Sample Header Ad - 728x90

SH Script to Rename .apk.odex files

0 votes
1 answer
948 views
I have written a script to utilize dexopt-wrapper to odex a folder of .apk's #!/bin/sh SYSAPP=/mnt/extSdCard/FilesToOdex/system/app/ SYSPRIVAPP=/mnt/extSdCard/FilesToOdex/system/priv-app/ for i1 in $SYSAPP*.apk ; do echo "Odexing $i1..." dexopt-wrapper $i1 $i1.odex done for i2 in $SYSPRIVAPP*.apk ; do echo "Odexing $i2..." dexopt-wrapper $i2 $i2.odex done for file1 in $SYSAPP*.apk.odex; do mv "$file1" "basename $file1 .apk.odex$file1.odex" done for file2 in $SYSPRIVAPP*.apk.odex; do mv "$file2" "basename $file2 .apk.odex$file2.odex" done The odexing part works, but as you can see it creates a bunch of .apk.odex files So my question is: 1. How can I setup the odexing portion to not write the files out as *.apk.odex? 2. **OR**, How can I get the mv to properly rename the *.apk.odex files to be just *.odex files? I tried: for file1 in $SYSAPP*.apk.odex; do mv "${file1}" "${file1%.odex}" done for file2 in $SYSPRIVAPP*.apk.odex; do mv "${file2}" "${file2%.odex}" done but it turned all my .apk.odex files to .apk
Asked by Kevin (209 rep)
May 20, 2014, 12:58 PM
Last activity: May 20, 2014, 02:55 PM