From 8d1acb1459e2ad554f8e4870a45067cff7e4d563 Mon Sep 17 00:00:00 2001 From: stackchain <30806844+stackchain@users.noreply.github.com> Date: Mon, 10 Jan 2022 13:44:33 -0500 Subject: [PATCH 01/13] [fix] Message to enable biometrics --- legacy/i18n/locales/en-US.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/legacy/i18n/locales/en-US.json b/legacy/i18n/locales/en-US.json index 999c1d45a0..7c54045de5 100644 --- a/legacy/i18n/locales/en-US.json +++ b/legacy/i18n/locales/en-US.json @@ -167,7 +167,7 @@ "components.settings.applicationsettingsscreen.title": "Settings", "components.settings.applicationsettingsscreen.version": "Current version:", "components.settings.biometricslinkscreen.enableFingerprintsMessage": "Enable use of fingerprints in device settings first!", - "components.settings.biometricslinkscreen.heading": "Use your fingerprint", + "components.settings.biometricslinkscreen.heading": "Use your device biometrics", "components.settings.biometricslinkscreen.linkButton": "Link", "components.settings.biometricslinkscreen.notNowButton": "Not now", "components.settings.biometricslinkscreen.subHeading1": "for faster, easier access", From 9f52ad79b52c23c2f8e0e26d12050ea8b3044be8 Mon Sep 17 00:00:00 2001 From: stackchain <30806844+stackchain@users.noreply.github.com> Date: Wed, 12 Jan 2022 17:28:25 -0500 Subject: [PATCH 02/13] [chore] Added message to i18n --- legacy/i18n/locales/en-US.json | 1 + 1 file changed, 1 insertion(+) diff --git a/legacy/i18n/locales/en-US.json b/legacy/i18n/locales/en-US.json index 7c54045de5..2c2eb74323 100644 --- a/legacy/i18n/locales/en-US.json +++ b/legacy/i18n/locales/en-US.json @@ -397,6 +397,7 @@ "crypto.keystore.subtitle": "You can disable this feature at any time in the settings", "global.actions.dialogs.apiError.message": "Error received from API method call while sending transaction. Please try again later or check our Twitter account (https://twitter.com/YoroiWallet)", "global.actions.dialogs.apiError.title": "API error", + "global.actions.dialogs.biometricsChange.message": "Due to biometric changes. You need to create a PIN.", "global.actions.dialogs.biometricsIsTurnedOff.message": "It seems that you turned off biometrics. Please turn it on", "global.actions.dialogs.biometricsIsTurnedOff.title": "Biometrics was turned off", "global.actions.dialogs.commonbuttons.backButton": "Back", From 463d663e285a22546f911fc0f3227cd6c81e75c8 Mon Sep 17 00:00:00 2001 From: stackchain <30806844+stackchain@users.noreply.github.com> Date: Wed, 12 Jan 2022 17:32:00 -0500 Subject: [PATCH 03/13] [chore] Changed the default route to setup PIN --- src/AppNavigator.tsx | 53 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/src/AppNavigator.tsx b/src/AppNavigator.tsx index 5a7244153f..09c028e6ee 100644 --- a/src/AppNavigator.tsx +++ b/src/AppNavigator.tsx @@ -1,9 +1,10 @@ import {NavigationContainer} from '@react-navigation/native' import {createStackNavigator} from '@react-navigation/stack' import {isEmpty} from 'lodash' -import React from 'react' +import React, {useEffect} from 'react' import type {IntlShape} from 'react-intl' import {defineMessages, useIntl} from 'react-intl' +import {Alert} from 'react-native' import {useDispatch, useSelector} from 'react-redux' import {showErrorDialog, signin} from '../legacy/actions' @@ -17,6 +18,7 @@ import {canBiometricEncryptionBeEnabled, recreateAppSignInKeys} from '../legacy/ import {errorMessages} from '../legacy/i18n/global-messages' import {defaultNavigationOptions, defaultStackNavigatorOptions} from '../legacy/navigationOptions' import { + canEnableBiometricSelector, installationIdSelector, isAppSetupCompleteSelector, isAuthenticatedSelector, @@ -24,6 +26,7 @@ import { isSystemAuthEnabledSelector, } from '../legacy/selectors' import type {State} from '../legacy/state' +import {CustomPinScreen} from './FirstRun/CustomPinScreen' import {FirstRunNavigator} from './FirstRun/FirstRunNavigator' import {CustomPinLogin} from './Login' import StorybookScreen from './StorybookScreen' @@ -39,6 +42,18 @@ const messages = defineMessages({ id: 'components.login.custompinlogin.title', defaultMessage: '!!!Enter PIN', }, + customPinTitle: { + id: 'components.firstrun.custompinscreen.title', + defaultMessage: '!!!Set PIN', + }, + biometricsChangeTitle: { + id: 'global.actions.dialogs.walletKeysInvalidated.title', + defaultMessage: '!!!Biometrics changes', + }, + biometricsChangeMessage: { + id: 'global.actions.dialogs.biometricsChange.message', + defaultMessage: '!!!Biometrics changed detected ', + }, }) /* eslint-disable @typescript-eslint/no-explicit-any */ @@ -50,21 +65,29 @@ type AppNavigatorRoutes = { 'app-root': any 'custom-pin-auth': any 'bio-auth': any + 'setup-custom-pin': any } /* eslint-enable @typescript-eslint/no-explicit-any */ const Stack = createStackNavigator() const NavigatorSwitch = () => { - const intl = useIntl() + const strings = useStrings() const isMaintenance = useSelector(isMaintenanceSelector) const isSystemAuthEnabled = useSelector(isSystemAuthEnabledSelector) const isAuthenticated = useSelector(isAuthenticatedSelector) const hasAnyWallet = useSelector(hasAnyWalletSelector) const installationId = useSelector(installationIdSelector) const isAppSetupComplete = useSelector(isAppSetupCompleteSelector) + const canEnableBiometrics = useSelector(canEnableBiometricSelector) const dispatch = useDispatch() + useEffect(() => { + if (hasAnyWallet && !isAuthenticated && isSystemAuthEnabled && !canEnableBiometrics) { + Alert.alert(strings.biometricsChangeTitle, strings.biometricsChangeMessage) + } + }, [hasAnyWallet, isAuthenticated, isSystemAuthEnabled, canEnableBiometrics, strings]) + if (isMaintenance) { return ( @@ -96,13 +119,9 @@ const NavigatorSwitch = () => { })} > {!isSystemAuthEnabled && ( - + )} - {isSystemAuthEnabled && ( + {isSystemAuthEnabled && canEnableBiometrics && ( { }} /> )} + {isSystemAuthEnabled && !canEnableBiometrics && ( + + )} ) } @@ -156,4 +182,15 @@ const AppNavigator = () => { return {IS_STORYBOOK ? : } } +const useStrings = () => { + const intl = useIntl() + + return { + customPinTitle: intl.formatMessage(messages.customPinTitle), + loginPinTitle: intl.formatMessage(messages.pinLoginTitle), + biometricsChangeTitle: intl.formatMessage(messages.biometricsChangeTitle), + biometricsChangeMessage: intl.formatMessage(messages.biometricsChangeMessage), + } +} + export default AppNavigator From 457a99c4e705330531d00ad54f68d8779d89da84 Mon Sep 17 00:00:00 2001 From: stackchain <30806844+stackchain@users.noreply.github.com> Date: Wed, 12 Jan 2022 17:34:05 -0500 Subject: [PATCH 04/13] [chore] Setting PIN will disable biometrics --- src/FirstRun/CustomPinScreen.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/FirstRun/CustomPinScreen.tsx b/src/FirstRun/CustomPinScreen.tsx index 2e8c098b21..13461a33ab 100644 --- a/src/FirstRun/CustomPinScreen.tsx +++ b/src/FirstRun/CustomPinScreen.tsx @@ -4,7 +4,7 @@ import {StyleSheet} from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' import {useDispatch, useSelector} from 'react-redux' -import {encryptAndStoreCustomPin, signin} from '../../legacy/actions' +import {encryptAndStoreCustomPin, setSystemAuth, signin} from '../../legacy/actions' import PinRegistrationForm from '../../legacy/components/Common/PinRegistrationForm' import {StatusBar} from '../../legacy/components/UiKit' import {isAuthenticatedSelector} from '../../legacy/selectors' @@ -14,6 +14,7 @@ export const CustomPinScreen = () => { const isAuth = useSelector(isAuthenticatedSelector) const dispatch = useDispatch() const handlePinEntered = async (pin: string) => { + await dispatch(setSystemAuth(false)) await dispatch(encryptAndStoreCustomPin(pin)) if (!isAuth) dispatch(signin()) // because in first run user is not authenticated } From 9c43beec34addfb74f1486d2af6e5b3375608260 Mon Sep 17 00:00:00 2001 From: stackchain <30806844+stackchain@users.noreply.github.com> Date: Wed, 12 Jan 2022 17:36:06 -0500 Subject: [PATCH 05/13] [chore] Updated selectors --- legacy/selectors.d.ts | 2 ++ legacy/selectors.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/legacy/selectors.d.ts b/legacy/selectors.d.ts index 809485f45d..05e7881382 100644 --- a/legacy/selectors.d.ts +++ b/legacy/selectors.d.ts @@ -43,6 +43,8 @@ export var isFetchingUtxosSelector: (state: State) => boolean export var lastUtxosFetchErrorSelector: (state: State) => typeof state.balance.lastFetchingError export var serverStatusSelector: (state: State) => ServerStatusCache export var utxosSelector: (state: State) => typeof state.balance.utxos +export var isAppInitializedSelector: (state: State) => boolean +export var canEnableBiometricSelector: (state: State) => boolean // prettier-ignore interface MultiToken { diff --git a/legacy/selectors.js b/legacy/selectors.js index ac87f96b6f..794d74e8ba 100644 --- a/legacy/selectors.js +++ b/legacy/selectors.js @@ -216,6 +216,8 @@ export const utxosSelector = (state: State): ?Array => state.balance.ut export const biometricHwSupportSelector = (state: State): boolean => state.appSettings.isBiometricHardwareSupported +export const canEnableBiometricSelector = (state: State): boolean => state.appSettings.canEnableBiometricEncryption + export const isSystemAuthEnabledSelector = (state: State): boolean => state.appSettings.isSystemAuthEnabled export const sendCrashReportsSelector = (state: State): boolean => state.appSettings.sendCrashReports From 5f7bfe3984958be2f18cbc30295e2739ab8b296c Mon Sep 17 00:00:00 2001 From: stackchain <30806844+stackchain@users.noreply.github.com> Date: Wed, 12 Jan 2022 17:43:57 -0500 Subject: [PATCH 06/13] [chore] App won't render till is ready --- src/App.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index 5ee4f5381d..8e4b88aace 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -7,9 +7,10 @@ import * as RNP from 'react-native-paper' import {SafeAreaProvider} from 'react-native-safe-area-context' import {enableScreens} from 'react-native-screens' import {QueryClient, QueryClientProvider} from 'react-query' -import {useDispatch} from 'react-redux' +import {useDispatch, useSelector} from 'react-redux' import {initApp} from '../legacy/actions' +import {isAppInitializedSelector} from '../legacy/selectors' import AppNavigator from './AppNavigator' import {SelectedWalletMetaProvider, SelectedWalletProvider} from './SelectedWallet' @@ -49,6 +50,9 @@ const useHideScreenInAppSwitcher = () => { const App = () => { useHideScreenInAppSwitcher() useInitializeApp() + const isAppInitialized = useSelector(isAppInitializedSelector) + + if (!isAppInitialized) return null return ( From 8e2e6c6f305ba6b164f2d19c2e906dd388624e88 Mon Sep 17 00:00:00 2001 From: stackchain <30806844+stackchain@users.noreply.github.com> Date: Wed, 12 Jan 2022 17:58:24 -0500 Subject: [PATCH 07/13] [chore] Refresh walletMeta context --- src/SelectedWallet/WalletSelection/WalletSelectionScreen.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SelectedWallet/WalletSelection/WalletSelectionScreen.tsx b/src/SelectedWallet/WalletSelection/WalletSelectionScreen.tsx index ec094a12e7..a65c96d2f0 100644 --- a/src/SelectedWallet/WalletSelection/WalletSelectionScreen.tsx +++ b/src/SelectedWallet/WalletSelection/WalletSelectionScreen.tsx @@ -34,8 +34,8 @@ export const WalletSelectionScreen = () => { await showErrorDialog(errorMessages.itnNotSupported, intl) return } - const wallet = await walletManager.openWallet(walletMeta) - selectWalletMeta(walletMeta) + const [wallet, newWalletMeta] = await walletManager.openWallet(walletMeta) + selectWalletMeta(newWalletMeta) selectWallet(wallet) const route = WALLET_ROOT_ROUTES.MAIN_WALLET_ROUTES From 08a4925c65a5aff801357283654981ba50edba4a Mon Sep 17 00:00:00 2001 From: stackchain <30806844+stackchain@users.noreply.github.com> Date: Wed, 12 Jan 2022 18:04:51 -0500 Subject: [PATCH 08/13] [chore] Auto disable easy confirmation --- .../Settings/ApplicationSettingsScreen.js | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/legacy/components/Settings/ApplicationSettingsScreen.js b/legacy/components/Settings/ApplicationSettingsScreen.js index e6748f73b2..a8ea170398 100644 --- a/legacy/components/Settings/ApplicationSettingsScreen.js +++ b/legacy/components/Settings/ApplicationSettingsScreen.js @@ -7,13 +7,14 @@ import {Platform, ScrollView, StyleSheet, Switch} from 'react-native' import DeviceInfo from 'react-native-device-info' import {useDispatch, useSelector} from 'react-redux' -import {setAppSettingField, setSystemAuth, showErrorDialog} from '../../actions' +// $FlowExpectedError +import {useSelectedWalletMeta, useSetSelectedWalletMeta} from '../../../src/SelectedWallet' +import {setAppSettingField, setEasyConfirmation, setSystemAuth} from '../../actions' import {CONFIG} from '../../config/config' import KeyStore from '../../crypto/KeyStore' import walletManager from '../../crypto/walletManager' import {APP_SETTINGS_KEYS} from '../../helpers/appSettings' import {canBiometricEncryptionBeEnabled, isBiometricEncryptionHardwareSupported} from '../../helpers/deviceSettings' -import {errorMessages} from '../../i18n/global-messages' import {SETTINGS_ROUTES} from '../../RoutesList' import { biometricHwSupportSelector, @@ -88,25 +89,26 @@ const ApplicationSettingsScreen = () => { const isSystemAuthEnabled = useSelector(isSystemAuthEnabledSelector) const installationId = useSelector(installationIdSelector) const dispatch = useDispatch() + const walletMeta = useSelectedWalletMeta() + const setSelectedWalletMeta = useSetSelectedWalletMeta() const setCrashReporting = (value: boolean) => dispatch(setAppSettingField(APP_SETTINGS_KEYS.SEND_CRASH_REPORTS, value)) const onToggleBiometricsAuthIn = async () => { if (isSystemAuthEnabled) { - if (!walletManager.canBiometricsSignInBeDisabled()) { - await showErrorDialog(errorMessages.disableEasyConfirmationFirst, intl) - - return - } - navigation.navigate(SETTINGS_ROUTES.BIO_AUTHENTICATE, { keyId: installationId, onSuccess: () => navigation.navigate(SETTINGS_ROUTES.SETUP_CUSTOM_PIN, { onSuccess: async () => { await dispatch(setSystemAuth(false)) - + await walletManager.disableEasyConfirmation() + dispatch(setEasyConfirmation(false)) + setSelectedWalletMeta({ + ...walletMeta, + isEasyConfirmationEnabled: false, + }) navigation.navigate(SETTINGS_ROUTES.MAIN) }, }), @@ -167,7 +169,7 @@ const ApplicationSettingsScreen = () => { Date: Wed, 12 Jan 2022 18:10:47 -0500 Subject: [PATCH 09/13] [chore] Adapted open wallet and disable easy confirmation --- legacy/crypto/walletManager.js | 35 ++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/legacy/crypto/walletManager.js b/legacy/crypto/walletManager.js index d30539dc4a..a2bbef32f3 100644 --- a/legacy/crypto/walletManager.js +++ b/legacy/crypto/walletManager.js @@ -22,6 +22,7 @@ import {CONFIG, WALLETS} from '../config/config' import {isJormungandr} from '../config/networks' import type {NetworkId, WalletImplementationId, YoroiProvider} from '../config/types' import {NETWORK_REGISTRY, WALLET_IMPLEMENTATION_REGISTRY} from '../config/types' +import {APP_SETTINGS_KEYS, readAppSettings} from '../helpers/appSettings' import {canBiometricEncryptionBeEnabled, isSystemAuthSupported} from '../helpers/deviceSettings' import type {ServerStatusCache, WalletMeta} from '../state' import type {DefaultAsset} from '../types/HistoryTransaction' @@ -256,7 +257,7 @@ class WalletManager { } get isEasyConfirmationEnabled() { - if (!this._wallet) return {} + if (!this._wallet) return false return this.getWallet().isEasyConfirmationEnabled } @@ -383,19 +384,17 @@ class WalletManager { } async disableEasyConfirmation() { - if (!this._wallet) { - throw new Error('Empty wallet') - } + const wallet = this.getWallet() - await this._updateMetadata(this._wallet.id, { + wallet.isEasyConfirmationEnabled = false + await this._saveState(wallet) + + await this._updateMetadata(wallet.id, { isEasyConfirmationEnabled: false, }) await this.deleteEncryptedKey('BIOMETRICS') await this.deleteEncryptedKey('SYSTEM_PIN') - - // $FlowFixMe - this._wallet.isEasyConfirmationEnabled = false this._notify() } @@ -511,19 +510,35 @@ class WalletManager { return wallet } - async openWallet(walletMeta: WalletMeta): Promise { + async openWallet(walletMeta: WalletMeta): Promise<[WalletInterface, WalletMeta]> { assert.preconditionCheck(!!walletMeta.id, 'openWallet:: !!id') const data = await storage.read(`/wallet/${walletMeta.id}/data`) + const appSettings = await readAppSettings() + const isSystemAuthEnabled = appSettings[APP_SETTINGS_KEYS.SYSTEM_AUTH_ENABLED] Logger.debug('openWallet::data', data) if (!data) throw new Error('Cannot read saved data') const wallet: WalletInterface = this._getWalletImplementation(walletMeta.walletImplementationId) + const newWalletMeta = {...walletMeta} await wallet.restore(data, walletMeta) wallet.id = walletMeta.id this._wallet = wallet this._id = walletMeta.id + const shouldDisableEasyConfirmation = walletMeta.isEasyConfirmationEnabled && !isSystemAuthEnabled + if (shouldDisableEasyConfirmation) { + wallet.isEasyConfirmationEnabled = false + + await this._updateMetadata(wallet.id, { + isEasyConfirmationEnabled: false, + }) + newWalletMeta.isEasyConfirmationEnabled = false + + await this.deleteEncryptedKey('BIOMETRICS') + await this.deleteEncryptedKey('SYSTEM_PIN') + } + // wallet state might have changed after restore due to migrations, so we // update the data in storage immediately await this._saveState(wallet) @@ -541,7 +556,7 @@ class WalletManager { await this.ensureKeysValidity() } - return wallet + return [wallet, newWalletMeta] } async save() { From 894f3895b6ba80905346c6155571474885a0e3df Mon Sep 17 00:00:00 2001 From: stackchain <30806844+stackchain@users.noreply.github.com> Date: Wed, 12 Jan 2022 18:16:13 -0500 Subject: [PATCH 10/13] [chore] Refresh walletMeta context --- .../Settings/ToggleEasyConfirmationScreen.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/legacy/components/Settings/ToggleEasyConfirmationScreen.js b/legacy/components/Settings/ToggleEasyConfirmationScreen.js index 1553b33c26..18efd58026 100644 --- a/legacy/components/Settings/ToggleEasyConfirmationScreen.js +++ b/legacy/components/Settings/ToggleEasyConfirmationScreen.js @@ -6,6 +6,8 @@ import {defineMessages, useIntl} from 'react-intl' import {ScrollView, View} from 'react-native' import {useDispatch, useSelector} from 'react-redux' +// $FlowExpectedError +import {useSelectedWalletMeta, useSetSelectedWalletMeta} from '../../../src/SelectedWallet' import {setEasyConfirmation, showErrorDialog} from '../../actions' import {WrongPassword} from '../../crypto/errors' import walletManager from '../../crypto/walletManager' @@ -55,11 +57,17 @@ const ToggleEasyConfirmationScreen = () => { const dispatch = useDispatch() const [masterPassword, setMasterPassword] = React.useState('') const clearPassword = () => setMasterPassword('') + const walletMeta = useSelectedWalletMeta() + const selectedWalletMeta = useSetSelectedWalletMeta() + const enableEasyConfirmation = async () => { try { await walletManager.enableEasyConfirmation(masterPassword, intl) dispatch(setEasyConfirmation(true)) - + selectedWalletMeta({ + ...walletMeta, + isEasyConfirmationEnabled: true, + }) navigation.goBack() } catch (error) { if (error instanceof WrongPassword) { @@ -73,6 +81,10 @@ const ToggleEasyConfirmationScreen = () => { const disableEasyConfirmation = async () => { await walletManager.disableEasyConfirmation() dispatch(setEasyConfirmation(false)) + selectedWalletMeta({ + ...walletMeta, + isEasyConfirmationEnabled: false, + }) navigation.goBack() } From 061f8f975c582166953e20ccd10bbcbac793778c Mon Sep 17 00:00:00 2001 From: stackchain <30806844+stackchain@users.noreply.github.com> Date: Wed, 12 Jan 2022 18:24:58 -0500 Subject: [PATCH 11/13] [chore] setSystemAuth wont throw if easyconfirmation is set --- legacy/actions.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/legacy/actions.js b/legacy/actions.js index 0edda03c28..baff0d8a9a 100644 --- a/legacy/actions.js +++ b/legacy/actions.js @@ -457,12 +457,6 @@ export const showConfirmationDialog = (dialog: DialogOptions, intl: IntlShape): }) export const setSystemAuth = (enable: boolean) => async (dispatch: Dispatch, getState: any) => { - const canBeDisabled = walletManager.canBiometricsSignInBeDisabled() - - if (!enable && !canBeDisabled) { - throw new Error('Can not disable system auth without disabling easy confirmation.') - } - await dispatch(setAppSettingField(APP_SETTINGS_KEYS.SYSTEM_AUTH_ENABLED, enable)) const installationId = installationIdSelector(getState()) From eb190d12b8dcfd36ba97109f96894933643ab5c3 Mon Sep 17 00:00:00 2001 From: vantuz-subhuman Date: Thu, 13 Jan 2022 15:48:01 +0300 Subject: [PATCH 12/13] Version and build bump, plus release script update --- install-release.sh | 93 ++++++++++++++++++---------- ios/Nightly-Info.plist | 2 +- ios/Podfile.lock | 6 +- ios/Staging-Info.plist | 2 +- ios/emurgo.xcodeproj/project.pbxproj | 49 ++++++++------- ios/emurgo/Info.plist | 2 +- 6 files changed, 91 insertions(+), 63 deletions(-) diff --git a/install-release.sh b/install-release.sh index 90b5a5c225..06be3c3698 100644 --- a/install-release.sh +++ b/install-release.sh @@ -25,48 +25,75 @@ function prompt() { then exit; fi } -prompt "Android : bump"; +function doAndroid() { + prompt "Android : bump"; -APP_GRADLE_FILE='android/app/build.gradle' -TMP_FILE='zzzzz.tmp' + APP_GRADLE_FILE='android/app/build.gradle' + TMP_FILE='zzzzz.tmp' -VC='versionCode' -VN='versionName' + VC='versionCode' + VN='versionName' -versionCode=$(grep "$VC " $APP_GRADLE_FILE | awk '{print $2}') -versionName=$(grep "$VN " $APP_GRADLE_FILE | awk '{print $2}' | tr -d '"') -nextVersionCode=$(($versionCode + 1)) + versionCode=$(grep "$VC " $APP_GRADLE_FILE | awk '{print $2}') + versionName=$(grep "$VN " $APP_GRADLE_FILE | awk '{print $2}' | tr -d '"') + nextVersionCode=$(($versionCode + 1)) -echo "Version code: ${versionCode}" -echo "Next version code: ${nextVersionCode}" + echo "Version code: ${versionCode}" + echo "Next version code: ${nextVersionCode}" -echo "Version name: ${versionName}" -nextVersionName=$(ask "Next version name? (Skip to use same)") -if [ -z ${nextVersionName} ] -then nextVersionName=${versionName}; fi -echo "Next version name: ${nextVersionName}" + echo "Version name: ${versionName}" + nextVersionName=$(ask "Next version name? (Skip to use same)") + if [ -z ${nextVersionName} ] + then nextVersionName=${versionName}; fi + echo "Next version name: ${nextVersionName}" -OLD_VC_LINE="$VC ${versionCode}" -OLD_VN_LINE="$VN \\\"${versionName}\\\"" -VC_LINE="$VC ${nextVersionCode}" -VN_LINE="$VN \\\"${nextVersionName}\\\"" -awk "{sub(/$OLD_VC_LINE/,\"$VC_LINE\")}1 {sub(/$OLD_VN_LINE/,\"$VN_LINE\")}1" $APP_GRADLE_FILE > $TMP_FILE && mv $TMP_FILE $APP_GRADLE_FILE + OLD_VC_LINE="$VC ${versionCode}" + OLD_VN_LINE="$VN \\\"${versionName}\\\"" + VC_LINE="$VC ${nextVersionCode}" + VN_LINE="$VN \\\"${nextVersionName}\\\"" + awk "{sub(/$OLD_VC_LINE/,\"$VC_LINE\")}1 {sub(/$OLD_VN_LINE/,\"$VN_LINE\")}1" $APP_GRADLE_FILE > $TMP_FILE && mv $TMP_FILE $APP_GRADLE_FILE -echo "Bumped $APP_GRADLE_FILE" + echo "Bumped $APP_GRADLE_FILE" -prompt "Android : build"; + prompt "Android : build"; -if ask-yn "Build nightly" -then BUILD_TYPE="Nightly"; BUILD_DIR="nightly"; -else - if ask-yn "Build prod" - then BUILD_TYPE="Mainnet"; BUILD_DIR="mainnet"; - else echo "No build selected"; exit 1; + if ask-yn "Build nightly" + then BUILD_TYPE="Nightly"; BUILD_DIR="nightly"; + else + if ask-yn "Build prod" + then BUILD_TYPE="Mainnet"; BUILD_DIR="mainnet"; + else echo "No build selected"; exit 1; + fi fi -fi -prompt "Android : building \"${BUILD_TYPE}\"" + prompt "Android : building gradle \"${BUILD_TYPE}\"" + + (cd android; \ + ENTRY_FILE=index.ts ./gradlew clean "assemble${BUILD_TYPE}Release" \ + && open app/build/outputs/apk/${BUILD_DIR}/release) +} + +function doApple() { + prompt "!!! Cannot bump iOS versions yet! You need to bump them manually. Proceed" + + if ask-yn "Build nightly" + then BUILD_TYPE="nightly"; BUILD_DIR="nightly"; + else + if ask-yn "Build prod" + then BUILD_TYPE="mainnet"; BUILD_DIR="mainnet"; + else echo "No build selected"; exit 1; + fi + fi + + prompt "Apple : building fastlane \"${BUILD_TYPE}\"" + + (cd ios; fastlane ios ${BUILD_TYPE}) +} + +if ask-yn "Do Android" +then doAndroid +fi -(cd android; \ -ENTRY_FILE=index.ts ./gradlew clean "assemble${BUILD_TYPE}Release" \ -&& open app/build/outputs/apk/${BUILD_DIR}/release) +if ask-yn "Do Apple" +then doApple +fi \ No newline at end of file diff --git a/ios/Nightly-Info.plist b/ios/Nightly-Info.plist index c321c0c7d2..a6e9f237c5 100644 --- a/ios/Nightly-Info.plist +++ b/ios/Nightly-Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 351 + 353 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/ios/Podfile.lock b/ios/Podfile.lock index cdc7d6666f..c74eb70635 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -593,9 +593,9 @@ SPEC CHECKSUMS: boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c BVLinearGradient: e3aad03778a456d77928f594a649e96995f1c872 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 - DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de + DoubleConversion: cde416483dac037923206447da6e1454df403714 FBLazyVector: e686045572151edef46010a6f819ade377dfeb4b - FBReactNativeSpec: cb0a244da26421acd471dcb12b563b7d572ce3bb + FBReactNativeSpec: 1ebbbd3ac408f1dc94ace2457cd8ba6d3d0d1345 Flipper: 1bd2db48dcc31e4b167b9a33ec1df01c2ded4893 Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 Flipper-Folly: 755929a4f851b2fb2c347d533a23f191b008554c @@ -603,7 +603,7 @@ SPEC CHECKSUMS: Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 Flipper-RSocket: 127954abe8b162fcaf68d2134d34dc2bd7076154 FlipperKit: 651f50a42eb95c01b3e89a60996dd6aded529eeb - glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62 + glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 MultiplatformBleAdapter: 975cfb2a333b2c42b7a11628bd100ccb61872da2 OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b diff --git a/ios/Staging-Info.plist b/ios/Staging-Info.plist index 85b7d60198..8f5130a4db 100644 --- a/ios/Staging-Info.plist +++ b/ios/Staging-Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 351 + 353 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/ios/emurgo.xcodeproj/project.pbxproj b/ios/emurgo.xcodeproj/project.pbxproj index 97802c44d7..16a58dfcf4 100644 --- a/ios/emurgo.xcodeproj/project.pbxproj +++ b/ios/emurgo.xcodeproj/project.pbxproj @@ -5,6 +5,7 @@ }; objectVersion = 46; objects = { + /* Begin PBXBuildFile section */ 00E356F31AD99517003FC87E /* emurgoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* emurgoTests.m */; }; 0364225EA79340159305AC26 /* Rubik-MediumItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = DB1534F401F64DFEB4584FD0 /* Rubik-MediumItalic.ttf */; }; @@ -1344,7 +1345,7 @@ BUNDLE_ID_SUFFIX = ""; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 351; + CURRENT_PROJECT_VERSION = 353; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; @@ -1368,7 +1369,7 @@ INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 4.5.4; + MARKETING_VERSION = 4.5.401; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1394,7 +1395,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 351; + CURRENT_PROJECT_VERSION = 353; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -1417,7 +1418,7 @@ INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 4.5.4; + MARKETING_VERSION = 4.5.401; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1440,7 +1441,7 @@ BUNDLE_DISPLAY_NAME = Yoroi; BUNDLE_ID_SUFFIX = ""; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 351; + CURRENT_PROJECT_VERSION = 353; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; @@ -1468,7 +1469,7 @@ "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", ); - MARKETING_VERSION = 4.5.4; + MARKETING_VERSION = 4.5.401; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1491,7 +1492,7 @@ BUNDLE_DISPLAY_NAME = "Yoroi Staging"; BUNDLE_ID_SUFFIX = .staging; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 351; + CURRENT_PROJECT_VERSION = 353; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; @@ -1519,7 +1520,7 @@ "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", ); - MARKETING_VERSION = 4.5.4; + MARKETING_VERSION = 4.5.401; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1544,7 +1545,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 351; + CURRENT_PROJECT_VERSION = 353; DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -1571,7 +1572,7 @@ "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", ); - MARKETING_VERSION = 4.5.4; + MARKETING_VERSION = 4.5.401; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1594,7 +1595,7 @@ BUNDLE_DISPLAY_NAME = "Yoroi Staging"; BUNDLE_ID_SUFFIX = .staging; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 351; + CURRENT_PROJECT_VERSION = 353; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -1621,7 +1622,7 @@ "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", ); - MARKETING_VERSION = 4.5.4; + MARKETING_VERSION = 4.5.401; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1830,7 +1831,7 @@ BUNDLE_ID_SUFFIX = .staging; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 351; + CURRENT_PROJECT_VERSION = 353; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; @@ -1854,7 +1855,7 @@ INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 4.5.4; + MARKETING_VERSION = 4.5.401; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1978,7 +1979,7 @@ BUNDLE_ID_SUFFIX = .staging; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 351; + CURRENT_PROJECT_VERSION = 353; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -2001,7 +2002,7 @@ INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 4.5.4; + MARKETING_VERSION = 4.5.401; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -2063,7 +2064,7 @@ BUNDLE_ID_SUFFIX = ""; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 351; + CURRENT_PROJECT_VERSION = 353; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; @@ -2087,7 +2088,7 @@ INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 4.5.4; + MARKETING_VERSION = 4.5.401; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -2112,7 +2113,7 @@ BUNDLE_ID_SUFFIX = .staging; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 351; + CURRENT_PROJECT_VERSION = 353; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; @@ -2136,7 +2137,7 @@ INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 4.5.4; + MARKETING_VERSION = 4.5.401; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -2162,7 +2163,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 351; + CURRENT_PROJECT_VERSION = 353; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -2185,7 +2186,7 @@ INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 4.5.4; + MARKETING_VERSION = 4.5.401; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -2209,7 +2210,7 @@ BUNDLE_ID_SUFFIX = .staging; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 351; + CURRENT_PROJECT_VERSION = 353; DEVELOPMENT_TEAM = F8NVT2G2L4; ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( @@ -2232,7 +2233,7 @@ INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 4.5.4; + MARKETING_VERSION = 4.5.401; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", diff --git a/ios/emurgo/Info.plist b/ios/emurgo/Info.plist index 3a332151b5..3c9b531a06 100644 --- a/ios/emurgo/Info.plist +++ b/ios/emurgo/Info.plist @@ -23,7 +23,7 @@ CFBundleSignature ???? CFBundleVersion - 351 + 353 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS From ff2b12bfd5051beb9efbd31bee486f29f884d32e Mon Sep 17 00:00:00 2001 From: vantuz-subhuman Date: Thu, 13 Jan 2022 15:56:51 +0300 Subject: [PATCH 13/13] Version and build bump, plus release script update --- install-release.sh | 36 +++++++++++++++++++++--------------- ios/emurgoTests/Info.plist | 2 +- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/install-release.sh b/install-release.sh index 06be3c3698..b6393edece 100644 --- a/install-release.sh +++ b/install-release.sh @@ -25,9 +25,7 @@ function prompt() { then exit; fi } -function doAndroid() { - prompt "Android : bump"; - +function bumpAndroid() { APP_GRADLE_FILE='android/app/build.gradle' TMP_FILE='zzzzz.tmp' @@ -54,16 +52,14 @@ function doAndroid() { awk "{sub(/$OLD_VC_LINE/,\"$VC_LINE\")}1 {sub(/$OLD_VN_LINE/,\"$VN_LINE\")}1" $APP_GRADLE_FILE > $TMP_FILE && mv $TMP_FILE $APP_GRADLE_FILE echo "Bumped $APP_GRADLE_FILE" +} - prompt "Android : build"; - +function buildAndroid() { if ask-yn "Build nightly" then BUILD_TYPE="Nightly"; BUILD_DIR="nightly"; - else - if ask-yn "Build prod" - then BUILD_TYPE="Mainnet"; BUILD_DIR="mainnet"; - else echo "No build selected"; exit 1; - fi + elif ask-yn "Build prod" + then BUILD_TYPE="Mainnet"; BUILD_DIR="mainnet"; + else echo "No build selected"; exit 1; fi prompt "Android : building gradle \"${BUILD_TYPE}\"" @@ -73,16 +69,26 @@ function doAndroid() { && open app/build/outputs/apk/${BUILD_DIR}/release) } +function doAndroid() { + + if ask-yn "Android : bump" + then bumpAndroid + fi + + if ask-yn "Android : build" + then buildAndroid + fi +} + function doApple() { + prompt "!!! Cannot bump iOS versions yet! You need to bump them manually. Proceed" if ask-yn "Build nightly" then BUILD_TYPE="nightly"; BUILD_DIR="nightly"; - else - if ask-yn "Build prod" - then BUILD_TYPE="mainnet"; BUILD_DIR="mainnet"; - else echo "No build selected"; exit 1; - fi + elif ask-yn "Build prod" + then BUILD_TYPE="mainnet"; BUILD_DIR="mainnet"; + else echo "No build selected"; exit 1; fi prompt "Apple : building fastlane \"${BUILD_TYPE}\"" diff --git a/ios/emurgoTests/Info.plist b/ios/emurgoTests/Info.plist index 3fb812d767..7da7943889 100644 --- a/ios/emurgoTests/Info.plist +++ b/ios/emurgoTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 351 + 353