增加安卓原生代码混淆压缩、资源压缩功能
This commit is contained in:
parent
0a4854eb4c
commit
68c77e9a3e
|
@ -72,6 +72,14 @@ android {
|
|||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
// signingConfig signingConfigs.debug
|
||||
signingConfig signingConfigs.release
|
||||
|
||||
// 移除项目中未使用的资源(如图片、字体和动画),以减小应用程序的包体积
|
||||
shrinkResources true
|
||||
|
||||
minifyEnabled true //资源压缩设置
|
||||
// 读取代码压缩配置文件
|
||||
// 混淆Android原生代码 启用ProGuard
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,9 @@ android.useAndroidX=true
|
|||
android.enableJetifier=true
|
||||
#org.gradle.java.home=D\:\\Android\\Android Studio\\jbr
|
||||
|
||||
# 混淆
|
||||
extra-gen-snapshot-options=--obfuscate
|
||||
|
||||
# 配置 VPN 加快下载速度
|
||||
systemProp.http.proxyHost=127.0.0.1
|
||||
systemProp.http.proxyPort=7890
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
#Flutter Wrapper
|
||||
-dontwarn io.flutter.**
|
||||
-keep class io.flutter.app.** { *; }
|
||||
-keep class io.flutter.plugin.** { *; }
|
||||
-keep class io.flutter.util.** { *; }
|
||||
-keep class io.flutter.view.** { *; }
|
||||
-keep class io.flutter.** { *; }
|
||||
-keep class io.flutter.plugins.** { *; }
|
Loading…
Reference in New Issue