Merge branch 'master' into renovate/realm-12.x

This commit is contained in:
Marcos Rodriguez Vélez 2024-02-29 14:28:06 -04:00 committed by GitHub
commit 92f627da29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 214 additions and 207 deletions

View file

@ -1,40 +0,0 @@
/* eslint react/prop-types: "off", react-native/no-inline-styles: "off" */
import React, { forwardRef } from 'react';
import { TouchableOpacity, View, Text } from 'react-native';
import { Icon } from 'react-native-elements';
import { useTheme } from './themes';
export const SquareButton = forwardRef((props, ref) => {
const { colors } = useTheme();
let backgroundColor = props.backgroundColor ? props.backgroundColor : colors.buttonBlueBackgroundColor;
let fontColor = colors.buttonTextColor;
if (props.disabled === true) {
backgroundColor = colors.buttonDisabledBackgroundColor;
fontColor = colors.buttonDisabledTextColor;
}
return (
<TouchableOpacity
style={{
flex: 1,
borderWidth: 0.7,
borderColor: 'transparent',
backgroundColor,
minHeight: 50,
height: 50,
maxHeight: 50,
borderRadius: 10,
justifyContent: 'center',
alignItems: 'center',
}}
{...props}
ref={ref}
accessibilityRole="button"
>
<View style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
{props.icon && <Icon name={props.icon.name} type={props.icon.type} color={props.icon.color} />}
{props.title && <Text style={{ marginHorizontal: 8, fontSize: 16, color: fontColor }}>{props.title}</Text>}
</View>
</TouchableOpacity>
);
});

View file

@ -0,0 +1,41 @@
import React, { forwardRef } from 'react';
import { TouchableOpacity, View, Text, StyleProp, ViewStyle, StyleSheet } from 'react-native';
import { useTheme } from './themes';
interface SquareButtonProps {
title: string;
onPress: () => void;
style: StyleProp<ViewStyle>;
testID?: string;
}
export const SquareButton = forwardRef<TouchableOpacity, SquareButtonProps>((props, ref) => {
const { title, onPress, style, testID } = props;
const { colors } = useTheme();
const hookStyles = StyleSheet.create({
text: {
color: colors.buttonTextColor,
},
});
return (
<TouchableOpacity ref={ref} style={style} onPress={onPress} testID={testID} accessibilityRole="button">
<View style={styles.contentContainer}>
<Text style={[styles.text, hookStyles.text]}>{title}</Text>
</View>
</TouchableOpacity>
);
});
const styles = StyleSheet.create({
contentContainer: {
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
},
text: {
marginHorizontal: 8,
fontSize: 16,
},
});

View file

