From 43f5e7748618968f4a696cad93c85bed9cc3b359 Mon Sep 17 00:00:00 2001 From: Hau Tran Date: Mon, 30 Jan 2023 00:36:31 +0700 Subject: [PATCH] [hautv] Add proguard-rules to example for release --- .../example/android/app/build.gradle | 2 + .../example/android/app/proguard-rules.pro | 109 ++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 jitsi_meet_wrapper/example/android/app/proguard-rules.pro diff --git a/jitsi_meet_wrapper/example/android/app/build.gradle b/jitsi_meet_wrapper/example/android/app/build.gradle index ffe52a2..4a22c74 100644 --- a/jitsi_meet_wrapper/example/android/app/build.gradle +++ b/jitsi_meet_wrapper/example/android/app/build.gradle @@ -55,6 +55,8 @@ android { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.debug + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } diff --git a/jitsi_meet_wrapper/example/android/app/proguard-rules.pro b/jitsi_meet_wrapper/example/android/app/proguard-rules.pro new file mode 100644 index 0000000..f883109 --- /dev/null +++ b/jitsi_meet_wrapper/example/android/app/proguard-rules.pro @@ -0,0 +1,109 @@ +#=== Flutter Wrapper ===# +-keep class io.flutter.app.** { *; } +-keep class io.flutter.plugin.** { *; } +-keep class io.flutter.util.** { *; } +-keep class io.flutter.view.** { *; } +-keep class io.flutter.** { *; } +-keep class io.flutter.plugins.** { *; } + +#=== Jitsi ===# +# Source: https://github.com/jitsi/jitsi-meet/blob/master/android/app/proguard-rules.pro +# Check above link for changes if release builds are broken again + +# Copyright (c) Facebook, Inc. and its affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /usr/local/Cellar/android-sdk/24.3.3/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: + +# React Native + +# Keep our interfaces so they can be used by other ProGuard rules. +# See http://sourceforge.net/p/proguard/bugs/466/ +-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip +-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters +-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip + +# Do not strip any method/class that is annotated with @DoNotStrip +-keep @com.facebook.proguard.annotations.DoNotStrip class * +-keep @com.facebook.common.internal.DoNotStrip class * +-keepclassmembers class * { + @com.facebook.proguard.annotations.DoNotStrip *; + @com.facebook.common.internal.DoNotStrip *; +} + +-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { + void set*(***); + *** get*(); +} + +-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } +-keep class * extends com.facebook.react.bridge.NativeModule { *; } +-keepclassmembers,includedescriptorclasses class * { native ; } +-keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } +-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } +-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } + +-dontwarn com.facebook.react.** +-keep,includedescriptorclasses class com.facebook.react.bridge.** { *; } + +# okhttp + +-keepattributes Signature +-keepattributes *Annotation* +-keep class okhttp3.** { *; } +-keep interface okhttp3.** { *; } +-dontwarn okhttp3.** + +# okio + +-keep class sun.misc.Unsafe { *; } +-dontwarn java.nio.file.* +-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement +-keep class okio.** { *; } +-dontwarn okio.** + +# WebRTC + +-keep class org.webrtc.** { *; } +-dontwarn org.chromium.build.BuildHooksAndroid + +# Jisti Meet SDK + +-keep class org.jitsi.meet.** { *; } +-keep class org.jitsi.meet.sdk.** { *; } + +# We added the following when we switched minifyEnabled on. Probably because we +# ran the app and hit problems... + +-keep class com.facebook.react.bridge.CatalystInstanceImpl { *; } +-keep class com.facebook.react.bridge.ExecutorToken { *; } +-keep class com.facebook.react.bridge.JavaScriptExecutor { *; } +-keep class com.facebook.react.bridge.ModuleRegistryHolder { *; } +-keep class com.facebook.react.bridge.ReadableType { *; } +-keep class com.facebook.react.bridge.queue.NativeRunnable { *; } +-keep class com.facebook.react.devsupport.** { *; } + +-dontwarn com.facebook.react.devsupport.** +-dontwarn com.google.appengine.** +-dontwarn com.squareup.okhttp.** +-dontwarn javax.servlet.** + +# ^^^ We added the above when we switched minifyEnabled on. + +# Rule to avoid build errors related to SVGs. +-keep public class com.horcrux.svg.** {*;} + +# Hermes +-keep class com.facebook.hermes.unicode.** { *; } +