yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] alkhafaf:
ok then.. please try the following:

1. open cmd.exe

2.paste the following code then press enter:

adb shell
su
grep " /system " /proc/mounts | awk '{system("mount -o rw,remount -t "$3" "$1" "$2)}'

then, if nothing appears, go on and try to run the odexer script...

if all that failed, go to recovery, then mount and storage, mount /system. After that run the script.
[Android Software/Hacking General [Developers Only]] M_J_Nazari:
Hi Alkhafaf, i think you followed this thread :D

[Toturial][Windows] How Editing The ODEX framework files? [Simplified]

at least you could create a link for your reference .

Thanks.
[Android Software/Hacking General [Developers Only]] alkhafaf:
Yeah bro.. I remember now...I just used the permissions and some little things from your thread... but surely not everything...

I forget to write the credit for it cuz I did it for mine since months and now I decided to make it as script..

There are some instructions for odexing here that u didn't refer to it... which is very important.. check the instructions (point no. 3)... I think u know it but forgot to write it in your thread..
[Android Software/Hacking General [Developers Only]] davidwilson83:
Nope, still not working. I tried both ways that you suggested and nothing.

Auto Odexer Script
Done by Alkhafaf. The odexing commands is posted by sicopat in xda forums.

remounting
List of devices attached
0019295d0b1c9e device

mount: permission denied (are you root?)
remount failed: Operation not permitted

Enter the name of the .apk file u want to odex (without .apk): Mms

sending dexopt-wrapper to the device
failed to copy 'dexopt-wrapper' to '/system/bin/dexopt-wrapper': Read-only file
system
Unable to chmod /system/bin/dexopt-wrapper: Read-only file system

sending the deodexed file to the device
failed to copy 'mod\Mms.apk' to '/system/app/Mms.apk': Read-only file system

Odexing the file:
Unable to create '/system/app/new_Mms.odex': Read-only file system

pushing the original files to the system
failed to copy 'original\Mms.apk' to '/system/app/Mms.apk': Read-only file syste
m
failed to copy 'original\Mms.odex' to '/system/app/Mms.odex': Read-only file sys
tem

Setting permissions..
Unable to chmod /system/app/Mms.odex: Read-only file system
Unable to chmod /system/app/Mms.apk: Read-only file system
Unable to chmod /system/app/new_Mms.odex: No such file or directory

copying signature from original file:
dd: can't open '/system/app/new_Mms.odex': Read-only file system

replacing with the new odex file
cp: can't stat '/system/app/new_Mms.odex': No such file or directory

settings permissions for the new odex file
Unable to chmod /system/app/Mms.odex: Read-only file system
Unable to chmod /system/app/Mms.odex: Read-only file system

deleting worked- on file
rm failed for /system/app/new_Mms.odex, No such file or directory

Finished

To odex a file again, press any key
To pull the apk file, press 1
To exit, press 0

I dunno why it's saying are you root? because I am definitely rooted. I installed BusyBox too. Very confused.
[Android Software/Hacking General [Developers Only]] alkhafaf:
Bro i think the problem is from u..:)

i did everything possible.. It should have worked with u from the first time with adb remount...

There is a problem with your root maybe.. Update the su binary from superuser app.
[Android Software/Hacking General [Developers Only]] davidwilson83:
But I don't see how it could be my phone. I have full root access. All of those root checker apps that you can get on the play store say I have full access to everything. I have busybox, dexopt wrapper, su binaries are up to date, superuser is up to date, there is no reason why it shouldn't work.

I'm really puzzled.
[Android Software/Hacking General [Developers Only]] alkhafaf:
Ask the developer of your kernel.. Tell him about the adb remount... It is not remounting..if u can not remount u can not push any files and can not do anything which change the file systems.

If u r using chanfire cf-root.. Ask him or post a qeustion in his thread.
[Android Software/Hacking General [Developers Only]] davidwilson83:
But it's a stock kernel, the way the phone came from Samsung. I have never changed the kernel.
[Android Software/Hacking General [Developers Only]] alkhafaf:
But u have rooted.. Then u should ask chainfire about this problem and how to solve, if u r using his cf-root.
[Android Software/Hacking General [Developers Only]] davidwilson83:
I'm not using CF-Root. I used this method which involves installing CWM as a zip file on an external SD card through stock recovery. Then when CWM boots, installing SuperUser.apk and su into /system/bin or xbin. Go have a read, it's pretty good. Could that have anything to do with it?
[Android Software/Hacking General [Developers Only]] alkhafaf:
yes, I think this could be the reason..

