MuntashirAkon / AppManager

A full-featured package manager and viewer for Android
https://muntashirakon.github.io/AppManager/
Other
4.67k stars 264 forks source link

Blocking/Editing components still doesn't work on 3.1.7 #1259

Closed HarriBuh closed 5 months ago

HarriBuh commented 8 months ago

Please check before submitting an issue

Describe the bug

On the very latest version, which SHOULD reenable blocking of components on Android 14, it still won't do that and still will give out the error message Screenshot_20231224-100222

To Reproduce

  1. Enter app
  2. Select the desired app to edit
  3. Change tabs to any component tab
  4. Try editing
  5. Wonder why it still won't work.

Expected behavior

It should work in the latest version, according to the patch notes.

Device info

Additional context

No response

MuntashirAkon commented 8 months ago

This looks like a different issue as it does not cause a crash. You need to share some logs as I do not have access to A14 device.

HarriBuh commented 8 months ago

file_4946737612774363496.log

I tried logging it via App Manager itself. Not sure whether it contains the info you are asking for, though.

Btw: The patch notes say blocking components should work on Android 14, which is not true in any case

1257

mehdits90 commented 8 months ago

Please check before submitting an issue

  • [X] I know what my device, OS and App Manager versions are
  • [X] I know how to take logs
  • [X] I know how to reproduce the issue which may not be specific to my device

Describe the bug

On the very latest version, which SHOULD reenable blocking of components on Android 14, it still won't do that and still will give out the error message Screenshot_20231224-100222

To Reproduce

  1. Enter app
  2. Select the desired app to edit
  3. Change tabs to any component tab
  4. Try editing
  5. Wonder why it still won't work.

Expected behavior

It should work in the latest version, according to the patch notes.

Device info

  • Device: Pixel 7
  • OS Version: A14
  • App Manager Version: 3.1.4
  • Mode: Root

Additional context

No response

mehdits90 commented 8 months ago

Very good

mahmoudk1000 commented 8 months ago

I have the same issue with components not being disabled.

craigacgomez commented 8 months ago

I haven't had much time to look at this yet, but it appears that version 3.1.4 does disable some components, but not all. In my limited test, it appears to disable Services and Receivers, but does not work for providers. I don't have any issues disabling all components with the code changes I made against the 3.1.x branch (which was my incomplete PR). The one difference is that I was using null as the "callingPackage", but I haven't tested if that is the cause or if it's some of the other changes between 3.1.3 & 3.1.4

craigacgomez commented 8 months ago

@MuntashirAkon I've done some further tests and compiled the application with additional debug statements to try to get to the bottom of what's going on. Here's what I found out...

The condition "BuildCompat.isAtLeastU()" appears to return "false" on Android 14

I added a few log statements in the code to see what's going on

        if (BuildCompat.isAtLeastU()) {
            Log.i(TAG, "------------------> In isAtLeastU condition");
            Log.i(TAG, "Build.VERSION.SDK_INT = " + Build.VERSION.SDK_INT);
            Log.i(TAG, "BuildCompat.isAtLeastU() = " + BuildCompat.isAtLeastU());

            String callingPackage = SelfPermissions.getCallingPackage(Users.getSelfOrRemoteUid());
            pm.setComponentEnabledSetting(componentName, newState, flags, userId, callingPackage);
        } else {
            Log.i(TAG, "------------------> Not in isAtLeastU condition");
            Log.i(TAG, "Build.VERSION.SDK_INT = " + Build.VERSION.SDK_INT);
            Log.i(TAG, "BuildCompat.isAtLeastU() = " + BuildCompat.isAtLeastU());
            pm.setComponentEnabledSetting(componentName, newState, flags, userId);
        }

And here's the result in the logcat output

12-28 20:44:08.681  4252  4926 I AppManager:  ------------------> Not in isAtLeastU condition
12-28 20:44:08.683  4252  4926 I AppManager: Build.VERSION.SDK_INT = 34
12-28 20:44:08.684  4252  4926 I AppManager: BuildCompat.isAtLeastU() = false
12-28 20:44:08.687  4252  4926 E ComponentBlocker:  at io.github.muntashirakon.AppManager.compat.PackageManagerCompat.setComponentEnabledSetting(PackageManagerCompat.java:313)
12-28 20:44:08.687  4252  4926 E ComponentBlocker:  at io.github.muntashirakon.AppManager.rules.compontents.ComponentsBlocker.applyRules(ComponentsBlocker.java:442)
12-28 20:44:08.687  4252  4926 E ComponentBlocker:  at io.github.muntashirakon.AppManager.details.AppDetailsViewModel.lambda$updateRulesForComponent$15$io-github-muntashirakon-AppManager-details-AppDetailsViewModel(AppDetailsViewModel.java:514)
12-28 20:44:08.687  4252  4926 E ComponentBlocker:  at io.github.muntashirakon.AppManager.details.AppDetailsViewModel$$ExternalSyntheticLambda39.run(Unknown Source:8)

