[MOD] dim capacitive buttons/leds | fixed | [9/3/12]

Search This thread

rsage

Senior Member
Jul 28, 2010
795
170
possibly add a soft flash feature? I currently have a Galaxy Note and there isn't a dev that can figure it out. Just wondering, since you were able to dim the captivate buttons, should be similar to tweaking the flash.

Ah ok, actually they have nothing to do with each other. Capacitive button characteristics are controlled by a set of system files. To give the camera app the ability to do a soft flash would probably require someone reverse engineering the apk, then making mods and recompiling (including adding some way to turn the soft flash on/off). Or someone would have to write a third party camera app with that capability. Technically it should be possible because I have a flashlight app that uses the camera flash and it can be set to varying levels of brightness, but I really don't know.
 

adv1sory

Senior Member
Dec 2, 2011
263
61
Toronto
Amen to that. What direction would I need to go to reverse engineer the app? What coding language would I need to learn?
 

rsage

Senior Member
Jul 28, 2010
795
170
Amen to that. What direction would I need to go to reverse engineer the app? What coding language would I need to learn?

Android apps are coded in Java. You'd also probably have to familiarize yourself with smali. There are ways to reverse-engineer or decompile apk's, but this thread isn't the right place to discuss. I'd post something in the general section. You can also check out this thread, the OP has had success in making mods to the stock camera app:

http://xdaforums.com/showthread.php?t=1569777
 
  • Like
Reactions: adv1sory

adv1sory

Senior Member
Dec 2, 2011
263
61
Toronto
Android apps are coded in Java. You'd also probably have to familiarize yourself with smali. There are ways to reverse-engineer or decompile apk's, but this thread isn't the right place to discuss. I'd post something in the general section. You can also check out this thread, the OP has had success in making mods to the stock camera app:

http://xdaforums.com/showthread.php?t=1569777

Thank you so much for guiding me in the right direction. I greatly appreciate it. Makes me wish I paid attention in Java class when I had the chance, but found the case sensitive language a burden. :(
 

rrkelley

Member
Jun 17, 2011
17
0
Does support init.d scripts. Had to manually do it. The flashable version did not work. Permissions were wrong on the flashable script. Someone over at themikmik steered me in the right direction.
 

rsage

Senior Member
Jul 28, 2010
795
170
Does support init.d scripts. Had to manually do it. The flashable version did not work. Permissions were wrong on the flashable script. Someone over at themikmik steered me in the right direction.

I can't explain why it doesn't work on Newt's RLS3 - it works on every other sense4 ROM I've tried. It's using the same standard installer script that everyone else uses. I'll try to flash RLS3 and look into it (I've been wanting to try RLS3 anyway).

The reason you had to change permissions is because you manually copied the script into /system/etc/init.d/ -- that has nothing to do with the flashable zip file itself. When you copy a script or file manually in any kind of root explorer/file explorer app, some kind of default permissions (usually the wrong ones) are assigned that the copied script/file itself has no control over.
 
  • Like
Reactions: PhantasmRezound

pwned3

Senior Member
Jul 23, 2011
1,261
275
Cullman
Will this work on venom?

Edit. Doesn't seem to be

Sent from my ADR6425LVW using Tapatalk 2
 
Last edited:

rsage

Senior Member
Jul 28, 2010
795
170
It actually does. I didn't flash it in recovery though I copied the script to the folder manually with root explorer. Check every box when setting permissions and reboot.

Yeah this will work. Flashing the zip does put the script in the right place, but I've noticed with newer sense4 ROMs like Viper and OneX that the permissions aren't being set right. So you can either flash the zip then manually change permissions, or manually copy the script to /system/etc/init.d and then change permissions.

I'll add a note to the OP later, and if I have time I'll try to fix the flashable zip.

Sent from my ADR6425LVW using Tapatalk 2
 
  • Like
Reactions: pwned3

fallen00sniper

Senior Member
Jan 4, 2012
832
147
Everett
www.androidfilehost.com
I can't explain why it doesn't work on Newt's RLS3 - it works on every other sense4 ROM I've tried. It's using the same standard installer script that everyone else uses. I'll try to flash RLS3 and look into it (I've been wanting to try RLS3 anyway).

The reason you had to change permissions is because you manually copied the script into /system/etc/init.d/ -- that has nothing to do with the flashable zip file itself. When you copy a script or file manually in any kind of root explorer/file explorer app, some kind of default permissions (usually the wrong ones) are assigned that the copied script/file itself has no control over.

I don't think you need this on newts one xXx 3.2.1, I am running it right now and the tweak app that is provided has this option on the others tab, capacitive button brightness, with the options of off, earliest, earlier, early, normal, late, later, latest, never.

I am kind of confused by all the names except off and never, which are about the same thing, but I want mine to be very very dim, so I am trying earliest and latest.

After a hot reboot it doesn't seem to make any difference, only off does and i have yet to try never...
 

rsage

Senior Member
Jul 28, 2010
795
170
I don't think you need this on newts one xXx 3.2.1, I am running it right now and the tweak app that is provided has this option on the others tab, capacitive button brightness, with the options of off, earliest, earlier, early, normal, late, later, latest, never.

I am kind of confused by all the names except off and never, which are about the same thing, but I want mine to be very very dim, so I am trying earliest and latest.

After a hot reboot it doesn't seem to make any difference, only off does and i have yet to try never...

Those options don't sound right. The tweak may show up in the tweaks app but may not be functional yet, in which case you'd still have to use this script.

Sent from my ADR6425LVW using Tapatalk 2
 

Superm@π

Senior Member
Dec 30, 2011
1,188
233
Will it work on AOSP ROMs?

Sent from my upgraded, ICS'ed, rooted, S-offed, viper rommed, desensed, themed, supercharged, customized toy.
 

rsage

Senior Member
Jul 28, 2010
795
170
Will it work on AOSP ROMs?

Sent from my upgraded, ICS'ed, rooted, S-offed, viper rommed, desensed, themed, supercharged, customized toy.

I believe it would, but you'd have to try. The mechanism that dims the lights should be the same no matter what ROM. The ROM would have to have init.d support though - that's key - so check with the ROM dev. If you flash it and it doesn't work (even after changing permissions on the script), you can simply delete it from /system/etc/init.d.

You may want to create a nandroid backup first so it'll be easier to roll back if there's a problem.
 
  • Like
Reactions: Superm@π

fo0you

Senior Member
Jul 16, 2010
585
236
Portland, Oregon
I believe it would, but you'd have to try. The mechanism that dims the lights should be the same no matter what ROM. The ROM would have to have init.d support though - that's key - so check with the ROM dev. If you flash it and it doesn't work (even after changing permissions on the script), you can simply delete it from /system/etc/init.d.

You may want to create a nandroid backup first so it'll be easier to roll back if there's a problem.

Works on AOKP M6. Have to fix the 50dimleds permissions after the flash though

Sent from my PG86100 using xda premium
 
  • Like
Reactions: rsage and Superm@π

Top Liked Posts

  • There are no posts matching your filters.
  • 20
    Flash this mod from custom recovery to dim the red capacitive buttons/leds (home, menu, back, search). This script doesn't change how or when the leds light up, it only controls the brightness when they do light up.

    The install script has been fixed to set appropriate permissions - there should no longer be a need to manually set permissions after flashing.

    This mod is not needed for ROM's which have this tweak working in Leedroid Tweaks.

    Flash like you would flash any other zip. You shouldn't need to wipe cache or dalvik. Nandroid first to be safe. To uninstall, just delete the script from /system/etc/init.d with a root file explorer.


    Requirements:
    • ROM with proper init.d support

    Credit:

    • fo0you for the idea
    • whoever originally created the script that fo0you posted that gave me the idea
    • Leedroid Tweaks app for being awesome and making me miss this tweak enough to create a script
    • Update: just found that someone already created something very similar to this in the EVO 3D forums (I think), so even though I did this on my own all credit to him for coming up with it first

    * Note: The usual caveats apply - I'm not responsible for phone death, please nandroid before flashing, etc.




    <------------------------------------------------ information below this line is now mostly obsolete ------------------------------------------------>

    UPDATE: This is now flashable from recovery - download dimleds-signed.zip instead of dimleds.zip

    For newer Sense 4 ROM's (like Newt's OnE XxX v3.2.1 and ViperRez), there is a minor problem which requires manual intervention. After flashing the zip, you have to use a file explorer to change permissions on the script file in /system/etc/init.d (change permissions to match the permissions of the other script files in the same directory). Alternatively, you can manually copy the script from the zip to /system/etc/init.d and change the permissions. I'll try to get a fixed version up soon.

    NOTE: This is no longer needed for Bored's s4 ROM (as of v2.4/2.5)

    This is a quick script I threw together to dim the capacitive buttons while running Newt's OnE XxX Sense 4.0 ROM (I'm currently using it on Bored's RezROM S4). I got the idea from another post in Newt's thread (by fo0you) about a script to toggle the capacitive buttons on or off. I prefer them on, but the default brightness is way too bright for me. If you want to toggle the lights on or completely off, get the script fo0you posted. If you just want to dim them, use this one.

    This is only a temporary measure until the Leedroid Tweaks app is updated for Sense 4.0 ROMs (this tweak is included in Leedroid Tweaks). This tweak already works in Leedroid Tweaks on some Sense 4.0 ROMs (I think on Joel's BAMF S4 ROM, but I could be wrong), but not others (like Newt's), hence this script. Different Sense 4.0 ROMs seem to have different tweaks working for some reason.

    The flashable zip copies a script to /system/etc/init.d

    Installation:

    1. Nandroid backup (did I mention that I take no responsibility if your phone implodes, explodes, or you lose data due to this tweak?)
    2. Copy dimleds-signed.zip to root of external SD card
    3. Reboot to recovery and flash like any other flashable zip
    4. Reboot from recovery
    5. New (only for newer Sense 4 ROM's): use a file explorer to change permissions on the script in /system/etc/init.d
    6. New (only for newer Sense 4 ROM's): reboot

    If you want to remove the tweak, just delete the 50dimleds script from /system/etc/init.d/ and reboot. You have to use a file manager like ES File Explorer or Root Explorer to do this. The leds will be automatically reset to default brightness when you reboot.
    3
    Uploaded new fixed zip and updated OP, should now work on any ROM with init.d support without needing to manually set permissions.
    2
    Does this work on the new Ivysaur Rom, anyone had jump n flash it n see if it works?

    Sent from my ADR6425LVW using Tapatalk 2

    Did u not read two posts above you ?

    Sent from my Dinc... I mean Rezound
    2
    Is there a way to set the led backlight to 0 so they never light up. I have not installed this, but just looking at this script there doesnt seem like a way. Infact, I am not even sure what the script does there is no obvious variable. It might appear after running the script I suppose.

    Not sure what you mean, the dimleds script only has one real line of code in it:


    Code:
    echo 2 > /sys/devices/platform/leds-pm8058/leds/button-backlight/currents

    It writes the value "2" to the sys file "currents", which dims the leds as much as they can be dimmed without turning them off completely. Technically it's redirecting the output of "echo 2" (which is "2') to the sys file. If you modify the script to write "1" or "0" it may do what you're looking for, but I haven't tried that in a while and I'm not guaranteeing anything.

    There are also apps on the market that will turn off the leds, like RootDim:

    https://play.google.com/store/apps/details?id=mobi.pruss.superdim&feature=nav_result
    2
    I believe it would, but you'd have to try. The mechanism that dims the lights should be the same no matter what ROM. The ROM would have to have init.d support though - that's key - so check with the ROM dev. If you flash it and it doesn't work (even after changing permissions on the script), you can simply delete it from /system/etc/init.d.

    You may want to create a nandroid backup first so it'll be easier to roll back if there's a problem.

    Works on AOKP M6. Have to fix the 50dimleds permissions after the flash though

    Sent from my PG86100 using xda premium