#! /system/bin/shThen, the task to update them just needs to execute this script with one of three options.
case "$1" in
-z)
site=http://zoom.dinglisch.net/beta.html
file=/data/data/net.dinglisch.android.zoom/shared_prefs/state.xml
current=$(basename $(wget -q -O - $site | sed 's/\"/\n/g' | grep -m 1 '/releases/Zoom.'))
installed=Zoom.$(grep 'string name="lv"' $file | sed 's#<[^>]*>##g').apk
if echo $installed | grep -q $current
then echo "same" > /sdcard/Tasker/updater
else echo "$current" > /sdcard/Tasker/updater
fi
;;
-tm)
site=http://tasker.dinglisch.net/beta.html
file=/data/data/net.dinglisch.android.taskerm/shared_prefs/net.dinglisch.android.tasker.statey.xml
current=$(basename $(wget -q -O - $site | sed 's/\"/\n/g' | grep "http://tasker.dinglisch.net/releases" | grep m))
installed=Tasker.$(grep 'string name="lvn"' $file | sed 's#<[^>]*>##g').apk
if echo $installed | grep -q $current
then echo "same" > /sdcard/Tasker/updater
else echo "$current" > /sdcard/Tasker/updater
fi
;;
-t)
site=http://tasker.dinglisch.net/beta.html
file=/data/data/net.dinglisch.android.taskerm/shared_prefs/net.dinglisch.android.tasker.statey.xml
current=$(basename $(wget -q -O - $site | sed 's/\"/\n/g' | grep "http://tasker.dinglisch.net/releases" | grep -v m))
installed=Tasker.$(grep 'string name="lvn"' $file | sed 's#<[^>]*>##g').apk
if echo $installed | grep -q $current
then echo "same" > /sdcard/Tasker/updater
else echo "$current" > /sdcard/Tasker/updater
fi
;;
*)
echo "auto updater for Tasker/Zoom betas
-z check for Zoom update.
-t check for Tasker update, non Market version
-tm check for Tasker Market version update
This script checks the Tasker or Zoom beta website
for the newest version and writes it to a file if it's
newer than the installed version. See
http://a-more-common-hades.blogspot.com
for a Tasker task to utilize this script"
;;
esac
-z check for Zoom update.
-t check for Tasker update, non Market version
-tm check for Tasker Market version update
I called the script "updateTZ" so the command I run is updateTZ -tm to check for the latest beta of the market version.
The Tasks are pretty simple but instead of pasting them here, I uploaded the two tasks to update Tasker and Zoom here at mediafire.com: http://www.mediafire.com/?fejn05a2uypvv. If you name the script anything else, or are using the non-market version of Tasker, you'll need to change the Locale Execute Plugin command accordingly.
If the currently installed version is up to date, the tasks flash "Tasker (or Zoom) is still up to date." If a new version is available, it downloads it then tries to open the downloaded file, which goes into the system install screen where you have to click "ok" to install.
Note: the current version of zoom, 1.0a8, has the wrong version information. It is still called 1.0a7 in the app so the zoom task won't currently work, it will keep seeing the app as an older version and update it.