Hello ! I tried to fix your scripts and they work normally. I didn't find a fix for the Entropy Engine, I will do researches about it later. Just in case, test them and tell me the results !
Fixed SQlite script :
Code:#!/system/bin/sh # "THE THING" also know as "TIM" # (c) 2015 - By _Bon_Bon@XDA # # insert some useless info [HERE] # and [HERE] ;P TIM=/data/The_Thing/Sqlite_Vacuum&Reindex.log # Interval between SQLite3 runs, in seconds, 172800=48 hours RUN_EVERY=172800 if [ -e $TIM ]; then LASTRUN=`stat -t $The_Thing | awk '{print $14}'` else LASTRUN=0 fi; CURRDATE=`date +%s` INTERVAL=$(expr $CURRDATE - $LASTRUN) if [ $INTERVAL -gt $RUN_EVERY ]; then if [ -e $TIM ]; then rm $TIM; fi; echo "SQLite database VACUUM and REINDEX started at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $TIM; for i in \ `busybox find /data -iname "*.db"`; do \ /system/xbin/sqlite3 $i 'VACUUM;'; /system/xbin/sqlite3 $i 'REINDEX;'; done; if [ -d "/dbdata" ]; then for i in \ `busybox find /dbdata -iname "*.db"`; do \ /system/xbin/sqlite3 $i 'VACUUM;'; /system/xbin/sqlite3 $i 'REINDEX;'; done; fi; if [ -d "/datadata" ]; then for i in \ `busybox find /datadata -iname "*.db"`; do \ /system/xbin/sqlite3 $i 'VACUUM;'; /system/xbin/sqlite3 $i 'REINDEX;'; done; fi; for i in \ `busybox find /sdcard -iname "*.db"`; do \ /system/xbin/sqlite3 $i 'VACUUM;'; /system/xbin/sqlite3 $i 'REINDEX;'; done; echo "SQLite database VACUUM and REINDEX finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $TIM; fi;[/hide]
Fixed zipalign script :
Code:#!/system/bin/sh # "THE THING" also know as "TIM" # (c) 2015 - By _Bon_Bon@XDA # # insert some useless info [HERE] # and [HERE] ;P TIM=/data/The_Thing/Zipaligner.log ZIPALIGNDB=/data/zipalign.db # Interval between SQLite3 runs, in seconds, 172800=48 hours RUN_EVERY=86400 if [ -e $TIM ]; then rm $TIM; fi; if [ ! -f $ZIPALIGNDB ]; then touch $ZIPALIGNDB; fi; echo "Started Zipalign at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $TIM; #-- Zipaling /data echo "Zipaligning /data" | tee -a $TIM; for DIR in /data/app; do cd $DIR; for APK in *.apk; do if [ $APK -ot $ZIPALIGNDB ] && [ $(grep "$DIR/$APK" $ZIPALIGNDB|wc -l) -gt 0 ]; then echo "Already checked: $DIR/$APK" | tee -a $TIM; else ZIPCHECK=`/system/xbin/zipalign -c -v 4 $APK | grep FAILED | wc -l`; if [ $ZIPCHECK == "1" ]; then echo "Now aligning: $DIR/$APK" | tee -a $TIM; /system/xbin/zipalign -f 4 $APK /data/local/$APK; rc = "$?"; if [ $rc -eq 0 ]; then if [ -e "/data/local/$APK" ]; then cp -f -p "/data/local/$APK" "$APK" | tee -a $TIM; rm -f "/data/local/$APK"; grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB; else echo "ZipAligning $APK Failed (no output file)" | tee -a $TIM; fi; else [ -f "/data/local/$APK" ] && rm -f "/data/local/$APK" echo "ZipAligning $APK Failed (rc: $rc)" | tee -a $TIM; fi; else echo "Already aligned: $DIR/$APK" | tee -a $TIM; grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB; fi; fi; done; done; #-- Zipalign /system echo "Zipaligning /system" | tee -a $TIM; for DIR in /system/app; do cd $DIR; for APK in *.apk; do if [ $APK -ot $ZIPALIGNDB ] && [ $(grep "$DIR/$APK" $ZIPALIGNDB|wc -l) -gt 0 ]; then echo "Already checked: $DIR/$APK" | tee -a $TIM; else ZIPCHECK=`/system/xbin/zipalign -c -v 4 $APK | grep FAILED | wc -l`; if [ $ZIPCHECK == "1" ]; then echo "Now aligning: $DIR/$APK" | tee -a $TIM; /system/xbin/zipalign -f 4 $APK /data/local/$APK; rc = "$?"; if [ $rc -eq 0 ]; then if [ -e "/data/local/$APK" ]; then cp -f -p "/data/local/$APK" "$APK" | tee -a $TIM; rm -f "/data/local/$APK"; grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB; else echo "ZipAligning $APK Failed (no output file)" | tee -a $TIM; fi; else [ -f "/data/local/$APK" ] && rm -f "/data/local/$APK" echo "ZipAligning $APK Failed (rc: $rc)" | tee -a $TIM; fi; else echo "Already aligned: $DIR/$APK" | tee -a $TIM; grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB; fi; fi; done; done; for DIR in /system/priv-app; do cd $DIR; for APK in *.apk; do if [ $APK -ot $ZIPALIGNDB ] && [ $(grep "$DIR/$APK" $ZIPALIGNDB|wc -l) -gt 0 ]; then echo "Already checked: $DIR/$APK" | tee -a $TIM; else ZIPCHECK=`/system/xbin/zipalign -c -v 4 $APK | grep FAILED | wc -l`; if [ $ZIPCHECK == "1" ]; then echo "Now aligning: $DIR/$APK" | tee -a $TIM; /system/xbin/zipalign -f 4 $APK /data/local/$APK; rc = "$?"; if [ $rc -eq 0 ]; then if [ -e "/data/local/$APK" ]; then cp -f -p "/data/local/$APK" "$APK" | tee -a $TIM; rm -f "/data/local/$APK"; grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB; else echo "ZipAligning $APK Failed (no output file)" | tee -a $TIM; fi; else [ -f "/data/local/$APK" ] && rm -f "/data/local/$APK" echo "ZipAligning $APK Failed (rc: $rc)" | tee -a $TIM; fi; else echo "Already aligned: $DIR/$APK" | tee -a $TIM; grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB; fi; fi; done; done; touch $ZIPALIGNDB; echo "Zipaligning finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $TIM;
Thanks a lot for this
I'll give them a go for sure!
And don't worry i got the Entropy script fixed earlier today, that's why I updated the change log
I'll come back into action tomorrow with some awesome "Timyfication" scripts! HYPE