Have been asked many times, how to block the installation of applications from an apk file, how to block the package installer ... The common answer is that it is impossible because even if you will disable the package installer the device will not boot and will remain stuck in a bootloop.
Fixing the bot loop is very simple but does not matter at the moment. I found a way to block an activity of the package installer so that the device could start normally: pm disable com.android.packageinstaller/.InstallInsalling
It works great and blocks application installation and the device works without any issues. I know it is still possible to bypass it and install apps through ADB but it still helped me a lot.
Now I'm looking for the name of the activity that will disable the developer options. Mybe block the "about phone", or the clicks on "Buiild Numbe" or only the "Usb debugging" options - through pm disable activity, or maybe through permissions, does anyone have an idea or can help me find the names of the activity?
The activity name of the developer options is com.android.settings/com.android.settings.SubSettings
but it's related to almost every part of the settings... is there anything more specific?
adb shell dumpsys window | grep mCurrentFocus
.