@ -74,6 +74,7 @@
B4549F362B82B10D002E3153 /* ci_post_clone.sh in Resources */ = {isa = PBXBuildFile; fileRef = B4549F352B82B10D002E3153 /* ci_post_clone.sh */; };
B461B852299599F800E431AA /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = B461B851299599F800E431AA /* AppDelegate.mm */; };
B47B21EC2B2128B8001F6690 /* BlueWalletUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B47B21EB2B2128B8001F6690 /* BlueWalletUITests.swift */; };
B49038D92B8FBAD300A8164A /* BlueWalletUITest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B49038D82B8FBAD300A8164A /* BlueWalletUITest.swift */; };
B4A29A2C2B55C990002A67DF /* EventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D32C5C52596CE3A008C077C /* EventEmitter.m */; };
B4A29A2D2B55C990002A67DF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
B4A29A2E2B55C990002A67DF /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = B461B851299599F800E431AA /* AppDelegate.mm */; };
@ -91,7 +92,7 @@
B4AB225E2B02AD12001F4328 /* XMLParserDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4AB225C2B02AD12001F4328 /* XMLParserDelegate.swift */; };
B4EE583C226703320003363C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B40D4E35225841ED00428FCC /* Assets.xcassets */; };
C59F90CE0D04D3E4BB39BC5D /* libPods-BlueWalletUITests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6F02C2F7CA3591E4E0B06EBA /* libPods-BlueWalletUITests.a */; };
C978A716948AB7DEC5B6F677 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; };
C978A716948AB7DEC5B6F677 /* (null) in Frameworks */ = {isa = PBXBuildFile; };
E5D4794B26781FC0007838C1 /* fiatUnits.json in Resources */ = {isa = PBXBuildFile; fileRef = 6DD410AD266CAF1F0087DE03 /* fiatUnits.json */; };
E5D4794C26781FC1007838C1 /* fiatUnits.json in Resources */ = {isa = PBXBuildFile; fileRef = 6DD410AD266CAF1F0087DE03 /* fiatUnits.json */; };
/* End PBXBuildFile section */
@ -139,6 +140,13 @@
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
remoteInfo = BlueWallet;
};
B49038D62B8FBA2500A8164A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
proxyType = 1;
remoteGlobalIDString = B4A29A212B55C990002A67DF;
remoteInfo = "BlueWallet-NoLDK";
};
B4A29A232B55C990002A67DF /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
@ -232,7 +240,6 @@
/* Begin PBXFileReference section */
008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = "<group>"; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* BlueWalletTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BlueWalletTests.m; sourceTree = "<group>"; };
04466491BA2D4876A71222FC /* Foundation.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Foundation.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Foundation.ttf"; sourceTree = "<group>"; };
0C3D27CE367C0DD11F4B8772 /* Pods-BlueWalletUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BlueWalletUITests.release.xcconfig"; path = "Target Support Files/Pods-BlueWalletUITests/Pods-BlueWalletUITests.release.xcconfig"; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* BlueWallet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BlueWallet.app; sourceTree = BUILT_PRODUCTS_DIR; };
@ -368,6 +375,7 @@
B461B851299599F800E431AA /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = BlueWallet/AppDelegate.mm; sourceTree = "<group>"; };
B47B21E92B2128B8001F6690 /* BlueWalletUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BlueWalletUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
B47B21EB2B2128B8001F6690 /* BlueWalletUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlueWalletUITests.swift; sourceTree = "<group>"; };
B49038D82B8FBAD300A8164A /* BlueWalletUITest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlueWalletUITest.swift; sourceTree = "<group>"; };
B4A29A452B55C990002A67DF /* BlueWallet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BlueWallet.app; sourceTree = BUILT_PRODUCTS_DIR; };
B4A29A462B55C990002A67DF /* BlueWallet-NoLDK.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BlueWallet-NoLDK.plist"; sourceTree = "<absolute>"; };
B4AB21062B61D8CA0080440C /* SplashScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashScreen.swift; sourceTree = "<group>"; };
@ -399,7 +407,7 @@
files = (
782F075B5DD048449E2DECE9 /* libz.tbd in Frameworks */,
764B49B1420D4AEB8109BF62 /* libsqlite3.0.tbd in Frameworks */,
C978A716948AB7DEC5B6F677 /* BuildFile in Frameworks */,
C978A716948AB7DEC5B6F677 /* (null) in Frameworks */,
773E382FE62E836172AAB98B /* libPods-BlueWallet.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -461,8 +469,8 @@
00E356EF1AD99517003FC87E /* BlueWalletTests */ = {
isa = PBXGroup;
children = (
00E356F21AD99517003FC87E /* BlueWalletTests.m */,
00E356F01AD99517003FC87E /* Supporting Files */,
B49038D82B8FBAD300A8164A /* BlueWalletUITest.swift */,
);
path = BlueWalletTests;
sourceTree = "<group>";
@ -901,7 +909,6 @@
buildConfigurationList = B47B21F32B2128B8001F6690 /* Build configuration list for PBXNativeTarget "BlueWalletUITests" */;
buildPhases = (
6A7B5D072DAE0808347B48AA /* [CP] Check Pods Manifest.lock */,
B4A54FD92B83C1DB00210890 /* ShellScript */,
B47B21E52B2128B8001F6690 /* Sources */,
B47B21E62B2128B8001F6690 /* Frameworks */,
B47B21E72B2128B8001F6690 /* Resources */,
@ -912,6 +919,7 @@
);
dependencies = (
B47B21F02B2128B8001F6690 /* PBXTargetDependency */,
B49038D72B8FBA2500A8164A /* PBXTargetDependency */,
);
name = BlueWalletUITests;
productName = BlueWalletUITests;
@ -923,7 +931,6 @@
buildConfigurationList = B4A29A422B55C990002A67DF /* Build configuration list for PBXNativeTarget "BlueWallet-NoLDK" */;
buildPhases = (
B4A29A2A2B55C990002A67DF /* [CP] Check Pods Manifest.lock */,
B4A29A472B55D17B002A67DF /* ShellScript */,
B4A29A2B2B55C990002A67DF /* Sources */,
B4A29A302B55C990002A67DF /* Frameworks */,
B4A29A342B55C990002A67DF /* Resources */,
@ -987,7 +994,7 @@
};
B47B21E82B2128B8001F6690 = {
CreatedOnToolsVersion = 15.0.1;
TestTargetID = 13B07F861A680F5B00A75B9A;
TestTargetID = B4A29A212B55C990002A67DF;
};
};
};
@ -1024,7 +1031,7 @@
);
mainGroup = 83CBB9F61A601CBA00E9B192;
packageReferences = (
6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode.git" */,
6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode" */,
B41B76832B66B2FF002C48D5 /* XCRemoteSwiftPackageReference "bugsnag-cocoa" */,
);
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
@ -1375,40 +1382,6 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BlueWallet-NoLDK/Pods-BlueWallet-NoLDK-resources.sh\"\n";
showEnvVarsInLog = 0;
};
B4A29A472B55D17B002A67DF /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cp ../scripts/maccatalystpatches/lightning-ldk-wallet.ts ../class/wallets/lightning-ldk-wallet.ts\n";
};
B4A54FD92B83C1DB00210890 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cp ../scripts/maccatalystpatches/lightning-ldk-wallet.ts ../class/wallets/lightning-ldk-wallet.ts\n";
};
CF0725821442A3000F20E874 /* Upload Bugsnag dSYM */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@ -1506,6 +1479,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B49038D92B8FBAD300A8164A /* BlueWalletUITest.swift in Sources */,
B47B21EC2B2128B8001F6690 /* BlueWalletUITests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -1555,6 +1529,11 @@
target = 13B07F861A680F5B00A75B9A /* BlueWallet */;
targetProxy = B47B21EF2B2128B8001F6690 /* PBXContainerItemProxy */;
};
B49038D72B8FBA2500A8164A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = B4A29A212B55C990002A67DF /* BlueWallet-NoLDK */;
targetProxy = B49038D62B8FBA2500A8164A /* PBXContainerItemProxy */;
};
B4A29A222B55C990002A67DF /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
platformFilter = ios;
@ -1661,7 +1640,7 @@
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development io.bluewallet.bluewallet";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "match AppStore io.bluewallet.bluewallet catalyst";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_OBJC_BRIDGING_HEADER = "BlueWallet-Bridging-Header.h";
@ -1716,7 +1695,7 @@
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore io.bluewallet.bluewallet";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "match AppStore io.bluewallet.bluewallet catalyst";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_OBJC_BRIDGING_HEADER = "BlueWallet-Bridging-Header.h";
@ -2261,7 +2240,7 @@
"$(inherited)",
);
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(SDKROOT)/System/iOSSupport/usr/lib/swift",
@ -2282,8 +2261,8 @@
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = BlueWallet;
TARGETED_DEVICE_FAMILY = 2;
TEST_TARGET_NAME = "BlueWallet-NoLDK";
};
name = Debug;
};
@ -2309,7 +2288,7 @@
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(SDKROOT)/System/iOSSupport/usr/lib/swift",
@ -2327,8 +2306,8 @@
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = BlueWallet;
TARGETED_DEVICE_FAMILY = 2;
TEST_TARGET_NAME = "BlueWallet-NoLDK";
};
name = Release;
};
@ -2518,7 +2497,7 @@
/* End XCConfigurationList section */
/* Begin XCRemoteSwiftPackageReference section */
6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode.git" */ = {
6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/EFPrefix/EFQRCode.git";
requirement = {
@ -2539,7 +2518,7 @@
/* Begin XCSwiftPackageProductDependency section */
6DFC806F24EA0B6C007B8700 /* EFQRCode */ = {
isa = XCSwiftPackageProductDependency;
package = 6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode.git" */;
package = 6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode" */;
productName = EFQRCode;
};
B41B76842B66B2FF002C48D5 /* Bugsnag */ = {

View file

@ -5,6 +5,24 @@
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "cd ${SRCROOT}&#10;cd ..&#10;cp scripts/maccatalystpatches/lightning-ldk-wallet.ts class/wallets/lightning-ldk-wallet.ts&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B4A29A212B55C990002A67DF"
BuildableName = "BlueWallet.app"
BlueprintName = "BlueWallet-NoLDK"
ReferencedContainer = "container:BlueWallet.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions>
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
@ -30,7 +48,7 @@
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"

View file

@ -5,6 +5,24 @@
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "cd ${SRCROOT}&#10;cd ..&#10;cp scripts/maccatalystpatches/lightning-ldk-wallet.ts class/wallets/lightning-ldk-wallet.ts&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B47B21E82B2128B8001F6690"
BuildableName = "BlueWalletUITests.xctest"
BlueprintName = "BlueWalletUITests"
ReferencedContainer = "container:BlueWallet.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions>
</BuildAction>
<TestAction
buildConfiguration = "Debug"

View file

@ -1,68 +0,0 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import <React/RCTLog.h>
#import <React/RCTRootView.h>
#define TIMEOUT_SECONDS 600
#define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
@interface BlueWalletTests : XCTestCase
@end
@implementation BlueWalletTests
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
{
if (test(view)) {
return YES;
}
for (UIView *subview in [view subviews]) {
if ([self findSubviewInView:subview matching:test]) {
return YES;
}
}
return NO;
}
- (void)testRendersWelcomeScreen
{
UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
BOOL foundElement = NO;
__block NSString *redboxError = nil;
RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
if (level >= RCTLogLevelError) {
redboxError = message;
}
});
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
return YES;
}
return NO;
}];
}
RCTSetLogFunction(RCTDefaultLogFunction);
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
}
@end

