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
Click to expand...
Click to collapse
I get "Unable to access jarfile baksmaili.jar"
Thanks to anyone who is willing to help.
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.
kyouko said:
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.
Click to expand...
Click to collapse
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.
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
kyouko said:
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
Click to expand...
Click to collapse
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?
Ooohhh shii- lol I'm a dumbass
Haha it should be baksmali-1.1.jar and smali-1.1.jar
I just edited my previous post to fix that mixup
I even pasted strait from yours.. it does not work man. I give up android is gay
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.
Funny thing is, you think you'll be able to mod I phone easier? Ha!
-------------------------------------
Sent via the XDA Tapatalk App
roflcopter
danaff37 said:
Funny thing is, you think you'll be able to mod I phone easier? Ha!
-------------------------------------
Sent via the XDA Tapatalk App
Click to expand...
Click to collapse
..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
I run a dual boot between ubuntu and windows 7 for work
Sent from my HERO200 using XDA App
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'
hellmonger said:
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?
Click to expand...
Click to collapse
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"
can this be done in window? cygwin? I have tried to call baksmali for a classes.dex also and having no luck. any insight?
thank
thanksssssss
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..
khanhj said:
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..
Click to expand...
Click to collapse
Why you have attached a warez spy app?
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)
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.
I always found it annoying when I accidentally hit the Swype button while trying to type a message and the Swype Help Dialog (Tutorial) would pop-up. I thought it was just me but others have complained about this also so I decided to mod the Swype keyboard so this wouldn't happen. However, the Swype button does have other useful functions that I didn't want to remove. This mod only disables the Tutorial pop-up. All other Swype button functions still work. I am doing this on a Linux pc. I don't use Windows but this should work similar in Windows.
Credits:
00.ante - Used his Keyboard for Example - http://forum.xda-developers.com/showthread.php?t=942392
MikeyMike01 - Inspired by his Home Haptic fix
What you will need:
1. A Swype Keyboard
2. Smali/Baksmali - http://code.google.com/p/smali/
3. APK Manager - Optional
How To Instructions (Using Smail/Baksmali, you can also use APK Manager for this):
1. Extract classes.dex from Swype.apk and place in same folder as smali.jar and baksmali.jar
2. Open Terminal, navigate to folder where you put classes.dex and run this command: java -jar baksmali.jar -o classout/ classes.dex
3. This will create a folder called "classout"
4. In the classout folder, navigate to com/swype/android/inputmethod
5. Open SwypeInputMethod.smali in text editor
6. Delete all lines of code that contain "HelpDialog" and "HELP_DIALOG", There is one line that is embedded within a method. Delete starting at .method to .endmethod.
7. There are two lines of code that have just "Help" in them. Do not delete these.
8. Save and Close SwypeInputMethod.smali
9. Delete classes.dex that you extracted
10. Run this command in terminal: java -Xmx512M -jar smali.jar classout/ -o classes.dex
11. Copy the classes.dex that is created and drop it into your swype.apk
12. Place swype.apk into your CWM install zip
13. Flash and enjoy.
Attached is an example of this mod using one of 00.ante's Swype KB's. If you don't want to go through the trouble of baksmali/smali, you can just extract the classes.dex from this and drop it into your swype kb. Should work.
Hello Guys, this is for the one who wanna learn how to decompile recompile apk's I created this thread here because for desire c user.. easily find..
Requirements:
-Java Link
-Winrar Link
-Notepad++ Link
-and Apktool Link (Credits Rizal Lovins)
-Common Sense/Brain
Extract it on C:/Apktool (Create a Apktool Folder)
Method
1.Go to C:/Apktool (Where you put tha jar files) also copy your framework-res.apk to C:/Users/(Name)/apktool/(here) and rename it to 1.apk
2.And Put the Apk you want.. put the apk to C:/Apktool
3.Then press SHIFT+Right Click there inside Apktool folder
4.Then CMD will pop-up then type apktool d (name).apk then enter... ex. apktool d Settings.apk (then enter)
5.Then A Folder will Pop-up on C:/Apktool named Settings (if you decompile Settings.apk)
6.Now Sign your output... (if needed)
7.Go to decompiled Folder-dist- press SHIFT+Right Click CMD pop up type... java -jar SignApk.jar testkey.x509.pem testkey.pk8 (decompiled).apk (decompiled)_signed.apk
Optional : Zipalign
Go to decompiled Folder-dist- press SHIFT+Right Click CMD pop up type zipalign -fv 4 (decompiled)_signed.apk (decompiled)_signed_zipaligned.apk
Have Fun Guys...
Here i tells you. How to use apktool & Multitool
Step 1: Necessay files (Download From XDA-Developers.com)
Step 2: How to enter commands for .apk Files
Step 3: How to setup apktool
Step 4: Themeing & Modding
--> Step 1- /Java (Install java first)
/Apktool
OR
/Multi Tool (Download attachment with multitool name as visualbasic(VisualBasicPowerPacksSetup)_without this file it not work)
/.netFramework v4.5 or Higher (For Multitool)
/7zip (Extracting .apk and other archieve or extention)
/Notepad++(used to read .xml files in decompiled apk)
--> Step 2- 1/ For systemui.apk
/commands
cd..
cd..
cd android/apktool
/apktool if framework-res.apk
/apktool if systemui.apk
/apktool d systemui.apk (d- for Decompiling apk)
/Themeing (Dont messup Here and there without any reason or you get uncompiled apk)
/apktool b systemui systemui-new.apk (b- For Re-Compiling apk)
Sign your new apk in order to working.
after compiling apk your new apk looks like / systemui-new.apk
Now Decompile It with 7zip & also place original apk of the current rom in desktop into a folder(decompile it also)
/Take two files from original Decompiled apk / 1.META INF 2.Android Mainfest.xml
/Add these two files into extracted /systemui-new.apk/Recompile it with 7zip/Now you use your new apk
---------------------------> Done
2/ For Framework-res.apk
/commands
cd..
cd..
cd android/apktool
/apktool if framework-res.apk
/apktool if Twframework-res.apk
/apktool d framework-res.apk (d- for Decompiling apk)
/Themeing (Dont messup Here and there without any reason or you get uncompiled apk)
/apktool b framework-res framework-res-new.apk (b- For Re-Compiling apk)
Sign your new apk in order to working.
after compiling apk your new apk looks like / framework-res-new.apk
Now Decompile It with 7zip & also place original apk of the current rom in desktop into a folder(decompile it also)
/Take two files from original Decompiled apk / 1.META INF 2.Android Mainfest.xml
/Add these two files into extracted /framework-res-new.apk/Recompile it with 7zip/Now you use your new apk
---------------------------> Done
Note : if this command not work in order to recompile your framework/only this line /apktool b framework-res framework-res-new.apk
than use new command /apktool d framework-res.apk framework1 (d- for Decompiling apk)
/apktool b framework-res.apk framework1 (b- For Re-Compiling apk)
others / settings.apk (recompile,decompile like systemui.apk)
cd..
cd..
cd android/apktool
/apktool if framework-res.apk
/apktool if Twframework-res.apk
/apktool d settings.apk (d- for Decompiling apk)
/Themeing (Dont messup Here and there without any reason or you get uncompiled apk)
/apktool b settings (b- For Re-Compiling apk)
Sign your new apk in order to working.
For checking compiled settings.apk/ dist/settings.apk
after compiling apk your new apk looks like / build/apk/here
Now Decompile It with 7zip & also place original apk of the current rom in desktop into a folder(decompile it also)
/Take two files from original Decompiled apk / 1.META INF 2.Android Mainfest.xml
/Add these two files into extracted /settings.apk(check in build folder)/Recompile it with 7zip/Now you use your new apk
---------------------------> Done
--> Step 3- A)Setuping Apktool
/only apktool not multitool (both are different)
open your laptop/desktop/ Drive c: make folder named/ android/apktool (inside android folder make apktool folder)
locate where you save apktool/unpack it with winrar or 7zip and copy whole files/paste it into/
c:/android/apktool(paste here)
Now Add three files of your ROM/Systemyui.apk , Framework-res.apk , Twframework-res.apk
after this/ just open apktool folder of c: drive where you add files in small window
You see window button in taskbar /click on it/search/cmd/ when you see / hit enter
Type commands <--------------------------------------------------------------------------------------
cd..
cd..
cd android/apktool (this command locate your apktool folder in c:drive)
/apktool if framework-res.apk (add 1.apk >c:/user/hp/apktool/ 1.apk
/apktool if systemui.apk (add 127.apk >c:/user/hp/apktool/ 127.apk
/apktool d systemui.apk (Decompile your apk>see decompiled apk in / c:/android/apktool
/apktool b systemui.apk (Recompile your apk)
--> Done
--> Step - B)Setuping MultiTool(Also type of apktool - Easy to use
Unpack your multitool.zip
Looks like AndroidMultitool_3.0_win7/AndroidMultitool
cut AndroidMultitool / directly paste it to
c:/AndroidMultitool(inside folder and where to add files)
/Compiled_apk
/Compiled_jar
/Decompiled_apk
/Decompiled_jar
/Files
/Log
/Program_Files
/Signed_apk
/Android Multitool.exe
Add these files in /Files folder/Systemyui.apk , Framework-res.apk , Twframework-res.apk
Now Run Android MultiTool.exe
I think you know much very well after run Android Multitool.exe /how to decompile , recompile etc.
Save my time.......
--> Done
--> Step 4 - After Decompile theme your self or what ever.
--> Done
I Dont Know The Developers Name..!!! Who Develop APKTOOL AND MULTITOOL
Credits -
1.Developer Of Apktool
2.Developer Of Multitool
Credits - To Me Kartik [email protected]
Better To Use Advanced Apk Tool..Its So Fast and Easy To Use and User friendly...
I am facing issues in compiling systemui.apk and systemUI.odex files. I was porting Pixel Navigation bar for AOSP ROM of @Santhosh M. There is any to combine both the files?
If i remember right i made the Pixel navbar for Santhosh M ROM. Doesn't it work anymore? If you don't like the home button just decompile the apk and go to drawable-xxhdpi-v4 and change the ic_sysbar_home icon.
Anyway in order to combine them
1. Download baksmali. Make new folder and put the baksmali.jar and SystemUI.odex there.
2. Open command prompt in the folder where baksmali is located. Type in command prompt "adb pull /system/framework/arm" to extract the required files from the phone.
3. Type "java -jar baksmali.jar deodex SystemUI.odex -l" in the command prompt and if it successful there should be an output folder called "out". Copy it and paste it to the decompiled SystemUI.apk then rename it "smali"
4. Get the required odex files from Pixel's SystemUI(tho' i would recommend you to get them from the already modified systemUI as it usually generates the same number IDs so you wont have to deal with odex file changes).
5. Paste them to smali/com/google/android/systemui(if i remember right you had to create google/android/systemui folders so no worries if they are missing)
6.Recompile
I'd advise you to use this tutorial as it is way more detailed.
Sashko98 said:
If i remember right i made the Pixel navbar for Santhosh M ROM. Doesn't it work anymore? If you don't like the home button just decompile the apk and go to drawable-xxhdpi-v4 and change the ic_sysbar_home icon.
Anyway in order to combine them
1. Download baksmali. Make new folder and put the baksmali.jar and SystemUI.odex there.
2. Open command prompt in the folder where baksmali is located. Type in command prompt "adb pull /system/framework/arm" to extract the required files from the phone.
3. Type "java -jar baksmali.jar deodex SystemUI.odex -l" in the command prompt and if it successful there should be an output folder called "out". Copy it and paste it to the decompiled SystemUI.apk then rename it "smali"
4. Get the required odex files from Pixel's SystemUI(tho' i would recommend you to get them from the already modified systemUI as it usually generates the same number IDs so you wont have to deal with odex file changes).
5. Paste them to smali/com/google/android/systemui(if i remember right you had to create google/android/systemui folders so no worries if they are missing)
6.Recompile
I'd advise you to use this tutorial as it is way more detailed.
Click to expand...
Click to collapse
Thanks! I will be trying this out today. You developed Pixel Nav bars and the thing is you made it for January build. This is April so I have seen that it doesn't works. We need to decompile the systemui.apk again and again Change the ID and other things.
I have ported pixel Navbars for LineageOS. It was easy and today, I stuck in this steps.
I just followed your tutorial and I got this error
C:\Users\Xaif\Desktop\Baksmali\framework>java -jar baksmali.jar deodex SystemUI.
odex -x
usage: java -jar baksmali.jar [options] <dex-file>
disassembles and/or dumps a dex file
-?,--help prints the help message then exits.
Specify twice for debug options
-a,--api-level <API_LEVEL> The numeric api-level of the file
being disassembled. If not
specified, it defaults to 15 (ICS).
-b,--no-debug-info don't write out debug info (.local,
.param, .line, etc.)
-c,--bootclasspath <BOOTCLASSPATH> A colon-separated list of
bootclasspath jar/oat files to use
for analysis. Add an initial colon
to specify that the jars/oats should
be appended to the default
bootclasspath instead of replacing
it
-d,--bootclasspath-dir <DIR> the base folder to look for the
bootclasspath files in. Defaults to
the current directory
-e,--dex-file <DEX_FILE> looks for dex file named DEX_FILE,
defaults to classes.dex
-f,--code-offsets add comments to the disassembly
containing the code offset for each
address
-i,--resource-id-files <FILES> the resource ID files to use, for
analysis. A colon-separated list of
prefix=file pairs. For example
R=res/values/public.xml:android.R=$A
NDROID_HOME/platforms/android-19/dat
a/res/values/public.xml
-j,--jobs <NUM_THREADS> The number of threads to use.
Defaults to the number of cores
available, up to a maximum of 6
-k,--check-package-private-access When deodexing, use the
package-private access check when
calculating vtable indexes. It
should only be needed for 4.2.0
odexes. The functionality was
reverted for 4.2.1.
-l,--use-locals output the .locals directive with
the number of non-parameter
registers, rather than the .register
directive with the total number of
register
-m,--no-accessor-comments don't output helper comments for
synthetic accessors
-n,--normalize-virtual-methods Normalize virtual method references
to the reference the base method.
-o,--output <DIR> the directory where the disassembled
files will be placed. The default is
out
-p,--no-parameter-registers use the v<n> syntax instead of the
p<n> syntax for registers mapped to
method parameters
-r,--register-info <REGISTER_INFO_TYPES> print the specificed type(s) of
register information for each
instruction. "ARGS,DEST" is the
default if no types are specified.
Valid values are:
ALL: all pre- and post-instruction
registers.
ALLPRE: all pre-instruction
registers
ALLPOST: all post-instruction
registers
ARGS: any pre-instruction registers
used as arguments to the instruction
DEST: the post-instruction
destination register, if any
MERGE: Any pre-instruction register
has been merged from more than 1
different post-instruction register
from its predecessors
FULLMERGE: For each register that
would be printed by MERGE, also show
the incoming register types that
were merged
-s,--sequential-labels create label names using a
sequential numbering scheme per
label type, rather than using the
bytecode addressQA
-t,--implicit-references Use implicit (type-less) method and
field references
-v,--version prints the version then exits
-X,--experimental enable experimental opcodes to be
disassembled, even if they aren't
necessarily supported in the Android
runtime yet
-x,--deodex deodex the given odex file. This
option is ignored if the input file
is not an odex file
Click to expand...
Click to collapse
I also tried doing like the above given command so I followed this steps:
C:\Users\Xaif\Desktop\Baksmali\framework>java -jar baksmali.jar --deodex SystemU
I.odex -l
Error occurred while loading boot class path files. Aborting.
org.jf.util.ExceptionWithContext: Cannot locate boot class path file /system/fra
mework/core.jar
at org.jf.dexlib2.analysis.ClassPath.loadClassPathEntry(ClassPath.java:2
96)
at org.jf.dexlib2.analysis.ClassPath.fromClassPath(ClassPath.java:207)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:67)
at org.jf.baksmali.main.main(main.java:305)
C:\Users\Xaif\Desktop\Baksmali\framework>
Click to expand...
Click to collapse
I have used ApkTool for Android to deodex that file and it did it successfully. Now, I am porting again