Help with public.xml editing! Please! - Android Q&A, Help & Troubleshooting

Hey guys if any of you are experienced with editing the public.xml file. Please let me know, i need to give these items new id's in the public.xml but everything i can think of is used up or out of range and causes it not to compile. I always get stumped on these id's and have no idea how to edit this properly.
This is adding 3 button tab's to a Sense modded Settings menu thats the form of AOSP. Any ideas on what the next id's can be and wouldn't cause a problem?
Public.xml (Need help finishing) http://pastebin.com/En6sjvpe
Strings.xml (Complete at bottom) http://pastebin.com/0KGQg4aa
ids.xml (Complete at bottom) http://pastebin.com/Ln1pc8nH
Res/XML/settings_headers.xml (Complete with edits) http://pastebin.com/Xv9dhvYp
Really stumped here guys please help me

Related

Help Editing Text Color .xmls

Hello! I was hoping someone out there could point me in the right direction. I'm trying to edit the text colors of the notification pull down. My method is this.
~I first decompile the twframework-res.apk and navigate to /res/layout/status_bar_expanded.xml and open it with notepad++
~I change all the values I want accordingly. #ff000000 for black and #ffffffff for white.
~After this I recompile the apk using apk manager. Compression 0 and heap size 512, Y system app, Y keep and then I go into the keep folder and delete the status_bar_expanded.xml I just edited. Then finish recompiling it and it goes through with zero errors.
~Then I push it to my phone and reboot. It goes Vibrant>TMO>Galaxy S logo>black screen and vibrating.
Is there another location where I'm suppose to edit these values as well? Any help would be appreciated. Thanks.
Awww can noone help at all?
Whitehawkx said:
Awww can noone help at all?
Click to expand...
Click to collapse
Still having issues?
Values have to be edited in framework-res.apk also
if it cause it not to boot it sounds like the new xml didnt copy over and isnt in the recompiled apk. That happenes to me a few times

[REQ] Modification of framework-res

Hello. I wish someone could help me with editing my framework file. I have some problems with apktool Basically I need someobe who could edit some files in res/values. Enable on screen buttons and change their height to 24 pixels. Enable 'ShowNavigationBar' in bools.xml and 'NavigationBarHeight' in dimens.xml. Every helpful post in this thread will be thanked
Edit: oops, there is the link http://db.tt/Dlu60svI

[Q] [Advanced question] Editing framework

I'm recently trying to edit my framework with this mod
http://forum.xda-developers.com/show....php?t=1916094
Well actually the steps in that thread are very simple, but since I'm trying to apply that to my Xperia Ray so it must have slightly different steps
What I want to ask :
- In framework/res, I found drawable-.........( mdpi,hdmpi,ldpi,etc.). If I'm going to replace the .9png's picture in there, should I make the picture as same as the original picture dimension? I'm using Dev-Drawable app in the Play Store ( it makes picture to drawable- hdpi,mdpi,etc. ), the result of using it is it gives me the mdpi version of the picture but with different dimesion from the original picture.
- I found errors and it says that I have errors in the /res/values/public.xml
I found this :
Code:
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 .
And because I'm a newbie I don't really get what that mean. So I just delete the files that I'm going to replace and I can re-compile the framework, but I got bootloop, LOL.
I confused about :
1."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."
What are the "holes" and " referenced in the code" mean?
2. Because I want to add .png's picture to the drawable-mdpi folder, Do I need to add dummies to the public.xml ?
3. I'm using the tricky signing method ( open archive in the original framework, copy meta-inf & android manifest and replace those files to the modded framework). Is this cause me an error?
Help me mateee
Why do you post this thread 2 times?
mihahn said:
Why do you post this thread 2 times?
Click to expand...
Click to collapse
Cause no one reply & help meee:crying:
RivaultUser said:
What I want to ask :
- In framework/res, I found drawable-.........( mdpi,hdmpi,ldpi,etc.). If I'm going to replace the .9png's picture in there, should I make the picture as same as the original picture dimension? I'm using Dev-Drawable app in the Play Store ( it makes picture to drawable- hdpi,mdpi,etc. ), the result of using it is it gives me the mdpi version of the picture but with different dimesion from the original picture.
Click to expand...
Click to collapse
It's best to keep the original dimensions yes although not essential, but some images will look strange if not.
RivaultUser said:
- I found errors and it says that I have errors in the /res/values/public.xml
I found this :
Code:
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!...
I confused about :
1."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."
What are the "holes" and " referenced in the code" mean?
Click to expand...
Click to collapse
It means you can remove lines so long as they don't point to anything in the drawables folder for example.
RivaultUser said:
2. Because I want to add .png's picture to the drawable-mdpi folder, Do I need to add dummies to the public.xml ?
Click to expand...
Click to collapse
No.
RivaultUser said:
3. I'm using the tricky signing method ( open archive in the original framework, copy meta-inf & android manifest and replace those files to the modded framework). Is this cause me an error?
Click to expand...
Click to collapse
No. If you're doing it like in my guide you should be fine. Re read the bold quoted text above.

Editing smali code.

Hey you gurus out there. Any extra ordinary person out there? Help me edit some smali code to add the buttons in my rom.
I av added the resources to framework-res.apk added the images and added the necessary values in the strings.xml, public.xml. damn those files are hard to edit. I had to do vb.net application to scan available item ids. But wen it comes to editing the smali files it really hard for me. Would be happy if anyone help me out
Sent from my TECNO N3S

Samsung Galaxy Star Custom Carrier Label

I've been looking for ways on how to customize our carrier label but found none. Fortunately, I've found this great thread http://forum.xda-developers.com/showthread.php?t=1570956 which gave me the idea so I started modifying my device and I was able to customize it, so I decided to share it with you guys since this site has been a great help for a beginner like me. So here's how:
Requirements
1. Apktool
2. Notepad++ or any xml editor
**Since modifying this is so complicated, I attached the edited xml which will replace your current xmls.**
Download the attached zip and extract it.
Open strings.xml and find this line (its in the endline )
<string name="iamLinker">InsertYourTextHere</string>
change the text in red font to your desired text and save
Extract your SystemUI
move the following xmls to /res/layout -- look for layout-ldpi as well
status_bar_expanded.xml
tw_status_bar_expanded.xml
tw_status_bar_expanded_dual.xml
move the following xmls to /res/values
strings.xml
styles.xml
recompile and push the modified SystemUI.apk
then reboot.
And that's it! Don't forget to hit thanks if this helps!
emmantot said:
I've been looking for ways on how to customize our carrier label but found none. Fortunately, I've found this great thread http://forum.xda-developers.com/showthread.php?t=1570956 which gave me the idea so I started modifying my device and I was able to customize it, so I decided to share it with you guys since this site has been a great help for a beginner like me. So here's how:
Requirements
1. Apktool
2. Notepad++ or any xml editor
**Since modifying this is so complicated, I attached the edited xml which will replace your current xmls.**
Download the attached zip and extract it.
Open strings.xml and find this line (its in the endline )
<string name="iamLinker">InsertYourTextHere</string>
change the text in red font to your desired text and save
Extract your SystemUI
move the following xmls to /res/layout -- look for layout-ldpi as well
status_bar_expanded.xml
tw_status_bar_expanded.xml
tw_status_bar_expanded_dual.xml
move the following xmls to /res/values
strings.xml
styles.xml
recompile and push the modified SystemUI.apk
then reboot.
And that's it! Don't forget to hit thanks if this helps!
Click to expand...
Click to collapse
Really nice ... but this is the wrong place to post.
Please move this to the Galaxy Star General forum.

Categories

Resources