Coder Social home page Coder Social logo

mrrfv / open-android-backup Goto Github PK

View Code? Open in Web Editor NEW
672.0 10.0 37.0 8.19 MB

Back up your device without vendor lock-ins, using insecure software or root. Supports encryption and compression out of the box. Works cross-platform.

Home Page: http://openandroidbackup.me/

License: GNU General Public License v3.0

Shell 11.28% Kotlin 0.04% Dart 3.91% PowerShell 1.51% SCSS 0.16% CSS 75.62% HTML 6.73% JavaScript 0.75%
android android-app flutter flutter-apps macos linux windows backup backup-script android-backup

open-android-backup's Introduction

mrrfv

I may be slow to respond through e-mail.

Linux Android Backup Linux Android Backup

open-android-backup's People

Contributors

ahtlon avatar dependabot[bot] avatar esnosy avatar florianschroen avatar fsmiamoto avatar mrrfv avatar usrtax avatar zanovis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

open-android-backup's Issues

Backup stalled

Device info

Manufacturer: Samsung
Android version: 12
Custom ROM/rooted? no
Model: Samsung Galaxy S10

System info

Available disk space: lots
Operating system: Arch Linux


Describe the issue below.
I tried using this script with the tar method to backup my phone, now it's stalled twice while backing up certain apps.
First time backing the helium backup app - which after 10 I cancelled, uninstalled helium and restarted backup now com.samsung.android.bixbyvision.framework has stalled, something I can't uninstall.

empty name of .apk

Hey nice work, but perhaps you could change
line 96 (cd $output && adb pull $( echo $app | sed "s/package://" | sed "s/.apk=/.apk /" | sed "s/\([[:blank:]]\).*/\1/" ).apk) produce an empty filename.apk .apk if you change it to (cd $output && adb pull $( echo $app | sed "s/^package://" | sed "s/base.apk=/base.apk /" | sed 's/\r//g').apk) youยดll get the right name if you wish that.

Best reagrds

Device not show up in script

Device info

Manufacturer: Samsung Galaxy S5
Android version: 11
Custom ROM/rooted? Rooted and custom rom, lineageOS, Android 11
Model: GT i9505

System info

Fedora 36, Linux, KDE


USB debugging activated
File transfer mode ON

My phone is recognised by my PC when attached with a wired connection. I can transfer files using KDE desktop. But ./backup.sh does not recognise the phone.

MIUI and .nomedia files

In .../Android/data folders of MIUI exist .nomedia files for which I did not find any way to delete or them or change their permissions. Due to lacking read access 'adb pull' is stopped after running into them and the whole run attempt is over. This way, personally I would write some for loop with additional checks ... (because I couldn't find any adb option to ignore errors for pull; presumably my ignorance, sorry). Thanks.
BTW: MIUI is not so nice concerning permanent install / uninstall, at least not with me. Hence, I installed the apk manually once after copying to phone and removed the (un)installs from the script.

Samsung Galaxy A40 needs 'USB Debugging' developer option

[31e8700]

Device info

Manufacturer: Samsung
Android version: 11
Custom ROM/rooted? no
Model: Galaxy A40

It is necessary to also activate the developer option 'USB Debugging' on my device to make the backup script work successfully. Without it, it hangs while trying to install (or uninstall I can't remember) the companion app.

AFAICS, this is not documented anywhere, so please add this information.

versioning and tag names

For over a year now, there's always only a single tag named "latest", and the app never gets a newer versionCode/versionName. This makes update checks very hard. Would you consider proper versioning (especially with versionCode increased for each release), at least every now and then? Like, having "stable tags" like v1.1.0 etc 2 (or more) times a year, while keeping the "latest" for test/development if needed? Thanks in advance!

Store apks using their original package names

I had recently backed up my android device using the tool, however I noticed that all the apks were backed up using a random identifier. This made it harder to selectively install applications. It would be preferred if we backup using their original package names.

location to backup data & encryption

Most people will have external drives that are where theyre data will lie, so it would be nice to be able to set that as the abckup location.

Also setting optional encryption is very nice because not everyone wants encryption, and many may even need to have it disabled.

Also if you type in an encryption password incorrectly it ends the whole backup process, effectively wasting your 2 hours of backing up your phone.

Android 13 support

Device info

Manufacturer: OnePlus
Android version: 13
Custom ROM/rooted: no/no
Model: 8 Pro

System info

Available disk space: a lot
Operating system: Ubuntu 22.04


I am unable to back up my Android 13 device. Before I begin explaining why, I came across an additional issue where the backup.sh script won't display anything in the console when running via WezTerm:

image

Anyway, back to the actual issue. So I launch the script, connect my phone, pair successfully, tell it to "Backup", then it tries to install the companion app, which gets installed successfully, but after that it wants to grant it some permissions, but they are not applied:

Exception occurred while executing 'grant':
java.lang.SecurityException: grantRuntimePermission: Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS.
	at android.app.ContextImpl.enforce(ContextImpl.java:2253)
	at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:2281)
	at com.android.server.pm.permission.PermissionManagerServiceImpl.grantRuntimePermissionInternal(PermissionManagerServiceImpl.java:1364)
	at com.android.server.pm.permission.PermissionManagerServiceImpl.grantRuntimePermission(PermissionManagerServiceImpl.java:1346)
	at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:553)
	at android.permission.PermissionManager.grantRuntimePermission(PermissionManager.java:597)
	at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2591)
	at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:302)
	at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
	at android.os.ShellCommand.exec(ShellCommand.java:38)
	at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onShellCommand(PackageManagerService.java:6341)
	at android.os.Binder.shellCommand(Binder.java:1073)
	at android.os.Binder.onTransact(Binder.java:901)
	at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4313)
	at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onTransact(PackageManagerService.java:6325)
	at android.os.Binder.execTransactInternal(Binder.java:1331)
	at android.os.Binder.execTransact(Binder.java:1268)
  • Couldn't assign permission android.permission.READ_CONTACTS to the companion app
  • Couldn't assign permission android.permission.WRITE_CONTACTS to the companion app
  • Couldn't assign permission android.permission.READ_EXTERNAL_STORAGE to the companion app
  • Couldn't assign permission android.permission.READ_SMS to the companion app

Then it asks me to press the "Export Data" button in the companion app that is opened automatically, and that results in: "Storage, SMS or contacts permissions have not been granted". When I first clicked the button, it asked me to give some contact reading permissions to the app and I allowed them. It still spits this error.

But it seems like the rest of the thing goes okay. It started to copy over some app data. I can see the status with PV:

Attempting to uninstall companion app.
Exporting apps.
Backing up app: com.reader.books
27,2MiB 0:00:01 [24,8MiB/s] [    <=>                                                                                                           ]
Backing up app: com.teamspeak.ts3client
35,5MiB 0:00:01 [27,8MiB/s] [    <=>                                                                                                           ]

Then this happened:

Exporting contacts (as vCard) and SMS messages (as CSV).
0,00 B 0:00:00 [0,00 B/s] [<=>                                                                                                                 ]
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
Errors occurred while backing up . - this file (or multiple files) might've been ignored.
mv: cannot stat './backup-tmp/Contacts/SMS_Messages.csv': No such file or directory

Can you please add support for Android 13?

Enable GitHub discussions or wiki for device-specific instructions

Thanks for creating and working on this project! ๐Ÿ‘

I just managed to back up my Xiaomi Redmi Note 7, but initially had some issues getting all required options enabled, since after just turning on ADB debugging and running the backup script some ADB permissions were still missing.

Error message after step "Granting required permissions to companion app."
Security exception: grantRuntimePermission: Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS.

java.lang.SecurityException: grantRuntimePermission: Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS.
  at android.app.ContextImpl.enforce(ContextImpl.java:1906)
  at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1934)
  at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:2237)
  at com.android.server.pm.permission.PermissionManagerService.access$1100(PermissionManagerService.java:122)
  at com.android.server.pm.permission.PermissionManagerService$PermissionManagerServiceInternalImpl.grantRuntimePermission(PermissionManagerService.java:3255)
  at com.android.server.pm.PackageManagerService.grantRuntimePermission(PackageManagerService.java:5890)
  at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:1955)
  at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:230)
  at android.os.ShellCommand.exec(ShellCommand.java:111)
  at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:22484)
  at android.os.Binder.shellCommand(Binder.java:881)
  at android.os.Binder.onTransact(Binder.java:765)
  at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4924)
  at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4114)
  at android.os.Binder.execTransactInternal(Binder.java:1021)
  at android.os.Binder.execTransact(Binder.java:994)

I figured out that you had to toggle three individual settings related to USB debugging and ADB to get the necessary permissions needed by the backup utility. The last of the three settings could only be enabled after logging into a MIUI account on the device to confirm that you're a developer and know what you're doing ๐Ÿ™„

What I actually want to express is, that enabling GitHub discussions or creating a wiki for device-specific instructions might be a good idea.
This could help less experienced users getting ADB properly enabled on their device and could reduce the number of issues in the long run.

What do you think? If you don't wish to create a wiki, perhaps a dedicated section in a README within subdirectories for device manufacturers like Xiaomi, Oppo etc. would be an option.

I, for one, would like to contribute some screenshots and instructions as a guide for less experienced Xiaomi users.

Cheers!

avoid overlong lines in output to stdout

I suggest that the messages sent to stdout are limited to 80 characters per line (where possible). This increases both readability and makes bug reports easier to read if users are requested to cut and paste messages. As an example, see the overlong lines in the report from #55 (comment)

Terminal prompts not correctly displayed in Putty (blank screen)

Device info

Manufacturer: Samnsung
Android version: 10
Custom ROM/rooted? No
Model: Galaxy S9 SM-G970W

System info

Available disk space: 5+TB
Operating system: Gentoo Linux / Windows 10


Describe the issue below.
Just tried this out today and was rather confused for a while, as when I run it the terminal would clear and nothing would happen (blank screen). After some testing I determined that there was a prompt telling me that I had to hit enter to continue, but I had to scroll up to see it.

I have the phone connected to a Linux machine (Gentoo) and am connected to that via ssh using Putty in Windows 10. Note that everything is working, it was just confusing because I don't see the prompts.

Here's an example image while backup.sh is running:
image
If I scroll up I see the info/prompts:
image

I played around a bit with a script, and it seems that tput init is causing this in the cecho function:


# "cecho" makes output messages yellow, if possible
function cecho() {
  if [ ! -v CI ]; then
    echo $(tput setaf 11)$1$(tput init)
  else
    echo $1
  fi
}

For reference, the text was not yellow, but if I change it to setaf 3 it is yellow (still not "scrolling" correctly). I have tried many different terminal sizes etc., and my $TERM variable shows as "xterm".

I'm wondering if there's an easy way to avoid this in the if [ ! -v CI ]; then on line 13, but unfortunately I'm not sure what CI is referring to.

No such file error halting process

Device info

Manufacturer: Samsung
Android version: 12
Custom ROM/rooted? No
Model: SM-N975U1

System info

Available disk space: 1.21TB (D: drive, backup location); 125GB (C: drive, system)
Operating system: Windows 11; Ubuntu WSL


Describe the issue below.
After apps are finished being exported (I tried both tar and adb method), it hits an exception.

/data/app/~~MnXxs_EbCa3JDHmoPetPlg==/com.dietbet.app-NreK0...le pulled, 0 skipped. 35.2 MB/s (27809188 bytes in 0.753s)
Exporting contacts (as vCard).
adb: error: failed to stat remote object '/storage/emulated/0/linux-android-backup-temp/.': No such file or directory
Exiting.
Press Enter to continue...

Runtime error: Function a/e not defined.

System info

Available disk space: plenty
Operating system: Arch Linux


Describe the issue below.

When I use open-android-backup my output is littered with "runtime error" messages:

...
? What do you want to do? (Use arrow keys)
Runtime error (func=(main), adr=6): Function a not defined.
Runtime error (func=(main), adr=3): Function e not defined.
Runtime error (func=(main), adr=6): Function a not defined.
Runtime error (func=(main), adr=3): Function e not defined.
โฏ Backup
  Restore
Runtime error (func=(main), adr=6): Function a not defined.
Runtime error (func=(main)Backup
Open Android Backup will install a companion app on your device, which will allow for contacts and other data to be backed up and restored.
...

Script crashes when exporting contacts

As in the title, apps export correctly but it crashes after this message:

Exporting contacts (as vCard).
adb: error: failed to stat remote object '/storage/emulated/0/linux-android-backup-temp': No such file or directory

log.txt

Cannot backup some of the apps under Windows 11

After running the script, a message shows up:

12.1MiB 0:00:00 [12.3MiB/s] [ <=>                                                                                          ]
7.48MiB 0:00:00 [11.4MiB/s] [ <=>                                                                                          ]
51.0MiB 0:00:03 [14.1MiB/s] [       <=>                                                                                    ]
24.5MiB 0:00:01 [13.9MiB/s] [   <=>                                                                                        ]
mv: cannot stat './backup-tmp/Apps/base.apk': No such file or directory
Exiting.
Press Enter to continue...:

It already crashed on "MiGalleryLockscreen_global_old.apk" and "VirtualSim.apk".
The files stay in the \backup-tmp\Apps directory.

Restore fails with remote secure_mkdirs failed: Operation not permitted while trying to write to storage/Android/data/

Device info

Manufacturer: Google
Android version: Android 13
Custom ROM/rooted? No
Model: Pixel 6 Pro

System info

Available disk space: ~275 GB
Operating system: Arch Linux 5.19.13-zen1-1-zen


Describe the issue below.
Restore fails with remote secure_mkdirs failed: Operation not permitted while trying to write to storage/Android/data/

Full echo output:

./backup-tmp/Storage/Alarms/: 2 files pushed, 0 skipped. 10.6 MB/s (962366 bytes in 0.087s)
adb: error: failed to copy './backup-tmp/Storage/Android/data/com.teamviewer.quicksupport.market/files/export/files.zip' to '/storage/emulated/0/Android/data/com.teamviewer.quicksupport.market/files/export/files.zip': remote secure_mkdirs failed: Operation not permitted
adb: error: failed to read copy responsep/2021-11-16 23-29-39.zip: 4%
adb: error: failed to read copy responsek-share.zip: 0%
adb: error: failed to read copy responsesame.app.edge_2022-06-03.apk: 1%
adb: error: failed to read copy response
./backup-tmp/Storage/Audiobooks/: 0 files pushed, 0 skipped.
adb: error: failed to read copy response/2022-09-03-hyperion-config.backup: 0%
adb: error: failed to read copy responseXL_20220901_113214755.jpg: 6%
adb: error: failed to read copy responsefaver.txt: 100%
adb: error: failed to read copy responsenced-YouTube-v17.36.37-arm64-v8a-cli_v2.11.1-patches_v2.66.2.apk: 90%
adb: error: failed to read copy response
./backup-tmp/Storage/DSfile/: 0 files pushed, 0 skipped.
adb: error: failed to read copy response-20220909-033737.mp4: 0%
adb: error: failed to read copy responseails/.database_uuid: 100%
adb: error: failed to read copy response/Cha-Ching.ogg: 100%
adb: error: failed to read copy responsegram/IMG_20220811_110405_105.jpg: 51%
adb: error: failed to read copy response
./backup-tmp/Storage/Podcasts/: 0 files pushed, 0 skipped.
adb: error: failed to read copy response
./backup-tmp/Storage/Recordings/: 0 files pushed, 0 skipped.
adb: error: failed to read copy responseRobot Theme.mp3: 13%
adb: error: failed to read copy response
3901 files pushed, 0 skipped. 17.1 MB/s (2844152529 bytes in 159.008s)

Windows 11 Insider Builds required for script?

Device info

Manufacturer: google
Android version: 11
Custom ROM/rooted? No
Model: Pixel 4a5g

System info

Available disk space: 80gb
Operating system:
Microsoft Windows 10 [Version 10.0.19045.2364]
WSL2 Ubuntu

I get the following error in the script, when it gets to thee part about loading the graphical file chooser for the backup location


Note: Backups will first be made on the drive this script is located in, and then will be copied to the specified location.
Running on Windows (WSL) - a graphical file chooser dialog will be open.
You will be prompted for the backup location. Press Enter to continue.

qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Can't find directory ''
Please re-enter the path, or hit ^C to exit
Note: Backups will first be made on the drive this script is located in, and then will be copied to the specified location.
Running on Windows (WSL) - a graphical file chooser dialog will be open.
You will be prompted for the backup location. Press Enter to continue.


I haven't upgraded to Windows 11 (honestly mostly because I would like to keep my taskbar on the side >_<) but it seems that most recent Windows 11 (and specifically Insider Builds) are required for the script as the directory choosing option requires a Linux GUI to choose the backup destination. Is this the case? If so, is it possible to enter the directory manually instead? I have no problem with GUIs, but for choosing an install directory, I don't think commandline is too far behind (I suppose it depends on if it's freetext vs completion). Is my understanding of the situation correct?

Retore totally fails

During the restore process I'm getting a wall of errors likeโ€ฆ

Extracting archive: ./AndroidManifest.xml
ERROR: ./AndroidManifest.xml
Can not open the file as archive


Extracting archive: ./DebugProbesKt.bin
ERROR: ./DebugProbesKt.bin
Can not open the file as archive


Extracting archive: ./META-INF/CERT.RSA
ERROR: ./META-INF/CERT.RSA
Can not open the file as archive


Extracting archive: ./META-INF/CERT.SF
ERROR: ./META-INF/CERT.SF
Can not open the file as archive


Extracting archive: ./META-INF/MANIFEST.MF
ERROR: ./META-INF/MANIFEST.MF
Can not open the file as archive


Extracting archive: ./META-INF/androidx.activity_activity.version
ERROR: ./META-INF/androidx.activity_activity.version
Can not open the file as archive


Extracting archive: ./META-INF/androidx.annotation_annotation-experimental.version
ERROR: ./META-INF/androidx.annotation_annotation-experimental.version
Can not open the file as archive


Extracting archive: ./META-INF/androidx.arch.core_core-runtime.version
ERROR: ./META-INF/androidx.arch.core_core-runtime.version
Can not open the file as archive


Extracting archive: ./META-INF/androidx.core_core.version
ERROR: ./META-INF/androidx.core_core.version
Can not open the file as archive


Extracting archive: ./META-INF/androidx.customview_customview.version
ERROR: ./META-INF/androidx.customview_customview.version
Can not open the file as archive


Extracting archive: ./META-INF/androidx.fragment_fragment.version
ERROR: ./META-INF/androidx.fragment_fragment.version
Can not open the file as archive


Extracting archive: ./META-INF/androidx.lifecycle_lifecycle-livedata-core.version
ERROR: ./META-INF/androidx.lifecycle_lifecycle-livedata-core.version
Can not open the file as archive


Extracting archive: ./META-INF/androidx.lifecycle_lifecycle-livedata.version
ERROR: ./META-INF/androidx.lifecycle_lifecycle-livedata.version
Can not open the file as archive


Extracting archive: ./META-INF/androidx.lifecycle_lifecycle-runtime.version
ERROR: ./META-INF/androidx.lifecycle_lifecycle-runtime.version
Can not open the file as archive


Extracting archive: ./META-INF/androidx.lifecycle_lifecycle-viewmodel.version
ERROR: ./META-INF/androidx.lifecycle_lifecycle-viewmodel.version
Can not open the file as archive


Extracting archive: ./META-INF/androidx.loader_loader.version
ERROR: ./META-INF/androidx.loader_loader.version
Can not open the file as archive


Extracting archive: ./META-INF/androidx.savedstate_savedstate.version
ERROR: ./META-INF/androidx.savedstate_savedstate.version
Can not open the file as archive


Extracting archive: ./META-INF/androidx.tracing_tracing.version
ERROR: ./META-INF/androidx.tracing_tracing.version
Can not open the file as archive


Extracting archive: ./META-INF/androidx.versionedparcelable_versionedparcelable.version
ERROR: ./META-INF/androidx.versionedparcelable_versionedparcelable.version
Can not open the file as archive


Extracting archive: ./META-INF/androidx.viewpager_viewpager.version
ERROR: ./META-INF/androidx.viewpager_viewpager.version
Can not open the file as archive


Extracting archive: ./META-INF/androidx.window_window-java.version
ERROR: ./META-INF/androidx.window_window-java.version
Can not open the file as archive


Extracting archive: ./META-INF/androidx.window_window.version
ERROR: ./META-INF/androidx.window_window.version
Can not open the file as archive


Extracting archive: ./META-INF/annotation-experimental_release.kotlin_module
--
Path = ./META-INF/annotation-experimental_release.kotlin_module
Type = lzma86


Would you like to replace the existing file:
  Path:     ./annotation-experimental_release
  Size:     10 bytes (1 KiB)
  Modified: 1981-01-01 01:01:02
with the file from archive:
  Path:     annotation-experimental_release
  Size:     4398046511360 bytes (4097 GiB)
? (Y)es / (N)o / (A)lways / (S)kip all / A(u)to rename all / (Q)uit? 
ERROR: Unexpected end of data : annotation-experimental_release

Sub items Errors: 1

Extracting archive: ./META-INF/app_release.kotlin_module
--
Path = ./META-INF/app_release.kotlin_module
Type = lzma86

ERROR: Unexpected end of data : app_release

Sub items Errors: 1

Extracting archive: ./META-INF/flutter_contacts_release.kotlin_module
--
Path = ./META-INF/flutter_contacts_release.kotlin_module
Type = lzma86

ERROR: Unexpected end of data : flutter_contacts_release

Sub items Errors: 1

Extracting archive: ./META-INF/kotlin-stdlib-common.kotlin_module
--
Path = ./META-INF/kotlin-stdlib-common.kotlin_module
Type = lzma86

ERROR: Data Error : kotlin-stdlib-common

Sub items Errors: 1

Extracting archive: ./META-INF/kotlin-stdlib-jdk7.kotlin_module
--
Path = ./META-INF/kotlin-stdlib-jdk7.kotlin_module
Type = lzma86

ERROR: Data Error : kotlin-stdlib-jdk7

Sub items Errors: 1

Extracting archive: ./META-INF/kotlin-stdlib-jdk8.kotlin_module
--
Path = ./META-INF/kotlin-stdlib-jdk8.kotlin_module
Type = lzma86

ERROR: Data Error : kotlin-stdlib-jdk8

Sub items Errors: 1

Extracting archive: ./META-INF/kotlin-stdlib.kotlin_module
--
Path = ./META-INF/kotlin-stdlib.kotlin_module
Type = lzma86

ERROR: Data Error : kotlin-stdlib

Sub items Errors: 1

Extracting archive: ./META-INF/kotlinx-coroutines-android.kotlin_module
--
Path = ./META-INF/kotlinx-coroutines-android.kotlin_module
Type = lzma86

ERROR: Data Error : kotlinx-coroutines-android

Sub items Errors: 1

Extracting archive: ./META-INF/kotlinx-coroutines-core.kotlin_module
--
Path = ./META-INF/kotlinx-coroutines-core.kotlin_module
Type = lzma86

ERROR: Data Error : kotlinx-coroutines-core

Sub items Errors: 1

Extracting archive: ./META-INF/kotlinx-serialization-core.kotlin_module
--
Path = ./META-INF/kotlinx-serialization-core.kotlin_module
Type = lzma86

ERROR: Data Error : kotlinx-serialization-core

Sub items Errors: 1

Extracting archive: ./META-INF/kotlinx-serialization-json.kotlin_module
--
Path = ./META-INF/kotlinx-serialization-json.kotlin_module
Type = lzma86

ERROR: Data Error : kotlinx-serialization-json

Sub items Errors: 1

Extracting archive: ./META-INF/services/kotlinx.coroutines.CoroutineExceptionHandler
ERROR: ./META-INF/services/kotlinx.coroutines.CoroutineExceptionHandler
Can not open the file as archive


Extracting archive: ./META-INF/services/kotlinx.coroutines.internal.MainDispatcherFactory
ERROR: ./META-INF/services/kotlinx.coroutines.internal.MainDispatcherFactory
Can not open the file as archive


Extracting archive: ./META-INF/window-java_release.kotlin_module
--
Path = ./META-INF/window-java_release.kotlin_module
Type = lzma86

ERROR: Unexpected end of data : window-java_release

Sub items Errors: 1

Extracting archive: ./META-INF/window_release.kotlin_module
--
Path = ./META-INF/window_release.kotlin_module
Type = lzma86

And that's where it ends:

Extracting archive: ./window_release
ERROR: ./window_release
Can not open the file as archive


Archives: 152
OK archives: 7
Can't open as archive: 123
Archives with Errors: 21
Archives with Warnings: 1

Warnings: 1

Open Errors: 1

Sub items Errors: 20
๏ฟฝ(B๏ฟฝ[m๏ฟฝ[?12l๏ฟฝ[?25h

The restoration doesn't actually happen from there. I just looked inside backup-tmp and there's tons of stuff, but there's also tons of stuff in the directory:

tjcarter@aki:~/Source/linux-android-backup/asuna$ ls
AndroidManifest.xml              kotlinx-coroutines-android
annotation                       kotlinx-coroutines-core
annotation-experimental_release  kotlinx-serialization-core
app_release                      kotlinx-serialization-json
assets/                          lib/
backup-tmp/                      linux-android-backup-06-30-2022-12-15-45.7z
classes.dex                      linux-android-backup-companion
collections                      linux-android-backup-companion.apk
coroutines                       META-INF/
DebugProbesKt.bin                NOTICES
flutter_contacts_release         NULL
internal                         ranges
kotlin/                          reflect
kotlin-stdlib                    res/
kotlin-stdlib-common             resources.arsc
kotlin-stdlib-jdk7               window-java_release
kotlin-stdlib-jdk8               window_release
kotlin-tooling-metadata.json

I've got some idea that maybe all of that is not supposed to be there? Anyway, it looks like I'm going to be awhile doing a messy manual restoration using the script as a guide. I had to reflash/erase everything. sigh

Please add "Doesn't save MMS attachments" to the readme

Device info

Manufacturer: Samsung
Android version: 9
Custom ROM/rooted? No
Model: J7

System info

Available disk space: 14320128K
Operating system: Ubuntu 20.04


Describe the issue below.
Great job, and I starred the project because it created a backup I wished I'd had when my old phone went for an unplanned swim :-(

But ... it just so happened that, at the moment, I had received some texts with dozens of attached JPEGs from a friend, and was hoping for a backup that would simplify extracting them to my PC.

I understand that saving attachments in a way that associates them with the text would be a hassle, and restoring them could be a nightmare if the internal formats varied across Android versions, so I'm not making a feature request. But please do update the documentation so users won't be unpleasantly surprised if they find they need. their backup.

Thanks,

Ran

p.s. I did find a free app on the Play Store that saves text threads as HTML files, and embeds JPEGs (dunno yet whether it works on other media) in base64. It doesn't restore, though (probably because that nightmare I feared is real). I'm gonna write a python program that will extract the pics and name them so they're associated with the threads. If it's okay with you, I'll add a comment with referrals if it works out (don't want to do unwelcome promotions).

This is a fake issue. [3in1]

Yeah, sorry. I know that Github isn't for social stuff, Github is for work. But sometimes this is the only direct space to address appreciation to Devs. So, yeah - you can label it "APPRECIATION".

... okay, I will manage something, but really - i'm forcing it. I don't really feel that I've encountered an issue. So I don't know I can reproduce it technically without any doubts. So just take it as "user story" or sth.

Device info

Manufacturer/Model: Xiaomi
Android version: Migration from 9 to 11
Custom ROM/rooted: Migration from MIUI 11 to ArrowOS 11 (Gapps, stable)
Model: Redmi Note 5 (Whyred)

System info

Available disk space: A lot
Operating system: Linux / PopOS


Task: I wanted to backup simple stuff for my girlfriend's old phone, which has stock MIUI, bloaty as hell. I'm running on ArrowOS on my Lavender (XRN7) - and from there I know that it's very, very stable and fast. Also, I used the script before, for my phone, and it made it's job smoothly (only export, no restoring).

Let's split it like that:

  1. ISSUE?
    While copying files from Redmi Note 5 the script just stopped working. I don't have any logs, because my thoughts was "okay, it was 50GB of data, it could break". It was somehow normal to me. After manually copying the biggest folder (DCIM of course) - I ran it again and it worked just fine. I cannot say that it was a script problem, because later on I've noticed that I didn't turn debugging "fully on" - in Xiaomi you need to have SIM inside or be logged to Xiaomi Account for enabling debug app install or something like that. I think it was a connection problem, so I don't know why I'm writing this, maybe just to tell what I've encountered.
  2. ACTUAL PROBLEM/QUESTION/ENHANCEMENT?
    What is interesting for me, though, is the problem of moving data from closed stock to AOSP-like ROM. I had no problems with restoring this backup (technically), but I have these thoughts:
    • Backup included MIUI apps which will have to be deleted by me manually. Maybe there is an area of improving the script here, when user want to make action like mine? I know that this is not a "migration" script, but "backup". But it could be nice to have option to mark if you're moving from stock to custom. After this, script could automatically delete system apps with no use on the new device. But that's a meaning of hooks, I suppose? These are too hard for me for now, sorry if I'm noobing here.
    • Second thing is more likely an issue - no contacts were restored! In backup-tmp I see that every contact is written in it's own .vsc file. But no single one was restored. Cannot tell why. But I have all the files, so I can restore them manually. Maybe also there could be a naming space for this? For example - I'm putting all contacts in one file, packing it and just "pushing" to device with help of your script?
    • Cleaning - even though I have a lot of shitty MIUI folders - everything works. There are no stability problems. I will try to delete some things manually and hope to not destroy anything. Maybe in the future this kind of simple cleaning could work?
  3. ACTUAL REASON OF THIS POST
    I want to say - THANK YOU! This is very simple and needed tool. It's so simple that it is clear - problems were on my/device side. This script is the future - every other backup solution is complicated and slow. I really love it. I wish you all the best and want to giving you my words of support - hope that this project will have future. Thanks again!

๐Ÿฆ„ ๐Ÿ’™ ๐Ÿพ

Question on apk files data backup

I don't understand, when backing up the .adb files, does that contain the applications settings/data or only the install package?

thx in advance

Error with call_log export

Device info

Manufacturer: Google Pixel 4XL
Android version: R(11)
Custom ROM/rooted? Not rooted
Model: /e/ OS 1.7-20230110250404

System info

Available disk space: +1 Terra
Operating system: Ubuntu 22.04 LTS


I am getting this is the cli. Everything before and after seems to be working:

Exporting call logs.
Error while accessing provider:call_log
java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.CallLogProvider from (null) (pid=19574, uid=2000) requires android.permission.READ_CALL_LOG or android.permission.WRITE_CALL_LOG
	at android.os.Parcel.createExceptionOrNull(Parcel.java:2374)
	at android.os.Parcel.createException(Parcel.java:2358)
	at android.os.Parcel.readException(Parcel.java:2341)
	at android.os.Parcel.readException(Parcel.java:2283)
	at android.app.IActivityManager$Stub$Proxy.getContentProviderExternal(IActivityManager.java:7962)
	at com.android.commands.content.Content$Command.execute(Content.java:515)
	at com.android.commands.content.Content.main(Content.java:727)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:399)
Caused by: android.os.RemoteException: Remote stack trace:
	at com.android.server.am.ActivityManagerService.getContentProviderImpl(ActivityManagerService.java:7148)
	at com.android.server.am.ActivityManagerService.getContentProviderExternalUnchecked(ActivityManagerService.java:7604)
	at com.android.server.am.ActivityManagerService.getContentProviderExternal(ActivityManagerService.java:7598)
	at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3767)
	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2875)

Error while accessing provider:call_log
java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.CallLogProvider from (null) (pid=19589, uid=2000) requires android.permission.READ_CALL_LOG or android.permission.WRITE_CALL_LOG
	at android.os.Parcel.createExceptionOrNull(Parcel.java:2374)
	at android.os.Parcel.createException(Parcel.java:2358)
	at android.os.Parcel.readException(Parcel.java:2341)
	at android.os.Parcel.readException(Parcel.java:2283)
	at android.app.IActivityManager$Stub$Proxy.getContentProviderExternal(IActivityManager.java:7962)
	at com.android.commands.content.Content$Command.execute(Content.java:515)
	at com.android.commands.content.Content.main(Content.java:727)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:399)
---
All required data has been copied from your device and it can now be unplugged.

script can't uninstall compenium app

app stop working

`? What do you want to do? Backup
Linux Android Backup will install a companion app on your device, which will allow for contacts to be backed up and restored.
The companion app is open-source, and you can see what it's doing under the hood on GitHub.
Downloading companion app.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 16.2M 100 16.2M 0 0 2505k 0 0:00:06 0:00:06 --:--:-- 3345k
Attempting to uninstall companion app.

companion app isn't showing on Android 12.1 device. When installing manual the companion apk the script showing the same result

Script aborts when exporting contacts

Exporting contacts (as vCard).
adb: error: failed to stat remote object '/storage/emulated/0/linux-android-backup-temp': No such file or directory

I went into the adb shell and that file/folder does not exist.

Rename project

I think linux-android-backup doesn't reflect the project very well, as the script works on all major operating systems (Linux, macOS and Windows via WSL), but I can't think of any other name to use. If you know of a name that could fit this type of project, please comment it.

Requirements:

  • can't be too generic or technical - we want to turn this into a grandpa-friendly tool in the future
  • needs to be easy to remember

Companion App doesn't work on privacy-focused Android distributions (CalyxOS, GrapheneOS)

Discussed in #39

Originally posted by onley November 27, 2022

Does this still work under Android 12? I have tried to perform a backup twice, once using tar export and once using adb export and both times it failed at "Exporting contacts (as vCard)". When using adb export there was also an error message
adb: error: failed to stat remote object '/storage/emulated/0/linux-android-backup-temp/.': No such file or directory
apparently the companion app is unable to write to the device.


Report any possible clues regarding this problem as well as workarounds under this issue. Unfortunately I don't have any devices that could run either of these operating systems, so I'm unable to debug this without your help.

A postinstall data breaks backup due to `set -e`

Device info

Manufacturer: Nokia
Android version: 10.0
Custom ROM/rooted? No
Model: 7 plus

System info

Available disk space: 539213824 kB
Operating system: Linux ... openSUSE Leap 15.3


Describe the issue below.

The command ./backup.sh stops at the line

adb: error: failed to stat remote object '/data/preloads/apps-postinstall/GoogleHandWritingIME/GoogleHandWritingIME.apk': Permission denied

just listed all apps an indeed this is the only one

Nokia/linux-android-backup-master> adb shell pm list packages -3 -f | grep apps-postinstall
package:/data/preloads/apps-postinstall/GoogleHandWritingIME/GoogleHandWritingIME.apk=com.google.android.apps.handwriting.ime

will try to add an exception for this postinstall in the list

7 Zip compression level too high

Why did you decide to use maximum compression for 7 Zip? It takes very long and is not really neccessary for a phone backup in my opinion because they usually arent that big. Could you make the compression optional or provides different compression settings?

Foreground color isn't reset

[31e8700]

System info

Available disk space: ยญโ€“
Operating system: openSUSE Leap 15.4 (GNU/Linux)

The backup script sets the foreground color of the console to yellow for logging messages, which is nice. However, after exiting, the color isn't properly reset and stays yellow. In case it matters, I use KDE's 'konsole' application version 21.12.3 together with 'newt' version 0.52.20 (which is quite an old version that comes with this openSUSE version). Maybe this is a bug in newt? Anyway, I suggest to explicitly reset the color.

line 6: [: -v: unary operator expected

Device info

Manufacturer: Asus
Android version: A12
Custom ROM/rooted? /e/ yes
Model: Sake

System info

Available disk space: 500GB
Operating system: OSX 10.15.7 ( Homebrew and Apple do not provide support for this old version)


Describe the issue below.
when run the script sh backup.sh:

line 6: [: -v: unary operator expected

tar Archive base-256 value is out of off_t range during backup / Freeze - use ADB instead.

Device info

Manufacturer: OnePlus 5t
Android version: 18.1
Custom ROM/rooted? Yes - LineageOS
Model:

System info

Available disk space: 500G
Operating system: Ubuntu 14LTS


Running the backup ends up with an error like

Exporting contacts (as vCard).
 379KiB 0:00:00 [ 529KiB/s] [  <=>                                                                                                                                              ]
Removing temporary files created by the companion app.
Exporting internal storage - this will take a while.
tar: Archive base-256 value is out of off_t range
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

and then seems to freeze.

Can't export apps on Oneplus 8 Pro

Hey,

I am having trouble using this script. It seems that is has trouble with on of the default oneplus apps. See the log output below:

Please enable developer options on your device, connect it to your computer and set it to file transfer mode. Then, press Enter to continue.

If you have connected your device correctly, you should now see a message asking for access to your phone. Allow it, then press Enter to go to the last step.
Tip: If this is not the first time you're using this script, you might not need to allow anything.

List of devices attached
d15fa995        device

Can you see your device in the list above, and does it say 'device' next to it? If not, quit this script (ctrl+c) and try again.
? What do you want to do? Backup
Linux Android Backup will install a companion app on your device, which will allow for contacts to be backed up and restored.
The companion app is open-source, and you can see what it's doing under the hood on GitHub.
Companion app already downloaded.
Attempting to uninstall companion app.
Installing companion app.
Performing Streamed Install
Success
Cleaning up after previous backup/restore...
'backup-tmp/Apps/13206695412905228816285/.apk' wurde entfernt
Verzeichnis 'backup-tmp/Apps/13206695412905228816285' wurde entfernt
'backup-tmp/Apps/4053151727101075425517/.apk' wurde entfernt
Verzeichnis 'backup-tmp/Apps/4053151727101075425517' wurde entfernt
'backup-tmp/Apps/282121249252142865729208/.apk' wurde entfernt
Verzeichnis 'backup-tmp/Apps/282121249252142865729208' wurde entfernt
'backup-tmp/Apps/6968270894246149783725/.apk' wurde entfernt
Verzeichnis 'backup-tmp/Apps/6968270894246149783725' wurde entfernt
'backup-tmp/Apps/1463832171288482248921974/.apk' wurde entfernt
Verzeichnis 'backup-tmp/Apps/1463832171288482248921974' wurde entfernt
'backup-tmp/Apps/8289915924186595128861/.apk' wurde entfernt
Verzeichnis 'backup-tmp/Apps/8289915924186595128861' wurde entfernt
Verzeichnis 'backup-tmp/Apps/26971239003197488465839' wurde entfernt
'backup-tmp/Apps/737611392321051839431543/.apk' wurde entfernt
Verzeichnis 'backup-tmp/Apps/737611392321051839431543' wurde entfernt
Verzeichnis 'backup-tmp/Apps' wurde entfernt
Verzeichnis 'backup-tmp' wurde entfernt
Starting: Intent { cmp=com.example.companion_app/.MainActivity }
The companion app has been opened on your device. Please press the 'Export Data' button - this will export contacts to the internal storage, allowing this script to backup them. Press Enter to continue.

Attempting to uninstall companion app.
Exporting apps.
/data/app/~~uFVEBSZlSSCj7wWzKLlPlQ==/net.oneplus.weather... pulled, 0 skipped. 37.2 MB/s (45317293 bytes in 1.162s)
/data/app/~~TMIkr1Kf1Q13ssQGHF3s8A==/com.nextcloud.clien... pulled, 0 skipped. 33.8 MB/s (29001624 bytes in 0.819s)
/data/app/~~NCsO2J8iWeaRHK0JJSihpA==/de.nextbike-mtTvxKY... pulled, 0 skipped. 38.6 MB/s (20516970 bytes in 0.507s)
/data/app/~~BiFU6dt5ylDFIMax_zZanQ==/com.ubnt.usurvey-Gp... pulled, 0 skipped. 36.9 MB/s (12193213 bytes in 0.315s)
/data/app/~~6D6Jt1gyVYE8IadgyQxoZw==/com.sony.songpal.md... pulled, 0 skipped. 37.0 MB/s (55286695 bytes in 1.427s)
/data/app/~~Ev77RvaPeJsKrByoTe86yA==/de.fiduciagad.andro... pulled, 0 skipped. 37.9 MB/s (62131604 bytes in 1.562s)
/data/app/~~S1d02NgQ413VWJV5T88NUA==/org.moire.opensudok...e pulled, 0 skipped. 21.6 MB/s (1507424 bytes in 0.067s)
adb: error: failed to stat remote object '/system/reserve/card/card.apk=com.oneplus.card.apk': No such file or directory

tar: unexpected EOF error

Heya mrrfv,
I'm having some troubles/bugs with the #Export contacts part of the script
have been trying to fix it myself but I'm kind of struggling.

would love to provide you with more info but I'm not sure what to send

awaiting your reply with excitement <3
Bruce.

get_text_input prompt result_var

Device info

Manufacturer: Nokia
Android version: 11
Custom ROM/rooted? No, vanilla Android One
Model: 2.3

System info

Available disk space: 65 GB on home partition, 11 on root.
Operating system: Debian Bookworm


Describe the issue below.
I am trying to run the script, but it is crashing at this step on both tar and adb mode.

Open Android Backup will install a companion app on your device, which will allow for contacts and other data to be backed up and restored.
The companion app is open-source, and you can see what it's doing under the hood on GitHub.
Companion app already downloaded.
Attempting to uninstall companion app.
Installing companion app.
Performing Streamed Install
Success
Granting required permissions to companion app.
Cleaning up after backup/restore...
Securely erasing temporary files, this will take a while.
Using /dev/urandom for random input.
Wipe mode is insecure (two passes [0xff/random])
Wiping ./backup-tmp DIRECTORY (going recursive now)
Removed directory ./backup-tmp ... Done
Cleanup complete.
Invalid usage. Usage: get_text_input prompt result_var [default_text]

After that, I just return to my regular prompt.

E_FAIL 7-Zip error occurs if the backup archive isn't split

Device info

Manufacturer: Samsung
Android version: 13
Custom ROM/rooted? No
Model: Zfold 3

System info

Available disk space: 300 GB
Operating system: Ubuntu 22.04.2 LTS


Describe the issue below.
My phone backup data size is nearly 100GB. The backup process went well until the 7z compression part. I've never successfully created the compressed image.

I've dug into backup_func.sh and the problem is with this line:
retry 5 7z a -p"$archive_password" -mhe=on -mx=9 -bb3 "$backup_archive" backup-tmp/*
which always result in the following on my PC:

System ERROR:
E_FAIL

I suspect it is file size issue because if I break up the compressed file into 8G splits the compression went well. I.e.:
7z a -p -mhe=on -mx=9 -bb3 -v8g manual_compress.7z backup-tmp/*

Please consider splitting the compressed file

Device Does Not Show Up

Hi I have several devices I am trying to recover and neither of them show up in the device list

Loading subscripts is suboptimal

In backup.sh, the subscripts are loaded with

for f in "$DIR"/functions/*; do source "$f"; done

I think this is suboptimal. Let's assume that you make a change in helper.sh: On Unix, most editors create a backup file called helper.sh~. Due to the * in the above code, this backed-up file gets also loaded, and usually after the changed file, thus essentially cancelling any modifications.

A probably better way is to say

for f in "$DIR"/functions/*.sh; do source "$f"; done

instead.

script aborts if an apk is missing

Device info

Manufacturer: Sony
Android version: 7.1.1
Custom ROM/rooted? no
Model: Sony Xperia Z5 compact (suzuran)

System info

Debian bullseye
Available disk space:
Operating system:


Something is going wrong with the apk download, causing the whole script to crash. I get:

Attempting to uninstall companion app.
Exporting apps.
adb: error: remote object '/mnt/asec/de.alpstein.alpregio.SchweizerPaerke-1/base.apk' does not exist

This app does not feature in my list of apps, so it is some artefact from a previous installation. Can I make the script just ignore such apps?

Failure when backing up .nomedia file

I was unable to get past this issue, but spent a little time looking at it. I am no android expert.
Things bump along ok (see #7) until this point:

Exporting internal storage - this will take a while.
adb: error: failed to copy '/storage/emulated/0/Android/data/.nomedia' to './backup-tmp/Storage/0/Android/data/.nomedia': remote open failed: Permission denied

I started an adb shell and found the file permissions were like so:

-rw------- 1 u0_a256 ext_data_rw 0 2021-05-10 20:59 storage/emulated/0/Android/data/.nomedia

My uid was 'shell' (uid 2000), so I had no way of changing the permissions. The phone is not rooted and not going to be.

It would be helpful to warn about such files but carry on processing. Better not to fail the backup for lack of permission on one zero-byte file.

Edit: usb client is mac laptop with Android Debug Bridge version 1.0.41, Version 33.0.2-8557947

backup.sh always fails with"tar: This does not look like a tar archive"

Hello,

I have been trying to use your LAB tool since I have read about it in an article of the German LinuxUser magazine ed. 09/2022 pp. 18-22 by Ferdinand Thommes, but so far it always aborts with below error, right after tentative storage of apk files for installed apps.

Is this a known issue with an effective fix or workaround?

Regards,
Ralph

7.56MiB 0:00:01 [7.36MiB/s] [ <=> ]
55.3MiB 0:00:07 [7.57MiB/s] [ <=> ]
6.17MiB 0:00:00 [7.36MiB/s] [<=> ]
2.69MiB 0:00:00 [6.96MiB/s] [<=> ]
110MiB 0:00:12 [8.59MiB/s] [ <=> ]
1.91MiB 0:00:00 [5.93MiB/s] [<=> ]
3.94MiB 0:00:01 [3.58MiB/s] [ <=> ]
91.0MiB 0:00:10 [8.66MiB/s] [ <=> ]
Exporting contacts (as vCard).
0.00 B 0:00:00 [0.00 B/s] [<=> ]
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors

[fiddle@lenolap:~/LU/202209]
$ ls backup-tmp/Apps/|grep -Ec [0-9]+\.apk
128

[fiddle@lenolap:~/LU/202209]
$ du -shx backup-tmp/Apps/
3.4G backup-tmp/Apps/

[fiddle@lenolap:~/LU/202209]
$ ll backup-tmp/Contacts/
total 0

Enable multiple attempts at a password pair when creating a backup

After taking the time to collect files for the backup, I was asked for my password. Then after I re-typed my password, the process failed. It would be convenient if instead of failing it looped back to the "Ask for password" function, maybe to a maximum of 3 tries in total, before failing.

Not working with macOS 11.4

Lots of errors are shown, and the script doesn't handle them and just keeps going.

$ git clone https://github.com/mrrfv/linux-android-backup
Cloning into 'linux-android-backup'...
remote: Enumerating objects: 283, done.
remote: Counting objects: 100% (17/17), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 283 (delta 4), reused 14 (delta 4), pack-reused 266
Receiving objects: 100% (283/283), 4.05 MiB | 8.35 MiB/s, done.
Resolving deltas: 100% (128/128), done.

$ ./backup.sh
Please enable developer options on your device, connect it to your computer and set it to file transfer mode. Then, press Enter to continue.
./backup.sh: line 20: [: -v: unary operator expected
If you have connected your device correctly, you should now see a message asking for access to your phone. Allow it, then press Enter to go to the last step.
Tip: If this is not the first time you're using this script, you might not need to allow anything.
./backup.sh: line 20: [: -v: unary operator expected
List of devices attached
xxxxxxxxxxxxxxx	device

Can you see your device in the list above, and does it say 'device' next to it? If not, quit this script (ctrl+c) and try again.
./backup.sh: line 55: [: -v: unary operator expected
Linux Android Backup will install a companion app on your device, which will allow for contacts to be backed up and restored.
The companion app is open-source, and you can see what it's doing under the hood on GitHub.
Downloading companion app.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 16.2M  100 16.2M    0     0  3393k      0  0:00:04  0:00:04 --:--:-- 4470k
Attempting to uninstall companion app.
Installing companion app.
Performing Streamed Install
Success
Granting required permissions to companion app.
./backup.sh: line 92: [: =: unary operator expected
./backup.sh: line 147: [: =: unary operator expected
If this project helped you, please star the GitHub repository. It lets me know that there are people using this script and I should continue working on it.

I've not investigated very much, but macOS's bash is old and it has something to do with this issue.

$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20)
Copyright (C) 2007 Free Software Foundation, Inc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.