From 67ab785b9031af1328fd0a2d5e52311654f5bef1 Mon Sep 17 00:00:00 2001 From: laobamac Date: Fri, 3 Apr 2026 23:31:29 +0800 Subject: [PATCH 1/4] Add USBMap.kext support for macOS Tahoe. --- Scripts/shared.py | 2 +- base.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Scripts/shared.py b/Scripts/shared.py index 6376417..5fd1531 100644 --- a/Scripts/shared.py +++ b/Scripts/shared.py @@ -7,7 +7,7 @@ from Scripts._build import BUILD -VERSION = "0.2" +VERSION = "0.3" if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"): current_dir = Path(sys.executable).parent diff --git a/base.py b/base.py index 65b6312..15b2b4c 100644 --- a/base.py +++ b/base.py @@ -607,7 +607,9 @@ def build_kext(self): personality["IOProviderMergeProperties"]["ports"][port_name] = { "port": binascii.a2b_hex(hexswap(hex(port["index"])[2:].zfill(8))), + "usb-port-number": binascii.a2b_hex(hexswap(hex(port["index"])[2:].zfill(8))), "UsbConnector": port["type"] or port["guessed"], + "usb-port-type": port["type"] or port["guessed"], } if self.settings["add_comments_to_map"] and port["comment"]: @@ -695,4 +697,4 @@ def monu(self): response = menu.start() self.on_quit() - self.utils.custom_quit() + self.utils.custom_quit() \ No newline at end of file From e4feaa0ff2675b5e72cb7f7c7aa2dda6e523b066 Mon Sep 17 00:00:00 2001 From: laobamac <107761278+laobamac@users.noreply.github.com> Date: Sat, 2 May 2026 20:40:41 +0800 Subject: [PATCH 2/4] Allow drag config.plist to auto-detect PI --- base.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/base.py b/base.py index 15b2b4c..2d84130 100644 --- a/base.py +++ b/base.py @@ -532,14 +532,25 @@ def build_kext(self): ]["_items"][0]["machine_model"] else: model_menu = utils.TUIOnlyPrint( - "Enter Model Identifier", - "Enter the model identifier: ", + "Enter Model Identifier or config.plist", + "Enter the model identifier or drag config.plist here: ", [ "You are seeing this as you have selected to use native classes. Model identifier autodetection is unavailable as you are not on macOS.", - "Please enter the model identifier of the target system below. You can find it in System Information or with 'system_profiler -detailLevel mini SPHardwareDataType'.", + "Please enter the model identifier of the target system, or drag your config.plist here to auto-detect it.", ], ).start() - model_identifier = model_menu.strip() + user_input = model_menu.strip().strip('"').strip("'") + + if Path(user_input).is_file() and user_input.lower().endswith(".plist"): + try: + plist_data = plistlib.load(open(user_input, "rb")) + model_identifier = plist_data.get("PlatformInfo", {}).get("Generic", {}).get("SystemProductName", "") + if not model_identifier: + model_identifier = input("SystemProductName not found. Enter manually: ").strip() + except Exception: + model_identifier = input("Failed to parse config.plist. Enter manually: ").strip() + else: + model_identifier = user_input ignore = response == "I" @@ -697,4 +708,4 @@ def monu(self): response = menu.start() self.on_quit() - self.utils.custom_quit() \ No newline at end of file + self.utils.custom_quit() From cb8320ea45e511517549c70d2faa9386fc9cd7ec Mon Sep 17 00:00:00 2001 From: laobamac <107761278+laobamac@users.noreply.github.com> Date: Sat, 2 May 2026 20:41:01 +0800 Subject: [PATCH 3/4] Update version to 0.3.1 in shared.py --- Scripts/shared.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/shared.py b/Scripts/shared.py index 5fd1531..18ed0be 100644 --- a/Scripts/shared.py +++ b/Scripts/shared.py @@ -7,7 +7,7 @@ from Scripts._build import BUILD -VERSION = "0.3" +VERSION = "0.3.1" if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"): current_dir = Path(sys.executable).parent From c66549451777a9993a029abb8bdb057c30f4efc8 Mon Sep 17 00:00:00 2001 From: laobamac <107761278+laobamac@users.noreply.github.com> Date: Sat, 2 May 2026 20:42:37 +0800 Subject: [PATCH 4/4] Create main.yml --- .github/workflows/main.yml | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..11b3963 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,40 @@ +name: Build Windows + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: 'pip' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pyinstaller + pip install -r requirements.txt + + - name: Build with PyInstaller + run: | + pyinstaller spec/Windows.spec + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: USBToolBox-Windows + path: dist/Windows.exe