mirror of https://github.com/jitsi/jitsi-meet
A libre build will exclude the following: - Analytics modules - Google Play services GMS - Crashlytics - Firebasepull/4168/head jitsi-meet_3710
parent
6bbc2927ab
commit
2d45709a6a
@ -0,0 +1,40 @@ |
||||
package org.jitsi.meet; |
||||
|
||||
import android.net.Uri; |
||||
import android.util.Log; |
||||
|
||||
import com.crashlytics.android.Crashlytics; |
||||
import com.google.firebase.dynamiclinks.FirebaseDynamicLinks; |
||||
import io.fabric.sdk.android.Fabric; |
||||
|
||||
import org.jitsi.meet.sdk.JitsiMeetActivity; |
||||
|
||||
/** |
||||
* Helper class to initialize Google related services and functionality. |
||||
* This functionality is compiled conditionally and called via reflection, that's why it was |
||||
* extracted here. |
||||
* |
||||
* "Libre builds" (builds with the LIBRE_BUILD flag set) will not include this file. |
||||
*/ |
||||
final class GoogleServicesHelper { |
||||
public static void initialize(JitsiMeetActivity activity) { |
||||
if (BuildConfig.GOOGLE_SERVICES_ENABLED) { |
||||
Log.d(activity.getClass().getSimpleName(), "Initializing Google Services"); |
||||
|
||||
Fabric.with(activity, new Crashlytics()); |
||||
|
||||
FirebaseDynamicLinks.getInstance().getDynamicLink(activity.getIntent()) |
||||
.addOnSuccessListener(activity, pendingDynamicLinkData -> { |
||||
Uri dynamicLink = null; |
||||
|
||||
if (pendingDynamicLinkData != null) { |
||||
dynamicLink = pendingDynamicLinkData.getLink(); |
||||
} |
||||
|
||||
if (dynamicLink != null) { |
||||
activity.join(dynamicLink.toString()); |
||||
} |
||||
}); |
||||
} |
||||
} |
||||
} |
@ -1,4 +1,4 @@ |
||||
/* @flow */ |
||||
// @flow
|
||||
|
||||
import _ from 'lodash'; |
||||
|
@ -0,0 +1,21 @@ |
||||
// @flow
|
||||
|
||||
import { NativeModules } from 'react-native'; |
||||
|
||||
export * from './functions.any'; |
||||
|
||||
/** |
||||
* Removes all analytics related options from the given configuration, in case of a libre build. |
||||
* |
||||
* @param {*} config - The configuration which needs to be cleaned up. |
||||
* @returns {void} |
||||
*/ |
||||
export function _cleanupConfig(config: Object) { |
||||
if (NativeModules.AppInfo.LIBRE_BUILD) { |
||||
config.analytics.scriptURLs = []; |
||||
delete config.analytics.amplitudeAPPKey; |
||||
delete config.analytics.googleAnalyticsTrackingId; |
||||
delete config.callStatsID; |
||||
delete config.callStatsSecret; |
||||
} |
||||
} |
@ -0,0 +1,12 @@ |
||||
// @flow
|
||||
|
||||
export * from './functions.any'; |
||||
|
||||
/** |
||||
* Removes all analytics related options from the given configuration, in case of a libre build. |
||||
* |
||||
* @param {*} config - The configuration which needs to be cleaned up. |
||||
* @returns {void} |
||||
*/ |
||||
export function _cleanupConfig(config: Object) { // eslint-disable-line no-unused-vars
|
||||
} |
Loading…
Reference in new issue