1.use kitchen extract rom from N7000ZSLO2_N7000OZSLO2_N7000XXLSO_HOME.tar.md5, then deodex rom.
2.copy android.policy.jar to sdcard.(android.policy.jar is unmodified.)
3.use dexopt-wrapper reodex ,get android.policy.odex.
4.copy android.policy.odex to /system/framework/android.policy.odex and set 644 permissions
5.reboot device and stay at samsung logo frame
now,How to deal with this problem? help,thx.
process
Code:
adb shell
su
busybox cp -f /data/local/tmp/odex/dexopt-wrapper /system/bin/dexopt-wrapper
chmod 755 /system/bin/dexopt-wrapper
busybox cp -f /system/framework/android.policy.jar /system/framework/android.policy.jar.bak
busybox cp -f /system/framework/android.policy.odex /system/framework/android.policy.odex.bak
rm /system/framework/android.policy.odex
busybox cp -f /data/local/tmp/odex/android.policy.jar /system/framework/android.policy.jar
dexopt-wrapper /system/framework/android.policy.jar /system/framework/android.policy.odex
busybox dd if=/system/framework/android.policy.odex.bak of= /system/framework/android.policy.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
rm /system/framework/android.policy.jar
busybox cp -f /system/framework/android.policy.jar.bak /system/framework/android.policy.jar
rm /system/framework/android.policy.jar.bak
rm /system/framework/android.policy.odex.bak
chmod 644 /system/framework/android.policy.odex
reboot
attach file is logcat information.The log file alway display "DexOpt: Some deps went away"
What Rom are you using?
But more important: Why do you want to do this?
If you using a deodexed rom, you don't need an odexed jar
ThaiDai said:
What Rom are you using?
But more important: Why do you want to do this?
Click to expand...
Click to collapse
offical rom:N7000ZSLO2_N7000OZSLO2_N7000XXLSO_HOME.tar
i want to add a recovery menu item.
now after update file,device status:
framework-res.apk OK
android.policy.jar fail
nokiamodeln91 said:
If you using a deodexed rom, you don't need an odexed jar
Click to expand...
Click to collapse
in framework folder,all is odex.so if i want to modify a jar, must need an odex file.i want to update file as little as possible.
update.
quywz said:
Code:
adb shell
su
busybox cp -f /data/local/tmp/odex/dexopt-wrapper /system/bin/dexopt-wrapper
chmod 755 /system/bin/dexopt-wrapper
busybox cp -f /system/framework/android.policy.jar /system/framework/android.policy.jar.bak
busybox cp -f /system/framework/android.policy.odex /system/framework/android.policy.odex.bak
rm /system/framework/android.policy.odex
busybox cp -f /data/local/tmp/odex/android.policy.jar /system/framework/android.policy.jar
dexopt-wrapper /system/framework/android.policy.jar /system/framework/android.policy.odex
busybox dd if=/system/framework/android.policy.odex.bak of=[COLOR="Red"][B]/data/local/tmp/odex/android.policy.odex[/B][/COLOR] bs=1 count=20 skip=52 seek=52 conv=notrunc
rm /system/framework/android.policy.jar
busybox cp -f /system/framework/android.policy.jar.bak /system/framework/android.policy.jar
rm /system/framework/android.policy.jar.bak
rm /system/framework/android.policy.odex.bak
chmod 644 /system/framework/android.policy.odex
reboot
Click to expand...
Click to collapse
Is there a reason you're copying the .odex signature to /data/local/tmp/odex/android.policy.odex instead of /system/framework/android.policy.odex ? With your script, /system/framework/android.policy.odex remains unsigned.
Einril said:
Is there a reason you're copying the .odex signature to /data/local/tmp/odex/android.policy.odex instead of /system/framework/android.policy.odex ? With your script, /system/framework/android.policy.odex remains unsigned.
Click to expand...
Click to collapse
sorry,In this thread,I write wrong.
The actual operation is "busybox dd if=/system/framework/android.policy.odex.bak of= /system/framework/android.policy.odex bs=1 count=20 skip=52 seek=52 conv=notrunc".but the result is same.
if=/system/framework/android.policy.odex.bak is input file.
of = /system/framework/android.policy.odex is output file.
copy .odex signature from /system/framework/android.policy.odex.bak to /system/framework/android.policy.odex.
quywz said:
sorry,In this thread,I forgot to copy "busybox cp -f /data/local/tmp/odex/android.policy.odex /system/framework/android.policy.odex".
The actual operation don't forgot.but the result is same.
Click to expand...
Click to collapse
So what you're doing is :
1. optimize /system/framework/android.policy.jar to create /system/framework/android.policy.odex
2. copy the signature from /system/framework/android.policy.odex.bak to /data/local/tmp/odex/android.policy.odex
3. copy /data/local/tmp/odex/android.policy.odex to /system/framework/android.policy.odex
Am I right ? If I am, you're deleting the .odex file created from android.policy.jar, and replacing it with another one.
Einril said:
So what you're doing is :
1. optimize /system/framework/android.policy.jar to create /system/framework/android.policy.odex
2. copy the signature from /system/framework/android.policy.odex.bak to /data/local/tmp/odex/android.policy.odex
3. copy /data/local/tmp/odex/android.policy.odex to /system/framework/android.policy.odex
Am I right ? If I am, you're deleting the .odex file created from android.policy.jar, and replacing it with another one.
Click to expand...
Click to collapse
sorry,In this thread,I write wrong.
The actual operation is "busybox dd if=/system/framework/android.policy.odex.bak of= /system/framework/android.policy.odex bs=1 count=20 skip=52 seek=52 conv=notrunc".but the result is same.
if=/system/framework/android.policy.odex.bak is input file.
of = /system/framework/android.policy.odex is output file.
copy .odex signature from /system/framework/android.policy.odex.bak to /system/framework/android.policy.odex.
1.right
2.copy .odex signature from /system/framework/android.policy.odex.bak to /system/framework/android.policy.odex.above is my copy wrong.
3.used new signed /system/framework/android.policy.odex.
4.reboot,device stay at logo frame
edit.invalid context
quywz said:
1.right
2.copy .odex signature from /system/framework/android.policy.odex.bak to /system/framework/android.policy.odex.above is my copy wrong.
3.used new signed /system/framework/android.policy.odex.
4.reboot,device stay at logo frame
Click to expand...
Click to collapse
Is the attached script the entire script ?
If it is, why are you only copying the .odex files from /data/local/tmp/odex/ to /system/framework/, and not android.policy.jar and framework.jar ?
Einril said:
Is the attached script the entire script ?
If it is, why are you only copying the .odex files from /data/local/tmp/odex/ to /system/framework/, and not android.policy.jar and framework.jar ?
Click to expand...
Click to collapse
yes,entire script.
somebody tell me "Pls use original jar".I tried to use new jar.but the result is same.:crying:
quywz said:
yes,entire script.
somebody tell me "Pls use original jar".I tried to use new jar.but the result is same.:crying:
Click to expand...
Click to collapse
You don't set the permissions for the files any longer. Is there a reason for that ? Permissions should be 644 I guess.
Einril said:
You don't set the permissions for the files any longer. Is there a reason for that ? Permissions should be 644 I guess.
Click to expand...
Click to collapse
I tried you said,isnt reason.I had set Permissions 755 and 777,all invalid :crying:
I dont understand why fail.I am finding reason....
quywz said:
I tried you said,isnt reason.I had set Permissions 755 and 777,all invalid :crying:
I dont understand why fail.I am finding reason....
Click to expand...
Click to collapse
Hum, I personally don't find any error in your script then... Maybe this is due to an error in the new files (framework-res.apk, framework.jar or android.policy.jar). I guess you modified them, and maybe you did some mistakes :/
Einril said:
Hum, I personally don't find any error in your script then... Maybe this is due to an error in the new files (framework-res.apk, framework.jar or android.policy.jar). I guess you modified them, and maybe you did some mistakes :/
Click to expand...
Click to collapse
thx.
I tried to update files one by one.after update framework-res.apk is ok.android.policy.jar is fail.so I dont modfiy android.policy.ja.then optimized it. updating android.policy.odex refer to attached script(not including framework part).but device is NG.
I dont find a NG reason.
Einril said:
Hum, I personally don't find any error in your script then... Maybe this is due to an error in the new files (framework-res.apk, framework.jar or android.policy.jar). I guess you modified them, and maybe you did some mistakes :/
Click to expand...
Click to collapse
today ,I found a problem.dexopt-wrapper android.policy.jar and get android.policy.odex.Compare origial android.policy.odex,we fond dex's magic is different.origial android.policy.odex is "dex035", new origial android.policy.odex is "dex036".if i manually modify different,device is still stay.I guss if i manually modify different,odex's checknum is wrong.what do lead to new odex's magic change?is API Level ?
quywz said:
today ,I found a problem.dexopt-wrapper android.policy.jar and get android.policy.odex.Compare origial android.policy.odex,we fond dex's magic is different.origial android.policy.odex is "dex035", new origial android.policy.odex is "dex036".if i manually modify different,device is still stay.I guss if i manually modify different,odex's checknum is wrong.what do lead to new odex's magic change?is API Level ?
Click to expand...
Click to collapse
In dexFile.h :
Code:
/* current version, encoded in 4 bytes of ASCII */
#define DEX_MAGIC_VERS "036\0"
/*
* older but still-recognized version (corresponding to Android API
* levels 13 and earlier
*/
#define DEX_MAGIC_VERS_API_13 "035\0"
So yes, your dexopt-wrapper uses an API level >= 14 (ICS and JB), whereas your original ROM file must be older.
Einril said:
In dexFile.h :
Code:
/* current version, encoded in 4 bytes of ASCII */
#define DEX_MAGIC_VERS "036\0"
/*
* older but still-recognized version (corresponding to Android API
* levels 13 and earlier
*/
#define DEX_MAGIC_VERS_API_13 "035\0"
So yes, your dexopt-wrapper uses an API level >= 14 (ICS and JB), whereas your original ROM file must be older.
Click to expand...
Click to collapse
offical rom version is 4.1.2.so API level should is 16.but extract odex from device is 035.
Related
Is it possible to odex a system before I compress it into a androidinstall and send it to my device to install?
If so how?
only way i have found to odex is through the phone
How do people release odex'ed builds then?
2 ways
1. if adb works push the odex script to /data run the scrpit (search odex donut or dzo's instructions on how to use it), then do an adb pull of /system then repack it into a .tar and go
2 adb doesnt work for me so here is how i do it, i load up my build and in the /data folder i have the odex script, i run the script using terminal emulator, then i restart after its finished and put in a blank sd card then i copy the app and framework folders from /system to the SD and replace those folders in the original .tar with the newly odex'd ones
I put the odex script into data and then added it to init
jholtom said:
Is it possible to odex a system before I compress it into a androidinstall and send it to my device to install?
If so how?
Click to expand...
Click to collapse
I asked dzo once and he answered me, in the Fresh Froyo thread. The search function isn't working right now, but when you read this it might be working. Another thread described things in more detail, but I long ago forgot where that thread is. I never got odexing to work outside the phone, but here is the script I have tried. Note that the dexpreopt.py python script has to be edited to mount system as read/write, or it completely fails. I run this after a complete build.
Code:
#! /bin/sh
. build/envsetup.sh
lunch us_vogue-userdebug
rm out/target/product/vogue/obj/PACKAGING/systemimage_unopt_intermediates/system.img
ONE_SHOT_MAKEFILE=/home/devel/android/build/tools/dexpreopt/Android.mk make -C /home/devel/android/ files
make
mkdir /tmp/system-odex
rm -rf /tmp/system-odex/system
cp -ra out/target/product/vogue/system /tmp/system-odex
dexpreopt.py --outsystemdir=/tmp/system-odex/system
for i in /tmp/system-odex/system/app/*.apk; do zipalign -f 4 $i /tmp/zip; mv /tmp/zip $i; done
tar -C /tmp/system-odex -czf odex.tgz system
n2rjt said:
I asked dzo once and he answered me, in the Fresh Froyo thread. The search function isn't working right now, but when you read this it might be working. Another thread described things in more detail, but I long ago forgot where that thread is. I never got odexing to work outside the phone, but here is the script I have tried. Note that the dexpreopt.py python script has to be edited to mount system as read/write, or it completely fails. I run this after a complete build.
Code:
#! /bin/sh
. build/envsetup.sh
lunch us_vogue-userdebug
rm out/target/product/vogue/obj/PACKAGING/systemimage_unopt_intermediates/system.img
ONE_SHOT_MAKEFILE=/home/devel/android/build/tools/dexpreopt/Android.mk make -C /home/devel/android/ files
make
mkdir /tmp/system-odex
rm -rf /tmp/system-odex/system
cp -ra out/target/product/vogue/system /tmp/system-odex
dexpreopt.py --outsystemdir=/tmp/system-odex/system
for i in /tmp/system-odex/system/app/*.apk; do zipalign -f 4 $i /tmp/zip; mv /tmp/zip $i; done
tar -C /tmp/system-odex -czf odex.tgz system
Click to expand...
Click to collapse
ok thanks
I'll work with it
Also there is a script I use to odex files as they are downloaded from the market or installed on the phone. It is inside of my barebones build and if you look inside my userinit from my build you will see the call to the file.
Edit: I do not take credit for it, I just claim to be a source of the file as I already have it.
Hi anyone,
Some things I want to discuss about.
1. DBDATA/databases
You should know that I include a update-script command to delete the /dbdata/databases folder in my ROM to prevent any App related problems.
But I think, since 2.2.1 this won't work anymore.
So does any ROM Dev has a workaround?
Or can someone confirm, that this works?
My update-script command:
Code:
delete_recursive DBDATA:databases
2. "rm" or "busybox rm" in a bash script?
When writing a script which gets executed from the update-script, do we need to use a simple "rm" or "busybox rm" for deleting files?
I'm not 100% sure, but I don't think that busybox is functional already?
My script:
Code:
#!/system/bin/sh
# Script written by darkyy // Joel Staub
# Script to prevent errors during the ROM installation
cd /sdcard
#/sdcard/Darky-Wallpaper
if [ -d "Darky-Wallpaper" ]; then
rm -r "Darky-Wallpaper"
fi
#/sdcard/Gingerbread_Keyboard
if [ -d "Gingerbread_Keyboard" ]; then
rm -r "Gingerbread_Keyboard"
fi
#/sdcard/launcherpro_backup
if [ -d "launcherpro_backup" ]; then
rm -r "launcherpro_backup"
fi
#/sdcard/Voodoo
if [ -d "Voodoo" ]; then
rm -r "Voodoo"
fi
#/sdcard/WindowsPhone7_Icons
if [ -d "WindowsPhone7_Icons" ]; then
rm -r "WindowsPhone7_Icons"
fi
"busybox rm" is the secure way when you need some functions of the busybox "rm" command, for example "rm -r".
If "rm" exists in /system/bin/ and a "rm" symlink to busybox in /system/xbin/, the shell chooses the one in /system/bin.
If the stock rm binary got removed it will work without busybox, but if not, "rm -r whatever" for example would fail.
Fr4gg0r said:
"busybox rm" is the secure way when you need some functions of the busybox "rm" command, for example "rm -r".
If "rm" exists in /system/bin/ and a "rm" symlink to busybox in /system/xbin/, the shell chooses the one in /system/bin.
If the stock rm binary got removed it will work without busybox, but if not, "rm -r whatever" for example would fail.
Click to expand...
Click to collapse
Thank you very much for this well-written answer.
So, does busybox work even when the ROM is installing?
*PUSH*
10char
Busybox works if the initramfs of the kernel used while installing has busybox. (Not the one included in the rom)
pawitp said:
Busybox works if the initramfs of the kernel used while installing has busybox. (Not the one included in the rom)
Click to expand...
Click to collapse
Thank you dude.
I finished with doing my "rm" commands with busybox.
Will be great for my ROM
Darkyy said:
Thank you dude.
I finished with doing my "rm" commands with busybox.
Will be great for my ROM
Click to expand...
Click to collapse
yes, busybox works even when installing rom
btw, to play safe, u need to chk if it is a symlink with -L, coz -d wont handle symlinks
ykk_five said:
yes, busybox works even when installing rom
btw, to play safe, u need to chk if it is a symlink with -L, coz -d wont handle symlinks
Click to expand...
Click to collapse
That's no problem
Thank you
Hey guys,
I had a nasty issue with Bi-Winning a couple weeks ago where I pushed custom framework and totally forgot about permissions. Apparently when you don't set the proper permissions it can really slow things down.
So I figured this could easily be avoided. So because of that and our CWM "Fix Permissions" option doesn't really do anything, I wrote this script to fix it!
Upon every boot, it will scan /system/app, /system/framework/, and /data/app and set the proper permissions for all the files in there.
Users
note if you're on Trigger 2.9.1+ or Bi-Winning V1+ you do NOT have to do this. It's built into your ROM already.
Flash the attached zip named "CWM_Flash_Permissions_Script.zip"
Ironically, it may not have the correct permissions after you flash it, so then do either of the following
1) Do these commands in ADB to set the correct permissions
Code:
adb shell
mount -o rw,remount /dev/block/stl9 /system
busybox chmod 777 /system/etc/init.d/*
or
2) Open up Root Explorer (or something similar)
navigate to /system/etc/init.d/
in there find the new file S30edt_perms
long press, and set the permissions
make it look like this
Code:
x x x
x x x
x x x
Here's the init.d script, it's really simple, but also effective
Code:
#!/system/bin/sh
# Permission script
# Written by Einherjar Dev Team
# www.edtdev.com
logFile=/data/edt/logs/S30edt_perms.log
if [ -f $logFile ]; then
rm $logFile
fi
touch $logFile
mount -o rw,remount /dev/block/stl9 /system
echo "Setting permissions" >> $logFile
for file in /system/app/* /system/framework/* /data/app/*; do
echo " setting permissions (644) for $file" >> $logFile
chmod 644 $file
done
echo "chmodding init.d folder"
chmod 777 /system/etc/init.d
for file in /system/etc/init.d/*; do
echo " setting permissions (777) for $file" >> $logFile
chmod 777 $file
done
echo "Permissions set" >> $logFile
Very cool, thanks roman.
Very cool to post the code too... lets us linux newbs get our learn on!
Poser said:
Very cool, thanks roman.
Very cool to post the code too... lets us linux newbs get our learn on!
Click to expand...
Click to collapse
I'm a Linux noobie myself!
birgertime said:
I'm a Linux noobie myself!
Click to expand...
Click to collapse
[slight OT] Just getting wifi working on an old ideapad y510 in slackware was an epic struggle... (wicd my arse)
[back on topic] I wish more devs would post script contents (though we can easily download and look in vi or notepad)... it helps the learning curve immensely
grateful for all the work EDT and rest of dev community does. We all are.
Question: What does the fix permissions CWM do then?
Poser said:
[slight OT] Just getting wifi working on an old ideapad y510 in slackware was an epic struggle... (wicd my arse)
[back on topic] I wish more devs would post script contents (though we can easily download and look in vi or notepad)... it helps the learning curve immensely
grateful for all the work EDT and rest of dev community does. We all are.
Question: What does the fix permissions CWM do then?
Click to expand...
Click to collapse
I have no clue, lol. Never bothered looking at it
edit: I hate vi.
roman im gonna add S30edt_perms.zip to my rom ..ill add you to credits
birgertime said:
I have no clue, lol. Never bothered looking at it
edit: I hate vi.
Click to expand...
Click to collapse
lol.
Vi is about as stripped down as you can get when it comes to text based editors... (I know its blasphemous... but I dig notepad++, shhh... dont tell)
I get "Bad Mode"
gamefreakgcb said:
I get "Bad Mode"
Click to expand...
Click to collapse
Hmm, ok you might need super user permissions do this and let me knkow if it works:
1) type in "adb shell"
2) type in su (don't press enter yet)
3) turn your screen on & unlock it
4) press enter on the su prompt, then his yes on the screen
then try that chmod command again.
birgertime said:
Hmm, ok you might need super user permissions do this and let me knkow if it works:
1) type in "adb shell"
2) type in su (don't press enter yet)
3) turn your screen on & unlock it
4) press enter on the su prompt, then his yes on the screen
then try that chmod command again.
Click to expand...
Click to collapse
Gave permission, still "Bad Mode"
gamefreakgcb said:
Gave permission, still "Bad Mode"
Click to expand...
Click to collapse
bad mode in the command line? gotta give me something more here
if it' s when you run chmod +x try this one:
Code:
busybox chmod 777 /system/etc/init.d/*
birgertime said:
bad mode in the command line? gotta give me something more here
if it' s when you run chmod +x try this one:
Code:
busybox chmod 777 /system/etc/init.d/*
Click to expand...
Click to collapse
When I do that, I get
chmod: /system/etc/init.d/S01edt_systcl: Read-only file system
chmod: /system/etc/init.d/S20edt_gps: Read-only file system
chmod: /system/etc/init.d/S30edt_perms: Read-only file system
chmod: /system/etc/init.d/S50edt_zipalign: Read-only file system
chmod: /system/etc/init.d/S98edt_tweaks: Read-only file system
chmod: /system/etc/init.d/S99edt_complete: Read-only file system
gamefreakgcb said:
When I do that, I get
chmod: /system/etc/init.d/S01edt_systcl: Read-only file system
chmod: /system/etc/init.d/S20edt_gps: Read-only file system
chmod: /system/etc/init.d/S30edt_perms: Read-only file system
chmod: /system/etc/init.d/S50edt_zipalign: Read-only file system
chmod: /system/etc/init.d/S98edt_tweaks: Read-only file system
chmod: /system/etc/init.d/S99edt_complete: Read-only file system
Click to expand...
Click to collapse
Oh crap, thanks for pointing that out man. Easy fix
do this
Code:
mount -o rw,remount /dev/block/stl9 /system
busybox chmod 777 /system/etc/init.d/*
should work like a charm
by the way, next time you flash a newer edt rom, they already have this fix built in. since you overwrote the file, you'll need to run the above commands to set the correct permissions as they get messed up sometimes when modifying them.
That did the trick, thanks.
The script in the .zip says
Code:
# Permission script
# Written by Roman (birgertime)
# www.edtdev.com
logFile=/data/edt/logs/S30edt_perms.log
if [ -f $logFile ]; then
rm $logFile
fi
touch $logFile
echo "Setting permissions" >> $logFile
for file in /system/app/* /system/framework/* /data/app/*; do
echo "setting permissions for $file" >> $logFile
chmod 0644 $file
done
echo "Permissions set" >> $logFile
Which is different than the OP. I'm confused.
MikeyMike01 said:
The script in the .zip says
Code:
# Permission script
# Written by Roman (birgertime)
# www.edtdev.com
logFile=/data/edt/logs/S30edt_perms.log
if [ -f $logFile ]; then
rm $logFile
fi
touch $logFile
echo "Setting permissions" >> $logFile
for file in /system/app/* /system/framework/* /data/app/*; do
echo "setting permissions for $file" >> $logFile
chmod 0644 $file
done
echo "Permissions set" >> $logFile
Which is different than the OP. I'm confused.
Click to expand...
Click to collapse
I notice that before... but got side tracked and forgot to mention something... I just pulled the one from in Bi-Winning V2 and have been ADB Push'ing that.
EDIT: Also noticed that the one that's in Dan_Brutal "Metrik Part 1- Pepperkake" is the wrong one.
Does this works on hd2 android? i really need this..
haysnamrip said:
Does this works on hd2 android? i really need this..
Click to expand...
Click to collapse
Should work on any Android that can run scripts
i flashed and its working.. no more changing permission after run fix_permissins on terminal emulator..
Hey Roman, thanks for yet another improvement for this phone!
Simple question: can I just download and push the S30edt_perms.zip to etc/int.d? And is this any good for CM7 based ROMs? I just checked and that file isn't in my init.d folder on Trigger Redux.
Thanks!
Sent from my rough sketch of a Vibrant on a brick.
refer to GUID(http://forum.xda-developers.com/showthread.php?t=2125196) to add recovery menu item.
1.Update framework-res.apk to device.device status is ok(reboot and device can normal go into os).
2.use dexopt-wrapper reodex ,get android.policy.odex
3.copy android.policy.odex to /system/framework/android.policy.odex and set 644 permissions
4.reboot device and stay at samsung logo frame
5.attach file is logcat information.The log file alway display "DexOpt: Some deps went away"
Code:
adb shell
su
busybox cp -f /data/local/tmp/odex/dexopt-wrapper /system/bin/dexopt-wrapper
chmod 755 /system/bin/dexopt-wrapper
busybox cp -f /system/framework/android.policy.jar /system/framework/android.policy.jar.bak
busybox cp -f /system/framework/android.policy.odex /system/framework/android.policy.odex.bak
rm /system/framework/android.policy.odex
busybox cp -f /data/local/tmp/odex/android.policy.jar /system/framework/android.policy.jar
dexopt-wrapper /system/framework/android.policy.jar /system/framework/android.policy.odex
busybox dd if=/system/framework/android.policy.odex.bak of= /system/framework/android.policy.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
rm /system/framework/android.policy.jar
busybox cp -f /system/framework/android.policy.jar.bak /system/framework/android.policy.jar
rm /system/framework/android.policy.jar.bak
rm /system/framework/android.policy.odex.bak
chmod 644 /system/framework/android.policy.odex
reboot
Stop opening more threads related to the same problem, please.
You have already your problem here and there and here again.
WORKS ON ALL ANDROID PHONES, YOUR ROM MUST BE ODEXED!!!
*I am not responsible for anything that happens to your device after flashing this zip file*
*Use at your own risk*
Click to expand...
Click to collapse
Hello Everyone!
Today I present to you, the ODEX Script.
Odexes the following folders. /data/app, /system/app, /system/priv-app
What this basically does is odex all of the apps you downloaded or apps that are in the /system/app folder
Benefits:-
1) Apps load faster
2) Apps work better
3) Decreased boot time ;P
HOW TO INSTALL?
1) Download the zip file
2) Flash it
3) It is recommended, but not required for this
Clear Cache and Dalvik Cache
4) Open Terminal Emulator. Download it if you don't have it.
*Please do not leave the terminal until the script is done.
Thank you
5) Type "su" then "odex"
6) RESTART TO APPLY CHANGES
6) Enjoy ))
Click to expand...
Click to collapse
Changelog:-
02v:- Odex all apps in /system/app folder.
No need to restart to fix the apps that have been odexed.
No more error reporting.
01v:- First Version
The Script:-
#!/system/xbin/bash
echo "RESTART TO APPLY CHANGES"
echo "Remounting /system/ as rw"
mount -o remount,rw /system
sleep 5
echo "Starting Odexing Apps"
echo "Starting in /data/app folder..."
echo "Started at $( date )"
echo "Deleting /data/app odex files"
sleep 1
echo ""
for y in $( find /data/app -name *.odex); do
rm $y
echo "Deleted $y"
done
echo "Deleting /system/app odex files"
sleep 1
echo ""
for x in $( find /system/app -name *.odex); do
rm $x
echo "Deleted $x"
done
for i in $( ls /data/app ); do
echo $i
o="${i%.*}.odex"
echo $o
if [ "$i" != "mcRegistry" ]; then
dexopt-wrapper "/data/app/$i" "/data/app/$o"
chmod 644 "/data/app/$i"
chmod 644 "/data/app/$o"
fi
done
echo "Finished Completing /data/app Folder"
echo ""
echo "Odexing /system/app folder"
sleep 3
for i in $( ls /system/app ); do
echo $i
o="${i%.*}.odex"
dexopt-wrapper "/system/app/$i" "/system/app/$o"
chmod 644 "/system/app/$i"
chmod 644 "/system/app/$o"
done
echo "Done running the script, current date is $( date )"
sleep 1
Click to expand...
Click to collapse
So things like updates, will it replace the odex file? Or delete it?
Verstuurd vanaf mijn SM-G900F met Tapatalk
Sock12345 said:
So things like updates, will it replace the odex file? Or delete it?
Verstuurd vanaf mijn SM-G900F met Tapatalk
Click to expand...
Click to collapse
I believe it keeps it, not sure though.
But if you run my script, it deletes the odex. Then remakes it.
la2o said:
I believe it keeps it, not sure though.
But if you run my script, it deletes the odex. Then remakes it.
Click to expand...
Click to collapse
So every time my apps gets updated through playstore i need to run "odex" command again?
bervin said:
So every time my apps gets updated through playstore i need to run "odex" command again?
Click to expand...
Click to collapse
I don't think so, you don't need to run it every time it app updates
I recommend to run the command every 2 weeks - a month