fix(dev): updates to scripts, added documentation

This commit is contained in:
Czarek Nakamoto 2025-05-20 13:18:14 +02:00 committed by cyan
parent 507dcf3ce0
commit df0c1ccd30
4 changed files with 56 additions and 16 deletions

View file

@ -204,6 +204,11 @@ Future<void> initializeAppConfigs({bool loadWallet = true}) async {
final trades = await CakeHive.openBox<Trade>(Trade.boxName, encryptionKey: tradesBoxKey);
final orders = await CakeHive.openBox<Order>(Order.boxName, encryptionKey: ordersBoxKey);
final walletInfoSource = await CakeHive.openBox<WalletInfo>(WalletInfo.boxName);
if (walletInfoSource.length == 0) {
printV("WalletInfo corrupted: length == 0");
} else {
printV("WalletInfo normal: ${walletInfoSource.length}");
}
final templates = await CakeHive.openBox<Template>(Template.boxName);
final exchangeTemplates = await CakeHive.openBox<ExchangeTemplate>(ExchangeTemplate.boxName);
final anonpayInvoiceInfo = await CakeHive.openBox<AnonpayInvoiceInfo>(AnonpayInvoiceInfo.boxName);

View file

@ -0,0 +1,35 @@
# Debug scripts
## `display_fuzzer_stats.sh`
Displays wallet fuzzer statistics in one screen for every emulator
## `record_tap.sh`
Used to configure wallet_fuzzer.sh - to unlock wallet and start fuzzer (or any action we wish to test)
## `wallet_fuzzer.sh`
Main logic to start wallet fuzzing scripts
## Extras
In order to install app on all devices you can run the following command:
```bash
for device in $(adb devices | grep -w "device" | awk '{print $1}'); do
echo "Installing on $device..."
adb -s $device install -r build/app/outputs/flutter-apk/app-debug.apk
done
```
To watch for some log message:
```bash
for device in $(adb devices | grep -w "device" | awk '{print $1}'); do
echo "Watching logs on $device..."
adb -s "$device" logcat | grep --line-buffered "WalletInfo corrupted" | sed "s/^/[$device] /" &
done
wait
```

View file

@ -127,6 +127,6 @@ adb shell getevent -lt "$TOUCH_DEVICE" | gawk -v sw="$SCREEN_WIDTH" -v sh="$SCRE
scaled_x = int(raw_x * sw / rx)
scaled_y = int(raw_y * sh / ry)
# Print the input tap command.
printf "adb shell input tap %d %d\n", scaled_x, scaled_y
printf "adb -s \$device_id shell input tap %d %d\n", scaled_x, scaled_y
}
'

View file

@ -26,21 +26,21 @@ function start_app() {
# and then copy the output into the adb shell input tap commands below.
# make sure to tap very briefly, otherwise multiple events will be generated.
sleep 6
adb -s $device_id shell input tap 602 1940
sleep 2.664044
adb -s $device_id shell input tap 473 1923
sleep 2.713335
adb -s $device_id shell input tap 459 2021
sleep 2.668894
adb -s $device_id shell input tap 515 2027
sleep 3.871710
adb -s $device_id shell input tap 977 141
sleep 4.263207
adb -s $device_id shell input tap 635 1801
sleep 3.804010
adb -s $device_id shell input tap 289 757
sleep 3.833263
adb -s $device_id shell input tap 962 2176
adb -s $device_id shell input tap 435 1982
sleep 2.596161
adb -s $device_id shell input tap 532 1920
sleep 2.583818
adb -s $device_id shell input tap 594 1973
sleep 2.549104
adb -s $device_id shell input tap 539 2072
sleep 3.529221
adb -s $device_id shell input tap 979 139
sleep 3.287868
adb -s $device_id shell input tap 430 1645
sleep 2.325175
adb -s $device_id shell input tap 368 1784
sleep 2.461983
adb -s $device_id shell input tap 442 2164
}
function stop_app() {