Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit beafc316 authored by Amit Kumar's avatar Amit Kumar 💻
Browse files

Enable proguard and split apks to reduce apk size

parent 0b446d96
Loading
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -34,9 +34,14 @@ android {
	}

	buildTypes {
		debug {
			signingConfig signingConfigs.debug
		}
		release {
			minifyEnabled false
			proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
			shrinkResources true
			minifyEnabled true
			proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
				'proguard-rules.pro'
		}
	}

@@ -49,6 +54,13 @@ android {
		}
	}

	splits {
		abi {
			enable true
			universalApk true // Build universal apk also for prebuiltapks in /e/OS.
		}
	}

	compileOptions {
		sourceCompatibility JavaVersion.VERSION_1_8
		targetCompatibility JavaVersion.VERSION_1_8
@@ -70,6 +82,8 @@ dependencies {
	implementation Libs.AndroidX.Lifecycle.runtime
	implementation Libs.AndroidX.Lifecycle.viewmodel

	debugImplementation Libs.leakCanary

	implementation Libs.MapBox.sdk
	implementation 'com.google.android.material:material:1.3.0'

+18 −18
Original line number Diff line number Diff line
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends androidx.fragment.app.Fragment

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}
-keepclassmembers class **.R$* {
    public static <fields>;
}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# MapBox
-keep class com.mapbox.android.telemetry.**
-keep class com.mapbox.android.core.location.**
-keep class com.mapbox.android.core.location.** { *; }
-dontnote com.mapbox.mapboxsdk.**
-dontnote com.mapbox.android.gestures.**
-dontnote com.mapbox.mapboxsdk.plugins.**

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
 No newline at end of file
# Preserve the line number for debugging stack traces.
-keepattributes SourceFile,LineNumberTable

# Hide original source file name.
-renamesourcefileattribute SourceFile
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ libs.junit = "junit:junit:4.13.1"
libs.robolectric = "org.robolectric:robolectric:4.5"
libs.mockK = "io.mockk:mockk:1.10.5"

libs.leakCanary = "com.squareup.leakcanary:leakcanary-android:2.6"
libs.leakCanary = "com.squareup.leakcanary:leakcanary-android:2.7"

libs.truth = "com.google.truth:truth:1.1"