Android program code obfuscation proguard script proguard. cfg

Source: Internet
Author: User

Android code obfuscation 1 proguard. cfg. This is the proguard script required for obfuscation. The Code is as follows: [java] view plain-optimizationpasses 5-dontusemixedcaseclassnames-dontskipnonpubliclibraryclasses-dontpreverify-verbose-optimizations! Code/simplification/arithmetic ,! Field /*,! Class/merging/*-keep public class * extends android. app. activity-keep public class * extends android. app. application-keep public class * extends android. app. service-keep public class * extends android. content. broadcastReceiver-keep public class * extends android. content. contentProvider-keep public class com. android. vending. licensing. ILicensingService-keepclasseswithmembernames class * {nati Ve <methods >;}- keepclasseswithmembernames class * {public <init> (android. content. context, android. util. attributeSet);}-keepclasseswithmembernames class * {public <init> (android. content. context, android. util. attributeSet, int);}-keepclassmembers enum * {public static ** [] values (); public static ** valueOf (java. lang. string);}-keep class * implements android. OS. parcelable {public static Final android. OS. Parcelable $ Creator *;} can be seen from the script. the obfuscation retains basic components such as Activity, Service, Application, BroadcastReceiver, and ContentProvider. All Native variable names and class names are retained. All classes Use constructors with fixed parameter formats, such as enumeration. (For more information, see examples and comments in <proguard_path>/examples .) 2. In the project's "default. in properties, add the phrase "proguard. config = proguard. the. APK behind the cfg package signature is confusing. In fact, we only need to do one step, that is, in the "default. in properties, add the phrase "proguard. config = proguard. cfg. Error: [INFO] Warning: there were 294 unresolved references to classes or interfaces. [INFO] You may need to specify additional library jars (using '-libraryjars '). [INFO] Warning: there were 3 unresolved references to program class members. you shoshould consider explicitly keeping the mentioned class members (using '-keep' or '-keepclassmembers '). [INFO] Your input classes appear to be inconsistent. [INF O] You may need to recompile them and try again. [INFO] Alternatively, you may have to specify the option [INFO] '-dontskipnonpubliclibraryclassmembers '. [INFO] java. io. IOException: Please correct the above warnings first. [INFO] at proguard.Initializer.exe cute (Initializer. java: 321) [INFO] at proguard. proGuard. initialize (ProGuard. java: 211) [INFO] at proguard.ProGuard.exe cute (ProGuard. java: 86) [INFO] at p Roguard. ProGuard. main (ProGuard. java: 492) solution: locate the solution and add-ignorewarnings to the proguard. cfg file to skip this error.

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.