问题
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
- 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.
- 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