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

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

OP M_J_Nazari

20th April 2012, 01:43 AM   |  #1  
M_J_Nazari's Avatar
OP Recognized Developer
Bushehr
Thanks Meter: 2,551
 
1,531 posts
Join Date:Joined: Jul 2010
Donate to Me
More
Hi, This is a simple tutorial for someone that wants to working on ODEX structure.

All needed files are attached, you don't need to download anything files.
Extract the Amestris_ODEX.zip file, your working folder will be this one.



I'm creating the simple example here.
for example i want to edit the services.jar file on ODEX structure.


We need to work on DEODEX version at first.

You can Deodex your files from here:
Quote:

The Best solution is here , Android Kitchen by dsixda user.
[KITCHEN] Android Kitchen, v0.192 [Linux / Mac / Windows]

Your Phone needs to be rooted and Busybox get installed.

the sample file is services.jar,also you can do it for any odex file.

1- Do all your editing and working on your deodex version.
2- Create this folders on your sd-card partition.
Code:
amestris_mod
amestris_original
3- Copy your modded file [your deodexed and edited services.jar] into amestris_mod folder.
4- Copy original jar file into amestris_original folder. [original odex services.jar]
5-Copy dexopt-wrapper into /system/bin folder and give full permission to that. [the simple way is root explorer ]

through the adb command:
Run the Amestris.bat file.
Code:
adb remount
adb push dexopt-wrapper /system/bin/dexopt-wrapper
adb shell chown 777 /system/bin/dexopt-wrapper
adb shell chmod 777 /system/bin/dexopt-wrapper
6-run this adb commands.
Code:
adb shell

cp /sdcard/amestris_mod/services.jar /system/framework/services.jar

dexopt-wrapper /system/framework/services.jar /system/framework/new_services.odex /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar

cp -f /sdcard/amestris_original/services.jar /system/framework

chmod 777 /system/framework/services.odex
chmod 777 /system/framework/services.jar
chmod 777 /system/framework/new_services.odex

busybox dd if=/system/framework/services.odex of=/system/framework/new_services.odex bs=1 count=20 skip=52 seek=52 conv=notrunc

cp /system/framework/new_services.odex /system/framework/services.odex

chmod 644 /system/framework/services.odex
chown root.root /system/framework/services.odex
rm /system/framework/new_services.odex

reboot
Credits:
Quote:

M_J_Nazari
sicopat
jubeh
Decad3nce
software_samurai

Attached Files
File Type: zip Amestris_ODEX.zip - [Click for QR Code] (286.1 KB, 1251 views)
Last edited by M_J_Nazari; 20th April 2012 at 08:38 AM.
The Following 13 Users Say Thank You to M_J_Nazari For This Useful Post: [ View ]
20th April 2012, 01:51 AM   |  #2  
M_J_Nazari's Avatar
OP Recognized Developer
Bushehr
Thanks Meter: 2,551
 
1,531 posts
Join Date:Joined: Jul 2010
Donate to Me
More
Android.policy.jar
This is a Sample for android.policy.jar

Run Amestris.bat file and run this commands here
Code:
adb remount
adb shell
cp /sdcard/amestris_mod/android.policy.jar /system/framework/android.policy.jar

dexopt-wrapper /system/framework/android.policy.jar /system/framework/new_android.policy.odex /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar

cp -f /sdcard/amestris_original/android.policy.jar /system/framework

chmod 777 /system/framework/android.policy.odex

chmod 777 /system/framework/new_android.policy.odex

busybox dd if=/system/framework/android.policy.odex of=/system/framework/new_android.policy.odex bs=1 count=20 skip=52 seek=52 conv=notrunc

cp /system/framework/new_android.policy.odex /system/framework/android.policy.odex

chmod 777 /system/framework/android.policy.odex
chown root.root /system/framework/android.policy.odex
rm /system/framework/new_android.policy.odex

reboot
Last edited by M_J_Nazari; 20th April 2012 at 02:28 AM.
The Following 4 Users Say Thank You to M_J_Nazari For This Useful Post: [ View ]
20th April 2012, 01:58 AM   |  #3  
M_J_Nazari's Avatar
OP Recognized Developer
Bushehr
Thanks Meter: 2,551
 
