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

Unable to disable or uninstall packages on older android versions #78

Closed
eauchat opened this issue Nov 30, 2021 · 16 comments
Closed

Unable to disable or uninstall packages on older android versions #78

eauchat opened this issue Nov 30, 2021 · 16 comments
Labels
bug Something isn't working help wanted Extra attention is needed
Milestone

Comments

@eauchat
Copy link

eauchat commented Nov 30, 2021

First, thanks a lot for the amazing software, it works very well and I very much appreciate it!! :)

Lately I've been trying to debloat an old huawei device with android 4.2.2 on it.
The UAD interface somehow seems to display the "Disable"/"Uninstall" buttons dimmer, and clicking them does nothing.

I searched but didn't find documentation on that kind of issue.
What could be the reason why it's not working?
Thanks a lot for the attention :)

@eauchat eauchat changed the title Unable to disable or uninstall packages on android 4.2 Unable to disable or uninstall packages on older android versions Nov 30, 2021
@eauchat
Copy link
Author

eauchat commented Nov 30, 2021

Actually, I'm also encountering the same issue with a Xiaomi device running android 7.1.
I wonder if there's anything I'm doing wrong, but I don't think so.

@0x192
Copy link
Owner

0x192 commented Dec 1, 2021

First, thanks a lot for the amazing software, it works very well and I very much appreciate it!! :)

Thanks! :)

The UAD interface somehow seems to display the "Disable"/"Uninstall" buttons dimmer, and clicking them does nothing.

Can you upload the logfile here please?

@0x192 0x192 added type::bug bug Something isn't working and removed type::bug labels Dec 1, 2021
@eauchat
Copy link
Author

eauchat commented Dec 4, 2021

Can you upload the logfile here please?

Yep, sure.

I just reproduced the bug right now, this is what I did:

  1. plugged the phone,
  2. opened the app,
  3. tried disabling a few apps (= clicked on the red "disable" button right from their names).
  4. went to settings and changed to "uninstalling" mode
  5. back to the apps list, tried uninstalling a few apps (= clicked on the red "uninstall" button right from their names).
  6. switched back to "disabling" mode

The uad.log file isn't so talkative, that's the full content of it after the mentioned operations:

2021-12-04 20:16:16 INFO  [src/gui/mod.rs:80] ANDROID_SDK: 17 | PHONE: Huawei HUAWEI Y330-U01
2021-12-04 20:16:19 WARN  [src/gui/views/list.rs:121] No custom selection imported: No such file or directory (os error 2)
2021-12-04 20:21:40 INFO  [src/gui/views/settings.rs:46] Disable mode disabled
2021-12-04 20:21:55 INFO  [src/gui/views/settings.rs:46] Disable mode enabled

@matchatealeaf
Copy link

I have the same issue on my Samsung Galaxy Note 8.0 (LTE) running Android 4.4.2.
I'm not sure if this is relevant since my Android version is slightly different from OP's 4.2.2.

Running pm disable-user com.android.chrome in adb shell returns sh: resetreason: can't execute: Permission denied.

I believe on 4.0+ pm disable-user requires root access.
A quick search online shows that pm block is the common substitute for pm disable-user in 4.0+ without root access.
Running

am force-stop com.android.chrome
pm block com.android.chrome
pm clear com.android.chrome

seems to work, and com.android.chrome is listed in UAD under the "Uninstalled" filter.

Perhaps the pm block option can be provided in the settings?

@sbechet
Copy link

sbechet commented Dec 7, 2021

see #63

@0x192 0x192 added this to the 0.4 milestone Dec 10, 2021
@0x192
Copy link
Owner

0x192 commented Dec 10, 2021

Mhm... on Android 8.0 pm disable-user works without root. I'm pretty sure it works without root since Android 5.0.

@eauchat
Can you confirm you also need root on your Android 4.4.2 phone?

adb shell pm disable-user <package>

pm disable doesn't work without root on Android 5+ so I don't think it will work but let's try just in case.

adb shell pm disable <package>

Perhaps the pm block option can be provided in the settings?

Yes but pm block only works on Android 4.4.2. I don't know what to use on older versions...


