Supported Mac models for Night Shift in Sierra 10.12.4

Night Shift was introduced in macOS Sierra 10.12.4 (Build 16E144f and Public Beta-1) and is controlled by the CoreBrightness.framework and you’ll need at least one of the following – or later – Mac models:

MacBookPro9,x
iMac13,x
Macmini6,x
MacBookAir5,x
MacPro6,x
MacBook8,x

Apple did not release any information about this. Not just yet, but I know this because I located the checks for it in said framework, and there it checks for matching Mac model names:

MacBookPro
iMac
Macmini
MacBookAir
MacPro
MacBook

Night Shift is however not supported – by Apple – on older Mac models. No. There are checks for minimum requirements, which I looked up with help of:

nm /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness|grep _ModelMinVersion

000000000001d490 S _ModelMinVersion

Ok. Now we know the offset. Time to dump the data with help of:

xxd -s 0x1D490 -l 24 /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness

0001d490: 0900 0000 0d00 0000 0600 0000 0500 0000
0001d4a0: 0600 0000 0800 0000

MacBookPro9,x
iMac13,x
Macmini6,x
MacBookAir5,x
MacPro6,x
MacBook8,x

Now you know how I did it, and in case you happen to own a Mac model that isn’t supported, yet, then you could try to patch the matching value in CoreBrightness.framework as some readers confirmed that it is working for them with older/unsupported hardware. The colors that I used should help you to find the byte that you need to change.

Anyway. This my friends is how it is done. Have fun now.

Edit: The order of the MacBook Pro and iMac was wrong – see comments. Fixed thanks to the heads up from Thomas and Nicolinux.

Update: You need to re-sign the patched framework binary with:
sudo codesign -f -s - /S*/L*/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness

Note: You may only use this patch in your script/software/app if the source code is available, preferable on Github, you are not asking for donations, and clearly state that this is my work. Thank you.

Advertisements

