Using Tasker facilities to help back up and restore *all* device settings?

96 views
Skip to first unread message

Soudane GMTA

unread,
Oct 1, 2023, 1:53:19 PM10/1/23
to Tasker
Now that Google has "improved" (ha ha!) recent versions of Android to the point that it's extremely difficult to develop something like TWRP or OrangeFox which can perform nandroid backups and restores, I'm looking for a way to back up and restore *all* device settings (not just application-specific settings) on my rooted Android 13 device which is running the latest beta version of Tasker. Note that there are no TWRP nor OrangeFox releases which work on my device.

Are there any facilities that Tasker offers that I can use (perhaps along with other software) to create some sort of utilility for backing up and restoring all of my device settings?

Thank you in advance for any ideas and suggestions.

Soudane GMTA

unread,
Oct 1, 2023, 2:00:38 PM10/1/23
to Tasker
PS: I want these proposed Settings backups to be saved locally, and not on the cloud.

Soudane GMTA

unread,
Oct 3, 2023, 12:09:21 PM10/3/23
to Tasker

I figured out a way to do this. It involves Tasker, but the bulk of the work is done by another 3rd-party utility. It's a module called TeMeFI. I'll explain below how it is used.

First of all, all settings can be queried and set by running "settings list", "settings system put", "settings global put", and "settings custom put". These commands can be run via the shell in Android.

The basic procedure for backing up settings is to run "settings list" and then reformat the results into a group of "settings [system/global/custom] put" statements, one for each setting, and then save those results into a script file on the Android device.

Then, to restore, the generated script is run in the Android shell.

These commands must be run via root.

It turns out that the TeMeFI utility can supply already implemented code for performing the backup procedure that I describe above, and that code can be queried and saved. I have done so, and I have saved that backup code as a script on my device.

TeMeFI is described and can be downloaded from here: https://forum.xda-developers.com/t/app-tool-temefi-comprehensive-system-administration.3806260/

The way I use Tasker for this is as follows:

(1) Get TeMeFI to generate the save-settings script, and then copy that code to a file which I call /sdcard/do-backup-settings.sh
(2) Write a shell script which runs "/system/bin/sh /sdcard/do-backup-settings.sh" and redirects its stdout output to a file called /sdcard/restore-settings.sh (because the script from TeMeFI writes its output to stdout). This restore-settings.sh file will contain the "settings ... put" commands for the current value of each device setting.
(3) Write a Tasker task called BackupSettings which uses "Run Shell" to run "/system/bin/sh /sdcard/backup-settings.sh" as root. This creates an up-to-date version of /sdcard/restore-settings.sh
(4) Write a Tasker task called RestoreSettings which uses "Run Shell" to run "/system/bin/sh /sdcard/restore-settings.sh" as root. This will restore all of the previously saved settings.
(5) Export each of BackupSettings and RestoreSettings as an app. Then, these apps can then be run to backup and restore the settings.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages