yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] Daneshm90:
K im uploading. Heres the status:

Rss.apk was not successfully deodexed so i left it out.

com.htc.rss.jar is something to monitor, if the rom gives u booting issues, try removing that file.

Other than that, everything should be good.
[G1 Android Development] puertoblack2003:
thanks..I'll check that out did you use a different method to deod?
[G1 Android Development] Daneshm90:
Well u gotta find out the classpath which is located inside init.rc which is inside ur boot.img. Then u select option 2 in the script and enter that path. If something is left behind, u try to do it again n this time read the error.

For eg, bluetooth.apk said it was missing a classpath and from the error u cud figure out its javax.obex.jar so just add ":java.obex.jar" at the end of ur classpath when u select option 2. Its trial and error really, some give unsolvable errors in which case i used -I to ignore the classes that dont exist. Im also improving the script as we speak. Im adding a "Ignore Mode" option which will be a last resort for frustated users who've given up on that one apk/jar not being to deodex.
[G1 Android Development] Daneshm90:
Here u go. Best of luck ;)

Link
[G1 Android Development] puertoblack2003:
thank you very much i'll bookmark for updates do you have a donate button?
[G1 Android Development] Daneshm90:
Lol no, i just did this script to make my/others life a bit easier.

I am glad however that u think its helpful enough to donate money to ;)
[G1 Android Development] puertoblack2003:
lol..its the appreciation that i have for the developers as yourself that take the time to put out freeware.I'm at no way an advance on rom building so these little tools is very useful..but willing to learn as i have about 20 tabs open on my browser...lol just reading away..

thanks buddy.
[G1 Android Development] Daneshm90:
Thnx, i appreciate ur sincerity. Ok so heres Auto-Deodexer v2.1

Things changed :

- Removed zipalign, prolly did more harm than good

- Added a new mode - Its called "ignore mode", by default its off, but by selecting from the menu u can toggle it on. Its status can be monitored as its always displayed above the main menu. When on, it uses the -I attribute to deodex which ignores the missing classes, now be carefull because its sole purpose is to be used on files who reports missing classpath, but those dont exist upon searching for them.

- Updated help, as it was outdated.
[G1 Android Development] puertoblack2003:
ok this time its working as it should but I'm about to lose my enter key on my keyboard for the apk lmao but I'm happy with it.:D
[G1 Android Development] Daneshm90:
Ah yes, sorry about it. I fixed it like 5 min after i uploaded it. I had left a PAUSE command in the part that deodexes apks. :( Its already fixed n uploaded btw.
[G1 Android Development] puertoblack2003:
ok working now.:) now if dsixda can incorporate this utility along with the other utility you have developed with his kitchen to a nice ui interface.This will be one of the best kitchen ever made..;) just a thought
[G1 Android Development] Daneshm90:
I agree, that would be sweet, a one stop for everything android ;)

Recovery changer, which u see in my signature, was heavily based on his kitchen, i just reduced it to the files NEEDED and created a interface for the user (Ofcourse i had to modify amonra's source code/add a whole lotta stuff but his kitchen is wht got me inspired)
[G1 Android Development] puertoblack2003:
yea i'll be lookin into that later on...
[G1 Android Development] Daneshm90:
Aight, before i go, i need to talk regarding ur rom. K if the stuff i sent over has problems booting and u cant narrow them down, try deodexing from scratch, as im afraid that the fact that previously the script use to zipalign the apk's could've caused an issue. To deodex ur rom in specific manually, all u gotta do is place place the apks/jar in appropriate place. THen select option 2 and enter

core.jar:ext.jar:framework.jar:android.policy.jar:services.jar:com.htc.framework.jar:com.htc.android.pimlib.jar:com.htc.android.easopen.jar:com.scalado.util.ScaladoUtil.jar:javax.obex.jar:com.google.android.maps.jar

(NO SPACES)

That should get u through most of the build, the ones that remain, either use ignore mode or remove them from the build. Good luck.

I've uploaded a slightly updated deodexer. Removed a minor bug and added a check where if an apk doesnt have a odex, it doesnt leave it in the apk folder, instead it moves it to the deodexed_APK folder for u ;)
[G1 Android Development] puertoblack2003:
ok cool yea i was having issue with

androidpolicy.jar and odex

com.htc.resource.apk and odex

com.htc.rss.jar and odex

framework-res.apk

service.jar and odex

everything else was fine,i'll follow on that info
[G1 Android Development] puertoblack2003:
this is the error:
[G1 Android Development] Daneshm90:
Hmm, those worked fine for me, only a couple didnt deodex.

Try this as the classpath then :

core.jar:ext.jar:framework.jar:android.policy.jar:services.jar:com.htc.framework.jar:com.htc.android.pimlib.jar:com.htc.android.easopen.jar:com.scalado.util.ScaladoUtil.jar

Btw the frameworks i sent u should be fine, its just the apk's im worried about. So if something doesnt deodex, get it from wht i sent u ;)
[G1 Android Development] puertoblack2003:
lol...the apk was fine for me just the few of the framework that i mentioned i ran into trouble, but i used your framework. I'll start packaging it tomorrow i just want to get it ready.. Oh by the way I'm on windows 7...:)
[G1 Android Development] Dexter_nlb:
your issue described, was solved on my side, with a copy of ONLY odex files back into the framework folder, so when they were requested, they were found :-) , so it was solved here..

I also added all framework JAR files to the bootclash path. which solved some other apk odex'ing work.

this was all on a 2.1-update1 release for desire, not sure how it works on other or earlier releases..

btw, did anyone confirm that *png and *ogg files needs to archived with no compression? as i modified the script to add apk with 2 7za lines first all compressable files, then a -mx0 with png and ogg files. which solved the htc_ime.apk issue i had.

But is this correctly assumed or just for the HTC_IME apk that has this compression issue?
[G1 Android Development] Daneshm90:
Well when modifying the contents of swype, i encounter the same issue, where it force-closes on anything besides mx0. So im prolly gonna have to add an option to this script where user defines the compression level. To be honest, i havent encountered a *system* apk that has caused issues by using mx9 in my experience.
[G1 Android Development] Dexter_nlb:
but this is similar to the "bootanimation.zip" if you compress contents, it will not show the animation.. so somehow the same logic seems to cover some apk, or lest some content depending on release maybe?
[G1 Android Development] Daneshm90:
Yea im aware of bootanimation.zip, but thats not an apk/jar ;) As far as apks go, im confident in saying that almost ALL system apk's have zero problems with users compressing their content. Other apk's however, such as swype do have issues when their files are compressed. Anyway, im uploading apk manager 4.6 which will have user configurable compression levels. I'll make same changes to this script and upload as well.
[G1 Android Development] Daneshm90:
K so i uploaded v2.3 :

- Added an option to select custom compression level (0-9) #Option 18

- U can monitor the status of ignore mode / compression level. Its right above the main menu
[G1 Android Development] puertoblack2003:
ok package together a test rom to test. I did the normal to wipe data clear cache and so on and flash the test rom.I was getting force close for the htc sense no matter what i did i re-did clear cache and wipe to factory setting i'm still having issue with force close on htc sense.
[G1 Android Development] Daneshm90:
K did u use the. apks i sent or ones u did urself ? cuz ones i did were zipaligned so might b causing issues. Also post up ur log.
[G1 Android Development] puertoblack2003:
na i used yours.Next time i'll post the log i nandroid restore I'm using my personal phone...lol
[G1 Android Development] Daneshm90:
lol k. Yea zipalign might b causing those issues. k ill send up nonzipaligned to save u some work ;)
[G1 Android Development] Daneshm90:
Ok so here. Once again first try it without rss.apk,quicklookup.apk and com.htc.rss.jar.

It should boot without em, if it doesnt then add them.

Link
[G1 Android Development] puertoblack2003:
ok will do thanks :) i wonder if other dev had the same issue but doing it without the tool?
[G1 Android Development] Daneshm90:
It will be similar issues if any exist. Only things that could result in his being better/worse would be the compression level he used or the inclusion/exclusion of the apks/jars that i talked about previously.
[G1 Android Development] puertoblack2003:
ok buddy.I'm happy to say no force close on the htc sense. Everything appears to be working as it should.Good job.I hope you continue development to improve your app. :)
[G1 Android Development] tjohnsonjr:
Great Job!! I do have a question though. Everything works fine, my only question is if you have any idea why certain apks won't show up after everything is booted up?(i.e. Contacts.apk on a Sense Rom)
[G1 Android Development] Daneshm90:
Im confused. were those apks properly deodexed? So ur saying its in /system/app but doesn't show up in app drawer? if so then it prolly wasn't deodexed properly.
[G1 Android Development] tjohnsonjr:
Sorry. I'm deodexing a Sense Rom and I want add the Contacts.apk from a Stock Rom
[G1 Android Development] Daneshm90:
Im not sure if that's possible. Its tied to other apks/framework. ur best betis to adb push it to system/app and monitor the log to see whatits complaining about.
[G1 Android Development] tjohnsonjr:
I'll try that. Thanks
[G1 Android Development] puertoblack2003:
compression? what do you suggest to set it to.
[G1 Android Development] Daneshm90:
Ive never had trouble with 9 but its up 2 u. Certain apps dont like it, so to be safe go somewhere 5-7ish.
[G1 Android Development] puertoblack2003:
ok thanks!!! i ve having issue with force close and i'm trying to pin point which should be compress and which one dont...boy and i thought this was easy...hahahaha still love the app.:)
[G1 Android Development] sparksco:
The framework is a apk
[G1 Android Development] zach.xtr:
Customized ROM Deodexer if Helpful

Hey Daneshm90 thank you for this nice tool!

I started using this a while ago and have enhance/modified it to suit my needs on building ROMs and thought I would share back to you :D

* added a log file

* made it so that you can just add all /system/framework and /system/app files from your ROM and run

* added a ALPHA version of finding and resigning all apps in the ROM that have a Shared UserID so that you can fully customize them and rebuild and resign without signature compatibility issues (not sure if this works on all ROMs and is still experimental)

* updated menu

Feel free to use all or none of it and let me know of any questions you have.
[G1 Android Development] Daneshm90:
Cool ill take a look and incorporate wht i feel wont cause any conflicts. Oh and give credit ofcourse ;)
[G1 Android Development] Daneshm90:
zach.xtr, so far ive looked at how ur logging, its good but cud be more detailed. Refer to apk manager for wht im talking about. Instead of echoing just commands, u can actually log a whole batch file with all the errors/statements, by recursively calling itself. As for uid, i do like it, as its good for porting to other builds. Ill prolly implement something similar in apk manager, where u cud drop an apk and select "Port this apk" and id remove shared uid and resign.
[G1 Android Development] zach.xtr:
In my experiance this issue with the Contacts.apk is due to a shared UserID mismatch. Basically it was signed with a different sign key than the apps on your ROM that have the same Shared User ID and is ignored by the system... The way to fix is to resign ALL apk in your /system/app and /system/framework that have the same Shared UserID using the same sign key...

As it sounds this can get complicated but it can be worked out :)
[G1 Android Development] rfgamaral:
Tried your version to deodex everything (framework/apps) and to also sign every apk but when using the new files, I get stuck in a boot animation loop...

Any idea why?
[G1 Android Development] Daneshm90:
to my recollection those files have never been deodexed properly as they refer to classes that exist in cloud or wht not.

Turn ignore mode on when deodexing rss anything from a sense rom. Fyi the rom wud work fine without them.
[G1 Android Development] zach.xtr:
Based on my experiances it sounds like there are still some mis-matches in the Shared UserID's...

Things to try:

* review the logcat while booting up; if shared UserID's still exist you will get something like the following which should provide direction.

07-15 02:49:00.436: ERROR/PackageManager(179): Package com.android.launcher has no signatures that match those in shared user android.uid.shared; ignoring!

* Review and try resign apk files in the /system/framework folder if you have not already.

* Eventhough you probably already know, if you are not looking to modify the libs of the system apps or install apps with shared userIDs from other ROMs then there is no real value to resigning...

My simple code was built for the HTC Eris (Verizon) so I am not sure how it ports either... :rolleyes:

Hope this helps
[G1 Android Development] deficitism:
Hi there.

First off, thank you for developing these fantastic scripts.

I used the custom version (one page back), as it had the sense optimization settings. I have run into one small issue. I can get just about everything deodexed, with the exception of framework.jar/odex. (besides the rss stuff) Framework.jar/odex seems to be the only files remaining in the framework folder.

I have read and searched through this thread, and tried a couple of the tips provided to no avail.

Any ideas what I could be doing wrong here?

Thanks in advance.
[G1 Android Development] deficitism:
Figured it out. Had to modify the bat files slightly to force a 512mb java heap size. All is well now. I blame the filthy machine I'm working on.
[G1 Android Development] rfgamaral:
I finally fixed all my problems and was able to boot without any force closes. I didn't use any of these thread tools but the kitchen I talked about.

Anyway, here's what I did to successfully deodex my ROM using that kitchen:

Every "app" and "framework" file (.jar or .apk) was completetly deodex by using baksmali to extract the contents from the .odex file and then smali was used to compile the classes.dex file. Just like the scripts found on this thread.

The classes.dex file was

added

to the corresponding .jar/.apk file. This was key to the whole process. The .jar/.apk file was not extracted and re-archived, that seems to only cause problems. You basically want to leave the original file untouched and just add the classes.dex file into the .jar/.apk file.

All .apk files, the ones in "app" and "framework", were signed as to avoid any sharing uid issues.

All .apk files, the ones in "app" and "framework", were zipaligned. Although this step is optional. Android documentation suggest this for apps, so I've used it... It doesn't seem to cause any issues so far.

That's it...

I hope this info is helpful for any another people having problems deodexing a ROM.
[G1 Android Development] zach.xtr:
Thanks for the detailed feedback. Question for on resigning ALL .apk files, in my experimenting if I resigned an .apk that had the shared UserID of com.google.uid.shared the phone could no longer communicated directly with google (i.e. log into your google account, download apps from the market, etc)... these are listed below.

EnhancedGoogleSearchProvider

GoogleSettingsProvider

gtalkservice

TalkProvider

GoogleApps

GoogleContactsSyncAdapter

GmailProvider

Did you not have this issue?
[G1 Android Development] rfgamaral:
To be honest, I didn't even connect to my WiFi so I didn't try any of the default Google services. I was just trying to completely de-odex a ROM without causing boot loops or force closes.

I'll have to try that some other time...

But did you sign ALL files or just a few? If ALL .apk files were signed with the same key, than it should be ok. But I'm not really the person that knows how to answer that, I'm just assuming here.

EDIT:

Damn, you're right, I can't login now... But I don't understand why...

The files you mentioned above didn't have an .odex file in the first place, so they weren't deodexed nor they were signed. I extracted their contents from my ROM and from MoDaCo's ROM (which is deodexed and working) and compared both. The signature files (the ones inside the META-INF folder) are exactly the same...

I don't understand why it's not working...
[G1 Android Development] gerard_f:
I have this problem "java.lang.OutOfMemoryError: Java heap space" when deodex framework.jar. How to fix it?

Thanks.
[G1 Android Development] Daneshm90:
Edit the bat file and replace java -jar with java -Xmx512m -jar

So if ur deodexing with custom classpath, place that inside seojar/seoapk

if ur deodexing with standard classes, place that inside deojar/deoapk
[G1 Android Development] Daneshm90:
I know that all apks that share a uid must be signed with same signatures, but considering ur signing all the apks with the same keys and still are seeing force closes makes me think thats where the different types of key comes into play (platform keys, test keys etc...) and each have its own purpose without which the apks cannot communicate with google's server

Btw, when porting a *rom* no need to sign the apks, its only when ur porting an *app* that u need to because the data partition wont accept an apk where its digest doesnt correspond to its contents. For system apps, as long as the manifest abides by its digest inside the signature, core wont complain and wont give u any force-closes.
[G1 Android Development] gerard_f:
Thank you, trying now!

Edit: works perfect, thanks again.
[G1 Android Development] Nekromantik:
will this work to de-odex Sense 2.2 Desire ROM?

what classpath command do I need to give for framework
[G1 Android Development] Daneshm90:
it should do it w/o probs. the classpath check a few posts back. remember to doedex bluetooth.apk u need to include java.obex.jar in the classpath.
[G1 Android Development] VeeDubZ:
Exactly what .bat do you edit and where do you edit it for the froyo 2.2 sense rom????
[G1 Android Development] Daneshm90:
You dont have to edit anything. Just choose custom classpath and enter it inside the script.
[G1 Android Development] raiderep:
So I am trying to de-odex the system framework and apks for the Epic and have run into a problem. I got the framework jars all de-odexed and most of the apks but there are about 15 that are being a pain for me. Here is the error I am getting for one of them:

Desktop\newsmalis>java -Xmx512m -jar baksmali-1.2.4.jar -x Vid

eoPlayer.odex

Error occured while loading boot class path files. Aborting.

org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoundException: Could not find int

erface Lcom/sec/android/touchwiz/widget/TwSeekBar$OnTwSeekBarChangeListener;

at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadAllImplementedInte

rfaces(ClassPath.java:819)

at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<init>(ClassPath.java:

675)

at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef(ClassPath.java:280

)

at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:16

3)

at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPathFromOdex(Cla

ssPath.java:110)

at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:96)

at org.jf.baksmali.main.main(main.java:278)

Error while loading class Lcom/sec/android/app/videoplayer/activity/MoviePlayer$

28; from file VideoPlayer.odex

Error while loading ClassPath class Lcom/sec/android/app/videoplayer/activity/Mo

viePlayer$28;

I have searched high and low for help and have come up empty so far. I looked at the init.rc file and the 5 common jars are the only ones listed as far as bootclass path. Anyone got any tips or pointers, anything? All help would really be appreciated.
[G1 Android Development] Daneshm90:
Choose "custom classpath" and enter twframework
[G1 Android Development] raiderep:
Thanx for the VERY fast response! I tried that and it got a few more for me. I have five stubborn ones left now: BluetoothOPP,Camera,FactoryTest,MobileAP and TouchWizCalendar. I would have figured the twframework class addition would have got rid of all the touch wiz ones at least...thanx for trying to help. Any other ideas?
[G1 Android Development] Daneshm90:
honestly just try adding each .jar in the framework directory to the classpath. I've deodexed my stock galaxy s w/o problems.
[G1 Android Development] raiderep:
Will do, thanks again. I did try adding each one at a time to the file I have baksmali in and running the command manually earlier with no luck. You think the script will work better? Your first tip helped big time so I am hoping this one does as well.
[G1 Android Development] Daneshm90:
yea it should work.
[G1 Android Development] raiderep:
Sooooo close! That got three of them. I am left with BluetoothOPP and TouchWizCalendar. Isn't there a way to find the jar they call on? I have tried them both twice through one jar at a time and they won't budge! Thanks man :)
[G1 Android Development] Daneshm90:
Try the bluex jar or w/e its called for bluetooth. Most of the time in the error u can make out wht jar its looking for.
[G1 Android Development] raiderep:
Got it! I kept trying the jar names with and without the .jar and finally got them through. javax.obex.jar did the bluetooth one and the calendar one needed the google.maps.jar and twframework.jar together to get it. Thanx for the tips, now I need my phone and a working recovery to test it out, its not launched officially till tuesday but root has been obtained already :cool:

Thanx for a really nice tool :D

edit: I was wondering if you suggest zipaligning first and then optimizing or vice-versa? dohhh...I think these are one and the same, right?
[G1 Android Development] Dexter_nlb:
i notice zipalign removed in 2.3, so i think your question is no longer valid, as function is not there anymore..
[G1 Android Development] karnovaran:
Since there are virtually no developers working on the Droid 2, I may need to learn some things on my own. I'd like to create a black notification bar and pull-down and it seems the first step is deodexing the framework.apk and services.jar. I assume with the right commands this program will do that for me. Before I proceed, is there any reason this may not work with the Droid 2?
[G1 Android Development] Daneshm90:
Nope, 0 reasons it wouldnt. If u encounter class path errors its because propietary framework weren't included in the classpath. Heres wht i do to ensure maximum results :

Select option 2 and list all the jar's in ur framework folder. So

1.jar:2.jar:3.jar

Then you should get most of em deodexed fine.
[G1 Android Development] karnovaran:
Ok, I have about 40. Do all of them?
[G1 Android Development] Daneshm90:
Wait wht ? u sure ? so 40 .jar's (not odex) in /system/framework ?

Then screw it lol, just use option 1 and do option 2 for any tht complain.