A practical Termux + Android Debug Bridge (ADB) package manager for Android devices.
It started as a small APK installer and evolved into a reusable command-line toolkit for installing patched APKs, handling split packages, managing user-installed/system packages, and recovering from a specific Android ART/dexopt profile mismatch that can affect patched APKs.
No root. No Shizuku dependency. No permanent privileged service.
ADB/Wireless Debugging is used only when you need package-management operations.
.apk.apks.xapk.apkm- Split APK installation with
adb install-multiple - Dedicated package directory:
/storage/emulated/0/APK
The interactive installer searches only this directory.
The apk command can also:
- π List installed packages
- π Search package names
- π Inspect package information
- π« Disable an app for user 0
- β Re-enable an app
- ποΈ Uninstall a package for user 0
- β»οΈ Restore a preinstalled package with
install-existing
Some patched APKs can trigger an Android ART profile/checksum mismatch during installation. When the normal installation fails with the known profile/dexopt indicators, the script automatically retries with:
adb install -r --ignore-dexopt-profile APP.apkThe script does not automatically:
- uninstall the app
- wipe application data
- disable ProfileInstaller
- delete ART profiles
- modify the patched APK
- require root
- require Shizuku
The normal installation is always attempted first.
Some Android/OEM packages cannot be disabled or modified by the ADB shell user. For example, some Vivo/iQOO privileged packages can return a SecurityException stating that root permission is required.
The manager detects this common response and reports:
π OEM Protected Package
β Nothing was changed.
It does not attempt to bypass OEM security restrictions.
Use the official Termux distribution you normally use. This project is designed around the GitHub/F-Droid style Termux environment rather than a Play Store build.
For the GitHub build, see the official Termux project:
https://github.com/termux/termux-app
pkg update && pkg upgradepkg install android-tools unzipThe script uses Bash, ADB and unzip.
termux-setup-storageAllow the Android permission prompt.
mkdir -p /storage/emulated/0/APKPut your APK packages in that folder.
Enable Developer Options β Wireless Debugging on the Android device.
Pairing and connecting are separate operations.
For a normal connection, use the address and port shown by Android:
adb connect IP:PORTExample format only:
adb connect 192.168.x.x:xxxxx
Never commit your real local IP address, pairing code, or other private connection details to a public repository.
Check the connection:
adb devicesYou should see a device ending in:
device
Then run:
apkCopy the repository's apk script into your Termux executable directory:
mkdir -p ~/bin
cp apk ~/bin/apk
chmod +x ~/bin/apkMake sure ~/bin is in your PATH:
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcVerify:
command -v apkExpected form:
/data/data/com.termux/files/home/bin/apk
Check the version:
apk --versionRun:
apkChoose:
1) π¦ Install APK/package
2) π οΈ Manage installed apps
3) β Exit
The installer scans:
/storage/emulated/0/APK
and presents supported package files for selection.
Install a package from the APK directory:
apk install example.apkOr provide a full path:
apk install /path/to/example.apkYou can also pass a filename directly:
apk example.apkSupported containers:
.apk
.apks
.xapk
.apkm
Run:
apkand select:
2) π οΈ Manage installed apps
Available operations:
apk listapk search gboardapk info com.example.appapk disable com.example.appEquivalent operation:
adb shell pm disable-user --user 0 com.example.appapk enable com.example.appapk uninstall com.example.appThe script intentionally uses:
adb shell pm uninstall --user 0 PACKAGEFor a preinstalled/system package, this normally removes it for user 0 rather than deleting the underlying system APK.
apk restore com.example.appEquivalent operation:
adb shell cmd package install-existing --user 0 com.example.appThis is useful for restoring a preinstalled application that was previously removed for user 0.
If a patched keyboard uses a different package name from stock Gboard, you can keep the patched keyboard active while removing the stock package for user 0.
First inspect installed packages:
apk search gboardThen, after confirming the package names and making sure another keyboard is available:
apk uninstall com.google.android.inputmethod.latinRestore the preinstalled copy later with:
apk restore com.google.android.inputmethod.latinAlways verify the package name before performing package operations.
A patched APK can sometimes fail with output similar to:
Error occurred during dexopt when processing external profiles
The profile does not match the APK
The checksums in the profile do not match the checksums of the .dex files
The installer first performs the normal operation:
adb install -r APP.apkIf the output matches the known profile/dexopt failure patterns, it retries:
adb install -r --ignore-dexopt-profile APP.apkFor split packages it similarly retries adb install-multiple with the profile flag.
The failure is environment-dependent. The same patched APK may install normally on one Android device and encounter the profile mismatch on another.
Therefore the manager uses normal install first, targeted fallback second rather than always bypassing profile processing.
This project is intentionally conservative.
- Use ADB package-management commands
- Limit destructive package removal to
--user 0 - Ask for
YESbefore interactive uninstall - Keep system APKs intact when using user-scoped uninstall
- Detect common OEM/root-only failures
- Leave OEM security restrictions alone
- Root the device
- Exploit Android security boundaries
- Bypass OEM root-only restrictions
- Modify
/system - Patch APKs
- Modify Morphe
- Wipe app data automatically
- Delete ART profiles automatically
- Install a persistent privileged daemon
- Require Shizuku
Wireless Debugging/ADB is intended to be used only when required.
A practical workflow is:
Enable Developer Options
β
Enable Wireless Debugging
β
Connect ADB
β
Perform the required package operation
β
Disconnect ADB
β
Disable Wireless Debugging / Developer Options when finished
Whether a banking/payment application accepts a device with Developer Options or Wireless Debugging enabled is controlled by that application's own security checks. This project does not attempt to bypass those checks.
The APK manager itself does not need a separate backup mechanism. Back up your Termux home and usr directories with your own Termux backup workflow.
A generic backup script can be kept outside the public project if it contains personal configuration.
Do not commit:
- API tokens
- passwords
- pairing codes
- private IP addresses
- personal NextDNS profiles
- private backup archives
- company files
- company credentials
Personal utilities such as a nextdns-backup script are intentionally not included in this repository when they may contain user-specific configuration or credentials.
$HOME/
βββ bin/
β βββ apk
βββ .apk_tmp/ # temporary extraction directory
βββ ...
/storage/emulated/0/
βββ APK/
β βββ app.apk
β βββ app.apks
β βββ app.xapk
βββ Termux Backups/
Before releasing a new version, test at least:
- Normal
.apkinstall - APK filename containing spaces
-
.apkssplit package -
.xapkpackage -
.apkmpackage - Normal installation without profile error
- Known ART/profile mismatch fallback
-
apk list -
apk search QUERY -
apk info PACKAGE - Disable a normal package
- Re-enable it
- Uninstall a user-scoped package
- Restore a preinstalled package
- OEM-protected package returns a friendly error
- ADB-disconnected state returns a clear error
This project deliberately uses Termux + ADB instead of implementing or embedding Shizuku.
Shizuku provides an IPC/Binder service that other Android applications can use to request privileged operations. This project instead keeps the workflow inside Termux and invokes ADB directly.
That means:
- Existing Shizuku-compatible applications do not automatically work with this project.
- This project does not claim to be a Shizuku replacement.
- It is useful when the desired operation can be performed through ADB/Package Manager commands.
Termux itself provides a RUN_COMMAND interface that can allow external applications to request Termux commands when explicitly configured and granted permission. If a future companion app is added, its security model should follow the official Termux permission requirements rather than exposing arbitrary shell access. See the official Termux RUN_COMMAND documentation: https://github.com/termux/termux-app/wiki/RUN_COMMAND-Intent
Issues and pull requests are welcome.
Please keep contributions focused on:
- Android package management
- Termux compatibility
- ADB workflows
- APK/APKS/XAPK/APKM handling
- Reliability and error handling
- Documentation
Do not submit:
- private credentials
- company code
- proprietary APKs
- personal backup archives
- device-specific secrets
- bypasses for security controls
The main branch should remain protected. Pull requests are preferred for changes so they can be reviewed before merging. GitHub supports protected branches and PR templates for this workflow: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches
See CONTRIBUTING.md.
Please do not publish security-sensitive information in issues or pull requests.
For security reports, see SECURITY.md.
GitHub recommends maintaining a SECURITY.md policy so users know how to report vulnerabilities privately: https://docs.github.com/en/code-security/getting-started/quickstart-for-securing-your-repository
MIT License. See LICENSE.
Version: 1.1.0
This is a personal/open-source utility built around Android's ADB and package-management interfaces. Android/OEM behavior can differ between devices and software versions, especially for privileged system packages.
If an operation fails with an OEM/root-only SecurityException, the correct behavior is to report the restriction rather than attempt to bypass it.