player-ui / player

https://player-ui.github.io
MIT License
73 stars 47 forks source link

Add proguard rules for Android #499

Open chris-fitzgerald-ck opened 2 months ago

chris-fitzgerald-ck commented 2 months ago

Is your feature request related to a problem? Please describe. Integrating player into a library with minification on would be easier with a sample proguard file. Defining the least needed rules would also allow clients to integrate while adding the most obfuscated and minified build possible.

Describe the solution you'd like It would be nice to have a sample proguard file that keeps all the classes that are used across the bridge with reflection, but still allows unused code to be stripped (or at least obfuscated).

Additional context Currently, our rules look like this for player:

# These libraries use reflection for bridge methods between the JNI and JVM
-keep @com.facebook.jni.annotations.DoNotStrip public class * { *; }
-keep @com.facebook.jni.annotations.DoNotStripAny public class * { *; }
-keep class com.intuit.playerui.** { *; }
-keepnames class * extends com.intuit.playerui.jsi.HostFunctionInterface { *; }