Modify apk resources programmatically - Android Software Development

I have tried to modify an apk with ZipFile and ZipOutputStream classes but I don´t find the way to replace files with these classes.
I want to modify apk resources from Java.
Any ideas?
Thanks in advance.

Related

Create a program to edit Host File

I'm starting developing on the Android 2.2, one of the things that's a real pain is editing the hosts file...
I've been trying to execute su commands through an application to edit the hosts file but it's proving very difficult. I'm pretty sure the Adfree app edits the host file, can anyone shed some light as to how to go about it and perhaps some sample code?
Thanks in Advance!
I'm not familiar with what language android is in, but if the hosts file is similar to regular computers then I bet he just replaced the hosts with one of his own
Captiv < vib

[Q] Help needed adding a Language to LatinIME

OK, so in looking at the source code, it seems that all I need to do is add a folder called /xml-az/ to /platform/packages/inputmethods/LatinIME.git/java/res/ that contains the custom kbd_qwerty.xml and kbd_qwerty_black.xml files for the language (in this case Azerbaijani which is a language very very similar to Turkish).
Eventually what I would like to do is create an APK to insert that code, but I need some help. I can write Java code so editing the source is not so much the problem. I need more help in creating the apk patch for testing and then the process in submitting the code. Anyone wanna help?

[Q] Recompile XML's?

Hello, i have decompiled an app using apktool which had some errors and im missing the apktool file so i cant re-compile it, however the XML's are readable and i have made some tweaks.
Is there any other way to convert the human readable XML to android binary code?
I tried AXMLPrinter2, but it cant compile the XML
The only way I can think of to do this without apktool is to build a dummy project in eclipse, then add your xml to the project, and export it. You can then extract the xml byte code from the apk.

[Q] can any one give me the .xml file editor?

Hii!!friends..
I have no computer!!!
So..
i want to edit .xml file in my galaxy y !!
So anyone tell me that how to do?
N give me the .xml editor app.....
Plzzz...
sorry its not possible to edit xml files on a phone without decompiling the apk first - you will just get a load of symbols
There are some xml apps on google play that can read xml files after you have decompiled the apk however they do not work properly with andriod xml files so you can read them but editing them is near on impossible on a phone

[SCRIPT] Quickly Convert *.java To *.smali Code

Most of us often want to add custom functionality to an existing apk and know how to do it in java, but don't know the exact dex/smali syntax. Trying to add this, there, test, error, debug, fix & hopefully getting it to work is common. To solve all of that trouble, I bring you this.
I made these little scripts to add an extension to Windows explorer shell for doing a task most people couldn't just do this easy. So now can just write your functionality in java, right-click the file & click Convert To *.smali and tada! You have the dex/smali compatible code which you can then paste it into your apk smali file.
Installation:
Download the attachment & extract the archive.
Run install.cmd as Administrator to install Windows Explorer shortcut.
You can also darg-n-drop files on convert.cmd to convert them.
Nice bro :thumsup:
Thank you very much. This is exactly what I need
Thanks for the information..
I would like you to help me with this issue since I do not want to work the conversion
it not work
where is the converted smali jfile?
Hello.
I click the right button of mouse and click the Convert to*.smali.
But I didn't the converted file.
could you lend me a hand?
vaibhavpandeyvpz said:
Most of us often want to add custom functionality to an existing apk and know how to do it in java, but don't know the exact dex/smali syntax. Trying to add this, there, test, error, debug, fix & hopefully getting it to work is common. To solve all of that trouble, I bring you this.
I made these little scripts to add an extension to Windows explorer shell for doing a task most people couldn't just do this easy. So now can just write your functionality in java, right-click the file & click Convert To *.smali and tada! You have the dex/smali compatible code which you can then paste it into your apk smali file.
Installation:
Download the attachment & extract the archive.
Run install.cmd as Administrator to install Windows Explorer shortcut.
You can also darg-n-drop files on convert.cmd to convert them.
Click to expand...
Click to collapse
Can you please update this. I tried running it on windows 10 and after that I don’t see the right click convert to smali
It's not working on Windows 10....Any updates on it?

Categories

Resources