Skip to content

Commit 4e4cd6f

Browse files
committed
update build config, refactor code
1 parent c40a897 commit 4e4cd6f

19 files changed

+822
-557
lines changed

app/build.gradle.kts

Lines changed: 184 additions & 174 deletions
Large diffs are not rendered by default.

app/proguard-rules.pro

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,51 @@
5353
# Retrofit 2
5454
# https://github.com/square/retrofit/blob/master/retrofit/src/main/resources/META-INF/proguard/retrofit2.pro
5555
##################################
56-
# Platform calls Class.forName on types which do not exist on Android to determine platform.
57-
-dontnote retrofit2.Platform
58-
# Platform used when running on Java 8 VMs. Will not be used at runtime.
59-
-dontwarn retrofit2.Platform$Java8
60-
# Retain generic type information for use by reflection by converters and adapters.
61-
-keepattributes Signature
62-
# Retain declared checked exceptions for use by a Proxy instance.
63-
-keepattributes Exceptions
56+
# Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and
57+
# EnclosingMethod is required to use InnerClasses.
58+
-keepattributes Signature, InnerClasses, EnclosingMethod
59+
60+
# Retrofit does reflection on method and parameter annotations.
61+
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
62+
63+
# Keep annotation default values (e.g., retrofit2.http.Field.encoded).
64+
-keepattributes AnnotationDefault
65+
66+
# Retain service method parameters when optimizing.
67+
-keepclassmembers,allowshrinking,allowobfuscation interface * {
68+
@retrofit2.http.* <methods>;
69+
}
70+
71+
# Ignore annotation used for build tooling.
72+
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
73+
74+
# Ignore JSR 305 annotations for embedding nullability information.
75+
-dontwarn javax.annotation.**
76+
77+
# Guarded by a NoClassDefFoundError try/catch and only used when on the classpath.
78+
-dontwarn kotlin.Unit
79+
80+
# Top-level functions that can only be used by Kotlin.
81+
-dontwarn retrofit2.KotlinExtensions
82+
-dontwarn retrofit2.KotlinExtensions$*
83+
84+
# With R8 full mode, it sees no subtypes of Retrofit interfaces since they are created with a Proxy
85+
# and replaces all potential values with null. Explicitly keeping the interfaces prevents this.
86+
-if interface * { @retrofit2.http.* <methods>; }
87+
-keep,allowobfuscation interface <1>
88+
89+
# Keep inherited services.
90+
-if interface * { @retrofit2.http.* <methods>; }
91+
-keep,allowobfuscation interface * extends <1>
92+
93+
# With R8 full mode generic signatures are stripped for classes that are not
94+
# kept. Suspend functions are wrapped in continuations where the type argument
95+
# is used.
96+
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
97+
98+
# R8 full mode strips generic signatures from return types if not kept.
99+
-if interface * { @retrofit2.http.* public *** *(...); }
100+
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>
64101

65102

66103
##################################
@@ -92,33 +129,6 @@
92129

93130
-keepclassmembers class com.codepath.models** { <fields>; }
94131

95-
96-
##################################
97-
# RX libs #
98-
##################################
99-
# Rxjava-promises
100-
-keep class com.darylteo.rx.** { *; }
101-
-dontwarn com.darylteo.rx.**
102-
-keep class rx.schedulers.Schedulers {
103-
public static <methods>;
104-
}
105-
-keep class rx.schedulers.ImmediateScheduler {
106-
public <methods>;
107-
}
108-
-keep class rx.schedulers.TestScheduler {
109-
public <methods>;
110-
}
111-
-keep class rx.schedulers.Schedulers {
112-
public static ** test();
113-
}
114-
115-
-dontwarn java.lang.invoke.*
116-
-keep class link.styler.styler_android.data.model.** { *; }
117-
-keep class * extends io.reactivex.observers.DisposableObserver {
118-
*;
119-
}
120-
121-
122132
##################################
123133
# Glide 4
124134
##################################
@@ -183,14 +193,6 @@
183193
# Other GenerateAdapter
184194
-keep class * implements androidx.lifecycle.GeneratedAdapter {<init>(...);}
185195

186-
##################################
187-
# Koin #
188-
##################################
189-
-keepnames class android.arch.lifecycle.ViewModel
190-
-keepclassmembers public class * extends android.arch.lifecycle.ViewModel { public <init>(...); }
191-
-keepclassmembers class com.lebao.app.domain.** { public <init>(...); }
192-
-keepclassmembers class * { public <init>(...); }
193-
194196
##################################
195197
# Crashlytics #
196198
##################################

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
tools:targetApi="31">
2626

2727
<activity
28-
android:name="com.example.moviedb.compose.ComposeActivity"
28+
android:name="com.example.moviedb.ui.screen.main.MainActivity"
2929
android:configChanges="orientation|screenSize"
3030
android:exported="true"
3131
android:theme="@style/Theme.MyApplication.NoActionBar">

0 commit comments

Comments
 (0)