PDA

View Full Version : TUTORIAL: Making Themes



htc(hot-taco-cheese)
01-16-2011, 10:28 AM
This is a tutorial that I posted on then incredible forum. If there is anything to change , such as the update-script being different on other devices, just tell me and I will change it.

This tutorial just goes through basic theming, once you can do this, you can get into more in-depth theming.


This thread will be used to give and take help on themes for various ROMs and devices. You may also use this thread to ask questions or troubleshoot for your themes.

You must be rooted.

I AM NOT RESPONSIBLE FOR ANY HARM DONE TO YOU OR YOUR DEVICE.

Tools Needed:
-An image manipulation tool (If you don't have Photoshop, get Gimp. It is free and works great.)

-WinRAR or WinZip



Directions:

Download your ROM of choice to your computer. Sense or Vanilla. doesn't matter

Extract the ROM to a new folder on your computer.

Open that folder.

Delete everything that was extracted except for the META-INF folder and the system folder.

***DO NOT TOUCH THE META-INF FOLDER! (no yet at least)***

Open the system folder. This is where you will be the whole time.

In the system folder, delete every folder except for the apps folder and the framework folder.

Go into the framework folder.

Delete everything there except for framework-res.apk and com.htc.resources.apk (com.htc.resources.apk will only be present in a Sense ROM)

Go back to the system folder.



App Icons:

To theme icons, open the app folder.

Pick an .apk that you want to theme.

To open it, use WinRAR. Or if you are using Ubuntu just use the stock archive manager. (You can extract it if you want. But if you extract it, you will have to drag and drop the icon into the .apk from which it came.)

In the .apk, open the res folder.

Now open the drawable-hdpi folder. (This is where icons are almost always located. Pretty much everything that can be easily themed is in the drawable-hdpi folders.)

The file that is used as the icon most often has these following names:
- app_icon.png
- ic_launcher_appnamehere.png ('appnamehere' is where the app's name is.)
- icon.png

Open the Icon with your image editor and color it.

Save it to the exact same location, with the exact same name as it had before, and as the same type it was before which is a .png



Framework:

Go back to the system folder.

Open the framework folder.

Extract framework-res.apk

Go into the extracted folder.

Open the drawable-hdpi folder.

Change these images how ever you want to.

Save the images.

Drag and drop the changed images into the drawable-hdpi folder of the framework-res.apk that is not extracted.

When it asks you to update the archive or save changes to the archive, select yes.


[CENTER][LEFT]Creating a flashable update.zip:


Go to the folder that contains the META-INF and system folders.

Open META-INF.

Open the com folder

Open the google folder.

Open the android folder.

Open the update-script (could be named updater-script) with a text editor. (NOT Microsoft Word)

Delete all of the text.

Paste all of this into it:


show_progress(0.200000, 10);
ui_print("Installing...");
mount("MTD", "system", "/system");
show_progress(0.500000, 40);
package_extract_dir("system", "/system");
show_progress(0.100000, 10);
ui_print("Done!");
unmount("/system");

If you are theming MIUI, Redemption ROM, or Redemptive rEVO, then copy and paste this into the updater-script.



ui_print("");
ui_print("It says this while updating.");
ui_print("");
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
show_progress 0.1 10
show_progress 0.2 0
show_progress 0.2 10
ui_print("");
ui_print("Done Installing!");
ui_print("Thankyou!");

You can change the text in quotations next to the ui_print. So instead of "Installing..." it can be "@(^_^)@ Monkey" if you want it to.

Now zip up the META-INF and system folders into one zip file.

MAKE A BACKUP OF YOUR SETUP!!!

Now, you can flash it in recovery.

Have Fun!!!


Sent from my ADR6300 using Android.net App

enlightened
01-16-2011, 12:17 PM
Thanks for posting this, Taco! Very clear and easy to follow.

Kmart95
01-16-2011, 12:53 PM
Thanks, great post i might actually be able to do all of this.

tweebee
01-16-2011, 01:09 PM
Good post, Taco!

stetsonaw
01-16-2011, 03:27 PM
Great starting place for the beginners out there!

x-tac23
01-16-2011, 03:43 PM
Excellent write up.

Sent from my DROIDX using Android.net App

htc(hot-taco-cheese)
01-16-2011, 03:46 PM
Anyone know if the update-script part needs to be revised.

Sent from my ADR6300 using Android.net App

stetsonaw
01-16-2011, 03:49 PM
Here's a short and to the point for Pete's Bugless Beast v0.6 series.



show_progress(0.500000, 0);
mount("MTD", "system", "/system");
package_extract_dir("system", "/system");

unmount("/system");


Of course, now that i compare, that first one you have above should work fine.

htc(hot-taco-cheese)
01-16-2011, 03:51 PM
OK sounds good.

Sent from my ADR6300 using Android.net App

OneTenderRebel
01-16-2011, 08:47 PM
I have a mac so I am using unrarx and when I go to extract a file in the app folder is says it's not a rar file? I am sure I am missing something, can someone point me in the right direction?

htc(hot-taco-cheese)
01-16-2011, 09:37 PM
That program probably only works with .rar files and not .zip's. Try a different file archiver.

Sent from my ADR6300 using Android.net App

OneTenderRebel
01-16-2011, 09:39 PM
Yeah I think I can do it with just my stock archive utility. If I want to replace the icons do they have to be 48x48 or can they be a bit smaller or bigger?

Or I guess I should go off the size of the icon that I am replacing, like if it is 72x72 replace it with something 72x72 correct?

htc(hot-taco-cheese)
01-16-2011, 09:43 PM
I forget what the size of my icons are. Sorry, I am not at home.

Sent from my ADR6300 using Android.net App

stetsonaw
01-16-2011, 09:49 PM
If I want to replace the icons do they have to be 48x48 or can they be a bit smaller or bigger?

Or I guess I should go off the size of the icon that I am replacing, like if it is 72x72 replace it with something 72x72 correct?
Generally you want to make them the same size. Otherwise they won't look right on your phone, see screenshot for example of a wrong sized icon being put in.

http://dl.dropbox.com/u/8287845/Tb6%20final/power.png

OneTenderRebel
01-16-2011, 09:53 PM
ok that's what I figured but wanted to double check. I am a complete noob with this stuff so I am literally just learning on the go here. I am extracting the apk to get to the folder where I find the res folder and all that stuff, do I need to zip those back up after I am done theming them?

stetsonaw
01-16-2011, 09:56 PM
not sure on a mac, on PC you can just drop them back into the zip after modifying the contents. but again, i'm not sure about a mac. now, if you have a windows side, you can just grab apk manager... unless they have a mac version. then it does all the unzipping/rezipping for you.

htc(hot-taco-cheese)
01-16-2011, 09:56 PM
Sorry again. I use Ubuntu and win7. Never used Mac.

Sent from my ADR6300 using Android.net App

stetsonaw
01-16-2011, 09:58 PM
odd ones are status bar icons (stat_*) run anywhere from 38 high to 45 high, wideness doesn't matter for those.

OneTenderRebel
01-16-2011, 10:01 PM
thanks for the help guys. Seem to be stuck on trying to zip them back up, google will be my friend for awhile.

htc(hot-taco-cheese)
01-16-2011, 10:23 PM
Can you open up the .apk with out extracting it? If so, just open the .apk and drag and drop your moddified .png's into the appropriate folder.

Sent from my ADR6300 using Android.net App

OneTenderRebel
01-16-2011, 10:28 PM
Ok I think I figured it out on my mac, this will be flashed as a theme and not a full rom correct? I am using metickone's frg83 rom as a base, do I flash that first and than flash my theme over it?

htc(hot-taco-cheese)
01-16-2011, 10:30 PM
Yes. ROM first, *then reboot(for best results)*, and then theme.

Sent from my ADR6300 using Android.net App

OneTenderRebel
01-16-2011, 10:30 PM
ok, wish me luck, first trial is going live for me *hopefully*

htc(hot-taco-cheese)
01-16-2011, 10:31 PM
Report back with results when finished, please.

Sent from my ADR6300 using Android.net App

OneTenderRebel
01-16-2011, 10:41 PM
Houston we have a problem. So I decided to only theme one icon just as a trial and it was the accountsandsync icon. When I flashed my theme the option for accountsandsync completely disappeared haha

Gravybird
01-16-2011, 10:47 PM
Houston we have a problem. So I decided to only theme one icon just as a trial and it was the accountsandsync icon. When I flashed my theme the option for accountsandsync completely disappeared haha

I will be patiently waiting for you to master this on a mac:-)

Sent from my DROIDX using Android.net App

htc(hot-taco-cheese)
01-16-2011, 10:48 PM
Yeah, that does not sound good. Is that even an app that is in your app drawer? Try to theme the Facebook icon. That is the app that I test icons on because I hate Facebook.

Sent from my ADR6300 using Android.net App

OneTenderRebel
01-16-2011, 10:50 PM
No it's in the settings list. But there is an icon for it

OneTenderRebel
01-16-2011, 11:22 PM
holy poop this is getting frustrating. I am determined to figure this out before I go to bed.

cush2push
01-16-2011, 11:24 PM
holy poop this is getting frustrating. I am determined to figure this out before I go to bed.

check the ending on the icon you edited sometimes certain image editing changes it from a .png to a .whatever check there first

OneTenderRebel
01-16-2011, 11:27 PM
it is saving it as a .png. I think where it is going wrong with me is I can't properly zip it back up using my Mac.

stetsonaw
01-16-2011, 11:47 PM
holy poop this is getting frustrating. I am determined to figure this out before I go to bed.
LOL, we've all been there, it's always fun until the next day... :D

cush2push
01-17-2011, 12:07 AM
it is saving it as a .png. I think where it is going wrong with me is I can't properly zip it back up using my Mac.

k what i do is i leave the original apk zipped and click open archive then only pull the res to the desktop ( it will make a copy to the desktop) then make your edits then drag and drop the res folder back into the apk and you should be set

OneTenderRebel
01-17-2011, 12:14 AM
ok not quite understanding sorry. Ok like I said I am using metick's frg83 deodexed v3 rom as a base. So I downloaded that zip file, opened it, made all the deletes explained in the OP. When I open the app folder it is all the apk files but they are in exec. Now I can unzip them using a program or even the stock archive utility and I can get into all the folders. I replace the icon I want to change, it gives me the do you want to replace deal and I click yes to it. After that is where I get stuck, I can't get that to stick for some reason. I can't get the apk back to the original exec state it was in on my Mac.

Edit: maybe unzip is the wrong word, when I double click the apk it gives me a folder with the same name but with "folder" added to the end of the apk

OneTenderRebel
01-17-2011, 01:07 AM
Gonna have to call it a night. I feel like I accomplished nothing. I do appreciate you guys trying to help though!! Thank you.

stetsonaw
01-17-2011, 02:17 AM
Learning is accomplishing something, always remember that. You learn so much through trial and error. Keep at it bro, you'll get it.

OneTenderRebel
01-17-2011, 03:28 AM
ok so my stubbornness wouldn't allow me to go to bed. I am following some rabbit holes not leading me anywhere real productive yet but now I am seeing stuff about signing and resigning apk's, do I have to worry about that at all?

OneTenderRebel
01-17-2011, 12:07 PM
So after many a trial and error I have come to the conclusion I cannot edit apk's properly on a Mac. I am sure it can be done, just not be me, haha. So right now I am in the process of getting Ubuntu up and running on my Mac.

htc(hot-taco-cheese)
01-17-2011, 12:16 PM
With Ubuntu, you don't need to download a different archive manager to work with the .apk's. The stock will work great.

Sent from my ADR6300 using Android.net App

OneTenderRebel
01-17-2011, 12:29 PM
Nice, so far the install has been super easy. I am installing it through a free virtualmachine I found, its called virtualbox if anyone is interested. That way I don't have to worry about dual booting.

sent from the great depths of my phones internet (thanks Al Gore)

htc(hot-taco-cheese)
01-17-2011, 01:21 PM
That is how I installed Ubuntu on my desktop.

Sent from my ADR6300 using Android.net App

OneTenderRebel
01-17-2011, 08:11 PM
YES! Got it all figured out, well I wouldn't say all of it, still have a whole lot to learn obviously but I themed a few icons and finally got them to stick

htc(hot-taco-cheese)
01-17-2011, 08:12 PM
nice. did you try theming the inside of the applications?

OneTenderRebel
01-17-2011, 08:21 PM
yeah, through ubuntu you can just open the apk and theme away on the .png file you chose. Thank you for the write up and the help.

OneTenderRebel
01-17-2011, 08:22 PM
I didn't do anything crazy. I just themed gmail to test it out. I didn't want to theme a lot only to not have it work.

htc(hot-taco-cheese)
01-17-2011, 08:26 PM
well now that you got the icons down, the inner parts of the app are really easy. Just watch out for the images with the .9.png ending. Those are a bit tricky to get right.

OneTenderRebel
01-22-2011, 12:22 AM
Quick question, I am using gimp to edit files, so hopefully someone can help me but how do I make the notification bar transparent?

wicked
01-22-2011, 02:31 AM
Quick question, I am using gimp to edit files, so hopefully someone can help me but how do I make the notification bar transparent?

I've never used Gimp but I use photoshop and it's fairly easy once you get the dimensions of the image and just creating a transparent version of it.
If you don't figure it out soon and want it done, just let me know the width and height of the image and I'll make it for ya

stetsonaw
01-22-2011, 02:43 AM
Underneath color, there is a color to alpha option, try that. Since its a .9.png, and if you decompiled, make sure your guide dots and lines stay black. There is also an option with the layers tool to adjust the transparency of the layer.

Sent from my Droid using Android.net App

dansparks78
01-23-2011, 02:19 PM
i think i'll try this out. i would, however, like to know if you can use an existing theme instead of starting from scratch with a full rom. is it possible to edit one or is it necessary to start from step one? i do understand that proper permissions and credits would need to be place if using others work, but using one as a foundation might help for noobs like me.

stetsonaw
01-23-2011, 03:42 PM
That's what I did for my theme, used the Old version of TruBlue for the base of my theme.

dansparks78
01-23-2011, 07:33 PM
alright, i was sigging aroud a little bit in the calculator apk, and changed the icon's colors, that was surprisingly simple. how do you change the color of the buttons? is it the xml files? i couldn't get them to open, so i'm guessing they're in there.

htc(hot-taco-cheese)
01-23-2011, 08:02 PM
I can never get XMLs to open. They will not open with any text editor. Even the IDEs that I have will not open them.

cush2push
01-23-2011, 08:14 PM
I can never get XMLs to open. They will not open with any text editor. Even the IDEs that I have will not open them.

If you use apk manager and decompile the apk then you can use notepad to edit them

dansparks78
01-23-2011, 08:19 PM
found a free xml editor, but most of what comes up is just a bunch of squares...chars missing from my comp i guess. could be some settings aren't right. i'll try to work on another apk or try another editor, there were a few i saw when i googled it. either way i have some fiddeling and finding to do. i've needed a project for a while. and thanks guys. maybe some day i'll be able to release something of my own.

OneTenderRebel
01-23-2011, 08:20 PM
I have a question, when I open a file to edit, let's say the stock settings icon you see in the app drawer. Obviously it's pixelated, is there a way to do a color fill without having to color each pixel individually? Does that make sense?

htc(hot-taco-cheese)
01-23-2011, 09:12 PM
Do you mean colorize it (a tint of a certain color)? Or do you want to replace a certain color (like they do on the news with green screens)?

OneTenderRebel
01-23-2011, 09:19 PM
151colorize it, to give you a better example I want to change the colors of the stock settings icon. If you look at the icon on a vanilla droid set up it has a blue circle in the icon but if you blow the image up you see that it is actually some shades of blue so the pixels have some the same color but some just a bit off color of the blue. I want to make it red but I can't match the colors properly to make it look good. Is there a way to match up the blue colors and turn them into corresponding red colors?

Edit: Added pic of icon

htc(hot-taco-cheese)
01-23-2011, 09:25 PM
Are you using Photoshop or GIMP? I know how to do it with GIMP but not Photoshop, and I am not at home right now to find out how. Maybe a themer here will know how.

The only place that I think it might be would be in the "Color" drop-down menu at the top.

OneTenderRebel
01-23-2011, 09:27 PM
I use gimp

htc(hot-taco-cheese)
01-23-2011, 09:33 PM
OK then. It is easy. Just click "Color" (or maybe it is "Tools" ) at the top. And then click "colorize".

Note: the image has to be in the RGB color format. To change it to RGB, click "Image", then "Mode", and then "RGB".

OneTenderRebel
01-23-2011, 09:35 PM
sweet, will try it out, thanks for the help again

htc(hot-taco-cheese)
01-23-2011, 09:41 PM
Anytime. To change the color, slide around the top bar. The brightness is the bottom bar. And the middle bar controls how lively the color is (I do not know a word for that).

OneTenderRebel
01-23-2011, 10:47 PM
I guess I am not meant to do this haha. I figured out how to colorize certain sections but I can't get the shades to match up properly. Like in that icon I posted a few posts back I need to match up the light shades or blue to light shades of red and the darker shades as well. I can change the inner circle to all red but it looks funny without the proper shades. Is there a way to pick the shade of blue from some of the pixels and have gimp pick the corresponding shade of red?

dansparks78
01-23-2011, 11:11 PM
yeah, i figured out if you use the fuzzy selector and messed w/ the threshold, you can pick all shades of a certain color. then right click on the selected area and colorize from there. if you almost have it, you can set the t-hold to 0 and hold shift to pick individual pixels and control to remove them. hope this helps ya, otr.

stetsonaw
01-24-2011, 02:16 AM
found a free xml editor, but most of what comes up is just a bunch of squares...chars missing from my comp i guess. could be some settings aren't right. i'll try to work on another apk or try another editor, there were a few i saw when i googled it. either way i have some fiddeling and finding to do. i've needed a project for a while. and thanks guys. maybe some day i'll be able to release something of my own.
MAy have been said already, but you need to decompile in apkmanager to be able to edit xmls. Once changes are made, recompile following the instructions in the program, and for more control, treat every apk like a system apk. For the calculator, the xmls to edit are in the drawable folder.


Sent from my Droid using Android.net App

dansparks78
01-24-2011, 03:13 AM
yeah, cush2push said that i'd need it. i've downloaded apkmanager, jdk6-23, the sdk installer, and couldn't find the dl link for a platform...just a rom?-- not sure if there is a difference. not sure if i'm biting off more than can chew either. seems like everything i grab needs a few other things, but i think i'm close to having it all. if i'm missing aything, let me know. my noodle's fried. gonna go at it again tomorrow. thank you all for your assistance and patience.

edit: didn't need a link for the platforms, sdk does it for you, good deal. once it's done getting the stuff it needs, let's see if i can get anywhere.

Bazar6
01-24-2011, 12:07 PM
I am definitely going to give this a try. Thanks for the right up!! Going to start small, with an app, then work my way up to a whole ROM.

dansparks78
01-24-2011, 12:48 PM
alright, here we go. changed the calc buttons, i think. gonna flash and see if it works.

maderschramm
01-24-2011, 03:00 PM
One thing about the updater-script is it needs to be edited by a text editor that doesn't include spaces.

Notepad++, gedit, vim, etc.

Notepad wont work.

Might want to include in op :)

Sent from my DROIDX using Android.net App

Bazar6
01-24-2011, 03:11 PM
Alright so I just read thru every post because I knew in my first read thru I saw something about .9.png. I have PhotoshopElements 9 here at work, and CS5 (with the real PS, along with fireworks) at home. The only post I saw was on a page or two ago, and it only said they;re tricky. How do I go about changing these? Because they look nothing like what is in the rom on my phone. I'm using Project Elite 4.2, and I'm only testing the waters right now, but I'm trying to do the keyboard buttons. They are green on my phone, but the files on the comp (in .9.png) are orange. What's the deal with this?

I used APKmanager to open the rom, and I also decompiled it because I want to get in to the xml editing as well. Thanks for any help!

dansparks78
01-24-2011, 11:47 PM
i'm having trouble compiling the apk after changing colors in the xml file...i've done what it said about the keep folder, tried to compile as a system and non system file, signed, unsigned, zipped and not. either i'm missing something or breaking sig...not sure. any help? i'll keep plugging away at it.

cush2push
01-24-2011, 11:57 PM
i'm having trouble compiling the apk after changing colors in the xml file...i've done what it said about the keep folder, tried to compile as a system and non system file, signed, unsigned, zipped and not. either i'm missing something or breaking sig...not sure. any help? i'll keep plugging away at it.

Make sure you are modding the colors.xml in the value folder and not the drawable folder

cush2push
01-25-2011, 12:03 AM
i'm having trouble compiling the apk after changing colors in the xml file...i've done what it said about the keep folder, tried to compile as a system and non system file, signed, unsigned, zipped and not. either i'm missing something or breaking sig...not sure. any help? i'll keep plugging away at it.

One quick tip if you're not sure of what goes where and what is what change each xml to a different color and load it up to see then go back to the out folder change as needed then recompile * there is no need to empty folders or decompile just go back to the out folder and mod away and recompile as needed only wipe foldrs when you are totally set on the color scheme*

dansparks78
01-25-2011, 12:31 AM
yeah, i was using the drawable folder for xml's. found the values folder and tried that at the same time. i'll start w/ a working one, 'cuz i'm not completely sure how much i've changed exactly in frustration. i have copies of both original and png edits, just in case i messed something up big i wouldn't have to start over completely. thanks again. sucks being a noob.

cush2push
01-25-2011, 12:38 AM
yeah, i was using the drawable folder for xml's. found the values folder and tried that at the same time. i'll start w/ a working one, 'cuz i'm not completely sure how much i've changed exactly in frustration. i have copies of both original and png edits, just in case i messed something up big i wouldn't have to start over completely. thanks again. sucks being a noob.

Fyi if you're modding a system apk like framework it won't like you modding the pngs you can only mod .9's but not pngs. No prob bro glad 2 help when I can

dansparks78
01-25-2011, 01:06 AM
i've changed quite a few png and 9 png, w/ no prob at all. it's how i spend some time between attempts at successfully compiling an apk after editing the xml. how ever, this last attempt compiled and signed w/o a hitch, but it f/c fixed perms, rebooted still f/c. next thing to figure out, i guess.

edit: ok, compiling is going ok, i guess, but the log is saying it can't find this or that, when i'm pushing, too. also i checed the stack trace in the error report about the f/c, and "binary xml file line#5: you must supply a layout_width attribute" in two places--android.app.activiythread and content.res.typed array. i'm thinking a line got goobered up somehow. any ideas, let me know.

another edit: when i push the app, do i have to ddo it as com.yadayada, or just name.apk?

dansparks78
01-25-2011, 06:02 PM
alright, pushed to \system\app\calculator.apk and data\app\com.android.calculator2.apk as they were listed originally listed before i got to digging...nothing...any ideas? everything is going fine, decomp, comp, push...but no results. even went as far as deleting the original apk's before push...do i need to wipe to get it to ok the modded apk? apk manager says not to sign system apps, but do need to do it anyway?

tp76
01-25-2011, 07:01 PM
So you are trying to theme the Calculator.apk and the changes are not showing after the push ?

How are you "pushing" these .apk's - with terminal or via update.zip ?

Also system/apps do not need to be signed, your issue lies somewhere else - if I had a bit more info I can easily help you out :)

GB D1

dansparks78
01-25-2011, 07:43 PM
ok, i've tried both methods to push, apk manager(terminal?) and update.zip. the only success i've had is the ud.z way. pushing doesn't work for me yet for some reason...i'll get it one day. i can get the file to my phone, but it just sits there.

using ud.z, however, it recognizes its an apk and installs just like any other flash, but when i try to open it, i get an immediate f/c. in the preview of thr error report under stack trace, i get the "java.lang.RTE : binary xml file line #5 : you must supply a layout_width attribute @ android.app.activitythread" and the same in "content.res.typedarray"

i haven't changed anything except for the png incons, and the button and text colors in values/color.xml it does the same wether i sign/don't sign in apk manager or wipe caches...i'm kinda los on this, because i havent changed anything but color.

oh yeah, if i push nothing changes or the calculator is missing completely

kookahdoo
01-25-2011, 09:31 PM
You have to fix the permissions everytime you pusk an apk.

Sent from my Droid using Tapatalk

dansparks78
01-25-2011, 09:51 PM
doesn't work. have tried to several times, and just now to be sure, but the same line #5 layout_width errors in stack trace that i mentioned before.

dansparks78
01-25-2011, 11:08 PM
think i might have figured it...i've been using regular notepad, and i just read that it inserts the return character and messes things up. will let you know how it goes w/ notepad++.


edit: used notepad++ to edit the xml, compiled rename, drag and drop, flash, fix perm, reboot....and....line 5...(insert appropriate curse here) i even left the original icons, to see if they were the reason.

android 1(well maybe 100)
me 0

is zipalign necessary or just a space saver?

Dorian
01-26-2011, 01:12 AM
think i might have figured it...i've been using regular notepad, and i just read that it inserts the return character and messes things up. will let you know how it goes w/ notepad++.


edit: used notepad++ to edit the xml, compiled rename, drag and drop, flash, fix perm, reboot....and....line 5...(insert appropriate curse here) i even left the original icons, to see if they were the reason.

android 1(well maybe 100)
me 0

is zipalign necessary or just a space saver?

Zip-align and PNG optimizer are just space savers used to minimize RAM usage while the files are in memory.

dansparks78
01-26-2011, 02:16 AM
alright, here is exactly what i do. maybe you guys can see where something goes wrong, resulting in the line #5 error when i try to run calculator.apk

1) get the calc.apk w/ 7zip...haven't had any luck regardless of where it comes from
2) place in to be modded folder in apk manager
3) run script.bat, then 22, 1, 9 to select and decompile apk
4) drag and drop png's into drawable-hdpi
5) with notepad++ open values/colors.xml and edit the "magic_flame" and "button_text" color codes then save and close
6) option 11 in script.bat to compile, yes to system file...sometimes keep, sometimes don't...doesn't seem to matter
7) don't sign it, cuz it says not to
8) sometimes zipalign...again seems to have no effect on my result
9) copy "unsignedCalculator.apk" to desktop and rename w/o "unsigned"
10) drag and drop it into the appropriate folder in the .zip file, overwriting existing
11) flash .zip file
12) fix permissions and reboot
13) try to open calculator.apk
14) feel like throwing something :)


anything that you see i've missed/done wrong? as far a i can tell and from what i've read, that's how you do it. except for the last li'l bit.

any ideas?

oh, and at step 5, i've also tried to change the color code in drawable/blue_button and button xml's with the exact same results

Dorian
01-26-2011, 08:03 AM
alright, here is exactly what i do. maybe you guys can see where something goes wrong, resulting in the line #5 error when i try to run calculator.apk

1) get the calc.apk w/ 7zip...haven't had any luck regardless of where it comes from
2) place in to be modded folder in apk manager
3) run script.bat, then 22, 1, 9 to select and decompile apk
4) drag and drop png's into drawable-hdpi
5) with notepad++ open values/colors.xml and edit the "magic_flame" and "button_text" color codes then save and close
6) option 11 in script.bat to compile, yes to system file...sometimes keep, sometimes don't...doesn't seem to matter
7) don't sign it, cuz it says not to
8) sometimes zipalign...again seems to have no effect on my result
9) copy "unsignedCalculator.apk" to desktop and rename w/o "unsigned"
10) drag and drop it into the appropriate folder in the .zip file, overwriting existing
11) flash .zip file
12) fix permissions and reboot
13) try to open calculator.apk
14) feel like throwing something :)


anything that you see i've missed/done wrong? as far a i can tell and from what i've read, that's how you do it. except for the last li'l bit.

any ideas?

oh, and at step 5, i've also tried to change the color code in drawable/blue_button and button xml's with the exact same results

Could you PM me the apk? I want to see what you're talking about. I've skinned my calculator before and had no issues... maybe something is wrong with your xml's?

tp76
01-26-2011, 01:13 PM
Same here, I've had zero issues with theming the calculator...it has to be an xml problem

stetsonaw
01-26-2011, 02:06 PM
Dan, are you deleting the Resources.arsc out of the keep folder when you select the "keep" option when recompiling? And what's the reasoning behind fixing permissions? I've never had to do that. and why are you extracting the apk, then decompiling it? Extract the APK only if you are swapping out png files. decompile if you are changing xmls.

You also need to go into the keep folder to delete ANYTHING you have changed. If you swapped out PNGs, then delete the drawable-hdpi folder. If you modified xmls in the drawable folder that you changed. lastly, when you make the color changes, ensure that the leading FF's are still there, for instance if your HTML color code is 0099ff, then your color code in the xml will look like #FF0099ff. This will cause problems.

dansparks78
01-26-2011, 05:23 PM
ok, when i compile and chose to copy original files over, i delete the png's themselves, i also delete the resources.arsc and the drawable/blue_button and /button (when i change them). the values folder doesn't show up in the keep folder, so i can't delete the colors and styles xml's. i'm guessing that's the resources.arsc part. anyway, not sure what i'm doing diferently today, but it's working. the only thing i can figure is i started over with the png files. but it works, keep/no keep. just to make sure i swapped out the the old png's (the ones that worked before i started changing the xml's) and....no line#5...line #6. so apparently there is something wrong there. maybe the images got corrupted w/ all of the copying and moving, or i accidentally changes the dimentions. i can send you the ones i did today, if you like...as soon as i figure out the pm and get them zipped up. shouldn't be too rough. i feel much better about all this, now that i've got something working...now for the advanced panel buttons and the +-=/* buttons.

