Assigning identities to files in values/public.xml within framework-res.apk - EVO 4G Android Development

So I'm making some edits to the framework-res.apk, adding new graphics files. When I compile them, APK Manager is not assigning identities to the files within public.xml.
How do I assign these identities? Looks like they're in hex....
Sent from my little black box using XDA App

This Rom is awesome!!! Been 4 days without a charge!!
Sent from my PC36100 using XDA App

kbizzle said:
This Rom is awesome!!! Been 4 days without a charge!!
Sent from my PC36100 using XDA App
Click to expand...
Click to collapse
Yea, it's pretty sweet. Thanks OP.
BTW, is there a Themes forum I could ask for help in? I really want to theme this ROM.

kbizzle said:
This Rom is awesome!!! Been 4 days without a charge!!
Sent from my PC36100 using XDA App
Click to expand...
Click to collapse
roflmao !!!! !

sirmx said:
Yea, it's pretty sweet. Thanks OP.
BTW, is there a Themes forum I could ask for help in? I really want to theme this ROM.
Click to expand...
Click to collapse
I heard the theme forum is for questions about this Rom. I suggest putting your theme in the "general" forum.
Sent from my PC36100 using XDA App

MadDogMaddux said:
So I'm making some edits to the framework-res.apk, adding new graphics files. When I compile them, APK Manager is not assigning identities to the files within public.xml.
How do I assign these identities? Looks like they're in hex....
Sent from my little black box using XDA App
Click to expand...
Click to collapse
The way I do it is I think about what I'm gong to post and if there is a question mark anywhere in there I don't post it in the development section. The whole site is supposed to be for devs so there is no need to seek out this section to ask question.
Since I've spent a good portion of my day so far messing with that dmnd framework-res.apk I guess I'll share what I've found...
http://forum.xda-developers.com/showpost.php?p=7380557&postcount=68
Brut.all said:
Don't do that! I think I should explain the purpose of public.xml file in the project wiki, because many people are confused. Note that you don't need this file when you build an apk from sources and apktool building mechanisms are very similar, so guess what: you could remove this file from decoded application and apktool will rebuild it without any problems. I had a reason why to generate public.xml - it's a feature, not a bug! ;-)
Well, the reason is: there may be references to resources in the application code. If resources ids will change after build, then code will reference different resources than in original apk. public.xml file gives us sureness that resources will get same ids after build - it's the only one reason to use this file. And you want to manually modify these ids ;-)
Adding or removing new resources is somewhat tricky. Yeah, I should write about that in the wiki.
You could remove any line from public.xml (even making a "hole" in the ids) at any moment, but you must be sure, that resource isn't referenced in the code.
There is never much sense in modifying ids in public.xml, because then modified lines lose their purpose.
If you want to add new resources, e.g. drawables and use them in the XML files - you don't have to change anything in the public.xml file.
If you want to add new resources and use them in your code, then you have to add them into public.xml, because you need to reference them somehow. Or you could use Resources.getIdentifier() method, but this is ugly.
And now the most tricky part: if you want to remove some resources, you have to remove info about them from public.xml as well. So first you have to be sure that they aren't referenced in the code. But there is also this "hole" problem, so:
If these resources are at the end of ids stack, then there is no problem.
If resources are near the end of ids stack and you are sure, that all resources after them aren't referenced in the code as well, then you could just remove them all. Actually you have did virtually the same, cause after modifying ids you made these lines totally useless, you broke them, so you could just remove them.
If you want to remove some resources, but add same or greater quantity of new ones (of the same type), then there is no problem - new resources will automatically fill in "holes" in ids. You don't have to add them to public.xml .
If none of above conditions are met, then you have holes and you have to fill them by something. But you don't have to add "useless .pngs" - just add:
Code:
<item type="drawable" name="DUMMY1" />
<item type="drawable" name="DUMMY2" />
<item type="drawable" name="DUMMY3" />
...
Like above, you don't have to add these resources to the public.xml .
Ufff... that's all
Click to expand...
Click to collapse
Also see...
http://forum.xda-developers.com/showthread.php?t=671883

Thanks for not being a douche, Xhausx!
Sent from my little black box using XDA App

Related

[Q] Title Bar removal

How do I remove the gray title bar for my app in the xml file for layout?
I cannot find anything I understand, doesn't error, or at least does not require a re-write of too much code.
thanks to anyone with this answer.
LuvinAndroid said:
How do I remove the gray title bar for my app in the xml file for layout?
I cannot find anything I understand, doesn't error, or at least does not require a re-write of too much code.
thanks to anyone with this answer.
Click to expand...
Click to collapse
The title bat background is determined by what is in the ROM's framework-res.apk, not the individual app.
Go to framework-res.apk/drawable-hdpi and replace the activity_title_bar.9 and bottom_bar.9 with the one's you like. Remember, these are .9 files, broken files may give you FCs.
In your AndroidManifest.xml add:
Code:
android:theme="@android:style/Theme.NoTitleBar"
To the <activty ...> tag
Example:
Code:
<activity android:name=".Foo"
android:theme="@android:style/Theme.NoTitleBar" />
ah, thanks guys, the xml file edit was the one that woked for me.
On another note, I am playing around with the SkellyAPP to learn the pricnipals behind Java/Android structures.
How would I load in an image NOT loaded by the xml but one loaded in that I can re-assign placement based on random numbers so I can wrap my head around a "main loop" with action going on.
Sorry for my noobishness, but I learn by taking baby steps and I promise not to spam the forum with too much trivial stuff

Theming guide anyone???

Need help from a fellow liberty theme. I've been having problems theming .9.png's. It doesn't seem to matter if I decompile, theme, and recompile, or just use gimp/photoshop in or out of the file. I'm using an existing theme already I'm not building xmls or anything using the same resources. I'm also using draw9patch to draw the patches for when i decompile it. After recompiling it and or flashing it it either bootloops or it'll boot up but EVERYTHING will force close or all of the .9.png's are stretched weird and show the black lines I put in with draw9patch. Is there any themer that could share a step by step guide on how they do it or how to deal with theming .9.png's. any how to out there is not working and its getting really difficult not to give up. I'm sure it is probably my fault but theres no guides on this and I'm really trying to learn
Sent from my DROIDX using XDA App
It may not be the images causing your bootloops or FC's, but a different issue when recompiling. When you recompile, do you get .9 error messages? If not, try pulling out your images and adding them to the original framework-res.apk just through 7zip. If you do get error messages from the .9's while compiling then it is an issue with the guides not being drawn correctly.
UnkleDuke said:
It may not be the images causing your bootloops or FC's, but a different issue when recompiling. When you recompile, do you get .9 error messages? If not, try pulling out your images and adding them to the original framework-res.apk just through 7zip. If you do get error messages from the .9's while compiling then it is an issue with the guides not being drawn correctly.
Click to expand...
Click to collapse
I didn't get any errors this last time. And I used archive manager on Linux to pull the images from the drawable hdpi folder to the one in the themes folder I'm using as a base and it is a liberty 1.5 theme and I'm using liberty 1.5 and everything was fc'ing
Sent from my DROIDX using XDA App
First, read this thoroughly:
http://developer.android.com/guide/developing/tools/draw9patch.html
You take a .9, rename it to a regular .png. Open it, edit it, save it. (as .png still) open that .png inside of draw9patch, add your lines. Save the image (as a .9.png). Put the image into eclipse to recompile the image. (Make an unsigned .apk, and pull it)
This is the only way I've ever done it, and it works every single time. People saying that you should add the lines in photo shop or anything else are lucky I guess, caues I've never got that to work for me.
joe772 said:
First, read this thoroughly:
http://developer.android.com/guide/developing/tools/draw9patch.html
You take a .9, rename it to a regular .png. Open it, edit it, save it. (as .png still) open that .png inside of draw9patch, add your lines. Save the image (as a .9.png). Put the image into eclipse to recompile the image. (Make an unsigned .apk, and pull it)
This is the only way I've ever done it, and it works every single time. People saying that you should add the lines in photo shop or anything else are lucky I guess, caues I've never got that to work for me.
Click to expand...
Click to collapse
I use draw9patch save it and put it in the drawable hdpi used apktool to compile and then just pulled em to the other drawable hdpi grrrrr
Sent from my DROIDX using XDA App
http://androidforums.com/droid-x-all-things-root/246462-theme-help-tutorial.html
sometimes i take the png they give, open it up in photoshop and draw over the layers. that way the size resolution and other things remain the same except for the image

Themed Calendar

I really didn't like that wooden calendar and it's colors, so I changed it a little bit.
There is only one color that I couldn't find. (picture number 2)
Special Thanks to biopsin for helping me to build this,
and thanks to cheatman for looking in to it.
If you want to try it, just download the zip file and flash it via recovery.
Does anyone know why I can't change those colors?
Hey guy,
I'm sorry but I can't help you. But i like your app. Please don't give up!
odysseus84 said:
Hey guy,
I'm sorry but I can't help you. But i like your app. Please don't give up!
Click to expand...
Click to collapse
I'm trying, but I haven't found a way to edit that xml. I don't have any problem
with other xmls but this one... I don't know what's wrong.
Looks like some great work there mate. As for your odd xml file problem, I'm not sure there's much you can do. I've had problems like that with a couple of apk's and I've never found a reliable fix. Sorry
Decompile the apk using apktool or apkmanager .... n den edit the xml....n compile agn
Sent from my GT-P1000 using XDA Premium App
agc93 said:
Looks like some great work there mate. As for your odd xml file problem, I'm not sure there's much you can do. I've had problems like that with a couple of apk's and I've never found a reliable fix. Sorry
Click to expand...
Click to collapse
Yeah, I've had this problem before with a framework.
Thats a nice theme. The wooden calendar wasnt really bad, but your theme makes it really nice!
I realy like your theme. The contacts.apk and the phone.apk are "woody ugly" too. Would you theme theese apps too?
Can you post your said XML alone as an attachment (the already modified and original)? I'd like to take a look at it.
As some resources (files in the /res folder) are shared between apps through the framework, changing anything shared might result in an inconsistency and FC the app.
A workaround might be to completely decompile the framework as a dependency and modify it there. It would result in a more dramatic change, but it would cross over to other apps such as the contacts, dialer and calendar simultaneously.
PS: this also applies to the browser, email app, contacts and so on, depending on what you change.
cheatman said:
completely decompile the framework as a dependency and modify it there.
Click to expand...
Click to collapse
but How?
by using what software?
I face similar issue and tried with apktool and apkmanager with no hope.
Would u give me a hand?
odysseus84 said:
I realy like your theme. The contacts.apk and the phone.apk are "woody ugly" too. Would you theme theese apps too?
Click to expand...
Click to collapse
I've already woked on both of them, you can find them in Themes and Apps section.
cheatman said:
Can you post your said XML alone as an attachment (the already modified and original)? I'd like to take a look at it.
As some resources (files in the /res folder) are shared between apps through the framework, changing anything shared might result in an inconsistency and FC the app.
A workaround might be to completely decompile the framework as a dependency and modify it there. It would result in a more dramatic change, but it would cross over to other apps such as the contacts, dialer and calendar simultaneously.
PS: this also applies to the browser, email app, contacts and so on, depending on what you change.
Click to expand...
Click to collapse
So there are lots of things that should be checked.
I uploded the xml here. There are 3 colors in this xml and I can't change any of
them. The xml is in layout folder and there is another xml with the same name in
layout-land folder. I've tried working on this one as well but the result is the
same as the other one.
Anyway, thanks for looking in to it, mate.
sohrab1985 said:
I've already woked on both of them, you can find them in Themes and Apps section.
Click to expand...
Click to collapse
Yes, i know that. They are nice but they don't look as good as the calendar (cause blue). Maybe you can change the colours to a few dark colours like your calendar (it's perfect for Meizu's Dark Theme)
What ever is come... thanks for your work
Sent from my GT-P1000 using Tapatalk
odysseus84 said:
Yes, i know that. They are nice but they don't look as good as the calendar (cause blue). Maybe you can change the colours to a few dark colours like your calendar (it's perfect for Meizu's Dark Theme)
What ever is come... thanks for your work
Sent from my GT-P1000 using Tapatalk
Click to expand...
Click to collapse
I see what I can do.
Ok, in the XML I can see you have three variations of brown/orange. Judging by the colors, I suspect this is the default XML, before editing it.
The colors are #ffbe801d, #ffede3c2 and #ff503200. What values are you trying to set instead of these? What I mean is, how EXACTLY are you replacing the actual text in the XML:
#ffbe801d becomes: ???
#ffede3c2 becomes: ???
#ff503200 becomes: ???
This is important as the color representation is not the basic HEX code encountered in regular web dev (for example). It's a 16-bit hex representation with alpha. The first two elements (ff) stand for 100% opacity.
C.
cheatman said:
Ok, in the XML I can see you have three variations of brown/orange. Judging by the colors, I suspect this is the default XML, before editing it.
The colors are #ffbe801d, #ffede3c2 and #ff503200. What values are you trying to set instead of these? What I mean is, how EXACTLY are you replacing the actual text in the XML:
#ffbe801d becomes: ???
#ffede3c2 becomes: ???
#ff503200 becomes: ???
This is important as the color representation is not the basic HEX code encountered in regular web dev (for example). It's a 16-bit hex representation with alpha. The first two elements (ff) stand for 100% opacity.
C.
Click to expand...
Click to collapse
Yeah, that's right, this is the default xml.
I edit the xml same as other xmls which I edit without any problem, I just open
the xml in a text file and change the value I want to edit and then I save it and
after that I compile it with Apk Manager.
I just want to change them to something like gray, for example I want to change
#ffbe801d to #ff787878 and #ffede3c2 to #ffbcbcbc. It dosen't matter if they
are not exactly these colors, like I said before I just want to make them gray
For the third one, I don't think it changes those two colors that I want to change.
Btw, thanks for helping.
Well, I've looked into it and I can:
1. Fully Decompile the APK. It doesn't need any shared resources from external packages.
2. Edit the XMLs accordingly. I have also seen that you were very thorough in your theme creation process.
It's all good apparently, however, I am unable to recompile everything back. The APK tool reports some missing resources. For some reason, there is a dependency that is not satisfied, although the package decompiles correctly (I have never seen a similar package before).
I'll have to scour some Google documentation before I'll come up with a relevant result, so it may take a while. I'm not gonna let it fly, though. The entire process should be plain smooth and must be doable anyway.
Hi
I have no issues bulding the calendar. If u send me your edited files i can try build it for you..also chech if apktool is up to date, using older ver. will hand out errors..
Edit
Tested these colors
#ffbe801d becomes: ff6090bf
#ffede3c2 becomes: ff9198b1
#ff503200 becomes: ff001d50
ref. : http://www.color-hex.com/
and it builded ok
Sent from my GT-P1000 using XDA Premium App
cheatman said:
Well, I've looked into it and I can:
1. Fully Decompile the APK. It doesn't need any shared resources from external packages.
2. Edit the XMLs accordingly. I have also seen that you were very thorough in your theme creation process.
It's all good apparently, however, I am unable to recompile everything back. The APK tool reports some missing resources. For some reason, there is a dependency that is not satisfied, although the package decompiles correctly (I have never seen a similar package before).
I'll have to scour some Google documentation before I'll come up with a relevant result, so it may take a while. I'm not gonna let it fly, though. The entire process should be plain smooth and must be doable anyway.
Click to expand...
Click to collapse
I'm sorry for putting you throurgh all of this, it's not really a big deal, mate.

[Guide]Change the Ticker Clock Color!

Alright, I am going to try and make this guide as easy to follow as possible for the 1000x people who requested it, lol...
Before starting there is a few things you are going to need/should have:
apk manager...
text editor...
General Idea with How to Work a Computer/Follow Directions
Since we are going to be editing xml's, you have to use apk manager... Hopefully you have some basic knowledge with this "program", since it takes a little getting used to.. If not though, i will try and make this as painless as possible
First, open up apk manager and decompile (9) the framework-res.apk of your choosing.. You can unzip my gingerbread theme and use that framework-res, or any other one that you can find
Now, go to the projects folder, and navigate to "framework-res.apk\res\layout".. This is where, as the name implies, all the layouts for the ticker are placed... They are in xml format, so you can easily use notepad or such...
The XML that we are looking for in order to change the color is "standbymode.xml". Open it up in your text editor... Don't be intimidated, i know it looks confusing lol.. We are only messing with a little part...
Navigate down to the 13th line, aka "<TextView android:textSize="@dimen/time.text.size"... This is where the phone gets its information about the size, font, and color for the Time!
Scroll through that line until you come across android:textColor="blah"... As you can guess the Hex Value within the quotes is the color the clock is! Right now it is ffeaff00, but we can very easily change that
All you have to do now is by googling "Hex value for purple" or whatever color you want, find the hex value that you want to use The code should be exactly six letters/numbers, no more and no less... Now, copy that hex value, and replace the old code from "ff" on! Do not erase those first two letters, because that is telling the phone what transparency value to use, and we would like to keep it fully visible
Easy Enough, right? The hard part is now done!
All we have to do now is recompile the apk, which can be tricky if you don't know what your doing..
P.S if you know how to do this, you are done! I would still scan over these steps though, just to make sure you are doing it right
To compile in apk manager, just type 11! if you get a compile error, then you did something wrong That shouldn't happen though, this is a relatively easy mod....
Wait a while until you get a "Is this a system apk?" message... type "y".... then type y again for the next message... Now do what it says!
Don't forget to delete the "resources.arsc" file, and the "standbymode.xml" file!
Now you are done!! Just replace that framework using whatever method you use, Whether that be with adb when the phone is in recovery, or by replacing the new modified apk with the original within a zip file already made by me
If you make your own, don't be stingy.. Upload it to XDA or whatever, and share it with the community I will put it up on the front page, and give you the credit Make sure though you share with me what kind of framework-res.apk it is, and where you got as in, if you got it from my gingerbread package, or from my stock 2.2 Accurate theme, or Reboot Options, or any other option
fantastic guide! thank you for this!
but im just wondering one thing, why dont you have a donate button for all the hard work you have been giving to the continuum community? hmmm
Trail, is there any code we can get to that's worth modding that's in Java? If so, I can start doing some development.
Sent from my SCH-I400 using XDA App
http://www.mediafire.com/?ajjo09hwxejqsl0
I added my own outlined orange softkeys, and and orange ticker color.
and a few things to the lockscreen text for the lulz
Also I failed to mention that it's based on your accurate gingerbread theme.
Thank you Jakeschweinz for sharing with the community I shall put this in the main mod Thread, and make it easy for everyone to find it And i'll be sure to let you have all the credit
Thanks again!
just a quick link to help you guys out with color
http://html-color-codes.info/
and here's my baby blue clock color
http://dl.dropbox.com/u/30842475/framework-res.apk
6FCAF5 <---- if anybody wants to know the color code for it,
And thanks again Trailblazer for this Guide.
You tricky bugger you figured it out without me lol..
Nice job!
So I'm kinda new to doing this, and I saw the upload that someone has on there for mediafire, and I was wondering, do you just download that, or do you put it in the .apk manager and change it?
This guide is very soon going to be outdated
Sent from my SCH-I400 using xda premium

[Question] Dropdown/quicktoggles help

So im working on dropdown toggles for non at&t firm and there is a lack of info on the subject will anyone with any tutorials pm me or post it here? Im close but not there yet....
Sent from my MB865 using XDA
daavvis said:
So im working on dropdown toggles for non at&t firm and there is a lack of info on the subject will anyone with any tutorials pm me or post it here? Im close but not there yet....
Click to expand...
Click to collapse
I just took a screenshot of your sig just in case. LoL
Man, i went at this for a few hours today with the indian rom.. it's a bunch of mis-matched ids between the quickpanel smali files and the public.xml - and a couple other xmls edits are needed too.
I think you gotta add the strings.xml lines and the drawable-hdpi icons, then recompile - that will generate the resource ids in the public.xml. Then decompile the new unsignedSystemUI to get those public.xml ids and change them accordingly in the 8 or so quickpanel smalis, changing like 8 or 10 ids in each one..
I went through all of them and recompiled. But after my status bar forced close, I re-decompiled it and the ids were mismatched again... I messed up a step or two somewhere - who knows.
I'll get back to it again sometime, but good luck in the meantime..
Just remember to delete the classes.dex from the keep folder for the smali edits to stick, and the resources.arsc of course for the values xml edits and others..
That's my half-assed tutorial...
Sent from my mind using XDA
Man, i went at this for a few hours today with the indian rom.. it's a bunch of mis-matched ids between the quickpanel smali files and the public.xml - and a couple other xmls edits are needed too.
I think you gotta add the strings.xml lines and the drawable-hdpi icons, then recompile - that will generate the resource ids in the public.xml. Then decompile the new unsignedSystemUI to get those public.xml ids and change them accordingly in the 8 or so quickpanel smalis, changing like 8 or 10 ids in each one..
I went through all of them and recompiled. But after my status bar forced close, I re-decompiled it and the ids were mismatched again... I messed up a step or two somewhere - who knows.
I'll get back to it again sometime, but good luck in the meantime..
Just remember to delete the classes.dex from the keep folder for the smali edits to stick, and the resources.arsc of course for the values xml edits and others..
That's my half-assed tutorial...
Sent from my mind using XDA
Click to expand...
Click to collapse
Yeah i spent hours changing id's then when i compiled it told me it was skipping the quickpannel folder cause it was unrecognised.... ill be back at it today...
And if u think india firm is bad whip open the asia firm.... the numbers are even further off and theres a whole extra folder in the values folder
........i feel like asking jim about this would be like asking the pres to tie your laces hahaha .........
Grrrrr mot and att
Sent from my MB865 using XDA

Categories

Resources