Jump to content

Dual Boot Bluetooth Pairing Solved


camoguy
 Share

30 posts in this topic

Recommended Posts

  • 6 months later...
On 2016/11/21 at 3:36 AM, DigitalBird said:

For all who find this thread and are a bit lazy ;)

 

I've created a little python script, which creates a registry file, which can be imported using the regedit tool.

No need to manually do the byte-swapping.

https://github.com/digitalbirdo/BT-LinkkeySync

 

Works great with macOS Sierra 10.12.1 and Win 8.1 Prof and an Asus BT-400 Stick for old bluetooth devices.

 

But i can't get my Logitech MX Master to work which uses Bluetooth 4.0 LE/Smart.

I'll try to pair it on windows and import the keys on the OSX side. Maybe that will work. I'll keep you updated.

Great Work! But can not for  Bluetooth 4.0 LE/Smart. 

I'll try to pair my MiMouse (it's a Bluetooth 4.0 LE/Smart mouse) on windows 10 and import the keys on the Ubuntu & MacOS side, For day and day I  solved this problem!

You can use  Wireshark to capture & analysis Bluetooth data packets on each platform,now you can finder the answer.

For my platform is Windows 10+Ubuntu16.04+MacOS HighSierria。 For Bluetooth 4.0 LE/Smart mouse does not need  link key, The IRK LTK RAND EDIV Address Value data need. For different platforms the Value data may need convert。My paired keys config each platform list in below,You can use it as an example.

 

Config files:

==========================================================================================================================
Windows 10 Registry
==========================================================================================================================

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\c8ff2840fec4]
"18dc56001a6f"=hex:9f,63,4d,7f,83,58,a9,15,21,d9,07,85,e9,ef,31,48

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\c8ff2840fec4\ce995d228b53]
"LTK"=hex:5e,75,65,20,d4,27,da,d5,b8,fc,ec,b9,2d,60,e4,52
"KeyLength"=dword:00000000
"ERand"=hex(b):b2,41,8f,ac,43,e6,67,d2
"EDIV"=dword:000058ba
"IRK"=hex:b2,af,08,39,62,d8,99,69,49,ed,d9,6a,f8,ad,e7,4c
"Address"=hex(b):53,8b,22,5d,99,ce,00,00
"AddressType"=dword:00000001
"AuthReq"=dword:00000001

=============================================================================================================================
Linux /var/lib/blutooth/XX:XX:XX:XX:XX/XX:XX:XX:XX:XX/info
=============================================================================================================================
[General]
Name=MiMouse
Appearance=0x03c2
AddressType=static
SupportedTechnologies=LE;
Trusted=true
Blocked=false
Services=00001530-1212-efde-1523-785feabcd123;00001800-0000-1000-8000-00805f9b34fb;00001801-0000-1000-8000-00805f9b34fb;0000180a-0000-1000-8000-00805f9b34fb;0000180f-0000-1000-8000-00805f9b34fb;00001812-0000-1000-8000-00805f9b34fb;

[DeviceID]
Source=2
Vendor=10007
Product=64
Version=35

[IdentityResolvingKey]
Key=B2AF083962D8996949EDD96AF8ADE74C

[LongTermKey]
Key=5E756520D427DAD5B8FCECB92D60E452
Authenticated=0
EncSize=16
EDiv=22714
Rand=15161339848898331058

[ConnectionParameters]
MinInterval=6
MaxInterval=9
Latency=100
Timeout=600

=======================================================================================================
MacOS com.apple.bluetoothd.plist
=======================================================================================================
{
    "SMPCloudLocalPrivateKey" = <4edf5681 31d2e5e2 0fbe80a2 7d28bb57 ae6f395b 932dbad7 60bbd490 1464348e 56da0fff b0777a3a f96c4148 eed126c5 3a9f8c9e 36820b25 e2d6766b 719bd79c 20fe862d df67e763 b1a544f2 75394731 4508c726 d9cea622 e17fdf79 e0eeb082>;
    "MagicCloudPairingMasterHint" = <d4b84bee f7db21e8 9cffc1b7 8b6759d9>;
    SMPDistributionKeys = {
        "c8-ff-28-40-fe-c4" = {
            "ce-99-5d-22-8b-53" = {
                AddressType = 1;
                MITMProtection = NO;
                OriginalAddressType = 1;
                LTKLength = <10>;
                RAND = <b2418fac 43e667d2>;
                IRK = <4ce7adf8 6ad9ed49 6999d862 3908afb2>;
                Address = <ce995d22 8b53>;
                EDIV = <ba58>;
                LTK = <5e756520 d427dad5 b8fcecb9 2d60e452>;
            };
        };
    };
    SMPCloudLocalNonce = <d40e7747 ba393789 0da2933c 2ff11b17>;
    LinkKeys = {
        "c8-ff-28-40-fe-c4" = {
            "4c-74-bf-64-06-f3" = <b05de895 fe4aeb5b c2dba041 547bcc7b>;
            "d8-9a-34-29-b9-85" = <dd8e162b bc6676af f6590315 f0e48a31>;
            "30-22-23-01-e8-1f" = <56dd3519 d1519956 eb6ff5f3 c2bdc2f1>;
            "18-dc-56-00-1a-6f" = <a4d18428 e04d25a6 a5e236c7 53255653>;
        };
    };
    "MagicCloudPairingMasterKey" = <2d6445ca aaafa3c9 efa77256 a7e75dc9>;
    "SMPCloudLocalPublicKey" = <4edf5681 31d2e5e2 0fbe80a2 7d28bb57 ae6f395b 932dbad7 60bbd490 1464348e 56da0fff b0777a3a f96c4148 eed126c5 3a9f8c9e 36820b25 e2d6766b 719bd79c>;
}
 

 

 

Link to comment
Share on other sites

  • 2 months later...

Any way for this to function using 2 different bluetooth adapters?

 

On win10 I use the internal bluetooth adapter and on Sierra I use an external. 

 

Tried to simply put the reg keys in the proper adapter key in the registry, yet that didn't do it. Seems as though there could be a hash being made using the adapter's mac address or similar, so not sure if it's possible...yet if anybody recommends a functional workaround, I would CERTAINLY appreciate that. 

 

Thanks in advance! 

 

Link to comment
Share on other sites

  • 2 months later...
  • 2 years later...

I did it in another way

from Windows to Mac

 

cd "$(dirname "$0")"
rm /tmp/temp.plist  
/usr/libexec/PlistBuddy -c "Add LinkKeys dict"   /tmp/temp.plist
input=BTKeys.reg
while IFS= read -r line
do
if [[ "$line" == *'HKEY_LOCAL_MACHINE'* ]]
then
t=$(printf "%s" ${line} | awk -F \\ '{print $8}' | tr -d ']')
echo
echo "BT:"$t
/usr/libexec/PlistBuddy -c "Add LinkKeys:$t dict"   /tmp/temp.plist
fi

if [[ "$line" == *'=hex'* ]]
then
key=$(printf "%s" ${line} | awk -F '=' '{print $1}' | tr -d '"')
value=$(printf "%s" ${line} | awk -F ':' '{print $2}' | tr -d ',')
echo $key $value
printf $value | xxd -r -p > /tmp/bin
/usr/libexec/PlistBuddy -c "Import LinkKeys:$t:$key /tmp/bin" /tmp/temp.plist
plutil -convert binary1 /tmp/temp.plist
fi

done < "$input"
echo
mv /tmp/temp.plist ./blued.plist

 

Edited by Rodion2010
Link to comment
Share on other sites

 Share

×
×
  • Create New...