各類常見jar包混淆

android打包準備:混淆第三方jar包(Gson, greenDao,sharesdk,UIL,高德地圖, unity,pinyin4j,async http,JPush,EventBus等)

標籤: 產品androidjarsdkgsonjava

2014-11-14 11:46 6972人閱讀 評論(1) 收藏 舉報android

 分類:api

 

技術類(29) app

一、Gson混淆
## ----------------------------------
async

##   ########## Gson混淆    ##########google

## ----------------------------------url

-keepattributes Signaturespa

-keep class sun.misc.Unsafe { *; }.net

-keep class com.google.gson.examples.android.model.** { *; }3d

 

二、greenDao混淆
# # -------------------------------------------

# #  ######## greenDao混淆  ########## 

# # -------------------------------------------

-libraryjars libs/greendao-1.3.7.jar

-keep class de.greenrobot.dao.** {*;}

-keepclassmembers class * extends de.greenrobot.dao.AbstractDao {
    public static java.lang.String TABLENAME;
}
-keep class **$Properties

 

三、volley混淆 
# # -------------------------------------------

# #  ############### 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$* { *; }

 

四、sharesdk混淆
## ----------------------------------

##      sharesdk

## ----------------------------------

-keep class cn.sharesdk.**{*;}

-keep class com.sina.**{*;}

-keep class **.R$* {*;}

-keep class **.R{*;}

-dontwarn cn.sharesdk.**

-dontwarn **.R$*

 

五、UIL混淆
## ----------------------------------

##      UIL相關

## ----------------------------------

-keep class com.nostra13.universalimageloader.** { *; }

-keepclassmembers class com.nostra13.universalimageloader.** {*;}


六、高德地圖sdk混淆
## ----------------------------------

##      高德地圖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.**  {*;}


七、unity混淆(須要修改proguard.jar文件)
## ---------------------------------------------------------------

##      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)進行混淆配置。


八、內部類或者內部接口類的混淆配置
# # -------------------------------------------

# #  ######## 內部類混淆配置  ########## 

# # -------------------------------------------

-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$*{*;}


 

九、pinyin4j

-dontwarn net.soureceforge.pinyin4j.**

-dontwarn demo.**

-libraryjars libs/pinyin4j-2.5.0.jar

-keep class net.sourceforge.pinyin4j.** { *;}

-keep class demo.** { *;}

 

十、volley

-libraryjars libs/volley.jar

 

十一、async http

-libraryjars libs/android-async-http-1.4.5.jar

 

十二、JPush

-libraryjars libs/jpush-sdk-release1.6.3.jar

-dontwarn cn.jpush.**

-keep class cn.jpush.** { *; }

 

1三、EventBus

-libraryjars libs/eventbus-1.0.1.jar

-keepclassmembers class ** {

    public void onEvent*(**);

}

-keepclassmembers class ** {

public void xxxxxx(**); //全部監聽的方法都要列在這裏

}

 

1四、SlidingMenu

-dontwarn com.jeremyfeinstein.slidingmenu.lib.**

-keep class com.jeremyfeinstein.slidingmenu.lib.**{*;}

 

1五、ActionBarSherlock

-dontwarn com.actionbarsherlock.**

-keep class com.actionbarsherlock.**{*;}
 
1七、asmack-android-19-0.8.10.jar 聊天xmpp 第三方jar

-libraryjars libs/asmack-android-19-0.8.10.jar

-keep class com.kenai.jbosh.** {*; }-keep class com.novell.sasl.client.** {*; }-keep class de.measite.smack.** {*; }-keep class org.** {*; }/**若是項目用到jar的接口  此方不加,會有問題**/-keep interface com.kenai.jbosh.** {*; }-keep interface com.novell.sasl.client.** {*; }-keep interface de.measite.smack.** {*; }-keep interface org.** {*; }

相關文章
相關標籤/搜索