mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-21 22:50:51 +10:00
device_probe.py: Add handling for T1s in DFU mode
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
## 1.2.0
|
## 1.2.0
|
||||||
- Resolve application not existing if user dismisses an update instead of installing
|
- Resolve application not existing if user dismisses an update instead of installing
|
||||||
|
- Add support for detecting T1 Security Chips in DFU mode
|
||||||
|
|
||||||
## 1.1.0
|
## 1.1.0
|
||||||
- Resolve rendering issues on Intel Broadwell iGPUs
|
- Resolve rendering issues on Intel Broadwell iGPUs
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class USBDevice:
|
|||||||
device_speed: int
|
device_speed: int
|
||||||
product_name: str
|
product_name: str
|
||||||
vendor_name: Optional[str] = None
|
vendor_name: Optional[str] = None
|
||||||
|
serial_number: Optional[str] = None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_ioregistry(cls, entry: ioreg.io_registry_entry_t):
|
def from_ioregistry(cls, entry: ioreg.io_registry_entry_t):
|
||||||
@@ -44,6 +45,7 @@ class USBDevice:
|
|||||||
device_class = None
|
device_class = None
|
||||||
device_speed = None
|
device_speed = None
|
||||||
vendor_name = None
|
vendor_name = None
|
||||||
|
serial_number = None
|
||||||
product_name = "N/A"
|
product_name = "N/A"
|
||||||
|
|
||||||
if "idVendor" in properties:
|
if "idVendor" in properties:
|
||||||
@@ -58,8 +60,10 @@ class USBDevice:
|
|||||||
vendor_name = properties["kUSBVendorString"].strip()
|
vendor_name = properties["kUSBVendorString"].strip()
|
||||||
if "USBSpeed" in properties:
|
if "USBSpeed" in properties:
|
||||||
device_speed = properties["USBSpeed"]
|
device_speed = properties["USBSpeed"]
|
||||||
|
if "kUSBSerialNumberString" in properties:
|
||||||
|
serial_number = properties["kUSBSerialNumberString"].strip()
|
||||||
|
|
||||||
return cls(vendor_id, device_id, device_class, device_speed, product_name, vendor_name)
|
return cls(vendor_id, device_id, device_class, device_speed, product_name, vendor_name, serial_number)
|
||||||
|
|
||||||
|
|
||||||
def detect(self):
|
def detect(self):
|
||||||
@@ -945,7 +949,29 @@ class Computer:
|
|||||||
for usb_device in self.usb_devices:
|
for usb_device in self.usb_devices:
|
||||||
if usb_device.vendor_id != 0x5ac:
|
if usb_device.vendor_id != 0x5ac:
|
||||||
continue
|
continue
|
||||||
if usb_device.device_id != 0x8600:
|
# Standard T1
|
||||||
|
if usb_device.device_id == 0x8600:
|
||||||
|
self.t1_chip = True
|
||||||
|
break
|
||||||
|
# T1 in DFU mode
|
||||||
|
# Note all Apple devices report the same device ID in DFU mode
|
||||||
|
if usb_device.device_id == 0x1281:
|
||||||
|
# Break down serial number into components
|
||||||
|
# ex. "CPID:8002 CPRV:10 CPFM:03 SCEP:01 BDID:12 ECID:000E5C8E34600026 IBFL:3D"
|
||||||
|
# Is this overcomplicating T1 detection? Probably...
|
||||||
|
if usb_device.serial_number is None:
|
||||||
|
continue
|
||||||
|
serial_number = usb_device.serial_number.split(" ")
|
||||||
|
# T1s come in 2 known flavours:
|
||||||
|
# - x619dev
|
||||||
|
# - CPID: 0x8002
|
||||||
|
# - BDID: 0x13
|
||||||
|
# - x619ap
|
||||||
|
# - CPID: 0x8002
|
||||||
|
# - BDID: 0x12
|
||||||
|
if "CPID:8002" not in serial_number:
|
||||||
|
continue
|
||||||
|
if "BDID:13" not in serial_number and "BDID:12" not in serial_number:
|
||||||
continue
|
continue
|
||||||
self.t1_chip = True
|
self.t1_chip = True
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user