feat: add multi-architecture APK support for all Android platforms

This commit is contained in:
Nedifinita
2025-07-15 14:33:37 +08:00
parent 8b16b4c5d2
commit 10d4c341a7
5 changed files with 71 additions and 22 deletions

View File

@@ -16,17 +16,31 @@ android {
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
ndk {
abiFilters += listOf("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
}
}
buildTypes {
release {
isMinifyEnabled = false
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
splits {
abi {
isEnable = true
reset()
include("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
isUniversalApk = true
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

View File

@@ -1,21 +1,16 @@
# 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
-keepattributes SourceFile,LineNumberTable
-renamesourcefileattribute SourceFile
# 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 *;
#}
-keep class org.json.** { *; }
-keep class org.osmdroid.** { *; }
-keep class org.mapsforge.** { *; }
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
-keepclassmembers class * {
@androidx.compose.runtime.Composable <methods>;
}
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-keep class androidx.compose.** { *; }
-keep class kotlin.** { *; }
-dontwarn org.osmdroid.**
-dontwarn org.mapsforge.**