0

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?

Joe
  • 115
  • 1
  • 1
  • 9
  • 1
    Open the app/activity and run adb shell dumpsys window | grep mCurrentFocus. – Irfan Latif Jun 21 '21 at 11:06
  • Answered here: https://android.stackexchange.com/a/175410/218526 – Irfan Latif Jun 21 '21 at 11:08
  • Install App Manager app from F-Droid, find Settings app in the apps list shown in it, click on it then Activity, then search for the term "develop". You will get very close to what you need. – Firelord Jun 21 '21 at 11:12
  • @Fireloard I have already tried AppManager, there are only 2 activities related to Developer options, and even after I blocked both nothing happened. I'm now trying irfan's advice – Joe Jun 21 '21 at 11:23
  • @Irfan the name is "com.android.settings/com.android.settings.SubSettings" but it's related to many other options... is there anything more specific? I can't find the name of the activity of the Usb debugging switch with your command because when I click it the adb disconnect... – Joe Jun 21 '21 at 11:33
  • Anther question, when I'm entering DO via settings and use the command adb shell dumpsys window | grep mCurrentFocus I get: com.android.settings/com.android.settings.SubSettings ..... But when I'm using an app called "developer options Shortcut" and then the dumpsys window command I get com.android.settings/com.android.settings.Settings$DevelopmentSettingsDashboardActivity - and when I'm pm disable it just block the settings main app with all the settings.... when blocked via AppManager it dose nothing.... why its like that? – Joe Jun 21 '21 at 11:53
  • 1
    Activity - which can be disabled or enabled - is the whole screen of an app, not a part of it, like you are looking for just USB Debugging switch. Also note that any app can disable or enable any of its components (which include Activities) at any time. So what you disabled may not remain disabled forever. – Irfan Latif Jun 21 '21 at 12:39
  • I understand any app can enable any of it components at any time, but why after 2 years it will suddenly decide to do that? 2. So there is no way you know that can block a part of an app like usb debugging? 3. is there an option to revoke the permission: android.permission.MANAGE_DEBUGGING, from Settings app or form --user 0? I got this message: is not a changeable permission type?
  • – Joe Jun 21 '21 at 12:46