feat: Настройка ProGuard/R8 для release-сборок
Включает минификацию, обфускацию и оптимизацию кода для release-сборок, установив minifyEnabled в true. • Добавлены правила ProGuard для OkHttp, чтобы предотвратить ошибки во время выполнения, связанные с рефлексией. • Добавлено правило -keep для классов моделей, чтобы гарантировать корректный парсинг JSON.
This commit is contained in:
@@ -20,7 +20,7 @@ android {
|
|||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
10
app/proguard-rules.pro
vendored
10
app/proguard-rules.pro
vendored
@@ -18,4 +18,12 @@
|
|||||||
|
|
||||||
# If you keep the line number information, uncomment this to
|
# If you keep the line number information, uncomment this to
|
||||||
# hide the original source file name.
|
# hide the original source file name.
|
||||||
#-renamesourcefileattribute SourceFile
|
#-renamesourcefileattribute SourceFile
|
||||||
|
|
||||||
|
# OkHttp rules
|
||||||
|
-keep,allowobfuscation,allowshrinking class okhttp3.**
|
||||||
|
-keep,allowobfuscation,allowshrinking class okio.**
|
||||||
|
-dontwarn org.conscrypt.**
|
||||||
|
|
||||||
|
# Keep models (data classes)
|
||||||
|
-keep class com.anabasis.vkchatmanager.models.** { *; }
|
||||||
|
|||||||
Reference in New Issue
Block a user