release: v1.0.2

加固:release 构建 + R8 混淆,清理无用资源,修启动链路
This commit is contained in:
maipulse authored and shouko committed 2026-10-30 21:35:19 +08:00
1 parent 5b85408f17
commit 967e93af98
29 files changed
+1640 -1490

No files matched your search

+33 -5
View File
@@ -11,8 +11,9 @@ android {
applicationId "com.maipulse.app"
minSdk 24
targetSdk 34
versionCode 1
versionName "1.0"
// 和网页里的 APP_VERSION 对齐,升级时一起改
versionCode 102
versionName "1.0.2"
ndk {
abiFilters "arm64-v8a"
@@ -20,7 +21,7 @@ android {
// Chaquopy 16 的 DSL 挂在 android.defaultConfig 下面
python {
buildPython "C:/Users/20558/AppData/Local/Programs/Python/Python38/python.exe"
buildPython "python"
pip {
install "flask"
install "requests"
@@ -33,6 +34,12 @@ android {
// 而 zipalign 之后我们要用 apksigner 重签。两边不是同一个 key 的话,
// 出来的包签名不一样,用户必须卸载才能覆盖安装。
signingConfigs {
release {
storeFile file("../maipulse-debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
debug {
storeFile file("../maipulse-debug.keystore")
storePassword "android"
@@ -46,7 +53,13 @@ android {
signingConfig signingConfigs.debug
}
release {
minifyEnabled false
// 出正式包:关调试标志,开 R8 去死代码 + 混淆 Java 侧
signingConfig signingConfigs.release
debuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
'proguard-rules.pro'
}
}
@@ -56,10 +69,25 @@ android {
}
androidResources {
// 这几类是已经压过的/要被 mmap 的,再压反而慢
noCompress 'json', 'png'
}
lint {
// release 构建默认跑 lintVital,它会联网拉 lint-gradle 依赖。
// 这条链断了整包就出不来,而 lint 结果对发版没有决定意义,直接关掉。
checkReleaseBuilds false
abortOnError false
}
packagingOptions {
jniLibs {
// 原生库直接从 APK 里 mmap,不再解压一份到 /data
useLegacyPackaging = false
}
}
}
dependencies {
implementation 'androidx.core:core:1.12.0'
}
}