FORUMS
Remove All Ads from XDA

[Utility][Tool]baksmali/smali

2,069 posts
Thanks Meter: 718
 
By bovirus, Senior Member on 5th June 2013, 10:36 PM
Post Reply Email Thread
- What is baksmali/smali?

smali/baksmali is an assembler/disassembler for the dex format used by dalvik, Android's Java VM implementation. The syntax is loosely based on Jasmin's/dedexer's syntax, and supports the full functionality of the dex format (annotations, debug info, line info, etc.)
The names "smali" and "baksmali" are equivalents of "assembler" and "disassembler" respectively.


- Author of the tool

JesusFreke


- Why we need it?

Android apk and jar files will include java classes to execute certain functionality. With baksmali, you will be able to disassemble the java classes into editable form (smalis) so you can do your editing and modding involving java script. Once you done changing, you need to assemble all classes to a readable form for android, i.e, classes.dex and here comes the role of assembler (Smali).


Since we have apk manager, do we still need this tool?

Yes and No!!! Because some apk managers even if they do support jar files but once they decompile smalis, they will remove some lines (.line, .parameter, ...etc) which are in my opinion are useful to locate some codes. So the choice is yours.


- What does this tool do?

Simply it baksmali classes.dex of android apk and jar files into editable form (smalis) to do your changes; then assemble it back (smali).


- Will it affect apk and jar original signature?

No, it will preserve original signature.


- Got problem?

During assembling (smali), you may got error message. You can check log file to locate what is wrong that make the manager stop assembling the file or post the log file for developers to look into it.


- What are the steps to work with this tool?

Run Baksmali_tool.bat file, this will create all needed folders in the first run.
1. Put android apk or jar file in "put-file-here" folder. If Current-file status is set to None, then either you need to set a file in option #3 or you forget putting valid file in "put-file-here" folder.
2. When Current-file status is set to your file, you can disassemble its classes.dex by option #1.
3. Classout folder with name of file project will be created in "project" folder; make your changes there.
4. If finished your changes, assemble classout folder by option #2.
5. If everything is OK, a new file will be created in "finish" folder with tag (Modded_) in its name, push it to your device by option #3 if it was system apk or jar; and if it was non system apk file, install it by option #4.


- Latest stable version

Latest stable baksmali/smali version: 2.2.2 (30.10.2017)

baksmali v. 2.2.2 - Download (bitbucket.org)

smali v. 2.2.2 - Download (bitbucket.org)

baksmali/smaly previous versions - Download (bitbucket.org)


- Latest beta version

Latest beta baksmali/smali version:


- Changelog

baksmali/smali wiki and changelog (github)


- Where can I download latest source code?

You can visit

baksmali/smali source page (github)

and you can download the latest smali and baksmali code versions.


- Special Thanks to XDA Portal Team

Special thanks to XDA Portal Team for featuring this utility

XDA Portal Team

..
Attached Thumbnails
Click image for larger version

Name:	001.png
Views:	7215
Size:	37.5 KB
ID:	2054932   Click image for larger version

Name:	002.png
Views:	7320
Size:	40.8 KB
ID:	2062571  
The Following 86 Users Say Thank You to bovirus For This Useful Post: [ View ] Gift bovirus Ad-Free
 
 
6th June 2013, 12:01 PM |#2  
hara74's Avatar
Senior Member
Flag Herrstein
Thanks Meter: 632
 
More
hi m8,
thanks for this nice tool
will try it next time I make a new theme

sent from my G-Note
6th June 2013, 12:59 PM |#3  
zeyadhan's Avatar
Senior Member
Flag tripoli
Thanks Meter: 131
 
More
great work majd keep it up
6th June 2013, 02:11 PM |#4  
iBotPeaches's Avatar
Recognized Developer
Flag Tampa
Thanks Meter: 4,212
 
Donate to Me
More
no credit to the author of smali/baksmali? :/
6th June 2013, 02:18 PM |#5  
majdinj's Avatar
Senior Member
Flag AlAhsa
Thanks Meter: 3,434
 
More
Quote:
Originally Posted by iBotPeaches

no credit to the author of smali/baksmali? :/

I think the authers are these guys ([email protected], [email protected], JesusFr.. @gmail.com) from project page.. aren't they??? if so I will update OP
6th June 2013, 02:30 PM |#6  
iBotPeaches's Avatar
Recognized Developer
Flag Tampa
Thanks Meter: 4,212
 
Donate to Me
More
Quote:
Originally Posted by majdinj

I think the authers are these guys ([email protected], [email protected], JesusFr.. @gmail.com) from project page.. aren't they??? if so I will update OP

Yes, thats the same person. I'd just put JesusFreke, as thats his username.
The Following User Says Thank You to iBotPeaches For This Useful Post: [ View ]
7th June 2013, 02:31 AM |#7  
majdinj's Avatar
Senior Member
Flag AlAhsa
Thanks Meter: 3,434
 
More
Version 1.1 is online
The Following 2 Users Say Thank You to majdinj For This Useful Post: [ View ] Gift majdinj Ad-Free
11th June 2013, 06:40 PM |#8  
majdinj's Avatar
Senior Member
Flag AlAhsa
Thanks Meter: 3,434
 
More
version 1.2 is online
some bugs fixed
13th June 2013, 09:22 AM |#9  
Kamy's Avatar
Recognized Contributor
Flag Beijing
Thanks Meter: 19,409
 
Donate to Me
More
Grate dev, Great tool...tnx majdini
13th June 2013, 10:27 AM |#10  
ezaechiel's Avatar
Senior Member
Flag Issou
Thanks Meter: 1,031
 
Donate to Me
More
What a great idea to simplify life ^^.

Thanks majdinj.
13th June 2013, 04:18 PM |#11  
badagila's Avatar
Senior Member
Flag Iloilo City
Thanks Meter: 119
 
Donate to Me
More
Quote:
Originally Posted by majdinj

Backsmali / Smali Manager





What is Backsmali / Smali?
smali/baksmali is an assembler/disassembler for the dex format used by dalvik, Android's Java VM implementation. The syntax is loosely based on Jasmin's/dedexer's syntax, and supports the full functionality of the dex format (annotations, debug info, line info, etc.)
The names "smali" and "baksmali" are equivalents of "assembler" and "disassembler" respectively.

Why we need it?
Android apk and jar files will include java classes to execute certain functionality. With backsmali, you will be able to disassemble the java classes into editable form (smalis) so you can do your editing and modding involving java script. Once you done changing, you need to assemble all classes to a readable form for android, i.e, classes.dex and here comes the role of assembler (Smali).

Since we have apk manager, do we still need this tool?
Yes and No!!! Because some apk managers even if they do support jar files but once they decompile smalis, they will remove some lines (.line, .parameter, ...etc) which are in my opinion are useful to locate some codes. So the choice is yours.

What does this tool do?
Simply it backsmali classes.dex of android apk and jar files into editable form (smalis) to do your changes; then assemble it back (smali).

Will it affect apk and jar original signature?
No, it will preserve original signature.

Got problem?
During assembling (smali), you may got error message. You can check log file to locate what is wrong that make the manager stop assembling the file or post the log file for developers to look into it.

What are the steps to work with this manager?
Run Backsmali_tool.bat file, this will create all needed folders in the first run..
1. Put android apk or jar file in "put-file-here" folder. If Current-file status is set to None, then either you need to set a file in option #3 or you forget putting valid file in "put-file-here" folder.
2. When Current-file status is set to your file, you can disassemble its classes.dex by option #1.
3. Classout folder with name of file project will be created in "project" folder; make your changes there.
4. If finished your changes, assemble classout folder by option #2.
5. If everything is OK, a new file will be created in "finish" folder with tag (Modded_) in its name, just rename it to its original name and push it to your device; don't forget to fix permissions as well.

If backsmali and smali code are outdated, what to do?
Just visit codes owner page, and download the latest smali and backsmali code versions and put them in "tools" folder (make sure to rename them to baksmali and smali without version number)

Future development?
Feel free to report any bugs or suggestion to improve upcoming releases

Download
- Backsmali-Manager_v1.2 @ 11/June/2013 (The most recent one)
- Backsmali-Manager_v1.1 @ 7/June/2013 (old)
- Backsmali-Manager_v1 @ 6/June/2013 (old)

Change-log:
@ 11/June/2013 (v1.2):
- Fixed bug of file path in Read Log option.
- Fixed number 10 file that was not shown in Set Current-file option.

@ 7/June/2013 (v1.1):
- Deleting the folder and file in project and finish folder of same project name before backsmali or smali (no more overlapping ).
- Added Read log file functionality in the main menu.
- Ability to open classout folder after backsmali.
- Ability to open finish folder after smali.
- Ability to renamed finished modded file to its original name.
- Neat smali and compression processing (i.e, hidden processing ).
- Fixed set Current-file option to visualize only apk and jar files.

@ 6/June/2013 (v1.0):
- First release of Backsmali / smali manager

i don't know how to start editing this smali file
The Following User Says Thank You to badagila For This Useful Post: [ View ] Gift badagila Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes