aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2020-02-26 02:02:53 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2020-02-26 02:02:53 +0100
commit4ac43a2f1be7ed28f68a585ebc0c49c0f6294b6f (patch)
tree9ef8aa43916bee21642979fe4d1594bdff6283d9
parent872140db64fa4e48e5f9be78890e077ef2667ae4 (diff)
add SIM REFRESH command after IMSI change
-rwxr-xr-xsim-applet/src/org/osmocom/IMSIPseudo/IMSIPseudo.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/sim-applet/src/org/osmocom/IMSIPseudo/IMSIPseudo.java b/sim-applet/src/org/osmocom/IMSIPseudo/IMSIPseudo.java
index 1482d46..d876dca 100755
--- a/sim-applet/src/org/osmocom/IMSIPseudo/IMSIPseudo.java
+++ b/sim-applet/src/org/osmocom/IMSIPseudo/IMSIPseudo.java
@@ -210,6 +210,7 @@ public class IMSIPseudo extends Applet implements ToolkitInterface, ToolkitConst
mi = MobileIdentity.str2mi(newIMSI_str, MobileIdentity.MI_IMSI, (byte)9);
writeIMSI(mi);
showMsg(changed);
+ refreshIMSI();
} catch (Exception e) {
showError((short)42);
}
@@ -232,4 +233,31 @@ public class IMSIPseudo extends Applet implements ToolkitInterface, ToolkitConst
gsmFile.select((short) SIMView.FID_EF_IMSI);
gsmFile.updateBinary((short)0, mi, (short)0, (short)mi.length);
}
+
+ /*
+ * - command qualifiers for REFRESH,
+ * ETSI TS 101 267 / 3GPP TS 11.14 chapter 12.6 "Command details":
+ * '00' =SIM Initialization and Full File Change Notification;
+ * '01' = File Change Notification;
+ * '02' = SIM Initialization and File Change Notification;
+ * '03' = SIM Initialization;
+ * '04' = SIM Reset;
+ * '05' to 'FF' = reserved values.
+ */
+ public static final byte SIM_REFRESH_SIM_INIT_FULL_FILE_CHANGE = 0x00;
+ public static final byte SIM_REFRESH_FILE_CHANGE = 0x01;
+ public static final byte SIM_REFRESH_SIM_INIT_FILE_CHANGE = 0x02;
+ public static final byte SIM_REFRESH_SIM_INIT = 0x03;
+ public static final byte SIM_REFRESH_SIM_RESET = 0x04;
+
+ /* Run the Proactive SIM REFRESH command for the FID_EF_IMSI. */
+ private void refreshIMSI()
+ {
+ /* See ETSI TS 101 267 / 3GPP TS 11.14 section 6.4.7.1 "EF IMSI changing procedure":
+ * Valid qualifiers are SIM_REFRESH_SIM_INIT_FILE_CHANGE and SIM_REFRESH_SIM_INIT_FULL_FILE_CHANGE.
+ */
+ ProactiveHandler proHdlr = ProactiveHandler.getTheHandler();
+ proHdlr.init((byte)PRO_CMD_REFRESH, SIM_REFRESH_SIM_INIT_FULL_FILE_CHANGE, DEV_ID_ME);
+ proHdlr.send();
+ }
}