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.
Related
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.
Hey people, I've just found it at O3D forums and I think I should share the information, as I don't have time for creating a good tutorial myself.
This way you can change colors for your own likes and make a lot kind of themes.
Before starting you should have your Apktool environment set up.
1. (only if you never saw APKTOOL in your life, otherwise, just jump it)
1· Download and install latest version of Java JDK
2· Download latest version of APK Multi-Tool as we'll be using it for un/packing APKs and push/pull them from/to our device.
3· Extract it anywhere you may like. If posible, in C:/ to avoid any kind of problems. Be sure to read README file before asking something about it.
4· Run Setup.bat, type 3 and press Enter. Close it.
5· Run Script.bat, type 0 and press Enter. Now let's type our framework's path.
6· /system/framework/framework-res.apk for basic framework file. This will be pulling it out from our phones.
7· Repeating Number 5, type /system/framework/lge-res.apk for LG's framework file.
8· Now move to X:\...\APK-Multi-Tool\place-apk-here-for-modding\ and copy both apks (framework-res + lge-res) and paste it at X:\...\APK-Multi-Tool\other\
9· Run Setup.bat again, type 2 and press Enter. Now both frameworks should be installed and we are ready to un/pack APKs from the version we're actually using (v30A/B/C/D...). Close it.
10· Back in Script.bat, type 0 again followed by Enter, then type the path of your desired APK. (/system/framework/xxxxxx.apk for frameworks & /system/app/xxxxxx.apk for apps). After pushing it, select it as your actual project.
11· Now type 9 followed by Enter. This will unpack our APK.
12· Now is the time for tunning anything you want to. Go to X:\...|APK-Multi-Tool\projects\xxxxxx.apk\ and you'll find there everything.
13· When it's done, let's re-pack it typing the option 11 followed by Enter. When repacking gets done, it will ask if you want to use any files from your original APK. Tell it Yes, otherwise your apk won't get signed.
14· When the extracting is done, move to X:\...|APK-Multi-Tool\keep\ and erase everything there BUT META-INF folder + AndroidManifest.xml. Now press anything at APK Multi-tool window and you'll get your APK ready to go.
15· Now type 8 to push it back to your phone and type the desired path. If it cames from /system/app/xxxxx.apk or /system/framework/xxxxx.apk.
If you get any error recompiling it, you should take a look at the log, typing 23 and fix it at the projects folder.
Click to expand...
Click to collapse
2.
potaturrias said:
When i maked this theme (my first theme) y used trial and error procedure.
The first step is replace or edit 9.png. pictures in drawable-hdpi folder located in framework-res.apk and lge-res.apk, you can do this quickly using this tools:
http://jgilfelt.github.com/android-actionbarstylegenerator (Check that the names of new pictures match with the old pictures)
http://android-holo-colors.com/
Many images have to edit them by hand
If you put more files than originally,for example switches in lge-res drawable-hdpi, you will get an error when try to compile.
The second step is replace xml files in drawable folder using xml files from zip file that you downloaded in the previous step.
If you don't get the desire result you have to edit styles.xml or drawable folder files or layout files to change backgrounds colors, text color,etc.
Remember there applications with lines in XML files that reference to framework or lge-res, for example:
android:textColor="@*android:color/transparent makes reference to transparent color defined in framework-res and
android:textColor="@com.lge.internal:color/transparent makes reference to transparent color defined in lge-res.
I hope that this mini guide help you, remember that you can make your theme based on this theme, will be easier i think.
Click to expand...
Click to collapse
Thanks to @potaturrias!
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...
I know this is an old news, but I think most of people out there or in here wondering
if they could deodex their CM7.2 or other ROM correctly. After trying every kitchen/apps
etc. to deodex, it's seems worthless. Moreover, as newbie, setting up the kitchen is so
complicated & frequently giving me a hard time. But no worries, these are the steps on
how to deodex ROM manually
NOTE:
1 THIS METHOD HAVE ALREADY DONE ONLY BY WINDOWS
2 THIS METHOD IS BASICALLY WORKS ON ANY ROM
3 BEFORE ASK ANYTHING, PLEASE UNDERSTAND THE WHOLE MAIN THREAD FIRST
Requirements:
1 The Manual-Deodexer.zip [in attachments below]
2 A working brain :silly:
3 All framework files
4 APK/JAR to deodex
5 A working PC of course
STEP A: Setup a working folder
1 Extract the Manual-Deodexer.zip
2 Create a folder named "Deodexer" [any place] in your PC [EXAMPLE: D:/Deodexer]
3 Place all of the files included in Manual-Deodexer.zip to the "Deodexer" folder
[baksmali.jar, smali.jar, java.awt.jar, busybox, dexopt-wrapper, zipalign.exe]
STEP B: Deodexing All JARs First [system/framework]
1 Place all of your framework files also in "Deodexer" folder
2 Deodexing framework files [I'll use android.policy.jar for a start]
3 Run CMD in mentioned folder [Shift + Right Click] & type:
Code:
java -Xmx1024m -jar baksmali.jar -c :core.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:core-junit.jar -x android.policy.odex
THIS WILL CREATE "out" FOLDER
4 Make sure the "out" folder is there, then in CMD, type:
Code:
java -Xmx1024m -jar smali.jar out -o classes.dex
THIS WILL CREATE "classes.dex"
5 Finally, deodex android.policy.jar:
> After the classes.dex created, directly delete both android.policy.odex & its "out" folder
> Open android.policy.jar with 7ZIP without extracting
> Drag the classes.dex in the 7ZIP window in the root folder
> Close the 7ZIP & you've deodexed android.policy.jar
[REPEAT THE SAME STEP FOR OTHER JARs 1 BY 1] [ON MY CM7.2, I GOT 19 JAR Files]
> So, basically repeat the steps for 19 times :laugh:
STEP B: Deodexing APK [system/app]
1 Place any APK you want to deodex also in "Deodexer" folder [I'll use SystemUI.apk for example]
2 Run CMD in mentioned folder [Shift + Right Click] & type:
Code:
java -Xmx1024m -jar baksmali.jar -c :am.jar:android.policy.jar:android.test.runner.jar:bmgr.jar:bouncycastle.jar:com.android.location.provider.jar:com.google.android.maps.jar:core.jar:core-junit.jar:ext.jar:framework.jar:ime.jar:input.jar:java.awt.jar:javax.obex.jar:monkey.jar:pm.jar:services.jar:sqlite-jdbc.jar:svc.jar -x SystemUI.odex
THIS WILL CREATE "out" FOLDER
3 Make sure the "out" is there & in CMD type:
Code:
java -Xmx1024m -jar smali.jar out -o classes.dex
THIS WILL CREATE "classes.dex"
4 Finally deodex SystemUI.apk:
> After the classes.dex created, directly delete both SystemUI.odex & its "out" folder
> Open SystemUI.apk with 7ZIP without extracting
> Drag the classes.dex in the 7ZIP window in the root folder
> Close the 7ZIP windows & you've deodexed SystemUI.apk
[REPEAT THE SAME STEPS ON OTHER APK YOU WANT TO DEODEX]
STEP C: Zipaplign Deodexed APK For Performances [OPTIONAL][ONLY APK]
1 In the same CMD prompt windows, type:
Code:
zipalign -v 4 "anyapk".apk zip_"anyapk".apk
2 A zip_"anyapk".apk file will be created. Delete your original deodexed "anyapk".apk
& rename zip_"anyapk".apk to the original "anyapk".apk you've deleted
3 Install it normally or push it to system/app [rw-r-r] method
NOTE:
1 TO DEODEXED Emails.apk & MobilePrint.apk YOU'LL NEED ANOTHER COPY OF "java.awt.jar"
2 IT IS DEODEX, SO BASICALLY YOU DON'T HAVE TO SIGN THE APK
ALL CREDITS GOES TO @sicopat FOR HIS WONDERFUL THREAD
To me too, why not, for making it snappy
Did I say it is a simple & quicker job??? No, it doesn't :silly:
Hit the thanks button if I helped
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