Skip to content

Commit

Permalink
Remove Fabric and Crashlytics
Browse files Browse the repository at this point in the history
The Logger now logs to `console.log` exclusively.
  • Loading branch information
Gudahtt committed Feb 18, 2020
1 parent 4f4964c commit c8bc08b
Show file tree
Hide file tree
Showing 38 changed files with 2 additions and 1,267 deletions.
1 change: 0 additions & 1 deletion .android.env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export MM_FOX_CODE=
export MM_FABRIC_API_KEY=
export MM_BRANCH_KEY_TEST=
export MM_BRANCH_KEY_LIVE=
export MM_MIXPANEL_TOKEN=
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ app/bin
.gradle
local.properties
*.iml
android/app/src/main/assets/crashlytics-build.properties
android/app/src/main/res/values/com_crashlytics_export_strings.xml
android/.project
android/app/.project
android/app/bin/
Expand Down
1 change: 0 additions & 1 deletion .ios.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
MM_FOX_CODE =
MM_FABRIC_API_KEY =
MM_BRANCH_KEY_TEST =
MM_BRANCH_KEY_LIVE =
46 changes: 0 additions & 46 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,8 @@ def getPassword(String currentUser, String keyChain) {
stdout.toString().trim()
}

buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
// These docs use an open ended version so that our plugin
// can be updated quickly in response to Android tooling updates

// We recommend changing it to the latest version from our changelog:
// https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
classpath 'io.fabric.tools:gradle:1.+'
}
}

apply plugin: "com.android.application"

apply plugin: 'io.fabric'


repositories {
maven { url 'https://maven.fabric.io/public' }
jcenter()
}

import com.android.build.OutputFile

/**
Expand Down Expand Up @@ -142,27 +119,8 @@ def enableSeparateBuildPerCPUArchitecture = false
*/
def enableProguardInReleaseBuilds = false

/**
*
* override fabric properties file if MM_FABRIC_API_KEY is set
*/
def buildFabricPropertiesIfNeeded() {
def FABRIC_API_KEY = System.getenv('MM_FABRIC_API_KEY')
if (FABRIC_API_KEY) {
def commentMessage = "AUTOGEN FABRIC PROPERTIES"
ant.propertyfile(file: "fabric.properties", comment: commentMessage) {
entry(key: "apiKey", value: FABRIC_API_KEY)
}
}
}

