Browse Source

doc: document required proguard rules

j8
Saúl Ibarra Corretgé 8 years ago
parent
commit
f6ace61674
1 changed files with 67 additions and 1 deletions
  1. 67
    1
      android/README.md

+ 67
- 1
android/README.md View File

16
    `"file:${rootProject.projectDir}/../../../jitsi/jitsi-maven-repository/releases"`
16
    `"file:${rootProject.projectDir}/../../../jitsi/jitsi-maven-repository/releases"`
17
    in android/build.gradle for the third-party react-native modules which Jitsi
17
    in android/build.gradle for the third-party react-native modules which Jitsi
18
    Meet SDK for Android depends on and are not publicly available in Maven
18
    Meet SDK for Android depends on and are not publicly available in Maven
19
-   repositories. Generally, if you are modifying the JavaSource code of Jitsi
19
+   repositories. Generally, if you are modifying the JavaScript code of Jitsi
20
    Meet SDK for Android only, you will very likely need to consider the former
20
    Meet SDK for Android only, you will very likely need to consider the former
21
    only.
21
    only.
22
 
22
 
309
 
309
 
310
 The `data` `Map` contains an "error" key with the error and a "url" key with the
310
 The `data` `Map` contains an "error" key with the error and a "url" key with the
311
 conference URL which necessitated the loading of the configuration file.
311
 conference URL which necessitated the loading of the configuration file.
312
+
313
+## ProGuard rules
314
+
315
+When using the SDK on a project some proguard rules have to be added in order
316
+to avoid necessary code being stripped. Add the following to your project's
317
+rules file:
318
+
319
+```
320
+# React Native
321
+
322
+# Keep our interfaces so they can be used by other ProGuard rules.
323
+# See http://sourceforge.net/p/proguard/bugs/466/
324
+-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
325
+-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
326
+-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
327
+
328
+# Do not strip any method/class that is annotated with @DoNotStrip
329
+-keep @com.facebook.proguard.annotations.DoNotStrip class *
330
+-keep @com.facebook.common.internal.DoNotStrip class *
331
+-keepclassmembers class * {
332
+    @com.facebook.proguard.annotations.DoNotStrip *;
333
+    @com.facebook.common.internal.DoNotStrip *;
334
+}
335
+
336
+-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
337
+  void set*(***);
338
+  *** get*();
339
+}
340
+
341
+-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
342
+-keep class * extends com.facebook.react.bridge.NativeModule { *; }
343
+-keepclassmembers,includedescriptorclasses class * { native <methods>; }
344
+-keepclassmembers class *  { @com.facebook.react.uimanager.UIProp <fields>; }
345
+-keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
346
+-keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
347
+
348
+-dontwarn com.facebook.react.**
349
+
350
+# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
351
+# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
352
+-dontwarn android.text.StaticLayout
353
+
354
+# okhttp
355
+
356
+-keepattributes Signature
357
+-keepattributes *Annotation*
358
+-keep class okhttp3.** { *; }
359
+-keep interface okhttp3.** { *; }
360
+-dontwarn okhttp3.**
361
+
362
+# okio
363
+
364
+-keep class sun.misc.Unsafe { *; }
365
+-dontwarn java.nio.file.*
366
+-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
367
+-dontwarn okio.**
368
+
369
+# WebRTC
370
+
371
+-keep class org.webrtc.** { *; }
372
+
373
+# Jisti Meet SDK
374
+
375
+-keep class org.jitsi.meet.sdk.** { *; }
376
+```
377
+

Loading…
Cancel
Save