Android打包较全的混淆


亲测有用

高德地图混淆

#3D 地图 V5.0.0之后:

-keepclass com.amap.api.maps.**{*;}

-keepclass com.autonavi.**{*;}

-keepclass com.amap.api.trace.**{*;}

-dontwarncom.amap.api.**

-dontwarncom.a.a.**

-dontwarncom.autonavi.**

-keepclass com.a.a.** {*;}

#定位

-keepclass com.amap.api.location.**{*;}

-keepclass com.amap.api.fence.**{*;}

-keepclass com.autonavi.aps.amapapi.model.**{*;}

##搜索

-keepclass com.amap.api.services.**{*;}

##导航

-keepclass com.amap.api.navi.**{*;}

-keepclass com.autonavi.**{*;}

注意:混淆打包记得更新高德地图的sh1要填发布版得,否则定位出错

相册选择galleryfinal

-keepclass cn.finalteam.galleryfinal.widget.*{*;}

-keepclass cn.finalteam.galleryfinal.widget.crop.*{*;}

-keepclass cn.finalteam.galleryfinal.widget.zoonview.*{*;}

这里我引用的是galleryfinal 相册选择

EventBus

#eventbus

-keepattributes*Annotation*

-keepclassmembersclass ** {

@org.greenrobot.eventbus.Subscribe ;

}

-keepenum org.greenrobot.eventbus.ThreadMode {*;}

# Only required if you use AsyncExecutor

-keepclassmembersclass * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {

(Java.lang.Throwable);

}

这个在github上没有,在官网的一个角落找到的

Butterknife

#butterknift

-keepclass butterknife.** {*;}

-dontwarnbutterknife.internal.**

-keepclass **$$ViewBinder {*;}

-keepclasseswithmembernamesclass * {

@butterknife.* ;

}

-keepclasseswithmembernamesclass * {

@butterknife.* ;

}

-dontwarnjavax.annotation.**

-dontwarnjavax.inject.**

okhttp3

-dontwarnokhttp3.logging.**

-keepclass okhttp3.internal.**{*;}

-dontwarnokio.**

Retrofit2

#-dontwarn retrofit2.**

#-keep class retrofit2.** { *; }

#-keepattributes Signature-keepattributes Exceptions

-dontwarnretrofit2.**

-keepclass retrofit2.** {*;}

-keepattributesSignature

-keepattributesExceptions

-keepclasseswithmembersclass * {

@retrofit2.http.* ;

}

 RxJava RxAndroid

-dontwarnsun.misc.**

-keepclassmembersclass rx.internal.util.unsafe.*ArrayQueue*Field* {

long producerIndex;

long consumerIndex;

}

-keepclassmembersclass rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {

rx.internal.util.atomic.LinkedQueueNode producerNode;

}

-keepclassmembersclass rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {

rx.internal.util.atomic.LinkedQueueNode consumerNode;

}

gson类不被混淆

-keepclass c.cc.going.bean.**{*;}

-keepclass c.cc.going.view.**{*;}

使用了Gson解析json,需要保持bean

保留Parcelable序列化类不被混淆

-keepclass * implements android.os.Parcelable {

public static final android.os.Parcelable$Creator *;

}

你可能感兴趣的:(Android打包较全的混淆)