Preface
This chapter describes the developer Guide/Developing/Tools/ProGuard. This chapter describes the obfuscators and version Android3.0 r1 ", welcome to talk with him: "litaojun@gmail.com", thank you again "Jim "! We look forward to your participation in translation of Android related information, contact me over140@gmail.com.
Original
Http://developer.android.com/guide/developing/tools/proguard.html
Obfuscators(ProGuard)
In this article(In this document)
Enabling ProGuard
Logging ing ProGuard
Decoding Obfuscated Stack Traces
Debugging considerations for published applications
See
ProGuard Manual»
ProGuard ReTrace Manual»
Obfuscators compress, optimize, and confuse code by deleting unused code and renaming classes, fields, and methods with obscure names. The result is relatively small.. ApkFile, which is difficult to reverse engineering. Therefore, when your application is sensitive to security (high requirements), such as when youHtml ">Authorize an applicationObfuscator is an important protection method.
Obfuscators are integrated inAndroidBuilding the system, so you do not have to call it manually. At the same time, obfuscators run only when building applications in release mode, so you do not have to deal with obfuscation code when building a program in debug mode. It is optional for the obfuscator to run, but it is recommended.
This document describes how to enable and configure obfuscators and how to use tracking (Retrace) Tool trace information on obfuscation stacks (Stack traces.
Enable obfuscatorsEnabling ProGuard
When you create a newAndroidAfter the projectProguard. cfgFiles are automatically created under the root directory of the project. This file defines how obfuscators optimize and confuse your code, so it is very important to know how to customize according to your needs. The default configuration file only covers the general situation, so you may need to edit it as needed. The following content is about how to customize the obfuscator configuration fileObfuscator Configuration.
To enable obfuscatorsAntOrEclipsePart of the build process can be found in<Project_root>/default. propertiesFile, SetProguard. configAttribute. The path can be an absolute path or a relative path of the Project root directory.
If you wantProguard. cfgThe file is in the default location (the root directory of the Project). You can specify the location as follows:
Proguard. config = proguard. cfg
Similarly, you can place the file in any location and specify its absolute path.
Proguard. config =/path/to/proguard. cfg
When you are in release mode, or by runningAnt release, Or by usingEclipseInExport WizardWhen building your application, the build system will automatically checkProguard. configWhether the attribute is set. If it is set, the obfuscator is packaging everything. ApkBefore the file, the application bytecode is automatically obfuscated. In the debugging mode, obfuscators are not called, because the debugging will be heavier.
After the obfuscator is run, the output files are:
Dump.txt
Description. ApkAllClassThe internal structure of the file.
Mapping.txt