Editing XML's in android's binary format? - Android Q&A, Help & Troubleshooting

Hello, I'm trying to create my own theme. I've decompiled deodexed systemui / framework-res and I want to get to work on these xml files. I'm running into issues though because they're in android binary format and I can't find a way to convert them to something a human can actually read.
I've searched around, but no methods I've tried have produced useful results. AXML is definitely broken and only shows UTF8 headers. I've decompiled the app in many different ways and it's just not working.
how can I edit something like status_bar.xml without a hex editor?

Are you sure you decompiled with apktool? Or just unzipped the apk? Do you have a /values folder after decompiling?
Sounds like you're not doing something right...
Sent from my phone's mind

If u decompile the apk you can modify .XML with notepad++ and then when you are finished you recompile
You can use
Apktool
Apkmanager
Or Google how to decompile .apk and you will get an answer on that many tutorials out there
Sent from my GT-N7000 using XDA Premium HD app

Related

Volume Slider Color

I'm wanting to change the color of the slider when you turn your volume up and down from yellow to another color. I'm running CM7 fascinatemtd ROM by JT, I know which folder it's in and how to do it. My question is, I use Apk Manager to decomplie my framework-res.apk which was pulled from the ROM using 7zip, I've decompiled the apk, edited the XML file, when I went to recompile the framework-res apk using option 11, a error pop up and told me to read the log, I hit enter, answered yes to system question, then went to keep folder and deleted the resources file as instructed, and hit enter, I was left with an unsigned framework-res.apk file, renamed it to framework-res.apk, and pushed it back into ROM with 7zip, rebooted recovery, cleared caches, and installed ROM, but phone wouldn't boot up. So what am I doing wrong...
Obviously not
Sent from my SCH-I500 using XDA App
What color do you want the slider man
Sent from my SCH-I500 using XDA App
Blue would match my theme the HEX code is 11114b...
Sent from my SCH-I500 using XDA Premium App
If apkmanager errors common logic would dictate to read the log and see what is going wrong
Trying to flash a broken apk won't work obviously
I've gotten it to decompile and recompile bit the problem now os the changes I've made don't show up I'm not getting any errors before I was ising a ROM that I themed so I went back and used the original ROM how do I get the changes to stay...
Sent from my SCH-I500 using XDA Premium App
And you're trying to edit progress_horizontal.xml? And changing code to ff11114b leaving the "f's" in?
good day.
Yes
Sent from my SCH-I500 using XDA Premium App
I should rename unsigned framework.res to framework.res right...
Sent from my SCH-I500 using XDA Premium App
And during the compile process, you hit y for "system apk" and hit y for "would you like to copy over any files..............." and from the keep folder delete resources.arsc and continue to compile. And yes rename back to framework-res.apk.
good day.
Answered yes to system app and no to copy over files, didn't delete arsc and changes stayed, but if I install will I get boot loop since I didn't delete arsc....
Sent from my SCH-I500 using XDA Premium App
If I hit y to copy over files the changes don't stay only if I hit n
Sent from my SCH-I500 using XDA Premium App
it worked, by not copying over the files and not deleting the resources arsc file, does anyone know what the XML file name is for the download progress bar color is...and thanks for your help guys...
Here's what I would do if I was on Windows!
Download apktool & dependencies:
http://android-apktool.googlecode.com/files/apktool1.4.1.tar.bz2
http://android-apktool.googlecode.com/files/apktool-install-windows-r04-brut1.tar.bz2
Unpack both archives to your Windows folder. This will make apktool accessible through cmd anywhere.
CD in cmd window to the location of your apk, If you haven't already done so and install the resources by copying or pulling (framework-res.apk, twframework-res.apk for touchwiz) or (framework-res.apk, SystemUI.apk for GB). Once copied to the folder you are cd'd too...
Install the resources
apktool if framework-res.apk
apktool if twframework-res.apk
apktool if SystemUI.apk
Decompile and make your changes..
apktool d framework-res.apk
Recompile when done
apktool b framework-res
If it built succesfully, then make a copy of your framework-res.apk. Then navigate to framework-res/build/apk! Open your copied apk with 7zip and drag n drop res & resources.arsc from framework-res/build/apk inside! Close it up..
Push and test.. On windows you may need to navigate to your sdk directory if not properly setup!
adb push "your_copied_file"/system/framework/framework-res.apk
If you get a failed to write to system, run this first.
adb shell su -c rw
YES got all progress bar colors changed to blue now my CM7 Fascinatemdt ROM is themed all of my drawable hdpi and XML files are complete I might post this as a theme, thank you for your help...
Sent from my SCH-I500 using XDA Premium App
notta said:
Here's what I would do if I was on Windows!
Download apktool & dependencies:
http://android-apktool.googlecode.com/files/apktool1.4.1.tar.bz2
http://android-apktool.googlecode.com/files/apktool-install-windows-r04-brut1.tar.bz2
Unpack both archives to your Windows folder. This will make apktool accessible through cmd anywhere.
CD in cmd window to the location of your apk, If you haven't already done so and install the resources by copying or pulling (framework-res.apk, twframework-res.apk for touchwiz) or (framework-res.apk, SystemUI.apk for GB). Once copied to the folder you are cd'd too...
Install the resources
apktool if framework-res.apk
apktool if twframework-res.apk
apktool if SystemUI.apk
Decompile and make your changes..
apktool d framework-res.apk
Recompile when done
apktool b framework-res
If it built succesfully, then make a copy of your framework-res.apk. Then navigate to framework-res/build/apk! Open your copied apk with 7zip and drag n drop res & resources.arsc from framework-res/build/apk inside! Close it up..
Push and test.. On windows you may need to navigate to your sdk directory if not properly setup!
adb push "your_copied_file"/system/framework/framework-res.apk
If you get a failed to write to system, run this first.
adb shell su -c rw
Click to expand...
Click to collapse
will this work also when trying to decompile/recompile a non system app, like one from the market, that has dependencies
adude247 said:
will this work also when trying to decompile/recompile a non system app, like one from the market, that has dependencies
Click to expand...
Click to collapse
It will work with anything provided you have the resources. Some apk's are picky by means of what you can replace.
The method above is using apktool the way it is supposed to be used. That apkmanager thing sounded crazy with the delete this after that, hit y or n before this. Seems like alot of un-needed steps and confusion!
On linux it's even easier, pretty much fully auto!
notta said:
It will work with anything provided you have the resources. Some apk's are picky by means of what you can replace.
The method above is using apktool the way it is supposed to be used. That apkmanager thing sounded crazy with the delete this after that, hit y or n before this. Seems like alot of un-needed steps and confusion!
On linux it's even easier, pretty much fully auto!
Click to expand...
Click to collapse
yeah, I didn't delete anything just decompiled, edited the XML, and recompiled, that was the only way I could get the changes to stay. Any suggestions on what to use if the above resources don't work to get the apk to decompile, an example of an apk that I want to edit but cant get it to recompile after decompiling and editing the XMLs is....
adude247 said:
yeah, I didn't delete anything just decompiled, edited the XML, and recompiled, that was the only way I could get the changes to stay. Any suggestions on what to use if the above resources don't work to get the apk to decompile, an example of an apk that I want to edit but cant get it to recompile after decompiling and editing the XMLs is....
Click to expand...
Click to collapse
I can't and won't explain getting resources for market apps or generally someone else's work. However there are several ways to approach non-building apk's.
For example aapt has the capability to recompile standalone 9's as well as xml's, which can then be injected into the apk with the 7zip method. Especially useful for minor changes.
Another example for stubborn apk's would be the Eclipse or similar project. This is where you would partially build the files you wanted to change.
Thanks for the advice...
Sent from my SCH-I500 using XDA Premium App

Bootloop with editing framework res need help

Hi i am trying to edit the framework res apk so i can change the text colour and the themed clock colour. I can decompile with apktool and change the colors.xml but after compiling framework res i just get stuck in a bootloop. I have tried just copying the reaources file to my original framework but still bootloops.
I have searched google and here and finding it hard to find a solution. One thing i noticed in 7zip it says that for resources the OS is FAT but on the edited one it is UNIX as well as being a smaller file when compressed. If anyone can help that will be great.
Thanks
Sent from my GT-I9100 using XDA App

Recompling an apk questions

Trying to modify contacts.apk to make the dialer multi-dpi compatible. Did that and it works.
My issue is recompiling the apk. Everytime I recompile the apk with apktool it looses over a megabyte in size. In my case went from 4.49MB to 3.19MB after rebuilding. Only file modified was dialer_app.xml and it's size stayed about the same.
I've brought framework-res.apk and twframework.apk into apktool. After copying the resulting contacts.apk back to the device it is not recognized.
I've also tried copying the META-INF directory from the original apk over to the new one. Still no luck. I'm new to this and if anyone has some help for me it would be greatly appreciated!
Did you sign your new apk after recompiling it ?
Do you have classes.dex and resources.arsc files in your new apk ?
since its a system apk I've read it shouldn't be signed. Only thing I did was copy the META-INF folder to the new apk. In the new apk I do see classes.dex and resources.arsc. All the files appear to be there but the apk has shrunken in size.
I'm guessing I'm missing something simple here. But I'm new to this. Been at it for a few hours haven't had any luck.
I am new in development field. I have two questions 1. Is there same meaning for building and recompiling using apk tool? 2. I know framework-res.apk is needed for apktool d com, but where and the what is the use of twframework.apk file. Please explain anyone .
Recompiled apks will be quite a bit smaller as they will have more compression applied, this is normal, just be careful as if the tool compresses it to much you will get fc's. But it should work fine.
idhbar said:
I am new in development field. I have two questions 1. Is there same meaning for building and recompiling using apk tool? 2. I know framework-res.apk is needed for apktool d com, but where and the what is the use of twframework.apk file. Please explain anyone .
Click to expand...
Click to collapse
Read the apktool website for info about framework files, as far as which one to use, if you are decompiling a la2 or la4 base use a kl2 or kk5 framework without jkays built in as the laX frameworks are kinda buggy.
Sent from my GT-I9100 using Tapatalk

[Q] Modifying SystemUI.apk xml file

I am using kyanROM and love it! One little tweak I was looking to make was in the notification it has kyanROM along the bottom. I was looking to replace that with my nickname. I am new to modding Android, so any help or tips would be appreciated.
Here are the steps I took and the issues I encountered:
Using NinjaMorph I extracted/decompiled SystemUI
I copied the files over to my PC
Looking through the files (not an exhaustive search mind you), I found one, tw_status_bar_tracking.xml, that had android:text="@string/kyanROM and android:layout_gravity="bottom". This looked promising to me, so I changed kyanROM to the name I wanted to use.
After saving, I copied this file back to my phone and opened the projected in NinjaMorph and said replace the original xml file with my new xml file.
"Finished" the project and closed out NinjaMorph.
Immediately experienced issues. SystemUI stopped working. Rebooting did nothing. So I restored my nandroid backup in order to start over. Back in NinjaMorph, I extracted SystemUI again and copied all files to my PC. Searching the contents of all files (a more exhaustive search) I found 4 instances of the phrase kyanROM:
First was the original in tw_status_bar_tracking.xml and said android:text="@string/kyanROM"
Second is in values\public.xml and says <public type="string" name="kyanROM" id="0x7f0800cd" />
The last two hits are from the same line in values\strings.xml and say <string name="kyanROM">kyanROM</string>
Now, assuming I'm correct that I need to mod SystemUI, after looking at the search results I'm thinking the change I need to make is to the last hit on my search, thus making it <string name="kyanROM">myName</string>. Then, when tw_status_bar_tracking.xml looks for the string kyanROM, it will display myName.
So, am I correct that in order to make this change I need to be in SystemUI? And If that is correct, is my proposed change correct - modifying the strings.xml file to show <string name="kyanROM">myName</string>?
If I do those, go into NinjaMorph and say to replace the original file with my new file I then should see myName along the bottom of the notification dropdown. Thoughts???
So I started over, this time I pulled the SystemUI.apk using adb. Then using apktool I did "apktook if SystermUI.apk". Then, apktool d SystermUI.apk ./mod". Found the file I *think* I need to modify (\values\strings.xml) and replaced kyanROM with myName. Saved the file.
Now I'm trying to recompile the file. I run the following apktool b -f -d mod. When I run this I get the error: Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml.
1) Am I modifying the correct file to place myName at the bottom of the notification screen?
2) How do I fix the PathNotExist error? I've looked at some solutions, but none seem to have worked.
Actually you need framework-res.apk from /system/framework installed through apk tool.
Pull framwork-res.apk and install it as you did for systemui.
After installing framework,type
apktool d systemui.apk
Now make the necessary changes and type
apktool b systemui
To recompile it back.
Note:after you recompile,you need to add meta-inf folder from original apk to your new recompiled apk to make it work.
Sent from my GT-N7000 using xda app-developers app
OK, I think I'm with you.
I need both SystemUI and framework-res in order to modify SystemUI
Install both (apktool if NameOfApk.apk)
decompile (apktool d SystemUI.apk)
make changes
recompile (apktool b SystemUI) but not the framework-res since I made no changes to it
And thanks for the tip about adding the meta-inf folder. I knew this, but since I never gotten that far to test, I'd probably forget to do that.
cyberpac9 said:
OK, I think I'm with you.
I need both SystemUI and framework-res in order to modify SystemUI
Install both (apktool if NameOfApk.apk)
decompile (apktool d SystemUI.apk)
make changes
recompile (apktool b SystemUI) but not the framework-res since I made no changes to it
And thanks for the tip about adding the meta-inf folder. I knew this, but since I never gotten that far to test, I'd probably forget to do that.
Click to expand...
Click to collapse
Installing framework-res.apk alone is enough if you have Samsung phone and have the latest apktool...
Sent from my GT-N7000 using xda app-developers app
vijai2011 said:
Installing framework-res.apk alone is enough if you have Samsung phone and have the latest apktool...
Sent from my GT-N7000 using xda app-developers app
Click to expand...
Click to collapse
OK, I installed both - no harm I guess. So I have made all my changes, updated the apk with the meta folder, etc. I'm ready to push this over to my phone. Using adb, do I need to remount or can I just do the following: adb push S:\apk\SystemUI.apk /system/app/
Well, I took a shot and just did the adb push without remount. I think it worked. We'll see if there are any issues moving forward. Yay! Many thanks....
edit: I noticed it reset my wallpaper, easy fix. Wonder if anything else would've been reset by this change?

[Q] Help editing XML Files

how can I edit XML files. I tried using notepad++ and VTS. All i see is whats in the attached pic.
Any ideas or reccomended programs?
termin8tor22 said:
how can I edit XML files. I tried using notepad++ and VTS. All i see is whats in the attached pic.
Any ideas or reccomended programs?
Click to expand...
Click to collapse
Is the .xml you're trying to edit from an app? If so, looks like to need to de-compile the app first, instead of just un-zipping it. If you already de-compiled it, then try XML Marker to edit it. :good:
Argumentation said:
Is the .xml you're trying to edit from an app? If so, looks like to need to de-compile the app first, instead of just un-zipping it. If you already de-compiled it, then try XML Marker to edit it. :good:
Click to expand...
Click to collapse
To be exact the xml is the AndroidManifest.xml file in the sense 5 clock widget apk and yes i decompiled the apk. will try xml marker
Edit: xml marker gave same results

Categories

Resources