mrrfv / open-android-backup

Back up your device without vendor lock-ins, using insecure software or root. Supports encryption and compression out of the box. Works cross-platform.
http://openandroidbackup.me/
GNU General Public License v3.0
751 stars 40 forks source link

Script crashes when exporting contacts #7

Closed Poomex closed 2 years ago

Poomex commented 2 years ago

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

mrrfv commented 2 years ago

What Android version are you on? Also, have you pressed the "Export Data" button in the companion app before letting the script continue?

Poomex commented 2 years ago

Android 10 (Havoc OS 3.7). Yes I have, I pressed the button and then continued the script with enter.

mrrfv commented 2 years ago

Do you have any experience with Android app development? I can't reproduce this on my side, so you'd have to install Flutter and Android Studio, build a debug .apk and use the built-in debugger to get error logs. A video or screenshots could be also helpful.

P.S. Możemy porozumiewać się po polsku :)

Poomex commented 2 years ago

Unfortunately I don't, but if you were to build such an apk I could install it and get the logcat from it. Would that work?

P.S. dla dobra innych użytkowników którzy mogą mieć ten sam problem może pozostańmy przy angielskim ;)

On January 23, 2022 6:37:05 PM GMT+01:00, mrrfv @.***> wrote:

Do you have any experience with Android app development? I can't reproduce this on my side, so you'd have to install Flutter and Android Studio, build a debug .apk and use the built-in debugger to get error logs. A video or screenshots could be also helpful.

P.S. Możemy porozumiewać się po polsku :)

-- > Reply to this email directly or view it on GitHub:

https://github.com/mrrfv/linux-android-backup/issues/7#issuecomment-1019531907

You are receiving this because you authored the thread.

Message ID: @.***> -- Sent from my Android device with K-9 Mail. Please excuse my brevity.

L34T commented 2 years ago

android:maxSdkVersion="28" from https://github.com/mrrfv/linux-android-backup/blob/673728da1d991e7fea2696810d9a1cab1603487b/companion_app/android/app/src/main/AndroidManifest.xml#L6 is wrong for me and returns errno 13 on create directory.

ps api29 phone ps2 not sure, but seems this line required for api29 and above... I was wrong. MANAGE_EXTERNAL_STORAGE required from api30 and above. But WRITE_EXTERNAL_STORAGE was required(according to manifest) for api28 and earlier. So for api29 no write permission was requested in manifest.

mrrfv commented 2 years ago

I built 2 debug APKs - one with no changes, and one with android:maxSdkVersion set to 29. Let me know if the second debug APK resolves the issue.

Download link (compressed with 7-Zip)

Poomex commented 2 years ago

The debug version worked for me. But I had to replace the .apk built by the script with the debug one, otherwise it kept overwriting it with the original.

Thank you for your work! Pozdro

xipmix commented 2 years ago

I saw this too on Android 12 and master at 1d395afb. To get past it I had to make this hack.

@@ -82,6 +82,8 @@ for permission in "${permissions[@]}"; do
   adb shell pm grant com.example.companion_app $permission
 done

+adb shell mkdir -p /storage/emulated/0/linux-android-backup-temp
+
 if [ -d backup-tmp ]; then
   cecho "Cleaning up after previous backup/restore..."
   rm -rfv backup-tmp

What is supposed to create this directory, if you don't do it with an adb shell command? You use one to remove it again.