AppManager icon indicating copy to clipboard operation
AppManager copied to clipboard

Blocking/Editing components still doesn't work on 3.1.4

Open HarriBuh opened this issue 1 year ago • 8 comments

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

HarriBuh avatar Dec 24 '23 09:12 HarriBuh

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.

MuntashirAkon avatar Dec 24 '23 09:12 MuntashirAkon

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

HarriBuh avatar Dec 24 '23 15:12 HarriBuh

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 avatar Dec 25 '23 08:12 mehdits90

Very good

mehdits90 avatar Dec 25 '23 08:12 mehdits90

I have the same issue with components not being disabled.

mahmoudk1000 avatar Dec 25 '23 09:12 mahmoudk1000

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 avatar Dec 28 '23 20:12 craigacgomez

@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

craigacgomez avatar Dec 29 '23 05:12 craigacgomez

@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.

MuntashirAkon avatar Dec 29 '23 09:12 MuntashirAkon

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?

parasiteoflife avatar Mar 01 '24 22:03 parasiteoflife

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).

MuntashirAkon avatar Mar 02 '24 11:03 MuntashirAkon

@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?

varunpilankar avatar Mar 11 '24 05:03 varunpilankar

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

acysm avatar Mar 11 '24 18:03 acysm

730213c320add99d20207d75ef2b020500eb404e

MuntashirAkon avatar Mar 18 '24 09:03 MuntashirAkon

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

parasiteoflife avatar Jul 11 '24 00:07 parasiteoflife

Milestone says the fix was made in v3.1.5 onwards

MuntashirAkon avatar Jul 11 '24 03:07 MuntashirAkon

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.

HarriBuh avatar Jul 11 '24 05:07 HarriBuh

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: @.***>

varunpilankar avatar Jul 11 '24 06:07 varunpilankar

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 avatar Jul 11 '24 07:07 MuntashirAkon

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

MuntashirAkon avatar Jul 11 '24 07:07 MuntashirAkon

@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...

HarriBuh avatar Jul 11 '24 08:07 HarriBuh

@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]

MuntashirAkon avatar Jul 11 '24 08:07 MuntashirAkon

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

HarriBuh avatar Jul 11 '24 12:07 HarriBuh