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.
Thank you very much for the hint on the changes… now my MacBook 5,5 (mid 2009) has nightshift! Great job!
Hi, I have the problem that I want to DISABLE nightshift again, due color depth degradation (it looks like a 16bit color depth mode on windows).. I used the tool FixEDID, but afterwards removed that DisplayMergeNub.kext again. Still, nightshift is selectable on my iMac14,2 hack. How can I DISABLE nightshift in a way that the whole mechanism is not used at all from beginning of the login screen?
I tried to patch corebrightness so it does EXCLUDE iMac14,2, which one results in a crash in the display properties…
Please help!
Followed the instructions but for 10.12.5. I am presented with a code signing error which was not present under 10.12.4. I’ll see if anyone else experiences the same hiccup.
Thank You!
10.12.5 + MacBook Air 2011 + Night Shift
Great! Thanks!
Mac Pro 5,1 + OS X 10.12.5
Hi,
I have lost NightShift on my MacPro3,1 when I updated Mac Os from 12.4 to 12.5. It seems that under Sierra 12.5 the offset has changed… in my machine it’s now 00 01 E2 40.
bye
Renzo
Hello, its really annoying I got 2 expensive big new screens for 2 machines, because my vision is really bad.
Now I got this ugly dark yellowish reddish screen tint, terrible I need bright !!! Calibration doesn’t fix it, not enough headroom… =(((
Just want to be able to turn Night Shift off for good, and was hoping this will fix it. Ridiculous that they enable it but don’t let you turn it off.
But I can’t even after fixing all, from the Terminal output matching pieces in the binary bytes to 06.
Not 100% certain if I did it right, as I understand it would be 06 for Mac Pro 6 and the others I don’t have to change.
Im on a Mac Pro 2010, any help would be very very much appreciated.
Thanks
The new offset for High Sierra Beta 2 is 0x200a0. Tested on my hackintosh spoofing an iMac11,3
works fine with MacBookPro7,1 macOS 12.6
MacBook Pro 9,2 with Night Shift Thanks
Hi Pike, i used your hack for some versions of Sierra and some betas of high sierra, but i think since 17A315i the patching resulted in an unusable monitor prefpane… do you have any tip what has changed there?
No. Sorry. I have no idea.
Hello Pike
First of all tell you that I really like the articles you write. They show in a clear and simple way advanced concepts related to Apple products.
After reading your article, I created a script to perform the framework patch automatically. It basically reads the model of the computer using ioreg and replaces it with Perl.
https://github.com/grisno/NightShiftFix/blob/master/NightShiftFix.sh
When doing the first tests in Sierra 10.12.6 I noticed that in the article indicate two different paths:
Path 1) /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness
Path 2) /S*/L*/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness
If you apply the patch on the first path, and sign the second path, a crash occurs when you try to open the screen preferences. I don’t know if it’s a mistake, or that I didn’t understand the article.
I think the right way, at least in MacOS Sierra 10.12.5 and 10.12.6, is to perform the patch and signature of the second path. I’d appreciate if this is right.
Thank you for sharing your knowledge
Best regards
The first one is only used for nm and xxd. Only the second one is used for sudo codesign.
Edit: I changed the <code></code> tags into <pre></pre> tags so that it becomes a scrollable one liner.
Thanks for the clarification =)
Now on High Sierra PB 6 and trying to get Nightshift back working but having been used to your method to replace the it seems thing have changed and the result of the xxd is
0001e260: 0100 0000 0100 0000 0100 0000 0100 0000
0001e270: 0100 0000 0100 0000
so is it even possible now to get Nightshift back
I can’t tell if what you did is correct. I’m still using High Sierra DP-6 (17A344b). Should have time to install DP-7 later today.
Hi Yeah I did check against another earlier install of High Sierra (PB 3) ran the commands in terminal to check if i put the right commands in and it came up with the usual list of machine figures 0900 etc.
So went back to the PB 6 install and re did the terminal commands but still comes up with the 0100 numbers listed as above.
Thanks.
Works for me with DP-7 (17A352a):
Hello again, I have worked out why I was getting a different offset and thus the 0100 numbers.
I had forgotten that NightEnabler.app had been installed, thus changing the CoreBrightness framework. Replaced the CoreBrightness framework with the original one and re did your procedure and now am getting the correct offset and number sequence.
sorry for all the bother.
Thanks.
No problem. Good to hear that you solved it 😉
After I find the offset with the command, do I replace those numbers with which others? What new correct number?
Yes. You need to replace the corresponding value (see blog article) with the one of your model identifier; see System Information -> Hardware -> Model Identifier: iMacNN,X
Don’t forget to convert the decimal value into hexadecimal. You can do that with help of the Calculator.app
My result:
nm /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness|grep _ModelMinVersion
0000000000020e00 S _ModelMinVersion
xxd -s 0x20e00 -l 24 /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness
00020e00: 0900 0000 0d00 0000 0600 0000 0500 0000 …………….
00020e10: 0600 0000 0800 0000 ……..
System Information -> Hardware -> Model Identifier: MacBookPro7,1
Then change 0900 into 0700 and follow the instructions.
did something change again in db8 or have i missed something:
i did change
00020e00: 0900 0000 0d00 0000 0600 0000 0500 0000 …………….
00020e10: 0600 0000 0800 0000 ……..
00020e00: 0600 0000 0d00 0000 0600 0000 0500 0000 …………….
00020e10: 0600 0000 0800 0000 ……..
for my MBP 6,1, re-signed, rebooted and: nothing. Could anybody confirm?
Edit: never mind, for some reason /S*/L*/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness
was not present – and therefore NS did not work. ln -s and it works!
Thanks,
Ben
Thanks, work on High Sierra Beta (17A360a)
Hello. Is there any way i can install Night shift on High Sierra. I tried the actual version with no luck. It results in a corruption of the Display in System Preferences.
Thanks
It still works, but you need too use the right offset. You can’t use the one of an older version of macOS (High) Sierra.
Thanks for your fast answer.
Yes, I know. But the Display panel, resolution, color, etc, is unreachable.
Thanks
It’s only there when Apple specifies it, like this:
Retina 5K display
27-inch (diagonal) Retina 5K display
5120‑by‑2880 resolution with support for one billion colors
500 nits brightness
Wide color (P3)
Is that what you are looking for?
Work on High Sierra 10.13 (17A365), using the previous version (beta), I just had to copy to the correct location and sign the file again.
No. Everything worked fine in my Mac Pro/Led Cinema display 27 with Sierra. Now, simply, the “Displays” in System Preferences wont open.
See earlier comments. You probably used the wrong path. Read carefully.
Working with High Sierra on a MBP early 2011!
As a non-developer, you could have mentioned that you have to disable “System Integrity Protection” for permission to change the CoreBrightness file and have to install “xcode developer tools” for executing the “codesign” command. You don’t need the “nm” command as – you can read in the comments – the offset for High Sierra final is “0x20e00” (please add that to your article). Thank you! The warm color of NightShift is better than f.lux.
Great!
Hey. The reason for letting people run nm is twofold:
1.) For people like you. Without Xcode (command lines tools) installed. Because entering nm in a terminal window, will open a dialog that asks you to install the required command line tools. This instantly solves the codesign problem you ran into.
2.) The offset is mostly likely different in a next update of macOS, and then people will run into problems.
Note: My blog audience is quite capable – the no permission error is verbose enough for them – and people who don’t understand that, better not mess with system files.
I used the mpkg from Github…
Ehm. That’s not mine is it?
Absolutely right. My mistake. Please apologize me,
Hi Piker, seem that Apple changes something in the latest beta, 10.13.2 (17c60c), here’s my new offset:
0001d490: 0000 f30f 580d 463d 0000 e873 2500 00f3
0001d4a0: 0f59 45ac f30f 1183
I’ve tried to use the same steps (I’ve a MacBookPro8,1, in the last beta I only have to change the 0900 with 0800 and everything worked), now I can’t find the old 0900 string.
What can we do?
Thanks for your help
Sorry, I solved (wrong offset), however seem Apple changed from this:
0900 0000 0d00 0000 0600 0000 0500 0000
to this:
0900 0000 0100 0000 0d00 0000 0600 0000
I’m not so smart with this type of code, can you verify that? (of course Nighshift work again with this new one; 9 -> 8)
However, thanks a lot for your help, you’re great
Yes. You used the old offset. And the data for High Sierra 10.13.2 has changed. Here it is:
00021bc0: 0900 0000 0100 0000 0d00 0000 0600 0000
00021bd0: 0500 0000 0600 0000 0800 0000
Note: The above offsets will likely change in future updates.
The second item (0100 0000) is for the iMacPro1,1 aka the new iMac Pro. See also: Supported Mac models for Night Shift in High Sierra 10.13.2
Pingback: Supported Mac models for Night Shift in High Sierra 10.13.2 – Pike's Universum
Hi Piker,
Im trying to patch core brightness again, on a 2010 cheese grater and Sierra 10.12.6
The dump shows:
0001d490: 0000 0000 ff9b 2903 2700 0000 0033 0000
0001d4a0: 0000 0000 0000 3300
If I understand correct I have to change the bit @ the vertical line below to:
0001d490: 0000 0000 ff9b 2903 2700 0000 0033 0000
0001d4a0: 0600 0000 0000 3300
—————–I—————————–
Searching with Hexfiend for 0000 0000 0000 3300 , it shows up twice,
Do I have to change both spots to 06 ?
Thanks a lot
Look at the data in the blog article. Yours doesn’t even come close. You are probably using the wrong offset. The offset that I used in my example (0x1d490) has most likely changed over time.
Hi again, I didn’t get it that I actually have to dump the model number,
Now something is happening, but not what was expected.
Now Apps crash while using the core brighness plugin, including system prefs.
1.) Restore the backup of the CoreBrightness.framework
2.) Follow the procedure in my blog article.
Only use the offset that you found. Nothing else. And please, don’t change anything when the data doesn’t look right.
000000000001e260 S _ModelMinVersion
input:
xxd -s 0x1e260 -l 24 /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness
output:
0001e260: 0400 0000 0500 0000 0200 0000 0100 0000
0001e270: 0100 0000 0200 0000
Don’t really know if this was the right way.
Where did you get the offset from? Have you checked it?
Ohh, ok, this is not the blog article.
Sorry, Im not that good at knowing about blogs, FB and all those things.
Thanks again
First thing I don’t know, which part is the offset, second I don’t know, where to get the right offset. I guess thats all written in the blog.
The blog seems to be for 10.13.
if I understand right this command is to obtain the offset
nm /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness|grep _ModelMinVersion
Thats what I did before.
Correct.
I don’t have Sierra 10.12.6 here and thus I cannot verify the offset for you. Perhaps someone else reading this can.
What is the BuildID that you are using? You get this by clicking on the version info in the ‘About This Mac’ dialog.
Hi Piker,
sorry to bug you again,
I think its the wrong path, I just don’t yet understand how to choose the right one.
Use the factory vanilla (backup copy) of the CoreBrightness.framework and see what offset/data you get.
The terminal spits out :
MAC-Mac-Pro:~ MACMAC$ nm /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness|grep _ModelMinVersion
000000000001e260 S _ModelMinVersion
MAC-Mac-Pro:~ MACMAC$ xxd -s 0x1D490 -l 24 /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness
didn’t see that before
0001d490: 0000 0000 ff9b 2903 2700 0000 0033 0000 ……).’….3..
0001d4a0: 0000 0000 0000 3300 ……3.
hahahaha same thing, sorry I really don’t know what I do wrong.
I might have to reinstall to be sure, the kext is clean.
Jumping to offset 0x1D490, the line shows
00 00 00 43 00 00 00 00 00 00 00 00 FF 9B 29 03 27 00 00 00 00 33 00 00 00 00 00 00 00 00 33 00 00 00 54 00 00 00 89 00 00 00 00 87
changing it to 06 at that vertical line
00 00 00 43 00 00 00 00 00 00 00 00 FF 9B 29 03 27 00 00 00 00 33 00 00 06 00 00 00 00 00 33 00 00 00 54 00 00 00 89 00 00 00 00 87 —————————————-I———
and see what it does
In step one you got this:
But instead of using 0x1e260 as offset, you keep using the old offset (0x1d490). That’s the problem.
first time yes, second try no, third try maybe, I don’t remember, I think I copy pasted and forgot to change it to the right offset Now I installed a virgin 10.12.6 lets see now what it does. now I get
000000000001e240 S _ModelMinVersion
xxd -s 0x1E240 -l 24 /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness
0001e240: 0900 0000 0d00 0000 0600 0000 0500 0000
0001e250: 0600 0000 0800 0000
thats the line I get jumping either 0x1E240 or 0x1E250
now Im lost because it is already 06 at the pipe.
C4 F1 70 42 F9 20 71 42 2E 50 71 42 63 7F 71 42 98 AE 71 42 CC DD 71 42 1B 0D 72 42 50 3C 72 42 85 6B 72 42 BA 9A 72 42 EF C9 72 42 24 F9 72 42 58 28 73 42 8D 57 73 42 09 00 00 00 0D 00 00 00 06 00 00 00 05 00 00 00 06 00 00 00 08 00 00 00 69 6E 69 74 00 73 74 61 72 74 00 77 61 69 74 46 6F 72 49 6E
Sorry, but I don’t know what this is – you forgot the use code or pre tags.
Now I have to change the 06 to a 05 for Mac Pro 5.1 ?
Yes. The one at 0x1E250.
P.s. I’m using my iPad in the train on my way home, and it’s hard to edit stuff for WordPress. Will do that at home.
the weird thing is 240 or 250 it gives me the same line @ 123400
and it didn’t work. same thing, notifications are crashing and if I try to open sys prefs / display
that crashes too.
the script above : same result
its really weird, it just doesn’t want to work in 10.12.6 =(
Ok so I reinstalled with a clean freshly downloaded 10.12.6, to make sure it isn’t any beta.
But still almost the same, the display pegs crash, Notifications don’t seem to run. Im really in trouble many of my music programs won’t work on High Sierra.
Is there no way to find out why it doesn’t work ?
Im sure I did it right because in High Sierra it worked.
Thanks Pike, very cool.