Code debugging after Android obfuscation

Source: Internet
Author: User

Proguard output files and their usefulness

After the confusion, we will output some files, in the Gradle mode is under the <project_dir>/build/proguard/ directory, Ant is in the <project_dir>/bin/ Proguard directory, Eclipse is built in <project_dir>/proguard video.
Each of the following documents is available:
+ Dump.txt describes the internal structure between all the class files in the apk file.
+ Mapping.txt Lists the original classes, methods, and mappings between the field names and the code after the confusion.
+ Seeds.txt lists classes and members that are not confused
+ usage.txt lists the code removed from the APK

When the release version of our released program bug, you can use the above file (special time Mapping.txt) file to find the original location of the error, bug modification. At the same time, there may be errors at the beginning of the Proguard configuration, or through the error log, depending on the files, find which files should not be confused, thereby modifying the Proguard configuration.

Note: These files will be overwritten after the re-release is compiled, so it is best to keep a copy of the configuration file without having to eat the release program.

Debugging Proguard after confusing the program

The above said the output of several files, we can use when changing the bug, through the mapping.txt, through the mapping relationship to find corresponding classes, methods, fields and so on.

In addition, the Proguard file contains the retrace script, you can restore a confused stack trace information into a readable information, window Retrace.bat,linux and Mac is retrace.sh, in <sdk_root The >/tools/proguard/ folder. The syntax is:

retrace.bat|retrace.sh [-verbose] mapping.txt [<stacktrace_file>]

For example:

retrace.bat -verbose mapping.txt obfuscated_trace.txt

If you do not specify <stacktrace_file>, the retrace tool will read from the standard input.

Code debugging after Android obfuscation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.