[GUIDE] ICS Style 'Settings.apk' - Make it yourself !! !!

Search This thread
S

s3l3ct4

Guest
Excellent Guide, helped me theme my SystemUI.apk. Pretty incredible what you can do when you decompile an apk's .xml files!
 

SpaceCaker

Senior Member
Mar 26, 2011
13,545
10,904
netherlands
www.youtube.com
for the toggles remove the both wifi and bluetooth lines

and add


HTML:
<CheckBoxPreference android:persistent="false" android:title="@string/wifi_quick_toggle_title" settings:icon="@drawable/ic_settings_wireless" android:key="toggle_wifi" android:summary="@string/wifi_quick_toggle_summary" />
    

<CheckBoxPreference android:persistent="false" android:title="@string/bluetooth_quick_toggle_title" settings:icon="@drawable/ic_settings_bluetooth2"  android:key="toggle_bluetooth" android:summary="@string/bluetooth_quick_toggle_summary" />
 

balamu96m

Senior Member
May 2, 2011
1,216
1,304
Chennai
for the toggles remove the both wifi and bluetooth lines

and add


HTML:
<CheckBoxPreference android:persistent="false" android:title="@string/wifi_quick_toggle_title" settings:icon="@drawable/ic_settings_wireless" android:key="toggle_wifi" android:summary="@string/wifi_quick_toggle_summary" />
    

<CheckBoxPreference android:persistent="false" android:title="@string/bluetooth_quick_toggle_title" settings:icon="@drawable/ic_settings_bluetooth2"  android:key="toggle_bluetooth" android:summary="@string/bluetooth_quick_toggle_summary" />


tried that.......but that isn't working..........need to edit some smali.............
 

Erhany

Senior Member
Feb 9, 2012
455
1,028
com/erhany
erhany.weebly.com
good work ! thanks but Im freakin out ! it doesnt work for me!
I try my Xperia arc 2.3.4 original system files , apktool if framework-res.apk ... 1.apk OK! but what is 2.apk ? It says can't find framework resources for package of id: 2.
I dont have twframework-res on my system/framework on arc! i tried semcgenericuxpres.apk is it true ? need help ! I want to try to edit my GB settings.apk look like ICS.. :/
 

gummie

Senior Member
Dec 12, 2011
929
482
Calamba
Im stuck on Step 8 (Building) I always get error so I cant find the neccessary file to copy and make that Settings-New

Code:
C:\>apktool b C:\Settings
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
C:\Settings\res\xml\settings.xml:8: error: Error: No resource found that matches
 the given name (at 'icon' with value '@drawable/ic_settings_bluetooth2').
C:\Settings\res\xml\settings.xml:11: error: Error: No resource found that matche
s the given name (at 'icon' with value '@drawable/ic_settings_more').
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\MARVIN~1\AppData\Local\Tem
p\APKTOOL4619853779678069497.tmp, -I, C:\Users\Marvin Bermudez\apktool\framework
\1.apk, -S, C:\Settings\res, -M, C:\Settings\AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:193)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
        at brut.androlib.Androlib.buildResources(Androlib.java:248)
        at brut.androlib.Androlib.build(Androlib.java:171)
        at brut.androlib.Androlib.build(Androlib.java:154)
        at brut.apktool.Main.cmdBuild(Main.java:182)
        at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
sers\MARVIN~1\AppData\Local\Temp\APKTOOL4619853779678069497.tmp, -I, C:\Users\Ma
rvin Bermudez\apktool\framework\1.apk, -S, C:\Settings\res, -M, C:\Settings\Andr
oidManifest.xml]
        at brut.util.OS.exec(OS.java:83)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
        ... 6 more

This is always the Output when I finally building. Please help me Im Stuck.

Edit: Somehow I find my problem, its when I edit Wireless on Settins.xml and add this lines.

2imamv.png


Is there something wrong on my Codes? Coz Im sure I copied the Target File correctly.
 
Last edited:

klin1344

Senior Member
Nov 11, 2011
3,486
5,611
Thanks for the awesome guide! :D
btw, do you know how I would adjust the color of the settings.apk background? I can see in your screenshot it is kind of gray-ish, whereas mine, from a samsung rom, is completely black.
 

