# OwnDroid **Repository Path**: manbu1103/OwnDroid ## Basic Information - **Project Name**: OwnDroid - **Description**: 官网版安卓版APP下载安装 - **Primary Language**: Kotlin - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-09-30 - **Last Updated**: 2026-10-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [English](Readme.md) | [日本語](Readme-ja.md) # OwnDroid 使用安卓的设备策略管理器 API 管理你的设备。 ## 下载 - [IzzyOnDroid F-Droid Repository](https://apt.izzysoft.de/fdroid/index/apk/com.bintianqi.owndroid) - [Releases on GitHub](https://github.com/BinTianqi/OwnDroid/releases) > [!NOTE] > ColorOS 用户应在 GitHub 上的 releases 下载 testkey 版本 ## 功能 - 系统:禁用摄像头、禁止截屏、全局静音、禁用USB信号、锁定任务模式、清除数据... - 网络:添加/修改/删除 Wi-Fi、网络统计、网络日志... - 应用:挂起/隐藏应用、阻止应用卸载、授予/撤销权限、清除应用存储、安装/卸载应用... - 用户限制:禁止发送短信、禁止拨出电话、禁用蓝牙、禁用NFC、禁用USB文件传输、禁止安装/卸载应用... - 用户:用户信息、创建/启动/切换/停止/删除用户... - 密码与锁屏:重置密码、设置屏幕超时... ## 工作模式 - Device owner(推荐) 激活方式: - Shizuku - Dhizuku - Root - ADB shell命令 `dpm set-device-owner com.bintianqi.owndroid/.Receiver` - [Dhizuku](https://github.com/iamr0s/Dhizuku) - 工作资料 ## FAQ ### 设备上已有账号 ```text java.lang.IllegalStateException: Not allowed to set the device owner because there are already some accounts on the device ``` 解决办法:冻结持有这些账号的 app ,或删除这些账号。 ### 设备上已有多个用户 ```text java.lang.IllegalStateException: Not allowed to set the device owner because there are already several users on the device ``` 解决办法:删除其他用户,包括工作资料、私密空间和应用分身。 ### Device owner 已存在 ```text java.lang.IllegalStateException: Trying to set the device owner (com.bintianqi.owndroid/.Receiver), but device owner (xxx) is already set. ``` 一个设备只能存在一个 device owner ,请先停用已存在的 device owner 。 ### MIUI & HyperOS ```text java.lang.SecurityException: Neither user 2000 nor current process has android.permission.MANAGE_DEVICE_ADMINS. ``` 解决办法: 在开发者设置中打开`USB调试(安全设置)`,或在root命令行中执行激活命令。 ### ColorOS ```text java.lang.IllegalStateException: Unexpected @ProvisioningPreCondition ``` 解决办法:使用 OwnDroid testkey 版本 testkey 版本和 signed 版本只是签名不同,在功能上没有区别。 ### 三星 ```text user limit reached ``` 三星限制了多用户功能,暂无解决办法。 ### 创建工作资料/用户 在大部分设备上,设置 device owner 后不能创建工作资料,因为系统在设置 device owner 时会添加`no_add_managed_profile`等用户限制。 Device owner 不能修改系统设置的用户限制,但如果你有 root 权限,你可以在 adb shell 中执行以下命令以关闭这个限制。 注意:device owner 和工作资料的 profile owner 不能为同一个 app ,否则 device owner 可能会在重启时失去特权。 ```shell pm set-user-restriction no_add_user 0 pm set-user-restriction no_add_managed_profile 0 pm set-user-restriction no_add_private_profile 0 pm set-user-restriction no_add_clone_profile 0 ``` 请谨慎绕过这些限制。这可能会导致一些预期之外的行为,比如你创建的用户在重启时被删除。 一些系统在设置了 device owner 后不允许在安卓设置中创建用户,你可以在 OwnDroid 中创建用户。 如果你有 root ,你也可以在 adb shell 中运行以上命令以解除限制。 ## 高级用户 ### API OwnDroid 提供了一个基于 Intent 的 API 。你需要在设置中设置密钥并启用 API 。括号中的数字是最小的安卓版本。 - HIDE(package: String) - UNHIDE(package: String) - SUSPEND(package: String) (7) - UNSUSPEND(package: String) (7) - DISABLE_METERED_DATA(package: String) (9) - ENABLE_METERED_DATA(package: String) (9) - DISABLE_USER_CONTROL(package: String) (11) - ENABLE_USER_CONTROL(package: String) (11) - BLOCK_UNINSTALL(package: String) - UNBLOCK_UNINSTALL(package: String) - CLEAR_APP_STORAGE(package: String) () (9) - ADD_USER_RESTRICTION(restriction: Boolean) - CLEAR_USER_RESTRICTION(restriction: Boolean) - SET_PERMISSION_DEFAULT(package: String, permission: String) (6) - SET_PERMISSION_GRANTED(package: String, permission: String) (6) - SET_PERMISSION_DENIED(package: String, permission: String) (6) - SET_SCREEN_CAPTURE_DISABLED() - SET_SCREEN_CAPTURE_ENABLED() - SET_CAMERA_DISABLED() - SET_CAMERA_ENABLED() - SET_USB_DISABLED() (12) - SET_USB_ENABLED() (12) - LOCK() - REBOOT() (7) ```shell # 一个在ADB shell中隐藏app的示例 am broadcast -a com.bintianqi.owndroid.action.HIDE -n com.bintianqi.owndroid/.ApiReceiver --es key abcdefg --es package com.example.app ``` ```kotlin // 一个在Kotlin中隐藏app的示例 val intent = Intent("com.bintianqi.owndroid.action.HIDE") .setComponent(ComponentName("com.bintianqi.owndroid", "com.bintianqi.owndroid.ApiReceiver")) .putExtra("key", "abcdefg") .putExtra("package", "com.example.app") context.sendBroadcast(intent) ``` [可用的用户限制](https://developer.android.google.cn/reference/android/os/UserManager#constants_1) ## 构建 你可以在命令行中使用 Gradle 以构建 OwnDroid ```shell # 使用testkey签名(默认) ./gradlew build # 使用你的jks密钥签名 ./gradlew build -PStoreFile="/path/to/your/jks/file" -PStorePassword="YOUR_KEYSTORE_PASSWORD" -PKeyPassword="YOUR_KEY_PASSWORD" -PKeyAlias="YOUR_KEY_ALIAS" ``` (在 Windows 系统中应使用`./gradlew.bat`) ## 贡献 欢迎提交贡献! 1. [Fork](https://github.com/BinTianqi/OwnDroid/fork) 此仓库(取消勾选 Copy the master branch only) 2. 克隆你的仓库到本地(请使用`dev`分支) 3. 做出修改(允许使用 AI ,但是你需要保证质量) 4. 在你的设备或模拟器上测试(如果是贡献翻译,可以跳过此步) 5. 使用 git 提交并推送修改 6. 打开 Pull request ## 许可证 [License.md](LICENSE.md) > Copyright (C) 2026 BinTianqi > > 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 .