yashsingh1/xdaforums huggingface dataset:
[Magisk] Sander9847:
I tried the wipe feature but broke something.

I reflashed my rom after the adk wipe and at first it worked but some apps didn't get installed. So I went and restored my full nandroid backup without uninstalling adk.

Now my rom has no mobile-data connection anymore, tried fixing it but this is what the APN settings give..

I find it very weird because I backedup everything and this is a problem I didn't have before. So it shouldn't be possible.
[Magisk] Sander9847:
Edit: APN settings error
[Magisk] totalnoob34:
It gave that error to me as well, I brushed it off as the ROM's fault. You just press the top right button and add the APN settings for your carrier manually. You can google the parameters.
[Magisk] Sander9847:
Thank you very much. That worked great! ?

I honestly wouldn't have known it was such an easy fix.

I was trying different firmwares and deleting config files. :rolleyes:

EDIT: the "restore default apn settings" button still seems broken though. It seems the new default is an empty list.
[Magisk] totalnoob34:
Maybe adk tinkered with apn settings, so that the defaults are no longer visible to the user created after wiping. I honestly have no clue.

Yes, restoring the default produced an empty list to me as well. I have no idea what happened, but I'm pretty positive it's something fixable with a proper factory reset. My solution is adding the APN setting manually and forgetting about the whole ordeal, doublethink-like.

EDIT: By 'tinkering' I mean it maybe didn't delete the folder where APN settings are stored, but it did delete the users, so that when a new one is created on reboot it doesn't have permission to access them. I am not a developer, though, I may be terribly wrong.
[Magisk] christian.arvin:
[MENTION=5228676]VR25[/MENTION]

Been wondering about this for a while,

Does your script handle the proper user:group permissions on restore? As I have observe when clean flashing. The permissions assignment is loss in data, and android recreate this and assigns new user:group id. This will cause security problems for apps and android system denying permissions and app data with 0:0 is a security risk. (context permissions is also a concern for SELinux)

I'm speculating, that's why titanium backup uses the package manager when restoring the app. Then adds the data afterwards.

I don't really have that much knowledge on how android do stuffs in background, but I can speculate that it saves data and settings to configs and database when it installs an app.

I love your Idea, and it could save us users in the custom ROM community, when sometimes updating the ROM requires us to do a clean install.

Hope this would help in your development.

PS, TB is a hassle for system updated apps.
[Magisk] VR25:
[MENTION=6550197]Sander9847[/MENTION], [MENTION=4628223]totalnoob34[/MENTION], I haven't experienced that. Will take a closer look...

[MENTION=2433195]goldencore[/MENTION], automated backups (and restores) don't work at all. You have to manually do both with the wizard. I may have found what's broken in Magisk, though (and there's a workaround).

[MENTION=6642823]christian.arvin[/MENTION], correct user:group are restored from /data/system/packages.list (after target apps are installed, of course).

SELinux contexts are handled automatically by the system itself.

Anything wrong, apart from posing security risks, would cause apps to repeatedly crash, rendering the whole system unusable (tested).

P.S., adk restricts permissions to 771 (rwx-rwx-x).
[Magisk] ainurrofiq:
How to add couple of apps, like WhatsApp, Telegram, just two of it without backing up all of the apps?

Should I write in config.txt

inc com.whatsapp

inc com.telegram

Like that? [MENTION=5228676]VR25[/MENTION]

Edit : Ive done adding both of the app by using globbing trick, and one more question, I'm on Oreo now, can this backup restored to nougat? Coz I will back to nougat soon, and the way to restore it is to flashing adk and perform wipe cache, dalvik, data and system, ,and then flash new ROM along with gapps n magisk,

Is it right?
[Magisk] Fif_:
Does adk support migrating device-encrypted app data (/data/user_de/<uid>)?

What about multiple users (/data/user/<uid> + /data/user_de/<uid> if the device has device-encrypted data)?
[Magisk] goldencore:
New update seems to work just fine with Magisk 17.1!

Thanks a lot for your work!
[Magisk] VR25:
Do you guys use multiple user accounts?

The restore works regardless of Android version. Keep this in mind tough: apps designed for Oreo and above will not install on Nougat.

Regarding how to perform a factory reset, while preserving the good stuf:

1. Add wipe to config or uncomment it and/or remove leading spaces.

2. Flash the same adk version from TWRP. It handles all the wiping and data migration automatically.

3. Flash new ROM.

That's all.

It does migrate some of that data. But I've specifically stated that adk wipe feature hasn't been tested on encrypted data, as I don't use encryption.

If you're wiling to test, take a full data backup (inc. media) and save it on a different storage device, just in case.

EDIT: as per the APN error report, multiple accounts migration doesn't seem to be fully functional. I have to take a closer look to see whether any special permissions need to be taken care of.

EDIT 2: for multiple user accounts, only settings are migrated.
[Magisk] ainurrofiq:
Okay thanks, , do you have ask group Telegram , we should make one , , it's gonna make reporting easier
[Magisk] totalnoob34:
Nope, I don't.
[Magisk] Fif_:
Well I do ;). That's why I was asking if it was supported...
[Magisk] totalnoob34:
No, sure, I was answering the question myself. Of course OP will want to solve the problem generally, just saying it still happens with a single user.
[Magisk] Shawn_007:
Not working for 17.1

Version tested - 2018.9.14
[Magisk] ainurrofiq:
I'm on 17.1

And it's working,
[Magisk] VR25:
That's not the latest adk version. ?️
[Magisk] marc0902:
I have a lot of Errors in the Main Log file. Count++ Not found and no backups are made automatically.
[Magisk] VR25:
I'm not jumping into Telegram anytime soon, due to my internet access limitations. Still waiting for ISPs to move their butts around the issue.

Does the wizard work normally?

Do you get the same error after running c=0; ((c++))?

EDIT: which device and ROM are you using?
[Magisk] marc0902:
Im getting 1 :) with no Errors

MIUI 10 Android P on Mi Mix 2S

The wizard works Like a charm
[Magisk] christian.arvin:
[MENTION=5228676]VR25[/MENTION]

Latest ADK on 17.2 Magisk

Haven't tried the restore option but ADK folder is showing in my external sdcard with app and appdata inside.

Suggestion for improvement:

Add a .nomedia file inside adk or backup folders.

Reason:

Some appdata has pictures or other medias that are detected by android and is showing in gallery or music.
[Magisk] VR25:
Try this potential fix as root:

1. Run sed -i 's/((Count++/$((Count + 1/' /sbin/.core/img/adk/core.sh

2. Reboot

Tip: you can simply paste that code on terminal instead of typing it.

[MENTION=6642823]christian.arvin[/MENTION], I'll do that. Thank you. :)
[Magisk] marc0902:
I now knew what the problem is. I have no mount Point with media_rw . The directory is there but empty....

The other mount Point is sdcard (internal storage)
[Magisk] hackiee:
hello dev,

it is working fine even on magisk version 17.2, but on backup of data there was an error regarding some folder does not exist.

I think it's due to new magisk 17.2's implementation method, coz it renames its service with a new name AFAIK. ?

So, clearing magisk manager's data solved my problem. If you want, I can provide logs for the same, if it's helpful. ?

The main thing, I don't want to backup my app's data, but apps only.

So, can you please tell me, if possible, how to achieve that ? ?

Thanks, really great module ??
[Magisk] ainurrofiq:
In config.txt write inc partial apps name|partial apps name

Example

inc whatsapp|plus
[Magisk] christian.arvin:
[MENTION=5228676]VR25[/MENTION]

Hi! Thank you for your module, its stable now on my device. :good::)

I would to like to suggest another feature in regard with the backup schedule.

Feature:

Fixed time of the day execution of backup instead of "time from first execution loop."

Reason:

Prevent of possible interference from backup when user is using an app and prevent data corruption.

Run backup on night time when phone has no activity.
[Magisk] hackiee:
ohk, but isn't it going to backup that inc'd app's data also ?

& if it isn't then also it's not a suitable solution for bulk backup of apps, coz I have a lot of apps ?
[Magisk] bigbadmoshe:
So this pretty much is replacing TiB. Thanks for keeping up the development.

Only issues I have found is sms and Bluetooth not being saved other then that I have switched between Roms with no issues.

Looking forward to more creative development.

Keep on rocking.
[Magisk] ainurrofiq:
It will backup the data bro, I've tried it for WhatsApp and plus
[Magisk] Zeuskk:
I have a problem with restore apps+data. In wizard i choose option 3 to restore Apps+data, then option 1 (default backup location) and then i got msg "Backup folder not found or empty". I checked location and in /data/media/adk/backups/ I have 2 folders: apk and appdata and they are not empty.
[Magisk] hackiee:
yup bro, and that's what I don't want, coz for backup of data, I hv tb ☺️

But, I want to get rid of the hassle of instaling apps, every time I test a new rom ?