View file

@ -0,0 +1,37 @@
//
// BlueWalletUITest.swift
// BlueWalletUITests
//
// Created by Marcos Rodriguez on 2/28/24.
// Copyright © 2024 BlueWallet. All rights reserved.
//
import XCTest
final class BlueWalletUITest: XCTestCase {
override func setUpWithError() throws {
continueAfterFailure = false
}
override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testAppLaunchesAndShowsSettingsButton() throws {
let app = XCUIApplication()
app.launch()
let settingsButton = app.buttons["SettingsButton"]
// Wait for the settings button to appear to make sure the app has finished launching and is displaying its initial UI.
let exists = NSPredicate(format: "exists == true")
expectation(for: exists, evaluatedWith: settingsButton, handler: nil)
// Wait for a maximum of 10 seconds for the settings button to appear
waitForExpectations(timeout: 10, handler: nil)
// Assert that the settings button is not only present but also hittable (visible and interactable)
XCTAssertTrue(settingsButton.isHittable, "The settings button should be visible and interactable")
}
}

View file

@ -473,7 +473,7 @@ PODS:
- React
- rn-ldk (0.8.4):
- React-Core
- RNCAsyncStorage (1.22.2):
- RNCAsyncStorage (1.22.3):
- React-Core
- RNCClipboard (1.13.2):
- React-Core
@ -845,7 +845,7 @@ SPEC CHECKSUMS:
ReactNativeCameraKit: 9d46a5d7dd544ca64aa9c03c150d2348faf437eb
RealmJS: a62dc7a1f94b888fe9e8712cd650167ad97dc636
rn-ldk: 0d8749d98cc5ce67302a32831818c116b67f7643
RNCAsyncStorage: 014a78b2cc8cc107c9e92ee428dc0c1ac3223416
RNCAsyncStorage: 10591b9e0a91eaffee14e69b3721009759235125
RNCClipboard: 60fed4b71560d7bfe40e9d35dea9762b024da86d
RNCPushNotificationIOS: 64218f3c776c03d7408284a819b2abfda1834bc8
RNDefaultPreference: 08bdb06cfa9188d5da97d4642dac745218d7fb31

