yashsingh1/xdaforums huggingface dataset:
[Android] dsixda:
I think I have an understanding of why it is not booting. There are some dependencies that are enforced, so certain files need to be deodexed before the others. I'll work on a potential fix later this weekend.

By the way, I have completed work on a plugin option which will allow you to use any of your custom scripts, which can be selectable from a plugins menu. I'll include it in the next release. This will allow people to contribute their own scripts to the kitchen.
[Android] dsixda:
If it's not too difficult I'll consider working on it for a future release. Thanks for the suggestion.
[Android] OMJ:
I vote to remove the "basic".....thanks for all your hard work!
[Android] puertoblack2003:
Hello,

after the last update .I ran to setup a working folder from the Rom.zip.Now i did not deodex the files.I left it as default so i ran the build rom form working folder after 3 attempts i'm getting the home sense force close.Not sure what else to look for I'm testing it on an evo.

I did clear to factory settings and clear cache and sd partition

thanks

Uploaded with ImageShack.us
[Android] dsixda:
Someone else reported this issue recently. I'm not sure. Did you use the task killer tweak? Also try without all those options turned on.
[Android] puertoblack2003:
never mine i was trying to be slick and move the widgets to the sdcard to leave some good size room internal but i put them back and everything is working...:) what a day..lol :D
[Android] puertoblack2003:
i can also confirm that the task killer don't work well for the evo :(
[Android] dsixda:
Yeah that's only for advanced users - you have to know how to use the values, not just rely on the defaults.
[Android] dsixda:
Ok, I have managed to deodex my own ROM's app and framework folders so that it finally boots up... but I had to ignore the BOOTCLASSPATH files in the framework (5 of them). I have included this option in the latest version of the kitchen that I have just uploaded.

Also I have incldued the "plugins" feature where you can run your own scripts in the kitchen without having to modify any of the kitchen files.
[Android] nickiberli:
hi

Thank you for your hard work.

But there is still a boot-loop. I just deodexed the /system/app folder.

in the /system/app folder are still 6 apps which aren't deodexed:

GmailProvider.odex

gtalkservice.odex

QuickLookup.odex

RSS.odex

Talk.odex

Vending.odex

I hope you can fix these problems :)
[Android] dsixda:
What are the errors and what ROM you used?
[Android] nickiberli:
I used this ROM:

http://android.modaco.com/content/htc-desire-desire-modaco-com/311140/rom-bravo-1-23-351-1/

This is the error of the first file which can't be deodexed:

NOW AT FILE 11 OF 118 IN system/app: ./GmailProvider.odex
Disassembling GmailProvider.odex ...
Error while disassembling method Lcom/google/android/providers/gmail/MailEngine;->runHttpRequestInternal(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;. Continuing.
org.jf.dexlib.Code.Analysis.ValidationException: class Lcom/google/android/gtalkservice/GTalkHttpClient; cannot be resolved.
at org.jf.dexlib.Code.Analysis.ClassPath$UnresolvedClassDef.unresolvedValidationException(ClassPath.java:535)
at org.jf.dexlib.Code.Analysis.ClassPath$UnresolvedClassDef.implementsInterface(ClassPath.java:558)
at org.jf.dexlib.Code.Analysis.ClassPath.getCommonSuperclass(ClassPath.java:368)
at org.jf.dexlib.Code.Analysis.RegisterType.merge(RegisterType.java:275)
at org.jf.dexlib.Code.Analysis.AnalyzedInstruction.mergeRegister(AnalyzedInstruction.java:185)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.propagateRegisterToSuccessors(MethodAnalyzer.java:444)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.setPostRegisterTypeAndPropagateChanges(MethodAnalyzer.java:409)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.setDestinationRegisterTypeAndPropagateChanges(MethodAnalyzer.java:396)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeIgetWideObject(MethodAnalyzer.java:2572)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:776)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:208)
at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:351)
at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:290)
at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:130)
at org.jf.baksmali.Adaptors.ClassDefinition.writeMethods(ClassDefinition.java:322)
at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:291)
at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:135)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:187)
at org.jf.baksmali.main.main(main.java:278)
opcode: iget-object
CodeAddress: 59
Method: Lcom/google/android/providers/gmail/MailEngine;->runHttpRequestInternal(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;

WARNING: Cannot deodex GmailProvider.odex, skipping it.
[Android] dsixda:
Thanks a lot for the feedback, I'll check it out later. 118 files?? Holy smokes! I feel sorry for you. LOL

Maybe I can give you a modified file and you can try it out (rather than uploading a new kitchen)?
[Android] nickiberli:
Ok, thanks for your help. Of course you can give me a modified file :) Plus a few instructions and I'll try it :)
[Android] dsixda:
Alright, just unzip the attachment below, and copy to the "scripts" folder of the kitchen. Then run again. If your framework was already deodexed, then just deodex the apps.

Ignore the errors for the RSS.odex, because it refers to system/framework/com.htc.rss.jar, which refers to a class that is not found in the ROM. This is a known issue with the tools given, but should be ok regardless.

I'll try to make the script more intelligent next time so that it doesn't need this manual editing by myself.

Let me know how it works out :-)
[Android] BesFen:
Hi dsixda,

I tested your kitchen on Legend today. I can build a bootable ROM. Thanks:D:D.

But there is one bug, App2SD was not work:o, I already have SD Card with FAT32+ext3, created in Ubuntu.

Do you have any sugestion to fix it?

Thanks
[Android] t2noob:
I tried the deodex on your rom and wasn't able to to make it boot.

It's a 2.1 HTC eris rom.

If i can do anything let me know.
[Android] dsixda:
I haven't used apps2sd but the one in this kitchen worked fine for Hero users. Can't help much further, sorry.

1000th post of the thread! ;)
[Android] dsixda:
What option did you use? Do a logcat during bootup if you want to further investigate.
[Android] silverxbv2:
Just installed this last night. How do you update to the latest versions? I did not read all 101 pages.
[Android] nickiberli:
I used your script from the attachement. I had to execute it with root permissions.

After the deodex process there were no .odex files left :)

But I canẗ boot the phone, there is still this stupid boot-loop. :(

Do you have another idea to fix it? :)

EDIT: I used the option to deodex just the /system/app folder. (Option a)
[Android] dsixda:
You don't need to read anything, there is an "update" option on the main menu
[Android] dsixda:
Can you give a logcat?

Also, can you start from the beginning with all the odex files? Don't deodex the framework files.. leave them as .odex. Just do the app files. Then build and flash. We'll see if that works first.

Leaving outside right now, so won't be around for a while (plus there is a World Cup final ..haha).
[Android] nickiberli:
I did this. I deodexed the /system/app folder, built it and flashed it. But it doesn't work :(

What do you mean with logcat? Shall I try to link the errors in a log file? (With 2>>logfile.txt?)
[Android] silverxbv2:
Thanks. Like I said, I installed it but never even ran it initially. Too tired at 3 am.:D
[Android] nickiberli:
I started my phone waited a few seconds and put this command into the terminal "./adb logcat > logcat.txt. After this, I waited ca. 15 seconds and pressed Ctrl + C. Right?

Here is the logfile:

http://ul.to/oba6uo
[Android] dsixda:
Well, i did find this:

W/PackageManager( 181): Exception reading apk: /system/app/Maps.apk
W/PackageManager( 181): java.io.IOException: /system/app/Maps.apk
W/PackageManager( 181):	at dalvik.system.DexFile.isDexOptNeeded(Native Method)
W/PackageManager( 181):	at com.android.server.PackageManagerService.performDexOptLI(PackageManagerService.java:2175)
W/PackageManager( 181):	at com.android.server.PackageManagerService.scanPackageLI(PackageManagerService.java:2553)
W/PackageManager( 181):	at com.android.server.PackageManagerService.scanPackageLI(PackageManagerService.java:2109)
W/PackageManager( 181):	at com.android.server.PackageManagerService.scanDirLI(PackageManagerService.java:2005)
W/PackageManager( 181):	at com.android.server.PackageManagerService.<init>(PackageManagerService.java:595)
W/PackageManager( 181):	at com.android.server.PackageManagerService.main(PackageManagerService.java:335)
W/PackageManager( 181):	at com.android.server.ServerThread.run(SystemServer.java:135)

And when building Maps.apk I had noticed this:

NOW AT FILE 1 OF 1 IN system/app: Maps.odex
Disassembling Maps.odex ...
Assembling into classes.dex ...
out\com\tinyline\util\GZIPInputStream.smali[106,28] extraneous input 'null' expecting COLON
out\com\tinyline\util\GZIPInputStream.smali[3237,16] extraneous input 'null' expecting OPEN_PAREN
out\com\tinyline\util\GZIPInputStream.smali[3803,61] no viable alternative at input 'null'
Found Maps.apk
Removing Maps.odex ...
Put classes.dex into Maps.apk ...
mv: cannot stat `classes.dex': No such file or directory
Unzipping Maps.apk ...
Zipping Maps.zip ...
Signing the new Maps.apk ...
Maps.apk signed

I guess my script didn't catch that strange error. I'll investigate further..

EDIT: I wonder if this problem is due to this error: http://code.google.com/p/smali/issues/detail?id=35

I am using Cygwin, so probably that is the reason for it. Windows doesn't distinguish between upper and lower case, so it sees folders like "a" and "A" as the same name, whereas Unix sees them as two different folders. So one of the folders probably got overwritten.

My advice?

1) Run the kitchen in Linux/Mac instead

2) OR, in Cygwin, Remove the Maps.apk + .odex and build your ROM again, then flash. See if that works.
[Android] nickiberli:
I always used Ubuntu...
[Android] dsixda:
Try removing Maps.apk.

Otherwise, one of us will need to ask JesusFreke here:

http://code.google.com/p/smali/issues/list

No time for me right now, i'll do it later tonight maybe, or else tomorrow. I might upload a revised kitchen before I go.
[Android] dsixda:
I've uploaded 0.63, probably should help a lot of you trying to do deodexing.
[Android] Mr Bill Florida:
I love your kitchen, I find it very easy to take a cooked rom and add my bootanimation and circular battery that I want. This save me from having to do different steps, main thing is signing the file, always had issues ever since I went to windows 7 and this eliminates all issues I had before.

Thanks for your hard work...

Mr Bill
[Android] dsixda:
Thanks for the words of encouragement guys.

By the way, if you want to be better updated with my work/thoughts/etc., follow me @ twitter.com/dsixda. This is just my XDA/geek account --- therefore, tech stuff only -- so you won't need to worry about me posting off-topic stuff like music and flowers and crap like that. LOL
[Android] puertoblack2003:
Is it safe to remove the odex file that remains in the folder?
[Android] dsixda:
No, because its APK/JAR file refers to the ODEX file.

So if you remove just the ODEX then the APK/JAR will raise an exception and/or crash. Better to remove both the APK/JAR and ODEX files.

In other words -

Odexed APK/JAR = .jar/.apk with .odex (the file that contains the Java class information)

De-odexed APK/JAR = just the .jar/.apk (which contains the Java class info inside it as 'classes.dex')

BTW, APK and JAR files are basically .ZIP files that have been renamed and signed ;-)
[Android] nickiberli:
If you remove the .odex files, the phone won't startup ;)

You have to deodex your app / framework folder, if you don't like the odex files ;)
[Android] puertoblack2003:
ok back to the drawing board :( I've tackling this for two days.I can't get a completed deox i wonder if this can be doex for the evo or anyone else having issue for this model?
[Android] dsixda:
The ROMs were never really meant to be de-odexed - Google never intended it to be like that. ;) So you will find a lot of issues along the way. The best thing to do is to do a logcat and find what is actually causing issues.

Keep in mind that the ODEX files have dependencies, in this order:

1) BOOTCLASSPATH JAR files (in /system/framework)

2) the rest of the JAR/APK files in /system/framework

3) APK files in /system/app

Theoretically,

- If you de-odex the files in 1), then you MUST de-odex everything below it next, because they depend on the state of 1).

Likewise, if you only de-odex the files in 2), you must de-odex the ones in 3).

- If you de-odex only the files in 3) then you don't need to de-odex any of the ones above it, because neither 1) or 2) depend on them. Plus, you shouldn't de-odex the ones in 1) or 2) afterwards, because that means you'll have to de-odex 3) again --- but there are no more ODEX files there, so you won't able to!

Keep this in mind when de-odexing.

If you follow those rules but still have issues, then, as a last resort, it's best to contact JesusFreke at http://code.google.com/p/smali. He has an IRC channel and he's easily accessible there through the chat. But you need to provide him with all the detailed info, including the 'baksmali' and 'smali' versions and syntax used for those commands... plus logcats, etc.

On my Nexus One, I get boot issues if I de-odex 1), 2) and 3). It complains about services.jar (it's a BOOTCLASSPATH file) in the logcat. But if I do 2) and 3) then it boots up fine. I'll probably ask him about it. I tried not de-odexing services.jar but I still got a boot loop.
[Android] puertoblack2003:
ok thanks for the heads up.
[Android] dsixda:
It would nice if one of the "experts" like Paul@Modaco would chime in - he shares deodexed ROMs all the time. However, I never get a response from him for anything .. :P Two seconds of their time... Anyways, there are always knowledgeable people dropping by this thread, and it's great when they

share

information. Hopefully we can sort some of the problems out.
[Android] dsixda:
BTW, I've reported this as a bug after chatting with the developer (JesusFreke) on IRC.

http://code.google.com/p/smali/issues/detail?id=39
[Android] TMartin:
Calkulin shares fully deodex'd ROMs. You can find him in here, ppcgeeks or forum.sdx-developers.com

He might be able to help.
[Android] dsixda:
Thanks, I'll get in touch with him... we've bumped heads before @ ppcgeeks :-)
[Android] dancer_69:
I have a problem with new 0.64 version on Ubuntu.

When trying to run 1 option I get the error:

line 44: scripts/check_rom: No such file or directory

Any help on this?
[Android] dsixda:
That line calls img_files_to_working_folder. You deleted that file?
[Android] dancer_69:
No, both img_files_to_working_folder and check_rom files are in scripts folder.
[Android] dsixda:
Works fine for me. I didn't change either file.
[Android] dsixda:
Before the offending line of code, put: echo `pwd`

This will help to debug
[Android] dancer_69:
If I run check_rom script from terminal, I get similar errors for scripts/make_backup_working and scripts/img_files_to_working_folder.

It must be a general problem of Ubuntu virtual machine. It works fine, but because I had usb problems with virtual box, I make in VMWare a virtual machine using the previous vmdk file. And after that starts the problem. I thought that was from new version because I updated the kitchen too. Have you any thoughts of what causes this problem, or any suggestions to correct it?
[Android] dsixda:
Read my second reply above your post
[Android] dancer_69:
I changed like this, but I get the same error without more info:

---------------------------------------

read opt

echo `pwd`

case $opt in

1) clear; scripts/check_rom;;

2) scripts/do_root;;

3) scripts/add_busybox show_help;;

4) scripts/disable_sounds;;

5) scripts/add_tether;;

6) scripts/do_zipalign;;

7) scripts/show_rom_info;;

0) scripts/menu_advanced $version; have_prompt=no;;

99) scripts/build_rom;;

u) scripts/about $version; have_prompt=no;;

x) scripts/init_kitchen; clear; echo; echo "Goodbye."; echo; exit 1;;

*) echo "Invalid option"; have_prompt=no;;

esac

-------------------------------------

This is the error:

/home/vadmin/Tools/android_kitchen/menu: line 45: scripts/check_rom: No such file or directory
[Android] dsixda:
No no no, put it after the "clear" statement, otherwise you won't see it.

Or just re-download and re-install the kitchen man.. Don't waste your time.
[Android] robocik:
Hi :)

i see a new version every day :) hehe

would it be possible to see a change log before downloading a new kitchen from update menu ?

Would be nice to see whats new, without opening your site in browser.

Cheers mate

keep up the great work!
[Android] dsixda:
Thought of that, but realized it was too much extra work. I could put up a text file of latest version, but then if someone had a much older version, they won't know what changed in between the other versions..
[Android] BlaY0:
Hi dsixda,

I found out that U can run very quickly out of heap memory when deodexing if .odex is let say several MB. To avoid this situation I added -Xmx512m option to every java command in your do_deodex_file script.
[Android] dsixda:
Thank you for the feedback. Yeah, I saw that parameter in the guide, but never encountered the heap memory issue. I'll put it in there anyway next release.

Are you having any kind of success with deodexing, i.e. after flashing the ROM? I wonder if your suggestion improves anything for those without the heap issue but still getting boot loop?
[Android] BlaY0:
Actually I haven't tried to cook ROM out of deodexed apps/framework, was just trying to deodex everything in system/app (memory heap error poped up with Mail.apk leaving it odexed) but then I haven't seen any point in doing this so I have put odexed apks and odex files back. Storage space gain would be negligible. Will try that and get back to you.

Otherwise nice and clean scripts... they could be half the size but instead they are more readable ;)

Good work!
[Android] dsixda:
Thanks..

Actually the ROM size should be much less after deodexing, and if you like themes and stuff like battery indicators, then a deodexed ROM is required.

Oh yeah, I know ;) That particular script is very messy for the time being; I'm still a newb at this shell scripting -- not particularly good at variable substitution, as you can tell in the baksmali function calls ;-)
[Android] nickiberli:
Shell scripts are cool!!! :D

BTT:

Did you hear from smali?
[Android] lpasq:
nice. thanks!

then my aosp build "make -jx otapackage" full roms are now processed per the second release note?
[Android] dsixda:
You mean JesusFreke (who made baksmali/smali)? Well he will update the Issue report if he adds any comments to it. You can subscribe to it by selecting the star, so that your Gmail gets notifications.

http://code.google.com/p/smali/issues/list

Plus you can view any updates to his code:

http://code.google.com/p/smali/source/list

Ohh.. I don't know, sorry. I was just referring to an OTA update for Nexus One that someone had posted; it had various commands in the update-script as well as new files/folders which were unnecessary for cooking. The most important part I included was removal of the recovery folder and references to the recovery image. Let me know if it worked for you.
[Android] dsixda:
if anyone's interested, this is the logcat result I get when I flash a Nexus One ROM that is fully deodex'ed with this kitchen:

http://pastebin.com/0cpDLvGa

(I had also added the "-Xmx512m" parameter to the java commands when deodexing. See a few posts up)

It crashes at boot. The only way to get it booting is if I select option "bs" instead (it will deodex both Framework and App folders

except

for the BOOTCLASSPATH files).

I noticed this:

D/dalvikvm( 58): DEX prep '/system/framework/services.jar': unzip in 770ms, rewrite 1332ms
D/AndroidRuntime( 58): --- registering native functions ---
I/SamplingProfilerIntegration( 58): Profiler is disabled.
W/dalvikvm( 58): Exception Ljava/lang/NullPointerException; thrown during Lorg/apache/harmony/security/fortress/Services;.<clinit>
W/dalvikvm( 58): Exception Ljava/lang/ExceptionInInitializerError; thrown during Ljava/security/Security;.<clinit>
W/dalvikvm( 58): Exception Ljava/lang/ExceptionInInitializerError; thrown during Lorg/apache/harmony/security/utils/AlgNameMapper;.<clinit>
D/AndroidRuntime( 58): Shutting down VM

So basically when it's getting the class info for services.jar, it encountered a pointer issue. Dunno how to fix this though :( Just thought someone could suggest an idea.
[Android] rfgamaral:
I won't be much of a help and just wanted to say that I'm also having problems deodexing a ROM.

Although, the ROM I'm trying to do that was built by me from scratch based on the latest RUU. I'm talking about the Hero and as you know there are lots of deodex ROMs out there for the Hero, so it's supposed to work...

My last temp was only to deodex the files in "app" and then I also tried to align all those apks (after deodexing). Both gave me a boot loop...

I read the last few pages of this topic to find out that this problem still isn't solved, such a mystery lol... Oh well...

Sorry for not helping but I tried all I could think of...
[Android] dsixda:
Thanks anyway, at least we know it is possible ;) Maybe you could ask one of those devs if they can help you out.
[Android] rfgamaral:
I tried something more painful now...

Started with /system/app files and created a bunch of "update.zip" files deodexing 10 files at a time. The next update would always include the previous deodexed files. I didn't do this too all of them as it's kinda boring lol...

I have a feeling (on my case at least) that the problem lies around the "restartapp.apk", I skipped that file and deodex everything until that point and it finally booted. It could be any other after that but I strongly believe it's that one.

However it started to force close everywhere, specially on the "touch input" app and "setup wizard". I read around here that problems could arise with high compression levels but as far as I could tell from the scripts, you are using the default compression level, whatever that is. It doesn't seem to be high though but I don't know if there's a parameter to set it to "0" so I could test it out...

EDIT1: Actually I just found the option, going to do one last try...

EDIT2: No dice...
[Android] dsixda:
Ok, I goofed. I just had a talk with JesusFreke, the designer of the smali/baksmali utilities.

It DOES NOT matter what order you deodex your files. The dependencies only mattered in the past (i.e. in older versions of these tools), when the deodexing would be initiated *on the phone*. Since we're doing this on our PCs, it doesn't matter!

LOL,

Ok well I am going to change my scripts now.

Also, the Maps.apk issue has been fixed, so I will download the latest version of "smali" to ensure it's working now.
[Android] lpasq:
Yes...it worked!

From N1 using XDA App
[Android] texasice:
Thank you.
[Android] BlaY0:
Hi dsixda,

I have found another problem. If I try to cook from stock img files, I end up with ROM that has broken VPN functionality (at least PPTP)...

I figured out that you forgot to set right permissions on /system/etc/ppp/ip-up-vpn thus I added:

set_perm 0 0 04755 SYSTEM:etc/ppp/ip-up-vpn

...to your update-script.

U could also add custom boot animation functionality by adding:

set_perm 2000 2000 0771 DATA:local

...to update-script and make WORKING_*/data/local directory where one can put his/her own bootanimation.zip.
[Android] dsixda:
This binary is not in all ROMs, but I'll put a check for that anyway.. Thanks.

What if you enable it and don't put a bootanimation.zip in there? Will the ROM return an error or revert to the default bootanimation?

Thanks!