[Tool][PC/Windows][GUI] smali2java, a tool decompile smali to java

Search This thread

HendySo

Member
Mar 2, 2011
13
31
Shenzhen
smali2java.png


smali2java is a tool that can decompile smali to java sources.

What is smali? smali is a readable form of Android bytecode. It can be called decompilation language of Android bytecode. Android application package, apk or jar, can be decompiled to smali by baksmali or apktool.

smali2java is based on smali files generated by apktool v1.5.0 with baksmali v1.3.4. smali2java depends on information such as code line number(.line keyword) and varialbe name(.local keyword) etc. Thus it can furthest reduce orignal java source code. The reduced java code will keep orignal variable names. The code sequence will be the same as orignal java code too. And also for this reason, this tool has limitaion. It only works for those smali files that have line numbers and varialbe name. Some java compiler options can eliminate these information from bytecodes.

smali2java uses apktool for convertion from Android bytecode to smali. It uses CCrystalTextView, written by Stcherbatchenko Andrei, as the java syntax highlighting component. Thanks to authors of these software and source codes for their great work.

Sample:
ActivityBase.smali (smali file)
ActivityBase.java (original java file)
ActivityBase.java (java file generated by smali2java)

Latest Version: 1.0.0.558
Download
 

Attachments

  • Smali2Java.1.0.0.558.zip
    6.5 MB · Views: 43,685

blunden

Senior Member
Jun 11, 2009
962
290
Nice tool. It seems to have some trouble correctly interpreting loops though. It also doesn't seem to include inner classes in its output.

It was unsuccessful at several methods in the apk I'm decompiling too (that include variable names and line information) but dex2jar + jd-gui failed at those too or produced non-working code.

Still, it shows some promise and even now it saves me some time by more easily showing the original variable names. No need to dig into the smali files for that. :)
 

hypeartist

Senior Member
Mar 19, 2012
53
41
Great!!!

Man! The proggie is just the must!!! It give the cleanest output I've ever seen!!!
As for some "// :( Parsing error. Please contact me." - they can be covered by other tools. (But YOURS is the first to run!)

Keep up the great work!
 

ilie321

Senior Member
Feb 5, 2011
451
270
38
hey great job
i want to help im trying to do something similar maybe we can share or work together at your project
 

Pankaj Rai

Senior Member
Oct 17, 2013
527
371
mumbai
www.obeyandroid.com
thanx i wanted this ... bt i got fc when i click fast ...at any option
smali2java.png


smali2java is a tool that can decompile smali to java sources.

What is smali? smali is a readable form of Android bytecode. It can be called decompilation language of Android bytecode. Android application package, apk or jar, can be decompiled to smali by baksmali or apktool.

smali2java is based on smali files generated by apktool v1.5.0 with baksmali v1.3.4. smali2java depends on information such as code line number(.line keyword) and varialbe name(.local keyword) etc. Thus it can furthest reduce orignal java source code. The reduced java code will keep orignal variable names. The code sequence will be the same as orignal java code too. And also for this reason, this tool has limitaion. It only works for those smali files that have line numbers and varialbe name. Some java compiler options can eliminate these information from bytecodes.

smali2java uses apktool for convertion from Android bytecode to smali. It uses CCrystalTextView, written by Stcherbatchenko Andrei, as the java syntax highlighting component. Thanks to authors of these software and source codes for their great work.

Sample:
ActivityBase.smali (smali file)
ActivityBase.java (original java file)
ActivityBase.java (java file generated by smali2java)

Latest Version: 1.0.0.558
Download


---------- Post added at 09:00 PM ---------- Previous post was at 09:00 PM ----------

hope u can fix it
smali2java.png


smali2java is a tool that can decompile smali to java sources.

What is smali? smali is a readable form of Android bytecode. It can be called decompilation language of Android bytecode. Android application package, apk or jar, can be decompiled to smali by baksmali or apktool.

smali2java is based on smali files generated by apktool v1.5.0 with baksmali v1.3.4. smali2java depends on information such as code line number(.line keyword) and varialbe name(.local keyword) etc. Thus it can furthest reduce orignal java source code. The reduced java code will keep orignal variable names. The code sequence will be the same as orignal java code too. And also for this reason, this tool has limitaion. It only works for those smali files that have line numbers and varialbe name. Some java compiler options can eliminate these information from bytecodes.

smali2java uses apktool for convertion from Android bytecode to smali. It uses CCrystalTextView, written by Stcherbatchenko Andrei, as the java syntax highlighting component. Thanks to authors of these software and source codes for their great work.

Sample:
ActivityBase.smali (smali file)
ActivityBase.java (original java file)
ActivityBase.java (java file generated by smali2java)

Latest Version: 1.0.0.558
Download
 

CosmicDan

Senior Member
Jun 19, 2009
5,862
7,697
34
Sydney
Xiaomi Poco F1
Mate, thanks a lot for your work on this. This presents the most readable code which makes debugging such a pleasant to use.

Any chance of opensourcing the app, since you seem to have moved on? Would love to add a Global Find option, among other less-used things.

Cheers!
 
  • Like
Reactions: FD_

FD_

Senior Member
Oct 16, 2012
241
390
Mate, thanks a lot for your work on this. This presents the most readable code which makes debugging such a pleasant to use.

Any chance of opensourcing the app, since you seem to have moved on? Would love to add a Global Find option, among other less-used things.

Cheers!

Hoping to see this project getting open sourced as well :fingers-crossed:. What I am missing is an option that just leaves the smali code where conversion failed.
 

CosmicDan

Senior Member
Jun 19, 2009
5,862
7,697
34
Sydney
Xiaomi Poco F1
Hoping to see this project getting open sourced as well :fingers-crossed:. What I am missing is an option that just leaves the smali code where conversion failed.

That's a good one, wouldn't be hard to implement either. This decompiler easily breaks if the original smali has been touched even a tiny bit and also often on inner/nested classes.

Even with the outstanding bugs, still the best so far for researching code without having to slog through smali (or java from another decompiler that looks like hodor)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 27
    smali2java.png


    smali2java is a tool that can decompile smali to java sources.

    What is smali? smali is a readable form of Android bytecode. It can be called decompilation language of Android bytecode. Android application package, apk or jar, can be decompiled to smali by baksmali or apktool.

    smali2java is based on smali files generated by apktool v1.5.0 with baksmali v1.3.4. smali2java depends on information such as code line number(.line keyword) and varialbe name(.local keyword) etc. Thus it can furthest reduce orignal java source code. The reduced java code will keep orignal variable names. The code sequence will be the same as orignal java code too. And also for this reason, this tool has limitaion. It only works for those smali files that have line numbers and varialbe name. Some java compiler options can eliminate these information from bytecodes.

    smali2java uses apktool for convertion from Android bytecode to smali. It uses CCrystalTextView, written by Stcherbatchenko Andrei, as the java syntax highlighting component. Thanks to authors of these software and source codes for their great work.

    Sample:
    ActivityBase.smali (smali file)
    ActivityBase.java (original java file)
    ActivityBase.java (java file generated by smali2java)

    Latest Version: 1.0.0.558
    Download
    1
    Mate, thanks a lot for your work on this. This presents the most readable code which makes debugging such a pleasant to use.

    Any chance of opensourcing the app, since you seem to have moved on? Would love to add a Global Find option, among other less-used things.

    Cheers!
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone