Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[UTIL][22/2/13]Auto Odexer Script V2.1-Mod your odex files with a breeze

OP alkhafaf

10th September 2012, 04:27 AM   |  #1  
alkhafaf's Avatar
OP Senior Member
Thanks Meter: 637
 
1,080 posts
Join Date:Joined: Apr 2012
Donate to Me
NEW VERSION 2.1, it is now much easier and like a breeze...


Before u read, u should know that this thread is for themers and modders only... and this is not a tool for odexing the whole ROM.


Hello everybody
While I was working on my ROM, and releasing an odex version, I suffered alot in working on the odex files and modifying them. Every time I should use the command line and copy certain commands from a notepad, in addition I have to edit the notepad file to make the commands odex other files... that was a pain...

ok.. the odex commands that were used are taken from this thread by sicopat, big thanks to his efforts. Actually I was thinking in how to make it easier for me to odex these modified files, so I tried to make a script that easily odex files, put the files in the right folder, run the script, and then write the name of the file u want to odex, then..... Waw the file is odexed in the phone and ready to run

For anyone that want to use these scripts, I wanted to share it with you, and I hope they would be useful to you.

Update (2/22/13) v2.1:
1. bootclasspath should be put manually from now, because $BOOTCLASSPATH doesn't work when no root in recovery.
2. Fixed a mistake in extracting and archiving files, now it's ok.
3. Now you can restore the original files if you like after odexing.
4. 7zip 32 bit is used instead of 64 bit, sorry for this, now it should work with 32 bit windows too.
5. Script re-arranged, and 7zip log operations saved in 7z_log.txt. you can check this one if you suspect in 7zip operation.
6. Backup of the original files before odexing and restore them after odexing.

Update (1/4/13) 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.

Update (9/20/12) v1.4: remount using busybox, this solves some remounting problems.

update (9/18/12) v1.3: adb added to the program, to make it work independently. And now you can pull the files after odexing if u need that.

update (9/10/12) v1.2: updated and added a missed command, it should works perfect. No need to put any files in your sdcard to make the operations... and the operations are commented so you can diagnose the problem if occurred.

download from here


Before you use, make sure u r running the corresponding odex rom in your device, then read how to use this tool.