52 thoughts on “Supported Mac models for Night Shift in Sierra 10.12.4

  1. Thanks for this !

    I think iMac and MacBook Pro are wrong though. I tried, Night Shift does not work on an iMac from 2011 (iMac12,1) and it does work on a 2012 MacBook Pro (MacBookPro10,1).

    My guess is it’s the other way around : iMac13,x and MacBookPro9,x. Could you check, please ?

  2. Pingback: macOS Sierra 10.12.4で追加される新機能「Night Shift」は2012以降に製造されたMacでのみ利用可能? | AAPL Ch.

  3. Pingback: macOS Night Shift: Das sind die unterstützten Geräte | iTopnews

  4. Fine information – but due to codesigning with any attempt to patch CoreBrightness my monitor control panel “crashes” (quits execution due to codesigning mismatch). Is there a way around this?

  5. Interesting post. I prefer using flux but it’s cool to see these native features getting patched out to everyone else.

  6. Regarding the patch : wouldn’t it be simpler (or at least more generic) to patch the function which check the version of the system, instead of the array (used by this function) ?

    By example, by replacing first bytes of CBU_IsNightShiftSupported with :
    48C7C001000000 // mov rax, 0x1
    C3 // ret

    Anyway, thank you for this post, it’s interesting (and seem to confirm it’s an artificial limit from Apple – is it even legal ?).

  7. so what exactly are you meant to do, i can enter the first and second terminal commands and see the list of numbers indicating the various mac models but what do i do next.
    i am on a Mac Pro 3.1 so i do i get that identified by night shift?

    • 1.) Backup the original binary.
      2.) Copy the binary to ~/
      3.) Open the binary in a hex editor and search for 09 00 00 00 0d 00 00 00 06 00 00 00 05 00 00 00 06 00 00 00 08 00 00 00
      4.) Change the last 6 into a 3 (for the Mac Pro).
      5.) Save the file.
      6.) Copy the patched file over the original one.
      7.) Run sudo codesign (see blog) to sign it.

      Note: Always keep a secondary boot option available. Just in case you run into trouble. I’m not responsible for trouble. If the steps are too difficult for you, then don’t go there.

  8. Ok so have opened the binary in a hex editor and changed the second instance of 06 00 to 03 00 for the Mac Pro. Now have saved the file, but can you just explain what you mean by copy the patched file over the original one.

  9. Right, now got Night Shift on MacPro 3.1 nVidea GT120 and 23″ Cinema Display.

    needed to chmod +x to new core brightness file and replace over existing core brightness exec.

    Thank You

  10. When I try to run “codesign”, I receive the following error message :
    /System/Library/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness: replacing existing signature
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    /System/Library/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness: the codesign_allocate helper tool cannot be found or used
    Any idea of what to do?
    Thanks in advance!

  11. Night Shift with iMac 15.1, works natively ..
    MacBookPro 8.1 I change 09 00 0000 0d….. with 08 00 0000 0d… now perfect work
    Thanks Pike!

  12. Now that Dev Beta 3 has been released the result of the minimum version search is now
    000000000001d470 S _ModelMinVersion

    and the next terminal entry should now be
    xxd -s 0x1D470 -l 24 /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness
    so when searching in the binary code the line you are looking for is 1d470
    change to your model as described above
    and remember to re-sign the patched binary

    • Interestingly, it´s possible to use the old patched corebrightness file(s) from beta 2 now with the beta 3, also no need to sign again then. (I did this on three machines without any side effects).

  13. Slightly off-topic: Has anyone noticed a dramatic performance/speed drop from 10.12.3 to 10.12.4 on old machines like i.e. the MacBook Pro 4,1 series?
    I have a couple of such machines and tried to update to beta-2 or the current beta-3. My impression is (and benchmarks seem to show) that something regarding the correct speed-stepping is gone sour in the 10.12.4 releases. Machines that had a geebench 2 (64bit) score of around 2100 went all down to mere 1250. Measurements have been repeated and I made sure that nothing else hogs the CPU. The machines are so slow that I had to revert back to 10.12.3.

    Pike to the rescue? What could I do to check further (most hackintosh related tools that I know of stopped working on El Cap and Sierra).

    Just another hint: On the sluggishly slow machines, the CPU temperatures stay low (in the range of 48 to 60°C – whereas normally I encountered 80 to 90°C there)

    • Finally, with the beta 6 of 10.12.4 things (in terms of speed & speedstepping) on old unsupported C2D machines are back to normal, i.e. my 17″ 2008 MBP is back to around 3700 geekbench 2 score.

  14. Thanks Dave!

    Now that Dev Beta 4 has been released the result of the minimum version search is now
    000000000001e260 S _ModelMinVersion

    and the next terminal entry should now be
    xxd -s 0x1E260 -l 24 /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness
    so when searching in the binary code the line you are looking for is 1e260
    change to your model as described above
    and remember to re-sign the patched binary

  15. Hello Guys
    Sorry for my noobiness!! But can someone upload a video doing that? I have a macbook pro early 2011. This was a feature i was looking for and…you know the rest!

  16. Anybody confirmed working on Mac Pro 5,1? I have a Mid 2012 Dual 3.06GHz processors with an AMD Radeon HD 7950 (Mac Edition) 3GB graphics card and 27″ Apple LED Cinema Display.

  17. Hi, I am quite new to all this.I have a late 2011 Macbook Pro may I confirm what byte I need to change please and the easiest way to locating the binary with a hex editor?
    Thanks.

  18. Hi, im trying on iMac 2011 model 12.1, so I’m changing 0d, by 12, saving file, overwrite the original and run command for resign, restart and nothing happens, what I’m doing wrong?

    i have sip disabled always and I’m editing by Xcode, thanks

      • It would be interested to see _why_ some monitors do not support it. My display is connected via a Displayport adapter and the panel isn’t IPS, it’s an MVA one. Maybe one of these properties trigger Night Shift not being available. Was hoping you could shed some light on this 🙂

      • I don’t think that it is related to IPS. And just to be sure. I checked a couple of old (2007/2009 no IPS) Samsung monitors and Night Shift works.

        I’ll see if I can find anything. Will keep you posted here 😉

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s