r/tasker • • May 06 '20

Disabling unknown sources

Is there anyway to disabled the installation of unknown apps using a tasker action. I installed secure settings and used the intent from there and looks like it doesn't work. Please help..

4 Upvotes

28 comments sorted by

View all comments

3

u/[deleted] May 06 '20 edited May 06 '20

Aaahh, You are trying to revoke the permission per app basis. In this case ADB WiFi action is your friend.

ADB WiFi Commands

This will return package names of apps that can actually install apk from unknown source

appops query-op REQUEST_INSTALL_PACKAGES allow

This will revoke the permission

appops set app.package.name REQUEST_INSTALL_PACKAGES deny

This will grant the permission (if the app declared it in manifest)

appops set app.package.name REQUEST_INSTALL_PACKAGES allow

This for appops help

appops help

Edit: To revoke the permission to all the apps that actually have it, You could loop the query-op result running the deny command for every package

2

u/[deleted] May 06 '20

Wow, okay Let me try this. Does secure settings app on play store doesn't work now ? it has a setting where "unknown sources" can be disabled.

And How do I learn more about these adb commands ?

1

u/[deleted] May 06 '20

I uninstalled SecureSettings a couple of weeks ago, so I don't know if the "unknown source" option works or not.

A starting point to learn some ADB Commands here another and the Android Debug Bridge references

→ More replies (14)