From 082330808f7b218993afd765458274a67b7543c8 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Tue, 19 Nov 2024 20:25:10 -0800 Subject: [PATCH] Fix building APK --- app/apk/build.gradle.kts | 7 +++++++ app/core/proguard-rules.pro | 6 +----- app/stub/build.gradle.kts | 2 ++ buildSrc/src/main/java/Setup.kt | 4 ---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/apk/build.gradle.kts b/app/apk/build.gradle.kts index ca1414288..0009e36b2 100644 --- a/app/apk/build.gradle.kts +++ b/app/apk/build.gradle.kts @@ -25,6 +25,13 @@ android { compileOptions { isCoreLibraryDesugaringEnabled = true } + + buildTypes { + release { + isMinifyEnabled = true + isShrinkResources = true + } + } } dependencies { diff --git a/app/core/proguard-rules.pro b/app/core/proguard-rules.pro index 357e009be..864ab8ff9 100644 --- a/app/core/proguard-rules.pro +++ b/app/core/proguard-rules.pro @@ -34,13 +34,9 @@ -keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation # Excessive obfuscation --repackageclasses 'a' +-flattenpackagehierarchy -allowaccessmodification --obfuscationdictionary ../dict.txt --classobfuscationdictionary ../dict.txt --packageobfuscationdictionary ../dict.txt - -dontwarn org.bouncycastle.jsse.BCSSLParameters -dontwarn org.bouncycastle.jsse.BCSSLSocket -dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider diff --git a/app/stub/build.gradle.kts b/app/stub/build.gradle.kts index eb2654995..4c52cff8f 100644 --- a/app/stub/build.gradle.kts +++ b/app/stub/build.gradle.kts @@ -28,6 +28,8 @@ android { buildTypes { release { proguardFiles("proguard-rules.pro") + isMinifyEnabled = true + isShrinkResources = false } } diff --git a/buildSrc/src/main/java/Setup.kt b/buildSrc/src/main/java/Setup.kt index 0c5e5f195..d27af6df3 100644 --- a/buildSrc/src/main/java/Setup.kt +++ b/buildSrc/src/main/java/Setup.kt @@ -315,10 +315,6 @@ fun Project.setupAppCommon() { else signingConfigs["debug"] } } - release { - isMinifyEnabled = true - isShrinkResources = true - } } lint {