diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index d4fdef7..1ce40bb 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -53,8 +53,12 @@ android { buildTypes { release { signingConfig = signingConfigs.getByName("release") - isMinifyEnabled = false - isShrinkResources = false + isMinifyEnabled = true + isShrinkResources = true + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro", + ) } } } diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro new file mode 100644 index 0000000..a45b3d5 --- /dev/null +++ b/android/app/proguard-rules.pro @@ -0,0 +1,22 @@ +# R8 keep rules for release builds. Keep these narrow: broad -keep rules defeat +# obfuscation, and Play flags DEX obfuscation below 25 %. + +# flutter_local_notifications stores scheduled notifications as JSON via Gson +# (models are reflected on) and its receivers are declared in the manifest. +-keep class com.dexterous.flutterlocalnotifications.** { *; } + +# Gson: generic type info is needed for TypeToken deserialization. +-keepattributes Signature, *Annotation*, EnclosingMethod, InnerClasses +-keep class com.google.gson.reflect.TypeToken { *; } +-keep class * extends com.google.gson.reflect.TypeToken +-keep class * extends com.google.gson.TypeAdapter +-keep class * implements com.google.gson.TypeAdapterFactory +-keep class * implements com.google.gson.JsonSerializer +-keep class * implements com.google.gson.JsonDeserializer +-keepclassmembers,allowobfuscation class * { + @com.google.gson.annotations.SerializedName ; +} + +# TensorFlow Lite: the native runtime calls back into these classes via JNI. +-keep class org.tensorflow.lite.** { *; } +-dontwarn org.tensorflow.lite.gpu.** diff --git a/android/app/src/main/res/raw/keep.xml b/android/app/src/main/res/raw/keep.xml new file mode 100644 index 0000000..86b0f84 --- /dev/null +++ b/android/app/src/main/res/raw/keep.xml @@ -0,0 +1,4 @@ + + + diff --git a/pubspec.lock b/pubspec.lock index 3018e25..24ebd29 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -617,10 +617,10 @@ packages: dependency: "direct main" description: name: tflite_flutter - sha256: "48e6fde2ad97162bb66a16a142f4c4698add9e8cd397ce9d1cc7451b55537ac1" + sha256: "0bba9040d8decda0960d7abf8eabf32243bf092bc7d0084e8e19681866b0bdbe" url: "https://pub.dev" source: hosted - version: "0.11.0" + version: "0.12.1" timezone: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 2dba381..3c8bfa7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: sd_kovinar description: SD Kovinar Muta club app — target scoring, camera streams, training calendar and contacts. publish_to: 'none' # This prevents publishing to pub.dev -version: 1.3.0+6 +version: 1.3.1+7 environment: sdk: '>=3.3.0 <4.0.0' @@ -14,7 +14,7 @@ dependencies: flutter_mjpeg: ^2.0.0 intl: any - tflite_flutter: ^0.11.0 + tflite_flutter: ^0.12.1 image: ^4.5.4 camera: ^0.10.0 path_provider: ^2.0.15