[英]Setting device owner rights to the app on Samsung phone
I am trying to set my app as device owner via adb with this command: 我正在尝试使用以下命令通过adb将我的应用设置为设备所有者:
dpm set-device-owner pl.my.packet/pl.my.packet.receivers.AdminReceiver
and then I see that error: 然后我看到那个错误:
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)
Phone: Samsung S7 Edge, not rooted, without any Google account linked. 电话:Samsung S7 Edge,未植根,未链接任何Google帐户。
I searched for other usefull threads for me but found nothing, I tried with these permissions: 我为我搜索了其他有用的线程,但一无所获,我尝试使用以下权限:
<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" />
I had a similar error and found that I had typo-ed the package and receiver name in dpm set-device-owner
command. 我有一个类似的错误,发现我在
dpm set-device-owner
命令中输入了软件包和接收者的名称。 I don't think you need the package name in your receiver's name. 我认为您不需要收件人姓名中的包裹名称。 Maybe
dpm set-device-owner pl.my.packet/.AdminReceiver
? 也许
dpm set-device-owner pl.my.packet/.AdminReceiver
吗?
not rooted
不扎根
You cannot do that as you are clearly told: 明确告诉您,您不能这样做:
Neither user 2000 nor current process has com.samsung.android.knox.permission.KNOX_PROXY_ADMIN_INTERNAL.,com.sec.enterprise.permission.MDM_PROXY_ADMIN_INTERNAL
用户2000和当前进程都没有com.samsung.android.knox.permission.KNOX_PROXY_ADMIN_INTERNAL。,com.sec.enterprise.permission.MDM_PROXY_ADMIN_INTERNAL
And you cannot just add random permissions and expect it to work. 而且,您不能只添加随机权限并期望它能正常工作。 I assume both are at least
signature
type or system
. 我认为两者至少都是
signature
类型或system
。 And you cannot have either on non rooted or not having system certificate. 而且,您不能拥有非根用户或没有系统证书。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.