summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorAlbin <albin@mullvad.net>2023-02-15 20:31:20 +0100
committerAlbin <albin@mullvad.net>2023-02-16 13:38:15 +0100
commitc394333a9c45ddff120f9efd45cf0bc0c0a109fa (patch)
tree104444667e140612f37cb331d0bf2a6a15221052 /android
parentca0e5973acd92f0dcf0db0f2b4f89dbac7fae32c (diff)
downloadmullvadvpn-c394333a9c45ddff120f9efd45cf0bc0c0a109fa.tar.xz
mullvadvpn-c394333a9c45ddff120f9efd45cf0bc0c0a109fa.zip
Configure proguard rules
Diffstat (limited to 'android')
-rw-r--r--android/app/build.gradle.kts7
-rw-r--r--android/app/proguard-rules.pro20
2 files changed, 27 insertions, 0 deletions
diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts
index 55b7b33c05..f673552b23 100644
--- a/android/app/build.gradle.kts
+++ b/android/app/build.gradle.kts
@@ -69,6 +69,13 @@ android {
}
buildTypes {
+ getByName("release") {
+ proguardFiles(
+ getDefaultProguardFile("proguard-android-optimize.txt"),
+ "proguard-rules.pro"
+ )
+ }
+
create("fdroid") {
initWith(buildTypes.getByName("release"))
isMinifyEnabled = false
diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro
new file mode 100644
index 0000000000..7d80dc6e39
--- /dev/null
+++ b/android/app/proguard-rules.pro
@@ -0,0 +1,20 @@
+# Mullvad
+# Keeping all Mullvad classes etc until the project has been split into multiple sub-projects
+# where it's better defined where the FFI/JNI boundaries are.
+-keep class net.mullvad.** { *; }
+
+# Mullvad daemon FFI/JNI
+# See: <repository-root>/mullvad-jni/classes.rs
+-keep class android.os.Parcelable { *; }
+-keep class java.lang.Boolean { *; }
+-keep class java.lang.Integer { *; }
+-keep class java.lang.String { *; }
+-keep class java.net.InetAddress { *; }
+-keep class java.net.InetSocketAddress { *; }
+-keep class java.util.ArrayList { *; }
+
+# Joda Time
+-dontwarn org.joda.convert.**
+-dontwarn org.joda.time.**
+-keep class org.joda.time.** { *; }
+-keep interface org.joda.time.** { *; }