FORUMS
Remove All Ads from XDA

[MOD][GUIDE] ICS+ Tabbed settings(MIUI Like)

549 posts
Thanks Meter: 820
 
By BigSplit, Senior Member on 16th January 2013, 11:04 PM
Post Reply Email Thread


So I came across this thread a week or more back and implemented it in my ICS rom, but I wasn't happy with it(various reasons but mostly because it is gesture based). So I abandoned it. Fast forward a couple days, jumping from project to project, idea to idea and I somehow ended up porting the latest ICS version of ShenduOS. Then boom, the settings app was *almost* exactly what I wanted. It featured a more natural swiping from tab to tab, similar to most launchers.

So I stripped the code for the tabs from the shendu settings app, stripped that code of any Shendu specific code and re-coded portions of the smali code so I could add it to the settings app of the ICS rom I use as my daily driver. What I ended up with is what seems to be something thats pretty generic and not rom specific.


So now I share with you what *should* work with any ICS+ rom. This guide will be very similar to the one I linked to above.

THIS SHOULD ALSO WORK ON OTHER DEVICES BUT I CANNOT TEST TO BE SURE

Prerequisites:
-experience decompiling/recompiling apk's with APKTool
-experience signing apks
-experience editing/theming apks

I will not go into any of the above any more then just saying when to preform certain actions......

GUIDE:

1. First you will need to decompile the Settings.apk from your ROM with apktool

2. Download the Settings.zip I attached to this post

3. Unzip the Settings.zip and copy the 'res' and 'smali' folders to your decompiled Settings.apk folder(merge with existing folders of the same names)

4. Open 'res/values/strings.xml' from the decompiled settings apk in your favorite text editor and add the following to the end of the list of strings...
Code:
    <string name="personalized_setting">Personal</string>
    <string name="device_setting">System</string>
    <string name="app_setting">Applications</string>
5. Open 'res/values/ids.xml' from the decompiled settings apk in your favorite text editor and add the following to the end of the list of ID's
Code:
    <item type="id" name="linearLayout1">false</item>
    <item type="id" name="personalized_tab">false</item>
    <item type="id" name="device_tab">false</item>
    <item type="id" name="app_tab">false</item>
    <item type="id" name="cursor">false</item>
    <item type="id" name="vPager">false</item>
6.Now you must recompile the settings.apk. This is because APKtool will give resource ID's to certain resources we added during this process, we need these generated ID's in the following steps because the code access's some resources directly by the ID's.

7. Decompile the Newly recompiled APK again, from here on out I will assume your editing this newly recompiled/decompiled version.

8. With this step it is very easy to make a typo, so please make sure you are paying Extra attention to details during this step.
-Open up 'res/values/public.xml' and you will find lines similar to the following.
Code:
<public type="id" name="vPager" id="0x7f08022a" />
-Below I will give you a list of .smali file names, each file is located in the 'smali/com/android/settings/' folder of your decompiled settings.apk
- Each file name will be followed by a line similar to above, you need to search the smali files for the ID(underlined in the example above)
- Then search the public.xml I told you to open above for the name for each line(red in example above)
- Replace the ID in the smali file with the one you located in the public.xml
Code:
!--MainSettings.smali--!
    <public type="id" name="vPager" id="0x7f08022a" />
    <public type="id" name="cursor" id="0x7f080229" />
    <public type="id" name="app_tab" id="0x7f080168" />
    <public type="id" name="device_tab" id="0x7f080228" />
    <public type="id" name="personalized_tab" id="0x7f080227" />
    <public type="layout" name="mainsetting" id="0x7f040090" />
	
	
!--DeviceSettings.smali--!
    <public type="xml" name="device_settings_headers" id="0x7f050051" />

	
!--AppSettings.smali--!
    <public type="xml" name="app_settings_headers" id="0x7f050052" />
	
!--PersonalSettings.smali--!
    <public type="xml" name="personal_settings_headers" id="0x7f050053" />
9. Now open up the 'AndroidManifest.xml' of your decompiled settings.apk in a text editor.
-Find a section similar to the below....
Code:
<activity android:label="@string/settings_label_launcher" android:name="Settings" android:taskAffinity="com.android.settings" android:clearTaskOnLaunch="true" android:launchMode="singleTop">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="android.settings.SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
The important parts you are looking for are 'name="Settings" and the 'android.intent.category.LAUNCHER' lines, there *should* only be a single section with these.
Change this section to the below:
Code:
        <activity android:label="@string/settings_label_launcher" android:name="Settings">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
Directly above that section copy/paste the following code:
Code:
<activity android:name="MainSetting" android:theme="@android:style/Theme.NoTitleBar"  android:taskAffinity="com.android.settings" android:launchMode="singleTask">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="android.settings.SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:label="@string/settings_label_launcher" android:name="PersonalSettings" android:taskAffinity="com.android.settings" android:launchMode="singleTask">
            <intent-filter>
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity android:label="@string/settings_label_launcher" android:name="DeviceSettings" android:taskAffinity="com.android.settings" android:launchMode="singleTask">
            <intent-filter>
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity android:label="@string/settings_label_launcher" android:name="AppSettings" android:taskAffinity="com.android.settings" android:launchMode="singleTask">
            <intent-filter>
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
10. You are now done with this round of modifications, its time to recompile the APK. Because this is a system app and we edited AndroidManifest.xml we must sign this recompiled Apk before pushing it to the system. You can try using any of the keys that come with whatever apk signing tool you use, but you will more then likely end up with a Settings.apk that wont show as being installed. To overcome this on ASOP roms I download and sign system apks with the platfrom keys from CyanogenMod's android_build github. If everything goes well and you push the new signed apk to the system, your settings app should now look similar to this when you open it.


