SIM card management method and device, electronic equipment, storage medium and program product
By modifying the target data of the SIM card, it does not comply with the rules when registering the network, and the network side equipment refuses to register, solving the problem that blacklists are easily cracked in the existing technology, and achieving a more secure SIM card lock effect.
Patent Information
- Application Number
- CN202510606279.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-12
- Publication Date
- 2025-07-25
AI Technical Summary
The existing SIM card locking method is easily cracked through the blacklist mechanism, resulting in user information leakage and low security.
When the public land mobile network number of the SIM card is on the blacklist, the target data of the SIM card is modified so that the modified mobile network code does not conform to the preset format or the target field in the modification management data request file indicates that the SIM card is unavailable, and is rejected by the network device during network registration.
Reject SIM card registration through network-side devices, the secret SIM card lock effect is achieved, which improves security and reliability, is not easy to be cracked, and protects user information from being leaked.
Smart Images

Figure CN120378864A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of communication technologies, and particularly relates to a SIM card management method, apparatus, electronic device, storage medium, and program product. Background Art
[0002] To ensure communication security and information security, some current electronic devices usually adopt the method of locking the Subscriber Identity Module (SIM) card (LOCK), so that the user can only use the SIM card of a specified operator and cannot use the SIM cards of other operators.
[0003] In the prior art, the method of locking the SIM card usually configures a blacklist of Public Land Mobile Network (PLMN) numbers in the Replay Protected Memory Block (RPMB) of the electronic device. After the electronic device is started, it detects whether the PLMN of the SIM card in the electronic device is in the blacklist. If it is not in the blacklist, the SIM card in the electronic device can be used normally. If it is in the blacklist, the SIM card in the electronic device cannot be used normally.
[0004] However, due to the relatively simple blacklist mechanism, criminals can crack this mechanism through means such as software vulnerabilities, chip vulnerabilities, and motherboard replacement, and modify the PLMN in the blacklist, so that SIM cards of other operators can also be used, resulting in the leakage of user information and low security. Summary of the Invention
[0005] The objective of the embodiments of this application is to provide a SIM card management method, apparatus, electronic device, storage medium, and program product, which can improve the security of user information.
[0006] In a first aspect, the embodiments of this application provide a SIM card management method, which includes: when the Public Land Mobile Network number of the SIM card in the electronic device is in the blacklist, modifying the target data of the SIM card; and based on the modified target data of the SIM card, performing a network registration process. Wherein, the target data includes the mobile network code of the SIM card, and the modified mobile network code does not conform to the preset mobile network code format; or, the target data includes the data carried in the target field of the management data request file of the SIM card, and the data carried in the modified target field indicates that the SIM card is unavailable.
[0007] Second aspect, an embodiment of the present application provides a SIM card management device, which includes a modification module and an execution module. The modification module is used to modify the target data of the SIM card when the public land mobile network number of the SIM card in the electronic device is in the blacklist. The execution module is used to execute the network registration process based on the modified target data of the SIM card. Wherein, the target data includes the mobile network code of the SIM card, and the modified mobile network code does not conform to the preset mobile network code format; or, the target data includes the data carried in the target field of the management data request file of the SIM card, and the data carried in the modified target field indicates that the SIM card is unavailable.
[0008] Third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory. The memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the SIM card management method described in the first aspect are implemented.
[0009] Fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the SIM card management method described in the first aspect are implemented.
[0010] Fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the SIM card management method described in the first aspect.
[0011] Sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the SIM card management method described in the first aspect.
[0012] In an embodiment of the present application, when the public land mobile network number of the SIM card in the electronic device is in the blacklist, the target data of the SIM card is modified; based on the modified target data of the SIM card, a network registration process is executed; wherein, the target data includes the mobile network code of the SIM card, and the modified mobile network code does not conform to the preset mobile network code format; or, the target data includes the data carried in the target field of the management data request file of the SIM card, and the data carried in the modified target field indicates that the SIM card is unavailable. In this way, since the modified mobile network code does not conform to the preset mobile network code format, or the data carried in the modified target field indicates that the SIM card is unavailable, therefore, the data reported by the electronic device to the network device when registering the network is non-compliant or incorrect. Then, the network device will reject the SIM card of the electronic device from registering the network, making the SIM card unable to register the network, thus achieving the effect of locking the SIM card. Thus, compared with the existing SIM card locking solution implemented through the blacklist, this solution realizes the SIM card locking effect by the network device rejecting the SIM card of the electronic device from camping on the network. This locking logic is more concealed than a simple blacklist and is not easily cracked, which can protect the user information from being leaked and is more secure and reliable. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 is one of the schematic flowcharts of the SIM card management method provided by the embodiment of the present application;
[0014] Figure 2 is a schematic diagram of the prompt information displayed by the electronic device provided by the embodiment of the present application;
[0015] Figure 3 is a schematic diagram of the electronic device in the flight mode provided by the embodiment of the present application;
[0016] Figure 4 is another schematic flowchart of the SIM card management method provided by the embodiment of the present application;
[0017] Figure 5 is still another schematic flowchart of the SIM card management method provided by the embodiment of the present application;
[0018] Figure 6 is yet another schematic flowchart of the SIM card management method provided by the embodiment of the present application;
[0019] Figure 7 is yet another schematic flowchart of the SIM card management method provided by the embodiment of the present application;
[0020] Figure 8 is a schematic structural diagram of the SIM card management device provided by the embodiment of the present application;
[0021] Figure 9 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
[0022] Figure 10 It is a schematic hardware structure diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0023] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.
[0024] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually of the same category, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally indicates an "or" relationship between the associated objects before and after.
[0025] The terms "at least one (item)", "at least one of", etc. in the specification and claims of the present application refer to any one, any two or more combinations of the objects it contains. For example, at least one (item) of a, b, and c can represent: "a", "b", "c", "a and b", "a and c", "b and c", and "a, b, and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" means two or more, and its expressed meaning is similar to that of "at least one (item)".
[0026] Next, in conjunction with the accompanying drawings, the SIM card management method, device, electronic device, storage medium, and program product provided by the embodiments of the present application will be described in detail through specific embodiments and their application scenarios.
[0027] The SIM card management method provided by the embodiments of the present application can be applied to the scenario where a user uses an electronic device with a SIM card locking function. Among them, one scenario is that the user uses an operator-customized electronic device, which has a SIM card locking function and can only use the SIM card of that operator to ensure the operator's package revenue. Another scenario is that an enterprise requires employees to use a customized electronic device, which has a SIM card locking function and can only use the SIM card of the operator designated by the enterprise to ensure communication security and information security.
[0028] In the related art, the blacklist of the PLMN is usually configured in the trusted partition of the electronic device to achieve the effect of locking the SIM card. For example, if the electronic device is a locked mobile phone of operator A and the user can only use the SIM card of operator A, then the PLMN of operator A is the whitelist, and the PLMNs of other operators are all blacklists, so that the locked mobile phone of operator A can only register the SIM card of operator A and cannot register the SIM cards of other operators.
[0029] However, this solution can still be cracked and modified, and there is still room for improvement in security and reliability.
[0030] Therefore, the embodiment of the present application provides a SIM card management method, which modifies the mobile network code of the SIM card of the operator in the blacklist, or modifies the data carried in the target field in the management data request file of the SIM card. In this way, since the modified mobile network code does not conform to the preset mobile network code format, or the data carried in the modified target field indicates that the SIM card is unavailable, when the electronic device registers the network, the data reported to the network-side device is irregular or incorrect. Then, the network-side device will reject the SIM card of the electronic device from registering the network, so that the SIM card cannot register the network, thereby achieving the effect of locking the SIM card. Thus, compared with the existing locking card solution implemented through the blacklist, this solution realizes the SIM locking effect by the network-side device rejecting the SIM card of the electronic device from camping on the network. This locking card logic is more concealed and difficult to crack compared to a simple blacklist, can protect user information from being leaked, and is more secure and reliable.
[0031] The execution subject of the SIM card management method provided by the embodiment of the present application can be a SIM card management device. Exemplarily, the SIM card management device can be an electronic device, or a functional component or functional entity in the electronic device. Hereinafter, taking the execution subject as an electronic device as an example, the SIM card management method provided by the embodiment of the present application will be described exemplarily.
[0032] Figure 1 is a schematic flowchart of the SIM card management method provided by the embodiment of the present application. As Figure 1 shown, the SIM card management method provided by the embodiment of the present application may include the following steps 101 and 102.
[0033] Step 101: When the public land mobile network number of the SIM card in the electronic device is in the blacklist, the electronic device modifies the target data of the SIM card.
[0034] In some embodiments of the present application, the above SIM card may be a SIM card installed in an electronic device. It should be noted that the SIM card in the embodiments of the present application may also be a Universal Subscriber Identity Module (USIM) card.
[0035] In some embodiments of the present application, the Public Land Mobile Network number (PLMN) of the above SIM card may include the mobile network code of the SIM card and the mobile country code of the SIM card.
[0036] In some embodiments of the present application, the above mobile network code is MNC (Mobile Network Code), which can be used to uniquely identify a mobile network operator.
[0037] It should be noted that in different countries or regions, the mobile network code formats of the mobile network code are different. For example, in Country A, the mobile network code format is 2 digits, that is, the mobile network code of Country A is a code composed of 2 digits; in Country B, the mobile network code format is 3 digits, that is, the mobile network code of Country B is a code composed of 3 digits. And in the same country or region, the mobile network code formats of different operators are the same but the mobile network codes are different. For example, in Country A, the mobile network code of operator a1 is 01, the mobile network code of operator a2 is 00, and the mobile network code of operator a3 is 02. In Country B, the mobile network code of operator b1 is 011, the mobile network code of operator b2 is 026, and the mobile network code of operator b3 is 052.
[0038] In some embodiments of the present application, the above mobile country code may be (Mobile Country Code, MCC), which can be used to uniquely identify a country.
[0039] In some embodiments of the present application, the above mobile country code may be a code composed of 3 digits. For example, the mobile country code of Country A is 4a0, the mobile country code of Country B is 3b0, and the mobile country code of Country C is 5c0.
[0040] It should be noted that the PLMN of each operator in each country or region is pre - specified. Exemplarily, assume that the MCC of country A is 4m0, and the MNC format of country A is 2 digits. Assume that the MNC of operator a1 in country A is 00, the usage status is in operation, and the used frequency bands include Global System for Mobile Communications (GSM) 9a0 / Time Division - Synchronous Code Division Multiple Access (TD - SCDMA) 201a / TD - SCDMA Long Term Evolution (TD - LTE) 1a00, etc.; the MNC of operator a2 in country A is 01, the usage status is in operation, and the used frequency bands include GSM 9a0 / TD - SCDMA 201a / TD - LTE 1a00, etc.; the MNC of operator a3 in country A is 03, the usage status is in operation, and the used frequency bands include Code Division Multiple Access (CDMA) 8a0 / TD - LTE 2a00, etc.; the MNC of operator a4 in country A is 15, the usage status is in operation, and the used frequency bands include LTE 18a0 / TD - LTE a300, etc.; the MNC of operator a3 in country A is 20, the usage status is in operation, and the used frequency bands include Global System for Mobile Communications - Railway (GSM - R), etc. Assume that the MCC of country B is 3n0, and the MNC format of country B is 3 digits. Assume that the MNC of operator b1 in country B is 05e, the usage status is in operation, and the used frequency bands include CDMA1c00, etc.; the MNC of operator b2 in country B is 06f, the usage status is in operation, and the used frequency bands include GSM and CDMA; the MNC of operator b3 in country B is 01g, the usage status is in operation, and the used frequency bands include CDMA2d00, etc.
[0041] In some embodiments of the present application, the electronic device can request a file based on the management data of the SIM card, read the mobile country code of the SIM card and the mobile network code of the SIM card from the basic file of the SIM card, and obtain the public land mobile network number of the SIM card.
[0042] In some embodiments of the present application, the above-mentioned management data request file may be the EF-AD (Elementary File - Abbreviated Dialing Numbers) file of the SIM card. The above-mentioned elementary file may be the EF-IMSI (Elementary File - International Mobile Subscriber Identification Number) file of the SIM card.
[0043] In some embodiments of the present application, the electronic device may read the EF-AD file of the SIM card through the Modem layer to determine the length of the mobile network code of the SIM card. Then, the electronic device reads the first 3 characters from the EF-IMSI file of the SIM card as the mobile country code of the SIM card, and then reads the characters of the length of the mobile network code starting from the 4th character to obtain the mobile network code of the SIM card. Then, the mobile country code of the SIM card + the mobile network code of the SIM card = the public land mobile network number of the SIM card, that is, MCC + MNC = PLMN.
[0044] In some embodiments of the present application, the electronic device may read the EF-AD file of the SIM card through the Modem and query the last four bits of Byte 4 in the EF-AD file. If 0010 is read, it means that the length of the mobile network code of the SIM card is 2 bits. If 0011 is read, it means that the length of the mobile network code of the SIM card is 3 bits.
[0045] Exemplarily, Byte 4 in the above-mentioned EF-AD file includes 8 bit positions from b8 - b1. The last four bits (b4 - b1) are used to encode the number of bits of the MNC in the IMSI (2 bits or 3 bits), and the other four bits (b8 - b5) are reserved for future use (Reserved for Future Use, RFU).
[0046] Exemplarily, assume that the electronic device reads the EF-AD file of the SIM card through the Modem layer and queries that the last four bits of Byte 4 in the EF-AD file are 0010. Then, it can be determined that the length of the mobile network code of the SIM card is 2. Then, the electronic device reads the first 3 characters from the EF-IMSI file of the SIM card through the Modem layer as the mobile country code of the SIM card, and then reads the 4th character and the 5th character to obtain the mobile network code of the SIM card.
[0047] It should be noted that the length of the mobile country code of the SIM card commonly used in the current industry is 3 digits. With the development of technology, the length of the mobile country code may change. This application is applicable to the solution with a 3-digit mobile country code, but is not limited to the solution with a 3-digit mobile country code.
[0048] In some embodiments of the present application, the above electronic device may be an electronic device that activates the SIM card lock function.
[0049] In some embodiments of the present application, the ways for the electronic device to activate the SIM card lock function include but are not limited to software default support, production line writing, online distribution, after-sales tool activation, etc. It should be noted that the SIM card management method in the embodiments of the present application can be compatible with multiple activation methods.
[0050] In some embodiments of the present application, the electronic device may activate the SIM card lock function during the production stage, or may activate the SIM card lock function through the user's input during the use stage. The embodiments of the present application do not limit this.
[0051] In some embodiments of the present application, the above blacklist may be a blacklist of PLMNs pre-configured in the RPMB of the electronic device. This blacklist can be configured during the production stage of the electronic device.
[0052] In some embodiments of the present application, if the public land mobile network number of the SIM card of the electronic device is in the blacklist, it means that the SIM card cannot be used in this electronic device. Therefore, the electronic device can modify the target data of the SIM card so that the SIM card cannot register a network in this electronic device, thereby achieving the effect of locking the SIM card.
[0053] Step 102: The electronic device executes a network registration process based on the modified target data of the SIM card.
[0054] In some embodiments of the present application, the above target data may include the mobile network code of the SIM card, and the modified mobile network code does not conform to the preset mobile network code format. Or, the above target data may include the data carried in the target field of the SIM card management data request file, and the data carried in the modified target field may indicate that the SIM card is unavailable.
[0055] In some embodiments of the present application, the above preset mobile network code format may be a format different from the mobile network code format of the SIM card's mobile network code. For example, if the mobile network code format of the SIM card's mobile network code is 2 digits, this preset mobile network code format is 3 digits; if the mobile network code format of the SIM card's mobile network code is 3 digits, this preset mobile network code format is 2 digits.
[0056] In some embodiments of the present application, the specific implementation of step 102 may include: the electronic device sends a registration request message to the network-side device, and the registration request message may carry at least the modified target data of the SIM card. Then, the electronic device receives a registration response message from the network-side device, and the registration response message may carry a registration failure signaling.
[0057] In some embodiments of the present application, the specific implementation of step 102 may include: the electronic device sends a registration request message to the network-side device, and the registration request message may carry at least the modified target data of the SIM card and the mobile country code of the SIM card. Then, the electronic device receives a registration response message from the network-side device, and the registration response message may carry a registration failure signaling.
[0058] Exemplarily, after the electronic device reads the mobile country code and the modified mobile network code of the SIM card at the modem layer, it uploads the mobile country code and the modified mobile network code of the SIM card to the communication framework of the electronic device, and then the communication framework generates the above-mentioned registration request message and sends it to the network-side device.
[0059] In some embodiments of the present application, both the above-mentioned registration request message and the registration response message may be Session Initiation Protocol (SIP) messages. The above-mentioned registration failure signaling may be any signaling indicating that the electronic device is rejected for registration by the network or the electronic device is prohibited from camping on the network. For example, the registration failure signaling may include a 403 Forbidden signaling, etc.
[0060] Further, when the electronic device receives a registration response message from the network-side device, it may display a prompt message, which is used to prompt the user that the SIM card installed in the electronic device cannot be used and inform the user of the available operators.
[0061] Exemplarily, Figure 2 A schematic diagram of the prompt message displayed by the electronic device provided in the embodiments of the present application. As Figure 2As shown, taking the electronic device as a mobile phone as an example, when receiving a registration response message from the network-side device, a prompt message 21 can be displayed on the mobile phone. The prompt message 21 includes "The mobile data service of this mobile phone has been locked to operator A / B / C. Only the SIM card slots inserted with A / B / C SIM cards can use the mobile data service." and "Please insert an A / B / C SIM card to use this mobile phone. Only the SIM card slots inserted with A / B / C SIM cards can use the mobile data service." In this way, the user is prompted through the prompt message 21 that the SIM card installed in the mobile phone cannot use the mobile data service, and the user is prompted that an A, B, or C operator's SIM card can be installed to use the mobile data service normally.
[0062] In some embodiments of the present application, the above target data may include the mobile network code of the SIM card, and the modified target data is the modified mobile network code. The specific implementation of the above step 102 may include: The electronic device executes a network registration process based on the mobile country code and the modified mobile network code. Specifically, the electronic device may send a registration request message to the network-side device, and the registration request message may carry the modified mobile network code of the SIM card and the mobile country code of the SIM card. Then, the electronic device receives a registration response message from the network-side device, and the registration response message may carry a registration failure signaling.
[0063] In this way, since the modified mobile network code does not conform to the preset mobile network code format, the network-side device will reject the SIM card's network registration, send a registration response message to the electronic device, and carry a registration failure signaling in the registration response message to inform the electronic device that the network registration fails.
[0064] In some embodiments of the present application, the above target data may include the data carried in the target field of the SIM card's management data request file. The specific implementation of the above step 102 may include: The electronic device executes a network registration process based on the mobile network code of the SIM card, the mobile country code of the SIM card, and the modified target field of the SIM card. Specifically, the electronic device may send a registration request message to the network-side device, and the registration request message may carry the mobile network code of the SIM card, the mobile country code of the SIM card, and the data carried in the modified target field of the SIM card. Then, the electronic device receives a registration response message from the network-side device, and the registration response message may carry a registration failure signaling.
[0065] In this way, since the data carried in the modified target field indicates that the SIM card is unavailable, the network side will reject the SIM card's network registration, send a registration response message to the electronic device, and carry a registration failure signaling in the registration response message to inform the electronic device that the network registration fails.
[0066] The SIM card management method provided by the embodiment of the present application modifies the target data of the SIM card when the public land mobile network number of the SIM card in the electronic device is in the blacklist; based on the modified target data of the SIM card, it executes the network registration process; wherein, the target data includes the mobile network code of the SIM card, and the modified mobile network code does not conform to the preset mobile network code format; or, the target data includes the data carried in the target field of the management data request file of the SIM card, and the data carried in the modified target field indicates that the SIM card is unavailable. In this way, since the modified mobile network code does not conform to the preset mobile network code format, or the data carried in the modified target field indicates that the SIM card is unavailable, therefore, the data reported by the electronic device to the network side device when registering the network is non-compliant or incorrect. Then, the network side device will reject the SIM card registration network of the electronic device, making the SIM card unable to register the network, thus achieving the effect of locking the SIM card. In this way, compared with the existing lock card solution implemented through the blacklist, this solution realizes the SIM lock card effect by the network side device rejecting the SIM card of the electronic device to camp on the network. This lock card logic is more concealed and not easily cracked compared to a simple blacklist, can protect user information from being leaked, and is more secure and reliable.
[0067] In some embodiments of the present application, the above target data includes the mobile network code of the SIM card, and the "modifying the target data of the SIM card" in step 101 can be specifically implemented through the following step 1011.
[0068] Step 1011: When the mobile network code is not a field of all 0s, the electronic device deletes the last digit of the mobile network code or adds a character to the mobile network code based on the length of the mobile network code.
[0069] In some embodiments of the present application, if the public land network number of the SIM card is in the blacklist, indicating that the SIM card installed in the electronic device cannot be used in the electronic device, then when the mobile network code of the SIM card is not a field of all 0s, the electronic device can modify the mobile network code of the SIM card based on the length of the mobile network code.
[0070] In some embodiments of the present application, the length of the mobile network code is relatively long, and the electronic device can delete the last digit of the mobile network code; the length of the mobile network code is relatively short, and the electronic device can add a character to the mobile network code.
[0071] In this way, when the mobile code is not an all-zero field, the electronic device modifies the mobile network code based on the length of the mobile network code, such that the modified mobile network code does not conform to the preset mobile network code format. Then, when the network-side device receives the modified mobile network code, it will reject the registration, which can achieve the effect of locking the SIM card. The logic is hidden and not easily cracked, improving the security of the product and the security of user information.
[0072] In some embodiments of the present application, the step of "deleting the last digit of the mobile network code based on the length of the mobile network code" in step 1011 can be specifically implemented through the following step 10111.
[0073] Step 10111: When the length of the mobile network code is 3, the electronic device deletes the last digit of the mobile network code.
[0074] Exemplarily, assuming the mobile network code is 010, the electronic device can delete the last digit of the mobile network code, and the modified mobile network code is 01.
[0075] Taking the case where the PLMN is in the blacklist and the MNC is 3 digits as an example, the following is a code description of the process of the electronic device reading the PLMN:
[0076] String plmn = "3p0 0q6";
[0077] String mcc = plmn.substring(0, 3);
[0078] String mnc = plmn.substring(2, plmn.length());
[0079] System.out.println("plmn[" + plmn + "]mcc[" + mcc + "]mnc[" + mnc + "]");
[0080] The read PLMN is MCC + the modified MNC: "3p0 0q".
[0081] In the above code, the PLMN read by the electronic device from the SIM card is "3p0 0q6". However, since this PLMN is in the blacklist and the MNC of this SIM card is 3 digits, the electronic device reads the first 3 characters "3p0" from the PLMN as the MCC of the SIM card, and forcibly reads the first 2 characters "0q" of the MNC of the SIM card as the modified MNC of the SIM card. Finally, the read PLMN is "3p0 0q".
[0082] Thus, for countries or operators where the PLMN is in the 3+3 format, for the PLMNs in the blacklist, the electronic device reads the first two characters of the MNC of the SIM card as the modified MNC of the SIM card. Then, the modified MNC of the SIM card does not conform to the rules of this country or operator, and the network-side device will reject the SIM card from registering on the network. In this way, the effect of locking the SIM card is achieved by the network-side device rejecting network registration. The logic is hidden and not easily cracked, making it more secure and reliable.
[0083] In some embodiments of the present application, the step of "adding one character to the mobile network code based on the length of the mobile network code" in step 1011 can be specifically implemented through the following step 10112.
[0084] Step 10112: When the length of the mobile network code is 2, the electronic device adds the character 0 after the last digit of the mobile network code.
[0085] Exemplarily, assuming the mobile network code is 03, the electronic device can add the character 0 after the last digit of the mobile network code, and the modified mobile network code is 030.
[0086] Taking the case where the PLMN is in the blacklist and the MNC is 2 digits as an example, the following is a piece of code to describe the process of the electronic device reading the PLMN:
[0087] String plmn = "4m0 0n";
[0088] String mcc = plmn.substring(0, 3);
[0089] String mnc = plmn.substring(3, plmn.length());
[0090] System.out.println("plmn[" + plmn + "]mcc[" + mcc + "]mnc[" + mnc + "]");
[0091] The read PLMN is MCC + the modified MNC: "4m0 0n0".
[0092] In the above code, the PLMN of the SIM card read by the electronic device is "4m0 0n". However, since this PLMN is in the blacklist and the MNC of this SIM card is 2 digits, the electronic device reads the first 3 characters "4m0" from the PLMN as the MCC of the SIM card, and forcibly reads 3 characters "0n0" as the modified MNC of the SIM card. The first 2 characters of these 3 characters are the MNC of the SIM card, and the 3rd character is the added character 0. Finally, the PLMN read is "4m0 0n0".
[0093] In this way, for countries or operators with a 3+2 format PLMN, for a PLMN in the blacklist, the electronic device reads the MNC of the SIM card and adds a character 0 as the modified MNC of the SIM card. Then, the modified MNC of the SIM card does not conform to the rules of this country or operator, and the network-side device will reject the SIM card from registering on the network. In this way, the effect of locking the SIM card is achieved by the network-side device rejecting network attachment, and the logic is hidden and not easily cracked, which is more secure and reliable.
[0094] It should be noted that the length of the mobile network code of the SIM card commonly used in the industry currently includes two types: 2 digits and 3 digits. With the development of technology, the length of the mobile network code may change. This application is applicable to the scenarios where the length of the mobile network code is 2 digits or 3 digits, but is not limited to the length of the mobile network code being 2 digits and 3 digits.
[0095] In a possible implementation manner of this application, the above target field may include a first field, and the "modifying the target data of the SIM card" in step 101 may be specifically implemented through the following step 1012 and step 1013.
[0096] Step 1012: When the mobile network code of the public land mobile network number of the SIM card is an all-0 field, the electronic device reads the first field in the management data request file, and this first field may be used to indicate the user equipment operation mode of the SIM card.
[0097] In some embodiments of this application, the above management data request file (EF-AD file) may include the user equipment operation mode, instructions on certain electronic device functions or how the mobile equipment (ME) should work during normal operation, and the length of the MNC in the IMSI.
[0098] In some embodiments of the present application, Byte1 in the above-mentioned management data request file represents the user equipment operation mode, with a length of 1 byte; Byte2 - Byte3 in the management data request file represents additional information (Additional information), with a length of 2 bytes; Byte4 in the management data request file represents the length of the MNC in the IMSI, with a length of 1 byte; Byte5 - Byte4 + X in the management data request file is RFU, with a length of X bytes.
[0099] In some embodiments of the present application, the above-mentioned user equipment operation mode may be UE operation mode (User Equipment operation mode), and can be determined according to the type of the SIM card. The user equipment operation mode may include at least one of the following: normal mode, type approval mode, cell test mode, manufacturer specific mode, specific facilities mode, maintenance (maintenance or off line) mode.
[0100] Among them, the normal mode is for PLMN users to operate in 3G. The type approval mode allows specific use of the electronic device or ME during type approval. The cell test mode allows testing of the cell before commercial use. The manufacturer specific mode allows certain manufacturers to perform specific proprietary automatic tests in their electronic devices or ME, for example, during the maintenance phase.
[0101] In some embodiments of the present application, the above-mentioned user equipment operation mode may be represented by a first field, and different data is carried in the first field, and the user equipment operation mode indicated by the first field is different. Exemplarily, when the data carried in the first field is 00, the user equipment operation mode indicated by the first field is the normal mode; when the data carried in the first field is 80, the user equipment operation mode indicated by the first field is the type approval mode; when the data carried in the first field is 01, the user equipment operation mode indicated by the first field is the normal mode + specific facilities mode; when the data carried in the first field is 81, the user equipment operation mode indicated by the first field is the type approval mode + specific facilities mode; when the data carried in the first field is 02, the user equipment operation mode indicated by the first field is the maintenance mode; when the data carried in the first field is 04, the user equipment operation mode indicated by the first field is the cell test mode.
[0102] Step 1013: The electronic device modifies the data carried in the first field, and the data carried in the modified first field is used to indicate that the SIM card is unavailable.
[0103] In some embodiments of the present application, the electronic device may modify the data carried in the first field, so that the data carried in the modified first field is different from the data carried in the first field before modification, so that the modified first field no longer indicates the user equipment operation mode indicated by the first field before modification.
[0104] In some embodiments of the present application, the electronic device may modify the data carried in the first field, and the modified first field indicates a first user equipment operation mode, and the first user equipment operation mode may be a user equipment operation mode different from the user equipment operation mode indicated by the first field before modification.
[0105] Exemplarily, assume that the data carried in the first field is 00, indicating the normal mode. The electronic device may modify the data carried in the first field to 04 or 02, indicating the cell test mode or the maintenance mode. In this way, the SIM card will be rejected when registering for a normal operator network.
[0106] In this way, by modifying the data carried in the first field of the EF-AD file, so that the modified first field no longer indicates the user equipment operation mode originally set for the SIM card, the SIM card will be rejected by the network side device when registering for the operator network in the user equipment operation mode indicated by the first field. That is, the SIM card is locked by the network side device rejecting network registration. This locking logic is more concealed and difficult to crack compared to a simple blacklist, and is more secure and reliable.
[0107] In another possible implementation manner of the present application, the above target field may include a second field, and the "modifying the target data of the SIM card" in the above step 101 may be specifically implemented by the following steps 1014 and 1015.
[0108] Step 1014: When the mobile network code of the public land mobile network number of the SIM card is a field of all 0s, the electronic device reads the second field in the management data request file, and the second field is used to indicate the closed user group that the SIM card can access.
[0109] It should be noted that for the explanation of the management data request file, reference may be made to the relevant description in the above step 1012. To avoid repetition, it will not be elaborated here.
[0110] In some embodiments of the present application, the above-mentioned second field may be a field for managing Byte2-Byte3 in the data request file. The data carried in the second field may be a Closed Subscriber Group (CSG) value, that is, the additional information in the above-mentioned step 1022 may include the CSG value.
[0111] In some embodiments of the present application, Byte2 in the above-mentioned management data request file is the first byte of the additional information, and b1-b8 in Byte2 are reserved for future use.
[0112] In some embodiments of the present application, Byte3 in the above-mentioned management data request file is the second byte of the additional information. b1 in Byte3 is used to control the encryption indicator function, b2 in Byte3 is the CSG display control bit, which is used to indicate which CSGs the electronic device should display when manually selecting a CSG, and b3-b8 in Byte3 are RFU. And, b2 in Byte3 corresponds to the value of the Operator CSG Entries_Only leaf node described in the communication standard. When the service number n92 is not available, this bit, that is, b2 in Byte3, should be ignored.
[0113] In some embodiments of the present application, b1 = 0 in Byte3 indicates that the encryption indicator function is disabled; b1 = 1 in Byte3 indicates that the encryption indicator function is enabled. b2 = 0 in Byte3 indicates that for each PLMN not included in EF_OCSGL, or for a PLMN without a CSG display indicator label, all available CSGs can be displayed without any restrictions. b2 = 1 in Byte3 indicates that for each PLMN not included in EF_OCSGL, or for any PLMN without a CSG display indicator label, the available CSGs found in the operator CSG list can be displayed.
[0114] Step 1015: The electronic device modifies the data carried in the second field, and the data carried in the modified second field can be used to indicate that the SIM card is unavailable.
[0115] In some embodiments of the present application, the data carried in the above-mentioned modified second field may be a fixed data n92, and this n92 is used to indicate that the SIM card is unavailable.
[0116] In some embodiments of the present application, after the electronic device modifies the data carried in the second field to n92, the registration of the SIM card to any type of operator network will be rejected.
[0117] Exemplarily, assume that the data carried in the first field is 00, indicating the normal mode, which means that the SIM card is set to register and use with a normal operator. After the electronic device modifies the data carried in the second field to n92, the SIM card will be rejected when registering for the network of a normal operator.
[0118] Again exemplarily, assume that the data carried in the first field is 04, indicating the cell test mode, which means that the SIM card is set to register and use with an operator in the cell test mode. After the electronic device modifies the data carried in the second field to n92, the SIM card will be rejected when registering for the network of an operator in the cell test mode.
[0119] In this way, by modifying the data carried in the second field of the EF-AD file so that the data carried in the modified second field indicates that the SIM card is unavailable, the SIM card will be rejected by the network-side device when registering for the network of the user equipment operation mode indicated by the first field, that is, the SIM card is locked by the network-side device rejecting network registration. This locking logic is more concealed and difficult to crack compared to a simple blacklist, and is more secure and reliable.
[0120] In another possible implementation manner of the present application, the above target field may include a first field and a second field, and the "modifying the target data of the SIM card" in step 101 above may be specifically implemented through the following steps 1016 and 1017.
[0121] Step 1016: When the mobile network code is a field of all 0s, the electronic device reads the first field and the second field in the management data request file.
[0122] Step 1017: The electronic device modifies the data carried in the first field and modifies the data carried in the second field.
[0123] It should be noted that for the relevant content of the first field, the second field, and the above steps 1016 and 1017, reference may be made to the relevant descriptions of steps 1012 to 1015 in the above embodiments. To avoid repetition, it will not be elaborated here.
[0124] In this way, by modifying at least one of the first field and the second field in the management data request file so that the data carried in the modified target field indicates that the SIM card is unavailable, in this way, the network-side device will reject the SIM card from registering for the network, thereby achieving the effect of locking the SIM card.
[0125] In some embodiments of the present application, the SIM card management method provided by the embodiments of the present application may further include the following step 103.
[0126] Step 103: When the public land mobile network number of the SIM card in the electronic device is not in the blacklist, the electronic device executes a network registration process based on the public land mobile network number.
[0127] In some embodiments of the present application, if the public land mobile network number of the SIM card is not in the blacklist, it indicates that the SIM card can be used in the electronic device. Then, the electronic device does not modify the read public land mobile network number of the SIM card and executes a network registration process based on this public land mobile network number. Specifically, the electronic device can send a registration request message to the network-side device, and the public land mobile network number of the SIM card is carried in this registration request message. Then, the electronic device receives a registration response message from the network-side device, and a registration success signaling can be carried in this registration response message to inform the electronic device that the network registration is successful.
[0128] In some embodiments of the present application, during the production stage of the electronic device, a whitelist of PLMNs can be pre-configured in the RPMB of the electronic device. When the public land mobile network number of the SIM card is in the whitelist, the electronic device can execute a network registration process based on the public land mobile network number.
[0129] Taking the PLMN not being in the blacklist as an example, the following is a piece of code to describe the process of the electronic device reading the PLMN:
[0130] String plmn = "4m0 0n";
[0131] String mcc = plmn.substring(0, 3);
[0132] String mnc = plmn.substring(2, plmn.length());
[0133] System.out.println("plmn[" + plmn + "]mcc[" + mcc + "]mnc[" + mnc + "]");
[0134] The read PLMN is MCC + MNC: "4m0 0n".
[0135] In the above code, the PLMN of the SIM card read by the electronic device is "4m0 0n". Since this PLMN is not in the blacklist, the electronic device reads the first 3 characters "4m0" from the PLMN as the MCC of the SIM card and reads the last 2 characters "0n" as the MNC of the SIM card. Finally, the read PLMN of the SIM card is "4m0 0n".
[0136] Thus, for a PLMN not in the blacklist, the electronic device can normally read the MCC and MNC of the SIM card and then execute the network registration process, and the SIM card of the electronic device can successfully register on the network.
[0137] In some embodiments of the present application, when the electronic device is in other device modes except the flight mode, the electronic device can execute the above-mentioned step 101, step 102 and related steps.
[0138] That is to say, when the electronic device is in other device modes except the flight mode, if the public land mobile number of the SIM card of the electronic device is in the blacklist, the electronic device modifies the target data of the SIM card and executes the network registration process based on the modified target data of the SIM card. If the public land mobile number of the SIM card of the electronic device is not in the blacklist, the electronic device executes the network registration process based on the public land mobile network number.
[0139] In some embodiments of the present application, the above-mentioned flight mode is a device mode that disables the wireless communication functions of the electronic device (such as cellular network, Wi-Fi, Bluetooth, etc.), and the above-mentioned other device modes are device modes that do not disable the wireless communication functions of the electronic device.
[0140] In some embodiments of the present application, the above-mentioned other device modes may include normal mode (standard mode), power saving mode (energy saving mode), super power saving mode (extreme power saving mode), data mode, do not disturb mode (silent mode), security mode, etc.
[0141] Among them, in the normal mode, all functions of the electronic device can operate normally; in the power saving mode, the performance of the electronic device can be reduced and background activities can be restricted to extend the battery life; in the super power saving mode, the electronic device can retain basic functions (such as phone calls and text messages) and close most applications; in the do not disturb mode, the electronic device can block notifications and incoming call prompts; in the data mode, the electronic device can turn on mobile data and turn off Wi-Fi and Bluetooth; in the security mode, the electronic device can run system pre-installed applications.
[0142] In some embodiments of the present application, the SIM card management method provided by the embodiments of the present application may further include the following step 104 and step 105.
[0143] Step 104: When the electronic device is in the flight mode, the electronic device modifies the target data of the SIM card.
[0144] That is to say, when the electronic device turns on the flight mode, regardless of whether the PLMN of the SIM card read by the electronic device is in the blacklist, the electronic device can modify the target data of the SIM card to achieve the effect of disconnecting the network and making the electronic device have no signal.
[0145] Exemplarily, Figure 3 is a schematic diagram of the electronic device provided in the embodiment of the present application in the flight mode. As Figure 3 shown, after the electronic device turns on the flight mode, the "signal" indicator 31 of the electronic device dims.
[0146] It should be noted that the specific implementation of "the electronic device modifies the target data of the SIM card" in step 104 above can refer to the relevant descriptions of step 101, steps 1011 to 1017, steps 10111 and 10112 in the above embodiments. To avoid repetition, it will not be elaborated here.
[0147] Step 105: The electronic device executes a network registration process based on the modified target data of the SIM card.
[0148] It should be noted that the specific implementation of step 105 above can refer to the relevant description of step 102 in the above embodiments. To avoid repetition, it will not be elaborated here.
[0149] Furthermore, the electronic device can also store the PLMN of the read SIM card, and the PLMN includes the MCC and MNC of the SIM card. Then, after the electronic device turns off the flight mode, it can be determined whether the stored PLMN of the SIM card is in the blacklist. If the PLMN of the SIM card is in the blacklist, the target data of the SIM card is modified, and a network registration process is executed based on the modified target data of the SIM card and the mobile country code of the SIM card; if the PLMN of the SIM card is not in the blacklist, a network registration process is executed based on the stored PLMN of the SIM card.
[0150] It should be noted that the specific implementation of each operation executed after the electronic device turns off the flight mode can refer to the relevant descriptions of the above embodiments. To avoid repetition, it will not be elaborated here.
[0151] In this way, when the electronic device is in the flight mode, by modifying the target data of the SIM card, the SIM card of the electronic device cannot camp on the network, so as to achieve the effect of disabling the wireless communication function of the electronic device. In addition, after the electronic device turns off the flight mode, the stored PLMN of the SIM card can be directly obtained without reading it from the SIM card again, which can improve the network registration efficiency and the network return speed is faster.
[0152] Next, taking the electronic device as a mobile phone as an example, the SIM card management method provided in the embodiment of the present application will be described.
[0153] Figure 4It is a schematic flowchart of the SIM card management method provided by an embodiment of the present application. Taking the case where the MNC of the SIM card in the mobile phone is not an all-zero field, the MCC of the SIM card is 3 digits, and the MNC is 2 digits as an example, the method may include the following steps 401 to step 404.
[0154] Step 401, the mobile phone reads the PLMN of the SIM card from the SIM card, and the PLMN of the SIM card includes MCC and MNC.
[0155] For example, assume that the PLMN of the SIM card is "4m0 0n".
[0156] Step 402, when the PLMN of the SIM card is in the blacklist, the MNC of the SIM card is not an all-zero field, and the length of the MNC of the SIM card is 2, the mobile phone adds the character 0 after the last digit of the MNC of the SIM card.
[0157] For example, assume that the MNC of the SIM card is "0n", and the modified MNC of the SIM card is "0n0".
[0158] Step 403, the mobile phone sends a registration request message to the network-side device, and the registration request message carries the modified MNC of the SIM card and the MCC of the SIM card.
[0159] Step 404, the mobile phone receives a registration response message from the network-side device, and the registration response message carries a 403 Forbidden signaling.
[0160] It should be noted that for the specific implementation processes of the above steps 401 to step 404, reference may be made to the relevant descriptions of the above embodiments. To avoid repetition, they are not elaborated herein in this embodiment.
[0161] In the embodiment of the present application, for countries or operators with a 3+2 format PLMN, for a PLMN in the blacklist, the mobile phone reads the MNC of the SIM card and adds one character 0 as the modified MNC of the SIM card. Then, the modified MNC of the SIM card does not conform to the rules of this country or operator, and the network-side device will reject the registration of this SIM card to the network. In this way, the effect of locking the SIM card is achieved by the network-side device rejecting network access. The logic is hidden and not easily cracked, which is more secure and reliable.
[0162] Figure 5 It is a schematic flowchart of the SIM card management method provided by an embodiment of the present application. Taking the case where the MNC of the SIM card in the mobile phone is not an all-zero field, the MCC of the SIM card is 3 digits, and the MNC is 3 digits as an example, the method may include the following steps 501 to step 504.
[0163] Step 501: The mobile phone reads the PLMN of the SIM card from the SIM card. The PLMN of the SIM card includes MCC and MNC.
[0164] For example, assume that the PLMN of the SIM card is "3p0 0q6".
[0165] Step 502: When the PLMN of the SIM card is in the blacklist, and the MNC of the SIM card is not a full-zero field, and the length of the MNC of the SIM card is 3, the mobile phone deletes the last digit of the MNC of the SIM card.
[0166] For example, assume that the MNC of the SIM card is "0q6", and the modified MNC of the SIM card is "0q".
[0167] Step 503: The mobile phone sends a registration request message to the network-side device. The registration request message carries the modified MNC of the SIM card and the MCC of the SIM card.
[0168] Step 504: The mobile phone receives a registration response message from the network-side device. The registration response message carries a 403 Forbidden signaling.
[0169] It should be noted that the specific implementation processes of the above steps 501 to 504 can refer to the relevant descriptions in the above embodiments. To avoid repetition, they are not elaborated in this embodiment.
[0170] In the embodiment of the present application, for countries or operators where the PLMN is in the 3+3 format, for the PLMN in the blacklist, the mobile phone reads the first 2 characters of the MNC of the SIM card as the modified MNC of the SIM card. Then, the modified MNC of the SIM card does not conform to the rules of this country or operator, and the network-side device will reject the registration of this SIM card to the network. In this way, the effect of locking the SIM card is achieved by the network-side device rejecting network registration. The logic is hidden and not easily cracked, which is more secure and reliable.
[0171] Figure 6 It is a schematic flowchart of the SIM card management method provided by the embodiment of the present application. Taking the MNC of the SIM card of the mobile phone as a full-zero field as an example, the method may include the following steps 601 to 608.
[0172] Step 601: The mobile phone reads the PLMN of the SIM card from the SIM card. The PLMN of the SIM card includes MCC and MNC.
[0173] For example, assume that the PLMN of the SIM card is "5k0 00", or assume that the PLMN of the SIM card is "3k0 000".
[0174] Step 602: When the PLMN of the SIM card is in the blacklist and the MNC of the SIM card is an all-zero field, the mobile phone reads the first field in the EF-AD file that indicates the operation mode of the user equipment and modifies the data in the first field.
[0175] For example, assuming the first field is 00, the mobile phone changes the first field to 04.
[0176] Step 603: The mobile phone sends a registration request message to the network-side device, and the registration request message carries at least the PLMN of the SIM card and the modified first field.
[0177] Step 604: When the PLMN of the SIM card is in the blacklist and the MNC of the SIM card is an all-zero field, the mobile phone reads the CSG value in the EF-AD file and modifies the CSG value.
[0178] For example, the mobile phone changes the CSG value to n92.
[0179] Step 605: The mobile phone sends a registration request message to the network-side device, and the registration request message carries at least the PLMN of the SIM card and the modified CSG value.
[0180] Step 606: When the PLMN of the SIM card is in the blacklist and the MNC of the SIM card is an all-zero field, the mobile phone reads the first field and the CSG value in the EF-AD file that indicate the operation mode of the user equipment, and modifies the data in the first field and the CSG value.
[0181] For example, the mobile phone changes the CSG value to n92.
[0182] Step 607: The mobile phone sends a registration request message to the network-side device, and the registration request message carries at least the PLMN of the SIM card, the modified first field, and the modified CSG value.
[0183] Step 608: The mobile phone receives a registration response message from the network-side device, and the registration response message carries a 403 Forbidden signaling.
[0184] It should be noted that the above Step 602, Step 604, and Step 606 are in a parallel relationship and are executed alternatively. The above Step 608 can be executed after the above Step 603, Step 605, and Step 607. In addition, for the specific implementation processes of the above Steps 601 to 608, reference can be made to the relevant descriptions of the above embodiments. To avoid repetition, they are not elaborated here in this embodiment.
[0185] In the embodiments of the present application, for a PLMN in the blacklist, when the MNC of the SIM card is the weight 0 field, by modifying at least one of the first field and the second field in the EF-AD file, the modified target field indicates that the SIM card is unavailable. In this way, the network-side device will reject the SIM card from registering on the network, thereby achieving the effect of locking the SIM card.
[0186] Figure 7 FIG. is a schematic flowchart of the SIM card management method provided by the embodiments of the present application. Taking the mobile phone in flight mode as an example, the method may include the following steps 701 to 711.
[0187] Step 701: The mobile phone turns on the flight mode.
[0188] Step 702: The mobile phone reads the PLMN of the SIM card from the SIM card and stores it. The PLMN of the SIM card includes MCC and MNC.
[0189] Step 703: The mobile phone modifies the MNC of the SIM card, and then sends a registration request message to the network-side device. The registration request message carries at least the MCC of the SIM card and the modified MNC of the SIM card.
[0190] Step 704: The mobile phone reads the first field in the EF-AD file for indicating the operating mode of the user equipment, modifies the data in the first field, and then sends a registration request message to the network-side device. The registration request message carries at least the PLMN of the SIM card and the modified first field.
[0191] Step 705: The mobile phone reads the CSG value in the EF-AD file, modifies the CSG value, and then sends a registration request message to the network-side device. The registration request message carries at least the PLMN of the SIM card and the modified CSG value.
[0192] Step 706: The mobile phone reads the first field and the CSG value in the EF-AD file for indicating the operating mode of the user equipment, modifies the data in the first field and the CSG value, and then sends a registration request message to the network-side device. The registration request message carries at least the PLMN of the SIM card, the modified first field, and the modified CSG value.
[0193] Step 707: The mobile phone receives a registration response message from the network-side device. The registration response message carries a 403 Forbidden signaling.
[0194] Step 708: The mobile phone turns off the flight mode.
[0195] Step 709: The mobile phone reads the stored PLMN of the SIM card. The PLMN of the SIM card includes MCC and MNC.
[0196] Step 710: When the Public Land Mobile Network (PLMN) of the SIM card is in the blacklist, modify the target data of the SIM card, and then execute the network registration process based on the modified target data of the SIM card.
[0197] Step 711: When the PLMN of the SIM card is not in the blacklist, execute the network registration process based on the PLMN of the SIM card.
[0198] It should be noted that the specific implementation processes of the above Steps 701 to 711 can refer to the relevant descriptions of the above embodiments. To avoid repetition, they will not be elaborated herein in this embodiment.
[0199] In the embodiment of the present application, when the mobile phone turns on the flight mode, by modifying the target data of the SIM card, the SIM card of the mobile phone cannot camp on the network, so as to achieve the effect of disabling the wireless communication function of the mobile phone. In addition, after the mobile phone turns off the flight mode, the stored PLMN of the SIM card can be directly obtained without reading it from the SIM card again, which can improve the network registration efficiency and the network return speed is faster.
[0200] It should be noted that the above various method embodiments, or various possible implementation manners in each method embodiment, can be executed independently, or any two or more of them can be combined with each other. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0201] For the SIM card management method provided in the embodiment of the present application, the execution subject can be a SIM card management device. In the embodiment of the present application, taking the SIM card management device executing the SIM card management method as an example, the SIM card management device provided in the embodiment of the present application is described.
[0202] Figure 8 It is a schematic structural diagram of the SIM card management device provided in the embodiment of the present application. The SIM card management device may include: a modification module 801 and an execution module 802.
[0203] Among them, the above modification module 801 is used to modify the target data of the SIM card when the Public Land Mobile Network number of the SIM card in the electronic device is in the blacklist. The above execution module 802 is used to execute the network registration process based on the modified target data of the SIM card. Among them, the target data includes the mobile network code of the SIM card, and the modified mobile network code does not conform to the preset mobile network code format; or, the target data includes the data carried in the target field of the management data request file of the SIM card, and the data carried in the modified target field indicates that the SIM card is unavailable.
[0204] In some embodiments of the present application, the above-mentioned target data includes the mobile network code of the SIM card. The modification module 801 is specifically configured to, when the mobile network code is not an all-zero field, delete the last digit of the mobile network code or add one character to the mobile network code based on the length of the mobile network code.
[0205] In some embodiments of the present application, the above-mentioned modification module 801 is specifically configured to, when the length of the mobile network code is 3, delete the last digit of the mobile network code.
[0206] In some embodiments of the present application, the above-mentioned modification module 801 is specifically configured to, when the length of the mobile network code is 2, add the character '0' after the last digit of the mobile network code.
[0207] In some embodiments of the present application, the above-mentioned target field includes a first field. The modification module 801 is specifically configured to, when the mobile network code of the public land mobile network number of the SIM card is an all-zero field, read the first field in the management data request file. The first field is used to indicate the user equipment operation mode of the SIM card; and modify the data carried in the first field, and the data carried in the modified first field indicates that the SIM card is unavailable.
[0208] In some embodiments of the present application, the above-mentioned target field includes a second field. The modification module 801 is specifically configured to, when the mobile network code of the public land mobile network number of the SIM card is an all-zero field, read the second field in the management data request file. The second field is used to indicate the closed user group accessible by the SIM card; and modify the data carried in the second field, and the data carried in the modified second field indicates that the SIM card is unavailable.
[0209] The SIM card management device provided by the embodiments of the present application modifies the mobile network code of the SIM card of the operator in the blacklist or modifies the target field in the management data request file of the SIM card. In this way, since the modified mobile network code does not conform to the preset mobile network code format, or the data carried in the modified target field indicates that the SIM card is unavailable, when the SIM card management device registers the network, the data reported to the network-side device does not conform to the rules or is incorrect. Then, the network-side device will reject the SIM card registration network of the SIM card management device, making the SIM card unable to register the network, thus achieving the effect of locking the SIM card. In this way, compared with the existing lock card scheme implemented by the blacklist, this scheme realizes the SIM lock card effect by the network-side device rejecting the SIM card of the SIM card management device from camping on the network. This lock card logic is more concealed and not easily cracked compared to a simple blacklist, can protect user information from being leaked, and is more secure and reliable.
[0210] The SIM card management device in the embodiments of the present application may be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal or other devices other than terminals. Exemplarily, the electronic device may be a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle-mounted electronic device, a mobile Internet device, an augmented reality / virtual reality device, a robot, a wearable device, a super mobile personal computer, a netbook, or a personal digital assistant, etc. It may also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiments of the present application do not make specific limitations.
[0211] The SIM card management device in the embodiments of the present application may be a device with an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems. The embodiments of the present application do not make specific limitations.
[0212] The SIM card management device provided in the embodiments of the present application can implement each process implemented by the above-mentioned SIM card management method. To avoid repetition, it will not be elaborated here.
[0213] Optionally, as Figure 9 shown, the embodiments of the present application further provide an electronic device 900, including a processor 901 and a memory 902. A program or instruction that can run on the processor 901 is stored on the memory 902. When the program or instruction is executed by the processor 901, it implements each step of the above-mentioned SIM card management method embodiment and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0214] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0215] Figure 10 Schematic diagram of the hardware structure of an electronic device for implementing the embodiments of the present application.
[0216] The electronic device 1000 includes, but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010 and other components.
[0217] Those skilled in the art can understand that the electronic device 1000 may further include a power source (such as a battery) for powering each component. The power source can be logically connected to the processor 1010 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. Figure 10 The structure of the electronic device shown in Figure 10 does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0218] Among them, the processor 1010 is used to modify the target data of the SIM card when the public land mobile network number of the SIM card in the electronic device is in the blacklist; and, based on the modified target data of the SIM card, execute the network registration process. Wherein, the target data includes the mobile network code of the SIM card, and the modified mobile network code does not conform to the preset mobile network code format; or, the target data includes the data carried in the target field of the management data request file of the SIM card, and the data carried in the modified target field indicates that the SIM card is unavailable.
[0219] In some embodiments of the present application, the above-mentioned target data includes the mobile network code of the SIM card. The processor 1010 is specifically used to, when the mobile network code is not a full 0 field, based on the length of the mobile network code, delete the last digit of the mobile network code or add a character to the mobile network code.
[0220] In some embodiments of the present application, the processor 1010 is specifically used to delete the last digit of the mobile network code when the length of the mobile network code is 3.
[0221] In some embodiments of the present application, the processor 1010 is specifically used to add the character 0 after the last digit of the mobile network code when the length of the mobile network code is 2.
[0222] In some embodiments of the present application, the above-mentioned target field includes a first field. The processor 1010 is specifically used to read the first field in the management data request file when the mobile network code of the public land mobile network number of the SIM card is a full 0 field. The first field is used to indicate the user equipment operation mode of the SIM card; and, modify the data carried in the first field, and the data carried in the modified first field indicates that the SIM card is unavailable.
[0223] In some embodiments of the present application, the above-mentioned target field includes a second field. The processor 1010 is specifically configured to, when the mobile network code of the public land mobile network number of the SIM card is an all-zero field, read the second field in the management data request file. The second field is used to indicate the closed user group that the SIM card can access; and modify the data carried in the second field, and the data carried in the modified second field indicates that the SIM card is unavailable.
[0224] The electronic device provided in the embodiments of the present application modifies the mobile network code of the SIM card of the operator in the blacklist, or modifies the target field in the management data request file of the SIM card. In this way, since the modified mobile network code does not conform to the preset mobile network code format, or the data carried in the modified target field indicates that the SIM card is unavailable, the data reported by the electronic device to the network-side device during network registration does not conform to the rules or is incorrect. Then, the network-side device will reject the SIM card of the electronic device from registering the network, making the SIM card unable to register the network, thereby achieving the effect of locking the SIM card. Thus, compared with the existing lock card scheme implemented through the blacklist, this scheme realizes the effect of SIM lock by the network-side device rejecting the SIM card of the electronic device from camping on the network. This lock card logic is more concealed and not easily cracked compared to a simple blacklist, can protect user information from being leaked, and is more secure and reliable.
[0225] It should be understood that in the embodiments of the present application, the input unit 1004 may include a graphics processing unit (GPU) 10041 and a microphone 10042. The graphics processing unit 10041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include a touch detection device and a touch controller. The other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, power-on keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here.
[0226] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area may store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both a volatile and a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 109 in the embodiments of the present application includes, but is not limited to, these and any other suitable types of memories.
[0227] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above-mentioned modem processor may not be integrated into the processor 1010 either.
[0228] The embodiments of the present application also provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above-mentioned embodiments of the SIM card management method and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0229] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.
[0230] Another embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the above embodiment of the SIM card management method, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0231] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.
[0232] The embodiments of the present application provide a computer program product. The program product is stored in a storage medium and is executed by at least one processor to implement each process of the above embodiment of the SIM card management method, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0233] It should be noted that in this article, the term "including", "comprising", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article, or device. Without further limitations, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or device including that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be executed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.
[0234] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases, the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0235] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative rather than restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them fall within the protection scope of the present application.
Claims
1. A SIM card management method, which is executed by an electronic device, characterized in that, The method includes: When the public land mobile network number of the subscriber identity module (SIM) card in an electronic device is in the blacklist, modifying the target data of the SIM card; Based on the modified target data of the SIM card, performing a network registration process; Wherein, the target data includes the mobile network code of the SIM card, and the modified mobile network code does not conform to the preset mobile network code format; or, the target data includes the data carried in the target field of the management data request file of the SIM card, and the data carried in the modified target field indicates that the SIM card is unavailable.
2. The method according to claim 1, wherein The target data includes the mobile network code of the SIM card, and modifying the target data of the SIM card includes: When the mobile network code is not an all-zero field, based on the length of the mobile network code, deleting the last digit of the mobile network code or adding one character to the mobile network code.
3. The method according to claim 2, wherein The deleting the last digit of the mobile network code or adding one character to the mobile network code based on the length of the mobile network code includes: When the length of the mobile network code is 3, deleting the last digit of the mobile network code; or, When the length of the mobile network code is 2, adding the character 0 after the last digit of the mobile network code.
4. The method according to claim 1, wherein The target field includes a first field, and modifying the target data of the SIM card includes: When the mobile network code of the public land mobile network number of the SIM card is an all-zero field, reading the first field in the management data request file, where the first field is used to indicate the user equipment operation mode of the SIM card; Modifying the data carried in the first field, and the data carried in the modified first field indicates that the SIM card is unavailable.
5. The method according to claim 1 or 4, characterized in that, The target field includes a second field, and modifying the target data of the SIM card includes: When the mobile network code of the public land mobile network number of the SIM card is an all-zero field, reading the second field in the management data request file, where the second field is used to indicate the closed user group accessible by the SIM card; Modifying the data carried in the second field, and the data carried in the modified second field indicates that the SIM card is unavailable.
6. A SIM card management device, characterized in that, The device includes: a modification module and an execution module; The modification module is used to modify the target data of the SIM card when the public land mobile network number of the SIM card in the electronic device is in the blacklist; The execution module is used to perform a network registration process based on the modified target data of the SIM card; Wherein, the target data includes the mobile network code of the SIM card, and the modified mobile network code does not conform to the preset mobile network code format; or, the target data includes the data carried in the target field of the management data request file of the SIM card, and the data carried in the modified target field indicates that the SIM card is unavailable.
7. The device according to claim 6, characterized in that, The target data includes the mobile network code of the SIM card. The modification module is specifically configured to: When the mobile network code is not an all-zero field, based on the length of the mobile network code, delete the last digit of the mobile network code or add one character to the mobile network code.
8. The device according to claim 7, characterized in that, The modification module is specifically configured to: When the length of the mobile network code is 3, delete the last digit of the mobile network code; or When the length of the mobile network code is 2, add the character '0' after the last digit of the mobile network code.
9. The device according to claim 6, characterized in that, The target field includes a first field. The modification module is specifically configured to: When the mobile network code of the public land mobile network number of the SIM card is an all-zero field, read the first field in the management data request file, where the first field is used to indicate the user equipment operation mode of the SIM card; Modify the data carried in the first field, and the data carried in the modified first field indicates that the SIM card is unavailable.
10. The device according to claim 6 or 9, characterized in that The target field includes a second field. The modification module is specifically configured to: When the mobile network code of the public land mobile network number of the SIM card is an all-zero field, read the second field in the management data request file, where the second field is used to indicate the closed user group accessible by the SIM card; Modify the data carried in the second field, and the data carried in the modified second field indicates that the SIM card is unavailable.
11. An electronic device, characterized in that, It includes a processor and a memory. The memory stores a program or instructions that can run on the processor. When the program or instructions are executed by the processor, the steps of the SIM card management method according to any one of claims 1 to 5 are implemented.