| # Functions for backuptool.sh |
| # symlinks don't have a context |
| # it is assumed that every label starts with 'u:object_r' and has no white-spaces |
| local context=`ls -Z "$1" | grep -o 'u:object_r:[^ ]*' | head -1` |
| if [ -e "$1" -o -L "$1" ]; then |
| # dont backup any apps that have odex files, they are useless |
| if ( echo "$F" | grep -q "\.apk$" ) && [ -e `echo "$1" | sed -e 's/\.apk$/\.odex/'` ]; then |
| echo "Skipping odexed apk $1"; |
| copy_file "$1" "$C/$D/$F" |
| local FILE=`basename "$1"` |
| if [ -e "$C/$DIR/$FILE" -o -L "$C/$DIR/$FILE" ]; then |
| copy_file "$C/$DIR/$FILE" "$1"; |
| echo "Deleting obsolete file $2" |