Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Add ProGuard rules to fix R8 build errors

AmanRajSinghMourya2e65259b7eaf
diff --git a/mobile/apps/locker/android/app/build.gradle b/mobile/apps/locker/android/app/build.gradle
index 1f53f4279b..f5903d27f2 100644
--- a/mobile/apps/locker/android/app/build.gradle
+++ b/mobile/apps/locker/android/app/build.gradle
@@ -49,6 +49,9 @@ android {
buildTypes {
release {
signingConfig = signingConfigs.release
+ minifyEnabled true
+ shrinkResources true
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
diff --git a/mobile/apps/locker/android/app/proguard-rules.pro b/mobile/apps/locker/android/app/proguard-rules.pro
new file mode 100644
index 0000000000..37a4cbccf0
--- /dev/null
+++ b/mobile/apps/locker/android/app/proguard-rules.pro
@@ -0,0 +1,18 @@
+# Keep error_prone annotations
+-dontwarn com.google.errorprone.annotations.**
+-dontnote com.google.errorprone.annotations.**
+
+# Keep all annotations
+-keepattributes *Annotation*
+
+# Keep Tink crypto library classes
+-keep class com.google.crypto.tink.** { *; }
+-dontwarn com.google.crypto.tink.**
+
+# Keep Sodium crypto library classes
+-keep class com.goterl.lazysodium.** { *; }
+-dontwarn com.goterl.lazysodium.**
+
+# Keep Ente crypto classes
+-keep class io.ente.** { *; }
+-dontwarn io.ente.**