Matrix
Matrix

Reputation: 11

How to disable or enable packages/services of apps programatically like Package disabler pro app

Im currently developing a Virtual Reality app.When i open my app and connect the phone to Samsung Gear VR device, the default gear vr home screen appears ; so i cannot see my app with the gear vr device.I saw apps like "Package Disabler Pro" and "cb enabler for gear vr" which disables the gear vr package/service so that i can see my app using the gear vr. But i cannot use a third party app to do this.I need to disable the gear vr service/package via my own vr app.So my questions are

1)How to disable package/service of another application programmatically ?

2)Do we need to root the phone for doing this ?

3)How to re-enable the package/service programmatically ?

Any help would be greatly appreciated

Upvotes: 1

Views: 2475

Answers (2)

Acuna
Acuna

Reputation: 1837

You must have a rooted phone and su installed, and yes, you can make it with all apps (and system too). Just input a commands to shell in your app:

su
pm disable com.site.package
pm enable com.site.package

ADD The reason that you don't see your app is that it installed as a system app, this apps doesn't appears in menu.

Upvotes: 1

AminST
AminST

Reputation: 381

this is work for others but not for me .i hope its work for you.if you want hide other packages just change com.android.camera with your package name.if you want enable packages just change disable to enable

Process process = Runtime.getRuntime().exec(new String[]{"s" , "-c","pm 
disable com.android.camera"});
process.waitFor();

Upvotes: 0

Related Questions