Download ArticleDownload Article

This How.com.vn teaches you how to edit the contents of an APK file. To edit the files inside, you'll need to decompile (and then recompile) the package using APKtool on a computer.[1] Editing APK files requires knowledge of Java, as well as the file systems on both Windows and Android. This should only be done by advanced users.

Part 1
Part 1 of 3:

Installing APKTool

Download Article
  1. How.com.vn English: Step 1 Install Java Development...
  2. How.com.vn English: Step 2 Install Android SDK.
    You also need to install Android Software Development Kit (SDK) to decompile and recompile APK files. The easiest way to install Android SDK is to download and install Android Studio from here.
    Advertisement
  3. How.com.vn English: Step 3 Create a new folder on your desktop.
    This is the folder you will save the APKTool and your APK files to. Use the following steps to create a new folder:[2]
    • Right-click a black space on your desktop.
    • Select New' and then Folder'.
  4. Step 4 Rename the folder "APK".
    To rename a folder, right-click on the folder and click Rename. Then type APK to rename the folder.
  5. How.com.vn English: Step 5 Right-click this link...
    Right-click this link and click Save link as. This opens a file browser you can use to select a place to save the apktool.bat file to.
  6. How.com.vn English: Step 6 Navigate to the APK folder and click Save.
    Use the file browser to navigate to the APK folder you just created on your desktop. Open the folder and click Save. This saves the apktool.bat file to the APK folder.
  7. Step 7 Download the "apktool.jar" file.
    Use the following steps to download apktool.jar:
  8. Step 8 Rename the file "apktool.jar".
    The file you download likely has the version number in the file name. You can remove that by right-click the file and clicking Rename. Then simply type apktool as the file name. The full file name should be "apktool.jar". By default, your downloaded files can be found in your "Downloads" folder.
  9. How.com.vn English: Step 9 Copy apktool.jar to the APK folder.
    After you finished renaming the file, right-click it and click Copy or Cut. Then open the APK folder you created on your desktop and right-click inside. Click Paste. This will paste the "apktool.jar" file inside the APK folder.
  10. Advertisement
Part 2
Part 2 of 3:

Decompiling and Editing

Download Article
  1. How.com.vn English: Step 1 Copy the APK file to your APK folder.
    APK files are available to download from various websites. You can also retrieve an APK from your Android device by connecting it to your computer using a charging cable and unlocking the device. Navigate to the Downloads folder on the device and copy and paste an APK file into the APK folder on your Windows Desktop.
  2. How.com.vn English: Step 2 Open the Windows search bar and type cmd.
    The search bar is usually located to the right of the Start menu.
  3. How.com.vn English: Step 3 Command Prompt
    in the search results. It has an icon that resembles a black screen with a white cursor on it.
  4. How.com.vn English: Step 4 Navigate to the APK folder at the command prompt.
    You can open a folder inside of the command prompt by typing cd followed by the name of the folder. For example, if you are in the default "C:\Users\Username>" when you open the command prompt, you can open your desktop by typing cd desktop. If you copied the APK folder to your desktop, you could then open the APK folder by typing cd apk. It should say "C:\users\username\desktop\apk>" next to the prompt.[3]
    • If your APK folder is saved to another location, type cd \ next to the command prompt to return to the root "C:" drive. Then type cd followed by the full path of the APK folder.
  5. How.com.vn English: Step 5 Type apktool if  followed by the APK file name.
    This installs the framework for the app.
    • For example, if the name of your APK file is "my-first-game.apk" you would type apk if my-first-game.apk in the command prompt.
  6. How.com.vn English: Step 6 Type apktool d followed by the APK filename.
    This de-compiles the APK file. The contents of the APK file will be placed in a separate folder of the same name as the APK file in the APK folder. You can now edit the decompiled APK files. You may need some coding skills to edit certain files within the folder.
    • Following the same example above, you would type apktool d my-first-game.apk in the command prompt.
  7. Advertisement
Part 3
Part 3 of 3:

Recompiling the APK

