如何在Android中与SIM卡进行APDU通信?

时间:2016-07-04 10:48:21

标签: android android-studio android-5.0-lollipop apdu sim-card

我想将一些APDU命令发送到插入Android智能手机的SIM卡。根据我的研究,选项使用SEEK4Android库或Telephony库。 (还有其他选择吗?

问题是我如何识别智能手机支持哪些库?

关于this Q&A我想我需要手机支持的 Open Mobile API Telephony 。但我如何检查这些是否得到支持?

在那里写道, Open Mobile API 只是 SmartcardService 的接口,对吗?我如何检查我的智能手机是否有此服务?

我使用adb列出了服务:

C:\ ADB> adb shell服务列表

找到128项服务:

0       sip: [android.net.sip.ISipService]
1       phone: [com.android.internal.telephony.ITelephony]
2       isms: [com.android.internal.telephony.ISms]
3       iphonesubinfo: [com.android.internal.telephony.IPhoneSubInfo]
4       simphonebook: [com.android.internal.telephony.IIccPhoneBook]
5       isub: [com.android.internal.telephony.ISub]
6       telecom: [com.android.internal.telecom.ITelecomService]
7       emergency_service: [com.sec.android.emergencymode.IEmergencyManager]
8       edmnativehelper: [mdm.edmnativehelperservice]
9       imms: [com.android.internal.telephony.IMms]
10      lpnet: [android.os.ILpnetManager]
11      media_projection: [android.media.projection.IMediaProjectionManager]
12      FMPlayer: [com.samsung.media.fmradio.internal.IFMPlayer]
13      voip: [android.os.IVoIPInterface]
14      launcherapps: [android.content.pm.ILauncherApps]
15      fingerprint: [android.service.fingerprint.IFingerprintService]
16      trust: [android.app.trust.ITrustManager]
17      media_router: [android.media.IMediaRouterService]
18      media_session: [android.media.session.ISessionManager]
19      restrictions: [android.content.IRestrictionsManager]
20      print: [android.print.IPrintManager]
21      dreams: [android.service.dreams.IDreamManager]
22      commontime_management: []
23      samplingprofiler: []
24      diskstats: []
25      voiceinteraction: [com.android.internal.app.IVoiceInteractionManagerService]
26      appwidget: [com.android.internal.appwidget.IAppWidgetService]
27      backup: [android.app.backup.IBackupManager]
28      jobscheduler: [android.app.job.IJobScheduler]
29      uimode: [android.app.IUiModeManager]
30      serial: [android.hardware.ISerialManager]
31      usb: [android.hardware.usb.IUsbManager]
32      DockObserver: []
33      audio: [android.media.IAudioService]
34      wallpaper: [android.app.IWallpaperManager]
35      dropbox: [com.android.internal.os.IDropBoxManagerService]
36      search: [android.app.ISearchManager]
37      country_detector: [android.location.ICountryDetector]
38      location: [android.location.ILocationManager]
39      devicestoragemonitor: []
40      notification: [android.app.INotificationManager]
41      ABTPersistenceService: [com.absolute.android.persistence.IABTPersistence]
42      updatelock: [android.os.IUpdateLock]
43      servicediscovery: [android.net.nsd.INsdManager]
44      connectivity: [android.net.IConnectivityManager]
45      rttmanager: [android.net.wifi.IRttManager]
46      wifiscanner: [android.net.wifi.IWifiScanner]
47      wifi: [android.net.wifi.IWifiManager]
48      wifip2p: [android.net.wifi.p2p.IWifiP2pManager]
49      netpolicy: [android.net.INetworkPolicyManager]
50      netstats: [android.net.INetworkStatsService]
51      network_score: [android.net.INetworkScoreService]
52      textservices: [com.android.internal.textservice.ITextServicesManager]
53      network_management: [android.os.INetworkManagementService]
54      clipboard: [android.content.IClipboard]
55      statusbar: [com.android.internal.statusbar.IStatusBarService]
56      enterprise_policy: [android.app.enterprise.IEnterpriseDeviceManager]
57      knox_timakeystore_policy: [com.sec.enterprise.knox.keystore.ITimaKeystore]
58      enterprise_billing_policy: [com.sec.enterprise.knox.billing.IEnterpriseBillingPolicy]
59      mum_container_policy: [com.sec.enterprise.knox.container.IKnoxContainerManager]
60      remoteinjection: [android.app.enterprise.remotecontrol.IRemoteInjection]
61      phone_restriction_policy: [android.app.enterprise.IPhoneRestrictionPolicy]
62      wifi_policy: [android.app.enterprise.IWifiPolicy]
63      application_policy: [android.app.enterprise.IApplicationPolicy]
64      enterprise_license_policy: [android.app.enterprise.license.IEnterpriseLicense]
65      log_manager_service: [android.app.enterprise.ILogManager]
66      harmony_eas_service: [android.content.IHarmonyEAS]
67      device_policy: [android.app.admin.IDevicePolicyManager]
68      lock_settings: [com.android.internal.widget.ILockSettings]
69      mount: [IMountService]
70      cover: [com.samsung.android.cover.ICoverManager]
71      accessibility: [android.view.accessibility.IAccessibilityManager]
72      input_method: [com.android.internal.view.IInputMethodManager]
73      mDNIe: [com.samsung.android.mdnie.IMdnieManager]
74      rcp: [android.os.IRCPManager]
75      bluetooth_secure_mode_manager: [android.bluetooth.IBluetoothSecureManagerService]
76      bluetooth_manager: [android.bluetooth.IBluetoothManager]
77      CCM: []
78      input: [android.hardware.input.IInputManager]
79      window: [android.view.IWindowManager]
80      alarm: [android.app.IAlarmManager]
81      consumer_ir: [android.hardware.IConsumerIrService]
82      CustomFrequencyManagerService: [android.os.ICustomFrequencyManager]
83      vibrator: [android.os.IVibratorService]
84      cepproxyks: [com.samsung.android.cepproxyks.ISCEPKeystoreService]
85      TUI: []
86      tima: [android.service.tima.ITimaService]
87      sedenial: [android.service.ISEDenialService]
88      SatsService: [com.samsung.android.service.sats.ISatsService]
89      ReactiveService: [com.samsung.android.service.reactive.IReactiveService]
90      DirEncryptService: [IDirEncryptService]
91      content: [android.content.IContentService]
92      account: [android.accounts.IAccountManager]
93      SEAMService: [com.sec.enterprise.knox.seams.ISEAMS]
94      persona: [android.os.IPersonaManager]
95      entropy: []
96      telephony.registry: [com.android.internal.telephony.ITelephonyRegistry]
97      scheduling_policy: [android.os.ISchedulingPolicyService]
98      webviewupdate: [android.webkit.IWebViewUpdateService]
99      usagestats: [android.app.usage.IUsageStatsManager]
100     battery: []
101     hardware: [android.os.IHardwareService]
102     permission: [android.os.IPermissionController]
103     cpuinfo: []
104     dbinfo: []
105     gfxinfo: []
106     meminfo: []
107     procstats: [com.android.internal.app.IProcessStats]
108     activity: [android.app.IActivityManager]
109     user: [android.os.IUserManager]
110     package: [android.content.pm.IPackageManager]
111     persona_policy: [android.content.pm.IPersonaPolicyManager]
112     display: [android.hardware.display.IDisplayManager]
113     power: [android.os.IPowerManager]
114     appops: [com.android.internal.app.IAppOpsService]
115     batterystats: [com.android.internal.app.IBatteryStats]
116     sensorservice: [android.gui.SensorServer]
117     mdm.remotedesktop: [mdm.samsung.IRemoteDesktopService]
118     media.sound_trigger_hw: [android.hardware.ISoundTriggerHwService]
119     media.audio_policy: [android.media.IAudioPolicyService]
120     media.camera: [android.hardware.ICameraService]
121     media.player: [android.media.IMediaPlayerService]
122     media.audio_flinger: [android.media.IAudioFlinger]
123     SurfaceFlinger: [android.ui.ISurfaceComposer]
124     display.qservice: [android.display.IQService]
125     batteryproperties: [android.os.IBatteryPropertiesRegistrar]
126     drm.drmManager: [drm.IDrmManagerService]
127     android.security.keystore: [android.security.keystore]

如上所示,智能手机中没有 SmartCardService 服务。为什么呢?

我用Google搜索 Open Moblie API ,结果几乎适用于SIM联盟公司。为什么?我不应该收到一些谷歌(因为Android是谷歌)文件而不是SIM联盟文件吗?

我的智能手机是一款带有Android 5.0.2版本的Sumsung Galaxy A3。

1 个答案:

答案 0 :(得分:0)

导航到您的adb驱动程序所在的位置(我在C:/Users/my_username/AppData/Local/Android/sdk/platform-tools中)并尝试使用以下命令:

adb root
adb shell

cd /system/framework
ls

如果有org.simalliance.openmobileapi.jar,您的设备应该支持SEEKForAndroid需要工作的SmartCardServices。