Commit Graph
1319 Commits
Author SHA1 Message Date
Davide Depau c5a90bc6a4 Update bug_report.yml
Build and test / Build gplay (push) Waiting to run
Build and test / Build foss (push) Waiting to run
Build and test / Unit tests for gplay (push) Waiting to run
Build and test / Unit tests for foss (push) Waiting to run
2026-11-10 23:03:05 +01:00
Davide Depau cb849d02fc Update bug_report.yml
Test with GHFM notice boxes
2026-11-10 23:01:56 +01:00
Davide Depau 1a3db2a015 Update bug_report.yml 2026-11-10 22:51:58 +01:00
Léon Avic Simmons 57d2431bda docs: fix duplicated word in Uri.getFilePath KDoc
"This will get the the path" -> "This will get the path".

Signed-off-by: Léon Avic Simmons <Avicennasis@gmail.com>
2026-11-05 19:53:16 +01:00
Davide Depau f9d1ec8998 chore: update gemfile lock 2026-11-04 19:19:24 +01:00
Davide Depau 88e66ca5a6 feat: update ignore files 2026-11-04 19:19:12 +01:00
Davide Depau 14af534a59 fix(fastlane): upload and attach only the gplayRelease outputs
upload_to_play_store defaulted apk_paths to every APK under
build/outputs, failing with "Cannot provide both apk(s) and aab" when
debug builds were around. The lanes also used GRADLE_*_OUTPUT_PATH,
which is merely the newest file there, so the GitHub release could get
a stale debug APK. Select the gplayRelease outputs by path instead.
2026-11-04 19:15:04 +01:00
Davide Depau c3478e86c3 fix(build): decide GPlay plugins before the plugins blocks run
Gradle runs a build script's plugins {} block before the rest of the
script, so the flavor property set in app/build.gradle.kts was only seen
by the next build in the same daemon. A fresh daemon skipped the Sentry
plugin and then failed configuring the missing 'sentry' extension; a
FOSS build after a GPlay one got the Google plugins. Set it in
settings.gradle.kts, which is evaluated before any project script.
2026-11-04 19:06:22 +01:00
Davide Depau 4e821e4ea4 feat: bump version to 2.2 and add changelog metadata 2026-11-04 18:46:35 +01:00
Davide Depau 9c5c3ba3b8 build(gplay): upload R8 mappings to Sentry
R8 merges classes and rewrites line numbers even with -dontobfuscate,
and no mapping ever reached Sentry, so release stack traces showed
merged class names (IntentKt.safeParcelableExtra as
coil.size.Dimension.safeParcelableExtra) and R8 line positions.

Apply the Sentry Android Gradle plugin for mapping upload only (no
bytecode instrumentation, no auto-installed dependencies). The mapping
UUID is always embedded; the upload runs when SENTRY_AUTH_TOKEN is set,
which the release lanes now require.
2026-10-30 23:24:37 +01:00
Davide Depau eef4ac7cdf fix(deps): bump libaums to fix SCSI retry buffer overflow
libaums retried failed SCSI commands without rewinding the data buffer,
so a retry after a partial transfer threw "newLimit > capacity" with
the command already sent, leaving the drive out of sync. Fixed upstream
in magnusja/libaums d85e48c.

Fixes ETCHDROID-A3
Fixes ETCHDROID-D1
Fixes ETCHDROID-9Z
Fixes ETCHDROID-AX
Fixes ETCHDROID-9Y
Fixes ETCHDROID-Z
2026-10-30 19:55:49 +01:00
Davide Depau e45c377dad fix(worker): use the only inserted card in multi-slot readers
Dual SD/microSD readers expose one LUN per slot. With the card in the
second slot LUN 0 has no medium, so the job failed with NoMediumException
although there was exactly one usable medium. Fall back to it when it's
the only one.
2026-10-30 19:51:08 +01:00
Davide Depau ce5531f5d1 fix(worker): keep read access to the image while the job runs
b263ffa dropped FLAG_GRANT_READ_URI_PERMISSION from every intent. For
images opened via ACTION_VIEW, whose grants can't be persisted, the
grant then dies with the receiving activity, and the worker's later
reads (e.g. the verify pass after the task is swiped away) fail.

Grant it again on the job start intent only, and only while we still
hold it: granting a permission we lost throws SecurityException.
2026-10-30 19:50:53 +01:00
Davide Depau 6b37c6f8a1 fix(ui): stop crashing when the source image is no longer readable
The image URI was only readable through temporary grants tied to the
activity that received it, so screens created later (progress screen
reopened from the notification, activities restored after process death)
could lose access. getDisplayName only caught SecurityException, so a
removed volume ("No root for ...") crashed MainActivity and
ProgressActivity, and the progress screen re-queried the provider and
sent an error event on every recomposition.

Take a persistable read grant for picked documents, treat any query
failure in getDisplayName as non-fatal (fall back to the URI path, log a
breadcrumb instead of an error event), query the name once per URI on
the progress screen, and refuse to open or confirm an image the provider
no longer lets us read, with a "Could not open the source file" toast.

ETCHDROID-AE (startActivity granting a URI we no longer held) was fixed
by b263ffa, which dropped FLAG_GRANT_READ_URI_PERMISSION; the confirm
screen now also handles the stale URI it can receive.

Fixes ETCHDROID-B0
Fixes ETCHDROID-BA
Fixes ETCHDROID-DD
Fixes ETCHDROID-D5
Fixes ETCHDROID-D6
Fixes ETCHDROID-D7
Fixes ETCHDROID-BN
Fixes ETCHDROID-AE
Fixes ETCHDROID-7S
Fixes ETCHDROID-DF
Fixes ETCHDROID-D8
2026-10-30 18:39:06 +01:00
Davide Depau 482fb57dca fix(telemetry): stop re-reporting job errors from the progress screen
WorkerService already captures every error it broadcasts. The progress
screen captured the parcelled copy again, doubling every job error and
splitting it into a second issue with a mangled stack (culprit
ProgressActivity), also on each intent re-delivery.
2026-10-30 18:35:09 +01:00
Davide Depau c13b9df388 fix(worker): report a missing medium instead of crashing with an NPE
Card readers without a card (or dead drives) fail TEST UNIT READY with
"medium not present"; init() skips such LUNs, leaving blockDevices
without LUN 0, so `blockDevices[0]!!` threw a bare NullPointerException
that surfaced as "InitException: Initialization failed".

Throw a recoverable NoMediumException that tells the user to insert a
card instead.

Fixes ETCHDROID-A4
Fixes ETCHDROID-AJ
2026-10-30 18:35:09 +01:00
Davide Depau 368df0ec24 fix(worker): don't report cancellation, map libaums transfer errors
A cancelled job (service destroyed) surfaced as JobCancellationException,
which the job handler wrapped into UnknownException (and verifyImage's
close into UsbCommunicationException), so it was broadcast as an error
and sent to Sentry, defeating the CancellationException filter. Rethrow
cancellation instead, and release the USB device in NonCancellable.

libaums transfer failures (MAX_RECOVERY_ATTEMPTS IOException caused by
PipeException/libusb errors) reaching the job handler unwrapped (e.g.
via the stream close in a finally) were reported as UnknownException.
Map them to UsbCommunicationException by cause type.

Drop the "Verification failed" captureMessage: it carries nothing the
VerificationFailedException event doesn't and doubled every report.

Fixes ETCHDROID-A6
Fixes ETCHDROID-CH
Fixes ETCHDROID-B2
Fixes ETCHDROID-9W
Fixes ETCHDROID-17
Fixes ETCHDROID-A1
2026-10-30 18:35:08 +01:00
Davide Depau a845254b30 fix(ui): don't crash on USB permission broadcasts and requests
ConfirmOperationActivity requests permission with an immutable PendingIntent,
so its USB_PERMISSION broadcast carries no device; a ProgressActivity still
alive in the background received it too and crashed on `intent.usbDevice!!`.
Ignore broadcasts without a device.

The auto-restarter stays registered while the progress screen is
backgrounded, so a granted permission could start WorkerService from the
background, which Android 12+ forbids. Defer the start until the activity is
started again.

UsbManager.requestPermission can throw "package not found" from the system
(e.g. secondary users/profiles); catch it and tell the user instead.

Fixes ETCHDROID-AF
Fixes ETCHDROID-7M
Fixes ETCHDROID-BF
2026-10-30 18:35:08 +01:00
Davide Depau c8babf6fdc fix(ui): don't crash when picking a file fails
Devices without DocumentsUI (TV boxes, some OEM ROMs) have no handler
for ACTION_OPEN_DOCUMENT, so launching the picker threw
ActivityNotFoundException. Fall back to ACTION_GET_CONTENT and show a
toast if no picker exists at all.

getDisplayName() only caught SecurityException, but the remote document
provider can throw anything across the binder; a ZTE provider threw
IllegalArgumentException ("You must pass a valid uri and observer")
from query() while handling the picker result. Catch all exceptions and
fall back to the URI path.

Fixes ETCHDROID-D4
Fixes ETCHDROID-BJ
2026-10-30 18:35:08 +01:00
Davide Depau 2473cbb00d fix(telemetry): don't downgrade wrapped programming errors
isEnvironmentalFault() returned true for any RecoverableException in the
chain, but the worker wraps every failure into InitException /
UsbCommunicationException, so NPEs, IllegalArgumentExceptions and
coroutine cancellations were tagged recoverable and hidden as warnings.
Return false when the chain contains a programming error.

Fixes ETCHDROID-A4
Fixes ETCHDROID-AJ
Fixes ETCHDROID-9Y
Fixes ETCHDROID-Z
Fixes ETCHDROID-9Z
Fixes ETCHDROID-AX
Fixes ETCHDROID-CH
2026-10-30 18:35:08 +01:00
Davide Depau a3507432e2 fix(ui): avoid buggy typed getParcelableExtra on Android 13
The API 33 typed getParcelableExtra NPEs in readParcelableCreatorInternal;
every read was caught and reported as a handled event. Use IntentCompat,
which only calls the typed overload on API 34+.

Fixes ETCHDROID-A9
Fixes ETCHDROID-9X
2026-10-30 18:29:51 +01:00
Davide Depau 4652199128 build: add fastlane lanes for Play and GitHub releases
Run on the machine holding the release key: 'fastlane play' uploads a
signed bundle to Play's pending changes, 'fastlane github' attaches a
signed APK without the Play restrictions to a draft GitHub release.
2026-10-30 18:16:48 +01:00
Davide Depau 125509078b fix(gplay): stop linking to donation pages on Play builds
Google Play's Payments policy forbids linking to pages that eventually
lead to donations. On Play builds, hide the donate buttons, unlink
depau.eu and open the website with ?gplay=1, which hides its donation
links.

GitHub release builds keep them: build with -Petchdroid.githubRelease.
2026-10-30 18:11:39 +01:00
Davide Depau 119d52c923 fix(deps): update Sentry to fix accessibility crash on Play builds
sentry-compose 8.46.0 crashes with AbstractMethodError on
SemanticsModifierNode.isImportantForBounds() whenever the accessibility
tree is read (TalkBack, UiAutomator) with Compose UI 1.11.
Fixed upstream in 8.47.0 (getsentry/sentry-java#5662).
2026-10-30 18:11:39 +01:00
Davide Depau baec61ee87 fix(deps): rebuild libaums on JitPack
JitPack no longer serves the artifacts of the cef48e29a5 build, breaking
every build. Request the same commit with a longer SHA so JitPack builds
it again.

Fixes #459
2026-10-30 17:47:37 +01:00
L.E.D. of Roommania 06525392c6 Translated using Weblate (Romanian)
Currently translated at 100.0% (134 of 134 strings)

Translation: EtchDroid/EtchDroid
Translate-URL: https://hosted.weblate.org/projects/etchdroid/app/ro/
2026-08-21 13:18:17 +02:00
Davide Depau 948598d92c fix(appium-tests): make sure system dialog taps actually took
A tap that lands while a dialog is still animating in is dropped, and
the click call succeeds either way, so the test walked on believing the
dialog was dismissed. It was not: the recording shows the notification
permission dialog still covering a success screen the test then spent
two minutes failing to find, because a system dialog on top is the only
window in the accessibility tree.

Click these until the dialog is actually gone.
2026-08-16 22:31:18 +02:00
Davide Depau 4c3505039d fix(appium-tests): stop racing the job in the notification tests
Two races, same cause: the tests had to complete a slow detour through
system UI before the job outran them. The banner only exists while the
job runs, and the skip-verification button only during verification, so
on CI the job was often over first.

Give both jobs room to outlast the detour, and drop the skip click from
these two -- they are about the banner, and test_skip_verification
already covers the button, so waiting for success removes the second
race entirely.

Lower the image size cap as well: with seconds-based windows, a fast
host turns a longer window into gigabytes of pointless I/O, while CI
stays far below the cap.
2026-08-16 21:54:48 +02:00
Davide Depau b5818e7e45 fix(ui): keep listening for job updates while the screen is backgrounded
Job updates are not replayed, so a progress screen that only listens
while resumed misses everything that happens while the user is in a
system dialog or another app -- including FINISHED. Nothing re-syncs
state on the way back, so the screen went on claiming the write was
still running long after it had completed, with no way forward.

Writes take minutes, so leaving the app during one is ordinary. Register
the receiver for the life of the activity instead.
2026-08-16 21:18:19 +02:00
Davide Depau c53561e975 fix(ui): don't fail a healthy job while the progress screen is backgrounded
onPause unregisters the progress receiver, but the silence watchdog kept
running, so any time away from the progress screen longer than
LAST_NOTIFICATION_TIMEOUT was read as the service having died and raised
a fatal error on a job that was writing perfectly well.

A system permission dialog, the notification settings screen, or simply
leaving the app during a long write all trip it -- writes take minutes,
so backgrounding is normal. In CI it is reliably fatal: the notification
tests spend more than 11s in the system permission dialog.

Only run the watchdog while the screen is actually receiving updates,
and restart its countdown on the way back in.
2026-08-16 20:17:51 +02:00
Davide Depau 2605ba04ce fix(appium-tests): re-find the notifications button after the permission dialog
Returning from the system dialog recomposes the banner, so the saved
element reference is stale by the time it is clicked again.
2026-08-16 19:40:54 +02:00
Davide Depau 99965a7f3c fix(appium-tests): don't let the lay-flat wait eat the write phase
On CI the sheet auto-proceeds -- the emulated gravity sensor reads flat
and the job starts on its own -- so waiting the full timeout for a
button that is already gone burned 15-30s of a ~28s job. The test then
went looking for a write phase that had already finished, which is why
the unplug tests failed while their job ran to a clean FINISHED.

Wait briefly instead: confirm_write_image already established that the
sheet was up, so the button is either there now or the job is running.
2026-08-16 19:40:49 +02:00
Davide Depau 6d0fa6b0c2 fix(appium-tests): run the write-speed calibration once per session
A fixture imported into two test modules becomes two definitions with
separate caches, so the session-scoped calibration write ran once per
module -- about 70s wasted on CI. Re-export it from conftest instead.
2026-08-16 17:39:39 +02:00
Davide Depau 8216fc91d1 fix(appium-tests): stop waiting 50s for a USB dialog Android never shows
Android often grants USB permission silently, so waiting out the dialog
timeout on every attempt burned ~150s per test on CI and left the
confirmation screen in a state where the next tap was dropped, so the
job never started at all. Keep the retry, but make the dialog wait
short: the grant button disappearing is the real signal that permission
landed, however it was granted.

Verify the 'write image' tap took as well, by waiting for what must
follow it -- the lay-flat sheet, or the progress screen when the sheet
auto-proceeds on a device with a working gravity sensor.
2026-08-16 17:39:34 +02:00
Davide Depau 608695d500 fix(appium-tests): pass unmap flags when re-adding drives
Mirrors the boot-time attach in scripts/vm-config.sh: without them a
re-plugged drive allocates its zero writes for real, and the qcow2
balloons until the host disk fills and QEMU pauses the VM.
2026-08-16 16:20:13 +02:00
Davide Depau c678633bdd fix(appium-tests): wait for real enumeration and always restore the stick
Poll dumpsys usb after a hot-plug instead of sleeping a fixed 2s: the
framework's view is what the app sees, and a fixed sleep loses the race
on slow hosts, so the flow started while the detach had been processed
but not the attach.

Restore the original drive when a setup or reconnect step fails. A
fixture that fails during setup never runs its teardown, so one failure
left every later test with no USB drive at all.

Also drop the over-sized unplug images: both unplugs happen in
different phases (one during the write, one during verification), so
one window is enough, and the bigger job pushed wait_for_success past
its 120s cap because each resume replays work.
2026-08-16 16:20:07 +02:00
Davide Depau f21a74000c fix(appium-tests): retry taps that get swallowed during activity transitions
The USB permission tap is dropped if it lands while the confirmation
activity is still settling, leaving the app with no permission request
at all and the test staring at a screen that will never change.

The lay-flat skip button needs a retry on stale for the same reason:
the sheet moves under the tap while animating in, and on CI no gravity
sensor ever fires the sheet's onReady, so nobody else will.
2026-08-16 16:20:00 +02:00
Davide Depau deb8538c93 fix(appium-tests): re-tap 'Write an image' if the file picker did not open
The tap is occasionally swallowed when a USB hot-plug recomposes the
device list under it, leaving the harness waiting for a picker that
never opened.
2026-08-16 14:36:17 +02:00
Davide Depau df96ab45fd fix(appium-tests): give the USB permission dialog a real timeout after replug
Re-enumeration and the system permission dialog can lag several
seconds while the guest is under heavy write I/O; the previous 1s
wait made the unplug tests flaky.
2026-08-16 14:35:57 +02:00
Davide Depau 18d09ef762 feat(appium-tests): speed-scale the qemu tests and generate random data on-device
Apply the measured-speed image sizing to the unplug tests, and
replace the fixed 10 MB pushed payload with dd from /dev/urandom on
the device: pushing speed-scaled amounts of data through Appium as
base64 would take longer than the test itself. Written data is now
verified via sha256 instead of a byte-for-byte payload comparison,
and the host-side raw target image is sized to match (sparse: a
zeroed target cannot false-match a random source).
2026-08-16 14:35:37 +02:00
Davide Depau 8a462f377b feat(appium-tests): size test images from a measured write speed
Emulated USB speed varies by orders of magnitude between hosts, and
fixed image sizes made the timing-sensitive tests flaky: on a fast
host the write finished before the harness could click the skip
verification button.

Measure the drive's throughput once per session with a small
app-driven speedtest write, timed from the app's own logcat
timestamps so UI latency cannot skew it, and size each generic test's
image so the write phase lasts TARGET_WRITE_SECONDS (env-tunable).
The calibration flow retries once, absorbing a known first-boot file
picker flake that would otherwise error every test in the session.
2026-08-16 14:35:19 +02:00
Davide Depau 2e932651de feat(appium-tests): grow the USB stick without ballooning its qcow2
Speed-scaled test images (next commit) reach multiple GB, so the 2G
stick is too small. The qcow2 is sparse and recreated on every VM
start, so the size costs nothing up front; discard=unmap and
detect-zeroes=unmap keep the mostly-zero test images from allocating
real host disk space, which previously filled the disk and made QEMU
pause the VM on ENOSPC.
2026-08-16 14:35:09 +02:00
Davide Depau 549018d2f5 fix(appium-tests): replace the uhci slow path with ehci
The LineageOS guest kernels ship no uhci_hcd (neither x86_64 nor
arm64), so uhci-attached devices never enumerate and the slow-bus
tests fail before the app ever sees the drive. Use an EHCI controller
instead, which both kernels support.

The default stick moves to ehci too: its moderate emulated throughput
keeps UI interaction windows wide. QEMU_USB_BUS must match the bus the
stick boots on, or the replug tests re-add the device on a different
controller than they removed it from, and the guest takes tens of
seconds to notice the new device.
2026-08-16 14:03:37 +02:00
Davide Depau a61162d9ce fix(ui): let the drive settle before auto-restarting a failed job. 2026-08-16 00:33:58 +02:00
Davide Depau 0d121bc85f fix(worker): multiple fixes wrt concurrency & errors
release the USB device before broadcasting errors; never leak connections;
reject concurrent jobs

a job started while another holds the drive steals the USB interface claim
(USBDEVFS_DISCONNECT_CLAIM), killing the other's transfers; failed inits
leaked claimed connections, making recovery permanently impossible (#449).
2026-08-16 00:25:49 +02:00
Davide Depau 875c885c32 fix(appium-tests): tolerate the lay-flat sheet auto-proceeding mid-click 2026-08-15 23:58:22 +02:00
Davide Depau 02610a883d fix(ui): fire the lay-flat sheet's onReady only once 2026-08-15 23:58:02 +02:00
Davide Depau 8683c9a8c7 fix: actually implement the chapters/subtitles 2026-08-15 23:01:08 +02:00
Davide Depau b428a492c5 feat(appium-tests): make CI recordings navigable 2026-08-15 22:35:05 +02:00
Davide Depau fc7eb9bc85 fix(appium-tests): don't abort under set -e when GL is off 2026-08-15 22:26:43 +02:00