ok, did u try to go to cwm and run the script??

and why don't u try cf-root ?

u can post a question in that thread about this problem and if anyone else is facing it.

update: I already posted a question in that thread, and saw someone says that when rebooting, root is gone..

to check that rooting and su works:

1. open cmd and then connect the device

2. write this :

if the symbol # appears, then it's rooted.
[Android Software/Hacking General [Developers Only]] alkhafaf:
I just want someone to try it and tell me IT WORKS !!, and make me happy..:)
[Android Software/Hacking General [Developers Only]] davidwilson83:
Ok I'll test it when I get home from work. I don't lose root when I reboot. YEs I booted into CWM recovery and ran the script but still nothing.

I don't wanna try CF-Root because I like this method and I don't wanna flash an insecure kernel.

I'll let you know what the outcome is.

---------- Post added at 10:02 AM ---------- Previous post was at 10:01 AM ----------

I'm trying!!!
[Android Software/Hacking General [Developers Only]] varun.chitre15:
@OP

A suggestion over here

U should use following code to mount system as r/w

su -c busybox mount -o remount,rw /system

This is universal remounting code and will work for sure.
[Android Software/Hacking General [Developers Only]] davidwilson83:
Ok so I just type that command then run the script? Do I need to do anything else?

---------- Post added at 12:47 PM ---------- Previous post was at 12:38 PM ----------

C:\Users\Davey Annihilation\Desktop>adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
0019295d0b1c9e device

C:\Users\Davey Annihilation\Desktop>adb shell
shell@android:/ $ su
su
shell@android:/ #

There ya go, definitely rooted.
[Android Software/Hacking General [Developers Only]] varun.chitre15:
I meant that to OP.
[Android Software/Hacking General [Developers Only]] alkhafaf:
Ok then.. Did u try to type that line that Varun posted into cmd and then run the script?

type it like this:

adb shell

su

busybox mount -o remount,rw /system

then run the script.
[Android Software/Hacking General [Developers Only]] davidwilson83:
Yer I did, but it didn't do anything and the script still didn't work properly. I think varun.chitre15 intended you to include that in your script.
[Android Software/Hacking General [Developers Only]] alkhafaf:
thanks bro.

I tried to write it like this but it is wrong:

adb shell su -c busybox mount -o remount,rw /system

and tried using quotes, also doesn't work:

adb "shell su -c busybox mount -o remount,rw /system"
[Android Software/Hacking General [Developers Only]] alkhafaf:
Bro. I think I probably knew the solution... this time I feel it will work.

The solution is in this thread, read it and download the attachment and then install the app, then follow the instructions in the thread:

http://xdaforums.com/showthread.php?t=1687590

It looks that the problem is related to (adbd) in your case it is secure, cuz you r using a stock kernel..

ok bro, after u do install the app and enable adbd insecure, connect your device and run the script....

tell me when it works with u.
[Android Software/Hacking General [Developers Only]] davidwilson83:
You are great. That worked perfectly!!!! Sorry for all the problems but thanks for persisting and helping me.
[Android Software/Hacking General [Developers Only]] alkhafaf:
Waw.. Iam really happy that it worked with u. :D

welcome anytime :)

please rate this thread, if it doesn't deserve 5 stars, then don't rate it :P :D
[Android Software/Hacking General [Developers Only]] davidwilson83:
Done.

Thanks again for all your help and patience.
[Android Software/Hacking General [Developers Only]] pimpol10:
All I want is to odex a deodexed apk. I don't have the original file, but just a single apk that needs to be odex. Yes, I'm a noob to this and I'm confused..I am running a odex rom and would like to find out the easiest way to re-odex an apk for future uses. I don't need a script to install it on directly to my phone, but just place it on my computer and I can drag and drop it into my phone. Thanks!
[Android Software/Hacking General [Developers Only]] alkhafaf:
For the original apk, u need to take it from the rom u r using..

And this script does the odex operation inside the device, so new file will be automatically inside the system..

And u can use the script to pull the odexed apk after that.

Maybe the next release will offer the choice to odex without putting it in the system files..

Sent from tapatalk using sgs i9000

[ROM][GB][JW8] MesoROM v2.0 8/27/2012 Ultra Light-Smooth-Beauty

Google+
[Android Software/Hacking General [Developers Only]] pimpol10:
So the purpose of putting the original file in there is for adb to know what to replace it with? So do it actually take the apk and the odex file out (cut & paste) of the rom on currently running or do I just put a copy of each in original folder? Just tring to understand. Thanks for clearing thing up for me, I appreciate it ;)

Oh I also need help changing my bootclasspath..I'm still confused..
[Android Software/Hacking General [Developers Only]] alkhafaf:
No bro.. The original file is in the process of odexing.. And tue signature it taken from the original odex file and put in the new odex.

For more info check the thread by sicopat and m_jazari, i already provided links to thier thread in the op.

The bootclasspath can be known from file init.irc which is put in the root of your device... The bootclasspath is a group of files that is used for the odexing process, they r framework jar files.

Sent from tapatalk using sgs i9000

[ROM][GB][JW8] MesoROM v2.0 8/27/2012 Ultra Light-Smooth-Beauty

Google+
[Android Software/Hacking General [Developers Only]] davidwilson83:
This thread is on the portal!

Top work mate! Portal News Thread

:)
[Android Software/Hacking General [Developers Only]] alkhafaf:
Waaaaw.... omg... thanks for telling me.

This is a big surprise... :D

Sent from tapatalk using sgs i9000

[ROM][GB][JW8] MesoROM v2.0 8/27/2012 Ultra Light-Smooth-Beauty

Google+
[Android Software/Hacking General [Developers Only]] echoot:
can u make it for batch odex?
[Android Software/Hacking General [Developers Only]] alkhafaf:
There are already scripts which odex everything, Search the forums.

I made this cuz I didn't see someone who made odexing for single files, and it is useful for after release mods ( mod or theming ).

Sent from tapatalk using sgs i9000

[ROM][GB][JW8] MesoROM v2.0 8/27/2012 Ultra Light-Smooth-Beauty

Google+
[Android Software/Hacking General [Developers Only]] echoot:
but i din' find thread batch odex support for JB. maybe u can make an option for it. just sugestion. tanx. :D
[Android Software/Hacking General [Developers Only]] AceofSpades90:
Does this Odex framework AND apps?
[Android Software/Hacking General [Developers Only]] alkhafaf:
Yes. U choose any single file u want to odex... just follow the instructions.

Sent from tapatalk using sgs i9000

[ROM][GB][JW8] MesoROM v2.0 8/27/2012 Ultra Light-Smooth-Beauty

Google+
[Android Software/Hacking General [Developers Only]] alkhafaf:
Did u try them and didn't work ?

Sent from tapatalk using sgs i9000

[ROM][GB][JW8] MesoROM v2.0 8/27/2012 Ultra Light-Smooth-Beauty

Google+
[Android Software/Hacking General [Developers Only]] AceofSpades90:
Appreciate the fast response.

Please help me out on this, i'm following instructions and so far i understand i need to change my BOOTCLASSPATH for captivate. I found the BOOTCLASSPATH and now what i do? Modify the files i need to odex?

EDIT: Ok i re-read your post and it says to edit both bat files to whatever my BOOTCLASSPATH is.

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

So what should go under "Original", "Mod" and "pulled_files" folders? I am using a JellyBean compiled from Nexus/SGS sources... So it is deodex by nature? I have not modified those files... Ok i understand pulled_files is the files we pull after odexing but Original and Mod...

Also, im confused on this step from the thread you linked:

:/

Sorry for asking fundamental questions but the OP assume i know what these "Original" files are...
[Android Software/Hacking General [Developers Only]] alkhafaf:
Hey bro.

The odexing method works if your rom is already odex version.that's why this method is only for odexing single files..

If your rom is already odex, then take the file (example SystemUI.apk) with its .odex (SystemUI.odex) then put it in the original folder..

Then put the deodexed file (that u should deodexed from the original odex one) in the mod folder, then complete the instructions.

This odexing method is useful for who do theming and edit odexed apk files.

Edit: to easily know your bootclass path using adb:

Adb shell echo $BOOTCLASSPATH

Sent from tapatalk using sgs i9000

[ROM][GB][JW8] MesoROM v2.0 8/27/2012 Ultra Light-Smooth-Beauty

Google+
[Android Software/Hacking General [Developers Only]] AceofSpades90:
Oh ok thanks (:

Sorry for posting here, not what i was looking for...

Nice read though!
[Android Software/Hacking General [Developers Only]] graffixnyc:
I'm trying to reodex andoid.policy.jar.

I have the deodexed one with the mods (ext power) and I placed that into the mod folder, placed the original jar and odex in the original folder. I made sure my bootclasspath was correct (pulled it from the adb command in the op) but when I reboot I just get stuck at the boot logo.

Do I have to pull the classes.dex file from the modded and put it in the original?

The OP mentions the resource file, but no mention about the classes.dex file
[Android Software/Hacking General [Developers Only]] alkhafaf:
u should copy everything to original jar except the classes.dex, since classes.dex will be the new android.policy.odex !!!

anyway, did u try to make wipe cache and dalvik cache ?

If that won't work, please try the mod first on deodex rom (maybe u missed something). If you already have done that on deodex, then try to remove the android.policy from the bootclasspath and try again..

A little note: y dont u do the 4 way reboot menu mod, it is much easier :)
[Android Software/Hacking General [Developers Only]] graffixnyc:
The only changes are in the classes.dex file as its only smali code that was changed. So then I would leave the original as is correct?

What mod are you talking about? I only know how to do it in the smali in Android.policy(making changes to globalaction files)
[Android Software/Hacking General [Developers Only]] alkhafaf:
this one :

http://xdaforums.com/showthread.php?t=1573032

and yes, no need to copy anything, just odex the file..
[Android Software/Hacking General [Developers Only]] graffixnyc:
Yeah, that's how I did the mod. Editing the smali in Android.policy.jar.

Thanks I will keep messing with it until I can get it to work
[Android Software/Hacking General [Developers Only]] Andy5:
Can't get it to work. :mad:

Samsung Galaxy nexus, stock image, rooted.

Enabled adbd insecure, booted in recovery(TWRP).

Adb shell echo $BOOTCLASSPATH: /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar

First time I run the script, I got:

/sbin/sh: dexopt-wrapper: not found

So I changed line "adb shell dexopt-wrapper /system/framework/..." to "adb shell /system/bin/dexopt-wrapper /system/framework/..."

Second run was also unsuccessful:

Odexing the file:
--- BEGIN '/system/framework/services.jar' (bootstrap=0) ---
--- waiting for verify+opt, pid=186
--- would reduce privs here
link_image[1891]: 186 could not load needed library 'libssl.so' for '/system/b
in/dexopt' (reloc_library[1306]: 186 cannot locate 'pqueue_find'...
)CANNOT LINK EXECUTABLE
--- END '/system/framework/services.jar' --- status=0xff00, process failed

What is going wrong? Any idea?
[Android Software/Hacking General [Developers Only]] NmAa:
Odexing APK

Hi sir, i wanna know more about this, i have two apks on my system that i want to have odex, i have read about odex, but i really don't have any idea where or how to start making that .odex file for an apk.

details:

I have replaced two apks on my system/app (adw launcher and file manager) it comes with another file (.odex file) after each apk. I replace it with (holo launcher and OI file manager plus root explorer file manager) im worried that it might ruin things if i won't provide each file an odex file like the two apks ive remove from the system.. hope you can help me.. thanks...
[Android Software/Hacking General [Developers Only]] alkhafaf:
Hello dude

please remove your quote, u don't have to quote the first page.

Don't worry bro, u don't have to worry, they will work fine, as along as these are not originally system apks.
[Android Software/Hacking General [Developers Only]] he_stheone64:
Hi alkhafaf - I have tried odexing my modded android.policy.jar for Sense 4.+ JB ROM for One S. I have certainly adjusted the script with the correct bootsclasspath.

This is the output and pulling files gave only 1kb .odex plus jar. Obviouslx dexopt wrapper was not found. Do you have an idea, what went wrong? Thx

Manual odexer script
Done by Alkhafaf. The odexing commands is posted by sicopat in xda forums.

remounting
List of devices attached
HT23PW400982 recovery

remount succeeded

Enter the name of the .jar file u want to odex(without .jar): android.policy

sending dexopt-wrapper to the device
768 KB/s (5512 bytes in 0.007s)

sending the deodexed file to the device
3222 KB/s (165119 bytes in 0.050s)

Odexing the file:
/sbin/sh: dexopt-wrapper: not found

pushing the original files to the system
76 KB/s (313 bytes in 0.004s)
3451 KB/s (477488 bytes in 0.135s)

Setting permissions..
chmod: /system/framework/new_android.policy.odex: No such file or directory

copying signature from original file:
20+0 records in
20+0 records out
20 bytes (20B) copied, 0.002045 seconds, 9.5KB/s

replacing with the new odex file

settings permissions for the new odex file

deleting worked- on file

Finished

To odex a file again, press any key
To pull the jar file, press 1
To exit, press 0

1
3 KB/s (72 bytes in 0.020s)
101 KB/s (313 bytes in 0.003s)

To odex a file again, press any key
To pull the jar file, press 1
To exit, press 0
[Android Software/Hacking General [Developers Only]] alkhafaf:
I think this is a busybox problem. Like Andy5 's problem in the previous post. Which busybox version u r using ?
[Android Software/Hacking General [Developers Only]] he_stheone64:
It might be a kernel issue, since the new JB kernel prevents rw in live mode. I will push a new Kernel without RW protection, which is now available and see whether that helps.
[Android Software/Hacking General [Developers Only]] alkhafaf:
mm.

but dexopt-wrapper is already pushed, so it is written to your system.

anyway, try the new kernel and tell me if it works with u
[Android Software/Hacking General [Developers Only]] he_stheone64:
New Kernel didn`t help, dexopt-wrapper still can`t be found. One S system also does not have sbin path.

Odexing the file:
/sbin/sh: dexopt-wrapper: not found
[Android Software/Hacking General [Developers Only]] alkhafaf:
edit the following in the code ( right click on the .bat file for the jar and edit):

adb shell dexopt-wrapper /system/framework/%jarname%.jar /system/framework/new_%jarname%.odex

to

adb shell "cd /system/bin && ./dexopt-wrapper /system/framework/%jarname%.jar /system/framework/new_%jarname%.odex "

if it doesn't work, return your code to original and :

install busybox by stericson from play store

and choose to install in sbin

then try it.

tell me of it works or not.
[Android Software/Hacking General [Developers Only]] yogeshmha:
therez this deodexed files...

can you tell how to covert them to odex

http://xdaforums.com/showthread.php?t=1999125

this is the quick settings.. i want to convert this mod for odexed stock rom. how can we do that

i need a complete guide to do so
[Android Software/Hacking General [Developers Only]] alkhafaf:
I am sorry

But this thread covers a apk or jar which u should already deodexed, then use the tool to odex back after modding.
[Android Software/Hacking General [Developers Only]] alkhafaf:
A new version will be uploaded... Everything will be done automatically,

1. The bootclasspath is automatically done by requesting it from the device.

2. No more need to drag resources or and modified files to the original apk or jar, cuz this is done by the tool automatically...

Happy new year
[Android Software/Hacking General [Developers Only]] yogeshmha:
i didnt get you please explain..

how can i convert that to odex file usable for stock
[Android Software/Hacking General [Developers Only]] cyanoper:
will this work on CyanogenMod 10?
[Android Software/Hacking General [Developers Only]] davidwilson83:
I think what alkhafaf is saying is that to use this Auto Odexer Script, you need to have an odexed file, deodex it & make your mods, then use the script to re-odex it.

As the mod you are referring to is deodexed, there would not be an original instance of the odexed version of it, and as such the Auto Odexer Script will not work.

I'm pretty sure I explained that correctly.

---------- Post added at 06:04 PM ---------- Previous post was at 06:02 PM ----------

This is the same as what I just said above, all of the CyanogenMod roms are deodexed and there would not be an original odexed version which could be used, so I am guessing that the answer is no. Sorry dude.
[Android Software/Hacking General [Developers Only]] alkhafaf:
Thanks davy for your good explanation..

That was exactly what I meant :)

But, for the case of that mode for deodexed, u can odex it, after u get your original odex files and follow Tue instructions... But as that thread said, your ROM should be 100 percent aosp and not modified ( I am actually not sure if cm10 is aosp or not ????) ....

And about odexing for cm10, it would work if the ROM is odexed cm10. But is already mentioned that this tool is for odexing single files ( For themers and modders only).
[Android Software/Hacking General [Developers Only]] yogeshmha:
Fair enough

Thanks i wished i could do something for my thread ppls
[Android Software/Hacking General [Developers Only]] alkhafaf:
NEW VERSION RELEASED

Update (1/4/12) v2: All things automated, no need to edit the script for bootclasspath, and even no need to drag and drop the edited files from the modded apk or jar.