I know it is possible to convert Java source to Smali, but is it possible the other way around? I'm kind of new with Android developing and I am reverse engineering apps to see how everything works in the Android platform, but can't do so with Smali. Any suggestions?
Don't think you can convert smali > java, but you can convert classes.dex (compiled form found in APK) to java. Use something like 7zip or WinRAR to extract "classes.dex" from the APK you are looking at then use dex2jar from here: https://code.google.com/p/dex2jar/downloads/list to convert the classes.dex file to a .jar file. (if you're on windows, just drag "classes.dex" onto "dex2jar.bat". On Linux, usage might be a little different, probably just open a terminal and type something like "./dex2jar.sh classes.dex").
Then you can open the .jar file with JD-GUI from here: http://java.decompiler.free.fr/?q=jdgui
Does it convert it perfectly to Java, or is it broken code?
shawngriffin said:
Does it convert it perfectly to Java, or is it broken code?
Click to expand...
Click to collapse
Seems OK to me, but I don't really know Java. Function names seem to be changed. Doesn't take long for you to try it yourself and see though
Okay I will. Thank you for your help
Please use the Q&A Forum for questions &
Read the Forum Rules Ref Posting
Thanks ✟
Moving to Q&A
Related
Hello! I'm not sure am I allowed to post this kind of question in this forum, but I couldn't find any better place.
I would like to modify (edit) my SGS II's ROM/kernel. I've already downloaded source from opensource.samsung.com (GT-I9100_OpenSource_Update2, 2.3.5).
I'm not new to programming but I just don't know how to "edit" that ROM/kernel. I have Visual Studio (I know the basics of C/C++, and I'm good at C#). Kernel is the lowest-level "program" so I guess it's written either in C or C++.
So what I'm wondering is how do I open the kernel or ROM in Visual Studio and am I able to compile it later with VS? (I just saw compiling tutorials and everyone is compiling on Linux (I'll install it if necessary)).
You don't have to write me step-by-step guide, but just help me a bit.
Sorry for my bad English by the way.
Link to download GT-I9100_OpenSource_Update2 from linux shell
If anyone is trying to download the files from linux shell, you need to find the file's "attach_id" which you put in the cmdline below to download what you need.
In this case (attach_id=1584) it's GT-I9100_OpenSource_Update2.zip
Code:
wget --post-data="method=downLoad&attach_id=1584&down_purpose=EETC" https://opensource.samsung.com/reception/reception_main.do?method=downLoad
Hello everyone
I have a question, first look at what I did.
I want to edit code of apk.
First, I use dex2jar. I can convert from APK to JAR file.
Second, I use JD. I can convert from JAR to Java source code.
Then I am trying to import these code into eclipse (or other editors) but it is not working.
Is there any possible way to edit the code?
I know we can edit smali but I think it is so much difficult.
I would be easier if I can edit in java source code and compile again to APK.
Thanks
Please use the Q&A Forum for questions Thanks
Moving to Q&A
It's not that easy. You can decompile (dex2jar & jd) the code to read it, do some research, etc. but this is a one way trip. If you want to modify something you will have to learn smali.
so, you mean the only way to modify code is smali?
We have apkbuilder tool in Android SDK for Windows, Linux and Mac OS. Is it possible to develop a similar tool that runs on Android platform?
My friends and I are working on a MiniJava compiler on Android platform, and we hope that the whole process - getting the MiniJava source code, compiling the code into dex file, packaging dex into apk - can run consecutively on Android. Now we're having trouble packaging dex into apk, since the "apkbuilder" file runs some Java commands. Please help me if you have any idea.
p.s. This is my first post, so please tell me if there's something improper.
Please use the Q&A Forum for questions Thanks
Moving to Q&A
I have read all the threads on the topic of decompiling APK file and recompiling it, and so far I am successful in decompiling and recompiling it.And now I want to make some changes in smali files like change package name and remove some features, But I don't know smali language, so Is there a way that I can convert smali files into Android JAVA project which I can import into Eclipse or I must have to learn smali language to achieve what I want.
Thanks in Advance
decompilerr said:
I have read all the threads on the topic of decompiling APK file and recompiling it, and so far I am successful in decompiling and recompiling it.And now I want to make some changes in smali files like change package name and remove some features, But I don't know smali language, so Is there a way that I can convert smali files into Android JAVA project which I can import into Eclipse or I must have to learn smali language to achieve what I want.
Thanks in Advance
Click to expand...
Click to collapse
It can be done with smali also ....
Only thing is you need to be tricky ....[emoji6]
Am not writing the procedure here coz changing package name doesn't sounds good for me [emoji1] I always respect efforts of original developers (some kangers always do change name and remove some features and claim the apk as theirs in generally am saying don't get hurted )
So I just want to confirm that changing package name and removing some features is possible via smali editing no need to convert the apk to java source .......
Press Thanks Button If You like My Work & Posts?
I've tested a great many ROMs on XDA as well as other sites.
Some are not allowed to be posted on XDA because they violate the rules. Mostly because modifications were done to ROMs that were posted on XDA without permission, and released on other sites.
A few of those ROMs use a very awesome customization app called RomControl.
https://forum.xda-developers.com/android/apps-games/app-rom-control-app-devs-t3146567
If you happen to run across a ROM that uses RomControl and it is not in English, I've translated the xml files to english.
I AM NOT PROVIDING THE ROMCONTROL.APK OR ROMS !!
All the files are in zip files called xml.zip and values.zip at the links below. They will need to be extracted.
https://www.androidfilehost.com/?fid=529152257862706088
https://www.androidfilehost.com/?fid=745425885120711022
The RomControl.apk will need to be decompiled and the files in the xml directory ( C:\path to your\AdvancedApkTool\3-Out\RomControl.apk\res\xml ) will be replaced with my files in the xml.zip file I posted.
The directory path above is what AdvancedApkTool uses.
Then extract the values.zip and place those files in the ( C:\path to your\AdvancedApkTool\3-Out\RomControl.apk\res\values )
Then recompile the apk.
I use this [Tool]Advanced ApkTool v4.2.0 by @BDFreak to decompile apk's
https://forum.xda-developers.com/sho....php?t=2639400
This thread is not to promote those other ROMs or sites. This is merely an offering of the time I spend to translate all the menu items, options etc. to English.
So IF you run across a ROM that has RomControl, and it's options and menus are not in English, you can have it up and running in English in less than 15 minutes.
This is an advanced effort. You will need to know how to decompile and recompile an apk and add it to your phone.
AGAIN, these files are only to be used on a copy of a RomControl.apk that is not in English. And the ROM must support RomControl.
I WILL NOT be answering questions on how to do that.
This quide below shows many possibilities for RomControl
https://forum.xda-developers.com/showthread.php?t=2799050
Here's two
https://forum.xda-developers.com/showpost.php?p=66779070&postcount=6139
https://forum.xda-developers.com/showpost.php?p=66754211&postcount=6088
It does require a lot of work.
If this thread turns into a trainwreck with people asking questions I said I will not answer, I will have it closed.
I WILL NOT be answering questions of where to get other ROMs that support this.
I've said the THREE times on this one page.
It took me a long time to do this. I may have missed one or two. Hopefully not. If you find something. Decompile the apk, find the area it's used in and fix it.