Editing XML, extreme noob - Android Software/Hacking General [Developers Only]

Hey guys, i've spent a few hours searching while figuring out these new tools I've downloaded in hopes to modify some basic apk's. After successfully modifying the background image for the pandora widget, my intention's are to now expand the widgets width. To do so I understand I would need to modify the xml file associated to the widget, and this is where my trouble's lie.
From what I've gathered I've been able to decompile the binary xml file to regular xml using AXMLPrinter, after editing it there seems to be no hope in recompiling it to an android freindly xml file.
After a bit of searching i've learned most suggest using apktool to decompile the apk, edit the necessary xml files, and then recompile. From what I understand this is the most appropriate method for what I desire.\
The problem i'm having is that once I decompile the apk, all I find is "smali" type files, and not one single xml file. This is where i'm lost..
Thanks for any help in advance, and sorry for this stupid question, it seems that everywhere I search this is the part that is directly skipped over.

you will find the xml files in the /res folder

Related

resources.arsc file - how to get info about icon from compiled application?

Hello,
How cen I get information about icon of compiled application??
I have downloaded example.apk on my PC.
Unziped it. Found binary AndroidManifest.xml. OK I decoded it and I get:
<application
android:theme="@7F0C0017"
android:label="@7F0B0000"
android:icon="@7F0200A4"
>
And I would like to know the name of the resources the is icon of this application. What means the number: @7F0200A4 . I tried as an offset in resoirces.arcs file but I missed It's not that.
Maybe it's wrong way?? Maybe there is other way to get knowledge about the icon???
BR.
Damien
Not sure if the app icon can be programatically determined without decompiling the whole apk, but it's usually app_icon.png, icon.png or ic_launcher_appname.png in /res/drawable
/Mats
Just open the .apk with a file manager and hunt around for the png, it's not in any xmls.

Help me out! editing XML file..

I just recently checked out LauncherPro beta, and i really like it, my only problem is that the shortcut icons arent really what I like.
All I want to do it edit the default_workspace.xml so that the target APKs for the shortcuts will be Phone, Messages, Gallery, and Browser. I've already edited the icons to reflect that.
I already decoded the binary XML, I just need to know how to re-compile it to a binary XML after editing.
Sorry guys, I'm a complete noob when it comes to any kind of coding... and thanks in advance
edit: I already read Stericson's sticky, but I either just didnt get it, or didnt see anywhere to re-compile a decompiled binary XML.
If you have used AXMLPrinter to decode XML, then no, you can't compile it back. It's for looking into XML files only, not for editing them as text.
AFAIK my apktool is only one tool, which gives you possibility to edit XML files easily:
http://forum.xda-developers.com/showthread.php?t=640592
AXML is what I used, but re-editing it is no problem. I tried using apktool, but it gives me a "java" is not recognized as an internal blah blah message.. I've googled it, and made sure the environment variables were correct also, just updated Java a couple hours ago as well.
edit: and oh, thanks for the reply.. it's the only one I've gotten so far between here and droidforums so far.
I don't really know, why you don't have java command set in your PATH - I think Java installer does it automatically :-/ You could find java.exe file on your disk and:
Add it to PATH - there are many arts about this in the internet.
Edit apktool.bat file to call java command using full path, i.e. replace "java" with something like: ' "C:\Program Files\Java\java.exe" '.
Don't use apktool.bat, call Java directly: ' "C:\Program Files\Java\java.exe" -jar %WINDIR%\apktool.jar d somefile.apk outdir '

[Q] Find core/java/android/view/Surface.java

Hello,
I would like to know, how its is possible to find, for example the file core/java/android/view/Surface.java .
Sorry for that noob question, but I am really interested in Android Software Developement and when I look at the github-profiles of others I always find those directories and files, I do not find on my system.
I tried using the baksmali tool and baksmalied my framework.jar . Then I found the file /framework/android/view/surface.smali but there are mostly completely different commands, so I think, there must be another tool that can edit the framework.jar in another way.
I would be very thankful for help.
AFAIK, what your looking for is in source, so once a build is compiled, you will not find that file(or folder structure). When you decompile framework.jar, you will find mostly smali files, which makes looking at the code give me headaches...
What are you trying to do? Is this for ICS or GB? and have you looked into setting up a repo on your computer? If you set one up, you will then find all the java source files you are looking for, but then you must compile the files you edit.
netwokz said:
AFAIK, what your looking for is in source, so once a build is compiled, you will not find that file(or folder structure). When you decompile framework.jar, you will find mostly smali files, which makes looking at the code give me headaches...
What are you trying to do? Is this for ICS or GB? and have you looked into setting up a repo on your computer? If you set one up, you will then find all the java source files you are looking for, but then you must compile the files you edit.
Click to expand...
Click to collapse
what i am trying to do, is to add some features like the rotation animation for motorola milestone 2.1 . what i already have managed, is to add ics animations and 4-way-reboot, by editiong the framework-res and framework.jar .

Can't Load res/raw Files After Modding

Hello xda-developers!
I'm new to Android hacking, but I have a general background in programming...
I've been modding an application recently, unpacked the .apk file, done my changes and repacked it, signed it and everything works well...But when I run the program, and the program wants to play an mp3 file, which was located in res/raw before packing the .apk file, it gives an error: "Can't load audio file."...What is the possible cause of this problem and how to solve it? Are the IDs of the raw resource files changed everytime I unpack and repack the .apk file or what?
Thanks in advance...
Edit: Issue fixed by unpacking and repacking using Apktool instead of WinZip.

[Q] Problem Modding APK

Hello guys,
I am modding an apk to bypass an update check.
I have this outdated APK that functions fine since the URL and query and site address remains same but whenever it checks for and update it crashes. The thing is the developer made it topnotch but since then left and his site was recently taken down so check update query crashes it totally. What I need to do is update just the one function where it brings up the GUI after start. Otherwise it keeps saying download update or crashes randomly at time of starting up.
Now I have been browsing for a day or two for all the tutorials and right now I`m hell lot of confused. I have downloaded many tools and dependencies but I dont know how to proceed. I will tell you guys what I have and what I need.
I have de-compiled the APK using "dex2jar", I had a .JAR file which I decomplied using JD-GUI-Windows now after saving source I have .ZIP file in which I made the necessary editing. Next I downlaoded APKTool.JAR and extracted resource files and XML files that can be read in text editor. Along with some .SMALI files.
Now I am not familier with SMALI language at all and editing in it seems rather complicated and on the other side I have the .JAR file that decomlied all the classes just fine.
MY QUESTION IS:
How do I recompile the files I have ? I have the main coding extraced using dex2jar so in java format and JD-Gui to in .ZIP files, and resources/XML files also decoded using APKTools. What do I do next to recompile the APK ?
In short I have plain text based java source code and plain text XML and other resource file. How do I recompile it ?

Categories

Resources