@
XXWHCA #3
大佬,经过我一阵捣鼓,功能是实现了,但是有个问题,我 app 无法卸载了。。。
起因是我用 chatGPT 帮我写了个类
https://github.com/magic3584/API/blob/master/DeviceOwnerUtil.kt (里面 clear 是我写的但是没生效。。。)
然后如下调用
``` kotlin
class MainActivity: FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) {
super.onCreate(savedInstanceState, persistentState)
DeviceOwnerUtil.setDeviceOwner(this);
// DeviceOwnerUtil.clearDeviceOwner(this)
}
}
```
然后发现先是无法停止
adb shell dpm remove-active-admin
com.xxx/.AdminReceiverException occurred while executing 'remove-active-admin':
java.lang.SecurityException: Attempt to remove non-test admin ComponentInfo{
com.xxx/com.xxx.AdminReceiver} 0
后来发现又无法卸载
➜ Desktop adb shell pm uninstall
com.xxxFailure [DELETE_FAILED_INTERNAL_ERROR]
pad 上 app 的“卸载”和“强行停止”都是灰的。。。
真是喜闻乐见。。。