Commit Graph
841 Commits
Author SHA1 Message Date
opencode.siil.arti.ee a58d1f5d96 test(backup): cover device failures, cancellation and stream ownership
The device-driver error test pins that the exception propagates unwrapped and
that the partial output is an exact prefix of the device. The cancellation test
does the same for coroutine cancellation and checks that the flow closes its
BlockDeviceInputStream. A third test pins that the output and existing prefix
streams are left open, and a fourth pins the digest hex formatting with a known
SHA-256 vector.
2026-11-17 18:30:36 +00:00
opencode.siil.arti.ee 894a1f7b12 fix(backup): resume from fatal errors and report progress accurately
Routine backup failures (no space, unwritable destination) no longer tell
the user to report a bug. The fatal screen gains a Resume backup action for
backups, which restarts the job so the existing destination file is appended
to. The prefix-hash phase is reported through isVerifying, so the progress
screen and the notification say the existing data is being checked instead of
restarting the bar. The error broadcast now carries the real byte offset, and
a forced progress update precedes fsync so a slow sync cannot trip the UI
watchdog. Backup destination names are shown without .part, and the
destination grant falls back to write-only when a provider rejects both flags.

The spec scopes resume to the fatal screen and reconnect flow (process death
is not reachable in v1) and documents the card-swap hazard.
2026-11-17 18:30:34 +00:00
opencode.siil.arti.ee 38f7da4194 feat(ui): show backup progress and checksum 2026-11-17 17:52:43 +00:00
opencode.siil.arti.ee 5b188bf555 feat(ui): add backup mode to the confirmation screen 2026-11-17 17:45:03 +00:00
opencode.siil.arti.ee 0cb99758d4 feat(ui): add the back up a drive entry point and part-file warning 2026-11-17 17:31:05 +00:00
opencode.siil.arti.ee ef5d5c028c feat(service): run backup jobs in the worker service 2026-11-17 17:22:41 +00:00
opencode.siil.arti.ee e7bc8479b5 fix(backup): fail when the device ends before the expected size 2026-11-17 17:12:58 +00:00
opencode.siil.arti.ee e9e017215f feat(backup): stream a block device to an output stream 2026-11-17 17:08:47 +00:00
opencode.siil.arti.ee bc1b14e4f4 fix(backup): avoid hidden storage UUID API before Android 12 2026-11-17 16:51:46 +00:00
opencode.siil.arti.ee 7c86d1786a feat(backup): add file naming, space and error helpers 2026-11-17 16:43:52 +00:00
opencode.siil.arti.ee 9ff2cdb502 feat(intents): add backup job plumbing 2026-11-17 16:36:05 +00: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 88e66ca5a6 feat: update ignore files 2026-11-04 19:19:12 +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 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 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
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 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 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 02610a883d fix(ui): fire the lay-flat sheet's onReady only once 2026-08-15 23:58:02 +02:00
L.E.D. of Roommania dd8cdeefe9 Translated using Weblate (Romanian)
Currently translated at 99.2% (133 of 134 strings)

Translation: EtchDroid/EtchDroid
Translate-URL: https://hosted.weblate.org/projects/etchdroid/app/ro/
2026-08-12 15:07:51 +02:00
Ilona Bereznova 349ef39d2d Translated using Weblate (Ukrainian)
Currently translated at 22.3% (30 of 134 strings)

Translation: EtchDroid/EtchDroid
Translate-URL: https://hosted.weblate.org/projects/etchdroid/app/uk/
2026-07-30 20:28:09 +02:00
Andrei Makeev ebb440868c fix: preserve completed job state across rotation 2026-07-28 15:33:13 +02:00
Davide Depau b263ffa28d fix: remove GRANT_READ_URI_PERMISSION intent flag
According to Gemini it's causing the rare java.lang.SecurityException
I see in the crash analytics and it's not necessary.
2026-07-01 20:38:22 +02:00
Davide Depau ef04574054 feat: bump version to 2.1 and add changelog metadata 2026-07-01 00:00:03 +02:00
Davide Depau 37e54decca fix: move Firebase Crashlytics dependency to GPlay flavor 2026-06-30 22:44:07 +02:00
Davide Depau 2c8326f016 fix: ensure closeAsync joins I/O thread to prevent libusb crash 2026-06-30 22:17:06 +02:00
Davide Depau e203b46563 fix: remove accidental cancel string vandalism 2026-06-30 21:48:31 +02:00
Davide Depau 0fada9a981 Translated using Weblate (Sardinian)
Currently translated at 100.0% (134 of 134 strings)

Translation: EtchDroid/EtchDroid
Translate-URL: https://hosted.weblate.org/projects/etchdroid/app/sc/
2026-06-30 20:02:18 +02:00
Davide Depau 0712634800 Added translation using Weblate (Sardinian) 2026-06-30 20:02:18 +02:00
Andries Helfferich 47a33a6c44 Translated using Weblate (Dutch)
Currently translated at 91.0% (122 of 134 strings)

Translation: EtchDroid/EtchDroid
Translate-URL: https://hosted.weblate.org/projects/etchdroid/app/nl/
2026-06-30 20:02:18 +02:00
Ben-bit-code208 8b5cef04b0 Translated using Weblate (Bengali (Bangladesh))
Currently translated at 100.0% (134 of 134 strings)

Translation: EtchDroid/EtchDroid
Translate-URL: https://hosted.weblate.org/projects/etchdroid/app/bn_BD/
2026-06-30 18:43:59 +02:00
Ben-bit-code208 070f6fe170 Translated using Weblate (Persian)
Currently translated at 91.7% (123 of 134 strings)

Translation: EtchDroid/EtchDroid
Translate-URL: https://hosted.weblate.org/projects/etchdroid/app/fa/
2026-06-30 18:43:59 +02:00
jonnysemon 5fc4f48187 Translated using Weblate (Arabic)
Currently translated at 100.0% (134 of 134 strings)

Translation: EtchDroid/EtchDroid
Translate-URL: https://hosted.weblate.org/projects/etchdroid/app/ar/
2026-06-30 18:43:59 +02:00
Liner Seven 4e90a51e5b Translated using Weblate (Japanese)
Currently translated at 100.0% (134 of 134 strings)

Translation: EtchDroid/EtchDroid
Translate-URL: https://hosted.weblate.org/projects/etchdroid/app/ja/
2026-06-30 18:43:59 +02:00
Weblate Translation Memory aaeb052e71 Translated using Weblate (Hebrew)
Currently translated at 100.0% (134 of 134 strings)

Translation: EtchDroid/EtchDroid
Translate-URL: https://hosted.weblate.org/projects/etchdroid/app/he/
2026-06-30 18:43:59 +02:00
Hosted Weblate user 54392 0173c36b2c Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (134 of 134 strings)

Translation: EtchDroid/EtchDroid
Translate-URL: https://hosted.weblate.org/projects/etchdroid/app/zh_Hans/
2026-06-30 18:43:59 +02:00