[Tutorial] Decompiling-Compiling-Editing APKs

Hello guys. I'm creating a thread with a simple tutorial of how to decompile, compile, edit apks. I've seen some threads about it, but all of them were very complicated to understand. It's a simple tutorial, not designed to really mess with apks, just to edit a bit, like swapping icons, images, etc. When I get some more time, I will also teach how to mess with some CM9 Theme Chooser APKs

First of all, what you are going to get with this?
1. Decompile APKs
2. Decompiling all files, so you will only get XML [easy to edit], images and SMALI files [in most cases]

You need to know...
1. Works only Windows [x86 or x64] [You can try on linux, but you will need to download other files of apktool. But the steps are almost the same]
2. Choose the .bat of your version. [x86 = 32 bits] [x64= 64 bits]
3. You need JRE
4. Attached, the most updated apktool.

Let's go...


STEP 1 - preparing

1. I've optimized the files to run at D:\apktool [Another partition]. So, extract the .7z, and make sure that there's a apktool folder at the ROOT of D:\ drive. If you want to put this folder at other place, please pay attention: open the Run [x??].bat on the notepad. If you want the folder at the C:\ drive, delete the "D:" line, and swap the directory to the one you choose. [Example: "C:\Users\....user name....\Desktop"] Just make sure you included the cd before the path. If you want the folder at other place on D:\ drive, just change the directory [Example: "D:\Desktop"], and again, with the "cd" command before the path.

STEP 2 - still preparing...

1. Get framework-res.apk from your ROM [if you are on a Samsung ROM, also get twframework]

2. Extract framework-res.apk here
3. Open the correct .bat of your Windows version

4. Run this command: "apktool if framework-res.apk" [if you are on a Samsung ROM, also do with the other framework]

STEP 3 - now decompiling

1. Now, put the apk you want to edit on your apktool folder.
2. Run this command: "apktool d APK-NAME.apk
3. You may get NO errors when it's done.
4. The out put folder is the folder of the decompiled apk.

STEP 4 - now compiling

1. Run this command: "apktool b APK-NAME" [without the .apk]
2. You may get NO errors when it's done.
3. The output APK is located on \[apktoolfolder]\APK-NAME\dist

STEP 5 - optimizing
1. Sign your APK with this
2. Zipalign your APK with this. You can also use zipalign scripts on your ROM to zipalign.
3. Now you may install your apk normally. [user app or system app]
__________________________________________________ __________________________________________________ ___________________________________________

TIPS
1. You can edit .smali files with Notepad ++
2. You can also edit XML files on the Notepad [Windows notepad. I think that with Notepad ++ also works]
3. Soon, I'm going to teach how to edit CM9 Theme Choose APKs. You will be able to: theme non-themed apps, and replace images.
4. I tried to be the most clear and direct as possible. If something is unclear, tell me now. If you have any suggestions to make the tutorial better, please tell me...via

Attached Files
File Type: 7z apktool r04+1.4.3.7z -  (3.81 MB, 65 views)

0 comments:

Post a Comment

Open Panel

Blogroll

counter