summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Ball <nullspoon@oper.io>2017-10-25 00:08:19 -0600
committerAaron Ball <nullspoon@oper.io>2017-10-25 00:08:19 -0600
commit0bd5365440d500fe4357293d7a880a95a8642e18 (patch)
tree395f92c6e4b4f5a028122ee82f84281f9e07313f
parentb9347c64bc9598150f714ff10e25e1e6825d4958 (diff)
downloadandbackup-0bd5365440d500fe4357293d7a880a95a8642e18.tar.gz
andbackup-0bd5365440d500fe4357293d7a880a95a8642e18.tar.xz
Fixed bug in non-existent apks
Prevoiusly, we didn't check if the apk destination backup directory existed before trying to copy it in. That means that new applications will fail backup of the installer apk. Now we create the parent directory first. Also, now we check if the apk is available on the system itself. In some cases such as with system apps, the installer apk is not in an expected location. Backing up installers for system apks is pointless anyways because /system is mounted as readonly most of the time, so re-installation at a later date couldn't happen without some workarounds.
-rwxr-xr-xandbackup.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/andbackup.sh b/andbackup.sh
index 51b41eb..86fdefa 100755
--- a/andbackup.sh
+++ b/andbackup.sh
@@ -124,10 +124,10 @@ backup_app() {
# No need to stop the application because we're in recovery mode
# Create backup destination if not exist
- [ ! -d "${backups}" ] && mkdir -p "${backups}"
+ [ ! -d "${backups}/${app}" ] && mkdir -p "${backups}/${app}"
# Backup the apk file if it exists
- if [ ! -z "${apk}" ]; then
+ if [ ! -z "${apk}" ] && [ -f "${apk}" ]; then
# Delete the old backup first
# There is a permissions issue querk when the backup was originall taken in
# recovery mode, but later is taken in android (Permission denied for no

Generated by cgit