Enable minification for release builds

This commit is contained in:
Grishka 2022-03-29 10:38:38 +03:00
parent cd4fc107e1
commit fa9112e117
3 changed files with 28 additions and 4 deletions

View File

@ -10,14 +10,15 @@ android {
applicationId "org.joinmastodon.android"
minSdk 23
targetSdk 31
versionCode 16
versionCode 17
versionName "0.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug{
debuggable true
@ -25,6 +26,7 @@ android {
appcenterPrivateBeta{
initWith release
minifyEnabled false
shrinkResources false
versionNameSuffix "-priv-beta"
}
appcenterPublicBeta{

View File

@ -18,4 +18,24 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
# Keep all model classes as they're used with gson and their names are shown in errors
-keep public class org.joinmastodon.android.model.**{
<fields>;
}
# Inner classes in api requests are used with gson
-keepclassmembers class org.joinmastodon.android.api.**$*{
*;
}
# Keep all enums for debugging purposes
-keepnames public enum * {
*;
}
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
@com.squareup.otto.Subscribe <methods>;
}

View File

@ -204,6 +204,7 @@
android:background="@drawable/edit_text_border"
android:inputType="textPersonName|textCapWords"
android:visibility="gone"
android:elevation="0dp"
tools:text="Eugen" />
<EditText
@ -218,6 +219,7 @@
android:background="@drawable/edit_text_border"
android:inputType="textMultiLine|textCapSentences"
android:visibility="gone"
android:elevation="0dp"
tools:text="Founder, CEO and lead developer @Mastodon, Germany." />
</RelativeLayout>