Android code signing and obfuscation packaging

Source: Internet
Author: User

Research on the Android APK signature and code confusion packaging, if not confused packaging, then the APK can be directly compiled to see the source, confusing packaging although still can understand, but not so understood, at least a little time

if not confusing , the post-compilation code is as follows:

Basically is the source code.

if after confusion, post-compilation the code is as follows:

There are many names in the code such as a, B and C, so it is difficult to read them.


Let's start by saying the APK signature:

1.APK signature must first get a key, how to generate key? Then use the JDK to build.

The JDK must first be configured in the system environment variable. This is not much to say, this is the use of Java must be configured.

2. Generate KeyStore


Run cmd and then use the CD to enter C:\Program files\java\jdk1.6.0_10\bin> (that is, the location of your C-drive installation JDK) directory, and then enter Keytool-genkey-aliasAndroid . Keystore-keyalg rsa-validity 50000-keystoreandroid. KeyStore


Parameter meaning:-validity mainly is the validity of the certificate, write 50,000 days.


Red Android words can be casually changed to their own name.

The Android.keystore file is generated in the C:\Program files\java\jdk1.6.0_10\bin> directory after the command executes. Such as:





After you get the APK, you can pack and bring your own signature.

We need to add something to confuse the code before we pack it, and we won't be able to see the code properly after we pack and then decompile.

Obfuscation code is often simple, in the need to package the project to find project.properties this file, open and then add a sentence at the bottom of the OK, such as:

The low version of ADT is not written like this, the high version of this is OK, if the lower version is written proguard.config=proguard.cfg. But now generally do not use, are engaged in version, in the high version of this will be in the last step of packaging report error: The approximate content of the error is:

Invalid proguard configuration file path c:.../proguard.cfg dose not exist or was not regular file


You can sign and pack the APK after you add it.

Click on the file-"Export ..." in the Eclipse interface.











And then it's ready! Successful everywhere with the signature of the confusing code APK.



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.