04-17-2013 08:11 PM
45 12
tools
  1. mmarz's Avatar
    That's it? I'll try the adb commands when I get home later today. If they really do stay disabled, i'll be really happy, I personally see no use for them on my end.
    They do, you just have to run the command after every boot. You can use gscript to automate it or add it to an init.d script.
    05-10-2011 11:46 AM
  2. Takenover83's Avatar
    mmarz, I am having trouble getting the newest keylights.rar up and going. This is on a fresh install of Harmonia 1.2

    • Installed tasker
    • Installed sl4a
    • copied the 4 script files to sdcard\sl4a\scripts\
    • copied the tasker xml to sdcard\tasker
    • pushed sush into /system/bin and chmod'ed
    • Code:
      adb remount
      adb push sush /system/bin/
      adb shell chmod 755 /system/bin/sush
    • Opened Tasker, Menu>Profile Data>Restore
    • Pressed Apply and rebooted
    • After rebooting, I see afterboot.sh runs and exits
    • Made sure sl4a had su access


    Running, the keyflash script's in sl4a manually, I do see the key's flash quickly and then stop. So I am thinking the problem is within Tasker.
    I have been testing with Google Voice SMS. (sending a text to GV and seeing if the keys flash)

    Edit #1: Tested task "Togglekeylights". Hit the test button, turned the screen off, and a few seconds later the keys flash. So I am guessing I am having a problem with one of the other profiles. The only two I can test right now are VOIP and GV. I am currently not topped up, so I can not test the other profiles.
    Edit #2: I fixed it. Had to enable the accessibility service for tasker. This needs added to instructions. Go to Settings>Accessibility> Enable Accesibility and Tasker.


    05-11-2011 01:27 AM
  3. mmarz's Avatar
    Hmmm, I just tested the tasker profile I uploaded using GV sms and it worked. I would say that maybe you made a typo when you created the sl4a folders, but the scripts show up in sl4a. Try editing the Keylights task in Tasker. Select one of the run script commands and see if you can select the correct script using the magnifying glass icon.

    Also, I put in a ten second delay between getting a notification and the lights blinking. I did that just for the missed call notification since the screen might be on after a missed call happens. But that adds a ten second delay for all notifications because of the way I set it up. Are you waiting long enough before deciding that it doesn't work? You can edit the delay by editing the Togglekeylights task.
    05-11-2011 02:04 AM
  4. Takenover83's Avatar
    I got it mmarz. The key step was. I edited the post above to include the info below.

    Edit #2: I fixed it. Had to enable the accessibility service for tasker. This needs added to instructions. Go to Settings>Accessibility> Enable Accesibility and Tasker.
    mmarz likes this.
    05-11-2011 02:35 AM
  5. mmarz's Avatar
    Thanks! Added!
    05-11-2011 04:06 AM
  6. JBHilton1230's Avatar
    Thanks this is exactly what I have been looking for.
    05-11-2011 07:31 AM
  7. JBHilton1230's Avatar
    Thanks for this
    05-11-2011 07:33 AM
  8. mmarz's Avatar
    Bonus flashing styles added to the first post. Enjoy!
    05-11-2011 12:36 PM
  9. easyguy's Avatar
    This mod stops the blacklight from turning on when you press the key. If you just want to do the same on your own without Tasker, run the following through adb shell or a script with root privileges:
    How do I do the above? adb shell or a script with root privileges.
    05-11-2011 02:09 PM
  10. mmarz's Avatar
    How do I do the above? adb shell or a script with root privileges.
    Download gscript from the market, add the disablekeys.sh from the attached rar file to /sdcard/gscript/, and then run the it with gscript.
    05-11-2011 02:33 PM
  11. mmarz's Avatar
    Well, it turns out that running Tasker in loops causes the phone to not go to sleep. This means that when your lights are flashing, the battery will drain faster because your phone never goes into idle mode. I tried to get around this by running the loop within the script, but that failed because as soon as the phone does go idle, the script stops running and the lights stop flashing. So while this solution does work, it is not ideal.

    What we really need is an app that puts the phone to sleep in between the the led flashes. The app I mentioned in the first post does that, but it only notifies you of incoming SMS. I made a work around by installing that app, and then having Tasker send myself an SMS whenever I want the lights to be triggered. This is also not ideal, but at least it saves your battery. I made a slightly modified version of the keylights app here: KeylightsOV.apk
    I hope the author doesn't mind (he hasn't updated his thread since June of 2010), but I couldn't stand to look at the default icon he used.

    Hopefully one of the rom devs will build in flashing the key lights for notifications into their rom, or some kind soul will make an app with more options for notifications. I am just too busy to start learning how to develop for Android myself.
    05-12-2011 03:28 AM
  12. Takenover83's Avatar
    I wonder if we can decompile the dex and add a few more notifications, and recompile?

    Edit: To decompile and recompile you need smali/baksmali

    Decompile: java -jar baksmali.jar -o classout/ classes.dex
    Recompile: java -Xmx512M -jar smali.jar classout/ -o classes.dex

    Notifications that would be wanted
    Missed calls
    Missed SMS
    Missed GV SMS
    Gmail/Email
    Groove IP missed calls or perhaps other voip (sipdroid/csipsimple)
    Voicemail
    05-12-2011 03:33 AM
  13. mmarz's Avatar
    I wonder if we can decompile the dex and add a few more notifications, and recompile?

    Edit: To decompile and recompile you need smali/baksmali

    Decompile: java -jar baksmali.jar -o classout/ classes.dex
    Recompile: java -Xmx512M -jar smali.jar classout/ -o classes.dex

    Notifications that would be wanted
    Missed calls
    Missed SMS
    Missed GV SMS
    Gmail/Email
    Groove IP missed calls or perhaps other voip (sipdroid/csipsimple)
    Voicemail
    I decomplied it thinking I could do that, but it is a but more complicated than I anticipated: keylights.rar

    The problem is that the author did not use a notification to turn on the lights. The author actually checks for an SMS in the inbox. That means to make it check for other items, you need to completely rewrite the program or have access to the source code. The decompiled code is too much of a mess to work with.
    05-12-2011 03:52 AM
  14. Takenover83's Avatar
    I was afraid of that. Is the author MIA? I would be willing to pay for updates, as I am sure many other Optimus users would.
    Edit: had a look over at sdx-developers. Look''s like he has not be around since a couple weeks after he posted the apk.
    05-12-2011 04:01 AM
  15. Takenover83's Avatar
    Considering I have my WIFI set to never sleep, and leave Groove IP running 24/7, I am wondering how much of a additional effect Tasker's loop is having on battery. As a workaround, a configurable time-out can be added, correct? That way if I have went to count-sheep and I get a notification, it will not flash for the next 6-hours.
    05-12-2011 04:23 AM
  16. mmarz's Avatar
    You can do that by cloning the Keylights profile. Then edit the profile where it says Variable Value. Change it to activate when it Doesn't Match and set the value as "Off". This way the profile is active for Go and Go2. Delete the Exit task. Then edit the Enter task. Delete all the entries except for one of the wait tasks and the set variable task at the end. Make the wait into the timeout time. Change the set variable to "Off" instead of "Go2" and remove the if condition. Hit properties and for collision handling set it to abort existing task.

    Now when your lights start flashing, this second task will begin the timer. If the time runs out, it will turn off the lights. If you wake your phone before that, it will harmlessly count down. If you wake your phone and then get another notification, the old countdown timer will be aborted and a new one will start.

    Still not ideal. I did a test, and running the flashing lights using this method drains about 6% an hour. Using the Keylights app, there is no noticeable change from the usual 1% an hour.
    05-12-2011 10:06 AM
  17. dnizzle91's Avatar
    I cant get this to work at all i followed the directions step by step and at the end tasker wasnt in the accessibility option
    05-12-2011 01:23 PM
  18. mmarz's Avatar
    I cant get this to work at all i followed the directions step by step and at the end tasker wasnt in the accessibility option
    Hmm, did you restore the saved profiles?
    05-12-2011 02:29 PM
  19. mdewyer's Avatar
    Thanks for this useful script!
    06-02-2011 10:34 AM
  20. happyroot's Avatar
    Could someone post a mirror of his the key lights app he modified?
    04-17-2013 08:11 PM
45 12
LINK TO POST COPIED TO CLIPBOARD