proguard-rules.pro 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # Copyright (c) Facebook, Inc. and its affiliates.
  2. #
  3. # This source code is licensed under the MIT license found in the
  4. # LICENSE file in the root directory of this source tree.
  5. # Add project specific ProGuard rules here.
  6. # By default, the flags in this file are appended to flags specified
  7. # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
  8. # You can edit the include path and order by changing the proguardFiles
  9. # directive in build.gradle.
  10. #
  11. # For more details, see
  12. # http://developer.android.com/guide/developing/tools/proguard.html
  13. # Add any project specific keep options here:
  14. # Disabling obfuscation is useful if you collect stack traces from production crashes
  15. # (unless you are using a system that supports de-obfuscate the stack traces).
  16. # -dontobfuscate
  17. # React Native
  18. # Keep our interfaces so they can be used by other ProGuard rules.
  19. # See http://sourceforge.net/p/proguard/bugs/466/
  20. -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
  21. -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
  22. -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
  23. -keep,allowobfuscation @interface com.facebook.jni.annotations.DoNotStrip
  24. # Do not strip any method/class that is annotated with @DoNotStrip
  25. -keep @com.facebook.proguard.annotations.DoNotStrip class *
  26. -keep @com.facebook.common.internal.DoNotStrip class *
  27. -keep @com.facebook.jni.annotations.DoNotStrip class *
  28. -keepclassmembers class * {
  29. @com.facebook.proguard.annotations.DoNotStrip *;
  30. @com.facebook.common.internal.DoNotStrip *;
  31. @com.facebook.jni.annotations.DoNotStrip *;
  32. }
  33. -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
  34. void set*(***);
  35. *** get*();
  36. }
  37. -keep class * implements com.facebook.react.bridge.JavaScriptModule { *; }
  38. -keep class * implements com.facebook.react.bridge.NativeModule { *; }
  39. -keepclassmembers,includedescriptorclasses class * { native <methods>; }
  40. -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
  41. -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
  42. -dontwarn com.facebook.react.**
  43. -keep,includedescriptorclasses class com.facebook.react.bridge.** { *; }
  44. # hermes
  45. -keep class com.facebook.jni.** { *; }
  46. # okhttp
  47. -keepattributes Signature
  48. -keepattributes *Annotation*
  49. -keep class okhttp3.** { *; }
  50. -keep interface okhttp3.** { *; }
  51. -dontwarn okhttp3.**
  52. # okio
  53. -keep class sun.misc.Unsafe { *; }
  54. -dontwarn java.nio.file.*
  55. -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
  56. -dontwarn okio.**