BetterKnownInstalled v1.6.0
New
- Stateful metadata database — BKI now tracks per-app original values in
metadata.db(pipe-delimited:name|installer|installerUid|installInitiator|packageSource|installOriginator|isOrphaned|installInitiatorUninstalled). - First boot: scans
packages.xmland builds the DB from original values, then patches. - Subsequent boots: prunes dead entries, detects newly installed apps, and re-applies patches. No more blind full-scan of every app on every boot.
- Uninstall restoration — new
uninstall.shrestores each app's exact original metadata frommetadata.dbduring the uninstall reboot, then deletes the DB. Previously patched apps no longer stay locked ascom.android.vending. - Atomic writes — all XML modifications are staged to
.tmpand moved into place (cat > .tmp && mv -f), eliminating the risk of a half-writtenpackages.xmlon crash or power loss.
Fixes
- Accurate uninstall — v1.5.x left every patched app as
com.android.vendingafter uninstall because there was no record of what the original installer was. The DB solves this permanently. - Faster subsequent boots — DB prune + new-app detection adds ~50 ms instead of re-processing 500+ apps every boot.
Changes
- Removed XML backup rotation — the old 4-file rotating backup scheme is gone.
metadata.dbis the authoritative backup of original values. A singlepackages.xml.safetytext copy is kept for crash recovery only. wait_for_data()moved toutil_functions.sh— shared betweenpost-fs-data.shanduninstall.sh.- Added
riscv64architecture support inget_arch().
Technical
- Engine:
sed(unchanged) + single-passawkfor DB operations - State:
metadata.dbin module directory, rebuilt on first boot, pruned/updated on subsequent boots - Scope: unchanged —
codePath="/data/app/"whitelist,system="true"/"1"guard - UID source:
com.android.vendingself-entry → existing Play Store app fallback
Upgrade Note
If upgrading from v1.5.x, the DB is built from the already patched packages.xml. Apps previously patched will have their patched values recorded as "originals," so uninstall will not revert those specific apps to their true pre-BKI state. Any app installed after v1.6.0 is fully tracked and will restore correctly.