mirror of
https://github.com/awfixers-stuff/OwnDroid.git
synced 2026-03-23 11:05:59 +00:00
127 lines
3.8 KiB
Markdown
127 lines
3.8 KiB
Markdown
[English](Readme-en.md)
|
||
|
||
# OwnDroid
|
||
|
||
使用安卓Device owner特权管理你的设备。
|
||
|
||
## 功能
|
||
|
||
- 系统
|
||
- 选项:禁用摄像头、禁止截屏、全局静音、禁用USB信号...
|
||
- 权限策略
|
||
- 清除数据
|
||
- ...
|
||
- 网络
|
||
- 添加/修改/删除 Wi-Fi
|
||
- 最小Wi-Fi安全等级
|
||
- VPN保持打开
|
||
- 网络日志
|
||
- ...
|
||
- 工作资料
|
||
- 创建工作资料
|
||
- 挂起个人应用
|
||
- ...
|
||
- 应用管理
|
||
- 挂起/隐藏应用
|
||
- 阻止应用卸载
|
||
- 安装/卸载应用
|
||
- ...
|
||
- 用户限制
|
||
- 网络:禁止配置移动网络、禁止配置Wi-Fi、禁用短信、禁止拨出电话...
|
||
- 连接:禁用蓝牙、禁止配置定位、禁用USB文件传输、禁用打印...
|
||
- 应用:禁止安装/卸载应用...
|
||
- 用户:禁止添加/删除/切换用户...
|
||
- 媒体:禁止调整亮度、禁止调整音量...
|
||
- 其他:禁止修改账号、禁止修改语言、禁止恢复出厂设置、禁用调试功能...
|
||
- 用户管理
|
||
- 用户信息
|
||
- 启动/切换/停止/删除用户
|
||
- 创建用户
|
||
- ...
|
||
- 密码与锁屏
|
||
- 重置密码
|
||
- 要求密码复杂度
|
||
- 设置屏幕超时
|
||
- ...
|
||
|
||
## 激活
|
||
|
||
- Shizuku (推荐)
|
||
- 在ADB命令行中执行命令: `dpm set-device-owner com.bintianqi.owndroid/.Receiver`
|
||
|
||
## FAQ
|
||
|
||
### 激活
|
||
|
||
#### 设备上有账号
|
||
|
||
```text
|
||
java.lang.IllegalStateException: Not allowed to set the device owner because there are already some accounts on the device
|
||
```
|
||
|
||
解决办法:
|
||
- 冻结持有这些账号的app。
|
||
- 删除这些账号。
|
||
- 使用LSPosed模块 [HookDPM](https://github.com/BinTianqi/HookDPM)。
|
||
|
||
#### 设备上有多个用户
|
||
|
||
```text
|
||
java.lang.IllegalStateException: Not allowed to set the device owner because there are already several users on the device
|
||
```
|
||
|
||
解决办法:
|
||
- 删除次级用户。
|
||
- 使用LSPosed模块[HookDPM](https://github.com/BinTianqi/HookDPM)。
|
||
|
||
> [!NOTE]
|
||
> 一些系统有应用克隆、儿童空间等功能,它们通常是用户。
|
||
|
||
#### MIUI
|
||
|
||
```text
|
||
java.lang.SecurityException: Neither user 2000 nor current process has android.permission.MANAGE_DEVICE_ADMINS.
|
||
```
|
||
|
||
解决办法:
|
||
- 在开发者设置中打开`USB debugging (Security setting)`。
|
||
- 在root命令行中执行激活命令
|
||
|
||
#### ColorOS
|
||
|
||
```text
|
||
java.lang.IllegalStateException: Unexpected @ProvisioningPreCondition
|
||
```
|
||
|
||
解决办法:使用 OwnDroid testkey 版本
|
||
|
||
## API
|
||
|
||
| ID | 描述 | Extras | 最小安卓版本 |
|
||
|:---------:|----------|--------------------|:------:|
|
||
| HIDE | 隐藏一个应用 | `package`: 目标应用的包名 | |
|
||
| UNHIDE | 取消隐藏一个应用 | `package`: 目标应用的包名 | |
|
||
| SUSPEND | 挂起一个应用 | `package`: 目标应用的包名 | 7 |
|
||
| UNSUSPEND | 取消挂起一个应用 | `package`: 目标应用的包名 | 7 |
|
||
| LOCK | 锁屏 | | |
|
||
|
||
在adb shell中使用API
|
||
```shell
|
||
am broadcast -a com.bintianqi.owndroid.action.<ID> -n com.bintianqi.owndroid/.ApiReceiver --es key <API_KEY>
|
||
# 示例
|
||
am broadcast -a com.bintianqi.owndroid.action.HIDE -n com.bintianqi.owndroid/.ApiReceiver --es key abcdefg --es package com.example.app
|
||
```
|
||
如果返回值为0,操作成功
|
||
|
||
## 许可证
|
||
|
||
[License.md](LICENSE.md)
|
||
|
||
> Copyright (C) 2024 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 <https://www.gnu.org/licenses/>.
|