This Magisk/KernelSU/APatch module patches packages.xml to address DroidGuard's UNKNOWN_INSTALLED status. This helps resolve issues related to app installation and verification on devices with Play Services.
DroidGuard uses several attributes within the packages.xml file to track app installations. This module modifies these attributes on non-system packages to ensure that apps are recognized as properly installed, preventing the UNKNOWN_INSTALLED status and related problems. Specifically, it:
- Sets the
installer,installInitiator, andinstallerUidattributes within each<package>tag inpackages.xmltocom.android.vending(the Google Play Store's package name identifier) and the corresponding user ID. This helps DroidGuard recognize the installation source as legitimate. - Removes the
installOriginatorattribute, as it can sometimes cause conflicts. - Removes the
isOrphanedandinstallInitiatorUninstalledattributes if their values are set totrueor1, as these can flag an app as incorrectly installed. - Changes the
packageSourceattribute to the constant value2(which representsPACKAGE_SOURCE_STORE), adding it when missing. - Skips system packages (
system="true"orsystem="1") to avoid incorrectly marking pre-installed OEM apps as Play Store installs.
This module uses abx2xml and xml2abx binaries if not in your system by default (provided by rhythmcache/android-xml-converter) to convert between binary and text XML formats, as packages.xml is typically in binary XML format. The module includes architecture-specific binaries for aarch64, armv7aeabi, i686, x86_64, and riscv64.
Important Warning: The environment check verdict modification implemented by this module is a relatively new technique. Google's implementation of this check is not yet robust enough to guarantee that all your packages will be correctly identified. It's possible that some apps might still trigger Play Protect warnings or behave unexpectedly, even after using this module. This is due to limitations and potential inconsistencies in how Google verifies app installations. Use this module with caution and be aware of the potential for these issues.
- Install this module through Magisk Manager, KernelSU, or APatch.
- Reboot your device for the changes to take effect.
Important: Installation from recovery is not supported. You must install this module from within a running Android environment (Magisk/KernelSU/APatch).
This module works automatically upon installation and reboot. No further user interaction is required. It modifies the necessary XML file during the boot process.
The module creates backups of the original packages.xml file in /data/adb/modules/BetterKnownInstalled/backup/ before making any changes. Up to five backups are kept, including the latest one. The backups are timestamped for easy identification.
The module logs its activity to /data/adb/modules/BetterKnownInstalled/BetterKnownInstalled.log. This log file can be helpful for troubleshooting.
- rhythmcache aka winter for the
abx2xmlandxml2abxbinaries. - @gavdoc38 for the PR updating problematic attributes.
- @T3SL4 (Me) for creating this module.
This project is licensed under the terms of the GNU General Public License v3.0. See the LICENSE file for details.