Download Article
  1. How.com.vn English: Step 1 Open the Windows search bar and type cmd.
    The search bar is usually located to the right of the Start menu. After you finish editing the files within the APK file folder, you will need to recompile the folder back into an APK file.
  2. How.com.vn English: Step 2 Command Prompt
    in the search results. It has an icon that resembles a black screen with a white cursor on it.
  3. How.com.vn English: Step 3 Navigate to the APK folder at the command prompt.
    You can open a folder inside of the command prompt by typing cd followed by the name of the folder. For example, if you are in the default "C:\Users\Username>" when you open the command prompt, you can open your desktop by typing cd desktop. If you copied the APK folder to your desktop, you could then open the APK folder by typing cd apk. It should say "C:\users\username\desktop\apk>" next to the prompt.
    • If your APK folder is saved to another location, type cd\ next to the command prompt to return to the root "C:" drive. Then type cd followed by the full path of the APK folder.
  4. How.com.vn English: Step 4 Type apktool b followed by the folder name of the APK you want to recompile.
    This re-compiles the folder into an APK file. The newly compiled APK file can be found in the "dist" folder inside the decompiled APK folder that Apktool created.[4]
    • For example, if the app you are working on is called "my-first-game.apk", you would type apktool b my-first-game.apk in the command prompt.
  5. Step 5 Create a new folder called "Signapk" on your desktop.
    To create a new folder on your desktop, right-click anywhere on your desktop and click New. Then click Folder. Right-click the new folder and click Rename. Then type "Signapk" as the new folder name.
  6. Step 6 Copy the newly compiled APK into the "Signapk" folder.
    The newly compiled APK can be found in the "dist" folder of the uncompiled APK folder in "Apktool" folder. Right-click the APK and click Copy. Then, navigate back to the "Signapk" folder and paste the APK file inside the folder.
  7. How.com.vn English: Step 7 Click here to...
    Click here to download SignApk.zip. This downloads the SignApk file that is needed to sign an apk file.
  8. How.com.vn English: Step 8 Extract the contents of SignApk.zip into the Signapk folder.
    This extracts the "certificate.pem" file, the "key.pk8" file, and the "signapk.jar" into the "Signapk" folder.
  9. Step 9 Navigate to the "Signapk" folder in the command prompt.
    To navigate to the Signapk folder in the command prompt, type cd \ to return to the root directory. Then type cd followed by the full path of the Signapk folder directory.
    • If you created the Signapk folder on your desktop, the full path is most likely "C:\users\username\desktop\Signapk>"
  10. How.com.vn English: Step 10 Type java -jar signapk.jar certificate.pem key.pk8 [apkfilename].apk [apkfilename]-signed.apk in the command prompt.
    Replace "[apkfilename]" with the actual name of the apk file you want to sign. This creates a new signed APK file in the Signapk folder. Use this file to install the software on your Android system.[5]
    • For example, if the app you are working on is called "my-first-game.apk", you would type ava -jar signapk.jar certificate.pem key.pk8 my-first-game.apk my-first-game-signed.apk in the command prompt.
  11. Advertisement

Community Q&A

Search
Add New Question
  • Question
    When I publish the APK to the play store, it does not let me upload because of debugging. How do I fix this?
    How.com.vn English: Brandan Hepi
    Brandan Hepi
    Community Answer
    Did you resign the application with another key? Maybe you left the app in debugging mode when you recomplied.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Video

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!

      About This Article

      How.com.vn English: Travis Boylls
      Written by:
      How.com.vn Technology Writer
      This article was co-authored by How.com.vn staff writer, Travis Boylls. Travis Boylls is a Technology Writer and Editor for How.com.vn. Travis has experience writing technology-related articles, providing software customer service, and in graphic design. He specializes in Windows, macOS, Android, iOS, and Linux platforms. He studied graphic design at Pikes Peak Community College. This article has been viewed 201,844 times.
      How helpful is this?
      Co-authors: 15
      Updated: February 2, 2024
      Views: 201,844
      Categories: Software
      Article SummaryX

      1. Download and install Java Development Kit from https://www.oracle.com/technetwork/java/javase/downloads/index.html.
      2. Download and install Android Studio from https://developer.android.com/studio.
      3. Create a new folder on your Windows desktop called "APK".
      4. Search for apktool.bat on Google and save the file to the APK folder.
      5. Download apktool.jar from https://ibotpeaches.github.io/Apktool/ and save it to the APK folder.
      6. Place an apk file in the APK folder.
      7 Navigate to the APK folder in the Windows Command prompt.
      8. Type "apktool if" followed by the apk file name in the command prompt to install the apk framework.
      9. Type "apktool d" followed by the apk filename to decompile the apk file.
      10. Edit the files in the newly created folder in the APK folder.
      11. Type "apktool b" followed by the folder name of the decompiled apk folder to recompile the apk folder.
      12. Create a new folder on your Windows desktop called "Signapk".
      13. Copy the newly compiled apk from the "dist" folder in the decompiled apk folder to the newly created "Signapk" folder.
      14. Download Signapk.zip from https://forum.xda-developers.com/attachment.php?attachmentid=1846095&d=1364661948
      15. Extract the contents to the "Signapk folder.
      16. Navigate to the "Signapk" folder in the Command Prompt and type "java -jar signapk.jar certificate.pem key.pk8 [apkfilename].apk [apkfilename]-signed.apk" in the Command Prompt.

      Did this summary help you?

      Thanks to all authors for creating a page that has been read 201,844 times.

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement