Android:检查手机是否是双SIM在论坛上进行了大量的研究之后,我现在知道在双SIM手机中无法找到两个SIM卡的IMSI或SIM序列号(除了与制造商联系)。现在我改变了的问题是,我们能发现手机有两个模拟人生吗?我相信有情报就能发现。我能想到的几种方法是:拨打USSD代码并跟踪IMEI号码的日志(我在印度尝试使用*139#)。)这将为我拨USSD代码的SIM提供IMEI号码。(据推测,这款手机遵循Android的规定,有两个IMEI号码。)存储用于SIM的SIM序列号和/或IMSI。在检测到任何其他IMSI/序列号之后,即使电话没有重新启动(即SIM被切换),也可以通过跟踪某些日志或通过广播事件处理。通过拨打*06#,您将看到两个IMEI号码。顺便说一句,得到这两个数字。(类似于屏幕捕获和文本图像解析。)如果有人能想到其他的方法,他们是最受欢迎的。我真的很感激在这方面提供任何帮助。此外,如果任何人有任何关于制造商API或链接的任何信息与他们联系,请与社区的人分享。
3 回答
慕的地8271018
TA贡献1796条经验 获得超4个赞
public static void samsungTwoSims(Context context) { TelephonyManager telephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); try{ Class<?> telephonyClass = Class.forName(telephony.getClass().getName()); Class<?>[] parameter = new Class[1]; parameter[0] = int.class; Method getFirstMethod = telephonyClass.getMethod("getDefault", parameter); Log.d(TAG, getFirstMethod.toString()); Object[] obParameter = new Object[1]; obParameter[0] = 0; TelephonyManager first = (TelephonyManager) getFirstMethod.invoke(null, obParameter); Log.d(TAG, "Device Id: " + first.getDeviceId() + ", device status: " + first.getSimState() + ", operator: " + first.getNetworkOperator() + "/" + first.getNetworkOperatorName()); obParameter[0] = 1; TelephonyManager second = (TelephonyManager) getFirstMethod.invoke(null, obParameter); Log.d(TAG, "Device Id: " + second.getDeviceId() + ", device status: " + second.getSimState()+ ", operator: " + second.getNetworkOperator() + "/" + second.getNetworkOperatorName()); } catch (Exception e) { e.printStackTrace(); } }
private static String[] simStatusMethodNames = {"getSimStateGemini", "getSimState"};public static boolean hasTwoActiveSims(Context context) { boolean first = false, second = false; for (String methodName: simStatusMethodNames) { // try with sim 0 first try { first = getSIMStateBySlot(context, methodName, 0); // no exception thrown, means method exists second = getSIMStateBySlot(context, methodName, 1); return first && second; } catch (GeminiMethodNotFoundException e) { // method does not exist, nothing to do but test the next } } return false;}
- 3 回答
- 0 关注
- 475 浏览
添加回答
举报
0/150
提交
取消