question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support key sync from Windows to MacOS

See original GitHub issue

I just did this manually and it was pretty straightforward.

From a paired device in Windows 10 (the Bose 700s, which interestingly support LE but were not paired by LE), I exported the link key data, changed the endianness to MacOS, then replaced this in the Mojave /private/var/root/Library/Preferences/com.apple.bluetoothd.plist (I used a hex editor to find and replace the existing paired key with Windows’).

The only gotcha was that I had to not only disable Bluetooth before modifying the plist file, but also perform a system reboot before starting Bluetooth again. Otherwise, something was reverting the key change to the plist file. I tried to see if I could figure out which specific service was doing this but didn’t have any luck.

I appreciate that perhaps replacing the key on Windows is easier than the above but wanted to share that it is indeed possible nevertheless.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:14

github_iconTop GitHub Comments

1reaction
roddy20commented, Jan 14, 2021

Right. You still need both values - the MAC in order to know which key to update on the other OS.

Ok here it is without sed maybe it will be better `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 `

0reactions
roddy20commented, Jan 17, 2021

and one more script for those who has a lot of different macOSes installed `if [[ $EUID -ne 0 ]]; then echo “This script must be run as root” exit 1 fi

if [[ -f “/private/var/root/Library/Preferences/com.apple.bluetoothd.plist” ]] then source=“/private/var/root/Library/Preferences/com.apple.bluetoothd.plist” fi

if [[ -f “/private/var/root/Library/Preferences/blued.plist” ]] then source=“/private/var/root/Library/Preferences/blued.plist” fi

if [[ $source ]] then defaults read $source else echo “File not found” exit fi

for s in /Volumes/*/private/var/root/Library/Preferences do

if [[ -f “$s/com.apple.bluetoothd.plist” ]] then target=“$s/com.apple.bluetoothd.plist” fi

if [[ -f “$s/blued.plist” ]] then target=“$s/blued.plist” fi

cp -v “${source}” “${target}”

done`

Read more comments on GitHub >

github_iconTop Results From Across the Web

Move your data from a Windows PC to a Mac - Apple Support
On your Mac · Open Migration Assistant, which is in the Utilities folder of your Applications folder. · Follow the onscreen instructions until...
Read more >
How to transfer your data from a Windows PC to a Mac using ...
How to transfer your data from a Windows PC to a Mac using Migration Assistant | Apple Support · Key moments. View all...
Read more >
Sync files with OneDrive on Mac OS X - Microsoft Support
If you're on OSX 10.10 or higher, get sync status directly from Finder by enabling Finder overlays in Settings. First, click the Apple...
Read more >
How to Switch from Mac to Windows PC - Intel
Make sure that the service is configured to sync the desired folders. Check that the syncing process is up to date. Then install...
Read more >
Using Box Drive Basics - Box Support
Icons in Windows and Mac kernel-based mode; Icons in Mac File ... it's important to uninstall Box Sync before you install Box Drive....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found