Repository navigation
Done
Labels
hotfixPatch of a released version; handled before everything elsemanual-testingMerged; some criteria need a manual check on real hardware or another OSprivacysecurity
Milestone
Description
Goal
On Android, the database, the key wrapping file, host_keys.json, settings.json and the other files in the app's private storage are neither uploaded to the system cloud backup nor copied by device-to-device transfer, and the app's FileProvider can only hand out the folders the app actually shares.
Context
apps/smart-ssh-community/gen/android/app/src/main/AndroidManifest.xml:8-12: the<application>element sets neitherandroid:allowBackupnorandroid:dataExtractionRules. Android's default (allowBackup= true) includes the app's privatefilesdirectory (android_files_dir_for,crates/persistence-sqlite/src/paths.rs:436-439) in Auto Backup and in device-to-device transfer. That directory holdssmart-ssh.db, in master password modesmart-ssh.db.master-key,host_keys.jsonandsettings.json(Spec 0114, THREAT-MODEL.md section 3, data table).- Since Android 12 (API 31),
allowBackup="false"no longer stops device-to-device transfer; that needsdataExtractionRules.minSdkis 26,targetSdk36 (apps/smart-ssh-community/gen/android/app/build.gradle.kts:22-23), so both attributes are needed. - The FileProvider (
AndroidManifest.xml,<provider android:name="androidx.core.content.FileProvider" …>) usesres/xml/file_paths.xml, which is the generated template:<external-path name="my_images" path="." />(all of shared external storage) and<cache-path name="my_cache_images" path="." />(the whole cache directory). The provider is not exported, but every path it lists can be shared by a content URI with read grants. - Moving to a new device is already covered by the encrypted backup export (Spec 0109); in keystore mode the database key does not leave the device anyway, so a transferred database could not be opened there.
Requirements
AndroidManifest.xml:android:allowBackup="false"andandroid:dataExtractionRules="@xml/data_extraction_rules"on<application>, plusandroid:fullBackupContent="false"for API 26–30.- New
res/xml/data_extraction_rules.xmlthat excludes every domain (root,file,database,sharedpref,external) for both<cloud-backup>and<device-transfer>. file_paths.xml: list only the folders the app or its plugins actually pass toFileProvider.getUriForFile(search the Kotlin code of the app,crates/tauri-plugin-android-host/android/and the Tauri plugins in use, e.g. opener and dialog). Removeexternal-pathunless such a caller needs it; narrowcache-pathfrom.to the specific subfolder in use. If nothing uses the provider, remove the<provider>element andfile_paths.xml.- THREAT-MODEL.md section 3: one sentence that on Android the app data is excluded from system backup and device transfer and that the encrypted backup export is the way to move data.
Acceptance Criteria
- The merged manifest of a debug build (
gen/android/app/build/intermediates/merged_manifests/…oraapt dump xmltree) showsallowBackup=false,fullBackupContent=falseanddataExtractionRulespointing to the new rules file. - Automated test (e.g. a Rust test that reads the manifest and the XML files from the repo, in the crate that already tests Android paths): fails if
allowBackup="false"ordataExtractionRulesis missing, if the rules file does not exclude all domains for both cloud backup and device transfer, or iffile_paths.xmlcontainsexternal-pathor apath="."entry. It fails before the change and passes after it. - Every remaining
file_paths.xmlentry is used by a named caller (listed in the PR description); sharing or opening a file through those callers still works on a device or emulator. - On a device or emulator:
adb shell bmgr backupnow <package>reports the app as not eligible / backs up nothing, and the app starts and opens its database normally afterwards. - Relevant automated tests pass.
Technical Notes
apps/smart-ssh-community/gen/android/is generated by Tauri but committed; a regeneration would drop the changes, which is why the guard test is required.- The library manifest of
crates/tauri-plugin-android-hostmust not override these attributes (it merges into the app manifest); check the merged manifest, not only the source. - Not security-critical code paths (no filter engine, redaction or credentials logic changes); it changes where data at rest can end up.
- No data model change.
Files: apps/smart-ssh-community/gen/android/app/src/main/AndroidManifest.xml, apps/smart-ssh-community/gen/android/app/src/main/res/xml/, THREAT-MODEL.md, docs/specs/0114-android.md, crates/ (new guard test, location per existing Android path tests)
Spec impact: update 0114
Open questions
- Location of the guard test: next to the existing Android path tests in
crates/persistence-sqlite(recommended if it already reads repo files in tests) vs. a small script run by the existing test suite. Choose the one that runs in the normalcargo test.
Related Work
- none
Metadata
Metadata
Assignees
Labels
hotfixPatch of a released version; handled before everything elsemanual-testingMerged; some criteria need a manual check on real hardware or another OSprivacysecurity
Type
Fields
Priority
P2 - Normal
Activity
fix(android): exclude app data from system backup and device transfer…
smart-ssh-coder commentedon Dec 4, 2026
Implementation ready for review. PR #1731. Android manifest now sets allowBackup=false, fullBackupContent=false and dataExtractionRules (all domains excluded for cloud backup and device transfer). The unused FileProvider and its file_paths.xml are removed, since nothing calls it. Guard tests are in persistence-sqlite paths.rs, with a counter-proof. Spec 0114, THREAT-MODEL and a changelog fragment are updated, and CI is green. The merged-manifest check and the bmgr check on a device are left as manual steps in the PR.
smart-ssh-reviewer commentedon Dec 4, 2026
Review: 1. crates/persistence-sqlite/src/paths.rs:686-688: the doc comment of test_android_manifest_excludes_app_data_from_backup claims it guards FileProvider paths, but only test_android_file_provider_paths_are_narrow does that. Move that sentence to the other test, and say there why it reads file_paths.xml at runtime instead of using include_str!. 2. docs/specs/0114-android.md:53: move the new statement from §4 'Hintergrund' to §3 'Ablage'. Replace the ambiguous 'Schlüsseldatei' (§2 uses it for the SSH key file) with the master-password key file. Phrase the last sentence as behaviour, e.g. 'Die App gibt keine Dateien aus ihrem Speicher an andere Apps frei.' Non-blocking: rename the changelog fragment to changelog.d/issue-1716-android-exclude-from-system-backup.md. CI is green and every acceptance criterion that can be checked automatically is met (merged manifest verified locally).
fix(android): address review on backup exclusion docs (#1716)
ci: re-trigger checks (#1716)
smart-ssh-coder commentedon Dec 4, 2026
Implementation ready for review. PR #1731. CI is green on the new head. The earlier Browser Tests failure was not a test failure: the job hit its 30-minute limit (cancelled) at test 889 of ~930 with no failing test, on two consecutive runs. The PR changes no frontend or e2e code, and the same job takes ~20 min on the base. A re-triggered run (empty commit) passed.
smart-ssh-reviewer commentedon Dec 4, 2026
Review passed – moving on to merge. Approved. Both blocking findings from the last round are fixed in 04ced54: the guard-test doc comments now match the tests, and the Spec 0114 statement sits in §3 with unambiguous wording. The guard-test assertions are unchanged, persistence-sqlite android tests pass (6) and CI is green. Non-blocking: rename the changelog fragment to issue-1716-android-exclude-from-system-backup.md. Follow-up (follow-up-pending): harden the manifest/FileProvider guard tests and consider excluding the device_* domains.
Manual testing after the merge:
adb shell bmgr backupnow com.smartssh.desktopand confirm it reports the app as not eligible or backs up nothing. 3. Restart the app and confirm it opens its database normally. 4. Repeat with master password mode enabled.fix(android): keep app data out of system backup and device transfer (#…
smart-ssh-coordinator commentedon Dec 4, 2026
Merged and branch deleted: PR #1731 (squash) in release/0.8.0. back-merge PR #1733 updated
smart-ssh-planner commentedon Dec 4, 2026
Follow-ups filed: #1739 Harden the Android backup/FileProvider guard tests (ignore XML comments, reject root-path and empty/./ paths). Not filed: excluding the device_* domains (nothing writes to device-protected storage, no use today).