1

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)
Community
  • 1
  • 1
Choumarin
  • 400
  • 1
  • 6
  • 16

1 Answers1

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.

NFC guy
  • 10,151
  • 3
  • 27
  • 58
  • Is the only solution to build my own image ? I was trying to avoid this :/ I don't quite understand this sentence : "This file claims to include signatures of applications that can retrieve the NFCEE_ADMIN permission. However, it seems to be the signer certificate chain instead of the application signature." – Choumarin Mar 03 '12 at 23:16
  • OK. Managed to get the application signature into the nfcee_access.xml file. But it still doesn't work :/ – Choumarin Mar 04 '12 at 12:40
  • Ok. The nfcee_access.xml is only used for users build, not production ones. I used CM9, works like a charm. – Choumarin Mar 04 '12 at 16:23