Proguard Confusion Introduction
28.1ProGuard Introduction
Java source code (. java files) is typically compiled into bytecode (. class files). Typically, the compiled bytecode still contains a lot of debugging information: source file name, line number, field name, method name, parameter name, and variable name, which makes the app easy to decompile and reverse engineer to get complete program code.
Proguard is a free tool for compressing, optimizing, and confusing Java bytecode files:
You can delete useless classes, fields, methods, and properties.
You can delete unused annotations to maximize the optimization of bytecode files.
You can also rename a class, field, method, and property that already exists by using a short, meaningless name.
Often used for Android development to confuse the final project and increase the difficulty of the project being deserialized.
Proguard the following four-step processing of code in the Java class:
1 compression (Shrink): Used to detect and delete unused classes, fields, methods, and properties.
2 Optimization (Optimize): Byte code is optimized and useless instructions are removed.
3 Obfuscation (obfuscate): Rename classes, fields, and methods using meaningless names such as A,b,c.
4 preflight (Preveirfy): The processed code is pre-checked on the Java platform.