Anti-compilation, mainly use two kinds of tools, one is to get the APK package name (apppackage) and class name (appactivity) tool, in fact, is to decompile the Java source code, Dex2jar and Jd-gui One is to add an APK package decompile and then add their own signature, modify some parameters, so that it better for the apptoools of automated testing, the following is a brief introduction to the use of these two tools:
First, Dex2jar and Jd-gui
1, download apk, modify the apk suffix named zip and unzip the zip file;
2. Open the folder to find the Classes.dex file, and copy it to the Dex2jar folder, execute the dex2jar.bat classes.dex command in the cmd command line, get the Classes_dex2jar.jar file;
3, open Jd-gui, select Open file to find the Classes_dex2jar.jar, you can get the package name and class name
Second, Apptool
Anti-compile command: apptool.bat-d-o e:/test/test.apk decompile test.apk file to e:test directory
Back to compile command: apptool.bat-b-o e:/test/test1.apk back to compile e:/test directory under file for test1.apk
After the anti-compilation is based on smaile modify the underlying source code
Res is the APK related resources, after repackaging the signature or original, for automation is not possible, so also need to re-sign.
Third, re-signing
1. Generate a signature file yourself with Eclipse Debug.keystore
You can also generate a signature yourself, with the following command: Keytool-genkey-v-keystore debug.keystore-alias androiddebugkey-keyalg rsa-validity 10000
2, follow the two, and then delete the manifest folder;
3. Re-sign:
Jarsigner-verbose-keystore%keystore_name%-storepass%keystore_storepass%%temp_prefix%%%i%KEYSTORE_ALIAS%- Keypass%keystore_keypass%-digestalg sha1-sigalg Md5withrsa
Iv. Other
View thin Information Apkhelper
View signature information Keytool-list-v-keystore apkname
[APP] If you want to decompile