View file

@ -8,10 +8,6 @@ brew install node@21
echo "===== Installing yarn (Xcode Cloud doenst like NPM ) ====="
brew install yarn
# LDK is not currently available for Catalyst, so we need to patch the wallet
echo "===== Running LDK is not currently available for Catalyst, so we need to patch the wallet ====="
cp scripts/maccatalystpatches/lightning-ldk-wallet.ts class/wallets/lightning-ldk-wallet.ts
# Install dependencies
echo "===== Running yarn install ====="
yarn install

View file

@ -271,6 +271,7 @@
"encrypt_tstorage": "Storage",
"encrypt_use": "Use {type}",
"encrypt_use_expl": "{type} will be used to confirm your identity before making a transaction, unlocking, exporting, or deleting a wallet. {type} will not be used to unlock encrypted storage.",
"biometrics_fail": "If {type} is not enabled, or fails to unlock, you can use your device passcode as an alternative.",
"general": "General",
"general_adv_mode": "Advanced Mode",
"general_adv_mode_e": "When enabled, you will see advanced options such as different wallet types, the ability to specify the LNDHub instance you wish to connect to, and custom entropy during wallet creation.",

14
package-lock.json generated
View file

@ -16,7 +16,7 @@
"@keystonehq/bc-ur-registry": "0.6.4",
"@ngraveio/bc-ur": "1.1.6",
"@noble/secp256k1": "1.6.3",
"@react-native-async-storage/async-storage": "1.22.2",
"@react-native-async-storage/async-storage": "1.22.3",
"@react-native-clipboard/clipboard": "1.13.2",
"@react-native-community/push-notification-ios": "1.11.0",
"@react-navigation/drawer": "6.6.9",
@ -4318,9 +4318,9 @@
}
},
"node_modules/@react-native-async-storage/async-storage": {
"version": "1.22.2",
"resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.22.2.tgz",
"integrity": "sha512-nZpzT4Wz1OkVdQaZP/awpDCTKiPzdmG0PYmRF37ZeJlfwlwOg55in0TP2YUOW0MhOCRiNMomWWLojDLv5j2OIw==",
"version": "1.22.3",
"resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.22.3.tgz",
"integrity": "sha512-Ov3wjuqxHd62tLYfgTjxj77YRYWra3A4Fi8uICIPcePgNO2WkS5B0ADXt9e/JLzSCNqVlXCq4Fir/gHmZTU9ww==",
"dependencies": {
"merge-options": "^3.0.4"
},
@ -25814,9 +25814,9 @@
"dev": true
},
"@react-native-async-storage/async-storage": {
"version": "1.22.2",
"resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.22.2.tgz",
"integrity": "sha512-nZpzT4Wz1OkVdQaZP/awpDCTKiPzdmG0PYmRF37ZeJlfwlwOg55in0TP2YUOW0MhOCRiNMomWWLojDLv5j2OIw==",
"version": "1.22.3",
"resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.22.3.tgz",
"integrity": "sha512-Ov3wjuqxHd62tLYfgTjxj77YRYWra3A4Fi8uICIPcePgNO2WkS5B0ADXt9e/JLzSCNqVlXCq4Fir/gHmZTU9ww==",
"requires": {
"merge-options": "^3.0.4"
}

View file

@ -105,9 +105,9 @@
"@react-native-async-storage/async-storage": "1.22.3",
"@react-native-clipboard/clipboard": "1.13.2",
"@react-native-community/push-notification-ios": "1.11.0",
"@react-navigation/drawer": "6.6.9",
"@react-navigation/native": "6.1.12",
"@react-navigation/native-stack": "6.9.20",
"@react-navigation/drawer": "6.6.11",
"@react-navigation/native": "6.1.14",
"@react-navigation/native-stack": "6.9.22",
"@remobile/react-native-qrcode-local-image": "https://github.com/BlueWallet/react-native-qrcode-local-image",
"@spsina/bip47": "github:BlueWallet/bip47#0a2f02c90350802f2ec93afa4e6c8843be2d687c",
"aezeed": "0.0.5",

View file

@ -1,8 +1,8 @@
import React, { useEffect, useState, useCallback, useContext } from 'react';
import { View, ScrollView, Alert, TouchableOpacity, TouchableWithoutFeedback, Text, StyleSheet } from 'react-native';
import { View, ScrollView, Alert, TouchableOpacity, TouchableWithoutFeedback, Text, StyleSheet, Platform } from 'react-native';
import { useNavigation } from '@react-navigation/native';
import navigationStyle from '../../components/navigationStyle';
import { BlueLoading, BlueSpacing20, BlueCard, BlueText } from '../../BlueComponents';
import { BlueSpacing20, BlueCard, BlueText } from '../../BlueComponents';
import Biometric from '../../class/biometrics';
import loc from '../../loc';
import { BlueStorageContext } from '../../blue_modules/storage-context';
@ -14,11 +14,11 @@ const prompt = require('../../helpers/prompt');
const EncryptStorage = () => {
const { isStorageEncrypted, encryptStorage, decryptStorage, saveToDisk } = useContext(BlueStorageContext);
const [isLoading, setIsLoading] = useState(true);
const [biometrics, setBiometrics] = useState({ isDeviceBiometricCapable: false, isBiometricsEnabled: false, biometricsType: '' });
const [storageIsEncryptedSwitchEnabled, setStorageIsEncryptedSwitchEnabled] = useState(false);
const { navigate, popToTop } = useNavigation();
const { colors } = useTheme();
const [isLoading, setIsLoading] = useState({ encryptStorage: false, biometrics: false });
const styleHooks = StyleSheet.create({
root: {
backgroundColor: colors.background,
@ -35,7 +35,6 @@ const EncryptStorage = () => {
const isStorageEncryptedSwitchEnabled = await isStorageEncrypted();
setStorageIsEncryptedSwitchEnabled(isStorageEncryptedSwitchEnabled);
setBiometrics({ isBiometricsEnabled, isDeviceBiometricCapable, biometricsType });
setIsLoading(false);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
useEffect(() => {
@ -63,26 +62,26 @@ const EncryptStorage = () => {
};
const onEncryptStorageSwitch = async value => {
setIsLoading(true);
setIsLoading(prev => ({ ...prev, encryptStorage: true }));
if (value === true) {
let p1 = await prompt(loc.settings.password, loc.settings.password_explain).catch(() => {
setIsLoading(false);
setIsLoading(prev => ({ ...prev, encryptStorage: false }));
p1 = undefined;
});
if (!p1) {
setIsLoading(false);
setIsLoading(prev => ({ ...prev, encryptStorage: false }));
return;
}
const p2 = await prompt(loc.settings.password, loc.settings.retype_password).catch(() => {
setIsLoading(false);
setIsLoading(prev => ({ ...prev, encryptStorage: false }));
});
if (p1 === p2) {
await encryptStorage(p1);
setIsLoading(false);
setStorageIsEncryptedSwitchEnabled(await isStorageEncrypted());
saveToDisk();
setIsLoading(prev => ({ ...prev, encryptStorage: false }));
} else {
setIsLoading(false);
setIsLoading(prev => ({ ...prev, encryptStorage: false }));
triggerHapticFeedback(HapticFeedbackTypes.NotificationError);
presentAlert({ message: loc.settings.passwords_do_not_match });
}
@ -94,7 +93,7 @@ const EncryptStorage = () => {
{
text: loc._.cancel,
style: 'cancel',
onPress: () => setIsLoading(false),
onPress: () => setIsLoading(prev => ({ ...prev, encryptStorage: false })),
},
{
text: loc._.ok,
@ -108,6 +107,7 @@ const EncryptStorage = () => {
};
const onUseBiometricSwitch = async value => {
setIsLoading(prev => ({ ...prev, biometrics: true }));
const isBiometricsEnabled = {
isDeviceBiometricCapable: biometrics.isDeviceBiometricCapable,
isBiometricsEnabled: biometrics.isBiometricsEnabled,
@ -118,18 +118,35 @@ const EncryptStorage = () => {
await Biometric.setBiometricUseEnabled(value);
setBiometrics(isBiometricsEnabled);
}
setIsLoading(prev => ({ ...prev, biometrics: false }));
};
const navigateToPlausibleDeniability = () => {
navigate('PlausibleDeniability');
};
return isLoading ? (
<ScrollView centerContent>
<BlueLoading />
</ScrollView>
) : (
<ScrollView contentContainerStyle={styles.root} automaticallyAdjustContentInsets contentInsetAdjustmentBehavior="automatic">
const renderPasscodeExplanation = () => {
let isCapable = true;
if (Platform.OS === 'android') {
if (Platform.Version < 30) {
isCapable = false;
}
}
return isCapable ? (
<>
<BlueText />
<BlueText>{loc.formatString(loc.settings.biometrics_fail, { type: biometrics.biometricsType })}</BlueText>
</>
) : null;
};
return (
<ScrollView
contentContainerStyle={styleHooks.root}
automaticallyAdjustContentInsets
contentInsetAdjustmentBehavior="automatic"
centerContent={isLoading}
>
<View style={styles.paddingTop} />
{biometrics.isDeviceBiometricCapable && (
<>
@ -139,10 +156,17 @@ const EncryptStorage = () => {
<ListItem
title={loc.formatString(loc.settings.encrypt_use, { type: biometrics.biometricsType })}
Component={TouchableWithoutFeedback}
switch={{ value: biometrics.isBiometricsEnabled, onValueChange: onUseBiometricSwitch }}
isLoading={isLoading.biometrics}
containerStyle={[styles.rowItemContainerStyle, styleHooks.root]}
switch={{
value: biometrics.isBiometricsEnabled,
onValueChange: onUseBiometricSwitch,
disabled: isLoading.encryptStorage || isLoading.biometrics,
}}
/>
<BlueCard>
<BlueText>{loc.formatString(loc.settings.encrypt_use_expl, { type: biometrics.biometricsType })}</BlueText>
{renderPasscodeExplanation()}
</BlueCard>
<BlueSpacing20 />
</>
@ -151,11 +175,17 @@ const EncryptStorage = () => {
{loc.settings.encrypt_tstorage}
</Text>
<ListItem
testID="EncyptedAndPasswordProtected"
testID="EncryptedAndPasswordProtected"
hideChevron
isLoading={isLoading.encryptStorage}
title={loc.settings.encrypt_enc_and_pass}
Component={TouchableWithoutFeedback}
switch={{ onValueChange: onEncryptStorageSwitch, value: storageIsEncryptedSwitchEnabled }}
containerStyle={[styles.rowItemContainerStyle, styleHooks.root]}
switch={{
onValueChange: onEncryptStorageSwitch,
value: storageIsEncryptedSwitchEnabled,
disabled: isLoading.encryptStorage || isLoading.biometrics,
}}
/>
{storageIsEncryptedSwitchEnabled && (
<ListItem
@ -171,15 +201,15 @@ const EncryptStorage = () => {
};
const styles = StyleSheet.create({
root: {
flex: 1,
},
paddingTop: { paddingTop: 19 },
paddingTop: { paddingTop: 36 },
headerText: {
fontWeight: 'bold',
fontSize: 30,
marginLeft: 17,
},
rowItemContainerStyle: {
minHeight: 60,
},
});
export default EncryptStorage;

View file

@ -526,12 +526,7 @@ const ViewEditMultisigCosigners = ({ route }: Props) => {
<QRCodeComponent value={exportStringURv2} size={260} isLogoRendered={false} />
<BlueSpacing20 />
<View style={styles.squareButtonWrapper}>
<SquareButton
// @ts-ignore wtf style
style={[styles.exportButton, stylesHook.exportButton]}
onPress={exportCosigner}
title={loc.multisig.share}
/>
<SquareButton style={[styles.exportButton, stylesHook.exportButton]} onPress={exportCosigner} title={loc.multisig.share} />
</View>
</View>
</KeyboardAvoidingView>