Android code encryption

Source: Internet
Author: User

Since I started android development, I feel that the code is easy to decompile some tools, such as my own commonly used dex2jar + jdgui and others, so next we will introduce our solutions for practical application.

1. for the code to be encrypted, I extracted the interface. For example, A Class A will implement the class interface IA, but the interface definition will be displayed in the program, instead, you will not see the code of the specific implementation class, because the code of the specific implementation class is dynamically loaded.

2. encryption implementation class. This step is mainly about the encryption implementation class. The process is like this. First export the jar package of the implementation class and then convert the format using the dx tool, then, use the encryption algorithm to encrypt the converted jar.

3. through jni decryption and loading class, this step is mainly to load the jar in the C/C ++ decryption program, and then load it through dexclassloader, of course, this step is implemented at the jni layer.

4. in this way, the entire jar package is loaded into android dalvikvm, so you can use reflection to call the corresponding class. Of course, performance can be read, but it is only a small amount of code, the entire code still needs to be obfuscated.

 

Welcome to shoot bricks ..

Related Article

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.