Can you both confirm pm uninstall still works on your phone ? (be careful, you can't restore the package with a command)

pm uninstall <package>

One thing I noticed is that even if the multi-user system was implemented in Android 4.2, pm uninstall can't be used with a specific user.

@0x192 0x192 added the help wanted Extra attention is needed label Dec 10, 2021
@matchatealeaf
Copy link

Mhm... on Android 8.0 pm disable-user works without root. I'm pretty sure it works without root since Android 5.0.

I think you misread my post, I'm talking about Android 4.4.2 on an old Galaxy Note 8.0 from 2013, not the Galaxy Note 8 from 2017.

Can you both confirm pm uninstall still works on your phone ? (be careful, you can't restore the package with a command)

On Android 4.4.2, pm uninstall works for me on an app that I installed myself, e.g.

pm uninstall com.aurora.store

However, it returns Failure on a built-in app, e.g.

pm uninstall com.android.chrome

@eauchat
Copy link
Author

eauchat commented Dec 24, 2021

@0x192, to answer your request

On that android 4.2.2 device, I ran the following commands and got the results you can see:

shell@android:/ $ pm disable-user com.google.android.apps.maps
pm disable-user com.google.android.apps.maps
Killed 
137

shell@android:/ $ pm disable com.google.android.apps.maps
pm disable com.google.android.apps.maps
Killed 
137

shell@android:/ $ pm uninstall com.google.android.apps.maps
pm uninstall com.google.android.apps.maps
Failure

It doesn't seem that anything changed on the device, app is still present.

I also tried what @matchatealeaf uses (pm block ...) but block command probably didn't exist in android 4.2 (Error: unknown command 'block').

I'm not able to root that device (thanks to huawei), so I can't test if any of those command would work with root.

@0x192
Copy link
Owner

0x192 commented Jan 9, 2022

Ok. This is the last issue before the release of the v0.4. Sorry for the late reply.

I didn't manage to find my old Android 4.4 phone so I couldn't do some tests.

I think you misread my post, I'm talking about Android 4.4.2 on an old Galaxy Note 8.0 from 2013, not the Galaxy Note 8 from 2017.

No, I understood that. I probably did not express myself very well. I wanted to point out that since disable-user doesn't require root since Android 5.0, it seems odd that this is not the case for Android 4.4.2.

According to @matchatealeaf, pm disable-user needs root on Android 4.4.2 but @eauchat succeed without it on Android 4.2.2

At the same time, pm disable was possible without root on Android 4.2.2 which is no longer the case since Android 5.0.

Did you both perform the commands on a already uninstalled package? Because Failure it's the typical return value of pm uninstall <already_uninstalled_package>


It doesn't seem that anything changed on the device, app is still present.

Are you sure about that? Can you list it with this command?

adb shell pm list packages -s | grep com.google.android.apps.maps

In the end, it seems that we weirdly can use pm disable-user on Android 4+ but not on Android 4.4.2

I'll make an exception to for Android 4.4.x and use pm block instead of pm disable-user

@eauchat
Copy link
Author

eauchat commented Jan 15, 2022

According to @matchatealeaf, pm disable-user needs root on Android 4.4.2 but @eauchat succeed without it on Android 4.2.2

Ah, well maybe I wasn't clear or something, but there seems to be a misunderstanding there.
Maybe the

Killed 
137

in the logs I sent are supposed to mean the command worked, but the result isn't there.
The app is still listed, and is still on the home screen, clickable, even after running all of the commands I mentioned.

Maybe there's something I didn't really get in your message @0x192, but to me the commands are failing to achieve my goal, which is to remove or at least disable the apps.
Not sure I can bring more useful information on the table on why it's failing though.

Thanks for your efforts still :)

0x192 added a commit that referenced this issue Jan 18, 2022
…8.0)

I don't know what happened. This is a nasty bug!
(and there is actually 2 bugs in the if condition)

It will help #78
@0x192
Copy link
Owner

0x192 commented Jan 18, 2022

I finally got my old Android 4.4 phone back.

1) I'm dumb. There was a nasty bug in my code preventing any action on older phones (< Android 8.0).
c188479 fixed this.

2) I can confirm we can only use pm block/pm unblock on Android 4.4.4 . All other commands need root. Old ADB version are really bad and have barely no error handling.
ADB commands can return the 0 exit code even if there is an error. ADB doesn't check if the package exists. It does not return any error if you try to pm block a non-existent package. Some commands are even killed by ADB before finishing and UAD can't catch the output. It seems to be the (questionable) behavior when the privileges are not high enough.
I also noticed that pm block doesn't set the package to the disabled state but to the uninstalled state.

3) @eauchat Unfortunately I think we're screwed without root on even older (< Android 4.4.4).
There is no other commands besidespm disable <package>, pm disable-user --user <user> <package> and pm uninstall <package>.

@eauchat
Copy link
Author

eauchat commented Jan 22, 2022

Well, the situation you describe with ADB showing bad error messages and no error handling, reflects quite well what I've observed. Thanks a lot for investigating the situation and trying to find solutions @0x192 :)
Great that this ticket helped solve that bug in the code :)

@Gaming-pandatje
Copy link

I want to delete some apps from my old phone (sm-a500fu android 6.0.1) but when I click on the uninstall button nothing happens is there any way to fix this?

@Pietzcker
Copy link

Pietzcker commented May 2, 2023

I have the same issue here (Android 6.0.1 on a Samsung Galaxy J5 (SM-J500FN)) - the device is detected, but it doesn't list anything under "Recommended/Enabled/All Lists", and when I manually search for things like facebook, Microsoft etc. and select them, clicking on Uninstall (individually or on "Uninstall Selected") doesn't do anything...

@Pietzcker
Copy link

To update this: The logfile shows that all the attempts to pm uninstall --user 0 com.xxx.yyy end in Failure - not installed for 0, but when I execute them manually in the adb shell, they work perfectly. So it seems to be a GUI issue?

@Gaming-pandatje
Copy link

Yeah I found this also out yesterday but still thanks all the bloatware is now gone on my device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants