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 ..