yeah, the color thing got me round one when i was editing xmls, kept giving me errors, so i googled it, and saw that the first two were the opacity. took some digging though. also, how do you attach in a pm, looked through the icons, and couldn't find anything...the email link?


edit: i got it. i i must have messed up the png's some how, cuz i started them over,as well. but it works, from stock to all red buttons, red text and red icons! :android-dance:

stetsonaw
01-26-2011, 11:04 PM
Awesome, glad you got it! Lets see it!

dansparks78
01-27-2011, 12:27 AM
alright, they're in the mail


screen shots!

c:\shot2.png

that didn't work

c:\shot0.pngc:\shot1.pngc:\shot2.png

!#@$!@%#^

http://i52.tinypic.com/x0r5op.pnghttp://i52.tinypic.com/tapqw8.pnghttp://i54.tinypic.com/jkya29.png

yay!:android-dance:

stetsonaw
01-27-2011, 01:24 PM
Looks good man, nice job on the icon color conversion too!

Sent from my Droid using Android.net App

Bazar6
02-02-2011, 09:45 AM
I've got a problem with mine. I'm doing Project Elite 4.2 (I know theres a themers pack, but I don't know what to do with that, so I'm following these directions for now). Just so I can get ahold of this, I only made two simple changes to it; the calculator icon and the green andy when you plug your phone in to USB, just to get it to work. But it's not.

I keep getting this:
E: Error in /sdcard/zip/mytheme.zip
(Status 6)
Then it's aborted.

I edited the two pngs in PSe9, and used WinRAR to do the extraction and replacing pngs in the apks. And to do the updater_script, I'm using Notepad. I have dreamweaver and apk manager if I would have better luck doing it that way. Anyone know of how I can get this? Thanks for any help!

htc(hot-taco-cheese)
02-02-2011, 03:21 PM
I would suggest using notepad ++ for the updater script. Notepad is not very good for coding of any kind.

Bazar6
02-02-2011, 03:56 PM
I was not aware of that. Thank you very much! The small edits I did showed up! Thanks a ton. Thought I'd need apk manager and all of that. I'll be back later with a full theme (much later)

htc(hot-taco-cheese)
02-02-2011, 04:37 PM
Anytime. Glad that I could help.

RoOoLeR
02-02-2011, 05:43 PM
Can i use this method to edit the stock Blur Keyboard?? colors etc. ?

WugFresh
02-02-2011, 06:12 PM
Yeah its all pngs and xml. Decompile blur-res.apk and screw around with it and you will be able to change stuff.

{{ WugFresh }}

WugFresh
02-02-2011, 06:15 PM
I would suggest using notepad ++ for the updater script. Notepad is not very good for coding of any kind.

+1. Or should I say ++1 lol.

Notepad++ is one of my favorite programs, especially for dealing with xml. It allows you to collapse sections bases on higharchy. Very slick program. Nice coloring too.

{{ WugFresh }}

htc(hot-taco-cheese)
02-02-2011, 08:23 PM
Is notepad ++ free? I do all of my developing and theming on my Ubuntu laptop so I just use Ubuntu's stock editor. But I think I will start to use windows, too.

WugFresh
02-03-2011, 07:26 PM
Yup it free. One of the best editors there is. :)

{{ WugFresh }}

Bazar6
02-07-2011, 09:37 AM
You also need to go into the keep folder to delete ANYTHING you have changed. If you swapped out PNGs, then delete the drawable-hdpi folder. If you modified xmls in the drawable folder that you changed. lastly, when you make the color changes, ensure that the leading FF's are still there, for instance if your HTML color code is 0099ff, then your color code in the xml will look like #FF0099ff. This will cause problems.

This may be simply a dumb question, but do you also have to keep the hex codes that start with 80? I'm trying to do the progress_horizontal.xml, and both the secondaryProgress and Progress items have the same hex values, except the secondaryP goes #8085d20f and the progress goes #ff85d20f. I ask because this is the only xml I'm changing and it still boot loops, just trying to narrow down where I'm going wrong. Thanks!

stetsonaw
02-16-2011, 09:24 PM
The color codes are 8 digit because the first two characters after the # are for the transparency, for example #FF0000FF would be opaque blue; #800000FF would drop the opacity down to 80%. Need to leave them there, but can change the transparency or color to whatever. Make sure you delete your resources.arsc after making changes in the layout folder. Just good practice.

Another thing to note is your apk_manager files. If you are getting constant FCs after editing just the layout folder, check the date on your apktool.jar. If it is the one from September, replace it with the June version, which can be found in APK_Manager 4.8.

Sent from 1885 via my DROID2 using Android.net App

Bazar6
02-17-2011, 03:53 PM
Dang, awesome man, thanks! I had no clue that's what they meant, I just kept the first two thinking they just had to be there.

I found where I was going wrong tho, Dorian helped me out. Turns out I was editing a themed version of the ROM. Dl'd the Vanilla version and compiled correctly. But knowing that little bit helps with the understanding lol, thanks.

ckirby
02-18-2011, 02:42 PM
So where's a good place to download Rome to my PC for theming?

Sent from my DROID2 using Android.net App

