积分 511 最后登录 2023-12-5 精华 0 阅读权限 40 主题 40 UID 238902 帖子 452 PB币 1147 威望 55 贡献 0 技术 26 活跃 299
折腾无限
UID 238902 帖子 452 PB币 1147 贡献 0 技术 26 活跃 299
本帖最后由 thelittlefox 于 2022-4-11 15:21 编辑
20220411编辑:
Monterey中蓝牙协议栈有比较大的变化,原教程内容不适用于Monterey。
Monterey中BLE设备蓝牙同步可以使用Hackintool3.8.5,在macOS下导出注册表文件。然后在win中导入注册表文件。
在windows中配对BLE蓝牙设备,然后到macOS下配对蓝牙设备,保持蓝牙为开启状态,断开已经连接的蓝牙设备。
必须断开已经连接的蓝牙设备,否则无法导出reg文件。
导出的reg文件将放置在macOS的桌面上。
拷贝到U盘中,重启到windows。使用psexec工具启动注册表工具,导入reg文件。重启windows,看BLE蓝牙设备是否正常工作。
经实验,BLE蓝牙罗技M590鼠标,导入reg文件后,重启后即可连接到windows,实现双系统蓝牙连接。
ikbc s200蓝牙键盘导入reg文件后仍然不能连接。
关闭windows蓝牙,关闭蓝牙键盘。
(需要注意,每一次连接,ikbc键盘的地址第6位会+1,有的设备是最后一位+1。比如第一次在windows下配对时地址为28ef42 7ece08,去mac下配对后地址会变为28ef43 7ece08.)
在整个注册表中搜索ikbc键盘的mac地址28ef42 7ece08。将搜索到的所有键名中的28ef42 7ece08改为28ef43 7ece08,很多处,都需要仔细修改。修改完后,重启windows。打开windows蓝牙和蓝牙键盘。
键盘即可以通过蓝牙进行连接。
鸣谢
AuroraWright:https://github.com/digitalbirdo/BT-LinkkeySync/issues/12
digitalbirdo:https://github.com/digitalbirdo/BT-LinkkeySync
jamyu: https://www.insanelymac.com/forum/topic/318483-keep-bluetooth-devices-paired-once-between-macwindows/ Keep Bluetooth devices paired once between Mac/Windows
wp8student: https://bbs.pcbeta.com/viewthread-1760493-1-1.html [教程] 蓝牙鼠标(设备)自动连接多mac或者多win或者mac/win混合教程
xjzkp: https://bbs.pcbeta.com/viewthread-1789383-1-1.html 解决mac系统(high sierra)与Windows蓝牙鼠标共用问题(简单翻译)
Jamyu: https://bbs.pcbeta.com/forum.php? ... &page=1#pid48193483 MacOS、Windows、Linux蓝牙4.0鼠标共用配对 复制代码
0x00:系统及设备:
win10 1809
macOS 10.14.2 mojave
Logitech M585 Bluetooth4.0 BLE 复制代码
0x01:删除macOS下的蓝牙信息(注意:所有蓝牙配对信息将被清空)
sudo rm /private/var/root/Library/Preferences/com.apple.bluetoothd.plist
sudo rm /Library/Preferences/com.apple.Bluetooth.plist 复制代码
0x02:配对鼠标,并导出配对信息
在macOS下配对鼠标,并备份配对信息(主要是获取配对成功后的bluetoothd.plist,Bluetooth.plist作为修改模板)
在桌面上新建/mouse/AfterPaired文件夹
sudo cp /private/var/root/Library/Preferences/com.apple.bluetoothd.plist ~/Desktop/mouse/AfterPaired/
sudo cp /Library/Preferences/com.apple.Bluetooth.plist ~/Desktop/mouse/AfterPaired/ 复制代码
注意:此时鼠标的mac地址为:<e082ec5c e5a0>
重启到win10,在win10下配对鼠标。
psexec工具的使用详见上面的鸣谢列表
psexec -s -i \\127.0.0.1 regedit 复制代码
用psexec工具启动regedit,导出HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\{bluetooth adapter MAC}\{BLE device MAC} 到一个reg文件。
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\48d705c4730a\e082ec5ce5a1]
"LTK"=hex:2c,21,a6,81,62,b3,3f,16,b5,10,ed,ac,5a,12,09,dc
"KeyLength"=dword:00000000
"ERand"=hex(b):95,f8,1f,05,cb,fa,0b,78
"EDIV"=dword:0000043b
"IRK"=hex:76,d9,aa,05,2d,3b,db,e7,40,9d,59,a7,f9,94,f0,72
"Address"=hex(b):a1,e5,5c,ec,82,e0,00,00
"AddressType"=dword:00000001
"CSRK"=hex:27,82,02,83,53,b2,cf,9e,87,c8,48,bb,c4,c5,dc,a9
"OutboundSignCounter"=dword:00000000
"MasterIRKStatus"=dword:00000001
"AuthReq"=dword:0000002d 复制代码
此时鼠标的mac地址为:<e082ec5c e5a1> (比macOS下的地址多了1)
然后重启到macOS
0x03:使用Plist Edit Pro工具修改com.apple.bluetoothd.plist文件
注册表--->bluetoothd.plist,需要删除其中的逗号
键值 注册表 bluetoothd.plist
EDIV:需要转换顺序 dword:0000043b <3b04>
IRK:需要转换顺序 hex:76,d9,aa,05,2d,3b,db,e7,40,9d,59,a7,f9,94,f0,72 <72f094f9 a7599d40 e7db3b2d 05aad976>
LTK:顺序一样,直接拷贝 hex:2c,21,a6,81,62,b3,3f,16,b5,10,ed,ac,5a,12,09,dc <2c21a681 62b33f16 b510edac 5a1209dc>
RAND:顺序一样,直接拷贝 hex(b):95,f8,1f,05,cb,fa,0b,78 <95f81f05 cbfa0b78>
ADDRESS:去除末尾的00,00后,转换顺序 hex(b):a1,e5,5c,ec,82,e0,00,00 <e082ec5c e5a1>
修改后的部分内容如下:
"48-d7-05-c4-73-0a" = {
"e0-82-ec-5c-e5-a1" = {
Address = <e082ec5c e5a1>;
AddressType = 1;
EDIV = <3b04>;
IRK = <72f094f9 a7599d40 e7db3b2d 05aad976>;
LTK = <2c21a681 62b33f16 b510edac 5a1209dc>;
LTKLength = <10>;
MITMProtection = 0;
OriginalAddressType = 1;
RAND = <95f81f05 cbfa0b78>; 复制代码 保存。
0x04:修改bluetoothd.plist 使用Plist Edit Pro工具修改~/Desktop/mouse/AfterPaired/中的com.apple.bluetoothd.plist
将文件中所有的原mac地址 e082ec5c e5a0 替换为新mac地址 e082ec5c e5a1,保存。
0x05:替换系统文件
替换前关闭蓝牙!关闭蓝牙!关闭蓝牙!
确认文件权限600,所有者root:wheel。
MBP:AfterPaired user$ ls -al ~/Desktop/mouse/AfterPaired 复制代码 sudo cp ~/Desktop/mouse/AfterPaired/com.apple.bluetoothd.plist /private/var/root/Library/Preferences/com.apple.bluetoothd.plist
sudo cp ~/Desktop/mouse/AfterPaired/com.apple.Bluetooth.plist /Library/Preferences/com.apple.Bluetooth.plist 复制代码 然后使用
sudo defaults read /private/var/root/Library/Preferences/com.apple.bluetoothd.plist
sudo defaults read /Library/Preferences/com.apple.Bluetooth.plist 复制代码 来确认文件内容是否正确。
0x06:分别重启至win10和mac,看鼠标是否已经连接。
需要注意的是 修改完成并替换的bluetoothd,Bluetooth文件需要多次确认内容正确。
目前遇到的问题是,在mac下修改完成,重启后,鼠标会不需要配对,自动连接到系统上。
但是查看bluetoothd.plist的时候,修改好的EDIV等值已经发生改变,看起来是mac系统连接鼠标的时候自动执行了一次配对。
1213update:
成功在两个系统下连接鼠标。
关键在于0x05步,替换两个文件之前确认下权限:600和文件所有者:root:wheel。
替换的时候关闭蓝牙!关闭蓝牙!关闭蓝牙!
有条件的坛友能否测试下这个方法,然后将您用的设备型号,系统版本,能否不再配对双系统直连回复到这个帖子下面?
展开阅读全文​