如何从应用程序重新初始化 SIM 卡?

How to reinitialize SIM card from application?

我在为 android phone 编写申请时遇到问题。我需要我的应用程序将 SIM 卡中的所有数据重新初始化到 phone - 所以这就像重新启动而不重新启动 phone 本身。

我知道进入飞行模式并返回没有帮助 - 它必须像真正的重启一样。我怎样才能从应用程序中获得它?

不确定这是最好的方法,但您始终可以使用 SIM 工具包和主动命令。根据 GSM specification

REFRESH, which requests the ME to carry out a SIM initialization according to GSM 11.11 subclause 11.2.1, and/or advises the ME that the contents or structure of EFs on the SIM have been changed. The command also makes it possible to restart a card session by resetting the SIM.

REFRESH 命令的说明,SIM 重置模式:

SIM Reset. This mode causes the ME to run the GSM session termination procedure and to deactivate the SIM in accordance with GSM 11.11 [20]. Subsequently, the ME activates the SIM again and starts a new card session. In case of a 3 Volt technology ME, the ME shall restart the SIM with the same supply voltage as in the previous session, if the ME can ensure that the SIM has not been changed in between. Otherwise, the ME shall perform the supply voltage switching in accordance with GSM 11.12 [21]. The SIM Reset mode is used when a SIM application requires ATR or complete SIM initialization procedures to be performed.

但是,这意味着您必须在 SIM 卡上加载自定义 SIM 工具包小程序,并且必须使用该小程序来触发主动命令。我不知道这是否适合您,因为您没有提供足够的详细信息。