Is there any universal framework-res.apk that can be used trough apktool, to retrieve xml files? because I am confused, I don't want to install my app on any mobile device!! (just to play around with code) and everywhere people write about ROMs and getting the framework from my device, in order to get my apk to compile with apktool? WHAT?! believe me, i am doing my research but I just cant seem to find a connection between the needed framework.res, and some randomly downloaded camera.apk?
How am I supposed to find appropriate framework for any downloaded .apk from internet? is it possible? I have tried with obviously non appropriate framework-res, it gives me lots of errors, after -apktool d example.apkk. Again, I don't have intention of installing it on any device, yet. as I said before, I would like to get code, to learn from it and to play with it, xml is the issue now, because of this framework-res stuff!! While java non 100% code I have!
Thank you for your time
Related
Well, I was going to put an app up on the market for a seminar , [and yes, i did use that Google app Builder], so when i tried to upload it, it told me that some value in the AndroidManifest.xml had to be a 32-bit integer.
So, I opened up that apk, viewed the manifest.xml file, but it just looks like a load of gibberish to me -__-
Now, I'm a bit new to all of this, considering that 11th grade's keeping me a wee bit occupied, so I guess I'll need some help with this.
[And note: Umm. Do not flame me for coming up with this, I'm not blaming google's app builder, or anything like that, anyway]
I've come across a couple of things like apktool, but each time i run it, it tells me that there's a file in jre7 that cannot be opened, apparently. Touche :|
It's an old question, so I guess you don't care too much about the answer by now, but to help others with a similar query, there are 2 ways to read the AndroidManifest file if you have the apk file.
1) If you extract the apk to a PC, you can use the apktool or similar to get a text version of the AndroidManifest.xml file
2) Alternatively if you have the apk already installed on an Android device you can use something like App Detective (https://play.google.com/store/apps/details?id=com.zmarties.detective) to view the AndroidManifest.xml directly on the device, even for paid apps that you can't extract from the device. (Full disclosure, I wrote App Detective).
I used dex2jar to decompile classes.dex , and used jdgui to convert those files into java files to edit, now I don't know how to recompile back, I'm not even sure it will work properly, or at all, but worth a try, I was trying to mod the vanilla Messaging app and remove all the attachment options for videos, pictures etc. because it's a waste of space, any help?
Use baksmil n smil tool ita simple.....
don't forgot hit thanx....
Probably might not work. The java files you get aren't quite the right ones. They will give you an idea of what to edit in the smali though.
Seeing as it is the stock messaging app, you would be better to download the source of the app from AOSP, edit that and compile. As said above, dex2jar does not give perfect Java code, so even if you did recompile it, you might not get a working app.
Or you could use baksmali to decompile the app to .smali format, and then use smali to recompile after editing the .smali files (not as easy to edit as Java source files).
The Smali Files are the machine language file type thing isn't it?, I've learnt the basics at Uni (using Spim), and understand what each thing does, but as it isn't directly coded, there isn't enough comments, for me to do anything with, I need to have some kind of info about what this does and what that does.
And about AOSP, I've tried downloading the source and It should be all downloaded and I've tried compiling it for my device (Sony Ericsson Xperia Ray (ST18i, Urushi) but it always comes up with errors, so I have put that stuff aside and gone back to attempting to mod some apps (First time, newbie), but I don't know where the Messaging App would be and how to change it. Sony Ericsson have Source Code for their Stock rom right?, I have tried getting hold of that, but have no idea how to read the file, and edit it, so it's much like AOSP. How to read files and how to edit and compile them?.
I've seen previously that you can modify 'more_keys_for_smiley' in LatinIME.apk to modify the predefined smilies in the keyboard ( http://forum.xda-developers.com/showthread.php?p=23362533 ).
I'm trying to do this for LatinImeGoogle.apk.
I've got it decompiled with apktool, but I can't seem to find where 'more_keys_for_smiley' is defined to change it. The only reference to it inside of that apk is in key_styles_common.xml where it has:
<key-style latin:moreKeys="!text/more_keys_for_smiley" latin:backgroundType="functional" latin:keyOutputText=" " latin:keyLabel="" latin:keyLabelFlags="hasPopupHint" latin:styleName="enterKeyStyle" />
Can anyone help me locate more_keys_for_smiley so I can modify it? Does the "!text" refer to a different package?
Thanks in advance for any help.
Ok, thanks to someone's help I was able to figure out that the string is now located in the odex file for the keyboard. I was able to deodex LatinImeGoogle.odex using baksmali and edited the file com/android/inputmethod/keyboard/internal/KeyboardTextsSet.smali. I then used smali to recreate the odex file, but pushing it to my device and rebooting causes the keyboard to not load. Do I need to do anything special with this new odex file?
I tried following tutorials ( http://forum.xda-developers.com/showthread.php?t=1208320 ) and using automatic batch scripts ( http://forum.xda-developers.com/showthread.php?p=31360029 ) for recreating the new odex file and copying the signature from the old one, but I could not get it to work. At best I got the keyboard to load and instantly crash, at worst it wouldn't even load the keyboard upon boot.
Anyone want to offer some advice or take a stab at this?
Seems like your doing exactly what i'm trying to accomplish, and had success, so i'm gonna ask a couple questions, but first some background info.
I'm using a (Verizon) Galaxy Nexus, CM10.1 Clockwork Recovery, GAPPS. (no custom Kernels, etc)
I'm a windows guy, definitely a noob to linux, i'm comfortable following the more complicated instructionals, but traveling off the beaten path is difficult for me.
I was able to use apktool tool to decompile Latinime.apk, and i found KeyboardTextsSet.smali, and the smileys i want modified.
Is it as simple as recompiling and installing it? (remove/uninstall keyboard via TitaniumBackup first?)
You refer to a LatinImeGoogle.odex, is this only relevant to someone using an odexed rom?
I appreciate greatly any assistance you are able to provide!:good:
PrettyPistol555 said:
Seems like your doing exactly what i'm trying to accomplish, and had success, so i'm gonna ask a couple questions, but first some background info.
I'm using a (Verizon) Galaxy Nexus, CM10.1 Clockwork Recovery, GAPPS. (no custom Kernels, etc)
I'm a windows guy, definitely a noob to linux, i'm comfortable following the more complicated instructionals, but traveling off the beaten path is difficult for me.
I was able to use apktool tool to decompile Latinime.apk, and i found KeyboardTextsSet.smali, and the smileys i want modified.
Is it as simple as recompiling and installing it? (remove/uninstall keyboard via TitaniumBackup first?)
You refer to a LatinImeGoogle.odex, is this only relevant to someone using an odexed rom?
I appreciate greatly any assistance you are able to provide!:good:
Click to expand...
Click to collapse
Yes, you should be able to modify KeyboardTextsSet.smali and then recompile and install the keyboard. I never achieved any success because I'm on an odexed ROM and couldn't get reodexing to work properly.
Tried but no joy, then realized it could be because the apk was from a previous nightly (couple days) than the one currently installed. Crossing my fingers that it's the reason it didn't work.
I'll try again.
sent from my vzw Galaxy Nexus / CM10.1 (nightlies)
Hello XDA-Members,
I want to add some function to my system music player app. So I decompiled the classes.dex with dex2jar, copied the source code and add the code for my functions. Now my problem is that I do not know how to recompile the app. I can't compile it with Eclipse because it uses some system namespaces (in Eclipse it is an error so I can't compile) How can I recompile the app? I only have the *.java files.
Or can't I use the java files and have to edit the smali files? Of course that's much harder...
Greetings Cilenco
Do you mean this music player? https://github.com/android/platform_packages_apps_music or the google play music one? If you mean the first one, try to edit the original source as it's provided by google and if you don't manage to compile it, send it to me and I'll give it a shot At the moment, I'm building PA so my linux system is busy, but if it's done I'll try to get your files compiled
If the second is the case, one problem is that google play music is not open source (afaik) and java files sometimes aren't decompiled right. Anyway, if you sent me the java files I could try to compile them as well
Sorry that I didn't named the app. I have a custom ROM and it is the music app from Sony Ericsson. Here is the apk:
http://goo.gl/GwdqYU
David:D said:
If you don't manage to compile it, send it to me and I'll give it a shot
Click to expand...
Click to collapse
What would be your way to compile the source files? Is there a way to compile the java files with Eclipse although the app uses system resources and libraries? Of course I can get all resources, the manifest and so on from apktool. I mean if you can get it work I want to learn it too. I think this is a very exciting piece of coding / reverse engineering. I'm able to decompile system apps, change their resources and so on but I do not know how to compile them from java source.
I'm building some ROMs on my PC so if the app uses some system resources and libraries, they should exist in this build environment I would basically try to put your files as an additional package in my build environment.
Ah okay I believe I understand: To build an system apk from java code I have to build the whole ROM again? Is the flashable zip enough to compile the apk? Probably not, right? I use a custom ROM from the forum here so I think I don't get the source. Or can I use the source from the sony developer site?
Is there any tutorial or guide how I can do this? Maybe I want to do this with more apps so it would be great if I can do it for my own and do not have to ask you all the time
p.s maybe we should write PNs then we don't spam the forum and we can write on German
Ok, I had a look at the apk and it seems like it's not correctly decompiled. I could easily import it to eclipse but the problem is, that some types aren't named correctly. That caused about 3000 errors No system files are missing, it's just not possible to completely decompile it. Maybe some parts of it are obfuscated (one problem was, that there was a com.scalado.a package and a com.scalado.a type etc.)
At least, I wasn't able to completely decompile it... I used dex2jar to convert it to a jar file, then I decompiled the class files using jd-gui and got the resources + androidmanifest.xml from apkool. How did you decompile it?
Probably, you'll have to edit the smali code...
Or maybe it's possible to just compile the files you need. Maybe it's enough to place the jar-file in the classpath so you don't have to decompile all dependencies. What files did you edit?
Hi,
Could anyone help me with my problem?
I'd be eternally thankfull
See: http://forum.xda-developers.com/showthread.php?p=48976088#post48976088
Good day,
I need help on modifying an apk, its basically a game that can be dowloaded on playstore. I read alot in the forum and I saw this APK tool reverse engineering an app.
apktool. I already ask a question but maybe it's better to create a new thread that I can monitor..
Now. what I achieved now is that I can decompile the apk, edit some things like splash.png, values on strings.xml and few line on androidmanifest.xml. I tried to recompile it and I have done it with no problem. Now i have the modified apk. I signed it using apk signer and followed all the procedure with no error. I copied it to my phone and test run it but sadly it says "App not installed". I also tried using zip signer from playstore and got the same result.. I dont know where am I messing it. Please help thanks.
There is Windows app called Virtuos Ten Studio, designed to do exactly that - it works pretty well and makes the whole process much easier (no need to use cmd line at all if I remember correctly).