FORUMS

[TOOLS][ZIPS][SCRIPTS]Android Backup and Restore Tools[Multiple Devices/Platforms]

3,228 posts
Thanks Meter: 4,107
 
By AndDiSa, Senior Member on 8th December 2019, 03:11 PM
Post Reply Email Thread
21st December 2019, 05:55 PM |#11  
Senior Member
Thanks Meter: 62
 
More
I got an error: "Unrecognised architecture armv7l".
After adding that to line 82 in functions.sh (and switching flaky usb port) it went through.

Edit:
Device gohan (BQ Aquaris X5 plus)
OS LineageOS 14.1-20191115 (unofficial)
Host Manjaro, bash v5.0.11 (ah well, I had to install PV command)
Edit: fixed device name
The Following User Says Thank You to Keule-T For This Useful Post: [ View ] Gift Keule-T Ad-Free
21st December 2019, 06:09 PM |#12  
AndDiSa's Avatar
OP Senior Member
Flag Heidelberg
Thanks Meter: 4,107
 
More
Quote:
Originally Posted by Keule-T

I got an error: "Unrecognised architecture armv7l".
After adding that to line 82 in functions.sh (and switching flaky usb port) it went through.

Edit:
Device gohan (BQ Aquaris X5 Pro)
OS LineageOS 14.1-20191115 (unofficial)
Host Manjaro, bash v5.0.11 (ah well, I had to install PV command)

@Keule-T Thank you very much for the info. I'll add that this change into the next version.
Would be great if others could report issues / success, too, so we can improve the scripts to be able to run on (almost) every device.
The Following 3 Users Say Thank You to AndDiSa For This Useful Post: [ View ] Gift AndDiSa Ad-Free
21st December 2019, 07:12 PM |#13  
Senior Member
Thanks Meter: 199
 
More
Quote:
Originally Posted by AndDiSa

Would be great if others could report issues / success, too, so we can improve the scripts to be able to run on (almost) every device.

Well, that was a disturbing experience. I downloaded and un-zipped the v1.1 on Arch Linux, opened a terminal from within that extracted folder, and ran the command ./backup_apps.sh with no additional arguments.

The terminal reported this:

Checking for root access...
Determining architecture...
Pushing busybox to device...
busybox-ndk/busybox-arm64: 1 file pushed. 26.0 MB/s (1478208 bytes in 0.054s)
### Creating dir qcom_2019-12-21_QQ1C.191205.016.A1
~/Downloads/android-backup-project-v1.1/qcom_2019-12-21_QQ1C.191205.016.A1 ~/Downloads/android-backup-project-v1.1


Then the terminal listed about 70 lines of .apk files, and then disaster happened. These are the last few lines of what the terminal reported:


## Stop Runtime
## Pull apps
package:/data/app/com.touchtype.swiftkey-80xpz-vz5Aii7U6vdFVHnQ==/base.apk=com.touchtype.swiftkey
/data/app/com.touchtype.swiftkey-80xpz-vz5Aii7U6vdFVHnQ==/base.apk
/data/app/com.touchtype.swiftkey-80xpz-vz5Aii7U6vdFVHnQ==
com.touchtype.swiftkey
./backup_apps.sh: line 55: pv: command not found


Then after that, complete silence. I mean COMPLETE. My phone did a Force Close and powered off. Wouldn't reboot back into system, just looped. I had to do a a Nandroid restore to get back into my phone again. Not good....


OnePlus 3T rooted with Magisk 20.1 and running MSM Xtended XQ v4.0 Android Q rom.

I like the concept, but I think I'll wait until you get it a bit more developed before I do a beta test again... Maybe you can make use of the above information to further your project.

---------- Post added at 12:12 PM ---------- Previous post was at 12:11 PM ----------

Forgot to add that the only thing that made it into the directory your script created on my PC was a file named

app_com.touchtype.swiftkey.tar.gz with a filesize of 0 . That's all that was there.
The Following User Says Thank You to Oblias For This Useful Post: [ View ] Gift Oblias Ad-Free
21st December 2019, 07:33 PM |#14  
AndDiSa's Avatar
OP Senior Member
Flag Heidelberg
Thanks Meter: 4,107
 
More
@Oblias thank you very much for your report. I am very sorry for the mess but it's exactly those reports which help really a lot.

pv is a program which helps logging the communication between the device and the pc and I did not have in mind that it probably is not installed on a Unix system. I'll add a check for the presence of the important programs so that there is a stable basis before starting the scripts.

The normal behaviour of the script is as follows:
- shutdown runtime (to prevent modifications during the backup process)
- backup apps and data
- restart runtime

So a "warm" restart of the device is normal after the backup script finishes. I am only wondering why you had to restore a nandroid ...
The Following 2 Users Say Thank You to AndDiSa For This Useful Post: [ View ] Gift AndDiSa Ad-Free
21st December 2019, 08:31 PM |#15  
Senior Member
Thanks Meter: 199
 
More
Quote:
Originally Posted by AndDiSa

@Oblias thank you very much for your report. I am very sorry for the mess but it's exactly those reports which help really a lot.