android {


afterEvaluate {
buildFabricPropertiesIfNeeded()
}

compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
Expand Down Expand Up @@ -253,7 +211,6 @@ dependencies {
implementation project(':react-native-sensors')
implementation project(':react-native-reanimated')
implementation project(':react-native-webview')
implementation project(':react-native-fabric')
implementation project(':@react-native-community_netinfo')
implementation project(':react-native-view-shot')
implementation project(':lottie-react-native')
Expand Down Expand Up @@ -285,9 +242,6 @@ dependencies {
implementation project(':react-native-vector-icons')
implementation 'com.mixpanel.android:mixpanel-android:5.+'

implementation('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') {
transitive = true;
}
androidTestImplementation('com.wix:detox:+') { transitive = true }
androidTestImplementation 'junit:junit:4.12'
}
Expand Down
3 changes: 0 additions & 3 deletions android/app/fabric.properties

This file was deleted.

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 @@ -4,7 +4,6 @@
import com.sensors.RNSensorsPackage;
import com.swmansion.reanimated.ReanimatedPackage;
import com.reactnativecommunity.webview.RNCWebViewPackage;
import com.smixx.fabric.FabricPackage;
import com.reactnativecommunity.netinfo.NetInfoPackage;
import fr.greweb.reactnativeviewshot.RNViewShotPackage;
import com.airbnb.android.react.lottie.LottiePackage;
Expand Down Expand Up @@ -53,7 +52,6 @@ protected List<ReactPackage> getPackages() {
new RNSensorsPackage(),
new ReanimatedPackage(),
new RNCWebViewPackage(),
new FabricPackage(),
new NetInfoPackage(),
new RNViewShotPackage(),
new LottiePackage(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import android.content.pm.PackageManager;
import android.util.Log;

import com.crashlytics.android.Crashlytics;
import com.crashlytics.android.core.CrashlyticsCore;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
Expand All @@ -23,8 +21,6 @@
import java.util.ArrayList;
import java.util.HashMap;

import io.fabric.sdk.android.Fabric;

public class RCTAnalytics extends ReactContextBaseJavaModule {

MixpanelAPI mixpanel;
Expand Down Expand Up @@ -63,7 +59,6 @@ public void optIn(boolean val) {

if(val){
this.mixpanel.optInTracking();
Fabric.with(this.getReactApplicationContext(), new Crashlytics());

}else{
this.mixpanel.optOutTracking();
Expand Down
14 changes: 0 additions & 14 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,3 @@ allprojects {
}
}
}

subprojects {project ->
if (project.name.contains('react-native-fabric')) {
buildscript {
repositories {
google()
jcenter()
maven {
url = 'https://dl.bintray.com/android/android-tools/'
}
}
}
}
}
2 changes: 0 additions & 2 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ include ':react-native-reanimated'
project(':react-native-reanimated').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-reanimated/android')
include ':react-native-webview'
project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview/android')
include ':react-native-fabric'
project(':react-native-fabric').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fabric/android')
include ':@react-native-community_netinfo'
project(':@react-native-community_netinfo').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/netinfo/android')
include ':react-native-view-shot'
Expand Down
13 changes: 2 additions & 11 deletions app/util/Logger.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
'use strict';
// eslint-disable-next-line import/default
import Fabric from 'react-native-fabric';
import { Platform } from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';

/**
Expand All @@ -18,14 +15,13 @@ export default class Logger {
* @returns - void
*/
static async log(...args) {
// TODO use crashlytics opt-in
// Check if user passed accepted opt-in to metrics
const metricsOptIn = await AsyncStorage.getItem('@MetaMask:metricsOptIn');
if (__DEV__) {
args.unshift('[MetaMask DEBUG]:');
console.log.apply(null, args); // eslint-disable-line no-console
} else if (metricsOptIn === 'agreed') {
Fabric.Crashlytics.log(JSON.stringify(args));
console.log(args);
}
}

Expand All @@ -36,18 +32,13 @@ export default class Logger {
* @returns - void
*/
static async error(...args) {
// TODO use crashlytics opt-in
// Check if user passed accepted opt-in to metrics
const metricsOptIn = await AsyncStorage.getItem('@MetaMask:metricsOptIn');
if (__DEV__) {
args.unshift('[MetaMask DEBUG]:');
console.warn(args); // eslint-disable-line no-console
} else if (metricsOptIn === 'agreed') {
if (Platform.OS === 'android') {
Fabric.Crashlytics.logException(JSON.stringify(args));
} else {
Fabric.Crashlytics.recordError(JSON.stringify(args));
}
console.log(args);
}
}
}
1 change: 0 additions & 1 deletion app/util/testSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ jest.mock('../core/Engine', () => ({

jest.mock('react-native-keychain', () => ({ getSupportedBiometryType: () => Promise.resolve('FaceId') }));
jest.mock('react-native-share', () => 'RNShare');
jest.mock('react-native-fabric', () => 'Fabric');
jest.mock('react-native-branch', () => 'RNBranch');
jest.mock('react-native-sensors', () => 'RNSensors');
jest.mock('react-native-device-info', () => 'DeviceInfo');
Expand Down
Binary file removed ios/Crashlytics.framework/Crashlytics
Binary file not shown.
31 changes: 0 additions & 31 deletions ios/Crashlytics.framework/Headers/ANSCompatibility.h

This file was deleted.

Loading

0 comments on commit c8bc08b

Please sign in to comment.