Selaa lähdekoodia

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 vuotta sitten
vanhempi
commit
2def75db50

+ 8
- 9
android/sdk/build.gradle Näytä tiedosto

51
     implementation 'com.google.code.gson:gson:2.8.6'
51
     implementation 'com.google.code.gson:gson:2.8.6'
52
     implementation "androidx.startup:startup-runtime:1.1.0"
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
         implementation project(':react-native-amplitude')
56
         implementation project(':react-native-amplitude')
62
-        implementation project(':react-native-device-info')
57
+        implementation project(':react-native-giphy')
63
         implementation(project(":react-native-google-signin")) {
58
         implementation(project(":react-native-google-signin")) {
64
             exclude group: 'com.google.android.gms'
59
             exclude group: 'com.google.android.gms'
65
             exclude group: 'androidx'
60
             exclude group: 'androidx'
72
     implementation project(':react-native-community_clipboard')
67
     implementation project(':react-native-community_clipboard')
73
     implementation project(':react-native-community_netinfo')
68
     implementation project(':react-native-community_netinfo')
74
     implementation project(':react-native-default-preference')
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
     implementation project(':react-native-gesture-handler')
75
     implementation project(':react-native-gesture-handler')
76
     implementation project(':react-native-get-random-values')
76
     implementation project(':react-native-get-random-values')
77
-    implementation project(':react-native-giphy')
78
     implementation project(':react-native-immersive')
77
     implementation project(':react-native-immersive')
79
     implementation project(':react-native-keep-awake')
78
     implementation project(':react-native-keep-awake')
80
     implementation project(':react-native-masked-view_masked-view')
79
     implementation project(':react-native-masked-view_masked-view')

+ 15
- 2
android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java Näytä tiedosto

46
 import java.util.List;
46
 import java.util.List;
47
 
47
 
48
 class ReactInstanceManagerHolder {
48
 class ReactInstanceManagerHolder {
49
+    private static final String TAG = ReactInstanceManagerHolder.class.getSimpleName();
50
+
49
     /**
51
     /**
50
      * FIXME (from linter): Do not place Android context classes in static
52
      * FIXME (from linter): Do not place Android context classes in static
51
      * fields (static reference to ReactInstanceManager which has field
53
      * fields (static reference to ReactInstanceManager which has field
110
             new com.corbt.keepawake.KCKeepAwakePackage(),
112
             new com.corbt.keepawake.KCKeepAwakePackage(),
111
             new com.facebook.react.shell.MainReactPackage(),
113
             new com.facebook.react.shell.MainReactPackage(),
112
             new com.reactnativecommunity.clipboard.ClipboardPackage(),
114
             new com.reactnativecommunity.clipboard.ClipboardPackage(),
113
-            new com.giphyreactnativesdk.GiphyReactNativeSdkPackage(),
114
             new com.reactnativecommunity.netinfo.NetInfoPackage(),
115
             new com.reactnativecommunity.netinfo.NetInfoPackage(),
115
             new com.reactnativepagerview.PagerViewPackage(),
116
             new com.reactnativepagerview.PagerViewPackage(),
116
             new com.oblador.performance.PerformancePackage(),
117
             new com.oblador.performance.PerformancePackage(),
146
             packages.add((ReactPackage)constructor.newInstance());
147
             packages.add((ReactPackage)constructor.newInstance());
147
         } catch (Exception e) {
148
         } catch (Exception e) {
148
             // Ignore any error, the module is not compiled when LIBRE_BUILD is enabled.
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
         // RNGoogleSignInPackage
163
         // RNGoogleSignInPackage
155
             packages.add((ReactPackage)constructor.newInstance());
167
             packages.add((ReactPackage)constructor.newInstance());
156
         } catch (Exception e) {
168
         } catch (Exception e) {
157
             // Ignore any error, the module is not compiled when LIBRE_BUILD is enabled.
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
         return packages;
173
         return packages;
240
             return;
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
         reactInstanceManager
258
         reactInstanceManager
246
             = ReactInstanceManager.builder()
259
             = ReactInstanceManager.builder()

+ 1
- 0
react/features/base/config/functions.native.js Näytä tiedosto

19
         delete config.analytics?.googleAnalyticsTrackingId;
19
         delete config.analytics?.googleAnalyticsTrackingId;
20
         delete config.callStatsID;
20
         delete config.callStatsID;
21
         delete config.callStatsSecret;
21
         delete config.callStatsSecret;
22
+        config.giphy = { enabled: false };
22
     }
23
     }
23
 }
24
 }
24
 
25
 

Loading…
Peruuta
Tallenna