[TUTORIAL] How to transform your settings.apk in perfect Honami Settings UPDATE 27/11

Search This thread

FranciscoGool

Senior Member
Mar 21, 2012
400
546
México, Coahuila
Yes it does but, it won't work on ics!
Check my settings$headeradapter.smali from my ics settings mod to disable auto-colorization! ;)

thanks for answer me... i see this file not work on ICS but my question is for implement on the Settings for Xperia L and SP...
for ICS, i want to add this function without lose the auto- colorization in the icons, is possible? @rakz992 you can help me?
 

KuaQ

Senior Member
May 4, 2012
631
1,047
Włocławek
kuaq-projects.meximas.com
Hi guys, maybe you know how I can change header color in settings (picture 2 on ss) like a first picture on screen? And how I can delete this blue line under header?

75457095019160356953.png
 

zenesis

Senior Member
Jan 13, 2012
548
151
Xiaomi Mi Mix 3
I'm having errors Sir during decompiling.

Code:
..\3-Out\Settings1.apk\smali\com\android\settings\accounts\ManageAccountsSettings.smali[69,15] no viable alternative at input 'prefs'
..\3-Out\Settings1.apk\smali\com\android\settings\accounts\ManageAccountsSettings.smali[69,21] no viable alternative at input 'Landroid/preference/PreferenceScreen;'



..\3-Out\Settings1.apk\smali\com\android\settings\accounts\ManageAccountsSettings.smali[94,15] no viable alternative at input 'proxyAdapter'
..\3-Out\Settings1.apk\smali\com\android\settings\accounts\ManageAccountsSettings.smali[94,28] no viable alternative at input 'Lcom/sonymobile/settings/preference/ProxyPreferenceRootAdapter;'



Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/android/settings/accounts/ManageAccountsSettings.smali
	at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:72)
	at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:56)
	at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
	at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:338)
	at brut.androlib.Androlib.buildSources(Androlib.java:299)
	at brut.androlib.Androlib.build(Androlib.java:285)
	at brut.androlib.Androlib.build(Androlib.java:258)
	at brut.apktool.Main.cmdBuild(Main.java:236)
	at brut.apktool.Main.main(Main.java:88)
 

DanielFlorin

Senior Member
Nov 3, 2013
994
711
27
Bucharest RO
rodevelopers.blogspot.ro
Pleaseee help me :(

@niaboc79

Compile error, why? How do I fix?
Help me!!! newbie :|

Code:
Log For : Settings.apk 

 Log Type : Recompiling 

 Log Recorded At : 17-Jul-14 -- 14:30:47.45 

 Log Recorded By : Advanced ApkTool v2.0.0 By BDFreak 

------------------------------------------------------ 

..\3-Out\Settings.apk\smali\com\android\settings\AutoSyncDialogFragment$1.smali[27,4] Error for input '.parameter': Invalid directive
..\3-Out\Settings.apk\smali\com\android\settings\AutoSyncDialogFragment$1.smali[42,4] Error for input '.parameter': Invalid directive
..\3-Out\Settings.apk\smali\com\android\settings\AutoSyncDialogFragment$1.smali[43,4] Error for input '.parameter': Invalid directive
..\3-Out\Settings.apk\smali\com\android\settings\AutoSyncDialogFragment$1.smali[42,15] mismatched input '"dialog"' expecting END_METHOD_DIRECTIVE
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/android/settings/AutoSyncDialogFragment$1.smali
	at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:72)
	at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:56)
	at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
	at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:338)
	at brut.androlib.Androlib.buildSources(Androlib.java:299)
	at brut.androlib.Androlib.build(Androlib.java:285)
	at brut.androlib.Androlib.build(Androlib.java:258)
	at brut.apktool.Main.cmdBuild(Main.java:236)
	at brut.apktool.Main.main(Main.java:88)

------------------------------------------------------
 

DanielFlorin

Senior Member
Nov 3, 2013
994
711
27
Bucharest RO
rodevelopers.blogspot.ro
@niaboc79

I followed all the instructions, I've compiled just a few Warning without errors but I do not switch for auto-sync occurs. Why? How can I fix?

No more icons change color when you apply a new theme, why?

What did I do wrong?

Pleasee help.

SS :

dff.png

Compile:
Capture.PNG
 
Last edited:

niaboc79

Recognized Developer / Inactive RT
Sep 8, 2007
12,453
68,231
Enghien
www.nirvana-records.be

DanielFlorin

Senior Member
Nov 3, 2013
994
711
27
Bucharest RO
rodevelopers.blogspot.ro
you have maybe missed a prt.

Icons are not changing according to theme, this is normal.

I checked everything again and did everything right just like you explained. You can look in the archives Settings.apk decompilation. In the archive you have and public.xml in framework-res.

Please check (if you have time) because it feels weird not to have Auto-sync switcher even if we did everything.
Thanks very very much. Good work bro :)

Arhive:

View attachment Settings.rar
 
Last edited:

DanielFlorin

Senior Member
Nov 3, 2013
994
711
27
Bucharest RO
rodevelopers.blogspot.ro
@niaboc79

I discovered Settings.apk not occur.

In Settings_Headers.xml in res / xml to add one row (row 34 of Screenshoot)

Capture.PNG

In res / values ​​/ Ids.xml add at least "<item type="id" name="auto_sync_settings"> false </ item>"

Capture2.PNG

In res/values. string.xml add row " <string name="auto_sync_text">Auto-sync</string> "

Capture3.PNG

in res/values/ public.xml add row " <public type="id" name="auto_sync_settings" id="0x7f09023d" /> " your next id.

So I solved the problem. Not occur auto-sync switch in settings.apk. My android version is JB 4.1.1

Update tutorial ?? Please.

But when I switch to disable auto-sync, Settings.apk force close: (why?

Done :)
Screenshot_2014-07-19-13-04-50.png
 

Top Liked Posts

  • There are no posts matching your filters.
  • 29
    Many people are asking me how to clone Honami settings. Changing some png is not difficult at all but when we need to edit the smali files it's different.

    So I will explain some differents parts such:

    • How to have black text on google account settings.
    • How to add Auto Synch Switcher.
    • How to add your personal sub menu settings.
    • How to add any applications in settings.

    How to have black text on google account settings.

    Many are thinking that the color of this text is defined by an xml in styles.xml or with a color. That's why no body exepting me as been able to have the correct text color.

    This text color is in fact defined by the google account and the color is white by default. Modding the text color inside google applications is not a good solution for Sony dev as an update would have change the color again.

    Sony have choose to convert the white text color to black inside the smali files of settings, so even if the user update the google app, the text will always have the right color.


    attachment.php


    Instructions

    1) Copy GenericSettingsFragment.smali in smali/com/sonymobile/settings

    2) Copy ProxyPreferenceRootAdapter in smali/com/sonymobile/settings/preference

    3) In smali/com/android/settings/accounts/ManageAccountsSettings.smali

    Replace full method addAuthenticatorSettings()V

    Code:
    .method private addAuthenticatorSettings()V
        .locals 3
    
        .prologue
        .line 357
        iget-object v1, p0, Lcom/android/settings/accounts/ManageAccountsSettings;->mAccountType:Ljava/lang/String;
    
        invoke-virtual {p0}, Lcom/android/settings/accounts/ManageAccountsSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
    
        move-result-object v2
    
        invoke-virtual {p0, v1, v2}, Lcom/android/settings/accounts/ManageAccountsSettings;->addPreferencesForType(Ljava/lang/String;Landroid/preference/PreferenceScreen;)Landroid/preference/PreferenceScreen;
    
        move-result-object v0
    
        .line 358
        .local v0, prefs:Landroid/preference/PreferenceScreen;
        if-eqz v0, :cond_0
    
        .line 359
        invoke-direct {p0, v0}, Lcom/android/settings/accounts/ManageAccountsSettings;->updatePreferenceIntents(Landroid/preference/PreferenceScreen;)V
    
        .line 361
        :cond_0
        return-void
    .end method

    by

    Code:
    .method private addAuthenticatorSettings()V
        .locals 4
    
        .prologue
        .line 364
        iget-object v2, p0, Lcom/android/settings/accounts/ManageAccountsSettings;->mAccountType:Ljava/lang/String;
    
        invoke-virtual {p0}, Lcom/android/settings/accounts/ManageAccountsSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
    
        move-result-object v3
    
        invoke-virtual {p0, v2, v3}, Lcom/android/settings/accounts/ManageAccountsSettings;->addPreferencesForType(Ljava/lang/String;Landroid/preference/PreferenceScreen;)Landroid/preference/PreferenceScreen;
    
        move-result-object v0
    
        .line 365
        .local v0, prefs:Landroid/preference/PreferenceScreen;
        if-eqz v0, :cond_0
    
        .line 366
        invoke-direct {p0, v0}, Lcom/android/settings/accounts/ManageAccountsSettings;->updatePreferenceIntents(Landroid/preference/PreferenceScreen;)V
    
        .line 372
        :cond_0
        new-instance v1, Lcom/sonymobile/settings/preference/ProxyPreferenceRootAdapter;
    
        invoke-virtual {p0}, Lcom/android/settings/accounts/ManageAccountsSettings;->getActivity()Landroid/app/Activity;
    
        move-result-object v2
    
        invoke-virtual {p0}, Lcom/android/settings/accounts/ManageAccountsSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
    
        move-result-object v3
    
        invoke-virtual {v3}, Landroid/preference/PreferenceScreen;->getRootAdapter()Landroid/widget/ListAdapter;
    
        move-result-object v3
    
        invoke-direct {v1, v2, v3}, Lcom/sonymobile/settings/preference/ProxyPreferenceRootAdapter;-><init>(Landroid/content/Context;Landroid/widget/ListAdapter;)V
    
        .line 375
        .local v1, proxyAdapter:Lcom/sonymobile/settings/preference/ProxyPreferenceRootAdapter;
        invoke-virtual {p0}, Lcom/android/settings/accounts/ManageAccountsSettings;->getListView()Landroid/widget/ListView;
    
        move-result-object v2
    
        invoke-virtual {v2, v1}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V
    
        .line 376
        return-void
    .end method
    19
    How to add Auto Synch Switcher

    The Honami settings introduce a new switcher that you can use the same way as Wifi and Bluetooth, the Auto Synch Switcher.
    I will show you an easy way to add it but I will have to teach you how are working the ID first :)


    attachment.php


    Little introduction to ID

    What are the ID?

    To tell you what they are, first I must tell you where they are... Open public.xml found in res/value and you will see something like that:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <public type="attr" name="state_encrypted" id="[COLOR="Red"]0x7f010000[/COLOR]" />
        <public type="attr" name="icon" id="0x7f010001" />
        <public type="attr" name="emptyColor" id="0x7f010002" />
        <public type="attr" name="minTickWidth" id="0x7f010003" />
        <public type="attr" name="optimalWidth" id="0x7f010004" />
        <public type="attr" name="optimalWidthWeight" id="0x7f010005" />
        <public type="attr" name="sweepDrawable" id="0x7f010006" />
        <public type="attr" name="followAxis" id="0x7f010007" />
        <public type="[COLOR="DarkOrange"]drawable[/COLOR]" name="preview" id="0x7f0200b8" />
        <public type="drawable" name="appwidget_button_center" id="0x7f020001" />
        <public type="drawable" name="appwidget_button_left" id="0x7f020002" />
        <public type="drawable" name="appwidget_button_right" id="0x7f020003" />
        <public type="drawable" name="btn_check_buttonless_on" id="0x7f020014" />
        <public type="drawable" name="data_sweep_left" id="[COLOR="Lime"]0x7f[/COLOR]020018" />
        <public type="mipmap" name="ic_launcher_settings" id="0x7f[COLOR="Magenta"]03[/COLOR]0000" />
        <public type="layout" name="account_preference" id="0x7f040001" />
        <public type="layout" name="account_sync_screen" id="0x7f040002" />
        <public type="layout" name="add_account_screen" id="0x7f04[COLOR="Silver"]0003[/COLOR]" />

    I've added some color to explain what are the different parts:

    In Red you have the full ID, the long number will be used in the differents smali files as a shortcut.
    In Dark Orange you have the type of ID, there are many differents type such as drawable, layout, styles, id, ...
    In Lime you can see that the 4 first characters are always 0x7f, all IDs used by an apk who are inside this apk are starting by that.
    In Magenta you can see two more characters, these two are related to the type saw earlier, for example type drawable 02, type layout 04, ...
    In Silver you have the last 4 characters who are related to different names used for a same type. These numbers are in hexadecimal.


    I need to show you an other place where you can find ID, inside framework-res.apk, Open public.xml found in res/value and you will see something like that:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <public type="attr" name="theme" id="[COLOR="Red"]0x01010000[/COLOR]" />
        <public type="attr" name="label" id="0x01010001" />
        <public type="attr" name="icon" id="0x01010002" />
        <public type="attr" name="name" id="[COLOR="Lime"]0x010[/color]10003" />
        <public type="attr" name="manageSpaceActivity" id="0x01010004" />
        <public type="attr" name="allowClearUserData" id="0x01010005" />
        <public type="attr" name="permission" id="0x01010006" />
        <public type="id" name="background" id="0x01020000" />
        <public type="id" name="checkbox" id="0x01020001" />
        <public type="id" name="content" id="0x01020002" />
        <public type="id" name="edit" id="0x01[COLOR="Magenta"]02[/color]0003" />
        <public type="id" name="empty" id="0x01020004" />
        <public type="style" name="Animation" id="0x01030000" />
        <public type="style" name="Animation.Activity" id="0x01030001" />
        <public type="style" name="Animation.Dialog" id="0x01030002" />
        <public type="style" name="Animation.Translucent" id="0x01030003" />
        <public type="style" name="Animation.Toast" id="0x01030004" />
        <public type="style" name="Theme" id="0x01030005" />
        <public type="style" name="Theme.NoTitleBar" id="0x0103[COLOR="Silver"]0006[/color]" />

    I have used the same colors as before because this is exactly working the same way with some little variations.

    The first characters are now 0x01 instead of 0x7, that means that these ID are inside framework-res.apk

    BUT be carefull, when the IDs are used inside the smali files of an APK, the first zero after the x is always removed.

    Example: 0x01030002 found in public.xml of framework-res.apk will be wrote inside a smali of an APK -> 0x1030002


    Instructions

    Now I can finally start :)

    1) Copy AutoSyncEnabler.smali, AutoSyncDialogFragment.smali, AutoSyncDialogFragment$1.smali and AutoSyncDialogFragment$2.smali in smali/com/android/settings/

    2) Open AutoSyncDialogFragment.smali with notepad++ and search "0x7" without the quote.

    You will found 4 ID as explained, these ID are related to MY Settings.apk, that means that inside your apk, these "Shortcuts" may not be the good one...

    I have include the public.xml found in MY settings.apk and called it public-settings.xml, open it too with notepad++ and in the same time open YOUR public.xml found in YOUR settings.apk

    Let's do it for the first ID found in the smali: 0x7f0b067a, search now the full ID inside my public.xml, you will found this:

    Code:
    <public type="string" name="data_usage_auto_sync_off_dialog_title" id="[COLOR="Red"]0x7f0b067a[/COLOR]" />

    So this ID is a shortcut for the "string" named "data_usage_auto_sync_off_dialog_title"

    Now search in YOUR public.xml: "data_usage_auto_sync_off_dialog_title" without the quote and check if the full ID is the same. If the ID is different, use this one inside the smali files.

    Do the same with all ID starting by 0x7

    3) Copy Settings$HeaderAdapter.smali in smali/com/android/settings/ and open it with notepad++

    Do a search for all ID starting by 0x7 and check between MY public.xml and YOUR public.xml

    Do also a search for all ID starting by 0x1 (ID related to framework-res.apk) (You must found 5 different ID)

    The first one found is 0x1010208

    As I told you ID related to framework-res.apk found in smali are slightly different when they are in the public.xml of framework-res.apk (Remember the first character after the x ? )

    I have include the public.xml found in MY framework-res.apk and called it public-framework-res.xml. Open MY public-framework-res.xml and YOUR public.xml of YOUR framework-res.apk

    Do a search for "0x01010208" without the quote (I have added a zero after the x ;) ) in MY public.xml and you will found that:

    Code:
    <public type="attr" name="listSeparatorTextViewStyle" id="0x01010208" />

    Now search "listSeparatorTextViewStyle" inside YOUR public.xml and check if the ID are the same, if different replace with the correct one (Don't forget to remove the zero in the smali).
    6
    Update :laugh:

    I've add: How to add Auto Synch Switcher ;)