简体   繁体   English

如何获得根电话的NFCEE_ADMIN权限?

[英]How to obtain NFCEE_ADMIN permission on rooted phone?

The NFCEE_ADMIN permission is signature level. NFCEE_ADMIN权限是签名级别。 However, is it possible to "cheat" to get this permission on a rooted phone ? 但是,是否有可能“欺骗”以在植根电话上获得此许可? Maybe using a technique similar to the way ClockSync does it ? 也许使用与ClockSync相似的技术?

I am trying to use reflexion techniques to get access to NFCExtras : 我正在尝试使用反射技术来访问NFCExtras:

mAdapter = NfcAdapter.getDefaultAdapter(this);

try {
    Class mynfcextras = Class.forName("android.nfc.INfcAdapterExtras");
    Method getnfcExtras = mAdapter.getClass().getMethod("getNfcAdapterExtrasInterface");
    Object nfcExtras = getnfcExtras.invoke(mAdapter);
} catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

But of course get the following error : "NFCEE_ADMIN permission required: Neither user xxx nor current process has com.android.nfc.permission.NFCEE_ADMIN." 但是,当然会出现以下错误:“需要NFCEE_ADMIN权限:用户xxx或当前进程都没有com.android.nfc.permission.NFCEE_ADMIN。”

Edit : Of course, I did add the permission to the package, but it is removed during installation : 编辑:当然,我确实向软件包添加了权限,但是在安装过程中将其删除:

W/PackageManager(  XXX): Not granting permission com.android.nfc.permission.NFCEE_ADMIN to package XXX (protectionLevel=2 flags=0x8be46)

The signature of your app needs to be in /system/etc/nfcee_access.xml . 应用程序的签名必须位于/system/etc/nfcee_access.xml See eg http://code.google.com/p/seek-for-android/wiki/BuildingTheSystem for an example how to create it. 有关如何创建示例的示例,请参见例如http://code.google.com/p/seek-for-android/wiki/BuildingTheSystem

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM