[Q] XML files - Desire Q&A, Help & Troubleshooting

so I have started to edit xml files and so far I have used apk manager, but it often fails to complile the files afterwards, is there a better application out there to edit xml files ?

Related

[Q] Binary XML edits....

Hi there,
I am trying to learn all this theming and have started with the basics, the notification bar icons in framework-res.apk.
I can pull it from the phone, I can decompile it but I am having a challenge putting it all back together as I changed the number of images in a specific animation and then edited the XML file regarding that, but I think there must be other references to the files as now there are less files and the error log is saying it can't find the ones I removed (both the png's and the references in the one xml file) when trying to recompile.
Is there a master XML listing all the files expected or something.
many thanks in advance
David P
Let me guess you are using apktool?
What you need to do is take a clean version of the apk you want to edit. For arguments sake let's say you are editing framework-res.apk.
Decompile using apktool and make your edits to .xml files ONLY. Once done recompile using,
apktool b -f [foldername] framework-res.apk
Now this recompiled apk will probably not work. However the xml files will be properly recompiled. So now you extract the edited .xml files, add them to a clean unedited framework-res.apk (not a de and re copmpiled one) without extracting the .apk. Just add and replace the files using WinRar or whatever.
Also add your edited images to necessary folder in the clean .apk too. So the end result is a clean framework-res.apk that you have updated with your edited .xml files and edited images. This apk should function just fine!!
Sorry if this is a big mess but it makes sense to me and it works for me.
Thanks for the suggestion. I am not quite sure what I am using, I have tried ThemePro for windows and APKManager, both of which are just scripted batch files so I would need to check what they use to extract or decompile with.
So Basically, I decompile, edit the xml (while textual) then recompile so the XML's are binary again. Then pull the BINARY XML#'s from the APK and use those with all the appropriate files and folders which I then create a new clean APK from by zipping it and renaming to .apk, correct?
David P
ephumuris said:
Let me guess you are using apktool?
What you need to do is take a clean version of the apk you want to edit. For arguments sake let's say you are editing framework-res.apk.
Decompile using apktool and make your edits to .xml files ONLY. Once done recompile using,
apktool b -f [foldername] framework-res.apk
Now this recompiled apk will probably not work. However the xml files will be properly recompiled. So now you extract the edited .xml files, add them to a clean unedited framework-res.apk (not a de and re copmpiled one) without extracting the .apk. Just add and replace the files using WinRar or whatever.
Also add your edited images to necessary folder in the clean .apk too. So the end result is a clean framework-res.apk that you have updated with your edited .xml files and edited images. This apk should function just fine!!
Sorry if this is a big mess but it makes sense to me and it works for me.
Click to expand...
Click to collapse
A lot of thanks!!! I'm looking for an explanation like this, all that I try give me an unusable framework-res.apk and now I know why.
ephumuris said:
Now this recompiled apk will probably not work.
Click to expand...
Click to collapse
Apktool creates "clean" apks as you name them. There is almost no difference between application built from sources or using apktool. And almost no logical difference between original apk and rebuilt one (for most apps, of course apktool doesn't support some of them).
If you are talking about system apps, then your problems are most probably related to incorrect way of installing resulting apk, not to it's structure. You can't reinstall system app easily and one of workarounds is to copy AndroidManifest.xml and META-INF from original file and push it to a device. Actually you did this using your method and I think this is the reason, why you think there is something wrong with apks built by apktool.

[Q] Framework-res.apk not working

So as I'm trying to figure out what's causing some bugs in the SEs music player I installed apktool to break the apk into readable java and text files.Since this is a system app i need the framework to decode it,and I pulled framework-res.apk from my system/framework directory and installed it in apktool,but it doesnt seem to apply to this app...Does anyone a file I can use?
The apps name is SemcMusic.apk
You could open the .apk in a .rar file . Its a pretty basic way though Idk if youll be able to access the file parts you need.
I guess it does work,but I just realized I have to find a peace of code in 20 folders and i have no knowledge of java...
Edit: It probably wont work that way since apktool translates binary xml to normal readable xml

[Q] Can't open/edit XML files

I'm having issues opening xml files in .apk like framework-res.apk. I've extracted the .apk using apk multi-tool and I have access to all the files but when I open it in a browser it's a blank page and if I open it in notepad I get a bunch of random characters. Is there a step I'm missing? Do I need to put these xml files through another filter before I can see/edit their contents?
yoft1 said:
I'm having issues opening xml files in .apk like framework-res.apk. I've extracted the .apk using apk multi-tool and I have access to all the files but when I open it in a browser it's a blank page and if I open it in notepad I get a bunch of random characters. Is there a step I'm missing? Do I need to put these xml files through another filter before I can see/edit their contents?
Click to expand...
Click to collapse
Since u Use apk multi tool, DECOMPILE not extract, and recompile when finished yep, that easy
*edit
Side note, internet explorer and NOTEPAD to edit code? Seriously? Lmao I always use notepad++ xD should check it out.
doug36 said:
Since u Use apk multi tool, DECOMPILE not extract, and recompile when finished yep, that easy
*edit
Side note, internet explorer and NOTEPAD to edit code? Seriously? Lmao I always use notepad++ xD should check it out.
Click to expand...
Click to collapse
Ah thanks a lot! And yeah I'm just starting, I haven't edited xml files before, so far all I've managed to do is make graphical changes by replacing/editing pictures in an .apk so I'm starting to dip into xml editing. I'm sure once I get my footing I'll switch to a dedicated xml editing tool but for now, I just want to see what they look like xD

create apk to edit system files

hi,
i want to know how do devs create an apk file that can edit files in system folder. for example sound files etc. generally a flashable zip is created which will replace the stock file with a modified one. The same thing, this time without going into recovery but being able to do it with an app itself.
Yes, ready to learn.

Values folder dissapears after recompiling.

I was looking to theming some of my apps & thought I'd start out simple. So I decomipiled my LGDownloadsUi.apk (pull from decompiled system.img) & copied the necessary framework files, installed them, and decompiled.
I looked in the res/values directory found the colors xml & changed the text color hex code.
Upon recompiling the values folder is not in the new apk. (Since it's a system app I need to copy the new xml from the newly compiled apk to the original to maintain the sig.) I tried simply deleting everything except for meta folder & moving everything over, but that result s in getting stuck in tmo splash screen. Am I missing something? Is editing the values xml files only viable in non system apk's? Do they get compiled into another file perhaps?
My device is a LG G3 D851 running MM 6.0
For decompiling I'm using the latest version of apktool.
Also I created a custom zip containing app & priv-app no framework, as my phone already has the framework files. Do I need to flash the same framework files from the decompiled system.img as well over my current ones? Thanks for any help.
TheLogicalGamer said:
I was looking to theming some of my apps & thought I'd start out simple. So I decomipiled my LGDownloadsUi.apk (pull from decompiled system.img) & copied the necessary framework files, installed them, and decompiled.
I looked in the res/values directory found the colors xml & changed the text color hex code.
Upon recompiling the values folder is not in the new apk. (Since it's a system app I need to copy the new xml from the newly compiled apk to the original to maintain the sig.) I tried simply deleting everything except for meta folder & moving everything over, but that result s in getting stuck in tmo splash screen. Am I missing something? Is editing the values xml files only viable in non system apk's? Do they get compiled into another file perhaps?
My device is a LG G3 D851 running MM 6.0
For decompiling I'm using the latest version of apktool.
Also I created a custom zip containing app & priv-app no framework, as my phone already has the framework files. Do I need to flash the same framework files from the decompiled system.img as well over my current ones? Thanks for any help.
Click to expand...
Click to collapse
I discovered that you can edit those xml's build the apk, the copy android manifest.xml and meta folder into the build folder. Then rebuild the apk to avoid signature issues. Instead coping the edit xml's into the new apk.

Categories

Resources