fix(android): stop backing up credentials no key can ever open

The app's data dir was eligible for Google cloud backup: the manifest set
neither allowBackup nor any extraction rules, so the SQLite catalogue
(library metadata, watch history) and the jellytau_secure_prefs
credential blob were shipped to the user's Google account. Restoring that
is worse than not having it — SecureStorage encrypts under an Android
Keystore key, and Keystore keys are never backed up, so a restored
install gets ciphertext with nothing to open it and fails auth silently
while looking signed in.

Backup and device-to-device transfer are both turned off. allowBackup
="false" covers API 24-30 outright and kills cloud backup on 31+; it does
NOT stop D2D there, so @xml/data_extraction_rules excludes every domain
from both channels. Nothing is lost: the catalogue is a rebuildable
mirror of the Jellyfin server, and watch state lives on the server.

The credential-load path degrades instead of erroring, because a device
can still arrive at undecryptable ciphertext (an older install's backup,
a Keystore key invalidated by a lockscreen change). Both backends now
distinguish "nothing stored" from "stored but unreadable" and answer the
second as the first: CredentialStore::load_credentials_file logs and
returns an empty map rather than CredentialError::Encryption — which
storage_get_access_token was turning into a hard Err and
storage_get_active_session into a warning — and SecureStorage.getCredential
discards the dead blob so it cannot fail every subsequent read. The
result is a login screen rather than a broken session, and the next
successful sign-in rewrites the store.

Also removes the half-declared Android TV support: the manifest offered
LEANBACK_LAUNCHER and the leanback uses-feature with no D-pad focus
model, no TV layouts, and neither of the two declarations Play's TV
validation also requires (touchscreen required="false", android:banner).
That fails review while advertising the app to TV launchers. All four go
back together when a focus pass is actually done.

And raises jvmTarget from 1.8 to 17 under compileSdk 36, with matching
compileOptions — AGP 8.11 already requires a JDK 17 toolchain, so 1.8 was
only capping emitted bytecode. Nothing else in the build assumed 1.8.

TRACES: UR-012 | IR-014
This commit is contained in:
2026-08-16 22:56:32 +02:00
parent 73641e192c
commit 4c9361d020
5 changed files with 227 additions and 13 deletions
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Backup / transfer policy for JellyTau (API 31+; see android:allowBackup in
AndroidManifest.xml for API 24-30).
Nothing is eligible for extraction, from either channel:
* cloud-backup - already off via android:allowBackup="false".
* device-transfer - NOT covered by allowBackup on Android 12+, which is why
this file exists. A D2D transfer would otherwise copy the same data the
cloud backup used to.
Why nothing is extractable:
* Credentials are unrecoverable off-device. jellytau_secure_prefs holds
AES-GCM ciphertext encrypted under an Android Keystore key, and Keystore
keys are never backed up or transferred. Restoring the prefs without the
key produces ciphertext nothing can read - a silent auth failure that looks
like a broken app rather than a logged-out one.
* Everything else is a rebuildable cache. The SQLite catalogue is a mirror of
the Jellyfin server (library metadata, watch history, offline downloads);
signing in again reproduces it, and watch state lives on the server anyway.
Backing it up would export a user's library and viewing history to their
Google account for no gain.
Exclude rules are listed per domain rather than relying on "root" alone,
because database/, shared_prefs/, files/ and external storage are addressed
as their own domains by the extraction engine.
-->
<data-extraction-rules>
<cloud-backup>
<exclude domain="root" />
<exclude domain="file" />
<exclude domain="database" />
<exclude domain="sharedpref" />
<exclude domain="external" />
</cloud-backup>
<device-transfer>
<exclude domain="root" />
<exclude domain="file" />
<exclude domain="database" />
<exclude domain="sharedpref" />
<exclude domain="external" />
</device-transfer>
</data-extraction-rules>