Android 反编译工具 jadx-gui
用工具查看哪些应该keep掉但是没被keep掉的类,发现被混淆掉了,就重新看看那个类,是不是还有专门的混淆规则
model类和json类,
-keep class com.zs.test.model.**{*;}
-keep class com.google.gson.**{*;}
泛型的类型可能会有问题,这时候就需要混淆,比如TypeToken
-keep class com.google.gson.reflect.TypeToken
-keep class * extends com.google.gson.reflect.TypeToken
-keep public class * implements java.lang.reflect.Type
还有一些sdk
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile# 保留 OkHttp、Gson 和相关类不被混淆
#-keep class com.zs.test.** { *; }# 保留泛型信息
-keep class com.zs.test.model.**{*;}#每日一测和每日一言
-keep class com.songcha.library_network.bean.BaseBean {*;}
-keep class * extends com.songcha.library_network.bean.BaseBean {*;}
-keep class com.songcha.library_business.bean.**$* {*;}
-keep class com.songcha.library_business.bean.advert.AdvertInfoBean {*;}
-keep class com.songcha.library_business.bean.configuration.WxShareBean {*;}
-keep class com.songcha.module_tqa.bean.**$* {*;}#typeToke
-keep class com.google.gson.reflect.TypeToken
-keep class * extends com.google.gson.reflect.TypeToken
-keep public class * implements java.lang.reflect.Type#R8
-dontwarn android.app.Activity$TranslucentConversionListener
-dontwarn com.bytedance.JProtect
-dontwarn com.download.library.DownloadImpl
-dontwarn com.download.library.DownloadListenerAdapter
-dontwarn com.download.library.DownloadTask
-dontwarn com.download.library.ResourceRequest
-dontwarn javax.lang.model.element.Element
-dontwarn net.sqlcipher.database.SQLiteOpenHelper
-dontwarn org.bouncycastle.jsse.BCSSLParameters
-dontwarn org.bouncycastle.jsse.BCSSLSocket
-dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider
-dontwarn org.conscrypt.Conscrypt$Version
-dontwarn org.conscrypt.Conscrypt
-dontwarn org.conscrypt.ConscryptHostnameVerifier
-dontwarn org.openjsse.javax.net.ssl.SSLParameters
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
-dontwarn org.openjsse.net.ssl.OpenJSSE
-dontwarn rx.Scheduler
-dontwarn rx.schedulers.Schedulers
-dontwarn com.alipay.sdk.app.H5PayCallback
-dontwarn com.alipay.sdk.app.PayTask#compose
-keep class androidx.compose.ui.** {*;}
#-keep class io.coil-kt.** {*;}#advert
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
-keep class com.bytedance.sdk.openadsdk.** {*;}
-keep public interface com.bytedance.sdk.openadsdk.downloadnew.** {*;}
-keep class com.pgl.sys.ces.* {*;}
-keep class com.bytedance.**{*;}#umeng
-keep class com.umeng.** {*;}
-keep class org.repackage.** {*;}
-keep class com.uyumao.** { *; }
-keepclassmembers class * {public <init> (org.json.JSONObject);
}
-keepclassmembers enum * {public static **[] values();public static ** valueOf(java.lang.String);
}
-keep public class com.beike.read.R$*{public static final int *;
}#wxpay
-keep class com.tencent.mm.opensdk.** {*;}
-keep class com.tencent.wxop.** {*;}
-keep class com.tencent.mm.sdk.** {*;}#database
-keep class com.songcha.library_database.** {*;}#rxjava
-keep class io.reactivex.**{*;}#arouter
-keep public class com.alibaba.android.arouter.routes.**{*;}
-keep public class com.alibaba.android.arouter.facade.**{*;}
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
-keep class * implements com.alibaba.android.arouter.facade.template.IProvider{*;}#eventbus
-keepclassmembers class * {@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }#viewmodel
-keep class * extends androidx.lifecycle.ViewModel {*;}
-keep class * extends androidx.lifecycle.AndroidViewModel {*;}#lifecycle
-keep interface androidx.lifecycle.LifecycleObserver {*;}
-keep class * implements androidx.lifecycle.LifecycleObserver {*;}#repository
-keep class * extends com.songcha.library_base.mvvm.base.BaseRepository {*;}#parcelable
-keepclassmembers class * implements android.os.Parcelable{public static final android.os.Parcelable$Creator CREATOR;
}#bugly
#-dontwarn com.tencent.bugly.**
-keep public class com.tencent.bugly.**{*;}#gson
-keep class com.google.gson.**{*;}#quick adapter
-keep class com.chad.library.** {*;}#oss
-keep class com.alibaba.sdk.android.oss.** { *; }
-dontwarn okio.**
-dontwarn org.apache.commons.codec.binary.**