A method and device for installing a Kext driver in a macOS system device

By using the installation script in the macOS system to automatically query the security policy database and display a friendly prompt box, the problem of the lack of automatic prompts during the Kext driver installation process is solved, a user-friendly installation and update process is realized, and the normal use of the hardware device is ensured.

CN118916086BActive Publication Date: 2025-01-21FEITIAN TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411405212.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-01-21
Estimated Expiration
2044-10-10

AI Technical Summary

Technical Problem

In macOS system, the first loading of a third-party Kext driver requires the user to manually allow it, and the system fails to automatically pop up a friendly prompt box, causing the user to be unable to install or update the Kext driver normally, affecting the use of hardware devices.

Method used

Query the security policy database of the operating system through the installation script to determine whether there is an installation record of the Kext driver. When loading the Kext driver, it automatically creates and displays a friendly prompt box, asking the user to confirm and open the loading interface to complete the installation or update process.

Benefits of technology

A friendly prompt box automatically pops up in the macOS system. After the user confirms, the Kext driver can be successfully installed or updated. This solves the problem of unrecognized hardware devices and simplifies the installation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916086B_ABST
    Figure CN118916086B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for implementing Kext driver installation in macOS system equipment, and belongs to the field of information security. The technical solution of the present invention automatically pops up a friendly prompt box when installing Kext driver on macOS system equipment. After the user processes the friendly prompt box, when the operating system receives the loading interface instruction sent by the installation script, it automatically opens the blocking loading interface and prompts the user to click the "Allow" button. Only after the user confirms the permission can the installation of the Kext driver be completed and the hardware device (such as UKey) can be used normally, which solves the problem that the hardware device cannot be identified and the operating system has no prompt box, the user cannot know that the operation needs to be confirmed and allowed, and the Kext driver cannot be used after installation. There is no need for the user to manually search and select the Kext driver executable program, and the operation is simple and convenient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security, and in particular to a method and device for implementing installation of a Kext driver in a macOS system device. Background Art

[0002] Kext (full name: Kernel Extension) driver is a kernel extension in macOS system, which is used to expand the functions of the system or add support for hardware devices. With the security upgrade of macOS system, the first loading of third-party Kext driver must be manually allowed by the user, otherwise it cannot be used; however, in actual usage scenarios, when the Kext driver is installed for the first time, the macOS system does not pop up a friendly prompt box (prompting the user to set user preferences and remove the blocking loading option), so that the user cannot open the allow loading interface, which will cause the hardware device (such as UKey) to be unusable, or the operating system pops up a friendly prompt box and the user chooses to ignore and complete the installation, which will also cause the hardware device to be unusable; and when the operating system loads the Kext driver, the user must manually enter the recovery mode to change the security policy, and then manually check the kernel driver executable program, so that the kernel driver can be loaded and used normally. The installation process is complicated and inconvenient to use. Therefore, it is urgent to provide a simple and convenient implementation solution that can ensure the successful installation of the Kext driver and the normal use of hardware devices. Summary of the invention

[0003] The purpose of the present invention is to overcome the deficiencies of the prior art and to provide a method and device for installing a Kext driver in a macOS system device.

[0004] In a first aspect, an embodiment of the present invention provides a method for installing a Kext driver in a macOS system device, comprising:

[0005] Step S1: The installation script queries the security policy database built into the operating system to determine whether there is an installation record of the Kext driver in the security policy database. If yes, execute step S4; otherwise, execute step S2;

[0006] Step S2: the installation script sends a Kext driver loading instruction to the operating system and blocks and waits for the operating system to load the Kext driver;

[0007] Step S3: After the operating system loads the Kext driver, the installation script creates and displays a friendly prompt box, and displays a first guide in the friendly prompt box to prompt the user to confirm. When the installation script receives the user's confirmation information, it sends an instruction to open the loading interface to the operating system;

[0008] Step S4: the installation script obtains the first state and the second state from the security policy database, and determines the values ​​of the first state and the second state. If the values ​​of the first state and the second state are both the first data, step S5 is executed; if the value of the first state is the second data and the value of the second state is the third data, step S8 is executed; if the value of the first state is the first data and the value of the second state is the fourth data, step S10 is executed;

[0009] Step S5: the installation script sends a Kext driver loading instruction to the operating system and blocks and waits for the operating system to load the Kext driver;

[0010] Step S6: After the operating system loads the Kext driver, the installation script obtains the first state and the second state from the security policy database, and determines whether the value of the first state is the first data and the value of the second state is the fourth data. If yes, execute step S7, otherwise terminate;

[0011] Step S7: the installation script determines that the Kext driver has an update, creates and displays a friendly prompt box, displays a second guide message in the friendly prompt box to prompt the user to confirm, and when the installation script receives the user's confirmation information, sends an instruction to open the loading interface to the operating system;

[0012] Step S8: the installation script sends a Kext driver loading instruction to the operating system and blocks and waits for the operating system to load the Kext driver;

[0013] Step S9: After the operating system loads the Kext driver, the installation script creates and displays a friendly prompt box, and displays a third guide in the friendly prompt box to prompt the user to confirm. When the installation script receives the user's confirmation information, it sends an instruction to open the loading interface to the operating system;

[0014] Step S10: the installation script sends a Kext driver loading instruction to the operating system and blocks and waits for the operating system to load the Kext driver;

[0015] Step S11: After the operating system loads the Kext driver, the installation script creates and displays a friendly prompt box, and displays a second guide message in the friendly prompt box to prompt the user to confirm. When the installation script receives the user's confirmation information, it sends an open loading interface instruction to the operating system.

[0016] In a second aspect, an embodiment of the present invention further provides a device for implementing a Kext driver installation in a macOS system device, comprising:

[0017] A first query and judgment module is used to query the security policy database built into the operating system to determine whether there is an installation record of the Kext driver in the security policy database, and if so, trigger the acquisition and judgment module, otherwise trigger the first sending module;

[0018] The first sending module is used to send a Kext driver loading instruction to the operating system and block and wait for the operating system to load the Kext driver;

[0019] A first creation prompt sending module is used to create and display a friendly prompt box after the operating system loads the Kext driver, and display a first guide in the friendly prompt box to prompt the user to confirm, and when receiving the user's confirmation information, send an open loading interface instruction to the operating system;

[0020] The acquisition and judgment module is used to obtain the first state and the second state from the security policy database, and judge the values ​​of the first state and the second state. If the values ​​of the first state and the second state are both the first data, the second sending module is triggered; if the value of the first state is the second data and the value of the second state is the third data, the third sending module is triggered; if the value of the first state is the first data and the value of the second state is the fourth data, the fourth sending module is triggered;

[0021] The second sending module is used to send a Kext driver loading instruction to the operating system and block and wait for the operating system to load the Kext driver;

[0022] A second query judgment module is used to obtain the first state and the second state from the security policy database after the operating system loads the Kext driver, and judge whether the value of the first state is the first data and the value of the second state is the fourth data, and if so, trigger the second creation prompt sending module, otherwise end;

[0023] The second creation prompt sending module is used to determine whether the Kext driver has an update, create and display a friendly prompt box, display a second guide in the friendly prompt box to prompt the user to confirm, and when receiving the user's confirmation information, send an open loading interface instruction to the operating system;

[0024] The third sending module is used to send a Kext driver loading instruction to the operating system and block and wait for the operating system to load the Kext driver;

[0025] A third creation prompt sending module is used to create and display a friendly prompt box after the operating system loads the Kext driver, and display a third guide in the friendly prompt box to prompt the user to confirm, and when receiving the user's confirmation information, send an open loading interface instruction to the operating system;

[0026] The fourth sending module is used to send a Kext driver loading instruction to the operating system and block and wait for the operating system to load the Kext driver;

[0027] The fourth creation prompt sending module is used to create and display a friendly prompt box after the operating system loads the Kext driver, display a second guide in the friendly prompt box to prompt the user to confirm, and when the user's confirmation information is received, send an open loading interface instruction to the operating system.

[0028] In the third aspect, an embodiment of the present invention further provides an electronic device, which includes at least one processor, a memory, and instructions stored in the memory and executable by the at least one processor, and the at least one processor executes the instructions to implement a method for installing a Kext driver in the aforementioned macOS system device.

[0029] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which includes a computer program. When the computer program runs on an electronic device, the electronic device executes the implementation method of installing a Kext driver in the aforementioned macOS system device.

[0030] In the fifth aspect, an embodiment of the present invention further provides a chip system, including a chip, which is coupled to a memory and is used to execute a computer program stored in the memory to execute the implementation method of installing a Kext driver in the aforementioned macOS system device.

[0031] Compared with the prior art, the present invention has the following advantages: the technical solution of the present invention will automatically pop up a friendly prompt box when installing or updating the Kext driver on a macOS system device. After the user processes the friendly prompt box, the operating system will automatically open the blocking loading interface when it receives the open loading interface instruction sent by the installation script and prompt the user to click the "Allow" button. Only after the user confirms the permission can the installation or update of the Kext driver be completed and the hardware device (such as UKey) can be used normally. This solves the problem that the hardware device cannot be recognized and the operating system has no prompt box, and the user cannot know that the operation needs to be confirmed and allowed, and the Kext driver cannot be installed or updated but cannot be used. The operation is simple and convenient. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 A flowchart of a method for installing a Kext driver in a macOS system device provided in Embodiment 1 of the present invention;

[0033] Figure 2-Figure 5 A flowchart of a method for installing a Kext driver in a macOS system device provided in Embodiment 2 of the present invention;

[0034] Figure 6 A block diagram of an implementation device for installing a Kext driver in a macOS system device provided in Example 3 of the present invention. DETAILED DESCRIPTION

[0035] The present application proposes a method and device for installing a Kext driver in a macOS system device. The specific implementation method of the present application is described in detail below in conjunction with the accompanying drawings. Examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.

[0036] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.

[0037] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings.

[0038] Embodiment 1

[0039] Embodiment 1 of the present invention provides a method for installing a Kext driver in a macOS system device, such as Figure 1 As shown, including:

[0040] Step S1: The installation script queries the security policy database built into the operating system to determine whether there is an installation record of the Kext driver in the security policy database. If yes, execute step S4; otherwise, execute step S2;

[0041] In this embodiment, before step S1, the following steps are also included: when the operating system receives the installation trigger information of the user, prompting the user to enter the user name and password, verifying the user identity according to the received user name and password entered by the user, and if the verification is successful, starting to execute the installation script and executing step S1, and if the verification fails, reporting an error;

[0042] Step S2: The installation script sends a Kext driver loading instruction to the operating system and blocks and waits for the operating system to load the Kext driver;

[0043] In this embodiment, after receiving the Kext driver loading instruction, the operating system executes step A1 and step A2;

[0044] Step A1: the operating system executes Kext driver loading, opens the security policy database, determines whether there is an installation record of the Kext driver in the policy table of the security policy database, and reports an error if yes, otherwise adds an installation record to the policy table of the security policy database, and sets the values ​​of the first state and the second state in the installation record to the second data and the third data respectively;

[0045] Step A2: The operating system generates a blocking message prompt and an "Allow" button under the General Functions module under the Security & Privacy module under System Preferences;

[0046] Step S3: After the operating system loads the Kext driver, the installation script creates and displays a friendly prompt box, and displays the first guide in the friendly prompt box to prompt the user to confirm. When the installation script receives the user's confirmation information, it sends an instruction to open the loading interface to the operating system;

[0047] In this embodiment, after step S3, the method further includes: when the operating system receives the instruction to open the loading interface, automatically opening the blocking loading interface, prompting the user whether to allow the Kext driver to load, and when receiving the user's permission information, modifying the values ​​of the first state and the second state in the security policy database to the first data;

[0048] When the values ​​of the first state and the second state are both the first data, it means that the Kext driver can be used normally;

[0049] Step S4: the installation script obtains the first state and the second state from the security policy database, determines the values ​​of the first state and the second state, and if the values ​​of the first state and the second state are both the first data, executes step S5; if the value of the first state is the second data and the value of the second state is the third data, executes step S8; if the value of the first state is the first data and the value of the second state is the fourth data, executes step S10;

[0050] Step S5: The installation script sends a Kext driver loading instruction to the operating system and blocks and waits for the operating system to load the Kext driver;

[0051] In this embodiment, between step S5 and step S6, the following steps are included: after the operating system receives the instruction to load the Kext driver, it executes step B1 to step B3;

[0052] Step B1: The operating system executes Kext driver loading and determines whether there is an installation record of the Kext driver in the policy table of the security policy database. If yes, execute step B2, otherwise end;

[0053] Step B2: The operating system determines whether the loaded Kext driver is a new version, if yes, executes step B3, otherwise ends;

[0054] Step B3: the operating system updates the value of the second state in the policy table of the security policy database to the fourth data;

[0055] Step S6: After the operating system loads the Kext driver, the installation script obtains the first state and the second state from the security policy database, and determines whether the value of the first state is the first data and the value of the second state is the fourth data. If yes, execute step S7, otherwise end;

[0056] Step S7: The installation script determines that the Kext driver has an update, creates and displays a friendly prompt box, displays a second guide in the friendly prompt box to prompt the user to confirm, and when the installation script receives the user's confirmation information, sends an instruction to open the loading interface to the operating system;

[0057] In this embodiment, after step S7, the method further includes: when the operating system receives the instruction to open the loading interface, automatically opening the blocking loading interface and prompting the user whether to allow the latest Kext driver to be loaded, and when receiving the user's permission information, modifying the value of the second state in the security policy database to the first data;

[0058] Step S8: The installation script sends a Kext driver loading instruction to the operating system and blocks and waits for the operating system to load the Kext driver;

[0059] In this embodiment, between step S8 and step S9, the following steps are included: after the operating system receives the instruction to load the Kext driver, steps C1 to C3 are executed;

[0060] Step C1: The operating system executes Kext driver loading and determines whether there is an installation record of the Kext driver in the policy table of the security policy database. If yes, execute step C2, otherwise end;

[0061] Step C2: The operating system obtains the corresponding first state and second state in the security policy database through the developer information of the Kext driver, and determines whether the values ​​of the obtained first state and second state are the second data and the third data. If yes, execute step C3, otherwise end;

[0062] Step C3: The operating system generates a blocking message prompt and an "Allow" button under the General Functions module under the Security & Privacy module in System Preferences;

[0063] Step S9: After the operating system loads the Kext driver, the installation script creates and displays a friendly prompt box, and displays a third guide in the friendly prompt box to prompt the user to confirm. When the installation script receives the user's confirmation information, it sends an instruction to open the loading interface to the operating system;

[0064] In this embodiment, after step S9, the method further includes: when the operating system receives the instruction to open the loading interface, automatically opening the blocking loading interface and prompting the user whether to allow the Kext driver to load, and when receiving the user's permission information, modifying the values ​​of the first state and the second state found in the security policy database to the first data;

[0065] Step S10: The installation script sends a Kext driver loading instruction to the operating system and blocks and waits for the operating system to load the Kext driver;

[0066] In this embodiment, between step S10 and step S11, the following steps are included: after the operating system receives the instruction to load the Kext driver, it executes step D1 to step D3;

[0067] Step D1: The operating system executes Kext driver loading and determines whether there is an installation record of the Kext driver in the policy table of the security policy database. If yes, execute step D2, otherwise end;

[0068] Step D2: The operating system determines whether the first state and the second state corresponding to the Kext driver are obtained in the security policy database through the developer information, and determines whether the values ​​of the obtained first state and the second state are the first data and the fourth data respectively. If yes, execute step D3, otherwise end;

[0069] Step D3: The operating system generates a blocking message prompt and an “Allow” button under the General Functions module under the Security and Privacy module under System Preferences;

[0070] Step S11: After the operating system loads the Kext driver, the installation script creates and displays a friendly prompt box, displays a second guide message in the friendly prompt box to prompt the user to confirm, and when the installation script receives the user's confirmation information, sends an instruction to open the loading interface to the operating system;

[0071] In this embodiment, step S11 also includes: when the operating system receives the instruction to open the loading interface, it automatically opens the blocking loading interface and prompts the user whether to allow the latest Kext driver to be loaded. When the user's permission information is received, the value of the second state found in the security policy database is modified to the first data.

[0072] The method of this embodiment will automatically pop up a friendly prompt box when installing or updating the Kext driver on a macOS system device. After the user processes the friendly prompt box, the operating system will automatically open the blocking loading interface when it receives the open loading interface instruction sent by the installation script and prompt the user to click the "Allow" button. Only after the user confirms and allows can the installation or update of the Kext driver be completed and the hardware device (such as UKey) can be used normally. This solves the problem of hardware device unrecognition and the operating system having no prompt box. The user cannot know that they need to confirm and allow the operation, and the Kext driver cannot be installed or updated but cannot be used. The operation is simple and convenient.

[0073] Embodiment 2

[0074] Embodiment 2 of the present invention provides a method for installing a Kext driver in a macOS system device, such as Figure 2-Figure 5 As shown, including:

[0075] Step 200: When the operating system receives the installation trigger information from the user, it prompts the user to enter a user name and password;

[0076] Step 201: When the operating system receives the user name and password input by the user, the user identity is verified according to the user name and password. If the verification is successful, step 202 is executed. If the verification fails, an error is reported.

[0077] In this embodiment, if the user identity authentication is successful, the sudo permission is obtained;

[0078] Step 202: The operating system starts executing the installation script;

[0079] Step 203: The installation script queries the entire policy database;

[0080] The command for querying the security policy database is: count=$(sudo sqlite3 / var / db / SystemPolicyConfiguration / KextPolicy “select count(*) from Kext_policy wheretema_id='S47T4UESP3'and bundle_id='com.ftsafe.iokit.ftscsi'and developer_name='FEITIAN Technologies Co.,Ltd.'”);

[0081] Step 204: The installation script determines whether there is an installation record of the Kext driver in the security policy database. If yes, execute step 210; otherwise, execute step 205;

[0082] In this embodiment, step 204 includes: determining whether the team_id, bundle_id and developer_name of the Kext driver exist in the Kext_policy table of the security policy database, if yes, executing step 210, otherwise executing step 205;

[0083] Step 205: The installation script sends a Kext driver loading instruction to the operating system and blocks and waits for the operating system to load the Kext driver;

[0084] The Kext driver loading instruction in this embodiment is: sudo Kextload / Library / Extensions / FTSIP_SCSI.Kext;

[0085] In this embodiment, blocking waiting means that before the call result is returned, the installation script thread will be suspended until the result of the operating system loading the Kext driver is obtained.

[0086] When the operating system receives the instruction to load the Kext driver, step A1 is executed;

[0087] Step A1: the operating system executes Kext driver loading, opens the security policy database, and determines whether the Kext driver has an installation record in the policy table of the security policy database. If yes, the process ends; otherwise, an installation record is added to the policy table, and the values ​​of the first state and the second state in the installation record are set as the second data and the third data respectively, and then executes step A2;

[0088] Specifically, determining whether the Kext driver has an installation record in the policy table of the security policy database includes: determining whether the team_id, bundle_id, and developer_name of the Kext driver exist in the Kext_policy table of the security policy database, if yes, there is an installation record, otherwise there is no installation record;

[0089] For example, the policy table is Kext_policy, the first state is allowed, and the second state is flags;

[0090] In this example, an installation record is added to the Kext_policy table: tema_id='S47T4UESP3'|bundle_id='com.ftsafe.iokit.ftscsi'|allowed='0'|developer_name='FEITIANTechnologies Co.,Ltd.'|flags=4;

[0091] The specific second data is 0, and the third data is 4;

[0092] Step A2: The operating system generates a blocking message prompt and an "Allow" button under the General Functions module under the Security & Privacy module under System Preferences;

[0093] Step 206: After the operating system loads the Kext driver, the installation script creates and displays a friendly prompt box, and displays the first guide in the friendly prompt box to prompt the user to confirm;

[0094] For example, the first introductory message in this embodiment is "This is the first time to install the Kext driver. You need to click "Allow" in the next pop-up window."

[0095] Step 207: When the installation script receives the user's confirmation information, it sends an instruction to open the loading interface to the operating system;

[0096] For example, in this embodiment, the instruction to open the loading interface is: open x-apple.systempreferences:com.apple.preference.security?General;

[0097] Step 208: When the operating system receives the instruction to open the loading interface, it automatically opens the blocking loading interface to prompt the user whether to allow the Kext driver to load;

[0098] In this embodiment, the operating system displays an "Allow" button, and the user can complete the approval of the kernel Kext driver loading by clicking the "Allow" button;

[0099] Step 209: The operating system determines whether the user's permission information is received. If yes, the values ​​of the first state and the second state in the security policy database are modified to the first data. Otherwise, the operation ends.

[0100] The first data in this embodiment is 1. When the values ​​of the first state and the second state are both 1, it indicates that the Kext driver can be used normally.

[0101] Step 210: The installation script obtains the first state and the second state from the security policy database, and determines the values ​​of the first state and the second state. If the values ​​of the first state and the second state are both the first data, step 211 is executed; if the value of the first state is the second data and the value of the second state is the third data, step 217 is executed; if the value of the first state is the first data and the value of the second state is the fourth data, step 223 is executed;

[0102] Specifically, the first data is 1, the second data is 0, the third data is 4, and the fourth data is 5;

[0103] Step 211: The installation script sends a Kext driver loading instruction to the operating system and blocks and waits for the operating system to load the Kext driver;

[0104] The Kext driver loading instruction in this embodiment is: sudo Kextload / Library / Extensions / FTSIP_SCSI.Kext;

[0105] In this embodiment, after step 211, when the operating system receives a Kext driver loading instruction, step B1 is executed;

[0106] Step B1: The operating system executes Kext driver loading and determines whether the Kext driver has an installation record in the policy table of the security policy database. If yes, execute step B2, otherwise end;

[0107] Specifically, determining whether the Kext driver has an installation record in the policy table of the security policy database includes: determining whether the team_id, bundle_id, and developer_name of the Kext driver exist in the Kext_policy table of the security policy database, if yes, there is an installation record, otherwise there is no installation record;

[0108] Step B2: The operating system determines whether the loaded Kext driver is a new version, if yes, executes step B3, otherwise ends;

[0109] Optionally, step B2 includes: the operating system determines whether the interface configuration information of the Kext driver (such as the content of the Info.plist file) has changed, if so, determines that the loaded Kext driver is a new version, and executes step B3; otherwise, determines that the loaded Kext driver is not a new version, and ends;

[0110] Step B3: the operating system updates the value of the second state in the policy table of the security policy database to the fourth data;

[0111] The fourth data in this embodiment is 5;

[0112] For example, the installation record before the update is: tema_id='S47T4UESP3'|bundle_id='com.ftsafe.iokit.ftscsi'|allowed='0'|developer_name='FEITIAN TechnologiesCo.,Ltd.'|flags=1, and the installation record after the update is: tema_id='S47T4UESP3'|bundle_id='com.ftsafe.iokit.ftscsi'|allowed='0'|developer_name='FEITIAN TechnologiesCo.,Ltd.'|flags=5;

[0113] Step B4: The operating system generates a blocking message prompt and an "Allow" button under the General Functions module under the Security and Privacy module under System Preferences;

[0114] Step 212: After the operating system loads the Kext driver, the installation script obtains the first state and the second state from the security policy database, and determines whether the value of the first state is the first data and the value of the second state is the fourth data. If yes, execute step 213, otherwise terminate;

[0115] In this example, the first state and the second state are obtained from the security policy database through an acquisition instruction, and the acquisition instruction is specifically:

[0116] The first state is allowed. The command to obtain the first state is: $(sudo sqlite3 / var / db / SystemPolicyConfiguration / KextPolicy "select allowed from Kext_policy wheretema_id='S47T4UESP3' and bundle_id='com.ftsafe.iokit.ftscsi' and developer_name='FEITIAN Technologies Co.,Ltd."); The second state is flags. The command to obtain the second state is: $(sudo sqlite3 / var / db / SystemPolicyConfiguration / KextPolicy "select flags fromKext_policy where tema_id='S47T4UESP3' and bundle_id='com.ftsafe.iokit.ftscsi' and developer_name='FEITIAN Technologies Co.,Ltd.");

[0117] In this embodiment, the value of the first state is the first data and the value of the second state is the fourth data, which indicates that the Kext driver is a new version;

[0118] Specifically, the fourth data is 5;

[0119] Step 213: The installation script determines that the Kext driver has an update, creates and displays a friendly prompt box, and displays a second guide in the friendly prompt box to prompt the user to confirm;

[0120] For example, the second guide in this embodiment is "The Kext driver has been updated, you need to click to allow in the next pop-up window";

[0121] Step 214: When the installation script receives the user's confirmation information, it sends an instruction to open the loading interface to the operating system;

[0122] Step 215: When the operating system receives the instruction to open the loading interface, it automatically opens the blocking loading interface and prompts the user whether to allow the latest Kext driver to load;

[0123] For example, in this embodiment, the instruction to open the loading interface is: open x-apple.systempreferences:com.apple.preference.security?General;

[0124] Step 216: The operating system determines whether the user's permission information is received, and if so, the value of the second state in the security policy database is modified to the first data, otherwise, the operation ends;

[0125] Step 217: The installation script sends a Kext driver loading instruction to the operating system and blocks and waits for the operating system to load the Kext driver;

[0126] The Kext driver loading instruction in this embodiment is: sudo Kextload / Library / Extensions / FTSIP_SCSI.Kext;

[0127] In this embodiment, after step 217, when the operating system receives a Kext driver loading instruction, step C1 is executed;

[0128] Step C1: The operating system executes Kext driver loading and determines whether the Kext driver has an installation record in the policy table of the security policy database. If yes, execute step C2, otherwise end;

[0129] Step C2: The operating system obtains the corresponding first state and second state in the security policy database through the developer information of the Kext driver, and determines whether the values ​​of the obtained first state and second state are the second data and the third data respectively. If yes, execute step C3, otherwise end;

[0130] In this embodiment, the developer information includes: team_id, bundle_id and developer_name;

[0131] Step C3: The operating system generates a blocking message prompt and an “Allow” button under the General Functions module under the Security and Privacy module under System Preferences;

[0132] In this embodiment, the user can complete the approval of Kext driver loading by clicking the "Allow" button;

[0133] Step 218: After the operating system loads the Kext driver, the installation script creates and displays a friendly prompt box, and displays a third guide in the friendly prompt box to prompt the user to confirm;

[0134] For example, the third guiding phrase in this embodiment is "The user has not approved the loading, and needs to click to allow in the next pop-up window";

[0135] Step 219: When the installation script receives the user's confirmation information, it sends an instruction to open the loading interface to the operating system;

[0136] For example, in this embodiment, the instruction to open the loading interface is: open x-apple.systempreferences:com.apple.preference.security?General;

[0137] Step 220: When the operating system receives the instruction to open the loading interface, it automatically opens the loading prevention interface and prompts the user whether to allow the Kext driver to load;

[0138] Step 221: The operating system determines whether the user's permission information is received. If yes, the values ​​of the first state and the second state found in the security policy database are modified to the first data. Otherwise, the operation ends.

[0139] Step 222: The installation script sends a Kext driver loading instruction to the operating system and blocks and waits for the operating system to load the Kext driver;

[0140] The Kext driver loading instruction in this embodiment is: sudo Kextload / Library / Extensions / FTSIP_SCSI.Kext;

[0141] In this embodiment, after step 222, when the operating system receives the instruction to load the Kext driver, step D1 is executed;

[0142] Step D1: The operating system executes Kext driver loading and determines whether the Kext driver has an installation record in the policy table of the security policy database. If yes, execute step D2, otherwise end;

[0143] Step D2: The operating system determines whether the first state and the second state corresponding to the Kext driver are obtained in the security policy database through the developer information, and determines whether the values ​​of the obtained first state and the second state are the first data and the fourth data respectively. If yes, execute step D3, otherwise end;

[0144] Step D3: The operating system generates a blocking message prompt and an “Allow” button under the General Functions module under the Security and Privacy module under System Preferences;

[0145] In this embodiment, the user can complete the approval of Kext driver loading by clicking the "Allow" button;

[0146] Step 223: After the operating system loads the Kext driver, the installation script creates and displays a friendly prompt box, and displays a second guide in the friendly prompt box to prompt the user to confirm;

[0147] For example, the second guide in this embodiment is "The Kext driver has been updated, you need to click to allow in the next pop-up window";

[0148] Step 224: When the installation script receives the user's confirmation information, it sends an instruction to open the loading interface to the operating system;

[0149] For example, in this embodiment, the instruction to open the loading interface is: open x-apple.systempreferences:com.apple.preference.security?General;

[0150] Step 225: When the operating system receives the instruction to open the loading interface, it automatically opens the blocking loading interface and prompts the user whether to allow the latest Kext driver to load;

[0151] Step 226: The operating system determines whether the user's permission information is received. If yes, the value of the second state found in the security policy database is modified to the first data. Otherwise, the process ends.

[0152] Embodiment 3

[0153] Embodiment 1 of the present invention provides a device for implementing a Kext driver in a macOS system device, such as Figure 6 As shown, including:

[0154] The first query and judgment module is used to query the security policy database built into the operating system to determine whether there is an installation record of the Kext driver in the security policy database, and if so, trigger the acquisition and judgment module, otherwise trigger the first sending module;

[0155] The first sending module is used to send a Kext driver loading instruction to the operating system and block and wait for the operating system to load the Kext driver;

[0156] The first creation prompt sending module is used to create and display a friendly prompt box after the operating system loads the Kext driver, and display a first guide in the friendly prompt box to prompt the user to confirm, and when receiving the user's confirmation information, send an open loading interface instruction to the operating system;

[0157] An acquisition and judgment module is used to obtain a first state and a second state from a security policy database, and judge the values ​​of the first state and the second state. If the values ​​of the first state and the second state are both first data, the second sending module is triggered; if the value of the first state is the second data and the value of the second state is the third data, the third sending module is triggered; if the value of the first state is the first data and the value of the second state is the fourth data, the fourth sending module is triggered;

[0158] The second sending module is used to send a Kext driver loading instruction to the operating system and block and wait for the operating system to load the Kext driver;

[0159] The second query judgment module is used to obtain the first state and the second state from the security policy database after the operating system loads the Kext driver, and judge whether the value of the first state is the first data and the value of the second state is the fourth data. If yes, the second creation prompt sending module is triggered, otherwise it ends;

[0160] The second creation prompt sending module is used to determine whether the Kext driver has an update, create and display a friendly prompt box, display a second guide in the friendly prompt box to prompt the user to confirm, and when receiving the user's confirmation information, send an open loading interface instruction to the operating system;

[0161] The third sending module is used to send a Kext driver loading instruction to the operating system and block and wait for the operating system to load the Kext driver;

[0162] The third creation prompt sending module is used to create and display a friendly prompt box after the operating system loads the Kext driver, and display a third guide in the friendly prompt box to prompt the user to confirm. When receiving the user's confirmation information, it sends an open loading interface instruction to the operating system;

[0163] A fourth sending module, used for sending a Kext driver loading instruction to the operating system and blocking and waiting for the operating system to load the Kext driver;

