-
Notifications
You must be signed in to change notification settings - Fork 39
/
proguard-rules.txt
92 lines (71 loc) · 3.34 KB
/
proguard-rules.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/jdeffibaugh/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
## Below are the suggested rules from the developer documentation:
## https://developers.optimizely.com/x/solutions/sdks/reference/index.html?language=android&platform=mobile#installation
# Optimizely
-keep class com.optimizely.ab.config.**
-keepclassmembers class com.optimizely.ab.config.** {
*;
}
# Keep Payload classes that get sent to the ODP server
-keep class com.optimizely.ab.odp.ODPEvent { *; }
# ODP event uses this. R8 complains about it.
-dontwarn java.beans.Transient
# Keep Payload classes that get sent to Optimizely's backend
-keep class com.optimizely.ab.event.internal.payload.** { *; }
# Keep these for logging purposes
-keep class com.optimizely.ab.bucketing.DecisionService { *; }
-keep class com.optimizely.ab.Optimizely { *; }
# Safely ignore warnings about other libraries since we are using Gson
-dontwarn com.fasterxml.jackson.**
-dontwarn org.json.**
# Annotations
-dontwarn javax.annotation.**
# Findbugs
-dontwarn edu.umd.cs.findbugs.annotations.SuppressFBWarnings
# slf4j
-dontwarn org.slf4j.**
-keep class org.slf4j.** {*;}
# Android Logger
-keep class com.noveogroup.android.log.** { *; }
-optimizations !class/unboxing/enum
-dontwarn com.google.gson.**
-dontwarn com.optimizely.ab.config.parser.**
# Gson (https://github.com/google/gson/blob/master/examples/android-proguard-example/proguard.cfg)
##---------------Begin: proguard configuration for Gson ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature
# For using GSON @Expose annotation
-keepattributes *Annotation*
# Gson specific classes
-dontwarn sun.misc.**
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
# Retain the name used by the Java SDK to determine whether Gson is usable as a config parser.
-keepnames class com.google.gson.Gson
##---------------End: proguard configuration for Gson ----------