Encrypt the android apk package and androidapk package
The body starts with the number.
Note: QQ Group No. 296733909
(Skip the Background introduction.) Developing android applications certainly inevitably requires writing java code. However, applications written in java are not secure. You can use android reverse assistants and other tools, it is easy to decompile the apk package and view the source code of the apk package, so there is a obfuscation tool to confuse java code. Even obfuscation is not safe. obfuscation makes your code hard to understand, but it is still understandable after all, and obfuscation is not so easy. You need to write files to ensure obfuscation, which do not need to be confused.
By understanding the principles of android, we can know that android will generate a classes. dex file after packaging, while the decompilation tool decompilers this file, so we only need to encrypt the file.
Love encryption is a good website. Passing the apk package will help you encrypt the apk package. Wait for about 1 minute to 5 days. If security detection is passed, you can encrypt it for you, download it, and decompile it with The Decompilation tool. You will find that the original dex file is missing, and an ijiami and dat file is added to the assets Directory, this file is actually the encrypted dex.
However, if you upload the package, you will always worry about something, right. In addition, it may take some time for the data to be encrypted. The data may be displayed the next day after the package is uploaded at night, and the data may be displayed on Monday after the package is uploaded at the weekend. In addition, you need to perform a security check on the uploaded package, in case your package...Well, let's encrypt it by ourselves.
(The text is coming)
I wrote an encryption method to encrypt the dex file. Let's try it.
The tool required for encryption is on the Baidu network disk. Address:Http://pan.baidu.com/s/1eQzssKE
1.Run your own project to generate the classes under the bin directory. copy dex to the tool directory in this folder (of course, You can decompress the apk package and retrieve the class. dex file for use)
2.Right-click to edit first. bat: Modify the directory where the dx command is located. The dx command is stored in android-sdk \ build-tools \ x. x. x \ (just change your path according to my path)
3.Run first. bat to generate a dex. jar file.
4.Run second. bat to generate a _ rf. dat file.
5.Open eclipse and import the androidEn project under this folder (this project is a project that I tested, and the dex in it is encrypted. You can run it to see the effect)
6.Replace the assets, res directory, and AnroidMainfest. xml files in your own project, merge the libs folder, and delete the jar reference package of the original project.
7.Put the generated _ rf. dat file under the assets Directory.
8.Modify the AnroidMainfest. xml file as follows:
<? Xml version = "1.0" encoding = "UTF-8"?>... <Application... android: name = "com. shell. appApplication "> <meta-data android: name =" TO_RUN_ACTIVITY "android: value =" android. app. application "/> <! -- The rows to be added for the preceding two actions, where com. shell. appApplication is the entry of the encrypted program. Do not change the value of TO_RUN_ACTIVITY to android by default. app. in general, you do not need to change the value of value if you have your own Application, such as com. example. of course, you can change the value of MyApplication to the value of the activity to be started, such as com. example. yourActivity --!> <Activity... </activity> </application>... </manifest>
9.Run the project and check the effect on your mobile phone.
10.If you have any questions about the above steps, the project cannot run, or you want to know the specific principle, you can add a QQ group (group number 296733909) and ask the relevant personnel to obtain the encrypted source code for self-study.
Principle Description: Uses dexclassloader to load dex files. Use C or C ++ to write dex file encryption and decryption, and use jni to write dexclassloader loading and running in C and C ++ code, which also involves reflection issues, for details, join the group (296733909.
Baidu keywords: dexclassloader, jni
(If you think it is good, please reprint it !!
Reprinted please indicate the source!)