Files
jwinterm c396e94b77 Add store capture harness: record real wallet flows into screenshots + video
Drives the real app through real flows on a device while recording the screen,
then cuts ONE recording into both deliverables — store screenshots and
marketing video — so a listing can't drift out of sync with its own trailer.

integration_test/demo/
  DemoSession adds what a passing test lacks: pacing (beat/hold/typeSlowly, so
  footage is watchable rather than a strobe), timing marks reported through
  binding.reportData, and seed guards. Scenarios reuse the existing 25 page
  robots rather than reimplementing navigation:
    core_store_set     dashboard, receive, send (composed, NEVER broadcast),
                       wallets, security — the store screenshot set
    onboarding_create  welcome -> PIN -> seed -> dashboard
    restore_from_seed  restore -> syncing
    swap_and_buy       Trocador quote, stopping BEFORE creating a trade; Buy
                       skipped when no provider key, matching what reviewers see

tools/demo/
  capture.sh   orchestrates boot/record/cut/shots/reel
  marks.py     maps timing marks onto the recording; cuts, extracts frames,
               builds manifests
  reel.py      branded master; reuses such_graphics video_transitions/video_qa
               when ~/src/such-graphics is present, degrades cleanly when not
               (this repo is public and must build without it)
  build-apk.sh local APK via the CI container image

Seed safety — the demo wallet is a real wallet with real funds:
  - seed comes from Vaultwarden at capture time, never the repo
  - guardNoSeedOnScreen() fails the run on a visible mnemonic, catching both
    the known seed and the generic shape of one (so freshly generated seeds
    are caught too)
  - unavoidable seed screens are wrapped in blindfold(); those spans are
    excised from the video with 0.6s padding, and screenshots honour the same
    padding
  - marks.py refuses to build a publishable master if any clip was cut without
    marks, since blindfold spans could not have been excised

Apple App Preview gets no touch indicators, captions, cards or music, and
reel.py enforces the 15-30s window rather than emitting an out-of-spec file.
Everything else keeps taps on, drawn by SurfaceFlinger via show_touches rather
than composited, so they look real.

Play sizing: the harness builds its own 1080x1920 AVD. The stock Medium Phone
AVD is 1080x2400 = 2.22:1 and Play rejects phone screenshots above 2:1.

Also gitignores android/app/upload-keystore.jks (and *.jks/*.keystore): the
Android workflow decodes ANDROID_KEYSTORE_BASE64 to exactly that path, so the
Play upload signing key was one `git add -A` away from being committed.
2026-07-31 15:25:29 -04:00

61 lines
2.2 KiB
Dart

import 'package:cw_core/wallet_type.dart';
/// Capture-time configuration, injected by `tools/demo/capture.sh` via
/// `--dart-define`. Nothing here is baked into a shipped build.
///
/// The demo wallet seed is pulled from the self-hosted Vaultwarden at capture
/// time and passed straight through — it is never written to the repo, never
/// committed, and never placed in `.secrets.g.dart`.
class DemoConfig {
/// BIP39 / Wownero seed for the demo wallet.
static const String walletSeed = String.fromEnvironment('DEMO_WALLET_SEED');
/// Which wallet the demo restores into. Hash Bags is Wownero-first, so that
/// is the default face of the app in store material.
static const String _walletTypeName =
String.fromEnvironment('DEMO_WALLET_TYPE', defaultValue: 'wownero');
/// A receive address used to populate the Send screen. This is a
/// *destination shown on camera*, so it should be an address you are happy
/// to publish — the capture script defaults it to the demo wallet's own
/// address rather than a stranger's.
static const String sendToAddress =
String.fromEnvironment('DEMO_SEND_ADDRESS');
/// Amount typed into the Send screen. Never broadcast in the core scenario.
static const String sendAmount =
String.fromEnvironment('DEMO_SEND_AMOUNT', defaultValue: '0.5');
/// Amount typed into the Swap screen.
static const String swapAmount =
String.fromEnvironment('DEMO_SWAP_AMOUNT', defaultValue: '10');
/// PIN used for the demo wallet.
static List<int> get pin {
const raw = String.fromEnvironment('DEMO_PIN', defaultValue: '0801');
return raw.split('').map(int.parse).toList();
}
static bool get hasSeed => walletSeed.trim().isNotEmpty;
static WalletType get walletType {
switch (_walletTypeName.toLowerCase()) {
case 'monero':
return WalletType.monero;
case 'bitcoin':
return WalletType.bitcoin;
case 'litecoin':
return WalletType.litecoin;
case 'wownero':
default:
return WalletType.wownero;
}
}
/// Human label for captions/log lines.
static String get walletLabel {
final n = _walletTypeName.toLowerCase();
return n.isEmpty ? 'Wownero' : '${n[0].toUpperCase()}${n.substring(1)}';
}
}