Jump to content

[MOD] Multicolor Notification LED


Guest dakok
 Share

Recommended Posts

Thanks to polish Telchina forum member Brucie for this stuff! - brought here by Xeros2

Lot of F1 owners comes over here so I thought it would be smart to open a separate topic since this seems to be working :)

 

I was able to mod file lights.default.so so we have 7 color leds.
What is needed is android 4.4 (4.2 will have only 3 colors because you can not control the blue LED, I have not tested whether it actually will work).
 
Lights.default.so file can be downloaded here
The file can be unpacked into / system / lib / hw / (first make a copy!), Eg. By ADB:
 
adb push lights.default.so /sdcard/
adb shell
su
mount -o rw,remount /system
cp /system/lib/hw/lights.default.so /system/lib/hw/lights.default.so.bak
cp /sdcard/lights.default.so /system/lib/hw/lights.default.so
Ctrl+C
adb reboot
 
and after rebooting you can enjoy 7 color leds;) Colors can be changed such notification. gravityboxem.
The following colors are available (#AARRGGBB):
Red - # FFFF0000
Green - # FF00FF00
Blue - # FF0000FF
Yellow - # ffffff00
Magenta (purple) - # FFFF00FF
Cyan (turquoise) - # FF00FFFF
White - #FFFFFFFF

 

BrocasHelm confirms the hack to be successful

 

Mofidied lights work perfectly on Mlais 4.4.3 1028, I get all 7 colors as expected through UNC in gravitybox

(before that I could only get red, green, yellow, no blue or any combination containing blue).

Edited by dakok
Link to comment
Share on other sites

Guest BrocasHelm

Actually making a flashable zip is too much of a trouble anyway, since all it changes is one file. No adb commands are needed really, you just need some file explorer with root access to copy/paste the file at the proper directory and give it proper permissions. For me its easier and less time consuming than restarting the phone twice. Plus you can always keep a backup of the other file just in case.

Link to comment
Share on other sites

LED controling apps (like Light Flow, LED Blinker, etc.) should handle it now too, but LED Blinker usually has issues with some custom colors, but it could have been fixed in recent versions.

Edited by xeros2
Link to comment
Share on other sites

Guest vassilis91

It works for me too. But i have issues with light flow. Another free app?

Edit : It works perfect with XLED from xposed. I am on laek repack.

Edited by vassilis91
Link to comment
Share on other sites

Guest BrucieK

It's not that much of a trouble to make a flashable zip, although I do have a template to make patches like this, makes things go a lot faster :)

https://mega.co.nz/#!D1EmCKCJ!m-IQNhYP_MPF9sh23_R4BA_aVs1_TKMWmOj7gG2TZfs

 

Thanks for that, I was just to lazy to make patch like this because it's faster for me to execute few commands over adb than making new flashable zip everytime I want to test if it works ;)

 

My mod should work on all roms that support blue led(kitkat roms) and with all apps that are controlling led through android api.

Edited by BrucieK
Link to comment
Share on other sites

Guest mindtrapper

Thanks for that, I was just to lazy to make patch like this because it's faster for me to execute few commands over adb than making new flashable zip everytime I want to test if it works ;)

 

My mod should work on all roms that support blue led(kitkat roms) and with all apps that are controlling led through android api.

 

Hey mate, thanks for a much needed mod. However it doesn't work in Micromax A310 rom. I suspect they changed something in the leds, maybe a symlink or config somewhere. It gives PURE AOSP v2 (JB) yellow led, which is nice.

Link to comment
Share on other sites

Guest korekore1

if we knew what files are responsible for the leds besides lights.default.so (hopefully not something kernel related) we could make ourselves happy..!I searched a bit but found nothing useful.

 

Maybe if we changed kernel with one from an aosp with blue led ability we could find out if a310 kernel is further modded by micromax

Link to comment
Share on other sites

Guest BrucieK

It's in kernel :( Led drivers export some files to sysfs interface(http://en.wikipedia.org/wiki/Sysfs), you can find virtual files in /sys/class/leds/

lights.default.so controls leds by writing to this files and since jellybean kernel doesn't have files for blue led it's impossible to control it.

BTW, here is source of lights.default.so: https://github.com/lanmengss/mtk/blob/master/hardware/liblights/lights.c (I didn't compiled it, I edited directly arm code :D ).

 

Can somebody with JellyBean rom issue this command over ADB and post output?: ls /sys/devices/platform/leds-mt65xx/leds/

Files in /sys/class/leds/ are just symlinks to /sys/devices/platform/leds-mt65xx/leds/, maybe one of symlinks is missing(the one for blue led)? But its probably missing kernel driver.

 

Do you know how to extract kernel image(boot.img)?

 

Hey mate, thanks for a much needed mod. However it doesn't work in Micromax A310 rom. I suspect they changed something in the leds, maybe a symlink or config somewhere. It gives PURE AOSP v2 (JB) yellow led, which is nice.

 

Micromax A310 rom is android 4.4? Upload original lights.default.so from that rom. Try to control leds over ADB: echo 255 > /sys/class/leds/green/brightness

Edited by BrucieK
Link to comment
Share on other sites

Guest BrucieK

Thanks, I will try to patch it tommorow ;) btw, by "doesn't work" you mean what? Leds doesn't work at all or there are no additional colors? Is blue led available on Micromax A310 rom?

Link to comment
Share on other sites

Guest korekore1

Thanks, I will try to patch it tommorow ;) btw, by "doesn't work" you mean what? Leds doesn't work at all or there are no additional colors? Is blue led available on Micromax A310 rom?

only red,green and yellow are working.Blue never worked on a310..

Link to comment
Share on other sites

Guest BrucieK

Can somebody with JellyBean rom issue this command over ADB and post output?: ls /sys/devices/platform/leds-mt65xx/leds/

Files in /sys/class/leds/ are just symlinks to /sys/devices/platform/leds-mt65xx/leds/, maybe one of symlinks is missing(the one for blue led)? But its probably missing kernel driver.

 

Try this, if there is no blue directory it's missing led driver in kernel

Link to comment
Share on other sites

Guest mindtrapper

Try this, if there is no blue directory it's missing led driver in kernel

 

JB Pure Aosp V2 returns:

 

000041ed 00000000 545ff339 .

000041ed 00000000 545ff339 ..

000041ed 00000000 545ff339 red

000041ed 00000000 545ff339 green

000041ed 00000000 545ff339 lcd-backlight

000041ed 00000000 545ff339 button-backlight

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.