Android Proguard simple learning

Source: Internet
Author: User


* Configure signature information
* Configure ProGuard to add ProGuard. config = proguard. cfg to proguard.

After the obfuscator is run, the output files are:
Dump.txt
The internal structure of all class files in the pai.apk package.
Mapping.txt
Lists the mappings between source code and obfuscated classes, methods, and attribute names. This file is useful for bug reports after construction, because it translates obfuscated stack trace information into classes, methods, and member names in the source code. For more information, view the decoded stack trace information.
Seeds.txt
List unobfuscated classes and members.
Usage.txt
Code extracted from .apk


# No optimization solution
-Dontoptimize
# Retain the signature to solve the generic problem
-Keepattributes Signature
-Dontskipnonpubliclibraryclassmembers
-Dontskipnonpubliclibraryclasses

# Third-party packages used in the project
-Libraryjars libs/android-support-v4.jar
# Do not confuse third-party packages
-Keep class android. support. v4 .**
# Exceptions caused by ignoring third-party packages
-Dontwarn android. support. v4 .**


--------------------------- The exception information is as follows [proguard] Note: there were 1 references to unknown classes.
[Proguard] You shocould check your configuration for typos.
[Proguard] Warning: there were 269 unresolved references to classes or interfaces.
[Proguard] You may need to specify additional library jars (using '-libraryjars '),
[Proguard] or perhaps the '-dontskipnonpubliclibraryclasses' option.
[Proguard] Warning: there were 57 unresolved references to program class members.
[Proguard] Your input classes appear to be inconsistent.
[Proguard] You may need to recompile them and try again.
[Proguard] Alternatively, you may have to specify the options
[Proguard] '-dontskipnonpubliclibraryclasses' and/or
[Proguard] '-dontskipnonpubliclibraryclassmembers '.

BUILD FAILED
D: \ android-sdk-windows \ tools \ ant \ build. xml: 736: Please correct the above warnings first.

References: Android tutorials
Official ProGuard website http://proguard.sourceforge.net/
Gson Packaging Problem http://blog.csdn.net/codingandroid/article/details/9495405



? How to handle Android imported packages? There are two types: third-party, and dynamic jar packages with source code. Do you need to set Obfuscation? Currently, no settings are required.



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.