Skip to content

v1.6.1 (1610)

Latest

Choose a tag to compare

@0x11DFE 0x11DFE released this 11 Sep 00:06

BetterKnownInstalled v1.6.1

New

  • OTA update supportupdateJson added to module.prop, so the manager can now notify you when a new BKI release is available.
  • Regression harness (tools/bki_debug.sh) — a self-contained test suite that dot-sources the real module functions and validates them against any packages.xml dump (e.g. from abx2xml) without touching the live system. Covers uid resolution, DB build/prune/update, patch semantics (no duplicate attributes, well-formed output), end-to-end process_xml, byte-identical idempotency, and the uninstall restore round-trip. Expect 24 passed, 0 failed. Verified against a real 868-package packages.xml on-device.
  • Full ABX variant supportinstallerUid-int, packageSource-int, isOrphaned-bool, and installInitiatorUninstalled-bool attribute variants are now handled consistently across the patch, the metadata DB, and the uninstall restore.

Fixes

  • Invalid XML on multi-line packages.xml — when the system writes package attributes wrapped across multiple lines, the old engine injected a duplicate installer attribute (and silently skipped the wrapped attributes), which could make Package Manager reject the file. The new walker edits the complete <package> element regardless of line wrapping.
  • packages.xml grew on every boot — the old line-split → modify → collapse round-trip was not idempotent. The new pre-split and patch are fixed points: a second full run is byte-identical, verified by the harness.
  • Multi-line packages skipped — they were invisible to the metadata.db build/scan and to the v1.6.0 uninstall restore.

Changes

  • Engine rewrite — the 8-pass sed pipeline is replaced by a single streaming awk pass that walks the file once and edits one <package> element at a time. Output is now byte-minimal: everything outside patched user apps is preserved verbatim instead of being reformatted.
  • uninstall.sh rebuilt on the same engine — streaming restore (no more tr '\n' ' ' collapse), strips and re-injects all installer-related attribute variants, keeps the safety backup, atomic write + verify.
  • Shared helpers consolidatedensure_abx_tools() and restore_perms() moved to util_functions.sh alongside wait_for_data().

Technical

  • Engine: single-pass streaming awk (walker hands one <package>…</package> segment at a time to handle_package()); heredoc-quoted fragments, no eval
  • Idempotency: pre-split s|</package>\(.\)|…\n\1|g and the patch are both fixed points — repeated boots do not modify or grow the file
  • State: metadata.db schema unchanged (8 pipe-delimited fields) — v1.6.0 DBs are fully compatible
  • Scope: unchanged — codePath="/data/app/" whitelist, system="true"/"1" guard
  • UID source: com.android.vending self-entry → existing Play Store app fallback (both now multi-line-safe)

Upgrade Note

Upgrading from v1.6.0 is seamless — the DB schema is unchanged and existing entries are reused. The v1.6.0 caveat still applies for apps first patched before v1.6.0 (their patched values are recorded as "originals," so uninstall won't revert those to the true pre-BKI state). Everything installed after v1.6.0 restores exactly.

Full Changelog

1600...1610