diff --git a/.android.env.example b/.android.env.example deleted file mode 100644 index 43ce09de97bb..000000000000 --- a/.android.env.example +++ /dev/null @@ -1,5 +0,0 @@ -export MM_FOX_CODE= -export MM_FABRIC_API_KEY= -export MM_BRANCH_KEY_TEST= -export MM_BRANCH_KEY_LIVE= -export MM_MIXPANEL_TOKEN= diff --git a/README.md b/README.md index f7c8220df409..4ce327c51337 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,7 @@ The code is built using React-Native and running code locally requires a Mac or - Before starting, you need to install React Native dependencies: - [MacOs](https://facebook.github.io/react-native/docs/getting-started.html#installing-dependencies-1) - [Linux](https://facebook.github.io/react-native/docs/getting-started.html#installing-dependencies-2) - - Now clone this repo and then install all our dependencies - - You'll also need to rename the `.*.env.example` files (remove the `.example`) in the root of the project and fill in the appropriate values for each key + - Now clone this repo and then install all our dependencies ```bash cd metamask-mobile @@ -29,8 +28,6 @@ yarn install - Running the app on Android: -You'll need the `secret-tool` (a part of [libsecret-tools](https://launchpad.net/ubuntu/bionic/+package/libsecret-tools) package on Debian/Ubuntu based distributions) and `watchman` binaries on your machine. You'll also want to have the android SDK; the easiest way to do that is by installing [Android Studio](https://developer.android.com/studio). Additionally, you'll need to install the Google Play Licencing Library via the SDK Manager in Android Studio. - ```bash yarn start:android ``` diff --git a/scripts/build.sh b/scripts/build.sh index a762ed8f38b7..0c1bff1ac746 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -7,15 +7,6 @@ MODE=$2 TARGET=$3 RUN_DEVICE=false PRE_RELEASE=false -JS_ENV_FILE=".js.env" -ANDROID_ENV_FILE=".android.env" -IOS_ENV_FILE=".ios.env" - -envFileMissing() { - FILE="$1" - echo "'$FILE' is missing, you'll need to add it to the root of the project." - echo "For convenience you can rename '$FILE.example' and fill in the parameters." -} displayHelp() { echo '' @@ -106,9 +97,9 @@ prebuild(){ ./node_modules/.bin/concat-cli -f app/core/InpageBridge.js node_modules/web3/dist/web3.min.js app/util/setProvider.js -o app/core/InpageBridgeWeb3.js # Load JS specific env variables if [ "$PRE_RELEASE" = false ] ; then - if [ -e $JS_ENV_FILE ] + if [ -e .js.env ] then - source $JS_ENV_FILE + source .js.env fi fi } @@ -133,9 +124,9 @@ prebuild_android(){ # Copy fonts with iconset yes | cp -rf ./app/fonts/Metamask.ttf ./android/app/src/main/assets/fonts/Metamask.ttf if [ "$PRE_RELEASE" = false ] ; then - if [ -e $ANDROID_ENV_FILE ] + if [ -e .android.env ] then - source $ANDROID_ENV_FILE + source .android.env fi fi } @@ -162,7 +153,7 @@ buildIosRelease(){ # Replace release.xcconfig with ENV vars if [ "$PRE_RELEASE" = true ] ; then echo "Setting up env vars..."; - echo "$IOS_ENV" | tr "|" "\n" > $IOS_ENV_FILE + echo $IOS_ENV | tr "|" "\n" > .ios.env echo "Build started..." brew install watchman cd ios && bundle install && bundle exec fastlane prerelease @@ -170,7 +161,7 @@ buildIosRelease(){ yarn sourcemaps:ios else if [ ! -f "ios/release.xcconfig" ] ; then - echo "$IOS_ENV" | tr "|" "\n" > ios/release.xcconfig + echo $IOS_ENV | tr "|" "\n" > ios/release.xcconfig fi ./node_modules/.bin/react-native run-ios --configuration Release --simulator "iPhone 11 Pro (13.2)" fi @@ -186,7 +177,7 @@ buildAndroidRelease(){ TARGET="android/app/build.gradle" sed -i'' -e 's/getPassword("mm","mm-upload-key")/"ANDROID_KEY"/' $TARGET; sed -i'' -e "s/ANDROID_KEY/$ANDROID_KEY/" $TARGET; - echo "$ANDROID_KEYSTORE" | base64 --decode > android/keystores/release.keystore + echo $ANDROID_KEYSTORE | base64 --decode > android/keystores/release.keystore fi # GENERATE APK @@ -212,31 +203,25 @@ checkParameters "$@" printTitle -if [ "$PLATFORM" == "ios" ]; then - if [ -f "$IOS_ENV_FILE" ]; then - if [ "$MODE" == "release" ] ; then - buildIosRelease - else - if [ "$RUN_DEVICE" = true ] ; then - buildIosDevice - else - buildIosSimulator - fi +if [ "$PLATFORM" == "ios" ] + then + + if [ "$MODE" == "release" ] ; then + buildIosRelease + else + if [ "$RUN_DEVICE" = true ] ; then + buildIosDevice + else + buildIosSimulator fi - else - envFileMissing $IOS_ENV_FILE fi else - if [ -f "$ANDROID_ENV_FILE" ]; then - if [ "$MODE" == "release" ] ; then - buildAndroidRelease - else - buildAndroid - fi - else - envFileMissing $ANDROID_ENV_FILE + if [ "$MODE" == "release" ] ; then + buildAndroidRelease + else + buildAndroid fi fi