Skip to content

Command line tool to update all third-party installed apps on your Android device, using F-Droid repositories.

License

Notifications You must be signed in to change notification settings

Microeinstein/adb-updater

Repository files navigation

adb-updater

Command line tool to update all third-party installed apps on your Android device, using F-Droid repositories.

Gallery

Updating repositories Showing updates
Showing updates Updating apps after confirmation

Background

Stock Android ROMs never allowed any non-system app (like F-Droid or any other store) to install updates, without prompting the user for confirmation for every single app — imagine having 40 updates, you have to wait for a popup to appear, press Yes, hope your ROM does not complain about something, then repeat for all other apps (not including the eventual Download press and the Install press, that's 200 user interactions!).

Of course one could root their device, but that's not always possible, at least without breaking some apps and not making them show warnings (DRMs, home banking, etc...).

One way is possible though: installing apps through ADB — this method does not require any user interaction (excluding manual compatibility checks and download of course), so I decided to exploit that.

A similar way is to gain shell permissions through ADB and launch a local service to allow apps exploiting them (with the only caveat that this service must be manually restarted after each reboot). Someone implemented this idea as Shizuku, but stores must support it in order to be any useful and despite being open source, it is not free.

Features

  • using a python ADB reimplementation, no need for google's adb binary
  • support F-Droid repositories — both index v1 and v2
  • ask to backup F-Droid when no repositories are configured
  • generate adbkey when missing
  • asynchronous download when possible
  • caching
    • repositories indices, using HTTP ETag
    • apps to update multiple devices in a row (tunable)
  • check app compatibility
    • device CPU and SDK version
    • app signature and version
  • ignore updates for certain apps
  • reasonably fast searching for compatible updates
  • print apps translated labels
  • respect the XDG Base Directory specification
  • cross platform

Backlog

  • command line arguments
  • improve UX
  • add default repositories
  • make f-droid backup optional
  • direct downloads support
  • more than 1 device simultaneously
  • network adb
  • handle small-width terminals
  • support other type of sources like Obtanium?
  • CI/CD
    • build on Windows 10 using PythonWin7, test on Windows 7
  • test on macOS
  • test on Android lower than 10

Unplanned

  • self auto-update

Download

See releases.

If you want to distribute and maintain other packages of this project for other channels, feel free to reach out.

Usage

  1. open a terminal
  2. ./adb-updater (in the program directory, if not added to PATH)
  3. if no repositories are configured, a backup of F-Droid from your device must be made
  4. wait for repositories syncing
  5. wait for device apps scanning
  6. results will be printed, press Y if you want to proceed
  7. wait for apps downloading
  8. wait for apps installation
  9. profit

Configuration

Distribution Location
Posix $HOME/.config/adb-updater/config.toml
Windows (portable) .\config\config.toml
# Package name of apps to not update
ignore_pkg = [
    'org.blokada.fem.fdroid',
]

# Max cache days for each downloaded apps
[cache.apps]
max_days = 30
max_size = "1G"

# Configured repositories, descending order of priority
[[repos]]
name = "F-Droid Archive"
address = "https://f-droid.org/archive/"

[[repos]]
name = "F-Droid"
address = "https://f-droid.org/repo/"

# ...

Dependencies

Resources
Name Usage Notes
lister helper jar get device information
Python 3.10
Name Usage Notes
pyinstaller linux and windows binaries dev only
python-adb device interaction git submodule; a fork of this project
libusb1 raw USB management (wrapper)
tomlkit configuration
pysimdjson extremely fast json files parsing
json-stream json streams parsing
colorama cross-platform support for ANSI escapes
tableprint terminal tables
readchar raw user input
aiohttp asynchronous HTTP requests
certifi static mozilla certificates optional
Native (all OS)
Name Notes
libusb 1.0.0
Native (posix)
Name Notes
glibc see below
zlib
libpthread
ca-certificates optional

Platform notes

  • PyInstaller freezes all python code (even the interpreter) and it bundles most native libraries, some of which are not visible through ldd.

  • Since ABIs are forward compatible but not backward compatible, it's optimal to compile the project with the oldest glibc version possible, like 2.28 present in Debian Buster. The same may apply to other native libraries. See PyInstaller docs for more information.

  • On Windows 7 you may (must?) need to install update KB2533623 or KB3063858,
    as per this fork of Python 3.10.

Development

See the contribution guide for build instructions and more information.

License

the fuck around and find out license v0.1