IzzySoft / Adebar

Android DEvice Backup And Report, using Bash and ADB. Moved to https://codeberg.org/izzy/Adebar -- this is only a mirror now.
GNU General Public License v2.0
245 stars 41 forks source link

Backup and restore from different phone and different Android version #19

Closed danjde closed 8 years ago

danjde commented 8 years ago

Hi Staff, I'm a Linux user and, I would like to know if with Adebar could be possible to copy user apps (only user apps), system and user setting, blacklist phone and personal dictionary, from an "Xperia Sola with CyanogenMod 11-20150714-UNOFFICIAL-pepper" to Samsung Galaxy NS3 Neo with CyanogenMod 12.1-20150518-UNOFFICIAL-s3ve3g.

many thanks!!

Davide Italy

IzzySoft commented 8 years ago

Hi @danjde

possible to copy user apps (only user apps)

including their data, yes. That's what I use Adebar for frequently. Found no issues transfering user-apps between devices with that, even with different Android versions involved.

system and user setting, blacklist phone and personal dictionary

I've never tried that part. The scripts Adebar creates skips system .apk files for a good reason, but transfering their data should work. You could try that – in the worst case, you'd have to factory-reset the Neo and start over. But chances are good I'd say, especially since you've running CM (though in different versions) on both devices. Reports are welcome then!

danjde commented 8 years ago

Well surely I will report it, but for example, at the end of the procedure, how could I know if my dictionary is copied to the new phone? For the blacklist is simple, it is shown.

many thanks again!

IzzySoft commented 8 years ago

AFAIR you can edit your personal dictionary in the corresponding settings (usually the keyboard), e.g. to remove words. So you can check there the same way as with the blacklist.

danjde commented 8 years ago

Ok, I will try...

danjde commented 8 years ago

Hi Izzy, I'm now watching the configuration section. I've some doubt:

is not clear for me what mean the option: "MK_APPDISABLE: the script to „freeze/disable“ apps" what is an app freeze or disable? The default value is "freeze" and I'm sure it's right, but what does it mean?

So then I could start the process, but first a brief summary (tell me if correct):

1) I've two phone: "Phone-A" and "Phone-B" and I want to copy user apps and config from "Phone-A" to "Phone-B" 2) first set the config directory with "Phone-A" and "Phone-B" config files (taken from your config example) on the adebar root "installation directory" 3) then connect to usb Phone-A and run ./adebar-cli Phone-A. Then disconnect Phone-A and connect Phone-B and do the same for "Phone-B"; 4) look into the /home/me/backups/Phone-A/userbackup if everything is ok 5) now for backing up only user apps and data connect to usb Phone-A and run "/home/me/backups/Phone-A/userbackup" 6) for restoring to the second phone: run "/home/me/backups/Phone-B/userrestore"

PS is not clear for me if dictionary and blacklist are into sysbackup or userbackup

many thanks again

IzzySoft commented 8 years ago

@danjde

what is an app freeze or disable

You can disable system apps (which you cannot uninstall without root) via Android's Settings › Apps › All (where they have a "disable" button) or "freeze" them using e.g. Titanium Backup – which has the same effect: the app is still installed, but won't run automatically and isn't visible anymore in launchers or on the home screen. Details here. You can simply leave that alone; in most cases, the pm disable commands will require root anyway (I didn't check that part thoroughly).

the process

Basically yes, with one important difference: As you want to restore the apps from phone-A to phone-B, in step 6 you must connect phone-B but run the restore scripts from phone-A :)

is not clear for me if dictionary and blacklist are into sysbackup or userbackup

I have not checked where those settings are stored. Obviously, if they are set by system apps, they would be part of those – but don't ask me from which (the dictionary most likely belongs to the keyboard app, but I'm not sure for the blacklist). Note you can edit the scripts before executing them, and simply commenting-out stuff you don't want to restore by simply adding a # in front of the corresponding lines.

danjde commented 8 years ago

Thanks again for your very clear explanations; the last question:

for the system apps is it possible to restore only setting and not its application (because coming from a previous release all the system applications should be obsolete, and I wouldn't overwrite old apps to new)?

Now I open on Cyanogenmod forum a thread for understand better where is the place for blacklist and dictionary.

many thanks again, I'll update soon ;-)

cyanogenmod forum

IzzySoft commented 8 years ago

for the system apps is it possible to restore only setting and not its application

As the scripts created by Adebar only backup data and not the system apps ( .apk), that's what should indeed happen, yes. APK files are only covered for user apps with the scripts generated by Adebar.

Could you tell me the location of these files?

Not the correct question in your CM post. What you want to ask for is which system app store those data. But still, the answer you will most likely get should answer that as well: /data/data/<package_name>/* – and that package_name part tells you what backup to restore then.

I'll update soon

Please do, yes! I'm curious as well :)

danjde commented 8 years ago

As the scripts created by Adebar only backup data and not the system apps ( .apk), that's what should indeed happen, yes. [..]

Perfect!

What you want to ask for is which system app store those data.

I've edited CM post as per your directions

Speak to you soon..

IzzySoft commented 8 years ago

Looking forward to that, thanks!

danjde commented 8 years ago

Hi Izzy, I've updated cyanogen thread, but no other answer, look if it right...

IzzySoft commented 8 years ago

That looks good. As expected, your blacklist data should be covered by com.android.providers.telephony. Dictionary data being covered by com.android.inputmethod.latin also sounds convincing (that's the default keyboard app). However, before restoring those to the new device, back them up from it just to be on the safe side: If one of those apps had its database structures changed, you might encounter crashes (due to the "old database" not being compatible) – in which case you then could simply restore the "dummy" instead of doing a full factory reset. I had that once with a cross-device cross-ROM cross-version transfer (restoring the SMS database from an old device to another one with a newer ROM of a different make ;)

danjde commented 8 years ago

Well, for your optimum suggestions ;-) For now, I've run ADEBAR for collecting each phone information, and all is gone well:

./adebar-cli xperia

Adebar running: Gathering lists of installed apps Obtaining list of disabled apps Creating backup/restore scripts for UserApps Creating backup/restore scripts for SytemApps Checking default install-location Collecting partition details Collecting device information Pulling configuration files Generating app detail info PostProcessing and Cleanup Adebar done.

./adebar-cli neo3

Adebar running: Gathering lists of installed apps Obtaining list of disabled apps Creating backup/restore scripts for UserApps Creating backup/restore scripts for SytemApps Checking default install-location Collecting partition details Collecting device information Pulling configuration files Generating app detail info PostProcessing and Cleanup Adebar done.

But, for the "sms" I've not undestand if ADEBAR work or if is it necessary a manual action..

In the next days, I will make the entire process, but during this period I've no much time, here in Italy these are days when we pay taxes, and pay taxes in Italy is very very complicated and takes a lot of days to dedication and prayers, then our politicians take this money and pay their own election campaigns and seaside villas :-|

many thanks again ;-)

IzzySoft commented 8 years ago

But, for the "sms" I've not undestand if ADEBAR work or if is it necessary a manual action.

Unfortunately, adb backup doesn't cover SMS/MMS. Not much Adebar can do about that (except maybe pulling the corresponding database from rooted devices – but then, copying it back to a different device/ROM might cause issues (I had that in the past).

And yeah, taxes are a nightmare (as are most polititians). And when asking where the money went to, think of bunga-bunga in Italy …

danjde commented 8 years ago

Hi Izzy, today I'm running the operations. Now I'm running sys and user backup, here part of my two script comment out,

userbackup: _AUTO_CONFIRM=1 autoConfirmedBackup nl.jacobras.notes autoConfirmedBackup cn.wps.mofficeeng autoConfirmedBackup org.telegram.messenger autoConfirmedBackup it.messagenet.mtalk autoConfirmedBackup uk.amazon.mShop.android autoConfirmedBackup cm.aptoide.pt autoConfirmedBackup com.secuso.privacyFriendlyCodeScanner autoConfirmedBackup com.lynxspa.prontotreno autoConfirmedBackup net.wilfinger.aquarius2go autoConfirmedBackup org.schabi.newpipe autoConfirmedBackup com.eclipsim.gpsstatus2 autoConfirmedBackup com.here.app.maps autoConfirmedBackup com.cgollner.unclouded autoConfirmedBackup org.videolan.vlc autoConfirmedBackup org.sufficientlysecure.viewer autoConfirmedBackup com.owncloud.android autoConfirmedBackup com.shazam.android autoConfirmedBackup it.redturtle.mobile.apparpav autoConfirmedBackup it.wind.myWind autoConfirmedBackup net.osmand.plus autoConfirmedBackup com.u17od.upm autoConfirmedBackup at.bitfire.davdroid autoConfirmedBackup com.anod.calendar autoConfirmedBackup com.estrongs.android.pop autoConfirmedBackup net.osmand.parkingPlugin autoConfirmedBackup org.fdroid.fdroid

_sysbackup: AUTO_CONFIRM=1

autoConfirmedBackup com.andrew.apollo

autoConfirmedBackup com.android.voicedialer

autoConfirmedBackup com.android.defcontainer

autoConfirmedBackup com.google.android.exchange

autoConfirmedBackup com.android.contacts autoConfirmedBackup com.android.phone

autoConfirmedBackup com.android.calculator2

autoConfirmedBackup net.cactii.flash2

autoConfirmedBackup com.android.htmlviewer

autoConfirmedBackup com.android.cellbroadcastreceiver autoConfirmedBackup com.android.bluetooth autoConfirmedBackup com.android.providers.calendar

autoConfirmedBackup com.bel.android.dspmanager

autoConfirmedBackup com.android.calendar autoConfirmedBackup com.android.browser

autoConfirmedBackup com.android.onetimeinitializer

autoConfirmedBackup com.cyanogenmod.lockclock

autoConfirmedBackup com.android.providers.downloads.ui

autoConfirmedBackup com.android.documentsui

[..]

AUTO_CONFIRM=1

autoConfirmedBackup com.android.camera2

autoConfirmedBackup com.android.vpndialogs

autoConfirmedBackup com.android.mms

autoConfirmedBackup com.android.provision

autoConfirmedBackup com.android.providers.media

autoConfirmedBackup com.android.certinstaller

autoConfirmedBackup com.android.dreams.phototable

autoConfirmedBackup com.android.videoeditor

autoConfirmedBackup com.android.settings

autoConfirmedBackup jackpal.androidterm

autoConfirmedBackup com.android.gallery3d

autoConfirmedBackup com.android.musicvis

autoConfirmedBackup com.android.wallpaper.livepicker

autoConfirmedBackup org.whispersystems.whisperpush

autoConfirmedBackup org.cyanogenmod.launcher.home

autoConfirmedBackup com.android.packageinstaller

autoConfirmedBackup com.android.development

autoConfirmedBackup com.android.providers.telephony

autoConfirmedBackup com.svox.pico

autoConfirmedBackup com.android.noisefield

autoConfirmedBackup com.android.email autoConfirmedBackup com.android.dialer

autoConfirmedBackup com.android.wallpapercropper

autoConfirmedBackup com.android.location.fused

autoConfirmedBackup com.android.backupconfirm

autoConfirmedBackup com.android.magicsmoke

autoConfirmedBackup com.android.providers.settings

autoConfirmedBackup com.android.providers.downloads

autoConfirmedBackup com.android.phasebeam

autoConfirmedBackup com.android.soundrecorder

autoConfirmedBackup com.cyanogenmod.account autoConfirmedBackup com.android.inputmethod.latin

autoConfirmedBackup com.android.proxyhandler

autoConfirmedBackup org.cyanogenmod.themes.provider

autoConfirmedBackup com.android.inputdevices

autoConfirmedBackup com.android.wallpaper.holospiral

autoConfirmedBackup com.android.nfc

autoConfirmedBackup com.android.stk

autoConfirmedBackup com.android.providers.userdictionary autoConfirmedBackup com.cyanogenmod.filemanager

autoConfirmedBackup com.android.pacprocessor

autoConfirmedBackup com.android.galaxy4

autoConfirmedBackup com.android.printspooler

autoConfirmedBackup android

autoConfirmedBackup com.android.providers.contacts

autoConfirmedBackup com.android.externalstorage

autoConfirmedBackup eu.chainfire.opendelta

autoConfirmedBackup com.android.dreams.basic

autoConfirmedBackup com.android.incallui

autoConfirmedBackup com.cyanogenmod.trebuchet

autoConfirmedBackup com.android.apps.tag

autoConfirmedBackup com.android.systemui

autoConfirmedBackup org.cyanogenmod.wallpapers.photophase

autoConfirmedBackup com.android.keychain

autoConfirmedBackup com.android.smspush

autoConfirmedBackup org.cyanogenmod.theme.chooser

autoConfirmedBackup com.android.wallpaper

autoConfirmedBackup com.android.deskclock

autoConfirmedBackup com.cyanogenmod.wallpapers

autoConfirmedBackup com.android.keyguard

autoConfirmedBackup org.cyanogenmod.voiceplus

autoConfirmedBackup com.android.shell_

A question: If I backup and then restore an android app and data that on the new phone does not exist or is in most recent version, what happens?

thanks again!

danjde commented 8 years ago

Update: almost all files stored are size zero:

ls -l userApps/

_totale 37176 -rw-r----- 1 vage vage 0 giu 18 10:10 at.bitfire.davdroid.ab -rw-r----- 1 vage vage 0 giu 18 09:53 cm.aptoide.pt.ab -rw-r----- 1 vage vage 32794023 giu 18 09:50 cn.wps.mofficeeng.ab -rw-r----- 1 vage vage 0 giu 18 10:11 com.anod.calendar.ab -rw-r----- 1 vage vage 0 giu 18 10:00 com.cgollner.unclouded.ab -rw-r----- 1 vage vage 0 giu 18 09:58 com.eclipsim.gpsstatus2.ab -rw-r----- 1 vage vage 0 giu 18 10:12 com.estrongs.android.pop.ab -rw-r----- 1 vage vage 0 giu 18 09:59 com.here.app.maps.ab -rw-r----- 1 vage vage 0 giu 18 09:55 com.lynxspa.prontotreno.ab -rw-r----- 1 vage vage 0 giu 18 10:03 com.owncloud.android.ab -rw-r----- 1 vage vage 0 giu 18 09:54 com.secuso.privacyFriendlyCodeScanner.ab -rw-r----- 1 vage vage 0 giu 18 10:04 com.shazam.android.ab -rw-r----- 1 vage vage 0 giu 18 10:09 com.u17od.upm.ab -rw-r----- 1 vage vage 0 giu 18 09:51 it.messagenet.mtalk.ab -rw-r----- 1 vage vage 0 giu 18 10:05 it.redturtle.mobile.apparpav.ab -rw-r----- 1 vage vage 0 giu 18 10:06 it.wind.myWind.ab -rw-r----- 1 vage vage 0 giu 18 10:13 net.osmand.parkingPlugin.ab -rw-r----- 1 vage vage 0 giu 18 10:07 net.osmand.plus.ab -rw-r----- 1 vage vage 0 giu 18 09:56 net.wilfinger.aquarius2go.ab -rw-r----- 1 vage vage 5233504 giu 18 09:49 nl.jacobras.notes.ab -rw-r----- 1 vage vage 0 giu 18 10:14 org.fdroid.fdroid.ab -rw-r----- 1 vage vage 0 giu 18 09:57 org.schabi.newpipe.ab -rw-r----- 1 vage vage 0 giu 18 10:02 org.sufficientlysecure.viewer.ab -rw-r----- 1 vage vage 0 giu 18 09:50 org.telegram.messenger.ab -rw-r----- 1 vage vage 0 giu 18 10:01 org.videolan.vlc.ab -rw-r----- 1 vage vage 0 giu 18 09:52 uk.amazon.mShop.android.ab

ls -l sysApps/

totale 0 -rw-r----- 1 vage vage 0 giu 18 10:21 com.android.bluetooth.ab -rw-r----- 1 vage vage 0 giu 18 10:24 com.android.browser.ab -rw-r----- 1 vage vage 0 giu 18 10:23 com.android.calendar.ab -rw-r----- 1 vage vage 0 giu 18 10:20 com.android.cellbroadcastreceiver.ab -rw-r----- 1 vage vage 0 giu 18 10:18 com.android.contacts.ab -rw-r----- 1 vage vage 0 giu 18 10:31 com.android.dialer.ab -rw-r----- 1 vage vage 0 giu 18 10:30 com.android.email.ab -rw-r----- 1 vage vage 0 giu 18 10:38 com.android.incallui.ab -rw-r----- 1 vage vage 0 giu 18 10:34 com.android.inputdevices.ab -rw-r----- 1 vage vage 0 giu 18 10:33 com.android.inputmethod.latin.ab -rw-r----- 1 vage vage 0 giu 18 10:19 com.android.phone.ab -rw-r----- 1 vage vage 0 giu 18 10:22 com.android.providers.calendar.ab -rw-r----- 1 vage vage 0 giu 18 10:37 com.android.providers.contacts.ab -rw-r----- 1 vage vage 0 giu 18 10:29 com.android.providers.media.ab -rw-r----- 1 vage vage 0 giu 18 10:35 com.android.providers.userdictionary.ab -rw-r----- 1 vage vage 0 giu 18 10:39 com.android.smspush.ab -rw-r----- 1 vage vage 0 giu 18 10:32 com.cyanogenmod.account.ab -rw-r----- 1 vage vage 0 giu 18 10:36 com.cyanogenmod.filemanager.ab

IzzySoft commented 8 years ago

If I backup and then restore an android app and data that on the new phone does not exist or is in most recent version, what happens?

They will be replaced by the version from your backup.

almost all files stored are size zero

I've never seen this that excessively – but yes, developers can decide their apps shall not be backed up (there's a flag ALLOW_BACKUP). You can work around that only if your device is rooted, by using an XPosed module named "BackupAllApps" which "overrides" that flag.

danjde commented 8 years ago

Hi Izzy, I've installed XPosed module named BackupAllApps, and now the situation is better: some apks have been copied, but some are still zero byte:

-rw-r----- 1 vage vage    0 giu 18 15:00 at.bitfire.davdroid.ab
-rw-r----- 1 vage vage 8,2M giu 18 14:54 cm.aptoide.pt.ab
-rw-r----- 1 vage vage  32M giu 18 14:53 cn.wps.moffice_eng.ab
-rw-r----- 1 vage vage    0 giu 18 15:01 com.anod.calendar.ab
-rw-r----- 1 vage vage 9,8M giu 18 14:56 com.cgollner.unclouded.ab
-rw-r----- 1 vage vage 1,6M giu 18 14:56 com.eclipsim.gpsstatus2.ab
-rw-r----- 1 vage vage    0 giu 18 15:02 com.estrongs.android.pop.ab
-rw-r----- 1 vage vage   41 giu 18 14:56 com.here.app.maps.ab
-rw-r----- 1 vage vage  25M giu 18 14:55 com.lynxspa.prontotreno.ab
-rw-r----- 1 vage vage 2,5M giu 18 14:57 com.owncloud.android.ab
-rw-r----- 1 vage vage 1,4M giu 18 14:54 com.secuso.privacyFriendlyCodeScanner.ab
-rw-r----- 1 vage vage  40M giu 18 14:58 com.shazam.android.ab
-rw-r----- 1 vage vage    0 giu 18 14:59 com.u17od.upm.ab
-rw-r----- 1 vage vage  19M giu 18 14:54 it.messagenet.mtalk.ab
-rw-r----- 1 vage vage 2,7M giu 18 14:58 it.redturtle.mobile.apparpav.ab
-rw-r----- 1 vage vage  16M giu 18 14:58 it.wind.myWind.ab
-rw-r----- 1 vage vage    0 giu 18 15:03 net.osmand.parkingPlugin.ab
-rw-r----- 1 vage vage   32 giu 18 14:59 net.osmand.plus.ab
-rw-r----- 1 vage vage 1,7M giu 18 14:55 net.wilfinger.aquarius2go.ab
-rw-r----- 1 vage vage 5,0M giu 18 14:52 nl.jacobras.notes.ab
-rw-r----- 1 vage vage    0 giu 18 15:04 org.fdroid.fdroid.ab
-rw-r----- 1 vage vage 2,6M giu 18 14:56 org.schabi.newpipe.ab
-rw-r----- 1 vage vage 6,2M giu 18 14:57 org.sufficientlysecure.viewer.ab
-rw-r----- 1 vage vage   41 giu 18 14:53 org.telegram.messenger.ab
-rw-r----- 1 vage vage  14M giu 18 14:57 org.videolan.vlc.ab
-rw-r----- 1 vage vage   41 giu 18 14:54 uk.amazon.mShop.android.ab_

Do you think it would be useful to try to back up some apks directly from adb to debug the problem?

I've try to run:

adb shell 'pm list packages -f reader'

but obtain no one informations

After I would have used:

adb pull [filepathname] [destination path]

I've seen this post, where you are also intervened.

Thanks again :-)

danjde commented 8 years ago

Update: I've try to restore, but seem not possible:

Trying to unlock your screen...
restoring: nl.jacobras.notes
adb: unable to open file nl.jacobras.notes
restoring: cn.wps.moffice_eng
adb: unable to open file cn.wps.moffice_eng
restoring: org.telegram.messenger
adb: unable to open file org.telegram.messenger
restoring: it.messagenet.mtalk
adb: unable to open file it.messagenet.mtalk
restoring: uk.amazon.mShop.android
adb: unable to open file uk.amazon.mShop.android
restoring: cm.aptoide.pt
adb: unable to open file cm.aptoide.pt
restoring: com.secuso.privacyFriendlyCodeScanner
adb: unable to open file com.secuso.privacyFriendlyCodeScanner
restoring: com.lynxspa.prontotreno
adb: unable to open file com.lynxspa.prontotreno
restoring: net.wilfinger.aquarius2go
adb: unable to open file net.wilfinger.aquarius2go
restoring: org.schabi.newpipe
adb: unable to open file org.schabi.newpipe
restoring: com.eclipsim.gpsstatus2
adb: unable to open file com.eclipsim.gpsstatus2
restoring: com.here.app.maps
adb: unable to open file com.here.app.maps
restoring: com.cgollner.unclouded
adb: unable to open file com.cgollner.unclouded
restoring: org.videolan.vlc
adb: unable to open file org.videolan.vlc
restoring: org.sufficientlysecure.viewer
adb: unable to open file org.sufficientlysecure.viewer
restoring: com.owncloud.android
adb: unable to open file com.owncloud.android
restoring: com.shazam.android
adb: unable to open file com.shazam.android
restoring: it.redturtle.mobile.apparpav
adb: unable to open file it.redturtle.mobile.apparpav
restoring: it.wind.myWind
adb: unable to open file it.wind.myWind
restoring: net.osmand.plus
adb: unable to open file net.osmand.plus
restoring: com.u17od.upm
adb: unable to open file com.u17od.upm
restoring: at.bitfire.davdroid
adb: unable to open file at.bitfire.davdroid
restoring: com.anod.calendar
adb: unable to open file com.anod.calendar
restoring: com.estrongs.android.pop
adb: unable to open file com.estrongs.android.pop
restoring: net.osmand.parkingPlugin
adb: unable to open file net.osmand.parkingPlugin
restoring: org.fdroid.fdroid
adb: unable to open file org.fdroid.fdroid
IzzySoft commented 8 years ago

Trying to unlock your screen...

Auto-unlock is highly experimental, and doesn't always work. First try without that, and see if that helps.

adb shell 'pm list packages -f reader'

I very much doubt a package by that name exists – that doesn't look like a complete package name to me. Used as a "filter" (what the -f switch should do – I've never used that switch, so I don't know exactly what it filters on), I don't see a package name containing "reader" either in your above lists.

Concerning remaining 0 byte files: that's strange. I've just tried at.bitfire.davdroid.ab and can confirm it doesn't back up – despite of BackupAllApps being active. No idea what's behind that – and I'm afraid nothing Adebar can fix. If you find a clue, please name it.

Btw: For DAVDroid it wouldn't really matter. You can install it again from e.g. F-Droid, and have to reconfigure it anyway – as account details are not part of the backup (those data belong to the account manager, which doesn't let you retrieve them via adb backup AFAIK).

danjde commented 8 years ago

Hi Izzy, I've try to backup and then restore directly from adb, but nothing:

From phone A adb shell 'pm list packages -f videolan' package:/data/app/org.videolan.vlc-2.apk=org.videolan.vlc adb pull /data/app/org.videolan.vlc-2.apk ~/mybackupdir ls ~/mybackupdir org.videolan.vlc-2.apk

From phone B adb restore ~/mybackupdir/org.videolan.vlc-2.apk Now unlock your device and confirm the restore operation.

I unlock, and no error message

Al seem to work fine but then, looking into the installed apps, nothing: the app is not installed;

I don't understand, perhaps Cyangenmod 12.1 works differently. I've enabled on developer options, root for adb and apps, on each phone, but nothing.

IzzySoft commented 8 years ago

adb restore ~/mybackupdir/org.videolan.vlc-2.apk

Wrong. Try adb install org.videolan.vlc-2.apk – APK files are no backup files :)

danjde commented 8 years ago

adb install ~/mybackupdir/org.videolan.vlc-2.apk 4835 KB/s (16224544 bytes in 3.276s) pkg: /data/local/tmp/org.videolan.vlc-2.apk Success

Well, this works.

Then, I've tested the ability to backup a single app and its data:

I've try on the PhoneA:

adb backup -f com.anod.calendar.ab -apk com.anod.calendar Now unlock your device and confirm the backup operation.

ls -l -rw-r----- 1 vage vage 1341761 giu 19 12:05 com.anod.calendar.ab

Works fine

Now I've connected the PhoneB and run the restore process:

adb restore com.anod.calendar.ab Now unlock your device and confirm the restore operation.

Works fine

Now I very doesn't understand why running adebar script "userrestore" this fails. Where I could be wrong? :-) Another information, that could be useful: When I run "userrestore" form PhoneA directory, having connected the PhoneB, I can see from screen some icons automatically selected, and then the phone automatically run this applications ... I hope I was clear :-)

Thanks again!

IzzySoft commented 8 years ago

First I wonder why com.anod.calendar.ab can suddenly backed up at all – in your last post, you wrote the backup results in a 0 byte file?

Now I very doesn't understand why running adebar script "userrestore" this fails.

From the output above, it looks like none of the .ab files are found. Are you sure you run the script from within its directory, and didn't rename the backup directory? The whole output looks strange to me:

restoring: com.anod.calendar
adb: unable to open file com.anod.calendar

Those entries miss the .ab suffix on the files. The restore function is called with the name of the backup file (e.g. com.anod.calendar.ab), not just with the package name. I cannot reproduce your problem here.

When I run "userrestore" form PhoneA directory, having connected the PhoneB, I can see from screen some icons automatically selected, and then the phone automatically run this applications ... I hope I was clear :-)

No idea, sorry. adb restore only restores your backup usually. I've never noticed it starting any app on the device.

danjde commented 8 years ago

First I wonder why com.anod.calendar.ab can suddenly backed up at all – in your last post, you wrote the backup results in a 0 byte file?

No, on the second backup (after XPosed module installation) com.anod.calendar.ab is successfully copied.

From the output above, it looks like none of the .ab files are found. Are you sure you run the script from within its directory, and didn't rename the backup directory? The whole output looks strange to me [..]

I've loooking into "userrestore" script the files name are without ".ab":

autoConfirmedRestore nl.jacobras.notes
autoConfirmedRestore cn.wps.moffice_eng
#autoConfirmedRestore org.telegram.messenger
autoConfirmedRestore it.messagenet.mtalk
#autoConfirmedRestore uk.amazon.mShop.android
autoConfirmedRestore cm.aptoide.pt
autoConfirmedRestore com.secuso.privacyFriendlyCodeScanner
[..]

Is it correct? or should be:

autoConfirmedRestore nl.jacobras.notes.ab
autoConfirmedRestore cn.wps.moffice_eng.ab
#autoConfirmedRestore org.telegram.messenger.ab
autoConfirmedRestore it.messagenet.mtalk.ab
#autoConfirmedRestore uk.amazon.mShop.android.ab
autoConfirmedRestore cm.aptoide.pt.ab
autoConfirmedRestore com.secuso.privacyFriendlyCodeScanner.ab
[..]

This the relative restore script:

function doRestore() {
  read -n 1 -p "Do you wish to restore ${1#*/} now? (Y/n) " res
  echo
  if [[ "${res,,}" = "y" || -z "${res}" ]]; then
  echo "restoring: ${1}"
    adb  restore ${1}
  else
    echo "Skipping ${1#*/}"
  fi
}

Looking into "userApps" directory all seem fine:

ls -la userApps
totale 188731
drwxrwxr-x 2 vage vage     1168 giu 18 15:04 .
drwxrwxr-x 8 vage vage      440 giu 19 14:36 ..
-rw-r----- 1 vage vage        0 giu 18 15:00 at.bitfire.davdroid.ab
-rw-r----- 1 vage vage  8547726 giu 18 14:54 cm.aptoide.pt.ab
-rw-r----- 1 vage vage 32793990 giu 18 14:53 cn.wps.moffice_eng.ab
-rw-r----- 1 vage vage        0 giu 18 15:01 com.anod.calendar.ab
-rw-r----- 1 vage vage 10203943 giu 18 14:56 com.cgollner.unclouded.ab
-rw-r----- 1 vage vage  1637230 giu 18 14:56 com.eclipsim.gpsstatus2.ab
-rw-r----- 1 vage vage        0 giu 18 15:02 com.estrongs.android.pop.ab
-rw-r----- 1 vage vage       41 giu 18 14:56 com.here.app.maps.ab
-rw-r----- 1 vage vage 26181215 giu 18 14:55 com.lynxspa.prontotreno.ab
-rw-r----- 1 vage vage  2581052 giu 18 14:57 com.owncloud.android.ab
-rw-r----- 1 vage vage  1427653 giu 18 14:54 com.secuso.privacyFriendlyCodeScanner.ab
-rw-r----- 1 vage vage 40978553 giu 18 14:58 com.shazam.android.ab
-rw-r----- 1 vage vage        0 giu 18 14:59 com.u17od.upm.ab
-rw-r----- 1 vage vage 19551448 giu 18 14:54 it.messagenet.mtalk.ab
-rw-r----- 1 vage vage  2741271 giu 18 14:58 it.redturtle.mobile.apparpav.ab
-rw-r----- 1 vage vage 15873917 giu 18 14:58 it.wind.myWind.ab
-rw-r----- 1 vage vage        0 giu 18 15:03 net.osmand.parkingPlugin.ab
-rw-r----- 1 vage vage       32 giu 18 14:59 net.osmand.plus.ab
-rw-r----- 1 vage vage  1686539 giu 18 14:55 net.wilfinger.aquarius2go.ab
-rw-r----- 1 vage vage  5233498 giu 18 14:52 nl.jacobras.notes.ab
-rw-r----- 1 vage vage        0 giu 18 15:04 org.fdroid.fdroid.ab
-rw-r----- 1 vage vage  2723622 giu 18 14:56 org.schabi.newpipe.ab
-rw-r----- 1 vage vage  6462606 giu 18 14:57 org.sufficientlysecure.viewer.ab
-rw-r----- 1 vage vage       41 giu 18 14:53 org.telegram.messenger.ab
-rw-r----- 1 vage vage 14404617 giu 18 14:57 org.videolan.vlc.ab
-rw-r----- 1 vage vage       41 giu 18 14:54 uk.amazon.mShop.android.ab
danjde commented 8 years ago

..or could be the problem around the:

cd "userApps"

Where is set this variable on the script "userrestore"?

I would like to learn and understand :-)

IzzySoft commented 8 years ago

autoConfirmedRestore nl.jacobras.notes.ab

This is how the lines should look like. As I don't use AutoConfirm myself, maybe there's a bug at that place … indeed, looks like. Could you please try updating line 156 in lib/scriptgen.lib from

echo "autoConfirmedRestore ${app}" >> "$restorescript"

to

echo "autoConfirmedRestore ${app}.ab" >> "$restorescript"

and run Adebar again? Does the restore script work then?

danjde commented 8 years ago

I've made the changes and redo all actions from adebar, now the restore process goes on, but at the end no one apps was restored:

./userrestore NOTICE: Do not interact with your device while performing automated restores! Trying to unlock your screen...

restoring: nl.jacobras.notes.ab Now unlock your device and confirm the restore operation.

restoring: cn.wps.moffice_eng.ab Now unlock your device and confirm the restore operation.

restoring: it.messagenet.mtalk.ab Now unlock your device and confirm the restore operation.

restoring: cm.aptoide.pt.ab Now unlock your device and confirm the restore operation.

restoring: com.secuso.privacyFriendlyCodeScanner.ab Now unlock your device and confirm the restore operation.

restoring: com.lynxspa.prontotreno.ab Now unlock your device and confirm the restore operation.

restoring: net.wilfinger.aquarius2go.ab Now unlock your device and confirm the restore operation.

restoring: org.schabi.newpipe.ab Now unlock your device and confirm the restore operation.

restoring: com.eclipsim.gpsstatus2.ab Now unlock your device and confirm the restore operation.

restoring: com.here.app.maps.ab Now unlock your device and confirm the restore operation.

restoring: com.cgollner.unclouded.ab Now unlock your device and confirm the restore operation.

restoring: org.videolan.vlc.ab Now unlock your device and confirm the restore operation.

restoring: org.sufficientlysecure.viewer.ab Now unlock your device and confirm the restore operation.

restoring: com.owncloud.android.ab Now unlock your device and confirm the restore operation.

restoring: com.shazam.android.ab Now unlock your device and confirm the restore operation.

restoring: it.redturtle.mobile.apparpav.ab Now unlock your device and confirm the restore operation.

restoring: it.wind.myWind.ab Now unlock your device and confirm the restore operation.

restoring: com.u17od.upm.ab Now unlock your device and confirm the restore operation.

restoring: at.bitfire.davdroid.ab Now unlock your device and confirm the restore operation.

restoring: com.anod.calendar.ab Now unlock your device and confirm the restore operation.

restoring: com.estrongs.android.pop.ab Now unlock your device and confirm the restore operation.

restoring: net.osmand.parkingPlugin.ab Now unlock your device and confirm the restore operation.

restoring: org.fdroid.fdroid.ab Now unlock your device and confirm the restore operation.

NB After the third restore process, the display show the adb unlock screen where both the two buttons were grey and not clickable until the end

IzzySoft commented 8 years ago

As I wrote before, it then maybe time to try without the auto-confirm. It's a highly experimental feature (and you'd need to experiment with it – especially with the MK_AUTOCONFIRM_DELAY). If it hits to fast (i.e. before the previous restore was finished), it fails – and sometimes "blocks" further use until rebooted. Your "NB" seems to confirm this hit you. Either use without auto-confirm, or try with a larger delay.

danjde commented 8 years ago

I've increase to 12 MK_AUTOCONFIRM_DELAY value and now some apps are restored, not all. But in the same way I see that the process from the computer monitor to display phone is not synchronized. It seems that the recovery process runs too fast. And not for all apps I can see on the phone display the name of the restoring app during the process.

Then, is it normal that there is not a progress bar for restore and backup process? In the PHONE1 config is present PROGRESS=1

Then, the value MK_APPRESTORE_DELAY=p seems not to be considered, in fact the restoring process takes place without human action. Is it correct?

One last note: while the restore process start, on Cyanogen 12.1 start Trebuchet interface for a few seconds, then appear the ADB Total Recovery Interface.

IzzySoft commented 8 years ago

MK_AUTOCONFIRM_DELAY

I found no way yet to figure automatically when the next item can be processed (didn't check too deep, suggestions welcome – but let's move that and all other auto-confirm stuff to a separate issue then, this one already got far too long and mixed).

is it normal that there is not a progress bar

Yes. No "progress bar" anywhere. Maybe a poorly chosen variable name, should have better been something like LOG_LEVEL. Should be described in the docs/wiki AFAIR, so please RTFM :)

in fact the restoring process takes place without human action

Auto overruns human. Like in traffic, no opposite appearances were reported yet :)

while the restore process start, on Cyanogen 12.1 start Trebuchet interface for a few seconds, then appear the ADB Total Recovery Interface.

Sounds perfectly normal to me. Before you started Adebar, you've probably been on your homescreen – so that's what you see when the device is unlocked (for as long as the delay between "unlock" and "start process" was set).

danjde commented 8 years ago

Hi Izzy, No, MK_AUTOCONFIRM_DELAY set to 30 or 60 is not enough, some packages was not restored.

Only setting AUTO_CONFIRM=0 and AUTO_UNLOCK=0 I was able to restore the backup files.

Even so before the restoration process to begin and even before i confirm from the display on the console i have on Linux console the message asking me to accept the restoration of the next packet. I think you should improve (not necessary increase) Adebar timing functions.

So the applications and its configurations seem correctly restored.

Now I have to take care of others, you've been very kind :-)

IzzySoft commented 8 years ago

Even so before the restoration process to begin and even before i confirm from the display on the console i have on Linux console the message asking me to accept the restoration of the next packet.

Nothing I can do about, sorry: there's no feedback from the device on that. ADB "spawns" the command on the device, and then immediately returns. If someone comes up with an idea of how to control that (find out when it's really done), I'm all open – but I have no idea (and currently lack the time to investigate that myself).

So the applications and its configurations seem correctly restored.

Glad to read! Hope you also like Adebar for its other features (e.g. the device documentation), and keep using it. I will close this issue now, as (hopefully) all has been done. Be welcome to open a new one if you have other questions/issues/suggestions :)