Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit 6fcb177

Browse files
committed
fix: add missing proguard rules
1 parent 87e963a commit 6fcb177

File tree

2 files changed

+150
-1
lines changed

2 files changed

+150
-1
lines changed

core/app/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,3 @@ lint/tmp/
9797

9898
# Proguard files
9999
dictionary.txt
100-
proguard-rules.pro

core/app/proguard-rules.pro

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
-ignorewarnings
2+
3+
-dontwarn **
4+
-dontnote **
5+
-dontobfuscate
6+
7+
-keep class javax.** { *; }
8+
-keep class jdkx.** { *; }
9+
10+
# keep javac classes
11+
-keep class openjdk.** { *; }
12+
13+
# Android builder model interfaces
14+
-keep class com.android.** { *; }
15+
16+
# Tooling API classes
17+
-keep class com.itsaky.androidide.tooling.** { *; }
18+
19+
# Builder model implementations
20+
-keep class com.itsaky.androidide.builder.model.** { *; }
21+
22+
# Eclipse
23+
-keep class org.eclipse.** { *; }
24+
25+
# JAXP
26+
-keep class jaxp.** { *; }
27+
-keep class org.w3c.** { *; }
28+
-keep class org.xml.** { *; }
29+
30+
# Services
31+
-keep @com.google.auto.service.AutoService class ** {
32+
}
33+
-keepclassmembers class ** {
34+
@com.google.auto.service.AutoService <methods>;
35+
}
36+
37+
# EventBus
38+
-keepclassmembers class ** {
39+
@org.greenrobot.eventbus.Subscribe <methods>;
40+
}
41+
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
42+
-keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
43+
<init>(java.lang.Throwable);
44+
}
45+
46+
# Accessed reflectively
47+
-keep class io.github.rosemoe.sora.widget.component.EditorAutoCompletion {
48+
io.github.rosemoe.sora.widget.component.EditorCompletionAdapter adapter;
49+
int currentSelection;
50+
}
51+
-keep class com.itsaky.androidide.projects.util.StringSearch {
52+
packageName(java.nio.file.Path);
53+
}
54+
-keep class * implements org.antlr.v4.runtime.Lexer {
55+
<init>(...);
56+
}
57+
-keep class * extends com.itsaky.androidide.lsp.java.providers.completion.IJavaCompletionProvider {
58+
<init>(...);
59+
}
60+
-keep class com.itsaky.androidide.editor.api.IEditor { *; }
61+
-keep class * extends com.itsaky.androidide.inflater.IViewAdapter { *; }
62+
-keep class * extends com.itsaky.androidide.inflater.drawable.IDrawableParser {
63+
<init>(...);
64+
android.graphics.drawable.Drawable parse();
65+
android.graphics.drawable.Drawable parseDrawable();
66+
}
67+
-keep class com.itsaky.androidide.utils.DialogUtils { public <methods>; }
68+
69+
# APK Metadata
70+
-keep class com.itsaky.androidide.models.ApkMetadata { *; }
71+
-keep class com.itsaky.androidide.models.ArtifactType { *; }
72+
-keep class com.itsaky.androidide.models.MetadataElement { *; }
73+
74+
# Parcelable
75+
-keepclassmembers class * implements android.os.Parcelable {
76+
public static final android.os.Parcelable$Creator CREATOR;
77+
}
78+
79+
# Used in preferences
80+
-keep enum org.eclipse.lemminx.dom.builder.EmptyElements { *; }
81+
-keep enum com.itsaky.androidide.xml.permissions.Permission { *; }
82+
83+
# Lots of native methods in tree-sitter
84+
# There are some fields as well that are accessed from native field
85+
-keepclasseswithmembers class ** {
86+
native <methods>;
87+
}
88+
89+
-keep class com.itsaky.androidide.treesitter.** { *; }
90+
91+
# Retrofit 2
92+
-dontwarn retrofit2.**
93+
-keep class retrofit2.** { *; }
94+
95+
-keepclasseswithmembers class * {
96+
@retrofit2.http.* <methods>;
97+
}
98+
99+
# OkHttp3
100+
-keep class okhttp3.** { *; }
101+
-keep interface okhttp3.** { *; }
102+
-dontwarn okhttp3.**
103+
104+
# Stat uploader
105+
-keep class com.itsaky.androidide.stats.** { *; }
106+
107+
# Gson
108+
-keep class * extends com.google.gson.TypeAdapter
109+
-keep class * implements com.google.gson.TypeAdapterFactory
110+
-keep class * implements com.google.gson.JsonSerializer
111+
-keep class * implements com.google.gson.JsonDeserializer
112+
113+
-keepclassmembers,allowobfuscation class * {
114+
@com.google.gson.annotations.SerializedName <fields>;
115+
}
116+
117+
## Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
118+
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
119+
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
120+
121+
## Themes
122+
-keep enum com.itsaky.androidide.ui.themes.IDETheme {
123+
*;
124+
}
125+
126+
## Contributor models - deserialized with GSON
127+
-keep class * implements com.itsaky.androidide.contributors.Contributor {
128+
*;
129+
}
130+
131+
# Suppress wissing class warnings
132+
## These are used in annotation processing process in the Java Compiler
133+
-dontwarn sun.reflect.annotation.AnnotationParser
134+
-dontwarn sun.reflect.annotation.AnnotationType
135+
-dontwarn sun.reflect.annotation.EnumConstantNotPresentExceptionProxy
136+
-dontwarn sun.reflect.annotation.ExceptionProxy
137+
138+
## Used in Logback. We do not need this though.
139+
-dontwarn jakarta.servlet.ServletContainerInitializer
140+
141+
## These are used in JGit
142+
## TODO(itsaky): Verify if it is safe to ignore these warnings
143+
-dontwarn java.lang.ProcessHandle
144+
-dontwarn java.lang.management.ManagementFactory
145+
-dontwarn org.ietf.jgss.GSSContext
146+
-dontwarn org.ietf.jgss.GSSCredential
147+
-dontwarn org.ietf.jgss.GSSException
148+
-dontwarn org.ietf.jgss.GSSManager
149+
-dontwarn org.ietf.jgss.GSSName
150+
-dontwarn org.ietf.jgss.Oid

0 commit comments

Comments
 (0)