Skip to content

Commit f1f5659

Browse files
committed
Enabled Code Obfuscation
Signed-off-by: dracarys18 <[email protected]>
1 parent 677623d commit f1f5659

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

app/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ android {
2323

2424
buildTypes {
2525
release {
26-
minifyEnabled false
26+
minifyEnabled true
2727
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
2828
}
2929
}

app/proguard-rules.pro

+35-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,38 @@
1818

1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
21-
#-renamesourcefileattribute SourceFile
21+
#-renamesourcefileattribute SourceFile
22+
23+
-keep class com.karthihegde.readlist.*
24+
-keep class com.karthihegde.readlist.ui.*
25+
-keep class com.karthihegde.readlist.retrofit.data.** {*;}
26+
27+
# Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and
28+
# EnclosingMethod is required to use InnerClasses.
29+
-keepattributes Signature, InnerClasses, EnclosingMethod
30+
31+
# Retrofit does reflection on method and parameter annotations.
32+
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
33+
34+
# Keep annotation default values (e.g., retrofit2.http.Field.encoded).
35+
-keepattributes AnnotationDefault
36+
37+
# Retain service method parameters when optimizing.
38+
-keepclassmembers,allowshrinking,allowobfuscation interface * {
39+
@retrofit2.http.* <methods>;
40+
}
41+
42+
43+
# With R8 full mode, it sees no subtypes of Retrofit interfaces since they are created with a Proxy
44+
# and replaces all potential values with null. Explicitly keeping the interfaces prevents this.
45+
-if interface * { @retrofit2.http.* <methods>; }
46+
-keep,allowobfuscation interface <1>
47+
48+
# Keep generic signature of Call, Response (R8 full mode strips signatures from non-kept items).
49+
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
50+
-keep,allowobfuscation,allowshrinking class retrofit2.Response
51+
52+
# With R8 full mode generic signatures are stripped for classes that are not
53+
# kept. Suspend functions are wrapped in continuations where the type argument
54+
# is used.
55+
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation

0 commit comments

Comments
 (0)