Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Sep 2, 2023 · 1 comment

Comments

@MuntashirAkon
Copy link
Member

MuntashirAkon commented Sep 2, 2023

  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
Copy link

koma312 commented Jul 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants