Objective:
Personal interest, want to self-develop an Android demo anti-compilation Look, do a record.
Tools:
Apktool: Obtain the resource file, extract the file under the Res path for viewing;
Dex2jar: Decompile The APK to Java source (that is, the Classes.dex file is converted back to the jar file);
Jd-gui: Anti-compilation Dex2jar The back-compiled jar file, view the source code.
Baidu Network Disk:
Link: https://pan.baidu.com/s/1655YcbCY5VBCtdyiKiM8Jg Password: T1JF
Environment:
Win10
OK, here's the anti-compilation process:
Retrieving resource files with Apktool decompile
Unzip the downloaded Apktool.rar file and put the APK file you need to compile into this directory, (demo01 is the file I need to decompile):
Under command line, navigate to the directory, enter the command:apktool.bat d-f demo01.apk demo01, as shown in:
Where demo01.apk is the name of the file that needs to be deserialized, demo01 the path to the post-compilation resource file, which holds all the resource files for the application, as shown in:
Get Java source code using Dex2jar and Gd-gui decompile
First, unzip the Dex2jar and Gd-gui and the two tools, then rename the apk file that needs to be recompiled to a. rar file or a. zip file, unzip it and get a Classes.dex file ( This file is compiled by the Java file and then packaged with the DX tool), the obtained Classes.dex file is placed in the previously extracted files Dex2jar tool , input command:d2j-dex2jar.bat Classes.dex, as shown in:
At this point, a Classes-dex2jar.jai file is generated under the path, and the file is opened with the Jd-gui.exe in Gd-gui to see the source code, as shown in.
Android APK Anti-compilation