From b31c8c257beace7954ad4b9cd37544ce9a269edf Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Mon, 6 May 2024 16:17:25 +0800 Subject: [PATCH] Better proguard rule --- .../okhttp3/internal/publicsuffix/PublicSuffixDatabase.kt | 2 +- okhttp/src/main/resources/META-INF/proguard/okhttp3.pro | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/okhttp/src/main/kotlin/okhttp3/internal/publicsuffix/PublicSuffixDatabase.kt b/okhttp/src/main/kotlin/okhttp3/internal/publicsuffix/PublicSuffixDatabase.kt index fef4fd01df79..0663124815de 100644 --- a/okhttp/src/main/kotlin/okhttp3/internal/publicsuffix/PublicSuffixDatabase.kt +++ b/okhttp/src/main/kotlin/okhttp3/internal/publicsuffix/PublicSuffixDatabase.kt @@ -245,7 +245,7 @@ class PublicSuffixDatabase internal constructor( companion object { @JvmField - val PUBLIC_SUFFIX_RESOURCE = "/okhttp3/internal/publicsuffix/${PublicSuffixDatabase::class.java.simpleName}.gz".toPath() + val PUBLIC_SUFFIX_RESOURCE = "/${PublicSuffixDatabase::class.java.name.replace('.','/')}.gz".toPath() private val WILDCARD_LABEL = byteArrayOf('*'.code.toByte()) private val PREVAILING_RULE = listOf("*") diff --git a/okhttp/src/main/resources/META-INF/proguard/okhttp3.pro b/okhttp/src/main/resources/META-INF/proguard/okhttp3.pro index 74fc3168014a..c5b800388776 100644 --- a/okhttp/src/main/resources/META-INF/proguard/okhttp3.pro +++ b/okhttp/src/main/resources/META-INF/proguard/okhttp3.pro @@ -2,7 +2,6 @@ -dontwarn javax.annotation.** # A resource is loaded with a relative path so the package of this class must be preserved. --keeppackagenames okhttp3.internal.publicsuffix.* -adaptresourcefilenames okhttp3/internal/publicsuffix/PublicSuffixDatabase.gz # Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.