[Guides & Links] TOUCHWIZ UNIFIED MODS THREAD

Search This thread

daxgirl

Senior Member
Jun 30, 2012
4,047
9,175
Jerusalem
have someone a idea why my systemui.apk stopps if i do this mod in Notificationpanelview.smali

i have done mod in blue and it work. but want to add a main switch for that. logcat says noting special
maybe because i use same locals?

Code:
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NotificationPanelView;->mContext:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v2, "main_switch_bg"

    const/4 v3, 0x0

    invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v1

    const/4 v4, 0x1

    if-ne v1, v4, :cond_ta


[COLOR="Blue"]invoke-virtual {v4}, Landroid/widget/LinearLayout;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v2, "brightness_background_color"

    const v3, 0x0

    invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    invoke-virtual {v4, v3}, Landroid/widget/LinearLayout;->setBackgroundColor(I)V[/COLOR]

:cond_ta
Need more code to try and help you. What method are you editing?

Sent from my SM-N920C using Tapatalk

---------- Post added at 11:28 AM ---------- Previous post was at 11:22 AM ----------

i thanks the guide is an awesome guide
but i only shows another way
for people dont have knowledge enough for modding
dont take me wrong

cheers
Well for that matter you can also just change the boolean in bools.xml in systemui. It checks either that or the build.prop value.

On the other hand this guide is not a heavy modding. It's just a single method to replace.
 
  • Like
Reactions: DaOldMan

tdunham

Inactive Recognized Contributor
Jun 21, 2008
13,686
36,465
TampaBay
Well for that matter you can also just change the boolean in bools.xml in systemui. It checks either that or the build.prop value.

On the other hand this guide is not a heavy modding. It's just a single method to replace.
I think perhaps that the Boolean for rotation is in framework-res.apk. :)
i thanks the guide is an awesome guide
but i only shows another way
for people dont have knowledge enough for modding
dont take me wrong

cheers
You can use customsettings to control toggles if you want something simple to try. It does not have a lot of the extra features but is something we used for a very long time for controlling roms and is not very difficult to learn.
The link should still be on the OP for thread for customsettings.
 
  • Like
Reactions: sanoc69

daxgirl

Senior Member
Jun 30, 2012
4,047
9,175
Jerusalem
I think perhaps that the Boolean for rotation is in framework-res.apk. :)

You can use customsettings to control toggles if you want something simple to try. It does not have a lot of the extra features but is something we used for a very long time for controlling roms and is not very difficult to learn.
The link should still be on the OP for thread for customsettings.
It's in systemui I think. The boolean for 360 rotation is in framework-res. The one for lockscreen I believe is in systemui. But I will check again.

Also I wouldn't worry. In echoe they use Rom control just fine ????????????
 

asc1977

Senior Member
Apr 15, 2012
5,330
6,989
Schwetzingen
Need more code to try and help you. What method are you editing?

Sent from my SM-N920C using Tapatalk

---------- Post added at 11:28 AM ---------- Previous post was at 11:22 AM ----------


Well for that matter you can also just change the boolean in bools.xml in systemui. It checks either that or the build.prop value.

On the other hand this guide is not a heavy modding. It's just a single method to replace.

its .method protected onFinishInflate()V

but it is so long so i didnt wanted to post it but i attached method with my changes
 

sanoc69

Account currently disabled
Jan 12, 2012
4,044
4,189
GB
meettomy.site
I think perhaps that the Boolean for rotation is in framework-res.apk. :)

You can use customsettings to control toggles if you want something simple to try. It does not have a lot of the extra features but is something we used for a very long time for controlling roms and is not very difficult to learn.
The link should still be on the OP for thread for customsettings.

Thanks for the tip
i have my own rom and i have also RC .
i know how to followed the guides and modding
i am talking for many users asking for things and dont know how to
or just dont want learning (lazy)

thanks
 

daxgirl

Senior Member
Jun 30, 2012
4,047
9,175
Jerusalem
its .method protected onFinishInflate()V

but it is so long so i didnt wanted to post it but i attached method with my changes
Never edit directly inFinishIbflate. Create your own method for setting bg. And call it when you need. Once from observer and once from onFinishInflate. You should NEVER write the code directly into onfinishinflate. The rule of thumb is... once you have a function called more than once, create a separate method for it. And call it when needed. Provided you have observer as well, you need another method to call to update data.
Also creating separate method is better for managing locals. Always go for separate method. Try it and tell me if you need help.
 
  • Like
Reactions: asc1977

tdunham

Inactive Recognized Contributor
Jun 21, 2008
13,686
36,465
TampaBay
its .method protected onFinishInflate()V

but it is so long so i didnt wanted to post it but i attached method with my changes

Code:
    const-string v2, "main_switch_bg"

    const/4 v3, 0x0

    invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v1

    [COLOR="Red"]const/4 v4, 0x1
[/COLOR]
    if-ne v1, v4, :cond_ta
	
	
	invoke-virtual {v4}, Landroid/widget/LinearLayout;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v2, "brightness_background_color"

    const v3, 0x0

    invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    invoke-virtual {v4, v3}, Landroid/widget/LinearLayout;->setBackgroundColor(I)V
This will not work, v4 is not a resource and you are not setting background color on a resource. Also, you are overwriting v4 register anyway with your color routine.

Edit:
Plus follow Daxgirl recommendation (she is always right remember :p ) to invoke external method like we do in other smali.
 
Last edited:
  • Like
Reactions: asc1977

daxgirl

Senior Member
Jun 30, 2012
4,047
9,175
Jerusalem
Thanks for the tip
i have my own rom and i have also RC .
i know how to followed the guides and modding
i am talking for many users asking for things and dont know how to
or just dont want learning (lazy)

thanks
Yeah we know thereassaad compiled the rc for you. Just keep your sources open and updated. On either your or friedrichs account on git.
Cheers.

---------- Post added at 11:46 AM ---------- Previous post was at 11:45 AM ----------

This will not work, v4 is not a resource and you are not setting background color on a resource. Also, you are overwriting v4 register anyway with your color routine.
This will not work because he needs a separate method and not such complicated condition inside already complicated method. Which is no less.. a life cycle callback.
 
Last edited:

sanoc69

Account currently disabled
Jan 12, 2012
4,044
4,189
GB
meettomy.site
Yeah we know thereassaad compiled the rc for you. Just keep your sources open and updated. On either your or friedrichs account on git.
Cheers.

ohhh Really? who tell that ?
thereassaad is my friend but he dont compiled nothing for me
and just fyi i dont use echoe rom
i have my own rom
enough for me
have a nice day
 

daxgirl

Senior Member
Jun 30, 2012
4,047
9,175
Jerusalem
ohhh Really? who tell that ?
thereassaad is my friend but he dont compiled nothing for me
and just fyi i dont use echoe rom
i have my own rom
enough for me
have a nice day
As long as your sources are provided, you are welcome. :good:

As it goes, the answer to "who told me that" is "the person who compiled the apk for you told me that".

And as for not using echoe rom, seriously, your loss. I hear it's like the best rom in the world. The lead developer from what I understand is this super genius guy. And one of the most talented developers. If not THE most talented. So I highly recommend you at least try it.

And that, my friend, is how you kick ass and maintain plausible deniability. LMAO :angel:
 
Last edited:

aceqott

Senior Member
Mar 6, 2013
266
252
CA
Aaaaaand... it's done. Next 6thGear teaser ????
Fully compatible with themes. Including updating theme color if custom colors are disabled as soon as theme is applied. Reverting to current theme colors once the custom colors are turned on in rc.

Awesome!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I have no words to describe how I feel right now.:victory::victory::victory::victory::victory::
 

sonnguyenpg

Senior Member
Aug 13, 2013
60
15
Aaaaaand... it's done. Next 6thGear teaser ????
Fully compatible with themes. Including updating theme color if custom colors are disabled as soon as theme is applied. Reverting to current theme colors once the custom colors are turned on in rc.

amazing, really unbelievable. II look forward to your guidance.
how to do it with this.
before
a87e2ba407dbc78a5633b1d11cbfc203.jpg

after selecting a theme
421d67392fc198353a5469883ce31893.jpg
 
Last edited:
  • Like
Reactions: tona182000

asc1977

Senior Member
Apr 15, 2012
5,330
6,989
Schwetzingen
Never edit directly inFinishIbflate. Create your own method for setting bg. And call it when you need. Once from observer and once from onFinishInflate. You should NEVER write the code directly into onfinishinflate. The rule of thumb is... once you have a function called more than once, create a separate method for it. And call it when needed. Provided you have observer as well, you need another method to call to update data.
Also creating separate method is better for managing locals. Always go for separate method. Try it and tell me if you need help.
Sure i try and thx for help but now i am at work. I try asap i am free. Only for your better understanding what i do with that look here

http://xdaforums.com/showpost.php?p=68106083&postcount=875

I can switch all colors off but this one i needed. Its for brightness slider background. I adapt @tdunhams guide from 6.0.1 to priject grace but there are differences which ids to use and i added some more customizations. For normal 6.0.1 there are a extra guide with xml edits and no notificationpanelview edit but that is not what i want [emoji2]
I dont give up. I am short before goal. Only that one problem but i will solve and maybe a new guide for especially grace if it make sense. Additional to tdunhams guide



Sent from my SM-N930F using XDA-Developers mobile app

---------- Post added at 14:57 ---------- Previous post was at 14:54 ----------

Aaaaaand... it's done. Next 6thGear teaser ????
Fully compatible with themes. Including updating theme color if custom colors are disabled as soon as theme is applied. Reverting to current theme colors once the custom colors are turned on in rc.

https://youtu.be/VZs4Ezs9bA0
Omg perfect. Exactly what i need additional to my mod [emoji2]

Sent from my SM-N930F using XDA-Developers mobile app
 
  • Like
Reactions: sonnguyenpg

lucadalba

Senior Member
Dec 4, 2015
435
487
[GUIDE][SOLUTION] How to add EXTRA\hidden notification panel TOGGLES in S5 MM 6.0.1 WITHOUT LOSING THEM on REBOOT

Hello to all.
Hope this guide will be useful :)

As you can know, there are some extra toggles that can be added in notification panel.

Working extra toggles are:
- TorchLight
- SFinder
- QuickConnect
- AirGesture
- AirView
- SBeam

All toggles list are located in System section of ettings DB.
In S5 there are 3 items for the toggles in Setings DB:
- notification_panel_active_app_list (this contains the ACTUAL order of toggles and if we edit toggles order, the new order will be saved here, and if we edit its value, toggles order will be immediately edited)
- notification_panel_active_app_list_for_reset (this contains the default toggles order, if we press reset button in notification panel settings, his value will be put in notification_panel_active_app_list, so toggles order will be resetted)
- notification_panel_default_active_app_list (it has the same value of notification_panel_active_app_list_for_reset but it is never used)

For editing this strings we could install @Wuby986 and @daxgirl's DBeditor and change the value of this 3 items adding extra toggles names, and it works fine, UNTIL YOU REBOOT

It's strange but when you reboot (if you add extra toggles) notification_panel_active_app_list and notification_panel_active_app_list_for_reset WILL BE RESETTED TO A DEFAULT VALUE (wrotten in SecSettingsProvider)

So searching in SecSettingsProvider smali, I've found that some toggles are not allowed by some CSC, so if you put extra (not allowed) toggles in your notification panel, the toggles order (notification_panel_active_app_list but also notification_panel_active_app_list_for_reset) will be resetted after reboot.

So how to solve?
It isn't properly a fix, but a good solution in my opinion.
We will use the item notification_panel_default_active_app_list because it's NEVER USED and above all it WILL *NOT* BE RESETTED AFTER REBOOT.

When you edit toggles order with settings, the new order will be saved in notification_panel_active_app_list (that will be resetted on reboot if contains extra toggles).
What we are going to do is edit SecSettings.apk to get the edited toggles will be saved also in notification_default_panel_active_app_list.
Then we will use @Wuby986 and @daxgirl's BootReceiver (an app that execute its own actions IMMEDIATELY AFTER REBOOT) to put the value of notification_panel_default_active_app_list (that now contains new toggle order) into notification_panel_active_app_list (that contains the actual toggles order and it is resetted after reboot).


So let's start!

Decompile SecSettings.apk and go into /smali/com/android/settings/NotificationPanelMenu.smali

Search for method .method private saveAppslist()V and ADD the highlihted BLUE code

Code:
.method private saveAppslist()V

