pm uninstall -k - General Questions and Answers

There are dozens of various device specific debloat guides scattered about here and most of them use the -k option to keep the packages data and cache directories although I have seen at least one guide that didn't recommend -k.
I'm guessing that the general reason for using the -k option is so that if someone later finds out they really do need the package it can be restored to the same state that it was in prior to being uninstalled.
My question is if I don't use the -k option can that cause the potential use of install-existing to fail?
Or is it simply a matter of losing any package settings that have been changed from the default state and as long as I can remember how I want the package configured it's no big deal to get back to where I was.
So are my assumptions correct or is there a looming disaster awaiting me because I neglected to use the -k option when uninstalling?

guess it's the only way to keep entry in /data/system/packages.xml to force app disabled permanently

Thanks for the response but I don't quite understand. I assumed that the -k option saved the current state of the apps current User Data and Cache as shown in settings > app info > storage.
My understanding of packages.xml is gleaned from context but my best guess is that it's something that controls the overall android build in some way or other.
Any insight you can provide that improves my obviously muddy understanding is appreciated.

right. just guesswork because the documentation doesn't say anything about /data/system/packages.xml. I tought package won't purged when data is kept, so it can remember it when trying to reinstall. Thats the difference, without -k it is simply purged and gone, and treated as new package on reinstall. But it seems I have mixed up with /data/system/users/0/package-restrictions.xml for disabled packages (nowadays uninstalling is done with --user 0 flag which means it's not actually uninstalled but disabled for the user)
https://developer.android.com/studio/command-line/adb#pm

Related

Installing MyOffice software

I'm having a nightmare getting this software to work - I have got as far as installing the software and entering my registration details. I can get my account name up and a list of mine / my colleagues diaries, however none of the diary information will refresh.
I have tried to uninstall myoffice to try a fresh reinstall, but for some reason I cannot remove it completely. When I do this, I cannot find the myoffice software, but when I reinstall it there is not a prompt for registration details and I get exactly the same problem again - the list of my colleagues but nothing but blank diaries. When I refresh the diaries, it goes through the motions and says 'refresh complete', but there is no information in the diaries.
Anyway - my question is; how do I 'completely' remove this software so I can try a fresh install? Using the remove software function clearly isn't removing the previous registration details I entered. Any ideas?
Cheers!
James
Same as windows... search the registry and delete all related keys
An easier (and more useful in the future way): Get yourself a copy of MemMaid or SKTools. Re-install the app again and uninstall it via MM or SK.

[GUIDE] [EMUI] Improve multitasking experience

I stumbled across com.huawei.iaware thing when I was reading logcat on my Huawei device. As we all know, Huawei implemented their own very aggressive memory management on top of Android,and thus messing up multitasking experience. Even disabling Automatic Launch doesn't help, as background tasks are almost always killed. On my 2GB ram device, multitasking between only 2 apps has been a nightmare.
As seen on logcat, Iaware seems to mimic Android's Low Memory Killer but in the most aggressive way imaginable. This guide can also improve performance and battery (a little bit) as killing apps repeatedly is expensive
To disable com.huawei.iaware without root, assuming you have installed and setup adb, just run
Code:
adb shell pm uninstall -k --user 0 com.huawei.iaware
Note that doing the above command will not actually delete the app in any way and you can still receive Ota updates, but the only way to restore that app is by factory reseting your device
To disable com.huawei.iaware with root, just install Link2sd or any similar app you could think of that can disable system apps. Find com.huawei.iaware and disable it.
Mods, can you move this thread to Hacking and Development - > Android General? Thanks

Accidentally Removed Some Apps via ADB

I finally found a way to disable/uninstall apps after a long time, and I could put the ADB I got to use. I've been looking for a way to disable/uninstall various apps, especially the ones that can't be normally disabled/uninstalled, and came across this article: www.xda-developers.com/uninstall-carrier-oem-bloatware-without-root-access/. It really helped, since I couldn't get root on my phone (not available).
I started with some apps I knew I don't use (most of the google ones), but accidentally uninstalled a few necessary ones. I got one of them back via ADB, but not the other two: com.google.android.setupwizard and com.google.android.configupdater. Does anyone know where I could find the APKs file for setup wizard and configupdater? I couldn't find them on apkpure.com... If these aren't necessary for using an android-based device, please let me know.
A minor thing I noticed is that I can still disable apps after uninstalling via ADB and turn off data. Also, I could turn off special access settings (appear on top, change system settings, etc.) but those revert to on after a moment. It doesn't bother me too much (as much as the fact that uninstalled apps still remain in the Apps list).
Edit: accidentally removed com.sec.android.app.personalization (can't find on apkpure).
Also, when I was removing unecessary apps, I could get rid of samsung pay, but not the related framework via ADB. I don't know what caused this, and I tried to remove pay before and after attempting to remove the framework. There were no crashes of any kind; just the command prompt (I use windows) returning a blank line instead of success/failure.
Also, when I was removing unecessary apps, I could get rid of samsung pay, but not the related framework via ADB. I don't know what caused this, and I tried to remove pay before and after attempting to remove the framework. There were no crashes of any kind; just the command prompt (I use windows) returning a blank line instead of success/failure.
Update: Found all of them on apkmirror instead. Case closed.
The setup wizard one was causing issues (looping app has stopped), so I removed it again with ADB. I might've got the wrong version or something...
Edit: Can't find a version of com.sec.android.app.personalization that will install properly, and my contact names are messed up (and the app stopped working).
MOD ACTION:
Thread closed as duplicate at the request of OP.

Why can't I remove bloatware apps on secondary users in Android?

For context, I'm using stock Android 13 (rooted) on my Pixel 5, and I, for the life of me, cannot figure out how to remove preinstalled bloatware apps from the secondary users. To clarify, I'm not talking about apps from the primary admin user (i.e. --user 0 in ADB) or work profiles; I'm talking about secondary users in which only one can be used at a time. I have no issues with removing apps from the primary profile, but I actually want to use a secondary user profile without the bloatware. In ADB, the error I get is "Failure [DELETE_FAILED_USER_RESTRICTED]," which leads me to believe that it may be possible to change some parameters using ADB and pm, but I can't seem to find what I'm looking for. I also tried it on the device, since I have root, and that failed, too. As far as I'm aware, I'm one of the first people to inquire about this, so if anyone has any information that can help me with my issue, I would greatly appreciate it. Thanks for reading my post!
My theory. The secondary user is using a separate memory space and perhaps links to actual files (e.g. hard links) rather than real copies.
The purpose of creating a sub-user account is to limit its ability to make changes to the main system, which, as you can see from your analysis, has been achieved.
p.s.
Perhaps also the user id are different and have different permissions in the system.
An Android device can have multiple users, which are the equivalent of users on a computer, if device supports that feature: Note that user 0 isn't always identical with the device administator, it's the default system user - primary user - who exists on all Android installations, he is called root . Secondary users are Android users with separate apps and data saved between sessions will say it’s an entirely different profile with its own apps, settings, wallpaper, and the like.
Each user gets a workspace for installing and placing apps. No user has access to another user's app data. Each user can influence the installed apps for all users. An admin user can remove apps or even the entire workspace set up by secondary users.
Exception: OBB Folder (/sdcard/Android/obb) is used to share files and folder between the multi users, but OBB folder may not be shown in second user.
You manage these users with their specific user id like e..g. user 1027:
Example:
Code:
adb shell "su"
pm uninstall -user <USER-ID> <PACKAGE-NAME>
xXx yYy said:
Code:
adb shell "su"
pm uninstall -user <USER-ID> <PACKAGE-NAME>
Click to expand...
Click to collapse
This didn't work for me. I get the same error: "Failure [DELETE_FAILED_USER_RESTRICTED]." I was running as superuser from ADB. Do you know of any way to work around this?
I've figured out a solution. What I ended up doing was disabling and hiding the bloatware apps using ADB. Unfortunately, this requires root, but I was able to do this since I already had it. Here are the commands I used for each of the packages:
Code:
adb shell
su
pm disable --user USER_ID PACKAGE
pm hide --user USER_ID PACKAGE
If you don't have root, you can still do this for a similar effect:
Code:
adb shell
pm disable-user --user USER_ID PACKAGE
I hope this helps someone out in debloating Android apps from secondary user profiles.

ADB App Management APK

This was built using Tasker but I'll share the extracted APK from App Factory below so it can be used without Tasker.
This is similar to ADB App Control for PC in its functioning. It has several executable commands that can be performed on applications in batches. Current commands are: Install, Enable, Disable, Uninstall, Uninstall Updates, and Reinstall. Requires ADB WiFi access to use. ROOT NOT REQUIRED. Can perform all commands on system applications.
In a nutshell, it makes debloating and re-bloating automated and quick. Can filter applications to show: System, User, Enable, Disabled, and Uninstalled. Also can combine filters and color code applications by their current state. Recently added the ability to save custom lists for quick recall of certain applications.
No experience with ADB necessary.
If you're not sure what uninstalling or disabling system applications can do to your device, you should probably not use this. I take no responsibility for any software issues that occur as a result from using this tool.
TaskerNet Task Import: CLICK HERE
Direct APK for use without Tasker below

Categories

Resources