Unverified Commit de9913fd authored by Hanwen Cheng's avatar Hanwen Cheng Committed by GitHub
Browse files

fix: 4.2.3 user reported issues. (#617)

* fix error on scanning

* fix path derivation bug

* bump to 4.2.4

* upgrade react navigation
parent 5e95b988
Pipeline #92553 failed with stages
in 3 minutes and 43 seconds
......@@ -134,8 +134,8 @@ android {
minSdkVersion 18
missingDimensionStrategy 'react-native-camera', 'general'
targetSdkVersion 28
versionCode 4203
versionName "4.2.3"
versionCode 4204
versionName "4.2.4"
ndk {
abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}
......
......@@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.2.3</string>
<string>4.2.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>4203</string>
<string>4204</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
......
{
"name": "NativeSigner",
"version": "4.2.3-beta",
"version": "4.2.4-beta",
"private": true,
"license": "GPL-3.0",
"engines": {
......@@ -52,8 +52,8 @@
"@polkadot/util-crypto": "2.8.1",
"@react-native-community/masked-view": "^0.1.6",
"@react-native-community/netinfo": "^4.1.5",
"@react-navigation/native": "^5.0.10",
"@react-navigation/stack": "^5.2.0",
"@react-navigation/native": "^5.3.2",
"@react-navigation/stack": "^5.3.5",
"bignumber.js": "^9.0.0",
"hoist-non-react-statics": "^3.3.0",
"node-libs-react-native": "^1.0.3",
......
......@@ -20,11 +20,17 @@ import { Platform, StyleSheet, View } from 'react-native';
import PasswordInput from 'components/PasswordInput';
import testIDs from 'e2e/testIDs';
import { defaultNetworkKey, UnknownNetworkKeys } from 'constants/networkSpecs';
import { Identity } from 'types/identityTypes';
import { NavigationAccountIdentityProps } from 'types/props';
import { withAccountStore } from 'utils/HOC';
import TextInput from 'components/TextInput';
import ButtonMainAction from 'components/ButtonMainAction';
import { getNetworkKey, validateDerivedPath } from 'utils/identitiesUtils';
import {
extractPathId,
getNetworkKey,
getNetworkKeyByPathId,
validateDerivedPath
} from 'utils/identitiesUtils';
import { navigateToPathsList, unlockSeedPhrase } from 'utils/navigationHelpers';
import { alertPathDerivationError } from 'utils/alertUtils';
import Separator from 'components/Separator';
......@@ -35,6 +41,17 @@ import KeyboardScrollView from 'components/KeyboardScrollView';
import { NetworkSelector, NetworkOptions } from 'components/NetworkSelector';
import { useSeedRef } from 'utils/seedRefHooks';
function getParentNetworkKey(
parentPath: string,
currentIdentity: Identity
): string {
if (currentIdentity.meta.has(parentPath)) {
return getNetworkKey(parentPath, currentIdentity);
}
const pathId = extractPathId(parentPath);
return getNetworkKeyByPathId(pathId);
}
function PathDerivation({
accounts,
navigation,
......@@ -51,7 +68,7 @@ function PathDerivation({
);
const parentPath = route.params.parentPath;
const parentNetworkKey = useMemo(
() => getNetworkKey(parentPath, currentIdentity),
() => getParentNetworkKey(parentPath, currentIdentity),
[parentPath, currentIdentity]
);
......
......@@ -203,7 +203,6 @@ export default class ScannerStore extends Container<ScannerState> {
multipartData,
totalFrameCount
} = this.state;
const partDataAsBytes = new Uint8Array(partData.length / 2);
for (let i = 0; i < partDataAsBytes.length; i++) {
......@@ -211,8 +210,9 @@ export default class ScannerStore extends Container<ScannerState> {
}
if (
partDataAsBytes[0] === new Uint8Array([0x00])[0] ||
partDataAsBytes[0] === new Uint8Array([0x7b])[0]
currentFrame === 0 &&
(partDataAsBytes[0] === new Uint8Array([0x00])[0] ||
partDataAsBytes[0] === new Uint8Array([0x7b])[0])
) {
// part_data for frame 0 MUST NOT begin with byte 00 or byte 7B.
throw new Error('Error decoding invalid part data.');
......
......@@ -184,7 +184,7 @@ export const getPathsWithSubstrateNetworkKey = (
return pathEntries.reduce(pathReducer, []);
};
const getNetworkKeyByPathId = (pathId: string): string => {
export const getNetworkKeyByPathId = (pathId: string): string => {
const networkKeyIndex = Object.values(SUBSTRATE_NETWORK_LIST).findIndex(
networkParams => networkParams.pathId === pathId
);
......
......@@ -1751,36 +1751,36 @@
resolved "https://registry.yarnpkg.com/@react-native-community/netinfo/-/netinfo-4.2.1.tgz#b6309f078da500807ef8afa4d659e56ccd14dee4"
integrity sha512-kAnmYp8vXpZToPw8rgE7uO+MqmqHSR9VEDPkuZT0DnFMBJmIXCSD2NLAD28HGKVY/kujVWCknC/FuVWr5/A3uA==
"@react-navigation/core@^5.2.2":
version "5.2.2"
resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-5.2.2.tgz#3f32b964bcea7682c8d742e6923decd6c68d0704"
integrity sha512-/Ov9RTPpfWOq3Ot7jAz92RShWQyQT6duK7LKajkHbRsQ6q9+kagHWpzm1HTLEf1EHQBYlRk8GkS9kMDHtvjywQ==
dependencies:
"@react-navigation/routers" "^5.1.1"
escape-string-regexp "^2.0.0"
query-string "^6.11.1"
"@react-navigation/core@^5.6.1":
version "5.6.1"
resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-5.6.1.tgz#c2951e56ef195027bfb4127d049aea5bd381fab1"
integrity sha512-cnz3WMJd4Ou6TGLYmEfUijs0Wk+O0Vnlye29B2W2SJfTfqU1w4J8Kl0lzVkg8CZQruicQRzLU8ONVeDN4lj9tA==
dependencies:
"@react-navigation/routers" "^5.4.4"
escape-string-regexp "^4.0.0"
nanoid "^3.1.5"
query-string "^6.12.1"
react-is "^16.13.0"
shortid "^2.2.15"
use-subscription "^1.4.0"
"@react-navigation/native@^5.0.10":
version "5.0.10"
resolved "https://registry.yarnpkg.com/@react-navigation/native/-/native-5.0.10.tgz#bbb128cd963138d90f8327519088ae896fb22b4d"
integrity sha512-VoVKuiwOwYh8u+Y1rfLQ4mGXzBgjWVHFD1exhOIMIAymbEBV5rFZkS0D5SHbDpL+SVW6wovv4jK85Gdutd8mEg==
"@react-navigation/native@^5.3.2":
version "5.3.2"
resolved "https://registry.yarnpkg.com/@react-navigation/native/-/native-5.3.2.tgz#31786ae160ab61ac609b2611306b728681016ada"
integrity sha512-F9UzCHNjBQSQLv2RNc4q+Uo/3hRx00CIrP6CPBcrDxLe318frN/LHWqh7Dd6rRm7OAvDFYKsniEluLqTPK3Y0w==
dependencies:
"@react-navigation/core" "^5.2.2"
"@react-navigation/core" "^5.6.1"
"@react-navigation/routers@^5.1.1":
version "5.1.1"
resolved "https://registry.yarnpkg.com/@react-navigation/routers/-/routers-5.1.1.tgz#574d957dd9cea9c181af2b0a0347ba0b7cb9a255"
integrity sha512-gqZA2LSqxTvsaGEY6HG8/oy+YEoOfG0xMtj0xoJlwdwL5UcOBX8cew93UzamRxWeGW05dM7og1z+j6XRQzdPGw==
"@react-navigation/routers@^5.4.4":
version "5.4.4"
resolved "https://registry.yarnpkg.com/@react-navigation/routers/-/routers-5.4.4.tgz#3b5e1a55edb73a506a82db59081ad434c0ce1aab"
integrity sha512-Q8ZIubVYc1569JOs2oMWbhNXBNzZHvRfP5cEZ6/ksj9cPF7DkwOXsAdF0b+Oe0ei0f7OaK9LTRmfiNdtAPWVzw==
dependencies:
shortid "^2.2.15"
nanoid "^3.1.5"
"@react-navigation/stack@^5.2.0":
version "5.2.0"
resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-5.2.0.tgz#e16138cd23b457594e790999552ab3d72e8e2707"
integrity sha512-lFTVV1S9YEPsIxzLUPY95Y2lqmday79uOadOopQkjq3JWmZTXBJDMW9jgV8B+F5EfUh0VabQ2zX06OfjxrvtUw==
"@react-navigation/stack@^5.3.5":
version "5.3.5"
resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-5.3.5.tgz#ab9a4dff8a6ec2828bde02a5ee5e73ec80dd1a98"
integrity sha512-b+yxDmx0t09keJ1CaYUe8Xvo+7mJ4MATc9ns/3tbqDpdiFY+mxBq2Y20WvnMroUyJQo2CIQwVUrfNSArImXPIA==
dependencies:
color "^3.1.2"
react-native-iphone-x-helper "^1.2.1"
......@@ -4078,10 +4078,10 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
escape-string-regexp@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344"
integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==
escape-string-regexp@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
escodegen@^1.11.1:
version "1.14.1"
......@@ -7087,10 +7087,10 @@ nan@^2.12.1, nan@^2.14.0:
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c"
integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==
nanoid@^2.1.0:
version "2.1.11"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-2.1.11.tgz#ec24b8a758d591561531b4176a01e3ab4f0f0280"
integrity sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA==
nanoid@^3.1.5:
version "3.1.7"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.7.tgz#3705ccf590b6a51fbd1794fcf204ce7b5dc46c01"
integrity sha512-ruOwuatdEf4BxQmZopZqhIMudQ9V83aKocr+q2Y7KasnDNvo2OgbgZBYago5hSD0tCmoSl4flIw9ytDLIVM2IQ==
nanomatch@^1.2.9:
version "1.2.13"
......@@ -8026,10 +8026,10 @@ query-string@6.8.1:
split-on-first "^1.0.0"
strict-uri-encode "^2.0.0"
query-string@^6.11.1:
version "6.11.1"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.11.1.tgz#ab021f275d463ce1b61e88f0ce6988b3e8fe7c2c"
integrity sha512-1ZvJOUl8ifkkBxu2ByVM/8GijMIPx+cef7u3yroO3Ogm4DOdZcF5dcrWTIlSHe3Pg/mtlt6/eFjObDfJureZZA==
query-string@^6.12.1:
version "6.12.1"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.12.1.tgz#2ae4d272db4fba267141665374e49a1de09e8a7c"
integrity sha512-OHj+zzfRMyj3rmo/6G8a5Ifvw3AleL/EbcHMD27YA31Q+cO5lfmQxECkImuNVjcskLcvBRVHNAB3w6udMs1eAA==
dependencies:
decode-uri-component "^0.2.0"
split-on-first "^1.0.0"
......@@ -8948,13 +8948,6 @@ shellwords@^0.1.1:
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==
shortid@^2.2.15:
version "2.2.15"
resolved "https://registry.yarnpkg.com/shortid/-/shortid-2.2.15.tgz#2b902eaa93a69b11120373cd42a1f1fe4437c122"
integrity sha512-5EaCy2mx2Jgc/Fdn9uuDuNIIfWBpzY4XIlhoqtXF6qsf+/+SGZ+FxDdX/ZsMZiWupIWNqAEmiNY4RC+LSmCeOw==
dependencies:
nanoid "^2.1.0"
side-channel@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.2.tgz#df5d1abadb4e4bf4af1cd8852bf132d2f7876947"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment