[Xperia Z Themes and Apps] langeveld024:
okay guys, here i'll explain how to reduce adaptive brightness (minimum) to match manual brightness (minimal) when using a kernel that supports lower minimum brightness than stock. (in this case, Zombie Kernel for Xperia Z, which is, as far as i know at the moment of writing, the only kernel for xperia z which supports this)

Disclaimer:

Im not responsible for anything that might happen to you or your phone or anything else when following these instructions.

Reguirements:

-PC with Java installed

-Notepad++ installed (recommended)

-Advanced ApkTool

-a phone (obviously) running a kernel that supports lower brightness than stock

-some basic knowlegde

1. first of all, make a nandroid backup in case something goes wrong!

2. copy your framework-res.apk and SemcGenericUxpRes.apk from /system/framework/ and from /system/framework/SemcGenericUxpRes/ and copy it to the root of your internal sd.

3. now plug in your phone to pc and move the files into the 2-in folder inside the advancedapktool folder on your pc.

4a. run advanced apktool and install frameworks (option 1).

4b. run option 2 (decompile files) and select the framework-res.apk.

5. you should now have a framework-res.apk folder in the 3-out folder in the root of the advancedapktool folder, open it and navigate to advancedapktool/3-out/framework-res.apk/res/values/

you should see something like this

now open integers.xml in notepad++ and search for the following lines:

<integer name="config_screenBrightnessDim">20</integer>

<integer name="config_screenBrightnessDark">20</integer>

change the ''20'' in to ''6'' (6 is a little bit brighter than kernel minimum, but 5 is too dark and makes the screen flickering)

so it looks like this

6. then you can recompile using option 3 in advancedapktool and option 2 in the next menu where it asks you to sign the apk. hit y and wait till its done.

7. copy the newly created framework-res.apk file found in the 4-done folder to the root of your internal sdcard.

8. using file manager, move the file to tmp/ folder and set correct permissions (rw-r-r aka 644)

9. then move the file to /system/framework/ and hit overwrite. (some apps like rootbrowser will create framework-res -copy.apk so i like to use ''file manager'' instead)

10. reboot and enjoy!

NOTE: you can also add brightness steps to the framework, they are in the arrays.xml file.

that will only add more diffferent steps to the brightness and will not reduce any brightness at all.

so, its an optional step if you like go a bit further!

the lines to look for look like this

also note, that values may differ from rom to rom and kernel to kernel and device to device. fine-tuning may be needed but this write-up defines what applied to my specific case.

Credits:
[MENTION=5078388]BDFreak[/MENTION] for the advanced apktool which prevents bootloop after decompiling/compiling.
[MENTION=5243932]Tommy-Geenexus[/MENTION] for this awesome, fast and lean kernel which supports low backlight brightness
[MENTION=2750809]chiragkrishna[/MENTION] for his guide which i used as a start guide dates from 2012 so pretty old but thanks to him i knew where to look for.

i am not a developer nor i have experience in theming or building apps or roms etc, and this decompiling was new for me too so i learned a bit and was fun. (was pretty simple though)

regards