Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Backup script for 3c toolbox system apps. Automatically re-add the 3c toolbox system app and helper apk to/system/priv-app when installing a new nightly. If you don't install 3c toolbox to system partition and this causes a problem, remove line 13.
#!/sbin/sh
#
# /system/addon.d/99-3ctoolbox.sh
# During a CM12.1 upgrade, this script backs up 3c toolbox apks
# installed in /system/priv-app, /system is formatted and
# reinstalled, then the files are restored.
#
. /tmp/backuptool.functions
list_files() {
cat <<EOF
system/priv-app/ccc71.at.apk
system/priv-app/ATSystem.apk
EOF
}
case "$1" in
backup)
list_files | while read FILE DUMMY; do
backup_file $S/"$FILE"
done
;;
restore)
list_files | while read FILE REPLACEMENT; do
R=""
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
[ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
done
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment