Method/Step 1 "Android APP secondary packaging" is to pirate the regular Android APP, crack it, implant malicious code and repackage it. It is exactly the same as a regular APP in terms of performance, user experience, and appearance, but it does run terrible programs quietly behind the scenes. It will unknowingly waste mobile phone power and traffic, maliciously charge fees, peek at privacy, and other behaviors. How to encrypt Android APP to prevent secondary packaging? 2. Many Android developers have their own preventive measures in the face of repackaging. APPs from well-known companies have almost all done their own processing within the program to prevent their APPs from being repackaged. Once packaged and re-run, the program will automatically exit. Next, let’s explain in detail how to encrypt Android APP to prevent secondary packaging. 3. To prevent Android APP from being repackaged within the code, you must first understand the machine identification principle of APK. The unique identification of APK relies on the package name and signature for authentication. Security software such as Peaclip, 360 Mobile Guard, etc. For copycat identification, they rely on the package name to determine the APK and then use the signature to determine whether it is a copycat. Therefore, when your own program is started, you can identify whether it has been repackaged by obtaining the signature of the APK itself and comparing it with the correct signature. How to encrypt Android APP to prevent secondary packaging? 4The signature of the APK itself can be obtained through the PackageManag object. 5. By decomposing the signature code, a string of about 20 is obtained. This string is the MD5 value of the APK signature. By comparing the obtained signature MD5 value with the correct MD5 value, you can identify whether the APK has been Piracy. How to encrypt Android APP to prevent secondary packaging? END method/step 21 The picture below is an analysis of code blocks of some protected APPs: How to encrypt Android APP to prevent secondary packaging? (1) "XX Power Saving King"'s key code to prevent secondary packaging 2 (2) "XX Battery Manager"'s key code to prevent secondary packaging 3 The above two are codes of the smali layer, and the above two codes are The screenshots are all processed by apps with very high download volume to prevent secondary packaging. The key code that will definitely be used in the processing code is how to encrypt Android APP to prevent secondary packaging? Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature. This method can play a certain security role, and ordinary packaging parties are helpless when faced with it. If you understand some smali syntax, its effect will be zero.