[GUIDE] How to decompile an apk <updated w/ guide><updated with compiling>
How to decompile an .APK:
Step 1:
Download >>This<< this is a tool for decompiling an .apk (i take no credit for this tool i did not make it i cant remember where i got it but the credit goes to the maker)
Step 2:
Now go to your C:\ directory create a new folder (doesnt matter what you name it) now extract the apk_manager to the folder that you created.
Step 3:
Download: >>This<< and also >>This<<
(whatever you are using 7zip or winrar, go into settings and integration and check the .BZ2 file extension)
Step 4:
Extract both files to the other folder in apk_manager
Step 5:
Plug your phone into your computer and pull framework-res.apk and twframework-res.apk from your /system/framework/ directory and place both files in the other folder
Step 6:
open up command prompt and enter
cd/
cd (whatever you named the folder that you put apk_manager)
cd other
apktool if framework-res.apk
Step 7:
cd/
cd (whatever you named the folder that you put apk_manager)
cd other
apktool if twframework-res.apk
Step 8:
now grab the apk that you want to decompile and place it in the place-apk-here-for-modding folder
Step 9:
open script now enter 22 into command press enter, press corresponding number for your apk for ex. 1 then press enter, now press 9 then enter... APK should now be decompiling (decompiled apk should be in the projects folder)
[size=+2]Compiling[/size]
You do nearly the same thing for compiling an apk press 22 and enter to select what project you want to do, then 11; your apk should be compiled
Let me know if anyone has any problems with this
I like how you were excited enough to post about making a post later.
Lol I was going to do it then but I got sidetracked...
Sent from my SGH-T959V using XDA App
ok....updated post w/ the guide
Going to try this method...
I did my framework-res.apk last night, font color changed for the pop-up windows. seemed to work fine, but then once it booted, i noticed that my volume bar was showing the loading spinner instead of the slider (whoops) and I was unable to get to the volume controls due to FC'ing.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I'll try this method and see if it works for me.
Many thanks for this!
I got so frustrated, I had to pull the toy out of the garage and let it loose down an empty road... lol
Lol lmao,hope this works for you
Sent from my SGH-T959V using XDA App
alos note you will have to delete the resourace arsc out of the apk u decompled and let the apk tool recompile a new one.. espcaly so if using a apk from a diffrent phone
Yeah I replaced the res directory, the manifest and the resources file with the one that apk tool compiled... I hadn't seen this post until I had already tried another method... Wife sprained her ankle so I won't have the time to try it for a couple of days.
Can I add a color to the colors.xml file the point to it in the styles.xml item?
Sent from my GS4G using XDA app.
how do I get the xml to stick when changing colors.xml in the value folder? When you get to the step to delete from the "keep" folder the value folders aren't there, they are hidden.
Sent from my SGH-T959V using Tapatalk
shotchacokov said:
Yeah I replaced the res directory, the manifest and the resources file with the one that apk tool compiled... I hadn't seen this post until I had already tried another method... Wife sprained her ankle so I won't have the time to try it for a couple of days.
Can I add a color to the colors.xml file the point to it in the styles.xml item?
Sent from my GS4G using XDA app.
Click to expand...
Click to collapse
sorry to hear that
So any advice on the problems we are both having? Thanks
Sent from my SGH-T959V using Tapatalk
Just tried your guide and it worked succesfully! Seems like all the files decompiled - I just needed to have a quick look at the decompiled AndroidManifest.xml and that file was decompiled.
I am curious about the error I received.
That's the console output (Windows 7 x64 command line):
Code:
Please make your decision:9
Decompiling Apk
test"An Error Occured, Please Check The Log (option 21)"
Drücken Sie eine beliebige Taste . . .
The log says this:
Code:
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
C:\Users\emelie\Downloads\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/signedcom.DevBob.DeskClockPlus-1.apk konnte nicht gefunden werden
C:\Users\emelie\Downloads\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedcom.DevBob.DeskClockPlus-1.apk konnte nicht gefunden werden
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\emelie\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 3
at java.lang.String.charAt(Unknown Source)
at brut.androlib.res.xml.ResXmlEncoders.findNonPositionalSubstitutions(ResXmlEncoders.java:165)
at brut.androlib.res.xml.ResXmlEncoders.enumerateNonPositionalSubstitutions(ResXmlEncoders.java:142)
at brut.androlib.res.data.value.ResStringValue.encodeAsResXmlValue(ResStringValue.java:45)
at brut.androlib.res.data.value.ResArrayValue.serializeToResValuesXml(ResArrayValue.java:55)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:264)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:137)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:93)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:120)
at brut.apktool.Main.main(Main.java:57)
Could you point me in any direction how to get rid of this error?
Like I said everything seems to decompile correctly but still I don't like errors
EDIT:
In the end I downloaded apktool by itself and it ran without any errors. Don't know what happened there..
when trying to preform step 6 i get the msg " 'java' not recognized as and internal or external command operable program or batch file."
read on a post in a diff forum that java2sdk was needed so i installed this and still getting the same command error...
what am i doing wrong?
Can this be used to translate system menus?
Sent from me
thanks for the post man!
I use apk multi tool, myself, but whichever tool you use just be sure to have the latest adb and Java sdk installed.
Sent from my SGH-T959V using XDA App
You realize, Java has to be in your path. Also, you should also install twframework.
Apktool if ~pathtotwframework-res.apk
Sent from my SGH-T959V using xda premium
I use apktool. It works on all platforms and it it uses a later bug free version. Apk manager is a big batch file that uses an old extremely buggy edition of apktool Yes all decompile tools are based on smali, baksmali, and apktool. In fact apktool requires Smali and baksmali to decompile classes.dex and odex files.
The steps to use apktool are.
1. Download apktool(Google it)
2. palace it in an apktool folder on your desktop or somewhere.
3. Download any thing else on the website.for your OS.
4. Unzip everything and add them to your folder. Add the folder to your path or CD to it every time
5. Run terminal or CMD
6.TYPE
apktool if (path to framework Res.apk)
Apktool if (path to twframework Res.apk)
(Now you never will have to worry about dependencies unless you have a new from)
Apktool d apkorjarfile output folder
(Example....
.. apktool d /users/airfluip/desktop/Settings.apk /users/airfluip/desktop/decompiledsettings )
Now it shows progress. It may take some time.
If you get PNG errors, it will still decompile, but copy the original drawable-hdpi folder Into the decompiled one after decompile
Next make changes
Next
Apktool b /foldertodecompiled.
You should have the apk in the "apk" folder in the decompile folder
Sent from my SGH-T959V using xda premium
so i added java to the path but now i get a pop up java has experianced an error and has to close... what am i doing wrong?
also i have some friends who are using apkmanager just fine and have never put anything in there PATH variable. why is it that they can use apkmanager with no errors and im getting alot?
Rookie407 said:
so i added java to the path but now i get a pop up java has experianced an error and has to close... what am i doing wrong?
also i have some friends who are using apkmanager just fine and have never put anything in there PATH variable. why is it that they can use apkmanager with no errors and im getting alot?
Click to expand...
Click to collapse
This is a problem with your system and java not getting along. ensure you have the latest edition of java installed. If so uninstall it and get a fresh download from the java Website
If the problem persists...um ahhhhh back up your important data and do a system restore? or ask someone else I'm not an i.t. Expert but a fresh start is always nice....
Sent from my SGH-T959V using XDA App
Hi guys
I need your help.
I'm adding Hebrew support to Valhalla Final.
I was able to decompile all files using APKTOOL like you explained
Added all files RES\Values-IW (with strings taken from SGS-i9000 ROM)
but I get error while trying to re-compile these files :
* Browser
* Contacts
* Framework-res
* Street
* Talk2
* Touchwizcalendar
* Tweaks
Also all the APKs that I successfully recompiled - do not work and not appear in the phone and cause Force Close when I launch them.
10x!
Related
Here's how to change the carrier name in the Triumph. I ran across this while looking for some other strings.
You will need to decompile framework-res.apk, make your changes, and then recompile it. If you don't know how to decompile the file, I recommend that you read this great thread on XDA written by KBanause; he gives you links to the tools that you will need as well as walking you through making theming edits:
http://forum.xda-developers.com/showpost.php?p=9066440&postcount=1
The steps below will assume that you are using apkmanager:
1. Decompile framework-res.apk using apkmanager.
1a. To do that, place the framework-res.apk file into the place-apk-here-for-modding folder.
1b. Start apkmanager. In Windows, double-click on the script.bat file in the main apkmanager folder. I'm not sure what you would type to start apkmanager in another OS since I haven't used this in any other OS at this time.
1c. In APKMANAGER, hit 22 and select the number for your framework-res.apk file -- if it is the only file in the place-apk-here-for-modding folder, it should be 1.
1d. Back on the main menu, select 9 to decompile framework-res.apk.
2. Once, the decompile is complete, browse to the projects folder in apkmanager and you should now have a new folder inside named framework-res.apk. Look inside the framework-res.apk folder and you should now be able to find the subfolder \res\values . This folder ONLY shows up if you decompile framework-res.apk.
3. Find strings.xml in that folder and open it in a text editor such as notepad++ or such. I don't recommend using the built-in Notepad in windows.
4. Find the line:
<string name="roamingText1">Virgin Mobile</string>
Change the "Virgin Mobile" to whatever you want. For example, changing this to:
<string name="roamingText1">Save the tatas</string>
5. After making your changes, recompile framework-res.apk.
5a. In apkmanager, use option 11 to recompile.
5b. When asked if this is a system file, select Yes.
5c. When asked if you want to copy over additional files, click Yes and it will extract the files into a folder named Keep in apkmanager and then pause.
5d. Go into the Keep folder and delete any files that you changed, in this case you only need to delete the resources.arsc since the only thing you changed was the strings.xml file.
5d. Back on the apkmanager screen, hit the space bar or Enter to continue.
5e. A file named unsignedframework-res.apk will be created in the place-apk-here-for-modding folder. You'll need to rename it back to framework-res.apk.
6. Either adb push the new framework-res.apk back into your phone or put it in a flashable Zip file and flash it in recovery.
6a. For anyone wanting to put their new file into a flashable zip, I've attached an empty Zip file in this thread. Add your new framework-res.apk file into the \system\framework folder. Make sure that you have your Zip utility set to just use the Store or No Compression method. You do not need to change anything in the META-INF folder for just this simple flash. Note: the updater script in the zip file mounts the file system as ext3 so I don't know how well that will work if your file system is ext4.
This results in the changes on the lockscreen and the extended status screen:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
So would this allow me to change your ROM's carrier text? Because I haven't found a version of apktool (or a deodexed ROM) that has allowed me to decompile and recompile a framework-res.apk yet.
primetechv2 said:
So would this allow me to change your ROM's carrier text? Because I haven't found a version of apktool (or a deodexed ROM) that has allowed me to decompile and recompile a framework-res.apk yet.
Click to expand...
Click to collapse
It depends on what version of apktool/apkmanager that you're using. Without knowing that, I can't say if you'll be successful or not.
I'm doing all of this on Windows.
Edit: Apparently APK Manager has a version 5.0 released. Linking it here instead of the original 4.9 that was linked before (thanks to one_love on sdx for pointing that out to me):
http://forum.xda-developers.com/showpost.php?p=16831998&postcount=1
However, I was always getting an error with the version of apktool 1.4.1 built into that APK Manager. I upgraded the APKTOOL to an unreleased version 1.4.2.26970b.jar which you can download from brut.all on his google code site. He provides it in one of the issues that somebody reported here:
http://code.google.com/p/android-ap... Type Status Priority Milestone Owner Summary
Just download the apktool1.4.2.269870b.jar from the link brut.all provides and then rename it to apktool.jar and then replace the version in apkmanager in the OTHER folder with the updated one.
I also downloaded the latest version of appt.exe and apktool.bat that is on brut.all's download area (they are contained in the apk install downloads (download the appropriate one for your os) and replaced the respective files in the "other" folder of apk manager:
http://code.google.com/p/android-apktool/downloads/list
That took care of all of my errors decompiling/recompiling framework-res.apk (except of course for user errors).
If that doesn't solve your issue, post your log file of errrors here or on the apk manager thread and perhaps somebody can help you/give you suggestions.
o.o
I didn't know all that was there... it should keep me busy for a little while, at least. Many many thanks. It sounds like 1.4.2 should be the build that fixes all my problems.
how or where do you get the framework?
You can either get it from a root file manager (like File Expert, Astro, Root Explorer), by navigating to /system/framework and getting framework-res.apk,
or by executing the following command from your command line (provided you have Android SDK and its platform tools installed):
Code:
adb pull /system/framework/framework-res.apk
Either of these will give you a working framework resource file to work with. (Umm... if it's not framework-res.apk, do this with the different filename.)
From there, use APKTool to decompile the whole file via the command line again...
Code:
apktool d framework-res.apk (or whatever the file be).
Once you've edited the contents to your liking, run the following to build the folder back into a workable framework-res...
Code:
apktool b framework-res framework-res.apk
If you changed the source (you did), also make sure you sign the new apk file... in this case find testsign.bat (and testsign.jar etc) and run the following:
Code:
testsign framework-res.apk
From there, getting framework-res.apk back can be a bit of a hassle. I have no evidence it can be done just by returning the file to the /system directory, and a few people have recommended throwing it into an update.zip package. If you find this to be an effective method, I'd recommend stealing b_randon14's stock Triumph ROM, opening it, replacing the framework-res.apk with your own, and then rezipping it (no signature is necessary here).
Need more info? lol. If you're confused feel free to PM me or one of the real gurus here.
Thank you kind sir, i successfully changed the carrier name.
boomersooner25 said:
Thank you kind sir, i successfully changed the carrier name.
Click to expand...
Click to collapse
Congrats! I probably shoulda just asked if you wanted me to do it for ya instead of writing a mini-tutorial. But it was fun.
You see to know a lot primetech..u should make your own rom
Thank you for this
Hello I am francais and I do not manage to make this tuto could use me?
Thank you
http://forum.xda-developers.com/attachment.php?attachmentid=850833&stc=1&d=1326227385
Carrier NICOLAS
UP ?
Please help
niconoel said:
Hello I am francais and I do not manage to make this tuto could use me?
Thank you
http://forum.xda-developers.com/attachment.php?attachmentid=850833&stc=1&d=1326227385
Carrier NICOLAS
Click to expand...
Click to collapse
Is this for the Motorola Triumph? or another phone?
Is for htc sebsation
Thank you
I don't think these instructions will work for the HTC Sensation. I would recommend that you go to the HTC Sensation forum and check with somebody there.
These instructions are specific to the Motorola Triumph.
Thank you
But I have to go to see(visit) where then thank you
Thanks
it was really helpful, i did it on my Mac BP.
I couldn't use ADB to push framework-res.apk back to system/framework,
Terminal never listed my phone on the "adb devices" (I spent the whole afternoon trying to do it this way). I used the zip file instead and was a lot easier.
NOw i have a custom carrier name, THANKS A LOT, you are a life saver
Help
I get a an error everytime i try to abd push my framework-res into my phone..
And when i tried to flash it with the flashable zip, i got md5 mismatch
BiHFSA said:
I get a an error everytime i try to abd push my framework-res into my phone..
And when i tried to flash it with the flashable zip, i got md5 mismatch
Click to expand...
Click to collapse
When doing the adb push, did you first do "adb remount" without quotes of course? If you don't then, your os will still be read only and you'll get an error. So you need to do:
adb remount
adb push framework-res.apk /system/app/
Assuming that you're in the same directory as your modified framework-res.apk file.
As for why you're getting an md5 mismatch, I'm not sure what's causing that. I've not heard of anyone else having that issue. You're aware that this guide is meant for the Motorola Triumph, correct and it is only for FROYO roms? So I assume that you have an MT?
Hey Guys
Does it work on the Samsung Galaxy S2 on Android 4.0.3 too? Does anyone know this ?
Greetings
Deadboy
Hello,
I searched a lot how to enable the rotation of the lockscreen without third-party application, and I finally found.
I share this change with you.
This operation works with all phones that work with GG / ICS (I have not tested on Cupcake / Donut. / Froyo / Honeycomb).
This tutorial seems very long, but this is explained in great detail for better understanding and to be accessible to all.
First and foremost: I am not responsible if you break, or if others problems occur on your phone. You and only you are responsible. Thank you
You must be root to apply the changes. Here's what happens on my Nexus S:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
For this we will use apktool which will allow us to uncompil the framework-res.apk of your ROM and adb to replace the original framework.
Note: I see throughout this tutorial as well as adb and java (to run apktool) are already installed on your computer and the drivers too of your phone to work with adb.
Due to a bug in the framework of apktool ICS we are obliged to decompile the framework-res.apk with apktool 4.2 and recompile with apktool 4.3.
Download: apktool 4.2
Download: apktool 4.3
Note: Download in the same folder as adb, it's will simplify the task later.
In our case, we will consider that our working folder is: C:\android_debug
I recommend doing the same to be simpler.
apktool and adb only work with the command prompt, so it must be run.
To do this:
Windows XP: Start -> Run -> cmd.exe
Windows Vista / Seven: -> Start -> in the search bar type cmd.exe and press Enter
This window is displayed (a few lines of text can change, as the first of which is that your version of Windows):
We see that the command prompt is placed directly into your default user folder (here C:\Users\Thomas), so you have to stand in our working folder:
cd c:\android_debug
We will have to decompile framework-res.apk, if you have the rom zip place it in the same directory, otherwise it must be extracted from your phone.
Connect your phone to your computer and then, still in the command prompt (cmd) write:
adb remount
adb pull /system/framework/framework-res.apk
Note: if say toyou it can not find adb ... it's either you have him not placed in C:\android_debug where or that you should write its extension: adb.exe
The command will be this: adb.exe pull /system/framework/framework-res.apk
Will be the same for the rest of the tutorial, write adb.exe rather than adb.
The framework-res.apk is now in your working folder.
We will "install" the framework-res.apk to let apktool use it then:
java -jar apktool43.jar if framework-res.apk
There will now be extracted with apktool 4.2
java -jar apktool42.jar d framework-res.apk
If all goes well you usually this:
We must update the necessary files to activate rotation on the lockscreen.
Go to the following folder: C:\android_debug\framework-res\res\values and open this file with your favorite files editor: bools.xml
Search config_enableLockScreenRotation value and change the false to true:
Save and close the file.
All changes are made, we will be able to recompile the framework
So back to the command prompt (yes the window of the 1970s )
Type this to run compiling the new framework-res.apk:
java -jar apktool43.jar b framework-res framework-res-new.zip
If all goes well the last message from the command prompt is this:
If you get errors like these:
Nothing serious! apktool just tells you it can not find default translations of some words, but he found in French / Or else.
Note: If you have other errors and framework-res-new.zip is not created is that you made a editing error or that you have the wrong version of apktool.
Now, everything is well and the framework-res-new.zip is created in your working directory (which I recall is C:\android_debug)
The purpose of the step is to replace the file resources.asrc in the original framework-res.apk by the new one placed in framework-res-new.zip
You should open it with your management software zip archives (WinRar here) and then extract the file resources.arsc:
Once the extracted file you can close the archive.
You must rename the file framework-res.apk in framework-res.apk.zip:
When this file is renamed you must open it with your management software archive and then delete the file ressources.arsc:
Leave open the archive and return to your working folder. You must drag the file resources.arsc previously extracted from the archive:
Commit the changes in your management software archive. Rename the file framework-res.apk.zip in framework-res.apk
So we are almost done, this last step is to replace the framework-res.apk in your phone. We will use adb, so back to the command prompt in order to type this:
adb remount
adb push framework-res.apk /system/framework/framework-res.apk
adb shell reboot
Explanations:
adb remount: allows you to have root privileges on the phone
adb push framework-res.apk /system/framework/framework-res.apk: sends the new framework-res.apk on the phone and replaces the existing one
adb shell reboot: reboot the phone
I hope this tutorial is clear enough and that helped you
For any spelling mistakes thank you for let me know by PM (I'm a french teenager).
[font=Arial, Verdana, sans-serif]If you like my work, pay me a coffee [/font]
GalaxyUser
Pretty awesome work dude.
thnx.
Thanks chilschils41
Getting error at compile
Hi,
i was following your guide for the ICSSGS 4.2 ROM. when compiling i got a load of errors like:
Exeption in thread "main" brut.Androlib.AndrolibException: brut.common.BrutExeption.........
Have you had any experience with this kind of error and do you know how to fix it?
thanks!
Hi,
Have you uncompiled the framework-res.apk with apktool42 ? Then re-compiled with apktool43? Your rom is deodex?
maybe he recompile "apktool d framework-res.apk",instead of framework-res..
I have not got the line "enable lock screen rotation"
I have" bool name="lockscreen_isPortrait">true</bool>"
and changed it to false
EDIT: It didnt' work
jaggyjags said:
I have not got the line "enable lock screen rotation"
I have" bool name="lockscreen_isPortrait">true</bool>"
and changed it to false
EDIT: It didnt' work
Click to expand...
Click to collapse
Try to add the line "config_enableLockScreenRotation"
Nice tutorial. I wanna see if this tut works on miui
Sent from my Droid using Tapatalk 2 Beta-4
GalaxyUser said:
Try to add the line "config_enableLockScreenRotation"
Click to expand...
Click to collapse
Added the line and no changes.
Running an HTC Explorer gingerbread 2.3.5
Thanks for your replies, I will try again tonight and let you know if it works. i did in fact recompile to the framework-res.apk . maybe thats the problem.
EDIT: thanks for the tips guys, the problem was the .apk extension when recompiling!
I am very thankful for this. I've wanted this for a long time since my phone is docked horizontal all the time. I even tried reinstalling widget locker to do this, but just never like any of the non stock lock screens as much.
Tip: when doing build to new file named framework-res-new.zip like in instructions, instead build to same file name framework-res.zip
Also need to have aapt.exe in the folder as apktool.
Otherwise I would always get errors otherwise using apktool.
Hello,
It doesn't work on my sgs2 ICS 4.0.3 XWLPG deodex with the Jkay mod.
Edit : I have also tried to modify the line "lockscreen_isPortrait" = true
Still not work
Works very nice with Defy+ and Quarx JB-Rom!
But I have an additional question: Could the notifications while lockscreen be disabled this way too?
great tut
can you tell any way to enable hold back to kill forground app option
Set the checkbox "enabled"
Btw, nice signature
defim said:
Set the checkbox "enabled"
Btw, nice signature
Click to expand...
Click to collapse
if had that option why would I have asked
---------- Post added at 06:59 PM ---------- Previous post was at 06:58 PM ----------
defim said:
Set the checkbox "enabled"
Btw, nice signature
Click to expand...
Click to collapse
if had that option why would I have asked
If you don't name you rom i think you have the same as me.
stock rom
Maybe you shoudl add another lines to you signatire like "asking right questions". Now still nobody knows you manufacturer, android version and so on. Also my crystal glass is cloudy
This guide is a great example of how to hack a third-party, closed-source application using apktool and smali. The first goal is to fix an annoying UI lag bug in Words With Friends by inserting a call to Thread.yield() at the top of a tight loop before acquiring a global lock. The second goal is to turn off the advertisements that display after every move.
Table of Contents
1. Install Words With Friends from Google Play
2. Extract the APK file from device onto PC
3. Decompile the APK file
4. Edit Smali: add Thread.sleep() to animation loop
5. Edit Smail: remove addActivity() call for ads
6. Reassemble the APK file
7. Sign the Reassembled APK File
8. Zipalign the reassembled APK file
9. Uninstall Words With Friends from the device
10. Install the fixed Words With Friends APK to the device
Appendix A: Troubleshooting
1. Install Words With Friends from Google Play
Words With Friends is a free application provided by Zynga and is available for install from the Google Play store. Simply search for Words With Friends and install it. More information about the app is available at http://www.wordswithfriends.com.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2. Extract the APK file from device onto PC
In order to modify the Words With Friends application the APK file needs to be obtained. There are several different ways to extract an APK file from your device. The method outlined here is using Astro File Manager from the Google Play store.
Install Astro File Manager from the Google Play store
Launch Astro File Manager from home screen
Select "Application Backup" *
Checkmark "Words Free"
Click "Backup"
Copy the Words With Friends APK file from /sdcard/backups/apps to your PC
* If the screen does not have an "Application Backup" item but rather goes straight into the file browser, open the menu and select "Application Backup" from the there instead.
Astro File Manager will create the folder "backups/apps" on the SDCard if it does not exist and put the Words With Friends APK file in it. The file name may vary, and in my case it was "Words Free-4811.apk".
If you have root access to your device, it may be easier to simply copy the APK file from /data/app to /sdcard and then copy it off the device from the SDCard. To do this I like to use a program called "Terminal Emulator", which can be installed from the Google Play store. Then you can just run the "su" command followed by "cp /data/app/com.zynga.words-1.apk /sdcard" to copy the APK file to the SDCard.
3. Decompile the APK file
The next step is to decompile the Words With Friends APK file using "apktool". The apktool application is freely downloadable from http://code.google.com/p/android-apktool and requires the Android SDK and Java Development Kit (JDK) to be installed. The steps that follow assume that the directory with the "apktool" command is in the PATH environment variable and may be called without having to give the absolute path. I will not cover the steps to install the Android SDK nor apktool here, as there are numerous good instructions on the Internet. The apktool application works on Windows, Mac, and Linux. I will be using Ubuntu Linux 12.04 64-bit (not that it really matters!).
Open a terminal/command prompt into the directory where the Words With Friends APK file is located. In my case, the name of the APK file was "Words Free-4811.apk", but I have renamed it to "WordsWithFriends-original.apk" for simplicity.
Run the following command to decompile the APK. The "-d" command-line argument decompiles the application in "Debug mode". I am not entirely sure what this does, but many instructions recommend its usage. Since it has worked for me, I use it unconditionally. If you get any errors with this commoand, try removing "-d" to see if that works.
apktool decode -d WordsWithFriends-original.apk decoded
This command will create a directory named "decoded" with the decompiled contents of the APK.
4. Edit Smali: add Thread.sleep() to animation loop
One of the bugs in Words With Friends is that there is a tight loop that spins, acquiring the graphics lock, checking if there are any animations to draw, then performing the animations if there are any. The problem is that sometimes this thread "thrashes" or "spins", causing the UI of the application to become temporarily unresponsive. This bug is especially noticable when a blank tile is played: after selecting the letter for the tile, the app appears to hang for several seconds. The fix for this is simple: put a call to Thread.yield() at the top of the loop before acquiring the graphics lock.
To fix this, open the file decompiled/smali/com/zynga/words/ui/game/as.smali in a text editor. Find the "run" method and then the line that follows that looks like:
iget-object v0, p0, Lcom/zynga/words/ui/game/as;->c:Landroid/view/SurfaceHolder;(for me this was at line 136). The two lines above it should be ":try_start_0" and ".line 2569" ("2569" may be different). Insert the following line *above* the ".line 2569" line:
invoke-static {}, Ljava/lang/Thread;->yield()V
Save the changes to the file then exit.
5. Edit Smail: remove addActivity() call for ads
Do you ever get annoyed at the advertisements that are displayed after each move you make? Although this may not be legal, it is quite simple to stop those ads from displaying. All you need to do is remove the command that displays them.
To do this, open the file decompiled/smali/com/zynga/toybox/ads/f.smali in a text editor. Find the line with the text "startActivity" (for me this was line 181) and either delete it or add a '#' as the first character of the line (to turn it into a comment). Then, comment or delete the ".line" line immediately above the startActivity line. Save the changes to the file then exit.
6. Reassemble the APK file
Now we need to rebuild the APK file from the modified smali sources. To do this, run the following apktool command:
apktool build -d decompiled WordsWithFriends-unsigned.apk
This should create the APK file WordsWithFriends-unsigned.apk in the current directory.
7. Sign the Reassembled APK File
Before the modified APK file can be loaded onto a device it must be signed. The instructions below are adapted from the official "Signing Your Applications" page at http://developer.android.com/tools/publishing/app-signing.html.
If you are already setup for APK signing, then this paragraph may be ignored. Otherwise, run the following command to create a code signing key:
keytool -genkey -keystore keystore -alias MyReleaseKey -keypass password -storepass password -keyalg RSA -keysize 2048 -validity 10000This will create a file named "keystore" in the current directory, protected by the password "password". Obviously, this is a terribly insecure password, so I wouldn't recommend using this key for anything else (unless you choose a better key). If you use different values for the -keystore, -alias, -keypass, or -storepass be sure to make the corresponding adjustments to the instructions that follow.
Run the following command to sign your APK file:
jarsigner -keystore keystore -storepass password -keypass password -sigalg MD5withRSA -digestalg SHA1 -signedjar WordsWithFriends-signed.apk WordsWithFriends-unsigned.apk MyReleaseKey
Of course, replace the values of the -keystore, -storepass, -keypass, and MyReleaseKey with the corresponding values on your system.
This should create a file named WordsWithFriends-signed.apk in the current directory, which is the signed version of the modified application.
8. Zipalign the reassembled APK file
Although it is not strictly required, as a performance increase the signed APK file can be "zipaligned". Simply run the following command:
zipalign 4 WordsWithFriends-signed.apk WordsWithFriends.apk
This will create a file named "WordsWithFriends.apk" in the current directory which is both signed and zipaligned. This is the "final" APK file that is ready to be installed.
9. Uninstall Words With Friends from the device
Since the modified APK file is signed with a different key than the one used to sign the APK that was installed from Google Play, the Android OS will refuse to load the modified APK. So before loading it Words With Friends must be uninstalled from the device. This can either be done from the device (eg. from the home screen or Settings -> Applications screen) or by connecting the device to the computer via the USB cable and running the following command:
adb uninstall com.zynga.words
10. Install the fixed Words With Friends APK to the device
Finally, install the signed and (optionally) zipaligned APK to the device connecting the device to the PC via the USB cable and running the following command:
adb install WordsWithFriends.apk
And you're done! Enjoy a better Words With Friends experience.
Appendix A: Troubleshooting
If you encounter any problems, check this section before reporting it.
A1. Cannot sign into Words With Friends using Facebook
It seems that sometimes after replacing the Words With Friends application from Google Play with the custom one that Facebook authentication does not work. Specifically, when the Words With Friends application starts up and prompts for either a Facebook account or email address to sign in, when Facebook is selected it briefly starts loading the Facebook page then returns to the Words With Friends application without having logged in.
This may be because the signature on the APK has changed. The workaround is to uninstall the Facebook application, log into Words With Friends with Facebook, then re-install the Facebook application from Google Play. This will cause Words With Friends to use the facebook.com web page to log in instead of the Facebook application that is installed locally, which does not check APK signatures.
A2. Words With Friends no longer updates from Google Play
Yep, that's unavoidable. To upgrade you will need to go through this entire process again, first uninstalling the modified Words With Friends and starting over with installing from Google Play.
A3. adb install fails with error "INSTALL_PARSE_FAILED_NO_CERTIFICATES"
If "adb install" fails with the error "INSTALL_PARSE_FAILED_NO_CERTIFICATES" then be sure that you are attempting to install the signed APK, as the OS will refuse to load unsigned APKs.
If you are using JDK 7 (as opposed to JDK 6 or 5), which can be tested by running "javac -version" then make sure to include "-sigalg MD5withRSA -digestalg SHA1" in the command-line arguments to jarsigner. The default signing algorithm changed in JDK 7, requiring that these arguments be explicitly specified (see http://developer.android.com/tools/publishing/app-signing.html#signapp for details)
Hi guys,
Here is third version of my ROM Tools PC Version (Automatic decompile classes.dex file to edit smali content). It is major release of this tool but further updates will follow.
After testing the third version on bunch of Devices successfully, here is the general release of it. This tool has been mainly constructed to decompile and recompile classes.dex of apk's and jar files without having to tediously type whole commands. However, there are few features I have added in it which in my opinion are useful bt not that much connected to dex operations.
What's New ?
Here is list of New features and detailed description of them:
Note:- No other fetaure except decompiling/recompiling will work if you have not connected your phone via USB cable and USB debugging is on.
Reboot Options:
Reboot:
Will normally reboot the phone
Necessary when replaced some framework file or pushed a system file
Code used
Code:
adb reboot
Click to expand...
Click to collapse
Recovery:
Reboot your phone in recovery mode
Necessary when thinking of flashing something and want to save time and instead of pressing a combo while phone is turned off.
Code used:
Code:
adb reboot recovery
Click to expand...
Click to collapse
Hot reboot: *May not work on all phones*
Reboots your phone faster
It reboots your phone faster by just killing all system processes forcing the GUI to restart. Preferred as its fast and reliable when pushing themed files. Not recommended if doing more intensive replacing(Sometimes syetem needs rebooting normally to show changes)
Code Used:
Code:
adb shell killall system_server
Click to expand...
Click to collapse
Miscellaneous:
logcat:
1. Display logcat:
Displays logcat with v long formatting with 10000+ lines.
Easy than typing whole command. Its with formatting. Has more lines than normal command prompt display
Code Used:
Code:
adb logcat -v long
Click to expand...
Click to collapse
2. Save logcat:
Saves logcat in main folder. A random prefix is added to each locat so that they do not get replaced by newer one.
Easier than typing the command. With good formatting.
Code used:
Code:
adb logcat -v long > logcat%random%.txt
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Fix permissions: *ignore errors*
Fixes permissions of /system/app, /system/framework/, system/etc/init.d
Necessary when replacing many files in system and saving time to set correct permissions. Sometimes, due to incorrect permissions, phone won't boot or scripts won't run. Very useful command to save you from these headaches.
Ignore errors because there may not be init.d folder present in your device. So it will show error for that, but all other permissions will be corrected
Code Used:
Code:
adb shell chmod 644 /system/app/*
adb shell chmod 644 /system/framework/*
adb shell chmod 777 /system/etc/init.d
adb shell chmod 777 /system/etc/init.d/*
Click to expand...
Click to collapse
Reset Password: *May not work on all devices* *Ignore errors*
Resets your pin, password, pattern lockscreen
Ignore errors because it will try to delete 4 files and there will be only one correct file to be deleted based on what type of password you have set.
May not work on all devices because I have only tested it on Gingerbread Samsung devices. *Confirmed to be working on rooted mobiles only*
Code Used:
Code:
adb shell rm /data/system/gesture.key
adb shell rm /data/system/password.key
adb shell rm /sd-ext/system/gesture.key
adb shell rm /sd-ext/system/passwork.key
Click to expand...
Click to collapse
Screenshot:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Changelog :
Code:
Version 3
28 Ma 2013
-Added Reboot
-Added Recovery
-Added Hot Reboot
-Added logcat
-Added Fix Permissions
-Added Reset Password
-Added an ugly easter egg
Version 2
18 April 2013
- Changed it from a script to multi tool
- Added folders for convenience
- Made eye candy
- Made it noob proof
- It's like changing Baichung Bhutiya to Lionel Messi
Version 1
- Just one smali.bat file and one baksmali.bat file with one one line each of commands to Baksmaling and Smaling (duh!)
PHP:
I am not responsible for your device being dead,
you flashing stock ROM,
you using your device as a brick,
or the decrease in love of your Girlfriend because you use your mobile so much
What does it do?
As you are aware, there are smali files in jar files and apks you need to edit for adding 4-way boot into power menu, extending Power options, changing clock colour, adding CRT effect, changing the pop up that comes up when you touch the easter egg image, adding brightness slidebar, adding lidroid toggles, etc and so manyyyy things
In order to edit them, you need to decompile apk and classes.dex
It is not a problem in editing smali files of apk as they are decompiled itself by APK-Multitool(I use it)
But, it does not work for jar files
I know that there is smali.jar and baksmali.jar for it but I don't like repeatedly commading same operations when I can do it with one click
This program decompiles and recompiles classes.dex from any jar or apk in one click(very useful when you only need to decompile dex file only)
Pre-Requisites:-
*PC
*My Tool
*Java JDK(or JRE) (If you are running Windows 7 64 bit, you may need to add Java in environment variable)
*7-Zip (For in zip operations[pull out classes.dex])
*classes.dex file(on which you will operate)
*Android Phone to be connected to PC with USB Debugging on to use features other than decompiling and recompiling
Guide:-
1. Download my Tool.
2. Extract it in any folder.
3. Place classes.dex in the input folder. DO NOT RENAME IT.
4. Run script.bat. Choose Option 1, Decompile classes.dex . In a few seconds, there will be a prompt that it is "Done. Press anykey to continue" (Note:- If you have UAC [User Account Control] on, you may run it as administrator or it might not be able to create folder if you have extracted it in System Drive)
5. Go to decompiled folder. There will BE classout folder. Make any changes in smali in classout folder(ALWAYS USE NOTEPAD++). DO NOT RENAME CLASSOUT FOLDER.
6. Again open script.bat if you had closed it or if not, then return to the window.
7. Choose 2 option "Compile classes.dex" . A new classes.dex will be formed in output folder.
8. Enjoy
Note:- Once you change things in classout folder, and you decompile another classes.dex, previous version in decompiled folder will be deleted. So if you want backup of it, move it somewhere else
Same thing will happen to classes.dex on output folder when you compile another one.
Other options
1. Connect you phone to PC with USB Debugging on and not on USB Tethering. Make sure you aren't using adb before using the tool. If so, Go to Alt+Ctrl+Del and to Task Manager and close adb.exe process
2. Choose the option what you want.
a) Logcat, either view or save it
If you view it, a window will appear with logcat in it. If you are done, just close that window
If you save it, it will be saved in the same folder where Script.bat is present. To stop saving it, Press Ctrl+C and type Y and press Enter
b) Reboot, may take some time in rebboting and rebooting in recovery.
c) Fix permissions and Reset password
3. Try to find Easter Egg
Download:-
ROMToolsPCv3.zip
Reserved
Definitely easier than the "java -jar smali.jar..." command.
Thank you.
Trying it out...
Thank You all
If you have suggestions, please post them here.
Great tool .Try to make one for resources also :thumbup:
Sent from my GT-I9082 using Tapatalk 2
balliboxer said:
Great tool .Try to make one for resources.dex also :thumbup:
Sent from my GT-I9082 using Tapatalk 2
Click to expand...
Click to collapse
Sure
Didn't knew there were such files too
balliboxer said:
Great tool .Try to make one for resources.dex also :thumbup:
Sent from my GT-I9082 using Tapatalk 2
Click to expand...
Click to collapse
Can you tell me which file contain these?
I searched it but did not find much
Are you talking about resources.arsc?
iamareebjamal said:
Can you tell me which file contain these?
I searched it but did not find much
Are you talking about resources.arsc?
Click to expand...
Click to collapse
Yea resources.arsc mistakenly written.dex
Sent from my GT-I9082 using Tapatalk 2
balliboxer said:
Yea resources.arsc mistakenly written.dex
Sent from my GT-I9082 using Tapatalk 2
Click to expand...
Click to collapse
Umm. That is automatically done by apktool
I did not find any way to do it separately
iamareebjamal said:
Umm. That is automatically done by apktool
I did not find any way to do it separately
Click to expand...
Click to collapse
But in apktool we have to manually put commands and sometimes it give error.
Sent from my GT-I9082 using Tapatalk 2
balliboxer said:
But in apktool we have to manually put commands and sometimes it give error.
Sent from my GT-I9082 using Tapatalk 2
Click to expand...
Click to collapse
Use apk multitool or vts instead
Linux Multitool
iamareebjamal said:
Thank You all
If you have suggestions, please post them here.
Click to expand...
Click to collapse
Here is something equal written for Linux.
http://d-h.st/UEh
Hope you like it.
Greetings.
Version 3 Released and OP Updated *Major Release*
iits cool dude thanks it helps a lot
badagila said:
iits cool dude thanks it helps a lot
Click to expand...
Click to collapse
Thanks. But don't quote the whole OP for saying something.
It takes some extra scrolls to move down o the point.
So, can you please remove the quote from you post?
----------------------------------------------------------------------------------------------------------------------------------------------------------
And guys, reset lock feature is now confirmed to be only working on rooted phones
Cheers
I can confirm "reset password" worked on sgs3 i727 on aokp rom, it still asking for a patron but any patron unlock it, for pass lock or pin it just reset it to default, big work thx
juancollado2003 said:
I can confirm "reset password" worked on sgs3 i727 on aokp rom, it still asking for a patron but any patron unlock it, for pass lock or pin it just reset it to default, big work thx
Click to expand...
Click to collapse
Yes, it works like that only
It will show the password screen but phone will get opened if you input any password
Funny though (Good for trolling people)
juancollado2003 said:
I can confirm "reset password" worked on sgs3 i727 on aokp rom, it still asking for a patron but any patron unlock it, for pass lock or pin it just reset it to default, big work thx
Click to expand...
Click to collapse
Yes, it works like that only
It will show the password screen but phone will get opened if you input any password
Funny though (Good for trolling people)
Does this work on linux?
GUIDE
This is a guide to help you de-odex your Jellybean odexed firmware.
As X-ultimate is not working on jellybean firmwares and @Agadoo spends a lot of time deodexing every firmware, I thought this guide can help a lot of people including @Agadoo.
THINGS TO REMEMBER :-
1. I AM “ NOT AT ALL RESPONSIBLE” FOR ANY SOFT-BRICKS OR ANY OTHER DAMAGES TO YOUR PC OR PHONE
2. WHEN YOU DEODEX YOUR FIRMWARE, SYSTEM WILL WRITE “.dex” FILES IN /data/dalvik-cache, WHICH WILL REDUCE SPACE IN THAT FOLDER.
3.YOU WILL READ THE WHOLE THREAD CAREFULLY BEFORE DOING ANYTHING.
There is a simple way to deodex your firmware i.e. using universal deodexer (http://forum.xda-developers.com/showthread.php?t=2213235). Here, when I say simple, I mean the download and setup of this program is simple.
But a few features are missing in it. Firstly it cannot zipalign after deodexing the firmware. The second problem is a major problem , as far as I think. We have preload partition and a system partition in our phone. The “.apk” and “.odex” files stored in the preload partition, have symlinks in the system folder. It means there are a few “.apk” and “.odex” files in the system folders which are not actually applications but symlinks of those apps in preload folder. So you need to manually sort them out, which is a real pain in your a**. But don’t worry, the below mentioned method is different.
ANOTHER way to deodex, like Universal deodexer....... Carbonite tool (credits- adityaf) --- http://forum.xda-developers.com/showthread.php?t=2226160 (ty kingbabasula)
***********************************************************************************************************************************************************************************************************************************************************
This method uses android kitchen (by dsixda) to deodex the firmware. SO ALL THE CREDITS GO TO HIM. Original thread ------- http://forum.xda-developers.com/showthread.php?t=633246
Setup looks complex because I have given a detailed explanation on how to do it.
The guide is in two parts. First part in first post and the second in the second post.
PART - 1
PREREQUISITES :- (installing cygwin and android kitchen)
1.LATEST VERSION OF JAVA SHOULD BE INSTALLED ON YOUR PC.
2.CYGWIN……….
Go to (http://www.cygwin.com) and download the LATEST setup.exe file TO AVOID ERRORS. (Remember to install in C:\cygwin) SEE BELOW, HOW TO INSTALL.
************************************************************************************************************
Cygwin instructions for dsixda's Android Kitchen
-------------------------------------------------
1) Run the Cygwin setup.exe and select the defaults for the installation paths, such as:
- install from internet
- install to C:\cygwin
2) At the 'Select Packages' screen, go to the 'Search' box to look for the following package:
* gcc4 (found under 'Devel')
- Click on the '+' symbol at the section it's found under
NOTE:- IN THE SELECT PACKAGE SCREEN, UNTICK "HIDE OBSOLETEPACKAGES" IN BOTTOM LEFT CORNER, AND THEN SEARCH FOR "gcc4".
..................Now it would be found under "_obsolete" and not under DEVEL...... (thanks bob for pointing)
- Then find this single package (only the one with this exact name, not multiple similarly-named ones!) and click 'Skip' once so that it changes to show a version number
Go back to the Search box and repeat the above steps for the rest of the packages:
* libmpfr4 (found under 'Libs')
* perl (found under 'Interpreters')
* cpio (found under 'Utils')
* util-linux (found under 'Utils')
* ncurses (found under 'Utils')
* zip (found under 'Archive')
* unzip (found under 'Archive')
* wget (found under 'Web')
3) Press Next to proceed installing these packages.
4) When installation has been completed, click on your new Cygwin desktop shortcut. This will open a terminal session that will run some initialization.
5) With the Cygwin terminal still open, we need to configure the path to the Java application so that it can be executed within Cygwin.
In the terminal, type the command 'java' (without quotes). If it says 'command not found', then read the below. Otherwise, skip this section.
First, make a backup of your .bash_profile file in case you make a mistake later in this procedure.
Enter the following in the terminal:
cp .bash_profile .bash_profile.backup
Next, find out where your java.exe file is and run the appropriate command to add it to your Cygwin path.
For example, my java.exe is found under C:\Program Files\Java\jre7\bin, so I had to type:
echo "PATH=/cygdrive/c/Program\ Files/Java/jre7/bin:\${PATH}" >> .bash_profile
Modify the command above so that it matches the actual path to your installed Java.
Remember to add a "\" character before any spaces in your path, as shown above.
Type the following so that the file gets loaded (you only need to do this once):
source .bash_profile
There should not be any errors displayed if successful.
(Otherwise, if you made an error in the .bash_profile file, restore your backup by typing: cp .bash_profile.backup .bash_profile, and then try the procedure again)
If done correctly, then when you type 'java' it should display some help information.
6) Your Cygwin is now ready for the kitchen!
************************************************************************************************************
3. Now download the kitchen from dsixda’s github https://github.com/dsixda/Android-Kitchen/tags. (Click the zip option.)
4. Now create a folder kitchen inside C:\cygwin\home\ and extract the kitchen’s zip in that folder. Your kitchen is setup now.
View the next post for deodexing
Credits:
1. Cygwin
2. dsixda
3. BOBFRANTIC FOR REPORTING
PART -2
HOW TO DEODEX :-
Requirements……………….
1. Download this zip file which contains two windows application files and updater script. LINK------ http://db.tt/T9Tooxy8
a. Linux disk internals - Install this file.
b. SGS2ext - Just keep it.
c. META-INF - Just keep it.
2. WinRAR
Procedures…………………….
1.Download the Samsung firmware that you want to deodex and Extract the “system.img.md5” and “hidden.img.md5” from the firmware(.tar.md5) with WinRAR. I suggest you extract it in new clean folder. Just minimize this folder.
2.Now right click SGS2ext.jar and open it with java. A window will open. Now drag the system.img.md5 (that you have extracted) from the minimized folder to this window. Let it complete fully. After that reopen SGS2ext do the same with hidden.img.md5. You will get two files in that folder i.e. “system.img.ext4.img” and “hidden.img.ext4.img”.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
3.Make a folder by name “WORKING_deodex” inside C:\cygwin\home\****\kitchen\. The word “WORKING_” should be in capital letters. Copy the META-INF folder that you downloaded to the “WORKING_deodex” folder. Create two new folders inside “WORKING_deodex” folder namely “system” and “preload”.
4.Search and Open the application “DiskInternals Linux Reader”. Select mount image from the left pane. Select raw disk images and click next. Browse and select “system.img.ext4.img”. This file will then be mounted. Inside the mounted folder, click only the “app” and “framework” folder and save it inside C:\cygwin\home\****\kitchen\WORKING_deodex\system
Do the same with with “hidden.img.ext4.img” file. But this time after mounting, save only the symlink folder to C:\cygwin\home\****\kitchen\WORKING_deodex\preload.
5. Now open cygwin terminal from desktop. Remember to run this as an administrator.
Then type “cd kitchen”.
Now type command “./menu”. You will enter android rom kitchen.
Go to “advanced options” and select deodex files.
IN THIS SCREEN SELECT THE OPTION "v" TO SET API.
SET API TO "16" as we are deodexing 4.1.2 firmware. (THANKS BOB AGAIN)
Then Deodex both app and framework folders.
Android kitchen will do the rest automatically. It will take a few minutes to complete.
6. After that go to
C:\cygwin\home\****\kitchen\WORKING_deodex\META-INF\com\google\android and open the updater script with notepad++.
In this file check if all the “.apk” files in preload partition are symlinked. Otherwise just add following line with the apk name from preload.
For example if there is Gmail.apk inside preload, then to symlink it write :-
symlink("/preload/symlink/system/app/Gmail.apk", "/system/app/Gmail.apk");
7. Now select the option to create a rom from working folder and select interactive mode.
It will first zipalign rom, compress it and sign the zip file.
Then transfer it to your sdcard and flash the file.
8. You can also push the files via adb
If you face any problem report it…………
Save @Agadoo’s data plan……
Reserved
Thanks for this, appreciated. I am running into a puzzlement right from the start. When I get to the select packages part of the Cygwin Setup and search for the first package gcc4 there is nothing to select. I noticed before this step you have a bunch of sites to download from. I selected the first. See screenshot.
bobfrantic said:
Thanks for this, appreciated. I am running into a puzzlement right from the start. When I get to the select packages part of the Cygwin Setup and search for the first package gcc4 there is nothing to select. I noticed before this step you have a bunch of sites to download from. I selected the first. See screenshot.
View attachment 2087910
Click to expand...
Click to collapse
Wait, the gcc4 has become obsolete. Wait till i update the post. thanks for reporting.
EDIT:- In the screenshot you posted, untick the hide obsolete packages and then search for gcc4. But it wont be under devel, it will be under obsolete package. (remember that)
bobfrantic said:
Thanks for this, appreciated. I am running into a puzzlement right from the start. When I get to the select packages part of the Cygwin Setup and search for the first package gcc4 there is nothing to select. I noticed before this step you have a bunch of sites to download from. I selected the first. See screenshot.
View attachment 2087910
Click to expand...
Click to collapse
Updated 1st post. See the steps again.
Deodex working ok, but with the SecEmail there is a problem and can't deodex that. So haven't been able to go further than deodexing so far.
Error occured while disassembling class Lcom.android.email.activity.setup.AccountSettingsHtmlSignatureFragment; - skipping class
java.lang.RuntimeException: regCount does not match the number of arguments of the method
at org.jf.dexlib.Code.Format.Instruction35c.checkItem(Instruction35c.java:160)
at org.jf.dexlib.Code.Format.Instruction35c.<init>(Instruction35c.java:69)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInvokeVirtualQuick(MethodAnalyzer.java:3681)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:1106)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:213)
at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:389)
at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:311)
at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:132)
at org.jf.baksmali.Adaptors.ClassDefinition.writeMethods(ClassDefinition.java:338)
at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:294)
at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:116)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:186)
at org.jf.baksmali.main.main(main.java:308)
Assembling into classes.dex ...
java -Xmx512m -jar smali.jar -a 17 -o classes.dex out
out\com\android\email\activity\MessageCompose.smali[0,-1] no viable alternative at input '<EOF>'
out\com\android\email\activity\setup\AccountSettingsHtmlSignatureFragment.smali[0,-1] no viable alternative at input '<EOF>'
WARNING: Unable to produce classes.dex!
that's where I am at so far
Ok not able to deodex. Tried moving SecEmail files from preload to apps. Spent enough time today so will try another day. Your guide is most appreciated. This problem is the result of something else going on.
Sent from my GT-I9070 using xda app-developers app
bobfrantic said:
Ok not able to deodex. Tried moving SecEmail files from preload to apps. Spent enough time today so will try another day. Your guide is most appreciated. This problem is the result of something else going on.
Sent from my GT-I9070 using xda app-developers app
Click to expand...
Click to collapse
bobfrantic said:
Deodex working ok, but with the SecEmail there is a problem and can't deodex that. So haven't been able to go further than deodexing so far.
Error occured while disassembling class Lcom.android.email.activity.setup.AccountSettingsHtmlSignatureFragment; - skipping class
java.lang.RuntimeException: regCount does not match the number of arguments of the method
at org.jf.dexlib.Code.Format.Instruction35c.checkItem(Instruction35c.java:160)
at org.jf.dexlib.Code.Format.Instruction35c.(Instruction35c.java:69)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInvokeVirtualQuick(MethodAnalyzer.java:3681)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:1106)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:213)
at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:389)
at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:311)
at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:132)
at org.jf.baksmali.Adaptors.ClassDefinition.writeMethods(ClassDefinition.java:338)
at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:294)
at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:116)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:186)
at org.jf.baksmali.main.main(main.java:308)
Assembling into classes.dex ...
java -Xmx512m -jar smali.jar -a 17 -o classes.dex out
out\com\android\email\activity\MessageCompose.smali[0,-1] no viable alternative at input ''
out\com\android\email\activity\setup\AccountSettingsHtmlSignatureFragment.smali[0,-1] no viable alternative at input ''
WARNING: Unable to produce classes.dex!
that's where I am at so far
Click to expand...
Click to collapse
I AM EXTREMELY SORRY. I FORGOT ONE IMPORTANT THING. IN THIS SCREEN SELECT THE OPTION "v" TO SET API.
SET API TO "16".
THEN TRY TO DEODEX.
anantttt said:
I AM EXTREMELY SORRY. I FORGOT ONE IMPORTANT THING. IN THIS SCREEN AFTER SELECT THE OPTION "v" TO SET API.
SET API TO "16".
THEN TRY TO DEODEX.
Click to expand...
Click to collapse
That was gonna be my next question. I saw something in the build.prop saying sdk 16 so wondered. thanks for the info. guess you will update things.
bobfrantic said:
That was gonna be my next question. I saw something in the build.prop saying sdk 16 so wondered. thanks for the info. guess you will update things.
Click to expand...
Click to collapse
Already updated. See OP.
It worked. will finish rest tomorrow but deoxed fine.
Sent from my GT-I9070 using xda app-developers app
Oh that is great!!! So I think the guide is complete now.
Tell me if the updater script is working properly.
Finished. Made the deodexed zip, followed the prompts in kitchen. Zipaligned, checked the update-script all was good. Signed zip took a bit of time, renamed it and put into my sd card. Started from scratch on phone with fresh install of XXLQG firmware, installed cocafe's 6.8 kernel/cwm, installed my deodexed firmware zip and phone rebooted fine and is deodexed. Preload, symlinks, apps, framework all are correct. Thanks for the guide and I can't think of anything else to add other than be patient, some steps take a while.
$ echo"PATH=cygdrive/c/Program\Files/Java/jre7/bin:\${PATH}">>.bash_profile
cygwin warning:
MS-DOS style path detected: echoPATH=cygdrive/c/Program\Files/Java/jre7/bin:${PATH}
Preferred POSIX equivalent is: echoPATH=cygdrive/c/Program/Files/Java/jre7/bin:${PATH}
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
-bash: echoPATH=cygdrive/c/Program\Files/Java/jre7/bin:${PATH}: No such file or directory
when I try to put the address of java appears the inscription above, and when I go into the kitchen and I type. / menu says that java is not installed.
what am I missing?
lobotwister said:
$ echo"PATH=cygdrive/c/Program\Files/Java/jre7/bin:\${PATH}">>.bash_profile
cygwin warning:
MS-DOS style path detected: echoPATH=cygdrive/c/Program\Files/Java/jre7/bin:${PATH}
Preferred POSIX equivalent is: echoPATH=cygdrive/c/Program/Files/Java/jre7/bin:${PATH}
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
-bash: echoPATH=cygdrive/c/Program\Files/Java/jre7/bin:${PATH}: No such file or directory
when I try to put the address of java appears the inscription above, and when I go into the kitchen and I type. / menu says that java is not installed.
what am I missing?
Click to expand...
Click to collapse
Do you have java installed?????
If not install the latest version of java and then try this command.
bobfrantic said:
Finished. Made the deodexed zip, followed the prompts in kitchen. Zipaligned, checked the update-script all was good. Signed zip took a bit of time, renamed it and put into my sd card. Started from scratch on phone with fresh install of XXLQG firmware, installed cocafe's 6.8 kernel/cwm, installed my deodexed firmware zip and phone rebooted fine and is deodexed. Preload, symlinks, apps, framework all are correct. Thanks for the guide and I can't think of anything else to add other than be patient, some steps take a while.
Click to expand...
Click to collapse
Well yes. Signing takes a bit of time. You can skip signing if you want.
Now, one more question. Totally off topic
Will you challenge Agadoo, in uploading the deodexed firmware.
anantttt said:
Well yes. Signing takes a bit of time. You can skip signing if you want.
Now, one more question. Totally off topic
Will you challenge Agadoo, in uploading the deodexed firmware.
Click to expand...
Click to collapse
Actually I have pretty well every deodexed firmware on my puter. I was thinking of starting a thread with all in one location instead of how it is now with them spread all over the place LOL. Whatcha think? Good idea or not...
bobfrantic said:
Actually I have pretty well every deodexed firmware on my puter. I was thinking of starting a thread with all in one location instead of how it is now with them spread all over the place LOL. Whatcha think? Good idea or not...
Click to expand...
Click to collapse
Good idea. But frapeti already has a thread in the dev forum.
And one more thing, after deodexing in the build.prop add these lines. Saw it in frapeti's thread.
LINK--- http://forum.xda-developers.com/showthread.php?t=1437799
anantttt said:
Do you have java installed?????
If not install the latest version of java and then try this command.
Click to expand...
Click to collapse
I do have java installed, but I can not make the program recognize the path to the folder of it, with all methods we have deodex forum I always have this problem with java, I do not know what else to do, just will not.
Uploaded with ImageShack.us