diff --git a/README.md b/README.md index 8fd0a0cf..b401125d 100644 --- a/README.md +++ b/README.md @@ -84,8 +84,10 @@ installation must be regenerated with that setting. Android release builds, including plain `flutter build apk --release`, keep Dart debug data in `build/symbols/android/app..symbols` to reduce APK -size without obfuscation. An explicit `--split-debug-info` path overrides this -default; `--analyze-size` retains Flutter's normal behavior. Keep these symbols +size. The release script also uses `--obfuscate` to shorten internal Dart names; +when building directly, add `--obfuscate --split-debug-info=build/symbols/android` +for the smaller APK. An explicit `--split-debug-info` path overrides the default; +plain `--analyze-size` builds retain Flutter's normal behavior. Keep these symbols with the matching APK before another local build replaces them. Decode a trace with `flutter symbolize --debug-info= --input=crash.txt`. diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 2411dfb6..329b0e52 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -173,6 +173,17 @@ val buildRustBackend = tasks.register("buildRustBackend") { } tasks.named("preBuild").configure { dependsOn(buildRustBackend) } +// Filter Android's copy only; keep shared bundles and mobile glass shaders intact. +tasks.withType().configureEach { + if (name.startsWith("copyFlutterAssets")) { + exclude( + "flutter_assets/packages/liquid_glass_easy/lib/assets/shaders/liquid_glass_desktop.frag", + "flutter_assets/packages/liquid_glass_easy/lib/assets/shaders/metaball_glass_desktop.frag", + "flutter_assets/packages/flutter_local_notifications_web/web/notifications_service_worker.js", + ) + } +} + flutter { source = "../.." } diff --git a/scripts/build_android.sh b/scripts/build_android.sh index 7c24afe2..127a3539 100644 --- a/scripts/build_android.sh +++ b/scripts/build_android.sh @@ -94,6 +94,8 @@ fi BUILD_GIT_COMMIT="$(git rev-parse --short=8 HEAD)" "${FLUTTER_COMMAND[@]}" build apk \ --release \ + --obfuscate \ + --split-debug-info "$PROJECT_DIR/build/symbols/android" \ --split-per-abi \ --target-platform "$TARGET_PLATFORM_LIST" \ --dart-define="GIT_COMMIT=$BUILD_GIT_COMMIT" \