How to Open Android Settings to Unknown Source

There is an application which developer does not provide updated apk to us and even not publish it on Google Player.

This app updates itself by download a new apk where the end user click on notify to install.

Up to Android 8 it has worked fine, because we could set allowance to install from unknown source to all apk.

The current Android request permission individually and all the time it is reinstalled, it looses its "unknown sources" permission.

The devices are Android A10S running enterprise agent 14.4.4.1051 on a lock/kiosk screen.

I have tried to work around by grant permission using afw commands as:

enable_system_app app name 
afw_set_permission_grant_state app_name android.permission.REQUEST_INSTALL_PACKAGES allow
afw_set_permission_grant_state app_name android.permission.INSTALL_PACKAGES allow
afw_set_permission_grant_state app_name android.permission.RESTART_PACKAGES allow 

Unfortunately, this scripts does grant the required permission.

As the app open shortly the screen for granting permission and kiosk locks it back, I have tried to include the setting screen in the kiosk. I run identify command to grab the intent, but it looks as missing the fragment to properly open it.

com.android.settings/.SubSettings

I have seen some posts that uses such kind of solution I have tried, but added by the fragment as

com.android.settings/.Settings$OverlaySettingsActivity

Is there a list of fragments as including OverlaySettingsActivity which we may look to each one is the fragmented responsible for Unknown Sources ?

4 years ago
Android
ANSWERS

I could find in GitHub the java source code of one of the Android setting app.

There I could find in (https://gerrit.dirtyunicorns.com/plugins/gitiles/android_packages_apps_Settings/+/2b2abac7148163dc6199b9dd304a6cebccbf310f/AndroidManifest.xml) its manifest the fragments as:

com.android.settings/.Settings$ManageExternalSourcesActivity
com.android.settings/.Settings$ManageAppExternalSourcesActivity

I have created an hidden entry in lockdown with them and now it opens the Unknown source configuration screen to end user choose to enable/disable to a specific app_name.

It shows a list with all apps that claims to install something.

I just could not identify yet how to open it already selected on the app_name to avoid end user to set something wrong.