Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
M_J_Nazari
Old
(Last edited by M_J_Nazari; 20th April 2012 at 07:38 AM.)
#1  
M_J_Nazari's Avatar
Recognized Developer - OP
Thanks Meter 2128
Posts: 1,408
Join Date: Jul 2010
Location: Bushehr

 
DONATE TO ME
Thumbs up [Toturial][Windows] How Editing The ODEX framework files? [Simplified]

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, 648 views)
The Following 11 Users Say Thank You to M_J_Nazari For This Useful Post: [ Click to Expand ]
 
M_J_Nazari
Old
(Last edited by M_J_Nazari; 20th April 2012 at 01:28 AM.)
#2  
M_J_Nazari's Avatar
Recognized Developer - OP
Thanks Meter 2128
Posts: 1,408
Join Date: Jul 2010
Location: Bushehr

 
DONATE TO ME
Default 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
The Following 3 Users Say Thank You to M_J_Nazari For This Useful Post: [ Click to Expand ]
 
M_J_Nazari
Old
(Last edited by M_J_Nazari; 20th April 2012 at 01:05 AM.)
#3  
M_J_Nazari's Avatar
Recognized Developer - OP
Thanks Meter 2128
Posts: 1,408
Join Date: Jul 2010
Location: Bushehr

 
DONATE TO ME
Default 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
The Following 2 Users Say Thank You to M_J_Nazari For This Useful Post: [ Click to Expand ]
 
M_J_Nazari
Old
(Last edited by M_J_Nazari; 23rd April 2012 at 03:19 PM.)
#4  
M_J_Nazari's Avatar
Recognized Developer - OP
Thanks Meter 2128
Posts: 1,408
Join Date: Jul 2010
Location: Bushehr

 
DONATE TO ME
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.
The Following 3 Users Say Thank You to M_J_Nazari For This Useful Post: [ Click to Expand ]
 
ramanadodda
Old
#5  
Senior Member
Thanks Meter 44
Posts: 230
Join Date: May 2010
Location: Hyderabad
Excellent explanation!!! Thank you very much.
The Following User Says Thank You to ramanadodda For This Useful Post: [ Click to Expand ]
 
PoorCollegeGuy
Old
#6  
PoorCollegeGuy's Avatar
Retired News Writer
Thanks Meter 362
Posts: 2,442
Join Date: Dec 2011
Location: Columbus

 
DONATE TO ME
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.
"When an expert can be blinded by his own expertise when they're creating something simple and easy to use when in reality, its' a nightmare for the novice" - The new overly aggressive but strangely intelligence XDA TV guy.

^ remember that before you flame people for not understanding what you understand.
 
chils41
Old
#7  
chils41's Avatar
Senior Member
Thanks Meter 460
Posts: 1,581
Join Date: Mar 2009
Location: Champaign, IL

 
DONATE TO ME
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.
Not into Phones any more!
now into AirGuns!

zech out the AirGun Forum I am working on:

http://www.AmatureAirGunner.com/Forum
 
burakgon
Old
(Last edited by burakgon; 23rd April 2012 at 08:04 AM.)
#8  
burakgon's Avatar
Senior Member
Thanks Meter 3388
Posts: 2,884
Join Date: Oct 2010
Location: Bursa

 
DONATE TO ME
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
The Following User Says Thank You to burakgon For This Useful Post: [ Click to Expand ]
 
myn
Old
#9  
myn's Avatar
Elite Recognized Developer
Thanks Meter 3939
Posts: 2,612
Join Date: 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?
 
M_J_Nazari
Old
#10  
M_J_Nazari's Avatar
Recognized Developer - OP
Thanks Meter 2128
Posts: 1,408
Join Date: Jul 2010
Location: Bushehr

 
DONATE TO ME
Quote:
Originally Posted by myn View Post
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+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...