IMSI获取手机号段、归属地
IMSI国际移动用户识别码(IMSI:International Mobile Subscriber Identification Number)是区别移动用户的标志,储存在SIM卡中,可用于区别移动用户的有效信息。其总长度不超过15位,同样使用0~9的数字。其中MCC是移动用户所属国家代号,占3位数字,中国的MCC规定为460;MNC是移动网号码,由两位或者三位数字组成,中国移动的移动网络编码(MNC)为00;用于识别移动用户所归属的移动通信网;MSIN是移动用户识别码,用以识别某一移动通信网中的移动用户。简单的说IMSI就是手机号码的标识。
先看反向代码
public static String getMobileAll(String imsi){
String s130 = "^46001(\\d{3})(\\d)[0,1]\\d+";
String s131 = "^46001(\\d{3})(\\d)9\\d+";
String s132 = "^46001(\\d{3})(\\d)2\\d+";
String s134 = "^460020(\\d)(\\d{3})\\d+";
String s13x0 = "^46000(\\d{3})([5,6,7,8,9])\\d+";
String s13x = "^46000(\\d{3})([0,1,2,3,4])(\\d)\\d+";
String s150 = "^460023(\\d)(\\d{3})\\d+";
String s151 = "^460021(\\d)(\\d{3})\\d+";
String s152 = "^460022(\\d)(\\d{3})\\d+";
String s155 = "^46001(\\d{3})(\\d)4\\d+";
String s156 = "^46001(\\d{3})(\\d)3\\d+";
String s157 = "^460077(\\d)(\\d{3})\\d+";
String s158 = "^460028(\\d)(\\d{3})\\d+";
String s159 = "^460029(\\d)(\\d{3})\\d+";
String s147 = "^460079(\\d)(\\d{3})\\d+";
String s185 = "^46001(\\d{3})(\\d)5\\d+";
String s186 = "^46001(\\d{3})(\\d)6\\d+";
String s187 = "^460027(\\d)(\\d{3})\\d+";
String s188 = "^460078(\\d)(\\d{3})\\d+";
String s1705 = "^460070(\\d)(\\d{3})\\d+";
String s170x = "^46001(\\d{3})(\\d)8\\d+";
String s178 = "^460075(\\d)(\\d{3})\\d+";
String s145 = "^46001(\\d{3})(\\d)7\\d+";
String s182 = "^460026(\\d)(\\d{3})\\d+";
String s183 = "^460025(\\d)(\\d{3})\\d+";
String s184 = "^460024(\\d)(\\d{3})\\d+";
//电信的,下面的还没有找到规则
String s180 = "^46003(\\d)(\\d{3})7\\d+";
String s153 = "^46003(\\d)(\\d{3})8\\d+";
String s189 = "^46003(\\d)(\\d{3})9\\d+";
String[] result = compile(s130,imsi);
if(result != null && result.length==2){
return "130"+result[1]+result[0];
}
result = compile(s131,imsi);
if(result != null && result.length==2){
return "131"+result[1]+result[0];