diff --git a/android/app/build.gradle b/android/app/build.gradle index 98d1c98c..229e7641 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -96,7 +96,7 @@ android { applicationId "com.minibits_wallet" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 58001 + versionCode 58002 versionName "0.1.9" } diff --git a/package.json b/package.json index 424825e4..ccfa8957 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minibits_wallet", - "version": "0.1.9-beta", + "version": "0.1.9-beta.2", "private": true, "scripts": { "android:clean": "cd android && ./gradlew clean", diff --git a/patches/@scure+bip32+1.5.0.patch b/patches/@scure+bip32+1.5.0.patch index 3d11b89a..b6f7165f 100644 --- a/patches/@scure+bip32+1.5.0.patch +++ b/patches/@scure+bip32+1.5.0.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/@scure/bip32/index.ts b/node_modules/@scure/bip32/index.ts -index 51a702f..ac252b2 100644 +index 51a702f..a13bf43 100644 --- a/node_modules/@scure/bip32/index.ts +++ b/node_modules/@scure/bip32/index.ts @@ -8,6 +8,7 @@ import { bytesToHex, concatBytes, createView, hexToBytes, utf8ToBytes } from '@n @@ -15,8 +15,8 @@ index 51a702f..ac252b2 100644 ); } - const I = hmac(sha512, MASTER_SECRET, seed); -+ //const I = hmac(sha512, MASTER_SECRET, seed); -+ console.log('[fromMasterSeed] Using patched hmac'); ++ // const I = hmac(sha512, MASTER_SECRET, seed); ++ // console.log('[fromMasterSeed] Using patched hmac'); + const I = new Uint8Array(QuickCrypto.createHmac('sha512', MASTER_SECRET).update(seed).digest()); return new HDKey({ versions, @@ -28,7 +28,7 @@ index 51a702f..ac252b2 100644 - const I = hmac(sha512, this.chainCode, data); + + // const I = hmac(sha512, this.chainCode, data); -+ console.log('[deriveChild] Using patched hmac'); ++ // console.log('[deriveChild] Using patched hmac'); + const I = new Uint8Array(QuickCrypto.createHmac('sha512', this.chainCode).update(data).digest()); + const childTweak = bytesToNumber(I.slice(0, 32)); diff --git a/patches/@scure+bip39+1.4.0.patch b/patches/@scure+bip39+1.4.0.patch index de0cfc12..29e9fc1a 100644 --- a/patches/@scure+bip39+1.4.0.patch +++ b/patches/@scure+bip39+1.4.0.patch @@ -12,7 +12,7 @@ index a903f6e..0bc8651 100644 "exports": { ".": { diff --git a/node_modules/@scure/bip39/src/index.ts b/node_modules/@scure/bip39/src/index.ts -index e6afe12..c1d593b 100644 +index e6afe12..c4546b4 100644 --- a/node_modules/@scure/bip39/src/index.ts +++ b/node_modules/@scure/bip39/src/index.ts @@ -5,6 +5,7 @@ import { sha256 } from '@noble/hashes/sha256'; @@ -26,10 +26,10 @@ index e6afe12..c1d593b 100644 @@ -142,5 +143,8 @@ export function mnemonicToSeed(mnemonic: string, passphrase = '') { * // new Uint8Array([...64 bytes]) */ - export function mnemonicToSeedSync(mnemonic: string, passphrase = '') { + export function mnemonicToSeedSync(mnemonic: string, passphrase = '') { - return pbkdf2(sha512, normalize(mnemonic).nfkd, salt(passphrase), { c: 2048, dkLen: 64 }); -+ const original = pbkdf2(sha512, normalize(mnemonic).nfkd, salt(passphrase), { c: 2048, dkLen: 64 }); ++ // const original = pbkdf2(sha512, normalize(mnemonic).nfkd, salt(passphrase), { c: 2048, dkLen: 64 }); + const updated = new Uint8Array(QuickCrypto.pbkdf2Sync(normalize(mnemonic).nfkd, salt(passphrase), 2048, 64, 'sha512')); -+ console.log('[mnemonicToSeedSync] Using patched pbkdf2', {original, updated}) ++ console.log('[@scure.bip39.mnemonicToSeedSync] Patched to use QuickCrypto.pbkdf2Sync') + return updated } diff --git a/src/models/ProofsStore.ts b/src/models/ProofsStore.ts index 716943f3..3c6bd9cd 100644 --- a/src/models/ProofsStore.ts +++ b/src/models/ProofsStore.ts @@ -196,15 +196,11 @@ export const ProofsStoreModel = types const rootStore = getRootStore(self) const count = proofsToRemove.length - const {userSettingsStore} = rootStore - - if (userSettingsStore.isLocalBackupOn === true) { - // TODO refactor recovery to separate model method - if(isRecoveredFromPending) { - Database.addOrUpdateProofs(proofsToRemove, false, false) // isPending = false, isSpent = false - } else { - Database.addOrUpdateProofs(proofsToRemove, false, true) // isPending = false, isSpent = true - } + + if(isRecoveredFromPending) { + Database.addOrUpdateProofs(proofsToRemove, false, false) // isPending = false, isSpent = false + } else { + Database.addOrUpdateProofs(proofsToRemove, false, true) // isPending = false, isSpent = true } proofsToRemove.map((proof) => { diff --git a/src/screens/Contacts/PrivateContacts.tsx b/src/screens/Contacts/PrivateContacts.tsx index cf11bf7f..5fda1063 100644 --- a/src/screens/Contacts/PrivateContacts.tsx +++ b/src/screens/Contacts/PrivateContacts.tsx @@ -342,7 +342,7 @@ export const PrivateContacts = observer(function (props: { } value={newContactName} autoCapitalize="none" - keyboardType="default" + keyboardType="default" maxLength={80} selectTextOnFocus={true} style={[ @@ -420,13 +420,15 @@ const $newContainer: TextStyle = { } const $contactInput: TextStyle = { - flex: 1, - borderTopLeftRadius: spacing.extraSmall, - borderBottomLeftRadius: spacing.extraSmall, - fontSize: 16, + flex: 1, + // borderRadius: 0, + // borderBottomRightRadius: spacing.extraSmall, + // borderTopLeftRadius: spacing.extraSmall, + fontSize: moderateVerticalScale(16), padding: spacing.small, alignSelf: 'stretch', textAlignVertical: 'top', + // borderWidth: 1, } const $contactDomain: TextStyle = { diff --git a/src/screens/MintsScreen.tsx b/src/screens/MintsScreen.tsx index 7e25e762..e0c366ae 100644 --- a/src/screens/MintsScreen.tsx +++ b/src/screens/MintsScreen.tsx @@ -180,6 +180,11 @@ export const MintsScreen: FC> = observer(funct const removeMint = async function () { if (!selectedMint) {return} + if(mintsStore.allMints.length === 1) { + setInfo('You need to keep at least 1 mint.') + return + } + const proofsByMint = proofsStore.getByMint(selectedMint.mintUrl, {isPending: false}) const pendingProofsByMint = proofsStore.getByMint(selectedMint.mintUrl, {isPending: true}) let message: string = '' @@ -205,7 +210,7 @@ export const MintsScreen: FC> = observer(funct onPress: () => { try { onMintUnselect() - toggleMintMenuModal() + setIsMintMenuVisible(false) mintsStore.removeMint(selectedMint as Mint) if (proofsByMint && proofsByMint.length > 0) { proofsStore.removeProofs(proofsByMint) diff --git a/src/screens/ReceiveScreen.tsx b/src/screens/ReceiveScreen.tsx index 2bfca371..2eb22d46 100644 --- a/src/screens/ReceiveScreen.tsx +++ b/src/screens/ReceiveScreen.tsx @@ -321,8 +321,7 @@ export const ReceiveScreen: FC> = observer( return ( diff --git a/src/screens/ScanScreen.tsx b/src/screens/ScanScreen.tsx index 0139a6db..f1cf6516 100644 --- a/src/screens/ScanScreen.tsx +++ b/src/screens/ScanScreen.tsx @@ -15,7 +15,7 @@ import {useHeader} from '../utils/useHeader' import {log} from '../services/logService' import { IncomingDataType, IncomingParser } from '../services/incomingParser' import AppError, { Err } from '../utils/AppError' -import { BottomModal, Button, ErrorModal, Icon, Text } from '../components' +import { BottomModal, Button, ErrorModal, Icon, Screen, Text } from '../components' import { LnurlUtils } from '../services/lnurl/lnurlUtils' import { infoMessage } from '../utils/utils' import Clipboard from '@react-native-clipboard/clipboard' @@ -212,12 +212,13 @@ export const ScanScreen: FC> = function ScanScree const inputBg = useThemeColor('background') return (shouldLoad ? ( - <> + (isScanned ? undefined : onReadCode(event))} - hideControls + hideControls + style={{flex: 1}} /> {prevRouteName !== 'SendOptions' && ( @@ -235,11 +236,15 @@ export const ScanScreen: FC> = function ScanScree )} {error && } - + ) : null ) } +const $screen: ViewStyle = { + flex: 1, +} + const $buttonContainer: ViewStyle = { flexDirection: 'row', alignSelf: 'center', diff --git a/src/screens/SendScreen.tsx b/src/screens/SendScreen.tsx index ee2ddc98..da0354ca 100644 --- a/src/screens/SendScreen.tsx +++ b/src/screens/SendScreen.tsx @@ -24,8 +24,6 @@ import { ImageStyle, Image, } from 'react-native' -import Clipboard from '@react-native-clipboard/clipboard' -import QRCode from 'react-native-qrcode-svg' import {spacing, typography, useThemeColor, colors} from '../theme' import {WalletStackScreenProps} from '../navigation' import { @@ -933,8 +931,11 @@ const SelectProofsBlock = observer(function (props: {