Skip to content

Instantly share code, notes, and snippets.

@Shourai
Last active March 29, 2017 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shourai/e0ab9c49e374fd85bb44970e5211775d to your computer and use it in GitHub Desktop.
Save Shourai/e0ab9c49e374fd85bb44970e5211775d to your computer and use it in GitHub Desktop.
Nightshift on unsupported macs
This was written by Ryanmcv over at https://pikeralpha.wordpress.com/2017/01/30/4398/comment-page-1/#comment-9146
1. Disable System Integrity Protection by booting into Recovery mode (hold down Command + R during boot-up), opening Terminal, and typing csrutil disable
2. Restart your Mac and open Finder. Navigate to System/Library/PrivateFrameworks/
Make a copy of the entire CoreBrightness.framework folder (save it to your desktop or a similar place).
3. In Xcode, open the copy of CoreBrightness.framework that you just created. File > Open; Browse to where you just saved CoreBrightness.framework; from within that .framework folder, choose the CoreBrightness icon at the top that looks like a shortcut.
4. In Xcode, press Shift + Command + J on your keyboard. A navigation column will appear on the left-hand side. Secondary/right-click CoreBrightness at the top of that column and choose Open As > Hex.
5. Once the hex code appears, press Command + F to open the Find tool. Search for the following: 09 00 00 00 0d 00 00 00 06 00 00 00 05 00 00 00 06 00 00 00 08 00 00 00
These numbers tell the system which Mac models can used Night Shift.
MacBookPro9,x = “09” in the above hex bits
iMac13,x = “0d”
Macmini6,x = “06”
MacBookAir5,x = “05”
MacPro6,x = second “06”
MacBook8,x = “08”
6. In my case, I needed to allow my early 2011 MacBook Pro (MacBookPro8,2) to use Night Shift. So, in Xcode, I changed “09” in the original hex string to 08. You will need to find the exact model number of your Mac and make the adjustment in Xcode accordingly.
6. Save the file in Xcode (File > Save) and exit. Copy your newly-edited CoreBrightness.framework folder over the existing one in System/Library/PrivateFrameworks/
7. Open Terminal and re-sign the new binary by pasting in this command:
sudo codesign -f -s - /S*/L*/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness
8. Boot back into Recovery mode and re-enable System Integrity Protection (open Terminal and type csrutil enable).
9. Restart your Mac, open System Preferences > Displays, and you should see the Night Shift tab.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment