Secure element Access Control on ICS 4.0.4

前端 未结 4 924
情歌与酒
情歌与酒 2020-12-02 16:00

I updated my Android phone to 4.0.4 and i noticed that a new file nfcee access.xml appeared in the system folder. The idea of the file as far as i understood is the

4条回答
  •  佛祖请我去吃肉
    2020-12-02 16:47

    If you root your phone, you can modify the file. The file contains the list of signatures and package names that are allowed access to the Secure Element (SE). The signatures is a hex-encoded X.509 certificate. To create one, simply include the tag in the file and it will print to logcat the hex-encoded signature of applications that are denied SE access, for easy cut-and-paste into this file.

    To create an app that can access the SE, you need to add this permission to the manifest:

    
    

    To actually access the SE, you need to access a hidden API by importing com.android.nfc_extras:

    import com.android.nfc_extras.NfcAdapterExtras;
    import com.android.nfc_extras.NfcAdapterExtras.CardEmulationRoute;
    import com.android.nfc_extras.NfcExecutionEnvironment;
    

    The easiest way to make this possible is to compile your app in the Android source code tree by placing it in packages/apps and building it from there. You need to add the following line to the Android.mk makefile to get access to the SE API:

    LOCAL_JAVA_LIBRARIES := com.android.nfc_extras
    

    The functions in com.android.nfc_extras allow enabling and disabling the SE, sending commands to it and receiving responses from it (comparable to IsoDep.transceive()).

提交回复
热议问题