When I changed from "isAtLeastU()" to comparing "Build.VERSION.SDK_INT", I was able to get this working again

        if (Build.VERSION.SDK_INT >= 34) {
            Log.i(TAG, "------------------> In SDK_INT > 34 condition");
            Log.i(TAG, "Build.VERSION.SDK_INT = " + Build.VERSION.SDK_INT);
            Log.i(TAG, "BuildCompat.isAtLeastU() = " + BuildCompat.isAtLeastU());

            String callingPackage = SelfPermissions.getCallingPackage(Users.getSelfOrRemoteUid());
            pm.setComponentEnabledSetting(componentName, newState, flags, userId, callingPackage);
        } else {
            Log.i(TAG, "------------------> Not in SDK_INT > 34 condition");
            Log.i(TAG, "Build.VERSION.SDK_INT = " + Build.VERSION.SDK_INT);
            Log.i(TAG, "BuildCompat.isAtLeastU() = " + BuildCompat.isAtLeastU());
            pm.setComponentEnabledSetting(componentName, newState, flags, userId);
        }

And here's the result in the logcat output

12-28 20:44:08.681  4252  4926 I AppManager:  ------------------> In SDK_INT > 34 condition
12-28 20:44:08.683  4252  4926 I AppManager: Build.VERSION.SDK_INT = 34
12-28 20:44:08.684  4252  4926 I AppManager: BuildCompat.isAtLeastU() = false
MuntashirAkon commented 8 months ago

@craigacgomez: Thanks. This appears to be an issue with the particular appcompat library packaged with this build. This will be fixed in the next release.

parasiteoflife commented 5 months ago

I don't want to sound impatient but it's been several weeks, is a new version coming soon? Or is there a beta I could use for the moment?

MuntashirAkon commented 5 months ago

I don't want to sound impatient but it's been several weeks, is a new version coming soon? Or is there a beta I could use for the moment?

I wanted to make a release in 23 January, but I've become quite busy with work and other stuff sooner than expected. So, I was unable to manage enough time to backport and prepare a new release. Please wait another week. I plan on releasing v3.1.5 in 11 March or earlier depending on the workload and issues to be fixed (yes, there's a slightly complicated, close-source, pixel-only issue, it seems in A14).

varunpilankar commented 5 months ago

@MuntashirAkon I have problem, where I have rules of blocking trackers and other component of many apps but after few hours they get unblocked automatically. I don't know what's the cause of it. I always have to import my rules and still it doesn't work at times unless I reboot.

Have anyone else notice a similar problem?

acysm commented 5 months ago

For example I have that error, have a look, I just launched app and tried to disable component LogcatAppManager11.3.24.zip

Screenshot_20240311-203740_App Manager.png

MuntashirAkon commented 5 months ago

730213c320add99d20207d75ef2b020500eb404e

parasiteoflife commented 1 month ago

One question, this fix is only included in latest beta 4.x or it's also in 3.1.7? Thanks

MuntashirAkon commented 1 month ago

Milestone says the fix was made in v3.1.5 onwards

HarriBuh commented 1 month ago

Blocking does not work on 3.1.7, Android 14. I intentionally downgraded from 4 Beta 1 (no issues here!) to 3.1.7 to check this.

varunpilankar commented 1 month ago

That's true.. 3.1.7 still has some issues. Also, any app activities, services, receivers, etc disabled from systems native controller doesn't get reflected in App Manager.

For Eg. WhatsApp

On my Lineage OS 19.1 (rooted), from native system settings I disable a receiver (com.google.firebase.iid.FirebaseInstanceIdReceiver) and if I check it from App Manager, it still shows enabled. Also vise versa sometimes. It creates a confusion as to which one is functioning properly.

This was never the case with Warden or SD Maid app, if you disable anything from there, it used to get reflected system wide.

Regards,

Varun Pilankar

Sent from my mobile device, please embrace the typos.


From: HarriBuh @.> Sent: Thursday, July 11, 2024 10:42:33 AM To: MuntashirAkon/AppManager @.> Cc: Indrasen Pilankar @.>; Comment @.> Subject: Re: [MuntashirAkon/AppManager] Blocking/Editing components still doesn't work on 3.1.4 (Issue #1259)

Blocking does not work on 3.1.7, Android 14. I intentionally downgraded from 4 Beta 1 to 3.1.7 to check this.

— Reply to this email directly, view it on GitHubhttps://github.com/MuntashirAkon/AppManager/issues/1259#issuecomment-2222047591, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHQM6UVU7BJQRABIF5HR7ADZLYH4DAVCNFSM6AAAAABBBMRWQOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRSGA2DONJZGE. You are receiving this because you commented.Message ID: @.***>

MuntashirAkon commented 1 month ago

Blocking does not work on 3.1.7, Android 14. I intentionally downgraded from 4 Beta 1 to 3.1.7 to check this.

Working on my device running Android 14.

MuntashirAkon commented 1 month ago

any app activities, services, receivers, etc disabled from systems native controller doesn't get reflected in App Manager.

Components not blocked by App Manager have a different colour. Please read the colour code section to get an idea. The toggle button does not represent whether a component was blocked, rather it represents whether a component was blocked by App Manager. Read the related FAQ: https://muntashirakon.github.io/AppManager/en/#sec:faq:app-components

HarriBuh commented 1 month ago

@MuntashirAkon I have just done a fresh install of version 4.0.0 beta 1 and voilà - blocked components are both recognised and staying blocked again. If that wasn't proof enough...

MuntashirAkon commented 1 month ago

@MuntashirAkon I have just done a fresh install of version 4.0.0 beta 1 and voilà - blocked components are both recognised and staying blocked again. If that wasn't proof enough...

You need to upload some logs, because it clearly works fine on my device.

[video reacted]

HarriBuh commented 1 month ago

@MuntashirAkon Maybe anyone can do this, I don't have the nerves to. I'm going to stay with version 4.