RE-Odex ROM (Flashable Zip in CWM)

Search This thread

androidphone2012

Senior Member
Feb 11, 2012
385
410
Original thread (zman0900) : http://xdaforums.com/showthread.php?t=1441293

I just slightly modified.

ROM, Google Apps, MODs .... Now for the daily drive? Just Flash this zip in CWM. (Don't flash in TWRP. Not working with that)

The attached files are just examples. If you're running that ROM, flash that zip matches the name. That's all.

Otherwise, you can modify odex.sh in zip.

1) Red

BOOTCLASSPATH found in init.rc on your device's root. Or extract boot.img then you can find that in the ramdisk.

2) Blue

Looking above add or remove

e.g. CM10.1
Code:
#!/tmp/busybox sh

export PATH=/tmp:$PATH
export BOOTCLASSPATH=[COLOR="Red"]/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar[/COLOR]

# Order matters here, up to BOOTCLASSPATH
FRAMEWORK="[COLOR="Blue"]/system/framework/core.jar
/system/framework/core-junit.jar
/system/framework/bouncycastle.jar
/system/framework/ext.jar
/system/framework/framework.jar
/system/framework/telephony-common.jar
/system/framework/mms-common.jar
/system/framework/android.policy.jar
/system/framework/services.jar
/system/framework/apache-xml.jar[/COLOR]"

# Odex Framework Rest
REST="/system/framework/*.jar"

# Odex apps
APPS="/system/app/*.apk"

# Set up busybox symlinks
for i in $(busybox --list)
do
	ln -s busybox /tmp/$i
done

# Framework
for i in $FRAMEWORK
do
	odex=`echo $i | sed -e 's/.jar/.odex/g'`
	dexopt-wrapper $i $odex
	zip -d $i classes.dex
done

# Framework Rest
for i in $REST
do
	odex=`echo $i | sed -e 's/.jar/.odex/g'`
	dexopt-wrapper $i $odex
	zip -d $i classes.dex
done

# System apps
for i in $APPS
do
	odex=`echo $i | sed -e 's/.apk/.odex/g'`
	dexopt-wrapper $i $odex
	zip -d $i classes.dex
done

# wipe Dalvik-cache
rm -rf /data/dalvik-cache
rm -rf /cache/dalvik-cache
 

Attachments

  • Odex-ROM_for.CM7.2.0.zip
    980.3 KB · Views: 311
  • Odex-ROM_for.CM9.zip
    980.3 KB · Views: 234
  • Odex-ROM_for.CM10.zip
    980.3 KB · Views: 281
  • Odex-ROM_for.CM10.1.zip
    980.3 KB · Views: 644
  • Odex-ROM_for.CM10.2.zip
    980.3 KB · Views: 666
Last edited:

androidphone2012

Senior Member
Feb 11, 2012
385
410
As for TWRP

Dees_Troy said:
The copy of dexopt-wrapper that you have included in the zip is dynamically linked. This means that the binary is using libraries from /system/lib in order to run. You may run into problems with this binary working on some ROMs as variances in libraries may fail to link properly with your binary. The reason it doesn't work with TWRP is because TWRP is dynamically linked and TWRP is usually set up to prevent linking to libraries in /system. The best practice would be to build your own dexopt-wrapper binary that is statically linked so that it doesn't need any outside libraries to run.
 
  • Like
Reactions: idroid2324

eushaun99

Senior Member
Feb 8, 2013
2,014
970
25
Subang Jaya
For aokp 4.2.2 I assume is cm10.1 zip? BTW, I just flashed it on a cm10.1 based ROM, I thought /system/app should have odex files? I only see core.odex in /system/framework.

Sent from my GT-P7500 using XDA Premium HD app
 

rmsinaga

Senior Member
Mar 13, 2011
385
152
What's the benefit of having framework being odex-ed?
Will this work on SlimROM which is AOSP & CM based?
Thanks
 

androidphone2012

Senior Member
Feb 11, 2012
385
410
What's the benefit of having framework being odex-ed?...
http://xdaforums.com/showthread.php?p=20281743

http://xdaforums.com/showthread.php?t=1423118

http://xdaforums.com/showthread.php?t=2200349

http://xdaforums.com/showthread.php?t=1443957

...
Will this work on SlimROM which is AOSP & CM based?
...

On any device and Android version, this can work

Before flashing, check your init.rc. If different, edit odex.sh in zip.
 
  • Like
Reactions: rmsinaga

androidphone2012

Senior Member
Feb 11, 2012
385
410

Attachments

  • Odex-ROM_for.CM7.2_alt.zip
    950 KB · Views: 12
  • Odex-ROM_for.CM9_alt.zip
    950 KB · Views: 11
  • Odex-ROM_for.CM10_alt.zip
    950 KB · Views: 15
  • Odex-ROM_for.CM10.1_alt.zip
    950 KB · Views: 39
  • Odex-ROM_for.CM10.2_alt.zip
    950 KB · Views: 51
Last edited:

UnitedOceanic

Senior Member
Nov 14, 2010
342
118
this looks really nice!

i was thinking, system apps don't need there libs anymore there are saved in /system/lib. could the script be extended to remove the lib just like the dex file?
 

ph03n!x

Senior Member
Dec 18, 2010
2,177
1,615
Works perfect with TWRP 2.6.0.1 on the N7100 with Carbon (CM 10.1 base)...
 

Top Liked Posts

  • There are no posts matching your filters.
  • 20
    Original thread (zman0900) : http://xdaforums.com/showthread.php?t=1441293

    I just slightly modified.

    ROM, Google Apps, MODs .... Now for the daily drive? Just Flash this zip in CWM. (Don't flash in TWRP. Not working with that)

    The attached files are just examples. If you're running that ROM, flash that zip matches the name. That's all.

    Otherwise, you can modify odex.sh in zip.

    1) Red

    BOOTCLASSPATH found in init.rc on your device's root. Or extract boot.img then you can find that in the ramdisk.

    2) Blue

    Looking above add or remove

    e.g. CM10.1
    Code:
    #!/tmp/busybox sh
    
    export PATH=/tmp:$PATH
    export BOOTCLASSPATH=[COLOR="Red"]/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar[/COLOR]
    
    # Order matters here, up to BOOTCLASSPATH
    FRAMEWORK="[COLOR="Blue"]/system/framework/core.jar
    /system/framework/core-junit.jar
    /system/framework/bouncycastle.jar
    /system/framework/ext.jar
    /system/framework/framework.jar
    /system/framework/telephony-common.jar
    /system/framework/mms-common.jar
    /system/framework/android.policy.jar
    /system/framework/services.jar
    /system/framework/apache-xml.jar[/COLOR]"
    
    # Odex Framework Rest
    REST="/system/framework/*.jar"
    
    # Odex apps
    APPS="/system/app/*.apk"
    
    # Set up busybox symlinks
    for i in $(busybox --list)
    do
    	ln -s busybox /tmp/$i
    done
    
    # Framework
    for i in $FRAMEWORK
    do
    	odex=`echo $i | sed -e 's/.jar/.odex/g'`
    	dexopt-wrapper $i $odex
    	zip -d $i classes.dex
    done
    
    # Framework Rest
    for i in $REST
    do
    	odex=`echo $i | sed -e 's/.jar/.odex/g'`
    	dexopt-wrapper $i $odex
    	zip -d $i classes.dex
    done
    
    # System apps
    for i in $APPS
    do
    	odex=`echo $i | sed -e 's/.apk/.odex/g'`
    	dexopt-wrapper $i $odex
    	zip -d $i classes.dex
    done
    
    # wipe Dalvik-cache
    rm -rf /data/dalvik-cache
    rm -rf /cache/dalvik-cache
    3
    The zip for CM10.2 (Android 4.3) added in OP
    1
    As for TWRP

    Dees_Troy said:
    The copy of dexopt-wrapper that you have included in the zip is dynamically linked. This means that the binary is using libraries from /system/lib in order to run. You may run into problems with this binary working on some ROMs as variances in libraries may fail to link properly with your binary. The reason it doesn't work with TWRP is because TWRP is dynamically linked and TWRP is usually set up to prevent linking to libraries in /system. The best practice would be to build your own dexopt-wrapper binary that is statically linked so that it doesn't need any outside libraries to run.
    1
    can work this script for nexus 4?

    On any device and Android version, this can work

    Before flashing, check your init.rc
    1
    Armeabi. Check your phone ABOUT

    Sent from my GT-I9205 using XDA Premium 4 mobile app