pv is a program which helps logging the communication between the device and the pc and I did not have in mind that it probably is not installed on a Unix system. I'll add a check for the presence of the important programs so that there is a stable basis before starting the scripts.

The normal behaviour of the script is as follows:
- shutdown runtime (to prevent modifications during the backup process)
- backup apps and data
- restart runtime

So a "warm" restart of the device is normal after the backup script finishes. I am only wondering why you had to restore a nandroid ...

Well, you said in the OP that one of the things needed for these scripts to run was to have "Ubuntu Linux (other should work, too)" installed. Arch Linux and Ubuntu Linux both use the Linux kernel, so I thought that would be alright. Which leaves me a bit confused as to why you said that PV is not installed on a Unix system??? But anyways.......

As far as the normal warm restart is concerned, perhaps something got messed up in the command when the script halted?? I'm not all that good with scripts, so I don't know. Also, perhaps whatever made the phone do a poweroff instead of a reboot, also corrupted some system file? Just guessing, of course... But it's not biggie really. Anyone who tries anything like this had better have a backup on hand, just in case any sort of unpredictable event happens.

So, let me know about the PV command issue, and I'll give it another try, if you'd like.

---------- Post added at 01:27 PM ---------- Previous post was at 01:24 PM ----------

Also, as an added thought, when you get a chance, perhaps a small FAQ in the OP as to what the normal behavior is when running these scripts. For example, letting folks know that their phone will do a reboot on the script completion, and things of that nature.... Just a thought....

---------- Post added at 01:31 PM ---------- Previous post was at 01:27 PM ----------

UPDATE: I also just checked my repos, and pv is available to be installed, it just wasn't installed during a 'normal' install of Arch Linux (if there is such a thing).

So, if I install pv, are there any other commands I should check for to see if I have installed before trying the script again?
The Following User Says Thank You to Oblias For This Useful Post: [ View ] Gift Oblias Ad-Free
21st December 2019, 09:29 PM |#16  
AndDiSa's Avatar
OP Senior Member
Flag Heidelberg
Thanks Meter: 4,107
 
More
@Oblias beside those "normal" programs like git, tar, gzip, ... which are normally always installed there is no additional program needed. But nevertheless I agree that probably some additional compatibility checks should be done especially as there are different versions of the programs existing which take probably also different parameters ...
The Following 2 Users Say Thank You to AndDiSa For This Useful Post: [ View ] Gift AndDiSa Ad-Free
21st December 2019, 09:51 PM |#17  
Senior Member
Thanks Meter: 199
 
More
Quote:
Originally Posted by AndDiSa

@Oblias beside those "normal" programs like git, tar, gzip, ... which are normally always installed there is no additional program needed. But nevertheless I agree that probably some additional compatibility checks should be done especially as there are different versions of the programs existing which take probably also different parameters ...

Makes sense. Alright then, I'll wait until you check things out, and once you have posted back, I'll give it another try. I don't mind some beta testing..
The Following User Says Thank You to Oblias For This Useful Post: [ View ] Gift Oblias Ad-Free
22nd December 2019, 09:24 PM |#18  
Junior Member
Thanks Meter: 4
 
More
Quote:
Originally Posted by AndDiSa

@cocolol
Edit: I expect that the script is blocked while checking a sane /data partition. Can you try to remove that part from the script? It doesn't harm and we can prove that my expectations are correct. It's sufficient the remove / comment out the checkForCleanData line.

After some investigation script was blocked on line 29 of functions.sh file on this condition "if [[ $($AMAGISK whoami) == "root" ]]"
I dont know why since when I replace this line with "$AMAGISK whoami" I get "root" as answer
Thus I replace "checkRootType" directly with "AS=$AMAGISK"

But I get the same with next function
Quote:

Determining architecture...
Unrecognized architecture aarch64

Seems to be does'nt get the answers same as problem above

I am using cygwin maybe it come from this.
I replaced == with =~ and it works but for the case condition I found nothing
22nd December 2019, 10:32 PM |#19  
AndDiSa's Avatar
OP Senior Member
Flag Heidelberg
Thanks Meter: 4,107
 
More
@cocolol I suppose cygwin has some issues with evaluating the expressions as aarch64 is supported. Probably also here you need to change the comparison ... If you know the type, you can also execute the code for the matching architecture.
3rd January 2020, 01:02 PM |#20  
AndDiSa's Avatar
OP Senior Member
Flag Heidelberg
Thanks Meter: 4,107
 
More
Uploaded version 1.2 of the tool with the following improvements:
- support for armv7l architecture
- checking prerequisites needed by the tool, e.g. adb, pv, ...
The Following 4 Users Say Thank You to AndDiSa For This Useful Post: [ View ] Gift AndDiSa Ad-Free
4th January 2020, 02:20 PM |#21  
minhajlk's Avatar
Senior Member
Flag Colombo
Thanks Meter: 305
 
More
Hi @AndDiSa,
My device is HTC 10 and I am running crdoid version 6 Android 10, when I run the ./backup_apps.sh, I get the following errors:
./backup_apps.sh: line 8: ./functions.sh: No such file or directory
./backup_apps.sh: line 15: checkPrerequisites: command not found
Thank you.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes