# 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 # Retrofit 和 OkHttp 的混淆规则 -dontwarn okhttp3.** -dontwarn okio.** -keep class okhttp3.** { *; } -keep class retrofit2.** { *; } -dontwarn retrofit2.** -dontwarn javax.annotation.Nullable -keep class com.offline.music.playermp3.javabean.A_data.AudioItem { *; } # 保持 Context、Intent 和权限相关的公共方法 -keep class android.content.Context { *; } -keep class android.content.Intent { *; } -keep class android.content.pm.PackageManager { *; } -keep class android.net.Uri { *; } -keep class com.google.gson.** { *; } -keepattributes Signature -keep class com.google.gson.reflect.TypeToken { *; } -keep class * extends com.google.gson.reflect.TypeToken -keepattributes AnnotationDefault,RuntimeVisibleAnnotations # 使用R8全模式,对未保留的类剥离通用签名。挂起函数被包装在使用类型参数的continuation中。 -keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation # 如果不保留,R8完整模式将从返回类型中剥离通用签名。 -if interface * { @retrofit2.http.* public *** *(...); } -keep,allowoptimization,allowshrinking,allowobfuscation class <3> # 在R8全模式下,对未保留的类剥离通用签名。 -keep,allowobfuscation,allowshrinking class retrofit2.Response ## ---------Retrofit混淆方法--------------- -dontwarn javax.annotation.** -dontwarn javax.inject.** # OkHttp3 -dontwarn okhttp3.logging.** -keep class okhttp3.internal.**{*;} -dontwarn okio.** # Retrofit -dontwarn retrofit2.** -keep class retrofit2.** { *; } -keepattributes Signature -keepattributes Exceptions # RxJava RxAndroid -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; } # Gson -keep class com.google.gson.stream.** { *; } -keepattributes EnclosingMethod -keep class com.offline.music.playermp3.javabean.**{*;} -keep class org.chromium.** { *; } -keep class androidx.media3.datasource.cronet.** { *; } -keep class androidx.media3.exoplayer.scheduler.PlatformScheduler$PlatformSchedulerService { *; }