Gradle 构建过程中 so 文件冲突的解决
前一篇里就说到了,要给至少一年前就没动过代码的 IG 解决个 […]
前一篇里就说到了,要给至少一年前就没动过代码的 IG 解决个 […]
历时一个多月,把上架被拒的 XIC 代码快翻烂了,终于重构出 […]
Waydroid 下运行 app,时不时内容显示就会自动旋转 […]
去年的时候,在 XSC 中要加入开屏广告,开始计划从 XIC […]
Google 在今年初在欧盟区需要执行新的数据隐私政策,继而 […]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 |
#------------------------------基础配置,通用配置,不要修改------------------------------ #==================== 代码混淆压缩比,在 0~7 之间 -optimizationpasses 5 #==================== 修改包名 -repackageclass "" #==================== 忽略访问修饰符,配合上一句使用 -allowaccessmodification #==================== 抛出异常时保留代码行号 -keepattributes SourceFile,LineNumberTable #==================== 不做预校验,preverify 是 proguard 的四个步骤之一,Android 不需要 preverify,去掉这一步能够加快混淆速度 -dontpreverify -verbose #==================== google 推荐算法 -optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/* #==================== 避免混淆 Annotation、内部类、泛型、匿名类 -keepattributes *Annotation*,InnerClasses,Signature,EnclosingMethod #==================== 保留四大组件,自定义的 Application 等这些类不被混淆 -keep public class * extends android.app.Activity -keep public class * extends android.app.Appliction -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.preference.Preference -keep public class com.android.vending.licensing.ILicensingService -keep public class * extends android.view.View #==================== support 包 -dontwarn android.support.** -keep class android.support.** {*;} -keep interface android.support.**{*;} #==================== databinding 包 -dontwarn android.databinding.** -keep class android.databinding.** {*;} #==================== 自定义 view 的 set/get 方法和构造方法 -keep public class * extends android.view.View { *** get*(); void set*(***); public <init>(android.content.Context); public <init>(android.content.Context, android.util.AttributeSet); public <init>(android.content.Context, android.util.AttributeSet, int); } #==================== 避免资源混淆 -keep class **.R$* {*;} #==================== 避免 layout 中 onclick 方法(android:onclick="onClick")混淆 -keepclassmembers class * extends android.app.Activity { public void *(android.view.View); } #==================== 避免回调函数 onXxxEvent 混淆 -keepclassmembers class * { void *(*Event); } #==================== 避免混淆枚举类 -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } #==================== Natvie 方法不混淆 -keepclasseswithmembernames class * { native <methods>; } #==================== 避免 Parcelable 混淆 -keep class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; } #==================== 避免 Serializable 接口的子类中指定的某些成员变量和方法混淆 -keepclassmembers class * implements java.io.Serializable { static final long serialVersionUID; private static final java.io.ObjectStreamField[] serialPersistentFields; !static !transient <fields>; private void writeObject(java.io.ObjectOutputStream); private void readObject(java.io.ObjectInputStream); java.lang.Object writeReplace(); java.lang.Object readResolve(); } #==================== 关闭 Log 日志 -assumenosideeffects class android.util.Log { public static *** d(...); public static *** v(...); public static *** i(...); public static *** e(...); public static *** w(...); } #==================== 保留 Keep 注解的类名和方法 -keep,allowobfuscation @interface android.support.annotation.Keep -keep @android.support.annotation.Keep class * -keepclassmembers class * { @android.support.annotation.Keep *; } #==================== WebView 混淆配置 -keepclassmembers class fqcn.of.javascript.interface.for.webview { public *; } -keepclassmembers class * extends android.webkit.webViewClient { public void *(android.webkit.WebView, java.lang.String, android.graphics.Bitmap); public boolean *(android.webkit.WebView, java.lang.String); } -keepclassmembers class * extends android.webkit.webViewClient { public void *(android.webkit.webView, jav.lang.String); } #------------------------------ 第三方库混淆(可以自行增加)------------------------------ #==================== RxJava、RxAndroid 混淆配置 -dontwarn rx.* -dontwarn sun.misc.** -keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* { long producerIndex; long consumerIndex; } -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef { rx.internal.util.atomic.LinkedQueueNode producerNode; } -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef { rx.internal.util.atomic.LinkedQueueNode consumerNode; } #==================== Okio -dontwarn com.squareup.** -dontwarn okio.** -keep public class org.codehaus.* { *; } -keep public class java.nio.* { *; } #==================== OkHttp3 混淆配置 -dontwarn com.squareup.okhttp3.** -keep class com.squareup.okhttp3.** { *;} -dontwarn okio.** #==================== Retrofit2 混淆配置 -dontwarn retrofit2.** -keep class retrofit2.** { *; } -keepattributes Signature -keepattributes Exceptions #==================== nineoldandroids -keep public class com.nineoldandroids.** {*;} #==================== Glide 混淆配置 -keep public class * implements com.bumptech.glide.module.GlideModule -keep public class * extends com.bumptech.glide.module.AppGlideModule -keep public enum com.bumptech.glide.load.ImageHeaderParser$** { **[] $VALUES; public *; } #==================== Picasso 混淆配置 -keep class com.parse.*{ *; } -dontwarn com.parse.** -dontwarn com.squareup.picasso.** #==================== Fresco 混淆配置 # Keep our interfaces so they can be used by other ProGuard rules. # See http://sourceforge.net/p/proguard/bugs/466/ -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip -keep,allowobfuscation @interface com.facebook.soloader.DoNotOptimize # Do not strip any method/class that is annotated with @DoNotStrip -keep @com.facebook.common.internal.DoNotStrip class * -keepclassmembers class * { @com.facebook.common.internal.DoNotStrip *; } # Do not strip any method/class that is annotated with @DoNotOptimize -keep @com.facebook.soloader.DoNotOptimize class * -keepclassmembers class * { @com.facebook.soloader.DoNotOptimize *; } # Keep native methods -keepclassmembers class * { native <methods>; } -dontwarn okio.** -dontwarn com.squareup.okhttp.** -dontwarn okhttp3.** -dontwarn javax.annotation.** -dontwarn com.android.volley.toolbox.** -dontwarn com.facebook.infer.** #==================== Gson 混淆配置 -keep class com.google.gson.** {*;} -keep class com.google.**{*;} -keep class sun.misc.Unsafe { *; } -keep class com.google.gson.stream.** { *; } -keep class com.google.gson.examples.android.model.** { *; } #==================== FastJson -dontwarn com.alibaba.fastjson.** -keep class com.alibaba.fastjson.** { *; } #==================== 支付宝支付 -keep class com.alipay.android.app.IAlixPay { *; } -keep class com.alipay.android.app.IAlixPay$Stub { *; } -keep class com.alipay.android.app.IRemoteServiceCallback { *; } -keep class com.alipay.android.app.IRemoteServiceCallback$Stub { *; } -keep class com.alipay.sdk.app.PayTask { public *; } -keep class com.alipay.sdk.app.AuthTask { public *; } -keep public class * extends android.os.IInterface #==================== 微信支付 -keep class com.tencent.mm.sdk.openapi.WXMediaMessage { *; } -keep class com.tencent.mm.sdk.openapi.** implements com.tencent.mm.sdk.openapi.WXMediaMessage$IMediaObject { *; } -keep class com.tencent.wxop.** { *; } -dontwarn com.tencent.mm.** -keep class com.tencent.mm.** { *; } -keep class sun.misc.Unsafe { *; } -keep class com.taobao.** { *; } -keep class com.alibaba.** { *; } -keep class com.alipay.** { *; } -dontwarn com.taobao.** -dontwarn com.alibaba.** -dontwarn com.alipay.** -keep class com.ut.** { *; } -dontwarn com.ut.** -keep class com.ta.** { *; } -dontwarn com.ta.** -keep class anet.**{ *; } -keep class org.android.spdy.** { *; } -keep class org.android.agoo.** { *; } -dontwarn anet.** -dontwarn org.android.spdy.** -dontwarn org.android.agoo.** -keepclasseswithmembernames class com.xiaomi.** { *; } -keep public class * extends com.xiaomi.mipush.sdk.PushMessageReceiver -dontwarn com.xiaomi.push.service.b -keep class org.apache.http.** -keep interface org.apache.http.** -dontwarn org.apache.** #==================== sharesdk -keep class cn.sharesdk.** { *; } -keep class com.sina.** { *; } -keep class **.R$* {*;} -keep class **.R { *; } -keep class com.mob.** { *; } -dontwarn com.mob.** -dontwarn cn.sharesdk.** -dontwarn **.R$* #==================== Banner 混淆配置 -keep class com.youth.banner.** { *; } #==================== GreenDao2 混淆配置 -keep class de.greenrobot.dao.** { *; } -keepclassmembers class * extends de.greenrobot.dao.AbstractDao { public static Java.lang.String TABLENAME; } -keep class **$Properties #==================== GreenDao3 混淆配置 -keepclassmembers class * extends org.greenrobot.greendao.AbstractDao { public static java.lang.String TABLENAME; } -keep class **$Properties # If you do not use SQLCipher: -dontwarn org.greenrobot.greendao.database.** # If you do not use Rx: -dontwarn rx.** #==================== XPopup 混淆配置 -dontwarn com.lxj.xpopup.widget.** -keep class com.lxj.xpopup.widget.** { *; } #==================== JiaoZiVideoPlayer 混淆配置 -keep public class cn.jzvd.JZMediaSystem { *; } -keep public class cn.jzvd.demo.CustomMedia.CustomMedia { *; } -keep public class cn.jzvd.demo.CustomMedia.JZMediaIjk { *; } -keep public class cn.jzvd.demo.CustomMedia.JZMediaSystemAssertFolder { *; } -keep class tv.danmaku.ijk.media.player.** { *; } -dontwarn tv.danmaku.ijk.media.player.* -keep interface tv.danmaku.ijk.media.player.** { *; } -dontwarn org.joda.time.** -keep class org.joda.time.** { *; } #==================== EventBus2 混淆配置 -keepclassmembers class ** { public void onEvent*(***); } # Only required if you use AsyncExecutor -keepclassmembers class * extends de.greenrobot.event.util.ThrowableFailureEvent { <init>(java.lang.Throwable); } #==================== EventBus3 混淆配置 -keepattributes *Annotation* -keepclassmembers class ** { @org.greenrobot.eventbus.Subscribe <methods>; } -keep enum org.greenrobot.eventbus.ThreadMode { *; } # Only required if you use AsyncExecutor -keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent { <init>(java.lang.Throwable); } #==================== Bugly 混淆配置 -dontwarn com.tencent.bugly.** -keep public class com.tencent.bugly.** { *; } #==================== Okgo 混淆配置 #okgo -dontwarn com.lzy.okgo.** -keep class com.lzy.okgo.** { *; } #okrx -dontwarn com.lzy.okrx.** -keep class com.lzy.okrx.** { *; } #okrx2 -dontwarn com.lzy.okrx2.** -keep class com.lzy.okrx2.** { *; } #okserver -dontwarn com.lzy.okserver.** -keep class com.lzy.okserver.** { *; } #==================== 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$* { *; } #==================== PictureSelector 2.0 混淆配置 -keep class com.luck.picture.lib.** { *; } -dontwarn com.yalantis.ucrop** -keep class com.yalantis.ucrop** { *; } -keep interface com.yalantis.ucrop** { *; } #==================== 百度地图混淆配置 # 百度定位混淆配置 -keep class vi.com.gdi.** { *; } -keep public class com.baidu.** { *; } -keep public class com.mobclick.** { *; } -dontwarn com.baidu.mapapi.utils.* -dontwarn com.baidu.platform.comapi.b.* -dontwarn com.baidu.platform.comapi.map.* #百度地图混淆配置 -keep class com.baidu.** { *; } -keep class vi.com.** { *; } -dontwarn com.baidu.** #==================== 高徳地图混淆配置 #3D 地图 V5.0.0 之前: -keep class com.amap.api.maps.** { *; } -keep class com.autonavi.amap.mapcore.* { *; } -keep class com.amap.api.trace.** { *; } #3D 地图 V5.0.0 之后: -keep class com.amap.api.maps.** { *; } -keep class com.autonavi.** { *; } -keep class com.amap.api.trace.** { *; } #定位 -keep class com.amap.api.location.** { *; } -keep class com.amap.api.fence.** { *; } -keep class com.autonavi.aps.amapapi.model.** { *; } #搜索 -keep class com.amap.api.services.** { *; } #2D 地图 -keep class com.amap.api.maps2d.** { *; } -keep class com.amap.api.mapcore2d.** { *; } #导航 -keep class com.amap.api.navi.** { *; } -keep class com.autonavi.** { *; } #==================== 环信混淆配置 -keep class com.easemob.** { *; } -keep class org.jivesoftware.** { *; } -dontwarn com.easemob.** #==================== 融云 -keepclassmembers class fqcn.of.javascript.interface.for.webview { public *; } -keepattributes Exceptions,InnerClasses -keep class io.rong.** { *; } -keep class * implements io.rong.imlib.model.MessageContent{ *; } -keepattributes Signature -keepattributes *Annotation* -keep class sun.misc.Unsafe { *; } -keep class com.google.gson.examples.android.model.** { *; } -keepclassmembers class * extends com.sea_monster.dao.AbstractDao { public static java.lang.String TABLENAME; } -keep class **$Properties -dontwarn org.eclipse.jdt.annotation.** -keep class com.ultrapower.** { *; } #==================== 友盟分享混淆配置 -dontshrink -dontoptimize -dontwarn com.google.android.maps.** -dontwarn android.webkit.WebView -dontwarn com.umeng.** -dontwarn com.tencent.weibo.sdk.** -dontwarn com.facebook.** -keep public class javax.** -keep public class android.webkit.** -dontwarn android.support.v4.** -keep enum com.facebook.** -keepattributes Exceptions,InnerClasses,Signature -keepattributes *Annotation* -keepattributes SourceFile,LineNumberTable -keep public interface com.facebook.** -keep public interface com.tencent.** -keep public interface com.umeng.socialize.** -keep public interface com.umeng.socialize.sensor.** -keep public interface com.umeng.scrshot.** -keep public class com.umeng.socialize.* { *; } -keep class com.facebook.** -keep class com.facebook.** { *; } -keep class com.umeng.scrshot.** -keep public class com.tencent.** { *; } -keep class com.umeng.socialize.sensor.** -keep class com.umeng.socialize.handler.** -keep class com.umeng.socialize.handler.* -keep class com.umeng.weixin.handler.** -keep class com.umeng.weixin.handler.* -keep class com.umeng.qq.handler.** -keep class com.umeng.qq.handler.* -keep class UMMoreHandler { *; } -keep class com.tencent.mm.sdk.modelmsg.WXMediaMessage { *; } -keep class com.tencent.mm.sdk.modelmsg.** implements com.tencent.mm.sdk.modelmsg.WXMediaMessage$IMediaObject { *; } -keep class im.yixin.sdk.api.YXMessage { *; } -keep class im.yixin.sdk.api.** implements im.yixin.sdk.api.YXMessage$YXMessageData { *; } -keep class com.tencent.mm.sdk.** { *; } -keep class com.tencent.mm.opensdk.** { *; } -keep class com.tencent.wxop.** { *; } -keep class com.tencent.mm.sdk.** { *; } -dontwarn twitter4j.** -keep class twitter4j.** { *; } -keep class com.tencent.** { *; } -dontwarn com.tencent.** -keep class com.kakao.** { *; } -dontwarn com.kakao.** -keep public class com.umeng.com.umeng.soexample.R$* { public static final int *; } -keep public class com.linkedin.android.mobilesdk.R$* { public static final int *; } -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } -keep class com.tencent.open.TDialog$* -keep class com.tencent.open.TDialog$* { *; } -keep class com.tencent.open.PKDialog -keep class com.tencent.open.PKDialog { *; } -keep class com.tencent.open.PKDialog$* -keep class com.tencent.open.PKDialog$* { *; } -keep class com.umeng.socialize.impl.ImageImpl { *; } -keep class com.sina.** { *; } -dontwarn com.sina.** -keep class com.alipay.share.sdk.** { *; } -keepnames class * implements android.os.Parcelable { public static final ** CREATOR; } -keep class com.linkedin.** { *; } -keep class com.android.dingtalk.share.ddsharemodule.** { *; } -keepattributes Signature #==================== 友盟推送混淆配置 -dontwarn com.umeng.** -dontwarn com.taobao.** -dontwarn anet.channel.** -dontwarn anetwork.channel.** -dontwarn org.android.** -dontwarn org.apache.thrift.** -dontwarn com.xiaomi.** -dontwarn com.huawei.** -dontwarn com.meizu.** -keepattributes *Annotation* -keep class com.taobao.** { *; } -keep class org.android.** { *; } -keep class anet.channel.** { *; } -keep class com.umeng.** { *; } -keep class com.xiaomi.** { *; } -keep class com.huawei.** { *; } -keep class com.meizu.** { *; } -keep class org.apache.thrift.** { *; } -keep class com.alibaba.sdk.android.** { *; } -keep class com.ut.** { *; } -keep class com.ta.** { *; } -keep public class **.R$* { public static final int *; } #==================== zxing -keep class com.google.zxing.** { *; } -dontwarn com.google.zxing.** #==================== log4j -dontwarn org.apache.log4j.** -keep class org.apache.log4j.** { *; } #==================== ButterKnife 7.0 -keep class butterknife.** { *; } -dontwarn butterknife.internal.** -keep class **$$ViewBinder { *; } -keepclasseswithmembernames class * { @butterknife.* <fields>; } -keepclasseswithmembernames class * { @butterknife.* <methods>; } #==================== AndFix -keep class * extends java.lang.annotation.Annotation -keepclasseswithmembernames class * { native <methods>; } #==================== 科大讯飞 -keep class com.iflytek.** { *; } #==================== Retrolambda -dontwarn java.lang.invoke.* #------------------------------ 实体类混淆配置(根据项目情况增加)------------------------------ # bean 类配置混淆 |
尚未着手,仅作备忘。 该库使用标准 Java 写就,在 An […]
在 Github 里看到一个 Java 写就的配置文件访问库 […]
在把一个 Android 项目从兼容高版本向兼容低版本反向移 […]
有时候计划在项目里展示一个放烟花/礼花的特效,没看到 And […]