11. What you have is 3 tabs with no settings. I left this for you to do, as each rom has its own specific settings options. Most ASOP roms store the main page of settings options in the 'res/xml/settings_headers.xml'. Copy/paste/reorganize each of these options into the 'app_settings_headers.xml', 'device_settings_headers.xml' and 'personal_settings_headers.xml' files which are also located in 'res/xml/'.

12. After all is said and done above, you *may* need to edit/theme the 'res/layout/mainsettings.xml' to suit your roms specific look.


NOTE:
If you are attempting this on a Non-ASOP Rom or are having trouble you may need to follow these additional instructions



And to finally end this, here are some screenshots where I added this feature to the settings.apk of our twistedmodICS rom by pwn.


Attached Files
File Type: zip Settings.zip - [Click for QR Code] (92.0 KB, 2391 views)
The Following 38 Users Say Thank You to BigSplit For This Useful Post: [ View ] Gift BigSplit Ad-Free
 
 
16th January 2013, 11:04 PM |#2  
OP Senior Member
Thanks Meter: 820
 
More
alternate mirror to files :http://www.mediafire.com/?8vp99zjfkbe42z2

reserved....
The Following 6 Users Say Thank You to BigSplit For This Useful Post: [ View ] Gift BigSplit Ad-Free
17th January 2013, 02:02 AM |#3  
strapped365's Avatar
Senior Member
Flag Columbus
Thanks Meter: 2,812
 
Donate to Me
More
Nice to see you finally got it how you wanted it. Thanks for the guide

Sent from my myTouch_4G_Slide using Tapatalk 2
The Following User Says Thank You to strapped365 For This Useful Post: [ View ] Gift strapped365 Ad-Free
17th January 2013, 07:07 AM |#4  
prboy1969's Avatar
Senior Member
Flag Michigan
Thanks Meter: 7,399
 
More
Nice guide. Thank you.

TEAM MiK
MikROMs Since 3/13/11
The Following 2 Users Say Thank You to prboy1969 For This Useful Post: [ View ] Gift prboy1969 Ad-Free
17th January 2013, 12:51 PM |#5  
OP Senior Member
Thanks Meter: 820
 
More
Quote:
Originally Posted by strapped365

Nice to see you finally got it how you wanted it. Thanks for the guide

Sent from my myTouch_4G_Slide using Tapatalk 2

Yessir, I was giddy like a little school girl when I finally got it to function how I wanted

Sent from my HTC Evo Shift using xda app-developers app
The Following 2 Users Say Thank You to BigSplit For This Useful Post: [ View ] Gift BigSplit Ad-Free
18th January 2013, 10:22 PM |#6  
bilgerryan's Avatar
Recognized Developer
Flag Garrett, IN
Thanks Meter: 38,129
 
Donate to Me
More
Re: [MOD][GUIDE] ICS+ Tabbed settings(MIUI Like)
Thanks for the work you put into this and the guide
29th January 2013, 04:42 AM |#7  
SaintZ93's Avatar
Senior Member
Flag Massachusetts
Thanks Meter: 4,607
 
More
Never mind, I figured it out!
29th January 2013, 05:50 AM |#8  
OP Senior Member
Thanks Meter: 820
 
More
Quote:
Originally Posted by SaintZ93

Never mind, I figured it out!

lol.. I re-downloaded to double check, checked it, then quoted your reply only to see that you figured it out already... If you need anything else let me know
The Following User Says Thank You to BigSplit For This Useful Post: [ View ] Gift BigSplit Ad-Free
30th January 2013, 05:44 AM |#9  
thronnos's Avatar
Senior Member
Flag San Antonio
Thanks Meter: 307
 
More
Re: [MOD][GUIDE] ICS+ Tabbed settings(MIUI Like)
Awesome

Shifted from planet Namek
31st January 2013, 12:53 PM |#10  
Account currently disabled
Flag Bandar Lampung
Thanks Meter: 713
 
More
thanks Bro for the guide

but I'm still confuse with this

Quote :
"To overcome this on ASOP roms I
download and sign system apks with the
platfrom keys from CyanogenMod's
android_build github. "

can you guide that too ?

Thanks in advance
The Following 2 Users Say Thank You to Adi_aishiteru For This Useful Post: [ View ] Gift Adi_aishiteru Ad-Free
1st February 2013, 09:33 AM |#11  
Nathan Ali Ashari's Avatar
Senior Member
Flag jakarta
Thanks Meter: 328
 
More
hello BigSplit.....after I followed your tutorial. I get this in apktool

C: \ Documents and Settings \ server \ Desktop \ ICS Apktool> apkto
I: Checking Whether sources has changed ...
I: Smaling ...
I: Checking Whether resources has changed ...
I: Building resources ...
AAPT: warning: string 'dsds_dsds_device_status' has no def
\ Documents and Settings \ server \ Desktop \ ICS Apktool \ Settings
AAPT: warning: string 'dsdsdevice_status' has no default t
ents and Settings \ server \ Desktop \ ICS Apktool \ Settings \ res;
I: Building apk file ...

C: \ Documents and Settings \ server \ Desktop \ ICS Apktool> apkto
I: Checking Whether sources has changed ...
I: Checking Whether resources has changed ...
I: Building apk file ...

C: \ Documents and Settings \ server \ Desktop \ ICS Apktool>

and I try to push my settings and my settings disappeared after reboot. help me to fix this problem .. thks
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes