amcommunity / TipsAndTricks

Tips and tricks on App Manager
15 stars 1 forks source link

Accidentally blocked some components which is causing a bootloop or the OS to crash during startup. How to fix via recovery? #10

Open MuntashirAkon opened 1 year ago

MuntashirAkon commented 1 year ago
  1. Try to remember the blocking method you’ve used. Default is IFW + Disable. This is also the worst case scenario here. So, if you can’t remember it, assume it’s the default.
  2. Take note of the packages and components that App Manager blocked. You can find them at /data/user/0/io.github.muntashirakon.AppManager/files/conf/ (assuming the user ID was 0). Rules for each app is saved in a file with format <package-name>.tsv (eg. io.github.muntashirakon.AppManager.tsv). If you only need the components blocked in a particular interval, you can do this by inspecting the modification date of the files.
  3. Navigate to /data/secure/system/ifw (Android M or earlier) or /data/system/ifw (Android N onwards) and delete the noted packages or components. App Manager stores rules for each package in a file with format <package-name>.xml (eg. io.github.muntashirakon.AppManager.xml)
  4. Navigate to /data/system/users/0/package-restrictions.xml, find the package names you noted earlier and delete all the XML tags called disabled-components. Example: Say you’ve accidentally block the .MainActivity of App Manager. You should find an entry like this:
    <pkg name="io.github.muntashirakon.AppManager" ceDataIndoe="12345" install-reason="3">
        <disabled-components>
            <item name=".MainActivity">
        </disabled-components>
    </pkg>

    If there's an entry like above, delete only the content beginning with <disabled-components> and ending with </disabled-components> like this:

        <disabled-components>
            <item name=".MainActivity">
        </disabled-components>

    So, the final results would be something like this:

    <pkg name="io.github.muntashirakon.AppManager" ceDataIndoe="12345" install-reason="3">
    </pkg>

In order to ensure that you didn’t corrupt the file, you should copy this file to your PC, delete the entries, validate the file using any XML validator and copy it back to where it belongs. Also, none of these files are accessible from ADB without root, but you can do this in the recovery if it supports this. If the recovery doesn't offer a terminal or a file manager, use something like the Aroma FM.

koma312 commented 1 month ago

Thank for this. It saved my arse from having to restore from recovery.