Sunday, February 28, 2016

[GUIDE] How to Decompile APKs with ODEX files [Noob Friendly]

When you have an system app with an odex file like bluetooth.apk and bluetooth.odex you can't use apktool for decompile and there is no need to deodex the whole ROM, follow this guide to decompile and mod one of these apps and nothing else.

NEED
- Be root
- Fastboot folder
- Files: baksmali.jar, smali.jar and zipalign.exe

Skip all this by downloading this folder

- Make a folder named "Baksmali" and place these files: baksmali.jar, smali.jar, zipaling.exe, the apk and her odex file
- Place the fastboot folder in C:/Baksmali and rename it to framework
- Make sure the files are named baksmali.jar and smali.jar for simplicity, not baksmali-somenumber.jar


DECOMPILE

- Conect your device to the PC
- Go to Backsmali/framework
- Right click + SHIFT on an empty space of the folder and select "open command window here" and input this command:

adb pull /system/framework

- Go to Baksmali folder
- Right click + SHIFT on an empty space of the folder and select "open command window here" and input this command (replace NAME with the name of your odex file):

java -jar baksmali.jar -d framework -x NAME.odex

- The files should be in the "out" folder now created

COMPILE
This way you can create a classes.dex file to later put in an apk so the apk is not more dependent of the odex file

- Again in Baksmali folder Right click + SHIFT and select "open command window here". Input
java -jar smali.jar -o classes.dex out

Now open the APK file with 7zip/winrar and drag the file classes.dex, confirm and exit.

Input this command:

zipalign -v 4 apk.apk new_apk.apk

apk: name of the apk we just added classes.dex file
new_apk: apk generated by zipaling, ready to use in the device

PLACE APP IN THE DEVICE

Rename the new_apk to the original name, and with a root explorer place it in system/app with permisions rw-r-r, remember deleting the odex file in that folder.
If when you open the app crashes always try rebooting

Attached Files
File Type: zip Baksmali.zip - [Click for QR Code] (3.16 MB)


via xda-developers http://ift.tt/1XTRQG7

IFTTT

Put the internet to work for you.

Turn off or edit this Recipe

No comments:

Post a Comment