[IDEs, Libraries, & Programming Tools] MidnightHarvester:
Here is a method for editing xml files directly on from your phone (as well as a fully functional Eclipse compatible IDE). I'm going to sleep so I'll post a reply I made in another thread first, and clean up in the morning. Have fun..G'night!

-------------------------------------------------------------------------------------------

Quote:

Originally Posted by Toni5830

You can extract xml but you can't see them (only strange symbols) and you can't edit them from phone.. you must use PC and decompile them.. no other possibility

Inviato con Tapatalk 2 dal telefono di casa

-------------------------------------------------------------------------------------------

No, you can edit them on your phone. Axel is one of the apps to use. The second is an IDE called AIDE which is compatible with Eclipse. You can develop, program and publish complete apps from your phone. I figured out how to edit compiled xml the other day. Ninjamorph is also useful because it unpacks the archives into a project which happens to be near where your AIDE projects are.

Begin by opening ninjamorph and choosing the apk to work on and create a project (can do this manually but keep a back up of the apk). Next, open AIDE and create a new project. As an example I'll be editing the lg_allapps_button_text.xml file in LGHome.apk (LG's launcher on G2, so files may differ for you). Choose the HelloWorld setup as that's the less,cluttered one. After creating the project, open up a file manager (you can do this from within AIDE as well) and create the same directory structure for your xml file (probably doesn't matter if a ../res/color xml file is in ../main..but it's good practice. The xml I'm editing is in /res/color, so I'll go into the project directory and create a ../res/color folder.

Now open Axel up and find the xml in the ninjamorph project that you are editing. Again in my case it'll be in /res/color. Go ahead and open it with Axel. Don't bother editing it here, we're going to just go into settings and "save as" (into our AIDE project directory) ../res/color/lg_allapps_button_text.xml. This adds it into our AIDE project and we can now go back into AIDE. In the oberflow action, choose "Goto Files" or whatever it's named (also an icon at the top for this action). It'll open a pane at the bottom with your project files. At this time you'll probably notice AIDE throwing a lot of errors (errors in your code, not app errors lol).

We have to fix every one of them before finish, so might as well start now before editing. Conversely, you could do this in Axel first once you know what kind of errors to expect and fix. In my case, I see two errors because the file is really small. Once clicking on the xml I want to edit in the files pane, I can see that it's telling me string values aren't allowed in the "color' attribute. The color is black but when Axel decompiled it, it changed it from it's ARGB form. I see this -

Code:

#xml namespace blah blah...

.....

....... android:color="1F000008/0xFF000000"

Of course there is more, I just highlighted the attribute I need to fix. You're going to need to learn how attributes need to be formatted or learn and keep a reference handy. Google has nice guides online for building android apps. In this case we change it to:

Code:

...

.... android:color="#FF000000"

Technically yes it's still a string, and yes the wrong format was hexadecimal (sort of), but now we have one less error. On large xmls, this gets annoying but you'll get fast at it. So, I've fixed,myerrors, so now for simplicity I'll just change the color on one of the attributes..to red ("#FFFF0000"). Now that edits are done and errors done, go back in the ooverflow action and scro,down and either click "Run" or "More" and then "Rebuild Project". We aren't worried about any other file, we just want our xml recompiled. Once it's done, if you want you can install your fancy Hello World app (or Tetris game app), lol but it's just as well if you choose not to.

Next, go back into your file manager and find your way back into your AIDE project directory. Locate the bin folder (where your compiled project will be) and navigate to your xml. Again, in my case, I'll be going to /res/color. Make sure you find the compiled version (the binary one with all the cool symbols). Copy this back into the same structure inside the ninjamorph project folder. If you aren't using ninjamorph and manually doing this then make sure you have a backup apk handy and akip the ninjamorph stuff.

Opem Ninjamorph back up and choose to complete your project. Once it's done repackaging it'll ask you if you want to resign the apk

Follow Steven's directions and dont sign it if its a system apk. Next he'll ask about zipaligning (i think?). I don't choose this option at all. If my mods work, then I'll redo the project and choose that option. Problem is, sometimes it can cause issues and you don't want to add more variables in until you know that all,is working or you'll be asking yourself "wonder if my edits were bad,or the zipalignment".

Ninjamorph will create a backup of the apk for you, and now you'll be given the option of installing the apk. You should know what you're doing already but...if using TWRP you can go ahead and replace the modded apk and reboot. Worst that'll happen is boot loops or force closes and you can manually go into recovery and use TWRP's file manager to copy your backup back (may need to mount /system first, and may need to chmod as well. Then try again. If you boot up and all is well, congrats! If using CWM, make sure you have a recovery plan before making the switch.

I have no clue if,there's any easier way. I'm still working on it. Granted, kf you're just going to edit a color like in my example it'd be MUCH easier just using a hex editor. AIDE is a pretty damn slick app as it also supports native mode C/C++ for developing codecs, drivers,,etc. For $8 you can purchase full version with support for larger projects and github and a few other things.

This method should work on any device that can run all those apps. I'm using a LG G2. I'm not the,developer of any of tbose apps so don't come to me if they aren't working: )