Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/cargo/rust/tokio-1.35.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry-Borodin authored Dec 28, 2023
2 parents a4f0ee9 + ab6c7f2 commit fb2a429
Show file tree
Hide file tree
Showing 14 changed files with 132 additions and 47 deletions.
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "io.parity.signer"
minSdk 23
targetSdk 34
versionCode 60200
versionName "6.2.0"
versionCode 60300
versionName "6.3.0"
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
Expand Down
2 changes: 0 additions & 2 deletions android/src/main/java/io/parity/signer/domain/FeatureFlags.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ object FeatureFlags {
FeatureOption.SKIP_UNLOCK_FOR_DEVELOPMENT -> false
FeatureOption.SKIP_ROOTED_CHECK_EMULATOR -> false
FeatureOption.EXPORT_SECRET_KEY -> false //unused
FeatureOption.ENABLE_DYNAMIC_DERIVATIONS -> true // enable for debug only
FeatureOption.FAIL_DB_VERSION_CHECK -> false

}
Expand All @@ -23,7 +22,6 @@ object FeatureFlags {

enum class FeatureOption {
FAIL_DB_VERSION_CHECK,
ENABLE_DYNAMIC_DERIVATIONS,
SKIP_UNLOCK_FOR_DEVELOPMENT,
SKIP_ROOTED_CHECK_EMULATOR,
EXPORT_SECRET_KEY; //unused as sample
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,31 +139,13 @@ class CameraViewModel() : ViewModel() {
}

is DecodeSequenceResult.DynamicDerivations -> {
if (FeatureFlags.isEnabled(FeatureOption.ENABLE_DYNAMIC_DERIVATIONS)) {
resetScanValues()
_dynamicDerivationPayload.value = payload.s
} else {
val context = ServiceLocator.appContext
Toast.makeText(
context,
"Dynamic derivations not supported yet",
Toast.LENGTH_LONG
).show()
}
resetScanValues()
_dynamicDerivationPayload.value = payload.s
}

is DecodeSequenceResult.DynamicDerivationTransaction -> {
if (FeatureFlags.isEnabled(FeatureOption.ENABLE_DYNAMIC_DERIVATIONS)) {
resetScanValues()
_dynamicDerivationTransactionPayload.value = payload.s
} else {
val context = ServiceLocator.appContext
Toast.makeText(
context,
"Dynamic derivations not supported yet",
Toast.LENGTH_LONG
).show()
}
resetScanValues()
_dynamicDerivationTransactionPayload.value = payload.s
}
}

Expand Down
48 changes: 37 additions & 11 deletions ios/PolkadotVault.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@
6D5801E1289924AD006C41D8 /* ConnectivityMonitoringAdapterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D5801E0289924AD006C41D8 /* ConnectivityMonitoringAdapterTests.swift */; };
6D5801E5289937BA006C41D8 /* ConnectivityMonitoringAssemblerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D5801E4289937BA006C41D8 /* ConnectivityMonitoringAssemblerTests.swift */; };
6D5801E7289937C0006C41D8 /* ConnectivityMonitoringAssembler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D5801E6289937C0006C41D8 /* ConnectivityMonitoringAssembler.swift */; };
6D5DB5E82B3C61A200EF82AB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D5DB5E72B3C61A200EF82AB /* AppDelegate.swift */; };
6D5DB5EB2B3D1A9500EF82AB /* DevicePasscodeAuthenticator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D5DB5EA2B3D1A9500EF82AB /* DevicePasscodeAuthenticator.swift */; };
6D5DCA032A7CFA2E0050B101 /* ExportKeysSelectionModal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D5DCA022A7CFA2E0050B101 /* ExportKeysSelectionModal.swift */; };
6D5FDDCC2977D08E0076C1C4 /* LogNoteModal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D5FDDCB2977D08E0076C1C4 /* LogNoteModal.swift */; };
6D5FDDD02977DBE00076C1C4 /* HiddenTextEditorBackgroundModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D5FDDCF2977DBE00076C1C4 /* HiddenTextEditorBackgroundModifier.swift */; };
Expand Down Expand Up @@ -449,6 +451,7 @@
6D220A2B2963DBC300122DA8 /* EnterBananaSplitPasswordModal.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EnterBananaSplitPasswordModal.swift; sourceTree = "<group>"; };
6D22FB872A9748700005993C /* BackendService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackendService.swift; sourceTree = "<group>"; };
6D25E6B22A02323A00376AB9 /* FullscreenModal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FullscreenModal.swift; sourceTree = "<group>"; };
6D263E072B39827700790510 /* AutoMockable.stencil */ = {isa = PBXFileReference; lastKnownFileType = text; path = AutoMockable.stencil; sourceTree = "<group>"; };
6D2779C728B3D33100570055 /* NavigationBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationBarView.swift; sourceTree = "<group>"; };
6D2A5D0E2AA5DF47009E0C3A /* ManageKeySetsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManageKeySetsView.swift; sourceTree = "<group>"; };
6D2A5D102AA607C7009E0C3A /* ActionSheetCircleButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionSheetCircleButton.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -506,6 +509,8 @@
6D5801E0289924AD006C41D8 /* ConnectivityMonitoringAdapterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectivityMonitoringAdapterTests.swift; sourceTree = "<group>"; };
6D5801E4289937BA006C41D8 /* ConnectivityMonitoringAssemblerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectivityMonitoringAssemblerTests.swift; sourceTree = "<group>"; };
6D5801E6289937C0006C41D8 /* ConnectivityMonitoringAssembler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectivityMonitoringAssembler.swift; sourceTree = "<group>"; };
6D5DB5E72B3C61A200EF82AB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
6D5DB5EA2B3D1A9500EF82AB /* DevicePasscodeAuthenticator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DevicePasscodeAuthenticator.swift; sourceTree = "<group>"; };
6D5DCA022A7CFA2E0050B101 /* ExportKeysSelectionModal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExportKeysSelectionModal.swift; sourceTree = "<group>"; };
6D5FDDCB2977D08E0076C1C4 /* LogNoteModal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogNoteModal.swift; sourceTree = "<group>"; };
6D5FDDCF2977DBE00076C1C4 /* HiddenTextEditorBackgroundModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HiddenTextEditorBackgroundModifier.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -882,11 +887,12 @@
2DE72BC026A588C7002BB752 /* PolkadotVault */ = {
isa = PBXGroup;
children = (
2DE72BC126A588C7002BB752 /* PolkadotVaultApp.swift */,
6DEEA87D28AFBF5D00371ECA /* libsigner.a */,
6D06CD272AFD2EF000FAB275 /* Configuration */,
6D8045DA28D0840500237F8C /* RustDataExtensions */,
6DA2ACA02939CB3000AAEADC /* Helpers */,
6D2D244928CCAD3700862726 /* Backend */,
6DEEA87D28AFBF5D00371ECA /* libsigner.a */,
6DFAF36C28AF845F0048763B /* Stubs */,
6D5801CF28991306006C41D8 /* Protocols */,
6D5801CE28991301006C41D8 /* Core */,
Expand All @@ -898,7 +904,6 @@
2D7A7BC626BA974E0053C1E0 /* Screens */,
2D7A7BC526BA96D00053C1E0 /* Cards */,
6DF91F3B29C06AF6000A6BB2 /* StateMediators */,
2DE72BC126A588C7002BB752 /* PolkadotVaultApp.swift */,
2DE72C1226AACB25002BB752 /* Database */,
2D75EF9E280F02B900C48FAF /* Generated */,
2DE72BC726A588C9002BB752 /* Preview Content */,
Expand Down Expand Up @@ -1103,6 +1108,14 @@
path = NavigationServices;
sourceTree = "<group>";
};
6D263E062B39827700790510 /* Sourcery */ = {
isa = PBXGroup;
children = (
6D263E072B39827700790510 /* AutoMockable.stencil */,
);
path = Sourcery;
sourceTree = "<group>";
};
6D2D244928CCAD3700862726 /* Backend */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1236,6 +1249,7 @@
6D57DC5C289E524800005C63 /* Templates */ = {
isa = PBXGroup;
children = (
6D263E062B39827700790510 /* Sourcery */,
6D57DC5D289E524800005C63 /* swiftui-strings-template.stencil */,
);
path = Templates;
Expand All @@ -1260,16 +1274,18 @@
6D5801CE28991301006C41D8 /* Core */ = {
isa = PBXGroup;
children = (
6D5DB5E92B3D1A8700EF82AB /* Authentication */,
6D5DB5E72B3C61A200EF82AB /* AppDelegate.swift */,
6D6430F528CB460A00342E37 /* ServiceLocator.swift */,
6DFE588C297A72B1002BFDBF /* JailbreakDetectionPublisher.swift */,
6DFE588A297A5F09002BFDBF /* ApplicationStatePublisher.swift */,
6D9921B6297FB471004891B6 /* PasswordProtectionStatePublisher.swift */,
6DEFB52B28FEC94000762219 /* QRCode */,
6D6ACA3F28F0B383002FB03A /* Camera */,
6DC5643128B68FB2003D540B /* Keychain */,
6DBD21F8289A7A14005D539B /* Database */,
6D5801D528991DA4006C41D8 /* Runtime */,
6D5801D22899132C006C41D8 /* Connectivity */,
6D6430F528CB460A00342E37 /* ServiceLocator.swift */,
6DFE588C297A72B1002BFDBF /* JailbreakDetectionPublisher.swift */,
6DFE588A297A5F09002BFDBF /* ApplicationStatePublisher.swift */,
6D9921B6297FB471004891B6 /* PasswordProtectionStatePublisher.swift */,
);
path = Core;
sourceTree = "<group>";
Expand Down Expand Up @@ -1328,6 +1344,14 @@
path = Connectivity;
sourceTree = "<group>";
};
6D5DB5E92B3D1A8700EF82AB /* Authentication */ = {
isa = PBXGroup;
children = (
6D5DB5EA2B3D1A9500EF82AB /* DevicePasscodeAuthenticator.swift */,
);
path = Authentication;
sourceTree = "<group>";
};
6D5DCA012A7CFA1E0050B101 /* ExportKeys */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -2229,7 +2253,6 @@
};
6DE48E282B1EB932003094D5 /* Run Sourcery */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand All @@ -2238,6 +2261,7 @@
inputPaths = (
"$(SRCROOT)/sourcery.yml",
"${SRCROOT}/PolkadotVaultTests/Generated/AutoMockable/Scripts/initial_setup.sh",
"$(SRCROOT)/PolkadotVault/Resources/Templates/Sourcery/AutoMockable.stencil",
);
name = "Run Sourcery";
outputFileListPaths = (
Expand Down Expand Up @@ -2376,6 +2400,7 @@
6DC33717295559EA0067284B /* NetworkSettingsDetailsActionModal.swift in Sources */,
6DDD73752940496800F04CE7 /* LogEntryRenderable.swift in Sources */,
6DF7751B28B399AC0040012E /* CornerRadius.swift in Sources */,
6D5DB5E82B3C61A200EF82AB /* AppDelegate.swift in Sources */,
6DF3CFEE299370F7002DF203 /* CreateKeySetSeedPhraseView.swift in Sources */,
6DEB18E82A0B8BD30013995E /* Stubs.swift in Sources */,
6D6430EC28CB2FDF00342E37 /* TapAndDelayDismissAnimator.swift in Sources */,
Expand Down Expand Up @@ -2507,6 +2532,7 @@
6DF91F4029C06B70000A6BB2 /* VerifierValue+Show.swift in Sources */,
6D2D245228CE5F2D00862726 /* KeyDetailsPublicKeyView.swift in Sources */,
6DD4A6A629E9480700FA6746 /* KeyListService.swift in Sources */,
6D5DB5EB2B3D1A9500EF82AB /* DevicePasscodeAuthenticator.swift in Sources */,
6D95E97328B4F42300E28A11 /* ActionButton.swift in Sources */,
2DAA829D27885A67002917C0 /* TCMeta.swift in Sources */,
2DA5F86027566C3600D8DD29 /* TCAuthorPublicKey.swift in Sources */,
Expand Down Expand Up @@ -2772,7 +2798,7 @@
"$(inherited)",
"$(PROJECT_DIR)/PolkadotVault",
);
MARKETING_VERSION = 6.1.3;
MARKETING_VERSION = 6.3.1;
PRODUCT_BUNDLE_IDENTIFIER = io.parity.NativeSigner;
PRODUCT_MODULE_NAME = PolkadotVault;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -2808,7 +2834,7 @@
"$(inherited)",
"$(PROJECT_DIR)/PolkadotVault",
);
MARKETING_VERSION = 6.1.3;
MARKETING_VERSION = 6.3.1;
PRODUCT_BUNDLE_IDENTIFIER = io.parity.NativeSigner;
PRODUCT_MODULE_NAME = PolkadotVault;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -2851,7 +2877,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 4GK8JWU7P9;
DEVELOPMENT_TEAM = P2PX3JU8FT;
INFOPLIST_FILE = PolkadotVaultTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -2950,7 +2976,7 @@
"$(inherited)",
"$(PROJECT_DIR)/PolkadotVault",
);
MARKETING_VERSION = 6.1.3;
MARKETING_VERSION = 6.3.1;
PRODUCT_BUNDLE_IDENTIFIER = io.parity.NativeSigner;
PRODUCT_MODULE_NAME = PolkadotVault;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
2 changes: 1 addition & 1 deletion ios/PolkadotVault/Configuration/Production.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
//

