• XDA Forums have been migrated to XenForo. We are aware of several issues including missing threads, logins not working, and more. To discuss, use this thread.

[Guide]Add Extra Dashboard Entries in Settings Like Sony Way

W

wolfmannight

Guest
Finally, I found a way to add Extra Dashboard Entries

More guide will come After 5 Jan...
I love Mod like sony do.. , I hate people who add own files in mod
Keep in mind I'm wolfmannight , hahahaha...

==========================================================================​
  1. Extract sonymobile.zip and copy sonymobile folder to \smali\com\ folder #from attachment
    After it Address will like this \smali\com\sonymobile\
    ---------------------------------------------------------------
  2. Extract drawable-xhdpi.zip and copy all .png to drawable-xhdpi folder #from attachment
    ---------------------------------------------------------------
  3. Copy somc_add_dashboard_tiles.xml to [ \res\xml\] #from attachment
    --------------------------------------------------------------
  4. Add Line in public.xml at last xml of xml lines and give your corresponding value 0xNNNNNNNN
    PHP:
        <public type="xml" name="somc_add_dashboard_tiles" id="0x7f060069" />
    -----------------------------------------------------------
  5. Add Line in ids.xml
    PHP:
        <item type="id" name="xperia_connectivity_settings">false</item>
        <item type="id" name="themes_settings">false</item>
        <item type="id" name="call_settings">false</item>
        <item type="id" name="introduction_to_xperia">false</item>
        <item type="id" name="anti_spamming">false</item>
        <item type="id" name="support">false</item>
    ----------------------------------------------------------
  6. Add Line in strings.xml
    PHP:
        <string name="device_connection">Device connection</string>
        <string name="theme_label_xperia">Themes</string>
        <string name="gettoknowit_settings_title">Introduction to Xperia™</string>
        <string name="anti_spam_app_name_settings_txt">Phone number assistant</string>
        <string name="support_settings_title">Support</string>
  7. Open SettingsActivity.smali [ \smali\com\android\settings\SettingsActivity.smali]
    Add this code below this line invoke-virtual {p0, v0, p1}, Lcom/android/settings/SettingsActivity;->loadCategoriesFromResource(ILjava/util/List;)V
    PHP:
        .line 1030
        const v0, 0x7f060069
    
        invoke-static {p0, v0, p1}, Lcom/sonymobile/settings/SomcDashboardTiles;->loadTilesFromResource(Lcom/android/settings/SettingsActivity;ILjava/util/List;)V
    Like this..
    Code:
        .line 1009
        const v0, 0x7f060014
    
        invoke-virtual {p0, v0, p1}, Lcom/android/settings/SettingsActivity;->loadCategoriesFromResource(ILjava/util/List;)V
    
    [COLOR="red"]    .line 1030
        const v0, 0x7f060069
    
        invoke-static {p0, v0, p1}, Lcom/sonymobile/settings/SomcDashboardTiles;->loadTilesFromResource(Lcom/android/settings/SettingsActivity;ILjava/util/List;)V[/COLOR]
    	
        .line 1010
        invoke-direct {p0, p1}, Lcom/android/settings/SettingsActivity;->updateTilesList(Ljava/util/List;)V
    
        .line 1011
        return-void
    -----------------------------------------------------------------------
  8. Add this code below this line Landroid/os/UserHandle;->myUserId()I
    PHP:
        move-result v15
    
        if-eqz v15, :cond_2
    
        invoke-static {v14}, Lcom/sonymobile/settings/SomcDashboardTiles;->isForAllUsers(Lcom/android/settings/dashboard/DashboardTile;)Z
    Like this..
    Code:
        .line 1283
        :cond_1
        :goto_2
        invoke-static {}, Landroid/os/UserHandle;->myUserId()I
    
    [COLOR="Red"]    move-result v15
    
        if-eqz v15, :cond_2
    
        invoke-static {v14}, Lcom/sonymobile/settings/SomcDashboardTiles;->isForAllUsers(Lcom/android/settings/dashboard/DashboardTile;)Z	[/COLOR]
    	
        move-result v15
    
        if-eqz v15, :cond_2
    
        move-object/from16 v0, p0
    
        iget-object v15, v0, Lcom/android/settings/SettingsActivity;->SETTINGS_FOR_RESTRICTED:[I
    
        invoke-static {v15, v6}, Lcom/android/internal/util/ArrayUtils;->contains([II)Z
    
        move-result v15
    
        if-nez v15, :cond_2
    ----------------------------------------------------------------------
  9. Change private to public
    Like this..
    Code:
    .method [COLOR="Red"]public[/COLOR] loadCategoriesFromResource(ILjava/util/List;)V
        .locals 28
        .param p1, "resid"    # I
        .annotation system Ldalvik/annotation/Signature;
            value = {
                "(I",
                "Ljava/util/List",
                "<",
                "Lcom/android/settings/dashboard/DashboardCategory;",
                ">;)V"
            }
        .end annotation
    ----------------------------------------------------------------------------
  10. Open \smali\com\android\settings\dashboard\DashboardCategory.smali
    Add this code below this line # virtual methods
    PHP:
    # virtual methods
    .method public addTile(ILcom/android/settings/dashboard/DashboardTile;)V
        .locals 1
        .param p1, "n"    # I
        .param p2, "tile"    # Lcom/android/settings/dashboard/DashboardTile;
    
        .prologue
        .line 70
        iget-object v0, p0, Lcom/android/settings/dashboard/DashboardCategory;->tiles:Ljava/util/List;
    
        invoke-interface {v0, p1, p2}, Ljava/util/List;->add(ILjava/lang/Object;)V
    
        .line 71
        return-void
    .end method
 

Attachments

Last edited:
W

wolfmannight

Guest
@wolfmannight
can you explain what difference does it make sense?
I couldn't find any difference right now , I'm still working on other Settings things...
If i found anything i will mention it..

But Right now i found ..
No need to create more smali for different new Dashboard entries
only add entry in somc header xml and put xml file in \res\xml folder..
 
W

wolfmannight

Guest
@moonryder
And by this method if "Introduction to Xperia" or "skin-core" apk are not install then it wont show in Settings , So.. No FC if App not installed
 
W

wolfmannight

Guest
Nice Guide :eek::eek:. You could make a guide on how to add switches for dashboard items (wifi / bluetooth / mobile network)?


Thanks :good:
for switches on dashboard guide already on xda , and Sony not use switches in Lollipop+
switches in settings is useless , most of people use SystemUI tiles to on/off
 

gamzekal

New member
Aug 6, 2012
2,297
3,521
0
Fizan
@gamzekal, this is completely different way ...
Before this i was using your way....
PM me your any social account id
Nice Guide .
OK.I will do it:good:
If you want to change font of settings or style of settings or add new subtitle in settings,you dont need to change smali files.You can create your own smali and reference it from related files in xml folder.But you need to change your framework-res.apk for changing style of Settings too
 
Last edited:

445NDO

New member
Nov 22, 2008
5
0
0
can you help me and million other who are stuck with a major app that they all love .. I have LG G2 and we all are missing the live weather app as we uninstalled it by mistake. can you create a flashable zip
 
Last edited:
Our Apps
Get our official app! (coming soon)
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