MicroLizard

Senior Member
Feb 20, 2012
251
216
Bandung, ID
Need your help.
I want to try decompile settings.apk but always got error.:confused:

Code:
-------------------------------------------------------------------------- 
|Sun 07/01/2012 -- 16:03:02.06| 
-------------------------------------------------------------------------- 
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) Client VM (build 20.2-b06, mixed mode, sharing)
Could Not Find C:\Program Files\Android SDK\android-sdk_r12-windows\android-sdk-windows\platform-tools\place-apk-here-for-modding\../place-apk-here-for-modding/signedSettings.apk
Could Not Find C:\Program Files\Android SDK\android-sdk_r12-windows\android-sdk-windows\platform-tools\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedSettings.apk
I: Baksmaling...
I: Loading resource table...
W: Skipping "android" package group
I: Loaded.
I: Loading resource table from file: C:\Users\Ukky\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 23
	at java.lang.String.charAt(Unknown Source)
	at brut.androlib.res.xml.ResXmlEncoders.findNonPositionalSubstitutions(ResXmlEncoders.java:165)
	at brut.androlib.res.xml.ResXmlEncoders.enumerateNonPositionalSubstitutions(ResXmlEncoders.java:142)
	at brut.androlib.res.data.value.ResStringValue.encodeAsResXmlValue(ResStringValue.java:45)
	at brut.androlib.res.data.value.ResArrayValue.serializeToResValuesXml(ResArrayValue.java:55)
	at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:264)
	at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:137)
	at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:93)
	at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
	at brut.apktool.Main.cmdDecode(Main.java:120)
	at brut.apktool.Main.main(Main.java:57)
 

balamu96m

Senior Member
May 2, 2011
1,216
1,304
Chennai
Ove or done ?

Sent from my GT-S5830 using xda premium

I found some important clues......i hope i finish it very soon
!!




Need your help.
I want to try decompile settings.apk but always got error.:confused:

Code:
-------------------------------------------------------------------------- 
|Sun 07/01/2012 -- 16:03:02.06| 
-------------------------------------------------------------------------- 
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) Client VM (build 20.2-b06, mixed mode, sharing)
Could Not Find C:\Program Files\Android SDK\android-sdk_r12-windows\android-sdk-windows\platform-tools\place-apk-here-for-modding\../place-apk-here-for-modding/signedSettings.apk
Could Not Find C:\Program Files\Android SDK\android-sdk_r12-windows\android-sdk-windows\platform-tools\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedSettings.apk
I: Baksmaling...
I: Loading resource table...
W: Skipping "android" package group
I: Loaded.
I: Loading resource table from file: C:\Users\Ukky\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 23
at java.lang.String.charAt(Unknown Source)
at brut.androlib.res.xml.ResXmlEncoders.findNonPositionalSubstitutions(ResXmlEncoders.java:165)
at brut.androlib.res.xml.ResXmlEncoders.enumerateNonPositionalSubstitutions(ResXmlEncoders.java:142)
at brut.androlib.res.data.value.ResStringValue.encodeAsResXmlValue(ResStringValue.java:45)
at brut.androlib.res.data.value.ResArrayValue.serializeToResValuesXml(ResArrayValue.java:55)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:264)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:137)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:93)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:120)
at brut.apktool.Main.main(Main.java:57)

I would recommend using apktool because detecting probs will be easier..........
 

BohArie

Senior Member
Dec 15, 2011
825
77
Kuching
need your help.

Wifi on/off almost over!!

Sent from my GT-I5801 using XDA

balamu96, how to fix cmparts.apk
urm, when I open sound mode in interface it should multi choose but I can choose only one..
I mean, check box.
how to put multi listpreference on cmparts.apk?
sorry to bother u about this problem, hope U will help me in my problem...
any way thanks for ICS setting step by step guide. very helpful thread.
 

balamu96m

Senior Member
May 2, 2011
1,216
1,304
Chennai
balamu96, how to fix cmparts.apk
urm, when I open sound mode in interface it should multi choose but I can choose only one..
I mean, check box.
how to put multi listpreference on cmparts.apk?
sorry to bother u about this problem, hope U will help me in my problem...
any way thanks for ICS setting step by step guide. very helpful thread.



I do not know how to do that !! You can use google to find any tutorial thread...............

What i know is, it cannot be done with .xml files. We need to edit smali files. To edit smali files, we should know the Dalvik opcodes. These Opcodes & their functions can be found here: http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html

Stackoverflow.com will also help you in doing so!
Good luck!
 
  • Like
Reactions: BohArie

BohArie

Senior Member
Dec 15, 2011
825
77
Kuching
I do not know how to do that !! You can use google to find any tutorial thread...............

What i know is, it cannot be done with .xml files. We need to edit smali files. To edit smali files, we should know the Dalvik opcodes. These Opcodes & their functions can be found here: http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html

Stackoverflow.com will also help you in doing so!
Good luck!

thank u for reply..
stackoverflow.com, already search on this thread but I dont understood every thing on this website..
thanks again...
how about wifi and bluetooth on/off?? already success or not?
 

balamu96m

Senior Member
May 2, 2011
1,216
1,304
Chennai
i can't decompile settings.apk even if i don't modify it... i tried this for more than 5 hours nothing works... i post here the problem in more detail
( http://xdaforums.com/showthread.php?p=29218359#post29218359 ) I can compile and decompile other apps but some would cause the apk manager to crash...

in apktool you must first load your framework-res.apk

this command would do:

Code:
apktool if framework-res.apk

if you have twframework-res or htc framework etc, load them also!!:good:
 

Top Liked Posts

  • There are no posts matching your filters.
  • 252
    android_tutorial.jpg

    Hi all !! This is a guide on how to mod your Settings.apk to make it like an ICS's one !!

    My sincere credits to iiandskater. He is the one who FIRST made MODS like this. I learnt these by comparing his MOD !!
    He hasn't come up with a guide because he doesn't have time . (I think so!)

    If you have completed modding and posting it ( on any website/forum), then please give credits and give a link to this thread !! This helps it reaching more people !! Thanks.


    Pre-requisites:
    -7zip
    -Notepad++

    This guide helps you to mod your settings' main screen only. If you want mod even other screens, then you need to read - why this/that step is done.
    If you want to know 'Why is this/that step done?' , then read the post completely !!:D

    I'll start from the basics.


    Starting with basics:

    1. Decompile your Settings.apk with 'apktool' (or) Apk Multi-tool (or) anything like that of your comfort !
    Why is this/that step done?: It is done in order to decode .xml files the apk.
    I decompiled with apktool.
    00.png



    2. Now navigate to Decompiled_Folder\res\values

    3. There, open 'strings.xml' with notepad++
    1.png


    4. Go to the very end of the file, there above </resources>, add the following:
    Code:
     <string name="location_settings_title">Location service</string>
        <string name="settings_ics_system">SYSTEM</string>
        <string name="settings_ics_radio">WIRELESS & NETWORKS</string>
        <string name="settings_radio_more">More...</string>
        <string name="settings_ics_device">DEVICE</string>
        <string name="settings_ics_personal">PERSONAL</string>
        <string name="settings_ics_system_cap">SYSTEM</string>
        <string name="power_usage_summary_text">Battery</string>

    It should look like this:
    2.png


    Now save the file and close it.

    Why is this/that step done?: This is for the 'text' that appear at different places. For example:
    txt1.png



    5. Now navigate to decompiled_folder\res\xml\

    6. There open 'settings.xml' with notepad++
    4.png


    Any phone's user can follow upto this blindly, but from here you should do similar things for your phone.

    HTC users, read this


    7. Your 'settings.xml' will look like this (may not be exact)(this is my modded settings.xml - i'll explain what i have modded):
    4a.png


    Now i have separated different 'things'/tags with an empty line between them, so that you won't get confused:

    5aaa.png


    Here, i will explain every different 'things'/tags with only one example, other things, you yourself will have try because others will be similar to what i explain.

    Preference screen:
    From the above picture, i am taking only the circled (can't 'define' its radius lol :D).
    mod2.png


    Now lets zoom it:
    mod1.png


    On reading it, you yourself can understand that:

    ---android:title="@string/wifi_quick_toggle_tittle" refers to a TEXT registered under the string name "wifi_quick_toggle_tittle" in the 'strings.xml'.
    Now check in your 'strings.xml', which is located at res/values/, by searching for "wifi_quick_toggle_tittle". There you will find this line/line similar to this:
    Code:
     <string name="wifi_quick_toggle_title">Wi-Fi</string>
    You can very well understand that the TEXT between the tags here(in strings.xml) will appear on the screen :D:D !!

    ---settings:icon="@drawable/ic_settings_wireless"> refers to the icon located at res/drawable-ldpi (or) res/drawable-xxxx(that of your phone).

    You can leave other things as it is but except for android:targetClass="com.android.settings.wifi.WifiSettings". This is because according to this only, you are directed to another screen on selecting it !!

    Here, i need to go to Wi-Fi settings on selecting it directly from the main screen. So i need to change it.
    To change, i opened res/xml/wireless_settings.xml

    There, like what we have seen earlier, many preference screens will be defined. There i found the preference screen of Wi-Fi settings
    I copied the android:targetClass="xxxxxxxxxxxx"(something given there) to Settings.xml file.

    If you want to do it for Bluetooth, then copy any of the preference screen completely [from <com.android.settings...... to </com.android.settings.IconPreferenceScreen>
    Then make changes in the title , icon, and target classs.

    Not yet over, last thing:
    Adding custom categories like Device, Personal, System etc.
    It is this line that makes it:
    Place it anywhere above (or) in-between any two preference screens !!
    Code:
    <PreferenceCategory android:title="@string/settings_ics_radio" />

    6aaa.png


    About icons, I'll tell after re-compiling.


    8. Re-Compiling it:

    After making all necessary changes and saving the 'xml' files, re-compile (or) build the apk. You should not get any error.

    9. After building it, you'll find the new 'Settings.apk' in decompiled_folder/dist. Do NOT use it.

    Now Go the folder where you have ORIGINAL/STOCK Settings.apk. Now simply extract it to any folder, say "settings-new", using 7zip.

    8. Now go to decompiled_folder/build/apk
    From there copy the 'resources.arsc' file and paste it in "Settings-new" folder. Replace it.

    9. Now again, go to decompiled_folder/build/apk/res/xml. There copy 'settings.xml'
    Paste it in Settings-new/res/xml folder. Replace if asked.

    10. ICONS:
    After downloading the icons.zip, you'll find the icons in 'drawable-ldpi' folder. Copy everything and paste it in Settings-new/res/drawable-xxxx (that of your phone). [If you do not know what is that 'xxxx' for your phone, then paste it in every 'drawable-ldpi/mdpi' folder]
    Replace if asked.

    11. Now come back and open "Settings-new" folder. You'll find 6 objects there, including folders. Now select them all --> "7zip" --> "Add to archive...". There, select 'Archive format as 'zip'and 'compression level' as 'Store' and then select 'ok'.

    12.Now rename the newly formed 'xxxx.zip' file to 'xxxx.apk'.
    Before copying to system/app rename it to Settings.apk instead some xxxx.apk !!

    Now your apk is ready to be put in system/app !!


    If you have completed everything and would like to distribute it, then download the 'Pre-scripted-update.zip' from attachments.
    Open the archive with 7zip (no need to extract) go to system/app. Just drag and drop your modded 'Settings.apk'.
    Thats all !! Close it and flash it via recovery !!

    Thats all....i believe........still can refine it.......!
    Icons-uploaded........!!

    If you have completed modding and posting it ( on any website/forum), then please give credits and give a link to this thread !! This helps it reaching more people !! Thanks.

    If you like this thread, the hit THANKS !!
    10
    You're welcome !!
    6
    thanks for this guide i'm searching from 5 days to but i can't find.
    6
    EDIT :::: saw what i did wrong XD

    now working correctly
    5
    great guide!

    balamu96m great guide man, thanks a lot!