Skip to content

Instantly share code, notes, and snippets.

@Acephalia
Last active January 9, 2024 06:04
Show Gist options
  • Save Acephalia/52c4b07188561ba67beddb75d715b477 to your computer and use it in GitHub Desktop.
Save Acephalia/52c4b07188561ba67beddb75d715b477 to your computer and use it in GitHub Desktop.
Mac OSX Remove Disabled Extensions

Disclaimer: Before proceeding, be aware that modifying system files can potentially cause issues if done incorrectly. Follow the instructions carefully, and ensure you have a backup or recovery plan in case of any unintended consequences. This works on all silicone devices and the latest OS.

Open a terminal window:

cd /var/db/SystemPolicyConfiguration sudo sqlite3 KextPolicy

You'll see a sqlite> prompt. Type:

.tables

Identify the table containing the information related to disabled software; in this case, it should be "kext_policy."

Execute the following command to display the data in the identified table:

select * from kext_policy ;

You will see several items that look like:

X9BL5JJAZJ|com.wch.usbserial|0|Jiangsu Qinheng Co., Ltd.|20

Note down the entries you want to remove.

To exit sqlite3, type:

.quit

Boot into Recovery Mode (Shutdown and then hold down the power button till you see the recovery screen options).

In the Recovery Mode menus, choose Utilities -> Terminal.

Navigate to the sqlite3 binary in the Recovery Mode environment:

cd /Volumes/[start up disk]/usr/bin Run sqlite3 on the KextPolicy database:

./sqlite3 /Volumes/[start up disk]/var/db/SystemPolicyConfiguration/KextPolicy You should see the sqlite> prompt again. Confirm the disabled kexts:

If your start up disk is Macintosh HD with a space then use /Macintosh\ HD/

select * from kext_policy ;

Now you can delete an item using its Team_ID:

Example: For X9BL5JJAZJ|com.wch.usbserial|0|Jiangsu Qinheng Co., Ltd.|20

Run: delete from kext_policy where Team_ID = 'X9BL5JJAZJ' ; Repeat the select command to confirm the item is removed.

If there is no Team_ID you can use the like syntax

delete from kext_policy where Bundle_ID like '%Jiangsu Qinheng Co.%' ;

Type .quit to exit sqlite3, reboot your system, and check the Disabled Software report to confirm the removal of the items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment