So you are on a stock firmware? If so, I would guess that the other packages are not signed with the same keys I linked to since its a stock ROM and not asop. The only thing you can do then is to attempt to re-sign every system apk/jar with a new signature(which I've never been successful at doing).
And the mainsetting will only show up in the public xml AFTER you compile it, then decompile it again. The only reason it wouldnt show up is if you are not placing the files i posted in the correct directories or not recompiling/decompiling when I said to.
Will you be willing to share your Settings.apk with me? I tried modding mine and it keeps force closing when I transfer the values to the separate xmls
Will you be willing to share your Settings.apk with me? I tried modding mine and it keeps force closing when I transfer the values to the separate xmls
Will you be willing to share your Settings.apk with me? I tried modding mine and it keeps force closing when I transfer the values to the separate xmls
I did. Set them to RW-R--R-- and then rebooted. It only loads when the header texts are left or even without text, just the tabs. But once I put the items, it starts to force close. It would be of great help if you could upload yours so that I may check the codes and compare with mine. Thanks!
Aww, that's sad, but I've seen you help a lot in this thread before me so +1 to you. If anyone else there is willing to upload their tabbed settings, please do.
Get Nullpointer exceptions because apparently PersonalSettings$HeaderAdapter has a lot of public values that were not included on the OP guide.
If you could please provide source or base stock deodexed (thread link) this was based on, it would be appreciated greatly.
Edit: Same applies to:
DeviceSettings$HeaderAdapter.smali
AppSettings$HeaderAdapter.smali
Get Nullpointer exceptions because apparently PersonalSettings$HeaderAdapter has a lot of public values that were not included on the OP guide.
If you could please provide source or base stock deodexed (thread link) this was based on, it would be appreciated greatly.
Edit: Same applies to:
DeviceSettings$HeaderAdapter.smali
AppSettings$HeaderAdapter.smali
The following is direction from BigSplit. Please be sure the thank him wherever possible for this work.
This is an addendum to the instructions on the OP which you still need to follow. I have added additional notes here in Green.
If something is not clear, please ask that I may update the notes.
Cheers - TD
Additional Porting Instructions
1. I would make sure you just have blank XML's for the lists of settings to start with(this will make it easier to debug).
2. AppSettings.smali, DeviceSettings.smali and PersonalSettings.smali files are all based off of Settings.smali. Settings.smali may be named differently in a non-asop based ROM or a custom ROM, but its the smali the displays the list of all settings.
3. Knowing this, you would replace all AppSettings.smali & AppSettings$xxx.smali(the sub-classes) with copies of Settings.smali and Settings$xxx.smali files to make sure those files contain the exact functionality you need for your ROM. - This means making copies of the Settings smali files and renaming them. For me this was ONLY the files Settings.smali, Settings$1.smali, Settings$2.smali, Settings$HeaderAdapter.smali, Settings$HeaderAdapter$HeaderViewHolder.smali
4. Within the AppSettings.smali and subclasses you would need to replace ALL occurrences of "com/android/settings/Settings"(or whatever its named) with "com/android/settings/AppSettings"(to ensure all calls are pointing to the correct paths). - Pay attention! Not ALL occurences. For instance see the following excerpt from new AppSettings.smali that references other subsets of settings that I do not want to rename (note #annotations section):
.class public Lcom/android/settings/AppSettings;
.super Landroid/preference/PreferenceActivity;
.source "Settings.java"
5. Now open up your 'res/values/public.xml'(YOUR ORIGINAL ROMS) and find the resource ID for 'settings_headers' or the name of the xml where your settings are normally stored.
6. THIS MUST BE DONE AFTER YOU COMPILE/DECOMPILE(read original tutorial). Find the resource ID for "app_settings_headers" in the public XML.
7. Now that you have both ID's, search all AppSettings.smali and subclasses for the ORIGINAL(settings_headers) ID and replace all occurrences with the ID for "app_settings_headers".
8. Repeat steps 4-7 with the DeviceSettings.smali and PersonalSettings.smali files and finish following the tutorial.
9 I would not add any items to the XML files until you have it working with swiping between 3 blank tabs.
Important Note about the settings.zip available on the OP:
The only smali files I used from the zip you should need are smali/com/android/settings/mainsetting smali files.
This only applies to the smali section, the files for the main apk are still fine to use.
The following is direction from BigSplit. Please be sure the thank him wherever possible for this work.
This is an addendum to the instructions on the OP which you still need to follow. I have added additional notes here in Green.
If something is not clear, please ask that I may update the notes.
Cheers - TD
Additional Porting Instructions
1. I would make sure you just have blank XML's for the lists of settings to start with(this will make it easier to debug).
2. AppSettings.smali, DeviceSettings.smali and PersonalSettings.smali files are all based off of Settings.smali. Settings.smali may be named differently in a non-asop based ROM or a custom ROM, but its the smali the displays the list of all settings.
3. Knowing this, you would replace all AppSettings.smali & AppSettings$xxx.smali(the sub-classes) with copies of Settings.smali and Settings$xxx.smali files to make sure those files contain the exact functionality you need for your ROM. - This means making copies of the Settings smali files and renaming them. For me this was ONLY the files Settings.smali, Settings$1.smali, Settings$2.smali, Settings$HeaderAdapter.smali, Settings$HeaderAdapter$HeaderViewHolder.smali
4. Within the AppSettings.smali and subclasses you would need to replace ALL occurrences of "com/android/settings/Settings"(or whatever its named) with "com/android/settings/AppSettings"(to ensure all calls are pointing to the correct paths). - Pay attention! Not ALL occurences. For instance see the following excerpt from new AppSettings.smali that references other subsets of settings that I do not want to rename (note #annotations section):
.class public Lcom/android/settings/AppSettings;
.super Landroid/preference/PreferenceActivity;
.source "Settings.java"
5. Now open up your 'res/values/public.xml'(YOUR ORIGINAL ROMS) and find the resource ID for 'settings_headers' or the name of the xml where your settings are normally stored.
6. THIS MUST BE DONE AFTER YOU COMPILE/DECOMPILE(read original tutorial). Find the resource ID for "app_settings_headers" in the public XML.
7. Now that you have both ID's, search all AppSettings.smali and subclasses for the ORIGINAL(settings_headers) ID and replace all occurrences with the ID for "app_settings_headers".
8. Repeat steps 4-7 with the DeviceSettings.smali and PersonalSettings.smali files and finish following the tutorial.
9 I would not add any items to the XML files until you have it working with swiping between 3 blank tabs.
Important Note about the settings.zip available on the OP:
The only smali files I used from the zip you should need are smali/com/android/settings/mainsetting smali files.
This only applies to the smali section, the files for the main apk are still fine to use.
I QUOTED FROM OP :
"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."
so you must signed with "platfrom keys from CyanogenMod's android_build github"
- Pay attention! Not ALL occurences. For instance see the following excerpt from new AppSettings.smali that references other subsets of settings that I do not want to rename (note #annotations section):
.class public Lcom/android/settings/AppSettings;
.super Landroid/preference/PreferenceActivity;
.source "Settings.java"
I was going to mention that you could keep a single copy of the member classes, but the last person I told about that working with a non-asop rom had a lot of trouble so I tried to keep it as simple as possible(still don't know if he ever got it working).
I was going to mention that you could keep a single copy of the member classes, but the last person I told about that working with a non-asop rom had a lot of trouble so I tried to keep it as simple as possible(still don't know if he ever got it working).
I thought you had it working.
The reason that BigSplit states to use empty xml is because you will have trouble (I did) just copying sections from settings_headers.xml to blank xml.
I had to remove some items from the xml code for it to work (they were items disabled on my phone anyway) or settings would FC.
So by trial and error, I found which lines of code from settings_header.xml would work in the mod xml files by just using small sections of code at a time until I found line(s) that were causing problems.
If you are editing the empty xml files, a line also needs to be changed to correct syntax if you are trying to use it.
Here is a small example.
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
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...
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.
-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
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:
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.
STEP 4 I do not find the ID must change sorry You have a tip to easily find the id ?
go to smali\com\android\settings\
and open with your favorite text editor
AppSettings.smali, DeviceSettings.smali, PersonalSettings.smali
and find settings_header ids (0xXXXXXXXX) in all that 3 smali, so it's goona be like this
Code:
[COLOR="Red"]0xXXXXXXXX[/COLOR] in AppSettings.smali
[COLOR="Red"]0xXXXXXXXX[/COLOR] in DeviceSettings.smali
[COLOR="Red"]0xXXXXXXXX[/COLOR] in PersonalSettings.smali
I watched the work you've done
Thank you for the superb editing that you have done I was not afar but luckily you came to help me
I strongly believe that this tutorial have parameters suitable for cyanogen bases
I hope my case can help other members
I want to thank you for the time you have given to help me
I'm still sorry but I do not understand step 4 I can not find a correct ID to be changed
I do not know exactly what ID must be changed
The following is direction from BigSplit. Please be sure the thank him wherever possible for this work.
This is an addendum to the instructions on the OP which you still need to follow. I have added additional notes here in Green.
If something is not clear, please ask that I may update the notes.
Cheers - TD
Additional Porting Instructions
1. I would make sure you just have blank XML's for the lists of settings to start with(this will make it easier to debug).
2. AppSettings.smali, DeviceSettings.smali and PersonalSettings.smali files are all based off of Settings.smali. Settings.smali may be named differently in a non-asop based ROM or a custom ROM, but its the smali the displays the list of all settings.
3. Knowing this, you would replace all AppSettings.smali & AppSettings$xxx.smali(the sub-classes) with copies of Settings.smali and Settings$xxx.smali files to make sure those files contain the exact functionality you need for your ROM. - This means making copies of the Settings smali files and renaming them. For me this was ONLY the files Settings.smali, Settings$1.smali, Settings$2.smali, Settings$HeaderAdapter.smali, Settings$HeaderAdapter$HeaderViewHolder.smali
4. Within the AppSettings.smali and subclasses you would need to replace ALL occurrences of "com/android/settings/Settings"(or whatever its named) with "com/android/settings/AppSettings"(to ensure all calls are pointing to the correct paths). - Pay attention! Not ALL occurences. For instance see the following excerpt from new AppSettings.smali that references other subsets of settings that I do not want to rename (note #annotations section):
.class public Lcom/android/settings/AppSettings;
.super Landroid/preference/PreferenceActivity;
.source "Settings.java"
5. Now open up your 'res/values/public.xml'(YOUR ORIGINAL ROMS) and find the resource ID for 'settings_headers' or the name of the xml where your settings are normally stored.
6. THIS MUST BE DONE AFTER YOU COMPILE/DECOMPILE(read original tutorial). Find the resource ID for "app_settings_headers" in the public XML.
7. Now that you have both ID's, search all AppSettings.smali and subclasses for the ORIGINAL(settings_headers) ID and replace all occurrences with the ID for "app_settings_headers".
8. Repeat steps 4-7 with the DeviceSettings.smali and PersonalSettings.smali files and finish following the tutorial.
9 I would not add any items to the XML files until you have it working with swiping between 3 blank tabs.
Important Note about the settings.zip available on the OP:
The only smali files I used from the zip you should need are smali/com/android/settings/mainsetting smali files.
This only applies to the smali section, the files for the main apk are still fine to use.