Android-IMSI-Catcher-Detector
Android-IMSI-Catcher-Detector copied to clipboard
Possible MNC parsing issue having length 3 in Device.java
Sir,
Please refer following code snippet from Device.java for MCC/MNC parsing code...
switch (phoneId) {
case TelephonyManager.PHONE_TYPE_NONE:
case TelephonyManager.PHONE_TYPE_SIP:
case TelephonyManager.PHONE_TYPE_GSM:
phoneType = "GSM";
mncMcc = tm.getNetworkOperator();
if (mncMcc != null && mncMcc.length() >= 5) {
try {
if (cell.getMobileCountryCode() == Integer.MAX_VALUE) {
cell.setMobileCountryCode(Integer.parseInt(tm.getNetworkOperator().substring(0, 3)));
}
if (cell.getMobileNetworkCode() == Integer.MAX_VALUE) {
cell.setMobileNetworkCode(Integer.parseInt(tm.getNetworkOperator().substring(3, 5)));
}
} catch (Exception e) {
log.info("MncMcc parse exception: ", e);
}
}
networkName = tm.getNetworkOperatorName();
if (!cell.isValid()) {
GsmCellLocation gsmCellLocation = (GsmCellLocation) tm.getCellLocation();
if (gsmCellLocation != null) {
cell.setCellId(gsmCellLocation.getCid());
cell.setLocationAreaCode(gsmCellLocation.getLac());
cell.setPrimaryScramblingCode(gsmCellLocation.getPsc());
}
}
break;
The line... cell.setMobileNetworkCode(Integer.parseInt(tm.getNetworkOperator().substring(3, 5)));
should be... cell.setMobileNetworkCode(Integer.parseInt(tm.getNetworkOperator().substring(3)));
Otherwise 3 digit MNC code will be parsed incorrectly.
Thanks
Agreements
- [x] I have reviewed and accepted the guidelines for contributing to this project.
- [x] I have searched the open Issues and made sure I am not filing a duplicate.
- [x] I have read the notes on debugging and will properly maintain this Issue.
Overview
AIMSICDversion (see theAboutscreen):- Phone and ROM running current release:
- Link to logfile without identifyable data:
Reproduction
References
Screenshots
There's no way to correctly parse MNC because one MCC can have both 2 digit and 3 digit MNCs, an example is 350-00, 350-01 and 350-007.
https://en.wikipedia.org/wiki/Mobile_Network_Codes_in_ITU_region_3xx_(North_America)#Bermuda_%E2%80%93_BM