[MOD][DEV][NX team] Bluelight Fix / AOD touch for all Note7 ported rom

Search This thread

karkasss

Senior Member
Mar 1, 2013
1,642
2,738
*This thread is for dev, Rom maintainer.
Do not flash the attached file without services.jar editing.

*Don't send pm to me with your service.jar anymore. you never get my reply.

.
.
.
.
.
.

Hi all,
This is first mod by NX team
We decide to share our mod with XDA members.
Any dev can use this mod to their own rom with proper credits
This mod will be working with any kernel(selinux permissive) / any variant if you are on Note7 ported rom.

Features are below.
1.Bluelight filter fix
2.AOD notification alarm touch / Music control
(Note7 original behavior)
3.AOD brightness control
(Rooted/Reboot required to take effect)

Credits :
@Patrick.H (NX Team)
@karkasss (NX Team)
@develoid ALT and F4 (AOD touch / Bluelight filter fix)
@asc1977, @DaOldMan (AOD brightness control)
(Please copy & paste when you add our credits)

We say again.
All credits should be mentioned on your OP when you add this mod to your rom.
All codes are not original note7 code but their code written by themselves.
So anybody can notice when you steal our work without credits


Attached file is for AryaMOD note7 users we already modded to show you before & after.
I'm sure you can mod by comparing code for services.jar. (both classes.dex / classes2.dex are modded)
And rest files should be added/replaced.
Do not forget to give proper permission for each file if you try to flash add-on or OTA
(Please see the updater-script)
You can add AOD Brightness control menu to your rom control instead of AODsettings.apk
http://forum.xda-developers.com/showthread.php?p=69653504


Download :
https://drive.google.com/open?id=0ByMmvUc7IhtmbkVEYkI0eklBNW8

Video review :
https://youtu.be/7CsFPvf3vls

Caution :

1. If you do data reset(Factory reset), Bluelight filter will not be working.
Because some files are located in \data\bluelight\
=> Flashing mod file again.

2. Only English string is supported on notification panel when Blulight filter is activating.
If you want to translate to your language, open then edit the string /data/bluelight/filter.cfg

3.Selinux policy should be permissive by kernel to work bluelight filter.

4. http://forum.xda-developers.com/showthread.php?p=69933565

5.Bluelight filter is not working on exynos device. Sorry to late inform you.

Below files from zip are only for AryaMOD note7 users,
because @Kamy (Rom maintainer) deleted quickpanel toggle and setting menu of bluelight filter
-csc/aryamod.xml
-priv-app/SecSettings2

We are considering if we upload our rom which is all these mod included to XDA.
This rom has just pure function of Note7 without any mod.
Let you know our decision soon.
 
Last edited:

karkasss

Senior Member
Mar 1, 2013
1,642
2,738
How to edit your services.jar

classes.dex part

1.AOD brightness control

com\android\server\display\DisplayPowerController.smali

For this smali edit, follow the below instruction.
http://forum.xda-developers.com/showthread.php?p=69653504
But only different string for "eragon_brightness" instead of "aod_brightness"
Because, AODsettings.apk file was aligned with this string "eragon_brightness" already.

2. AOD Touch & Bluelight filter
com\android\server\power\PowerManagerService$BinderService.smali

1)Go to the
.method public setDozeOverrideFromAod(IIILandroid/os/IBinder;)V

2)Search
const-string v0, "PowerManagerService"

2)Add below line
invoke-static {p2}, Lcom/samsung/android/aod/AODTouchDaemon;->call(I)V

like this.
Code:
const/16 v0, 0xff
if-le p3, v0, :cond_2d
:cond_2c
const/4 p3, -0x1
:cond_2d
[COLOR="Blue"]invoke-static {p2}, Lcom/samsung/android/aod/AODTouchDaemon;->call(I)V[/COLOR]
const-string v0, "PowerManagerService"
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;->()V

com\samsung\android\mdnie\MdnieManagerService.smali

1)Search
.field private mDisplayOn:Z

2)Add below line
.field private mDaemon:Lcom/samsung/android/bluelightfilter/KPPDaemon;

like this
Code:
.field private final mContext:Landroid/content/Context;
.field private mCurtainModeIsRunning:Z
[COLOR="blue"].field private mDaemon:Lcom/samsung/android/bluelightfilter/KPPDaemon;[/COLOR]
.field private mDisplayOn:Z
.field private mEbookScenarioEnabled:Z

3)Search
const-string/jumbo v2, "lcd_curtain" or "lcd_curtain"

4)Add below line
invoke-virtual {p0}, Lcom/samsung/android/mdnie/MdnieManagerService;->addFilter()V

like this
Code:
:cond_fa
invoke-direct {p0}, Lcom/samsung/android/mdnie/MdnieManagerService;->setting_is_changed()V
[COLOR="blue"]invoke-virtual {p0}, Lcom/samsung/android/mdnie/MdnieManagerService;->addFilter()V[/COLOR]
return-void
:cond_101
const-string/jumbo v2, "lcd_curtain"

5)Search
# virtual methods

6)Add blue lines
Code:
# virtual methods
[COLOR="blue"].method public addFilter()V
    .locals 2

    new-instance v0, Lnxteam/craftingmod/bluelightfilter/KPPDaemon;

    iget-object v1, p0, Lcom/samsung/android/mdnie/MdnieManagerService;->mContext:Landroid/content/Context;

    invoke-direct {v0, v1}, Lnxteam/craftingmod/bluelightfilter/KPPDaemon;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/samsung/android/mdnie/MdnieManagerService;->mDaemon:Lnxteam/craftingmod/bluelightfilter/KPPDaemon;

    return-void
.end method[/COLOR]
.method public getContentMode()I

7)Search
.method public setmDNIeEmergencyMode(Z)Z

See the above lines.

8)Replaced Red lines by Blue lines

Code:
const-string v2, "/sys/class/mdnie/mdnie/accessibility"
    if-eqz p1, :cond_4a
[COLOR="red"]    const/4 v1, 0x6[/COLOR]
    :cond_4a
[COLOR="Red"]    invoke-static {v2, v1, p2}, Lcom/samsung/android/mdnie/MdnieManagerService;->sysfsWrite_CB_HBM(Ljava/lang/String;I[I)Z[/COLOR]
    move-result v1
    goto :goto_44
.end method


Code:
const-string v2, "/sys/class/mdnie/mdnie/accessibility"
    if-eqz p1, :cond_4a
[COLOR="blue"]    const/4 v1, 0x2[/COLOR]
    :cond_4a
[COLOR="Blue"]    invoke-static {v2, v1, p2}, Lcom/samsung/android/mdnie/MdnieManagerService;->sysfsWrite_CB(Ljava/lang/String;I[I)Z[/COLOR]
    move-result v1
    goto :goto_44
.end method

classes2.dex part
1)Add below smali to /root folder
https://drive.google.com/open?id=0ByMmvUc7IhtmY3JBNzJJUUNMMUE


Important
Don't forget add below permissions to your updater-script

set_perm(0, 2000, 0755, "/system/bin/kppd");
set_perm(0, 2000, 0666, "/data/bluelight/filter.cfg");
set_perm(0, 2000, 0666, "/data/bluelight/kppd.cfg");
 
Last edited:

amour9999

Senior Member
May 7, 2015
113
16
Nice job mate but in the title it's for all Note7 ported ROM however in the downloaded file it's for Aryamod only.
Second point, is the file flashable in any N7 ROM to fix AOD and blue filter.

Thnxx

Sent from my SM-N9005 using Tapatalk
 

karkasss

Senior Member
Mar 1, 2013
1,642
2,738
Nice job mate but in the title it's for all Note7 ported ROM however in the downloaded file it's for Aryamod only.
Second point, is the file flashable in any N7 ROM to fix AOD and blue filter.

Thnxx

Sent from my SM-N9005 using Tapatalk
You do not flash this zip file if you are not on AryaMOD Note7 rom.
This thread is for Dev, Rom maintainer.
So you should wait until they mod.
 

examiner

Senior Member
Oct 25, 2011
656
119
batangas
Thanks dude.. can you make also a settings without fingerprint and iris menu.thanks again.waiting for your instruction how to removed the korean in the notification panel.
 

karkasss

Senior Member
Mar 1, 2013
1,642
2,738
Thanks dude.. can you make also a settings without fingerprint and iris menu.thanks again.waiting for your instruction how to removed the korean in the notification panel.
Wait until I update bluelightfilter.apk for the multi language. I'm not available at this moment.
Other request should be asked via original rom thread.

for the fingerprint, you can delete easily.
etc/permissions/ search *fingerprint~.xml
just delete all.
 
Last edited:

kopitalk

Senior Member
Feb 4, 2012
2,709
2,012
Singapore
File updated.
Korean translated to English on notification panel.
Only english is supported.
If you want translate your language, edit string /data/bluelight/filter.cfg
Is the notification strings supposed to be like this, i.e. mixed Korean and English?
 

Attachments

  • Screenshot_20161125-212707.png
    Screenshot_20161125-212707.png
    78.3 KB · Views: 846
Last edited:

karkasss

Senior Member
Mar 1, 2013
1,642
2,738
Forgive friend @karkass are messed up with 100 things open, and I understood little. Just a simple flash in recovery? And since in the zip I see services.jar but is universal? ...Sorry, but I did not understand
you need to edit your services.jar comparing both file after baksmali.
one is before.zip
the other one is from NXteamMOD_for_AryaMOD_Note7.zip
 

Top Liked Posts

  • There are no posts matching your filters.
  • 48
    *This thread is for dev, Rom maintainer.
    Do not flash the attached file without services.jar editing.

    *Don't send pm to me with your service.jar anymore. you never get my reply.

    .
    .
    .
    .
    .
    .

    Hi all,
    This is first mod by NX team
    We decide to share our mod with XDA members.
    Any dev can use this mod to their own rom with proper credits
    This mod will be working with any kernel(selinux permissive) / any variant if you are on Note7 ported rom.

    Features are below.
    1.Bluelight filter fix
    2.AOD notification alarm touch / Music control
    (Note7 original behavior)
    3.AOD brightness control
    (Rooted/Reboot required to take effect)

    Credits :
    @Patrick.H (NX Team)
    @karkasss (NX Team)
    @develoid ALT and F4 (AOD touch / Bluelight filter fix)
    @asc1977, @DaOldMan (AOD brightness control)
    (Please copy & paste when you add our credits)

    We say again.
    All credits should be mentioned on your OP when you add this mod to your rom.
    All codes are not original note7 code but their code written by themselves.
    So anybody can notice when you steal our work without credits


    Attached file is for AryaMOD note7 users we already modded to show you before & after.
    I'm sure you can mod by comparing code for services.jar. (both classes.dex / classes2.dex are modded)
    And rest files should be added/replaced.
    Do not forget to give proper permission for each file if you try to flash add-on or OTA
    (Please see the updater-script)
    You can add AOD Brightness control menu to your rom control instead of AODsettings.apk
    http://forum.xda-developers.com/showthread.php?p=69653504


    Download :
    https://drive.google.com/open?id=0ByMmvUc7IhtmbkVEYkI0eklBNW8

    Video review :
    https://youtu.be/7CsFPvf3vls

    Caution :

    1. If you do data reset(Factory reset), Bluelight filter will not be working.
    Because some files are located in \data\bluelight\
    => Flashing mod file again.

    2. Only English string is supported on notification panel when Blulight filter is activating.
    If you want to translate to your language, open then edit the string /data/bluelight/filter.cfg

    3.Selinux policy should be permissive by kernel to work bluelight filter.

    4. http://forum.xda-developers.com/showthread.php?p=69933565

    5.Bluelight filter is not working on exynos device. Sorry to late inform you.

    Below files from zip are only for AryaMOD note7 users,
    because @Kamy (Rom maintainer) deleted quickpanel toggle and setting menu of bluelight filter
    -csc/aryamod.xml
    -priv-app/SecSettings2

    We are considering if we upload our rom which is all these mod included to XDA.
    This rom has just pure function of Note7 without any mod.
    Let you know our decision soon.
    18
    How to edit your services.jar

    classes.dex part

    1.AOD brightness control

    com\android\server\display\DisplayPowerController.smali

    For this smali edit, follow the below instruction.
    http://forum.xda-developers.com/showthread.php?p=69653504
    But only different string for "eragon_brightness" instead of "aod_brightness"
    Because, AODsettings.apk file was aligned with this string "eragon_brightness" already.

    2. AOD Touch & Bluelight filter
    com\android\server\power\PowerManagerService$BinderService.smali

    1)Go to the
    .method public setDozeOverrideFromAod(IIILandroid/os/IBinder;)V

    2)Search
    const-string v0, "PowerManagerService"

    2)Add below line
    invoke-static {p2}, Lcom/samsung/android/aod/AODTouchDaemon;->call(I)V

    like this.
    Code:
    const/16 v0, 0xff
    if-le p3, v0, :cond_2d
    :cond_2c
    const/4 p3, -0x1
    :cond_2d
    [COLOR="Blue"]invoke-static {p2}, Lcom/samsung/android/aod/AODTouchDaemon;->call(I)V[/COLOR]
    const-string v0, "PowerManagerService"
    new-instance v2, Ljava/lang/StringBuilder;
    invoke-direct {v2}, Ljava/lang/StringBuilder;->()V

    com\samsung\android\mdnie\MdnieManagerService.smali

    1)Search
    .field private mDisplayOn:Z

    2)Add below line
    .field private mDaemon:Lcom/samsung/android/bluelightfilter/KPPDaemon;

    like this
    Code:
    .field private final mContext:Landroid/content/Context;
    .field private mCurtainModeIsRunning:Z
    [COLOR="blue"].field private mDaemon:Lcom/samsung/android/bluelightfilter/KPPDaemon;[/COLOR]
    .field private mDisplayOn:Z
    .field private mEbookScenarioEnabled:Z

    3)Search
    const-string/jumbo v2, "lcd_curtain" or "lcd_curtain"

    4)Add below line
    invoke-virtual {p0}, Lcom/samsung/android/mdnie/MdnieManagerService;->addFilter()V

    like this
    Code:
    :cond_fa
    invoke-direct {p0}, Lcom/samsung/android/mdnie/MdnieManagerService;->setting_is_changed()V
    [COLOR="blue"]invoke-virtual {p0}, Lcom/samsung/android/mdnie/MdnieManagerService;->addFilter()V[/COLOR]
    return-void
    :cond_101
    const-string/jumbo v2, "lcd_curtain"

    5)Search
    # virtual methods

    6)Add blue lines
    Code:
    # virtual methods
    [COLOR="blue"].method public addFilter()V
        .locals 2
    
        new-instance v0, Lnxteam/craftingmod/bluelightfilter/KPPDaemon;
    
        iget-object v1, p0, Lcom/samsung/android/mdnie/MdnieManagerService;->mContext:Landroid/content/Context;
    
        invoke-direct {v0, v1}, Lnxteam/craftingmod/bluelightfilter/KPPDaemon;-><init>(Landroid/content/Context;)V
    
        iput-object v0, p0, Lcom/samsung/android/mdnie/MdnieManagerService;->mDaemon:Lnxteam/craftingmod/bluelightfilter/KPPDaemon;
    
        return-void
    .end method[/COLOR]
    .method public getContentMode()I

    7)Search
    .method public setmDNIeEmergencyMode(Z)Z

    See the above lines.

    8)Replaced Red lines by Blue lines

    Code:
    const-string v2, "/sys/class/mdnie/mdnie/accessibility"
        if-eqz p1, :cond_4a
    [COLOR="red"]    const/4 v1, 0x6[/COLOR]
        :cond_4a
    [COLOR="Red"]    invoke-static {v2, v1, p2}, Lcom/samsung/android/mdnie/MdnieManagerService;->sysfsWrite_CB_HBM(Ljava/lang/String;I[I)Z[/COLOR]
        move-result v1
        goto :goto_44
    .end method


    Code:
    const-string v2, "/sys/class/mdnie/mdnie/accessibility"
        if-eqz p1, :cond_4a
    [COLOR="blue"]    const/4 v1, 0x2[/COLOR]
        :cond_4a
    [COLOR="Blue"]    invoke-static {v2, v1, p2}, Lcom/samsung/android/mdnie/MdnieManagerService;->sysfsWrite_CB(Ljava/lang/String;I[I)Z[/COLOR]
        move-result v1
        goto :goto_44
    .end method

    classes2.dex part
    1)Add below smali to /root folder
    https://drive.google.com/open?id=0ByMmvUc7IhtmY3JBNzJJUUNMMUE


    Important
    Don't forget add below permissions to your updater-script

    set_perm(0, 2000, 0755, "/system/bin/kppd");
    set_perm(0, 2000, 0666, "/data/bluelight/filter.cfg");
    set_perm(0, 2000, 0666, "/data/bluelight/kppd.cfg");
    9
    This is wonderful [emoji120]

    Sent from my SM-G935F using Tapatalk
    5
    File updated.
    Korean translated to English on notification panel.
    Only english is supported.
    If you want translate your language, edit string /data/bluelight/filter.cfg
    3
    Korean bug fixed. (Bluelightfilter.apk was updated)
    Same link.



    나의 SM-G920K 의 Tapatalk에서 보냄
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone