from :http://www.cnblogs.com/dream-sky/archive/2012/11/15/2771648.html

stay project.properties Riga   proguard.config=proguard.cfg

proguard.cfg The configuration is as follows :

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

# Ignore the warning It can also be used. -ignorewarnings
-dontwarn

# Declaration of third party jar package , Don't worry about the third party jar In bag .so file ( If there is )
-libraryjars libs/tencent_openapi.jar
-libraryjars libs/httpmime-4.1.3.jar
-libraryjars libs/weibo.sdk.android.sso.jar
-libraryjars libs/android-support-v4.jar

-libraryjars  libs/AHibernate-1.1.jar
-libraryjars  libs/core.jar
-libraryjars  libs/gson-1.6.jar

-libraryjars  libs/android-support-v4.jar
-libraryjars  libs/baidumapapi_v2_1_2.jar
-libraryjars  libs/locSDK_3.1.jar
-libraryjars  libs/pinyin4j-2.5.0.jar

-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 * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService

-keepclasseswithmembernames class * {
native <methods>;
}

-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}

-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

# Don't confuse third parties jar The class in the package
-keep class com.baidu.mapapi.** {*;}
-keep class com.tencent.tauth.** {*;}
-keep class org.apache.http.entity.mime.** {*;}
-keep class android.support.v4.** {*;}
-keep class android.net.http.** {*;}
-keep class com.weibo.sdk.android.** {*;}
-keep class com.sina.sso.** {*;}

-keep interface net.sourceforge.pinyin4j.** { *; }
-keep interface vi.com.gdi.bgl.android.** { *; }
-keep interface cn.sharesdk.** { *; }

Explain , The third party jar If there is .so file , Don't worry , The third party introduced jar Don't confuse the documents , Otherwise, an exception may be reported

The project involves jar package :

The confusion in my own project

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify -dontwarn android.support.v4.**
-dontwarn com.baidu.mapapi.utils.*
-dontwarn com.baidu.platform.comapi.b.*
-dontwarn com.baidu.platform.comapi.map.
-dontwarn demo.**
-dontwarn org.scribe.services.** -libraryjars libs/AHibernate-1.1.jar
-libraryjars libs/core.jar
-libraryjars libs/gson-1.6.jar -libraryjars libs/android-support-v4.jar
-libraryjars libs/baidumapapi_v2_1_2.jar
-libraryjars libs/locSDK_3.1.jar
-libraryjars libs/pinyin4j-2.5.0.jar -keep class android.support.v4.** { *; }
-keep interface android.support.v4.** { *; }
-keep public class * extends net.sourceforge.pinyin4j.**
-keep public class * extends vi.com.gdi.bgl.android.**
-keep public class * extends android.support.v4.**
-keep public class * extends cn.sharesdk.**
-keep public class * extends com.baidu.**
-keep public class * extends demo.**
-keep class net.sourceforge.pinyin4j.** {*;}
-keep class vi.com.gdi.bgl.android.** {*; }
-keep class cn.sharesdk.** {*;}
-keep class com.baidu.** {*;}
-keep class demo.** {*;} -keep interface net.sourceforge.pinyin4j.** { *; }
-keep interface vi.com.gdi.bgl.android.** { *; }
-keep interface cn.sharesdk.** { *; }
-keep interface com.baidu.** { *; }
-keep interface demo.** { *; }
-keepattributes *Annotation* ##---------------Begin: proguard configuration for Gson ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature
# Gson specific classes
-keep class sun.misc.Unsafe { *; }
#-keep class com.google.gson.stream.** { *; }
# Application classes that will be serialized/deserialized over Gson
##---------------End: proguard configuration for Gson ---------- -verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* -keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService -keepclasseswithmembernames class * {
native <methods>;
} -keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
} -keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
} -keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
} -keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
} -keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