APP_RUNTIME_MODE = production
DYNAMIC_DERIVATIONS_ENABLED = false
DYNAMIC_DERIVATIONS_ENABLED = true
PRODUCT_NAME = Vault
PRODUCT_MODULE_NAME = PolkadotVault
23 changes: 23 additions & 0 deletions ios/PolkadotVault/Core/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// AppDelegate.swift
// PolkadotVault
//
// Created by Krzysztof Rodak on 27/12/2023.
//

import UIKit

final class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_: UIApplication,
shouldAllowExtensionPointIdentifier extensionPointIdentifier: UIApplication.ExtensionPointIdentifier
) -> Bool {
switch extensionPointIdentifier {
case .keyboard:
false
default:
true
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// DevicePasscodeAuthenticator.swift
// PolkadotVault
//
// Created by Krzysztof Rodak on 28/12/2023.
//

import Foundation
import LocalAuthentication

protocol DevicePasscodeAuthenticatorProtocol {
/// This methods trigger passcode screen to authenticate user, if failed, will bring back "Unlock app" screen
///
/// As we can't use `LAContext` to properly evaluate user authentication, as this would trigger biometry check
/// if set up. Hence we need to rely on fetching some seed from Keychain and with assumption that authentication
/// is used only when some seed is present this satisfies our requirements
/// - Returns: whether user is authenticated or not
func authenticateUser() -> Bool
}

final class DevicePasscodeAuthenticator: DevicePasscodeAuthenticatorProtocol {
private let seedsMediator: SeedsMediating

init(
seedsMediator: SeedsMediating = ServiceLocator.seedsMediator
) {
self.seedsMediator = seedsMediator
}

func authenticateUser() -> Bool {
guard let seedName = seedsMediator.seedNames.first else { return true }
return !seedsMediator.getSeed(seedName: seedName).isEmpty
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ final class ConnectivityMonitoringAdapter: ObservableObject, ConnectivityMonitor
guard isConnected != self.isConnected else { return }
self.isConnected = isConnected
notificationQueue.async {
if isConnected {
try? historyDeviceWasOnline()
}
update(isConnected)
}
}
Expand Down
1 change: 1 addition & 0 deletions ios/PolkadotVault/Core/ServiceLocator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ enum ServiceLocator {
static var onboardingMediator: OnboardingMediator = OnboardingMediator()

static var networkColorsGenerator = UnknownNetworkColorsGenerator()
static var devicePasscodeAuthenticator: DevicePasscodeAuthenticatorProtocol = DevicePasscodeAuthenticator()
}
1 change: 1 addition & 0 deletions ios/PolkadotVault/PolkadotVaultApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct PolkadotVaultApp: App {
@StateObject var navigation = NavigationCoordinator()
@StateObject var jailbreakDetectionPublisher = JailbreakDetectionPublisher()
@StateObject var applicationStatePublisher = ApplicationStatePublisher()
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate

var body: some Scene {
WindowGroup {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ extension MainScreenContainer {

private extension MainScreenContainer.ViewModel {
func initialiseAppRun() {
appLaunchMediator.finaliseInitialisation { result in
appLaunchMediator.finaliseInitialisation(connectivityMediator.isConnectivityOn) { result in
switch result {
case .success:
self.checkInitialState()
Expand Down
2 changes: 1 addition & 1 deletion ios/PolkadotVault/Screens/Logs/Views/LogNoteModal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ extension LogNoteModal {
case .success:
isPresented = false
case let .failure(error):
presentableError = .init(title: error.description)
presentableError = .alertError(message: error.description)
isPresentingError = true
}
}
Expand Down
Loading

0 comments on commit fb2a429

Please sign in to comment.