Merge branch 'main' into misc-fixes
What changed, and why it matters
This merge commit is a broad hardening and feature update for the Skylight Wallet. It adds Monero payment deep-link support, improves build and release security, tightens Tor and connection settings, and fixes several UI/UX issues. There is no clear evidence of an active security vulnerability being patched; instead, the changes look like defensive improvements and routine fixes.
Review the new deep-link handling path to confirm it cannot be used to bypass the lock screen or pre-fill a send with a malicious address before the user authenticates. Verify that the CI attestation and hash checks are active and that the signing secrets are not exposed to the build container. No urgent patch appears required, but treat this as a security-hardening release and validate the release artifacts against the published monero_c.sha256.
Security signals we found
CI/CD release pipeline hardening: binary hash verification, builder image attestation, checksum-pinned toolchain downloads, separation of build and signing stages
monero: deep-link intent filters added to AndroidManifest.xml and iOS Info.plist
Deep-link routing gated behind wallet existence and unlock state; payment URIs replayed only after reaching /wallet_home
Sensitive screens (/lws_keys, /secret_keys) wrapped with ReauthGate
Removal of exported MainActivity route override that previously ignored route extras/URIs
Local address over Tor rejected in connection settings; SOCKS port validated to 1-65535
QR scanner restricted to accepted payment URIs or valid addresses
Transaction broadcast failure handling distinguishes unknown outcome from connection failure
Native Android clipboard auto-clear after timeout with sensitive-clip flag
cargokit builds forced to use committed Cargo.lock via --locked
Evidence from the diff
The commit merges ‘main’ into ‘misc-fixes’ and touches CI/CD, Docker builder, Android/iOS manifests, localization, and many Dart screens. Security-relevant changes include: (1) CI hardening—release workflow now verifies monero_c binary hashes against pubspec.lock, verifies builder image provenance via GitHub attestations, pins rustup and Android command-line tool checksums, separates unsigned build from signing, and runs signing in an isolated container; (2) deep-link handling—adds monero: scheme intent filters and routes payment URIs to the send form only after unlock, with a guard that warns if the coin connection is not configured; (3) app-lock/route guards—secret-keys and LWS-keys routes are now wrapped in ReauthGate, and the previous exported-activity route override is removed; (4) Tor/connection fixes—blocks local addresses over Tor, validates SOCKS port range, and only starts built-in Tor when that mode is selected; (5) send flow improvements—QR scanner only accepts valid payment URIs or addresses, and transaction broadcast failures are categorized as unknown vs. not-sent; (6) clipboard timeout clearing is moved to native Android; (7) cargokit builds are forced to use –locked. No CVE or vendor security advisory is referenced in the commit materials.
Changed components
.github/workflows/build-builder-image.yml.github/workflows/release.ymlDockerfile.builderandroid/app/src/main/AndroidManifest.xmlandroid/app/src/main/kotlin/com/example/monero_light_wallet/MainActivity.ktios/Runner/Info.plistlib/main.dartlib/screens/desktop/home_shell.dartlib/screens/scan_qr.dartlib/screens/send.dartlib/screens/settings.dartlib/screens/tor_settings.dartlib/services/foreground_sync_service.dartlib/wallet_core_glue.dartlib/widgets/connection_settings_form.dartlib/widgets/tor_settings_form.dartmonero_c.sha256scripts/pin-rust-toolchain.shInspect captured patch +588 / −136
### .github/workflows/build-builder-image.yml
@@ -19,6 +19,7 @@ jobs:
build-and-push:
name: Build and Push Docker Image
runs-on: ubuntu-latest
+ environment: Builder
permissions:
contents: read
packages: write
@@ -60,7 +61,7 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,prefix=
- type=raw,value=latest
+ type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- name: Build and push Docker image
id: build
### .github/workflows/release.yml
@@ -106,11 +106,30 @@ jobs:
echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_OUTPUT
echo "Using Flutter version: ${FLUTTER_VERSION}"
+ verify-native:
+ name: Verify monero_c binaries
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+
+ - name: Binaries match the pinned monero_c commit
+ run: |
+ set -euo pipefail
+ EXPECTED=$(awk '/^ monero:/{f=1} f&&/resolved-ref:/{gsub(/"/,"",$2);print $2;exit}' pubspec.lock)
+ [ -n "$EXPECTED" ] || { echo "::error::no monero resolved-ref in pubspec.lock"; exit 1; }
+ MANIFEST=$(sed -n 's/^# monero_c //p' monero_c.sha256)
+ if [ "$EXPECTED" != "$MANIFEST" ]; then
+ echo "::error::monero_c.sha256 pins $MANIFEST but pubspec.lock pins $EXPECTED"
+ exit 1
+ fi
+ sha256sum -c monero_c.sha256
+
build-android:
name: Android
runs-on: ubuntu-latest
environment: Release
- needs: version
+ needs: [version, verify-native]
steps:
- name: Free up disk space
run: |
@@ -129,27 +148,46 @@ jobs:
- name: Pull builder image
run: docker pull ghcr.io/magicgrants/skylight-wallet-builder:latest
- - name: Set up Android signing
+ - name: Verify builder image provenance
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
- echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > ./android/keystore.jks
- cat > android/key.properties << EOF
- storePassword=${{ secrets.ANDROID_STORE_PASSWORD }}
- keyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}
- keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}
- storeFile=/tmp/skylight/android/keystore.jks
- EOF
+ set -euo pipefail
+ IMAGE=ghcr.io/magicgrants/skylight-wallet-builder
+ DIGEST=$(docker inspect --format='{{range .RepoDigests}}{{println .}}{{end}}' "$IMAGE:latest" | grep "^$IMAGE@" | head -n1 | cut -d@ -f2)
+ test -n "$DIGEST"
+ echo "Builder image: $IMAGE@$DIGEST"
+ # The signing build must only ever run inside an image the image
+ # workflow published from main, so a :latest moved by a dispatch from
+ # any other ref is rejected before a single secret is written.
+ gh attestation verify "oci://$IMAGE@$DIGEST" \
+ --repo MAGICGrants/skylight-wallet \
+ --cert-identity-regex '^https://github\.com/(?i:MAGICGrants)/skylight-wallet/\.github/workflows/build-builder-image\.yml@refs/heads/main$'
+ echo "BUILDER_IMAGE=$IMAGE@$DIGEST" >> "$GITHUB_ENV"
+
+ - name: Assert builder Flutter version matches pubspec
+ run: |
+ set -euo pipefail
+ EXPECTED='${{ needs.version.outputs.flutter_version }}'
+ ACTUAL=$(docker run --rm "$BUILDER_IMAGE" flutter --version --machine 2>/dev/null | jq -r '.frameworkVersion')
+ echo "builder Flutter: $ACTUAL / pubspec: $EXPECTED"
+ if [ "$EXPECTED" != "$ACTUAL" ]; then
+ echo "::error::Builder Flutter $ACTUAL does not match pubspec $EXPECTED"
+ exit 1
+ fi
- - name: Build APKs and AAB
+ - name: Build unsigned APKs and AAB
run: |
VERSION='${{ needs.version.outputs.version }}'
# Deterministic timestamp for reproducible builds
export SOURCE_DATE_EPOCH=$(git log -1 --format=%ct)
+ # No key.properties: gradle debug-signs; the real key is applied in the signing pass.
# Fixed build path for reproducibility
docker run --rm \
-v "$PWD:/tmp/skylight" \
-w /tmp/skylight \
-e SOURCE_DATE_EPOCH \
- ghcr.io/magicgrants/skylight-wallet-builder:latest \
+ "$BUILDER_IMAGE" \
bash -c "cp -a /opt/cargo /tmp/skylight-cargo && export CARGO_HOME=/tmp/skylight-cargo && export PUB_CACHE=/tmp/skylight/.pub-cache && flutter pub get --enforce-lockfile && bash scripts/pin-rust-toolchain.sh && flutter build apk --dart-define=DEMO_MODE=true --release --split-per-abi && flutter build appbundle --dart-define=DEMO_MODE=true --release -PplayStore=true"
mkdir -p dist
@@ -158,6 +196,40 @@ jobs:
cp -v build/app/outputs/flutter-apk/app-x86_64-release.apk "dist/skylight-wallet-${VERSION}-x86_64.apk"
cp -v build/app/outputs/bundle/release/app-release.aab "dist/skylight-wallet-${VERSION}.aab"
+ - name: Sign APKs and AAB
+ env:
+ KS_PASS: ${{ secrets.ANDROID_STORE_PASSWORD }}
+ KEY_PASS: ${{ secrets.ANDROID_KEY_PASSWORD }}
+ KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
+ run: |
+ set -euo pipefail
+ echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > "$RUNNER_TEMP/keystore.jks"
+ # Network-free signing pass: key never shares a process with the build.
+ # APKs get the app key; the AAB the Play upload key (debug JAR sig stripped first).
+ docker run --rm \
+ -v "$PWD/dist:/work" \
+ -v "$RUNNER_TEMP/keystore.jks:/keystore.jks:ro" \
+ -w /work \
+ -e KS_PASS -e KEY_PASS -e KEY_ALIAS \
+ "$BUILDER_IMAGE" \
+ bash -c '
+ set -euo pipefail
+ apksigner=$(ls -d "$ANDROID_HOME"/build-tools/*/apksigner | sort -V | tail -n1)
+ zipalign=$(ls -d "$ANDROID_HOME"/build-tools/*/zipalign | sort -V | tail -n1)
+ for apk in *.apk; do
+ "$zipalign" -p -f 4 "$apk" "$apk.aligned"
+ mv "$apk.aligned" "$apk"
+ "$apksigner" sign --ks /keystore.jks --ks-pass env:KS_PASS --key-pass env:KEY_PASS --ks-key-alias "$KEY_ALIAS" "$apk"
+ "$apksigner" verify --verbose "$apk"
+ done
+ for aab in *.aab; do
+ zip -d "$aab" "META-INF/*.RSA" "META-INF/*.SF" "META-INF/*.DSA" "META-INF/*.EC" >/dev/null 2>&1 || true
+ jarsigner -keystore /keystore.jks -storepass "$KS_PASS" -keypass "$KEY_PASS" -sigalg SHA256withRSA -digestalg SHA-256 "$aab" "$KEY_ALIAS"
+ jarsigner -keystore /keystore.jks -storepass "$KS_PASS" -verify "$aab"
+ done
+ '
+ rm -f "$RUNNER_TEMP/keystore.jks"
+
- name: Upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
@@ -170,7 +242,7 @@ jobs:
name: Linux (x86_64)
runs-on: ubuntu-latest
environment: Release
- needs: version
+ needs: [version, verify-native]
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
@@ -180,6 +252,34 @@ jobs:
- name: Pull builder image
run: docker pull ghcr.io/magicgrants/skylight-wallet-builder:latest
+ - name: Verify builder image provenance
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ set -euo pipefail
+ IMAGE=ghcr.io/magicgrants/skylight-wallet-builder
+ DIGEST=$(docker inspect --format='{{range .RepoDigests}}{{println .}}{{end}}' "$IMAGE:latest" | grep "^$IMAGE@" | head -n1 | cut -d@ -f2)
+ test -n "$DIGEST"
+ echo "Builder image: $IMAGE@$DIGEST"
+ # The signing build must only ever run inside an image the image
+ # workflow published from main, so a :latest moved by a dispatch from
+ # any other ref is rejected before a single secret is written.
+ gh attestation verify "oci://$IMAGE@$DIGEST" \
+ --repo MAGICGrants/skylight-wallet \
+ --cert-identity-regex '^https://github\.com/(?i:MAGICGrants)/skylight-wallet/\.github/workflows/build-builder-image\.yml@refs/heads/main$'
+ echo "BUILDER_IMAGE=$IMAGE@$DIGEST" >> "$GITHUB_ENV"
+
+ - name: Assert builder Flutter version matches pubspec
+ run: |
+ set -euo pipefail
+ EXPECTED='${{ needs.version.outputs.flutter_version }}'
+ ACTUAL=$(docker run --rm "$BUILDER_IMAGE" flutter --version --machine 2>/dev/null | jq -r '.frameworkVersion')
+ echo "builder Flutter: $ACTUAL / pubspec: $EXPECTED"
+ if [ "$EXPECTED" != "$ACTUAL" ]; then
+ echo "::error::Builder Flutter $ACTUAL does not match pubspec $EXPECTED"
+ exit 1
+ fi
+
- name: Build Linux packages
run: |
# cargokit builds the Rust plugins with `rustup run stable`, and the
@@ -189,7 +289,7 @@ jobs:
docker run --rm \
-v "$PWD:/workspace" \
-w /workspace \
- ghcr.io/magicgrants/skylight-wallet-builder:latest \
+ "$BUILDER_IMAGE" \
bash -c "flutter pub get --enforce-lockfile && bash scripts/pin-rust-toolchain.sh && flutter build linux --release && ./deb/build_deb.sh --version ${VERSION} && ./appimage/build_appimage.sh --version ${VERSION}"
mkdir -p dist
@@ -208,7 +308,7 @@ jobs:
name: Windows (x64)
runs-on: windows-2022
environment: Release
- needs: version
+ needs: [version, verify-native]
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
@@ -257,7 +357,7 @@ jobs:
name: iOS
runs-on: macos-26
environment: Release
- needs: version
+ needs: [version, verify-native]
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
### Dockerfile.builder
@@ -4,7 +4,11 @@ ARG FLUTTER_VERSION
# Passed by build-builder-image.yml from rust-toolchain.toml (single source of truth).
ARG RUST_VERSION
+# Installer/SDK tool pins (version + checksum). Bump version and hash together.
+ARG RUSTUP_VERSION=1.28.2
+ARG RUSTUP_INIT_SHA256=20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c
ARG ANDROID_CMDLINE_TOOLS_VERSION=11076708
+ARG ANDROID_CMDLINE_TOOLS_SHA256=2d2d50857e4eb553af5a6dc3ad507a17adf43d115264b1afc116f95c92e5e258
ARG ANDROID_BUILD_TOOLS_VERSION=36.0.0
ARG ANDROID_PLATFORM_VERSION=36
ARG ANDROID_NDK_VERSION=28.1.13356709
@@ -46,15 +50,23 @@ ENV RUSTUP_HOME=/opt/rustup
ENV PATH="/flutter/bin:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${CARGO_HOME}/bin:${PATH}"
ENV FLUTTER_ROOT="/flutter"
-# Install Rust with pinned version
-RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${RUST_VERSION} --profile minimal && \
+# Install Rust via a pinned, checksum-verified rustup-init (not curl|sh of a
+# live installer script). The toolchain itself is pinned by RUST_VERSION and
+# verified by rustup on download.
+RUN curl --proto '=https' --tlsv1.2 -sSfL -o /tmp/rustup-init \
+ "https://static.rust-lang.org/rustup/archive/${RUSTUP_VERSION}/x86_64-unknown-linux-gnu/rustup-init" && \
+ echo "${RUSTUP_INIT_SHA256} /tmp/rustup-init" | sha256sum -c - && \
+ chmod +x /tmp/rustup-init && \
+ /tmp/rustup-init -y --default-toolchain ${RUST_VERSION} --profile minimal && \
+ rm /tmp/rustup-init && \
. ${CARGO_HOME}/env && \
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android
-# Install Android SDK command-line tools with pinned version
+# Install Android SDK command-line tools with pinned version + checksum
RUN mkdir -p ${ANDROID_HOME}/cmdline-tools && \
cd ${ANDROID_HOME}/cmdline-tools && \
- curl -o cmdtools.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_CMDLINE_TOOLS_VERSION}_latest.zip && \
+ curl -fsSL -o cmdtools.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_CMDLINE_TOOLS_VERSION}_latest.zip && \
+ echo "${ANDROID_CMDLINE_TOOLS_SHA256} cmdtools.zip" | sha256sum -c - && \
unzip cmdtools.zip && \
mv cmdline-tools latest && \
rm cmdtools.zip
### android/app/src/main/AndroidManifest.xml
@@ -58,6 +58,13 @@
<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. -->
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW"/>
+ <category android:name="android.intent.category.DEFAULT"/>
+ <category android:name="android.intent.category.BROWSABLE"/>
+ <data android:scheme="monero"/>
+ </intent-filter>
</activity>
<!-- flutter_foreground_task background-sync service. Do not rename. -->
<service
### android/app/src/main/kotlin/com/example/monero_light_wallet/MainActivity.kt
@@ -4,6 +4,8 @@ import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.os.Build
+import android.os.Handler
+import android.os.Looper
import android.os.PersistableBundle
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
@@ -18,21 +20,16 @@ class MainActivity : FlutterFragmentActivity() {
// time; see build.gradle.kts.
private val storeReviewChannel = "org.magicgrants.wallet/store_review"
- // MainActivity is exported, so any app (or adb) can start it with an intent
- // that names a route, via the "route" extra or a data URI, and reach screens
- // past App Lock. The app takes no links, so ignore both: it always starts at
- // its own initial route, and a new intent never pushes one.
- override fun getInitialRoute(): String? = null
-
- override fun shouldHandleDeeplinking(): Boolean = false
-
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, secureClipboardChannel)
.setMethodCallHandler { call, result ->
when (call.method) {
"copySensitive" -> {
- copySensitive(call.argument<String>("text") ?: "")
+ copySensitive(
+ call.argument<String>("text") ?: "",
+ call.argument<Int>("clearAfterSeconds") ?: 60,
+ )
result.success(null)
}
// Android 13 shows its own clipboard confirmation, so the
@@ -54,15 +51,35 @@ class MainActivity : FlutterFragmentActivity() {
}
}
+ private val clipboardHandler = Handler(Looper.getMainLooper())
+ private var pendingClipClear: Runnable? = null
+
// Copies [text] flagged as sensitive so keyboards/clipboard UIs don't show a
// preview and it isn't synced. The extras key is honored on Android 13+
// (ClipDescription.EXTRA_IS_SENSITIVE) and by some earlier OEM keyboards.
- private fun copySensitive(text: String) {
+ private fun copySensitive(text: String, clearAfterSeconds: Int) {
val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
val clip = ClipData.newPlainText("", text)
clip.description.extras = PersistableBundle().apply {
putBoolean("android.content.extra.IS_SENSITIVE", true)
}
clipboard.setPrimaryClip(clip)
+
+ // Clear natively after the timeout: the Dart timer reads the clipboard
+ // first, which Android 10+ blocks for a backgrounded app. Writing isn't.
+ pendingClipClear?.let { clipboardHandler.removeCallbacks(it) }
+ if (clearAfterSeconds <= 0) return
+ val clear = Runnable {
+ pendingClipClear = null
+ try {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
+ clipboard.clearPrimaryClip()
+ } else {
+ clipboard.setPrimaryClip(ClipData.newPlainText("", ""))
+ }
+ } catch (_: Exception) {}
+ }
+ pendingClipClear = clear
+ clipboardHandler.postDelayed(clear, clearAfterSeconds * 1000L)
}
}
### ios/Runner/Info.plist
@@ -21,6 +21,17 @@
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleURLTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleURLName</key>
+ <string>org.magicgrants.skylight.payments</string>
+ <key>CFBundleURLSchemes</key>
+ <array>
+ <string>monero</string>
+ </array>
+ </dict>
+ </array>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
### lib/l10n/app_en.arb
@@ -1,5 +1,14 @@
{
"@@locale": "en",
+ "scanQrUnexpectedCode": "That QR isn't a valid address or payment code.",
+ "deepLinkCoinNotConfigured": "Please configure your {chain} connection first.",
+ "@deepLinkCoinNotConfigured": {
+ "placeholders": {
+ "chain": {
+ "type": "String"
+ }
+ }
+ },
"continueText": "Continue",
"cancel": "Cancel",
"done": "Done",
@@ -31,6 +40,7 @@
"connectionTypeLws": "Light Wallet Server",
"connectionTypeNode": "Monero Node",
"connectionRemoteIpNotAllowed": "Connections to remote IP addresses aren't allowed. Use a domain name or a local IP address.",
+ "connectionLocalOverTorNotAllowed": "A local address can't be reached through Tor. Turn Tor off, or use the server's onion address.",
"connectionProtocolHttps": "Removing protocol. Using HTTPS for domains.",
"connectionProtocolHttp": "Removing protocol. Using HTTP for local addresses.",
"connectionTestStop": "Stop",
@@ -166,7 +176,11 @@
"homeSynced": "Synced",
"homeTorConnected": "Tor · connected",
"homeTorConnecting": "Tor · connecting",
+ "homeTorDisconnected": "Tor · disconnected",
"homeTorOff": "Tor · off",
+ "homeTorExternalConnected": "External Tor · connected",
+ "homeTorExternalConnecting": "External Tor · connecting",
+ "homeTorExternalDisconnected": "External Tor · disconnected",
"homeReceive": "Receive",
"homeSend": "Send",
"homeNoTransactions": "No Transactions",
@@ -317,6 +331,7 @@
"sendIrreversibleNote": "Monero transactions are irreversible. Double-check the address and amount before sending.",
"sendSwitchUnit": "Switch amount unit",
"sendFailedToGetFeesError": "Failed to get fees.",
+ "sendNoConnectionError": "Couldn't reach the server. Check your connection and try again.",
"torSettingsTitle": "Tor Settings",
"torSettingsModeBuiltIn": "Built-in Tor",
"torSettingsModeExternal": "External Tor",
### lib/l10n/app_localizations.dart
@@ -93,6 +93,18 @@ abstract class AppLocalizations {
/// A list of this localizations delegate's supported locales.
static const List<Locale> supportedLocales = <Locale>[Locale('en'), Locale('pt')];
+ /// No description provided for @scanQrUnexpectedCode.
+ ///
+ /// In en, this message translates to:
+ /// **'That QR isn\'t a valid address or payment code.'**
+ String get scanQrUnexpectedCode;
+
+ /// No description provided for @deepLinkCoinNotConfigured.
+ ///
+ /// In en, this message translates to:
+ /// **'Please configure your {chain} connection first.'**
+ String deepLinkCoinNotConfigured(String chain);
+
/// No description provided for @continueText.
///
/// In en, this message translates to:
@@ -279,6 +291,12 @@ abstract class AppLocalizations {
/// **'Connections to remote IP addresses aren\'t allowed. Use a domain name or a local IP address.'**
String get connectionRemoteIpNotAllowed;
+ /// No description provided for @connectionLocalOverTorNotAllowed.
+ ///
+ /// In en, this message translates to:
+ /// **'A local address can\'t be reached through Tor. Turn Tor off, or use the server\'s onion address.'**
+ String get connectionLocalOverTorNotAllowed;
+
/// No description provided for @connectionProtocolHttps.
///
/// In en, this message translates to:
@@ -963,12 +981,36 @@ abstract class AppLocalizations {
/// **'Tor · connecting'**
String get homeTorConnecting;
+ /// No description provided for @homeTorDisconnected.
+ ///
+ /// In en, this message translates to:
+ /// **'Tor · disconnected'**
+ String get homeTorDisconnected;
+
/// No description provided for @homeTorOff.
///
/// In en, this message translates to:
/// **'Tor · off'**
String get homeTorOff;
+ /// No description provided for @homeTorExternalConnected.
+ ///
+ /// In en, this message translates to:
+ /// **'External Tor · connected'**
+ String get homeTorExternalConnected;
+
+ /// No description provided for @homeTorExternalConnecting.
+ ///
+ /// In en, this message translates to:
+ /// **'External Tor · connecting'**
+ String get homeTorExternalConnecting;
+
+ /// No description provided for @homeTorExternalDisconnected.
+ ///
+ /// In en, this message translates to:
+ /// **'External Tor · disconnected'**
+ String get homeTorExternalDisconnected;
+
/// No description provided for @homeReceive.
///
/// In en, this message translates to:
@@ -1743,6 +1785,12 @@ abstract class AppLocalizations {
/// **'Failed to get fees.'**
String get sendFailedToGetFeesError;
+ /// No description provided for @sendNoConnectionError.
+ ///
+ /// In en, this message translates to:
+ /// **'Couldn\'t reach the server. Check your connection and try again.'**
+ String get sendNoConnectionError;
+
/// No description provided for @torSettingsTitle.
///
/// In en, this message translates to:
### lib/l10n/app_localizations_en.dart
@@ -8,6 +8,14 @@ import 'app_localizations.dart';
class AppLocalizationsEn extends AppLocalizations {
AppLocalizationsEn([String locale = 'en']) : super(locale);
+ @override
+ String get scanQrUnexpectedCode => 'That QR isn\'t a valid address or payment code.';
+
+ @override
+ String deepLinkCoinNotConfigured(String chain) {
+ return 'Please configure your $chain connection first.';
+ }
+
@override
String get continueText => 'Continue';
@@ -104,6 +112,10 @@ class AppLocalizationsEn extends AppLocalizations {
String get connectionRemoteIpNotAllowed =>
'Connections to remote IP addresses aren\'t allowed. Use a domain name or a local IP address.';
+ @override
+ String get connectionLocalOverTorNotAllowed =>
+ 'A local address can\'t be reached through Tor. Turn Tor off, or use the server\'s onion address.';
+
@override
String get connectionProtocolHttps => 'Removing protocol. Using HTTPS for domains.';
@@ -474,9 +486,21 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get homeTorConnecting => 'Tor · connecting';
+ @override
+ String get homeTorDisconnected => 'Tor · disconnected';
+
@override
String get homeTorOff => 'Tor · off';
+ @override
+ String get homeTorExternalConnected => 'External Tor · connected';
+
+ @override
+ String get homeTorExternalConnecting => 'External Tor · connecting';
+
+ @override
+ String get homeTorExternalDisconnected => 'External Tor · disconnected';
+
@override
String get homeReceive => 'Receive';
@@ -888,6 +912,10 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get sendFailedToGetFeesError => 'Failed to get fees.';
+ @override
+ String get sendNoConnectionError =>
+ 'Couldn\'t reach the server. Check your connection and try again.';
+
@override
String get torSettingsTitle => 'Tor Settings';
### lib/l10n/app_localizations_pt.dart
@@ -8,6 +8,14 @@ import 'app_localizations.dart';
class AppLocalizationsPt extends AppLocalizations {
AppLocalizationsPt([String locale = 'pt']) : super(locale);
+ @override
+ String get scanQrUnexpectedCode => 'Esse QR não é um endereço ou código de pagamento válido.';
+
+ @override
+ String deepLinkCoinNotConfigured(String chain) {
+ return 'Por favor, configure sua conexão $chain primeiro.';
+ }
+
@override
String get continueText => 'Continuar';
@@ -104,6 +112,10 @@ class AppLocalizationsPt extends AppLocalizations {
String get connectionRemoteIpNotAllowed =>
'Conexões com endereços IP remotos não são permitidas. Use um nome de domínio ou um endereço IP local.';
+ @override
+ String get connectionLocalOverTorNotAllowed =>
+ 'Um endereço local não pode ser acessado via Tor. Desative o Tor ou use o endereço onion do servidor.';
+
@override
String get connectionProtocolHttps => 'Removendo protocolo. Usando HTTPS para domínios.';
@@ -475,9 +487,21 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get homeTorConnecting => 'Tor · conectando';
+ @override
+ String get homeTorDisconnected => 'Tor · desconectado';
+
@override
String get homeTorOff => 'Tor · desligado';
+ @override
+ String get homeTorExternalConnected => 'Tor externo · conectado';
+
+ @override
+ String get homeTorExternalConnecting => 'Tor externo · conectando';
+
+ @override
+ String get homeTorExternalDisconnected => 'Tor externo · desconectado';
+
@override
String get homeReceive => 'Receber';
@@ -889,6 +913,10 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get sendFailedToGetFeesError => 'Não foi possível carregar taxas.';
+ @override
+ String get sendNoConnectionError =>
+ 'Não foi possível conectar ao servidor. Verifique sua conexão e tente novamente.';
+
@override
String get torSettingsTitle => 'Configurações do Tor';
### lib/l10n/app_pt.arb
@@ -1,5 +1,14 @@
{
"@@locale": "pt",
+ "scanQrUnexpectedCode": "Esse QR não é um endereço ou código de pagamento válido.",
+ "deepLinkCoinNotConfigured": "Por favor, configure sua conexão {chain} primeiro.",
+ "@deepLinkCoinNotConfigured": {
+ "placeholders": {
+ "chain": {
+ "type": "String"
+ }
+ }
+ },
"continueText": "Continuar",
"cancel": "Cancelar",
"done": "Concluir",
@@ -31,6 +40,7 @@
"connectionTypeLws": "Servidor Light Wallet",
"connectionTypeNode": "Nó Monero",
"connectionRemoteIpNotAllowed": "Conexões com endereços IP remotos não são permitidas. Use um nome de domínio ou um endereço IP local.",
+ "connectionLocalOverTorNotAllowed": "Um endereço local não pode ser acessado via Tor. Desative o Tor ou use o endereço onion do servidor.",
"connectionProtocolHttps": "Removendo protocolo. Usando HTTPS para domínios.",
"connectionProtocolHttp": "Removendo protocolo. Usando HTTP para endereços locais.",
"connectionTestStop": "Parar",
@@ -166,7 +176,11 @@
"homeSynced": "Sincronizado",
"homeTorConnected": "Tor · conectado",
"homeTorConnecting": "Tor · conectando",
+ "homeTorDisconnected": "Tor · desconectado",
"homeTorOff": "Tor · desligado",
+ "homeTorExternalConnected": "Tor externo · conectado",
+ "homeTorExternalConnecting": "Tor externo · conectando",
+ "homeTorExternalDisconnected": "Tor externo · desconectado",
"homeReceive": "Receber",
"homeSend": "Enviar",
"homeNoTransactions": "Sem transações",
@@ -317,6 +331,7 @@
"sendIrreversibleNote": "Transações Monero são irreversíveis. Confira o endereço e o valor antes de enviar.",
"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.",
"torSettingsTitle": "Configurações do Tor",
"torSettingsModeBuiltIn": "Tor Integrado",
"torSettingsModeExternal": "Tor Externo",
### lib/main.dart
@@ -46,6 +46,7 @@ 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/wallet_core_glue.dart';
+import 'package:wallet_domain/wallet_domain.dart' show WalletManager, parsePaymentUri;
import 'package:wallet_infra/wallet_infra.dart' show HostPlatform;
void main() async {
@@ -152,8 +153,14 @@ class _AppRootState extends State<_AppRoot> with WidgetsBindingObserver {
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;
+ static const _paymentUriSchemes = {'monero'};
+
static void _markSubtreeDirty(Element element) {
element.markNeedsBuild();
element.visitChildren(_markSubtreeDirty);
@@ -176,8 +183,14 @@ class _AppRootState extends State<_AppRoot> with WidgetsBindingObserver {
'/unlock': (context) => UnlockScreen(),
'/wallet_home': (context) => WalletHomeScreen(),
'/settings': (context) => SettingsScreen(),
- '/lws_keys': (context) => LwsKeysScreen(),
- '/secret_keys': (context) => SecretKeysScreen(),
+ '/lws_keys': (context) => ReauthGate(
+ reason: AppLocalizations.of(context)!.settingsAppLockUnlockReason,
+ child: LwsKeysScreen(),
+ ),
+ '/secret_keys': (context) => ReauthGate(
+ reason: AppLocalizations.of(context)!.revealSeedAuthReason,
+ child: SecretKeysScreen(),
+ ),
'/send': (context) => SendScreen(),
'/scan_qr': (context) => ScanQrScreen(),
'/receive': (context) => ReceiveScreen(),
@@ -201,15 +214,77 @@ class _AppRootState extends State<_AppRoot> with WidgetsBindingObserver {
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
+ _routeObserver.current.addListener(_onRouteChanged);
}
@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);
+ _routeObserver.current.removeListener(_onRouteChanged);
_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));
+ }
+
+ void _openPaymentUri(String raw) {
+ if (!mounted) return;
+ final manager = Provider.of<WalletManager>(context, listen: false);
+ final request = parsePaymentUri(raw, manager.allWallets);
+ if (request == null) return;
+ final wallet = manager.getWallet(request.coinSymbol);
+ // A coin with no connection set up can't send; warn instead of opening a form
+ // that can't complete. The toast + l10n need a context below the MaterialApp,
+ // so they go through the navigator's overlay rather than this (root) context.
+ if (wallet == null || wallet.connectionAddress.isEmpty) {
+ final overlay = _navigatorKey.currentState?.overlay;
+ if (overlay == null) return;
+ final name = wallet?.blockchainName ?? request.coinSymbol;
+ showBrandToastOnOverlay(
+ overlay,
+ AppLocalizations.of(overlay.context)!.deepLinkCoinNotConfigured(name),
+ );
+ return;
+ }
+ _navigatorKey.currentState?.pushNamed(
+ '/send',
+ arguments: SendScreenArgs(destinationAddress: request.address, amount: request.amount),
+ );
+ }
+
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (!isMobile) return;
@@ -292,8 +367,16 @@ class _AppRootState extends State<_AppRoot> with WidgetsBindingObserver {
if (!_startedServices) {
_startedServices = true;
- TorSettingsService.sharedInstance.loadSettings();
- TorService.sharedInstance.start();
+ _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.
+ unawaited(() async {
+ await TorSettingsService.sharedInstance.loadSettings();
+ if (TorSettingsService.sharedInstance.torMode == TorMode.builtIn) {
+ await TorService.sharedInstance.start();
+ }
+ }());
// Attach the manager once so the (multicoin) fiat model knows to
// fetch XMR; every startService() afterwards can stay argless.
@@ -346,6 +429,14 @@ class _AppRootState extends State<_AppRoot> with WidgetsBindingObserver {
);
},
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))!];
+ },
locale: Locale.fromSubtags(languageCode: languageProvider.language),
onGenerateRoute: _onGenerateRoute,
);
@@ -389,17 +480,19 @@ class _NoTransitionPageRoute<T> extends MaterialPageRoute<T> {
/// Tracks the name of the route currently on top, so the re-lock does not stack
/// a second `/unlock` on one that is already showing.
class _CurrentRouteObserver extends NavigatorObserver {
- String? currentName;
+ final ValueNotifier<String?> current = ValueNotifier<String?>(null);
+
+ String? get currentName => current.value;
@override
void didPush(Route<dynamic> route, Route<dynamic>? previousRoute) =>
- currentName = route.settings.name;
+ current.value = route.settings.name;
@override
void didPop(Route<dynamic> route, Route<dynamic>? previousRoute) =>
- currentName = previousRoute?.settings.name;
+ current.value = previousRoute?.settings.name;
@override
void didReplace({Route<dynamic>? newRoute, Route<dynamic>? oldRoute}) =>
- currentName = newRoute?.settings.name;
+ current.value = newRoute?.settings.name;
}
### lib/screens/desktop/home_shell.dart
@@ -1,12 +1,9 @@
-import 'dart:async';
-
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:skylight_wallet/l10n/app_localizations.dart';
import 'package:skylight_wallet/screens/settings.dart';
-import 'package:skylight_wallet/services/tor_service.dart';
import 'package:skylight_wallet/widgets/ui/ui.dart';
/// The top-level desktop destinations, mirroring the mobile navigation bar
@@ -89,11 +86,6 @@ class _DesktopShellState extends State<DesktopShell> {
static String _cachedVersion = '';
String _version = _cachedVersion;
- // TorService exposes no change notification, so poll its status and rebuild
- // when it flips (e.g. connecting → connected after launch).
- Timer? _torPoll;
- TorConnectionStatus _torState = TorService.sharedInstance.status;
-
@override
void initState() {
super.initState();
@@ -103,16 +95,6 @@ class _DesktopShellState extends State<DesktopShell> {
if (mounted) setState(() => _version = _cachedVersion);
});
}
- _torPoll = Timer.periodic(const Duration(seconds: 1), (_) {
- final status = TorService.sharedInstance.status;
- if (mounted && status != _torState) setState(() => _torState = status);
- });
- }
-
- @override
- void dispose() {
- _torPoll?.cancel();
- super.dispose();
}
void _go(String route) {
@@ -215,7 +197,17 @@ class _DesktopShellState extends State<DesktopShell> {
onTap: () => showSettingsSheet(context),
),
const SizedBox(height: 6),
- _torStatus(),
+ TorStatusPill(
+ labels: TorStatusLabels(
+ connected: i18n.homeTorConnected,
+ connecting: i18n.homeTorConnecting,
+ disconnected: i18n.homeTorDisconnected,
+ off: i18n.homeTorOff,
+ externalConnected: i18n.homeTorExternalConnected,
+ externalConnecting: i18n.homeTorExternalConnecting,
+ externalDisconnected: i18n.homeTorExternalDisconnected,
+ ),
+ ),
if (_version.isNotEmpty)
Padding(
padding: const EdgeInsets.only(left: 14, top: 1),
@@ -285,35 +277,4 @@ class _DesktopShellState extends State<DesktopShell> {
),
);
}
-
- Widget _torStatus() {
- final i18n = AppLocalizations.of(context)!;
- final (Color color, String text) = switch (_torState) {
- TorConnectionStatus.connected => (BrandColors.purple, i18n.homeTorConnected),
- TorConnectionStatus.connecting => (BrandColors.warning, i18n.homeTorConnecting),
- TorConnectionStatus.disconnected => (BrandColors.inkFaint, i18n.homeTorOff),
- };
- return Padding(
- padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 4),
- child: Row(
- children: [
- Container(
- width: 7,
- height: 7,
- decoration: BoxDecoration(color: color, shape: BoxShape.circle),
- ),
- const SizedBox(width: 9),
- Text(
- text,
- style: TextStyle(
- fontFamily: 'Ubuntu',
- fontSize: 12,
- height: 1,
- color: BrandColors.inkMuted,
- ),
- ),
- ],
- ),
- );
- }
}
### lib/screens/scan_qr.dart
@@ -3,15 +3,28 @@ import 'package:flutter/material.dart';
import 'package:skylight_wallet/l10n/app_localizations.dart';
import 'package:skylight_wallet/widgets/ui/ui.dart';
+/// Optional arguments for the scan route. When [accept] is given, the scanner
+/// only returns a code it accepts and keeps scanning otherwise, so an unexpected
+/// QR never pops back; [invalidMessage] is shown (throttled) on a reject.
+class ScanQrArgs {
+ final bool Function(String text) accept;
+ final String? invalidMessage;
+
+ const ScanQrArgs({required this.accept, this.invalidMessage});
+}
+
class ScanQrScreen extends StatelessWidget {
const ScanQrScreen({super.key});
@override
Widget build(BuildContext context) {
final i18n = AppLocalizations.of(context)!;
+ final args = ModalRoute.of(context)?.settings.arguments as ScanQrArgs?;
return ScanQrView(
title: i18n.scanQrTitle,
+ accept: args?.accept,
+ invalidMessage: args?.invalidMessage,
onResult: (text) => Navigator.pop(context, text),
onBack: () => Navigator.pop(context),
);
### lib/screens/send.dart
@@ -4,7 +4,14 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
-import 'package:wallet_domain/wallet_domain.dart' show baseUnitsToDecimalString, decimalToBaseUnits;
+import 'package:wallet_domain/wallet_domain.dart'
+ show
+ baseUnitsToDecimalString,
+ decimalToBaseUnits,
+ parsePaymentUri,
+ BroadcastFailure,
+ BroadcastOutcome;
+import 'package:wallet_infra/wallet_infra.dart' show RequestNotSentException;
import 'package:wallet_infra/wallet_infra.dart' show StoreReview;
import 'package:skylight_wallet/l10n/app_localizations.dart';
@@ -13,6 +20,7 @@ import 'package:skylight_wallet/models/contact_model.dart';
import 'package:skylight_wallet/models/fiat_rate_model.dart';
import 'package:skylight_wallet/models/wallet_types.dart';
import 'package:skylight_wallet/screens/desktop/home_shell.dart';
+import 'package:skylight_wallet/screens/scan_qr.dart';
import 'package:skylight_wallet/util/formatting.dart';
import 'package:skylight_wallet/util/logging.dart';
import 'package:skylight_wallet/util/platform.dart';
@@ -141,38 +149,31 @@ class _SendScreenState extends State<SendScreen> {
Future<void> _scanQrCode() async {
final wallet = appWalletOf(context);
+ final cw = xmrWallet(context);
final i18n = AppLocalizations.of(context)!;
- final result = await Navigator.pushNamed(context, '/scan_qr');
+ // The scanner only returns a code it claims — a standard monero: payment URI
+ // or a bare address — and keeps scanning on anything else, so an unexpected QR
+ // never pops back to this form.
+ bool accept(String text) =>
+ (cw != null && parsePaymentUri(text, [cw]) != null) || wallet.isAddressValid(text);
- if (result == null || result is! String) return;
-
- String address = '';
- String? amount;
- final uri = Uri.tryParse(result);
-
- if (uri != null && uri.scheme == 'monero') {
- if (!wallet.isAddressValid(uri.path)) {
- if (mounted) {
- showBrandToast(context, i18n.sendInvalidAddressError);
- }
- return;
- }
+ final result = await Navigator.pushNamed(
+ context,
+ '/scan_qr',
+ arguments: ScanQrArgs(accept: accept, invalidMessage: i18n.scanQrUnexpectedCode),
+ );
- address = uri.path;
+ if (result == null || result is! String) return;
- amount = uri.queryParameters['tx_amount'];
- } else if (wallet.isAddressValid(result)) {
- address = result;
- } else {
- if (mounted) {
- showBrandToast(context, i18n.sendInvalidAddressError);
- }
- return;
- }
+ // Accepted, so it parses as a monero: payment URI or is a bare address.
+ final request = cw == null ? null : parsePaymentUri(result, [cw]);
+ final address = request?.address ?? result;
+ final amount = request?.amount;
+ if (!mounted) return;
_destinationAddressController.text = address;
- if (amount != null) {
+ if (amount != null && amount.isNotEmpty) {
// A payment request is denominated in XMR, so entry switches to XMR.
_amount.setCoinText(_asExactAmount(amount));
}
@@ -519,6 +520,9 @@ class _SendScreenState extends State<SendScreen> {
final feeRatio = tx.amount > 0 ? tx.fee / tx.amount : null;
final showHighFeeWarning = feeRatio != null && feeRatio > 0.10;
+ var unresolved = false;
+ var connectionFailed = false;
+
final committed = await showConfirmSendSheet(
context: context,
labels: ConfirmSendLabels(
@@ -543,9 +547,25 @@ class _SendScreenState extends State<SendScreen> {
highFeeWarning: showHighFeeWarning ? i18n.confirmSendHighFeeWarning(_highFeeToken) : null,
highFeeToken: _highFeeToken,
highFeePercent: showHighFeeWarning ? '${(feeRatio * 100).round()}%' : null,
- onConfirm: () => _commitTx(tx, destinationAddress),
+ onConfirm: () => _commitTx(
+ tx,
+ destinationAddress,
+ onUnresolved: () => unresolved = true,
+ onConnectionFailed: () => connectionFailed = true,
+ ),
);
+ // Nothing sent: toast already shown, stay on the form.
+ if (connectionFailed) return;
+
+ if (unresolved) {
+ // Recorded as unresolved: warn rather than claim success, then route home.
+ if (mounted) await _showUnresolvedSendSheet();
+ if (mounted) {
+ Navigator.pushNamed(context, '/wallet_home', arguments: {'showTxSuccessToast': false});
+ }
+ return;
+ }
if (committed == true) {
// The send went through: ask for a store review on a later launch.
unawaited(StoreReview.markEligible());
@@ -555,14 +575,71 @@ class _SendScreenState extends State<SendScreen> {
}
}
- /// Commits the transaction; surfaces its own errors as snackbars (matching the
- /// retired confirm screen) and rethrows so the sheet stays open on failure.
- Future<void> _commitTx(AppPendingTx tx, String destinationAddress) async {
+ /// Warns that a send was never confirmed (may or may not be in the network).
+ Future<void> _showUnresolvedSendSheet() {
+ final i18n = AppLocalizations.of(context)!;
+ return showBrandSheet<void>(
+ context: context,
+ builder: (sheetContext) => SafeArea(
+ top: false,
+ child: Padding(
+ padding: isDesktopModal ? EdgeInsets.zero : const EdgeInsets.fromLTRB(22, 8, 22, 12),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ const SheetHandle(),
+ Row(
+ children: [
+ SheetIcon(
+ icon: Icons.warning_rounded,
+ bg: BrandColors.warningBg,
+ color: BrandColors.warning,
+ ),
+ const SizedBox(width: 11),
+ Expanded(child: Text(i18n.warning, style: BrandText.sheetTitle)),
+ ],
+ ),
+ const SizedBox(height: 7),
+ Text(
+ i18n.txDetailsUnknownStatus,
+ style: BrandText.bodyMuted.copyWith(fontSize: 13, height: 1.5),
+ ),
+ const SizedBox(height: 18),
+ BrandButton(label: i18n.close, onPressed: () => Navigator.pop(sheetContext)),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+
+ /// Commits the tx. Surfaces errors as toasts; rethrows to keep the sheet open,
+ /// except unknown ([onUnresolved]) and not-sent ([onConnectionFailed]) which
+ /// close it.
+ Future<void> _commitTx(
+ AppPendingTx tx,
+ String destinationAddress, {
+ required void Function() onUnresolved,
+ required void Function() onConnectionFailed,
+ }) async {
final i18n = AppLocalizations.of(context)!;
final wallet = appWalletOf(context);
try {
await wallet.commitTx(tx, destinationAddress);
+ } on BroadcastFailure catch (failure) {
+ if (failure.outcome == BroadcastOutcome.unknown) {
+ onUnresolved();
+ return;
+ }
+ if (mounted) showBrandToast(context, i18n.unknownError);
+ rethrow;
+ } on RequestNotSentException {
+ // Nothing was sent: show a connectivity error and close the sheet.
+ if (mounted) showBrandToast(context, i18n.sendNoConnectionError);
+ onConnectionFailed();
+ return;
} on FormatException catch (error) {
var errorMsg = error.toString().replaceFirst('FormatException: ', '');
if (error.toString().contains('HTTP error code 500')) {
### lib/screens/settings.dart
@@ -235,19 +235,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
Future<void> _showViewSecretKeysDialog() async {
final i18n = AppLocalizations.of(context)!;
- if (Platform.isAndroid || Platform.isIOS) {
- final result = await BiometricAuth.authenticateIfAppLockEnabled(
- reason: i18n.revealSeedAuthReason,
- );
- if (result != BiometricAuthResult.authenticated) {
- if (mounted) {
- showBrandToast(context, i18n.settingsAppLockUnableToAuthError);
- }
- return;
- }
- if (!mounted) return;
- }
-
final ok = await showConfirmSheet(
context: context,
icon: Icons.warning_amber_rounded,
### lib/screens/tor_settings.dart
@@ -18,8 +18,10 @@ class TorSettingsScreen extends StatelessWidget {
static const _modes = [TorMode.builtIn, TorMode.external, TorMode.disabled];
Future<bool> _test(String port) async {
+ final parsed = int.tryParse(port.trim());
+ if (parsed == null || parsed < 1 || parsed > 65535) return false;
try {
- final proxy = (host: InternetAddress.loopbackIPv4, port: int.tryParse(port) ?? 9050);
+ final proxy = (host: InternetAddress.loopbackIPv4, port: parsed);
final response = await makeSocksHttpRequest(
'GET',
'https://check.torproject.org/api/ip',
### lib/services/foreground_sync_service.dart
@@ -10,6 +10,7 @@ export 'package:wallet_background/wallet_background.dart'
startForegroundSync,
stopForegroundSync,
startForegroundSyncIfEnabled,
+ restartForegroundSyncIfRunning,
isWalletFullySynced,
stopSyncAndDeleteWallets;
### lib/wallet_core_glue.dart
@@ -10,7 +10,7 @@ import 'package:skylight_wallet/models/monero_wallet_adapter.dart';
import 'package:skylight_wallet/widgets/tx_details.dart' show TxDetailsDialog;
import 'package:skylight_wallet/periodic_tasks.dart' show backgroundDispatcher;
import 'package:skylight_wallet/services/foreground_sync_service.dart'
- show foregroundSyncCallback, stopSyncAndDeleteWallets;
+ show foregroundSyncCallback, stopSyncAndDeleteWallets, restartForegroundSyncIfRunning;
import 'package:skylight_wallet/services/notifications_service.dart';
import 'package:skylight_wallet/services/shared_preferences_service.dart';
import 'package:skylight_wallet/services/tor_service.dart';
@@ -262,5 +262,7 @@ Future<void> deleteWallet(BuildContext context) async {
/// Rebuilds the wallet if the server kind (LWS↔node) changed, then resyncs.
void applyConnectionChange(BuildContext context) {
- unawaited(Provider.of<WalletManager>(context, listen: false).applyConnectionChange('XMR'));
+ final manager = Provider.of<WalletManager>(context, listen: false);
+ // Restart the foreground service too, so its isolate re-reads the new server.
+ unawaited(manager.applyConnectionChange('XMR').then((_) => restartForegroundSyncIfRunning()));
}
### lib/widgets/connection_settings_form.dart
@@ -349,6 +349,14 @@ class _ConnectionSettingsFormState extends State<ConnectionSettingsForm> {
return;
}
+ if (_useTor && addressIsLocal(daemonAddress)) {
+ setState(() {
+ _hasTested = false;
+ _errorMessage = i18n.connectionLocalOverTorNotAllowed;
+ });
+ return;
+ }
+
if (_useTor && TorSettingsService.sharedInstance.torMode == TorMode.disabled) {
showBrandToast(context, i18n.lwsSetupTorDisabledError);
return;
@@ -413,6 +421,11 @@ class _ConnectionSettingsFormState extends State<ConnectionSettingsForm> {
return;
}
+ if (_useTor && addressIsLocal(daemonAddress)) {
+ setState(() => _errorMessage = i18n.connectionLocalOverTorNotAllowed);
+ return;
+ }
+
final wallet = appWalletOf(context);
wallet.setConnection(
### lib/widgets/tor_settings_form.dart
@@ -135,7 +135,11 @@ class _TorSettingsFormState extends State<TorSettingsForm> {
});
try {
- final port = int.tryParse(_socksPortController.text) ?? 9050;
+ final port = int.tryParse(_socksPortController.text.trim());
+ if (port == null || port < 1 || port > 65535) {
+ setState(() => _connectionSuccess = false);
+ return;
+ }
final proxyInfo = (host: InternetAddress.loopbackIPv4, port: port);
final response = await makeSocksHttpRequest(
### monero_c.sha256
@@ -0,0 +1,10 @@
+# monero_c e31cbe2cc595fa9d640b35ffb45dc3afa91ec7b0
+c721efde6dd802bf97122cd71b45e9c755e40e6e762a754595511891e03cd8fc android/app/src/main/jniLibs/x86_64/libmonero_libwallet2_api_c.so
+3d7799055055027a1c0f1d81076b1bf272c354e07b85c42a757c97626e054b72 android/app/src/main/jniLibs/arm64-v8a/libmonero_libwallet2_api_c.so
+648a39c56f3d95b028ba305b8ea1f95ad16bee8cf0302df0e1fc6b99b341996d android/app/src/main/jniLibs/armeabi-v7a/libmonero_libwallet2_api_c.so
+abefc0f65a7a11be8194dd764bb5022a195d7622a7c5af5b6c7234afc7959d3a linux/monero_libwallet2_api_c.so
+71a952d59390524fb99082dca5cb2e997911be843be454d85a31fc16b562e4a8 windows/monero_libwallet2_api_c.dll
+71abe034d8408b8ccd245853fee3bb1d7aec9970c0065e60430d77f013b25329 windows/libwinpthread-1.dll
+e004b8946fca8a130712281e36133c55f2366877fcff0ae2f3836ab023bf0400 windows/libssp-0.dll
+932d96c1b40e90afe17f1c43e80f240e289d9771e4986c5cb51935bd50565d30 ios/Frameworks/MoneroWallet.xcframework/ios-arm64/MoneroWallet.framework/MoneroWallet
+527df8aa17e88d4af842b0cd121b80f2aaf473d6fdf65ccd6c685e2633f487a7 ios/Frameworks/MoneroWallet.xcframework/ios-arm64-simulator/MoneroWallet.framework/MoneroWallet
### scripts/pin-rust-toolchain.sh
@@ -24,12 +24,19 @@ ROOT="$(cd "$(dirname "$0")/.." && pwd)"
TOOLCHAIN="${1:-$(sed -n 's/^[[:space:]]*channel[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' "$ROOT/rust-toolchain.toml" | head -1)}"
n=0
+locked=0
while IFS= read -r f; do
if grep -q "?? 'stable'" "$f"; then
sed -i "s/?? 'stable'/?? '$TOOLCHAIN'/" "$f"
n=$((n + 1))
fi
+ # Force cargo to honor each plugin's committed Cargo.lock — fail rather than
+ # resolve new dependency versions at build time. Idempotent.
+ if grep -q '\.\.\.extraArgs,' "$f" && ! grep -q "'--locked'" "$f"; then
+ sed -i "s/\.\.\.extraArgs,/...extraArgs, '--locked',/" "$f"
+ locked=$((locked + 1))
+ fi
done < <(find "$CACHE" "$ROOT/plugins" -path '*/cargokit/build_tool/lib/src/builder.dart' 2>/dev/null | sort -u)
-echo "pin-rust-toolchain: set cargokit toolchain to $TOOLCHAIN in $n file(s) (PUB_CACHE=$CACHE, repo=$ROOT)"
+echo "pin-rust-toolchain: set cargokit toolchain to $TOOLCHAIN in $n file(s), added --locked in $locked file(s) (PUB_CACHE=$CACHE, repo=$ROOT)"
[ "$n" -gt 0 ] || echo " (warning: no cargokit builder.dart found/patched — verify PUB_CACHE + that the string still exists)"Why this scored 37/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.