1.Gson混淆
1
2
3
4
5
6
|
## ----------------------------------
## ########## Gson混淆 ##########
## ----------------------------------
-keepattributes Signature
-keep
class
sun.misc.Unsafe { *; }
-keep
class
com.google.gson.examples.android.model.** { *; }
|
2.greenDao混淆
1
2
3
4
5
6
7
8
|
# # -------------------------------------------
# # ######## greenDao混淆 ##########
# # -------------------------------------------
-keep
class
com.manjay.housebox.greendao.** {*;}
-keepclassmembers
class
*
extends
de.greenrobot.dao.AbstractDao {
public
static
java.lang.String TABLENAME;
}
-keep
class
**$Properties
|
3.volley混淆
1
2
3
4
5
6
7
8
9
10
|
# # -------------------------------------------
# # ############### volley混淆 ###############
# # -------------------------------------------
-keep
class
com.android.volley.** {*;}
-keep
class
com.android.volley.toolbox.** {*;}
-keep
class
com.android.volley.Response$* { *; }
-keep
class
com.android.volley.Request$* { *; }
-keep
class
com.android.volley.RequestQueue$* { *; }
-keep
class
com.android.volley.toolbox.HurlStack$* { *; }
-keep
class
com.android.volley.toolbox.ImageLoader$* { *; }
|
4.sharesdk混淆
1
2
3
4
5
6
7
8
9
|
## ----------------------------------
## sharesdk
## ----------------------------------
-keep
class
cn.sharesdk.**{*;}
-keep
class
com.sina.**{*;}
-keep
class
**.R$* {*;}
-keep
class
**.R{*;}
-dontwarn cn.sharesdk.**
-dontwarn **.R$*
|
5.UIL混淆
1
2
3
4
5
|
## ----------------------------------
## UIL相关
## ----------------------------------
-keep
class
com.nostra13.universalimageloader.** { *; }
-keepclassmembers
class
com.nostra13.universalimageloader.** {*;}
|
6.高德地图sdk混淆
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
## ----------------------------------
## 高德地图sdk混淆
## ----------------------------------
-libraryjars libs/android-support-v4.jar
-dontwarn android.support.v4.**
-keep
class
android.support.v4.** { *; }
-keep
interface
android.support.v4.app.** { *; }
-keep
public
class
*
extends
android.support.v4.**
-keep
public
class
*
extends
android.app.Fragment
-libraryjars libs/MapApiLocation.jar
-libraryjars libs/MapApiSearch.jar
-libraryjars libs/Android_Map_V2.
0.4
.jar
-dontwarn com.amap.api.**
-dontwarn com.a.a.**
-dontwarn com.autonavi.**
-keep
class
com.amap.api.** {*;}
-keep
class
com.autonavi.** {*;}
-keep
class
com.a.a.** {*;}
|
7.unity混淆(需要修改proguard.jar文件)
1
2
3
4
5
6
7
8
9
10
|
## ---------------------------------------------------------------
## unity混淆(需要修改proguard.jar文件)
## ---------------------------------------------------------------
-libraryjars f:/work_hb_v021/Lib_SocShare_v237_0804/libs/untiy-classes.jar
-dontwarn com.unity3d.player.**
-dontwarn org.fmod.**
-keep
class
com.unity3d.player.**{*;}
-keep
class
org.fmod.**{*;}
-keep
public
class
*
extends
com.unity3d.player.**
-keep
public
class
*
extends
org.fmod.**
|
注:还需要对与unity交互的相关方法或者类(jni)进行混淆配置。
8.内部类或者内部接口类的混淆配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
# # -------------------------------------------
# # ######## 内部类混淆配置 ##########
# # -------------------------------------------
-keep
class
com.manjay.housebox.activity.CityListActivity$*{
<fields>;
<methods>;
}
-keepclassmembers
class
com.manjay.housebox.activity.CityListActivity$*{*;}
-keep
class
com.manjay.housebox.map.MapActivity$*{
<fields>;
<methods>;
}
-keepclassmembers
class
com.manjay.housebox.map.MapActivity$*{*;}
|
本文转自 glblong 51CTO博客,原文链接:http://blog.51cto.com/glblong/1435959,如需转载请自行联系原作者