详细页优化
This commit is contained in:
@@ -36,6 +36,13 @@ android {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
|
||||
// 启用代码混淆
|
||||
isMinifyEnabled = true
|
||||
// 启用资源压缩
|
||||
isShrinkResources = true
|
||||
// 指定 ProGuard 规则文件
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
29
android/app/proguard-rules.pro
vendored
Normal file
29
android/app/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# Flutter ProGuard Rules
|
||||
# 2026-04-11 | ProGuard Rules | 解决 release 包白屏问题
|
||||
|
||||
# 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.** { *; }
|
||||
|
||||
# Flutter 嵌入相关
|
||||
-keep class io.flutter.embedding.** { *; }
|
||||
|
||||
# 保持 Flutter 生成的类
|
||||
-keep class androidx.lifecycle.** { *; }
|
||||
|
||||
# 保持反射调用的类
|
||||
-keepattributes *Annotation*
|
||||
-keepattributes Signature
|
||||
-keepattributes InnerClasses
|
||||
|
||||
# 保持泛型信息
|
||||
-keepclassmembers,allowobfuscation class * {
|
||||
@com.google.gson.annotations.SerializedName <fields>;
|
||||
}
|
||||
|
||||
# 避免 R8 完全模式问题
|
||||
-dontwarn io.flutter.embedding.**
|
||||
@@ -2,7 +2,8 @@
|
||||
<application
|
||||
android:label="mom_kitchen"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:networkSecurityConfig="@xml/network_security_config">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
|
||||
10
android/app/src/main/res/xml/network_security_config.xml
Normal file
10
android/app/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
2026-04-11 | 网络安全配置 | 允许 HTTP 明文流量
|
||||
解决 Android 9+ 默认禁止 HTTP 流量导致的白屏问题
|
||||
-->
|
||||
<network-security-config>
|
||||
<domain-config cleartextTrafficPermitted="true">
|
||||
<domain includeSubdomains="true">eat.wktyl.com</domain>
|
||||
</domain-config>
|
||||
</network-security-config>
|
||||
Reference in New Issue
Block a user