Guide to decompiling Android App to source code: Difference between revisions
(Created page with 'Category:English pages Category:Mobiltelefoni Category:Android Category:Software development <google>ENGELSK</google> ==Howto: Extract APK into readable Java sour…') |
No edit summary |
||
Line 38: | Line 38: | ||
## Select File-Save All Sources to save sourcecode | ## Select File-Save All Sources to save sourcecode | ||
====Apk Manager Plus | ==Tools== | ||
===Apk Manager Plus=== | |||
[[File:Apk Manager Plus.jpg|55px|right]] | [[File:Apk Manager Plus.jpg|55px|right]] | ||
Apk Manager Plus can backup .apk files from apps installed on your phone or tablet to the SD card.<br> | Apk Manager Plus can backup .apk files from apps installed on your phone or tablet to the SD card.<br> | ||
Line 44: | Line 45: | ||
* [https://play.google.com/store/apps/details?id=com.magmamobile.apkmanager.plus Apk Manager Plus] | * [https://play.google.com/store/apps/details?id=com.magmamobile.apkmanager.plus Apk Manager Plus] | ||
===APK-Multi-Tool=== | |||
;APK-Multi-Tool contains: | ;APK-Multi-Tool contains: | ||
[[File:APK.png|right]] | [[File:APK.png|right]] | ||
Line 58: | Line 59: | ||
* [https://github.com/APK-Multi-Tool/APK-Multi-Tool APK-Multi-Tool from GitHub] | * [https://github.com/APK-Multi-Tool/APK-Multi-Tool APK-Multi-Tool from GitHub] | ||
===dex2jar=== | |||
Use dex2jar to translate .dex to .jar file then use JD-GUI to open the .jar file and view the .class files in the project. | Use dex2jar to translate .dex to .jar file then use JD-GUI to open the .jar file and view the .class files in the project. | ||
* [http://code.google.com/p/dex2jar/ dex2jar - Translates dex to jar file] | * [http://code.google.com/p/dex2jar/ dex2jar - Translates dex to jar file] | ||
Line 64: | Line 65: | ||
* [https://code.google.com/p/android-apktool/wiki/ApktoolOptions Apktool options] | * [https://code.google.com/p/android-apktool/wiki/ApktoolOptions Apktool options] | ||
===JD-GUI=== | |||
[[File:JD-GUI.png|right]] | [[File:JD-GUI.png|right]] | ||
JD-GUI is a standalone graphical utility that displays Java source codes of “.class” files. You can browse the reconstructed source code with the JD-GUI for instant access to methods and fields. | JD-GUI is a standalone graphical utility that displays Java source codes of “.class” files. You can browse the reconstructed source code with the JD-GUI for instant access to methods and fields. | ||
* [http://jd.benow.ca/ Java Decompiler JD-GUI] | * [http://jd.benow.ca/ Java Decompiler JD-GUI] | ||
==Other interesting links== | |||
* [http://blogmal.42.org/rev-eng/patching-android-apps.story patching-android-apps] | * [http://blogmal.42.org/rev-eng/patching-android-apps.story patching-android-apps] | ||
<google>ENGELSK</google> | <google>ENGELSK</google> |
Revision as of 09:04, 15 March 2014
<google>ENGELSK</google>
Howto: Extract APK into readable Java source code and XML files
Setup
- Install Apk Manager Plus on your Android device.
- Download APK-Multi-Tool and extract the files into a folder on your harddisk. There must be no spaces in the directory path.
- Install 'Java SE Development Kit 7'.
- Edit the environtment variable 'JAVA_HOME' to point to 'C:\Program Files\Java\jdk1.7.0_51' or wherever you installed the Java Development Kit.
- Run Setup.bat
- Select step 2. 'Installing Framework-Res'.
- Connect your phone to the PC via USB.
- 9. Pull Dependencies from Phone
- 10. Return to Main Menu
- Select step 3. 'Setup Directories'.
- Select step 2. 'Installing Framework-Res'.
- Download dex2jar and extract it to wherever you want it installed.
- Download JD-GUI and extract it to wherever you want it installed.
Note: If step 2. 'Installing Framework-Res' fails it mighe be caused by a bug in APK-Multi-Tool\other\apkinstall.bat. To fix it replace:
- (Y) with [Y]
- (N) with (N)
- (y) with [y]
- (y) with (y)
- and (%INPUT%) with [%INPUT%]
Decompile .APK file
- Start 'Apk Manager Plus' on your Android device and export an App to the SD card
- Copy the <app>.apk to APK-Multi-Tool\place-apk-here-for-modding
- Run Script.bat
- Select 9. Decompile apk
- Decompiled apk is now in APK-Multi-Tool\projects (as smali files)
- Run C:\<path to dex2jar>\d2j-dex2jar <app>.apk
- <app> is now in <app>_dex2jar.jar
- Run C:\<path to jd-gui<\jd-gui.exe
- Select File-Save All Sources to save sourcecode
Tools
Apk Manager Plus
Apk Manager Plus can backup .apk files from apps installed on your phone or tablet to the SD card.
Afterwards you can use the USB cable to transfer them to a PC.
APK-Multi-Tool
- APK-Multi-Tool contains
- android-apktool
- A tool for reengineering 3rd party, closed, binary Android apps. It can decode resources to nearly original form and rebuild them after making some modifications.
- smali / backsmali
- assembler/disassembler for Android's dex format
- and a lot of other tools, and has build a menu system around all the tools.
To download APK-Multi-Tool Tool (includes android-apktool):
or clone Git repository from here:
dex2jar
Use dex2jar to translate .dex to .jar file then use JD-GUI to open the .jar file and view the .class files in the project.
usage: C:\path\d2j-dex2jar [options] <file0> [file1 ... fileN]
JD-GUI
JD-GUI is a standalone graphical utility that displays Java source codes of “.class” files. You can browse the reconstructed source code with the JD-GUI for instant access to methods and fields.
Other interesting links
<google>ENGELSK</google>