Skip to content

Commit

Permalink
android: enable proguard (#399)
Browse files Browse the repository at this point in the history
Signed-off-by: kari-ts <kari@tailscale.com>
  • Loading branch information
kari-ts committed May 22, 2024
1 parent a05829b commit e826a17
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
9 changes: 9 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ android {
buildConfigField "String", "GITHUB_PASSWORD", "\"" + getLocalProperty("githubPassword")+"\""
buildConfigField "String", "GITHUB_2FA_SECRET", "\"" + getLocalProperty("github2FASecret")+"\""
}
release {
minifyEnabled true

shrinkResources true

proguardFiles getDefaultProguardFile(
'proguard-android-optimize.txt'),
'proguard-rules.pro'
}
}

testBuildType "applicationTest"
Expand Down
21 changes: 21 additions & 0 deletions android/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Keep all classes with native methods
-keepclasseswithmembernames class * {
native <methods>;
}

# Keep specific classes from Tink library
-keep class com.google.crypto.tink.** { *; }

# Ignore warnings about missing Error Prone annotations
-dontwarn com.google.errorprone.annotations.**

# Keep Error Prone annotations if referenced
-keep class com.google.errorprone.annotations.** { *; }

# Keep Google HTTP Client classes
-keep class com.google.api.client.http.** { *; }
-dontwarn com.google.api.client.http.**

# Keep Joda-Time classes
-keep class org.joda.time.** { *; }
-dontwarn org.joda.time.**

0 comments on commit e826a17

Please sign in to comment.