-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Summary
Add a new subcommand, device-update (or device-upgrade), that uses a connected device's internal package metadata to identify and install pending updates specifically for apps originally managed by F-Droid.
Motivation
Currently, fdroidcl install -u requires an app ID or a manual list. For users with multiple devices, upgrading "everything" currently requires an "involved" workflow:
- Running
fdroidcl scanto find what's there. - Manually piping or scripting that list into
fdroidcl install. - Managing the "Hybrid Install" risk where F-Droid might try to overwrite a Play Store version of the same app (which fails due to signatures but wastes time/bandwidth).
A device-driven approach removes this friction by letting the phone's own "Installer" metadata act as the filter. This would allow fdroidcl to act as a desktop-powered Update All functionality currently available in F-Droid Android client, which would add a significant value as Google's identification policy make on-device sideloading increasingly cumbersome.
Proposed Implementation
1. Command Workflow
-
Step A (Device Selection): * If
ANDROID_SERIALis set, use it. If multiple devices are detected and no serial is provided, offer a simple interactive picker (TUI) to select the target. -
Step B (The "Installer" Filter): * Run
adb shell pm list packages -iand filter for lines containinginstaller=org.fdroid.fdroid. This ensures we only attempt to update apps that the user has intentionally placed on the F-Droid track. -
Step C (Delta Comparison): * Compare the
versionCodeof the filtered device packages against the localfdroidclindex. -
Step D (Batch Execution): * Download and execute
adb install -r -i org.fdroid.fdroidfor the identified updates.
2. Proposed CLI Interface
# Standard usage: auto-selects if one device is connected
$ fdroidcl device-update
# Example output with interactive picker:
# ? Select device:
# > [RFCT...] Samsung S25 Ultra
# [TAB9...] Samsung Tab S9 Plus
# Result:
# [✓] org.journiv.app: 1.0.2 -> 1.0.5
# [✓] org.syncthing.android: 1.27.2 -> 1.27.3
# Done. 2 apps updated.
# Exclude specific apps via substring match
$ fdroidcl device-update -e syncthing -e "work.app"
# Update the index before performing the update
$ fdroidcl device-upgrade -u
# Override the default org.fdroid.fdroid installer filtering
$ fdroidcl device-upgrade -i org.fdroid.basicTechnical Details
- Exclusion Logic: The
-eflag should support multiple instances and perform a case-insensitive substring match against the package ID. - Installer Preservation: Using the
-i org.fdroid.fdroidflag during theadb installphase is recommended to maintain the "Installer" metadata on the device for future cycles. - TUI: For the device picker, utilizing a lightweight TUI library (or simply mimicking the existing devices output with an index) would keep dependencies minimal.
I'll be happy to contribute a PR to implement this functionality if this direction align with the project's goals.