Android Wi-Fi EAP-SIM代码解析
2017-07-23 22:24
537 查看
1. wpa_supplicant
During the process of EAP-SIM Authentication, wpa_supplicant will send APDU-Command:"SELECT" to ApduService.The "SELECT" Command means to select one file from the file system of SIM Card
The right APDU-Response is 0x61, or 0x6c, or 0x9f, which means the APDU-Command executed successfully;
The wrong APDU-Response is 0x6a82, which means "Selected file not found", according to the protocol: ETSI GSM 11.11
scard_get_imsi() |-->scard_select_file() |-->_scard_select_file() |-->scard_transmit() |-->SCardTransmit() |-->(1)socket_local_client()-->open socket and connect | |-->socket() | |-->socket_local_client_connect() | |-->connect() |-->(2)send() |-->(3)select() |-->(4)recv()
2. ApduService
The ApduService is responsible for setting up a Unix socket when Wifi starts and listening for incoming connections.
Data read from the socket will be parsed and transmitted as a APDU Command to Telephony.
The response will be sent back over the socket. The socket's name is sent to the wpa supplicant.
frameworks/opt/net/wifi/service/java/com/android/server/wifi/ApduService.java
runService() |-->(1)waitForConnection() | |-->ServerSocket.accept() |-->(2)communicationWithClient() |-->ConnectionSocket.getInputStream() |-->ConnectionSocket.getOutputStream() |-->phone.iccTransmitApduBasicChannel()
3. PhoneInterfaceManager
/packages/services/Telephony/src/com/android/phone/PhoneInterfaceManager.java(1) important events:
EVENT_TRANSMIT_APDU_LOGIC_CHANNEL_DONE
EVENT_TRANSMIT_APDU_BASIC_CHANNEL_DONE
(2) important commands:
CMD_TRANSMIT_APDU_LOGIC_CHANNEL
CMD_TRANSMIT_APDU_BASIC_CHANNEL
(3) important methods:
iccTransmitApduLogicalChannel()
iccTransmitApduBasicChannel()
(4) related System Property:
[gsm.sim.operator.numeric]
相关文章推荐
- Android Wi-Fi EAP-TLS/EAP-PEAP/EAP-TTLS(扩展认证协议)简介
- Android Wi-Fi 设置带宽代码流程
- Android Wi-Fi 获取RSSI的代码流程
- Android调用WI-FI的核心代码
- Android的基础学习:采用Pull方式解析XML文件(代码)
- [Android | 小代码] 天气预报 简易Demo json解析数组+对象 Gson+Volley简单使用
- 在Android 8.0(API第26级)和更高版本的设备上,您可以在试图通过蓝牙、BLE和wi - fi对其他设备进行配对时定制配对请求对话框
- Android中热修复框架Robust原理解析+并将框架代码从"闭源"变成"开源"(上篇)
- FFT变换Android代码及解析
- Android Volley完全解析之代码完成
- Android实践 -- Android Wi-Fi 直连
- Android Wi-Fi Direct 开发指南
- 告别Dagger2模板代码:DaggerAndroid原理解析
- Android中NFC功能流程图解析及代码演示『轉』
- Android Wi-Fi SeLinux打开后WiFi开关无响应(Android7.0/6.0)
- Android OTA 与recovery模块代码解析
- Android 通过 JNI 获取 Wi-Fi 网络接口名
- android客户端从服务器端获取json数据并解析的实现代码
- AndroidManifest 属性解析以及 代码动态获取属性值
- android代码混淆后gson无法解析问题