GSEventSetBacklightLevel(BrightnessSlider.value);
[[UIApplication sharedApplication] setBacklightLevel:BrightnessSlider.value];
iOS UIScreen has brightness property. Setting it to a different value updates screen brightness. But after lock / unlock screen brightness is restored to whatever brightness is set in iOS Settings.
Must I make a call to save the setting? Is there a sync call or something?
This is a jailbreak development,No “sandbox”。
The
UIApplicationsetBacklightLevel:call is indeed temporary.However, if you look at the code to toggle (change) brightness level in SBSettings, that is a permanent setting. I do still think that any change in brightness is also affected by whether or not the user has the Settings -> Brightness -> Auto-Brightness feature turned on. Auto-Brightness will dynamically adjust the screen brightness.
Take a look at this page. Scroll to the bottom to see this link.
As you can see, a permanent brightness change is achieved by writing the new brightness level to the com.apple.springboard.plist file:
which contains the values that you are seeing SpringBoard revert to. And, then the change is also applied temporarily with the code you’re using:
The combination of these two changes should get you what you want.