To do this, you need a root device:
Install the application on your device, and then remove apk from the device using:
- Connect your rooted Android device to your computer using the supplied USB cable.
- At the adb command prompt (usually
C:\android-sdk-windows\tools\ ) type adb shell and hit enter - Switch to root user, type
su and press enter - type "cd data / app" and press enter
- List all installed apk files, type
ls and press enter (find the one you want to extract) - In another command window, pull one of the files onto the computer by typing:
adb pull /data/app/application.apk name.apk and press enter
Once you have apk, rename it to whatever.zip and extract it as a zip file. Now you will see a bunch of folders. Now everything that is in the folder with your assets can be restored. For Java code, you should use dex2jar to convert classes.dex to a .jar file. After that, you can use the JD-GUI to read the code from the .jar file.
To extract AndroidManifest.xml and everything in the res folder (layout of xml files, images, etc.), you must use APKTool Run the following command:
apktool.bat d sampleApp.apk
It also extracts the .smali file of all .class files, but they are hard to read, and you should use the code from dex2jar instead.
source share