ckirby
02-18-2011, 02:43 PM
Roms lol sorry

Sent from my DROID2 using Android.net App

stetsonaw
02-18-2011, 02:49 PM
DroidForums.net has a decent droid2 section.

ckirby
02-18-2011, 04:09 PM
So what's the best rom to theme that is the most compatible.

Sent from my DROID2 using Android.net App

stetsonaw
02-18-2011, 04:10 PM
According to a survey conducted by Droid-Life, Liberty is used by 65% or so of rooters. I'm working on theming it right now :D

ckirby
02-18-2011, 05:38 PM
Yea i run liberty as well
Do i just copy the zip file on my phone for the rom then and open on my PC?

Sent from my DROID2 using Android.net App

stetsonaw
02-18-2011, 07:47 PM
download the ROM zip to your computer, then open it with 7zip or WinRAR, follow the directions in the OP, and you should be good.

ckirby
02-18-2011, 07:57 PM
Thanx. Any luck with liberty yourself? Hows the theme goin?

Sent from my DROID2 using Android.net App

stetsonaw
02-18-2011, 08:07 PM
its...coming along, trying to find a way to remove the clock, lol! Other than that, it's just moving pngs and modifying a couple xmls. Hit up the thread link in my sig for Project Elite if you want a preview. Also hit me up if you need a hand, via PM and i'll get you my Google Talk.

ckirby
02-18-2011, 08:18 PM
Sounds good. I'm just starting this theming stuff so i may take you up on the offer. I've actually been reading up on Java programming and android development but i like to personalize.

Sent from my DROID2 using Android.net App

Bazar6
03-01-2011, 02:26 PM
Hey y'all, I'm trying to theme ProjectElite's new Rom v5, which is Gingerbread. But, the updater-srcipt isn't taking. Every time I try to flash, it gives me this error:
mount () expects 4 args, got 3
E:Error in [file path]
(status 7)
Installation aborted.

I haven't found a vanilla version of the ROM yet, but that doesn't seem to be the case (that I know of, unless some tells em otherwise). Is there anything in particular I need to change for Gingerbread or this rom in particular?

Thanks

cush2push
03-01-2011, 02:58 PM
Hey y'all, I'm trying to theme ProjectElite's new Rom v5, which is Gingerbread. But, the updater-srcipt isn't taking. Every time I try to flash, it gives me this error:
mount () expects 4 args, got 3
E:Error in [file path]
(status 7)
Installation aborted.

I haven't found a vanilla version of the ROM yet, but that doesn't seem to be the case (that I know of, unless some tells em otherwise). Is there anything in particular I need to change for Gingerbread or this rom in particular?

Thanks

sounds like the updater script isnt a good one havnt had time to check the diff between the new/old scripts what recovery are you using ? rzrecovery should still beable to read old scripts

stetsonaw
03-01-2011, 03:06 PM
The updater-script I have below in the PE 4.2 theme works, or you can grab the one out of my theme over on DF for PE5. You will just need to open it in notepad++ or Textpad to take my title and name out of it. Just make sure you grab the entire META-INF folder.

Sent from my DROID2 using Android.net App

Bazar6
03-01-2011, 03:17 PM
Thanks for the response Cush. I thought I originally included it, but yes, I am using RZRecovery.

Stetsonaw, thanks a ton, that worked!! I don't understand the Meta-Inf folder tho, so I'm not even going to ask why it didn't originally work. But again, thanks!!!

stetsonaw
03-01-2011, 03:20 PM
Awesome! Again, just make sure to change the updatet-script. You did the SystemUI.apk in /system/app as well, right?

Sent from my DROID2 using Android.net App

Bazar6
03-01-2011, 03:42 PM
yea I was able to get the script modified (I have no plans on releasing anything to the public tho lol, I'm not that good yet).. and yea I saw that's where most of the status bar icons are as well.. apkmanager gets an error when decompiling, but I get everything fine, able to do the .9ms perfectly and put them back in the archive without having to compile. Thanks for the help dude!

Sent from my Droid using Android.net App

stetsonaw
03-01-2011, 04:43 PM
no point really to decompile the systemui.apk, just remember to grab the systemui.apk out of the 5.0.1 release, it has a fix in there for the statusbar pulldown transparency for the background. In Froyo, this was status_bar_background in framework, in GB, it's shade_bg in systemui. just something to note.

Bazar6
03-01-2011, 04:52 PM
Lmao great timing.. I was looking for what the bg graphic was as I saw the email notif.

I only decompiled to see what the xmls had in em

Sent from my Droid using Android.net App

RayBan
03-05-2011, 05:19 AM
great write-up htc! this looks like a perfect way to spend my saturday :)

thanks!

Not_Garrett
03-09-2011, 04:20 PM
Thanks for this guide! I'll do playing around with theming tonight... :D

Not_Garrett
03-12-2011, 01:06 AM
So, it's going somewhat well so far! Kinda sucks having to learn a whole new file system though... lol.

Hopefully I'll get my theme ported to Android by the end of the weekend. :D

volsfan1965
05-14-2011, 03:14 PM
I was wondering if this will work for the droid 2 global