Supported Mac models for Night Shift in Sierra 10.12.4+

People looking for Night Shift support in High Sierra 10.13.2 you should visit my follow up Supported Mac models for Night Shift in High Sierra 10.13.2.

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

I opened the CoreBrightness binary in a hex editor (app) and change the coloured byte that matches with the used hardware. After that I saved the file and copied it to the original location.

The next step is to re-sign the patched framework binary with:

sudo codesign -f -s - /S*/L*/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness

Well. 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 here confirmed that this is working for them with older/unsupported hardware.

Note: The colours 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.

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.

173 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 ?).

    • Hi,

      Yes. We can patch it in several different ways, but the end result will be the same.

      What I showed you here is how it works, which also results in a more human friendly patch.

      We only know the list of currently supported Mac’s, in this Beta, but Apple may change it with a future Beta.

    • “By example, by replacing first bytes of CBU_IsNightShiftSupported …” Could you please tell me where is that line that you changed ? Thank you !

      • @Sebastien : You can search & edit this function directly with a disassembler like Hopper Disassembler.

        Else, for 10.12.4 (16E195), you can use a hexadecimal editor, go to offset 0x1ace7, and change :
        55 48 89 E5 41 57 41 56
        with
        48 C7 C0 01 00 00 00 C3

        (don’t search for it, there are multiple instances of this bytes)

        Note : confirmed to work on a MacBookPro8,2, after a force resign of CoreBrightness.framework with a Developer ID Application certificate.

  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

  19. MacBook (13-inch, Mid 2010)
    I have a problem.

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

    xxd -s 0x1E260 -l 24 /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness
    0001e260: 0900 0000 0d00 0000 0600 0000 0500 0000 …………….
    0001e270: 0600 0000 0800 0000

    but… the last step is impossible

    sudo codesign -f -s – /S*/L*/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness
    Password:
    /System/Library/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness: replacing existing signature
    /System/Library/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness: Operation not permitted

  20. Hi, Pike. Thank you for your work.
    I did every point of instruction(MacBookPro8,1):
    0.) disable SIP (boot into recovery, open terminal and run “csrutil disable”)
    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.
    But when I run last command(7.):
    /System/Library/PrivateFrameworks/CoreBrightness.framework/CoreBrightness: replacing existing signature
    /System/Library/PrivateFrameworks/CoreBrightness.framework/CoreBrightness: main executable failed strict validation

      • Hi Pike, and thank you.
        What do you mean by that?
        I had the same result as t2ras: ‘main executable failed strict validation’

      • No, I only taped command:
        sudo codesign -f -s – /S*/L*/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness

      • Thank you guys!
        Instruction from “ryanmcv | March 28, 2017 at 9:00 pm” works for me!
        I received error “main executable failed strict validation” when I edit CoreBrightness with Vim and command “:% ! xxd” –> “:% ! xxd -r”

  21. Here are step-by-step instructions that I created. You will need Xcode or any basic hex editor.

    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/
    Version/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.

  22. hi guys.

    please, i`m facing some trouble when i run the command:

    sudo codesign -f -s – /S*/L*/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness

    After it asks for my password, it says: “The specified item could not be found in the keychain.”
    ( looks like there is a certificate issue)
    thanks in advance for your help.
    Regards.
    Juan Manuel

    • Check for illegal characters!

      It should be: sudo codesign -f -s - /S*/L*/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness

      Checked with Sierra 10.12.5 and still working.

      Edit: Got it. Your -s – is the problem. Don’t use a dash “–” symbol but a minus sign “-“.

  23. Thank you!!!
    it was that!
    but this is the final question, i promise, now when I try to run the command it says: “bundle format unrecognized, invalid, or unsuitable”

    Thanks in advance again!!
    Juan Manuel

  24. Maybe it`s the name of the code for ” Imac” because i have to change the 0D ( wich is in hexa) to 12. I think it`s 0C, but i don`t know if its correct.

    • Hi Juanma,

      Yes indeed. And here is a tip; Use the Calculator.app and change Menu -> View to “Programmer”. This allows you to enter hex and decimal values, and convert them for you. Just in case that you are wondering how people do this sort of things.

  25. Finally it works!!!
    i don`t know what happen, but when my girlfirend try to edit the file, after that, we try to run the command again and it works!
    thank you soo much!

    • Hi Juanma,

      WordPress changed a minus sign in the instruction into a dash symbol. Same things happens with single and double quotes. Probably due to the lack of use of <code> </code> tags.

  26. Hello

    MacBookPro8,1

    Here is the output
    0001e260: 0900 0000 0d00 0000 0600 0000 0500 0000 …………….
    0001e270: 0600 0000 0800 0000

    What must I do next to enable nightshift please?

  27. MacBook (13 inches, mid-2010) what am I doing wrong?

    /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness|grep _ModelMinVersion
    000000000001e260 S _ModelMinVersion

    xxd -s 0x1D490 -l 24 /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness
    0001d490: 0000 0000 ff9b 2903 2700 0000 0033 0000 ……).’….3..
    0001d4a0: 0000 0000 0000 3300 ……3.

    sudo codesign -f -s – /S*/L*/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness
    Password:
    Sorry, try again.
    Password:
    /System/Library/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness: replacing existing signature

  28. Sorry for the persistence, but what else should I do?

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

    000000000001e260 S _ModelMinVersion

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

    0001e260: 0900 0000 0d00 0000 0600 0000 0500 0000 …………….
    0001e270: 0600 0000 0800 0000 ……..

    sudo codesign -f -s -/S*/L*/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness

    Password:
    Sorry, try again.
    Password:
    /System/Library/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness: replacing existing signature

    • Hi Anton,

      No problem. You know what. I’ve read my own article and that was when I noticed that something was missing. I hope that the newly added text is helpful for you. If not. Let me know ok?

      Thanks!

  29. I have an 11.6″ 2011 MBA (4,1). I changed “05” to “04” using vim and xxd, and nothing happened after reboot. Then I restored /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness from the backup copy I made and tried followed the instructions in ryanmcv’s post and still nothing. Any idea what I did wrong? Also, why is it codesign -f -s – /S*/L*/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness
    instead of codesign -f -s – /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness?

    • Are you making the edits directly to the CoreBrightness binary that located in /System/Library/PrivateFrameworks? That could be your problem. I would try copying CoreBrightness.framework to your desktop, making the edits to that version, and then copying that newly edited version into /System/Library/PrivateFrameworks and overwrite the original one.

      Also, make sure you’re using the correct command in Terminal to sign the binary. Your post above has a dash instead of a minus sign. It should be:

      sudo codesign -f -s - /S*/L*/PrivateFrameworks/CoreBrightness.framework/
      Version/Current/CoreBrightness

      • “I would try copying CoreBrightness.framework to your desktop, making the edits to that version, and then copying that newly edited version into /System/Library/PrivateFrameworks and overwrite the original one.”

        I tried that the second time, maybe I messed something up and it’s too late?

        After running codesign again (making doubly sure I type a minus sign (hyphen?)) I get:

        /System/Library/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness: replacing existing signature

    • Where did the instruction say to replace ALL occurances of 0x00 0x0d with 0x00 0x0c?

      That is a big NO NO. Please search for the exact data and ONLY replace the byte that you need to patch.

  30. any hack to enable night shift on “external monitors”?
    I say because I have Nvidia GPU connected to a Samsung 4k TV and no night shift tab?

    • @saschamt & @oscar: did you try to patch the root function (CBU_IsNightShiftSupported) which do the compatibility check ? Search in previous answers to know how.

      • That is not a good idea. The reason for this is that logic may change over time. It is less likely that the supported models will change and thus that is a better patch.

  31. hi I’m confused …im sorry…I have a MacBook 5,2…can u tell me what to do to fix my brightness? I got the hex decimal app I don’t know what I’m suppose to do from there

  32. I did everything described here: “ryanmcv | March 28, 2017 at 9:00 pm”, and it worked amazing on my trusty MacBook Pro 8,1

    Today I inadvertedly upgraded to 10.12.5 Beta (16F54b), and now, Night Shift is gone 😦

  33. Thanks for this guide Pikeralpha :).

    I have now removed f.lux.app and can use NightShade even though my rig identifies as a ‘iMac11,1’. I replaced the ‘0d’ with ’07’ and now iMac7,1 is my bare minimum for Night Shade.

    Could the same method be applied to allow installing and booting into macOS Sierra from a device Apple have ‘deemed’ incompatible ? I have worked around this issue by changing my board-id but it would be good to not have that restriction imposed by Apple 🙂

    Would you know which framework Apple uses to perform the minimum requirements check mentioned at the URL above ?

    • Easy: It does not have any backlashes to set all versions to “01” hex for all platforms/machines. That´s how I did it on all my various machines. “One size fits all” 😉

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s