Skip to content

Commit

Permalink
Merge pull request #811 from MetaMask/develop
Browse files Browse the repository at this point in the history
Release v0.1.8
  • Loading branch information
Bruno Barbieri authored Jul 13, 2019
2 parents 9da0b2b + 96a153c commit 321053b
Show file tree
Hide file tree
Showing 263 changed files with 24,854 additions and 12,435 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "mixpanel-iphone"]
path = mixpanel-iphone
url = git@github.com:mixpanel/mixpanel-iphone.git
[submodule "ios/mixpanel-iphone"]
path = ios/mixpanel-iphone
url = git@github.com:mixpanel/mixpanel-iphone.git
27 changes: 18 additions & 9 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -174,22 +174,23 @@ android {
applicationId "io.metamask"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 8
versionName "0.1.7"
versionCode 9
versionName "0.1.8"
multiDexEnabled true
testBuildType System.getProperty('testBuildType', 'debug')
missingDimensionStrategy "minReactNative", "minReactNative46"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
abiFilters "armeabi-v7a", "x86"
abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
dexOptions {
javaMaxHeapSize "2048M"
}

manifestPlaceholders = [
MM_BRANCH_KEY_TEST: "$System.env.MM_BRANCH_KEY_TEST",
MM_BRANCH_KEY_LIVE: "$System.env.MM_BRANCH_KEY_LIVE"
MM_BRANCH_KEY_LIVE: "$System.env.MM_BRANCH_KEY_LIVE",
MM_MIXPANEL_TOKEN: "$System.env.MM_MIXPANEL_TOKEN"
]
missingDimensionStrategy 'react-native-camera', 'general'

Expand All @@ -213,6 +214,12 @@ android {
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}

packagingOptions {
pickFirst 'lib/x86_64/libjsc.so'
pickFirst 'lib/arm64-v8a/libjsc.so'
}

buildTypes {
debug {
manifestPlaceholders = [isDebug:true]
Expand Down Expand Up @@ -248,6 +255,8 @@ android {
}

dependencies {
implementation project(':react-native-fabric')
implementation project(':@react-native-community_netinfo')
implementation project(':react-native-view-shot')
implementation project(':lottie-react-native')
implementation project(':@react-native-community_async-storage')
Expand All @@ -257,9 +266,9 @@ dependencies {
implementation project(':react-native-svg')
implementation project(':react-native-gesture-handler')
implementation project(':react-native-screens')
implementation 'com.android.support:multidex:1.0.1'
implementation "com.android.support:support-annotations:27.1.1"
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation "com.facebook.react:react-native:+" // From node_modules

implementation project(':react-native-branch')
Expand All @@ -269,13 +278,13 @@ dependencies {
implementation project(':react-native-camera')
implementation project(':react-native-share')
implementation project(':react-native-i18n')
implementation project(':react-native-fabric')
implementation project(':react-native-aes-crypto')
implementation project(':react-native-keychain')
implementation project(':react-native-os')
implementation project(':react-native-randombytes')
implementation project(':react-native-fs')
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;
Expand Down
44 changes: 43 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-sdk tools:overrideLibrary="com.tectiv3.aes" />
Expand Down Expand Up @@ -43,12 +44,51 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- Branch URI Scheme -->
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="metamask.app.link" />
<data android:scheme="https" android:host="metamask-alternate.app.link" />
<data android:scheme="https" android:host="metamask.test-app.link" />
<data android:scheme="https" android:host="metamask-alternate.test-app.link" />
</intent-filter>
<intent-filter>
<data android:scheme="metamask" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<intent-filter>
<data android:scheme="ethereum" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<intent-filter>
<data android:scheme="dapp" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<intent-filter>
<data android:scheme="wc" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<intent-filter>
<data android:scheme="http" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<intent-filter>
<data android:scheme="https" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>

<!-- Branch App Links (optional) -->
<intent-filter android:autoVerify="true">
Expand All @@ -70,6 +110,8 @@
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}" />

<!-- Branch install referrer tracking (optional) -->
<receiver android:name="io.branch.referral.InstallListener" android:exported="true">
Expand All @@ -80,7 +122,7 @@


<provider
android:name="android.support.v4.content.FileProvider"
android:name="androidx.core.content.FileProvider"
android:authorities="io.metamask.provider"
android:grantUriPermissions="true"
android:exported="false">
Expand Down
20 changes: 16 additions & 4 deletions android/app/src/main/java/io/metamask/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactFragmentActivity;
import com.facebook.react.ReactRootView;
import com.mixpanel.android.mpmetrics.MixpanelAPI;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;

import io.branch.rnbranch.*;

import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;

import androidx.annotation.NonNull;

public class MainActivity extends ReactFragmentActivity {

Expand All @@ -25,9 +31,15 @@ protected String getMainComponentName() {
@Override
protected void onStart() {
super.onStart();
if(!BuildConfig.DEBUG){
RNBranchModule.initSession(getIntent().getData(), this);
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 All @@ -43,7 +55,7 @@ public void onNewIntent(Intent intent) {
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Nullable
@NonNull
@Override
protected Bundle getLaunchOptions() {
Bundle bundle = new Bundle();
Expand Down
20 changes: 12 additions & 8 deletions android/app/src/main/java/io/metamask/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import com.crashlytics.android.Crashlytics;
import com.facebook.react.ReactApplication;
import com.smixx.fabric.FabricPackage;
import com.reactnativecommunity.netinfo.NetInfoPackage;
import fr.greweb.reactnativeviewshot.RNViewShotPackage;
import com.airbnb.android.react.lottie.LottiePackage;
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
Expand All @@ -13,16 +15,16 @@
import com.horcrux.svg.SvgPackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import io.branch.rnbranch.RNBranchPackage;
import io.branch.referral.Branch;
import io.branch.rnbranch.RNBranchModule;
import com.web3webview.Web3WebviewPackage;
import io.metamask.nativeModules.RCTAnalyticsPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import cl.json.RNSharePackage;
import com.bitgo.randombytes.RandomBytesPackage;
import com.peel.react.rnos.RNOSModule;
import com.oblador.keychain.KeychainPackage;
import com.AlexanderZaytsev.RNI18n.RNI18nPackage;
import com.rnfs.RNFSPackage;
import com.smixx.fabric.FabricPackage;
import org.reactnative.camera.RNCameraPackage;
import com.tectiv3.aes.RCTAesPackage;
import com.swmansion.rnscreens.RNScreensPackage;
Expand All @@ -35,7 +37,7 @@
import java.util.Arrays;
import java.util.List;

import android.support.multidex.MultiDexApplication;
import androidx.multidex.MultiDexApplication;


public class MainApplication extends MultiDexApplication implements ShareApplication, ReactApplication {
Expand All @@ -50,8 +52,10 @@ public boolean getUseDeveloperSupport() {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNViewShotPackage(),
new LottiePackage(),
new FabricPackage(),
new NetInfoPackage(),
new RNViewShotPackage(),
new LottiePackage(),
new AsyncStoragePackage(),
new ReactNativePushNotificationPackage(),
new BackgroundTimerPackage(),
Expand All @@ -60,7 +64,6 @@ protected List<ReactPackage> getPackages() {
new RNGestureHandlerPackage(),
new RNScreensPackage(),
new RNBranchPackage(),
new FabricPackage(),
new KeychainPackage(),
new RandomBytesPackage(),
new RCTAesPackage(),
Expand All @@ -70,7 +73,8 @@ protected List<ReactPackage> getPackages() {
new RNOSModule(),
new RNSharePackage(),
new VectorIconsPackage(),
new Web3WebviewPackage()
new Web3WebviewPackage(),
new RCTAnalyticsPackage()
);
}

Expand All @@ -90,8 +94,8 @@ public void onCreate() {
super.onCreate();
if (!BuildConfig.DEBUG){
Fabric.with(this, new Crashlytics());
Branch.getAutoInstance(this);
}
RNBranchModule.getAutoInstance(this);
SoLoader.init(this, /* native exopackage */ false);
}

Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/java/io/metamask/SplashActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;

public class SplashActivity extends AppCompatActivity {
@Override
Expand Down
Loading

0 comments on commit 321053b

Please sign in to comment.