readIMSI, writeIMSI
This commit is contained in:
parent
0866f3a036
commit
c24fdd1ad7
|
@ -285,23 +285,16 @@ public class IMSIPseudo extends Applet implements ToolkitInterface, ToolkitConst
|
||||||
|
|
||||||
private void showIMSI() {
|
private void showIMSI() {
|
||||||
/* 3GPP TS 31.102 4.2.2: IMSI */
|
/* 3GPP TS 31.102 4.2.2: IMSI */
|
||||||
byte[] IMSI = new byte[9];
|
|
||||||
byte[] msg = {'C', 'u', 'r', 'r', 'e', 'n', 't', ' ', 'I', 'M', 'S', 'I', ':', ' ',
|
byte[] msg = {'C', 'u', 'r', 'r', 'e', 'n', 't', ' ', 'I', 'M', 'S', 'I', ':', ' ',
|
||||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '};
|
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '};
|
||||||
|
|
||||||
gsmFile.select((short) SIMView.FID_DF_GSM);
|
|
||||||
gsmFile.select((short) SIMView.FID_EF_IMSI);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
gsmFile.readBinary((short)0, IMSI, (short)0, (short)9);
|
byte IMSI[] = readIMSI();
|
||||||
|
mi2str(msg, (byte)14, (byte)16, IMSI, false);
|
||||||
|
showMsgAndWaitKey(msg);
|
||||||
} catch (SIMViewException e) {
|
} catch (SIMViewException e) {
|
||||||
showError(e.getReason());
|
showError(e.getReason());
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mi2str(msg, (byte)14, (byte)16, IMSI, false);
|
|
||||||
|
|
||||||
showMsgAndWaitKey(msg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleMenuResponseMain() {
|
private void handleMenuResponseMain() {
|
||||||
|
@ -343,4 +336,20 @@ public class IMSIPseudo extends Applet implements ToolkitInterface, ToolkitConst
|
||||||
byte mi[] = str2mi(imsi, MI_IMSI);
|
byte mi[] = str2mi(imsi, MI_IMSI);
|
||||||
showMsgAndWaitKey(hexdump(mi));
|
showMsgAndWaitKey(hexdump(mi));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private byte[] readIMSI()
|
||||||
|
{
|
||||||
|
gsmFile.select((short) SIMView.FID_DF_GSM);
|
||||||
|
gsmFile.select((short) SIMView.FID_EF_IMSI);
|
||||||
|
byte[] IMSI = new byte[9];
|
||||||
|
gsmFile.readBinary((short)0, IMSI, (short)0, (short)9);
|
||||||
|
return IMSI;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void writeIMSI(byte mi[])
|
||||||
|
{
|
||||||
|
gsmFile.select((short) SIMView.FID_DF_GSM);
|
||||||
|
gsmFile.select((short) SIMView.FID_EF_IMSI);
|
||||||
|
gsmFile.updateBinary((short)0, mi, (short)0, (short)mi.length);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue