[Utility][Tool]baksmali/smali

Search This thread

majdinj

Senior Member
Nov 25, 2006
980
3,438
AlAhsa
Hi,
i've XP&Backsmali / Smali Manager v1.5 and i want baksmali framework.jar but i got error message(attachment)
I think wrong is slash (should be a backslash)
the same error is after i select 1(baksmali*)and then x and Y or
--------------------------------------------------------------and then b and Y

can you upload the file, so I can have a look to the problem


*baksmali or backsmali? :confused:

baksmali,,, oh sh*t for this typo.!!! it is just type error and will not affect the performance of the tool, so don't worry
 
  • Like
Reactions: Kamy

Kamy

Senior Member
Aug 29, 2012
5,335
19,304
Beijing
can you upload the file, so I can have a look to the problem




baksmali,,, oh sh*t for this typo.!!! it is just type error and will not affect the performance of the tool, so don't worry

Yeah it's just a typo. Am using this toolkit ,v1.2 actually and it's so convenient and easy. I don't have any problem with.

Sent from my GT-N7000 using Tapatalk HD
 
Last edited:

baran0119

Senior Member
Feb 16, 2013
202
90
Cracow/Sanok
I discovered something else:
This error occurs only when I extracted it on my desktop
('Pulpit' = 'Desktop' in my language)
If I create new folder 'xda' in c:\ (so c:\xda) and I extract there I have not this problem :) (work without error)
At first to me opened the folder itself with bad slash:

But after refresh is well:


But is still on the desktop

Here you've all a folder 'Baksmali-Manager_v1.5' compressed to rar (NOTE: from the desktop, included framework.jar)

Hmm Strange error, I'm sorry that I did not try it in a different location before seen, but I did not expect (though in both cases I used the same procedure)
 
Last edited:

majdinj

Senior Member
Nov 25, 2006
980
3,438
AlAhsa
Here you've all a folder 'Baksmali-Manager_v1.5' compressed to rar (NOTE: from the desktop, included framework.jar)

Hmm Strange error, I'm sorry that I did not try it in a different location before seen, but I did not expect (though in both cases I used the same procedure)

I tried your file on desktop, baksmali and smali OK (using Win 7)



It could be XP unique problem!!
 

metalfan78

Senior Member
Jan 30, 2010
5,009
2,476
Littleton, CO
Thank you so much for this. I just found this and you made my modding life so much easier!

---------- Post added at 06:50 AM ---------- Previous post was at 06:41 AM ----------

I'm not sure what compression level to set it at for SecPhone on a galaxy s3. Any advice? If it's set at 9 then it's half the size of the original, set at 0 and it's 2 mb bigger.
 

majdinj

Senior Member
Nov 25, 2006
980
3,438
AlAhsa
'Application not installed' after Signing apk ....

If you are trying to sign a system app, then sure it will not work.
Can I have more details about the app you are trying to sign?



Thank you so much for this. I just found this and you made my modding life so much easier!

---------- Post added at 06:50 AM ---------- Previous post was at 06:41 AM ----------

I'm not sure what compression level to set it at for SecPhone on a galaxy s3. Any advice? If it's set at 9 then it's half the size of the original, set at 0 and it's 2 mb bigger.

In the majority of time, level 9 compression ratio will be nice in size and performance. I just add the feature of customizing the compression level just in case some app wouldn't work on the highest compression ratio.
 
  • Like
Reactions: metalfan78

majdinj

Senior Member
Nov 25, 2006
980
3,438
AlAhsa
New update online:

v1.55 @ 5/October/2013:
- Update baksmali and smali codes to v2.0b6 (date 14/9/2013).
- Update adb, zipalign engine from android sdk 20130917.
- Corrected some typo errors.

Check OP please..
 
  • Like
Reactions: Kamy

c0pyright

Member
May 23, 2009
5
2
I had a problem running this on windows 8

I had to edit the bat and change some of the "/" to "\" for it to make the folders and dump properly
not sure if its just windows being picky or if you've accidentally used the wrong slash in places

edit:
that didn't quite fix it.
the %~dp0 trails a backslash so the error went from being:
"The system cannot find the file C:\Baksmali\/project/project1.apk_classout"
to:
"The system cannot find the file C:\Baksmali\\project\project1.apk_classout"
 
Last edited:

majdinj

Senior Member
Nov 25, 2006
980
3,438
AlAhsa
I had a problem running this on windows 8

I had to edit the bat and change some of the "/" to "\" for it to make the folders and dump properly
not sure if its just windows being picky or if you've accidentally used the wrong slash in places

edit:
that didn't quite fix it.
the %~dp0 trails a backslash so the error went from being:
"The system cannot find the file C:\Baksmali\/project/project1.apk_classout"
to:
"The system cannot find the file C:\Baksmali\\project\project1.apk_classout"
Nop, it is the correct slash,,, I am using windows 7 x86 and no problem at all.. However, this is the 2nd time report of same problem (the previous one was on Win XP if baksmali tool on desktop)..!!!.
Okey,, let's try to remove slashes from %~dp0.. download the modified baksmali-manager from attachment bellow and try it..
 

Attachments

  • Baksmali_Manager_v1.55.rar
    2.2 MB · Views: 69

c0pyright

Member
May 23, 2009
5
2
the extra slash is gone but I still get this error:
"The system cannot find the file C:\Baksmali\project/project1.apk_classout."

I think the window is just showing the help text with all the valid command options for baksmali
 
  • Like
Reactions: majdinj

majdinj

Senior Member
Nov 25, 2006
980
3,438
AlAhsa
the extra slash is gone but I still get this error:
"The system cannot find the file C:\Baksmali\project/project1.apk_classout."

I think the window is just showing the help text with all the valid command options for baksmali

It seems the new cmd of WIN 8 you are using is very demanding one..!!!
No problem man, I changed all slashes and then I tested it and it should be now OK, please test the new one in the attachment bellow and give me your feedback
 

Attachments

  • Baksmali_test.rar
    2.2 MB · Views: 50

c0pyright

Member
May 23, 2009
5
2
It seems the new cmd of WIN 8 you are using is very demanding one..!!!
No problem man, I changed all slashes and then I tested it and it should be now OK, please test the new one in the attachment bellow and give me your feedback

that seems to have done the trick.
I did notice another bug though, if the parent folder has a space in the name then it stops working again.
 
  • Like
Reactions: majdinj

majdinj

Senior Member
Nov 25, 2006
980
3,438
AlAhsa
that seems to have done the trick.
I did notice another bug though, if the parent folder has a space in the name then it stops working again.

Yep,, this is general bug for all cmd bat tools
workaround extract it on desktop or directly on c drive..
I will give you more time for testing till tomorrow,, so I could put this fix in OP

I appreciated your testing my tool..
 

bdorr1105

Senior Member
Sep 6, 2008
4,129
3,113
New update online:

v1.56 @ 8/October/2013:
- Fixed some syntax for full compatibility with new WIN 8 cmd version (thanks to @c0pyright for testing).

Yea this is saying I don't have java on my computer although I do and java works on my computer so all the text is red saying I need to install Java...Additionaly it won't create any folders? Where does it create them at? Thanks
 

Top Liked Posts

  • There are no posts matching your filters.
  • 88
    - 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

    ..
    3
    @ 29/June/2013 (v1.5-FINAL):
    - Fixed adb remount bug for some ROMs in push option.
    - Baksmali argument is updated; now you can choose whether to baksmali with x argument (retain .line, .parameter, .prologue, and .local) or b argument (remove .line, .parameter, .prologue, and .local).
    2
    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.
    2
    Version 1.1 is online
    2
    Version 1.3 is online

    Change log:
    - Added adb push finished file to device system partition (for system files).
    - Ability to choose whether to reboot device after pushing files to device.
    - Added adb install finished apk (for non-system files).
    - Adjustable Java heap memory size.
    - Adjustable finished file compression level.
    - Updated Smali and Backsmali codes (date 15/6/2013).
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