of android Security issues -- More articles on code obfuscation

  1. Talking about Android Protection Technology __ Code obfuscation

    Talking about Android Protection Technology __ Code obfuscation   Code obfuscation Code obfuscation (Obfuscated code) It's also called flower instruction , Is the code of the computer program , To a functional equivalence , But forms of behavior that are difficult to read and understand . Put the various elements in the code ...

  2. Android Studio Code obfuscation in environment + The signature is packaged

    Android Studio Code obfuscation in environment + The signature is packaged author  Mr_ Mr. Feng   Focus on 2016.08.21 01:10  Number of words 1040  read 734 Comment on 5 like 34 notes : This article uses Android Stud ...

  3. Cordova Android Project how to do code obfuscation

    I want to change build.gradle To configure But this document clearly says // GENERATED FILE! DO NOT EDIT! But I tried : if (cdvReleaseSigningProperties ...

  4. Android Studio( 11、 ... and ): Code obfuscation and packaging apk

    Android Studio Related blog : Android Studio( One ): Introduce . install . To configure Android Studio( Two ): Shortcut key settings . Plug in installation Android Studio( 3、 ... and ): Set up Andr ...

  5. 【 turn 】Android Code confusion under programming

    What is code obfuscation Code obfuscation (Obfuscated code) It's also called flower instruction , Is the code of the computer program , To a functional equivalence , But forms of behavior that are difficult to read and understand . Code obfuscation can be used for program source code , It can also be used in programs compiled from ...

  6. Android Code confusion under programming

    What is code obfuscation Java It's a cross platform . Explanatory language ,Java Source code compiled into intermediate ” Bytecode ” Store in class In file . Due to the need of cross platform ,Java Bytecode includes a lot of source code information , Such as variable name . Method name , And through ...

  7. Android 4.0 ProGuard Code obfuscation as well as proguard returned with error code 1.See console Solutions to exceptions

    Recently, I'm going to go online , I went to find a way to go online ... I've done code obfuscation before , It's using progarud.cfg, But after decompiled, it is still invalid , And then I just leave it alone , Because I really don't know what's going on . When I go online today, I always report an error , total ...

  8. Android Code confusion under programming (android-support-v4.jar)

    term If you refer to a third party in the process of code obfuscation Jar package , You need to add a third party to the confusing script file Jar Declaration of the package . Some third parties Jar Although the package is declared in the obfuscation script , But in the process of confusion, we often find internal classes or reference files ...

  9. Android studio The signature is confused with the code

    Signature : Application upgrade : Application modularization : Code or data sharing confusion : The obfuscator takes all variables in the code . function . The name of the class becomes a short alphabetic code , It's hard to decompile code after confusion , Even if the decompilation is successful, it is difficult to get the true semantics of the program .

Random recommendation

  1. nexenta systemcallerror

    I've been trying nexenta do iscsi, Set up ip The above error appears terms of settlement , Let's talk first. mtu Set to not week with the original value , For example, it used to be 1500, Set it to 1501, That's all right. , And then you can change it back , There is no problem !

  2. lua Stack operation commonly used function learning 2

    /* ** basic stack manipulation */ LUA_API int  <strong> (lua_gettop) (lua_State *L);  </str ...

  3. common MIME type

    Hypertext markup language text .htm,.html text/html Plain text .txt text/plain GIF graphics .gif image/gif JPEG graphics .ipeg,.jpg image/jpe ...

  4. MYSQL A way to query a comma separated string in a field

    First, we create a comma separated string . CREATE TABLE test(id int(6) NOT NULL AUTO_INCREMENT,PRIMARY KEY (id),pname VARCH ...

  5. Application TWaver 3D Vector graphics processing capabilities

    You bet , mention TWaver, The first thing that comes to mind is " Telecom topology component ". in fact . Because it's flexible MVC framework . Vector design . Easy to customize and so on .TWaver There's a lot more that can be done . For example, it is common in the real estate industry &qu ...

  6. Hand in hand, you build vue Environmental Science

    First step node Environmental installation 1.1 If this machine is not installed node Running environment , Please download node Installation package for installation 1.2 If the machine is already installed node The operation of , Please update to the latest node Version download address :https://nod ...

  7. python It's the foundation of ( Two )

    The last stage , We have learned python The type of data . What about today , Let's learn all kinds of operators . One . Basic operators a = 10    b = 20 Operation symbol describe Example + Add —— Add two objects a+b Output ...

  8. Python introduction ( One ) data type 、 Loop statement

    Scripting language types : 1. Compiler language : The code cannot be executed after writing , You need to compile      eg:c.c++.c# 2. Interpretive language : No compilation required Direct execution                       eg:python.jav ...

  9. One 、python Basic grammatical elements ( Temperature conversion )

    #C=(F-32)/1.8 ; F = C * 1.8 + 32 TempStr = input(" Please enter the temperature value with symbol :") if TempStr[-1] in ['f','F ...

  10. springboot+mybatis Implement login function , return json

    1. newly build maven project (pom) <?xml version="1.0" encoding="UTF-8"?> <project xmlns= ...