Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove all remaining legacy analytics native code #8829

Merged
merged 9 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .android.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export MM_FOX_CODE="EXAMPLE_FOX_CODE"
export MM_BRANCH_KEY_TEST=
export MM_BRANCH_KEY_LIVE=
export MM_MIXPANEL_TOKEN=
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "ios/mixpanel-iphone"]
path = ios/mixpanel-iphone
url = https://github.com/metamask/mixpanel-iphone
[submodule "ios/branch-ios-sdk"]
path = ios/branch-ios-sdk
url = https://github.com/metamask/ios-branch-deep-linking-attribution
2 changes: 0 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
manifestPlaceholders.MM_BRANCH_KEY_TEST = "$System.env.MM_BRANCH_KEY_TEST"
manifestPlaceholders.MM_BRANCH_KEY_LIVE = "$System.env.MM_BRANCH_KEY_LIVE"
manifestPlaceholders.MM_MIXPANEL_TOKEN = "$System.env.MM_MIXPANEL_TOKEN"
}

packagingOptions {
Expand Down Expand Up @@ -294,7 +293,6 @@ dependencies {
implementation(files("../libs/nativesdk.aar"))
implementation("com.facebook.react:react-android")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
implementation('com.mixpanel.android:mixpanel-android:5.+')
implementation 'org.apache.commons:commons-compress:1.22'
androidTestImplementation 'org.mockito:mockito-android:4.2.0'
androidTestImplementation 'androidx.test:core:1.5.0'
Expand Down
4 changes: 0 additions & 4 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@
android:value="io.metamask"/>
<meta-data android:name="com.dieam.reactnativepushnotification.notification_color"
android:resource="@color/lightgray"/>
<!-- MIXPANEL -->
<meta-data android:name="com.mixpanel.android.mpmetrics.MixpanelAPI.token" android:value="${MM_MIXPANEL_TOKEN}" />
<activity android:name="com.mixpanel.android.takeoverinapp.TakeoverInAppActivity"
android:theme="@style/com_mixpanel_android_TakeoverInAppActivityTheme"/>

<provider
android:name="androidx.core.content.FileProvider"
Expand Down
9 changes: 0 additions & 9 deletions android/app/src/main/java/io/metamask/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactActivityDelegate;
import com.mixpanel.android.mpmetrics.MixpanelAPI;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.util.Log;
Expand Down Expand Up @@ -34,14 +33,6 @@ protected String getMainComponentName() {
protected void onStart() {
super.onStart();
RNBranchModule.initSession(getIntent().getData(), this);

try{
ApplicationInfo ai = this.getPackageManager().getApplicationInfo(this.getPackageName(), PackageManager.GET_META_DATA);
String mixpanelToken = (String)ai.metaData.get("com.mixpanel.android.mpmetrics.MixpanelAPI.token");
MixpanelAPI.getInstance(this, mixpanelToken);
}catch (PackageManager.NameNotFoundException e){
Log.d("RCTAnalytics","init:token missing");
}
}

@Override
Expand Down
2 changes: 0 additions & 2 deletions android/app/src/main/java/io/metamask/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import cl.json.ShareApplication;
import io.branch.rnbranch.RNBranchModule;
import io.metamask.nativeModules.RCTMinimizerPackage;
import io.metamask.nativeModules.RCTAnalyticsPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
Expand Down Expand Up @@ -45,7 +44,6 @@ protected List<ReactPackage> getPackages() {
packages.add(new LottiePackage());
packages.add(new PreventScreenshotPackage());
packages.add(new ReactVideoPackage());
packages.add(new RCTAnalyticsPackage());
packages.add(new RCTMinimizerPackage());
packages.add(new NativeSDKPackage());
packages.add(new RNTarPackage());
Expand Down

This file was deleted.

This file was deleted.

10 changes: 10 additions & 0 deletions app/constants/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ export const ANALYTICS_DATA_DELETION_DATE = `${prefix}analyticsDataDeletionDate`
export const METAMETRICS_DELETION_REGULATION_ID = `${prefix}MetaMetricsDeletionRegulationId`;
export const ANALYTICS_DATA_RECORDED = `${prefix}analyticsDataRecorded`;
export const METAMETRICS_ID = `${prefix}MetaMetricsId`;

/**
* @deprecated, use {@link METAMETRICS_ID} instead
* Keeping MIXPANEL_METAMETRICS_ID for backward compatibility
*
* TODO remove MIXPANEL_METAMETRICS_ID:
* - add a migration
* - remove the legacy id test from {@link MetaMetrics}.#getMetaMetricsId()
* @see https://github.com/MetaMask/metamask-mobile/issues/8833
*/
export const MIXPANEL_METAMETRICS_ID = `${prefix}MixpanelMetaMetricsId`;

export const WALLETCONNECT_SESSIONS = `${prefix}walletconnectSessions`;
Expand Down
4 changes: 0 additions & 4 deletions app/constants/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ export const KEYSTONE_LEARN_MORE =
'https://keyst.one/metamask?rfsn=6088257.656b3e9&utm_source=refersion&utm_medium=affiliate&utm_campaign=6088257.656b3e9';
export const KEYSTONE_SUPPORT_VIDEO = 'https://keyst.one/mmmvideo';

// MixPanel
export const MIXPANEL_PROXY_ENDPOINT_BASE_URL =
'https://proxy.metafi.codefi.network/mixpanel/v1/api/app';

// Network
export const CHAINLIST_URL = 'https://chainlist.wtf';
export const MM_ETHERSCAN_URL = 'https://etherscamdb.info/domain/meta-mask.com';
Expand Down
6 changes: 0 additions & 6 deletions app/util/test/testSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,6 @@ NativeModules.RNCNetInfo = {
getCurrentState: jest.fn(() => Promise.resolve()),
};

NativeModules.RCTAnalytics = {
optIn: jest.fn(),
trackEvent: jest.fn(),
getRemoteVariables: jest.fn(),
};

NativeModules.PlatformConstants = {
forceTouchAvailable: false,
};
Expand Down
Loading
Loading