Join now - be part of our community!

Disabling system apps via adb

profile.country.GB.title
joelippa
Member

Disabling system apps via adb

Has anyone attempted something like this on a Sony Bravia android TV to hide / disable system apps? :

 

adb shell pm hide a.system.app.I.want.gone

 

I read here that this doesn't require root (which is nice for me and my TV) but the reddit thread talks about phones, not android TV devices. I thought I'd ask if anyone else has attempted doing this / is attempting this just asking for trouble with potential future Sony updates.

 

Thanks!

5 REPLIES 5
profile.country.GB.title
EdwinaU
Moderator

Hi Joelippa, 

Thanks for joining the community. Hopefully you'll get some member responses to your question soon. There have been previous discussions involving adb on our boards here but I'm not sure how specific they are to your query.

Cheers,

EdwinaU

profile.country.GB.title
Jecht_Sin
Enthusiast

I can't find the thread anymore, but someone suggested that we can disable these apps using these adb commands:

echo on

adb shell pm uninstall -k --user 0 com.google.android.inputmethod.japanese
adb shell pm uninstall -k --user 0 com.google.android.play.games
adb shell pm uninstall -k --user 0 com.google.android.music
adb shell pm uninstall -k --user 0 com.sony.dtv.sonyshelf
adb shell pm uninstall -k --user 0 com.sony.dtv.sonyselect
adb shell pm uninstall -k --user 0 com.sony.dtv.bravialifehack
adb shell pm uninstall -k --user 0 com.sony.dtv.netflixmanager
adb shell pm uninstall -k --user 0 com.sony.dtv.networkrecommendation
adb shell pm uninstall -k --user 0 com.sony.dtv.watchtvrecommendation
adb shell pm uninstall -k --user 0 com.sony.dtv.irbrecommendation
adb shell pm uninstall -k --user 0 com.sony.dtv.woprecommendation
adb shell pm uninstall -k --user 0 com.sony.dtv.networkapp.wifidirect
adb shell pm uninstall -k --user 0 com.sony.dtv.recommendationservice
adb shell pm uninstall -k --user 0 com.sony.snei.video.hhvu
adb shell pm uninstall -k --user 0 tv.samba.ssm
adb shell pm uninstall -k --user 0 com.sony.dtv.interactivetvutil.ppbridge
adb shell pm uninstall -k --user 0 com.sony.dtv.interactivetvutil
adb shell pm uninstall -k --user 0 com.sony.dtv.interactivetvutil.output
adb shell pm uninstall -k --user 0 com.sony.dtv.interactivetvplatform
adb shell pm uninstall -k --user 0 com.sony.dtv.bleadvertiseservice
adb shell pm uninstall -k --user 0 com.sony.dtv.b2b.hotellanguage
adb shell pm uninstall -k --user 0 com.sony.dtv.b2b.hotelmenu
adb shell pm uninstall -k --user 0 com.sony.dtv.photosharingplus
adb shell pm uninstall -k --user 0 com.gameloft.android.HEP.GloftANHP

timeout 10 > nul

adb uninstall com.google.android.inputmethod.japanese
adb uninstall com.google.android.play.games
adb uninstall com.google.android.music
adb uninstall com.sony.dtv.sonyshelf
adb uninstall com.sony.dtv.sonyselect
adb uninstall com.sony.dtv.bravialifehack
adb uninstall com.sony.dtv.netflixmanager
adb uninstall com.sony.dtv.networkrecommendation
adb uninstall com.sony.dtv.watchtvrecommendation
adb uninstall com.sony.dtv.irbrecommendation
adb uninstall com.sony.dtv.woprecommendation
adb uninstall com.sony.dtv.networkapp.wifidirect
adb uninstall com.sony.dtv.recommendationservice
adb uninstall com.sony.snei.video.hhvu
adb uninstall tv.samba.ssm
adb uninstall com.sony.dtv.interactivetvutil.ppbridge
adb uninstall com.sony.dtv.interactivetvutil
adb uninstall com.sony.dtv.interactivetvutil.output
adb uninstall com.sony.dtv.interactivetvplatform
adb uninstall com.sony.dtv.bleadvertiseservice
adb uninstall com.sony.dtv.b2b.hotellanguage
adb uninstall com.sony.dtv.b2b.hotelmenu
adb uninstall com.sony.dtv.photosharingplus
adb uninstall com.gameloft.android.HEP.GloftANHP

timeout 10 > nul

They had been tested still, obviously, do it at your own risk. I only used the one to disable Samba TV. If anything goes wrong I didn't find out how to enable them back, other than doing a factory reset. Reboot the TV after using any of these commands.

 

Actually I have found it. The discussion starts from this page: https://community.sony.be/t5/android-tv/android-7-0-nougat-update-discussion-thread/td-p/2326414/pag... - look for the post of Frago21ps

profile.country.GB.title
joelippa
Member

Thanks Jecht_Sin, that's very useful much appreciated.

 

I must admit that uninstalling apps does scare me because I can't imagine how I'd reinstall an uninstalled app should I need to. I hope that if I just disable an app, I might be able to re-enable it if required.

 

Your post and the post byFrago21ps does prove that's it's possible to run adb commands against the TV so I think I'll definitely run some tests.

 

Thanks again, I'll report back with whatever I find.

profile.country.GB.title
joelippa
Member

Update #1:

 

The "pm hide" option no longer works at all with Android N (7.0) because this feature has been locked down by Google in a previous security update:

 

adb shell pm hide XX

 

An attempt to hide an app with this method will result in the following response and the app will remain untouched:

 

Error: java.lang.SecurityException: Neither user 2000 nor current process has android.permission.MANAGE_USERS.

 

Pursuing an adb shell temp root might be a way forward here for the brave who are willing to attempt it but I personally won't go down this path. 

 

Another option is "pm disable" but unlike "pm hide" (which no longer works), disable has always required root so this option is also ruled out:

 

adb shell pm disable XX
profile.country.GB.title
joelippa
Member

Update #2:

 

Although "pm hide" is now defunct in Android N+, there could still be hope for disabling system apps on non-rooted TVs to some degree at least. The following does work in adb without error when called for a system app, in this case the samba / flingo app:

 

adb shell cmd appops set tv.samba.ssm RUN_IN_BACKGROUND ignore

 

There's more info here that describes what this command line is supposed to do, but to summarise in case that page ever goes away: 

 

"How exactly this command works is that it allows you to restrict a hidden permission that is normally not accessible to the user in the Settings app. This permission is called the RUN_IN_BACKGROUND permission and the only way it can be modified is to use “cmd appops” which is the command line interface for “App Ops” – Google’s user-facing permission management system.

 

Google added this hidden ADB command that enables you to restrict any application from receiving implicit broadcast intents (ie. the app waking up in the background) and also prevent those applications from scheduling background services without using JobScheduler (ie. the app waking up at an inopportune time, draining your battery). This command is actually meant for use only by developers looking to simulate how their app would perform under low memory conditions, but thankfully we’re able to put it to our own use."

 

Having instructed android to ignore / restrict requests for RUN_IN_BACKGROUND for an app via the cmd appops command line, we can check it's status as follows:

 

 

adb shell cmd appops get tv.samba.ssm RUN_IN_BACKGROUND
RUN_IN_BACKGROUND: ignore; time=+1d22h36m17s921ms ago; rejectTime=+21s415ms ago

 

 

..which in this case confirms that "ignore" has been successfully set against the RUN_IN_BACKGROUND permission for the tv.samba.ssm app. Having rebooted the TV, I can confirm that this setting persists across reboots.

 

Unfortunately it's not good news for the tv.samba.ssm app because this app avoids all attempts to stop it running. Disabling it in the normal way (when the option is available) from the app manager in settings also doesn't stop it completely and DNS requests flingo.tv continue. Samba interactive has the hallmarks of malware. 

 

All supported AppOpManager AppOps operations (permissions i.e.RUN_IN_BACKGROUND) are declared within this file:

https://github.com/aosp-mirror/platform_frameworks_base/blob/master/core/java/android/app/AppOpsMana...