From c615ebbc07d1c52fe5f0e2cdfcc14cb2da6096e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Thu, 14 Feb 2019 00:15:56 -0500 Subject: [PATCH] FIX: Android not redering QR code #302 --- App.test.js | 2 +- loc/id_ID.js | 5 +- package-lock.json | 232 ++++++++++++++++-- package.json | 2 +- .../lndViewAdditionalInvoiceInformation.js | 11 +- screen/lnd/lndViewInvoice.js | 10 +- screen/receive/details.js | 11 +- screen/receive/receiveAmount.js | 15 +- screen/settings/language.js | 2 +- screen/wallets/export.js | 13 +- screen/wallets/xpub.js | 11 +- 11 files changed, 262 insertions(+), 52 deletions(-) diff --git a/App.test.js b/App.test.js index 072984948..746871b2d 100644 --- a/App.test.js +++ b/App.test.js @@ -9,7 +9,7 @@ import MockStorage from './MockStorage'; import { FiatUnit } from './models/fiatUnit'; global.crypto = require('crypto'); // shall be used by tests under nodejs CLI, but not in RN environment let assert = require('assert'); -jest.mock('react-native-custom-qr-codes', () => 'Video'); +jest.mock('react-native-qrcode-svg', () => 'Video'); const AsyncStorage = new MockStorage(); jest.setMock('AsyncStorage', AsyncStorage); jest.useFakeTimers(); diff --git a/loc/id_ID.js b/loc/id_ID.js index 7049e1d70..9583424be 100644 --- a/loc/id_ID.js +++ b/loc/id_ID.js @@ -18,7 +18,7 @@ module.exports = { header: 'Sebuah dompet mewakili sepasang kunci rahasia dan sebuah alamat' + 'yang bisa dipilih untuk menerima koin.', add: 'Tambah dompet', create_a_wallet: 'Buat dompet', - create_a_wallet1: "Gratis dan bisa buat", + create_a_wallet1: 'Gratis dan bisa buat', create_a_wallet2: 'sebanyak yang kamu mau', latest_transaction: 'transaksi terbaru', empty_txs1: 'Transaksimu akan muncul di sini,', @@ -71,8 +71,7 @@ module.exports = { }, import: { title: 'impor', - explanation: - "Ketik kata mnemonic, private key, WIF, atau apapun yang kamu punya. BlueWallet akan mencoba mengimpor dompet kamu.", + explanation: 'Ketik kata mnemonic, private key, WIF, atau apapun yang kamu punya. BlueWallet akan mencoba mengimpor dompet kamu.', imported: 'Diimpor', error: 'Gagal mengimpor. Pastikan data yang diketik benar.', success: 'Berhasil', diff --git a/package-lock.json b/package-lock.json index 664714a66..6a0723f30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "BlueWallet", - "version": "3.7.0", + "version": "3.7.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2843,6 +2843,14 @@ "quick-lru": "^1.0.0" } }, + "can-promise": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/can-promise/-/can-promise-0.0.1.tgz", + "integrity": "sha512-gzVrHyyrvgt0YpDm7pn04MQt8gjh0ZAhN4ZDyCRtGl6YnuuK6b4aiUTD7G52r9l4YNmxfTtEscb92vxtAlL6XQ==", + "requires": { + "window-or-global": "^1.0.1" + } + }, "caniuse-lite": { "version": "1.0.30000929", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000929.tgz", @@ -3576,6 +3584,11 @@ "randombytes": "^2.0.0" } }, + "dijkstrajs": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.1.tgz", + "integrity": "sha1-082BIh4+pAdCz83lVtTpnpjdxxs=" + }, "dlv": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.2.tgz", @@ -3641,11 +3654,6 @@ "version": "git+https://github.com/Overtorment/node-electrum-client.git#59712b3b7dbe666431eeb5649d6f6541529d386a", "from": "git+https://github.com/Overtorment/node-electrum-client.git" }, - "electrum-host-parse": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/electrum-host-parse/-/electrum-host-parse-0.1.1.tgz", - "integrity": "sha512-N1ua6Xc5aMcVWPqxlIyiSV/tDGlbGP+S4bIR6KKGDv227VnzXibcin+4t25b5spjDmhfbbk0rIqV1T3MV5WlBQ==" - }, "elliptic": { "version": "6.4.1", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", @@ -11037,6 +11045,11 @@ "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==" }, + "pngjs": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.3.3.tgz", + "integrity": "sha512-1n3Z4p3IOxArEs1VRXnZ/RXdfEniAUS9jb68g58FIXMNkPJeZd+Qh4Uq7/e0LVxAQGos1eIUrqrt4FpjdnEd+Q==" + }, "posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", @@ -11558,6 +11571,191 @@ "resolved": "https://registry.npmjs.org/qr.js/-/qr.js-0.0.0.tgz", "integrity": "sha1-ys6GOG9ZoNuAUPqQ2baw6IoeNk8=" }, + "qrcode": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.3.3.tgz", + "integrity": "sha512-SH7V13AcJusH3GT8bMNOGz4w0L+LjcpNOU/NiOgtBhT/5DoWeZE6D5ntMJnJ84AMkoaM4kjJJoHoh9g++8lWFg==", + "requires": { + "can-promise": "0.0.1", + "dijkstrajs": "^1.0.1", + "isarray": "^2.0.1", + "pngjs": "^3.3.0", + "yargs": "^12.0.5" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "camelcase": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", + "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==" + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "requires": { + "locate-path": "^3.0.0" + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "requires": { + "pump": "^3.0.0" + } + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" + }, + "isarray": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.4.tgz", + "integrity": "sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA==" + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "requires": { + "invert-kv": "^2.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "mem": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.1.0.tgz", + "integrity": "sha512-I5u6Q1x7wxO0kdOpYBB28xueHADYps5uty/zg936CiG8NTe5sJL8EjrCuLneuDW3PlMdZBGDIn8BirEVdovZvg==", + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^1.0.0", + "p-is-promise": "^2.0.0" + } + }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "p-is-promise": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", + "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==" + }, + "p-limit": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", + "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==" + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "qs": { "version": "6.6.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.6.0.tgz", @@ -12194,14 +12392,6 @@ } } }, - "react-native-custom-qr-codes": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/react-native-custom-qr-codes/-/react-native-custom-qr-codes-2.0.0.tgz", - "integrity": "sha512-tUQipLzDorDgv/gzuhAISSqCCNOTtM+QveAUTnV1deeEKDAtdfdzY9QJIqLZYmfYvusySpXOK1Sdu9X+6AR2Jg==", - "requires": { - "prop-types": "^15.5.10" - } - }, "react-native-device-info": { "version": "0.26.1", "resolved": "https://registry.npmjs.org/react-native-device-info/-/react-native-device-info-0.26.1.tgz", @@ -12300,6 +12490,15 @@ "qr.js": "0.0.0" } }, + "react-native-qrcode-svg": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/react-native-qrcode-svg/-/react-native-qrcode-svg-5.1.2.tgz", + "integrity": "sha512-nQ0x2DHQMC2XI5QDxYMGaUhqZ4UT/o/V1Wr0oet5uZwkfnc8OoPt08dae/tO7VcCG7x3plmmafm7Tsh3g67bHA==", + "requires": { + "prop-types": "^15.5.10", + "qrcode": "^1.2.0" + } + }, "react-native-randombytes": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/react-native-randombytes/-/react-native-randombytes-3.5.2.tgz", @@ -14917,6 +15116,11 @@ "bs58check": "<3.0.0" } }, + "window-or-global": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/window-or-global/-/window-or-global-1.0.1.tgz", + "integrity": "sha1-2+RboqKRqrxW1iz2bEW3+jIpRt4=" + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", diff --git a/package.json b/package.json index 7b430318f..1829eda19 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,6 @@ "react-localization": "^1.0.10", "react-native": "^0.58.1", "react-native-camera": "^1.10.0", - "react-native-custom-qr-codes": "^2.0.0", "react-native-device-info": "^0.26.1", "react-native-elements": "^0.19.0", "react-native-flexi-radio-button": "^0.2.2", @@ -79,6 +78,7 @@ "react-native-permissions": "^1.1.1", "react-native-prompt-android": "^0.3.4", "react-native-qrcode": "^0.2.7", + "react-native-qrcode-svg": "^5.1.2", "react-native-randombytes": "^3.5.2", "react-native-rate": "^1.1.6", "react-native-sentry": "^0.41.1", diff --git a/screen/lnd/lndViewAdditionalInvoiceInformation.js b/screen/lnd/lndViewAdditionalInvoiceInformation.js index 698b1b1e7..5ab167e35 100644 --- a/screen/lnd/lndViewAdditionalInvoiceInformation.js +++ b/screen/lnd/lndViewAdditionalInvoiceInformation.js @@ -11,7 +11,7 @@ import { BlueSpacing20, } from '../../BlueComponents'; import PropTypes from 'prop-types'; -import { QRCode } from 'react-native-custom-qr-codes'; +import QRCode from 'react-native-qrcode-svg'; /** @type {AppStorage} */ let BlueApp = require('../../BlueApp'); const loc = require('../../loc'); @@ -49,11 +49,12 @@ export default class LNDViewAdditionalInvoiceInformation extends Component { Open direct channel with this node: diff --git a/screen/lnd/lndViewInvoice.js b/screen/lnd/lndViewInvoice.js index 68f0f1d83..0ac8e8fcd 100644 --- a/screen/lnd/lndViewInvoice.js +++ b/screen/lnd/lndViewInvoice.js @@ -12,11 +12,11 @@ import { import PropTypes from 'prop-types'; import ReactNativeHapticFeedback from 'react-native-haptic-feedback'; import { Icon } from 'react-native-elements'; +import QRCode from 'react-native-qrcode-svg'; /** @type {AppStorage} */ let BlueApp = require('../../BlueApp'); const loc = require('../../loc'); const EV = require('../../events'); -const QRFast = require('react-native-qrcode'); const { width, height } = Dimensions.get('window'); export default class LNDViewInvoice extends Component { @@ -187,11 +187,13 @@ export default class LNDViewInvoice extends Component { onLayout={this.onLayout} > - diff --git a/screen/receive/details.js b/screen/receive/details.js index 0a05b5e7c..87d2f85a1 100644 --- a/screen/receive/details.js +++ b/screen/receive/details.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { View, Share } from 'react-native'; -import { QRCode } from 'react-native-custom-qr-codes'; +import QRCode from 'react-native-qrcode-svg'; import bip21 from 'bip21'; import { BlueLoading, @@ -88,11 +88,12 @@ export default class ReceiveDetails extends Component { diff --git a/screen/receive/receiveAmount.js b/screen/receive/receiveAmount.js index a5cc03a99..9ec536a21 100644 --- a/screen/receive/receiveAmount.js +++ b/screen/receive/receiveAmount.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { View, Share, TextInput, KeyboardAvoidingView, Platform, Dimensions, ScrollView } from 'react-native'; -import { QRCode as QRSlow } from 'react-native-custom-qr-codes'; +import QRCode from 'react-native-qrcode-svg'; import QRFast from 'react-native-qrcode'; import bip21 from 'bip21'; import { @@ -105,13 +105,14 @@ export default class ReceiveAmount extends Component { {this.state.label} - {Platform.OS === 'ios' || this.state.bip21.length < 54 ? ( - ) : ( diff --git a/screen/settings/language.js b/screen/settings/language.js index 8bb377a4b..784ab0f79 100644 --- a/screen/settings/language.js +++ b/screen/settings/language.js @@ -24,7 +24,7 @@ export default class Language extends Component { { label: 'Deutsch (DE)', value: 'de_de' }, { label: 'Español (ES)', value: 'es' }, { label: 'Français (FR)', value: 'fr_fr' }, - { label: 'Indonesia (ID)', value: 'id_id' }, + { label: 'Indonesia (ID)', value: 'id_id' }, { label: '日本語 (JP)', value: 'jp_jp' }, { label: 'Nederlands (NL)', value: 'nl_nl' }, { label: 'Portuguese (BR)', value: 'pt_br' }, diff --git a/screen/wallets/export.js b/screen/wallets/export.js index 9658e12ba..246cad0f5 100644 --- a/screen/wallets/export.js +++ b/screen/wallets/export.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Dimensions, Platform, ActivityIndicator, View } from 'react-native'; -import { QRCode as QRSlow } from 'react-native-custom-qr-codes'; +import QRCode from 'react-native-qrcode-svg'; import { BlueSpacing20, SafeBlueArea, BlueNavigationStyle, BlueText } from '../../BlueComponents'; import PropTypes from 'prop-types'; const QRFast = require('react-native-qrcode'); @@ -83,12 +83,13 @@ export default class WalletExport extends Component { if (this.state.showQr) { if (Platform.OS === 'ios' || this.state.wallet.getSecret().length < 54) { return ( - ); diff --git a/screen/wallets/xpub.js b/screen/wallets/xpub.js index 2226c60bb..08175a423 100644 --- a/screen/wallets/xpub.js +++ b/screen/wallets/xpub.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Dimensions, Platform, ActivityIndicator, View } from 'react-native'; -import { QRCode as QRSlow } from 'react-native-custom-qr-codes'; +import QRCode from 'react-native-qrcode-svg'; import { BlueSpacing20, SafeBlueArea, BlueText, BlueNavigationStyle, BlueCopyTextToClipboard } from '../../BlueComponents'; import PropTypes from 'prop-types'; const QRFast = require('react-native-qrcode'); @@ -75,12 +75,13 @@ export default class WalletXpub extends Component { if (this.state.showQr) { if (Platform.OS === 'ios' || this.state.xpub.length < 54) { return ( - );