如何获取NFCEE_ADMIN权限根深蒂固的手机吗?根深蒂固、权限、手机、NFCEE_ADMIN

2023-09-06 23:57:53 作者:我恨自己爱上你。

该NFCEE_ADMIN权限签名级别。 但是,是否有可能欺骗工作再上一个植根于手机这个权限?也许使用类似于时钟同步它的方式的技术?

我想使用反射技术来获得访问NFCExtras:

  mAdapter = NfcAdapter.getDefaultAdapter(本);

尝试 {
    类mynfcextras =的Class.forName(android.nfc.INfcAdapterExtras);
    方法getnfcExtras = mAdapter.getClass()实现getMethod(getNfcAdapterExtrasInterface)。
    对象nfcExtras = getnfcExtras.invoke(mAdapter);
}赶上(例外五){
    // TODO自动生成的catch块
    e.printStackTrace();
}
 

不过,当然得到以下错误:需要NFCEE_ADMIN权限:无论是用户还是XXX当前进程com.android.nfc.permission.NFCEE_ADMIN

编辑:当然,我也允许添加到程序包,但在安装过程中删除:

  W / PackageManager(XXX):未授予权限com.android.nfc.permission.NFCEE_ADMIN打包XXX(的ProtectionLevel = 2标志= 0x8be46)
 

解决方案

您的应用程序的签名需要在 /system/etc/nfcee_access.xml 。例如参见 HTTP://$c$c.google.com/p /谋求换安卓/维基/ BuildingTheSystem 一个例子,如何创建它。

大家对小米的误解为何根深蒂固 雷军 高端名字不会带动公司崛起

The NFCEE_ADMIN permission is signature level. 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 ?

I am trying to use reflexion techniques to get access to 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."

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. See e.g. http://code.google.com/p/seek-for-android/wiki/BuildingTheSystem for an example how to create it.