Ver código fonte

ref(proguard): Create common proguard config.

j8
hristoterezov 6 anos atrás
pai
commit
717fade79c

+ 1
- 1
android/app/build.gradle Ver arquivo

@@ -33,7 +33,7 @@ android {
33 33
         }
34 34
         release {
35 35
             minifyEnabled true
36
-            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
36
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules-release.pro'
37 37
         }
38 38
     }
39 39
 

+ 1
- 89
android/app/proguard-rules-debug.pro Ver arquivo

@@ -1,93 +1,5 @@
1
-# Add project specific ProGuard rules here.
2
-# By default, the flags in this file are appended to flags specified
3
-# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4
-# You can edit the include path and order by changing the proguardFiles
5
-# directive in build.gradle.
6
-#
7
-# For more details, see
8
-#   http://developer.android.com/guide/developing/tools/proguard.html
9
-
10
-# Add any project specific keep options here:
11
-
12
-# If your project uses WebView with JS, uncomment the following
13
-# and specify the fully qualified class name to the JavaScript interface
14
-# class:
15
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16
-#   public *;
17
-#}
1
+-include proguard-rules.pro
18 2
 
19 3
 # Disabling obfuscation is useful if you collect stack traces from production crashes
20 4
 # (unless you are using a system that supports de-obfuscate the stack traces).
21 5
 -dontobfuscate
22
-
23
-# React Native
24
-
25
-# Keep our interfaces so they can be used by other ProGuard rules.
26
-# See http://sourceforge.net/p/proguard/bugs/466/
27
--keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
28
--keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
29
--keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
30
-
31
-# Do not strip any method/class that is annotated with @DoNotStrip
32
--keep @com.facebook.proguard.annotations.DoNotStrip class *
33
--keep @com.facebook.common.internal.DoNotStrip class *
34
--keepclassmembers class * {
35
-    @com.facebook.proguard.annotations.DoNotStrip *;
36
-    @com.facebook.common.internal.DoNotStrip *;
37
-}
38
-
39
--keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
40
-  void set*(***);
41
-  *** get*();
42
-}
43
-
44
--keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
45
--keep class * extends com.facebook.react.bridge.NativeModule { *; }
46
--keepclassmembers,includedescriptorclasses class * { native <methods>; }
47
--keepclassmembers class *  { @com.facebook.react.uimanager.UIProp <fields>; }
48
--keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
49
--keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
50
-
51
--keep class com.facebook.react.bridge.ModuleRegistryHolder { *; }
52
--keep class com.facebook.react.bridge.CatalystInstanceImpl { *; }
53
--keep class com.facebook.react.bridge.JavaScriptExecutor { *; }
54
--keep class com.facebook.react.bridge.queue.NativeRunnable { *; }
55
--keep class com.facebook.react.bridge.ExecutorToken { *; }
56
--keep class com.facebook.react.bridge.ReadableType { *; }
57
--keep class com.facebook.react.devsupport.** { *; }
58
--dontwarn com.facebook.react.devsupport.**
59
-
60
--dontwarn com.facebook.react.**
61
-
62
-# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
63
-# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
64
--dontwarn android.text.StaticLayout
65
-
66
-# okhttp
67
-
68
--keepattributes Signature
69
--keepattributes *Annotation*
70
--keep class okhttp3.** { *; }
71
--keep interface okhttp3.** { *; }
72
--dontwarn okhttp3.**
73
--dontwarn com.squareup.okhttp.**
74
-
75
-# okio
76
-
77
--keep class sun.misc.Unsafe { *; }
78
--dontwarn java.nio.file.*
79
--dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
80
--dontwarn okio.**
81
-
82
-# FastImage
83
-
84
--keep public class com.dylanvann.fastimage.* {*;}
85
--keep public class com.dylanvann.fastimage.** {*;}
86
-
87
--keep class org.webrtc.** { *; }
88
-
89
-
90
--dontwarn com.google.appengine.**
91
--dontwarn javax.servlet.**
92
-
93
-

+ 6
- 0
android/app/proguard-rules-release.pro Ver arquivo

@@ -0,0 +1,6 @@
1
+-include proguard-rules.pro
2
+
3
+# Crashlytics
4
+-keepattributes *Annotation*
5
+-keepattributes SourceFile,LineNumberTable
6
+-keep public class * extends java.lang.Exception

+ 13
- 20
android/app/proguard-rules.pro Ver arquivo

@@ -16,10 +16,6 @@
16 16
 #   public *;
17 17
 #}
18 18
 
19
-# Disabling obfuscation is useful if you collect stack traces from production crashes
20
-# (unless you are using a system that supports de-obfuscate the stack traces).
21
-# -dontobfuscate
22
-
23 19
 # React Native
24 20
 
25 21
 # Keep our interfaces so they can be used by other ProGuard rules.
@@ -48,15 +44,6 @@
48 44
 -keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
49 45
 -keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
50 46
 
51
--keep class com.facebook.react.bridge.ModuleRegistryHolder { *; }
52
--keep class com.facebook.react.bridge.CatalystInstanceImpl { *; }
53
--keep class com.facebook.react.bridge.JavaScriptExecutor { *; }
54
--keep class com.facebook.react.bridge.queue.NativeRunnable { *; }
55
--keep class com.facebook.react.bridge.ExecutorToken { *; }
56
--keep class com.facebook.react.bridge.ReadableType { *; }
57
--keep class com.facebook.react.devsupport.** { *; }
58
--dontwarn com.facebook.react.devsupport.**
59
-
60 47
 -dontwarn com.facebook.react.**
61 48
 
62 49
 # TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
@@ -70,7 +57,6 @@
70 57
 -keep class okhttp3.** { *; }
71 58
 -keep interface okhttp3.** { *; }
72 59
 -dontwarn okhttp3.**
73
--dontwarn com.squareup.okhttp.**
74 60
 
75 61
 # okio
76 62
 
@@ -81,16 +67,23 @@
81 67
 
82 68
 # FastImage
83 69
 
84
--keep public class com.dylanvann.fastimage.* {*;}
85 70
 -keep public class com.dylanvann.fastimage.** {*;}
86 71
 
87
--keep class org.webrtc.** { *; }
72
+# We added the following when we switched minifyEnabled on. Probably because we
73
+# ran the app and hit problems...
88 74
 
75
+-keep class com.facebook.react.bridge.CatalystInstanceImpl { *; }
76
+-keep class com.facebook.react.bridge.ExecutorToken { *; }
77
+-keep class com.facebook.react.bridge.JavaScriptExecutor { *; }
78
+-keep class com.facebook.react.bridge.ModuleRegistryHolder { *; }
79
+-keep class com.facebook.react.bridge.ReadableType { *; }
80
+-keep class com.facebook.react.bridge.queue.NativeRunnable { *; }
81
+-keep class com.facebook.react.devsupport.** { *; }
82
+-keep class org.webrtc.** { *; }
89 83
 
84
+-dontwarn com.facebook.react.devsupport.**
90 85
 -dontwarn com.google.appengine.**
86
+-dontwarn com.squareup.okhttp.**
91 87
 -dontwarn javax.servlet.**
92 88
 
93
-# Crashlytics
94
--keepattributes *Annotation*
95
--keepattributes SourceFile,LineNumberTable
96
--keep public class * extends java.lang.Exception
89
+# ^^^ We added the above when we switched minifyEnabled on.

Carregando…
Cancelar
Salvar