Adding the Open Mobile API library to an Android device to get APDU-based access to the SIM

…衆ロ難τιáo~ 提交于 2019-12-12 05:07:28

问题


I have a device without NFC. This device also does not support the Open Mobile API. I need access to the SIM applet on that device.

Now I wonder if I could add that functionality...If I have a copy of the Open Mobile API library, would it work if pushed that Open Mobile API library to my device through ADB? Could I then exchange APDUs with my SIM applet?


回答1:


No, that won't work. The Open Mobile API library is only an interface to the Open Mobile API service ("SmartcardService"). Thus, the library only helps your app to communicate with the service through a standardized interface (= the Open Mobile API). If you try to use the library on a device without the SmartcardService, the library won't be able to bind to that service and, consequently, the API calls will fail.

What you can do

  1. Starting with Android 5 (API level 21), the TelephonyManager provides an API to exchange APDU commands with applications on the SIM/UICC. See iccOpenLogicalChannel, iccTransmitApduBasicChannel, iccTransmitApduLogicalChannel, etc. Just as with the Open Mobile API, your app would, of course, need to have the permission to access that API.
  2. If there is an implementation of the SmartcardService for your device that also implements access to the SIM/UICC through the RIL, you could install that service together with the Open Mobile API library to get access to the SIM/UICC. See my report Open Mobile API: Accessing the UICC on Android Devices.


来源:https://stackoverflow.com/questions/37942706/adding-the-open-mobile-api-library-to-an-android-device-to-get-apdu-based-access

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