[0164] The fourth creation prompt sending module is used to create and display a friendly prompt box after the operating system loads the Kext driver, display a second guide in the friendly prompt box to prompt the user to confirm, and when receiving the user's confirmation information, send an open loading interface instruction to the operating system.

[0165] In this embodiment, the operating system's operating process when receiving the load Kext driver instruction sent by the first sending module, the second sending module, the third sending module and the fourth sending module is the same as that of Embodiment 1 and Embodiment 2, and will not be repeated here; the operating system's operating process when receiving the open loading interface instruction sent by the first creation prompt sending module, the second creation prompt sending module, the third creation prompt sending module and the fourth creation prompt sending module is the same as that of Embodiment 1 and Embodiment 2, and will not be repeated here.

[0166] Optionally, an embodiment of the present application further provides an electronic device, the electronic device comprising at least one processor, a memory, and instructions stored in the memory and executable by at least one processor, and at least one processor executes the instructions to implement the implementation method of installing a Kext driver in a macOS system device in the above embodiment. When the electronic device is a chip system, it can be composed of a chip, or it can include a chip and other discrete devices, which is not specifically limited in the embodiment of the present application; the chip is coupled to the memory, and is used to execute a computer program stored in the memory to execute the implementation method of installing a Kext driver in a macOS system device disclosed in the above embodiment.

[0167] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs. When a computer program is loaded and executed on an electronic device, the process or function described in the embodiment of the present application is generated in whole or in part. The computer program can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a base station, electronic device, server or data center to another base station, electronic device, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by an electronic device or a data storage device such as a server or data center that contains one or more media that can be integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc. In the embodiment of the present application, the electronic device may include the device described above.

[0168] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in a claim. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0169] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for installing a Kext driver in a macOS system device, characterized in that: include: Step S1: The installation script queries the security policy database built into the operating system to determine whether there is an installation record of the Kext driver in the security policy database. If yes, execute step S4; otherwise, execute step S2; Step S2: the installation script sends a Kext driver loading instruction to the operating system and blocks and waits for the operating system to load the Kext driver; Step S3: After the operating system loads the Kext driver, the installation script creates and displays a friendly prompt box, and displays a first guide in the friendly prompt box to prompt the user to confirm. When the installation script receives the user's confirmation information, it sends an instruction to open the loading interface to the operating system; Step S4: the installation script obtains the first state and the second state from the security policy database, and determines the values ​​of the first state and the second state. If the values ​​of the first state and the second state are both the first data, step S5 is executed; if the value of the first state is the second data and the value of the second state is the third data, step S8 is executed; if the value of the first state is the first data and the value of the second state is the fourth data, step S10 is executed; Step S5: the installation script sends a Kext driver loading instruction to the operating system and blocks and waits for the operating system to load the Kext driver; Step S6: After the operating system loads the Kext driver, the installation script obtains the first state and the second state from the security policy database, and determines whether the value of the first state is the first data and the value of the second state is the fourth data. If yes, execute step S7, otherwise terminate; Step S7: the installation script determines that the Kext driver has an update, creates and displays a friendly prompt box, displays a second guide message in the friendly prompt box to prompt the user to confirm, and when the installation script receives the user's confirmation information, sends an instruction to open the loading interface to the operating system; Step S8: the installation script sends a Kext driver loading instruction to the operating system and blocks and waits for the operating system to load the Kext driver; Step S9: After the operating system loads the Kext driver, the installation script creates and displays a friendly prompt box, and displays a third guide in the friendly prompt box to prompt the user to confirm. When the installation script receives the user's confirmation information, it sends an instruction to open the loading interface to the operating system; Step S10: the installation script sends a Kext driver loading instruction to the operating system and blocks and waits for the operating system to load the Kext driver; Step S11: After the operating system loads the Kext driver, the installation script creates and displays a friendly prompt box, and displays a second guide message in the friendly prompt box to prompt the user to confirm. When the installation script receives the user's confirmation information, it sends an open loading interface instruction to the operating system.

2. The method for installing a Kext driver in a macOS system device according to claim 1, wherein: Before step S1, the following steps are also included: When the operating system receives the user's installation trigger information, it prompts the user to enter a user name and password, and verifies the user identity based on the received user name and password. If the verification is successful, the installation script is executed and step S1 is executed. If the verification fails, an error is reported.

3. The method for installing a Kext driver in a macOS system device according to claim 1, wherein: The steps S2 and S3 also include: Step A1: After receiving the instruction to load the Kext driver, the operating system executes the Kext driver loading, opens the security policy database, and determines whether there is an installation record of the Kext driver in the policy table of the security policy database. If yes, an error is reported; otherwise, an installation record is added to the policy table of the security policy database, and the values ​​of the first state and the second state in the installation record are set as the second data and the third data respectively; Step A2: the operating system generates a blocking information prompt and an "Allow" button under the general function module under the security and privacy module under the system preferences; After step S3, it also includes: when the operating system receives the instruction to open the loading interface, it automatically opens the blocking loading interface, prompts the user whether to allow the Kext driver to load, and when the user's permission information is received, the values ​​of the first state and the second state in the security policy database are modified to the first data.