[MENTION=5228676]VR25[/MENTION] please help, if you can help in this regard ?
[Magisk] VR25:
Actually, that's not an issue at all. Here's how things work in regards to this: adk waits for external storage to pop in /mnt/media_rw/. The timeout is set to 90 seconds after late start service mode kicks in. That's a bit more than enough for Android to mount everything. If external storage is detected, adk uses the largest partition found. Else, it falls back to /data/media/adk/backups.

Build 2018.9.22 has been out for a while and it should fix your issue. Have you upgraded yet?

I'll add more filtering options. Config keywords such as, "noapk" and "nodata" sound good...

Thanks. :)

That's another great suggestion! You guys really have some excellent brain fuel! Wanna gimme some? Where can I purchase that from? :confused:

I'll work on more advanced scheduling algorithms. Thank you!

Been working on these 2 for a while...

Thanks. :)

So, you don't use an sdcard...

What happens when you pick option 3 (<custom>) and type in the path /data/media/adk/backups?

Could you grab the wizard.log generated just after the error? Thanks.

---

Yesterday's Build Changelog

**2018.9.22 (201809220)**

- Exclude $modData and <external storage>/$MODID from media scan.

- Use legacy variable increment syntax to prevent malfunction in legacy shells.

- White-list irrelevant 'chmod' and 'chown' errors causing some manual restores to fail.
[Magisk] hackiee:
Thanks Dev :D:D

Will look forward to this :angel:

Keep up the great work :highfive:
[Magisk] henningsieh:
Shure, you got that right? ;) That's not what he wanted:
[Magisk] ainurrofiq:
Okay, i lose my focus haha
[Magisk] hackiee:
Np bro, the thing I wanted was not possible at that time.

You just tried to be helpful :o

And as the dev said, he will add more filtering options.

