Android Reverse Basics: apk anti-compile repack re-signing

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.