How to use:
first extract the downloaded file to a folder then:
1. Put your bootclasspath in bootclasspath.txt (follow the instruction below in Important Note 2).
2. Put the original odex and apk (or jar) file in the "original" folder.
3. Put your modded deodexed apk (or jar) file in the "mod" folder
4. Connect your phone with usb and make sure adb is working. ( and don't forget to check the USB Debugging in the settings of your device).
5. It is better that you boot in recovery mod, specially when odexing framework files.
6. Now run the script (.bat file), choose the one for apk or for the jar, according to file you want to odex.
7. after the script opens, write the name of the apk (or jar) file without the .apk (or .jar)
8. Odexing......done.
9. after finishing odexing, u can pull the odexed apk or jar file by pressing 1 then Enter, the it will be pulled in the (pulled_files) folder. Or if you want to restore the original apk (or jar) file with its odex, then press 2.

If you find this thread useful, pressing the thanks button is appreciated.


Important note: If you r using a rooted stock kernel, then u could face problem in remounting, hence a problem in the script. To solve this problem check this post.

Important note 2:To get Your BOOTCLASSPATH:
1. In adb:
adb devices
adb remount
adb shell echo $BOOTCLASSPATH

after that, you can right click and choose (mark), then mark the bootclasspath then press (enter) now you have copied the bootclasspath. go to bootclasspath.txt in the extracted folder of the script, then paste the bootclasspath and save the file.


OR

2. In the root of your device, in the init.rc file:

look for a line with (bootclasspath= ), then copy everything on the right hand of the equal mark. Go to bootclasspath.txt then paste it there, then save the file.

screenshot:




Credit:
Sicopat- for his guide on odexing.
M_j_Nazari- for his guide on odexing and his written commands for the odexing operation. thread link
Last edited by alkhafaf; 22nd February 2013 at 08:50 PM.
The Following 44 Users Say Thank You to alkhafaf For This Useful Post: [ View ]
18th September 2012, 12:47 AM   |  #2  
daveyannihilation's Avatar
Recognized Contributor / Themer
Flag Perth
Thanks Meter: 5,443
 
2,642 posts
Join Date:Joined: Apr 2012
Donate to Me
More
I keep getting this error when trying to use your script. Help please?

Code:
remounting
'adb' is not recognized as an internal or external command,
operable program or batch file.
The Following User Says Thank You to daveyannihilation For This Useful Post: [ View ]
18th September 2012, 05:05 AM   |  #3  
alkhafaf's Avatar
OP Senior Member
Thanks Meter: 637
 
1,080 posts
Join Date:Joined: Apr 2012
Donate to Me
Quote:
Originally Posted by daveyannihilation

I keep getting this error when trying to use your script. Help please?

Code:
remounting
'adb' is not recognized as an internal or external command,
operable program or batch file.

This happened cuz u didn't add the adb directory to the system variables...
Anyway I updated it and it should work now without doing that...please try it and give me a feedback..
The Following 2 Users Say Thank You to alkhafaf For This Useful Post: [ View ]
18th September 2012, 05:25 AM   |  #4  
daveyannihilation's Avatar
Recognized Contributor / Themer
Flag Perth
Thanks Meter: 5,443
 
2,642 posts
Join Date:Joined: Apr 2012
Donate to Me
More
Quote:
Originally Posted by alkhafaf

This happened cuz u didn't add the adb directory to the system variables...
Anyway I updated it and it should work now without doing that...please try it and give me a feedback..

Ok mate. I'll download it and try it when I get home. Just for future reference though, how do I add the ADB directory to system variables??
The Following User Says Thank You to daveyannihilation For This Useful Post: [ View ]
18th September 2012, 05:51 AM   |  #5  
alkhafaf's Avatar
OP Senior Member
Thanks Meter: 637
 
1,080 posts
Join Date:Joined: Apr 2012
Donate to Me
Quote:
Originally Posted by daveyannihilation

Ok mate. I'll download it and try it when I get home. Just for future reference though, how do I add the ADB directory to system variables??

Go to my computer,then properties, in advanced there is Environment Variables, press it .. then in system variables add the (path) and write the directory that leads to the adb that u have when u installed android development tools ( it should be in platform-tools folder).

Try odexer first before doing that I can not try it cuz I don't know who to delete the adb from the system variables

Sent from tapatalk using sgs i9000

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

Google+
Last edited by alkhafaf; 18th September 2012 at 05:55 AM.
The Following 2 Users Say Thank You to alkhafaf For This Useful Post: [ View ]
18th September 2012, 05:59 AM   |  #6  
daveyannihilation's Avatar
Recognized Contributor / Themer
Flag Perth
Thanks Meter: 5,443
 
2,642 posts
Join Date:Joined: Apr 2012
Donate to Me
More
Quote:
Originally Posted by alkhafaf

Go to my computer,then properties, in advanced there is Environment Variables, press it .. then in system variables add the (path) and write the directory that leads to the adb that u have when u installed android development tools ( it should be in platform-tools folder).

Try odexer first before doing that I can not try it cuz I don't know who to delete the adb from the system variables

Sent from tapatalk using sgs i9000

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

Google+

Will do when I get home from work mate. So in about 6 hours. But who's counting? :P
18th September 2012, 06:05 AM   |  #7  
alkhafaf's Avatar
OP Senior Member
Thanks Meter: 637
 
1,080 posts
Join Date:Joined: Apr 2012
Donate to Me
Quote:
Originally Posted by daveyannihilation

Will do when I get home from work mate. So in about 6 hours. But who's counting? :P

Lol.. of course not.. cuz I will sleep now... its 6 am here and didn't sleep yet... and you r living the new day


Sent from tapatalk using sgs i9000

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

Google+
The Following User Says Thank You to alkhafaf For This Useful Post: [ View ]
18th September 2012, 03:03 PM   |  #8  
daveyannihilation's Avatar
Recognized Contributor / Themer
Flag Perth
Thanks Meter: 5,443
 
2,642 posts
Join Date:Joined: Apr 2012
Donate to Me
More
Quote:
Originally Posted by alkhafaf

Lol.. of course not.. cuz I will sleep now... its 6 am here and didn't sleep yet... and you r living the new day


Sent from tapatalk using sgs i9000

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

Google+

Ok I tried it and it didn't work properly.

Code:
remounting
adb server is out of date.  killing...
* daemon started successfully *
List of devices attached
0019295d0b1c9e  device

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

No error found

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:
/system/bin/sh: busybox: cannot execute - Permission denied

replacing with the new odex file
/system/bin/sh: cp: not found

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
That's the error I keep getting. What does it mean? Am I doing something wrong?
18th September 2012, 03:52 PM   |  #9  
blahbl4hblah's Avatar
Recognized Developer
Flag Los Angeles, CA
Thanks Meter: 1,623
 
5,584 posts
Join Date:Joined: Oct 2010
Donate to Me
More
Quote:
Originally Posted by daveyannihilation

Ok I tried it and it didn't work properly.

Code:
remounting
adb server is out of date.  killing...
* daemon started successfully *
List of devices attached
0019295d0b1c9e  device

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

No error found

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:
/system/bin/sh: busybox: cannot execute - Permission denied

replacing with the new odex file
/system/bin/sh: cp: not found

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
That's the error I keep getting. What does it mean? Am I doing something wrong?

That's because your system isn't being set to read write. And it looks like your using an old adb

Sent from my Sensation
18th September 2012, 04:22 PM   |  #10  
daveyannihilation's Avatar
Recognized Contributor / Themer
Flag Perth
Thanks Meter: 5,443
 
2,642 posts
Join Date:Joined: Apr 2012
Donate to Me
More
Quote:
Originally Posted by blahbl4hblah

That's because your system isn't being set to read write. And it looks like your using an old adb

Sent from my Sensation

Ok then. Is there a way of setting my file system to read write? And do I just need to update the SDK via Eclipse to get a newer version of adb??

Post Reply Subscribe to Thread

Tags
auto, easy, odex, reodex
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes