Hi, Guest! Login / Register




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

[Development] How to decompile and recompile an Android application (apk) using Apktool in Windows

#1
(This post was last modified: 07-08-2017, 06:40 PM by hovatek. )

Apktool is a very handy tool for Modding apks.

Requirements


Steps to decompile or recompile an apk using Apktool


  1. After downloading apktool jar file, rename it from whatever to just apktool
  2. Copy both apktool.jar and apktool.bat to the same folder

    [Image: Hovatek-how-to-use-apktool-to-decompile-...-apk-1.jpg]

  3. Copy all .apk files you find in the /system/framework folder of your ROM and the apk you wish to mod to the same directory as apktool.jar and apktool.bat

    [Image: Hovatek-how-to-use-apktool-to-decompile-...-apk-2.jpg]

  4. Hold the Shift key (on your PC's keyboard), right-click any blank space in the folder and select Open command Windows here

    [Image: Hovatek-how-to-use-apktool-to-decompile-...-apk-3.jpg]

  5. apktool should now be open

    [Image: Hovatek-how-to-use-apktool-to-decompile-...-apk-4.jpg]

Installing necessary frameworks


  1. First, you need to install the necessary frameworks. In this example, its framework-res.apk & org.cyanogenmod.platform-res.apk . Yours could be different, more or fewer.

  2. To install the first framework in this example (framework-res.apk) type

    Code:
    apktool if framework-res.apk

    [Image: Hovatek-how-to-use-apktool-to-decompile-...-apk-5.jpg]

  3. Press Enter and wait till its done installing

    [Image: Hovatek-how-to-use-apktool-to-decompile-...-apk-6.jpg]

  4. To install the second framework in this example (org.cyanogenmod.platform-res.apk) type

    Code:
    apktool if org.cyanogenmod.platform-res.apk

    [Image: Hovatek-how-to-use-apktool-to-decompile-...-apk-7.jpg]

  5. Press Enter and wait till its done installing

    [Image: Hovatek-how-to-use-apktool-to-decompile-...-apk-8.jpg]

Decompiling the apk


  1. In this example, its Settings.apk

  2. To decompile Settings.apk , type

    Code:
    apktool d Settings.apk

    [Image: Hovatek-how-to-use-apktool-to-decompile-...-apk-9.jpg]

  3. Press Enter and wait till its decompiled

    [Image: Hovatek-how-to-use-apktool-to-decompile-...apk-10.jpg]

  4. You should now see the decompiled files in the Settings folder

    [Image: Hovatek-how-to-use-apktool-to-decompile-...apk-11.jpg]

Recompiling the apk


  1. To recompile the apk, type

    Code:
    apktool b -o NewSettings.apk Settings

  2. You can change "NewSettings" to whatever you want

    [Image: Hovatek-how-to-use-apktool-to-decompile-...apk-12.jpg]

  3. You should now find NewSettings.apk in the apktool folder

    [Image: Hovatek-how-to-use-apktool-to-decompile-...apk-13.jpg]

  4. Sign the apk using Zipsigner @ https://forum.hovatek.com/thread-15847.html




Attached Files
.zip   apktool batch file.zip (Size: 232 bytes / Downloads: 12)
Need further assistance? Speak with a Hovatek Representative:
Working Hours: Mondays - Saturdays ; 09:00 - 18:00 (GMT +1:00)
Reply










Users browsing this thread:
1 Guest(s)