1,531 posts
Join Date:Joined: Jul 2010
Donate to Me
More
This is a Sample for framework.jar
The framework.jar or frameowrk.odex file is very sensitive and vital file for android.
some changes of this file will turn your phone into force close messages.

but i create a sample for this file;

do it like below:
Run Amestris.bat file and type this commands.
Code:
adb remount
adb shell
cp /sdcard/amestris_mod/framework.jar /system/framework/framework.jar
dexopt-wrapper /system/framework/framework.jar /system/framework/new_framework.odex /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar
cp -f /sdcard/amestris_original/framework.jar /system/framework
chmod 777 /system/framework/framework.odex
chmod 777 /system/framework/framework.jar
chmod 777 /system/framework/new_framework.odex
busybox dd if=/system/framework/framework.odex of=/system/framework/new_framework.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
cp /system/framework/new_framework.odex /system/framework/framework.odex
chmod 777 /system/framework/framework.odex
chown root.root /system/framework/framework.odex
rm /system/framework/new_framework.odex
reboot
Last edited by M_J_Nazari; 20th April 2012 at 02:05 AM.
The Following 3 Users Say Thank You to M_J_Nazari For This Useful Post: [ View ]
20th April 2012, 02:01 AM   |  #4  
M_J_Nazari's Avatar
OP Recognized Developer
Bushehr
Thanks Meter: 2,551
 
1,531 posts
Join Date:Joined: Jul 2010
Donate to Me
More
1: Q: When i use the cp command , the error shows with " cp: not found " message
A: try to use " busybox cp" instead the " cp " command.
Last edited by M_J_Nazari; 23rd April 2012 at 04:19 PM.
The Following 3 Users Say Thank You to M_J_Nazari For This Useful Post: [ View ]
20th April 2012, 02:19 AM   |  #5  
Senior Member
Flag Hyderabad
Thanks Meter: 54
 
239 posts
Join Date:Joined: May 2010
More
Excellent explanation!!! Thank you very much.
The Following User Says Thank You to ramanadodda For This Useful Post: [ View ]
22nd April 2012, 06:42 PM   |  #6  
Account currently disabled
Flag Columbus
Thanks Meter: 364
 
2,440 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Hey there, i saw this guide and really liked it, so I wrote about it on the XDA Portal

here's the link!

http://www.xda-developers.com/androi...amework-files/

i hope you enjoy the write up.
22nd April 2012, 09:21 PM   |  #7  
chils41's Avatar
Senior Member
Flag Champaign, IL
Thanks Meter: 460
 
1,585 posts
Join Date:Joined: Mar 2009
Donate to Me
More
Thumbs up
Thank you so much all you guys.

now lets see if i can use this to port SMemo to imilka's CM9 or AOSP

thnx.
23rd April 2012, 09:02 AM   |  #8  
burakgon's Avatar
Senior Member
Flag Bursa
Thanks Meter: 3,770
 
2,963 posts
Join Date:Joined: Oct 2010
Donate to Me
More
You can do same on linux. Smali is cross platform. Just needs java. I added deoxt wrapper on my ROM's for who want to do it easily.

Sent from my GT-I9000 using Tapatalk 2 Beta-6
Last edited by burakgon; 23rd April 2012 at 09:04 AM.
The Following User Says Thank You to burakgon For This Useful Post: [ View ]
23rd April 2012, 05:54 PM   |  #9  
myn's Avatar
Senior Recognized Developer
Thanks Meter: 4,002
 
2,658 posts
Join Date:Joined: Nov 2007
Donate to Me
Great write up.

Does this method also remove the classes.dex file that is found in apks since it is now housed as a seperate .odex file?
24th April 2012, 12:50 PM   |  #10  
M_J_Nazari's Avatar
OP Recognized Developer
Bushehr
Thanks Meter: 2,551
 
1,531 posts
Join Date:Joined: Jul 2010
Donate to Me
More
Quote:
Originally Posted by myn

Great write up.

Does this method also remove the classes.dex file that is found in apks since it is now housed as a seperate .odex file?

This method doesn't remove anything. this is a method for replacing [editing] odex files.

if you want to convert the apk files to odex structure you need to check the Amestris Odexer Script v1.2.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes