how do you open and edit classes.dex?

Search This thread

CarbonKang

Senior Member
Apr 6, 2010
630
1
I can not open classes.dex for the life of me. I have tried multiple ways with different commands and such and still can not get it to open.

I have found this method to get me the farthest but still no go on opening it. every time I enter the command

java -jar baksmali.jar -o classout/ classes.dex

I get "Unable to access jarfile baksmaili.jar"

Thanks to anyone who is willing to help.
 

CarbonKang

Senior Member
Apr 6, 2010
630
1
Download AvaboxV2 and unzip the folder. Inside there are tools for editing and such, namely the "Smali" folder which is hopefully what you are looking for.

I tried that. It will only do apks... :( I need to to do it to a .dex or a .jar

okay now I see the folder C:\Users\Devin\Documents\AvaboxV2\Smali\baksmali

but still I will need the command prompt and I will be in the same trouble i am in now.
 
Last edited:

kyouko

Senior Member
Mar 6, 2010
1,091
251
Put the classes.dex file in the \smali\baksmali folder. then navigate to that folder in command prompt:
Code:
cd\
cd C:\Users\Devin\Documents\AvaboxV2\Smali\baksmali
java -jar baksmali-1.1.jar -o classout/ classes.dex
*that should create a folder called "classout" in \baksmali with the smali files*
Then make your edits to the .smali files using notepad++ or w/e

To close up the classout folder and put it back into a classes.dex enter this in cmd:
Code:
java -jar smali-1.1.jar classout -o classes.dex

Edit: fixed file name mix-up
 
Last edited:

CarbonKang

Senior Member
Apr 6, 2010
630
1
Put the classes.dex file in the \smali\baksmali folder. then navigate to that folder in command prompt:

Then make your edits to the .smali files using notepad++ or w/e

To close up the classout folder and put it back into a classes.dex enter this in cmd:
Code:
java -jar smali-1.2.1.jar classout -o classes.dex

dude no matter what I type cmd will NOT go to that folder. "Folder not found" or some ****.

I can NOT wait till iPhone 4 comes out android is total ****.

got it to go to teh folder in cmd but like I said i get the stupid ass unable to access jarfile baksmali.jar

When baksmali.jar is clearly in the freaking folder.

Is there not an easier way to do this?
 
Last edited:

kyouko

Senior Member
Mar 6, 2010
1,091
251
Ooohhh shii- lol I'm a dumbass :D
Haha it should be baksmali-1.1.jar and smali-1.1.jar

I just edited my previous post to fix that mixup
 
  • Like
Reactions: drlzanej

CarbonKang

Senior Member
Apr 6, 2010
630
1
Never mind thank you so much man.. I was just getting pissed off because I have been trying this for so long. Thanks for the help.
 
Last edited:

in4nerd

Member
Aug 9, 2010
19
0
PHX
roflcopter

Funny thing is, you think you'll be able to mod I phone easier? Ha!

-------------------------------------
Sent via the XDA Tapatalk App

..Thumbs up

Srsly..its not difficult to mod android and its apps/framework(/resources)...at all. Only 2 real vars: setup and level of incompetence

not related->Getting a mac soon, mostly everything is windows compatible (80% of market/business/etc), mac not so much...parallel+windows 7 good idea?

kthxbai
 

Attachments

  • d2.jpg
    d2.jpg
    31.2 KB · Views: 801

hellmonger

Senior Member
Oct 9, 2010
778
263
Laval
Anyone have a clue why i get this error?

Smali\baksmali>java -jar framework.jar
-o classout/ classes.dex

Failed to load Main-Class manifest attribute from
framework.jar

This prog hero specific?

Thanks'
 

kyouko

Senior Member
Mar 6, 2010
1,091
251
Anyone have a clue why i get this error?

Smali\baksmali>java -jar framework.jar
-o classout/ classes.dex

Failed to load Main-Class manifest attribute from
framework.jar

This prog hero specific?
it not hero specific > link

framework.jar doesn't have the "Main-class" header which is why you're getting that error.

it should be
Code:
java -jar baksmali.jar -o classout/ classes.dex
NOT
Code:
java -jar [COLOR="red"]framwork[/COLOR].jar -o classout/ classes.dex

java -jar is used to run the baksmali and smali.jar "applications"
 
Last edited:

Ebaum1

Senior Member
Dec 10, 2011
208
47
Columbus, Oh
can this be done in window? cygwin? I have tried to call baksmali for a classes.dex also and having no luck. any insight?
 
Last edited:

khanhj

Member
Aug 29, 2012
37
3
Ho Chi Minh
this app, everytime i start it, i have to press OK button (that annoying) but it work. see what can we do with it:
- i try to extract the classes.dex file, (using winrar)
- edit some code (to remove the dialog appear when it start),
- compress the code back .dex file
- put the .dex into .apk file
- install on the phone fail :(
can anyone give me suggestion or please do something..
 

Attachments

  • SVRP-v1.7.5.apk
    33.9 KB · Views: 81

GEKTHEBOSS

Senior Member
Mar 22, 2012
1,986
2,963
this app, everytime i start it, i have to press OK button (that annoying) but it work. see what can we do with it:
- i try to extract the classes.dex file, (using winrar)
- edit some code (to remove the dialog appear when it start),
- compress the code back .dex file
- put the .dex into .apk file
- install on the phone fail :(
can anyone give me suggestion or please do something..

Why you have attached a warez spy app?
 

jedi134

Senior Member
Aug 27, 2007
320
34
Can anyone tell why I get this error?


UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: bad magic value: 64 65 79 0a 30 33 36 00
at org.jf.dexlib.DexFile.<init>(DexFile.java:359)
at org.jf.baksmali.main.main(main.java:176)
 

Spooters

Member
Apr 15, 2013
23
7
Using Win7. I've always just thrown all editing files in Android/SMALI folder.
Hold Shift, Right Click "Open Command Window Here".
Then for compressing/decompressing the commands I use are.

java -jar baksmali.jar -o classout/ classes.dex

java -Xmx512M -jar smali.jar classout -o classes.dex

Haven't run into any issues yet. I noticed no one has put the "-Xmx512M" in their code.
I hope this helps. :)
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    Put the classes.dex file in the \smali\baksmali folder. then navigate to that folder in command prompt:
    Code:
    cd\
    cd C:\Users\Devin\Documents\AvaboxV2\Smali\baksmali
    java -jar baksmali-1.1.jar -o classout/ classes.dex
    *that should create a folder called "classout" in \baksmali with the smali files*
    Then make your edits to the .smali files using notepad++ or w/e

    To close up the classout folder and put it back into a classes.dex enter this in cmd:
    Code:
    java -jar smali-1.1.jar classout -o classes.dex

    Edit: fixed file name mix-up
    3
    Download AvaboxV2 and unzip the folder. Inside there are tools for editing and such, namely the "Smali" folder which is hopefully what you are looking for.
    3
    Anyone have a clue why i get this error?

    Smali\baksmali>java -jar framework.jar
    -o classout/ classes.dex

    Failed to load Main-Class manifest attribute from
    framework.jar

    This prog hero specific?
    it not hero specific > link

    framework.jar doesn't have the "Main-class" header which is why you're getting that error.

    it should be
    Code:
    java -jar baksmali.jar -o classout/ classes.dex
    NOT
    Code:
    java -jar [COLOR="red"]framwork[/COLOR].jar -o classout/ classes.dex

    java -jar is used to run the baksmali and smali.jar "applications"
    2
    Funny thing is, you think you'll be able to mod I phone easier? Ha!

    -------------------------------------
    Sent via the XDA Tapatalk App
    1
    Ooohhh shii- lol I'm a dumbass :D
    Haha it should be baksmali-1.1.jar and smali-1.1.jar

    I just edited my previous post to fix that mixup