├── .gitattributes
├── LICENSE
├── META-INF
└── com
│ └── google
│ └── android
│ ├── update-binary
│ └── updater-script
├── README.md
├── ReadMe.txt
├── assets
├── .gitkeep
├── 2023-02-26_16-00-21.png
├── 2023-02-26_20-59-33.png
├── 2023-02-26_21-00-29.png
├── Screenshot_20230226-130051.png
├── Screenshot_Folders_databackup_20220420-224223.png
└── Screenshot_inside_databackup_20220420-224252.png
├── changelog.md
├── customize.sh
├── module.json
├── module.prop
└── system
└── bin
└── data_backup.sh
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Set the default behavior, in case people don't have core.autocrlf set
2 | * text eol=lf
3 |
4 | # DB files protection
5 | *.db binary
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 ziand
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/META-INF/com/google/android/update-binary:
--------------------------------------------------------------------------------
1 | #!/sbin/sh
2 |
3 | #################
4 | # Initialization
5 | #################
6 |
7 | umask 022
8 |
9 | # echo before loading util_functions
10 | ui_print() { echo "$1"; }
11 |
12 | require_new_magisk() {
13 | ui_print "*******************************"
14 | ui_print " Please install Magisk v20.4+! "
15 | ui_print "*******************************"
16 | exit 1
17 | }
18 |
19 | #########################
20 | # Load util_functions.sh
21 | #########################
22 |
23 | OUTFD=$2
24 | ZIPFILE=$3
25 |
26 | mount /data 2>/dev/null
27 |
28 | [ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk
29 | . /data/adb/magisk/util_functions.sh
30 | [ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk
31 |
32 | install_module
33 | exit 0
34 |
--------------------------------------------------------------------------------
/META-INF/com/google/android/updater-script:
--------------------------------------------------------------------------------
1 | #MAGISK
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # data_backup
3 |
4 | > _Download releases_: https://github.com/Magisk-Modules-Alt-Repo/data_backup/releases
5 |
6 | ## Introduction
7 |
8 | Script of creating User Data backup from booted system with root (subsequent restoring by  script).
9 |
10 | ### ***Advantages***
11 |
12 | - creating and restoring data backup in the absence of TWRP for the device;
13 | - a great opportunity to create a full backup with the contents of the internal memory or part of it, allowing you to restore an exact copy without reconfiguring the user after restoring;
14 | - the speed of archiving and restoring is much more higher than TWRP;
15 | - launch from a PC (useful when the display is crashed to take the backup);
16 | - the ability to restore a backup created on a newly released version of Android, in the case when there is no TWRP for this Android yet;
17 | - automatic needed reboot at the first login after restoring the backup in the presence of root;
18 | - the presence of various options for creating / restoring a backup;
19 | - the ability to restore a backup without TWRP from booted system with root;
20 | - the universality of the method for different models of brands of devices on different versions of Android.
21 |
22 | ### ***Screenshots***
23 |
24 |
25 |
26 | ## Supported devices
27 |
28 | ### ***First-grade support***
29 |
30 | on my hands:
31 | - Google Pixels
32 | - HTC
33 |
34 | ### ***Others***
35 |
36 | - Asus Rog Phone
37 |
38 | some:
39 | - Xiaomi, POCO
40 |
41 | ## Requirement
42 |
43 | - Android 7+
44 | - Magisk 20.4+
45 | - Optionally: Windows, macOS or Linux PC with [Android Platform Tools](https://developer.android.com/studio/command-line/adb) installed
46 | - Optionally: External storage device (extSD or USB-OTG)
47 |
48 | ## Installing script
49 |
50 | The script data_backup.sh will be integrated into the system by installing a Magisk module data_backup_v2.xx-MAGISK.zip.
51 | - Download the module and copy it to internal storage.
52 | - In the Magisk App: Modules - Install from storage - select the downloaded module .zip - Reboot. Done, now you can use it.
53 |
54 | ## Running script
55 |
56 | There are 2 variants for running script, from device or PC therminal.
57 | 1. Main variant: From ***Android therminal***, for example [Material Terminal](https://play.google.com/store/apps/details?id=yarolegovich.materialterminal&pli=1) or another.
58 |
59 | `su`
60 |
61 | `data_backup.sh`
62 |
63 | 2. From ***PC therminal*** :
64 |
65 | `adb shell`
66 |
67 | `su`
68 |
69 | `data_backup.sh`
70 |
71 | ## Parameters at starting
72 |
73 | ### ***Without parameters*** (main & default)
74 |
75 | The script will make data backup with all contents of internal device memory, except for folders of archives itself data backup and folders TWRP with backups.
76 |
77 | ### ***Parameters***
78 |
79 | ***#1***
80 |
81 | `-e <...>` - to ***exclude*** from archive one or several catalogues of internal memory. Folders are listed through a blank.
82 | > NOTE: _Paths named with blanks accordingly are not supposed !_
83 | >
84 | Example 1.1: `data_backup.sh -e DCIM Download Pictures/Screenshots My_Music`
85 |
86 | There is posible to specify folders names with ***Pattern Matching:***
87 |
88 | Example 1.2: `data_backup.sh -M -e DCIM *ownload Pictures/Screen* iG[oO]* [mW]*`
89 |
90 | where:
91 |
92 | `*ownload` - folders names in the root of intSD with "ownload" in the end of names;
93 |
94 | `Pictures/Screen*` - all subdirectories beginning on "Screen" in catalogue "Pictures" of internal SD;
95 |
96 | `iG[oO]*` - all catalogues beginning on iGo without sensitivity the register of the letter "o";
97 |
98 | `[mW]*` - names begin on letters "m" or "W".
99 |
100 |
101 | ***#2***
102 |
103 | `-m` - to exclude from created backup ALL content of the internal storage. This variant is similar as official TWRPs create data backups (without ***media***).
104 |
105 | Example: `data_backup.sh -m`
106 |
107 | ***#3***
108 |
109 | `-M` - forced creation of ***Multy-volume*** backup on any storage device in exFAT format for possible coping and restoring from the external SD in FAT32.
110 |
111 | This key is not obligatory at backuping directly on external SD in FAT32 because in this case the script automatically creates Multivolume archive up to 4GB of each volume.
112 |
113 | The key, as the first specified, can be used together with key `-m` or `-e ...`.
114 |
115 | Example: `data_backup.sh -M -e Download`
116 |
117 | ***#4***
118 |
119 | `-h` - to show ***help*** message and exit.
120 |
121 | ## Created files
122 |
123 | The backup is saving into folder `databackup` in the root of a storage device.
124 | In case of next backuping, the folder `databackup` of a previous backup is automatically renamed to `databackup_` :
125 |
128 |
129 |
130 |
131 | Inside databackup folder there are files for a latest backup :
132 | - `data*.tar` - archive files of the backup;
133 | - `check_sum.sha1` - hash-file of archive files data*.tar;
134 | - `datarestore.log` - log-file of restoring user data;
135 | - `databackup.log` - log-file of backuping user data.
136 |
137 | File databackup.log has info for correct restoring backup:
138 |
139 |
140 |
141 | - backuping date;
142 | - system software number;
143 | - including intSD (yes/no);
144 | - excluding folders from intSD;
145 | - Magisk version;
146 | - screen settings.
147 |
148 | In the end of the file there is info about successful backuping or error code (in last case data*.tar archives will be deleted).
149 |
150 | > **Warning**
151 | > - Restoring backup is ONLY from the folder `databackup` in the root of a storage.
152 | > - Do not rename the folder and data*.tar files !
153 | > - Any editing of the archive data*.tar files is not allowed for correct restoring !
154 |
155 | ## Features of script working
156 |
157 | - Data backup automatically will be created on external storage device if it is mounted. First the script is looking for mounted USB-OTG, then extSD and after intSD. You can unmount external SDs for creating the backup on internal SD.
158 | - If external SD in FAT32, the backup will be created automatically by Multy-volume archive files up to 4GB of each.
159 | - To avoid error 1, do not use your smartphone and do not switch off the screen during backuping.
160 | - After starting the script switches on Air plane mode, reduces the screen brightness.
161 | - Running calculating hash-checksum will be started in the background after successful backuping, Air plane mode will be switched off, screen settings will be restored. At this time you can use your device.
162 | - User itself has to check if enough free space for backup.
163 | - Save created backup on intSD by copying databackup folder somewhere to PC, cloud and so on.
164 |
165 | ## Probable mistakes
166 |
167 | - Backup will not be saved at any error during backuping.
168 | - Error 2: "Failure. Error 2. Not enough place on storage device". Care about enough free place.
169 | - Error 1: "Failure. Error 1". It means about other mistakes of recording on a storage device. Do not use your device and do not switch off a screen during backuping. Restart data backup cript.
170 |
171 | ## Additional info:
172 |
173 | - Magisk Modules Alternative Repository: https://github.com/Magisk-Modules-Alt-Repo/data_backup
174 | - A link of script attachments: https://github.com/ziandzivan/attachments_of_data_backup
175 |
--------------------------------------------------------------------------------
/ReadMe.txt:
--------------------------------------------------------------------------------
1 | # Data backup creator description :
2 | # https://4pda.to/forum/index.php?showtopic=1014571&view=findpost&p=114462143
3 |
4 | Мои разработки включают несколько проектов на xda и 4pda и некоторые спрашивают как меня поощрить, поэтому оставлю здесь:
5 | Только на добровольной основе если кто желает поддержать меня за бессоные ночи, может пополнить баланс моего спец. мобильного телефоного на чашку кофе в 2..3$ :
6 | +375 29 6454817 A1.BY Беларусь. Пополнить баланс можно из почти любой страны мира, РФ, Укр,.. У большинства можно в своем банковском приложении, KIWI, и т.д.
7 | Желательно сообщить об этом в личку 4pda. Спасибо за поддержку.
8 |
9 | My development work on my many projects comes out of my free time, so if you enjoy some my project or anything else I have done. For a one-time donation you can hit the donate
10 | to add few bucks for a cup of coffee to my cell phone balance: +375 29 6454817 A1.BY Republic of Belarus.
11 | Thank you for your support.
12 |
13 |
--------------------------------------------------------------------------------
/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/assets/2023-02-26_16-00-21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ziandzivan/data_backup/187cd37f3ec8e6af09808380391babe35e5f0010/assets/2023-02-26_16-00-21.png
--------------------------------------------------------------------------------
/assets/2023-02-26_20-59-33.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ziandzivan/data_backup/187cd37f3ec8e6af09808380391babe35e5f0010/assets/2023-02-26_20-59-33.png
--------------------------------------------------------------------------------
/assets/2023-02-26_21-00-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ziandzivan/data_backup/187cd37f3ec8e6af09808380391babe35e5f0010/assets/2023-02-26_21-00-29.png
--------------------------------------------------------------------------------
/assets/Screenshot_20230226-130051.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ziandzivan/data_backup/187cd37f3ec8e6af09808380391babe35e5f0010/assets/Screenshot_20230226-130051.png
--------------------------------------------------------------------------------
/assets/Screenshot_Folders_databackup_20220420-224223.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ziandzivan/data_backup/187cd37f3ec8e6af09808380391babe35e5f0010/assets/Screenshot_Folders_databackup_20220420-224223.png
--------------------------------------------------------------------------------
/assets/Screenshot_inside_databackup_20220420-224252.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ziandzivan/data_backup/187cd37f3ec8e6af09808380391babe35e5f0010/assets/Screenshot_inside_databackup_20220420-224252.png
--------------------------------------------------------------------------------
/changelog.md:
--------------------------------------------------------------------------------
1 |
2 | 2.11
3 | - Initial release
4 |
5 | 2.12
6 | - check-version for deleting
--------------------------------------------------------------------------------
/customize.sh:
--------------------------------------------------------------------------------
1 | # Make module binaries executable (needed for some magisk versions such as 20.4 )
2 |
3 | set_perm $MODPATH/system/bin/data_backup.sh 0 0 0755
4 |
--------------------------------------------------------------------------------
/module.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "v2.11",
3 | "versionCode": 4,
4 | "zipUrl": "https://github.com/ziandzivan/data_backup/releases/download/v2.11/data_backup_v2.11-MAGISK.zip",
5 | "changelog": "https://raw.githubusercontent.com/ziandzivan/data_backup/main/changelog.md"
6 | }
--------------------------------------------------------------------------------
/module.prop:
--------------------------------------------------------------------------------
1 | id=data_backup
2 | name=Data backup creator
3 | version=v2.11
4 | versionCode=4
5 | author=ziand
6 | description=Data backup creator for restoring by data_restore.zip from or Magisk module installer or TWRP
7 | updateJson=https://raw.githubusercontent.com/ziandzivan/data_backup/main/module.json
8 |
--------------------------------------------------------------------------------
/system/bin/data_backup.sh:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ziandzivan/data_backup/187cd37f3ec8e6af09808380391babe35e5f0010/system/bin/data_backup.sh
--------------------------------------------------------------------------------