diff --git a/mobile/android/app/build.gradle b/mobile/android/app/build.gradle index 4999f9a7f9..0839000dd0 100644 --- a/mobile/android/app/build.gradle +++ b/mobile/android/app/build.gradle @@ -81,6 +81,7 @@ android { release { signingConfig signingConfigs.release + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } namespace 'app.alextran.immich' diff --git a/mobile/android/app/proguard-rules.pro b/mobile/android/app/proguard-rules.pro index 898caee06c..af43ae23c2 100644 --- a/mobile/android/app/proguard-rules.pro +++ b/mobile/android/app/proguard-rules.pro @@ -36,4 +36,12 @@ ##---------------End: proguard configuration for Gson ---------- # Keep all widget model classes and their fields for Gson --keep class app.alextran.immich.widget.model.** { *; } \ No newline at end of file +-keep class app.alextran.immich.widget.model.** { *; } + +##---------------Begin: proguard configuration for ok_http JNI ---------- +# The ok_http Dart plugin accesses OkHttp and Okio classes via JNI +# string-based reflection (JClass.forName), which R8 cannot trace. +-keep class okhttp3.** { *; } +-keep class okio.** { *; } +-keep class com.example.ok_http.** { *; } +##---------------End: proguard configuration for ok_http JNI ----------