So, sure we will have that features soon (seeing the current module's development scale :laugh: )
[Magisk] candiesdoodle:
Very promising stuff. Some quick guidance if you could:

(1) the migration of apps+data and backup of apps+data are two different concepts right? i can use both exclusively?

And if i use both for say 3 apps, i will see two copies of the app+data ... one in /data/media/adk/migrated_data and other in /data/media/adk/backups?

(2) data restore is done from migrated_apps or from backups? how do i choose?

(2) How does this play with google's restore mechanism?

Say i install a new rom, i have configured "noauto" .... and i have restored the 3 apps from above example using the initial setup. When i fire up adk from terminal and choose the option for data restore... what does it do? overwrite the apks which i have restored in google setup?
[Magisk] VR25:
Yes, data migration and backups are two separate things, and you can use both exclusively.

Migration happens only when you flash the same adk version again from TWRP and <noauto> is NOT enabled.

Data from migrated_data folder can only be restored by the automatic mechanism, which kicks in shortly after boot on a fresh system when <noauto> is disabled. You can restore backups from a custom location, but /data/media/adk/migrated_data is not a possible candidate. Data formats differ.

Only automatic restore is done from migrated_data and that data cannot be restored using the wizard.

On-demand restore has two predefined locations, namely, <largest external storage partition>/adk/backups and /data/media/adk/backups. The first takes precedence.

The wizard prompts you to choose where to restore backups from, and it offers a <custom> option.

Wizard's option 2 let's you restore only apps' data. Other restore options are, 1) APKs only and 3) apps+data (with option to filter out already installed apps). The first always replaces installed apps, while the second obviously does that only if you don't filter out apps which are already installed.
[Magisk] candiesdoodle:
​

Thank you, this is very valuable info.

So here is my use case: I just want one app to be included, no auto restore, and I will initiate restore manually.

I wrote the this simple config file before first reboot:

inc com.termux
noauto

I reboot. But I don't see migrated apps in /data/media/adk

The directory just has:

:/data/data/com.termux/files/home # ls /data/media/adk -l
total 12
-rw-r--r-- 1 media_rw media_rw 3095 2018-09-25 23:19 config.txt
drwxr-xr-x 2 media_rw media_rw 4096 2018-09-25 23:07 info
drwxrwxrwx 2 media_rw media_rw 4096 2018-09-25 23:28 logs
:/data/data/com.termux/files/home #

Secondly. No adk directory in sdcard. The test backup function also gave error saying no adk directory.

However, I manually created the adk directory and the triggered the backup function which created the backup for the APK and the data files.

Are both of these because of magisk 17.2?
[Magisk] foxmcc8:
Ok, i would like to ask about another scenario.

I use an encrypted device so no "wipe" for me.

So i flash the same adk version in TWRP(for the migration staff to do it's work),factory wipe and flash the new ROM and Gapps.

Now i am booting the system and comes the initial Google setup.

I choose restore from previous Google device cloud backup so i can have back my settings(WiFi keys ext.).

And here comes the question.Will this conflict with the auto restoration from the migrated apps+data and should or shouldn't choose to restore any apps from the Google backup?
[Magisk] VR25:
Magisk 17.2 may have some new weird stuff going on. I'll test it today and see...

Meanwhile, it'd be great if you could delete/rename the adk folder were backups reside and grab both main.log and wizard.log after testing again the auto & manual backups, respectively. Thanks. :)

There'll be no conflicts at all. The restore mechanisms will never interfere with one another.
[Magisk] goldencore:
Do you know if your module works under Android Pie?
[Magisk] rinaldi14:
[MENTION=5228676]VR25[/MENTION]

Dev which line I must edit...
[Magisk] rinaldi14:
Or deleted all words inside of config.txt and rewrite only "wipe words" inside of config.txt?
[Magisk] godofsalt:
Well, that appears to be the Config.Text Instructions. My 2 cents.

Again, my 2 cents... What I actually did, was Renamed that actual file. Then used that side by side, with a text file, to make the the Actual "Config.txt" file.... Then save the Newly created Config.txt to the ADK folder. (I took the newly renamed file, and Relocated to a different Folder, so that ADK Folder was clean)

Done. Reboot, and see if it works....

Hope that my help you, again just my Opinion and how I got it too work for me....
[Magisk] rinaldi14:
[MENTION=5228676]VR25[/MENTION]

Please corrected If I'm wrong...you mean like this?
[Magisk] rinaldi14:
Anw thanks mate..Dev of this module already explain it to me but i dont understand with " add wipe to config.txt"

I already attach a file please corrected if i'm wrong mate..
[Magisk] VR25:
Since "wipe" is already there, simply remove the # symbol standing before it. ;)

P.S., those instructions on the config file are not a problem. ADK only uses what it considers valid, skipping the rest as if it wasn't even there. In other words, any word which does not represent a feature is ignored. So is any keyword with leading characters (i.e., #wipe " wipe", etc.).
[Magisk] rinaldi14:
[MENTION=5228676]VR25[/MENTION] Thanks Dev...like this Dev? Please corrected..
[Magisk] Atrate:
[MENTION=5228676]VR25[/MENTION] Hey, that's a nice module! Have you thought of making a way to encrypt the backups themselves? It sort of defeats the point of encrypted data if the backed up app data isn't encrypted.
[Magisk] godofsalt:
VR25-- where is the break the actual break as far as "Stable" vs "Not Stable", with regards to Magisk versions ?

Just asking , not harassing. Seen so many say 16.x is "OK", 17.1/17.2 "NOT OK"....

My set up- Galaxy S5 (Virgin Mobile, yeah under Sprint) On Lineage 15.1 (8.1 Oreo) . With Magisk 17.2, it really did not preform well (ADK)... now 17.1 Magisk, I see that I have it working ....@ 80% ( I have more Non-system apps, (Apps that I have installed), that are NOT backed up...) . This is the reason for asking....

I am certain, or believe, for you, that Magisk is a real pain in the butt. I do see ADK as a real "Back Up" solution, aside from old Titanium Back up- yes have that too.

Thanks for all that you have done so far. I truly believe this is (ADK) is going to be truly Awesome. (Love that fact, that 1 could update their phone, (with the right Tweaks) and BAM..... you have your updated phone. Updated, and working how it was, prior to that flashing. Even more s, the actual Time Savings... of an Updating the Phone... Awesome
[Magisk] VR25:
Yes, and I've still been thinking on that. The issue with encryption is "inefficiency". Backing up, then encrypting every single copy of data is a massive hit on CPU and disk I/O.

The best way to have both is backing up to an encrypted location. If your /data is encrypted and your backups go to /data/media/adk/backups, then these are encrypted as well.

For sdcard users and alike, using a LUKS-encrypted partition sounds good to me.

I'm looking for and evaluating options. Thanks.

The last Magisk version I tested fully is 17.1. ADK worked just fine. Now I'm on 17.2 (which is a beta BTW) and there appears to be new issues to deal with.

Frequent adk updates will resume once I'm done bashing a few priority projects out of the way. Thanks. :)
[Magisk] godofsalt:
.....

I can say that I do have mine working again, with Magisk 17.1 !!!!

My issues were with the 17.2 Beta, which I too, were on. Basically, I rolled back to the "Stable" Magisk and all is well so far.

Please keep this up an going ! I see a "Mod" that really might change how things are handled. with regards to Back ups as well as, updating, a current ROM.

Just awesome! thanks you
[Magisk] Charles IV:
Wow, this looks great, especially as I'm trying to degoogle myself. One question (for now) is about the noauto option. Of I enable this, how easy is it to manually restore an app?
[Magisk] VR25:
It's very easy. You don't even have to study any documentation to restore apps. Simply run <adk> as root and follow the wizard.
[Magisk] godofsalt:
that is WHY your "ADK" is so awesome. Love it! and looking very happy into the future for what this may become!

OH- just wanted to let you know that, for me, I'm on LineageOS 15.1 with very few Google apps, Magisk (of course) and a SmartPack kernel. for my SGS5. Magisk-0 currently on 7.1 (Had to leave 7.2 (too many issues, can wait ) ALL seems to be working!

Awesome. Please keep this going....
[Magisk] VR25:
ANNOUNCEMENT

I'm creating Telegram groups for my modules and other software projects. I need at most one person's profile (for each group) to get started.

Interested? Send me your tg profile via PM, then post here which groups you want to be part of.

If a post regarding a group you're interested in already exists, don't PM me! Read on.

I'll post and announce each group's link on respective threads so others can join.

Notes:

I won't be replying to these PMs.

If you're not added to the group(s) after some time, that usually means someone else has already sent me their profile. Look for group link announcement(s) on respective thread(s).

Thank you! :)
[Magisk] godofsalt:
Reply to your Announcement ....

I run my Galaxy S5 on the Sprint Network (Formally Virgin Mobile USA) SM-G900P which is also KLTEDV over at LineageOS.

Hopefully that helps

Tanks
[Magisk] xela92:
Hi there VR25,

thanks for your efforts, your script is a very cool idea.

I was thinking of using it to backup data and apps on my Ubuntu workstation, but I have some issues with that.

First, I edit the config file in /data/media/adk/config.txt

inc
bkp -e "ssh -i /sdcard/ssh/key" $apkBkps $appDataBkps user@myhost:/home/user/folder

note that I fixed the names (in your OP, variables were $appBkps and $appdataBkps, that would lead to an error!)

so I run adk and do a test backup (the only option I see to run a backup)

the backup fails on SSH command:

(i) Backing up misc data...rsync: Failed to exec ssh: No such file or directory (2)
rsync error: error in IPC code (code 14) at pipe.c(85) [sender=3.1.4dev]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in IPC code (code 14) at io.c(226) [sender=3.1.4dev]

after a while then, my config.txt is being replaced with the original one.

I saw that ssh binaries does not come with your package. Is ssh function ready to be used? Am I doing something wrong?

I'm using latest version with Magisk 17.1

Thank you
[Magisk] VR25:
I'm on LOS 14.1 and it came with ssh pre-installed.

Forgot to change a few things in regards to this and add ssh binaries for the masses! The next version will have this stuff working. Thanks. :)
[Magisk] guest4711:
SSH is emulated by busybox if not installed on your ROM. So install busybox (there is a MagiskModule to use it systemless) and try again...
[Magisk] xela92:
Thanks to you :) I can confirm I can see all data and apks under /sdcard/adk folder, I see also some appdata folder under /data/media/adk (can't say why)

Thank you again, I really like your work!
[Magisk] xela92:
Hi,

Unfortunately, I installed busybox module from magisk but it seems not to include ssh as well. I'm attaching a screenshot of the commands that result available from busybox.

I also saw that there's an ssh module in magisk, but it includes ssh server without client!
[Magisk] Hammerhand.17:
Ok, I think more or less I have the idea, but want to be sure about everything. I want to make a clean flash of my root. I think the process is:

1. Make a full backup of my device (it doesn't have external SD).

2. Install the module in magisk.

3. Run terminal - su - ask

4. As you can see in the screenshot, I see "rsync -hrtuv --inplace --progress --stats $@". I think this is the way to make a backup, but it doesn't work.

In config.txt, I have the default configuration:

inc
inc term|provider
bkpFreq=24
wipe

How would be the configuration to make a backup of user & system apps in the internal memory each 24 hours? Do I have to left terminal app open?

5. When I have my backup done, to make a clean flash, do I have to flash the module in TWRP, and choose "migrate" (don't know if that option comes up)?

6. If I have "wipe" option in config.txt, I don't do a factory reset. Is this because when I flash module, factory reset is automatically done?

One more question: once backup is done, are TWRP backups fully functional? (You know, because apps are, if I get it well, moved from default location, and not copied)

Sorry for the long post, but I wanted to be sure to get the full wiring mode of the module.

Thanks in advance.