Bladeren bron

fix(android) exclude the Giphy SDK from the libre build

Fixes: https://github.com/jitsi/jitsi-meet/issues/11759
factor2
Saúl Ibarra Corretgé 3 jaren geleden
bovenliggende
commit
2def75db50

+ 8
- 9
android/sdk/build.gradle Bestand weergeven

@@ -51,15 +51,10 @@ dependencies {
51 51
     implementation 'com.google.code.gson:gson:2.8.6'
52 52
     implementation "androidx.startup:startup-runtime:1.1.0"
53 53
 
54
-    if (rootProject.ext.libreBuild) {
55
-        implementation(project(':react-native-device-info')) {
56
-            exclude group: 'com.google.firebase'
57
-            exclude group: 'com.google.android.gms'
58
-            exclude group: 'com.android.installreferrer'
59
-        }
60
-    } else {
54
+    // Only add these packages if we are NOT doing a LIBRE_BUILD
55
+    if (!rootProject.ext.libreBuild) {
61 56
         implementation project(':react-native-amplitude')
62
-        implementation project(':react-native-device-info')
57
+        implementation project(':react-native-giphy')
63 58
         implementation(project(":react-native-google-signin")) {
64 59
             exclude group: 'com.google.android.gms'
65 60
             exclude group: 'androidx'
@@ -72,9 +67,13 @@ dependencies {
72 67
     implementation project(':react-native-community_clipboard')
73 68
     implementation project(':react-native-community_netinfo')
74 69
     implementation project(':react-native-default-preference')
70
+    implementation(project(':react-native-device-info')) {
71
+        exclude group: 'com.google.firebase'
72
+        exclude group: 'com.google.android.gms'
73
+        exclude group: 'com.android.installreferrer'
74
+    }
75 75
     implementation project(':react-native-gesture-handler')
76 76
     implementation project(':react-native-get-random-values')
77
-    implementation project(':react-native-giphy')
78 77
     implementation project(':react-native-immersive')
79 78
     implementation project(':react-native-keep-awake')
80 79
     implementation project(':react-native-masked-view_masked-view')

+ 15
- 2
android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java Bestand weergeven

@@ -46,6 +46,8 @@ import java.util.Arrays;
46 46
 import java.util.List;
47 47
 
48 48
 class ReactInstanceManagerHolder {
49
+    private static final String TAG = ReactInstanceManagerHolder.class.getSimpleName();
50
+
49 51
     /**
50 52
      * FIXME (from linter): Do not place Android context classes in static
51 53
      * fields (static reference to ReactInstanceManager which has field
@@ -110,7 +112,6 @@ class ReactInstanceManagerHolder {
110 112
             new com.corbt.keepawake.KCKeepAwakePackage(),
111 113
             new com.facebook.react.shell.MainReactPackage(),
112 114
             new com.reactnativecommunity.clipboard.ClipboardPackage(),
113
-            new com.giphyreactnativesdk.GiphyReactNativeSdkPackage(),
114 115
             new com.reactnativecommunity.netinfo.NetInfoPackage(),
115 116
             new com.reactnativepagerview.PagerViewPackage(),
116 117
             new com.oblador.performance.PerformancePackage(),
@@ -146,6 +147,17 @@ class ReactInstanceManagerHolder {
146 147
             packages.add((ReactPackage)constructor.newInstance());
147 148
         } catch (Exception e) {
148 149
             // Ignore any error, the module is not compiled when LIBRE_BUILD is enabled.
150
+            Log.d(TAG, "Not loading AmplitudeReactNativePackage");
151
+        }
152
+
153
+        // GiphyReactNativeSdkPackage
154
+        try {
155
+            Class<?> giphyPackageClass = Class.forName("com.giphyreactnativesdk.GiphyReactNativeSdkPackage");
156
+            Constructor constructor = giphyPackageClass.getConstructor();
157
+            packages.add((ReactPackage)constructor.newInstance());
158
+        } catch (Exception e) {
159
+            // Ignore any error, the module is not compiled when LIBRE_BUILD is enabled.
160
+            Log.d(TAG, "Not loading GiphyReactNativeSdkPackage");
149 161
         }
150 162
 
151 163
         // RNGoogleSignInPackage
@@ -155,6 +167,7 @@ class ReactInstanceManagerHolder {
155 167
             packages.add((ReactPackage)constructor.newInstance());
156 168
         } catch (Exception e) {
157 169
             // Ignore any error, the module is not compiled when LIBRE_BUILD is enabled.
170
+            Log.d(TAG, "Not loading RNGoogleSignInPackage");
158 171
         }
159 172
 
160 173
         return packages;
@@ -240,7 +253,7 @@ class ReactInstanceManagerHolder {
240 253
             return;
241 254
         }
242 255
 
243
-        Log.d(ReactInstanceManagerHolder.class.getCanonicalName(), "initializing RN with Application");
256
+        Log.d(TAG, "initializing RN with Application");
244 257
 
245 258
         reactInstanceManager
246 259
             = ReactInstanceManager.builder()

+ 1
- 0
react/features/base/config/functions.native.js Bestand weergeven

@@ -19,6 +19,7 @@ export function _cleanupConfig(config: Object) {
19 19
         delete config.analytics?.googleAnalyticsTrackingId;
20 20
         delete config.callStatsID;
21 21
         delete config.callStatsSecret;
22
+        config.giphy = { enabled: false };
22 23
     }
23 24
 }
24 25
 

Laden…
Annuleren
Opslaan