diff --git a/.gitattributes b/.gitattributes
old mode 100755
new mode 100644
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
old mode 100755
new mode 100644
diff --git a/.gitignore b/.gitignore
old mode 100755
new mode 100644
diff --git a/License.md b/License.md
old mode 100755
new mode 100644
diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary
old mode 100755
new mode 100644
index f28aa9d..28b48e5
--- a/META-INF/com/google/android/update-binary
+++ b/META-INF/com/google/android/update-binary
@@ -11,7 +11,7 @@ ui_print() { echo "$1"; }
require_new_magisk() {
ui_print "*******************************"
- ui_print " Please install Magisk v20.0+! "
+ ui_print " Please install Magisk v20.4+! "
ui_print "*******************************"
exit 1
}
@@ -27,170 +27,7 @@ mount /data 2>/dev/null
[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk
. /data/adb/magisk/util_functions.sh
-[ $MAGISK_VER_CODE -lt 20000 ] && require_new_magisk
+[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk
-if [ $MAGISK_VER_CODE -ge 20400 ]; then
- # New Magisk have complete installation logic within util_functions.sh
- install_module
- exit 0
-fi
-
-#################
-# Legacy Support
-#################
-
-TMPDIR=/dev/tmp
-PERSISTDIR=/sbin/.magisk/mirror/persist
-
-is_legacy_script() {
- unzip -l "$ZIPFILE" install.sh | grep -q install.sh
- return $?
-}
-
-print_modname() {
- local authlen len namelen pounds
- namelen=`echo -n $MODNAME | wc -c`
- authlen=$((`echo -n $MODAUTH | wc -c` + 3))
- [ $namelen -gt $authlen ] && len=$namelen || len=$authlen
- len=$((len + 2))
- pounds=$(printf "%${len}s" | tr ' ' '*')
- ui_print "$pounds"
- ui_print " $MODNAME "
- ui_print " by $MODAUTH "
- ui_print "$pounds"
- ui_print "*******************"
- ui_print " Powered by Magisk "
- ui_print "*******************"
-}
-
-# Override abort as old scripts have some issues
-abort() {
- ui_print "$1"
- $BOOTMODE || recovery_cleanup
- [ -n $MODPATH ] && rm -rf $MODPATH
- rm -rf $TMPDIR
- exit 1
-}
-
-rm -rf $TMPDIR 2>/dev/null
-mkdir -p $TMPDIR
-
-# Preperation for flashable zips
-setup_flashable
-
-# Mount partitions
-mount_partitions
-
-# Detect version and architecture
-api_level_arch_detect
-
-# Setup busybox and binaries
-$BOOTMODE && boot_actions || recovery_actions
-
-##############
-# Preparation
-##############
-
-# Extract prop file
-unzip -o "$ZIPFILE" module.prop -d $TMPDIR >&2
-[ ! -f $TMPDIR/module.prop ] && abort "! Unable to extract zip file!"
-
-$BOOTMODE && MODDIRNAME=modules_update || MODDIRNAME=modules
-MODULEROOT=$NVBASE/$MODDIRNAME
-MODID=`grep_prop id $TMPDIR/module.prop`
-MODNAME=`grep_prop name $TMPDIR/module.prop`
-MODAUTH=`grep_prop author $TMPDIR/module.prop`
-MODPATH=$MODULEROOT/$MODID
-
-# Create mod paths
-rm -rf $MODPATH 2>/dev/null
-mkdir -p $MODPATH
-
-##########
-# Install
-##########
-
-if is_legacy_script; then
- unzip -oj "$ZIPFILE" module.prop install.sh uninstall.sh 'common/*' -d $TMPDIR >&2
-
- # Load install script
- . $TMPDIR/install.sh
-
- # Callbacks
- print_modname
- on_install
-
- # Custom uninstaller
- [ -f $TMPDIR/uninstall.sh ] && cp -af $TMPDIR/uninstall.sh $MODPATH/uninstall.sh
-
- # Skip mount
- $SKIPMOUNT && touch $MODPATH/skip_mount
-
- # prop file
- $PROPFILE && cp -af $TMPDIR/system.prop $MODPATH/system.prop
-
- # Module info
- cp -af $TMPDIR/module.prop $MODPATH/module.prop
-
- # post-fs-data scripts
- $POSTFSDATA && cp -af $TMPDIR/post-fs-data.sh $MODPATH/post-fs-data.sh
-
- # service scripts
- $LATESTARTSERVICE && cp -af $TMPDIR/service.sh $MODPATH/service.sh
-
- ui_print "- Setting permissions"
- set_permissions
-else
- print_modname
-
- unzip -o "$ZIPFILE" customize.sh -d $MODPATH >&2
-
- if ! grep -q '^SKIPUNZIP=1$' $MODPATH/customize.sh 2>/dev/null; then
- ui_print "- Extracting module files"
- unzip -o "$ZIPFILE" -x 'META-INF/*' -d $MODPATH >&2
-
- # Default permissions
- set_perm_recursive $MODPATH 0 0 0755 0644
- fi
-
- # Load customization script
- [ -f $MODPATH/customize.sh ] && . $MODPATH/customize.sh
-fi
-
-# Handle replace folders
-for TARGET in $REPLACE; do
- ui_print "- Replace target: $TARGET"
- mktouch $MODPATH$TARGET/.replace
-done
-
-if $BOOTMODE; then
- # Update info for Magisk Manager
- mktouch $NVBASE/modules/$MODID/update
- cp -af $MODPATH/module.prop $NVBASE/modules/$MODID/module.prop
-fi
-
-# Copy over custom sepolicy rules
-if [ -f $MODPATH/sepolicy.rule -a -e $PERSISTDIR ]; then
- ui_print "- Installing custom sepolicy patch"
- # Remove old recovery logs (which may be filling partition) to make room
- rm -f $PERSISTDIR/cache/recovery/*
- PERSISTMOD=$PERSISTDIR/magisk/$MODID
- mkdir -p $PERSISTMOD
- cp -af $MODPATH/sepolicy.rule $PERSISTMOD/sepolicy.rule || abort "! Insufficient partition size"
-fi
-
-# Remove stuffs that don't belong to modules
-rm -rf \
-$MODPATH/system/placeholder $MODPATH/customize.sh \
-$MODPATH/README.md $MODPATH/.git* 2>/dev/null
-
-#############
-# Finalizing
-#############
-
-cd /
-$BOOTMODE || recovery_cleanup
-rm -rf $TMPDIR
-
-ui_print "- Done"
+install_module
exit 0
diff --git a/META-INF/com/google/android/updater-script b/META-INF/com/google/android/updater-script
old mode 100755
new mode 100644
diff --git a/README.md b/README.md
index 5ee3591..1182509 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
# Migrator - A Backup Solution and Data Migration Utility for Android
-Install as a regular Magisk module (no reboot required, though).
+Install as a regular Magisk module - no reboot required, though.
If `M` and `migrator` executables are unavailable before a reboot, use `/dev/M` or `/dev/migrator`.
-`migrator.sh` can be extracted from the root of the zip and used as is (e.g., `su -c sh migrator.sh`).
+`migrator` can be extracted from the root of the zip and used as is (e.g., `su -c sh migrator`).
Busybox is required on systems not rooted with Magisk.
The binary can simply be placed in `/data/adb/bin/`.
@@ -14,12 +14,6 @@ The binary can simply be placed in `/data/adb/bin/`.
## CHANGELOG
```
-v2020.9.24-beta (202009240)
-
-- Do not remount / rw if it's not tmpfs.
-- Fixed backup import issue.
-
-
v2020.9.13-beta.1 (202009131)
- Enhanced system data backup and restore logic.
@@ -33,51 +27,44 @@ Release Notes
- Nothing was done in regards to the "MIUI 12" bootloop issue. The root cause is still unknown.
-v2020.9.11-beta (202009110)
-
-- "-m" option and M sub-option (as in -beM) to move hard link backups to internal sdcard, so that they survive factory resets.
-When launched without the -m (move) option, Migrator automatically moves hard link backups back to /data/migrator/local/, for convenience.
-/data/migrator/ is inconvenient, but more private than /data/media/ and /data/media/0/.
-
-- Auto-generate sample /sdcard/Download/migrator/packages.list.
-
-- Backup/restore LineageOS-specific Android settings as well.
+v2020.9.24-beta (202009240)
-- copy README.md to /sdcard/Download/migrator/.
+- Do not remount / rw if it's not tmpfs.
+- Fixed backup import issue.
-- Enforce Unix line endings (LF) in /data/migrator.conf before parsing it.
-This ensures config files written on Windows Notepad or other CRLF-loving editors still work as expected.
-- Exported backups are now imported to local/ as opposed to imported/ in /data/migrator/.
-This means the "i" flag, as in -ri is no longer necessary/valid.
+v2021.7.16-beta (202107160)
-- Fixed: "migrator" executable inaccessible or not found.
+- APKs are no longer hard-linked (crash due to SELinux).
+- Data dir is /sdcard/Documents/vr25/migrator/.
+- Exclude thumbnails, input method and adb settings from backups.
+- General optimizations
+- Installer prints changelog and other info.
+- Inverted changelog order.
+- Move option is -M to prevent confusion (formerly -m).
+- Updated documentation & bundled terminal.
-- Removed long options (e.g., --backup --app) to reduce overhead.
-Other performance enhancements were made on top of that.
+Merged pull request #5 from SebastianApel/master
-- System data (D) is no longer hard-linked.
-Regular copies are made instead.
-Android dislikes otherwise.
+ Enhancements:
-- Two flags changed: A --> b (both (app and data)), E --> e (everything).
+ - Backup /data/media/0/Android/data/${pkg} [used for pictures by ch.threema.app]
+ - And also restore it later into the correct location (including setting the correct user & perms)
+ - Also backup widget configuration and roles of apps into _sysdata
+ - Wifi Config is at a different location in Android 11 - make sure it's backed up
+ - Better approach to restoring _sysdata (handle case where file does not exist [in some cases])
-- Updated documentation.
-This includes data migrator tutorial, flag mnemonics (e.g., -rb = restore both (app and data)) and more.
-As hard as the text may seem, read the damn thing anyway and give me some feedback on it... please!
+ Bugfixes:
-Release Notes
- - MIUI users who face the "reboot to fastboot" issue should refrain from flashing the zip for now.
- - I recommend extracting zip_file/migrator.sh and running it as is - until the cause of that issue is identified and eliminated.
- - Usage example: "su -c sh /path/to/migrator.sh -be"
- - An alias can be appended to Termux's .bashrc to save time and effort, e.g., alias M="su -c sh /sdcard/Download/migrator.sh".
+ - In recovery mode, /data/user/0 does not exist (at least on my phone) - /data/data works
+ - Apps were crashing without RestoreCon of /data/data/$pkg - added that
```
---
## LICENSE
-Copyright 2018-2020, VR25
+Copyright 2018-present, VR25 @ xda-developers
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -93,13 +80,32 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
+---
+## Donations
+
+
+- [Liberapay](https://liberapay.com/VR25/)
+- [Patreon](https://patreon.com/vr25/)
+- [PayPal](https://paypal.me/vr25xda/)
+
+
+---
+## Online Support
+
+
+- [Facebook page](https://fb.me/vr25xda/)
+- [Git repository](https://github.com/VR-25/acc/)
+- [Telegram channel](https://t.me/vr25_xda/)
+- [Telegram group](https://t.me/migrator_group/)
+
+
---
## --help
```
-Migrator v2020.9.24-beta (202009240)
+Migrator v2021.7.16-beta (202107160)
A Backup Solution and Data Migration Utility for Android
-Copyright 2018-2020, VR25
+Copyright 2018-present, VR25 @ xda-developers
License: GPLv3+
@@ -120,7 +126,7 @@ M is a migrator alias.
OPTIONS[flags]
Backup
--b[abdDemMns] [regex|-v regex] [[+ file or full pkg names] | [/path/to/list] | [-- for /sdcard/Download/migrator/packages.list]]
+-b[abdDemMns] [regex|-v regex] [[+ file or full pkg names] | [/path/to/list] | [-- for /sdcard/Documents/vr25/migrator/packages.list]]
Delete local backups
-d <"bkp name (wildcards supported)" ...>
@@ -135,11 +141,11 @@ Import backups
List backups
-l [regex|-v regex]
-Export logs to /sdcard/Download/migrator/migrator.log.bz2
+Export logs to /sdcard/Documents/vr25/migrator/migrator.log.bz2
-L
Make hard link backups immune to factory resets
--m
+-M
Force all apps to reregister for push notifications (Google Cloud Messaging)
-n
@@ -160,7 +166,7 @@ D: system data
m: magisk data
M: move /data/migrator to internal sdcard
s: settings (global, secure and system)
-e: everything (-be = -bADms, -re = -rAms)
+e: everything (-be = -bbDms, -re = -rbms)
i: interactive (-ei, -ii)
n: not backed up (-bn) or not installed (-rn)
@@ -186,7 +192,7 @@ Backup everything
migrator -be + $(pm list packages -s | sed 's/^package://')
Backup everything, except system apps and move /data/migrator to internal sdcard, so that hard link backups survive factory resets
-When launched without the -m (move) option, Migrator automatically moves hard link backups back to /data/migrator/local, for convenience
+When launched without the -M (move) option, Migrator automatically moves hard link backups back to /data/migrator/local, for convenience
migrator -beM
Backup all users apps' data (d)
@@ -198,7 +204,7 @@ migrator -d \*
Delete Facebook Lite and Instagram backups
migrator -d "*facebook.lite*" "*instag*"
-Export all backups to /sdcard/Download/migrator/exported/
+Export all backups to /sdcard/Documents/vr25/migrator/exported/
migrator -e
... To /storage/XXXX-XXXX/migrator_exported
@@ -207,7 +213,7 @@ migrator -e -d /storage/XXXX-XXXX
Interactive export
migrator -ei
-Import all backups from /sdcard/Download/migrator/exported
+Import all backups from /sdcard/Documents/vr25/migrator/exported
migrator -i
... From /storage/XXXX-XXXX/migrator_exported
@@ -249,7 +255,7 @@ migrator -rn
Migrator can backup/restore apps (a), respective data (d) and runtime permissions.
-The order of secondary options is irrelevent (e.g., -rda = -rad, "a" and "d" are secondary options).
+The order of secondary options is irrelevant (e.g., -rda = -rad, "a" and "d" are secondary options).
Everything in /data/adb/, except magisk/ is considered "Magisk data" (m).
After restoring such data, one has to launch Magisk Manager and disable/remove all modules that are or may be incompatible with the [new] ROM.
@@ -270,7 +276,7 @@ Backups are stored in /data/migrator/local/.
These take virtually no extra storage space (hard links).
Backups can be exported as individual [compressed] archives (highly recommended).
-Data is exported to /sdcard/Download/migrator/exported/ by default - and imported to "/data/migrator/local/".
+Data is exported to /sdcard/Documents/vr25/migrator/exported/ by default - and imported to "/data/migrator/local/".
The default compression method is (.tar file).
Method here refers to " " (e.g., "zstd -1").
The decompression/extraction method to use is automatically determined based on file extension.
@@ -339,7 +345,7 @@ Notes
- If you have to format data, export backups to external storage after step 1 below (-e -d /storage/XXXX-XXXX) and later import with -i -d storage/XXXX-XXXX).
- If you use a different root method, ignore Magisk-related steps.
- In "-beM", the "M" sub-option means "move hard link backups to internal sdcard, so that they survive factory resets".
- When launched without the -m (move) option (i.e., migrator -m), Migrator automatically moves hard link backups back to /data/migrator/local/, for convenience.
+ When launched without the -M (move) option (i.e., migrator -M), Migrator automatically moves hard link backups back to /data/migrator/local/, for convenience.
- Using a terminal emulator app other than NetHunter means you have to exclude it from backups/restores or detach migrator from it.
1. Backup everything, except system apps: "migrator -beM".
@@ -361,14 +367,19 @@ SYSTEM DATA (D)
If you find any issue after restoring system data (-rD), remove the associated files with "su -c rm ".
/data/system_?e/0/accounts_?e.db*
-/data/misc/adb/adb_keys
-/data/misc/bluedroid/bt_config.conf
+/data/system/sync/accounts.xml
+/data/misc/bluedroid/bt_config.*
+/data/misc/apexdata/com.android.wifi/WifiConfigStoreSoftAp.xml
+/data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
/data/misc/wifi/WifiConfigStore.xml
/data/misc/wifi/softap.conf
/data/system/xlua/xlua.db*
/data/system/users/0/photo.png
+/data/system/users/0/appwidgets.xml
+/data/system/users/0/roles.xml
/data/system/users/0/wallpaper*
-/data/user*/0/com.android.*provider*/databases/*.db*
+/data/user_de/0/com.android.*provider*/databases/*.db*
+/data/data/com.android.*provider*/databases/*.db*
/data/system/deviceidle.xml
diff --git a/TODO.txt b/TODO.txt
index 980af3b..f3470a2 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,10 +1,14 @@
-Find and bundle static ccrypt binaries
+find and bundle static ccrypt binaries
GMS "can't read media"?
-Wizard
+wizard
-Some /data/adb/ symlinks (e.g., /data/adb/acc) are not backed up/restored
+some /data/adb/ symlinks (e.g., /data/adb/acc) are not backed up/restored
-Issue on MIUI ROMs? Dirty flash required after Migrator install/upgrade?
- automatic backups not working?
+automatic backups not working on MIUI?
+
+export backups directly (no hard-links)
+ [some] devices have issues with secontexts
+
+filter out cache and thumbnail for *_media/files/
diff --git a/customize.sh b/customize.sh
old mode 100755
new mode 100644
index b96e231..21d8af0
--- a/customize.sh
+++ b/customize.sh
@@ -72,18 +72,35 @@ $BOOTMODE && ! test -d /data/data/com.offsec.nhterm && {
pm install $MODPATH/system/app/com.offsec.nhterm/com.offsec.nhterm.apk > /dev/null
}
+
# copy README;
-data_dir=/sdcard/Download/migrator
+data_dir=/sdcard/Documents/vr25/migrator
mkdir -p $data_dir
+mv -f /sdcard/Download/migrator/* $data_dir 2>/dev/null \
+ && rmdir /sdcard/Download/migrator # migrate old data_dir
cp -f $MODPATH/README.md $data_dir/
+
# generate a sample packages.list
test -f $data_dir/packages.list \
|| echo "# Parsed by M -b --
# Any package, including system's can be listed here
-# Extended grep regex is supported - meaning, writing full package nanes is not strictly necessary
+# Extended grep regex is supported - meaning, writing full package names is not strictly necessary
# For convenience/intuitiveness a comma can be used in place of '|', for alternation
inputmethod.latin
providers.userdictionary
chrome,youtube,d.vending" > $data_dir/packages.list
+
+
+# print changelog
+
+ui_print "- Done
+- Rebooting is not required
+- If regular commands don't work, try \"sh /data/M\"
+
+
+CHANGELOG
+
+$(sed -En "/^## CHANGELOG/,/^## LICENSE/p" $data_dir/README.md | grep -Ev '^---|^## |^```')"
+ui_print() { :; }
diff --git a/migrator.sh b/migrator.sh
index e958335..11e70ac 100644
--- a/migrator.sh
+++ b/migrator.sh
@@ -1,7 +1,7 @@
#!/system/bin/sh
# Migrator
# A Backup Solution and Data Migration Utility for Android
-# Copyright 2018-2020, VR25
+# Copyright 2018-present, VR25 @ xda-developers
# License: GPLv3+
@@ -14,9 +14,9 @@ ssaid=false
log=/dev/migrator.log
tmp=/dev/migrator.tmp
bkp_dir=/data/migrator/local
-data_dir=/sdcard/Download/migrator
+data_dir=/sdcard/Documents/vr25/migrator
packages=/data/system/packages.
-version="v2020.9.24-beta (202009240)"
+version="v2021.7.16-beta (202107160)"
ssaid_xml_tmp=/dev/.settings_ssaid.xml.tmp
settings=/data/system/users/0/settings_
ssaid_xml=${settings}ssaid.xml
@@ -24,7 +24,6 @@ ssaid_boot_script=${bkp_dir%/*}/enable-ssaid-apps.sh
sysdata="/data/system_?e/0/accounts_?e.db*
/data/system/sync/accounts.xml
-/data/misc/adb/adb*_keys*
/data/misc/bluedroid/bt_config.*
/data/misc/apexdata/com.android.wifi/WifiConfigStoreSoftAp.xml
/data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
@@ -39,6 +38,9 @@ sysdata="/data/system_?e/0/accounts_?e.db*
/data/data/com.android.*provider*/databases/*.db*
/data/system/deviceidle.xml"
+# excluded system data
+#/data/misc/adb/adb*_keys*
+
get_apk_dir() {
grep " name=\"$1\" codePath=" ${packages}xml \
@@ -107,7 +109,7 @@ tt "${1-}" "-B|-L" || {
# prepare busybox and extra executables
bin_dir=/data/adb/bin
-busybox_dir=/dev/.busybox
+busybox_dir=/dev/.vr25/busybox
magisk_busybox=/data/adb/magisk/busybox
[ -x $busybox_dir/ls ] || {
@@ -131,6 +133,19 @@ export PATH="$bin_dir:$busybox_dir:/data/adb/modules_update/migrator/bin:/data/a
unset bin_dir busybox_dir magisk_busybox
+# "rsync -t --inplace --no-W" wrapper
+which rsync > /dev/null || \
+ rsync() {
+ shift 3
+ tt "$2" "*/" && mkdir -p "$2"
+ if tt "$1" "*/"; then
+ cp -Rduf "$1"* "$1".* "$2" 2>/dev/null
+ else
+ cp -Rduf "$1" "$2"
+ fi
+ }
+
+
param1=${1-}
t -n "$param1" && shift
@@ -295,26 +310,37 @@ case "$param1" in
# backup app
app=false
if $both || tt "$param1" "-b*[ae]*"; then
- rm $bkp_dir/$pkg/*.apk
- ln $(get_apk_dir $pkg)/*.apk $bkp_dir/$pkg/ && {
+ if t -f $(get_apk_dir $pkg)/base.apk; then
app=true
printf " $pkg\n App\n"
- }
- fi 2>/dev/null
+ rsync -t --inplace --no-W $(get_apk_dir $pkg)/*.apk $bkp_dir/$pkg/ 2>/dev/null
+ fi
+ for f in $bkp_dir/$pkg/*.apk; do
+ t -f $(get_apk_dir $pkg)/${f##*/} || rm $f
+ done
+ # legacy
+ # APK hard links do not play nice with SELinux
+ # rm $bkp_dir/$pkg/*.apk
+ # ln $(get_apk_dir $pkg)/*.apk $bkp_dir/$pkg/ && {
+ # app=true
+ # printf " $pkg\n App\n"
+ # }
+ # fi 2>/dev/null
+ fi
# backup data
if $both || tt "$param1" "-b*[de]*"; then
$app && echo " Data" || printf " $pkg\n Data\n"
- killall -STOP $pkg > /dev/null 2>&1
rm -rf $bkp_dir/$pkg/$pkg $bkp_dir/$pkg/${pkg}_de $bkp_dir/$pkg/${pkg}_media 2>/dev/null
- mkdir $bkp_dir/$pkg/$pkg $bkp_dir/$pkg/${pkg}_de $bkp_dir/$pkg/${pkg}_media
+ #mkdir $bkp_dir/$pkg/$pkg $bkp_dir/$pkg/${pkg}_de $bkp_dir/$pkg/${pkg}_media # rsync [wrapper] will handle this
: > $bkp_dir/$pkg/modes.txt
for e in /data/data/${pkg}::$pkg /data/user_de/0/${pkg}::${pkg}_de /data/media/0/Android/data/${pkg}::${pkg}_media; do
ls -1d ${e%::*}/* ${e%::*}/.* 2>/dev/null \
- | grep -Ev '/\.$|/\.\.$|/app_optimized|/app_tmp|/cache$|/code_cache$|/dex$|/lib$|oat$' | \
+ | grep -Eiv '/\.$|/\.\.$|/app_optimized|/app_tmp|cache|/dex$|/lib$|oat$|thumbnail' | \
while IFS= read -r i; do
t -z "$i" && continue
- cp -dlR "$i" $bkp_dir/$pkg/${e#*::}/
+ #cp -dlR "$i" $bkp_dir/$pkg/${e#*::}/
+ rsync -rtl --inplace --no-W "$i" $bkp_dir/$pkg/${e#*::}/
find "$i" -print0 2>/dev/null | xargs -0 -n 10 stat -c "%a %n" \
>> $bkp_dir/$pkg/modes.txt
done
@@ -375,6 +401,8 @@ case "$param1" in
done
fi
fi
+ # exclude input method settings to prevent "no keyboard" issue
+ sed -i /inputmethod/d $bkp_dir/_settings/secure.txt
fi
# backup system data
@@ -424,7 +452,7 @@ case "$param1" in
t $param1 = -B && ssaid_only=false || ssaid_only=true
- until t -d /sdcard/Download \
+ until t -d /sdcard/Documents \
&& t .$(getprop sys.boot_completed 2>/dev/null) = .1 \
&& pm list packages -s > /dev/null 2>&1
do
@@ -625,7 +653,7 @@ case "$param1" in
;;
- -m) # make hard link backups immune to factory resets
+ -M) # make hard link backups immune to factory resets
mv_bkps
;;
@@ -939,7 +967,7 @@ case "$param1" in
cat <".
-/data/system_?e/0/accounts_?e.db*
-/data/misc/adb/adb_keys
-/data/misc/bluedroid/bt_config.conf
-/data/misc/wifi/WifiConfigStore.xml
-/data/misc/wifi/softap.conf
-/data/system/xlua/xlua.db*
-/data/system/users/0/photo.png
-/data/system/users/0/wallpaper*
-/data/user*/0/com.android.*provider*/databases/*.db*
-/data/system/deviceidle.xml
+$sysdata
ASSORTED NOTES & TIPS
diff --git a/service.sh b/service.sh
old mode 100755
new mode 100644
index d6a6bbc..400b0d7
--- a/service.sh
+++ b/service.sh
@@ -1,5 +1,5 @@
#!/system/bin/sh
-# enable apps with Settings.Secure.ANDROID_ID (SSAID) and start automatic backups (if enabled)
+# enable apps with Settings.Secure.ANDROID_ID (SSAID) and start backup daemon (if enabled)
-/data/adb/magisk/busybox start-stop-daemon -bx ${0%/*}/migrator.sh -S -- -B
+start-stop-daemon -bx ${0%/*}/migrator.sh -S -- -B || (${0%/*}/migrator.sh -B) &
exit 0
diff --git a/system/app/com.offsec.nhterm/com.offsec.nhterm.apk b/system/app/com.offsec.nhterm/com.offsec.nhterm.apk
index b83f236..0c6ab80 100644
Binary files a/system/app/com.offsec.nhterm/com.offsec.nhterm.apk and b/system/app/com.offsec.nhterm/com.offsec.nhterm.apk differ