Related
BACKGROUND
If you use an Android tablet to surf the web, you often face the issue that if you visit a web site that has a mobile version, the server checks your User Agent and says "Android, eh? You're a phone!" - and bumps you to mobile.nfl.com instead of www.nfl.com, which sucks because phone optimized web sites tend to look bad on a 10.1" 1280x800. For example, you want this not this.
So, you can handle that quite easily, you ask the browser to present itself as something else.
CAUSE
Default, my tablet presents itself as...
Mozilla/5.0 (Linux; U; Android 3.1; en-gb; GT-P7500 Build/HMJ37) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13
...and that's when all the web sites say "Android, aha! You're a phone!"
But I can instruct the tablet browser to present itself as anything else, for example...
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.215 Safari/535.1
...which is handy because it makes all the web sites say "Aha! You're a Chrome browser running on MacOS X 10.7 Lion!", therefore showing me the proper web sites.
ONE SOLUTION
You can do this by decompiling /system/framework/framework-res.apk
Open /res/values/strings.xml, search for the string "web_user_agent" and you'll see this:
<string name="web_user_agent" formatted="false">Mozilla/5.0 (Linux; U; Android %s) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 %sSafari/534.13</string>
You can change this blue string into whatever you want.
However, if you do this you're stuck without a proper "android" user agent.
That could be a pain in the ass if you've got an app that relies on a hidden browser window to complete a sign-in authentication, checking the user agent in the process...*cough*NFLGamePassForAndroidTablet*cough*
ANOTHER, MORE ELEGANT, SOLUTION
The more elegant version, however is decompiling /system/app/Browser.apk
Open the file /res/xml/advanced_preferences.xml if you want the menu item in Advanced settings
or open the file /res/xml/general_preferences.xml if you want the menu item in General settings
Insert this…
<ListPreference android:entries="@array/pref_development_ua_choices" android:title="@string/pref_development_uastring" android:key="user_agent" android:defaultValue="0" android:entryValues="@array/pref_development_ua_values" />
... somewhere, between/above/below some other node. I've put it over the ...
<com.android.browser.search.SearchEnginePreference …
... node, giving me this new menu item in Advanced...
... opening this menu ...
Compile it back and there you go.
This fix is basically just shortcutting around the about:debug route by moving the option out of the hidden debug menu, but it's quite convenient to have the option easily accessible without entering debug mode, and you're not stuck without an "Android" user agent.
HOW TO DO THIS, STEP BY STEP.
(mirrored from post #25)
Teaching has never been my strong feat but I'll give it a shot.
Please note:
The "Setup to build" part is for Windows, recreated from memory, and may be inaccurate. I love you guys but I'm not gonna wipe my system and start over just to retrace my steps
For the entire guide, I'm pre-supposing basic computer skills, a rudimentary understanding of ADB, folder structures, file management, text editing and "what do you mean command line??!"
== Set up to build:
If you don't have Java installed, download and install Java from java.com
Download APK Manager 5 and remember to thank the guy.
Place it in a folder in C:\ so you have a directory stucture like this:
C:\apkmanager5
C:\apkmanager5\other
C:\apkmanager5\place-apk-here-for-modding
...etc
C:\apkmanager5 is the home dir for our purposes, so from now on assume we're in C:\apkmanager5 unless I say otherwise.
Run Script.bat
Select 24 "Exit"
(this should create any dirs and logfiles that may be missing)
== Get the required files and prepare for editing
Pull the following .APKs from your phone via ADB or extract them from your ROM.zip to /place-apk-here-for-modding in our homedir. You should make a backup of at least Browser.apk, just in case.
/system/app/Browser.apk
/system/framework/framework-res.apk
/system/framework/twframework-res.apk
Run the following commands from a command prompt in our home dir:
java -jar other/apktool.jar if place-apk-here-for-modding/framework-res.apk
java -jar other/apktool.jar if place-apk-here-for-modding/twframework-res.apk
The command line will return:
I: Framework installed to: C:\Users\((username))\apktool\framework\1.apk
I: Framework installed to: C:\Users\((username))\apktool\framework\2.apk
== Decompile and edit
Run Script.bat
(this will open the apkmanager window)
Enter 19 "Select compression level for apk's"
Enter 0 (compression=0)
Enter 22 "Set current project"
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Select the number for "Browser.apk"
Select 9 "Decompile apk"
It'll say "Decompiling apk" and hang for a while.
Open a file explorer/total commander/whatever on your computer, and go to /projects in our home dir. You'll see that we now have the decompiled Browser.apk in there.
Go to /projects/Browser.apk/res/xml/ and open general_preferences.xml with a text editor. Notepad, Notepad++, Ultraedit or something, not Word
Add the purple code, so the content looks like this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
[COLOR="Indigo"][I][B]<ListPreference android:entries="@array/pref_development_ua_choices" android:title="@string/pref_development_uastring" android:key="user_agent" android:defaultValue="0" android:entryValues="@array/pref_development_ua_values" />[/B][/I][/COLOR]
<com.android.browser.BrowserHomepagePreference android:hint="@string/http" android:maxLength="8192" android:title="@string/pref_content_homepage" android:key="homepage" android:inputType="textMultiLine|textUri" />
<PreferenceCategory android:title="@string/pref_general_sync_title">
<Preference android:title="@string/pref_personal_sync_with_chrome" android:key="sync_with_chrome" android:summary="@string/pref_personal_sync_with_chrome_summary" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_general_autofill_title">
<CheckBoxPreference android:title="@string/pref_autofill_enabled" android:key="autofill_enabled" android:summary="@string/pref_autofill_enabled_summary" android:defaultValue="true" />
<PreferenceScreen android:title="@string/pref_autofill_profile_editor" android:key="autofill_profile" android:summary="@string/pref_autofill_profile_editor_summary" android:fragment="com.android.browser.AutoFillSettingsFragment" />
</PreferenceCategory>
</PreferenceScreen>
The purple code shows the UAstring item in General Preferences just above the "Set homepage" item.
== Compile
Go back to the apkmanager window.
Select 11 "Compile apk"
It'll output "Building Apk" and think about it for a while.
Apkmanager will ask, "Is this a system Apk?"
"y" - yes it is.
Then it will ask, "Aside from the signatures, would you like to copy over any additional files that you didn't modify from the original apk in order to ensure least # of errors?"
"y" - yes, you want to do that.
apkmanager will extract those original files and then present you with this screen:
Read that, then I'll explain it
Right. At this point apkmanager has made a copy of the original, compiled Browser.apk files in C:\apkmanager5\keep
As the name "keep" suggests, whatever is in here will be kept and carried on to your new build, so:
For every file that you have changed in /projects/Browser.apk/, you need to delete the counterpart in /keep/.
That way, apkmanager knows to keep your unchanged files unchanged but grab your changed file(s) from /projects/Browser.apk. It may seem like dumb way of doing it but it makes sense that you don't want your computer to compile more than it has to. Compiling takes time and CPU, and...well...the less is done, the less can go wrong.
In this case you edited /projects/Browser.apk/res/xml/general_preferences.xml
So you have to delete /keep/res/xml/general_preferences.xml
AND you have to delete /keep/resources.arsc as well!
Whenever you have changed any XML in an .apk, you also have to delete /keep/resources.arsc when compiling. The apk's resource table is compiled into resources.arsc, so if you dont delete it from keep/, you're gonna keep that and carry it over into your new, modified Browser.apk, and your changes won't come through
Ok, after deleting those two files, you "Press any key to continue ...", all the resources are compressed, and now you have a modified Browser.apk in place-apk-here-for-modding/
Wrap it in a flashable zip and flash it.
("How" is outside the scope of this guide)
As it turns out, this is actually a rather general guide on decompiling, editing and recompiling stuff for honeycomb. You can use the exact same method to edit other apks like, framework-res.apk and SystemUI.apk.
Flashble zip?
Credits to the original devs who found these? (DocRambone,alterbridge86) Otherwise nice guide.
PhantomHacker said:
Credits to the original devs who found these? (DocRambone,alterbridge86) Otherwise nice guide.
Click to expand...
Click to collapse
lol, i love how you give the credits. Phantom.... you are a posterchild!
task650 said:
lol, i love how you give the credits. Phantom.... you are a posterchild!
Click to expand...
Click to collapse
I try.
Sent from my GT-P7510 using Tapatalk
Can someone tell me how to decompile in win7?
Preferably the very easiest way with the easiest tool.
Thanks.
Sent from my GT-P7500 using Tapatalk
PhantomHacker said:
Credits to the original devs who found these? (DocRambone,alterbridge86) Otherwise nice guide.
Click to expand...
Click to collapse
Thanks.
As for credits, I assure you I've figured this out all by myself, so how about I give myself a pat on the back then?
I know that DocRambone has a thread where he supplies flashable zips of the the fix in framework-res.apk/res/values/strings.xml but as far as I can see, he doesn't share how. I asked him in PM but he didn't answer, and all he writes in his thread seems to be "You have to decompile the apk and change some of the xml's and then recompile it again.".
So I had to figure it out myself, and it wasn't exactly hard. So far so good.
The selectable browser version is a fairly straightforward solution, since I'm simply moving an existing setting out in the open from a hidden debug menu, but I cannot for the life of me see any other published info about it.
So again, I haven't published anything I haven't figured out myself, and as I've been unfortunate enough to see my own original creation in someone else's 2 dollar Market app, I'm slightly sensitive to the issue of copying.
If you were trolling, consider me trolled.
Hooolm said:
doesn't share how
Click to expand...
Click to collapse
ot: Its a bit like that these days... It seems a lot harder to gather needed information than it was in WM6.X times.
pkoper said:
ot: Its a bit like that these days... It seems a lot harder to gather needed information than it was in WM6.X times.
Click to expand...
Click to collapse
Yeah, it's just... I've never stolen anything, and I get really pissed spending a couple of hours figuring out something cool, and sharing it with the community then being told "pretty pictures - now credit those who told you how"
Edit..
All good, but I need to learn to do more search before asking, iam sorry
And here is a little offtopic question. Why does it look like this in rootexplorer when iam about to edit the xml file
Sent from my GT-P7510 using xda premium
Hooolm said:
Yeah, it's just... I've never stolen anything, and I get really pissed spending a couple of hours figuring out something cool, and sharing it with the community then being told "pretty pictures - now credit those who told you how"
Click to expand...
Click to collapse
I didn't see an issue with your original post. It would have been different if you had posted Doc's zips as your own creation, but you didn't. Yours was simply a tutorial to teach and explain how such a thing could be done. It's the difference between you showing me a Ferrari Italia and telling me you built it, versus simply telling me HOW they built it.
In any case, you mention Doc never answered your requests. Does anybody know what the heck happened to him? I stopped following his threads when he went MIA.
bd85 said:
Edit..
All good, but I need to learn to do more search before asking, iam sorry
And here is a little offtopic question. Why does it look like this in rootexplorer when iam about to edit the xml file
Sent from my GT-P7510 using xda premium
Click to expand...
Click to collapse
Prob cuz root explorer isnt an xml viewer/editor?
DT3CH said:
Prob cuz root explorer isnt an xml viewer/editor?
Click to expand...
Click to collapse
In can open the andrpidmanifest.Xml that is in browser apk just fine, but when I go to the xml res folder and open the xml there it looks like my earlier Screenshots.
This works but not the xml i want to edit, strange
Sent from my GT-P7510 using xda premium
bd85 said:
In can open the andrpidmanifest.Xml that is in browser apk just fine, but when I go to the xml res folder and open the xml there it looks like my earlier Screenshots.
This works but not the xml i want to edit, strange
Sent from my GT-P7510 using xda premium
Click to expand...
Click to collapse
The resource table is compiled into resources.arsc
You have to decompile the entire .apk to edit the xml and compile again afterwards.
Use something like apkmanager, it's real easy to set up. There's a thread for it in the 10.1 dev forum ;-)
i hope phantomhacker can include this in the 3.2 rom don't really want to try this out myself in case i screw this up
Hooolm said:
The resource table is compiled into resources.arsc
You have to decompile the entire .apk to edit the xml and compile again afterwards.
Use something like apkmanager, it's real easy to set up. There's a thread for it in the 10.1 dev forum ;-)
Click to expand...
Click to collapse
Have you actually done this, does it work? I'm interested, and tried with apkmanager, but the recompiled browser wont work. I think its a problem with my install of apkmanager, but I'm not sure.
blulite said:
Have you actually done this, does it work? I'm interested, and tried with apkmanager, but the recompiled browser wont work. I think its a problem with my install of apkmanager, but I'm not sure.
Click to expand...
Click to collapse
Yeah, I've done it several times. For task650 v6.1, stock XWKH7 and XXKI1.
I decompile it with framework-res.apk and twframework-res.apk installed and compile it back as a system app.
Edit:
I've used this ApkManager 4.9 HC edition without problems
bd85 said:
In can open the andrpidmanifest.Xml that is in browser apk just fine, but when I go to the xml res folder and open the xml there it looks like my earlier Screenshots.
This works but not the xml i want to edit, strange
Sent from my GT-P7510 using xda premium
Click to expand...
Click to collapse
Ahh, weird indeed
decompile works great on my mac, but compile does not work.
Please make your decision: 10
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
i've also tried this:
http://forum.xda-developers.com/showpost.php?p=7064736&postcount=447
didnt work
My Mac isn't set up to build, I can't help you there.
I'm building on a Windows Server remotely.
How about asking in the apkmanager thread? I'm sure they know more about it
This was the reason why I created this App:
Why should, Advanced setting added to my settings app??? Why cant I put them all in a separate app just like another settings app???
Click to expand...
Click to collapse
And here I go with all new app called SETTINGS PLUS. All ROM developers can put their Advanced settings right over here...
So, how can I do that???
ChangeLog:
Version 2:
* Fixed some issues
* Now you can add 'Long press Back to Kill" like options right in this APP.
Version 1:
* Advanced settings from Settings.apk can be put in this small App.
Click to expand...
Click to collapse
Implementation:-
Here are the steps to be implemented...
Step 1: Download attached Settings_Plus.apk below
Step 2: Now Decompile Settings_Plus.apk.. Below are the commands:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Step 3: If you want icon before any option, add icon image to /res/drawable-hdpi folder. (Better to have good icon size, for reference you can use icon.png size attributes)
Step 4: To add new preference to Settings_Plus, open /res/xml/preferences_header1.xml in NOTEPAD++
You should see something like this:
Explanation of Each Tag and purpose:
Step 5: This is it. Now, compile your apk and SIGN IT. If you don’t sign it, you can’t install it. After signing, install Settings_Plus on your phone. Now, your Settings_Plus app should display your list item as well...
Click to expand...
Click to collapse
Where to find Package & Class Names???
For package Name:
Download and install APKSKY latest version from here : http://forum.xda-developers.com/showthread.php?t=1115021
You should put APKSPY in AAPT.EXE (used to decompile APK/Jar files) folder. And then drag and drop your APK. It will show you package name.
For Class / Activity Name:
From Above process, you can compile Settings_Plus.apk You can see AndroidManifest.xml file right in the first folder. Open it with NOTEPAD++
Above pic gives more information than words...
And Ofcourse, Compile and SIGN APK.
Click to expand...
Click to collapse
How to hide an app from Launcher ???
From AndroidMainfest.XML file, change below line
<category android:name="android.intent.category.LAUNCHER" />
Click to expand...
Click to collapse
as
<category android:name="android.intent.category.DEFAULT" />
Click to expand...
Click to collapse
And Ofcourse, Compile and SIGN APK.
Click to expand...
Click to collapse
Screenshots Attached
TroubleShooting : Hmmm, Whats WRONG???
Lets find it out here...
Go to application mainfest of the file that you want to put in Settings_Plus app. If you see something like this:
<intent-filter />
Click to expand...
Click to collapse
This means your app can not be launched. May be because it doesnt have any intent. I mean check this for the Mainactivity...
NOW change add intents as shown below:
<intent-filter >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter >
Click to expand...
Click to collapse
Now your app is visible... It took full overnight to find this out... If you don't do this, you will be getting PERMISSION DENIAL error.
Other possible exception is CLASS NOT FOUND. this means, the app you put in Settings_Plus doesn't have any associated app installed in your phone.
Click to expand...
Click to collapse
===>>> If you wanna try, then install All packages from "EXAMPLE PACKAGE" attached. Just install all of them as Normal Packages.
Screenshots Attached
Where's the download link ?
Download link is up
Some useful intent codes:
SystemUI Preferences for Tabbed View:
<header android:icon="@drawable/systemuipreferences" android:title="SystemUI Preferences">
<intent android:targetPackage="com.serajr.systemui.preferences" android:targetClass="com.serajr.systemui.preferences.SystemUIPreferencesActivity" />
</header>
On Screen Buttons:
<header android:icon="@drawable/osb" android:title="Navigation Buttons">
<intent android:targetPackage="cn.kyle.gn.NavBar" android:action="android.intent.action.MAIN" android:targetClass="cn.kyle.gn.NavBar.GnNavBarActivity" />
</header>
CPU Nofills:
<header android:icon="@drawable/overclock" android:title="CPU Overclock">
<intent android:targetPackage="it.sineo.android.noFrillsCPUClassic" android:action="android.intent.action.MAIN" android:targetClass="it.sineo.android.noFrillsCPUClassic.activity.MainActivity" />
</header>
QuickPanel Settings:
<header android:title="Quick Settings">
<intent android:targetPackage="com.lidroid.quickpanel" android:action="android.intent.action.MAIN" android:targetClass="com.lidroid.quickpanel.MainActivity" />
</header>
Long Press Back to kill:
<CheckBoxPreference android:title="@string/kill_app_longpress_back" android:key="kill_app_longpress_back" android:summary="@string/kill_app_longpress_back_summary" />
Click to expand...
Click to collapse
- Hit Thanks if I help you
nice ...like :cyclops:
Nice idea...ill try it soon.
Great Idea!
How to hide an app from Launcher..
Find in Manifest:
Code:
<category android:name="android.intent.category.LAUNCHER" /
Change to
Code:
<category android:name="android.intent.category.DEFAULT" /
Thanks for input
jader13254 said:
Great Idea!
How to hide an app from Launcher..
Find in Manifest:
Code:
<category android:name="android.intent.category.LAUNCHER" /
Change to
Code:
<category android:name="android.intent.category.DEFAULT" /
Click to expand...
Click to collapse
Thanks for the input... I will update first post... And, we can get class names from Manifest file. I will update that aswell...
srihari210 said:
Thanks for the input... I will update first post... And, we can get class names from Manifest file. I will update that aswell...
Click to expand...
Click to collapse
Thanks, after a little change your app works fine (sorry for pm).
Perfect work!
Looks awesome!
Gonna try it soon...!
Juz be the smart Geek
Added Example Package - Check it out
All,
I have added example package for your reference.. check it out... its working perfectly..
Cheers,
Srihari G.
Hi friend is a good idea...
Setting plus include in settins ... is a best idea...
Advanced settings menu ... OC, RAM manager
Sesme said:
Hi friend is a good idea...
Setting plus include in settins ... is a best idea...
Advanced settings menu ... OC, RAM manager
Click to expand...
Click to collapse
Yes, Anything... Everything (Any APP) you can put in Settings_Plus menu...
You know, if you want to put some shortcuts from settings, then, you can..
For example, directly open Connectivity option (MSC or MTC).. here you can code... This code should exist in SETTINGS.apk.. You just need to put the correct one and put in here.. thats it, so easy..
srihari210 said:
Yes, Anything... Everything (Any APP) you can put in Settings_Plus menu...
You know, if you want to put some shortcuts from settings, then, you can..
For example, directly open Connectivity option (MSC or MTC).. here you can code... This code should exist in SETTINGS.apk.. You just need to put the correct one and put in here.. thats it, so easy..
Click to expand...
Click to collapse
There is a little spelling mistake
Attached a SS, btw, you can make a cwm package if you want, for the included apps or the app will fc when they arent available
jader13254 said:
There is a little spelling mistake
Attached a SS, btw, you can make a cwm package if you want, for the included apps or the app will fc when they arent available
Click to expand...
Click to collapse
Haahaaa... I know, I will make spelling mistakes...
And, They can install EXAMPLE Package, if they want to try... Example Package works just fine... They just need to install as normal package...
May Be i should mention that in first post
srihari210 said:
Haahaaa... I know, I will make spelling mistakes...
And, They can install EXAMPLE Package, if they want to try... Example Package works just fine... They just need to install as normal package...
May Be i should mention that in first post
Click to expand...
Click to collapse
Ohh, sorry I just checked yesterday and it wasn't upload there! Nice!
Hi, all ! Great work
How to add Colored text ?
.....................................
android:textColor not working
.....................................
Thank you for good and usefully application
MicQo said:
Hi, all ! Great work
How to add Colored text ?
.....................................
android:textColor not working
.....................................
Thank you for good and usefully application
Click to expand...
Click to collapse
Hmm, I dont think, you can put colors to this text. I mean, its same like SETTINGS APP.
These are PREFERENCE Headers and NOT NORMAL LIST... Anyway, I havent tried coloring text, till now..
srihari210 said:
Hmm, I dont think, you can put colors to this text. I mean, its same like SETTINGS APP.
These are PREFERENCE Headers and NOT NORMAL LIST... Anyway, I havent tried coloring text, till now..
Click to expand...
Click to collapse
Thank you, helped me.
@srihari210
would you plz share the source codes?
tnx
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Want to port CM11 themes? Go here:
CMX- Port CM11 themes in one click.
I will update the information whenever time allows.
Please feel free to contribute or discuss.
In this first post I'm going to try and explain what XTheme and the theme apk's are and how they work. Why? Because you'll have a better understanding of the workings, this will hopefully enable better self sufficiency.
In the second post i'll describe how to set up an environment to port themes and the process of how to port CM 10 themes to XTheme.
I'm going to assume you know nothing about anything to try and cover everything. I myself don't know everything, but what i do know I will try to share.
I'm going to try and keep this as basic as possible so anyone with no knowledge can follow along.
There are already some brilliant guides out there that will help if you read them, so i will link to them instead of regurgitating info from them.
[Guide]T-mobile theme engine.
[Tool]XML generator.
[Guide]How to theme CM10.1.
CM 10 theme mega thread.
[How to] XMLGenerator and .bat script
Knowledge is power!
Click to expand...
Click to collapse
You can find the XTheme thread here containing install instructions, compatible devices and more.
Basically it performs in a similar manner to the theme chooser engine for CM based ROM's... but for ROM bases other than just CM. Until now-18/04/13, the theme chooser engine was restricted to CM based ROM's. XTheme makes it possible to theme stock ROM's.
Click to expand...
Click to collapse
The theme chooser engine allows you to choose a theme and apply it whilst your device is turned on without overwriting your stock images (requires a reboot to see full changes).
This is opposed to a different method of theming, zip flashing or Metamorphing. These methods overwrites either whole apk's or just the relevant images depending on the method you use.
The beauty of the theme chooser is if you decide to change theme or remove it, there is no fallout from the theme that was applied, so all the images are returned back to stock. This isn't really possible through Metamorph or zip flashing unless you use VRTheme or the Universal theme zip which creates a backup. Even so i've found this doesn't work 100%. And restoring your original images through Metamorph and zip flashing can be a painful and tiresome task.
The theme chooser works by redirecting images from inside a theme apk, provided that the relevant images and redirection are present.
If the images or redirections are not present for battery icons for example, then the battery icons will not be themed.
A simple and clean method to theme.
Click to expand...
Click to collapse
Now you know how the engine works we'll talk about the theme apk.
Within the apk is a folder named "res", this contains all the images and xml files that is used within the theme.
Inside the "res" directory are a number folders. Depending on the theme you are porting/creating, some folders will not be used. The folders are mainly self explanatory and these include:
anim ~Controls animations, e.g. screen fades, rotations etc.
color ~xmls control colors used in the theme.
drawable ~Contains xmls that control drawables.
drawable-*dpi ~Contains theme images and possibly xml's.
layout ~Contains xml's that controls the layout values of elements in the theme.
mipmap-*dpi ~Houses "ic_launcher" icons.
values ~Contains xmls including strings, styles, drawables which we will discuss later.
xml ~Contains the redirection xmls. This is where the magic happens.
You can find more in depth details here:
http://developer.android.com/guide/topics/resources/providing-resources.html
If you are unsure where to house elements when adding to your theme, simply look inside the original apk.
For example if i want to theme the icon of Gmail, i would extract the Gmail apk and search for the location of the launcher icon. This is located in mipmap-*dpi, so i would add it to the mipmap-*dpi directory in my theme with the relevant redirections.
Click to expand...
Click to collapse
The redirections xml diverts the original package resources to the theme resources.
Here's a little workflow for changing the Gmail launcher icon.
This is achieved by adding the relevant syntax to the redirection.xml like so:
Code:
<?xml version="1.0" encoding="utf-8"?>
<theme-redirections
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:pluto="http://www.w3.org/2001/pluto.html">
[COLOR=Red]<package-redirections android:name="[COLOR=RoyalBlue]com.google.android.gm[/COLOR]" android:resource="@xml/[COLOR=SeaGreen]com_google_android_gm[/COLOR]" android:minSdkVersion="16" />[/COLOR]
</theme-redirections>
I have highlighted the package redirection above to break it down.
Red= Package redirection syntax.
Blue= Original package name. Found in the "AndroidManifest"
Green= Redirection package name. you can call this anything but i strongly suggest you stick with the original and change "." to "_" as above.
This has told the engine to divert "com.google.android.gm" (Gmail.apk) to use the resources defined in "com_google_android_gm".xml in the theme xml folder.
Now we need to create an xml inside the xml folder named "com_google_android_gm".
Within this xml we add the correct syntax for the resources to be used:
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
[COLOR=Red]<item name="[COLOR=Blue]mipmap/ic_launcher_mail[/COLOR]">@[COLOR=SeaGreen]mipmap/com_google_android_gm_ic_launcher_mail[/COLOR]</item>[/COLOR]
</resources>
Red= Resource redirection syntax.
Blue= Original directory and resource
Green= Redirection directory and resource
This is telling the engine to display "com_google_android_gm_ic_launcher_mail".png located in the mipmap-*dpi directory within the theme apk.
Now we add the "com_google_android_gm_ic_launcher_mail".png into the mipmap-*dpi directory to complete the redirection process.
You can see why i suggest to keep the redirection package name the same. it keeps a consistency that's easy to follow.
Click to expand...
Click to collapse
Time Taken:
Setting up 10 minutes
Porting 10 minutes
Difficulty:
Xtheme Engine themes. Most themes in this thread are for Sony devices. To enable these to work fully on other OEM devices, they require proper redirections.
[THEMES]Xposed theme Engine.
[PORT]CM to XThemeEngine.
[[XTHEMES]] THEMES PLANET [4.3 supported].
Port CM Themes to Xtheme Engine in One Click!
Post any other threads here and i will add them to the above list.
Click to expand...
Click to collapse
Now we know the basics of how the engine and redirections work we can start creating/porting some themes.
We need to gather some tools for the process:
Java Link
ApkManager/Multitool Link
CM10 theme to port Take your pick.
SampleTheme.apk Link at bottom of the page.
Notepad++ Link
7zip Link
Weapon of choice- i chose a beverage with alcoholic content. Link
Java.
Download, install and add bin path to your environment variables.
Windows 7.
Select Computer from the Start menu
Choose System Properties from the context menu
Click Advanced system settings > Advanced tab
Click on Environment Variables, under System Variables, click "new".
In the "variable name" field enter JAVA_HOME
In the "variable value" field enter the "bin" location from the java folder.
My location is "C:\Program Files\Java\jre7\bin"
Reboot.
Open a cmd window and type java. If you added the path correctly you will receive an help menu. If not try to add the path again.
For more help see below or use Google.
http://www.java.com/en/download/help/path.xml
ApkManager/Multitool.
Extract and read the "README"
You can also follow instructions here:
http://forum.xda-developers.com/showthread.php?t=1310151
Click to expand...
Click to collapse
Alternative method. Thanks pier10.
Firstly let me say. If you do not have a redirections.xml in the CM theme xml folder you will need to create one.
See this post for details.
Once we have our environment setup we can get started.
XTheme creator ruqqq has described how to port CM themes in his thread but ill try to expand it.
http://forum.xda-developers.com/showpost.php?p=40428425&postcount=2
1 .Run the setup.bat and select option 3 to create directories.
2. Place your CM10 and SampleTheme.apk's in "place-apk-here-for-modding". Sample theme link. CM10 theme link.
3. Run script.bat and choose option 24 to set project.
4. Select your CM 10 theme apk and choose option 9 to decompile.
5. Repeat the process with the sample theme
6. Your now presented with 2 output folders in "projects" with the same name as the apk.
7. Enter "projects/SampleTheme.apk" and delete the "res" folder.
8. Goto the CM10 theme in projects and copy the "res" folder across into the SampleTheme.apk folder.
9. Open both "AndroidManifest.xml" with notepad++
10. In the SampleTheme AndroidManifest change
Code:
package="[COLOR=Red]sg.ruqqq.theme.SampleTheme[/COLOR]"
with the package name from the CM10 AndroidManifest. Add an X or Xtheme to the end of the package name to differentiate it from the original.
Code:
package="sg.ruqqq.theme.SampleTheme"
Becomes
Code:
package="com.vicino.theme.honeycombl.xtheme"
Or
Code:
package="com.vicino.theme.honeycomb.x"
We can also reflect the change in res/values/strings.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">HoneycombTheme</string>
<string name="theme_name">HoneycombTheme</string>
<string name="style_appearance_name">HoneycombTheme</string>
<string name="author">vicino</string>
<string name="copyright">vicino</string>
</resources>
Becomes
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">HoneycombTheme X</string>
<string name="theme_name">HoneycombTheme X</string>
<string name="style_appearance_name">HoneycombTheme</string>
<string name="author">vicino</string>
<string name="copyright">vicino</string>
</resources>
11. Check If the theme contains a redirections.xml (res/xml/redirections.xml), if it doesn't you must create one. See the post above headed "redirections.xml" orsee this post for details on editing. You should have a line of code for each package xml file in the xml folder.
This applies to every ROM. If the theme does not contain a redirections.xml it will not redirect resources.
Delete any unused lines of code.
If you are using a "stock" ROM, example TouchWiz(Samsung), Sense(HTC), Semc(Sony), open up "android.xml" in res/xml and add redirections for your OEM images.
For Sony based ROM's you can find my redirections below. For other ROM's you will have to create them or find them
http://forum.xda-developers.com/showpost.php?p=40024969&postcount=5
TIP:
My redirections syntax refer to framework images as "framework_res", if the theme you are porting uses "frameworks_res" for example follow this:
Open up the android xml with NotePad ++.
Click the search tab at the top and select replace.
In the field "Find what" enter @drawable/framework_res.
In the field "Replace with" enter @drawable/frameworks_res.
Click replace all, save and close.
12. Compile the project by selecting 12. When prompted select option 2.
13. You will recieve a "unsignedSampleTheme.apk" in the "place-apk-here-for-modding" folder. Select option 13 to sign the apk.
14. You now have a "signedSampleTheme.apk" in "place-apk-here-for-modding", you can rename this to the CM10 theme name.
15. Place the apk on your device, install, apply and reboot.
Click to expand...
Click to collapse
@ruqqq for the XTheme engine.
CM team for the Theme chooser engine.
All the authors of the guides and posts.
@MrDSL for helping me out with Theme Chooser.
@mcsqwizzys98, @Rycon33, @josephnero, @peetr_ and many others over on the Xperia T forum (sorry if i forgot anyone).
@Brut.all, @iBotPeaches, @JesusFreke, @Daneshm90, and @raziel23x for apktool, smali/ baksmali, apkManager/multiTool,
@rovo89 and @Tungstwenty for making this possible with Xposed framework.
@vicino for using Honeycomb theme as an example.
Everyone else who they credited.
Click to expand...
Click to collapse
Q.Why does the ported theme not look 100% as the original theme?
A.
ruqqq said:
There are 2 reason for this. Firstly, as stated in the previous post, styles.xml is not working for XThemeEngine. Hence, the ported themes would not work 100%. For better success, port a theme which is closer to Holo styles (dark background, bright text). Second reason, which is the most common reason, is that the theme is made for CM10. CM10 is very close to AOSP while your device which is running stock rom only retain some parts of AOSP. The theme need to be properly ported (analyze your stock rom frameworks and redirect the proper files in your ported theme etc.) to fully support your device.
Click to expand...
Click to collapse
Q. My theme is not recognized.
A. Make sure you have permissions in the android.manifest.xml.
Code:
<uses-permission android:name="sg.ruqqq.XThemeEngine.permission.SYSTEM_THEME" />
Q. Nothing is themed!?.
A. You must have a "redirections.xml" and package.xml's in the "res/xml" folder
If you plan on releasing any ported themes then ask the author of the theme for permission and give credits and link back to their thread. Not only is this good community manners, it's XDA rules.
XDA rule 12:
12. Using the work of others.
If you are developing something that is based on the work of another Member, you MUST first seek their permission, and you must give credit to the member whose work you used. If a dispute occurs about who developed / created a piece of work, first try to settle the matter by private message and NOT in open forum. If this fails then you may contact a moderator with clear evidence that the work was created by you.
Convincing evidence will result in copied work being removed. If there is no clear evidence you created the work then in the spirit of sharing all work will remain posted on the forums.
As an addition, developers have the right to hold exclusivity over their work for as long as it is deemed necessary by the dev or freely share it. However, if the work is claimed as exclusive, it must remain as such. No selective sharing will be allowed (ie allowing certain people to use it and not others). Should the dev decide to start sharing the work with others, the work automatically becomes fair game for all to use.
In regards to permissions, same rules remain for this but if permission was already given, unless there is a very valid reason, it cannot be revoked (same applies to major updates on the work). Under that same premise, permissions cannot be denied unless the work is exclusive or under severe circumstances.
In plain English: If you want to keep your work exclusive, go for it. However, if you are going to share your work, do it fairly.
These rules apply to all software posted on XDA (including but not limited to ROMs, RUUs, apps, games, kernels, themes, icons, etc) unless that software comes with a license that waives these rules.
Click to expand...
Click to collapse
Thanks to @vicino, as i used his "Honeycomb Lite Theme" as an example.
Awesome guide it will help many people!!!
Sent from my LT30p using Tapatalk 4 Beta
you never fail to amaze mate.thank you
very nice guide dully:good:
it's very comprehensible
i'd like to add some redirections for Xperia(coz Sony always do some funny funny things )
at android.xml:
- for screenshot dialog image
Code:
<item name="drawable/semc_ic_dialog_screenshot">@drawable/frameworks_res_ic_lock_screenshot</item>
at com_android_systemui.xml:
- for data H+
Code:
<item name="drawable/stat_sys_data_connected_h_plus">@drawable/com_android_systemui_stat_sys_data_connected_hp</item>
<item name="drawable/stat_sys_data_fully_connected_h_plus">@drawable/com_android_systemui_stat_sys_data_fully_connected_hp</item>
Rycon and his hplus icon
Sent from my LT30p using Tapatalk 4 Beta
mcsqwizzys98 said:
Rycon and his hplus icon
Sent from my LT30p using Tapatalk 4 Beta
Click to expand...
Click to collapse
hahaha, true mate, as you know i'm mostly on mobile
i'll add some more later, those i can remember
EDIT: Another option for ApkManager is TickleMyAndroid tool for de/recompiling, signing apks.
EDIT2: If you want to have a nice Sony accent theme that can blend well to any ported themes, try to mod an existing Sony accent theme. I personally used white accent(ccffffff) so the default toggles, panel clock, etc won't look out of place when using any ported XTheme theme.
Cheers fellas.:good: I've updated the guide to use the SampleTheme method as described in the XTheme thread. It seems to be less temperamental.
i port a theme flowing your guide
Bt when i click apply its shows failed please help
i m using xtheme engine beta5
only i skip step 10 is it mandatory?
Drockk_Xm said:
i port a theme flowing your guide
Bt when i click apply its shows failed please help
i m using xtheme engine beta5
only i skip step 10 is it mandatory?
Click to expand...
Click to collapse
Only if your using an OEM ROM and want the theme to work fully on your device.
Can you post your AndroidManifest.xml or post the contents and wrap code tags around it, thanks.
dully79 said:
Only if your using an OEM ROM and want the theme to work fully on your device.
Can you post your AndroidManifest.xml or post the contents and wrap code tags around it, thanks.
Click to expand...
Click to collapse
AndroidManifest.xml
PHP:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:hasCode="false" package="com.gekn.theme.Sense5.xtheme"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:pluto="http://www.w3.org/2001/pluto.html">
<uses-permission android:name="sg.ruqqq.XThemeEngine.permission.SYSTEM_THEME" />
<application android:label="@string/app_name" android:icon="@drawable/icon" />
</manifest>
Drockk_Xm said:
AndroidManifest.xml
PHP:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:hasCode="false" package="com.gekn.theme.Sense5.xtheme"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:pluto="http://www.w3.org/2001/pluto.html">
<uses-permission android:name="sg.ruqqq.XThemeEngine.permission.SYSTEM_THEME" />
<application android:label="@string/app_name" android:icon="@drawable/icon" />
</manifest>
Click to expand...
Click to collapse
Ok your manifest is fine, can you send me your apk or link to the original?
dully79 said:
Ok your manifest is fine, can you send me your apk or link to the original?
Click to expand...
Click to collapse
apk link
https://www.dropbox.com/s/jvd5sill84i8ga8/Sense 5 CM10.1 signed.apk
apk signed via ZipSigner
and got .zip format
then rename the extension zip to apk
Drockk_Xm said:
apk link
https://www.dropbox.com/s/jvd5sill84i8ga8/Sense%205%20CM10.1%20signed.apk
apk signed via ZipSigner
and got .zip format
then rename the extension zip to apk
Click to expand...
Click to collapse
There is no redirections.xml in res/xml.
Edit: After looking at it more that theme isnt very well constructed.
None of the images have package names designated to them, so it's a bit of a free for all inside res/drawable-*dpi.
Now that I have my Optimus pro g and have been working with this more I gotta say its more frustrating then anything..
Metamorph using zipthemer from the market seems like a better alternative.
Stuff that should work and clearly works in other areas just randomly doesn't work for no known reason.
Very fustrating..
MrDSL said:
Now that I have my Optimus pro g and have been working with this more I gotta say its more frustrating then anything..
Metamorph using zipthemer from the market seems like a better alternative.
Stuff that should work and clearly works in other areas just randomly doesn't work for no known reason.
Very fustrating..
Click to expand...
Click to collapse
Without a doubt. Now you know why I feel like I'm banging my head against a wall.
You definitely need to hide anything that is fragile and within arms reach when messing with xtheme.
dully79 said:
There is no redirections.xml in res/xml.
Edit: After looking at it more that theme isnt very well constructed.
None of the images have package names designated to them, so it's a bit of a free for all inside res/drawable-*dpi.
Click to expand...
Click to collapse
here is my apk link bro
http://d-h.st/9fQ
I have added redirections. Xml as well n added permissions as well then wat is d problem
Sent from my Galaxy GT-I9500 using xda premium
harisaduelite said:
here is my apk link bro
http://d-h.st/9fQ
I have added redirections. Xml as well n added permissions as well then wat is d problem
Sent from my Galaxy GT-I9500 using xda premium
Click to expand...
Click to collapse
Why don't you read the quide and figure it out like most people this honestly isn't really that hard at all you make redirections delete the public file and make sure yo add device specific redirections in android XML and your done-_-
Sent from my LT30p using Tapatalk 4 Beta
harisaduelite said:
here is my apk link bro
http://d-h.st/9fQ
I have added redirections. Xml as well n added permissions as well then wat is d problem
Sent from my Galaxy GT-I9500 using xda premium
Click to expand...
Click to collapse
You've quoted a post that WASN'T directed at you. It was for Drockk. And ive told you, your AndroidManifest is messed up. Use the one from the SampleTheme.apk just like the guide describes and i guarantee it will work.
Its been a while since I was trying to figure this out and I finally figured it :victory: I am sharing this guide here because some people are still searching for it
NOTE: I haven't tested this on Sense roms so I am not sure if it will work.
I created a small "Rom Details" section in the "About Phone" Section in Settings.apk
What you need:
A Machine with Windows and Java installed.
APKTool
Brain
Patience
For AOSP/CM based roms:
Get Settings.apk and framework-res.apk from ROM
Put in APKTool Directory.
Press Shift Key + Left Click on Mouse and select Open Command Line here
Type "apktool if framework-res.apk" and press enter; then
Continue with the guide bellow
For TouchWiz based roms:
Get Settings.apk, twframework-res.apk and framework-res.apk from ROM.
Put in APKTool Directory.
Press Shift Key + Right click on mouse and then select "Open Command Line here"
Type "apktool if framework-res.apk", press enter; then
Type "apktool if twframework-res.apk", press enter; then
Continue with the guide bellow.
Main thing starts now:laugh::
1. Type "apktool d Settings.apk"
2. Now, you'll find a folder name "Settings" in the APKTool directory with Decompiled Settings.apk Files
3. Go to APKTool/Settings/res/values and open strings.xml with Notepad++
4.Now copy and paste these lines at the end of the file above "</resources>" line
Code:
<string name="rom_version">ROM Version</string>
<string name="rom_chef">Chef</string>
<string name="rom_name">Rom Name</string>
<string name="rom_name_main">[Your ROM's name]</string>
<string name="chef_name">[Your Name]</string>
<string name="rom_version_main">[Your rom's version]</string>
5. Now save the file and close it.
6. Now go to APKTool/Settings/res/xml and open "device_info_settings.xml" and add these lines at the end of the file above "</PreferenceScreen>"
Code:
<PreferenceCategory android:title="ROM Details" />
<Preference android:title="@string/rom_name" android:key="rom_name" android:summary="@string/rom_name_main" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/rom_version" android:key="rom_version" android:summary="@string/rom_version_main" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/rom_chef" android:key="rom_chef" android:summary="@string/rom_chef_main" style="?android:preferenceInformationStyle" />
7. Now save the file and press Shift + Right Button on Mouse and select "Open command line here"
8. Now type "apktool b Settings-new.apk" and press enter
9. Download the sample-flash.zip attached to this thread and extract it in a folder called "Settings-new" on desktop
10. Copy Settings-new.apk from APKTool Directory to "Desktop/Settings-new/system/app" and then rename it to "Settings.apk"
11. Copy to sdcard and flash.
How it looks on my phone:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
CREDITS: @Brut.all and @iBotPeaches for their awesome work on APKTool
@b16h22
@deathnotice01
Open Source Community
thanks bro i am loking fo this.....
Nice Its nice one
Finally someone made this easier
LOL... now there are so many guides on this.. one i found is here
Nachiket.Namjoshi said:
Nice Its nice one
Finally someone made this easier
LOL... now there are so many guides on this.. one i found is here
Click to expand...
Click to collapse
You want me to close this thread¿ That never gonna happen :screwy:
This is easier
**Sent from my eViL Broadcom Chip **
nolinuxnoparty said:
You want me to close this thread¿ That never gonna happen :screwy:
This is easier
**Sent from my eViL Broadcom Chip **
Click to expand...
Click to collapse
loll. no.. hahaha.. that's why I said that it is easier.. lol.. xD .. keep up the good work !
Sent from my GT-S5360 using xda app-developers app
not working with me :S
nothing appeared in about phone section :S
@nolinuxnoparty there is no Settings/res/xml and "device_info_settings.xml"
what do i do
my rom fw is 4.3 buils 205 ( xperia sp )
Hamidreza2010 said:
@nolinuxnoparty there is no Settings/res/xml and "device_info_settings.xml"
what do i do
my rom fw is 4.3 buils 205 ( xperia sp )
Click to expand...
Click to collapse
Found it
Hamidreza2010 said:
@nolinuxnoparty there is no Settings/res/xml and "device_info_settings.xml"
what do i do
my rom fw is 4.3 buils 205 ( xperia sp )
Click to expand...
Click to collapse
Of course you have friends, see again
Marília de Oliveira said:
Of course you have friends, see again
Click to expand...
Click to collapse
Yes your right :laugh:
nolinuxnoparty said:
Its been a while since I was trying to figure this out and I finally figured it :victory: I am sharing this guide here because some people are still searching for it
NOTE: I haven't tested this on Sense roms so I am not sure if it will work.
I created a small "Rom Details" section in the "About Phone" Section in Settings.apk
What you need:
A Machine with Windows and Java installed.
APKTool
Brain
Patience
For AOSP/CM based roms:
Get Settings.apk and framework-res.apk from ROM
Put in APKTool Directory.
Press Shift Key + Left Click on Mouse and select Open Command Line here
Type "apktool if framework-res.apk" and press enter; then
Continue with the guide bellow
For TouchWiz based roms:
Get Settings.apk, twframework-res.apk and framework-res.apk from ROM.
Put in APKTool Directory.
Press Shift Key + Right click on mouse and then select "Open Command Line here"
Type "apktool if framework-res.apk", press enter; then
Type "apktool if twframework-res.apk", press enter; then
Continue with the guide bellow.
Main thing starts now:laugh::
1. Type "apktool d Settings.apk"
2. Now, you'll find a folder name "Settings" in the APKTool directory with Decompiled Settings.apk Files
3. Go to APKTool/Settings/res/values and open strings.xml with Notepad++
4.Now copy and paste these lines at the end of the file above "</resources>" line
Code:
<string name="rom_version">ROM Version</string>
<string name="rom_chef">Chef</string>
<string name="rom_name">Rom Name</string>
<string name="rom_name_main">[Your ROM's name]</string>
<string name="chef_name">[Your Name]</string>
<string name="rom_version_main">[Your rom's version]</string>
5. Now save the file and close it.
6. Now go to APKTool/Settings/res/xml and open "device_info_settings.xml" and add these lines at the end of the file above "</PreferenceScreen>"
Code:
<PreferenceCategory android:title="ROM Details" />
<Preference android:title="@string/rom_name" android:key="rom_name" android:summary="@string/rom_name_main" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/rom_version" android:key="rom_version" android:summary="@string/rom_version_main" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/rom_chef" android:key="rom_chef" android:summary="@string/rom_chef_main" style="?android:preferenceInformationStyle" />
7. Now save the file and press Shift + Right Button on Mouse and select "Open command line here"
8. Now type "apktool b Settings-new.apk" and press enter
9. Download the sample-flash.zip attached to this thread and extract it in a folder called "Settings-new" on desktop
10. Copy Settings-new.apk from APKTool Directory to "Desktop/Settings-new/system/app" and then rename it to "Settings.apk"
11. Copy to sdcard and flash.
How it looks on my phone:
CREDITS: @Brut.all and @iBotPeaches for their awesome work on APKTool
@b16h22
@deathnotice01
Open Source Community
Click to expand...
Click to collapse
Cant find APKTool/Settings/res/values/strings.xml
Using lollipop xtreme rom
Help me
Thanx But!!!
when i try this i got error in this line <string name="chef_name">[Your Name]</string>
but after changing the chef_name to rom_chef_main it works perfectly anyway thanx
Looking for this for years.. Thanks!
nice tuto
i try it and it's so gooooooooooooooooooooooooood
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
- Section One -
Hey guys! I'm back again with another contribution to the community, this time I'm posting a guide on behalf of my theme, Svelte UI.
I have noticed there is a very few amount of theme's available for the new CyanogenMod Theme Chooser out there. And hopefully I can change this.
This guide will cover everything needed to create a Theme, from creating the initial project to theming itself. And some tips on how I theme.
And to make all you lovely people even happier. I will provide all code and even a sample .apk
And also I don't want to add screenshots of my desktop to this thread, because the resolution will be way to big. Instead I'll have links. So let's get started shall we?
VIDEO TUTORIALS
[x] One - Create Project
[x] Two - Initial Setup
More coming.
- Section One -
This section is vital for you to accomplish your theme, so please do not skim through it.
For the requirements, you need an IDE. Yes I will be showing you how build the theme from scratch and not a template.
Use an IDE that you're comfortable with, I wont be showing yo how to use it. I will be using Eclipse for this tutorial.
You will need an image editing program, I am going to use Paint.NET. It's free, advanced, and does the job as good as Photoshop.
We are also going to need patience. Yeap. Theming takes allot of time and patience, it is frustrating especially if you're doing precise editing but it's worth it at the end.
One more thing we are going to need is, an APK decompiler. So download one you like, install the required .apk's for it to work properly.
Then get hold of the SystemUI.apk and Framework-res.apk, we're going to use this later.
- Section One -
Okay, now go ahead and open up your IDE, and create a new Project, give it a name and an appropriate package name.
For example mine is "Svelte UI" and "com.ascendapps.sui". [View Screenshot]
Now click next till you end the project setup. Once your project has been created.
- Section Two -
Go ahead and delete the following folders.
[src, layout, menu, values-sw600dp, and values-sw720dp-land also delete drawable-ldpi if you want] [View Screenshot]
Now in the values folder, create a new xml and call it "public.xml" and make sure to delete the "dimens.xml" file.
Inside the xml file (public.xml) add the following code - [View Screenshot]
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<public type="drawable" name="ic_launcher" id="0x7f020000" />
<public type="string" name="app_name" id="0x7f030000" />
<public type="style" name="AppBaseTheme" id="0x7f040000" />
<public type="style" name="AppTheme" id="0x7f040001" />
</resources>
- Section Three -
Now go ahead and save it. Make you save things when working throughout your project, better be safe than sorry.
Open up AndroidManifest.xml, and add the following code and do what it tells you - [View Screenshot]
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="7" android:versionName="1.0" package="com.ascendapps.sui" <!-- Enter the package name of your project that you had done in the setup earlier -->
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-feature android:name="org.cyanogenmod.theme" android:required="true" />
<application android:label="Svelte" android:icon="@drawable/ic_launcher" android:hasCode="false" /> <!-- Change label to theme name -->
<meta-data android:name="org.cyanogenmod.theme.name" android:value="Svelte" /> <!-- Name of Theme -->
<meta-data android:name="org.cyanogenmod.theme.author" android:value="Krish Gounder" /> <!-- Your Name -->
</manifest>
.
Please make sure to delete the Info statements once you've finished editing the xml.
For example delete the lines in green. Which is the following -
Code:
<!-- Your Name -->
<!-- Name of Theme -->
<!-- Change label to theme name -->
<!-- Enter the package name of your project that you had done in the setup earlier -->
- Section Four -
Now save your project, and close everything. Once closed, navigate to your project workspace. In there you should see your projects name.
Like this . [View Screenshot]
Open the the project then inside the work folder open the "Assets" folder. This is where everything comes to life.
Go ahead, and create the things you want to be included in your theme.
- fonts - If you wish to use different fonts in your theme.
- images - The images that are displayed when applying the theme.
- overlays - You must create this folder, this is where all the theming images are kept.
- wallpapers - If you want to add a wallpaper to your theme. Use .jpg
- bootanimation- Add a .zip file of your bootanimation in here.
- alarms - If you want to add alarm sounds to your theme.
- lockscreen - Add a lockscreen wallpaper. Use .jpg
- notifications - If you want notification sounds.
- ringtones - If you want to have ringtone sounds.
I will be using images, overlays and wallpapers.
So inside the images folder you will need -
lockscreen_preview.jpg if you are having a lockscreen wallpaper.
styles_preview.jpg just add your wallpaper.
wallpaper_preview.jpg Just use the wallpaper and add an icon in the middle of the image.
Add your wallpaper in the wallpapers folder and name it - wallpaper1.jpg
[Screenshot One] - [Screenshot Two] Now we've completed this section.
- Section One -
For theming you'll need a reasonable image editing software, Paint.NET works quite well.
So you want to know how to theme apps and components? Let's start with the framework-res.apk.
Earlier, I had stated that you'll need an APK Decompiler. So using the decompiler, decompile the framework-res.apk.
Open up to decompiled project and navigate to the folder you wish to work on. for example, drawable-xxhdpi.
Now in your theme work folder, go into "overlays" and create a folder called "android"
Inside there, create a folder called "res" and inside "res" create drawable-xxhdpi or the folder you chose.
Now go back to the project you decompiled earlier, and copy in all the .png files that you know you'll theme.
- Section Two -
How to them other apps and get it to work. the way the theme chooser knows what to them is by package names.
So if you want to theme an app you''l need to find out it's package name. For example Instagram is - com.android.instagram
If you make a folder with that name, and inside you have to create the res folder, it's basically the same layout but the initial name is the package name.
- Section Three -
It's often weird to work with .9.png's when you come face to face with it the first time. The best way to edit them is by working with the image inside the borders.
By this I mean, when you open the image in an editor it has these black lines around the edges, using a selecting tool. select everything inside the border, and do not select the border.
These borders help the Android system with stretching the image.
CREDITS -
[x] Me for preparing this guide.
[x] CyanogenMod Team for the Theme Chooser.
[x] Imgur
[x] XDA
[x] Eclipse
[x] QuickMod Dev
[x] And curiosity.
RESERVED
This section is user based, so if you need help with theming something.
Let me know and I'll update this thread post and I'll directly link you to the info.
When theming a specific application, whether it's a system app or a normal app.
You will need to give the folder the package name so the system knows what to theme.
So if you want to theme the settings app you'll have to name the folder "com.android.settings".
Thanks to @Vincentmrl He requested me to add these so people have a better idea and don't get confused.
The names on the left correspond to the app to right.
android (framework-res.apk)
com.android.dialer (Dialer.apk)
com.android.email (Email.apk)
com.android.keyguard (Keyguard.apk , lockscreen theming)
com.android.settings (Settings.apk)
com.android.systemui (SystemUI.apk)
I will be adding more to these. And easy way of finding the apps package name is by looking at its PlayStore url.
Or by checking in android app manager.
- Section One - Add your own custom background
First of all, you'll need to create or find your own image.
Make sure it's a reasonable size, this is basically a common sense statement.
Don't use a really small image. Okay once you've gotten your image.
Change the name of the image to the following - background_holo_dark.png
Place this image in the following folder - /overlays/android/res/drawable-nodpi
Once done, you need a way for the system to find the image, you can do this by creating a new styles.xml in the values folder.
So go ahead and create a file named styles.xml in the values folder.
The next thing you have to do is add this code inside your xml file.
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Black" parent="@*android:style/Theme">
<item name="android:colorBackground">@color/transparent</item>
<item name="android:windowBackground">@drawable/background_holo_dark</item>
</style>
</resources>
Save the file and you're done.
Thank you guy, I love it, maybe I'll do one
GæxD said:
Thank you guy, I love it, maybe I'll do one
Click to expand...
Click to collapse
Goodluck! let me know when you make it. I'll be glad to check it out. :]
Sent from my Nexus 5 using Tapatalk
krishneelg3 said:
Goodluck! let me know when you make it. I'll be glad to check it out. :]
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
Thanks again
I have one question, how to change this colors? Example, I marked the colors in red:
The switch button can be change in the framework-res.apk.
And the text can be changed in colors.xml. it should be displayed as "primary_text" and "secondary_text".
Edit - You may need to look in Settings.apk for the text colors. If they don't work, then look for it in framework-res.apk.
It will be a trial and error thing, so you'll have to test many times.
Sent from my Nexus 5 using Tapatalk
krishneelg3 said:
The switch button can be change in the framework-res.apk.
And the text can be changed in colors.xml. it should be displayed as "primary_text" and "secondary_text".
Edit - You may need to look in Settings.apk for the text colors. If they don't work, then look for it in framework-res.apk.
It will be a trial and error thing, so you'll have to test many times.
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
Okay
You can make a tutorial explaining better this part of colors and others things to put in OP. Other peoples may also have the same doubt =)
GæxD said:
Okay
You can make a tutorial explaining better this part of colors and others things to put in OP. Other peoples may also have the same doubt =)
Click to expand...
Click to collapse
Thanks, I will be sure to add more info about this when I prepare it later.
I look forward
I have a theme in the works. ?
HI thank you for the guide but i keep getting 'Errorublic symbol style/AppBaseTheme declared here is not defined.' while using android studio. how do i solve this? it wont let me compile my apk.
RealiableCandy4 said:
HI thank you for the guide but i keep getting 'Errorublic symbol style/AppBaseTheme declared here is not defined.' while using android studio. how do i solve this? it wont let me compile my apk.
Click to expand...
Click to collapse
Use eclipse dude, with one click you install your apk on device and test the theme
What version of Eclipse are you guys using? I downloaded the Standard version and it keeps me prompting an error whenever I try to create the public.xml file. Any ideas?
torresfelipe said:
What version of Eclipse are you guys using? I downloaded the Standard version and it keeps me prompting a error whenever I try to create the public.xml file. Any ideas?
Click to expand...
Click to collapse
Eclipse Kepler, is the current one. I don't think you need a specific version.
Sent from my Nexus 5 using Tapatalk
torresfelipe said:
What version of Eclipse are you guys using? I downloaded the Standard version and it keeps me prompting an error whenever I try to create the public.xml file. Any ideas?
Click to expand...
Click to collapse
Eclipse Standard/SDK
Version: Kepler Service Release 2
Build id: 20140224-0627
Thanks guys. I might have done something wrong, but it's working now. I'm using the latest release, 4.4 Luna.
GæxD said:
Use eclipse dude, with one click you install your apk on device and test the theme
Click to expand...
Click to collapse
Thanks for the reply i fixed it by adding
Code:
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar"></style>
in the styles.xml file
I used Generator to generate png/9.png files of my theme. Problem is that all of files look like this themename_background.png, themename_tab.png etc. (you know what i mean). How to make theme work with that named images? I need to edit some code to audo add this or how? Its not so easy to rename all pngs (takes alot of time)
I just cant do it.Downloaded eclipse with android SDK and aplication wizzard isnt that easy: next, next, next. Also i dont have folders what you said to delete... For me (newbie) its useless guide.. Just trying and still cant do anything because dont know how...
And finally when i will make any project how to build it to be ready to install?
@baciany Check your Pm
@TheArc;
Which APK Decompiler do you use? Do you think that something simple as http://www.decompileandroid.com/ would work?