我正在尝试使用以下命令通过 adb 将我的应用设置为设备所有者:
dpm set-device-owner pl.my.packet/pl.my.packet.receivers.AdminReceiver
然后我看到了那个错误:
java.lang.SecurityException: Neither user 2000 nor current process has com.samsung.android.knox.permission.KNOX_PROXY_ADMIN_INTERNAL.,com.sec.enterprise.permission.MDM_PROXY_ADMIN_INTERNAL
at android.os.Parcel.readException(Parcel.java:1693)
at android.os.Parcel.readException(Parcel.java:1646)
at android.app.admin.IDevicePolicyManager$Stub$Proxy.setActiveAdmin(IDevicePolicyManager.java:5825)
at com.android.commands.dpm.Dpm.runSetDeviceOwner(Dpm.java:145)
at com.android.commands.dpm.Dpm.onRun(Dpm.java:96)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:51)
at com.android.commands.dpm.Dpm.main(Dpm.java:41)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:301)
电话:Samsung S7 Edge,未植根,未关联任何 Google 帐户。
我为我搜索了其他有用的线程但一无所获,我尝试了以下权限:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="com.sec.enterprise.permission.MDM_PROXY_ADMIN_INTERNAL"/>
<uses-permission android:name="com.samsung.android.knox.permission.KNOX_PROXY_ADMIN_INTERNAL"/>
<uses-permission android:name="com.samsung.accessory.permission.ACCESSORY_FRAMEWORK" />