How to obtain NFCEE_ADMIN permission on rooted phone?

一个人想着一个人 提交于 2019-12-19 11:33:14

问题


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)

回答1:


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.



来源:https://stackoverflow.com/questions/9545734/how-to-obtain-nfcee-admin-permission-on-rooted-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!