.
.
.
.

    invoke-virtual {p0}, Lcom/android/settings/NotificationPanelMenu;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v4

    const-string v5, "notification_panel_active_app_list"

    invoke-static {v4, v5, v0}, Landroid/provider/Settings$System;->putString(Landroid/content/ContentResolver;Ljava/lang/String;Ljava/lang/String;)Z
    
    [COLOR=blue]invoke-virtual {p0}, Lcom/android/settings/NotificationPanelMenu;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v4

    const-string v5, "notification_panel_default_active_app_list"

    invoke-static {v4, v5, v0}, Landroid/provider/Settings$System;->putString(Landroid/content/ContentResolver;Ljava/lang/String;Ljava/lang/String;)Z[/COLOR]

    invoke-virtual {p0}, Lcom/android/settings/NotificationPanelMenu;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v4

    const-string v5, "notification_panel_active_number_of_apps"

    const/16 v6, 0xa

    invoke-static {v4, v5, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v4

    iput v4, p0, Lcom/android/settings/NotificationPanelMenu;->mActiveAppsNum:I

    return-void
.end method
When you change toggles order, the above code will save the new order also in notification_panel_default_active_app_list (that will NOT be resetted after reboot)


Now search for method .method private resetPanel()V and ADD the highlihted BLUE code

Code:
.method private resetPanel()V
    .locals 6

    .prologue
    invoke-virtual {p0}, Lcom/android/settings/NotificationPanelMenu;->getActivity()Landroid/app/Activity;

    move-result-object v3

    const-string v4, "com.android.settings"

    const-string v5, "RQSB"

    invoke-static {v3, v4, v5}, Lcom/android/settings/Utils;->insertLog(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {p0}, Lcom/android/settings/NotificationPanelMenu;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    .local v2, "cr":Landroid/content/ContentResolver;
    const-string v3, "notification_panel_active_app_list_for_reset"

    invoke-static {v2, v3}, Landroid/provider/Settings$System;->getString(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .local v0, "activeApps":Ljava/lang/String;
    const-string v3, "notification_panel_active_number_of_apps_for_reset"

    const/16 v4, 0xa

    invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v1

    .local v1, "activeAppsNum":I
    invoke-virtual {p0}, Lcom/android/settings/NotificationPanelMenu;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "notification_panel_active_app_list"

    invoke-static {v3, v4, v0}, Landroid/provider/Settings$System;->putString(Landroid/content/ContentResolver;Ljava/lang/String;Ljava/lang/String;)Z
    
    [COLOR=blue]invoke-virtual {p0}, Lcom/android/settings/NotificationPanelMenu;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "notification_panel_default_active_app_list"

    invoke-static {v3, v4, v0}, Landroid/provider/Settings$System;->putString(Landroid/content/ContentResolver;Ljava/lang/String;Ljava/lang/String;)Z[/COLOR]
	
	.
	.
	.
	.
	
.end method

When you reset toggles order, the above code will also reset notification_panel_default_active_app_list, because (thanks to BootReceiver) when you reboot, its value will become the actual toggles order, and if you reset toggles and not reset this value, you will got old toggles order after reboot.

Now save changes, recompile the app and put it into /system/priv-app/SecSettings (and give rwxr-xr-x permissions to the folder and rw-r--r-- permissions to the apk).


Now you have to FLASH THE ZIP ATTACHED AT THIS POST to install edited (by myself) BootReceiver for automatically adding the 6 extra toggles wrotten at the top of this post and for making this mod fully working, or you can also BUILD BOOTRECEIVER FROM MY SOURCES (because they contains the proper code for this mod) and then install it in /system/priv-app .

The second option (building BootReceiver from sources) should be used (for this mod) only if you want to edit the default toggles order (adding or deleting toggles) and you just need to edit a string in strings.xml .
DO NOT EDIT OTHER STRINGS or JAVA CODE if you don't know what you're doing!!

Anyway I want to remember that BootReceiver is OPEN SOURCE and if you build it from sources and you use it into your rom, you MUST PROVIDE YOUR SOURCES.

So, if you want to build from my sources and share into your rom, here is how to do (I want to remember BootReceiver code has been created by @daxgirl and @Wuby986 , I link my sources because they are edited properly for this mod and anyway they are forked from original repository, that can be accessed here)

1. Log into your GitHub account (don't have one? Join it! It's a simple operartion and you will need GitHub to share your sources)
2. Open this link (my repository): https://github.com/lucadalba/BootReceiver
3. Now CLICK ON FORK button on top right corner of page (this will create a copy of this repository into your account)
4. Now GitHub will redirect you to your copy of BootReceiver repository
5. Click on COPY OR DOWNLOADbutton, so COPY THE LINK THAT WILL APPEAR IN THE TEXTBOX (I will call it "Your repo URL")(should be https://github.com/yourusername/BootReceiver.git )
6. Open Android Studio, click on File>New>Project from Version Control>Git
7. Paste Your repo URL in Git Repository Url and then click on Clone
8. Wait all processes will finish (if you get gradle error, in the log you should found a link to automatically fix, click on it and continue)
9. Now open the Project tab on the right of the window and go in /app/res/values/double click on strings.xml
moNcx


Here is what you will found. You should need to edit only the BLUE HIGHLIGHTED string

Code:
<resources>

    <!--App strings-->
    <string name="app_name">Boot Receiver</string>
    <string name="boot_complete_toast">Boot completed - Quickpanel toggles setted</string>


    <!--Keys and values - untranslatable-->

    <!--Key of the item in Settings DB that contains ACTUAL TOGGLES ORDER-->
    <!--It will be resetted on reboot and you have to apply xda mod to solve-->
    <string name="tiles_key" translatable="false">notification_panel_active_app_list</string>

    <!--Key of the item in Settings DB that contains toggles order APPLIED WHEN YOU RESET TOGGLES order-->
    <!--It will be resetted on reboot and you have to apply xda mod to solve-->
    <string name="tiles_reset_key" translatable="false">notification_panel_active_app_list_for_reset</string>

    <!--Key of the item in Settings DB that is never used by the system-->
    <!--So we have previously edited this (with xda mod) and now it will contain the same value of notification_panel_active_app_list-->
    <!--The advantage is that this will NEVER BE RESETTED on reboot and so (because this contains notification_panel_active_app_list BEFORE REBOOT)-->
    <!--we will take the Settings DB value of this item and we will put it into notification_panel_active_app_list AFTER REBOOT-->
    <string name="tiles_default_key" translatable="false">notification_panel_default_active_app_list</string>



    <!--This contains the names of all toggles we want in Notification Panel -->
    <!--This will be put into notification_panel_active_app_list_for_reset on every reboot -->
    <!--On first rom boot it will be put also in notification_panel_active_app_list and notification_panel_default_active_app_list -->
    <string name="tiles_reset_value" translatable="false">[COLOR=blue]Wifi;MobileData;Location;TorchLight;SilentMode;AutoRotate;Bluetooth;WiFiHotspot;AirplaneMode;DormantMode;Nfc;SBeam;AllShareCast;CarMode;QuickConnect;Toolbox;MultiWindow;TouchSensitivity;PowerSaving;UltraPowerSaving;AirGesture;AirView;SmartStay;SmartPause;NetworkBooster;PersonalMode;SFinder;Sync;[/COLOR]</string>


</resources>

Every toggle is called as following:
Code:
Name[b];[/b]

So if you know other extra toggles names you can put their name into string, if you want to delete some toggles, just delete their names.
You can also edit toggles order on reset moving toggles names in the string.

When you have done your modifications, click on Build>Build APK , wait a minute and a notification should notice you that apk has been created.
Click on notification link and you should see app-debug.apk and app-debug-unaligned.apk
Raname app-debug.apk to BootReceiver.apk , copy it into /system/priv-app/BootReceiver into your phone and give rwxr-xr-x perms to folder and rw-r--r-- perms to apk.
Then reboot.
Done! ;)

For sharing your updated sources press on VCS>Git>Push , it will appear a list with edited files to upload and a Comment section.
In the comment section write a small description of your edits, then click on "Commit and PUSH".
It will appear a login window and you have to put into it your github username and password, than login (if a window will ask you to set a new password, do it), after this click on Push button and updated files will be uploaded into your repo;)

Hope this guide will be useful and sorry if there aren't some informations or this is too long.. it's my first guide more difficult than previos 2 i shared.
Thanks to xda and to @tdunham and all Samsung modders for this fantastic thread and guides:)
 

Attachments

  • BootReceiver_precompiled.zip
    166.7 KB · Views: 102
Last edited:

tdunham

Inactive Recognized Contributor
Jun 21, 2008
13,686
36,465
TampaBay
[GUIDE][SOLUTION] How to add EXTRA\hidden notification panel TOGGLES in S5 MM 6.0.1 WITHOUT LOSING THEM on REBOOT
Now I am curious if the S5 is still doing old method that requires this because in other versions of MM, they have converted back to using features.xml or others.xml to set default toggles.
Look in yours to see if they exist.
In Note 5 version, it is others.xml and line to edit, if it exists, yours may be different
<CscFeature_SystemUI_ConfigDefQuickSettingItem>
 

daxgirl

Senior Member
Jun 30, 2012
4,047
9,175
Jerusalem
Now I am curious if the S5 is still doing old method that requires this because in other versions of MM, they have converted back to using features.xml or others.xml to set default toggles.
Look in yours to see if they exist.
In Note 5 version, it is others.xml and line to edit, if it exists, yours may be different
<CscFeature_SystemUI_ConfigDefQuickSettingItem>
They do. Both s5 and note 4 use the old way. And the string for qs tiles is also in system and not in secure table.

Sent from my SM-G920F using Tapatalk
 

Top Liked Posts