APK anti-compilation Everyone is familiar, here only to make a note.
1 Anti-compilation apk
Apktool D perfect.apk
This will extract the resource file, Classes.dex also decompile the Smali file.
2 Modify Smali File
Get the Smali file and you can now modify and add your own code to the Smali file.
Of course, you can further use Dex2jar processing to turn Dex into a Java class file, and then use Jd-jui and so on to decompile the Java code.
Now the APK is basically confused, but it is basic enough to understand the meaning of a careful reading.
Modify Smali is the test you smali the basis of the Assembly, this is the right to be born skillfully, read more practice, more simple than arm assembly.
3 repackaging
Apktool b Perfect
4 Re-signing
There is no signature information after repackaging, and a re-signing is required because the APK does not have a signature and cannot be installed.
Signature is also very simple with Jarsigner, Jarsigner and Keytool are actually the tools in the JDK, in the Java installation directory can be found, is to give the jar file signed
123456 123456 -signedjar perfect-hack-signed.apk perfect-hack.apk lesliekeystore
You can also use the default Debug key signature, Debug.keystore is generally located in the ~/.android directory
Jarsigner-verbose-keystore debug.keystore-storepass android-keypass android-signedjar perfect_signed.apk perfect.apk Androiddebugkey
If there is no keystore, you can use Keytool to generate a
123456 123456 -signedjar perfect-hack-signed.apk perfect-hack.apk lesliekeystore
This is the basis of the foundation, looking very simple, but in the Smali to inject a line of toast to the code or spent a day of time.
Android Reverse Basics: apk anti-compile repack re-signing