简体   繁体   English

如何在Android应用程序级别上检查SIM锁定

[英]How can I check SIM lock on Android application level

I'm looking for a way to find out if an android device is SIM locked or not. 我正在寻找一种方法来查明Android设备是否被SIM锁定。 I know that in /efs/ should be a file where this setting is stored at. 我知道/ efs /应该是存储此设置的文件。 The problem is that without root there's no access to /efs/. 问题是没有root就无法访问/ efs /。

USSD codes like # #7465625# does no more work for Android 4.1.2 on Samsung devices. 7465625#这样的USSD代码在三星设备上的Android 4.1.2上没有用。

So does anybody know how I can figure out if there's a SIM lock enabled? 那么有谁知道如何确定是否启用了SIM锁定?

Thanks, tom 谢谢,汤姆

Assuming we're talking about the same kind of Sim Lock, you can check SIM Lock and a variety of other things using the Telephony Manager . 假设我们正在讨论相同类型的Sim Lock,您可以使用Telephony Manager检查SIM Lock和其他各种事物。

TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

int simState = telephonyManager.getSimState();

if (simState == TelephonyManager.SIM_STATE_NETWORK_LOCKED) {
    //do something
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM