Add FHSE and other wallet-core improvements
What changed, and why it matters
This is a large feature and hardening update for a Monero wallet app. It adds FIDO2 security-key support (called FHSE), encrypted metadata backup, memory-hardening flags for Android and iOS, a new transaction-history screen, seed-phrase verification, and changes how 'monero:' payment links are handled so they cannot bypass the app's lock screen. Most of the changes are defensive, but the size of the patch and the new deep-link handling deserve careful review because any mistake there could let a malicious link open the send screen while the wallet is still locked.
Treat this as a significant security-relevant release, not a routine update. Reviewers should: (1) audit the full route_policy.dart and PaymentLinkGate logic in the Dart layer to confirm no route can be reached while AppSession.isUnlocked is false; (2) verify that Android's getInitialRoute/shouldHandleDeeplinking overrides and iOS FlutterDeepLinkingEnabled=false cannot be circumvented by intent flags or scene restoration; (3) inspect the wallet_fhse and wallet_backup_platform plugin implementations (not shown in this diff) for key handling and backup encryption; (4) validate that the new backup_rules.xml and iCloud container only expose the intended metadata_backup directory; (5) run static/dynamic analysis on the updated native dependencies (YubiKit, BoringSSL, libsodium, libcbor) and confirm reproducible Swift package pins in CI.
Security signals we found
New FIDO2/Hardware security key integration (wallet_fhse, YubiKit Swift 1.4.0)
New encrypted metadata backup with iCloud/Android backup rules
Android native memory hardening: memtagMode sync, nativeHeapZeroInitialized, gwpAsanMode always
iOS hardened-process entitlements: hardened-heap, checked-allocations, dyld-ro, enhanced-security-version 2
Payment-link handling rewritten to prevent deep-link bypass of app lock
Flutter deep linking explicitly disabled on Android and iOS
Route policy added to deny unlisted/locked routes
Large dependency and build-tool version bumps
New history export and seed verification UI flows
Evidence from the diff
The commit is a major wallet-core refresh (+4,088/-971 across 65 files). Key technical changes visible in the diff include: (1) FHSE (FIDO2 hardware security key encryption) integration via new wallet_fhse plugin and YubiKit Swift package; (2) wallet_backup_platform plugin with iCloud container and scoped Android backup rules; (3) Android manifest hardening (MTE, GWP-ASan, zero-initialized native heap) and iOS hardened-process entitlements; (4) replacement of Flutter deep-linking with platform-specific PaymentLinks channels on Android/iOS that hold monero: URIs until Dart reports the user is past all locks; (5) new screens/routes for history, verify seed, advanced security, metadata backup, security-key unlock; (6) dependency updates (Flutter 3.41.7/Dart 3.11.5, CocoaPods 1.17, iOS deployment target 16.0, new plugins). The patch is explicitly defensive and does not appear to introduce a known vulnerability, but the new route policy and payment-link gate are security-critical and only partially shown in the supplied diff.
Changed components
Android MainActivity deep-link handlingiOS AppDelegate / PaymentLinks plugin integrationAndroidManifest.xml backup and memory-hardening flagsiOS Runner.entitlements and Podfile build settingspubspec.yaml plugin set (wallet_fhse, wallet_backup_platform, wallet_openalias, etc.)lib/main.dart routing, app-lock, and payment-link gatelib/route_policy.dart (new route access control)lib/screens/history.dart, verify_seed.dart, settings.dart, send.dartRelease CI workflow (Swift package pin checks, iCloud production container)Inspect captured patch +4088 / −971
### .github/workflows/release.yml
@@ -416,6 +416,8 @@ jobs:
<dict>
<key>method</key>
<string>app-store</string>
+ <key>iCloudContainerEnvironment</key>
+ <string>Production</string>
<key>provisioningProfiles</key>
<dict>
<key>org.magicgrants.skylightwallet</key>
@@ -435,6 +437,17 @@ jobs:
flutter pub get --enforce-lockfile
flutter build ipa --dart-define=DEMO_MODE=true --release --export-options-plist=ios/ExportOptions.plist
+ - name: Check Swift package pins
+ # YubiKit Swift and swift-log must build from the revisions committed in
+ # Package.resolved. Xcode rewrites the file when it resolves anything
+ # else, so a missing or changed file fails the release.
+ run: |
+ for f in ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved \
+ ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved; do
+ git ls-files --error-unmatch "$f" > /dev/null
+ git diff --exit-code -- "$f"
+ done
+
- name: Prepare artifact
run: |
VERSION='${{ needs.version.outputs.version }}'
### .gitignore
@@ -47,3 +47,7 @@ app.*.map.json
# Local reproducibility test outputs (.so builds + logs)
/repro-out/
pubspec_overrides.yaml
+
+# monero_c for macOS, built locally (scripts/build-moneroc.sh): it embeds the
+# build path, so it is never committed
+/macos/Frameworks/
### README.md
@@ -4,6 +4,8 @@
A modern, open-source, and self-custody Monero light-wallet built with Flutter by [MAGIC Grants](https://magicgrants.org).
+On Android, the optional Background sync and Continuous sync use your view key only: they see incoming payments, but never hold a key that could spend.
+
**Website:** [skylight.magicgrants.org](https://skylight.magicgrants.org)
Looking for Bitcoin, Ethereum, and Dai too? [Spice Wallet](https://github.com/MAGICGrants/spice-wallet) is MAGIC Grants' multicoin wallet, built on the same wallet engine.
@@ -23,6 +25,14 @@ Looking for Bitcoin, Ethereum, and Dai too? [Spice Wallet](https://github.com/MA
Android APKs are also available from the [latest release](https://github.com/MAGICGrants/skylight-wallet/releases/latest).
+### Requirements
+
+- **iOS:** iOS 16 or later.
+- **Android:** Android 7.0 (API 24) or later.
+- **macOS:** macOS 13 Ventura or later, on Apple silicon. There is no macOS release yet; build from source.
+- **Windows:** Windows 10 or 11, 64-bit. Security keys need Windows 11, version 22H2 or later.
+- **Linux:** 64-bit (x86_64). Security keys need libfido2 (`libfido2-1`, which the ``.deb`` recommends).
+
### Desktop
#### Linux
@@ -75,11 +85,12 @@ A successful verification prints `Good signature from "MAGIC Grants <info@magicg
Before you begin, ensure you have the following installed:
-- **Flutter SDK** (3.8.1 or higher) - [Installation guide](https://docs.flutter.dev/get-started/install)
-- **Dart SDK** (3.8.1 or higher) - Usually comes with Flutter
+- **Flutter SDK** (3.41.7, the version pinned in `pubspec.yaml`) - [Installation guide](https://docs.flutter.dev/get-started/install)
+- **Dart SDK** (3.11.5) - Comes with Flutter
- **Android Studio** - For Android development
-- **Android SDK** - API level 21+ (Android 5.0 Lollipop or higher)
-- **Java JDK** - Version 11 or higher
+- **Android SDK** - API level 24+ (Android 7.0 or higher)
+- **Java JDK** - Version 17
+- **Xcode** (26 or later) and **CocoaPods** (1.17) - For iOS and macOS builds
## Getting Started
### android/app/src/main/AndroidManifest.xml
@@ -11,11 +11,27 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
+ <!-- Native memory hardening, for the C and C++ in this process (the
+ Flutter engine, Monero, Tor, FHSE). memtagMode: Arm MTE in sync mode,
+ which stops a use-after-free or overflow at the faulting access; it
+ takes effect only on devices with MTE turned on (Pixel 8 and later).
+ nativeHeapZeroInitialized: memory from the system allocator (malloc,
+ new) is zeroed as it is handed out, so a missed initialisation reads
+ zeros rather than an earlier allocation's data; it does not clear
+ memory on free, or cover memory a library pools itself.
+ gwpAsanMode: sampled allocations sit between guard pages on every
+ launch, and a hit ends the process. Older Android versions ignore
+ what they lack. -->
<application
android:label="Skylight Wallet"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"
- android:allowBackup="false">
+ android:allowBackup="true"
+ android:fullBackupContent="@xml/backup_rules"
+ android:dataExtractionRules="@xml/data_extraction_rules"
+ android:memtagMode="sync"
+ android:nativeHeapZeroInitialized="true"
+ android:gwpAsanMode="always">
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
@@ -54,11 +70,19 @@
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
+ <!-- No intent may name a screen: MainActivity forwards payment links
+ to Dart over a channel instead, and Dart opens the Send form
+ only once the user is past every lock. -->
+ <meta-data
+ android:name="flutter_deeplinking_enabled"
+ android:value="false"
+ />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
- <!-- Monero payment links: the send form opens prefilled, past App Lock. -->
+ <!-- Payment links: forwarded to Dart by MainActivity; the Send form
+ opens pre-filled only once the user is past every lock. -->
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
### android/app/src/main/kotlin/com/example/monero_light_wallet/MainActivity.kt
@@ -3,7 +3,9 @@ package org.magicgrants.skylight
import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
+import android.content.Intent
import android.os.Build
+import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.os.PersistableBundle
@@ -20,8 +22,73 @@ class MainActivity : FlutterFragmentActivity() {
// time; see build.gradle.kts.
private val storeReviewChannel = "org.magicgrants.wallet/store_review"
+ // Payment links (monero:) reach Dart over this channel and nowhere else; Dart
+ // holds them until the user is past every lock (wallet_ui's PaymentLinkGate).
+ // Flutter's own deep linking is off (the manifest's flutter_deeplinking_enabled
+ // and the two overrides below), so no intent can name a screen: its data URI
+ // and its "route" extra are both ignored.
+ private val paymentLinksChannel = "org.magicgrants.wallet/payment_links"
+ private val paymentLinkSchemes = setOf("monero")
+ private var paymentLinks: MethodChannel? = null
+ private var pendingPaymentLink: String? = null
+ private var dartTakesPaymentLinks = false
+
+ override fun getInitialRoute(): String? = null
+
+ override fun shouldHandleDeeplinking(): Boolean = false
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ // A recreated activity (rotation, a restored process) still carries the
+ // intent it was opened with; that link was taken already.
+ if (savedInstanceState == null) pendingPaymentLink = paymentLink(intent)
+ super.onCreate(savedInstanceState)
+ // Recents shows no picture of the wallet (Android 13 and later). Not
+ // FLAG_SECURE, which would also stop the user's own screenshots; the
+ // screens that show a secret add that themselves (SecureScreenMixin).
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) setRecentsScreenshotEnabled(false)
+ }
+
+ override fun onNewIntent(intent: Intent) {
+ super.onNewIntent(intent)
+ val link = paymentLink(intent) ?: return
+ val channel = paymentLinks
+ if (dartTakesPaymentLinks && channel != null) {
+ channel.invokeMethod("link", link)
+ } else {
+ pendingPaymentLink = link
+ }
+ }
+
+ // The payment link in a VIEW intent with one of [paymentLinkSchemes], or null.
+ // Not one Android replays when the app is reopened from Recents, and not one
+ // longer than any real payment link. Dart parses and checks it again.
+ private fun paymentLink(intent: Intent?): String? {
+ if (intent == null || intent.action != Intent.ACTION_VIEW) return null
+ if (intent.flags and Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY != 0) return null
+ val uri = intent.data ?: return null
+ val scheme = uri.scheme?.lowercase() ?: return null
+ if (scheme !in paymentLinkSchemes) return null
+ val link = uri.toString()
+ return if (link.length <= MAX_PAYMENT_LINK_LENGTH) link else null
+ }
+
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
+ paymentLinks = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, paymentLinksChannel)
+ .apply {
+ setMethodCallHandler { call, result ->
+ when (call.method) {
+ // Dart is listening: hand over the launch link, if any;
+ // later ones go straight over the channel.
+ "takeInitialLink" -> {
+ dartTakesPaymentLinks = true
+ result.success(pendingPaymentLink)
+ pendingPaymentLink = null
+ }
+ else -> result.notImplemented()
+ }
+ }
+ }
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, secureClipboardChannel)
.setMethodCallHandler { call, result ->
when (call.method) {
@@ -82,4 +149,8 @@ class MainActivity : FlutterFragmentActivity() {
pendingClipClear = clear
clipboardHandler.postDelayed(clear, clearAfterSeconds * 1000L)
}
+
+ companion object {
+ private const val MAX_PAYMENT_LINK_LENGTH = 2048
+ }
}
### android/app/src/main/res/xml/backup_rules.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Android 11 and earlier: the same single folder as data_extraction_rules.xml.
+-->
+<full-backup-content>
+ <include domain="root" path="app_flutter/metadata_backup/" />
+</full-backup-content>
### android/app/src/main/res/xml/data_extraction_rules.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Android 12 and later. Backs up the metadata backup's folder and nothing else:
+ its files are already sealed with a key from the seed. A section left out is
+ fully enabled for all app data, which would carry the encrypted seed store and
+ the wallet files along, so every section names the same single folder.
+ The folder is wallet-core's getAppDir() (path_provider's documents directory,
+ app_flutter) + metadata_backup; see wallet_backup_platform's README.
+-->
+<data-extraction-rules>
+ <cloud-backup>
+ <include domain="root" path="app_flutter/metadata_backup/" />
+ </cloud-backup>
+ <device-transfer>
+ <include domain="root" path="app_flutter/metadata_backup/" />
+ </device-transfer>
+ <cross-platform-transfer platform="ios">
+ <include domain="root" path="app_flutter/metadata_backup/" />
+ </cross-platform-transfer>
+</data-extraction-rules>
### deb/build_deb.sh
@@ -81,7 +81,8 @@ mkdir -p "$PACKAGE_DIR/usr/bin"
mkdir -p "$PACKAGE_DIR/usr/share/icons/hicolor/512x512/apps"
mkdir -p "$PACKAGE_DIR/usr/share/applications"
-# Create control file
+# Create control file. libfido2 is what security keys use on Linux (loaded at
+# run time); without it the app runs as before and keys are unavailable.
echo "Creating control file..."
INSTALLED_SIZE=$(du -sk ../build/linux/x64/release/bundle | cut -f1)
cat > "$PACKAGE_DIR/DEBIAN/control" << EOF
@@ -92,6 +93,7 @@ Priority: optional
Architecture: amd64
Installed-Size: $INSTALLED_SIZE
Maintainer: MAGIC Grants
+Recommends: libfido2-1
Description: A light Monero wallet.
Homepage: https://github.com/MAGICGrants/skylight-wallet
EOF
### ios/Podfile
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
- platform :ios, '15.0'
+platform :ios, '16.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -39,5 +39,27 @@ end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
+ # The memory hardening Enhanced Security turns on, for the C and C++ the
+ # pods compile (wallet_fhse's libsodium and libcbor, BoringSSL, zxing):
+ # zeroed stack variables, the typed allocator that hardened-heap
+ # (Runner.entitlements) builds on, and libc++'s fast bounds checks in
+ # release builds (debug builds already get its debug mode). Not
+ # ENABLE_ENHANCED_SECURITY itself, which would build for arm64e.
+ #
+ # Xcode 27 also refuses iOS deployment targets below 15.0, and several
+ # plugin podspecs still ask for 9.0 to 14.0. Raise them to the app's own
+ # minimum (16.0, above).
+ target.build_configurations.each do |config|
+ current = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
+ if current && Gem::Version.new(current) < Gem::Version.new('16.0')
+ config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
+ end
+ config.build_settings['CLANG_ENABLE_STACK_ZERO_INIT'] = 'YES'
+ config.build_settings['CLANG_ENABLE_C_TYPED_ALLOCATOR_SUPPORT'] = 'YES'
+ config.build_settings['CLANG_ENABLE_CPLUSPLUS_TYPED_ALLOCATOR_SUPPORT'] = 'YES'
+ unless config.name == 'Debug'
+ config.build_settings['CLANG_CXX_STANDARD_LIBRARY_HARDENING'] = 'fast'
+ end
+ end
end
end
### ios/Podfile.lock
@@ -1,13 +1,22 @@
PODS:
+ - camera_avfoundation (0.0.1):
+ - Flutter
+ - file_selector_ios (0.0.1):
+ - Flutter
- Flutter (1.0.0)
+ - flutter_foreground_task (0.0.1):
+ - Flutter
- flutter_local_notifications (0.0.1):
- Flutter
- flutter_secure_storage (6.0.0):
- Flutter
- - local_auth_darwin (0.0.1):
+ - flutter_zxing (0.0.1):
- Flutter
- - FlutterMacOS
- - mobile_scanner (7.0.0):
+ - image_picker_ios (0.0.1):
+ - Flutter
+ - integration_test (0.0.1):
+ - Flutter
+ - local_auth_darwin (0.0.1):
- Flutter
- FlutterMacOS
- package_info_plus (0.4.5):
@@ -19,42 +28,79 @@ PODS:
- Flutter
- screen_brightness_ios (0.1.0):
- Flutter
+ - screen_protector (1.5.1):
+ - Flutter
+ - ScreenProtectorKit (= 1.5.1)
+ - ScreenProtectorKit (1.5.1)
- share_plus (0.0.1):
- Flutter
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- tor_ffi_plugin (0.0.1):
- Flutter
+ - wallet_backup_platform (0.1.0):
+ - Flutter
+ - wallet_fhse (0.1.0):
+ - Flutter
+ - wallet_openalias (0.0.1):
+ - Flutter
+ - webcrypto (0.1.1):
+ - Flutter
+ - FlutterMacOS
- workmanager_apple (0.0.1):
- Flutter
DEPENDENCIES:
+ - camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`)
+ - file_selector_ios (from `.symlinks/plugins/file_selector_ios/ios`)
- Flutter (from `Flutter`)
+ - flutter_foreground_task (from `.symlinks/plugins/flutter_foreground_task/ios`)
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
+ - flutter_zxing (from `.symlinks/plugins/flutter_zxing/ios`)
+ - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
+ - integration_test (from `.symlinks/plugins/integration_test/ios`)
- local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`)
- - mobile_scanner (from `.symlinks/plugins/mobile_scanner/darwin`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- screen_brightness_ios (from `.symlinks/plugins/screen_brightness_ios/ios`)
+ - screen_protector (from `.symlinks/plugins/screen_protector/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- tor_ffi_plugin (from `.symlinks/plugins/tor_ffi_plugin/ios`)
+ - wallet_backup_platform (from `.symlinks/plugins/wallet_backup_platform/ios`)
+ - wallet_fhse (from `.symlinks/plugins/wallet_fhse/ios`)
+ - wallet_openalias (from `.symlinks/plugins/wallet_openalias/ios`)
+ - webcrypto (from `.symlinks/plugins/webcrypto/darwin`)
- workmanager_apple (from `.symlinks/plugins/workmanager_apple/ios`)
+SPEC REPOS:
+ trunk:
+ - ScreenProtectorKit
+
EXTERNAL SOURCES:
+ camera_avfoundation:
+ :path: ".symlinks/plugins/camera_avfoundation/ios"
+ file_selector_ios:
+ :path: ".symlinks/plugins/file_selector_ios/ios"
Flutter:
:path: Flutter
+ flutter_foreground_task:
+ :path: ".symlinks/plugins/flutter_foreground_task/ios"
flutter_local_notifications:
:path: ".symlinks/plugins/flutter_local_notifications/ios"
flutter_secure_storage:
:path: ".symlinks/plugins/flutter_secure_storage/ios"
+ flutter_zxing:
+ :path: ".symlinks/plugins/flutter_zxing/ios"
+ image_picker_ios:
+ :path: ".symlinks/plugins/image_picker_ios/ios"
+ integration_test:
+ :path: ".symlinks/plugins/integration_test/ios"
local_auth_darwin:
:path: ".symlinks/plugins/local_auth_darwin/darwin"
- mobile_scanner:
- :path: ".symlinks/plugins/mobile_scanner/darwin"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
@@ -63,30 +109,51 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/permission_handler_apple/ios"
screen_brightness_ios:
:path: ".symlinks/plugins/screen_brightness_ios/ios"
+ screen_protector:
+ :path: ".symlinks/plugins/screen_protector/ios"
share_plus:
:path: ".symlinks/plugins/share_plus/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
tor_ffi_plugin:
:path: ".symlinks/plugins/tor_ffi_plugin/ios"
+ wallet_backup_platform:
+ :path: ".symlinks/plugins/wallet_backup_platform/ios"
+ wallet_fhse:
+ :path: ".symlinks/plugins/wallet_fhse/ios"
+ wallet_openalias:
+ :path: ".symlinks/plugins/wallet_openalias/ios"
+ webcrypto:
+ :path: ".symlinks/plugins/webcrypto/darwin"
workmanager_apple:
:path: ".symlinks/plugins/workmanager_apple/ios"
SPEC CHECKSUMS:
+ camera_avfoundation: 769d252259fa21e39ada7399c9dc9c0921af8165
+ file_selector_ios: 80c12e90ad3f2045ed6819d03742f1a4c5ec3f93
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
- flutter_local_notifications: a5a732f069baa862e728d839dd2ebb904737effb
- flutter_secure_storage: 1ed9476fba7e7a782b22888f956cce43e2c62f13
- local_auth_darwin: c3ee6cce0a8d56be34c8ccb66ba31f7f180aaebb
- mobile_scanner: 9157936403f5a0644ca3779a38ff8404c5434a93
- package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
- path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
- permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
- screen_brightness_ios: 9953fd7da5bd480f1a93990daeec2eb42d4f3b52
- share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a
- shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
- tor_ffi_plugin: 2a4dd758515e5124dce8323f950f6bb135e611b5
- workmanager_apple: 904529ae31e97fc5be632cf628507652294a0778
+ flutter_foreground_task: 21ef182ab0a29a3005cc72cd70e5f45cb7f7f817
+ flutter_local_notifications: ff50f8405aaa0ccdc7dcfb9022ca192e8ad9688f
+ flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
+ flutter_zxing: 1383f56e9cb3d5fba8d6bb653e4fbed2149f7c75
+ image_picker_ios: 4f2f91b01abdb52842a8e277617df877e40f905b
+ integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573
+ local_auth_darwin: 63c73d6d28cc3e239be2b6aa460ea6e317cd5100
+ package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
+ path_provider_foundation: 0b743cbb62d8e47eab856f09262bb8c1ddcfe6ba
+ permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
+ screen_brightness_ios: 6a6f7794b67f07c4f1e24f6374b2d8ad367ffb39
+ screen_protector: 585e4a9744efa35ec4ba9a6877b22e46b8d48987
+ ScreenProtectorKit: 6ceb3e0808341a9bc15d175bff40dfdd4b32da71
+ share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f
+ shared_preferences_foundation: 5086985c1d43c5ba4d5e69a4e8083a389e2909e6
+ tor_ffi_plugin: d80e291b649379c8176e1be739e49be007d4ef93
+ wallet_backup_platform: 4bfb79de0bf9f9a5e399263dece05e91d2e7e243
+ wallet_fhse: 097ff3864e5d32222f9049f248224fc3edbdbf51
+ wallet_openalias: 2e0f3f89a53cd7c1094400eab675463390059dc6
+ webcrypto: aa788ff6b0a956e5d6e613b35b99c13e220ca2d0
+ workmanager_apple: 7bac258335c310689a641e2d66e88d4845d372e9
-PODFILE CHECKSUM: 3d68f7cb47d5f2fb7765407f663653c9b51100f3
+PODFILE CHECKSUM: c06e3c8e7c4932e16a323b42f1db40d2022e55fc
-COCOAPODS: 1.16.2
+COCOAPODS: 1.17.0
### ios/Runner.xcodeproj/project.pbxproj
@@ -13,6 +13,10 @@
6FF8B85D2F19277F00206EFD /* MoneroWallet.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6FF8B85C2F19277F00206EFD /* MoneroWallet.xcframework */; };
6FF8B85E2F19277F00206EFD /* MoneroWallet.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6FF8B85C2F19277F00206EFD /* MoneroWallet.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
+ FF73651470A3258C9BE6BA6E /* SecurityKeyOperations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 285AB4E3C0ACD6DDA8D3EACD /* SecurityKeyOperations.swift */; };
+ 513EAD7ECFC95D4EACD7524B /* SecurityKeyChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEEB15EF9B8FA7344CFCD11C /* SecurityKeyChannel.swift */; };
+ 6431CB5BDF16DB08076C4F81 /* PrivacyCover.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A84F489497BC2189A49B732 /* PrivacyCover.swift */; };
+ F4266FC460FC211C6FD972E7 /* YubiKit in Frameworks */ = {isa = PBXBuildFile; productRef = 786BC24A685CA9C36E047769 /* YubiKit */; };
79D78220F5B529E1F8AAEC80 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5801F2E4C06C47481468529E /* Pods_Runner.framework */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
@@ -58,6 +62,10 @@
6FF8B85C2F19277F00206EFD /* MoneroWallet.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = MoneroWallet.xcframework; path = Frameworks/MoneroWallet.xcframework; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
+ 285AB4E3C0ACD6DDA8D3EACD /* SecurityKeyOperations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SecurityKeyOperations.swift; path = ".symlinks/plugins/wallet_fhse/apple/SecurityKeyOperations.swift"; sourceTree = SOURCE_ROOT; };
+ CEEB15EF9B8FA7344CFCD11C /* SecurityKeyChannel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SecurityKeyChannel.swift; path = ".symlinks/plugins/wallet_fhse/apple/SecurityKeyChannel.swift"; sourceTree = SOURCE_ROOT; };
+ 7A84F489497BC2189A49B732 /* PrivacyCover.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PrivacyCover.swift; path = ".symlinks/plugins/wallet_fhse/apple/PrivacyCover.swift"; sourceTree = SOURCE_ROOT; };
+ C20E80BCEA94B1C535960DE5 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
@@ -86,6 +94,7 @@
files = (
6FF8B85D2F19277F00206EFD /* MoneroWallet.xcframework in Frameworks */,
79D78220F5B529E1F8AAEC80 /* Pods_Runner.framework in Frameworks */,
+ F4266FC460FC211C6FD972E7 /* YubiKit in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -160,7 +169,11 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
+ CEEB15EF9B8FA7344CFCD11C /* SecurityKeyChannel.swift */,
+ 7A84F489497BC2189A49B732 /* PrivacyCover.swift */,
+ 285AB4E3C0ACD6DDA8D3EACD /* SecurityKeyOperations.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
+ C20E80BCEA94B1C535960DE5 /* Runner.entitlements */,
);
path = Runner;
sourceTree = "<group>";
@@ -220,6 +233,9 @@
dependencies = (
);
name = Runner;
+ packageProductDependencies = (
+ 786BC24A685CA9C36E047769 /* YubiKit */,
+ );
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
@@ -253,6 +269,9 @@
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
+ packageReferences = (
+ 6F53B4424E23BB8F384171A1 /* XCRemoteSwiftPackageReference "yubikit-swift" */,
+ );
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
@@ -427,6 +446,9 @@
buildActionMask = 2147483647;
files = (
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
+ 513EAD7ECFC95D4EACD7524B /* SecurityKeyChannel.swift in Sources */,
+ 6431CB5BDF16DB08076C4F81 /* PrivacyCover.swift in Sources */,
+ FF73651470A3258C9BE6BA6E /* SecurityKeyOperations.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -504,7 +526,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 15.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@@ -518,11 +540,16 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_CPLUSPLUS_TYPED_ALLOCATOR_SUPPORT = YES;
+ CLANG_ENABLE_C_TYPED_ALLOCATOR_SUPPORT = YES;
CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_STACK_ZERO_INIT = YES;
+ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = Y62MZZFR2Y;
ENABLE_BITCODE = NO;
+ ENABLE_SECURITY_COMPILER_WARNINGS = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Frameworks",
@@ -642,7 +669,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 15.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -693,7 +720,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 15.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@@ -709,11 +736,16 @@
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_CPLUSPLUS_TYPED_ALLOCATOR_SUPPORT = YES;
+ CLANG_ENABLE_C_TYPED_ALLOCATOR_SUPPORT = YES;
CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_STACK_ZERO_INIT = YES;
+ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = Y62MZZFR2Y;
ENABLE_BITCODE = NO;
+ ENABLE_SECURITY_COMPILER_WARNINGS = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Frameworks",
@@ -740,11 +772,16 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_CPLUSPLUS_TYPED_ALLOCATOR_SUPPORT = YES;
+ CLANG_ENABLE_C_TYPED_ALLOCATOR_SUPPORT = YES;
CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_STACK_ZERO_INIT = YES;
+ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = Y62MZZFR2Y;
ENABLE_BITCODE = NO;
+ ENABLE_SECURITY_COMPILER_WARNINGS = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Frameworks",
@@ -799,6 +836,25 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
+
+/* Begin XCRemoteSwiftPackageReference section */
+ 6F53B4424E23BB8F384171A1 /* XCRemoteSwiftPackageReference "yubikit-swift" */ = {
+ isa = XCRemoteSwiftPackageReference;
+ repositoryURL = "https://github.com/Yubico/yubikit-swift";
+ requirement = {
+ kind = exactVersion;
+ version = 1.4.0;
+ };
+ };
+/* End XCRemoteSwiftPackageReference section */
+
+/* Begin XCSwiftPackageProductDependency section */
+ 786BC24A685CA9C36E047769 /* YubiKit */ = {
+ isa = XCSwiftPackageProductDependency;
+ package = 6F53B4424E23BB8F384171A1 /* XCRemoteSwiftPackageReference "yubikit-swift" */;
+ productName = YubiKit;
+ };
+/* End XCSwiftPackageProductDependency section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
### ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -0,0 +1,24 @@
+{
+ "originHash" : "27c93eff4dfb0ee36f0f5d536b891dbb7ac5a65ff544f77bdd05550fd667147f",
+ "pins" : [
+ {
+ "identity" : "swift-log",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/apple/swift-log",
+ "state" : {
+ "revision" : "4038b6a4f74a1426f47eb1dd5b4bb5628a15d597",
+ "version" : "1.16.1"
+ }
+ },
+ {
+ "identity" : "yubikit-swift",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/Yubico/yubikit-swift",
+ "state" : {
+ "revision" : "e19212f2efbca9af280e57542e669885de5acdc1",
+ "version" : "1.4.0"
+ }
+ }
+ ],
+ "version" : 3
+}
### ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -0,0 +1,24 @@
+{
+ "originHash" : "27c93eff4dfb0ee36f0f5d536b891dbb7ac5a65ff544f77bdd05550fd667147f",
+ "pins" : [
+ {
+ "identity" : "swift-log",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/apple/swift-log",
+ "state" : {
+ "revision" : "4038b6a4f74a1426f47eb1dd5b4bb5628a15d597",
+ "version" : "1.16.1"
+ }
+ },
+ {
+ "identity" : "yubikit-swift",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/Yubico/yubikit-swift",
+ "state" : {
+ "revision" : "e19212f2efbca9af280e57542e669885de5acdc1",
+ "version" : "1.4.0"
+ }
+ }
+ ],
+ "version" : 3
+}
### ios/Runner/AppDelegate.swift
@@ -8,12 +8,19 @@ import workmanager_apple
private var secureClipboardChannel: FlutterMethodChannel?
private var storeReviewChannel: FlutterMethodChannel?
private var hostPlatformChannel: FlutterMethodChannel?
+ private var securityKeyChannel: SecurityKeyChannel?
+ private var paymentLinks: PaymentLinks?
private var sceneConnectObserver: NSObjectProtocol?
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
+ // The launch screen over the app whenever it is not active: the app
+ // switcher, and the Face ID prompt on the way back (wallet_fhse's
+ // apple/PrivacyCover.swift).
+ PrivacyCover.shared.install()
+
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
}
@@ -126,6 +133,20 @@ import workmanager_apple
}
hostPlatformChannel = channel
}
+
+ let securityKeyRegistrar = engineBridge.pluginRegistry.registrar(forPlugin: "SecurityKey")
+ if let messenger = securityKeyRegistrar?.messenger() {
+ // FIDO2 security keys (YubiKit) for FHSE wallet-file encryption.
+ securityKeyChannel = SecurityKeyChannel(messenger: messenger)
+ }
+
+ if let registrar = engineBridge.pluginRegistry.registrar(forPlugin: "PaymentLinks") {
+ // Payment links (monero:) for the Send form; see PaymentLinks.
+ let links = PaymentLinks(messenger: registrar.messenger(), schemes: ["monero"])
+ registrar.addSceneDelegate(links)
+ registrar.addApplicationDelegate(links)
+ paymentLinks = links
+ }
}
/// Hands the request to StoreKit's own prompt, which decides whether to show
@@ -142,3 +163,77 @@ import workmanager_apple
return true
}
}
+
+/// Payment links reach Dart over this channel and nowhere else; Dart holds them
+/// until the user is past every lock (wallet_ui's PaymentLinkGate).
+/// FlutterDeepLinkingEnabled is NO in Info.plist, so no URL can name a screen.
+///
+/// The link the app is launched with arrives with the scene's connection and
+/// waits until Dart asks for it ("takeInitialLink"); later ones are sent as
+/// they come.
+final class PaymentLinks: NSObject, FlutterPlugin, FlutterSceneLifeCycleDelegate {
+ private static let channelName = "org.magicgrants.wallet/payment_links"
+ /// Longer than any real payment link. Dart parses and checks it again.
+ private static let maxLength = 2048
+
+ private let schemes: Set<String>
+ private let channel: FlutterMethodChannel
+ private var pending: String?
+ private var dartListening = false
+
+ init(messenger: FlutterBinaryMessenger, schemes: Set<String>) {
+ self.schemes = schemes
+ channel = FlutterMethodChannel(name: Self.channelName, binaryMessenger: messenger)
+ super.init()
+ channel.setMethodCallHandler { [weak self] call, result in
+ guard let self, call.method == "takeInitialLink" else {
+ result(FlutterMethodNotImplemented)
+ return
+ }
+ self.dartListening = true
+ result(self.pending)
+ self.pending = nil
+ }
+ }
+
+ /// Registered by AppDelegate, not by the plugin registrant.
+ static func register(with registrar: FlutterPluginRegistrar) {}
+
+ func scene(
+ _ scene: UIScene,
+ willConnectTo session: UISceneSession,
+ options connectionOptions: UIScene.ConnectionOptions?
+ ) -> Bool {
+ guard let context = connectionOptions?.urlContexts.first else { return false }
+ return accept(context.url)
+ }
+
+ func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) -> Bool {
+ var handled = false
+ for context in URLContexts where accept(context.url) {
+ handled = true
+ }
+ return handled
+ }
+
+ func application(
+ _ application: UIApplication,
+ open url: URL,
+ options: [UIApplication.OpenURLOptionsKey: Any] = [:]
+ ) -> Bool {
+ accept(url)
+ }
+
+ /// Takes a link with one of [schemes], or refuses it.
+ private func accept(_ url: URL) -> Bool {
+ guard let scheme = url.scheme?.lowercased(), schemes.contains(scheme) else { return false }
+ let link = url.absoluteString
+ guard link.count <= Self.maxLength else { return false }
+ if dartListening {
+ channel.invokeMethod("link", arguments: link)
+ } else {
+ pending = link
+ }
+ return true
+ }
+}
### ios/Runner/Info.plist
@@ -21,6 +21,11 @@
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <!-- No URL may name a screen: AppDelegate's PaymentLinks forwards payment
+ links to Dart, which opens the Send form only once the user is past
+ every lock. -->
+ <key>FlutterDeepLinkingEnabled</key>
+ <false/>
<key>CFBundleURLTypes</key>
<array>
<dict>
@@ -97,5 +102,28 @@
<string>We need access to your camera to scan QR codes for connection and wallet addresses.</string>
<key>NSFaceIDUsageDescription</key>
<string>We use Face ID to unlock your wallet without typing your password.</string>
+ <key>NFCReaderUsageDescription</key>
+ <string>Skylight uses NFC to talk to your security key.</string>
+ <!-- Smart card applications the NFC reader may select: FIDO2/U2F, and
+ YubiKey Management for the key's serial number (the check that it is
+ the key that was set up, before a PIN is sent). -->
+ <key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
+ <array>
+ <string>A0000006472F0001</string>
+ <string>A000000527471117</string>
+ </array>
+ <!-- Metadata backup: the iCloud container, hidden from the Files app. -->
+ <key>NSUbiquitousContainers</key>
+ <dict>
+ <key>iCloud.org.magicgrants.skylightwallet</key>
+ <dict>
+ <key>NSUbiquitousContainerIsDocumentScopePublic</key>
+ <false/>
+ <key>NSUbiquitousContainerName</key>
+ <string>Skylight</string>
+ <key>NSUbiquitousContainerSupportedFolderLevels</key>
+ <string>None</string>
+ </dict>
+ </dict>
</dict>
</plist>
### ios/Runner/Runner.entitlements
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <!-- Metadata backup: this app's own iCloud container (wallet_backup_platform). -->
+ <key>com.apple.developer.icloud-container-identifiers</key>
+ <array>
+ <string>iCloud.org.magicgrants.skylightwallet</string>
+ </array>
+ <key>com.apple.developer.icloud-services</key>
+ <array>
+ <string>CloudDocuments</string>
+ </array>
+ <key>com.apple.developer.ubiquity-container-identifiers</key>
+ <array>
+ <string>iCloud.org.magicgrants.skylightwallet</string>
+ </array>
+ <key>com.apple.developer.nfc.readersession.formats</key>
+ <array>
+ <string>TAG</string>
+ </array>
+ <key>com.apple.security.smartcard</key>
+ <true/>
+ <!-- Enhanced Security (iOS 26 and later; earlier versions ignore these).
+ All of it except pointer authentication, which needs every binary in
+ the process built for arm64e, and Flutter's engine is arm64 only.
+ Version 2 also turns on guard objects around freed memory.
+ checked-allocations is Memory Integrity Enforcement (hardware memory
+ tagging, A19 and later), enforced rather than in soft mode, and
+ enable-pure-data extends tagging to allocations without pointers,
+ where key material lives. hardened-heap pairs with the typed
+ allocators set in the Runner target and the Podfile. -->
+ <key>com.apple.security.hardened-process</key>
+ <true/>
+ <key>com.apple.security.hardened-process.enhanced-security-version-string</key>
+ <string>2</string>
+ <key>com.apple.security.hardened-process.platform-restrictions-string</key>
+ <string>2</string>
+ <key>com.apple.security.hardened-process.dyld-ro</key>
+ <true/>
+ <key>com.apple.security.hardened-process.hardened-heap</key>
+ <true/>
+ <key>com.apple.security.hardened-process.checked-allocations</key>
+ <true/>
+ <key>com.apple.security.hardened-process.checked-allocations.enable-pure-data</key>
+ <true/>
+</dict>
+</plist>
### lib/l10n/app_en.arb
@@ -29,6 +29,7 @@
"welcomeTermsLink": "Terms of Service",
"welcomeAgreeMiddle": " and ",
"welcomePrivacyLink": "Privacy Policy",
+ "settingsLicensesLabel": "Open-Source Licenses",
"lwsSetupTitle": "Connection Setup",
"lwsSetupDescription": "Connect to a Monero light-wallet server (LWS) or your own full node. Only select a server you trust. Even if you use Tor, this server can learn information about you. With an LWS, your private view key and primary address will be shared with this server.",
"lwsSetupProxyPortLabel": "HTTP Proxy Port (Optional)",
@@ -63,14 +64,15 @@
"settingsConnectionOverClearnet": "over Clearnet",
"settingsConnectionInLocalNetwork": "in Local Network",
"settingsBackgroundSyncLabel": "Background Sync",
- "settingsBackgroundSyncDescription": "Periodically sync Monero in the background so it's up to date when you open the app. Only runs while charging and on WiFi.",
+ "settingsBackgroundSyncDescription": "Periodically sync Monero in the background so it's up to date when you open the app. Uses your view key only: it sees incoming payments but can never spend. Only runs while charging and on WiFi.",
"settingsForegroundSyncLabel": "Continuous Sync",
- "settingsForegroundSyncDescription": "Keep Monero syncing continuously while the app runs in the background, with a persistent notification. Uses more battery.",
- "homeBlocksRemaining": "{count} blocks left",
+ "settingsForegroundSyncDescription": "Keep Monero syncing continuously while the app runs in the background, with a persistent notification. Uses your view key only: it sees incoming payments once confirmed but can never spend. Uses more battery.",
+ "homeBlocksRemaining": "{count, plural, =1{1 block left} other{{count} blocks left}}",
"@homeBlocksRemaining": {
"placeholders": {
"count": {
- "type": "String"
+ "type": "int",
+ "format": "decimalPattern"
}
}
},
@@ -83,6 +85,11 @@
"fiatModeTorOnlyDesc": "Prices fetched over Tor · recommended",
"fiatModeClearnetDesc": "Not private, the price server sees your IP address",
"fiatModeDisabledDesc": "No prices fetched, balances shown in crypto only",
+ "settingsOpenAliasSettingsLabel": "OpenAlias Settings",
+ "openAliasSettingsSheetSubtitle": "How names like name@example.com are looked up when you send.",
+ "openAliasModeTorOnlyDesc": "Names looked up over Tor · recommended",
+ "openAliasModeClearnetDesc": "Not private, DNS servers see your IP address and the name",
+ "openAliasModeDisabledDesc": "No lookups, send to addresses only",
"fiatApiSettingsDisplayCurrencyLabel": "Display Currency",
"createWalletTitle": "Wallet Setup",
"createWalletDescription": "Would you like to create a new wallet or restore an existing wallet?",
@@ -105,25 +112,25 @@
"generateSeedConfirm": "I have written down all the words and stored them somewhere only I can reach.",
"generateSeedBirthdayLabel": "Wallet birthday",
"generateSeedBirthdayReason": "Where a future restore starts scanning",
- "onboardingTorNotePrivacy": "Tor hides your address from the node you query — slower, and worth it.",
- "onboardingTorNoteChangeable": "Changeable later under Settings → Connections.",
- "onboardingPriceNoteRatesOnly": "The price service is asked for rates only — never for addresses or amounts.",
- "onboardingPriceNoteTor": "Routed over Tor by default, separately from chain traffic.",
- "onboardingConnectionNoteServer": "Point Skylight at a light-wallet server (LWS), or connect to your own Monero node.",
- "onboardingConnectionNoteChangeable": "Changeable later under Settings → Connection.",
- "onboardingWalletNoteGenerated": "A new wallet’s seed is generated here, offline, and shown to you once.",
- "onboardingWalletNoteRestore": "Restoring asks roughly when the seed first held funds, to skip years of scanning.",
- "onboardingWalletCreateBullet1": "A Monero seed phrase, shown once",
- "onboardingWalletCreateBullet2": "Starts empty, syncs from today",
+ "onboardingTorNotePrivacy": "Connections over Tor can be slower.",
+ "onboardingTorNoteChangeable": "You can change this later in Settings.",
+ "onboardingPriceNoteRatesOnly": "Only prices are requested. Your addresses and balances are not sent.",
+ "onboardingPriceNoteTor": "Prices are fetched over Tor by default.",
+ "onboardingConnectionNoteServer": "Use a light-wallet server (LWS) or your own Monero node.",
+ "onboardingConnectionNoteChangeable": "You can change this later in Settings.",
+ "onboardingWalletNoteGenerated": "Skylight Wallet generates your seed on this device.",
+ "onboardingWalletNoteRestore": "When restoring, a scan-from date makes syncing faster.",
+ "onboardingWalletCreateBullet1": "A new polyseed",
+ "onboardingWalletCreateBullet2": "Syncs from today",
"onboardingWalletCreateBullet3": "Takes about two minutes",
"onboardingWalletRestoreBullet1": "A Polyseed, BIP39 or legacy Monero seed",
"onboardingWalletRestoreBullet2": "Optional scan-from date",
"onboardingWalletRestoreBullet3": "Recovers your existing balance and history",
- "onboardingSeedNotePassword": "Skylight Wallet asks for your password before ever showing them again.",
- "onboardingPasswordNoteLaunch": "Asked for at every launch, and before the seed is ever shown.",
- "onboardingPasswordNoteNotCloud": "Not a cloud account. Losing it means restoring from your seed phrase.",
+ "onboardingSeedNotePassword": "Skylight Wallet asks for your password before showing these words again.",
+ "onboardingPasswordNoteLaunch": "You need this password to open your wallet and to view your seed.",
+ "onboardingPasswordNoteNotCloud": "This password can't be recovered. If you lose it, restore your wallet from your seed phrase.",
"onboardingPasswordStrong": "Strong",
- "onboardingPasswordMatch": "Both entries match",
+ "onboardingPasswordMatch": "Passwords match",
"lwsDetailsTitle": "Wallet Details",
"lwsDetailsDescription": "If your Monero light wallet server (LWS) requires registration, you can use these details to add this wallet to that server. Not all servers require registration.",
"lwsDetailsPrimaryAddressLabel": "Primary Address",
@@ -166,6 +173,23 @@
},
"restoreWalletChecksumError": "This isn't a valid seed phrase — check the words and their order.",
"navigationBarWallet": "Wallet",
+ "historyTitle": "History",
+ "historyExportCsv": "Export CSV",
+ "historyExported": "History exported",
+ "historyExportFailed": "Could not export the history",
+ "navigationBarHistory": "History",
+ "historyFilterType": "Type",
+ "@historyFilterType": {
+ "description": "History filter: received or sent."
+ },
+ "historyFilterAddress": "Address",
+ "@historyFilterAddress": {
+ "description": "History filter: transactions received at, or sent to, one address."
+ },
+ "historyFilterAddressAny": "Any address",
+ "historyFilterAddressHint": "Transactions received at this address, or sent to it.",
+ "historyFilterAddressInvalid": "Not a Monero address",
+ "historyFilterReset": "Reset",
"navigationBarSettings": "Settings",
"unlockButton": "Unlock",
"unlockReason": "Unlock Wallet",
@@ -215,23 +239,25 @@
"sendSendButton": "Send",
"sendTransactionSuccessfullySent": "Transaction successfully sent!",
"sendOpenAliasResolveError": "Invalid OpenAlias.",
+ "sendOpenAliasDisabledError": "OpenAlias is turned off. Turn it on in Settings.",
"sendInvalidAddressError": "Invalid address.",
"sendInsufficientBalanceError": "Insufficient balance.",
"sendInsufficientBalanceToCoverFeeError": "Insufficient balance to cover the network fee.",
"settingsTitle": "Settings",
"settingsSectionGeneral": "General",
- "settingsSectionBehaviour": "Behaviour",
+ "settingsSectionSecurityPrivacy": "Security and privacy",
+ "settingsSectionData": "Data",
+ "settingsSectionBehaviour": "Behavior",
"settingsSectionWallet": "Wallet",
"settingsSectionAbout": "About",
"settingsNotifyNewTxsLabel": "Transaction Notifications",
"settingsNotifyNewTxsDescription": "Show a notification when you receive a transaction. When connected to a Monero node, Background Sync must also be enabled.",
"settingsNotifyNewTxsDescriptionIos": "Notifications will be delayed for Tor LWS connections.",
- "settingsAppLockLabel": "App Lock",
"settingsAppLockUnlockReason": "Unlock Wallet",
"settingsAppLockUnableToAuthError": "Unable to authenticate. Make sure you have device unlock set up.",
- "settingsVerboseLoggingLabel": "Diagnostic Logs",
- "settingsVerboseLoggingDescription": "Log wallet operations to a text file in the app's data folder for debugging purposes.",
- "settingsVerboseLoggingDescriptionIos": "Log wallet operations and allow the logs to be exported to a text file.",
+ "settingsLoggingLabel": "Diagnostic Logs",
+ "settingsLoggingDescription": "Log wallet operations to a text file in the app's data folder for debugging purposes.",
+ "settingsLoggingDescriptionIos": "Log wallet operations and allow the logs to be exported to a text file.",
"settingsExportLogsLabel": "Export Logs",
"settingsExportLogsButton": "Export",
"settingsExportLogsError": "No logs found to export.",
@@ -331,7 +357,7 @@
"sendPriorityHeading": "Priority",
"sendPickContactTitle": "Send to a contact",
"sendAvailableSuffix": "available",
- "sendIrreversibleNote": "Monero transactions are irreversible. Double-check the address and amount before sending.",
+ "sendIrreversibleNote": "Transactions are irreversible, so make sure the address and amount are correct.",
"sendSwitchUnit": "Switch amount unit",
"sendFailedToGetFeesError": "Failed to get fees.",
"sendNoConnectionError": "Couldn't reach the server. Check your connection and try again.",
@@ -356,5 +382,37 @@
"torDisabledWalletsWarningConfirm": "Disable Tor",
"settingsTorSettingsLabel": "Tor Settings",
"lwsSetupTorDisabledError": "Tor is disabled. Please go back and enable it.",
- "lwsSetupInvalidQrCode": "Invalid connection address."
+ "lwsSetupInvalidQrCode": "Invalid connection address.",
+ "coinHomeSwap": "Swap",
+ "coinHomeSwapComingSoon": "Coming soon!",
+ "verifySeedTitle": "Verify Seed Phrase",
+ "homeIncomingTitle": "Incoming",
+ "homeIncomingUnlocksIn": "Unlocks in about {minutes, plural, =1{1 minute} other{{minutes} minutes}} · {done} of {needed}",
+ "@homeIncomingUnlocksIn": {"placeholders": {"minutes": {"type": "int"}, "done": {"type": "int"}, "needed": {"type": "int"}}},
+ "homeIncomingConfirmations": "{done} of {needed} confirmations",
+ "@homeIncomingConfirmations": {"placeholders": {"done": {"type": "int"}, "needed": {"type": "int"}}},
+ "homeChartTitle": "Balance · 90 days",
+ "homeChartToday": "Today",
+ "homeChartEachCoin": "Each coin's balance",
+ "homeChartNew": "New",
+ "homeChartEmpty": "Your balance over time shows here after your first transaction.",
+ "homeChecklistTitle": "Secure your wallet",
+ "homeChecklistProgress": "{done} of {total}",
+ "@homeChecklistProgress": {"placeholders": {"done": {"type": "int"}, "total": {"type": "int"}}},
+ "homeChecklistVerifySeed": "Verify your seed phrase",
+ "homeChecklistAutoBackup": "Turn on automatic backups",
+ "homeChecklistTor": "Connect through Tor",
+ "homeChecklistPrivateLookups": "Use Tor for price and OpenAlias lookups",
+ "homeChecklistSecurityKeys": "Set up a security key",
+ "verifySeedSubtitle": "Input words {first}, {second} and {third} of your seed phrase below.",
+ "@verifySeedSubtitle": {"placeholders": {"first": {"type": "int"}, "second": {"type": "int"}, "third": {"type": "int"}}},
+ "verifySeedButton": "Verify",
+ "verifySeedWrongTitle": "Those words don't match",
+ "verifySeedWrongBody": "Check the seed phrase you wrote down, then enter the three new words asked for. {count, plural, =1{1 try} other{{count} tries}} left before the app locks.",
+ "@verifySeedWrongBody": {"placeholders": {"count": {"type": "int"}}},
+ "verifySeedTryAgain": "Try again",
+ "verifySeedUnavailable": "Your seed phrase can't be read right now. Try again after unlocking the wallet.",
+ "verifySeedDone": "Seed phrase verified",
+ "homeIncomingTitleMore": "Incoming (+{count, plural, =1{1 Other} other{{count} Others}})",
+ "@homeIncomingTitleMore": {"placeholders": {"count": {"type": "int"}}}
}
### lib/l10n/app_localizations.dart
@@ -225,6 +225,12 @@ abstract class AppLocalizations {
/// **'Privacy Policy'**
String get welcomePrivacyLink;
+ /// No description provided for @settingsLicensesLabel.
+ ///
+ /// In en, this message translates to:
+ /// **'Open-Source Licenses'**
+ String get settingsLicensesLabel;
+
/// No description provided for @lwsSetupTitle.
///
/// In en, this message translates to:
@@ -432,7 +438,7 @@ abstract class AppLocalizations {
/// No description provided for @settingsBackgroundSyncDescription.
///
/// In en, this message translates to:
- /// **'Periodically sync Monero in the background so it\'s up to date when you open the app. Only runs while charging and on WiFi.'**
+ /// **'Periodically sync Monero in the background so it\'s up to date when you open the app. Uses your view key only: it sees incoming payments but can never spend. Only runs while charging and on WiFi.'**
String get settingsBackgroundSyncDescription;
/// No description provided for @settingsForegroundSyncLabel.
@@ -444,14 +450,14 @@ abstract class AppLocalizations {
/// No description provided for @settingsForegroundSyncDescription.
///
/// In en, this message translates to:
- /// **'Keep Monero syncing continuously while the app runs in the background, with a persistent notification. Uses more battery.'**
+ /// **'Keep Monero syncing continuously while the app runs in the background, with a persistent notification. Uses your view key only: it sees incoming payments once confirmed but can never spend. Uses more battery.'**
String get settingsForegroundSyncDescription;
/// No description provided for @homeBlocksRemaining.
///
/// In en, this message translates to:
- /// **'{count} blocks left'**
- String homeBlocksRemaining(String count);
+ /// **'{count, plural, =1{1 block left} other{{count} blocks left}}'**
+ String homeBlocksRemaining(int count);
/// No description provided for @fiatApiSetupTitle.
///
@@ -507,6 +513,36 @@ abstract class AppLocalizations {
/// **'No prices fetched, balances shown in crypto only'**
String get fiatModeDisabledDesc;
+ /// No description provided for @settingsOpenAliasSettingsLabel.
+ ///
+ /// In en, this message translates to:
+ /// **'OpenAlias Settings'**
+ String get settingsOpenAliasSettingsLabel;
+
+ /// No description provided for @openAliasSettingsSheetSubtitle.
+ ///
+ /// In en, this message translates to:
+ /// **'How names like name@example.com are looked up when you send.'**
+ String get openAliasSettingsSheetSubtitle;
+
+ /// No description provided for @openAliasModeTorOnlyDesc.
+ ///
+ /// In en, this message translates to:
+ /// **'Names looked up over Tor · recommended'**
+ String get openAliasModeTorOnlyDesc;
+
+ /// No description provided for @openAliasModeClearnetDesc.
+ ///
+ /// In en, this message translates to:
+ /// **'Not private, DNS servers see your IP address and the name'**
+ String get openAliasModeClearnetDesc;
+
+ /// No description provided for @openAliasModeDisabledDesc.
+ ///
+ /// In en, this message translates to:
+ /// **'No lookups, send to addresses only'**
+ String get openAliasModeDisabledDesc;
+
/// No description provided for @fiatApiSettingsDisplayCurrencyLabel.
///
/// In en, this message translates to:
@@ -642,61 +678,61 @@ abstract class AppLocalizations {
/// No description provided for @onboardingTorNotePrivacy.
///
/// In en, this message translates to:
- /// **'Tor hides your address from the node you query — slower, and worth it.'**
+ /// **'Connections over Tor can be slower.'**
String get onboardingTorNotePrivacy;
/// No description provided for @onboardingTorNoteChangeable.
///
/// In en, this message translates to:
- /// **'Changeable later under Settings → Connections.'**
+ /// **'You can change this later in Settings.'**
String get onboardingTorNoteChangeable;
/// No description provided for @onboardingPriceNoteRatesOnly.
///
/// In en, this message translates to:
- /// **'The price service is asked for rates only — never for addresses or amounts.'**
+ /// **'Only prices are requested. Your addresses and balances are not sent.'**
String get onboardingPriceNoteRatesOnly;
/// No description provided for @onboardingPriceNoteTor.
///
/// In en, this message translates to:
- /// **'Routed over Tor by default, separately from chain traffic.'**
+ /// **'Prices are fetched over Tor by default.'**
String get onboardingPriceNoteTor;
/// No description provided for @onboardingConnectionNoteServer.
///
/// In en, this message translates to:
- /// **'Point Skylight at a light-wallet server (LWS), or connect to your own Monero node.'**
+ /// **'Use a light-wallet server (LWS) or your own Monero node.'**
String get onboardingConnectionNoteServer;
/// No description provided for @onboardingConnectionNoteChangeable.
///
/// In en, this message translates to:
- /// **'Changeable later under Settings → Connection.'**
+ /// **'You can change this later in Settings.'**
String get onboardingConnectionNoteChangeable;
/// No description provided for @onboardingWalletNoteGenerated.
///
/// In en, this message translates to:
- /// **'A new wallet’s seed is generated here, offline, and shown to you once.'**
+ /// **'Skylight Wallet generates your seed on this device.'**
String get onboardingWalletNoteGenerated;
/// No description provided for @onboardingWalletNoteRestore.
///
/// In en, this message translates to:
- /// **'Restoring asks roughly when the seed first held funds, to skip years of scanning.'**
+ /// **'When restoring, a scan-from date makes syncing faster.'**
String get onboardingWalletNoteRestore;
/// No description provided for @onboardingWalletCreateBullet1.
///
/// In en, this message translates to:
- /// **'A Monero seed phrase, shown once'**
+ /// **'A new polyseed'**
String get onboardingWalletCreateBullet1;
/// No description provided for @onboardingWalletCreateBullet2.
///
/// In en, this message translates to:
- /// **'Starts empty, syncs from today'**
+ /// **'Syncs from today'**
String get onboardingWalletCreateBullet2;
/// No description provided for @onboardingWalletCreateBullet3.
@@ -726,19 +762,19 @@ abstract class AppLocalizations {
/// No description provided for @onboardingSeedNotePassword.
///
/// In en, this message translates to:
- /// **'Skylight Wallet asks for your password before ever showing them again.'**
+ /// **'Skylight Wallet asks for your password before showing these words again.'**
String get onboardingSeedNotePassword;
/// No description provided for @onboardingPasswordNoteLaunch.
///
/// In en, this message translates to:
- /// **'Asked for at every launch, and before the seed is ever shown.'**
+ /// **'You need this password to open your wallet and to view your seed.'**
String get onboardingPasswordNoteLaunch;
/// No description provided for @onboardingPasswordNoteNotCloud.
///
/// In en, this message translates to:
- /// **'Not a cloud account. Losing it means restoring from your seed phrase.'**
+ /// **'This password can\'t be recovered. If you lose it, restore your wallet from your seed phrase.'**
String get onboardingPasswordNoteNotCloud;
/// No description provided for @onboardingPasswordStrong.
@@ -750,7 +786,7 @@ abstract class AppLocalizations {
/// No description provided for @onboardingPasswordMatch.
///
/// In en, this message translates to:
- /// **'Both entries match'**
+ /// **'Passwords match'**
String get onboardingPasswordMatch;
/// No description provided for @lwsDetailsTitle.
@@ -921,6 +957,72 @@ abstract class AppLocalizations {
/// **'Wallet'**
String get navigationBarWallet;
+ /// No description provided for @historyTitle.
+ ///
+ /// In en, this message translates to:
+ /// **'History'**
+ String get historyTitle;
+
+ /// No description provided for @historyExportCsv.
+ ///
+ /// In en, this message translates to:
+ /// **'Export CSV'**
+ String get historyExportCsv;
+
+ /// No description provided for @historyExported.
+ ///
+ /// In en, this message translates to:
+ /// **'History exported'**
+ String get historyExported;
+
+ /// No description provided for @historyExportFailed.
+ ///
+ /// In en, this message translates to:
+ /// **'Could not export the history'**
+ String get historyExportFailed;
+
+ /// No description provided for @navigationBarHistory.
+ ///
+ /// In en, this message translates to:
+ /// **'History'**
+ String get navigationBarHistory;
+
+ /// History filter: received or sent.
+ ///
+ /// In en, this message translates to:
+ /// **'Type'**
+ String get historyFilterType;
+
+ /// History filter: transactions received at, or sent to, one address.
+ ///
+ /// In en, this message translates to:
+ /// **'Address'**
+ String get historyFilterAddress;
+
+ /// No description provided for @historyFilterAddressAny.
+ ///
+ /// In en, this message translates to:
+ /// **'Any address'**
+ String get historyFilterAddressAny;
+
+ /// No description provided for @historyFilterAddressHint.
+ ///
+ /// In en, this message translates to:
+ /// **'Transactions received at this address, or sent to it.'**
+ String get historyFilterAddressHint;
+
+ /// No description provided for @historyFilterAddressInvalid.
+ ///
+ /// In en, this message translates to:
+ /// **'Not a Monero address'**
+ String get historyFilterAddressInvalid;
+
+ /// No description provided for @historyFilterReset.
+ ///
+ /// In en, this message translates to:
+ /// **'Reset'**
+ String get historyFilterReset;
+
/// No description provided for @navigationBarSettings.
///
/// In en, this message translates to:
@@ -1173,6 +1275,12 @@ abstract class AppLocalizations {
/// **'Invalid OpenAlias.'**
String get sendOpenAliasResolveError;
+ /// No description provided for @sendOpenAliasDisabledError.
+ ///
+ /// In en, this message translates to:
+ /// **'OpenAlias is turned off. Turn it on in Settings.'**
+ String get sendOpenAliasDisabledError;
+
/// No description provided for @sendInvalidAddressError.
///
/// In en, this message translates to:
@@ -1203,10 +1311,22 @@ abstract class AppLocalizations {
/// **'General'**
String get settingsSectionGeneral;
+ /// No description provided for @settingsSectionSecurityPrivacy.
+ ///
+ /// In en, this message translates to:
+ /// **'Security and privacy'**
+ String get settingsSectionSecurityPrivacy;
+
+ /// No description provided for @settingsSectionData.
+ ///
+ /// In en, this message translates to:
+ /// **'Data'**
+ String get settingsSectionData;
+
/// No description provided for @settingsSectionBehaviour.
///
/// In en, this message translates to:
- /// **'Behaviour'**
+ /// **'Behavior'**
String get settingsSectionBehaviour;
/// No description provided for @settingsSectionWallet.
@@ -1239,12 +1359,6 @@ abstract class AppLocalizations {
/// **'Notifications will be delayed for Tor LWS connections.'**
String get settingsNotifyNewTxsDescriptionIos;
- /// No description provided for @settingsAppLockLabel.
- ///
- /// In en, this message translates to:
- /// **'App Lock'**
- String get settingsAppLockLabel;
-
/// No description provided for @settingsAppLockUnlockReason.
///
/// In en, this message translates to:
@@ -1257,23 +1371,23 @@ abstract class AppLocalizations {
/// **'Unable to authenticate. Make sure you have device unlock set up.'**
String get settingsAppLockUnableToAuthError;
- /// No description provided for @settingsVerboseLoggingLabel.
+ /// No description provided for @settingsLoggingLabel.
///
/// In en, this message translates to:
/// **'Diagnostic Logs'**
- String get settingsVerboseLoggingLabel;
+ String get settingsLoggingLabel;
- /// No description provided for @settingsVerboseLoggingDescription.
+ /// No description provided for @settingsLoggingDescription.
///
/// In en, this message translates to:
/// **'Log wallet operations to a text file in the app\'s data folder for debugging purposes.'**
- String get settingsVerboseLoggingDescription;
+ String get settingsLoggingDescription;
- /// No description provided for @settingsVerboseLoggingDescriptionIos.
+ /// No description provided for @settingsLoggingDescriptionIos.
///
/// In en, this message translates to:
/// **'Log wallet operations and allow the logs to be exported to a text file.'**
- String get settingsVerboseLoggingDescriptionIos;
+ String get settingsLoggingDescriptionIos;
/// No description provided for @settingsExportLogsLabel.
///
@@ -1788,7 +1902,7 @@ abstract class AppLocalizations {
/// No description provided for @sendIrreversibleNote.
///
/// In en, this message translates to:
- /// **'Monero transactions are irreversible. Double-check the address and amount before sending.'**
+ /// **'Transactions are irreversible, so make sure the address and amount are correct.'**
String get sendIrreversibleNote;
/// No description provided for @sendSwitchUnit.
@@ -1940,6 +2054,162 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'Invalid connection address.'**
String get lwsSetupInvalidQrCode;
+
+ /// No description provided for @coinHomeSwap.
+ ///
+ /// In en, this message translates to:
+ /// **'Swap'**
+ String get coinHomeSwap;
+
+ /// No description provided for @coinHomeSwapComingSoon.
+ ///
+ /// In en, this message translates to:
+ /// **'Coming soon!'**
+ String get coinHomeSwapComingSoon;
+
+ /// No description provided for @verifySeedTitle.
+ ///
+ /// In en, this message translates to:
+ /// **'Verify Seed Phrase'**
+ String get verifySeedTitle;
+
+ /// No description provided for @homeIncomingTitle.
+ ///
+ /// In en, this message translates to:
+ /// **'Incoming'**
+ String get homeIncomingTitle;
+
+ /// No description provided for @homeIncomingUnlocksIn.
+ ///
+ /// In en, this message translates to:
+ /// **'Unlocks in about {minutes, plural, =1{1 minute} other{{minutes} minutes}} · {done} of {needed}'**
+ String homeIncomingUnlocksIn(int minutes, int done, int needed);
+
+ /// No description provided for @homeIncomingConfirmations.
+ ///
+ /// In en, this message translates to:
+ /// **'{done} of {needed} confirmations'**
+ String homeIncomingConfirmations(int done, int needed);
+
+ /// No description provided for @homeChartTitle.
+ ///
+ /// In en, this message translates to:
+ /// **'Balance · 90 days'**
+ String get homeChartTitle;
+
+ /// No description provided for @homeChartToday.
+ ///
+ /// In en, this message translates to:
+ /// **'Today'**
+ String get homeChartToday;
+
+ /// No description provided for @homeChartEachCoin.
+ ///
+ /// In en, this message translates to:
+ /// **'Each coin\'s balance'**
+ String get homeChartEachCoin;
+
+ /// No description provided for @homeChartNew.
+ ///
+ /// In en, this message translates to:
+ /// **'New'**
+ String get homeChartNew;
+
+ /// No description provided for @homeChartEmpty.
+ ///
+ /// In en, this message translates to:
+ /// **'Your balance over time shows here after your first transaction.'**
+ String get homeChartEmpty;
+
+ /// No description provided for @homeChecklistTitle.
+ ///
+ /// In en, this message translates to:
+ /// **'Secure your wallet'**
+ String get homeChecklistTitle;
+
+ /// No description provided for @homeChecklistProgress.
+ ///
+ /// In en, this message translates to:
+ /// **'{done} of {total}'**
+ String homeChecklistProgress(int done, int total);
+
+ /// No description provided for @homeChecklistVerifySeed.
+ ///
+ /// In en, this message translates to:
+ /// **'Verify your seed phrase'**
+ String get homeChecklistVerifySeed;
+
+ /// No description provided for @homeChecklistAutoBackup.
+ ///
+ /// In en, this message translates to:
+ /// **'Turn on automatic backups'**
+ String get homeChecklistAutoBackup;
+
+ /// No description provided for @homeChecklistTor.
+ ///
+ /// In en, this message translates to:
+ /// **'Connect through Tor'**
+ String get homeChecklistTor;
+
+ /// No description provided for @homeChecklistPrivateLookups.
+ ///
+ /// In en, this message translates to:
+ /// **'Use Tor for price and OpenAlias lookups'**
+ String get homeChecklistPrivateLookups;
+
+ /// No description provided for @homeChecklistSecurityKeys.
+ ///
+ /// In en, this message translates to:
+ /// **'Set up a security key'**
+ String get homeChecklistSecurityKeys;
+
+ /// No description provided for @verifySeedSubtitle.
+ ///
+ /// In en, this message translates to:
+ /// **'Input words {first}, {second} and {third} of your seed phrase below.'**
+ String verifySeedSubtitle(int first, int second, int third);
+
+ /// No description provided for @verifySeedButton.
+ ///
+ /// In en, this message translates to:
+ /// **'Verify'**
+ String get verifySeedButton;
+
+ /// No description provided for @verifySeedWrongTitle.
+ ///
+ /// In en, this message translates to:
+ /// **'Those words don\'t match'**
+ String get verifySeedWrongTitle;
+
+ /// No description provided for @verifySeedWrongBody.
+ ///
+ /// In en, this message translates to:
+ /// **'Check the seed phrase you wrote down, then enter the three new words asked for. {count, plural, =1{1 try} other{{count} tries}} left before the app locks.'**
+ String verifySeedWrongBody(int count);
+
+ /// No description provided for @verifySeedTryAgain.
+ ///
+ /// In en, this message translates to:
+ /// **'Try again'**
+ String get verifySeedTryAgain;
+
+ /// No description provided for @verifySeedUnavailable.
+ ///
+ /// In en, this message translates to:
+ /// **'Your seed phrase can\'t be read right now. Try again after unlocking the wallet.'**
+ String get verifySeedUnavailable;
+
+ /// No description provided for @verifySeedDone.
+ ///
+ /// In en, this message translates to:
+ /// **'Seed phrase verified'**
+ String get verifySeedDone;
+
+ /// No description provided for @homeIncomingTitleMore.
+ ///
+ /// In en, this message translates to:
+ /// **'Incoming (+{count, plural, =1{1 Other} other{{count} Others}})'**
+ String homeIncomingTitleMore(int count);
}
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
### lib/l10n/app_localizations_en.dart
@@ -77,6 +77,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get welcomePrivacyLink => 'Privacy Policy';
+ @override
+ String get settingsLicensesLabel => 'Open-Source Licenses';
+
@override
String get lwsSetupTitle => 'Connection Setup';
@@ -187,18 +190,27 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get settingsBackgroundSyncDescription =>
- 'Periodically sync Monero in the background so it\'s up to date when you open the app. Only runs while charging and on WiFi.';
+ 'Periodically sync Monero in the background so it\'s up to date when you open the app. Uses your view key only: it sees incoming payments but can never spend. Only runs while charging and on WiFi.';
@override
String get settingsForegroundSyncLabel => 'Continuous Sync';
@override
String get settingsForegroundSyncDescription =>
- 'Keep Monero syncing continuously while the app runs in the background, with a persistent notification. Uses more battery.';
+ 'Keep Monero syncing continuously while the app runs in the background, with a persistent notification. Uses your view key only: it sees incoming payments once confirmed but can never spend. Uses more battery.';
@override
- String homeBlocksRemaining(String count) {
- return '$count blocks left';
+ String homeBlocksRemaining(int count) {
+ final intl.NumberFormat countNumberFormat = intl.NumberFormat.decimalPattern(localeName);
+ final String countString = countNumberFormat.format(count);
+
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$countString blocks left',
+ one: '1 block left',
+ );
+ return '$_temp0';
}
@override
@@ -229,6 +241,23 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get fiatModeDisabledDesc => 'No prices fetched, balances shown in crypto only';
+ @override
+ String get settingsOpenAliasSettingsLabel => 'OpenAlias Settings';
+
+ @override
+ String get openAliasSettingsSheetSubtitle =>
+ 'How names like name@example.com are looked up when you send.';
+
+ @override
+ String get openAliasModeTorOnlyDesc => 'Names looked up over Tor · recommended';
+
+ @override
+ String get openAliasModeClearnetDesc =>
+ 'Not private, DNS servers see your IP address and the name';
+
+ @override
+ String get openAliasModeDisabledDesc => 'No lookups, send to addresses only';
+
@override
String get fiatApiSettingsDisplayCurrencyLabel => 'Display Currency';
@@ -301,39 +330,37 @@ class AppLocalizationsEn extends AppLocalizations {
String get generateSeedBirthdayReason => 'Where a future restore starts scanning';
@override
- String get onboardingTorNotePrivacy =>
- 'Tor hides your address from the node you query — slower, and worth it.';
+ String get onboardingTorNotePrivacy => 'Connections over Tor can be slower.';
@override
- String get onboardingTorNoteChangeable => 'Changeable later under Settings → Connections.';
+ String get onboardingTorNoteChangeable => 'You can change this later in Settings.';
@override
String get onboardingPriceNoteRatesOnly =>
- 'The price service is asked for rates only — never for addresses or amounts.';
+ 'Only prices are requested. Your addresses and balances are not sent.';
@override
- String get onboardingPriceNoteTor => 'Routed over Tor by default, separately from chain traffic.';
+ String get onboardingPriceNoteTor => 'Prices are fetched over Tor by default.';
@override
String get onboardingConnectionNoteServer =>
- 'Point Skylight at a light-wallet server (LWS), or connect to your own Monero node.';
+ 'Use a light-wallet server (LWS) or your own Monero node.';
@override
- String get onboardingConnectionNoteChangeable => 'Changeable later under Settings → Connection.';
+ String get onboardingConnectionNoteChangeable => 'You can change this later in Settings.';
@override
- String get onboardingWalletNoteGenerated =>
- 'A new wallet’s seed is generated here, offline, and shown to you once.';
+ String get onboardingWalletNoteGenerated => 'Skylight Wallet generates your seed on this device.';
@override
String get onboardingWalletNoteRestore =>
- 'Restoring asks roughly when the seed first held funds, to skip years of scanning.';
+ 'When restoring, a scan-from date makes syncing faster.';
@override
- String get onboardingWalletCreateBullet1 => 'A Monero seed phrase, shown once';
+ String get onboardingWalletCreateBullet1 => 'A new polyseed';
@override
- String get onboardingWalletCreateBullet2 => 'Starts empty, syncs from today';
+ String get onboardingWalletCreateBullet2 => 'Syncs from today';
@override
String get onboardingWalletCreateBullet3 => 'Takes about two minutes';
@@ -349,21 +376,21 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get onboardingSeedNotePassword =>
- 'Skylight Wallet asks for your password before ever showing them again.';
+ 'Skylight Wallet asks for your password before showing these words again.';
@override
String get onboardingPasswordNoteLaunch =>
- 'Asked for at every launch, and before the seed is ever shown.';
+ 'You need this password to open your wallet and to view your seed.';
@override
String get onboardingPasswordNoteNotCloud =>
- 'Not a cloud account. Losing it means restoring from your seed phrase.';
+ 'This password can\'t be recovered. If you lose it, restore your wallet from your seed phrase.';
@override
String get onboardingPasswordStrong => 'Strong';
@override
- String get onboardingPasswordMatch => 'Both entries match';
+ String get onboardingPasswordMatch => 'Passwords match';
@override
String get lwsDetailsTitle => 'Wallet Details';
@@ -458,6 +485,39 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get navigationBarWallet => 'Wallet';
+ @override
+ String get historyTitle => 'History';
+
+ @override
+ String get historyExportCsv => 'Export CSV';
+
+ @override
+ String get historyExported => 'History exported';
+
+ @override
+ String get historyExportFailed => 'Could not export the history';
+
+ @override
+ String get navigationBarHistory => 'History';
+
+ @override
+ String get historyFilterType => 'Type';
+
+ @override
+ String get historyFilterAddress => 'Address';
+
+ @override
+ String get historyFilterAddressAny => 'Any address';
+
+ @override
+ String get historyFilterAddressHint => 'Transactions received at this address, or sent to it.';
+
+ @override
+ String get historyFilterAddressInvalid => 'Not a Monero address';
+
+ @override
+ String get historyFilterReset => 'Reset';
+
@override
String get navigationBarSettings => 'Settings';
@@ -589,6 +649,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get sendOpenAliasResolveError => 'Invalid OpenAlias.';
+ @override
+ String get sendOpenAliasDisabledError => 'OpenAlias is turned off. Turn it on in Settings.';
+
@override
String get sendInvalidAddressError => 'Invalid address.';
@@ -606,7 +669,13 @@ class AppLocalizationsEn extends AppLocalizations {
String get settingsSectionGeneral => 'General';
@override
- String get settingsSectionBehaviour => 'Behaviour';
+ String get settingsSectionSecurityPrivacy => 'Security and privacy';
+
+ @override
+ String get settingsSectionData => 'Data';
+
+ @override
+ String get settingsSectionBehaviour => 'Behavior';
@override
String get settingsSectionWallet => 'Wallet';
@@ -625,9 +694,6 @@ class AppLocalizationsEn extends AppLocalizations {
String get settingsNotifyNewTxsDescriptionIos =>
'Notifications will be delayed for Tor LWS connections.';
- @override
- String get settingsAppLockLabel => 'App Lock';
-
@override
String get settingsAppLockUnlockReason => 'Unlock Wallet';
@@ -636,14 +702,14 @@ class AppLocalizationsEn extends AppLocalizations {
'Unable to authenticate. Make sure you have device unlock set up.';
@override
- String get settingsVerboseLoggingLabel => 'Diagnostic Logs';
+ String get settingsLoggingLabel => 'Diagnostic Logs';
@override
- String get settingsVerboseLoggingDescription =>
+ String get settingsLoggingDescription =>
'Log wallet operations to a text file in the app\'s data folder for debugging purposes.';
@override
- String get settingsVerboseLoggingDescriptionIos =>
+ String get settingsLoggingDescriptionIos =>
'Log wallet operations and allow the logs to be exported to a text file.';
@override
@@ -915,7 +981,7 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get sendIrreversibleNote =>
- 'Monero transactions are irreversible. Double-check the address and amount before sending.';
+ 'Transactions are irreversible, so make sure the address and amount are correct.';
@override
String get sendSwitchUnit => 'Switch amount unit';
@@ -994,4 +1060,113 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get lwsSetupInvalidQrCode => 'Invalid connection address.';
+
+ @override
+ String get coinHomeSwap => 'Swap';
+
+ @override
+ String get coinHomeSwapComingSoon => 'Coming soon!';
+
+ @override
+ String get verifySeedTitle => 'Verify Seed Phrase';
+
+ @override
+ String get homeIncomingTitle => 'Incoming';
+
+ @override
+ String homeIncomingUnlocksIn(int minutes, int done, int needed) {
+ String _temp0 = intl.Intl.pluralLogic(
+ minutes,
+ locale: localeName,
+ other: '$minutes minutes',
+ one: '1 minute',
+ );
+ return 'Unlocks in about $_temp0 · $done of $needed';
+ }
+
+ @override
+ String homeIncomingConfirmations(int done, int needed) {
+ return '$done of $needed confirmations';
+ }
+
+ @override
+ String get homeChartTitle => 'Balance · 90 days';
+
+ @override
+ String get homeChartToday => 'Today';
+
+ @override
+ String get homeChartEachCoin => 'Each coin\'s balance';
+
+ @override
+ String get homeChartNew => 'New';
+
+ @override
+ String get homeChartEmpty => 'Your balance over time shows here after your first transaction.';
+
+ @override
+ String get homeChecklistTitle => 'Secure your wallet';
+
+ @override
+ String homeChecklistProgress(int done, int total) {
+ return '$done of $total';
+ }
+
+ @override
+ String get homeChecklistVerifySeed => 'Verify your seed phrase';
+
+ @override
+ String get homeChecklistAutoBackup => 'Turn on automatic backups';
+
+ @override
+ String get homeChecklistTor => 'Connect through Tor';
+
+ @override
+ String get homeChecklistPrivateLookups => 'Use Tor for price and OpenAlias lookups';
+
+ @override
+ String get homeChecklistSecurityKeys => 'Set up a security key';
+
+ @override
+ String verifySeedSubtitle(int first, int second, int third) {
+ return 'Input words $first, $second and $third of your seed phrase below.';
+ }
+
+ @override
+ String get verifySeedButton => 'Verify';
+
+ @override
+ String get verifySeedWrongTitle => 'Those words don\'t match';
+
+ @override
+ String verifySeedWrongBody(int count) {
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$count tries',
+ one: '1 try',
+ );
+ return 'Check the seed phrase you wrote down, then enter the three new words asked for. $_temp0 left before the app locks.';
+ }
+
+ @override
+ String get verifySeedTryAgain => 'Try again';
+
+ @override
+ String get verifySeedUnavailable =>
+ 'Your seed phrase can\'t be read right now. Try again after unlocking the wallet.';
+
+ @override
+ String get verifySeedDone => 'Seed phrase verified';
+
+ @override
+ String homeIncomingTitleMore(int count) {
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$count Others',
+ one: '1 Other',
+ );
+ return 'Incoming (+$_temp0)';
+ }
}
### lib/l10n/app_localizations_pt.dart
@@ -77,6 +77,9 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get welcomePrivacyLink => 'Política de Privacidade';
+ @override
+ String get settingsLicensesLabel => 'Licenças de Código Aberto';
+
@override
String get lwsSetupTitle => 'Configuração da conexão';
@@ -188,18 +191,27 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get settingsBackgroundSyncDescription =>
- 'Sincroniza o Monero periodicamente em segundo plano para que esteja atualizado ao abrir o app. Só roda enquanto carrega e no WiFi.';
+ 'Sincroniza o Monero periodicamente em segundo plano para que esteja atualizado ao abrir o app. Usa só a sua chave de visualização: vê os pagamentos recebidos, mas nunca pode gastar. Só roda enquanto carrega e no WiFi.';
@override
String get settingsForegroundSyncLabel => 'Sincronização contínua';
@override
String get settingsForegroundSyncDescription =>
- 'Mantém o Monero sincronizando continuamente enquanto o app roda em segundo plano, com uma notificação persistente. Usa mais bateria.';
+ 'Mantém o Monero sincronizando continuamente enquanto o app roda em segundo plano, com uma notificação persistente. Usa só a sua chave de visualização: vê os pagamentos recebidos depois de confirmados, mas nunca pode gastar. Usa mais bateria.';
@override
- String homeBlocksRemaining(String count) {
- return '$count blocos restantes';
+ String homeBlocksRemaining(int count) {
+ final intl.NumberFormat countNumberFormat = intl.NumberFormat.decimalPattern(localeName);
+ final String countString = countNumberFormat.format(count);
+
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$countString blocos restantes',
+ one: '1 bloco restante',
+ );
+ return '$_temp0';
}
@override
@@ -230,6 +242,23 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get fiatModeDisabledDesc => 'Sem preços; saldos exibidos apenas em cripto';
+ @override
+ String get settingsOpenAliasSettingsLabel => 'Configurações do OpenAlias';
+
+ @override
+ String get openAliasSettingsSheetSubtitle =>
+ 'Como nomes como nome@exemplo.com são consultados quando você envia.';
+
+ @override
+ String get openAliasModeTorOnlyDesc => 'Nomes consultados pelo Tor · recomendado';
+
+ @override
+ String get openAliasModeClearnetDesc =>
+ 'Não privado, os servidores DNS veem seu endereço IP e o nome';
+
+ @override
+ String get openAliasModeDisabledDesc => 'Sem consultas; envie apenas para endereços';
+
@override
String get fiatApiSettingsDisplayCurrencyLabel => 'Moeda de Exibição';
@@ -302,40 +331,38 @@ class AppLocalizationsPt extends AppLocalizations {
String get generateSeedBirthdayReason => 'Onde uma futura restauração começa a escanear';
@override
- String get onboardingTorNotePrivacy =>
- 'O Tor esconde seu endereço do nó que você consulta — mais lento, e vale a pena.';
+ String get onboardingTorNotePrivacy => 'Conexões pelo Tor podem ser mais lentas.';
@override
- String get onboardingTorNoteChangeable => 'Pode ser alterado depois em Configurações → Conexões.';
+ String get onboardingTorNoteChangeable => 'Você pode alterar isso depois nas Configurações.';
@override
String get onboardingPriceNoteRatesOnly =>
- 'O serviço de preços recebe apenas pedidos de cotações — nunca endereços ou valores.';
+ 'Apenas os preços são solicitados. Seus endereços e saldos não são enviados.';
@override
- String get onboardingPriceNoteTor => 'Roteado pelo Tor por padrão, separado do tráfego da rede.';
+ String get onboardingPriceNoteTor => 'Os preços são buscados pelo Tor por padrão.';
@override
String get onboardingConnectionNoteServer =>
- 'Aponte a Skylight para um servidor de carteira leve (LWS), ou conecte-se ao seu próprio nó Monero.';
+ 'Use um servidor light-wallet (LWS) ou seu próprio nó Monero.';
@override
String get onboardingConnectionNoteChangeable =>
- 'Pode ser alterado depois em Configurações → Conexão.';
+ 'Você pode alterar isso depois nas Configurações.';
@override
- String get onboardingWalletNoteGenerated =>
- 'A seed de uma nova carteira é gerada aqui, offline, e mostrada a você uma única vez.';
+ String get onboardingWalletNoteGenerated => 'A Skylight Wallet gera sua seed neste dispositivo.';
@override
String get onboardingWalletNoteRestore =>
- 'A restauração pergunta aproximadamente quando a seed teve fundos pela primeira vez, para pular anos de escaneamento.';
+ 'Ao restaurar, uma data para escanear a partir dela torna a sincronização mais rápida.';
@override
- String get onboardingWalletCreateBullet1 => 'Uma frase seed Monero, mostrada uma vez';
+ String get onboardingWalletCreateBullet1 => 'Uma nova polyseed';
@override
- String get onboardingWalletCreateBullet2 => 'Começa vazia, sincroniza a partir de hoje';
+ String get onboardingWalletCreateBullet2 => 'Sincroniza a partir de hoje';
@override
String get onboardingWalletCreateBullet3 => 'Leva cerca de dois minutos';
@@ -351,21 +378,21 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get onboardingSeedNotePassword =>
- 'A Skylight Wallet pede sua senha antes de mostrá-las novamente.';
+ 'A Skylight Wallet pede sua senha antes de mostrar estas palavras novamente.';
@override
String get onboardingPasswordNoteLaunch =>
- 'Pedida a cada abertura, e antes de a seed ser mostrada.';
+ 'Você precisa desta senha para abrir sua carteira e para ver sua seed.';
@override
String get onboardingPasswordNoteNotCloud =>
- 'Não é uma conta na nuvem. Perdê-la significa restaurar a partir da sua frase seed.';
+ 'Esta senha não pode ser recuperada. Se você a perder, restaure sua carteira a partir da sua frase seed.';
@override
String get onboardingPasswordStrong => 'Forte';
@override
- String get onboardingPasswordMatch => 'As duas entradas coincidem';
+ String get onboardingPasswordMatch => 'As senhas coincidem';
@override
String get lwsDetailsTitle => 'Detalhes da Carteira';
@@ -460,6 +487,40 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get navigationBarWallet => 'Carteira';
+ @override
+ String get historyTitle => 'Histórico';
+
+ @override
+ String get historyExportCsv => 'Exportar CSV';
+
+ @override
+ String get historyExported => 'Histórico exportado';
+
+ @override
+ String get historyExportFailed => 'Não foi possível exportar o histórico';
+
+ @override
+ String get navigationBarHistory => 'Histórico';
+
+ @override
+ String get historyFilterType => 'Tipo';
+
+ @override
+ String get historyFilterAddress => 'Endereço';
+
+ @override
+ String get historyFilterAddressAny => 'Qualquer endereço';
+
+ @override
+ String get historyFilterAddressHint =>
+ 'Transações recebidas neste endereço ou enviadas para ele.';
+
+ @override
+ String get historyFilterAddressInvalid => 'Não é um endereço Monero';
+
+ @override
+ String get historyFilterReset => 'Redefinir';
+
@override
String get navigationBarSettings => 'Configurações';
@@ -591,6 +652,9 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get sendOpenAliasResolveError => 'OpenAlias inválido.';
+ @override
+ String get sendOpenAliasDisabledError => 'O OpenAlias está desligado. Ligue-o nas Configurações.';
+
@override
String get sendInvalidAddressError => 'Endereço inválido.';
@@ -607,6 +671,12 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get settingsSectionGeneral => 'Geral';
+ @override
+ String get settingsSectionSecurityPrivacy => 'Segurança e privacidade';
+
+ @override
+ String get settingsSectionData => 'Dados';
+
@override
String get settingsSectionBehaviour => 'Comportamento';
@@ -627,9 +697,6 @@ class AppLocalizationsPt extends AppLocalizations {
String get settingsNotifyNewTxsDescriptionIos =>
'As notificações serão atrasadas para conexões LWS via Tor.';
- @override
- String get settingsAppLockLabel => 'Desbloqueio com PIN/Biometria';
-
@override
String get settingsAppLockUnlockReason => 'Desbloquear carteira';
@@ -638,14 +705,14 @@ class AppLocalizationsPt extends AppLocalizations {
'Não foi possível autenticar. Verifique se o desbloqueio de tela está configurado.';
@override
- String get settingsVerboseLoggingLabel => 'Logs de Diagnóstico';
+ String get settingsLoggingLabel => 'Logs de Diagnóstico';
@override
- String get settingsVerboseLoggingDescription =>
+ String get settingsLoggingDescription =>
'Registrar operações da carteira em um arquivo de texto na pasta de dados do app para fins de depuração.';
@override
- String get settingsVerboseLoggingDescriptionIos =>
+ String get settingsLoggingDescriptionIos =>
'Registrar operações da carteira e permitir exportar os logs para um arquivo de texto.';
@override
@@ -917,7 +984,7 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get sendIrreversibleNote =>
- 'Transações Monero são irreversíveis. Confira o endereço e o valor antes de enviar.';
+ 'As transações são irreversíveis, então verifique se o endereço e o valor estão corretos.';
@override
String get sendSwitchUnit => 'Alternar unidade do valor';
@@ -997,4 +1064,114 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get lwsSetupInvalidQrCode => 'Endereço de conexão inválido.';
+
+ @override
+ String get coinHomeSwap => 'Trocar';
+
+ @override
+ String get coinHomeSwapComingSoon => 'Em breve!';
+
+ @override
+ String get verifySeedTitle => 'Verificar Frase Seed';
+
+ @override
+ String get homeIncomingTitle => 'A receber';
+
+ @override
+ String homeIncomingUnlocksIn(int minutes, int done, int needed) {
+ String _temp0 = intl.Intl.pluralLogic(
+ minutes,
+ locale: localeName,
+ other: '$minutes minutos',
+ one: '1 minuto',
+ );
+ return 'Desbloqueia em cerca de $_temp0 · $done de $needed';
+ }
+
+ @override
+ String homeIncomingConfirmations(int done, int needed) {
+ return '$done de $needed confirmações';
+ }
+
+ @override
+ String get homeChartTitle => 'Saldo · 90 dias';
+
+ @override
+ String get homeChartToday => 'Hoje';
+
+ @override
+ String get homeChartEachCoin => 'Saldo de cada moeda';
+
+ @override
+ String get homeChartNew => 'Novo';
+
+ @override
+ String get homeChartEmpty =>
+ 'Seu saldo ao longo do tempo aparece aqui após sua primeira transação.';
+
+ @override
+ String get homeChecklistTitle => 'Proteja sua carteira';
+
+ @override
+ String homeChecklistProgress(int done, int total) {
+ return '$done de $total';
+ }
+
+ @override
+ String get homeChecklistVerifySeed => 'Verifique sua frase seed';
+
+ @override
+ String get homeChecklistAutoBackup => 'Ative os backups automáticos';
+
+ @override
+ String get homeChecklistTor => 'Conecte-se pelo Tor';
+
+ @override
+ String get homeChecklistPrivateLookups => 'Use o Tor nas consultas de preço e OpenAlias';
+
+ @override
+ String get homeChecklistSecurityKeys => 'Configure uma chave de segurança';
+
+ @override
+ String verifySeedSubtitle(int first, int second, int third) {
+ return 'Insira as palavras $first, $second e $third da sua frase seed abaixo.';
+ }
+
+ @override
+ String get verifySeedButton => 'Verificar';
+
+ @override
+ String get verifySeedWrongTitle => 'Essas palavras não conferem';
+
+ @override
+ String verifySeedWrongBody(int count) {
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: 'Restam $count tentativas',
+ one: 'Resta 1 tentativa',
+ );
+ return 'Confira a frase seed que você anotou e insira as três novas palavras pedidas. $_temp0 antes de o app bloquear.';
+ }
+
+ @override
+ String get verifySeedTryAgain => 'Tentar novamente';
+
+ @override
+ String get verifySeedUnavailable =>
+ 'Não é possível ler sua frase seed agora. Tente novamente depois de desbloquear a carteira.';
+
+ @override
+ String get verifySeedDone => 'Frase seed verificada';
+
+ @override
+ String homeIncomingTitleMore(int count) {
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$count Outras',
+ one: '1 Outra',
+ );
+ return 'A receber (+$_temp0)';
+ }
}
### lib/l10n/app_pt.arb
@@ -29,6 +29,7 @@
"welcomeTermsLink": "Termos de Serviço",
"welcomeAgreeMiddle": " e a ",
"welcomePrivacyLink": "Política de Privacidade",
+ "settingsLicensesLabel": "Licenças de Código Aberto",
"lwsSetupTitle": "Configuração da conexão",
"lwsSetupDescription": "Conecte-se a um servidor light-wallet Monero (LWS) ou ao seu próprio nó completo. Selecione apenas um servidor em que você confia. Mesmo se você usar o Tor, este servidor pode obter informações sobre você. Com um LWS, sua chave privada de visualização e seu endereço primário serão compartilhados com este servidor.",
"lwsSetupProxyPortLabel": "Porta do Proxy HTTP (opcional)",
@@ -63,14 +64,15 @@
"settingsConnectionOverClearnet": "via Clearnet",
"settingsConnectionInLocalNetwork": "na rede local",
"settingsBackgroundSyncLabel": "Sincronização em segundo plano",
- "settingsBackgroundSyncDescription": "Sincroniza o Monero periodicamente em segundo plano para que esteja atualizado ao abrir o app. Só roda enquanto carrega e no WiFi.",
+ "settingsBackgroundSyncDescription": "Sincroniza o Monero periodicamente em segundo plano para que esteja atualizado ao abrir o app. Usa só a sua chave de visualização: vê os pagamentos recebidos, mas nunca pode gastar. Só roda enquanto carrega e no WiFi.",
"settingsForegroundSyncLabel": "Sincronização contínua",
- "settingsForegroundSyncDescription": "Mantém o Monero sincronizando continuamente enquanto o app roda em segundo plano, com uma notificação persistente. Usa mais bateria.",
- "homeBlocksRemaining": "{count} blocos restantes",
+ "settingsForegroundSyncDescription": "Mantém o Monero sincronizando continuamente enquanto o app roda em segundo plano, com uma notificação persistente. Usa só a sua chave de visualização: vê os pagamentos recebidos depois de confirmados, mas nunca pode gastar. Usa mais bateria.",
+ "homeBlocksRemaining": "{count, plural, =1{1 bloco restante} other{{count} blocos restantes}}",
"@homeBlocksRemaining": {
"placeholders": {
"count": {
- "type": "String"
+ "type": "int",
+ "format": "decimalPattern"
}
}
},
@@ -83,6 +85,11 @@
"fiatModeTorOnlyDesc": "Preços buscados pelo Tor · recomendado",
"fiatModeClearnetDesc": "Não privado, o servidor de preços vê seu endereço IP",
"fiatModeDisabledDesc": "Sem preços; saldos exibidos apenas em cripto",
+ "settingsOpenAliasSettingsLabel": "Configurações do OpenAlias",
+ "openAliasSettingsSheetSubtitle": "Como nomes como nome@exemplo.com são consultados quando você envia.",
+ "openAliasModeTorOnlyDesc": "Nomes consultados pelo Tor · recomendado",
+ "openAliasModeClearnetDesc": "Não privado, os servidores DNS veem seu endereço IP e o nome",
+ "openAliasModeDisabledDesc": "Sem consultas; envie apenas para endereços",
"fiatApiSettingsDisplayCurrencyLabel": "Moeda de Exibição",
"createWalletTitle": "Configuração da Carteira",
"createWalletDescription": "Você quer criar uma nova carteira ou restaurar uma carteira existente?",
@@ -105,25 +112,25 @@
"generateSeedConfirm": "Anotei todas as palavras e as guardei em um lugar que só eu posso acessar.",
"generateSeedBirthdayLabel": "Aniversário da carteira",
"generateSeedBirthdayReason": "Onde uma futura restauração começa a escanear",
- "onboardingTorNotePrivacy": "O Tor esconde seu endereço do nó que você consulta — mais lento, e vale a pena.",
- "onboardingTorNoteChangeable": "Pode ser alterado depois em Configurações → Conexões.",
- "onboardingPriceNoteRatesOnly": "O serviço de preços recebe apenas pedidos de cotações — nunca endereços ou valores.",
- "onboardingPriceNoteTor": "Roteado pelo Tor por padrão, separado do tráfego da rede.",
- "onboardingConnectionNoteServer": "Aponte a Skylight para um servidor de carteira leve (LWS), ou conecte-se ao seu próprio nó Monero.",
- "onboardingConnectionNoteChangeable": "Pode ser alterado depois em Configurações → Conexão.",
- "onboardingWalletNoteGenerated": "A seed de uma nova carteira é gerada aqui, offline, e mostrada a você uma única vez.",
- "onboardingWalletNoteRestore": "A restauração pergunta aproximadamente quando a seed teve fundos pela primeira vez, para pular anos de escaneamento.",
- "onboardingWalletCreateBullet1": "Uma frase seed Monero, mostrada uma vez",
- "onboardingWalletCreateBullet2": "Começa vazia, sincroniza a partir de hoje",
+ "onboardingTorNotePrivacy": "Conexões pelo Tor podem ser mais lentas.",
+ "onboardingTorNoteChangeable": "Você pode alterar isso depois nas Configurações.",
+ "onboardingPriceNoteRatesOnly": "Apenas os preços são solicitados. Seus endereços e saldos não são enviados.",
+ "onboardingPriceNoteTor": "Os preços são buscados pelo Tor por padrão.",
+ "onboardingConnectionNoteServer": "Use um servidor light-wallet (LWS) ou seu próprio nó Monero.",
+ "onboardingConnectionNoteChangeable": "Você pode alterar isso depois nas Configurações.",
+ "onboardingWalletNoteGenerated": "A Skylight Wallet gera sua seed neste dispositivo.",
+ "onboardingWalletNoteRestore": "Ao restaurar, uma data para escanear a partir dela torna a sincronização mais rápida.",
+ "onboardingWalletCreateBullet1": "Uma nova polyseed",
+ "onboardingWalletCreateBullet2": "Sincroniza a partir de hoje",
"onboardingWalletCreateBullet3": "Leva cerca de dois minutos",
"onboardingWalletRestoreBullet1": "Uma seed Monero Polyseed, BIP39 ou legada",
"onboardingWalletRestoreBullet2": "Data de escaneamento opcional",
"onboardingWalletRestoreBullet3": "Recupera seu saldo e histórico existentes",
- "onboardingSeedNotePassword": "A Skylight Wallet pede sua senha antes de mostrá-las novamente.",
- "onboardingPasswordNoteLaunch": "Pedida a cada abertura, e antes de a seed ser mostrada.",
- "onboardingPasswordNoteNotCloud": "Não é uma conta na nuvem. Perdê-la significa restaurar a partir da sua frase seed.",
+ "onboardingSeedNotePassword": "A Skylight Wallet pede sua senha antes de mostrar estas palavras novamente.",
+ "onboardingPasswordNoteLaunch": "Você precisa desta senha para abrir sua carteira e para ver sua seed.",
+ "onboardingPasswordNoteNotCloud": "Esta senha não pode ser recuperada. Se você a perder, restaure sua carteira a partir da sua frase seed.",
"onboardingPasswordStrong": "Forte",
- "onboardingPasswordMatch": "As duas entradas coincidem",
+ "onboardingPasswordMatch": "As senhas coincidem",
"lwsDetailsTitle": "Detalhes da Carteira",
"lwsDetailsDescription": "Se o seu servidor Light Wallet Monero (LWS) exigir registro, você pode usar estes dados para adicionar esta carteira a esse servidor. Nem todos os servidores exigem registro.",
"lwsDetailsPrimaryAddressLabel": "Endereço Primário",
@@ -166,6 +173,17 @@
},
"restoreWalletChecksumError": "Esta não é uma frase-semente válida — verifique as palavras e sua ordem.",
"navigationBarWallet": "Carteira",
+ "historyTitle": "Histórico",
+ "historyExportCsv": "Exportar CSV",
+ "historyExported": "Histórico exportado",
+ "historyExportFailed": "Não foi possível exportar o histórico",
+ "navigationBarHistory": "Histórico",
+ "historyFilterType": "Tipo",
+ "historyFilterAddress": "Endereço",
+ "historyFilterAddressAny": "Qualquer endereço",
+ "historyFilterAddressHint": "Transações recebidas neste endereço ou enviadas para ele.",
+ "historyFilterAddressInvalid": "Não é um endereço Monero",
+ "historyFilterReset": "Redefinir",
"navigationBarSettings": "Configurações",
"unlockButton": "Desbloquear",
"unlockReason": "Desbloquear carteira",
@@ -215,23 +233,25 @@
"sendSendButton": "Enviar",
"sendTransactionSuccessfullySent": "Transação enviada com sucesso!",
"sendOpenAliasResolveError": "OpenAlias inválido.",
+ "sendOpenAliasDisabledError": "O OpenAlias está desligado. Ligue-o nas Configurações.",
"sendInvalidAddressError": "Endereço inválido.",
"sendInsufficientBalanceError": "Saldo insuficiente.",
"sendInsufficientBalanceToCoverFeeError": "Saldo insuficiente para cobrir a taxa da rede.",
"settingsTitle": "Configurações",
"settingsSectionGeneral": "Geral",
+ "settingsSectionSecurityPrivacy": "Segurança e privacidade",
+ "settingsSectionData": "Dados",
"settingsSectionBehaviour": "Comportamento",
"settingsSectionWallet": "Carteira",
"settingsSectionAbout": "Sobre",
"settingsNotifyNewTxsLabel": "Notificações de Transações",
"settingsNotifyNewTxsDescription": "Mostrar uma notificação quando você receber uma transação. Ao conectar-se a um nó Monero, a Sincronização em Segundo Plano também precisa estar ativada.",
"settingsNotifyNewTxsDescriptionIos": "As notificações serão atrasadas para conexões LWS via Tor.",
- "settingsAppLockLabel": "Desbloqueio com PIN/Biometria",
"settingsAppLockUnlockReason": "Desbloquear carteira",
"settingsAppLockUnableToAuthError": "Não foi possível autenticar. Verifique se o desbloqueio de tela está configurado.",
- "settingsVerboseLoggingLabel": "Logs de Diagnóstico",
- "settingsVerboseLoggingDescription": "Registrar operações da carteira em um arquivo de texto na pasta de dados do app para fins de depuração.",
- "settingsVerboseLoggingDescriptionIos": "Registrar operações da carteira e permitir exportar os logs para um arquivo de texto.",
+ "settingsLoggingLabel": "Logs de Diagnóstico",
+ "settingsLoggingDescription": "Registrar operações da carteira em um arquivo de texto na pasta de dados do app para fins de depuração.",
+ "settingsLoggingDescriptionIos": "Registrar operações da carteira e permitir exportar os logs para um arquivo de texto.",
"settingsExportLogsLabel": "Exportar Logs",
"settingsExportLogsButton": "Exportar",
"settingsExportLogsError": "Nenhum log encontrado para exportar.",
@@ -331,7 +351,7 @@
"sendPriorityHeading": "Prioridade",
"sendPickContactTitle": "Enviar para um contato",
"sendAvailableSuffix": "disponível",
- "sendIrreversibleNote": "Transações Monero são irreversíveis. Confira o endereço e o valor antes de enviar.",
+ "sendIrreversibleNote": "As transações são irreversíveis, então verifique se o endereço e o valor estão corretos.",
"sendSwitchUnit": "Alternar unidade do valor",
"sendFailedToGetFeesError": "Não foi possível carregar taxas.",
"sendNoConnectionError": "Não foi possível conectar ao servidor. Verifique sua conexão e tente novamente.",
@@ -356,5 +376,31 @@
"torDisabledWalletsWarningConfirm": "Desativar o Tor",
"settingsTorSettingsLabel": "Configurações do Tor",
"lwsSetupTorDisabledError": "O Tor está desativado. Por favor, volte e ative-o.",
- "lwsSetupInvalidQrCode": "Endereço de conexão inválido."
+ "lwsSetupInvalidQrCode": "Endereço de conexão inválido.",
+ "coinHomeSwap": "Trocar",
+ "coinHomeSwapComingSoon": "Em breve!",
+ "verifySeedTitle": "Verificar Frase Seed",
+ "homeIncomingTitle": "A receber",
+ "homeIncomingUnlocksIn": "Desbloqueia em cerca de {minutes, plural, =1{1 minuto} other{{minutes} minutos}} · {done} de {needed}",
+ "homeIncomingConfirmations": "{done} de {needed} confirmações",
+ "homeChartTitle": "Saldo · 90 dias",
+ "homeChartToday": "Hoje",
+ "homeChartEachCoin": "Saldo de cada moeda",
+ "homeChartNew": "Novo",
+ "homeChartEmpty": "Seu saldo ao longo do tempo aparece aqui após sua primeira transação.",
+ "homeChecklistTitle": "Proteja sua carteira",
+ "homeChecklistProgress": "{done} de {total}",
+ "homeChecklistVerifySeed": "Verifique sua frase seed",
+ "homeChecklistAutoBackup": "Ative os backups automáticos",
+ "homeChecklistTor": "Conecte-se pelo Tor",
+ "homeChecklistPrivateLookups": "Use o Tor nas consultas de preço e OpenAlias",
+ "homeChecklistSecurityKeys": "Configure uma chave de segurança",
+ "verifySeedSubtitle": "Insira as palavras {first}, {second} e {third} da sua frase seed abaixo.",
+ "verifySeedButton": "Verificar",
+ "verifySeedWrongTitle": "Essas palavras não conferem",
+ "verifySeedWrongBody": "Confira a frase seed que você anotou e insira as três novas palavras pedidas. {count, plural, =1{Resta 1 tentativa} other{Restam {count} tentativas}} antes de o app bloquear.",
+ "verifySeedTryAgain": "Tentar novamente",
+ "verifySeedUnavailable": "Não é possível ler sua frase seed agora. Tente novamente depois de desbloquear a carteira.",
+ "verifySeedDone": "Frase seed verificada",
+ "homeIncomingTitleMore": "A receber (+{count, plural, =1{1 Outra} other{{count} Outras}})"
}
### lib/main.dart
@@ -3,6 +3,7 @@ import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
+import 'package:flutter/services.dart' show HardwareKeyboard, KeyEvent;
import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:skeletonizer/skeletonizer.dart';
@@ -29,10 +30,12 @@ import 'package:skylight_wallet/screens/send.dart';
import 'package:skylight_wallet/screens/create_wallet.dart';
import 'package:skylight_wallet/screens/create_wallet_password.dart';
import 'package:skylight_wallet/screens/restore_wallet.dart';
+import 'package:skylight_wallet/screens/verify_seed.dart';
import 'package:skylight_wallet/screens/wallet_home.dart';
import 'package:skylight_wallet/screens/welcome.dart';
import 'package:skylight_wallet/screens/tor_settings.dart';
import 'package:skylight_wallet/screens/address_book.dart';
+import 'package:skylight_wallet/screens/history.dart';
import 'package:skylight_wallet/screens/privacy_policy.dart';
import 'package:skylight_wallet/screens/terms_of_service.dart';
import 'package:skylight_wallet/screens/unlock.dart';
@@ -45,9 +48,12 @@ import 'package:skylight_wallet/services/foreground_sync_service.dart';
import 'package:skylight_wallet/util/dirs.dart';
import 'package:skylight_wallet/util/logging.dart';
import 'package:skylight_wallet/util/platform.dart';
+import 'package:skylight_wallet/route_policy.dart';
import 'package:skylight_wallet/wallet_core_glue.dart';
-import 'package:wallet_domain/wallet_domain.dart' show WalletManager, parsePaymentUri;
-import 'package:wallet_infra/wallet_infra.dart' show HostPlatform;
+import 'package:wallet_backup_platform/backup_ui.dart';
+import 'package:wallet_domain/wallet_domain.dart' show AppSession, WalletManager, parsePaymentUri;
+import 'package:wallet_fhse/security_keys_ui.dart';
+import 'package:wallet_infra/wallet_infra.dart' show BiometricAuth, HostPlatform;
void main() async {
// Catch all uncaught async errors
@@ -58,6 +64,8 @@ void main() async {
await HostPlatform.init();
installWalletCore();
+ installSecurityKeysUi();
+ installMetadataBackup();
BrandColors.install(skylightPalette);
// Selected onboarding option cards stay white — only the accent border
// marks the selection (no tinted fill).
@@ -152,25 +160,44 @@ class _AppRootState extends State<_AppRoot> with WidgetsBindingObserver {
// actual flip we force an in-place rebuild of the navigator subtree.
final GlobalKey<NavigatorState> _navigatorKey = GlobalKey<NavigatorState>();
final _CurrentRouteObserver _routeObserver = _CurrentRouteObserver();
- bool _relockPending = false;
- bool _walletExists = false;
Brightness? _lastBrightness;
- // A payment deep link (monero:) awaiting replay. Held until the app is past the
- // lock, then opened on the send form — see _onRouteChanged.
- String? _pendingPaymentUri;
+ // App Lock over the screens the user left (a relock): drawn above the
+ // navigator ([AppLockCover]), so a screen finishing something under it
+ // cannot pop it the way it could pop a route.
+ final _cover = ValueNotifier<bool>(false);
+
+ // Every route the platform pushes is dropped; payment links (monero:) come
+ // over PaymentLinkChannel instead and wait in the gate until the user is past
+ // every lock (AppSession) and on a screen behind them.
+ final _routeLinkBlocker = RouteLinkBlocker();
+ late final PaymentLinkGate _paymentLinks;
static const _paymentUriSchemes = {'monero'};
+ // App Lock (always on): its "Lock after" time in the background, on mobile.
+ final _appLock = AppLockTimer();
+ // Set when the app reaches `paused`, so the way back is noticed at its first
+ // step (`hidden`), before a link that resumed it could land.
+ bool _wasPaused = false;
+
+ // "Fully lock after", with security keys on.
+ final _fullLock = SecurityKeyFullLock();
+
+ // "Lock after" a time without use, on a desktop OS: the full close.
+ final _desktopLock = DesktopAutoLock();
+ // App Lock's shorter time without use, on a desktop OS: covers the app.
+ final _desktopAppLock = DesktopAutoLock.appLock();
+
static void _markSubtreeDirty(Element element) {
element.markNeedsBuild();
element.visitChildren(_markSubtreeDirty);
}
// The bottom-nav destinations. Tapping a nav tab must not animate, so these
// get a zero-duration route in _onGenerateRoute.
- static const _noTransitionRoutes = {'/wallet_home', '/address_book', '/settings'};
+ static const _noTransitionRoutes = {'/wallet_home', '/history', '/address_book', '/settings'};
- Map<String, WidgetBuilder> get _routes => {
+ static final Map<String, WidgetBuilder> _routes = {
'/welcome': (context) => WelcomeScreen(),
'/tor_settings': (context) => TorSettingsScreen(),
'/connection_setup': (context) => ConnectionSetupScreen(),
@@ -181,6 +208,11 @@ class _AppRootState extends State<_AppRoot> with WidgetsBindingObserver {
'/lws_details': (context) => LwsDetailsScreen(),
'/restore_wallet': (context) => RestoreWalletScreen(),
'/unlock': (context) => UnlockScreen(),
+ '/security_key_unlock': (context) => const SecurityKeyUnlockScreen(),
+ // Re-authenticates every time it opens: it can turn security keys off.
+ '/advanced_security': (context) => const GuardedAdvancedSecurityScreen(),
+ '/metadata_backup': (context) => const MetadataBackupScreen(),
+ '/verify_seed': (context) => const VerifySeedScreen(),
'/wallet_home': (context) => WalletHomeScreen(),
'/settings': (context) => SettingsScreen(),
'/lws_keys': (context) => ReauthGate(
@@ -195,13 +227,18 @@ class _AppRootState extends State<_AppRoot> with WidgetsBindingObserver {
'/scan_qr': (context) => ScanQrScreen(),
'/receive': (context) => ReceiveScreen(),
'/address_book': (context) => AddressBookScreen(),
+ '/history': (context) => const HistoryScreen(),
'/terms_of_service': (context) => TermsOfService(),
'/privacy_policy': (context) => PrivacyPolicy(),
};
Route<dynamic>? _onGenerateRoute(RouteSettings settings) {
+ // Deny by default (route_policy.dart): an unlisted route, or one behind the
+ // locks while the app is locked, shows nothing and removes itself.
final builder = _routes[settings.name];
- if (builder == null) return null;
+ if (builder == null || !routePolicy.allows(settings.name, unlocked: AppSession.isUnlocked)) {
+ return RefusedRoute(settings, listed: routePolicy.access.containsKey(settings.name));
+ }
// Desktop: no transition anywhere. Mobile: only between the nav-bar screens;
// every other push/pop keeps its normal animation.
if (isDesktop || _noTransitionRoutes.contains(settings.name)) {
@@ -213,55 +250,52 @@ class _AppRootState extends State<_AppRoot> with WidgetsBindingObserver {
@override
void initState() {
super.initState();
+ assert(() {
+ final c = routePolicy.check(_routes.keys);
+ return c.unlisted.isEmpty && c.stale.isEmpty;
+ }(), 'route_policy.dart does not match the routes');
+ // Android: the Continuous Sync service and this app take turns holding the
+ // wallets, never both at once; installed before anything opens.
+ ForegroundSyncLink.install(Provider.of<WalletManager>(context, listen: false));
+ // First, so it is asked before WidgetsApp's own observer and drops every
+ // pushed route before WidgetsApp could turn it into a screen.
+ WidgetsBinding.instance.addObserver(_routeLinkBlocker);
WidgetsBinding.instance.addObserver(this);
- _routeObserver.current.addListener(_onRouteChanged);
+ _paymentLinks = PaymentLinkGate(
+ schemes: _paymentUriSchemes,
+ unlocked: AppSession.unlocked,
+ landing: _routeObserver.current,
+ canLand: () => routePolicy.requiresUnlock(_routeObserver.currentName),
+ open: _openPaymentUri,
+ );
+ unawaited(PaymentLinkChannel.listen(_paymentLinks.offer));
+ if (isDesktopOS) {
+ HardwareKeyboard.instance.addHandler(_onKey);
+ _desktopLock.start(_lockDesktop);
+ _desktopAppLock.start(_coverDesktop);
+ }
}
@override
void dispose() {
+ _cover.dispose();
+ _appLock.dispose();
+ _fullLock.dispose();
+ _desktopLock.dispose();
+ _desktopAppLock.dispose();
+ if (isDesktopOS) HardwareKeyboard.instance.removeHandler(_onKey);
WidgetsBinding.instance.removeObserver(this);
- _routeObserver.current.removeListener(_onRouteChanged);
+ WidgetsBinding.instance.removeObserver(_routeLinkBlocker);
+ _paymentLinks.dispose();
_announceWallet?.removeListener(_announceNewTxsOnGrowth);
super.dispose();
}
- // A deep link that arrives while the app is running (warm start). Payment links
- // open the send form; anything else is left to the default handling.
- @override
- Future<bool> didPushRouteInformation(RouteInformation routeInformation) async {
- if (_handleDeepLink(routeInformation.uri.toString())) return true;
- return super.didPushRouteInformation(routeInformation);
- }
-
- bool _isPaymentUri(String raw) {
- final scheme = Uri.tryParse(raw.trim())?.scheme.toLowerCase();
- return scheme != null && _paymentUriSchemes.contains(scheme);
- }
-
- // Open a payment link now if the app is past the lock, else hold it for replay.
- bool _handleDeepLink(String raw) {
- if (!_isPaymentUri(raw)) return false;
- final current = _routeObserver.currentName;
- if (!_walletExists || current == null || current == '/unlock') {
- _pendingPaymentUri = raw;
- } else {
- _openPaymentUri(raw);
- }
- return true;
- }
-
- // Replay a held payment link the first time the app reaches home — after boot
- // (no lock) or after unlock. The send form still reviews and authenticates the
- // spend; the link only prefills it.
- void _onRouteChanged() {
- final raw = _pendingPaymentUri;
- if (raw == null || _routeObserver.currentName != '/wallet_home') return;
- _pendingPaymentUri = null;
- WidgetsBinding.instance.addPostFrameCallback((_) => _openPaymentUri(raw));
- }
-
+ /// Opens the Send form for a payment link the gate let through: the user is
+ /// past every lock and on a screen behind them. It only pre-fills the form,
+ /// which reviews and confirms the payment as always.
void _openPaymentUri(String raw) {
- if (!mounted) return;
+ if (!mounted || !AppSession.isUnlocked) return;
final manager = Provider.of<WalletManager>(context, listen: false);
final request = parsePaymentUri(raw, manager.allWallets);
if (request == null) return;
@@ -285,37 +319,156 @@ class _AppRootState extends State<_AppRoot> with WidgetsBindingObserver {
);
}
+ /// The system back button, while App Lock covers the app: swallowed. It
+ /// would otherwise pop a screen out of sight under the cover. Asked before
+ /// the MaterialApp's own handler, which registers after this one.
+ @override
+ Future<bool> didPopRoute() async => _cover.value;
+
+ /// App Lock over the screens the user left.
+ void _showCover() => _cover.value = true;
+
+ void _hideCover() => _cover.value = false;
+
+ /// From the cover: the wallet closed meanwhile and a key comes next.
+ void _coverNeedsKey() => _replaceStack('/security_key_unlock');
+
+ /// A lock screen replaces the stack. A cover that is up stays until that
+ /// screen is fully in, so nothing it covered shows on the way.
+ void _replaceStack(String lockRoute) {
+ _navigatorKey.currentState?.pushNamedAndRemoveUntil(lockRoute, (route) => false);
+ if (!_cover.value) return;
+ final top = _routeObserver.top;
+ final animation = top is ModalRoute ? top.animation : null;
+ if (animation == null || animation.isCompleted) return _hideCover();
+ void settled(AnimationStatus status) {
+ if (status.isAnimating) return;
+ animation.removeStatusListener(settled);
+ _hideCover();
+ }
+
+ animation.addStatusListener(settled);
+ }
+
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
+ if (isDesktopOS) {
+ _onDesktopLifecycle(state);
+ return;
+ }
if (!isMobile) return;
if (state == AppLifecycleState.paused) {
- // App Lock has to cover backgrounding, not just a cold start. Without
- // this, resuming walked straight back into an unlocked wallet with the
- // password still in memory, and the seed was reachable from there.
- unawaited(_maybeArmRelock());
+ _wasPaused = true;
+ // App Lock has to cover backgrounding, not just a cold start: once its
+ // time is up the password goes and the way back shows the lock. Not
+ // while it is showing: the device's own prompt can background the app.
+ if (_routeObserver.currentName != '/unlock' && !_cover.value) {
+ unawaited(_appLock.onBackground(context));
+ }
+ unawaited(_fullLock.onBackground(context));
// Leaving the app marks everything on screen as seen so a background
// isolate won't re-notify a tx the user just watched arrive. Desktop has
// no background isolate — and doing this would pre-empt its foreground
// announce. Marks only synced history (hash-based), so an unsynced
// receipt is still announced later.
unawaited(appWalletOf(context, listen: false).notifyNewIncomingTxs(announce: false));
- } else if (state == AppLifecycleState.resumed && _relockPending) {
- _relockPending = false;
- // Pushed ON TOP of the current stack rather than replacing it, so
- // unlocking pops straight back to the screen the user left. Skipped when
- // one is already showing, which would stack duplicates.
- if (_routeObserver.currentName != '/unlock') {
- _navigatorKey.currentState?.pushNamed('/unlock');
- }
+ } else if (_wasPaused) {
+ // The first step back (`hidden`, then `inactive`, then `resumed`):
+ // before a payment link that brought the app back gets a frame to land.
+ _wasPaused = false;
+ _onReturn();
}
}
- /// On background: with App Lock on and a wallet present, drop the in-memory
- /// password and arm a re-lock so the next resume returns to the lock screen.
- Future<void> _maybeArmRelock() async {
- _relockPending = await armAppLockRelock(context);
+ void _onReturn() {
+ // Both decided at once, before anything is awaited; App Lock's locks the
+ // session ([AppSession]) as it decides.
+ final appLockDue = _appLock.takeDueOnReturn();
+ // Past "Fully lock after" (or locked by its timer while away): the lock
+ // screens replace the stack *before* the wallets close, which takes a
+ // while, so the screen being left is never usable with the password still
+ // in memory. App Lock comes first when its time is up too.
+ if (_fullLock.takeDueOnResume()) {
+ // App Lock first when it was showing too (its cover, or its screen):
+ // the way in still starts with the device's own check.
+ final appLockShowing = _cover.value || _routeObserver.currentName == '/unlock';
+ _replaceStack(appLockDue || appLockShowing ? '/unlock' : '/security_key_unlock');
+ unawaited(_fullLock.lock(context));
+ return;
+ }
+
+ if (appLockDue) {
+ // Over the current stack rather than replacing it, so unlocking returns
+ // straight to the screen the user left; not again over a lock screen.
+ if (_routeObserver.currentName != '/unlock') _showCover();
+ unawaited(_appLock.lock(context));
+ }
+ }
+
+ /// A desktop OS. App Lock covers the app after its time without use, or as
+ /// the window is hidden for "Immediately" (macOS reports `hidden` when no
+ /// window is visible: hidden, minimised, covered, or the screen locked).
+ /// Both "without use" clocks are checked as the app comes back, since their
+ /// timers can stall while the computer sleeps.
+ void _onDesktopLifecycle(AppLifecycleState state) {
+ if (state == AppLifecycleState.hidden) {
+ unawaited(_coverDesktopIfImmediate());
+ } else if (state == AppLifecycleState.resumed) {
+ unawaited(_onDesktopResumed());
+ }
+ }
+
+ Future<void> _coverDesktopIfImmediate() async {
+ if (await AppLockPreferences.minutes() == 0) await _coverDesktop();
+ }
+
+ Future<void> _onDesktopResumed() async {
+ // The full close first: it may replace the stack with the unlock screen,
+ // and then there is nothing left to cover.
+ await _desktopLock.check();
+ await _desktopAppLock.check();
+ }
+
+ /// App Lock on a desktop OS: the unlock screen goes over whatever is open,
+ /// and the wallet stays open and syncing behind it. Linux and Windows ask
+ /// for the password again; macOS asks for Touch ID or the Mac's password,
+ /// and drops the keychain password meanwhile ([lockAppLock]).
+ Future<void> _coverDesktop() async {
+ // Already at a lock screen, or onboarding with no wallet yet.
+ if (!mounted || !AppSession.isUnlocked) return;
+ // A Mac with no way to confirm its owner has nothing to ask.
+ if (usesDeviceLock && !await BiometricAuth.isAvailable()) return;
+ if (!mounted || !AppSession.isUnlocked) return;
+ AppSession.lock();
+ if (_routeObserver.currentName != '/unlock') _showCover();
+ await lockAppLock(context);
+ }
+
+ /// "Lock after" ran out on a desktop OS. The unlock screen replaces the stack
+ /// first, then the wallet closes and its password is forgotten.
+ Future<void> _lockDesktop() async {
+ if (!mounted || !await desktopAutoLockApplies(context)) return;
+ if (!mounted) return;
+ // App Lock first (the typed password on Linux and Windows); a key follows
+ // when keys are on.
+ _replaceStack('/unlock');
+ await _desktopLock.lock(context);
+ }
+
+ // Use, for both "without use" clocks: any key or pointer input reaching the
+ // app.
+ bool _onKey(KeyEvent event) {
+ _recordUse();
+ return false;
+ }
+
+ void _onPointer(PointerEvent event) => _recordUse();
+
+ void _recordUse() {
+ _desktopLock.recordUse();
+ _desktopAppLock.recordUse();
}
// Desktop has no background isolate to announce incoming txs, so the
@@ -355,19 +508,12 @@ class _AppRootState extends State<_AppRoot> with WidgetsBindingObserver {
final theme = sharedPreferences.getString(SharedPreferencesKeys.theme) ?? 'system';
- final appLockEnabled =
- sharedPreferences.getBool(SharedPreferencesKeys.appLockEnabled) ?? false;
-
- // A desktop OS asks for the typed password at every launch.
- final initialRoute = walletExists
- ? appLockEnabled || isDesktopOS
- ? '/unlock'
- : '/wallet_home'
- : '/welcome';
+ // App Lock at every launch (always on; the typed password on
+ // Linux and Windows). With security keys on, a key comes next.
+ final initialRoute = walletExists ? '/unlock' : '/welcome';
if (!_startedServices) {
_startedServices = true;
- _walletExists = walletExists;
// Only the built-in Tor is ours to start; external/disabled must
// not spin up an embedded Tor, whose status would then misreport
// the external proxy.
@@ -398,7 +544,11 @@ class _AppRootState extends State<_AppRoot> with WidgetsBindingObserver {
navigatorKey: _navigatorKey,
navigatorObservers: [_routeObserver],
title: 'Skylight Monero Wallet',
- localizationsDelegates: AppLocalizations.localizationsDelegates,
+ localizationsDelegates: const [
+ ...AppLocalizations.localizationsDelegates,
+ FhseLocalizations.delegate,
+ BackupLocalizations.delegate,
+ ],
supportedLocales: AppLocalizations.supportedLocales,
theme: brandLightTheme(),
darkTheme: brandDarkTheme(),
@@ -421,22 +571,34 @@ class _AppRootState extends State<_AppRoot> with WidgetsBindingObserver {
_lastBrightness = brightness;
// Brand-tone skeletons (the default grey clashes with the
// navy/orange scheme); tokens resolve to the current theme.
- return SkeletonizerConfig(
- data: SkeletonizerConfigData(
- effect: SoldColorEffect(color: BrandColors.surfaceMuted),
+ final app = AppLockCover(
+ shown: _cover,
+ cover: (_) => UnlockScreen(onUnlocked: _hideCover, onKeyNeeded: _coverNeedsKey),
+ child: SkeletonizerConfig(
+ data: SkeletonizerConfigData(
+ effect: SoldColorEffect(color: BrandColors.surfaceMuted),
+ ),
+ child: child ?? const SizedBox.shrink(),
),
- child: child ?? const SizedBox.shrink(),
+ );
+ if (!isDesktopOS) return app;
+ // Pointer input anywhere counts as use for "Lock after".
+ return Listener(
+ behavior: HitTestBehavior.translucent,
+ onPointerDown: _onPointer,
+ onPointerHover: _onPointer,
+ onPointerMove: _onPointer,
+ onPointerSignal: _onPointer,
+ child: app,
);
},
initialRoute: initialRoute,
- // Always boot through the resolved initial route; a cold-start deep
- // link arrives here, so capture a payment link for replay past the
- // lock and never let it become the initial route (which would race
- // boot/unlock and skip the lock). The `route` extra is ignored.
- onGenerateInitialRoutes: (deepLink) {
- if (_isPaymentUri(deepLink)) _pendingPaymentUri = deepLink;
- return [_onGenerateRoute(RouteSettings(name: initialRoute))!];
- },
+ // Always boot through the resolved initial route. Whatever the
+ // platform offers as a deep link is ignored: payment links
+ // arrive over PaymentLinkChannel, and nothing else is taken.
+ onGenerateInitialRoutes: (_) => [
+ _onGenerateRoute(RouteSettings(name: initialRoute))!,
+ ],
locale: Locale.fromSubtags(languageCode: languageProvider.language),
onGenerateRoute: _onGenerateRoute,
);
@@ -484,15 +646,36 @@ class _CurrentRouteObserver extends NavigatorObserver {
String? get currentName => current.value;
+ /// The top route itself.
+ Route<dynamic>? top;
+
@override
- void didPush(Route<dynamic> route, Route<dynamic>? previousRoute) =>
- current.value = route.settings.name;
+ void didPush(Route<dynamic> route, Route<dynamic>? previousRoute) {
+ top = route;
+ current.value = route.settings.name;
+ }
@override
- void didPop(Route<dynamic> route, Route<dynamic>? previousRoute) =>
- current.value = previousRoute?.settings.name;
+ void didPop(Route<dynamic> route, Route<dynamic>? previousRoute) {
+ top = previousRoute;
+ current.value = previousRoute?.settings.name;
+ }
@override
- void didReplace({Route<dynamic>? newRoute, Route<dynamic>? oldRoute}) =>
- current.value = newRoute?.settings.name;
+ void didReplace({Route<dynamic>? newRoute, Route<dynamic>? oldRoute}) {
+ top = newRoute;
+ current.value = newRoute?.settings.name;
+ }
+
+ /// A route taken out from under the top (a refused one removes itself).
+ @override
+ void didRemove(Route<dynamic> route, Route<dynamic>? previousRoute) {
+ if (!identical(route, top)) return;
+ top = previousRoute;
+ current.value = previousRoute?.settings.name;
+ }
}
+
+/// Every route name the app defines, for test/route_policy_test.dart.
+@visibleForTesting
+Iterable<String> get appRouteNames => _AppRootState._routes.keys;
### lib/models/monero_wallet_adapter.dart
@@ -266,8 +266,9 @@ class MoneroWalletAdapter extends ChangeNotifier implements AppWallet {
@override
Future<ResolvedOpenAlias?> resolveOpenAlias(String alias) async {
- // resolveAlias throws when Tor is down or the input is a raw address;
- // skylight's send flow expects null on any failure.
+ // resolveAlias follows the OpenAlias setting (over Tor, directly, or not
+ // at all) and throws when that lookup cannot happen or the input is a raw
+ // address; skylight's send flow expects null on any failure.
try {
final resolved = await _wallet.resolveAlias(alias);
if (resolved == null) return null;
### lib/route_policy.dart
@@ -0,0 +1,39 @@
+import 'package:wallet_ui/wallet_ui.dart' show RouteAccess, RoutePolicy;
+
+/// Who may open each of Skylight's routes. Deny by default: `onGenerateRoute`
+/// refuses a route that is not listed here, and one marked
+/// [RouteAccess.unlocked] until the user is past every lock (App Lock, the
+/// typed password, security keys). `test/route_policy_test.dart` fails if a
+/// route is missing.
+const routePolicy = RoutePolicy({
+ // Onboarding, before a wallet exists.
+ '/welcome': RouteAccess.public,
+ '/tor_settings': RouteAccess.public,
+ '/fiat_api_setup': RouteAccess.public,
+ '/connection_setup': RouteAccess.public,
+ '/create_wallet': RouteAccess.public,
+ '/create_wallet_password': RouteAccess.public,
+ '/generate_seed': RouteAccess.public,
+ '/restore_wallet': RouteAccess.public,
+ // Restore scans a seed's QR code; Send and the address book use it too.
+ '/scan_qr': RouteAccess.public,
+ // The locks themselves.
+ '/unlock': RouteAccess.public,
+ '/security_key_unlock': RouteAccess.public,
+ // Legal pages, linked from onboarding.
+ '/terms_of_service': RouteAccess.public,
+ '/privacy_policy': RouteAccess.public,
+ // The wallet.
+ '/wallet_home': RouteAccess.unlocked,
+ '/send': RouteAccess.unlocked,
+ '/receive': RouteAccess.unlocked,
+ '/address_book': RouteAccess.unlocked,
+ '/history': RouteAccess.unlocked,
+ '/settings': RouteAccess.unlocked,
+ '/lws_details': RouteAccess.unlocked,
+ '/lws_keys': RouteAccess.unlocked,
+ '/secret_keys': RouteAccess.unlocked,
+ '/advanced_security': RouteAccess.unlocked,
+ '/metadata_backup': RouteAccess.unlocked,
+ '/verify_seed': RouteAccess.unlocked,
+});
### lib/screens/address_book.dart
@@ -177,7 +177,7 @@ class _AddressBookScreenState extends State<AddressBookScreen> {
return Scaffold(
backgroundColor: BrandColors.paper,
- bottomNavigationBar: const WalletNavigationBar(selectedIndex: 1),
+ bottomNavigationBar: const WalletNavigationBar(selectedIndex: 2),
body: SafeArea(
bottom: false,
child: Center(
@@ -631,7 +631,12 @@ class _ContactSheetState extends State<_ContactSheet> {
if (widget.contact == null) {
await model.addContact(name, {'XMR': address});
} else {
- await model.updateContact(widget.contact!.id, name, {'XMR': address});
+ // Keep the addresses Skylight does not show (a contact shared with
+ // Spice through the backup can hold BTC or ETH ones too).
+ await model.updateContact(widget.contact!.id, name, {
+ ...widget.contact!.addresses,
+ 'XMR': address,
+ });
}
if (mounted) Navigator.pop(context);
} catch (_) {
### lib/screens/desktop/home_shell.dart
@@ -6,9 +6,8 @@ import 'package:skylight_wallet/l10n/app_localizations.dart';
import 'package:skylight_wallet/screens/settings.dart';
import 'package:skylight_wallet/widgets/ui/ui.dart';
-/// The top-level desktop destinations, mirroring the mobile navigation bar
-/// (Skylight has no separate History screen).
-enum DesktopNav { home, addressBook, settings }
+/// The top-level desktop destinations, mirroring the mobile navigation bar.
+enum DesktopNav { home, history, addressBook, settings }
/// Shared style for a desktop screen's large title (Settings, Contacts, …).
TextStyle get desktopTitleStyle => TextStyle(
@@ -182,6 +181,8 @@ class _DesktopShellState extends State<DesktopShell> {
'/wallet_home',
),
const SizedBox(height: 2),
+ _navItem(DesktopNav.history, Icons.history, i18n.navigationBarHistory, '/history'),
+ const SizedBox(height: 2),
_navItem(
DesktopNav.addressBook,
Icons.people_outline,
### lib/screens/generate_seed.dart
@@ -36,14 +36,14 @@ class _GenerateSeedScreenState extends State<GenerateSeedScreen> with SecureScre
_seed = generated.seed.mnemonic.split(' ');
}
- /// A desktop OS adds a password step (password-last flow). Mobile has no
- /// password screen — it's guarded by the device app lock — so it commits the
- /// wallet directly from here. That includes the iOS build on a Mac, which
- /// shows the desktop layout but keeps the mobile wallet password.
+ /// Linux and Windows add a password step (password-last flow). Elsewhere there
+ /// is no password screen — a generated password is guarded by the device's
+ /// App Lock — so it commits the wallet directly from here. That includes
+ /// macOS and the iOS build on a Mac, which show the desktop layout.
void _continue() {
final generated = _generated;
if (generated == null) return;
- if (isDesktopOS) {
+ if (typesWalletPassword) {
Navigator.pushNamed(
context,
'/create_wallet_password',
@@ -111,7 +111,7 @@ class _GenerateSeedScreenState extends State<GenerateSeedScreen> with SecureScre
).format(_generated!.restoreDate)
: null,
confirmLabel: i18n.generateSeedConfirm,
- passwordNote: isDesktopOS ? i18n.onboardingSeedNotePassword : null,
+ passwordNote: typesWalletPassword ? i18n.onboardingSeedNotePassword : null,
revealLabel: i18n.generateSeedReveal,
continueText: i18n.continueText,
loading: _committing,
### lib/screens/history.dart
@@ -0,0 +1,771 @@
+import 'dart:convert';
+import 'dart:io';
+
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+import 'package:provider/provider.dart';
+
+import 'package:skylight_wallet/consts.dart' as consts;
+import 'package:skylight_wallet/l10n/app_localizations.dart';
+import 'package:skylight_wallet/models/fiat_rate_model.dart';
+import 'package:skylight_wallet/screens/desktop/home_shell.dart';
+import 'package:skylight_wallet/util/platform.dart';
+import 'package:skylight_wallet/wallet_core_glue.dart';
+import 'package:skylight_wallet/widgets/ui/ui.dart';
+import 'package:skylight_wallet/widgets/wallet_navigation_bar.dart';
+import 'package:wallet_domain/wallet_domain.dart' show CryptoWallet, TxDetails;
+import 'package:wallet_infra/wallet_infra.dart' show LogLevel, exportFileName, log, saveExportFile;
+
+/// The wallet's transactions, filterable by direction and by address, and
+/// exportable as CSV (the filtered ones, or all of them with no filter). A
+/// top-level destination in the navigation bar, as in Spice; Skylight holds
+/// only Monero, so Spice's blockchain and asset filters have no place here.
+class HistoryScreen extends StatefulWidget {
+ const HistoryScreen({super.key});
+
+ @override
+ State<HistoryScreen> createState() => _HistoryScreenState();
+}
+
+enum _Filter { type, address }
+
+/// Whether [tx] involves [address]: received at it, or sent to it.
+///
+/// One list serves both directions: on an incoming transaction `recipients`
+/// holds the wallet's own addresses it was received at, and on an outgoing one
+/// who was paid. Change is included deliberately: a spend that returned change
+/// to the address did involve it. Monero addresses are compared exactly; base58
+/// is case-significant.
+@visibleForTesting
+bool txInvolvesAddress(TxDetails tx, String address) {
+ final wanted = address.trim();
+ return tx.recipients.any((r) => r.address.trim() == wanted);
+}
+
+class _HistoryScreenState extends State<HistoryScreen> {
+ // Unchecked (hidden) directions; empty = everything checked (the default).
+ final Set<int> _typesHidden = {};
+
+ /// The one address the address filter matches, or null for no filter.
+ String? _address;
+
+ /// The last paste or scan was not a Monero address. Cleared by the next
+ /// attempt or a reset.
+ bool _addressInvalid = false;
+
+ _Filter? _open;
+
+ void _toggleOpen(_Filter f) => setState(() => _open = _open == f ? null : f);
+
+ /// A bare address or a `monero:<address>?...` URI; null if neither.
+ String? _extractAddress(String raw, CryptoWallet wallet) {
+ final value = raw.trim();
+ if (value.isEmpty) return null;
+ final uri = Uri.tryParse(value);
+ if (uri != null && uri.scheme.toLowerCase() == 'monero') {
+ return wallet.isAddressValid(uri.path) ? uri.path : null;
+ }
+ return wallet.isAddressValid(value) ? value : null;
+ }
+
+ void _setAddress(String? raw, CryptoWallet wallet) {
+ final found = raw == null ? null : _extractAddress(raw, wallet);
+ setState(() {
+ if (found == null) {
+ _addressInvalid = true;
+ return;
+ }
+ _address = found;
+ _addressInvalid = false;
+ });
+ }
+
+ Future<void> _pasteAddress(CryptoWallet wallet) async {
+ final data = await Clipboard.getData(Clipboard.kTextPlain);
+ if (mounted) _setAddress(data?.text, wallet);
+ }
+
+ Future<void> _scanAddress(CryptoWallet wallet) async {
+ final result = await Navigator.pushNamed(context, '/scan_qr');
+ if (mounted && result is String) _setAddress(result, wallet);
+ }
+
+ void _clearAddress() => setState(() {
+ _address = null;
+ _addressInvalid = false;
+ });
+
+ /// Saves [txs], the transactions the filters let through, as CSV. [anchor]
+ /// is the button, for the iPad share popover.
+ Future<void> _export(CryptoWallet asset, List<TxDetails> txs, BuildContext anchor) async {
+ final i18n = AppLocalizations.of(context)!;
+ final box = anchor.findRenderObject() as RenderBox?;
+ final origin = box == null ? null : box.localToGlobal(Offset.zero) & box.size;
+ try {
+ final saved = await saveExportFile(
+ name: exportFileName('skylight-history', 'csv', DateTime.now()),
+ bytes: utf8.encode(txHistoryCsv([for (final tx in txs) (tx: tx, asset: asset)])),
+ typeLabel: 'CSV',
+ extension: 'csv',
+ mimeType: 'text/csv',
+ sharePositionOrigin: origin,
+ );
+ if (saved && mounted) showBrandToast(context, i18n.historyExported);
+ } catch (e) {
+ log(LogLevel.error, '[History] CSV export failed: $e');
+ if (mounted) showBrandToast(context, i18n.historyExportFailed);
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final i18n = AppLocalizations.of(context)!;
+ // Watched so the list follows new transactions; the rows read the engine
+ // wallet's exact amounts.
+ appWalletOf(context, listen: true);
+ final fiatRate = context.watch<FiatRateModel>();
+ final asset = xmrWallet(context);
+ // Content gutter: the desktop shell caps width and wants wider margins.
+ final gutter = isDesktop ? 44.0 : 20.0;
+
+ final all = asset?.txHistory ?? const <TxDetails>[];
+ final entries = all.where((tx) {
+ if (_typesHidden.contains(tx.direction)) return false;
+ final address = _address;
+ if (address != null && !txInvolvesAddress(tx, address)) return false;
+ return true;
+ }).toList();
+
+ int typeCount(int type) => all.where((tx) => tx.direction == type).length;
+ final typeOptions = [
+ _Option(
+ '${consts.txDirectionIncoming}',
+ i18n.coinHomeReceived,
+ _typeIcon(Icons.south, BrandColors.success, BrandColors.successBg),
+ typeCount(consts.txDirectionIncoming),
+ ),
+ _Option(
+ '${consts.txDirectionOutgoing}',
+ i18n.coinHomeSent,
+ _typeIcon(Icons.north, BrandColors.primary, BrandColors.surfaceAccent),
+ typeCount(consts.txDirectionOutgoing),
+ ),
+ ];
+ // The pill shows the number of checked options, but only once some are
+ // unchecked: all checked is the default and reads as "no filter".
+ final typesChecked = typeOptions.where((o) => !_typesHidden.contains(int.parse(o.value)));
+ final typeCountBadge = typesChecked.length == typeOptions.length ? null : typesChecked.length;
+
+ final list = entries.isEmpty || asset == null
+ ? Center(child: Text(i18n.homeNoTransactions, style: BrandText.bodyMuted))
+ : _Timeline(
+ entries: entries,
+ asset: asset,
+ i18n: i18n,
+ fiatRate: fiatRate,
+ gutter: gutter,
+ onTapTx: (tx) => showTxDetailsDialog(context, tx),
+ );
+
+ final canExport = asset != null && entries.isNotEmpty;
+ void export(BuildContext anchor) {
+ if (canExport) _export(asset, entries, anchor);
+ }
+
+ final filters = <Widget>[
+ SingleChildScrollView(
+ scrollDirection: Axis.horizontal,
+ padding: EdgeInsets.fromLTRB(gutter, 0, gutter, 12),
+ child: Row(
+ children: [
+ _FilterPill(
+ label: i18n.historyFilterType,
+ count: typeCountBadge,
+ open: _open == _Filter.type,
+ onTap: () => _toggleOpen(_Filter.type),
+ ),
+ const SizedBox(width: 7),
+ _FilterPill(
+ label: i18n.historyFilterAddress,
+ count: _address == null ? null : 1,
+ open: _open == _Filter.address,
+ onTap: () => _toggleOpen(_Filter.address),
+ ),
+ ],
+ ),
+ ),
+ if (_open == _Filter.type)
+ _FilterPanel(
+ header: i18n.historyFilterType,
+ options: typeOptions,
+ isSelected: (v) => !_typesHidden.contains(int.parse(v)),
+ gutter: gutter,
+ onToggle: (v) => setState(() => _typesHidden.toggle(int.parse(v))),
+ onReset: () => setState(_typesHidden.clear),
+ onDone: () => setState(() => _open = null),
+ ),
+ if (_open == _Filter.address && asset != null)
+ _AddressPanel(
+ address: _address,
+ iconAsset: asset.iconAsset,
+ invalid: _addressInvalid,
+ gutter: gutter,
+ onPaste: () => _pasteAddress(asset),
+ onScan: () => _scanAddress(asset),
+ onClear: _clearAddress,
+ onDone: () => setState(() => _open = null),
+ ),
+ Expanded(
+ child: _open == null
+ ? list
+ : GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () => setState(() => _open = null),
+ child: Opacity(opacity: 0.4, child: IgnorePointer(child: list)),
+ ),
+ ),
+ ];
+
+ if (isDesktop) {
+ return DesktopShell(
+ active: DesktopNav.history,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(44, 30, 44, 20),
+ child: Row(
+ children: [
+ Expanded(child: Text(i18n.historyTitle, style: desktopTitleStyle)),
+ Builder(
+ builder: (anchor) => BrandButton.secondary(
+ label: i18n.historyExportCsv,
+ icon: Icons.file_download_outlined,
+ expand: false,
+ onPressed: canExport ? () => export(anchor) : null,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ...filters,
+ ],
+ ),
+ );
+ }
+
+ return Scaffold(
+ backgroundColor: BrandColors.paper,
+ bottomNavigationBar: const WalletNavigationBar(selectedIndex: 1),
+ body: SafeArea(
+ bottom: false,
+ child: Center(
+ child: ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: 520),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
+ child: BrandScreenHeader(
+ center: Text(i18n.historyTitle, style: BrandText.appBar.copyWith(fontSize: 16)),
+ action: Tooltip(
+ message: i18n.historyExportCsv,
+ child: Opacity(
+ opacity: canExport ? 1 : 0.4,
+ child: Builder(
+ builder: (anchor) => IconCircleButton(
+ icon: Icons.file_download_outlined,
+ onPressed: canExport ? () => export(anchor) : null,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ const SizedBox(height: 8),
+ ...filters,
+ ],
+ ),
+ ),
+ ),
+ ),
+ );
+ }
+
+ Widget _typeIcon(IconData icon, Color fg, Color bg) {
+ return Container(
+ width: 24,
+ height: 24,
+ alignment: Alignment.center,
+ decoration: BoxDecoration(color: bg, borderRadius: BorderRadius.circular(8)),
+ child: Icon(icon, size: 13, color: fg),
+ );
+ }
+}
+
+extension _ToggleSet<T> on Set<T> {
+ void toggle(T value) => contains(value) ? remove(value) : add(value);
+}
+
+/// A filter option: its stored value, display name, leading icon, and how many
+/// transactions match it overall.
+class _Option {
+ final String value;
+ final String label;
+ final Widget icon;
+ final int count;
+ const _Option(this.value, this.label, this.icon, this.count);
+}
+
+class _Timeline extends StatelessWidget {
+ final List<TxDetails> entries;
+ final CryptoWallet asset;
+ final AppLocalizations i18n;
+ final FiatRateModel fiatRate;
+ final double gutter;
+ final void Function(TxDetails tx) onTapTx;
+
+ const _Timeline({
+ required this.entries,
+ required this.asset,
+ required this.i18n,
+ required this.fiatRate,
+ required this.gutter,
+ required this.onTapTx,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ final rows = withDayHeaders(entries, (tx) => tx.timestamp);
+
+ return ListView.builder(
+ padding: EdgeInsets.fromLTRB(gutter, 0, gutter, 24),
+ itemCount: rows.length,
+ itemBuilder: (context, index) {
+ final row = rows[index];
+ if (row is String) {
+ return Padding(
+ padding: EdgeInsets.only(top: index == 0 ? 0 : 18, bottom: 4),
+ child: SectionHeader(label: row, padding: EdgeInsets.zero),
+ );
+ }
+ final tx = row as TxDetails;
+ final next = index + 1 < rows.length ? rows[index + 1] : null;
+ // No coin icon, as on the home screen: Skylight is single-coin.
+ return TxActivityRow(
+ tx: tx,
+ asset: asset,
+ showCoinIcon: false,
+ labels: TxActivityLabels(received: i18n.coinHomeReceived, sent: i18n.coinHomeSent),
+ fiatRate: fiatRate,
+ showDivider: next is TxDetails,
+ onTap: () => onTapTx(tx),
+ );
+ },
+ );
+ }
+}
+
+/// The address filter's panel: one Monero address, set by paste or scan.
+///
+/// Same chrome as [_FilterPanel] (card, shadow, sunken footer) over the
+/// address book's entry row, so setting an address here looks like setting
+/// one on a contact.
+class _AddressPanel extends StatelessWidget {
+ final String? address;
+ final String iconAsset;
+ final bool invalid;
+ final double gutter;
+ final VoidCallback onPaste;
+ final VoidCallback onScan;
+ final VoidCallback onClear;
+ final VoidCallback onDone;
+
+ const _AddressPanel({
+ required this.address,
+ required this.iconAsset,
+ required this.invalid,
+ required this.gutter,
+ required this.onPaste,
+ required this.onScan,
+ required this.onClear,
+ required this.onDone,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ final i18n = AppLocalizations.of(context)!;
+ return Padding(
+ padding: EdgeInsets.fromLTRB(gutter, 0, gutter, 12),
+ child: Container(
+ clipBehavior: Clip.antiAlias,
+ decoration: _panelDecoration,
+ foregroundDecoration: _panelBorder,
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(16, 14, 16, 4),
+ child: SectionHeader(label: i18n.historyFilterAddress, padding: EdgeInsets.zero),
+ ),
+ Padding(
+ padding: const EdgeInsets.fromLTRB(16, 2, 16, 0),
+ child: Text(i18n.historyFilterAddressHint, style: BrandText.caption),
+ ),
+ Padding(
+ padding: const EdgeInsets.fromLTRB(16, 10, 16, 14),
+ child: address == null ? _empty(i18n) : _filled(),
+ ),
+ _PanelFooter(onReset: onClear, onDone: onDone),
+ ],
+ ),
+ ),
+ );
+ }
+
+ Widget _empty(AppLocalizations i18n) => Container(
+ decoration: BoxDecoration(
+ color: BrandColors.surfaceSunken,
+ border: Border.all(color: invalid ? BrandColors.error : BrandColors.border),
+ borderRadius: BorderRadius.circular(14),
+ ),
+ padding: const EdgeInsets.symmetric(horizontal: 13, vertical: 11),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ children: [
+ Container(
+ width: 30,
+ height: 30,
+ alignment: Alignment.center,
+ decoration: BoxDecoration(color: BrandColors.surfaceTinted, shape: BoxShape.circle),
+ child: Icon(
+ Icons.account_balance_wallet_outlined,
+ size: 15,
+ color: BrandColors.inkFaint,
+ ),
+ ),
+ const SizedBox(width: 11),
+ Expanded(
+ child: Text(
+ i18n.historyFilterAddressAny,
+ style: TextStyle(
+ fontSize: 12.5,
+ fontWeight: FontWeight.w500,
+ color: BrandColors.inkFaint,
+ ),
+ ),
+ ),
+ MiniActionButton(
+ bordered: true,
+ icon: Icons.content_paste_outlined,
+ label: i18n.sendPasteButton,
+ onTap: onPaste,
+ ),
+ if (Platform.isAndroid || Platform.isIOS) ...[
+ const SizedBox(width: 7),
+ MiniActionButton(
+ bordered: true,
+ icon: Icons.qr_code_scanner,
+ label: i18n.sendScanButton,
+ onTap: onScan,
+ ),
+ ],
+ ],
+ ),
+ if (invalid) ...[
+ const SizedBox(height: 8),
+ Text(
+ i18n.historyFilterAddressInvalid,
+ style: BrandText.caption.copyWith(color: BrandColors.error),
+ ),
+ ],
+ ],
+ ),
+ );
+
+ Widget _filled() => BrandCard(
+ radius: 14,
+ padding: const EdgeInsets.symmetric(horizontal: 13, vertical: 11),
+ child: Row(
+ children: [
+ CoinMark(coinSymbol: 'XMR', iconAsset: iconAsset, size: 30),
+ const SizedBox(width: 11),
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ 'Monero',
+ style: TextStyle(
+ fontSize: 12.5,
+ fontWeight: FontWeight.w500,
+ color: BrandColors.ink,
+ ),
+ ),
+ const SizedBox(height: 3),
+ Text(
+ shortenMiddle(address!, head: 9, tail: 9),
+ style: TextStyle(
+ fontFamily: 'Ubuntu Mono',
+ fontSize: 11,
+ color: BrandColors.inkMuted,
+ ),
+ ),
+ ],
+ ),
+ ),
+ Tappable(
+ behavior: HitTestBehavior.opaque,
+ onTap: onClear,
+ child: Container(
+ width: 26,
+ height: 26,
+ alignment: Alignment.center,
+ decoration: BoxDecoration(color: BrandColors.surfaceTinted, shape: BoxShape.circle),
+ child: Icon(Icons.close, size: 13, color: BrandColors.inkMuted),
+ ),
+ ),
+ ],
+ ),
+ );
+}
+
+/// A filter panel's card: shadowed, with its border in the foreground so the
+/// footer's fill cannot overpaint it (a background border is drawn behind the
+/// children, dimming the bottom corners). Getters: the colours follow the
+/// theme.
+BoxDecoration get _panelDecoration => BoxDecoration(
+ color: BrandColors.card,
+ borderRadius: BorderRadius.circular(18),
+ boxShadow: const [
+ BoxShadow(color: Color(0x242C170C), blurRadius: 28, offset: Offset(0, 8)),
+ BoxShadow(color: Color(0x0F2C170C), blurRadius: 2, offset: Offset(0, 1)),
+ ],
+);
+
+BoxDecoration get _panelBorder => BoxDecoration(
+ borderRadius: BorderRadius.circular(18),
+ border: Border.all(color: BrandColors.borderStrong),
+);
+
+/// A filter panel's Reset / Done footer.
+class _PanelFooter extends StatelessWidget {
+ final VoidCallback onReset;
+ final VoidCallback onDone;
+
+ const _PanelFooter({required this.onReset, required this.onDone});
+
+ @override
+ Widget build(BuildContext context) {
+ final i18n = AppLocalizations.of(context)!;
+ return Container(
+ decoration: BoxDecoration(
+ color: BrandColors.surfaceSunken,
+ border: Border(top: BorderSide(color: BrandColors.surfaceTinted)),
+ ),
+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Tappable(
+ behavior: HitTestBehavior.opaque,
+ onTap: onReset,
+ child: Padding(
+ padding: const EdgeInsets.symmetric(vertical: 5),
+ child: Text(
+ i18n.historyFilterReset,
+ style: TextStyle(fontSize: 13, color: BrandColors.primary),
+ ),
+ ),
+ ),
+ BrandButton(label: i18n.done, onPressed: onDone, expand: false, dense: true),
+ ],
+ ),
+ );
+ }
+}
+
+/// A rounded filter chip: category name, a count badge and an up/down chevron.
+/// Goes dark (the design's ink pill) once it is open or has a selection.
+class _FilterPill extends StatelessWidget {
+ final String label;
+ final int? count; // null = every option checked (the default): no badge.
+ final bool open;
+ final VoidCallback onTap;
+
+ const _FilterPill({
+ required this.label,
+ required this.count,
+ required this.open,
+ required this.onTap,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ final active = open || count != null;
+ final fg = active ? BrandColors.onPrimary : BrandColors.ink;
+ return Tappable(
+ behavior: HitTestBehavior.opaque,
+ onTap: onTap,
+ child: Container(
+ padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12),
+ decoration: BoxDecoration(
+ color: active ? BrandColors.inverseSurface : BrandColors.card,
+ borderRadius: BorderRadius.circular(100),
+ border: Border.all(color: active ? BrandColors.inverseSurface : BrandColors.borderStrong),
+ ),
+ child: Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Text(label, style: TextStyle(fontSize: 12.5, color: fg)),
+ if (count != null) ...[
+ const SizedBox(width: 7),
+ Container(
+ padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 2.5),
+ decoration: BoxDecoration(
+ color: BrandColors.onPrimary.withValues(alpha: 0.22),
+ borderRadius: BorderRadius.circular(20),
+ ),
+ child: Text(
+ '$count',
+ style: TextStyle(
+ fontFamily: 'Ubuntu Mono',
+ fontSize: 10,
+ fontWeight: FontWeight.w700,
+ color: fg,
+ ),
+ ),
+ ),
+ ],
+ const SizedBox(width: 7),
+ Icon(
+ open ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
+ size: 15,
+ color: active ? fg : BrandColors.inkMuted,
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}
+
+/// The inline multi-select dropdown for one filter: a card of checkbox rows
+/// (icon, name, count) with a Reset / Done footer.
+class _FilterPanel extends StatelessWidget {
+ final String header;
+ final List<_Option> options;
+ final bool Function(String value) isSelected;
+ final double gutter;
+ final ValueChanged<String> onToggle;
+ final VoidCallback onReset;
+ final VoidCallback onDone;
+
+ const _FilterPanel({
+ required this.header,
+ required this.options,
+ required this.isSelected,
+ required this.gutter,
+ required this.onToggle,
+ required this.onReset,
+ required this.onDone,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ return Padding(
+ padding: EdgeInsets.fromLTRB(gutter, 0, gutter, 12),
+ child: Container(
+ clipBehavior: Clip.antiAlias,
+ decoration: _panelDecoration,
+ foregroundDecoration: _panelBorder,
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(16, 14, 16, 4),
+ child: SectionHeader(label: header, padding: EdgeInsets.zero),
+ ),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Column(
+ children: [
+ for (var i = 0; i < options.length; i++)
+ _row(options[i], last: i == options.length - 1),
+ ],
+ ),
+ ),
+ _PanelFooter(onReset: onReset, onDone: onDone),
+ ],
+ ),
+ ),
+ );
+ }
+
+ Widget _row(_Option opt, {required bool last}) {
+ final selected = isSelected(opt.value);
+ return Tappable(
+ behavior: HitTestBehavior.opaque,
+ onTap: () => onToggle(opt.value),
+ child: Container(
+ decoration: last
+ ? null
+ : BoxDecoration(
+ border: Border(bottom: BorderSide(color: BrandColors.surfaceTinted)),
+ ),
+ padding: const EdgeInsets.symmetric(vertical: 10),
+ child: Row(
+ children: [
+ _Check(selected: selected),
+ const SizedBox(width: 12),
+ opt.icon,
+ const SizedBox(width: 12),
+ Expanded(
+ child: Text(
+ opt.label,
+ style: TextStyle(
+ fontSize: 14,
+ color: selected ? BrandColors.ink : BrandColors.inkMuted,
+ ),
+ ),
+ ),
+ Text(
+ '${opt.count}',
+ style: TextStyle(
+ fontFamily: 'Ubuntu Mono',
+ fontSize: 12,
+ color: BrandColors.inkMuted,
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}
+
+/// The 20×20 rounded checkbox: a filled tick when on.
+class _Check extends StatelessWidget {
+ final bool selected;
+ const _Check({required this.selected});
+
+ @override
+ Widget build(BuildContext context) {
+ return Container(
+ width: 20,
+ height: 20,
+ alignment: Alignment.center,
+ decoration: BoxDecoration(
+ color: selected ? BrandColors.primaryDeep : null,
+ borderRadius: BorderRadius.circular(6),
+ border: selected ? null : Border.all(color: BrandColors.inputBorder, width: 1.5),
+ ),
+ child: selected ? const Icon(Icons.check, size: 13, color: BrandColors.onPrimary) : null,
+ );
+ }
+}
### lib/screens/restore_wallet.dart
@@ -18,6 +18,7 @@ import 'package:skylight_wallet/util/secure_screen.dart';
import 'package:skylight_wallet/wallet_core_glue.dart';
import 'package:skylight_wallet/widgets/ui/ui.dart';
import 'package:wallet_domain/wallet_domain.dart' show SeedSource, parseRestoreQr;
+import 'package:wallet_backup_platform/backup_ui.dart' show scheduleImportWalletData;
class RestoreWalletScreen extends StatefulWidget {
const RestoreWalletScreen({super.key});
@@ -125,16 +126,18 @@ class _RestoreWalletScreenState extends State<RestoreWalletScreen> with SecureSc
}
final restoreHeight = _restoreHeight;
- // A desktop OS adds a password step; mobile has no password screen (the
- // device app lock guards it), so it restores the wallet directly. That
- // includes the iOS build on a Mac, in the desktop layout.
- if (isDesktopOS) {
+ // Linux and Windows add a password step; elsewhere there is no password
+ // screen (the device's App Lock guards a generated one), so it restores the
+ // wallet directly. That includes macOS and the iOS build on a Mac, in the
+ // desktop layout.
+ if (typesWalletPassword) {
Navigator.pushNamed(
context,
'/create_wallet_password',
arguments: CreateWalletPasswordArgs(
commit: (ctx) async {
await restoreWallet(ctx, mnemonic: mnemonic, restoreHeight: restoreHeight);
+ if (ctx.mounted) scheduleImportWalletData(ctx);
return restoreHeight;
},
),
@@ -168,6 +171,8 @@ class _RestoreWalletScreenState extends State<RestoreWalletScreen> with SecureSc
}
if (!mounted) return;
setState(() => _committing = false);
+ // Asks whether to import wallet data (payment details, address book).
+ scheduleImportWalletData(context);
Provider.of<FiatRateModel>(context, listen: false).startService();
if (appWalletOf(context).isNodeMode) {
Navigator.pushNamedAndRemoveUntil(context, '/wallet_home', (route) => false);
### lib/screens/send.dart
@@ -10,7 +10,8 @@ import 'package:wallet_domain/wallet_domain.dart'
decimalToBaseUnits,
parsePaymentUri,
BroadcastFailure,
- BroadcastOutcome;
+ BroadcastOutcome,
+ OpenAliasMode;
import 'package:wallet_infra/wallet_infra.dart' show RequestNotSentException;
import 'package:wallet_infra/wallet_infra.dart' show StoreReview;
@@ -87,6 +88,9 @@ class _SendScreenState extends State<SendScreen> {
bool _formValid = false; // gates the send button
int _openAliasResolving = 0; // >0 while OpenAlias resolution is in flight
+ // The user turned OpenAlias lookups off (Settings), so say that rather than
+ // "invalid".
+ bool _openAliasOff = false;
bool _didInit = false; // one-time setup guard for didChangeDependencies
// Caches the last OpenAlias resolution + dedupes concurrent lookups so
@@ -254,6 +258,8 @@ class _SendScreenState extends State<SendScreen> {
/// in-flight lookup of the same domain so amount changes / revalidations
/// don't re-hit the (slow, over-Tor) resolver. Drives `_openAliasResolving`.
Future<ResolvedOpenAlias?> _resolveDomain(String domain) async {
+ _openAliasOff = await OpenAliasMode.load() == OpenAliasMode.disabled;
+ if (_openAliasOff || !mounted) return null;
if (domain == _resolveCacheInput) return _resolveCacheOutput;
if (_resolveInFlight != null && domain == _resolveInFlightInput) {
return _resolveInFlight!;
@@ -317,7 +323,9 @@ class _SendScreenState extends State<SendScreen> {
if (resolved == null) {
if (setErrors) {
setState(() {
- _destinationAddressError = i18n.sendOpenAliasResolveError;
+ _destinationAddressError = _openAliasOff
+ ? i18n.sendOpenAliasDisabledError
+ : i18n.sendOpenAliasResolveError;
});
}
return false;
@@ -453,7 +461,9 @@ class _SendScreenState extends State<SendScreen> {
if (resolved == null) {
setState(() {
_isLoading = false;
- _destinationAddressError = i18n.sendOpenAliasResolveError;
+ _destinationAddressError = _openAliasOff
+ ? i18n.sendOpenAliasDisabledError
+ : i18n.sendOpenAliasResolveError;
});
return;
}
### lib/screens/settings.dart
@@ -8,20 +8,24 @@ import 'package:skylight_wallet/l10n/app_localizations.dart';
import 'package:skylight_wallet/models/app_wallet.dart';
import 'package:skylight_wallet/models/fiat_rate_model.dart';
import 'package:skylight_wallet/widgets/connection_settings_form.dart';
-import 'package:skylight_wallet/widgets/fiat_api_settings_form.dart';
-import 'package:skylight_wallet/widgets/tor_settings_form.dart';
import 'package:skylight_wallet/models/language_model.dart';
import 'package:skylight_wallet/models/theme_model.dart';
import 'package:skylight_wallet/screens/lws_keys.dart';
import 'package:skylight_wallet/screens/secret_keys.dart';
import 'package:skylight_wallet/util/logging.dart';
import 'package:skylight_wallet/util/platform.dart';
import 'package:skylight_wallet/wallet_core_glue.dart';
+import 'package:wallet_backup_platform/backup_ui.dart' show BackupLocalizations;
+import 'package:wallet_fhse/security_keys_ui.dart'
+ show AppLockTile, DesktopAutoLockTile, FhseLocalizations, SecurityKeysState, securityKeysState;
+import 'package:wallet_domain/wallet_domain.dart' show OpenAliasMode;
+import 'package:wallet_fhse/wallet_fhse.dart' show SecurityKeyService;
import 'package:skylight_wallet/periodic_tasks.dart';
import 'package:skylight_wallet/services/notifications_service.dart';
import 'package:skylight_wallet/services/shared_preferences_service.dart';
import 'package:skylight_wallet/services/tor_settings_service.dart';
import 'package:skylight_wallet/widgets/language_sheet.dart';
+import 'package:skylight_wallet/widgets/privacy_settings_sheets.dart';
import 'package:skylight_wallet/widgets/ui/ui.dart';
import 'package:skylight_wallet/widgets/wallet_navigation_bar.dart';
import 'package:wallet_infra/wallet_infra.dart' show BiometricAuth, BiometricAuthResult;
@@ -52,9 +56,10 @@ class SettingsScreen extends StatefulWidget {
class _SettingsScreenState extends State<SettingsScreen> {
var _newTxNotificationsEnabled = false;
- var _appLockEnabled = false;
- var _verboseLoggingEnabled = false;
+ var _loggingEnabled = false;
+ SecurityKeysState? _securityKeys;
FiatApiMode _fiatMode = FiatApiMode.torOnly;
+ OpenAliasMode _openAliasMode = OpenAliasMode.torOnly;
// Toggles animate only after the stored values have loaded, so they don't
// slide from off→on when the screen first appears.
var _animateToggles = false;
@@ -82,21 +87,19 @@ class _SettingsScreenState extends State<SettingsScreen> {
await SharedPreferencesService.get<bool>(SharedPreferencesKeys.notificationsEnabled) ??
false;
- final appLockEnabled =
- await SharedPreferencesService.get<bool>(SharedPreferencesKeys.appLockEnabled) ?? false;
-
- final verboseLoggingEnabled =
- await SharedPreferencesService.get<bool>(SharedPreferencesKeys.verboseLoggingEnabled) ??
- false;
+ final loggingEnabled =
+ await SharedPreferencesService.get<bool>(SharedPreferencesKeys.loggingEnabled) ?? false;
final fiatMode = await FiatRateModel.loadFiatApiMode();
+ final openAliasMode = await OpenAliasMode.load();
+ await _loadSecurityKeys();
if (!mounted) return;
setState(() {
_newTxNotificationsEnabled = newTxNotificationsEnabled;
- _appLockEnabled = appLockEnabled;
- _verboseLoggingEnabled = verboseLoggingEnabled;
+ _loggingEnabled = loggingEnabled;
_fiatMode = fiatMode;
+ _openAliasMode = openAliasMode;
});
// Enable animation a frame after the loaded values are painted.
WidgetsBinding.instance.addPostFrameCallback((_) {
@@ -106,6 +109,8 @@ class _SettingsScreenState extends State<SettingsScreen> {
void _setTxNotificationsEnabled(bool value) async {
final wallet = appWalletOf(context);
+ // The notification check is view-only: its material follows this toggle.
+ final applySyncSettings = syncSettingsApplier(context);
setState(() {
_newTxNotificationsEnabled = value;
@@ -119,42 +124,44 @@ class _SettingsScreenState extends State<SettingsScreen> {
// everything already received.
await wallet.markExistingTxsAsNotified();
await SharedPreferencesService.set<bool>(SharedPreferencesKeys.notificationsEnabled, true);
+ await applySyncSettings();
await applyBackgroundTaskRegistration();
}
} else {
await SharedPreferencesService.set<bool>(SharedPreferencesKeys.notificationsEnabled, false);
+ await applySyncSettings();
await applyBackgroundTaskRegistration();
}
}
- void _setAppLockEnabled(bool value) async {
- final i18n = AppLocalizations.of(context)!;
-
- if (value) {
- final result = await BiometricAuth.authenticate(reason: i18n.settingsAppLockUnlockReason);
- // Enabling app-lock is an explicit opt-in, so decline and error both report.
- if (result != BiometricAuthResult.authenticated) {
- if (mounted) {
- showBrandToast(context, i18n.settingsAppLockUnableToAuthError);
- }
- return;
- }
+ Future<void> _loadSecurityKeys() async {
+ if (!SecurityKeyService.isSupportedPlatform) return;
+ try {
+ final state = await securityKeysState();
+ if (mounted) setState(() => _securityKeys = state);
+ } catch (_) {
+ // Advanced Security says what went wrong; the rest of Settings loads.
}
+ }
- if (!mounted) return;
- setState(() {
- _appLockEnabled = value;
- });
+ Future<void> _openAdvancedSecurity() async {
+ await Navigator.pushNamed(context, '/advanced_security');
+ await _loadSecurityKeys();
+ }
- await SharedPreferencesService.set<bool>(SharedPreferencesKeys.appLockEnabled, value);
+ String _securityKeysValue(FhseLocalizations i18n) {
+ final state = _securityKeys;
+ if (state == null || !state.engaged) return i18n.advancedSecurityOff;
+ if (state.unreadable) return i18n.advancedSecurityNeedsAttention;
+ return i18n.advancedSecurityKeyCount(state.keys.length);
}
- void _setVerboseLoggingEnabled(bool value) async {
+ void _setLoggingEnabled(bool value) async {
setState(() {
- _verboseLoggingEnabled = value;
+ _loggingEnabled = value;
});
- await SharedPreferencesService.set<bool>(SharedPreferencesKeys.verboseLoggingEnabled, value);
+ await SharedPreferencesService.set<bool>(SharedPreferencesKeys.loggingEnabled, value);
}
void _exportLogs() async {
@@ -249,6 +256,17 @@ class _SettingsScreenState extends State<SettingsScreen> {
);
if (ok != true || !mounted) return;
if (isDesktop) {
+ // The sheet is not a route, so the /secret_keys ReauthGate does not cover
+ // it: where App Lock is the device's prompt (macOS, the iOS build on a
+ // Mac) it prompts here; on Linux and Windows it stays behind the unlock.
+ if (usesDeviceLock) {
+ final result = await BiometricAuth.confirmOwner(reason: i18n.revealSeedAuthReason);
+ if (result != BiometricAuthResult.authenticated) {
+ if (mounted) showBrandToast(context, i18n.settingsAppLockUnableToAuthError);
+ return;
+ }
+ if (!mounted) return;
+ }
await showSecretKeysSheet(context);
} else {
await Navigator.pushNamed(context, '/secret_keys');
@@ -262,97 +280,14 @@ class _SettingsScreenState extends State<SettingsScreen> {
}
}
- double _sheetMaxHeight(BuildContext sheetContext) {
- final media = MediaQuery.of(sheetContext);
- return (media.size.height - media.viewInsets.bottom) * 0.86;
- }
-
- /// Settings popup chrome, matching Spice's sheets: a handle, an icon + title
- /// header, then the form scrolling below (the form carries its own save
- /// button and pops on success).
- Future<void> _showSettingsSheet({
- required IconData icon,
- required String title,
- required Widget form,
- }) {
- return showBrandSheet<void>(
- context: context,
- isScrollControlled: true,
- builder: (sheetContext) {
- // Desktop modal: the card owns the edge padding and drops the drag handle.
- final hpad = isDesktopModal ? 0.0 : 22.0;
- return SafeArea(
- top: false,
- child: ConstrainedBox(
- constraints: BoxConstraints(maxHeight: _sheetMaxHeight(sheetContext)),
- child: Padding(
- padding: EdgeInsets.only(top: isDesktopModal ? 0 : 10),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const SheetHandle(),
- Padding(
- padding: EdgeInsets.fromLTRB(hpad, 0, hpad, 16),
- child: Row(
- children: [
- SheetIcon(
- icon: icon,
- bg: BrandColors.surfaceTinted,
- color: BrandColors.primaryDeep,
- ),
- const SizedBox(width: 11),
- Expanded(child: Text(title, style: BrandText.sheetTitle)),
- ],
- ),
- ),
- Flexible(
- child: SingleChildScrollView(
- padding: EdgeInsets.fromLTRB(hpad, 0, hpad, isDesktopModal ? 0 : 16),
- child: form,
- ),
- ),
- ],
- ),
- ),
- ),
- );
- },
- );
- }
-
- void _showTorSettings() async {
- final i18n = AppLocalizations.of(context)!;
-
- void onSaved() {
- appWalletOf(context).load();
- Provider.of<FiatRateModel>(context, listen: false).startService();
- Navigator.pop(context);
- }
-
- await _showSettingsSheet(
- icon: Icons.public,
- title: i18n.torSettingsTitle,
- form: TorSettingsForm(saveButtonLabel: i18n.torSettingsSaveButton, onSaved: onSaved),
- );
+ Future<void> _showTorSettings() async {
+ await showTorSettingsSheet(context);
// Disabling Tor can auto-disable a Tor-only fiat mode, so refresh both rows.
if (mounted) await _refreshFiatMode();
}
- void _showFiatApiSettings() async {
- final i18n = AppLocalizations.of(context)!;
-
- await _showSettingsSheet(
- icon: Icons.attach_money,
- title: i18n.settingsFiatApiSettingsLabel,
- form: FiatApiSettingsForm(
- saveButtonLabel: i18n.torSettingsSaveButton,
- onSaved: () async {
- await Provider.of<FiatRateModel>(context, listen: false).startService();
- if (mounted) Navigator.pop(context);
- },
- ),
- );
+ Future<void> _showFiatApiSettings() async {
+ await showFiatApiSettingsSheet(context);
if (mounted) await _refreshFiatMode();
}
@@ -366,7 +301,8 @@ class _SettingsScreenState extends State<SettingsScreen> {
Navigator.pop(context);
}
- await _showSettingsSheet(
+ await showSettingsFormSheet(
+ context,
icon: Icons.dns,
title: i18n.settingsConnectionSettingsLabel,
form: ConnectionSettingsForm(
@@ -380,6 +316,20 @@ class _SettingsScreenState extends State<SettingsScreen> {
if (mounted) setState(() {});
}
+ Future<void> _showOpenAliasSettings() async {
+ final changed = await showOpenAliasSheet(context);
+ if (changed == true) {
+ final mode = await OpenAliasMode.load();
+ if (mounted) setState(() => _openAliasMode = mode);
+ }
+ }
+
+ String _openAliasModeLabel(AppLocalizations i18n) => switch (_openAliasMode) {
+ OpenAliasMode.torOnly => i18n.fiatApiSettingsModeTorOnly,
+ OpenAliasMode.clearnet => i18n.fiatApiSettingsModeClearnet,
+ OpenAliasMode.disabled => i18n.fiatApiSettingsModeDisabled,
+ };
+
Future<void> _refreshFiatMode() async {
final mode = await FiatRateModel.loadFiatApiMode();
if (mounted) setState(() => _fiatMode = mode);
@@ -477,7 +427,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
final i18n = AppLocalizations.of(context)!;
final language = context.watch<LanguageModel>();
final theme = context.watch<ThemeModel>();
- final isMobile = Platform.isAndroid || Platform.isIOS;
final wallet = appWalletOf(context, listen: true);
final fiatRate = context.watch<FiatRateModel>();
final showNotifyToggle = Platform.isAndroid || (Platform.isIOS && !wallet.isNodeMode);
@@ -500,65 +449,87 @@ class _SettingsScreenState extends State<SettingsScreen> {
value: languageNames[language.language]?.$1 ?? language.language.toUpperCase(),
onTap: () => showLanguageSheet(context),
),
- if (isMobile)
- SettingsToggleTile(
- title: i18n.settingsAppLockLabel,
- value: _appLockEnabled,
- onChanged: _setAppLockEnabled,
- animate: _animateToggles,
- ),
SettingsLinkTile(
title: i18n.settingsConnectionSettingsLabel,
subtitle: connectionSubtitle,
linkLabel: i18n.settingsLwsViewKeysButton,
onTap: _showConnectionSettings,
),
+ SettingsLinkTile(
+ title: i18n.settingsFiatApiSettingsLabel,
+ subtitle: fiatSubtitle,
+ linkLabel: i18n.settingsLwsViewKeysButton,
+ onTap: _showFiatApiSettings,
+ ),
+ ],
+ ),
+ SettingsGroup(
+ label: i18n.settingsSectionSecurityPrivacy,
+ tiles: [
+ // Always on: how long the app may be away before it asks again.
+ const AppLockTile(),
+ if (isDesktopOS) const DesktopAutoLockTile(),
+ if (SecurityKeyService.isSupportedPlatform)
+ SettingsNavTile(
+ title: FhseLocalizations.of(context).advancedSecurityLabel,
+ value: _securityKeysValue(FhseLocalizations.of(context)),
+ onTap: _openAdvancedSecurity,
+ ),
SettingsLinkTile(
title: i18n.settingsTorSettingsLabel,
subtitle: _torModeLabel(i18n),
linkLabel: i18n.settingsLwsViewKeysButton,
onTap: _showTorSettings,
),
SettingsLinkTile(
- title: i18n.settingsFiatApiSettingsLabel,
- subtitle: fiatSubtitle,
+ title: i18n.settingsOpenAliasSettingsLabel,
+ subtitle: _openAliasModeLabel(i18n),
linkLabel: i18n.settingsLwsViewKeysButton,
- onTap: _showFiatApiSettings,
+ onTap: _showOpenAliasSettings,
),
],
),
SettingsGroup(
- label: i18n.settingsSectionBehaviour,
+ label: i18n.settingsSectionData,
tiles: [
- if (showNotifyToggle)
- SettingsToggleTile(
- title: i18n.settingsNotifyNewTxsLabel,
- description: Platform.isIOS
- ? i18n.settingsNotifyNewTxsDescriptionIos
- : i18n.settingsNotifyNewTxsDescription,
- value: _newTxNotificationsEnabled,
- onChanged: _setTxNotificationsEnabled,
- animate: _animateToggles,
- ),
+ SettingsNavTile(
+ title: BackupLocalizations.of(context).backupTitle,
+ onTap: () => Navigator.pushNamed(context, '/metadata_backup'),
+ ),
SettingsToggleTile(
- title: i18n.settingsVerboseLoggingLabel,
+ title: i18n.settingsLoggingLabel,
description: Platform.isIOS
- ? i18n.settingsVerboseLoggingDescriptionIos
- : i18n.settingsVerboseLoggingDescription,
- value: _verboseLoggingEnabled,
- onChanged: _setVerboseLoggingEnabled,
+ ? i18n.settingsLoggingDescriptionIos
+ : i18n.settingsLoggingDescription,
+ value: _loggingEnabled,
+ onChanged: _setLoggingEnabled,
animate: _animateToggles,
),
// Only meaningful with logs to export, so hide it when
- // verbose logging is off rather than disabling it.
- if (Platform.isIOS && _verboseLoggingEnabled)
+ // logging is off rather than disabling it.
+ if (Platform.isIOS && _loggingEnabled)
SettingsLinkTile(
title: i18n.settingsExportLogsLabel,
linkLabel: i18n.settingsExportLogsButton,
onTap: _exportLogs,
),
],
),
+ if (showNotifyToggle)
+ SettingsGroup(
+ label: i18n.settingsSectionBehaviour,
+ tiles: [
+ SettingsToggleTile(
+ title: i18n.settingsNotifyNewTxsLabel,
+ description: Platform.isIOS
+ ? i18n.settingsNotifyNewTxsDescriptionIos
+ : i18n.settingsNotifyNewTxsDescription,
+ value: _newTxNotificationsEnabled,
+ onChanged: _setTxNotificationsEnabled,
+ animate: _animateToggles,
+ ),
+ ],
+ ),
SettingsGroup(
label: i18n.settingsSectionWallet,
tiles: [
@@ -590,6 +561,14 @@ class _SettingsScreenState extends State<SettingsScreen> {
title: i18n.welcomePrivacyLink,
onTap: () => Navigator.pushNamed(context, '/privacy_policy', arguments: true),
),
+ SettingsNavTile(
+ title: i18n.settingsLicensesLabel,
+ onTap: () => showLicensePage(
+ context: context,
+ applicationName: 'Skylight Wallet',
+ applicationVersion: _appVersion,
+ ),
+ ),
],
),
];
@@ -611,7 +590,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
return Scaffold(
backgroundColor: BrandColors.paper,
- bottomNavigationBar: const WalletNavigationBar(selectedIndex: 2),
+ bottomNavigationBar: const WalletNavigationBar(selectedIndex: 3),
body: SafeArea(
bottom: false,
child: Center(
### lib/screens/unlock.dart
@@ -5,27 +5,50 @@ import 'package:local_auth/local_auth.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:skylight_wallet/l10n/app_localizations.dart';
+import 'package:skylight_wallet/util/platform.dart' show typesWalletPassword;
import 'package:skylight_wallet/wallet_core_glue.dart';
import 'package:skylight_wallet/widgets/floating_bob.dart';
import 'package:skylight_wallet/widgets/ui/ui.dart';
-import 'package:wallet_infra/wallet_infra.dart' show BiometricAuth, BiometricAuthResult;
+import 'package:wallet_domain/wallet_domain.dart' show AppSession;
+import 'package:wallet_fhse/security_keys_ui.dart'
+ show
+ FhseLocalizations,
+ reopenAfterAppLock,
+ showAppLockRecoveryPhrase,
+ waitForFullLock,
+ walletNeedsSecurityKey;
+import 'package:wallet_infra/wallet_infra.dart'
+ show BiometricAuth, BiometricAuthResult, BoundToAnotherPcException;
class UnlockScreen extends StatefulWidget {
- const UnlockScreen({super.key});
+ const UnlockScreen({super.key, this.onUnlocked, this.onKeyNeeded});
+
+ /// Set when this is App Lock's cover over the screens the user left
+ /// (`AppLockCover`), which has no route to pop: the app hides the cover.
+ final VoidCallback? onUnlocked;
+
+ /// The cover's way on when the wallet closed meanwhile and a security key
+ /// comes next: the app replaces its stack with the key screen.
+ final VoidCallback? onKeyNeeded;
@override
State<UnlockScreen> createState() => _UnlockScreenState();
}
class _UnlockScreenState extends State<UnlockScreen> {
- static bool get _isDesktop => Platform.isLinux || Platform.isWindows || Platform.isMacOS;
+ // The typed password at every launch (Linux, Windows); App Lock's device
+ // prompt elsewhere, macOS included (Touch ID or the Mac's password).
+ static bool get _isDesktop => typesWalletPassword;
final TextEditingController _passwordController = TextEditingController();
bool _obscure = true;
bool _isLoading = false;
String? _error;
String? _biometricLabel; // resolved per device on iOS (Face ID vs Touch ID)
bool _started = false;
+ // The device could not confirm its owner (a lockout, say): the recovery
+ // phrase is offered as the way in instead.
+ bool _offerRecoveryPhrase = false;
String _version = ''; // desktop footer status bar
@override
@@ -58,6 +81,8 @@ class _UnlockScreenState extends State<UnlockScreen> {
final i18n = AppLocalizations.of(context)!;
try {
final types = await LocalAuthentication().getAvailableBiometrics();
+ // A passcode alone keeps the generic "Unlock".
+ if (types.isEmpty) return;
final label = types.contains(BiometricType.face)
? i18n.unlockWithFaceId
: i18n.unlockWithTouchId;
@@ -75,19 +100,60 @@ class _UnlockScreenState extends State<UnlockScreen> {
Future<void> _promptUnlock() async {
final i18n = AppLocalizations.of(context)!;
- final result = await BiometricAuth.authenticate(reason: i18n.unlockReason);
+ // Always asks (App Lock is always on); a device with no lock at all has
+ // nothing to ask and passes, and Settings warns about it.
+ final result = await BiometricAuth.confirmOwner(reason: i18n.unlockReason);
- // Auto-prompted with a password field right there: stay silent on a decline
- // (the user chose to type instead), report only a real error.
+ // Auto-prompted: stay silent on a decline (the button asks again), report
+ // only a real error, and offer the recovery phrase for it.
if (result == BiometricAuthResult.authenticated) {
- if (mounted) Navigator.pushReplacementNamed(context, '/wallet_home');
+ // A full lock still closing the wallets decides what comes next.
+ await waitForFullLock();
+ if (!mounted) return;
+ // With security keys on and the wallet closed, a key comes next.
+ final needsKey = await walletNeedsSecurityKey(context);
+ if (!mounted) return;
+ // Otherwise the keystore password comes back (a relock dropped it) and,
+ // after a full lock, the wallet opens again. Without one it stays shut.
+ if (!needsKey && !await reopenAfterAppLock(context)) {
+ if (mounted) {
+ setState(() => _offerRecoveryPhrase = true);
+ showBrandToast(context, i18n.unlockUnableToAuthError);
+ }
+ return;
+ }
+ if (mounted) _unlocked(needsKey: needsKey);
} else if (result == BiometricAuthResult.error) {
if (mounted) {
+ setState(() => _offerRecoveryPhrase = true);
showBrandToast(context, i18n.unlockUnableToAuthError);
}
}
}
+ /// The device could not confirm its owner: the recovery phrase opens the
+ /// wallet instead (and stands in for a security key, when keys are on).
+ Future<void> _useRecoveryPhrase() async {
+ if (await showAppLockRecoveryPhrase(context) && mounted) _unlocked(needsKey: false);
+ }
+
+ /// Past App Lock. A key comes next when keys are on and the wallet is
+ /// closed; otherwise this was the last lock ([AppSession]). A relock covers
+ /// the screen the user left, and the app uncovers it; at a launch or after
+ /// a full lock this is the base route, and home comes next.
+ void _unlocked({required bool needsKey}) {
+ if (needsKey) {
+ final onKeyNeeded = widget.onKeyNeeded;
+ if (onKeyNeeded != null) return onKeyNeeded();
+ Navigator.of(context).pushNamedAndRemoveUntil('/security_key_unlock', (route) => false);
+ return;
+ }
+ AppSession.markUnlocked();
+ final onUnlocked = widget.onUnlocked;
+ if (onUnlocked != null) return onUnlocked();
+ Navigator.of(context).pushReplacementNamed('/wallet_home');
+ }
+
Future<void> _unlockWithPassword() async {
final i18n = AppLocalizations.of(context)!;
if (_passwordController.text.isEmpty) {
@@ -100,14 +166,37 @@ class _UnlockScreenState extends State<UnlockScreen> {
});
try {
- await unlockWithPassword(context, _passwordController.text);
+ // App Lock after a time without use: the wallet stayed open, so the
+ // password is only checked again and the screen left comes back.
+ final rechecked = await recheckPasswordIfOpen(context, _passwordController.text);
+ if (rechecked != null) {
+ if (!rechecked) throw Exception('Incorrect wallet password.');
+ if (mounted) {
+ _passwordController.clear();
+ _unlocked(needsKey: false);
+ }
+ return;
+ }
+ if (!mounted) return;
+ final needsKey = await unlockWithPassword(context, _passwordController.text);
if (mounted) {
- Navigator.pushNamedAndRemoveUntil(context, '/wallet_home', (route) => false);
+ if (widget.onUnlocked != null) return _unlocked(needsKey: needsKey);
+ // No key to follow: the password was the last lock.
+ if (!needsKey) AppSession.markUnlocked();
+ Navigator.pushNamedAndRemoveUntil(
+ context,
+ needsKey ? '/security_key_unlock' : '/wallet_home',
+ (route) => false,
+ );
}
- } catch (_) {
+ } catch (e) {
if (mounted) {
+ _passwordController.clear();
setState(() {
- _error = i18n.unlockIncorrectPasswordError;
+ // The files are bound to a PC whose TPM this one cannot use.
+ _error = e is BoundToAnotherPcException
+ ? FhseLocalizations.of(context).unlockBoundToAnotherPc
+ : i18n.unlockIncorrectPasswordError;
_isLoading = false;
});
}
@@ -135,6 +224,10 @@ class _UnlockScreenState extends State<UnlockScreen> {
biometricLabel: _biometricLabel,
onUnlockPassword: _unlockWithPassword,
onUnlockBiometric: _promptUnlock,
+ recoveryLabel: _offerRecoveryPhrase
+ ? FhseLocalizations.of(context).securityKeyUseRecoveryPhrase
+ : null,
+ onUseRecoveryPhrase: _useRecoveryPhrase,
);
}
}
### lib/screens/verify_seed.dart
@@ -0,0 +1,77 @@
+import 'package:flutter/material.dart';
+import 'package:wallet_fhse/security_keys_ui.dart' show lockWalletAction;
+
+import 'package:skylight_wallet/l10n/app_localizations.dart';
+import 'package:skylight_wallet/util/secure_screen.dart';
+import 'package:skylight_wallet/wallet_core_glue.dart';
+import 'package:skylight_wallet/widgets/ui/ui.dart';
+
+/// Desktop: the seed check as a centered modal over the home.
+Future<void> showVerifySeedSheet(BuildContext context) => showBrandSheet<void>(
+ context: context,
+ isScrollControlled: true,
+ builder: (_) => const VerifySeedScreen(embedded: true),
+);
+
+/// The seed check from the home's security checklist: three words of the seed
+/// phrase at random positions, never showing any.
+class VerifySeedScreen extends StatefulWidget {
+ /// Content only, for [showVerifySeedSheet].
+ final bool embedded;
+
+ const VerifySeedScreen({super.key, this.embedded = false});
+
+ @override
+ State<VerifySeedScreen> createState() => _VerifySeedScreenState();
+}
+
+class _VerifySeedScreenState extends State<VerifySeedScreen> with SecureScreenMixin {
+ late final SeedVerifier _verifier;
+
+ // Bound up front: the lock must still run if this page is closed during a
+ // check.
+ late final Future<void> Function() _lock;
+
+ @override
+ void initState() {
+ super.initState();
+ _lock = lockWalletAction(context);
+ final wallet = appWalletOf(context);
+ _verifier = SeedVerifier(
+ loadWords: () async {
+ // The words the user wrote down: the seed as created or restored
+ // (polyseed, BIP39 or 25 words). A wallet from before that was kept
+ // still has its polyseed; its 25 derived words are not asked for,
+ // since a BIP39 restore never showed them to the user.
+ final stored = await wallet.readStoredSeed();
+ var phrase = stored?.mnemonic ?? '';
+ if (phrase.isEmpty) phrase = await wallet.readPolyseed();
+ final words = phrase.trim().split(RegExp(r'\s+'));
+ return words.length > 1 ? words : null;
+ },
+ );
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final i18n = AppLocalizations.of(context)!;
+ return SeedVerifyView(
+ labels: SeedVerifyLabels(
+ title: i18n.verifySeedTitle,
+ subtitle: (p) => i18n.verifySeedSubtitle(p[0], p[1], p[2]),
+ verifyButton: i18n.verifySeedButton,
+ wrongTitle: i18n.verifySeedWrongTitle,
+ wrongBody: i18n.verifySeedWrongBody,
+ tryAgain: i18n.verifySeedTryAgain,
+ unavailable: i18n.verifySeedUnavailable,
+ ),
+ verifier: _verifier,
+ embedded: widget.embedded,
+ onVerified: () {
+ showBrandToast(context, i18n.verifySeedDone);
+ Navigator.pop(context);
+ },
+ onLocked: _lock,
+ );
+ }
+}
### lib/screens/wallet_home.dart
@@ -2,9 +2,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
-import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
-import 'package:skeletonizer/skeletonizer.dart';
import 'package:skylight_wallet/l10n/app_localizations.dart';
import 'package:skylight_wallet/models/app_wallet.dart';
@@ -13,25 +11,16 @@ import 'package:skylight_wallet/screens/desktop/home_shell.dart';
import 'package:skylight_wallet/services/tor_service.dart';
import 'package:skylight_wallet/util/platform.dart';
import 'package:skylight_wallet/wallet_core_glue.dart';
+import 'package:skylight_wallet/screens/verify_seed.dart';
+import 'package:skylight_wallet/widgets/home_labels.dart';
+import 'package:skylight_wallet/widgets/privacy_settings_sheets.dart';
import 'package:skylight_wallet/widgets/ui/ui.dart';
import 'package:skylight_wallet/widgets/wallet_navigation_bar.dart';
-import 'package:wallet_domain/wallet_domain.dart' show TxDetails;
+import 'package:wallet_backup_platform/wallet_backup_platform.dart' show MetadataBackupSetup;
+import 'package:wallet_domain/wallet_domain.dart' show CryptoWallet, SeedStore;
+import 'package:wallet_fhse/security_keys_ui.dart' show securityKeysOn;
import 'package:wallet_infra/wallet_infra.dart' show StoreReview;
-/// The balance hero's big number style, mirroring Spice's `coin_home.dart`.
-TextStyle get _balanceStyle => TextStyle(
- fontFamily: 'Ubuntu Mono',
- fontSize: 33,
- height: 1,
- fontWeight: FontWeight.w700,
- letterSpacing: -0.66,
- color: BrandColors.ink,
- fontFeatures: const [FontFeature.tabularFigures()],
-);
-
-TextStyle get _balanceSubStyle =>
- TextStyle(fontFamily: 'Ubuntu Mono', fontSize: 13.5, height: 1, color: BrandColors.inkMuted);
-
/// Monero is decimal-12; cap the displayed coin amount for legibility.
String _amountText(double amount) => amount.toStringAsFixed(5);
@@ -43,7 +32,6 @@ enum StatusIconStatus { loading, complete, fail }
typedef _HomeValues = ({
double unlockedBalance,
double? unlockedBalanceFiat,
- double lockedBalance,
StatusIconStatus status,
bool disconnected,
});
@@ -53,7 +41,6 @@ _HomeValues _deriveHome(AppWallet wallet, FiatRateModel fiatRate) {
final unlockedBalanceFiat = fiatRate.rateFor('XMR') is double && wallet.unlockedBalance is double
? wallet.unlockedBalance! * fiatRate.rateFor('XMR')!
: null;
- final lockedBalance = (wallet.totalBalance ?? 0) - (wallet.unlockedBalance ?? 0);
var status = StatusIconStatus.fail;
if (wallet.isFullySynced) {
@@ -69,7 +56,6 @@ _HomeValues _deriveHome(AppWallet wallet, FiatRateModel fiatRate) {
return (
unlockedBalance: unlockedBalance,
unlockedBalanceFiat: unlockedBalanceFiat,
- lockedBalance: lockedBalance,
status: status,
disconnected: wallet.torRequirementBroken || status == StatusIconStatus.fail,
);
@@ -82,10 +68,32 @@ class WalletHomeScreen extends StatefulWidget {
State<WalletHomeScreen> createState() => _WalletHomeScreenState();
}
-class _WalletHomeScreenState extends State<WalletHomeScreen> {
+class _WalletHomeScreenState extends State<WalletHomeScreen> with WidgetsBindingObserver {
+ late final SecurityChecklist _checklist = SecurityChecklist(
+ autoBackupOn: MetadataBackupSetup.automaticBackupOn,
+ securityKeysOn: securityKeysOn,
+ canVerifySeed: _canVerifySeed,
+ );
+ bool? _seedAskable;
+
+ // The seed check asks for the words as kept since the wallet was made, or,
+ // for an older wallet, its polyseed. Worked out once per visit.
+ Future<bool> _canVerifySeed() async {
+ final known = _seedAskable;
+ if (known != null) return known;
+ var askable = await SeedStore.exists();
+ if (!askable && mounted) {
+ askable = (await appWalletOf(context).readPolyseed()).isNotEmpty;
+ }
+ return _seedAskable = askable;
+ }
+
@override
void initState() {
super.initState();
+ WidgetsBinding.instance.addObserver(this);
+ _checklist.addListener(_onChecklistChanged);
+ _checklist.refresh();
WidgetsBinding.instance.addPostFrameCallback((_) {
final Map<String, dynamic>? args =
@@ -101,208 +109,128 @@ class _WalletHomeScreenState extends State<WalletHomeScreen> {
});
}
+ @override
+ void dispose() {
+ WidgetsBinding.instance.removeObserver(this);
+ _checklist.removeListener(_onChecklistChanged);
+ _checklist.dispose();
+ super.dispose();
+ }
+
+ // A setting may have changed in the system settings (iCloud) meanwhile.
+ @override
+ void didChangeAppLifecycleState(AppLifecycleState state) {
+ if (state == AppLifecycleState.resumed) _checklist.refresh();
+ }
+
+ void _onChecklistChanged() {
+ if (mounted) setState(() {});
+ }
+
// Still the screen in front, with the app in the foreground: the review
// dialog must not land on a send or receive the user has already opened.
bool _stillOnHome() =>
mounted &&
(ModalRoute.of(context)?.isCurrent ?? false) &&
WidgetsBinding.instance.lifecycleState == AppLifecycleState.resumed;
- void _showTxDetails(TxDetails txDetails) {
- showTxDetailsDialog(context, txDetails);
- }
-
void _showTxSuccessToast() {
final i18n = AppLocalizations.of(context)!;
showBrandToast(context, i18n.sendTransactionSuccessfullySent);
}
+ Future<void> _openStep(SecurityStep step) => switch (step) {
+ SecurityStep.verifySeed =>
+ isDesktop ? showVerifySeedSheet(context) : Navigator.pushNamed(context, '/verify_seed'),
+ SecurityStep.autoBackup => Navigator.pushNamed(context, '/metadata_backup'),
+ SecurityStep.tor => showTorSettingsSheet(context),
+ SecurityStep.privateLookups => showPrivateLookupSheets(context),
+ SecurityStep.securityKeys => Navigator.pushNamed(context, '/advanced_security'),
+ };
+
@override
Widget build(BuildContext context) {
final i18n = AppLocalizations.of(context)!;
final wallet = appWalletOf(context, listen: true);
final fiatRate = context.watch<FiatRateModel>();
final v = _deriveHome(wallet, fiatRate);
- if (isDesktop) {
- return const DesktopShell(active: DesktopNav.home, child: DesktopHomeView());
- }
+ // The engine wallet, not the app adapter: the shared cards read its
+ // exact history and balances.
+ final cw = xmrWallet(context)!;
+ final coins = <HomeCoin>[(wallet: cw, tokens: const <CryptoWallet>[])];
+ final sections = HomeSections(activity: HomeActivity.shared, labels: homeLabels(i18n));
+ final configured = cw.connectionAddress.isNotEmpty;
+ Widget hero(Widget? footer) => HomeBalanceHero(
+ fiatRate: fiatRate,
+ fiatTotal: v.unlockedBalanceFiat,
+ coinText: '${_amountText(v.unlockedBalance)} XMR',
+ fiatErrorTooltip: i18n.homeFiatApiError,
+ footer: footer,
+ );
+ void receive() => Navigator.pushNamed(context, '/receive');
+ void send() => Navigator.pushNamed(context, '/send');
+ void swap() => showBrandToast(context, i18n.coinHomeSwapComingSoon);
+ final incoming = sections.incoming(coins);
+ final chart = sections.chart(coins);
+ final checklist = securityChecklistCard(
+ checklist: _checklist,
+ labels: securityChecklistLabels(i18n),
+ onStep: _openStep,
+ );
- return Scaffold(
- backgroundColor: BrandColors.paper,
- bottomNavigationBar: WalletNavigationBar(selectedIndex: 0),
- body: SafeArea(
- child: Center(
- child: ConstrainedBox(
- constraints: const BoxConstraints(maxWidth: 520),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- const _Header(),
- Expanded(
- child: CustomScrollView(
- slivers: [
- SliverToBoxAdapter(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- _BalanceHero(
- wallet: wallet,
- unlockedBalance: v.unlockedBalance,
- unlockedBalanceFiat: v.unlockedBalanceFiat,
- lockedBalance: v.lockedBalance,
- fiatRate: fiatRate,
- disconnected: v.disconnected,
- ),
- Padding(
- padding: const EdgeInsets.fromLTRB(16, 0, 16, 22),
- child: _ActionRow(
- onReceive: () => Navigator.pushNamed(context, '/receive'),
- onSend: () => Navigator.pushNamed(context, '/send'),
- ),
- ),
- Padding(
- padding: const EdgeInsets.fromLTRB(20, 0, 20, 10),
- child: SectionHeader(
- label: i18n.coinHomeActivityTitle,
- padding: EdgeInsets.zero,
- ),
- ),
- ],
- ),
- ),
- _ActivitySliver(
- wallet: wallet,
- i18n: i18n,
- fiatRate: fiatRate,
- onTapTx: _showTxDetails,
- ),
- const SliverToBoxAdapter(child: SizedBox(height: 24)),
- ],
- ),
- ),
- ],
- ),
+ if (isDesktop) {
+ return DesktopShell(
+ active: DesktopNav.home,
+ child: DesktopHomeLayout(
+ status: configured
+ ? _SyncStatusPill(status: v.status, blocksRemaining: wallet.syncBlocksRemaining)
+ : null,
+ balance: hero(configured ? ConnectionPills(wallet: cw) : null),
+ actions: DesktopHomeActions(
+ receiveLabel: i18n.homeReceive,
+ sendLabel: i18n.homeSend,
+ swapLabel: i18n.coinHomeSwap,
+ onReceive: receive,
+ onSend: send,
+ onSwap: swap,
),
+ wide: [?incoming, chart],
+ side: checklist,
),
- ),
- );
- }
-}
-
-class _Header extends StatelessWidget {
- const _Header();
+ );
+ }
- @override
- Widget build(BuildContext context) {
- return Padding(
- padding: const EdgeInsets.only(left: 20, right: 20, top: 16, bottom: 2),
- child: Row(
- children: [
- ClipRRect(
- borderRadius: BorderRadius.circular(6),
- child: SvgPicture.asset('assets/logo.svg', width: 26, height: 26),
- ),
- const SizedBox(width: 9),
- Text(
- 'Skylight Wallet',
- style: TextStyle(
- fontWeight: FontWeight.w500,
- fontSize: 17,
- height: 1,
- color: BrandColors.ink,
- ),
- ),
- ],
+ return WalletHomeView(
+ header: HomeHeader(
+ logo: ClipRRect(
+ borderRadius: BorderRadius.circular(8),
+ child: SvgPicture.asset('assets/logo.svg', width: 30, height: 30),
+ ),
+ title: 'Skylight Wallet',
),
- );
- }
-}
-
-class _BalanceHero extends StatelessWidget {
- final AppWallet wallet;
- final double unlockedBalance;
- final double? unlockedBalanceFiat;
- final double lockedBalance;
- final FiatRateModel fiatRate;
- final bool disconnected;
-
- const _BalanceHero({
- required this.wallet,
- required this.unlockedBalance,
- required this.unlockedBalanceFiat,
- required this.lockedBalance,
- required this.fiatRate,
- required this.disconnected,
- });
-
- @override
- Widget build(BuildContext context) {
- final i18n = AppLocalizations.of(context)!;
- final showFiat = !fiatRate.isDisabled && unlockedBalanceFiat != null;
- final coinText = '${_amountText(unlockedBalance)} XMR';
-
- return Padding(
- padding: const EdgeInsets.fromLTRB(20, 30, 20, 24),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- // Fiat leads when available; otherwise the coin amount is the hero,
- // with a skeleton while the rate is still loading.
- Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Flexible(
- child: showFiat
- ? BalanceText.split(
- formatFiat(unlockedBalanceFiat!, fiatRate.fiatCurrency),
- style: _balanceStyle,
- )
- : (!fiatRate.isDisabled && !fiatRate.hasFailed)
- ? Skeletonizer(child: Text('0.0000', style: _balanceStyle))
- : (fiatRate.hasFailed && !fiatRate.isDisabled)
- ? Text('--', style: _balanceStyle)
- : Text(coinText, style: _balanceStyle),
- ),
- if (fiatRate.hasFailed && !fiatRate.isDisabled) ...[
- const SizedBox(width: 8),
- Padding(
- padding: const EdgeInsets.only(top: 6),
- child: Tooltip(
- message: i18n.homeFiatApiError,
- child: Icon(Icons.warning_rounded, size: 18, color: BrandColors.warning),
- ),
- ),
- ],
- ],
- ),
- const SizedBox(height: 10),
- // When the rate is unavailable the fiat hero is '--', so keep the coin
- // amount visible as the sub-line.
- if (showFiat || (fiatRate.hasFailed && !fiatRate.isDisabled))
- Text(coinText, style: _balanceSubStyle),
- // Funds that have arrived but aren't spendable yet — Monero locks a
- // receipt for ten blocks, so the unlocked balance above omits it.
- if (lockedBalance > 0)
- Padding(
- padding: const EdgeInsets.only(top: 6),
- child: Text(
- '${i18n.pending}: +${_amountText(lockedBalance)} XMR',
- style: _balanceSubStyle,
- ),
- ),
- _ConnectionRow(wallet: wallet, disconnected: disconnected),
- ],
+ balance: hero(_ConnectionRow(wallet: wallet, disconnected: v.disconnected)),
+ actions: HomeActionRow(
+ receiveLabel: i18n.homeReceive,
+ sendLabel: i18n.homeSend,
+ swapLabel: i18n.coinHomeSwap,
+ onReceive: receive,
+ onSend: send,
+ onSwap: swap,
),
+ incoming: incoming,
+ chart: chart,
+ checklist: checklist,
+ bottomNavigationBar: WalletNavigationBar(selectedIndex: 0),
);
}
}
/// The connection info row: transport/kind pills. While syncing the pills
/// compact to icons with "x blocks left" beside them; when the connection has
-/// failed, the same slot shows "Disconnected" in red. Shared by the mobile
-/// balance hero and the desktop home.
+/// failed, the same slot shows "Disconnected" in red. Sits under the mobile
+/// home's balance.
class _ConnectionRow extends StatelessWidget {
final AppWallet wallet;
final bool disconnected;
@@ -316,261 +244,29 @@ class _ConnectionRow extends StatelessWidget {
if (cw == null || cw.connectionAddress.isEmpty) return const SizedBox.shrink();
final blocks = wallet.syncBlocksRemaining;
final trailing = blocks != null
- ? i18n.homeBlocksRemaining(NumberFormat.decimalPattern().format(blocks))
+ ? i18n.homeBlocksRemaining(blocks)
: disconnected
? i18n.homeDisconnected
: null;
- return Padding(
- padding: const EdgeInsets.only(top: 12),
- child: trailing == null
- ? ConnectionPills(wallet: cw)
- : Row(
- children: [
- ConnectionPills(wallet: cw, compact: true),
- const SizedBox(width: 10),
- Container(width: 1, height: 14, color: BrandColors.borderStrong),
- const SizedBox(width: 10),
- Flexible(
- child: Text(
- trailing,
- overflow: TextOverflow.ellipsis,
- style: TextStyle(
- fontFamily: 'Ubuntu Mono',
- fontSize: 13,
- height: 1,
- color: disconnected ? BrandColors.error : BrandColors.inkMuted,
- ),
- ),
- ),
- ],
- ),
- );
- }
-}
-
-class _ActionRow extends StatelessWidget {
- final VoidCallback onReceive;
- final VoidCallback onSend;
-
- const _ActionRow({required this.onReceive, required this.onSend});
-
- @override
- Widget build(BuildContext context) {
- final i18n = AppLocalizations.of(context)!;
+ if (trailing == null) return ConnectionPills(wallet: cw);
return Row(
children: [
- Expanded(
- child: ActionButton(
- icon: Icons.arrow_downward,
- label: i18n.homeReceive,
- onPressed: onReceive,
- ),
- ),
- const SizedBox(width: 8),
- Expanded(
- child: ActionButton(icon: Icons.arrow_upward, label: i18n.homeSend, onPressed: onSend),
- ),
- ],
- );
- }
-}
-
-class _ActivitySliver extends StatelessWidget {
- final AppWallet wallet;
- final AppLocalizations i18n;
- final FiatRateModel fiatRate;
- final double horizontalPadding;
- final void Function(TxDetails tx) onTapTx;
-
- const _ActivitySliver({
- required this.wallet,
- required this.i18n,
- required this.fiatRate,
- required this.onTapTx,
- this.horizontalPadding = 20,
- });
-
- @override
- Widget build(BuildContext context) {
- // The engine wallet supplies the exact-BigInt tx history the shared row
- // reads; the parent watches the neutral wallet (listen: true) so this
- // subtree rebuilds when the history changes.
- final asset = xmrWallet(context)!;
- final txs = asset.txHistory;
-
- if (txs.isEmpty) {
- return SliverToBoxAdapter(
- child: Padding(
- padding: EdgeInsets.symmetric(horizontal: horizontalPadding, vertical: 12),
+ ConnectionPills(wallet: cw, compact: true),
+ const SizedBox(width: 10),
+ Container(width: 1, height: 14, color: BrandColors.borderStrong),
+ const SizedBox(width: 10),
+ Flexible(
child: Text(
- i18n.homeNoTransactions,
- textAlign: TextAlign.center,
- style: BrandText.bodyMuted,
- ),
- ),
- );
- }
-
- final rows = withDayHeaders(txs, (tx) => tx.timestamp);
-
- return SliverPadding(
- padding: EdgeInsets.symmetric(horizontal: horizontalPadding),
- sliver: SliverList.builder(
- itemCount: rows.length,
- itemBuilder: (context, index) {
- final row = rows[index];
- if (row is String) {
- return Padding(
- padding: EdgeInsets.only(top: index == 0 ? 4 : 16, bottom: 4),
- child: SectionHeader(label: row, padding: EdgeInsets.zero),
- );
- }
- final tx = row as TxDetails;
- // No coin icon: Skylight is single-coin (Monero), so the leading badge
- // is a coin-agnostic direction circle. Divider only within a day group.
- final next = index + 1 < rows.length ? rows[index + 1] : null;
- return TxActivityRow(
- tx: tx,
- asset: asset,
- showCoinIcon: false,
- labels: TxActivityLabels(received: i18n.coinHomeReceived, sent: i18n.coinHomeSent),
- fiatRate: fiatRate,
- showDivider: next is TxDetails,
- onTap: () => onTapTx(tx),
- );
- },
- ),
- );
- }
-}
-
-/// Desktop main home body (rendered inside [DesktopShell]): the balance and
-/// Receive/Send on one row, then the full day-grouped activity. Mirrors the
-/// mobile [WalletHomeScreen] logic (shared via [_deriveHome]); only the layout
-/// is desktop-specific. Skylight is single-coin, so there is no coin grid.
-class DesktopHomeView extends StatelessWidget {
- const DesktopHomeView({super.key});
-
- // Getter, not const: BrandColors.ink is a runtime (palette/brightness) value.
- static TextStyle get _bigBalance => TextStyle(
- fontFamily: 'Ubuntu Mono',
- fontSize: 44,
- height: 1,
- fontWeight: FontWeight.w700,
- letterSpacing: -0.88,
- color: BrandColors.ink,
- fontFeatures: const [FontFeature.tabularFigures()],
- );
-
- @override
- Widget build(BuildContext context) {
- final i18n = AppLocalizations.of(context)!;
- final wallet = appWalletOf(context, listen: true);
- final fiatRate = context.watch<FiatRateModel>();
- final v = _deriveHome(wallet, fiatRate);
-
- final showFiat = !fiatRate.isDisabled && v.unlockedBalanceFiat != null;
- final coinText = '${_amountText(v.unlockedBalance)} XMR';
- final cw = xmrWallet(context);
- final configured = cw != null && cw.connectionAddress.isNotEmpty;
-
- return CustomScrollView(
- slivers: [
- SliverToBoxAdapter(
- child: Padding(
- padding: const EdgeInsets.fromLTRB(44, 40, 44, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- if (configured)
- Align(
- alignment: Alignment.centerRight,
- child: Padding(
- padding: const EdgeInsets.only(bottom: 18),
- child: _SyncStatusPill(
- status: v.status,
- blocksRemaining: wallet.syncBlocksRemaining,
- ),
- ),
- ),
- Row(
- crossAxisAlignment: CrossAxisAlignment.end,
- children: [
- Expanded(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Flexible(
- child: showFiat
- ? BalanceText.split(
- formatFiat(v.unlockedBalanceFiat!, fiatRate.fiatCurrency),
- style: _bigBalance,
- )
- : (!fiatRate.isDisabled && !fiatRate.hasFailed)
- ? Skeletonizer(child: Text('0.0000', style: _bigBalance))
- : (fiatRate.hasFailed && !fiatRate.isDisabled)
- ? Text('--', style: _bigBalance)
- : Text(coinText, style: _bigBalance),
- ),
- if (fiatRate.hasFailed && !fiatRate.isDisabled) ...[
- const SizedBox(width: 8),
- Padding(
- padding: const EdgeInsets.only(top: 6),
- child: Tooltip(
- message: i18n.homeFiatApiError,
- child: Icon(
- Icons.warning_rounded,
- size: 18,
- color: BrandColors.warning,
- ),
- ),
- ),
- ],
- ],
- ),
- const SizedBox(height: 12),
- if (showFiat || (fiatRate.hasFailed && !fiatRate.isDisabled))
- Text(coinText, style: _balanceSubStyle),
- if (v.lockedBalance > 0)
- Padding(
- padding: const EdgeInsets.only(top: 6),
- child: Text(
- '${i18n.pending}: +${_amountText(v.lockedBalance)} XMR',
- style: _balanceSubStyle,
- ),
- ),
- if (configured) ...[
- const SizedBox(height: 14),
- ConnectionPills(wallet: cw),
- ],
- ],
- ),
- ),
- const SizedBox(width: 24),
- _DesktopActions(
- onReceive: () => Navigator.pushNamed(context, '/receive'),
- onSend: () => Navigator.pushNamed(context, '/send'),
- ),
- ],
- ),
- const SizedBox(height: 34),
- SectionHeader(label: i18n.coinHomeActivityTitle, padding: EdgeInsets.zero),
- const SizedBox(height: 4),
- ],
+ trailing,
+ overflow: TextOverflow.ellipsis,
+ style: TextStyle(
+ fontFamily: 'Ubuntu Mono',
+ fontSize: 13,
+ height: 1,
+ color: disconnected ? BrandColors.error : BrandColors.inkMuted,
),
),
),
- _ActivitySliver(
- wallet: wallet,
- i18n: i18n,
- fiatRate: fiatRate,
- horizontalPadding: 44,
- onTapTx: (tx) => showTxDetailsDialog(context, tx),
- ),
- const SliverToBoxAdapter(child: SizedBox(height: 28)),
],
);
}
@@ -587,13 +283,12 @@ class _SyncStatusPill extends StatelessWidget {
@override
Widget build(BuildContext context) {
final i18n = AppLocalizations.of(context)!;
+ final blocks = blocksRemaining;
final (Color dot, String text) = switch (status) {
StatusIconStatus.complete => (BrandColors.success, i18n.homeSynced),
StatusIconStatus.loading => (
BrandColors.warning,
- blocksRemaining != null
- ? i18n.homeBlocksRemaining(NumberFormat.decimalPattern().format(blocksRemaining))
- : i18n.homeSyncing,
+ blocks != null ? i18n.homeBlocksRemaining(blocks) : i18n.homeSyncing,
),
StatusIconStatus.fail => (BrandColors.error, i18n.homeDisconnected),
};
@@ -627,33 +322,3 @@ class _SyncStatusPill extends StatelessWidget {
);
}
}
-
-class _DesktopActions extends StatelessWidget {
- final VoidCallback onReceive;
- final VoidCallback onSend;
-
- const _DesktopActions({required this.onReceive, required this.onSend});
-
- @override
- Widget build(BuildContext context) {
- final i18n = AppLocalizations.of(context)!;
- return Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- BrandButton.secondary(
- label: i18n.homeReceive,
- icon: Icons.south_west,
- expand: false,
- onPressed: onReceive,
- ),
- const SizedBox(width: 10),
- BrandButton.secondary(
- label: i18n.homeSend,
- icon: Icons.north_east,
- expand: false,
- onPressed: onSend,
- ),
- ],
- );
- }
-}
### lib/screens/welcome.dart
@@ -24,13 +24,11 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
}
Future<void> _pushHomeIfWalletExists() async {
- if (await openExistingWallet(context) && mounted) {
- // A desktop OS opens nothing until the user types the password.
- Navigator.pushNamedAndRemoveUntil(
- context,
- isDesktopOS ? '/unlock' : '/wallet_home',
- (route) => false,
- );
+ // Through the same locks as a launch (App Lock, then security keys),
+ // never straight home.
+ final route = await existingWalletRoute(context);
+ if (route != null && mounted) {
+ Navigator.pushNamedAndRemoveUntil(context, route, (route) => false);
}
}
### lib/services/foreground_sync_service.dart
@@ -12,7 +12,8 @@ export 'package:wallet_background/wallet_background.dart'
startForegroundSyncIfEnabled,
restartForegroundSyncIfRunning,
isWalletFullySynced,
- stopSyncAndDeleteWallets;
+ stopSyncAndDeleteWallets,
+ ForegroundSyncLink;
/// Foreground-service isolate entry: bootstrap this isolate, then hand off to
/// the shared handler. Top-level `@pragma` so it survives tree-shaking.
### lib/services/shared_preferences_service.dart
@@ -18,8 +18,7 @@ class SharedPreferencesKeys {
static const String backgroundSyncEnabled = SettingsKeys.backgroundSyncEnabled;
static const String foregroundSyncEnabled = SettingsKeys.foregroundSyncEnabled;
static const String backgroundSyncIntervalMinutes = SettingsKeys.backgroundSyncIntervalMinutes;
- static const String appLockEnabled = SettingsKeys.appLockEnabled;
- static const String verboseLoggingEnabled = SettingsKeys.verboseLoggingEnabled;
+ static const String loggingEnabled = SettingsKeys.loggingEnabled;
static const String contacts = SettingsKeys.contacts;
static const String torMode = SettingsKeys.torMode;
static const String torSocksPort = SettingsKeys.torSocksPort;
### lib/util/logging.dart
@@ -1,5 +1,5 @@
// The whole logger lives in wallet-core (wallet_infra): the log() API +
-// formatter, the verbose gate, the file sink (FileLogSink), log rotation
+// formatter, the logging-on check, the file sink (FileLogSink), log rotation
// (cleanOldLogFiles), and file listing/export. The app only installs the sink
// (console + file) in wallet_core_glue.dart.
export 'package:wallet_infra/wallet_infra.dart'
### lib/util/platform.dart
@@ -8,11 +8,21 @@ bool get isDesktop => isDesktopLayout;
/// True when running natively on a desktop OS (Linux/Windows/macOS).
///
-/// What follows the OS rather than the layout keys off this: the wallet
-/// password typed at every launch, and announcing incoming transactions from
-/// the foreground. The iOS build on a Mac is not one of these. It keeps iOS's
-/// keystore-held password, App Lock and background sync.
+/// What follows the OS rather than the layout keys off this: announcing
+/// incoming transactions from the foreground (no background isolate), and
+/// "Lock after" a time without use. The iOS build on a Mac is not one of these.
+/// It keeps iOS's App Lock and background sync.
final bool isDesktopOS = Platform.isLinux || Platform.isWindows || Platform.isMacOS;
+/// True where the user types the wallet password at every launch: Linux and
+/// Windows. Elsewhere it is generated at onboarding and kept in the keystore
+/// (wallet_infra's `WalletSecrets.holdsWalletPassword`).
+final bool typesWalletPassword = Platform.isLinux || Platform.isWindows;
+
+/// True where App Lock (the device's own prompt: biometrics or the device
+/// passcode, Touch ID or the Mac's password on macOS) guards that generated
+/// password: Android, iOS and macOS.
+final bool usesDeviceLock = !typesWalletPassword;
+
/// True on the mobile platforms (Android/iOS), the iOS build on a Mac included.
final bool isMobile = Platform.isAndroid || Platform.isIOS;
### lib/wallet_core_glue.dart
@@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:io';
import 'package:flutter/widgets.dart';
+import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'package:skylight_wallet/models/app_wallet.dart';
@@ -28,7 +29,11 @@ import 'package:wallet_domain/wallet_domain.dart'
RestorePoint,
TxDetails,
baseUnitsToDecimalString;
-import 'package:wallet_monero/wallet_monero.dart' show MoneroWallet;
+import 'package:wallet_backup_platform/wallet_backup_platform.dart'
+ show MetadataBackupConfig, MetadataBackupSetup;
+import 'package:wallet_fhse/security_keys_ui.dart' show SecurityKeysUi, SecurityKeysUiConfig;
+import 'package:wallet_fhse/wallet_fhse.dart' show FhseNative, FhseWalletGuard;
+import 'package:wallet_monero/wallet_monero.dart' show MoneroWallet, closeOrphanedMoneroWallets;
import 'package:wallet_openalias/wallet_openalias.dart' show resolveOpenAlias;
const _moneroDecimals = 12;
@@ -46,6 +51,21 @@ void installWalletCore() {
WalletAppConfig.install(WalletAppConfig.skylight);
CryptoWallet.aliasResolver = resolveOpenAlias;
+ // Android: native Monero wallets an app isolate left open when it was
+ // destroyed (swiped away) are closed by whoever takes over.
+ WalletManager.closeOrphanedWallets = closeOrphanedMoneroWallets;
+
+ // Where the wallet password is generated (mobile and macOS) it is FHSE's
+ // root, derived from the seed, and security keys can later take it out of
+ // the keystore (Settings > Advanced Security). Installed in every isolate, so
+ // background runs know when the password is behind keys and check in with
+ // the view key instead. Where the user types it (Linux, Windows), a new
+ // wallet gets the same root and the typed password unlocks it, together with
+ // a key once keys are on; only where FHSE's library loads, so a computer
+ // without it keeps the typed password as the wallet password.
+ if (wcore.WalletSecrets.holdsWalletPassword || FhseNative.isAvailable) {
+ WalletManager.passwordGuard = const FhseWalletGuard();
+ }
wcore.NotificationService.windowsAppName = 'Skylight Wallet';
wcore.NotificationService.windowsAppUserModelId = 'org.magicgrants.skylight';
@@ -69,14 +89,13 @@ void installWalletCore() {
FiatRates.install(getTorProxy: TorSettingsService.sharedInstance.getProxy);
// The whole logger lives in wallet-core now: console + file sinks fan out
- // from one installed sink; the file sink is verbose-gated internally.
+ // from one installed sink; the file sink writes only with logging on.
wcore.WalletLog.sink = wcore.CompositeLogSink([
const wcore.DebugPrintLogSink(),
wcore.FileLogSink(),
]);
- wcore.WalletLog.isVerbose = () async =>
- await SharedPreferencesService.get<bool>(SharedPreferencesKeys.verboseLoggingEnabled) ??
- false;
+ wcore.WalletLog.isLoggingOn = () async =>
+ await SharedPreferencesService.get<bool>(SharedPreferencesKeys.loggingEnabled) ?? false;
CryptoWallet.incomingTxNotifier = (tx, _) {
final amount =
@@ -138,10 +157,10 @@ Future<bool> startupWalletManager(BuildContext context) =>
Future<bool> _loadExistingWalletManager(WalletManager manager) async {
if (await manager.hasAnyExistingWallet()) {
- if (_isMobile) {
- await manager.loadCachedDisplayState();
- manager.openWalletFilesAndSync();
- }
+ // App Lock is always on, so nothing is decrypted before the user gets past
+ // it: the unlock screen opens the wallet (reopenAfterAppLock). Linux and
+ // Windows wait for the typed password the same way.
+ if (wcore.WalletSecrets.holdsWalletPassword) await manager.loadCachedDisplayState();
return true;
}
return false;
@@ -215,37 +234,50 @@ Future<int> commitGeneratedWallet(
required DateTime restoreDate,
}) async {
final manager = Provider.of<WalletManager>(context, listen: false);
- await manager.restoreAll(seed: seed, from: RestorePoint.date(restoreDate));
+ await manager.restoreAll(seed: seed, from: RestorePoint.date(restoreDate), freshSeed: true);
manager.syncInBackground();
return manager.getWallet('XMR')!.getRestoreHeight();
}
-/// Arms the app-lock re-lock when the app goes to the background; see
-/// [WalletManager.armAppLockRelock], which both apps share so the behaviour
-/// cannot drift. Wrapped here only because Skylight reaches wallet-core through
-/// this layer rather than from screens.
-Future<bool> armAppLockRelock(BuildContext context) =>
- Provider.of<WalletManager>(context, listen: false).armAppLockRelock();
-
-/// Opens an already-existing wallet (used by the welcome safety-net). Returns
-/// false when there is none. Opens only on mobile: on a desktop OS the wallet
-/// waits for the typed password, and the caller shows the unlock screen.
-Future<bool> openExistingWallet(BuildContext context) async {
+/// After a sync or notifications toggle changes: Monero's view-only background
+/// copy and the view-only material every background run uses, set up or
+/// removed now rather than at the next launch ([WalletManager.applySyncSettings]).
+/// Bound before the caller's awaits.
+Future<void> Function() syncSettingsApplier(BuildContext context) =>
+ Provider.of<WalletManager>(context, listen: false).applySyncSettings;
+
+/// Where the welcome safety-net sends an install that already has a wallet,
+/// or null when there is none: through the same locks as a launch, so the
+/// unlock screen (App Lock is always on; the typed password on Linux and
+/// Windows), and a security key after it when keys are on.
+Future<String?> existingWalletRoute(BuildContext context) async {
+ final manager = Provider.of<WalletManager>(context, listen: false);
+ return await manager.hasAnyExistingWallet() ? '/unlock' : null;
+}
+
+/// App Lock on Linux and Windows after a time without use: the wallet stayed
+/// open, so the password is only checked again ([WalletManager.checkTypedPassword]).
+/// Null when the wallet is not open: [unlockWithPassword] opens it.
+Future<bool?> recheckPasswordIfOpen(BuildContext context, String password) async {
final manager = Provider.of<WalletManager>(context, listen: false);
- if (!await manager.hasAnyExistingWallet()) return false;
- if (_isMobile) manager.openWalletFilesAndSync();
- return true;
+ if (!manager.hasPassword) return null;
+ return manager.checkTypedPassword(password);
}
/// Opens the wallet with a desktop-entered password, then syncs. Throws on a
/// wrong password (the unlock screen shows the error).
-Future<void> unlockWithPassword(BuildContext context, String password) async {
+///
+/// Returns true when security keys are on: the password was right, and a key
+/// comes next, so the caller shows the security-key unlock instead.
+Future<bool> unlockWithPassword(BuildContext context, String password) async {
final manager = Provider.of<WalletManager>(context, listen: false);
if (!await manager.unlockWithTypedPassword(password)) {
throw Exception('Incorrect wallet password.');
}
+ if (!manager.hasPassword) return true;
await manager.openAll();
manager.syncInBackground();
+ return false;
}
/// Deletes the wallet and everything derived from it.
@@ -266,3 +298,36 @@ void applyConnectionChange(BuildContext context) {
// Restart the foreground service too, so its isolate re-reads the new server.
unawaited(manager.applyConnectionChange('XMR').then((_) => restartForegroundSyncIfRunning()));
}
+
+// ----- Security keys (FHSE) -----
+
+/// The shared security-key screens (wallet_fhse): Skylight's name, mark and
+/// home route, and where they find the wallet manager. UI isolate only.
+void installSecurityKeysUi() {
+ SecurityKeysUi.install(
+ SecurityKeysUiConfig(
+ appName: 'Skylight',
+ walletManagerOf: (context) => Provider.of<WalletManager>(context, listen: false),
+ homeRoute: '/wallet_home',
+ logo: (_) => SvgPicture.asset('assets/logo_nobg.svg', width: 44, height: 44),
+ ),
+ );
+}
+
+// ----- Metadata backup -----
+
+/// The metadata backup (wallet_backup): who each payment went to, its
+/// transaction key, and the address book, encrypted with the seed. Off until the
+/// user turns it on in Settings > Backup; then saved on this device, and to
+/// iCloud (iOS) or Android's Auto Backup (Android) only if the user turns that
+/// on too. UI isolate only, so a background run never writes a backup file.
+/// 25-word seeds have none.
+void installMetadataBackup() {
+ MetadataBackupSetup.install(
+ const MetadataBackupConfig(
+ appName: 'Skylight',
+ iCloudContainer: 'iCloud.org.magicgrants.skylightwallet',
+ exportFileStem: 'skylight-backup',
+ ),
+ );
+}
### lib/widgets/connection_settings_form.dart
@@ -128,8 +128,11 @@ class _ConnectionSettingsFormState extends State<ConnectionSettingsForm> {
final fg = _showSyncOptions && _foregroundSyncEnabled;
// Captured before the await so the notification starts from the live status.
final synced = fg && appWalletOf(context).isFullySynced;
+ final applySyncSettings = syncSettingsApplier(context);
await SharedPreferencesService.set<bool>(SharedPreferencesKeys.backgroundSyncEnabled, bg);
await SharedPreferencesService.set<bool>(SharedPreferencesKeys.foregroundSyncEnabled, fg);
+ // Both syncs are view-only: the copy they open exists before they start.
+ await applySyncSettings();
if (fg) {
await startForegroundSync(synced: synced);
} else {
### lib/widgets/home_labels.dart
@@ -0,0 +1,26 @@
+import 'package:skylight_wallet/l10n/app_localizations.dart';
+import 'package:skylight_wallet/widgets/ui/ui.dart';
+
+/// The home cards' strings.
+HomeLabels homeLabels(AppLocalizations i18n) => HomeLabels(
+ incomingTitle: i18n.homeIncomingTitle,
+ incomingMore: i18n.homeIncomingTitleMore,
+ unlocksIn: i18n.homeIncomingUnlocksIn,
+ confirmations: i18n.homeIncomingConfirmations,
+ chartTitle: i18n.homeChartTitle,
+ chartToday: i18n.homeChartToday,
+ chartEachCoin: i18n.homeChartEachCoin,
+ chartNew: i18n.homeChartNew,
+ chartEmpty: i18n.homeChartEmpty,
+);
+
+/// The security checklist's strings.
+SecurityChecklistLabels securityChecklistLabels(AppLocalizations i18n) => SecurityChecklistLabels(
+ title: i18n.homeChecklistTitle,
+ progress: i18n.homeChecklistProgress,
+ verifySeed: i18n.homeChecklistVerifySeed,
+ autoBackup: i18n.homeChecklistAutoBackup,
+ tor: i18n.homeChecklistTor,
+ privateLookups: i18n.homeChecklistPrivateLookups,
+ securityKeys: i18n.homeChecklistSecurityKeys,
+);
### lib/widgets/privacy_settings_sheets.dart
@@ -0,0 +1,147 @@
+import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
+import 'package:wallet_domain/wallet_domain.dart' show OpenAliasMode;
+
+import 'package:skylight_wallet/l10n/app_localizations.dart';
+import 'package:skylight_wallet/wallet_core_glue.dart';
+import 'package:skylight_wallet/models/fiat_rate_model.dart';
+import 'package:skylight_wallet/widgets/fiat_api_settings_form.dart';
+import 'package:skylight_wallet/widgets/tor_settings_form.dart';
+import 'package:skylight_wallet/widgets/ui/ui.dart';
+
+// The privacy settings sheets, shared by Settings and the home's security
+// checklist so both open the same thing.
+
+double _sheetMaxHeight(BuildContext sheetContext) {
+ final media = MediaQuery.of(sheetContext);
+ return (media.size.height - media.viewInsets.bottom) * 0.86;
+}
+
+/// Settings popup chrome, matching Spice's sheets: a handle, an icon + title
+/// header, then the form scrolling below (the form carries its own save
+/// button and pops on success).
+Future<void> showSettingsFormSheet(
+ BuildContext context, {
+ required IconData icon,
+ required String title,
+ required Widget form,
+}) {
+ return showBrandSheet<void>(
+ context: context,
+ isScrollControlled: true,
+ builder: (sheetContext) {
+ // Desktop modal: the card owns the edge padding and drops the drag handle.
+ final hpad = isDesktopModal ? 0.0 : 22.0;
+ return SafeArea(
+ top: false,
+ child: ConstrainedBox(
+ constraints: BoxConstraints(maxHeight: _sheetMaxHeight(sheetContext)),
+ child: Padding(
+ padding: EdgeInsets.only(top: isDesktopModal ? 0 : 10),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ const SheetHandle(),
+ Padding(
+ padding: EdgeInsets.fromLTRB(hpad, 0, hpad, 16),
+ child: Row(
+ children: [
+ SheetIcon(
+ icon: icon,
+ bg: BrandColors.surfaceTinted,
+ color: BrandColors.primaryDeep,
+ ),
+ const SizedBox(width: 11),
+ Expanded(child: Text(title, style: BrandText.sheetTitle)),
+ ],
+ ),
+ ),
+ Flexible(
+ child: SingleChildScrollView(
+ padding: EdgeInsets.fromLTRB(hpad, 0, hpad, isDesktopModal ? 0 : 16),
+ child: form,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ );
+ },
+ );
+}
+
+/// Tor: built in, external or off. Saving reconnects the wallet and restarts
+/// the price feed, which follows the Tor choice.
+Future<void> showTorSettingsSheet(BuildContext context) {
+ final i18n = AppLocalizations.of(context)!;
+ return showSettingsFormSheet(
+ context,
+ icon: Icons.public,
+ title: i18n.torSettingsTitle,
+ form: Builder(
+ builder: (formContext) => TorSettingsForm(
+ saveButtonLabel: i18n.torSettingsSaveButton,
+ onSaved: () {
+ appWalletOf(formContext).load();
+ Provider.of<FiatRateModel>(formContext, listen: false).startService();
+ Navigator.pop(formContext);
+ },
+ ),
+ ),
+ );
+}
+
+/// The price source: Tor-only, clearnet or off.
+Future<void> showFiatApiSettingsSheet(BuildContext context) {
+ final i18n = AppLocalizations.of(context)!;
+ return showSettingsFormSheet(
+ context,
+ icon: Icons.attach_money,
+ title: i18n.settingsFiatApiSettingsLabel,
+ form: Builder(
+ builder: (formContext) => FiatApiSettingsForm(
+ saveButtonLabel: i18n.torSettingsSaveButton,
+ onSaved: () async {
+ await Provider.of<FiatRateModel>(formContext, listen: false).startService();
+ if (formContext.mounted) Navigator.pop(formContext);
+ },
+ ),
+ ),
+ );
+}
+
+/// OpenAlias lookups: Tor-only, clearnet or off. True when the user saved.
+Future<bool?> showOpenAliasSheet(BuildContext context) {
+ final i18n = AppLocalizations.of(context)!;
+ return showOpenAliasSettingsSheet(
+ context,
+ labels: OpenAliasSettingsLabels(
+ title: i18n.settingsOpenAliasSettingsLabel,
+ subtitle: i18n.openAliasSettingsSheetSubtitle,
+ modeLabel: i18n.fiatApiSettingsModeLabel,
+ torOnly: i18n.fiatApiSettingsModeTorOnly,
+ torOnlyDesc: i18n.openAliasModeTorOnlyDesc,
+ clearnet: i18n.fiatApiSettingsModeClearnet,
+ clearnetDesc: i18n.openAliasModeClearnetDesc,
+ disabled: i18n.fiatApiSettingsModeDisabled,
+ disabledDesc: i18n.openAliasModeDisabledDesc,
+ save: i18n.torSettingsSaveButton,
+ cancel: i18n.cancel,
+ ),
+ );
+}
+
+/// Opens whichever of the price source and OpenAlias still goes over
+/// clearnet, one after the other: the checklist step that covers both.
+Future<void> showPrivateLookupSheets(BuildContext context) async {
+ if (await FiatRateModel.loadFiatApiMode() == FiatApiMode.clearnet) {
+ if (!context.mounted) return;
+ await showFiatApiSettingsSheet(context);
+ }
+ if (await OpenAliasMode.load() == OpenAliasMode.clearnet) {
+ if (!context.mounted) return;
+ await showOpenAliasSheet(context);
+ }
+}
### lib/widgets/wallet_navigation_bar.dart
@@ -5,13 +5,13 @@ import 'package:skylight_wallet/widgets/ui/ui.dart';
/// Brand bottom nav — flat icon+label tabs on the paper ground with a hairline
/// top border (copied from Spice's design). Skylight's destinations:
-/// Wallet / Contacts / Settings.
+/// Wallet / History / Contacts / Settings.
class WalletNavigationBar extends StatelessWidget {
final int selectedIndex;
const WalletNavigationBar({super.key, required this.selectedIndex});
- static const _routes = ['/wallet_home', '/address_book', '/settings'];
+ static const _routes = ['/wallet_home', '/history', '/address_book', '/settings'];
void _select(BuildContext context, int index) {
if (index == selectedIndex) return;
@@ -23,6 +23,7 @@ class WalletNavigationBar extends StatelessWidget {
final i18n = AppLocalizations.of(context)!;
final items = [
(Icons.account_balance_wallet_outlined, i18n.navigationBarWallet),
+ (Icons.history, i18n.navigationBarHistory),
(Icons.people_outline, i18n.addressBookTitle),
(Icons.tune, i18n.navigationBarSettings),
];
### linux/CMakeLists.txt
@@ -34,6 +34,37 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
"Debug" "Profile" "Release")
endif()
+# Memory hardening for the runner and for the plugins built with
+# APPLY_STANDARD_SETTINGS: zeroed stack variables, stack canaries, stack clash
+# probes, and hardware control-flow protection (CET on x86-64, BTI and PAC on
+# arm64). Each flag only where the compiler accepts it, checked with -Werror
+# as the build uses it: a flag the compiler takes but ignores for this target
+# only warns, and would then fail the build.
+include(CheckCXXCompilerFlag)
+set(HARDENING_FLAGS "")
+set(CMAKE_REQUIRED_FLAGS "-Werror")
+foreach(flag
+ -ftrivial-auto-var-init=zero
+ -fstack-protector-strong
+ -fstack-clash-protection
+ -fcf-protection=full
+ -mbranch-protection=standard)
+ string(MAKE_C_IDENTIFIER "HAVE${flag}" have_flag)
+ check_cxx_compiler_flag(${flag} ${have_flag})
+ if(${have_flag})
+ list(APPEND HARDENING_FLAGS ${flag})
+ endif()
+endforeach()
+unset(CMAKE_REQUIRED_FLAGS)
+
+# A position-independent executable, so ASLR moves the runner too.
+if(POLICY CMP0083)
+ cmake_policy(SET CMP0083 NEW)
+ include(CheckPIESupported)
+ check_pie_supported()
+endif()
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+
# Compilation settings that should be applied to most targets.
#
# Be cautious about adding new options here, as plugins use this function by
@@ -45,6 +76,22 @@ function(APPLY_STANDARD_SETTINGS TARGET)
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
target_compile_options(${TARGET} PRIVATE -Wno-deprecated)
+ # The hardening above; glibc's bounds-checked string and memory functions
+ # (FORTIFY, which needs optimisation, so not in debug builds), replacing
+ # any level the distribution's compiler sets; libstdc++'s bounds checks;
+ # and at link time, a read-only GOT and no executable stack. FORTIFY also
+ # marks functions such as write() warn-unused-result; that stays a warning,
+ # so a plugin that ignores one still builds.
+ if(HARDENING_FLAGS)
+ target_compile_options(${TARGET} PRIVATE ${HARDENING_FLAGS})
+ endif()
+ target_compile_options(${TARGET} PRIVATE
+ "$<$<NOT:$<CONFIG:Debug>>:-U_FORTIFY_SOURCE>"
+ "$<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=3>"
+ "$<$<NOT:$<CONFIG:Debug>>:-Wno-error=unused-result>")
+ target_compile_definitions(${TARGET} PRIVATE _GLIBCXX_ASSERTIONS)
+ target_link_options(${TARGET} PRIVATE
+ "-Wl,-z,relro" "-Wl,-z,now" "-Wl,-z,noexecstack")
endfunction()
# Flutter library and tool build rules.
### linux/flutter/generated_plugins.cmake
@@ -12,6 +12,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
list(APPEND FLUTTER_FFI_PLUGIN_LIST
flutter_zxing
tor_ffi_plugin
+ wallet_fhse
wallet_openalias
)
### linux/runner/main.cc
@@ -1,6 +1,19 @@
+#include <sys/prctl.h>
+#include <sys/resource.h>
+
#include "my_application.h"
int main(int argc, char** argv) {
+#ifdef NDEBUG
+ // Other processes of the same user can no longer attach to the wallet or
+ // read its memory through /proc/<pid>/mem, and a crash leaves no core dump
+ // holding keys. ssh-agent does the same. Release and profile builds only,
+ // so a debugger still attaches to debug builds.
+ prctl(PR_SET_DUMPABLE, 0, 0, 0, 0);
+ struct rlimit no_core = {0, 0};
+ setrlimit(RLIMIT_CORE, &no_core);
+#endif
+
g_autoptr(MyApplication) app = my_application_new();
return g_application_run(G_APPLICATION(app), argc, argv);
}
### macos/Podfile
@@ -1,4 +1,4 @@
-platform :osx, '10.15'
+platform :osx, '13.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -38,5 +38,27 @@ end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
+ # Xcode 27 refuses macOS deployment targets below 12.0, and several plugin
+ # podspecs still ask for 10.13 to 10.15. Raise them to the app's own minimum
+ # (13.0, for YubiKit).
+ #
+ # The memory hardening Enhanced Security turns on, for the C and C++ the
+ # pods compile (wallet_fhse's libsodium and libcbor, BoringSSL): zeroed
+ # stack variables, the typed allocator that hardened-heap (the Runner
+ # entitlements) builds on, and libc++'s fast bounds checks in release
+ # builds (debug builds already get its debug mode). Not
+ # ENABLE_ENHANCED_SECURITY itself, which would build for arm64e.
+ target.build_configurations.each do |config|
+ current = config.build_settings['MACOSX_DEPLOYMENT_TARGET']
+ if current && Gem::Version.new(current) < Gem::Version.new('13.0')
+ config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '13.0'
+ end
+ config.build_settings['CLANG_ENABLE_STACK_ZERO_INIT'] = 'YES'
+ config.build_settings['CLANG_ENABLE_C_TYPED_ALLOCATOR_SUPPORT'] = 'YES'
+ config.build_settings['CLANG_ENABLE_CPLUSPLUS_TYPED_ALLOCATOR_SUPPORT'] = 'YES'
+ unless config.name == 'Debug'
+ config.build_settings['CLANG_CXX_STANDARD_LIBRARY_HARDENING'] = 'fast'
+ end
+ end
end
end
### macos/Podfile.lock
@@ -0,0 +1,102 @@
+PODS:
+ - file_selector_macos (0.0.1):
+ - FlutterMacOS
+ - flutter_local_notifications (0.0.1):
+ - FlutterMacOS
+ - flutter_secure_storage_macos (6.1.3):
+ - FlutterMacOS
+ - flutter_zxing (0.0.1):
+ - FlutterMacOS
+ - FlutterMacOS (1.0.0)
+ - local_auth_darwin (0.0.1):
+ - Flutter
+ - FlutterMacOS
+ - package_info_plus (0.0.1):
+ - FlutterMacOS
+ - path_provider_foundation (0.0.1):
+ - Flutter
+ - FlutterMacOS
+ - screen_brightness_macos (0.1.0):
+ - FlutterMacOS
+ - share_plus (0.0.1):
+ - FlutterMacOS
+ - shared_preferences_foundation (0.0.1):
+ - Flutter
+ - FlutterMacOS
+ - tor_ffi_plugin (0.0.1)
+ - wallet_fhse (0.1.0):
+ - FlutterMacOS
+ - wallet_openalias (0.0.1)
+ - webcrypto (0.1.1):
+ - Flutter
+ - FlutterMacOS
+
+DEPENDENCIES:
+ - file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`)
+ - flutter_local_notifications (from `Flutter/ephemeral/.symlinks/plugins/flutter_local_notifications/macos`)
+ - flutter_secure_storage_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos`)
+ - flutter_zxing (from `Flutter/ephemeral/.symlinks/plugins/flutter_zxing/macos`)
+ - FlutterMacOS (from `Flutter/ephemeral`)
+ - local_auth_darwin (from `Flutter/ephemeral/.symlinks/plugins/local_auth_darwin/darwin`)
+ - package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)
+ - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
+ - screen_brightness_macos (from `Flutter/ephemeral/.symlinks/plugins/screen_brightness_macos/macos`)
+ - share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`)
+ - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
+ - tor_ffi_plugin (from `Flutter/ephemeral/.symlinks/plugins/tor_ffi_plugin/macos`)
+ - wallet_fhse (from `Flutter/ephemeral/.symlinks/plugins/wallet_fhse/macos`)
+ - wallet_openalias (from `Flutter/ephemeral/.symlinks/plugins/wallet_openalias/macos`)
+ - webcrypto (from `Flutter/ephemeral/.symlinks/plugins/webcrypto/darwin`)
+
+EXTERNAL SOURCES:
+ file_selector_macos:
+ :path: Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos
+ flutter_local_notifications:
+ :path: Flutter/ephemeral/.symlinks/plugins/flutter_local_notifications/macos
+ flutter_secure_storage_macos:
+ :path: Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos
+ flutter_zxing:
+ :path: Flutter/ephemeral/.symlinks/plugins/flutter_zxing/macos
+ FlutterMacOS:
+ :path: Flutter/ephemeral
+ local_auth_darwin:
+ :path: Flutter/ephemeral/.symlinks/plugins/local_auth_darwin/darwin
+ package_info_plus:
+ :path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos
+ path_provider_foundation:
+ :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
+ screen_brightness_macos:
+ :path: Flutter/ephemeral/.symlinks/plugins/screen_brightness_macos/macos
+ share_plus:
+ :path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos
+ shared_preferences_foundation:
+ :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
+ tor_ffi_plugin:
+ :path: Flutter/ephemeral/.symlinks/plugins/tor_ffi_plugin/macos
+ wallet_fhse:
+ :path: Flutter/ephemeral/.symlinks/plugins/wallet_fhse/macos
+ wallet_openalias:
+ :path: Flutter/ephemeral/.symlinks/plugins/wallet_openalias/macos
+ webcrypto:
+ :path: Flutter/ephemeral/.symlinks/plugins/webcrypto/darwin
+
+SPEC CHECKSUMS:
+ file_selector_macos: 3e56eaea051180007b900eacb006686fd54da150
+ flutter_local_notifications: 4ccab5b7a22835214a6672e3f9c5e8ae207dab36
+ flutter_secure_storage_macos: c2754d3483d20bb207bb9e5a14f1b8e771abcdb9
+ flutter_zxing: 99d4c62c06f609ccb5347c71f388cebd7d5705ef
+ FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1
+ local_auth_darwin: 63c73d6d28cc3e239be2b6aa460ea6e317cd5100
+ package_info_plus: 12f1c5c2cfe8727ca46cbd0b26677728972d9a5b
+ path_provider_foundation: 0b743cbb62d8e47eab856f09262bb8c1ddcfe6ba
+ screen_brightness_macos: 2d6d3af2165592d9a55ffcd95b7550970e41ebda
+ share_plus: 1fa619de8392a4398bfaf176d441853922614e89
+ shared_preferences_foundation: 5086985c1d43c5ba4d5e69a4e8083a389e2909e6
+ tor_ffi_plugin: 2566c1ed174688cca560fa0c64b7a799c66f07cb
+ wallet_fhse: 25a1183531ca0be07f3df5b4d79f435a329cb9bf
+ wallet_openalias: 7526f78902d0692e377d89af41d17894bb0ad5e0
+ webcrypto: aa788ff6b0a956e5d6e613b35b99c13e220ca2d0
+
+PODFILE CHECKSUM: f3a3719d2373eb7ff1e4bb7a363a2bae3b6a45ac
+
+COCOAPODS: 1.17.0
### macos/Runner.xcodeproj/project.pbxproj
@@ -21,12 +21,18 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
+ 9A1B2C3D4E5F6071829304B2 /* monero_libwallet2_api_c.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 9A1B2C3D4E5F6071829304B1 /* monero_libwallet2_api_c.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; };
335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; };
33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; };
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
+ 98D19850CDE966923BF75991 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 885BB32EF4DE9407933D50FD /* Pods_Runner.framework */; };
+ A1F3C2D4E5B60718293A4B5C /* SecurityKeyOperations.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4E6F5071829A3B4526D7E8F /* SecurityKeyOperations.swift */; };
+ B2E4D3C5F6A70819304B5C6D /* SecurityKeyChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5F70618293AB4C5637E8F90 /* SecurityKeyChannel.swift */; };
+ C3D5E4F607B8192A415C6D7E /* YubiKit in Frameworks */ = {isa = PBXBuildFile; productRef = F608172930AB4C5D748F90A1 /* YubiKit */; };
+ F71372956EE4A9B7113F18D6 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AEEDAB4AD80BFB98B031073 /* Pods_RunnerTests.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -53,18 +59,23 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
+ 9A1B2C3D4E5F6071829304B2 /* monero_libwallet2_api_c.dylib in Bundle Framework */,
);
name = "Bundle Framework";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 9A1B2C3D4E5F6071829304B1 /* monero_libwallet2_api_c.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = monero_libwallet2_api_c.dylib; path = Frameworks/monero_libwallet2_api_c.dylib; sourceTree = "<group>"; };
+ 1A7B0C9B1627946F0BC1C26A /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
+ 2AEEDAB4AD80BFB98B031073 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
- 33CC10ED2044A3C60003C045 /* skylight_wallet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "skylight_wallet.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 33A150061B229F2E68DDAF34 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
+ 33CC10ED2044A3C60003C045 /* skylight_wallet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = skylight_wallet.app; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
@@ -76,22 +87,32 @@
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
+ 47E7A4D069E5CE4EF14D8F7A /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
+ 67799E18F52DE14E4B978BB6 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
+ 8741BAB022871AF957248DC9 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
+ 885BB32EF4DE9407933D50FD /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
+ D4E6F5071829A3B4526D7E8F /* SecurityKeyOperations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SecurityKeyOperations.swift; path = "Flutter/ephemeral/.symlinks/plugins/wallet_fhse/apple/SecurityKeyOperations.swift"; sourceTree = SOURCE_ROOT; };
+ E5F70618293AB4C5637E8F90 /* SecurityKeyChannel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SecurityKeyChannel.swift; path = "Flutter/ephemeral/.symlinks/plugins/wallet_fhse/apple/SecurityKeyChannel.swift"; sourceTree = SOURCE_ROOT; };
+ EFA29E21B8FD908BF8BED000 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
331C80D2294CF70F00263BE5 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ F71372956EE4A9B7113F18D6 /* Pods_RunnerTests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
33CC10EA2044A3C60003C045 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ C3D5E4F607B8192A415C6D7E /* YubiKit in Frameworks */,
+ 98D19850CDE966923BF75991 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -125,6 +146,7 @@
331C80D6294CF71000263BE5 /* RunnerTests */,
33CC10EE2044A3C60003C045 /* Products */,
D73912EC22F37F3D000D13A0 /* Frameworks */,
+ 8061D9331C4AFC73B0B5CE1D /* Pods */,
);
sourceTree = "<group>";
};
@@ -164,6 +186,8 @@
children = (
33CC10F02044A3C60003C045 /* AppDelegate.swift */,
33CC11122044BFA00003C045 /* MainFlutterWindow.swift */,
+ E5F70618293AB4C5637E8F90 /* SecurityKeyChannel.swift */,
+ D4E6F5071829A3B4526D7E8F /* SecurityKeyOperations.swift */,
33E51913231747F40026EE4D /* DebugProfile.entitlements */,
33E51914231749380026EE4D /* Release.entitlements */,
33CC11242044D66E0003C045 /* Resources */,
@@ -172,9 +196,26 @@
path = Runner;
sourceTree = "<group>";
};
+ 8061D9331C4AFC73B0B5CE1D /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ 1A7B0C9B1627946F0BC1C26A /* Pods-Runner.debug.xcconfig */,
+ 8741BAB022871AF957248DC9 /* Pods-Runner.release.xcconfig */,
+ EFA29E21B8FD908BF8BED000 /* Pods-Runner.profile.xcconfig */,
+ 67799E18F52DE14E4B978BB6 /* Pods-RunnerTests.debug.xcconfig */,
+ 33A150061B229F2E68DDAF34 /* Pods-RunnerTests.release.xcconfig */,
+ 47E7A4D069E5CE4EF14D8F7A /* Pods-RunnerTests.profile.xcconfig */,
+ );
+ name = Pods;
+ path = Pods;
+ sourceTree = "<group>";
+ };
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 9A1B2C3D4E5F6071829304B1 /* monero_libwallet2_api_c.dylib */,
+ 885BB32EF4DE9407933D50FD /* Pods_Runner.framework */,
+ 2AEEDAB4AD80BFB98B031073 /* Pods_RunnerTests.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -186,6 +227,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
buildPhases = (
+ 0D248FED70260B47CBC28E2A /* [CP] Check Pods Manifest.lock */,
331C80D1294CF70F00263BE5 /* Sources */,
331C80D2294CF70F00263BE5 /* Frameworks */,
331C80D3294CF70F00263BE5 /* Resources */,
@@ -204,18 +246,23 @@
isa = PBXNativeTarget;
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
+ 3A3941C6F93506A6EC406544 /* [CP] Check Pods Manifest.lock */,
33CC10E92044A3C60003C045 /* Sources */,
33CC10EA2044A3C60003C045 /* Frameworks */,
33CC10EB2044A3C60003C045 /* Resources */,
33CC110E2044A8840003C045 /* Bundle Framework */,
3399D490228B24CF009A79C7 /* ShellScript */,
+ 8C5B5D5BF65EBA50355E7729 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
33CC11202044C79F0003C045 /* PBXTargetDependency */,
);
name = Runner;
+ packageProductDependencies = (
+ F608172930AB4C5D748F90A1 /* YubiKit */,
+ );
productName = Runner;
productReference = 33CC10ED2044A3C60003C045 /* skylight_wallet.app */;
productType = "com.apple.product-type.application";
@@ -260,6 +307,9 @@
Base,
);
mainGroup = 33CC10E42044A3C60003C045;
+ packageReferences = (
+ 0718293A4BC5D6E85990A1B2 /* XCRemoteSwiftPackageReference "yubikit-swift" */,
+ );
productRefGroup = 33CC10EE2044A3C60003C045 /* Products */;
projectDirPath = "";
projectRoot = "";
@@ -291,6 +341,28 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
+ 0D248FED70260B47CBC28E2A /* [CP] Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
+ );
+ name = "[CP] Check Pods Manifest.lock";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+ showEnvVarsInLog = 0;
+ };
3399D490228B24CF009A79C7 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
@@ -329,6 +401,45 @@
shellPath = /bin/sh;
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
};
+ 3A3941C6F93506A6EC406544 /* [CP] Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
+ );
+ name = "[CP] Check Pods Manifest.lock";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+ showEnvVarsInLog = 0;
+ };
+ 8C5B5D5BF65EBA50355E7729 /* [CP] Embed Pods Frameworks */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
+ );
+ name = "[CP] Embed Pods Frameworks";
+ outputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -346,6 +457,8 @@
files = (
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */,
33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */,
+ B2E4D3C5F6A70819304B5C6D /* SecurityKeyChannel.swift in Sources */,
+ A1F3C2D4E5B60718293A4B5C /* SecurityKeyOperations.swift in Sources */,
335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -380,6 +493,7 @@
/* Begin XCBuildConfiguration section */
331C80DB294CF71000263BE5 /* Debug */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = 67799E18F52DE14E4B978BB6 /* Pods-RunnerTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 1;
@@ -394,6 +508,7 @@
};
331C80DC294CF71000263BE5 /* Release */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = 33A150061B229F2E68DDAF34 /* Pods-RunnerTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 1;
@@ -408,6 +523,7 @@
};
331C80DD294CF71000263BE5 /* Profile */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = 47E7A4D069E5CE4EF14D8F7A /* Pods-RunnerTests.profile.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 1;
@@ -454,14 +570,15 @@
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ EXCLUDED_ARCHS = x86_64;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.14;
+ MACOSX_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
@@ -474,10 +591,15 @@
baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_CPLUSPLUS_TYPED_ALLOCATOR_SUPPORT = YES;
+ CLANG_ENABLE_C_TYPED_ALLOCATOR_SUPPORT = YES;
CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_STACK_ZERO_INIT = YES;
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
+ ENABLE_HARDENED_RUNTIME = YES;
+ ENABLE_SECURITY_COMPILER_WARNINGS = YES;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -530,6 +652,7 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ EXCLUDED_ARCHS = x86_64;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
@@ -543,7 +666,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.14;
+ MACOSX_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
@@ -586,14 +709,15 @@
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ EXCLUDED_ARCHS = x86_64;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.14;
+ MACOSX_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
@@ -606,10 +730,15 @@
baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_CPLUSPLUS_TYPED_ALLOCATOR_SUPPORT = YES;
+ CLANG_ENABLE_C_TYPED_ALLOCATOR_SUPPORT = YES;
CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_STACK_ZERO_INIT = YES;
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
+ ENABLE_HARDENED_RUNTIME = YES;
+ ENABLE_SECURITY_COMPILER_WARNINGS = YES;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -626,10 +755,15 @@
baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_CPLUSPLUS_TYPED_ALLOCATOR_SUPPORT = YES;
+ CLANG_ENABLE_C_TYPED_ALLOCATOR_SUPPORT = YES;
CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_STACK_ZERO_INIT = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
+ ENABLE_HARDENED_RUNTIME = YES;
+ ENABLE_SECURITY_COMPILER_WARNINGS = YES;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -700,6 +834,25 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
+
+/* Begin XCRemoteSwiftPackageReference section */
+ 0718293A4BC5D6E85990A1B2 /* XCRemoteSwiftPackageReference "yubikit-swift" */ = {
+ isa = XCRemoteSwiftPackageReference;
+ repositoryURL = "https://github.com/Yubico/yubikit-swift";
+ requirement = {
+ kind = exactVersion;
+ version = 1.4.0;
+ };
+ };
+/* End XCRemoteSwiftPackageReference section */
+
+/* Begin XCSwiftPackageProductDependency section */
+ F608172930AB4C5D748F90A1 /* YubiKit */ = {
+ isa = XCSwiftPackageProductDependency;
+ package = 0718293A4BC5D6E85990A1B2 /* XCRemoteSwiftPackageReference "yubikit-swift" */;
+ productName = YubiKit;
+ };
+/* End XCSwiftPackageProductDependency section */
};
rootObject = 33CC10E52044A3C60003C045 /* Project object */;
}
### macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -0,0 +1,24 @@
+{
+ "originHash" : "27c93eff4dfb0ee36f0f5d536b891dbb7ac5a65ff544f77bdd05550fd667147f",
+ "pins" : [
+ {
+ "identity" : "swift-log",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/apple/swift-log",
+ "state" : {
+ "revision" : "4038b6a4f74a1426f47eb1dd5b4bb5628a15d597",
+ "version" : "1.16.1"
+ }
+ },
+ {
+ "identity" : "yubikit-swift",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/Yubico/yubikit-swift",
+ "state" : {
+ "revision" : "e19212f2efbca9af280e57542e669885de5acdc1",
+ "version" : "1.4.0"
+ }
+ }
+ ],
+ "version" : 3
+}
### macos/Runner.xcworkspace/contents.xcworkspacedata
@@ -4,4 +4,7 @@
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
+ <FileRef
+ location = "group:Pods/Pods.xcodeproj">
+ </FileRef>
</Workspace>
### macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -0,0 +1,24 @@
+{
+ "originHash" : "27c93eff4dfb0ee36f0f5d536b891dbb7ac5a65ff544f77bdd05550fd667147f",
+ "pins" : [
+ {
+ "identity" : "swift-log",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/apple/swift-log",
+ "state" : {
+ "revision" : "4038b6a4f74a1426f47eb1dd5b4bb5628a15d597",
+ "version" : "1.16.1"
+ }
+ },
+ {
+ "identity" : "yubikit-swift",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/Yubico/yubikit-swift",
+ "state" : {
+ "revision" : "e19212f2efbca9af280e57542e669885de5acdc1",
+ "version" : "1.4.0"
+ }
+ }
+ ],
+ "version" : 3
+}
### macos/Runner/DebugProfile.entitlements
@@ -4,9 +4,47 @@
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
+ <!-- Outgoing connections: nodes, LWS, Tor, price and fiat APIs. -->
+ <key>com.apple.security.network.client</key>
+ <true/>
+ <!-- FIDO2 security keys over USB HID (YubiKit), for FHSE. -->
+ <key>com.apple.security.device.usb</key>
+ <true/>
+ <key>com.apple.security.files.user-selected.read-write</key>
+ <true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
+ <!-- Debug and profile builds only. Local builds are signed ad hoc, with no
+ Team ID, and the hardened runtime's library validation refuses to
+ load their frameworks. Release builds keep library validation, so
+ they need a Team ID: sign them with an Apple Development or
+ Developer ID certificate. -->
+ <key>com.apple.security.cs.disable-library-validation</key>
+ <true/>
+ <!-- Enhanced Security (macOS 26 and later; earlier versions ignore these),
+ as on iOS: all of it except pointer authentication, which needs
+ every binary in the process built for arm64e, and Flutter's engine
+ is arm64 only. Version 2 also turns on guard objects around freed
+ memory. checked-allocations is Memory Integrity Enforcement (hardware
+ memory tagging, M5 and later), enforced rather than in soft mode,
+ and enable-pure-data extends tagging to allocations without
+ pointers, where key material lives. hardened-heap pairs with the
+ typed allocators set in the Runner target and the Podfile. -->
+ <key>com.apple.security.hardened-process</key>
+ <true/>
+ <key>com.apple.security.hardened-process.enhanced-security-version-string</key>
+ <string>2</string>
+ <key>com.apple.security.hardened-process.platform-restrictions-string</key>
+ <string>2</string>
+ <key>com.apple.security.hardened-process.dyld-ro</key>
+ <true/>
+ <key>com.apple.security.hardened-process.hardened-heap</key>
+ <true/>
+ <key>com.apple.security.hardened-process.checked-allocations</key>
+ <true/>
+ <key>com.apple.security.hardened-process.checked-allocations.enable-pure-data</key>
+ <true/>
</dict>
</plist>
### macos/Runner/MainFlutterWindow.swift
@@ -2,6 +2,9 @@ import Cocoa
import FlutterMacOS
class MainFlutterWindow: NSWindow {
+ // FIDO2 security keys (YubiKit over USB HID) for FHSE wallet-file encryption.
+ private var securityKeyChannel: SecurityKeyChannel?
+
override func awakeFromNib() {
let flutterViewController = FlutterViewController()
let windowFrame = self.frame
@@ -12,6 +15,7 @@ class MainFlutterWindow: NSWindow {
self.minSize = NSSize(width: 900, height: 640)
RegisterGeneratedPlugins(registry: flutterViewController)
+ securityKeyChannel = SecurityKeyChannel(messenger: flutterViewController.engine.binaryMessenger)
super.awakeFromNib()
}
### macos/Runner/Release.entitlements
@@ -4,5 +4,36 @@
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
+ <!-- Outgoing connections: nodes, LWS, Tor, price and fiat APIs. -->
+ <key>com.apple.security.network.client</key>
+ <true/>
+ <!-- FIDO2 security keys over USB HID (YubiKit), for FHSE. -->
+ <key>com.apple.security.device.usb</key>
+ <true/>
+ <key>com.apple.security.files.user-selected.read-write</key>
+ <true/>
+ <!-- Enhanced Security (macOS 26 and later; earlier versions ignore these),
+ as on iOS: all of it except pointer authentication, which needs
+ every binary in the process built for arm64e, and Flutter's engine
+ is arm64 only. Version 2 also turns on guard objects around freed
+ memory. checked-allocations is Memory Integrity Enforcement (hardware
+ memory tagging, M5 and later), enforced rather than in soft mode,
+ and enable-pure-data extends tagging to allocations without
+ pointers, where key material lives. hardened-heap pairs with the
+ typed allocators set in the Runner target and the Podfile. -->
+ <key>com.apple.security.hardened-process</key>
+ <true/>
+ <key>com.apple.security.hardened-process.enhanced-security-version-string</key>
+ <string>2</string>
+ <key>com.apple.security.hardened-process.platform-restrictions-string</key>
+ <string>2</string>
+ <key>com.apple.security.hardened-process.dyld-ro</key>
+ <true/>
+ <key>com.apple.security.hardened-process.hardened-heap</key>
+ <true/>
+ <key>com.apple.security.hardened-process.checked-allocations</key>
+ <true/>
+ <key>com.apple.security.hardened-process.checked-allocations.enable-pure-data</key>
+ <true/>
</dict>
</plist>
### pubspec.lock
@@ -210,6 +210,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "7.0.1"
+ file_selector:
+ dependency: transitive
+ description:
+ name: file_selector
+ sha256: bd15e43e9268db636b53eeaca9f56324d1622af30e5c34d6e267649758c84d9a
+ url: "https://pub.dev"
+ source: hosted
+ version: "1.1.0"
+ file_selector_android:
+ dependency: transitive
+ description:
+ name: file_selector_android
+ sha256: "89243030ea4b3463fb402b44d5eeacc4ccb1c46a88870cb2a5080d693200c1ed"
+ url: "https://pub.dev"
+ source: hosted
+ version: "0.5.2+6"
+ file_selector_ios:
+ dependency: transitive
+ description:
+ name: file_selector_ios
+ sha256: "97269e5307a0ab813b1fa2430bada0a96e0afb74848417f8676f64ba5de0051c"
+ url: "https://pub.dev"
+ source: hosted
+ version: "0.5.3+6"
file_selector_linux:
dependency: transitive
description:
@@ -234,6 +258,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.7.0"
+ file_selector_web:
+ dependency: transitive
+ description:
+ name: file_selector_web
+ sha256: "73181fbc5257776d8ecaa6a94ab3c8e920ad143b9132a6d984a9271dfc6928d3"
+ url: "https://pub.dev"
+ source: hosted
+ version: "0.9.5"
file_selector_windows:
dependency: transitive
description:
@@ -681,8 +713,8 @@ packages:
dependency: "direct main"
description:
path: "impls/monero.dart"
- ref: "0f01328816eb671ff9e4f79a3c0c15990006fb12"
- resolved-ref: "0f01328816eb671ff9e4f79a3c0c15990006fb12"
+ ref: "96c7c077f9264ad9237742e4ac2e9593facd7c0f"
+ resolved-ref: "96c7c077f9264ad9237742e4ac2e9593facd7c0f"
url: "https://github.com/magicgrants/monero_c"
source: git
version: "0.0.0"
@@ -1269,6 +1301,24 @@ packages:
url: "https://github.com/MAGICGrants/wallet-core"
source: git
version: "0.1.0"
+ wallet_backup:
+ dependency: "direct main"
+ description:
+ path: "packages/wallet_backup"
+ ref: 2c2c8a3cbd33e5c28b958c25c0d002158e3a1185
+ resolved-ref: 2c2c8a3cbd33e5c28b958c25c0d002158e3a1185
+ url: "https://github.com/MAGICGrants/wallet-core"
+ source: git
+ version: "0.1.0"
+ wallet_backup_platform:
+ dependency: "direct main"
+ description:
+ path: "packages/wallet_backup_platform"
+ ref: 2c2c8a3cbd33e5c28b958c25c0d002158e3a1185
+ resolved-ref: 2c2c8a3cbd33e5c28b958c25c0d002158e3a1185
+ url: "https://github.com/MAGICGrants/wallet-core"
+ source: git
+ version: "0.1.0"
wallet_domain:
dependency: "direct main"
description:
@@ -1278,6 +1328,15 @@ packages:
url: "https://github.com/MAGICGrants/wallet-core"
source: git
version: "0.1.0"
+ wallet_fhse:
+ dependency: "direct main"
+ description:
+ path: "packages/wallet_fhse"
+ ref: 2c2c8a3cbd33e5c28b958c25c0d002158e3a1185
+ resolved-ref: 2c2c8a3cbd33e5c28b958c25c0d002158e3a1185
+ url: "https://github.com/MAGICGrants/wallet-core"
+ source: git
+ version: "0.1.0"
wallet_fiat:
dependency: "direct main"
description:
### pubspec.yaml
@@ -57,7 +57,7 @@ dependencies:
monero:
git:
url: https://github.com/magicgrants/monero_c
- ref: 0f01328816eb671ff9e4f79a3c0c15990006fb12
+ ref: 96c7c077f9264ad9237742e4ac2e9593facd7c0f
path: impls/monero.dart
# wallet-core packages; SHA-pinned for release, redirected to the local sibling
@@ -82,6 +82,23 @@ dependencies:
url: https://github.com/MAGICGrants/wallet-core
ref: 2c2c8a3cbd33e5c28b958c25c0d002158e3a1185
path: packages/wallet_openalias
+ # FHSE: security keys guarding the wallet password.
+ wallet_fhse:
+ git:
+ url: https://github.com/MAGICGrants/wallet-core
+ ref: 2c2c8a3cbd33e5c28b958c25c0d002158e3a1185
+ path: packages/wallet_fhse
+ # Metadata backup: payment destinations, tx keys and the address book.
+ wallet_backup:
+ git:
+ url: https://github.com/MAGICGrants/wallet-core
+ ref: 2c2c8a3cbd33e5c28b958c25c0d002158e3a1185
+ path: packages/wallet_backup
+ wallet_backup_platform:
+ git:
+ url: https://github.com/MAGICGrants/wallet-core
+ ref: 2c2c8a3cbd33e5c28b958c25c0d002158e3a1185
+ path: packages/wallet_backup_platform
wallet_background:
git:
url: https://github.com/MAGICGrants/wallet-core
### scripts/build-moneroc.sh
@@ -1,14 +1,22 @@
#!/usr/bin/env bash
#
-# Build monero_c's wallet2_api_c library for one target, at the FIXED
-# path /tmp/monero_c.
+# Build monero_c's wallet2_api_c library for one target, at a FIXED path:
+# /tmp/monero_c, or ~/Library/Caches/monero_c on macOS. Not /tmp there: CMake
+# always rewrites /private/tmp (the real path) to /tmp, so depends' staging
+# paths stop matching and the first package fails to install.
#
# Args:
-# $1 target (e.g. aarch64-linux-android, x86_64-linux-gnu, x86_64-w64-mingw32)
+# $1 target (e.g. aarch64-linux-android, x86_64-linux-gnu, x86_64-w64-mingw32,
+# aarch64-apple-darwin)
# $2 clone source (default: the local ./monero_c submodule; CI passes the remote URL)
#
# Run from the app repo root (needs pubspec.lock + scripts/reproducible.patch).
-# Output: /tmp/monero_c/monero_libwallet2_api_c/build/<target>/libwallet2_api_c.{so,dll}
+# Output: <path>/monero_libwallet2_api_c/build/<target>/libwallet2_api_c.{so,dll,dylib}
+#
+# macOS (on a Mac with Xcode, plus autoconf, automake, libtool, pkg-config and
+# xz): the app loads it from macos/Frameworks/monero_libwallet2_api_c.dylib,
+# copied there with `install_name_tool -id @rpath/monero_libwallet2_api_c.dylib`.
+# Apple silicon only; the macOS apps exclude x86_64.
#
set -euo pipefail
@@ -24,18 +32,26 @@ git config --global --add safe.directory '*'
git config --global user.name 'MAGIC Grants'
git config --global user.email 'info@magicgrants.org'
-rm -rf /tmp/monero_c
-git clone "$SRC" /tmp/monero_c
-git -C /tmp/monero_c checkout "$COMMIT"
+if [ "$(uname)" = Darwin ]; then
+ BUILD_DIR="$HOME/Library/Caches/monero_c"
+ JOBS="$(sysctl -n hw.logicalcpu)"
+else
+ BUILD_DIR=/tmp/monero_c
+ JOBS="$(nproc)"
+fi
+
+rm -rf "$BUILD_DIR"
+git clone "$SRC" "$BUILD_DIR"
+git -C "$BUILD_DIR" checkout "$COMMIT"
# Only the submodules a Monero build uses; the others are for other coins,
# and fetching them fails the build whenever one of their hosts is down.
-git -C /tmp/monero_c submodule update --init --recursive --force -- monero lwsf
+git -C "$BUILD_DIR" submodule update --init --recursive --force -- monero lwsf
-cd /tmp/monero_c
+cd "$BUILD_DIR"
# Pin the git-am committer date (baked into Monero's version string) + __DATE__/__TIME__.
export SOURCE_DATE_EPOCH="$(git log -1 --format=%ct)"
export GIT_COMMITTER_DATE="@$SOURCE_DATE_EPOCH"
./apply_patches.sh monero
patch -p1 < "$REPO/scripts/reproducible.patch"
unset MAKEFLAGS # use make's classic pipe jobserver (from reproducible.patch), not the fifo one
-./build_single.sh monero "$TARGET" -j"$(nproc)"
+./build_single.sh monero "$TARGET" -j"$JOBS"
### test/history_address_filter_test.dart
@@ -0,0 +1,71 @@
+import 'package:flutter_test/flutter_test.dart';
+import 'package:skylight_wallet/screens/history.dart';
+import 'package:wallet_domain/wallet_domain.dart';
+
+/// The history screen's address filter.
+///
+/// `recipients` is one list serving both directions (the wallet's own
+/// addresses on an incoming transaction, who was paid on an outgoing one), so
+/// the filter needs no direction branch. What is worth pinning is the two
+/// deliberate calls: change is matched, and nothing else is.
+TxDetails _tx({required List<TxRecipient> recipients, int direction = 0}) => TxDetails(
+ index: 0,
+ direction: direction,
+ hash: 'h',
+ amountBaseUnits: BigInt.one,
+ feeBaseUnits: BigInt.zero,
+ recipients: recipients,
+ accountIndex: 0,
+ subaddrIndexList: const [],
+ timestamp: 0,
+ height: 1,
+ confirmations: 1,
+ key: '',
+);
+
+void main() {
+ const alice = '8Alice';
+ const bob = '4Bob';
+
+ test('an incoming transaction received at the address matches', () {
+ final tx = _tx(recipients: [TxRecipient(alice, BigInt.one)]);
+ expect(txInvolvesAddress(tx, alice), isTrue);
+ });
+
+ test('an outgoing transaction that paid the address matches', () {
+ final tx = _tx(recipients: [TxRecipient(bob, BigInt.one)], direction: 1);
+ expect(txInvolvesAddress(tx, bob), isTrue);
+ });
+
+ test('change returned to the address matches', () {
+ // Deliberate: a spend that sent change back to this address involved it.
+ final tx = _tx(
+ recipients: [TxRecipient(bob, BigInt.one), TxRecipient(alice, BigInt.two, isChange: true)],
+ direction: 1,
+ );
+ expect(txInvolvesAddress(tx, alice), isTrue);
+ });
+
+ test('an unrelated transaction, or one with no recipients, does not match', () {
+ expect(txInvolvesAddress(_tx(recipients: [TxRecipient(bob, BigInt.one)]), alice), isFalse);
+ expect(txInvolvesAddress(_tx(recipients: const []), alice), isFalse);
+ });
+
+ test('matching is exact: no prefix, and base58 stays case-significant', () {
+ expect(
+ txInvolvesAddress(_tx(recipients: [TxRecipient('${alice}Extra', BigInt.one)]), alice),
+ isFalse,
+ );
+ expect(
+ txInvolvesAddress(_tx(recipients: [TxRecipient('4AbCd', BigInt.one)]), '4abcd'),
+ isFalse,
+ );
+ });
+
+ test('surrounding whitespace from a paste does not stop a match', () {
+ expect(
+ txInvolvesAddress(_tx(recipients: [TxRecipient(alice, BigInt.one)]), ' $alice\n'),
+ isTrue,
+ );
+ });
+}
### test/openalias_mode_test.dart
@@ -0,0 +1,77 @@
+import 'dart:io';
+
+import 'package:flutter_test/flutter_test.dart';
+import 'package:wallet_domain/wallet_domain.dart';
+import 'package:wallet_infra/testing.dart';
+import 'package:wallet_infra/wallet_infra.dart';
+import 'package:wallet_monero/wallet_monero.dart';
+import 'package:skylight_wallet/models/monero_wallet_adapter.dart';
+
+/// Skylight's send screen resolves names through this adapter, so the
+/// OpenAlias setting (Settings > Security and privacy) must reach it the same
+/// way it does in Spice: Clearnet-Only resolves with Tor off.
+void main() {
+ late Directory tmp;
+ late MoneroWalletAdapter adapter;
+ late List<int?> ports;
+
+ final address = '4${'a' * 94}';
+
+ setUpAll(() => WalletFileCrypto.kdf = const FastTestPbkdf2());
+ tearDownAll(() => WalletFileCrypto.kdf = const WebCryptoPbkdf2());
+
+ setUp(() async {
+ tmp = Directory.systemTemp.createTempSync('openalias_mode');
+ SharedPreferencesService.store = MemoryPreferenceStore();
+ WalletSecrets.store = MemorySecretStore();
+ WalletAppConfig.install(WalletAppConfig.skylight, directories: FixedDirectories(tmp));
+ useTestCaBundle();
+ WalletLog.sink = MemoryLogSink();
+ final backend = FakeMoneroBackend()..addressValidator = (a, _) => a == address;
+ final wallet = MoneroWallet(backend: backend);
+ backend.existingWalletPaths.add(await wallet.walletPathForType('lws'));
+ await wallet.openExisting(password: 'pw');
+ adapter = MoneroWalletAdapter(wallet, readStoredSeed: () async => null);
+
+ ports = [];
+ CryptoWallet.aliasResolver =
+ ({
+ required String alias,
+ required String network,
+ required String asset,
+ required int? socksPort,
+ String? nativeAsset,
+ }) async {
+ ports.add(socksPort);
+ return ResolvedAlias(address: address);
+ };
+ await TorSettingsService.sharedInstance.save(torMode: TorMode.disabled);
+ });
+
+ tearDown(() {
+ CryptoWallet.resetInjectablesForTesting();
+ TorSettingsService.sharedInstance.resetForTesting();
+ WalletAppConfig.resetForTesting();
+ CaBundle.resetForTesting();
+ SharedPreferencesService.resetForTesting();
+ tmp.deleteSync(recursive: true);
+ });
+
+ test('Clearnet-Only resolves with Tor off, without a proxy', () async {
+ await OpenAliasMode.clearnet.save();
+ final resolved = await adapter.resolveOpenAlias('donate.example.org');
+ expect(resolved?.address, address);
+ expect(ports, [null]);
+ });
+
+ test('Tor-Only with Tor off resolves nothing, and never asks', () async {
+ expect(await adapter.resolveOpenAlias('donate.example.org'), isNull);
+ expect(ports, isEmpty);
+ });
+
+ test('Disabled resolves nothing, and never asks', () async {
+ await OpenAliasMode.disabled.save();
+ expect(await adapter.resolveOpenAlias('donate.example.org'), isNull);
+ expect(ports, isEmpty);
+ });
+}
### test/route_policy_test.dart
@@ -0,0 +1,56 @@
+import 'package:flutter_test/flutter_test.dart';
+import 'package:skylight_wallet/main.dart' show appRouteNames;
+import 'package:skylight_wallet/route_policy.dart';
+import 'package:wallet_ui/wallet_ui.dart' show RouteAccess;
+
+/// The route policy (lib/route_policy.dart) is deny by default, so it must name
+/// every route, and the public ones are pinned here: making a screen reachable
+/// before the unlock should be a decision, not an accident.
+void main() {
+ test('every route says who may open it, and nothing else is listed', () {
+ final c = routePolicy.check(appRouteNames);
+ expect(c.unlisted, isEmpty, reason: 'add these to lib/route_policy.dart');
+ expect(c.stale, isEmpty, reason: 'remove these from lib/route_policy.dart');
+ });
+
+ test('only onboarding, the lock screens and the legal pages are public', () {
+ final public = {
+ for (final e in routePolicy.access.entries)
+ if (e.value == RouteAccess.public) e.key,
+ };
+ expect(public, {
+ '/welcome',
+ '/tor_settings',
+ '/fiat_api_setup',
+ '/connection_setup',
+ '/create_wallet',
+ '/create_wallet_password',
+ '/generate_seed',
+ '/restore_wallet',
+ '/scan_qr',
+ '/unlock',
+ '/security_key_unlock',
+ '/terms_of_service',
+ '/privacy_policy',
+ });
+ });
+
+ test('every wallet screen waits for the unlock', () {
+ for (final name in [
+ '/wallet_home',
+ '/send',
+ '/receive',
+ '/address_book',
+ '/history',
+ '/settings',
+ '/lws_details',
+ '/lws_keys',
+ '/secret_keys',
+ '/advanced_security',
+ '/metadata_backup',
+ ]) {
+ expect(routePolicy.requiresUnlock(name), isTrue, reason: name);
+ expect(routePolicy.allows(name, unlocked: false), isFalse, reason: name);
+ }
+ });
+}
### windows/CMakeLists.txt
@@ -45,6 +45,11 @@ function(APPLY_STANDARD_SETTINGS TARGET)
target_compile_options(${TARGET} PRIVATE /EHsc)
target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")
+ # Control Flow Guard, for the runner and the plugins built with these
+ # settings: an indirect call may only reach a real function entry point.
+ # Not /CETCOMPAT; see HardenProcess in runner/main.cpp.
+ target_compile_options(${TARGET} PRIVATE /guard:cf)
+ target_link_options(${TARGET} PRIVATE /guard:cf)
endfunction()
# Flutter library and tool build rules.
### windows/flutter/generated_plugins.cmake
@@ -17,6 +17,7 @@ list(APPEND FLUTTER_FFI_PLUGIN_LIST
flutter_local_notifications_windows
flutter_zxing
tor_ffi_plugin
+ wallet_fhse
wallet_openalias
)
### windows/runner/main.cpp
@@ -5,8 +5,40 @@
#include "flutter_window.h"
#include "utils.h"
+namespace {
+
+// Process-wide mitigations, applied before any other code runs.
+//
+// DLLs load only from the application directory and System32, not from the
+// working directory or PATH, so a DLL planted there is never picked up. None
+// may come from a network share or a low-integrity file, and System32's copy
+// wins over a same-named DLL dropped next to the app. The app opens its own
+// DLLs by bare name from its directory, and Windows' by System32 path, so
+// neither is affected.
+//
+// Not hardware shadow stacks (/CETCOMPAT): the Dart VM unwinds to an
+// exception handler by resetting the stack pointer, which a shadow stack
+// rejects.
+void HardenProcess() {
+ ::SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
+
+ PROCESS_MITIGATION_IMAGE_LOAD_POLICY image_load = {};
+ image_load.NoRemoteImages = 1;
+ image_load.NoLowMandatoryLabelImages = 1;
+ image_load.PreferSystem32Images = 1;
+ ::SetProcessMitigationPolicy(ProcessImageLoadPolicy, &image_load,
+ sizeof(image_load));
+
+ // End the process on heap corruption rather than carry on.
+ ::HeapSetInformation(nullptr, HeapEnableTerminationOnCorruption, nullptr, 0);
+}
+
+} // namespace
+
int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
_In_ wchar_t *command_line, _In_ int show_command) {
+ HardenProcess();
+
// Attach to console when present (e.g., 'flutter run') or create a
// new console when running with a debugger.
if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {Why this scored 35/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.