[Q] Implement Theme in Rom

Search This thread

-WP7User-

Senior Member
Aug 31, 2010
315
33
Zurich
Hello!
I'm trying to make my own Rom right now. With dsixda's Kitchen it isn't very hard to do so I thought I'd just give it a try. I'm taking a rooted official Update (Version: 2.10.405.2) as my base. Adding busybox runparts, the /data/app functionality, a2sd+, the custom bootanimation functionality etc. isn't a problem. Removing some apps like Maps, Facebook, Teeter (and so on) and adding some like Rom Manager, Neocore or Quadrant isn't a problem, too. But if I want to implement a theme like the Carbon Espresso Mod or a theme I made with the UOT Kitchen I'm getting bootloops at booting the phone. Here's what I do: I unzip the folder (for example a theme made with the UOT Kitchen) and I copy over the framework-res.apk from the unzipped folder to my Working Folder of the Kitchen (to system/framework) and I overwrite the original framework-res.apk.
And NO: I didn't choose a battery mod or a bootanimation in the UOT Kitchen....

Hope you guys can help me :D
 

zHk3R

Senior Member
Aug 17, 2009
1,274
1,464
33
Hoth
It's a system .apk so it doesn't have to be signed.
I can't shed any light on the subject, but here's a bump.
 

mbobino

Senior Member
Apr 15, 2010
308
324
Oklahoma
bobserv3000.com
Are you replacing the whole "framework-res.apk" file? If so then you will need to resign your entire ROM. Why? When you change a system file ("framework-res.apk", "com.htc.framework.apk", "twframework-res", "rosie.apk", etc.) it no longer has a matching "signature" for all the files it serves images to. Plug your phone into your computer and open up "ddms" in your android_sdk > tools folder to watch what happens when the phone boots up.

A workaround (The way I do it, it's more fun IMHO) is to open up your .apk files in 7zip (or if you're on a mac BetterZip) and add the images from the themed .apk to your stock .apk. This way makes it so your original .apk has the same signature as your other system files yet has the new images from the other files that you wanted. I've had a lot of luck with this method. I don't know if it will still work if you change any .xml files as I have not messed with those yet.

I've subscribed to this thread so if you have any questions post back here or you can PM me if you want. I'm on XDA all day, every day so I'll try to help as much as I can.
 

-WP7User-

Senior Member
Aug 31, 2010
315
33
Zurich
Thanks for all the answers! Especially to you, mbobino. Is there a way to sign the whole Rom new? When I make my Rom at the End, the Kitchen signs it automatically, doesn't it? The idea with the images is very good, but if I want to implement a theme like Carbon Espresso it isn't that easy, 'cause Carbon Espresso isn't just a few images. There are several .xml's etc.
 

HeyItsLou

Senior Member
Jun 17, 2010
920
126
The reason you boot loop is mis matched resource ID's in the public.xml file. If you decompile the framework using apktool after adding your images using an archiver then recompile apktool will update the public file for you which saves you from pulling ID''s for every image. I have a video tutorial of how to set up apktool and decompile framework in my Rom thread. Changing images in app apk's won't cause you to boot loop just messing with the framework will.

Sent from my ADR6300 using XDA App
 

mbobino

Senior Member
Apr 15, 2010
308
324
Oklahoma
bobserv3000.com
Thanks for all the answers! Especially to you, mbobino. Is there a way to sign the whole Rom new? When I make my Rom at the End, the Kitchen signs it automatically, doesn't it? The idea with the images is very good, but if I want to implement a theme like Carbon Espresso it isn't that easy, 'cause Carbon Espresso isn't just a few images. There are several .xml's etc.

The kitchen signs the .zip that you flash when you build it. It does not sign any .apks for you on its own. However, there is an option to sign .apks within the kitchen.

In my opinion, taking all of the images and figuring out how it all works is fun. I feel like I've already learned quite a bit from just digging around and moving files around.

As for the .xml files, you can decompile the .apk and edit them and then recompile the .apk. I'm actually looking into this today. It sounds like some work but hopefully I'll get it figured out.
 

-WP7User-

Senior Member
Aug 31, 2010
315
33
Zurich
Sounds like fun indeed :D So, I'll just have to try it. Where can I find the "Settings" for the Notification Bar? Thanks :D
 

bestialbub

Senior Member
May 19, 2010
181
33
The variois status*.xml files in the res/layout folder of the framework-res.apk and the status*.smali files in the services.jar.
 

-WP7User-

Senior Member
Aug 31, 2010
315
33
Zurich
What? If I want to implement a Theme made with the UOT Kitchen (without battery) I should just copy over those files to my existing res-framework.apk OR copy over the whole res-framework.apk (the new one) and sign it?
EDIT: Just tried it with a theme from the UOT Kitchen and it worked perfectly. I've just signed the res-framework.apk and the htc.com.resources.apk (or whatever) in the Kitchen, flashed it on my Phone and it just worked like a Charm. But I have got a 50% Transparent Notification Bar and all the system icons (Battery and time/date) are still black and not transparent! Has anyone got a idea where to change this? (.xml or whatever)...And does anyone know where I can find the HTC Wallpapers? I want to change them a little bit :D
 
Last edited:

dan0412

Senior Member
Jul 15, 2010
559
14
New York, NY
The reason you boot loop is mis matched resource ID's in the public.xml file. If you decompile the framework using apktool after adding your images using an archiver then recompile apktool will update the public file for you which saves you from pulling ID''s for every image. I have a video tutorial of how to set up apktool and decompile framework in my Rom thread. Changing images in app apk's won't cause you to boot loop just messing with the framework will.

Sent from my ADR6300 using XDA App

HeyItsLou, I looked up your ROM thread but couldn't locate the video tutorial.... do you mind providing the url? Specifically, I am trying to add to the list of wallpapers in a ROM. (I have setup apktool but not sure where/which folder to add my wallpapers in Framework-res.apk Launcher.apk before recompiling/signing). Thanks.
 
Last edited:

-WP7User-

Senior Member
Aug 31, 2010
315
33
Zurich
Thanks! But like I've written before in my Edit, I made it. The bigger theme (Carbon Espresso) wasn't a problem, too. I just had to sign the .apk's in system/app and system/framework (the kitchen doesn't do it by itself. You have to choose the option to sign a single .apk and then look, where the system/framework .apk's are...). Works great now!
 

husker91

Senior Member
Thanks! But like I've written before in my Edit, I made it. The bigger theme (Carbon Espresso) wasn't a problem, too. I just had to sign the .apk's in system/app and system/framework (the kitchen doesn't do it by itself. You have to choose the option to sign a single .apk and then look, where the system/framework .apk's are...). Works great now!

Isnt that what I said in the 2nd post -.- lol jk. Glad you got it working!
 

bestialbub

Senior Member
May 19, 2010
181
33
I don't sign system files or apps and apkmanager among other threads I've read say not to. Im on a rooted backflip. I find I only have to sign third party apps to install.

Why do you have to sign YOUR files?
 

-WP7User-

Senior Member
Aug 31, 2010
315
33
Zurich
Sorry for answering that late. Had a few things to do, so I wasn't online very often :D
If you want to cook an App into your Rom (NeoCore for example), then you don't have to sign it. You can just copy it into data/app. But if you want to change the whole framework-res.apk of the Rom, you have to sign it. 'Cause if you don't sign it, you'll get a Bootloop. The framework-res.apk is a very important part of the Rom, so it has to "fit" to the others. There are some ID's which have to match. Otherwise it won't work. That's how I understood it :D

Another Question: Has anybody got an Idea where to change the things that are coming, when you first start the phone with a new Rom (the "installation" of the Rom)? I wan't to write: "Welcome to DomiKamp's Rom!" Or something like that...
 

Jirv311

Senior Member
Mar 30, 2008
1,136
303
Johnstown
I don't sign system files or apps and apkmanager among other threads I've read say not to. Im on a rooted backflip. I find I only have to sign third party apps to install.

Why do you have to sign YOUR files?

I was curious about this too. I always edit the framework-res of any ROM I flash using a custom set of images I have and have never signed the apk afterwards and it has always worked. Maybe cause I'm only replacing images? I usually do this with framework-res and twframework-res and they both can sometimes grow by 1MB or more. Just my experience.

Sent from my SAMSUNG-SGH-I897 using XDA App
 

mbobino

Senior Member
Apr 15, 2010
308
324
Oklahoma
bobserv3000.com
Sorry for answering that late. Had a few things to do, so I wasn't online very often :D
If you want to cook an App into your Rom (NeoCore for example), then you don't have to sign it. You can just copy it into data/app. But if you want to change the whole framework-res.apk of the Rom, you have to sign it. 'Cause if you don't sign it, you'll get a Bootloop. The framework-res.apk is a very important part of the Rom, so it has to "fit" to the others. There are some ID's which have to match. Otherwise it won't work. That's how I understood it :D

Another Question: Has anybody got an Idea where to change the things that are coming, when you first start the phone with a new Rom (the "installation" of the Rom)? I wan't to write: "Welcome to DomiKamp's Rom!" Or something like that...

I think that in order to do the "welcome to" thing you'll have to edit the update-script file. I'm not 100% on it though. Look at a cm Rom and see what all is in there.

Sent from my HTC Evo 4G using XDA App