Git Product home page Git Product logo

asus-rog-phone-2-rgb's Introduction

Asus-ROG-Phone-2-RGB

This app allows you to control the logo rgb on custom roms. Works on stock rom too after release 2.0-hotfix

Only works on android 10 roms as the android 9 rgb driver doesn't react to changes, therefore it is probably not possible to make it work on android 9 using current methods.

Only use this if you are using Asus Rog Phone 2 or *3

Rog 3 works with latest release, however at the moment the second led cannot be lit on its own, the logo led must also be on to use second led

You need to be rooted to use this since it writes to system files

This modifies system files so use it at your own risk

Sections

Setup

Animations

Usage

Notifications

Second led

Notification Timeout

Per App Custom Animations and Colours

Notification Snooze

Save Restore App Data

Battery Animations

Music Visualiser

Triple Shake

Issues

Features

Version

Screenshots

Setup

  1. Download the latest apk from releases.
  2. Find it in your downloads folder and click on it to install.
  3. Grant the root request
  4. Take a look at Save Restore App Data to restore old data.

If you want a video guide here is a youtube video showing all the features and how to use them for release 9 click to view

Animations currently available

  1. off
  2. solid one colour
  3. breathing one colour
  4. blink
  5. rainbow
  6. another rainbow?
  7. rainbow breathe
  8. somekind of thunder
  9. thunder rainbow
  10. quick two flashes
  11. quick two flashes rainbow
  12. breathe rainbow
  13. some strange breathe rainbow
  14. slow glitchy rainbow
  15. yellow light? rofl

Usage

To use it press the power button on the bottom right of the screen. ( see screen shots bellow )

When it turns green we are good to go and you can head over the animations tab.

The Colour wheel allows you to change the colour provided the animations aren't rainbow.

Colour wheel will work for the following animations.

  1. solid one colour
  2. breathing one colour
  3. blink
  4. some kind of thunder
  5. quick two flashes
  6. and sort of the last one too

Notifications

Notification support is available from version 4 currently in beta and on the notifications branch.

To use the notifications

  1. You will find notification settings in the animations tab.
  2. Press on React to Notifications to start the service.
  3. Only needed before release 14 Press on the "Click to enable app to read notifications in settings" button and allow Asus Rog Phone 2 RGB to read notifications
  4. Select which animation you want to run when there is a notification
  5. Press on "Select which apps trigger notifications" and tick on all the apps you want the app to use leds when a notification come in.
  6. Optionaly you can select notification timeout see Notification Timeout
  7. You can select different animations or colours for each app see Per App Custom Animations and Colours

Second led

With the release of version 5 you can also enable the use of the second led that's normally ment to be used with a custom case.

The "enable second led" switch above "Notification settings" switch enables the second led for any animations selected above. This doesnt have any impact on using the second led for notifications.

For notifications you now have the following options relating to the second led.

  1. "use second led for notifications also" This lights up the second led and the logo led when a notification comes in.
  2. "Use Only the second led for notifications" This lights up only the second led.
  3. If you have both 1 and 2 disabled then only the logo led with light up.

How do the notifications work?

When a new notification comes in, the app reads the package name and saves it. The selected notification animation is executed.

When you remove the notification from the status bar the app also detects this and restores the animations to whatever you selected in the app, If you didnt select anything then it will just turn them off.

What if multiple notifications come in at once?

The app tracks the latest notification, and only checks if the latest is removed. So if you have a whats app notification followed by a telegram notification. The notification animation will keep playing until you remove the telegram notification.

This will allow setting custom notification animations for each app. ( in progress )

How do you deal with spammy notifications?

As of release 6 users can select which applications they want to trigger leds from an app list, illiminating the need for a blacklist now.

Notification Timeout

This feature was added in release 7. It allows you to choose a time between 20 seconds and 9 hours, this will determine the maximum time it takes before the leds are turned off provided the notification is not cleared.

The slider ( or seekbar in android lingo ) is setup so that it increases exponentially meaning it is easier to dile in smalled values, For example half way through the bar is only 4 minutes. 3/4 of the way is around 1 hour and it will increase quickly to 9 hours and 33 minutes at the end.

Why is this feature neccessary?

If you leave the notification option on all the time, you can get a notification during the night for example and the leds will be blinking for the whole night, decreasing your battery by a bit.

However with notification timeout enabled you can set it so the leds stop after say 20 minutes of not clearing them.

How does it work?

A thread is created from the NotificationService class when the leds are ment to react to the notification. The thread checks if the leds have been flashing for specified amount of time and if the notification itself is not cleared.

If the notification is cleared then it will call the same code that the NotificationService uses to stop and restore the leds.

If another notification comes in while there is already leds blinking for a notification then the timer is essentially reset and will wait to timeout for the new notification. This is because currently only the latest notification is being tracked. Future release might track every notification that comes in but this is pointless at the moment since the animations for every notification is the same.

Per App Custom Animations and Colours

This feature was introduced after release 11. It allows each app to have it own unique animation and colours for the leds. So you can set all if your Telegram notifications to blink blue for example, all of say youtube notifications to breath red and so on.

To use this mode
  1. In the notification settings click on "Select which apps trigger notifications"
  2. Click on the app which you want to enable, it should turn green with a green asus rog logo.
  3. To select which animation you want to use for the app click on the apps icon and a new view will come up saying "custom notification options for (app name)"
  4. From here you can enable your desired animation for this app.
  5. Also make sure the standard notification options are enabled as here Notifications

Notification Snooze

This feature allows you to set a time window for when the notification service can be stopped. So if you dont want your leds to be blinking during the night then this feature is for you.

This feature is also recommended for rog 3 users as in order for rog 3 leds to work the app needs to hold a wakelock which consumes battery. So with notification snooze the wakelock is released thereby saving rog 3 users some battery.

How to Use Notification Snooze
  1. Click on "Show notification snooze settings" to expand the menu.
  2. Select "Set start time" this is when you want the notification service to stop. set a future time. so for example if right now its 20:45 set 20:46 since if you set 20:44 it will trigger tommorow.
  3. Select "set end time" set this after your start time.
  4. select "enable snooze" to start the thing.
Notification Snooze Best Practises

NOTE: if you change the start time or end time you will need to select "enable snooze" again it will be unselected anyway once you change the settings.

NOTE on Delay: cause of how repeating alarm manager works the times you set will not be accurate. So for example if you set start time for 20:10 it will probably stop the notification service at like 20:15 maybe earlier or even later.

Save Restore App Data

Since release 13 you can now save and restore your data, this way you dont have to setup all of the settings for custom notifications each time you reinstall the app.

How to
  1. Change any setting in the app that you want and when finished go to the about tab.
  2. Click on the "Export Settings" button to save.
  3. After reinstalling the app or whenever. You can click on "Import Settings", the app will restart and your previous settings will be applied.
How does it work

Because this app uses root access we can take advantage of the shared preferences file.

When you save your settings, the app copies /data/data/terminal_heat_sink.asusrogphone2rgb/shared_prefs/terminal_heat_sink.asusrogphone2rgb.xml into /sdcard/.terminal_heat_sink.asusrogphone2rgb.xml

When you restore the settings, the app copies the file back into the shared preferences folder and restarts the app so that it can read the new shared preferences therby restoring the apps settings to what they were.

Battery Animations

This feature is available since release 15. When enabled a service will receive broadcasts about the battery status and will apply a colour based on the battery percentage. 0% = red, 100% = green, anything in between will be a smooth gradient achieved by adjusting the hue.

This feature takes notifications into account, so if there is a notification present then the battery service wont update the leds, as notification visualisation is more important then battery.

The service updates the leds about every 5 seconds, This is because the build in android system only broadcasts battery changes every 5 second on average.

However connecting and disconnecting from the charger is broadcast almost immediately so there is no issues there.

Music Visualiser

Introduced in release 16. When enabled the leds dance to the music currently playing on the phone.

Notifications take priority over the visualiser. Once notifications are cleared visualiser will continue.

Modes
  1. rgb, the hue is changed according to the waveform
  2. glow, the lightness of the colour is changed according to the waveform, It will use the colour you selected in the colorwheel tab.

Triple Shake

Triple Shake allows you to quickly shake your phone 3 times to toggle the second led when enabled.

The second led will use whatever mode you selected above at the very top of the App.

It will also use the colour you selected in the colour wheel for the appropriate modes.

I made this because I use the second led as a flashlight sometimes so this is a quick shortcut lol

Issues

  1. colour wheel performance. This is improved as of version 3 but could still be smoother.
  2. app list can take a while to load because it gets the app icon for each application on the phone.
  3. notification service keeps on restarting when killed.

Features

  1. animation speed should be possible (might not be possible)
  2. blink delay should be possible too (might not be possible)
  3. maybe custom animations? (in progress)
  4. set animations for when receiving notifications/calls so on... (done)
  5. enable the use of second led (done)
  6. allow timeout for notifications (done)
  7. add quicktiles for toggling logo led (done), second led (done) and notifications ( in progress )
  8. allow filtering when selecting apps (done)
  9. set custom animations and colours for each app (done)
  10. save restore app settings (done)
  11. battery charging animations (done-beta)
  12. music visualiser (done)(can be improved)
  13. Notification Snooze (done-beta)
  14. Triple shake (done)

Version

  1. 5.2-magisk
    New magisk mode added that can be triggered from the about tab and pressing the create magisk module button.

    This will generate a magisk module, uninstall the app and reboot your phone.
    The magisk module should allow all services to run without needing the notification as android hopefully wont kill a system app.

    To uninstall simply remove the magisk module from magisk manager.

    NOTE: This is completely optional the functionality is identical for the magisk version as the default.

    NOTE: This is a testing feature so there could be some issues. I will test it for about a week before uploading to the playstore if everything is ok
  1. 5.1-fixes
    triple shake should be less sensitive now ( so it shouldn't trigger in your pocket )
    fixed triple shake being always active even when turning off the service
    improve drag/swipe inside colour picker. You still can't drag on the brightness bar unfortunately
  1. 5.0-shake
    Added triple shake to miscellaneous settings.
    When enabled this allows you to shake your phone 3 times quickly to toggle the second led
  1. 4.9-notification_snooze
    Added notification snooze feature which turns off the notification service during set times
    Show instructions for notification snooze on the first time you enable it
    Updated about
  1. 4.8-notification_service
    Improved notification service. It now exists properly if not needed.
    Rog 3 notifications should now be fully working thanks to @jawadzoha from my telegram group for rog 3 testing.
  1. 4.7-colour_crash_wakelock
    Fixed a crash when selecting colour
    Added rog 3 wakelock for rog 3 mode thanks again to @jawadzoha from my telegram group for rog 3 testing.
  1. 4.6-colour_brightness_rog3_loop
    Added Brightness bar to colour wheel tab and when you select PerApp notification colours. 
    Also added a preview at the bottom of the colour picker so that you can get a more accurate idea of what it will look like.

    Rog 3 notifications update: 
    In rog 3 mode there is now a timer refreshing the driver every 30 seconds because rog 3 is a good phone.
    Thanks again to @jawadzoha from my telegram group for rog 3 testing.
  1. 4.5-rog3_notifications
    notification support for rog3
    choice between rog 2 / rog 3 on first launch.
    app should launch on android 11 now
    magisk root notifications are turned off on first launch
  1. 4.4-rog3
    Rog 3 support added.
    All functions work except being able to use only the second led
    Thanks to @jawadzoha from my telegram group for massive testing.

    fixed out of bounds bug that crashes app
  1. 4.3-audio-visualiser
    added an audio visualiser. It has two different mode at the moment. rainbow and single colour mode that you can select from the colourwheel tab
  1. 4.2-battery
    Added battery animations when charging.
    UI update to fix logos from touching each other
  1. 4.1-settings-bypass
    Tiny update that removes the need for the "Click to enable App to read notifications in settings" button. This is because I have figured out how to grant this  permission using a command.

    The "React to Notifications" checkbox now enables and disables access accordingly.
  1. 4.0-save-data
    Added two buttons in the about tab to save and restore all of the settings in the app.
    This way you wont have to set up all of the custom notifications for each app every time there is a new release.
  1. 3.9-ui-update
    Changed all of the switches to use checkboxes, functionality is identical to previous release just visuals changed
  1. 3.8-per-app-animations
    You can now set custom animations/colours for each app by clicking on the app icon in app select
  1. 3.6-ui-detection-easter-eggs
    Added ability to type to filter applications in app select
  1. 3.6-ui-detection-easter-eggs
    Allow more scrolling in all three tabs, this way on smaller screen settings you can 
    scroll down so the power buttons are not blocking the view.

    Implemented os and device checks. App will only run on asus and android 10.

    SystemWriter updated to read files for future.

    UI update

    Easter eggs - animate bg....
  1. 3.5-quick-tile
    Added two quick tiles for toggling the logo led and second led.
  1. 3.4-beta-delay
    New feature added that allows the lights to stop or timeout after a number of minutes or whatever you select.
    So this way if a notification comes on during the night the leds won't be shinning all night long.

    Update to UI
    AnimationsActivity heavily refactored.
    Timer Runnable created in NotificationService
  1. 3.3-beta-app-select
    Added a view to select applications that you want to trigger the leds when they receive notifications.
    Improved UI a little bit
    Updated the about page
  1. 3.2-beta-second_led
    This is a beta release that introduced the use of the second led
  1. 3.1-beta-notifications
    This is a beta release that introduced notification support
  1. 3.0-performance
    Rewrote SystemWriter to only write once per action thereby increasing performance mostly for colour wheel
    ColorWheel fragment now only writes to system if the data is changed instead of everytime the app opens or twice when colour is changed.
  1. 2.0-hotfix
    Issue with fragment not working on stock rom fixed. Stock rom tested working ok without any crashes
  1. initial_release
    Working on HavocOS only.

Screenshots

screenshot 1 screenshot 2 screenshot 3 screenshot 4 screenshot 5 screenshot 6 screenshot 7 screenshot 8 screenshot 9 screenshot 10 screenshot 11 screenshot 12 screenshot 13 screenshot 14 screenshot 15 screenshot 16 screenshot 17 screenshot 18

asus-rog-phone-2-rgb's People

Contributors

artiomsu avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.