Skip to content

Commit

Permalink
Add scripts for generating and verifying SHA 512 checksums (#2168)
Browse files Browse the repository at this point in the history
* Add scripts for generating and verifying SHA 512 checksums

* Update checksum scripts

* Rename to NON_EMPTY since that's what it actually is 😅

* Add checksum to prerelease

* Address feedback

* only gen checksum if apk exists

* add shellscript

* fix .sh file
  • Loading branch information
rickycodes authored Apr 9, 2021
1 parent bcada03 commit 190f7b7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/core/Engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import contractMap from '@metamask/contract-metadata';
import Logger from '../util/Logger';
import { LAST_INCOMING_TX_BLOCK_INFO } from '../constants/storage';

const EMPTY = 'EMPTY';
const NON_EMPTY = 'NON_EMPTY';

const encryptor = new Encryptor();
let currentChainId;
Expand Down Expand Up @@ -79,7 +79,7 @@ class Engine {
new PersonalMessageManager(),
new MessageManager(),
new NetworkController({
infuraProjectId: process.env.MM_INFURA_PROJECT_ID || EMPTY,
infuraProjectId: process.env.MM_INFURA_PROJECT_ID || NON_EMPTY,
providerConfig: {
static: {
eth_sendTransaction: async (payload, next, end) => {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"build:announce": "node ./scripts/metamask-bot-build-announce.js",
"build:android:release": "./scripts/build.sh android release",
"build:android:release:e2e": "./scripts/build.sh android releaseE2E",
"build:android:checksum": "./scripts/checksum.sh",
"build:android:checksum:verify": "shasum -a 512 -c sha512sums.txt",
"build:android:pre-release": "./scripts/build.sh android release --pre",
"build:android:pre-release:bundle": "GENERATE_BUNDLE=true ./scripts/build.sh android release --pre",
"build:ios:release": "./scripts/build.sh ios release",
Expand Down
2 changes: 2 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ buildAndroidRelease(){
if [ "$PRE_RELEASE" = true ] ; then
# Generate sourcemaps
yarn sourcemaps:android
# Generate checksum
yarn build:android:checksum
fi

if [ "$PRE_RELEASE" = false ] ; then
Expand Down
7 changes: 7 additions & 0 deletions scripts/checksum.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

FILE=./android/app/build/outputs/apk/release/app-release.apk

if test -f "$FILE"; then
shasum -a 512 "$FILE" > ./android/app/build/outputs/apk/release/sha512sums.txt
fi;

0 comments on commit 190f7b7

Please sign in to comment.