Permanently enable PROJECT_MEDIA permission on Android
Must-Know Basics
Due to Android’s built-in security, every application must request the
PROJECT_MEDIA
permission from the user each time it attempts to share screen.
Unattended Mode
As a result, the current unattended-mode configuration will prompt the user for permission on every viewer connection. This behavior means the unattended mode isn’t really fully unattended on Android.
How to permanently grant PROJECT_MEDIA permission ?
Permanently enabling the
PROJECT_MEDIA
permission requires :
- a physical access to the android device (unlocked)
- a computer (Windows/Linux/MacOS) with ADB ( Android Debug Bridge ) installed
- a USB cable to connect the two
What is ADB (Android Debug Bridge) ?
ADB is a Google-provided command-line tool for debugging and testing on Android devices. It exposes features not available to regular users, and because anyone can use ADB, you can access these advanced capabilities even if you’re not a developer.
We will use
adb
to permanently grant the
PROJECT_MEDIA
permission, thereby achieving a fully unattended mode.
Setup ADB on the android device (2min)
- Go to your settings > About Phone.
- Tap the “Build number” until the “you are now a developer” message shows up. It require at least 7 taps.
- Go to your settings > System > Developer Options.
- Check the “USB debugging” is enabled.
Setup ADB on the computer (15min)
Follow this
guide
to install the
adb
command line tools
in your computer. There are builds for Windows, Linux and MacOS.
Permanently Grant permission (5min)
Connect your android device to your computer with a USB cable. If you’re prompted to “Allow USB debugging from this computer?”, tap Allow.
Open a command prompt and run the following command :
adb shell cmd appops set --user 0 net.tsplus.remotesupport PROJECT_MEDIA allow
This will grant permanently the
PROJECT_MEDIA
permission for the TSplus Remote Support Android application only.
Note : this change will survive after device reboot.
Disable ADB on your device (2min)
Because our change is saved in the android system, we can disable ADB on the android device.
- Go to your settings > System > Developer Options.
- Uncheck the “Developer Options”.
Once disabled, the “Developer Options” entry is removed from the System menu.
Restore default settings (5min)
To restore default settings, open a command prompt and run the following command :
adb shell cmd appops set --user 0 net.tsplus.remotesupport PROJECT_MEDIA default
This will reset the
PROJECT_MEDIA
permission to its default state for the TSplus Remote Support Android application only.
So every attempt to share your screen will prompt for your permission.