4. The method for installing a Kext driver in a macOS system device according to claim 1, wherein: The steps S5 and S6 also include: Step B1: After receiving the instruction to load the Kext driver, the operating system executes the Kext driver loading and determines whether there is an installation record of the Kext driver in the policy table of the security policy database. If yes, execute step B2, otherwise end; Step B2: The operating system determines whether the loaded Kext driver is a new version, if yes, executes step B3, otherwise ends; Step B3: the operating system updates the value of the second state in the policy table of the security policy database to fourth data; Step B4: the operating system generates a blocking information prompt and an "Allow" button under the general function module under the security and privacy module under the system preferences; After step S7, the method also includes: when the operating system receives the instruction to open the loading interface, it automatically opens the blocking loading interface and prompts the user whether to allow the latest Kext driver to be loaded, and when receiving the user's permission information, the value of the second state in the security policy database is modified to the first data.

5. The method for installing a Kext driver in a macOS system device according to claim 1, wherein: The step S8 and the step S9 also include: Step C1: After receiving the instruction to load the Kext driver, the operating system executes the Kext driver loading and determines whether there is an installation record of the Kext driver in the policy table of the security policy database. If yes, execute step C2, otherwise end; Step C2: the operating system obtains the corresponding first state and second state in the security policy database through the developer information of the Kext driver, and determines whether the obtained value of the first state and the obtained value of the second state are the second data and the third data respectively, if yes, executing step C3, otherwise ending; Step C3: the operating system generates a blocking information prompt and an "Allow" button under the general function module under the security and privacy module under the system preferences; After step S9, it also includes: when the operating system receives the instruction to open the loading interface, it automatically opens the blocking loading interface and prompts the user whether to allow the Kext driver to load. When the user's permission information is received, the values ​​of the first state and the second state found in the security policy database are modified to the first data.

6. The method for installing a Kext driver in a macOS system device according to claim 1, wherein: The step S10 and the step S11 further include: Step D1: After receiving the instruction to load the Kext driver, the operating system executes the Kext driver loading and determines whether there is an installation record of the Kext driver in the policy table of the security policy database. If yes, execute step D2, otherwise end; Step D2: The operating system determines whether the developer information of the Kext driver obtains the corresponding first state and second state in the security policy database, and determines whether the values ​​of the first state and the second state obtained are the first data and the fourth data respectively. If yes, step D3 is executed, otherwise the operation ends. Step D3: the operating system generates a blocking information prompt and an "Allow" button under the general function module under the security and privacy module under the system preferences; After step S11, it also includes: when the operating system receives the instruction to open the loading interface, it automatically opens the blocking loading interface and prompts the user whether to allow the latest Kext driver to be loaded. When the user's permission information is received, the value of the second state found in the security policy database is modified to the first data.

7. A device for installing a Kext driver in a macOS system device, characterized in that: include: A first query and judgment module is used to query the security policy database built into the operating system to determine whether there is an installation record of the Kext driver in the security policy database, and if so, trigger the acquisition and judgment module, otherwise trigger the first sending module; The first sending module is used to send a Kext driver loading instruction to the operating system and block and wait for the operating system to load the Kext driver; A first creation prompt sending module is used to create and display a friendly prompt box after the operating system loads the Kext driver, and display a first guide in the friendly prompt box to prompt the user to confirm, and when receiving the user's confirmation information, send an open loading interface instruction to the operating system; The acquisition and judgment module is used to obtain the first state and the second state from the security policy database, and judge the values ​​of the first state and the second state. If the values ​​of the first state and the second state are both the first data, the second sending module is triggered; if the value of the first state is the second data and the value of the second state is the third data, the third sending module is triggered; if the value of the first state is the first data and the value of the second state is the fourth data, the fourth sending module is triggered; The second sending module is used to send a Kext driver loading instruction to the operating system and block and wait for the operating system to load the Kext driver; A second query judgment module is used to obtain the first state and the second state from the security policy database after the operating system loads the Kext driver, and judge whether the value of the first state is the first data and the value of the second state is the fourth data, and if so, trigger the second creation prompt sending module, otherwise end; The second creation prompt sending module is used to determine whether the Kext driver has an update, create and display a friendly prompt box, display a second guide in the friendly prompt box to prompt the user to confirm, and when receiving the user's confirmation information, send an open loading interface instruction to the operating system; The third sending module is used to send a Kext driver loading instruction to the operating system and block and wait for the operating system to load the Kext driver; A third creation prompt sending module is used to create and display a friendly prompt box after the operating system loads the Kext driver, and display a third guide in the friendly prompt box to prompt the user to confirm, and when receiving the user's confirmation information, send an open loading interface instruction to the operating system; The fourth sending module is used to send a Kext driver loading instruction to the operating system and block and wait for the operating system to load the Kext driver; The fourth creation prompt sending module is used to create and display a friendly prompt box after the operating system loads the Kext driver, display a second guide in the friendly prompt box to prompt the user to confirm, and when the user's confirmation information is received, send an open loading interface instruction to the operating system.

8. An electronic device, characterized in that: The electronic device includes at least one processor, a memory, and instructions stored in the memory and executable by the at least one processor, and the at least one processor executes the instructions to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises a computer program, and when the computer program is executed on an electronic device, the electronic device is enabled to perform the method according to any one of claims 1 to 6.

10. A chip system, characterized in that: The invention comprises a chip, wherein the chip is coupled to a memory and is used to execute a computer program stored in the memory to execute the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Installation method and system of hardware equipment driver

    CN105159720A

  • Defense method and device for HID attack and computer equipment

    CN111859373A