Access the SIM Card with an Android Application?

2019-01-08 14:15发布

I wonder if it's possible to access to the SIM card with an Android Application

6条回答
对你真心纯属浪费
2楼-- · 2019-01-08 14:49

You can get the IMEI like this (but is it what you want ?), just an exemple :

mTelephonyMgr = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
String imei = mTelephonyMgr.getDeviceId();

Likewise, you have

String getSimCountryIso():

Returns the ISO country code equivalent for the SIM provider's country code.

String getSimOperator(): Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM.

String getSimOperatorName(): Returns the Service Provider Name (SPN).

String getSimSerialNumber(): Returns the serial number of the SIM, if applicable.

int getSimState(): Returns a constant indicating the state of the device SIM card.

String getSubscriberId(): Returns the unique subscriber ID, for example, the IMSI for a GSM phone.

For more, take a look at this page

and don't forget to add the correct permission in the manifest (getDeviceId() => Requires Permission: READ_PHONE_STATE)

查看更多
爱情/是我丢掉的垃圾
3楼-- · 2019-01-08 14:50

SEEK is most useful one,but majority Android phones are not support that.So,maybe we can assess SIM card by some other method like read SMS(in SIM card).

查看更多
来,给爷笑一个
4楼-- · 2019-01-08 14:52

You should use IccFileHandler in interal api of android using java reflection . It is located at framework/base/telephony

查看更多
老娘就宠你
5楼-- · 2019-01-08 15:01

SIM card access is only possible for system applications:

Low level access to the SIM card is not available to third-party apps. The OS handles all communications with the SIM card including access to personal information (contacts) on the SIM card memory. Applications also cannot access AT commands, as these are managed exclusively by the Radio Interface Layer (RIL). The RIL provides no high level APIs for these commands.

source: https://source.android.com/security/overview/app-security.html#sim-card-access

查看更多
迷人小祖宗
6楼-- · 2019-01-08 15:07

Without SmartCardAPI from SEEK(Secure Element Evaluation Kit) its never possible. In majority Android phones available in market SmartCardAPI is not implemented. So either you build your own Android after integrating the SmartCardAPI code or wait for some decent phone with this feature to come out. You can find the patch file for implementation here.

查看更多
淡お忘
7楼-- · 2019-01-08 15:10

SmartCard API for Android might be of interest for you: http://code.google.com/p/seek-for-android/

查看更多
登录 后发表回答