[GUIDE]How to port miui for epic. - Epic 4G Android Development

My epic was lost,so I cannt continue to work for it.
Now i make a porting guide for you.You can continue to work for it based on the present build.It may need more additional works in the furture if the cm7 fixes others things.
1. Download miui_port_ns.zip and ns (or ns 4g,or others)miui rom from miui.us.
miui_port_ns.zip contains some files come from cm7 and EH17. What we need to do is that replace some files of miui.us latest rom with miui_port_ns's ones.
2. Extract miui_port_ns.zip to “miui_port_ns”.
3. Extract the ns(or ns 4g)miui rom to a new folder,then rename it “miui_epic”.
4. cd into “miui_epic”,delete all folders and files except “system” folder.(In the future,if our cm7 support mtd,you may need reserve some related files)
5. copy kernel_update/ and META-INF/ folders to “miui_epic”
6. cd into “miui_epic/system/vendor”
(1) delete bin/pvrsrvinit
(2) delete etc/
(3) cut and replace lib/ to system/lib/
7. cd into “miui_epic/system/lib”,delete egl/ and hw/ folders.
8. Cd into “miui_epic/system/app”,delete Nfc.apk and Tag.apk(nfc related).
9. Copy and replace “miui_port_ns/system/” to “miui_epic/system/”.
10. Modify build version in miui_epic/system/buid.prop.
11. Modify system/framework/ framework.jar to enable data:
(1) Smali framework.jar: apktool d framework.jar
(2) Copy and replace “miui_port_ns/framework.jar/com” to “framework.jar.out/smali/com”
(3) Baksmali framework.jar: apktool b framework.jar.out
(4) Copy and replace framework.jar.out/dist/ framework.jar to miui_epic/system/framework/
12. Modify system/framework/ framework-res.apk to remove “Roaming Indicator” chars:
(1) apktool d framework-res.apk
(2) Cd into framework-res/res,open strings.xml in “values”,” values-en-rUS”,” values-zh-rCN”,search for “roamingText1”,set value null,then save them.
(3) apktool b framework-res
(4) Replace miui_epic/system/framework/ framework-res.apk’s resources.arsc with framework-res/build/apk/resources.arsc.
13. The last step:cd into miui_epic,zip “kernel_update”,” META-INF” and ” system” to a zip file.You also can sign it(not have to).Then flash it!
Thanks:EpicCM team,xboxfanj and and many other contributors.

bxfxf said:
My epic was lost,so I cannt continue to work for it.
Now i make a porting guide for you.You can continue to work for it based on the present build.It may need more additional works in the furture if the cm7 fixes others things.
1. Download miui_port_ns.zip and ns (or ns 4g,or others)miui rom from miui.us.
2. Extract miui_port_ns.zip to “miui_port_ns”.
3. Extract the ns(or ns 4g)miui rom to a new folder,then rename it “miui_epic”.
4. cd into “miui_epic”,delete all folders and files except “system” folder.(In the future,if our cm7 support mtd,you may need reserve some related files)
5. copy kernel_update/ and META-INF/ folders to “miui_epic”
6. cd into “miui_epic/system/vendor”
(1) delete bin/pvrsrvinit
(2) delete etc/
(3) cut and replace lib/ to system/lib/
7. cd into “miui_epic/system/lib”,delete egl/ and hw/ folders.
8. Cd into “miui_epic/system/app”,delete Nfc.apk and Tag.apk(nfc related).
9. Copy and replace “miui_port_ns/system/” to “miui_epic/system/”.
10. Modify build version in miui_epic/system/buid.prop.
11. Modify system/framework/ framework.jar to enable data:
(1) Smali framework.jar: apktool d framework.jar
(2) Copy and replace “miui_port_ns/framework.jar/com” to “framework.jar.out/smali/com”
(3) Baksmali framework.jar: apktool b framework.jar.out
(4) Copy and replace framework.jar.out/dist/ framework.jar to miui_epic/system/framework/
12. Modify system/framework/ framework-res.apk to remove “Roaming Indicator” chars:
(1) apktool d framework-res.apk
(2) Cd into framework-res/res,open strings.xml in “values”,” values-en-rUS”,” values-zh-rCN”,search for “roamingText1”,set value null,then save them.
(3) apktool b framework-res
(4) Replace miui_epic/system/framework/ framework-res.apk’s resources.arsc with framework-res/build/apk/resources.arsc.
13. The last step:cd into miui_epic,zip “kernel_update”,” META-INF” and ” system” to a zip file.You also can sign it(not have to).Then flash it!
Thanks:EpicCM team,xboxfanj and and many other contributors.
Click to expand...
Click to collapse
Awesome! Sorry to hear about your epic though. Thanks for the work you've put into it, and thanks for the future work that this will inspire.

Thanks for this. Maybe more devs can jump on this. Think we seen many modified touchwiz roms!!
Sent from my SPH-D700 using Tapatalk

Thank you bxfxf. I'll miss you.
Sent from my SPH-D700 using Tapatalk

I hope other dev's pick this up! I love this ROM! I hope it does die!
Thank you so much for your work! You've done a hell of a job!

bxfxf said:
My epic was lost,so I cannt continue to work for it.
Now i make a porting guide for you.You can continue to work for it based on the present build.It may need more additional works in the furture if the cm7 fixes others things.
Click to expand...
Click to collapse
Thank you for all of your hard work and for these wonderful instructions!
joshts0 said:
I hope other dev's pick this up! I love this ROM! I hope it does die!
Thank you so much for your work! You've done a hell of a job!
Click to expand...
Click to collapse
Lol... just going to let you know.. you said you hope the rom does die

I'm pretty sure yall knew someone was gonna ask this sooner or later..
but, is there anyway a flashable version of this can be uploaded..
becasue I dont know what..
"cd into" means (maybe copy directory.. but I dont think thats right..)
"Smali" means..
"Baksmali" means..
"apktool b framework-res" mean..
pretty much im lost after step 3. "Extract the ns(or ns 4g)miui rom to a new folder,then rename it “miui_epic”."
I dont mind doing it myself and learning.. So maybe a link to a video that goes thru the steps..

bigdreco said:
I'm pretty sure yall knew someone was gonna ask this sooner or later..
but, is there anyway a flashable version of this can be uploaded..
becasue I dont know what..
"cd into" means (maybe copy directory.. but I dont think thats right..)
"Smali" means..
"Baksmali" means..
"apktool b framework-res" mean..
pretty much im lost after step 3. "Extract the ns(or ns 4g)miui rom to a new folder,then rename it “miui_epic”."
I dont mind doing it myself and learning.. So maybe a link to a video that goes thru the steps..
Click to expand...
Click to collapse
These are commands that need to be run
"Cd" means change directory, move to folder etc.
"Smali" and "baksmali" are used to decompile and compile .jars basically.
And "apktool d framework-res.apk" will decompile the framework-res.apk.
If I'm wrong correct me please
Sent from my Samsung Legen-wait for it-dary! 4g

bigdreco said:
I'm pretty sure yall knew someone was gonna ask this sooner or later..
but, is there anyway a flashable version of this can be uploaded..
becasue I dont know what..
"cd into" means (maybe copy directory.. but I dont think thats right..)
"Smali" means..
"Baksmali" means..
"apktool b framework-res" mean..
pretty much im lost after step 3. "Extract the ns(or ns 4g)miui rom to a new folder,then rename it “miui_epic”."
I dont mind doing it myself and learning.. So maybe a link to a video that goes thru the steps..
Click to expand...
Click to collapse
If i understand what you are saying correctly...
A flashable version has been posted for a while: here
These instructions are for developers to be able to take the latest version as MIUI is updated and recompile it so that we have the latest version of MIUI available for our phones.

Death259 said:
If i understand what you are saying correctly...
A flashable version has been posted for a while: here
These instructions are for developers to be able to take the latest version as MIUI is updated and recompile it so that we have the latest version of MIUI available for our phones.
Click to expand...
Click to collapse
Yea.. that is the version that I was using for about a week, up till today..
but as I was reading the instructions from this one.. I noticed that it compiles files from miui_port_ns.zip with files from miui.us.. and I know miui.us is the "american version".. so I figured that it would take away most of the Japanese language/apps that I don't understand..

So, maybe this is a dumb question...
But aren't steps 6-8 irrelevant, if you proceed with step 9?

ac16313 said:
These are commands that need to be run
"Cd" means change directory, move to folder etc.
"Smali" and "baksmali" are used to decompile and compile .jars basically.
And "apktool d framework-res.apk" will decompile the framework-res.apk.
If I'm wrong correct me please
Sent from my Samsung Legen-wait for it-dary! 4g
Click to expand...
Click to collapse
yea,you are right!
I am sorry my english is poor,these instructions may have some grammar errors.

Should the step 12(4) comes before 12(3)?
Sent from my SPH-D700 using Tapatalk

hienkhieu said:
Should the step 12(4) comes before 12(3)?
Sent from my SPH-D700 using Tapatalk
Click to expand...
Click to collapse
No.Should do "apktool b framework-res" first,then you can get the new file "resources.arsc" in framework-res/build/apk/ ,then put it in the original framework-res.apk.

bigdreco said:
Yea.. that is the version that I was using for about a week, up till today..
but as I was reading the instructions from this one.. I noticed that it compiles files from miui_port_ns.zip with files from miui.us.. and I know miui.us is the "american version".. so I figured that it would take away most of the Japanese language/apps that I don't understand..
Click to expand...
Click to collapse
Lol... that was a one time messup. You just got lucky with the one you tried Everyone other version i have used doesn't have the language issue.

Death259 said:
Lol... that was a one time messup. You just got lucky with the one you tried Everyone other version i have used doesn't have the language issue.
Click to expand...
Click to collapse
OHHH.. OK..well imma upgrade to the new version that was posted yesterday 11/17/2011 and see how it works out for me.. thanks!!

bxfxf said:
My epic was lost,so I cannt continue to work for it.
Now i make a porting guide for you.You can continue to work for it based on the present build.It may need more additional works in the furture if the cm7 fixes others things.
1. Download miui_port_ns.zip and ns (or ns 4g,or others)miui rom from miui.us.
miui_port_ns.zip contains some files come from cm7 and EH17. What we need to do is that replace some files of miui.us latest rom with miui_port_ns's ones.
2. Extract miui_port_ns.zip to “miui_port_ns”.
3. Extract the ns(or ns 4g)miui rom to a new folder,then rename it “miui_epic”.
4. cd into “miui_epic”,delete all folders and files except “system” folder.(In the future,if our cm7 support mtd,you may need reserve some related files)
5. copy kernel_update/ and META-INF/ folders to “miui_epic”
6. cd into “miui_epic/system/vendor”
(1) delete bin/pvrsrvinit
(2) delete etc/
(3) cut and replace lib/ to system/lib/
7. cd into “miui_epic/system/lib”,delete egl/ and hw/ folders.
8. Cd into “miui_epic/system/app”,delete Nfc.apk and Tag.apk(nfc related).
9. Copy and replace “miui_port_ns/system/” to “miui_epic/system/”.
10. Modify build version in miui_epic/system/buid.prop.
11. Modify system/framework/ framework.jar to enable data:
(1) Smali framework.jar: apktool d framework.jar
(2) Copy and replace “miui_port_ns/framework.jar/com” to “framework.jar.out/smali/com”
(3) Baksmali framework.jar: apktool b framework.jar.out
(4) Copy and replace framework.jar.out/dist/ framework.jar to miui_epic/system/framework/
12. Modify system/framework/ framework-res.apk to remove “Roaming Indicator” chars:
(1) apktool d framework-res.apk
(2) Cd into framework-res/res,open strings.xml in “values”,” values-en-rUS”,” values-zh-rCN”,search for “roamingText1”,set value null,then save them.
(3) apktool b framework-res
(4) Replace miui_epic/system/framework/ framework-res.apk’s resources.arsc with framework-res/build/apk/resources.arsc.
13. The last step:cd into miui_epic,zip “kernel_update”,” META-INF” and ” system” to a zip file.You also can sign it(not have to).Then flash it!
Thanks:EpicCM team,xboxfanj and and many other contributors.
Click to expand...
Click to collapse
I started last night on making a GUI that will automate this process. Basically all that will need to be done is the downloading of a new version whenever it comes out. I'm thinking the baksmali/smali stuff will cause an issue, and might not be able to be automated, and if that's the case, then i will just do as much automation as i can.
One question though... is this the smali/baksmali tool everyone is using?

Death259 said:
I started last night on making a GUI that will automate this process. Basically all that will need to be done is the downloading of a new version whenever it comes out. I'm thinking the baksmali/smali stuff will cause an issue, and might not be able to be automated, and if that's the case, then i will just do as much automation as i can.
One question though... is this the smali/baksmali tool everyone is using?
Click to expand...
Click to collapse
That is correct
Sent from my Samsung Legen-wait for it-dary! 4g

bxfxf said:
My epic was lost,so I cannt continue to work for it.
Now i make a porting guide for you.You can continue to work for it based on the present build.It may need more additional works in the furture if the cm7 fixes others things.
1. Download miui_port_ns.zip and ns (or ns 4g,or others)miui rom from miui.us.
miui_port_ns.zip contains some files come from cm7 and EH17. What we need to do is that replace some files of miui.us latest rom with miui_port_ns's ones.
2. Extract miui_port_ns.zip to “miui_port_ns”.
3. Extract the ns(or ns 4g)miui rom to a new folder,then rename it “miui_epic”.
4. cd into “miui_epic”,delete all folders and files except “system” folder.(In the future,if our cm7 support mtd,you may need reserve some related files)
5. copy kernel_update/ and META-INF/ folders to “miui_epic”
6. cd into “miui_epic/system/vendor”
(1) delete bin/pvrsrvinit
(2) delete etc/
(3) cut and replace lib/ to system/lib/
7. cd into “miui_epic/system/lib”,delete egl/ and hw/ folders.
8. Cd into “miui_epic/system/app”,delete Nfc.apk and Tag.apk(nfc related).
9. Copy and replace “miui_port_ns/system/” to “miui_epic/system/”.
10. Modify build version in miui_epic/system/buid.prop.
11. Modify system/framework/ framework.jar to enable data:
(1) Smali framework.jar: apktool d framework.jar
(2) Copy and replace “miui_port_ns/framework.jar/com” to “framework.jar.out/smali/com”
(3) Baksmali framework.jar: apktool b framework.jar.out
(4) Copy and replace framework.jar.out/dist/ framework.jar to miui_epic/system/framework/
12. Modify system/framework/ framework-res.apk to remove “Roaming Indicator” chars:
(1) apktool d framework-res.apk
(2) Cd into framework-res/res,open strings.xml in “values”,” values-en-rUS”,” values-zh-rCN”,search for “roamingText1”,set value null,then save them.
(3) apktool b framework-res
(4) Replace miui_epic/system/framework/ framework-res.apk’s resources.arsc with framework-res/build/apk/resources.arsc.
13. The last step:cd into miui_epic,zip “kernel_update”,” META-INF” and ” system” to a zip file.You also can sign it(not have to).Then flash it!
Thanks:EpicCM team,xboxfanj and and many other contributors.
Click to expand...
Click to collapse
On step 11(1) you have to "Smali framework.jar: apktool d framework.jar" does this mean i need to do both, or i can i do one or the other?

Death259 said:
I started last night on making a GUI that will automate this process. Basically all that will need to be done is the downloading of a new version whenever it comes out. I'm thinking the baksmali/smali stuff will cause an issue, and might not be able to be automated, and if that's the case, then i will just do as much automation as i can.
One question though... is this the smali/baksmali tool everyone is using?
Click to expand...
Click to collapse
I use apktool, but both are probably fine. To answer ur question about step11, u have to baksmali first, then modify whatever he said to modify, then smali
Sent from my SPH-D700 using Tapatalk

Related

[Android 4.0][GUIDE]Port ICS transition animations on EVERY ROM & EVERY PHONE

Because some people asked me, I wrote this tutorial that explains how to port ICS transition animations on EVERY ROM & especially on EVERY PHONE!!!.
1) First of all, you need to download and install APK MANAGER:
http://forum.xda-developers.com/showthread.php?t=695701
2) Extract with WinRAR, from the ROM you want to modify, the file framework-res.apk, that you can find in the directory \System\framework\.
3) Go to the apk manager folder and place the framework-res.apk file in the folder "place-apk-here-for-modding".
4) In the apk manager folder, double click on the file "Script". A cmd window will open.
5) Where it says "Please make your decision", write "22" (Set current project) and enter. Then enter "1" (to choose the first apk) and enter. Then enter "9" (Decompile apk) and enter.
The script will decompile the framework-res.apk.
6) Now go to your apk manager folder, go to Projects\framework-res.apk\res\anim\.
In this folder there are the animations of your rom. They consist in some .xml files decompiled.
7) Download this:
http://www.mediafire.com/?1qjwtotg1r8umm1
8) Copy the files from the folder "anims" of the zip downloaded into the anim folder and you are asked to replace the files; choose yes. Then copy also the files from the folder "other_files" to the anim folder.
9) Now go to your apk manager folder, go to Projects\framework-res.apk\res\values\. Edit the file integers.xml and put these two lines under the line of "shortAnimTime":
<integer name="config_activityShortDur">150</integer>
<integer name="config_activityDefaultDur">220</integer>
Save.
10) Return to Script. Enter "11" (Compile apk) and enter.
The script will rebuild the framework-res.apk.
11) You are asked if this is a system application. Enter "y" and enter. Then a second question appears. Enter newly "y".
12) Then after it processes, Don't press anything & DON'T CLOSE THIS WINDOW!!! A new folder "keep" is created in the apk manager folder. Go inside it and delete the file "resources.arsc". Now go inside keep\res\anim\ and delete every file with the same name as every file of the "anims" folder of the zip downloaded.
Then return to Script and press enter. It processes, then if everything went ok, in the folder "place-apk-here-for-modding" a file "unsignedframework-res.apk" is created. Copy it outside and rename it "framework_res.apk".
13) Now you can create a flashable zip or you can simply push it to your system (but you have to sign the apk).
CONGRATRULATIONS!!! YOU ARE DONE!!!
And if you think this tutorial is useful, CLICK THANKS!!!
Now I'm satisfied and i can continue studying phylosophy for tomorrow test...
P.S.: If you think that this post can help or interest people of other forums (with other devices), please share this post and also give credit to me!!!
Video of this mod working:
http://www.youtube.com/watch?v=vf1U_30Ngfk
capez said:
Work in progress
Click to expand...
Click to collapse
WHAAOOON, that's great, that's the post I was looking for mate !
This is what we should expect on this forum : knowledge sharing ! Work sharing and ROM/THEME/APPS sharing is great but knowledge is even better.
If I can test something ...
capez said:
Work in progress
Click to expand...
Click to collapse
Will this work with every devices ?? Wow... Cant wait to do this!!!
Sent from my Nexus One using Tapatalk
Finally DONE!!!
cool animations, thanks!!!
(Replaced)
got bootloops on my desire hd.. running glanet ics..
Rotation animations??
I already installed the CM7 transition animation zip from your other thread.. So, thank you in case I haven't appreciated your work
Does this one have screen rotation animation too?
digkong said:
got bootloops on my desire hd.. running glanet ics..
Click to expand...
Click to collapse
Did you pushed the modded framework-res.apk directly into the phone?
Do you think [Android 4.0 ICS] should be in the title in this form? It's a little misleading.
Hmm...It started FC. Removing my links for now. Gonna see why.
Works great
Great guide. It worked for me.
Oddly though, I replaced my framework-res.apk through root explorer, set all the correct permissions, and when I rebooted, my google accounts were deleted, along with my contacts and google music library.
Not a problem though, Ill just have to relogin to them.
Great, it works very well. I maybe found a more simple way to do it :
1. Dowload ApkTools package I've done here :
http://www.multiupload.com/Q6YSAF2MH3
2. Unzip it to your harddrive and put your FrameWork-res.apk in it,
3. Click on "decomp.bat"
4. A new "unpack" directory has been created, with decompiled files in it,
5. Download this:
http://www.mediafire.com/?1qjwtotg1r8umm1
6. Copy the files from the folder "anims" of the zip downloaded into the anim folder and you are asked to replace the files; choose yes. Then copy also the files from the folder "other_files" to the anim folder.
7. Now go to your apk manager folder, go to Projects\framework-res.apk\res\values\. Edit the file integers.xml and put these two lines under the line of "shortAnimTime":
<integer name="config_activityShortDur">150</integer>
<integer name="config_activityDefaultDur">220</integer>
Save.
8. Patch the anim files in it, and edit the xml,
9. When finished, just click "recomp.bat" to get a new compiled file "framework-res2.apk",
10. Juste rename the file and put it in a update zip file, you can use this one and replace the framework file in it by yours :
http://www.multiupload.com/PPMFV9Y316
Should work !!!
PS : If your framework-res.apk contains .9.png files, decompilation will fails. No problem with standard CM7 framework-res.apk, but some custom themed ROM can have the problem. Don't know how to fix that, maybe the 1st solution with APK MANAGER work better !?
capez said:
Did you pushed the modded framework-res.apk directly into the phone?
Click to expand...
Click to collapse
i used root explorer..
hmmm.. it maybe beacause i did not set permissions right...
great it worked after i set the permissions.. thanks for ur work will post this guide in dhd forum too..
nmeuret said:
Great, it works very well. I maybe found a more simple way to do it :
1. Dowload ApkTools package I've done here :
http://www.multiupload.com/Q6YSAF2MH3
2. Unzip it to your harddrive and put your FrameWork-res.apk in it,
3. Click on "decomp.bat"
4. A new "unpack" directory has been created, with decompiled files in it,
5. Patch the anim files in it, and edit the xml,
6. When finished, just click "recomp.bat" to get a new compiled file "framework-res2.apk",
7. Juste rename the file and put it in a update zip file, you can use this one and replace the framework file in it by yours :
http://www.multiupload.com/PPMFV9Y316
Should work !!!
PS : If your framework-res.apk contains .9.png files, decompilation will fails. No problem with standard CM7 framework-res.apk, but some custom themed ROM can have the problem. Don't know how to fix that, maybe the 1st solution with APK MANAGER work better !?
Click to expand...
Click to collapse
Maybe this is the problem someone is having...Someone must compare your version and mine, to see which one works and which not. (Obviously with a non-cyanogenmod rom )
Update done for CM7 Nightly 176 (latest) :
http://www.multiupload.com/J88VTO2SU6
---------- Post added at 07:01 PM ---------- Previous post was at 06:59 PM ----------
capez said:
Maybe this is the problem someone is having...Someone must compare your version and mine, to see which one works and which not. (Obviously with a non-cyanogenmod rom )
Click to expand...
Click to collapse
Well, in the APK MANAGER post they say :
>Optimize pngs (ignores .9.pngs)
So it should work better !! (but as I'm lazy, I still use APKTOOL one click solution )
I got instant bootloops! How? Can u patch for me??
Sent from my Nexus One using Tapatalk
nmeuret said:
Update done for CM7 Nightly 176 (latest) :
Click to expand...
Click to collapse
Just a heads up. I downloaded your file and you renamed your framework-res wrong. There's a space between "framework-res" and ".apk" so it won't overwrite the original.
this does not have the rotation animation..
anyway to get that..
dawgpound6985 said:
Just a heads up. I downloaded your file and you renamed your framework-res wrong. There's a space between "framework-res" and ".apk" so it won't overwrite the original.
Click to expand...
Click to collapse
OOpppsss, thanks, fixed here :
http://www.multiupload.com/J88VTO2SU6

How to re-odex?

Normally to decompile my dex files I use smali and baksmali, how can I re-odex them?
Id like to get my service.jar re-odexed so I can try and push it to my phone via a zip update.
Sent from my MB865 using xda premium
[mini HOW-TO] Re-Odex (or create a new .odex file)
Fall of Enosis said:
Normally to decompile my dex files I use smali and baksmali, how can I re-odex them?
Id like to get my service.jar re-odexed so I can try and push it to my phone via a zip update.
Sent from my MB865 using xda premium
Click to expand...
Click to collapse
It all needs to be done on your phone, live.. with adb.
Here's how I accomplished it - I will use the services.jar in this example. Just change the file name and path to existing .odex accordingly for other files (not sure if all steps are required exactly, but it has worked for me multiple times with different jars and SysUI apk):
Requirements:
Odexed system
adb
dexopt-wrapper
Put this dexopt-wrapper file (unzip first) in /system/bin with 775 permissions:
X X X
X....X
X....X
Probably a good idea to reboot after pushing that file, if you use root explorer (like I did).
Put the deodexed services.jar (or other jar/apk file you want to make an new odex of) on your sd card.
Go to /system folder (with root explorer or equal) and mount it R/W (not sure if this is necessary - but won't hurt)
Put your USB connection to "Charge only" mode.
Go here (big props and credit to jhotmann for this) and follow steps 8-12 (I've recreated the steps with the A2's bootclasspath below).
The bootclass path is located in the /init.rc file at the root of your phone.
Connect with adb (do a adb devices check to make sure you're all good).
To create the new odex:
Code:
adb shell
su
cd /sdcard/
dexopt-wrapper services.jar new.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:/system/framework/com.motorola.android.frameworks.jar:/system/framework/com.motorola.android.widget.jar
I know it's a long entry for those who don't work with command lines often (like me), but double check your entry before hitting enter.
To copy the signature from the existing odex (change path to /system/app/.. if necessary):
Code:
busybox dd if=/system/framework/services.odex of=new.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
Done! Rename new.odex (created on your /sdcard) to services.odex since that is your new signed odex file...
You can then get that on your odexed system by your choice of method (adb push, update.zip, root explorer push, etc.. - note: please know what you are doing before trying to push files with root explorer! - you cannot simply copy and paste!)
Or, if you want to deodex it right away again for some odd reason like I did (personal issues )... Take the services.jar and the new services.odex from your sdcard and put them on your computer - and open the services.jar with 7-zip (maybe winzip) and delete the classes.dex file from the 7-zip window. Now you have a fresh new set of .jar/.odex files ready for deodexing (I did this all with the SystemUI.apk last night, that's why I elaborated and re-typed this whole thing today..).
Frigging brilliant man.
Much appreciated. I'm super sick and my USB cable is at work.
Once i get it back on Wednesday, I'll work all this out. If I could thank you twice I would.
Thanks man!
Sent from my MB865 using xda premium
Fall of Enosis said:
Frigging brilliant man.
Much appreciated. I'm super sick and my USB cable is at work.
Once i get it back on Wednesday, I'll work all this out. If I could thank you twice I would.
Thanks man!
Sent from my MB865 using xda premium
Click to expand...
Click to collapse
Not a prob.
And, I updated the dexopt-wrapper link so it's easier to download - just unzip it first..
Good luck on your quest.. let me know if you catch any snags along the way - and i'll try and help you out.
Sent from my mind using XDA
Ok sooo, I think we (or most likely me) are confused on what I wanted to do. I don't want to make a NEW odex file. I need to recombine my modded classes.dex BACK with the service.jar.
Since I needed to modify some script in the services.jar I had to de-odex it so I had a classes.dex file to use baksmali with so I could modify it. Once I modded it I used smali to create the NEW MODDED classes.dex. And now I need to re-odex(bad terminology?) them to re-combine the services.jar with the classes.dex so the modded services.jar could be used on a odexed ROM.
I'm working on a de-odexed version also, but I'd like to be able to offer both
Fall of Enosis said:
Ok sooo, I think we (or most likely me) are confused on what I wanted to do. I don't want to make a NEW odex file. I need to recombine my modded classes.dex BACK with the service.jar.
Since I needed to modify some script in the services.jar I had to de-odex it so I had a classes.dex file to use baksmali with so I could modify it. Once I modded it I used smali to create the NEW MODDED classes.dex. And now I need to re-odex(bad terminology?) them to re-combine the services.jar with the classes.dex so the modded services.jar could be used on a odexed ROM.
I'm working on a de-odexed version also, but I'd like to be able to offer both
Click to expand...
Click to collapse
So, you have a deodexed services.jar (with an unedited classes.dex inside)? And, you also have an edited classes.dex (the new modded one). Just drag and drop the new modded classes.dex into the services.jar file with 7-zip to overwrite the old one.
Then I would check out the mods on a deodexed system, and provided they work, then go through the re-odexing process (separating that classes.dex from the apk and creating a new odex file) as described above to get it working on odexed systems.
Hope that helps.. Good luck!
Yes sir, you are correct. That was the first thing I tried to do was just drag and drop the modded classes.dex with 7zip, save it, however when i tried to flash the "modded" ROM it can't install the system folder because (according to Jim), when I modded copied the new classes.dex, I changed the size, and so the signature needed to be changed as well. They mismatched.
Fall of Enosis said:
Yes sir, you are correct. That was the first thing I tried to do was just drag and drop the modded classes.dex with 7zip, save it, however when i tried to flash the "modded" ROM it can't install the system folder because (according to Jim), when I modded copied the new classes.dex, I changed the size, and so the signature needed to be changed as well. They mismatched.
Click to expand...
Click to collapse
Not sure about the details of that.. I know the signatures can be tricky, but I've modded a few apks/jars similarly with no problems... when you say "can't install.." is that it wouldn't flash in recovery, or you bootlooped?
Just wouldn't flash at all.
And thanks for all your help man.
Sent from my MB865 using xda premium
I've updated the 2nd post with more detail on creating a new odex file...
Not to be a "rooster" (replace with your word of choice) or anything, but maybe this info has a place somewhere besides the general threads..?:angel: (and what is up with these new Smilies and posting reply layout?) - it just seems so hard to come by good literature on this process (which, I suppose, is a process so rarely needed though...)
So I need to perform the processes above while running in an odexed environment correct? Does this process change the deodexed APK we are running the script on to an odexed one as well as create a new .odex file for that APK? I am just confused about what the result is after running the script. For my situation I want to take 2 deodexed files (systemui and sec settings.apk) and odex them. Then push them into an odexed rom. Once I run the script above what am I left with?
Didact74 said:
So I need to perform the processes above while running in an odexed environment correct?
YES.
Does this process change the deodexed APK we are running the script on to an odexed one as well as create a new .odex file for that APK?
(Yes, it will create a new odex file that you will need to rename, but..)NO. You will need to take the classes.dex out of the deodexed apk/jar - use something like 7-zip. Unless you only edited smali, then you really only need the new odex file.
I am just confused about what the result is after running the script. For my situation I want to take 2 deodexed files (systemui and sec settings.apk) and odex them. Then push them into an odexed rom. Once I run the script above what am I left with?
Click to expand...
Click to collapse
I broke up your quote with my best answers...
As for what your're left with is a new.odex file, properly signed, if all goes well. You are going to need to do it for each of your deodexed files.
Rename them, remove the classes.dex from the deodexed files you used, and get them on your phone however you choose (I prefer zip packages and a restore.zip in case something goes wrong).
Also note that the bootclass path is different from GB to ICS.. and among different devices of course. Check init.rc file if need be. I posted the one to use for A2 ICS (think it may be the same for razr too) here: http://forum.xda-developers.com/showthread.php?t=1753659
I can't garuntee you won't have problems, but good luck... if you do you could try the dexopt-wrapper from here: http://forum.xda-developers.com/showthread.php?t=1645950 - just unzip it first obviously (but I think it's the exact same file though..)
Btw, it's all done with adb, one line at a time.. not really a script, but thank you for the idea - maybe a batch file?
Sent from my phone's mind
Great, thank you for the detailed response. Last question.
What if I have the original SystenUI.odex and SecSettings.odex files that used to be attributed to them before i deodexed them? Can I simply reuse those without having to run through the adb process?
Thanks,
Didact74 said:
Great, thank you for the detailed response. Last question.
What if I have the original SystenUI.odex and SecSettings.odex files that used to be attributed to them before i deodexed them? Can I simply reuse those without having to run through the adb process?
Thanks,
Click to expand...
Click to collapse
But, you deodexed them to edit the smali files in the classes.dex right? So, no, you will need to use the new odex files that are created from the modded deodexed files you used..
If you never edited any of the smali files, then you didn't need to deodex in the first place... you only need to deodex in order to mod the smali files - everything else in the apk can be modded as is on odexed systems.
Sent from my phone's mind
Thank you very much. Can you repost the wrapper file? Its not downloading correctly.
Didact74 said:
Thank you very much. Can you repost the wrapper file? Its not downloading correctly.
Click to expand...
Click to collapse
Updated the link in Post #2 with a zip file - you need to unzip it first then move it.
Thank you.
So I am getting an error trying to re-odex. See the attached image of the error.
Weird thing is that even though I get an error it still creates the new.odex file. I triedto go through the entire process even though I was getting errors and it just got stuck on the boot screen and never loaded. Anything in my error attached raise any flags?
Thanks,
Didact74 said:
Thank you.
So I am getting an error trying to re-odex. See the attached image of the error.
Weird thing is that even though I get an error it still creates the new.odex file. I triedto go through the entire process even though I was getting errors and it just got stuck on the boot screen and never loaded. Anything in my error attached raise any flags?
Thanks,
Click to expand...
Click to collapse
Hmmm... First thing I can think of is: are all of those framework files in the bootclass path that you used actually in your /framework folder? With our A2, in ICS there are a few extra .jar files listed that were not actually on our phone, so I had to remove those from the path...
I will try to make a new odex myself and make sure that's not a standard error message... @Fall of Enosis, you recall what it spits out?
EDIT: Shoot - forgot I'm deodexed right now... will attempt later or hear back from Fall by then..
alteredlikeness said:
Hmmm... First thing I can think of is: are all of those framework files in the bootclass path that you used actually in your /framework folder? With our A2, in ICS there are a few extra .jar files listed that were not actually on our phone, so I had to remove those from the path...
I will try to make a new odex myself and make sure that's not a standard error message... @Fall of Enosis, you recall what it spits out?
EDIT: Shoot - forgot I'm deodexed right now... will attempt later or hear back from Fall by then..
Click to expand...
Click to collapse
Yes, all .jar files listed in my bootclass were located in the framework directory.
Nevermind...my mistake. I had an issue with my files not being deodexed correctly from the start. I went back and deodexed, made the edits to res and smali then odexed using the method above again and all went well!
Thanks!

(GUIDE) How to use Apktool Apk manager Baksmali and Adb

Hello Guys....
Just been watchin around our forum and The Galaxy Fit Development Group in FB and came to know that many are not able to decompile, compile, using apktool and apk manager !!! And few are not able to use the baksmali tool and even Android debugging bridge (ADB) So Decided to make a Guide on How to use all these
The tools required are attached along with this file...
So here we go....
[How To Use APK Tool]
If you're using apktool for the first time thn
Place framework-res.apk and twframework-res.apk from STOCK Firmwares (Do not take it from Custom ROM )
Thn open command prompt in the current window and type the following code
Code:
apktool if framework-res.apk
apktool if twframework-res.apk
The Dependencies would be installed in apktool folder in C:\Users\USER NAME\apktool\framework and also check if u hav 1.apk and 2.apk present inside the folder
Decompile And Compile Apk's Using apktool
Place the apk file that u wish to decompile in the downloaded apktool folder
Open command prompt in the current window and type the following code
Code:
[To Decompile] apktool d "apk name.apk"
[To Recompile] apktool b "apk name"
Example:
Code:
[To Decompile Mms.apk] apktool d Mms.apk
[To Recompile Mms.apk] apktool b Mms
The Compiled apk would be in "dist folder" inside the "decompiled folder"
[How To Use APK Manager]
Always use apktool to install dependencies even if u r gonna use apk manager
Place the apk tat u wish to decompile in "Place here for modding folder"
Open Script.bat in the folder and Press 9 to decompile and 11 to recompile
The decompiled folder would be in "Projects" folder and recompiled apk would be in "place here for modding folder"
[How To Use Baksmali]
Smali/Baksmali is an assembler/disassembler for the dex format used by Dalvik
The names "smali" and "baksmali" are the Icelandic equivalents of "assembler" and "disassembler" respectively
Smali Editting can be done through apk tool as well as apk manager but all those needs experience and practice
Place either the .apk or .jar file who's dex u want to decompile in that baksmali folder
Right click and Edit 1.bat using notepad++
Code:
java -jar baksmali.jar -x "filename"."file extension" -o classout
Example:
Code:
[To Decompile Mms.apk] java -jar baksmali.jar -x [B]Mms.apk[/B] -o classout
[To Decompile android.policy.jar] java -jar baksmali.jar -x [B]android.policy.jar[/B] -o classout
U would get a folder called classout
Make necessary changes and to compile back just press 2.bat
U would get classes.dex in the current folder
Replace this classes.dex with the classes.dex in the unmodded file
[How To Use ADB]
Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device
With this adb u would be able to push pull files from your mobile, Logcat and much more
I would explain only the basic that is used most often that is pullin and pushin of files
Place the file tat u r about to push into the ADB folder
Code:
[To Push system apps] adb push "[B]apk name".apk [/B]/system/[B]app[/B]/[B]"apk name".apk[/B]
[To Push system framework files] adb push [B]"name".jar[/B]/system/[B]framework[/B]/[B]"name".jar[/B]
[To Push files to your SD Card] adb push [B]"filename.extension"[/B] /sdcard/
Example:
Code:
[To Push Mms.apk] adb push Mms.apk /system/app/Mms.apk
[To Push android.policy.jar] adb push android.policy.jar /system/framework/android.policy.jar
[To Push files to your SD Card] adb push Readme.txt /sdcard/
Credits:
Google
And to all those who taught me [How To Use These]
Tools
Reserved
Rooting
Sorry, I know this is not the right thread to post this..
But i need help
I am a newbie and never had rooted my android phone... I know that there had been many threads about rooting this phone..but i am a little afraid about bricking my phone..that's why i am asking again..
The specs of my phone are given in the attachment...Please give a guide on rooting and unrooting my phone..
Akshit97 said:
Sorry, I know this is not the right thread to post this..
But i need help
I am a newbie and never had rooted my android phone... I know that there had been many threads about rooting this phone..but i am a little afraid about bricking my phone..that's why i am asking again..
The specs of my phone are given in the attachment...Please give a guide on rooting and unrooting my phone..
Click to expand...
Click to collapse
May be u should try using the search option next time...
but since u asked for it
http://forum.xda-developers.com/showthread.php?t=1606380
Really good guide mr.wilfred...
Want to ask something about compile and decompile apk from ICS version... what tool I need to compile and decompile it? And which version?
Thank you....
Sent from my GT-S5670 using Tapatalk 2
AldoSebastian said:
Really good guide mr.wilfred...
Want to ask something about compile and decompile apk from ICS version... what tool I need to compile and decompile it? And which version?
Thank you....
Sent from my GT-S5670 using Tapatalk 2
Click to expand...
Click to collapse
A seperate version of Apk tool has been made and i saw it few days back in xda only.... I would let u know if i get that link... ^_^
http://www.xda-developers.com/android/modified-apktool-for-android-4-0-4/
this is the one for ics apks
unable to compile using your method
Avilove.Cullen said:
unable to compile using your method
Click to expand...
Click to collapse
which are u talking abt.......apks dexes or jar files........
Avilove.Cullen said:
unable to compile using your method
Click to expand...
Click to collapse
Thn u would hav done any error....
btw... wat was the error u got...
Avilove.Cullen said:
unable to compile using your method
Click to expand...
Click to collapse
Hey Avi from personal experience,.. I found out something none of these guides tell us !
U need to put a file called aapt in apkmultitools/platformtools/ for u to compile properly in some computers,..!
I had an error which read as
java.io.exception : cannot run command [aapt ....blah blah blah]
if this is the same error,.. just put the right aapt file,..
also,.. to mod JELLY BEAN apks,.. all u gotto do is put the latest aapt that u can download using Android SDK,..
Havent tested whether it works .. but saw that some did succesfylly decompile using this method (no not in xda,.. in some other forum,.. )
I did all this and I get a folder with all the this stuff in it with smali extentions. I was wondering how do you actually look at the code of the apk and program it self. The reason why I want to look at the code is to see apps are written; the best way I know how to is by looking at code and figuring it out.
brievolz84 said:
I did all this and I get a folder with all the this stuff in it with smali extentions. I was wondering how do you actually look at the code of the apk and program it self. The reason why I want to look at the code is to see apps are written; the best way I know how to is by looking at code and figuring it out.
Click to expand...
Click to collapse
FYI smali's are dalvik opcodes... u can use dex2jar to view the smali in java language which is easier wen compared to smali... and to under these languages u would hav to learn java or hav xperience and interest too
need a recommendation for APK Tool
Hi, I have a i9305 SG3 using a custom ROM Jellybean Ver 4.1. I want to learn how to decompile, edit, and recompile code in my SystemUI.apk file. I know I need an APK tool/manager of some sort. However, after looking through your thread (and looking into other research on google) I wasn't able to find conclusive evidence on WHAT the name of a stable APK Program is and WHERE to get it.
*
I am using Windows 7 64x PC and want to learn how to edit APKs. I have appreciated reading your threads and hope to learn more. I need to find the right APK software to start with. Suggestions please....
droido123 said:
Hi, I have a i9305 SG3 using a custom ROM Jellybean Ver 4.1. I want to learn how to decompile, edit, and recompile code in my SystemUI.apk file. I know I need an APK tool/manager of some sort. However, after looking through your thread (and looking into other research on google) I wasn't able to find conclusive evidence on WHAT the name of a stable APK Program is and WHERE to get it.
*
I am using Windows 7 64x PC and want to learn how to edit APKs. I have appreciated reading your threads and hope to learn more. I need to find the right APK software to start with. Suggestions please....
Click to expand...
Click to collapse
Hey there..... Hello..... U can either use apk manager or apk tool to decompile nd recompile apk's ... But as far as i know ICS rom's had different dependencies hence a diff version of apktool wer required .... since your rom being jelly bean ,As a wild guess, it MAY hav certain problems as such in ICS's ROM's ..... The best solution is either ask a fellow dev from your community who has been decompilin/recompilin apps or else there's always a better partner ( google ) .....
Sent from my GT-S5670 using XDA
Hey wilfred for decompiling app from custom rom like cm7 should we still use stock framework first??
MajinSaiyan4 said:
Hey wilfred for decompiling app from custom rom like cm7 should we still use stock framework first??
Click to expand...
Click to collapse
nop.... use CM7 framework-res.apk !!!
wilfredcool007 said:
nop.... use CM7 framework-res.apk !!!
Click to expand...
Click to collapse
Ok thnx but i had problems recompiling systemUI.apk with apktool even without any modifications sry cant post error right now im on phone..
MajinSaiyan4 said:
Ok thnx but i had problems recompiling systemUI.apk with apktool even without any modifications sry cant post error right now im on phone..
Click to expand...
Click to collapse
Did u delete the public.xml before u could recompile ??? if so u wouldnt hav got any error.... to be on the safer side send me the error tat u get....
wilfredcool007 said:
Did u delete the public.xml before u could recompile ??? if so u wouldnt hav got any error.... to be on the safer side send me the error tat u get....
Click to expand...
Click to collapse
Uh is it necessary to del public.xml??ok i wil try when im on pc..actually i was trying jellybean layout mod but i was unsuccesful

[Q] Different method to edit an Apk: differences?

Hi to all! What are the differences between this:
Rename the *.apk to *.zip
Extract the *.zip file
Edit whatever you want
Compress all files again
Rename the *.zip to *.apk
and this:
Download ApkTool and "install" it
Using CMD navigate to the *.apk folder
Use this command "apktool d app_u_want_edit.apk"
Edit whatever you want
Use this command "apktool b app_u_want_edit"
???
Thanks in advance.
apktool
Francoiky said:
Use this command "apktool d app_u_want_edit.apk"
Edit whatever you want
Use this command "apktool b app_u_want_edit"
Click to expand...
Click to collapse
.
Using apktool be more change.
Normally you do not make changes to the file classes.dex and resources.arsc included in the APK files.
.
ze7zez said:
.
Using apktool be more change.
Normally you do not make changes to the file classes.dex and resources.arsc included in the APK files.
.
Click to expand...
Click to collapse
So, if I would change graphics only I could simply unzip and zip again, right?
As long as they are not .9.pngs then this will work but it will only work for images. I would advice learning apktool as this is the proper way to do it and you have less chances of messing something up. Alot of images are indexed and if not done properly can lead you to a boot loop
Sent from the Bat Cave

[GUIDE][TOOL] Android L 5.0 (Lollipop) deodex tool for windows! Oat2dex convertor.

EDIT 2 : WAIT NO MORE! Thanx to our friend @joeldroid for his AMAZING TOOL that can batch deodex lollipop files.!
Head over HERE and learn more about it. It is in early stages but works perfectly!
EDIT : I didn't made these tools as I said I compiled (gathered) a set of tools and wrote the guide and so mentioned on XDA Portal that I created a "Quick Guide" please refer that point. Credit goes to the devs of these tool creator. I am extremely sorry for my ignorance but I don't know the devs, please PM me your names so I can give proper credits.
A related guide to this can be found here on this blog, here is the link http://softdx.kr/220200813802
Hello Guys,
I am back with another exciting guide. Deodex lollipop apps and jar's now successfully.! This tool can be useful for ROM developers, chefs and themers and for those who can port apps.
Now on XDA Portal : http://www.xda-developers.com/android/deodex-lollipop-system-apps-with-ease/
I compiled together a set of tool to deodex Lollipop. I'll be attaching it at the end of the thread.
Well now lets get to it.
As we know in Android 5.0 Lollipop framework, app, priv-app folder we have * .apk files and * .jar file, and subsequently when you look at the sub-folder called * .odex files they have a specific folder for art runtime in order to compress into two modes.
* odex.art.xz -> The art mode to native file.
* .odex.xz -> 7zip * .odex appears when you unzip the file.
* .odex.xz unpack the file compression, uses the * .odex file.
unless the ARM is compressed folder * .odex
So in order to deodex files we need this deodex tool and your apk along with *.odex.xz.
Procedure
1) Extract the attached 7z file to desktop and hold right shift key and right click mouse button, you'll see "Open Command Prompt here" click on it.
2) Now a command prompt window will open. Now place you .apk and .odex.xz file there and type "7za x *.odex.xz " and press enter. This will lead to xz uncompressing and output file we will recieve as an odex, though a new format odex will be given in output so we need oat2dex converter
3) Now enter this command "oat2dex.bat *.odex and press Enter. With this command, you confirm that there is OAT file and DEX file header present. Note if you face any errors during this command you'll unfortunately have to give up as that apk won't be converted.
4) Now assuming you got no error in converting enter this command "oat2dex.bat *.odex temp.dex. This command will will you give you your required output ,i.e. .temp.dex. file is created, it is odex file with the old structure.
5) Now using the baksamli / smali to De-Odex use this command "java -jar baksmali-2.0.3.jar -a 21 -x temp.dex -o deodex". As you all know this command will decompile dex and as a result we will find find a deodex output folder without any error.
6) Now to compile the output back to classes.dex use this command "java -jar smali-2.0.3,jar -a 21 deodex -o classes.dex".
7) Now to put classes.dex into apk use this command "7za u -tzip *.apk classes.dex"
Hope this guide makes you to deodex your required file(s) properly
P.S. I am not big of a dev and this guide may contain a number of errors as this took me around 2 hours to figure out the proper way to write this guide , if you spot any error please do help me correcting it.
I am writing a program that can batch deodex all files, but as I said I am no dev Hope someone can do this to write a program to batch deodex.
Please hit like if this helped you :fingers-crossed:
Any suggestion(s) are welcome.:laugh:
For Example
Say we need to deodex SemcVideo.apk
Keep SemcVideo.odex in the folder and then
1) 7za x SemcVideo.odex.xz
To decompress the compressed files that SemcVideo.odex has and to use them for later purpose.
Then, using the oat2dex tool*
2) oat2dex.bat SemcVideo.odex
With this command, you confirm that OAT file and DEX file header is present.
If a file error occurs here it will not convert.
In order to convert the file name to dex format.
3) oat2dex.bat SemcVideo.odex temp.dex
temp.dex file is created, it is odex file with the old structure.
Now, using the baksamli / smali to De-Odex.
4) java -jar baksmali-2.0.3.jar -a 21 -x temp.dex -o deodex
If a deodex folder is created without any error during Decompile, next step is to pack it properly.
Now, the recompiling process to generate classes.dex file.
5)java -jar smali-2.0.3.jar -a 21 deodex -o classes.dex
Now, without any error a classes.dex file is generated.
Now to add this in apk
6) 7za u -tzip SemcVideo.apk classes.dex
This will update SemcVideo.apk video files with file newly created classes.dex
Hope this helps.
Nice, I will be trying this out a little later. Would love a batch option though. Major pain to deodex everything manually LOL
Edit: A little lost here. So I extracted the shamu factory image, and I have the full set of system files. I extract the package you uploaded. So I would simply drop an apk or jar into the directory with the tools, along with its matching odex file, right? Could you provide an example of how to deodex say "SystemUI.apk"? I am not following the steps and understanding what you are suggesting we do . .
hlxanthus said:
Nice, I will be trying this out a little later. Would love a batch option though. Major pain to deodex everything manually LOL
Click to expand...
Click to collapse
Yup working on the batch deodex thing hope some advanced dev can write a program and help in batch deodexing
hlxanthus said:
Nice, I will be trying this out a little later. Would love a batch option though. Major pain to deodex everything manually LOL
Edit: A little lost here. So I extracted the shamu factory image, and I have the full set of system files. I extract the package you uploaded. So I would simply drop an apk or jar into the directory with the tools, along with its matching odex file, right? Could you provide an example of how to deodex say "SystemUI.apk"? I am not following the steps and understanding what you are suggesting we do . .
Click to expand...
Click to collapse
Check Post 2 added an example
Excellent!! That was all it took to figure it out. As they say, now we are cooking with gas. :good:
Successfully deodexed several apks and jars from the nexus 6 factory images, trying to figure out where the heck to shoehorn in an extended power menu . . but android.policy.jar doesnt have an odex . .
any method to do this on linux?
what do u push to phone? i pushed apk i drug over earlier and wont install?
---------- Post added at 07:42 PM ---------- Previous post was at 07:40 PM ----------
i did following:
1) unzipped the oat2dex archive
2) run command prompt
3) drag apk and apk.odex.xz
4) follow all steps successfuly
5) what gets pushed to phone? I found apk i drug over in step 3? or do i find in a folder or where lol.. is the apk.odex go too?
This doesn't touch your phone at all . . you put the apk and odex file in the tools directory and follow the guide, see the example in the second post.
Tech N You said:
For Example
Say we need to deodex SemcVideo.apk
Keep SemcVideo.odex in the folder and then
1) 7za x SemcVideo.odex.xz
To decompress the compressed files that SemcVideo.odex has and to use them for later purpose.
Then, using the oat2dex tool*
2) oat2dex.bat SemcVideo.odex
With this command, you confirm that OAT file and DEX file header is present.
If a file error occurs here it will not convert.
In order to convert the file name to dex format.
3) oat2dex.bat SemcVideo.odex temp.dex
temp.dex file is created, it is odex file with the old structure.
Now, using the baksamli / smali to De-Odex.
4) java -jar baksmali-2.0.3.jar -a 21 -x temp.dex -o deodex
If a deodex folder is created without any error during Decompile, next step is to pack it properly.
Now, the recompiling process to generate classdex.dex file.
5)java -jar smali-2.0.3.jar -a 21 deodex -o classes.dex
Now, without any error a classes.dex file is generated.
Now to add this in apk
6) 7za u -tzip SemcVideo.apk classes.dex
This will update SecVideo.apk video files with file newly created classes.dex
Hope this helps.
Click to expand...
Click to collapse
Thanks much for this. I been have using the oat2dex script (Pau Oliva) on my linux build but have not been able to successfully deodex. I got the classes extracted but hit the wall there. I just gave you method a quick try with my sysui apk and i got an fc on reboot. I will start fresh in the morning and report back to you. I am currenty using an N9 with LRX22C stock factory images. Also, I thought I understood that JesusFreke may need to fix the smali/baksmali for us to properly deodex lollipop.
Regards
hlxanthus said:
This doesn't touch your phone at all . . you put the apk and odex file in the tools directory and follow the guide, see the example in the second post.
Click to expand...
Click to collapse
i know.. i meant there is no way to port apks using oat2dex? after deodex what do we push to phone?
can someoen explain to me whats ht epoint of doing this guide?
will it make lollypop GPE compatible with xposed?
anyone know how to convert the modified dex file back to oat format odex?
i found dex2oat, but it is an android binary; would like to be able to convert on pc.
i'm hoping there's a way to do this to be able to make minor smali edits without deodexing the entire system.
hlxanthus said:
Excellent!! That was all it took to figure it out. As they say, now we are cooking with gas. :good:
Successfully deodexed several apks and jars from the nexus 6 factory images, trying to figure out where the heck to shoehorn in an extended power menu . . but android.policy.jar doesnt have an odex . .
Click to expand...
Click to collapse
I am so sorry for late reply. Glad it worked. Some files that don't have .odex.rz can be deodexed simply by Xultimate. Give a try
Hi, no I am sorry but I have no expertise on Linux may be some of you can try this to port to linux
fhem said:
Thanks much for this. I been have using the oat2dex script (Pau Oliva) on my linux build but have not been able to successfully deodex. I got the classes extracted but hit the wall there. I just gave you method a quick try with my sysui apk and i got an fc on reboot. I will start fresh in the morning and report back to you. I am currenty using an N9 with LRX22C stock factory images. Also, I thought I understood that JesusFreke may need to fix the smali/baksmali for us to properly deodex lollipop.
Regards
Click to expand...
Click to collapse
Great, If you face any FC issues try to avoid those apk's as this is still a beta phase but many devs out there can work on this to make it stable.
lewonsky said:
can someoen explain to me whats ht epoint of doing this guide?
will it make lollypop GPE compatible with xposed?
Click to expand...
Click to collapse
Hi, First refer this guide for difference b/w odex and deodex http://forum.xda-developers.com/showthread.php?p=40026270#post40026270
It will not make it compatible with Xposed, but you can manually theme it as many themers do or you can port apps to different android versions.
elliwigy said:
i know.. i meant there is no way to port apks using oat2dex? after deodex what do we push to phone?
Click to expand...
Click to collapse
After deodexing the files successfully you can create flashable zip and flash via recovery, as I can see that Lollipop already has TWRP for it.
Tech N You said:
Hello Guys,
I am back with another exciting guide. Deodex lollipop apps and jar's now successfully.! This tool can be useful for ROM developers, chefs and themers and for those who can port apps.
Now on XDA Portal : http://www.xda-developers.com/android/deodex-lollipop-system-apps-with-ease/
I compiled together a set of tool to deodex Lollipop. I'll be attaching it at the end of the thread.
Well now lets get to it.
As we know in Android 5.0 Lollipop framework, app, priv-app folder we have * .apk files and * .jar file, and subsequently when you look at the sub-folder called * .odex files they have a specific folder for art runtime in order to compress into two modes.
* odex.art.xz -> The art mode to native file.
* .odex.xz -> 7zip * .odex appears when you unzip the file.
* .odex.xz unpack the file compression, uses the * .odex file.
unless the ARM is compressed folder * .odex
So in order to deodex files we need this deodex tool and your apk along with *.odex.xz.
Procedure
1) Extract the attached 7z file to desktop and hold right shift key and right click mouse button, you'll see "Open Command Prompt here" click on it.
2) Now a command prompt window will open. Now place you .apk and .odex.xz file there and type "7za x *.odex.xz " and press enter. This will lead to xz uncompressing and output file we will recieve as an odex, though a new format odex will be given in output so we need oat2dex converter
3) Now enter this command "oat2dex.bat *.odex and press Enter. With this command, you confirm that there is OAT file and DEX file header present. Note if you face any errors during this command you'll unfortunately have to give up as that apk won't be converted.
4) Now assuming you got no error in converting enter this command "oat2dex.bat *.odex temp.dex. This command will will you give you your required output ,i.e. .temp.dex. file is created, it is odex file with the old structure.
5) Now using the baksamli / smali to De-Odex use this command "java -jar baksmali-2.0.3.jar -a 21 -x temp.dex -o deodex". As you all know this command will decompile dex and as a result we will find find a deodex output folder without any error.
6) Now to compile the output back to classes.dex use this command "java -jar smali-2.0.3,jar -a 21 deodex -o classes.dex".
7) Now to put classes.dex into apk use this command "7za u -tzip *.apk classes.dex"
Hope this guide makes you to deodex your required file(s) properly
P.S. I am no dev and this guide may contain a number of errors as this took me around 2 hours to figure out the proper way to write this guide , if you spot any error please do help me correcting it.
I am writing a program that can batch deodex all files, but as I said I am no dev Hope someone can do this to write a program to batch deodex.
Please hit like if this helped you :fingers-crossed:
Any suggestion(s) are welcome.:laugh:
Click to expand...
Click to collapse
don't be posting the you create this mode ..! i was the one the found how to get the job down ..thank you to (Goldie) and ( tdunham) and SAC23) for creating the tools ...NOT YOU ! give the credit to proper person.. .it's not about creating a conflict without you.
ORIGINAL
http://forum.xda-developers.com/gal...-5-0-gonna-t2961967/post57262607#post57262607
hlxanthus said:
Excellent!! That was all it took to figure it out. As they say, now we are cooking with gas. :good:
Successfully deodexed several apks and jars from the nexus 6 factory images, trying to figure out where the heck to shoehorn in an extended power menu . . but android.policy.jar doesnt have an odex . .
Click to expand...
Click to collapse
You can find it on "/system/framework/arm/" directory.
---------- Post added at 11:18 PM ---------- Previous post was at 11:13 PM ----------
Tech N You said:
For Example
Now to add this in apk
6) 7za u -tzip SemcVideo.apk classes.dex
This will update SecVideo.apk video files with file newly created classes.dex
Hope this helps.
Click to expand...
Click to collapse
Thank you very much!!But, do you know how to re-odex the modified dex file?

Categories

Resources