Decompiling apk to jar..and vice versa - Android Software/Hacking General [Developers Only]

Hi!.i was rying to reverse engineer an app.ihave managed to convert it to a jar file and decompile it using JD(via dex2jar)ihave also tried apktool but it converts it to smali code..and its not readable at all :/.my question is:
after i got the .Java files and loaded them to netbeans...made the changes..how should i compile it back to an apk? thanks

marko.gangsta said:
Hi!.i was rying to reverse engineer an app.ihave managed to convert it to a jar file and decompile it using JD(via dex2jar)ihave also tried apktool but it converts it to smali code..and its not readable at all :/.my question is:
after i got the .Java files and loaded them to netbeans...made the changes..how should i compile it back to an apk? thanks
Click to expand...
Click to collapse
As far as I know you can't. You will have to reference the java code to smali in the apk
Sent from my ADR6350 using XDA Premium App

is this the only way? i just cant modify anything in the smali files they are very confusing..the only problem i get when im compiling the jar is that netbeans cant find the Android SDK like: android.view.WindowManager;.and as far as i know netbeans doesnt support android.any help?

Related

Xml read error

Well, not Sure if the past should be here, I think so.
*I was tinkering with a rom (Ledro id for desire), and wanted to take a look at the xml, in such framework-res.apk, but that open from the pc, I get: hexadecimal value 0x03 is an invalid character (with xml notepad). I still open it but it is unintelligible.
What are apk's trying to open with java (do not know if I have what it takes to open them) and that makes me: failed to load main-class manifest attribute ....
I just want to tweak a little, have if I learn slowly.
Sorry for my english I am from spain
Sent from my HTC Desire using XDA App
XML files in apks are compiled to binary form, so you can't open them directly. You have to use some decoding tool: apktool (in my signature), Apk Manager (a wrapper around apktool) or AXMLPrinter2 (older and less powerful tool: can't rebuild XML and only partial info is decoded).
And no, you can't run apk files using Java on your PC.
Brut.all said:
XML files in apks are compiled to binary form, so you can't open them directly. You have to use some decoding tool: apktool (in my signature), Apk Manager (a wrapper around apktool) or AXMLPrinter2 (older and less powerful tool: can't rebuild XML and only partial info is decoded).
And no, you can't run apk files using Java on your PC.
Click to expand...
Click to collapse
Thanks, I will try
Edit: lol I dont know how I can install apktol in Windows...
I unpack the files into c:/ and now?
dany_danay said:
Thanks, I will try
Edit: lol I dont know how I can install apktol in Windows...
I unpack the files into c:/ and now?
Click to expand...
Click to collapse
So How can do this?
dany_danay said:
I unpack the files into c:/ and now?
Click to expand...
Click to collapse
You don't read carefully:
http://code.google.com/p/android-apktool/
Unpack both to your Windows directory
Click to expand...
Click to collapse

[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 .

[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 ?

Use Apktool in my ap

Hi dear friends
I want to write an app like app cloner
to decompile and recompile I think apktool is best library
Unfurtunatley I'm not android expert and I don't know what package of apktool I need.
I decompile and recompile with apktool using c++ and apktool.jar obtained from apktool site in windows app but I don't know how to use this jar file in my android project code
I write this but i dont know what I missed it partialy decompile apk and throw force close dialog and debugger dont show what the error is
brut.androlib.ApkDecoder decoder=new ApkDecoder();
decoder.setApkFile(new File( arrlist.get(position).app.publicSourceDir));
File out=getApplicationContext().getDir(arrlist.get(position).app.packageName, Context.MODE_PRIVATE);
decoder.setOutDir(out);
decoder.decode();
Any help apperciated

Baksmali In Android

I'm making a program which will extract a Apk and modify some Smali code and again recompile it.
Apk Editor is good but I want the function in my app anybody can help ?

Categories

Resources