MrRare2's DPC app based on OwnDroid.
This uses Android's Device Policy Manager.
This is mostly only used for MrRare2 but you can use it as well if you want.
- Disable camera
- Disable screen capture
- Disable status bar
- Master volume mute
- Common Criteria mode
- Hardware monitor (temperatures, fan speeds)
- Reboot device
- Change time / time zone
- Lots of policies (permission, MTE, Nearby streaming, FRP)
- Lock task mode
- Security logging
- Network (VPN always on, private DNS, WiFi)
- Network logging
- User restrictions (change wifi state, change location state, block factory resetting via settings, etc..)
- App block install / uninstall / hide / suspend
- Manage users
- Reset password
- Set timeout
- Configure keyboard features
- App lock/hide
- Themes (Material Design 3 + Dynamic Color)
- Root
- Shizuku
- Dhizuku
- ADB ->
dpm set-device-owner dev.mr2.dpc/.Receiver
java.lang.IllegalStateException: Not allowed to set the device owner because there are already some accounts on the device
- Freeze those apps with accounts using Hail.
- Or uninstall them
java.lang.IllegalStateException: Not allowed to set the device owner because there are already several users on the device
Note
Some systems have a feature like "App cloning" or "Kids Space" which are usually just users.
- Remove those users (secondary users, guest accounts, etc...)
You can check the receiver file for the intent extras to sends as well as the arguments
am broadcast -n dev.mr2.dpc/.ApiReceiver -a dev.mr2.dpc.api.ACTION_NAME --es key ...Intent intent = new Intent("dev.mr2.dpc.api.ACTION_NAME");
intent.setClassName("dev.mr2.dpc", "dev.mr2.dpc.ApiReceiver");
intent.putExtra("key", "...");
sendBroadcast(intent);val intent = Intent("dev.mr2.dpc.api.ACTION_NAME").apply {
setClassName("dev.mr2.dpc", "dev.mr2.dpc.ApiReceiver")
putExtra("key", "...")
}
sendBroadcast(intent)Send a raw TCP response to localhost at the port defined in the app with a base64 encoded AES-GCM 256-bit JSON request, with the key being the SHA-512 of the API key using only the first 32 bytes, under the spec of IV + ciphertext + tag. Decoding is the opposite way: base64 decode -> AES decrypt with key -> parse JSON. It also uses the same spec.
Warning
Only use the TCP API at your own risk! The developers are not responsible for any type of damage this usage may cause, as with the usage of the app itself.
- Install deps
pkg update && pkg upgrade -y && pkg install -y gradle kotlin openjdk-17 aapt2 apksigner wgettermux-setup-storage
- Install Android SDK tools (here)
gradle buildorgradle assembleReleasecp app/build/outputs/apk/release/app-release.apk /sdcard/MDPC.apk
AAPT2 aapt2-* Daemon #0: Daemon startup failed
Append this into ~/.gradle/gradle.properties:
android.aapt2FromMavenOverride=/data/data/com.termux/files/usr/bin/aapt2
And try again
ERROR: AAPT: error: failed to load include path /data/data/com.termux/files/home/apps/sdk/platforms/android-*/android.jar. (target sdk >= 35)
As of now there has no official solution for this issue (as seen here) but you can try replacing the aapt2 binary on $PREFIX/bin with some pre built binaries like this one but I take no responsibility on these unofficial aapt2 builds, use at your own risk!.
./gradlew buildor./gradlew assembleRelease
./gradle.bat buildor./gradle.bat assembleRelease
Copyright (C) 2024 BinTianqi
Copyright (C) 2025 MrRare2
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.