perf: enable R8 code and resource shrinking without obfuscation

This commit is contained in:
LZX committed 2026-11-08 15:44:03 +08:00
1 parent 17a0fd9367
commit d6fc15526c
2 files changed
+17 -21

No files matched your search

+4 -3
View File
@@ -11,8 +11,8 @@ android {
applicationId = "com.lzxnone.tailscalemanager" applicationId = "com.lzxnone.tailscalemanager"
minSdk = 28 minSdk = 28
targetSdk = 36 targetSdk = 36
versionCode = 100 versionCode = 101
versionName = "1.0.0" versionName = "1.0.1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
} }
@@ -31,7 +31,8 @@ android {
buildTypes { buildTypes {
release { release {
isMinifyEnabled = false isMinifyEnabled = true
isShrinkResources = true
if (keystoreFile.exists()) { if (keystoreFile.exists()) {
signingConfig = signingConfigs.getByName("release") signingConfig = signingConfigs.getByName("release")
} }
+13 -18
View File
@@ -1,21 +1,16 @@
# Add project specific ProGuard rules here. # 仅代码裁剪(Tree Shaking),完全禁用重命名混淆
# You can control the set of applied configuration files using the -dontobfuscate
# proguardFiles setting in build.gradle. -dontoptimize
#
# 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 -keepattributes SourceFile,LineNumberTable,InnerClasses,EnclosingMethod,Exceptions,Signature
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for # 保持数据模型与核心接口结构
# debugging stack traces. -keep class com.lzxnone.tailscalemanager.model.** { *; }
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to # 保持 Android 基本组件
# hide the original source file name. -keep public class * extends android.app.Activity
#-renamesourcefileattribute SourceFile -keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider