-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kraity <kraity@krait.cn> (cherry picked from commit 1fccc2b)
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
-keep, allowoptimization, allowobfuscation | ||
@com.alibaba.fastjson2.annotation.JSONType class * | ||
# Keep the fields and methods with @JSONField | ||
-keepclassmembers, allowobfuscation class * { | ||
@com.alibaba.fastjson2.annotation.JSONField <fields>; | ||
@com.alibaba.fastjson2.annotation.JSONField <methods>; | ||
} | ||
|
||
# Ignore warning | ||
-dontwarn java.beans.Transient | ||
-dontwarn com.alibaba.fastjson.* | ||
|
||
# Keep the fields and methods annotated with | ||
# @JSONField for classes which are referenced | ||
-if class * { | ||
@com.alibaba.fastjson2.annotation.JSONField <fields>; | ||
} | ||
-keep, allowobfuscation, allowoptimization class <1> | ||
-if class * { | ||
@com.alibaba.fastjson2.annotation.JSONField <methods>; | ||
} | ||
-keep, allowobfuscation, allowoptimization class <1> | ||
|
||
# Keep any (anonymous) classes extending TypeReference | ||
-keep, allowobfuscation class com.alibaba.fastjson2.TypeReference | ||
-keep, allowobfuscation class * extends com.alibaba.fastjson2.TypeReference |