Syncthing-android: File Browser does not show folders in /data/

Created on 29 Aug 2015  路  40Comments  路  Source: syncthing/syncthing-android

Steps to reproduce:

  1. Start app
  2. Accept root request
  3. Check use root
  4. Check advanced file picker
  5. Restart app
  6. Try to add folder _/data/user/whatever/_ and restart

The _/data_ folder shows no subfolders in the GUI.
I can add _/data/user/whatever_ via the WebUI ( it even autocompletes the paths!? ) but it does not show the mapping after save.

Anyway, after the obligatory restart, the app will hang/freeze/just show a white background for a while after that is just crashes.
On another device, endless toasters are displayed, announcing that the app was given root.

A complete clean up ( cache/data ) will reset it.

Sony Xperia Sola with CM 12.1 ( 2015-08-22 ) 0.6.6 via F-Droid
Nexus 7 (2012) with CM 12.1 ( 2015-08-25 ) 0.6.6 via PlayStore

logcat: app does not start, can't save one
_config.xml_ from Nexus: https://gist.github.com/licaon-kter/fad76b067c248ddb8bde

/LE: Other apps, say a file manager, when given root access can read/write anything in the _/data/_ folder.

/LE2: On the Nexus I can read the toasters:

"app given root interactive shell"
"app given root interactive shell
/data/data/com.nutomic.syncdroidandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncdroidandroid/files/"
invalid root frozen-due-to-age

Most helpful comment

@rom1504 , Scheduled oandrbackup to sdcard + usual Syncthing mode = backups for the rest of apps (more manual, but safer and more reliable).

Other things are most likely already synced in cloud storages

For users which have Google apps installed and generally "live in the cloud". For privacy-demanding or strict-FOSS users Syncthing may be used on typically-already-backed-up things too.

All 40 comments

Sorry, forgot to comment:

The problem is that root is only given to the syncthing binary, but the folder listing in the app is done from Java. We could solve that by listing the folders from a shell (pull requests welcome).

Root works fine on my Nexus 5, can you record a logcat on a PC, and post that in a seperate issue?

While C/++ maybe I could read, Java is kinda foreign to me.

_"the folder listing in the app is done from Java"_: so it lists the folders in / (root) ok but not subfolders, and that is "as expected" ? I would think that listing /data/subfolder is the same as / (root).

Regarding the freeze, I'm still investigating, I can repro it at will, but I want to get the steps clear, and the whole waiting process ( "restart to" and "key generated" ) makes it slow and cumberstone.

What I can share now, is that after some failed starts _config.xml_ get's renamed to _config.xml_invalid_ BUT after that the next start still does not go ok, hence _config.xml_ get's renamed AGAIN to _config.xml_invalid_ and inside everything was reseted to default, keys are AAAAA-AAAAAA-..., folders are not listed anymore.

Listing /data/ requires root permission, and we can only get that via shell, not via Java APIs. So it needs a different implementation (which we don't have).

For the freeze, it should be fine if you just record a log with adb logcat or a logcat app, and post it here.

Same problem with accessing folders under /data.
Can configure the folder in WebGUI, but after that the app hangs on white screen, so the sync does not work.
I got an x86 phone (Lenovo K900), so if i could be of any help in resolving the issue, i'm ready!

The app should start fine if you entered the path correctly. Can you post a logcat of the app start?

I'll do it today later or tomorrow!
Thanks!

Here is the logcat from the moment i started the freshly reinstalled app for the 1st time.
It includes the key generetion,
the selection of root access,
entry into the webgui and
adding the folder in /data/data/..., and
restarting from webgui.
After that the app stuckes on white screen, the SuperSU toasters keep on showing saying that the
"app given root interactive shell" AND
"app given root interactive shell
/data/data/com.nutomic.syncdroidandroid/lib/libsyncthing.so -generate /data/data/com.nutomic.syncdroidandroid/files/",
and then the system dialog pops up saying that the app does not respond.

09-12 16:56:16.514 I/InputDispatcher(424): Application is not responding: AppWindowToken{21fb62c8 token=Token{2162ffa8 ActivityRecord{21830208 u0 com.nutomic.syncthingandroid/.activities.WebGuiActivity}}} - Window{218e2538 u0 com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.WebGuiActivity}.  It has been 8009.8ms since event, 8006.9ms since wait started.  Reason: Waiting because the focused window has not finished processing the input events that were previously delivered to it.
09-12 16:56:16.514 I/WindowManager(424): Input event dispatching timed out sending to com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.WebGuiActivity
09-12 16:56:18.134 E/ActivityManager(424): ANR in com.nutomic.syncthingandroid (com.nutomic.syncthingandroid/.activities.WebGuiActivity)
09-12 16:56:18.134 E/ActivityManager(424):   15% 26929/libsyncthing.so: 14% user + 0.6% kernel / faults: 8 minor
09-12 16:56:18.134 E/ActivityManager(424):   2% 26345/com.nutomic.syncthingandroid: 1.9% user + 0.1% kernel / faults: 51 minor
09-12 16:56:29.204 I/InputDispatcher(424): Application is not responding: AppWindowToken{21fb62c8 token=Token{2162ffa8 ActivityRecord{21830208 u0 com.nutomic.syncthingandroid/.activities.WebGuiActivity}}} - Window{218e2538 u0 com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.WebGuiActivity}.  It has been 8006.0ms since event, 8002.9ms since wait started.  Reason: Waiting because the focused window has not finished processing the input events that were previously delivered to it.
09-12 16:56:29.204 I/WindowManager(424): Input event dispatching timed out sending to com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.WebGuiActivity
09-12 16:56:30.894 E/ActivityManager(424): ANR in com.nutomic.syncthingandroid (com.nutomic.syncthingandroid/.activities.WebGuiActivity)
09-12 16:56:30.894 E/ActivityManager(424):   13% 26929/libsyncthing.so: 13% user + 0.5% kernel / faults: 2 minor
09-12 16:56:30.894 E/ActivityManager(424):   2.7% 26345/com.nutomic.syncthingandroid: 2.2% user + 0.5% kernel / faults: 122 minor
09-12 16:56:30.894 E/ActivityManager(424):   5% 26345/com.nutomic.syncthingandroid: 3.7% user + 1.2% kernel / faults: 8 minor
09-12 16:56:30.894 E/ActivityManager(424):   1.8% 26929/libsyncthing.so: 1.8% user + 0% kernel
09-12 16:56:35.144 W/ActivityManager(424):   Force finishing activity com.nutomic.syncthingandroid/.activities.WebGuiActivity
09-12 16:56:35.194 I/ActivityManager(424): Killing ProcessRecord{21699370 26345:com.nutomic.syncthingandroid/u0a10142}: user's request
09-12 16:56:35.294 I/ActivityManager(424): Process com.nutomic.syncthingandroid (pid 26345) has died.
09-12 16:56:35.294 W/ActivityManager(424): send smart intent packageName=com.nutomic.syncthingandroid
09-12 16:56:35.294 W/InputDispatcher(424): channel '218d5868 com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
09-12 16:56:35.294 E/InputDispatcher(424): channel '218d5868 com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
09-12 16:56:35.294 W/InputDispatcher(424): Attempted to unregister already unregistered input channel '218d5868 com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.MainActivity (server)'
09-12 16:56:35.294 W/ActivityManager(424): Scheduling restart of crashed service com.nutomic.syncthingandroid/.syncthing.SyncthingService in 221712ms
09-12 16:56:35.294 I/WindowState(424): WIN DEATH: Window{218d5868 u0 com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.MainActivity}
09-12 16:56:35.294 I/WindowState(424): WIN DEATH: Window{218e2538 u0 com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.WebGuiActivity}
09-12 16:56:35.314 D/topa    (424): ViewRootImpl processName com.nutomic.syncthingandroid
09-12 16:56:35.334 I/ActivityManager(424): Start proc com.nutomic.syncthingandroid for activity com.nutomic.syncthingandroid/.activities.MainActivity: pid=27098 uid=10142 gids={50142, 1015, 3003, 1028}
09-12 16:56:35.434 W/XPrivacy(27098): Hooking package=com.nutomic.syncthingandroid
09-12 16:56:35.754 D/topa    (27098): ViewRootImpl processName com.nutomic.syncthingandroid
09-12 16:56:36.254 D/topa    (27098): ViewRootImpl processName com.nutomic.syncthingandroid
09-12 16:56:36.554 I/ActivityManager(424): Displayed com.nutomic.syncthingandroid/.activities.MainActivity: +1s248ms
09-12 16:56:37.074 D/topa    (424): change FPS 60 in com.nutomic.syncthingandroid
09-12 16:56:37.834 I/SyncthingRunnableIoNice(27098): ionice performed on libsyncthing.so
09-12 16:56:42.604 I/SyncthingNativeCode(27098): 14:56:42 WARNING: Key exists; will not overwrite.
09-12 16:56:42.604 I/SyncthingNativeCode(27098): 14:56:42 INFO: Device ID: XXXXXXX-XXXXXXX
09-12 16:56:44.634 I/SyncthingRunnableIoNice(27098): ionice performed on libsyncthing.so
09-12 16:56:49.324 I/SyncthingNativeCode(27098): 14:56:49 WARNING: Key exists; will not overwrite.
09-12 16:56:49.324 I/SyncthingNativeCode(27098): 14:56:49 INFO: Device ID: XXXXXXX-XXXXXXX
09-12 16:56:51.004 I/SyncthingRunnableIoNice(27098): ionice performed on libsyncthing.so
09-12 16:56:55.414 I/SyncthingNativeCode(27098): 14:56:55 WARNING: Key exists; will not overwrite.
09-12 16:56:55.414 I/SyncthingNativeCode(27098): 14:56:55 INFO: Device ID: XXXXXXX-XXXXXXX
09-12 16:56:57.164 I/SyncthingRunnableIoNice(27098): ionice performed on libsyncthing.so
09-12 16:57:02.004 I/SyncthingNativeCode(27098): 14:57:02 WARNING: Key exists; will not overwrite.
09-12 16:57:02.004 I/SyncthingNativeCode(27098): 14:57:02 INFO: Device ID: XXXXXXX-XXXXXXX
09-12 16:57:03.824 I/SyncthingRunnableIoNice(27098): ionice performed on libsyncthing.so
09-12 16:57:08.644 I/SyncthingNativeCode(27098): 14:57:08 WARNING: Key exists; will not overwrite.
09-12 16:57:08.644 I/SyncthingNativeCode(27098): 14:57:08 INFO: Device ID: XXXXXXX-XXXXXXX
09-12 16:57:10.364 I/SyncthingRunnableIoNice(27098): ionice performed on libsyncthing.so
09-12 16:57:14.704 I/SyncthingNativeCode(27098): 14:57:14 WARNING: Key exists; will not overwrite.
09-12 16:57:14.704 I/SyncthingNativeCode(27098): 14:57:14 INFO: Device ID: XXXXXXX-XXXXXXX
09-12 16:57:16.354 I/SyncthingRunnableIoNice(27098): ionice performed on libsyncthing.so
09-12 16:57:20.824 I/SyncthingNativeCode(27098): 14:57:20 WARNING: Key exists; will not overwrite.
09-12 16:57:20.824 I/SyncthingNativeCode(27098): 14:57:20 INFO: Device ID: XXXXXXX-XXXXXXX
09-12 16:57:22.554 I/SyncthingRunnableIoNice(27098): ionice performed on libsyncthing.so
09-12 16:57:27.384 I/SyncthingNativeCode(27098): 14:57:27 WARNING: Key exists; will not overwrite.
09-12 16:57:27.384 I/SyncthingNativeCode(27098): 14:57:27 INFO: Device ID: XXXXXXX-XXXXXXX
09-12 16:57:29.074 I/SyncthingRunnableIoNice(27098): ionice performed on libsyncthing.so
09-12 16:57:33.894 I/SyncthingNativeCode(27098): 14:57:33 WARNING: Key exists; will not overwrite.
09-12 16:57:33.894 I/SyncthingNativeCode(27098): 14:57:33 INFO: Device ID: XXXXXXX-XXXXXXX
09-12 16:57:35.594 I/SyncthingRunnableIoNice(27098): ionice performed on libsyncthing.so
09-12 16:57:40.124 I/SyncthingNativeCode(27098): 14:57:40 WARNING: Key exists; will not overwrite.
09-12 16:57:40.124 I/SyncthingNativeCode(27098): 14:57:40 INFO: Device ID: XXXXXXX-XXXXXXX
09-12 16:57:40.144 D/topa    (27098): ViewRootImpl processName com.nutomic.syncthingandroid
09-12 16:58:11.114 I/ActivityManager(424): START u0 {act=android.intent.action.MAIN flg=0x10104000 cmp=com.nutomic.syncthingandroid/.activities.MainActivity} from pid 533
09-12 16:58:11.194 D/topa    (424): ViewRootImpl processName com.nutomic.syncthingandroid
09-12 16:58:11.364 D/topa    (27098): ViewRootImpl processName com.nutomic.syncthingandroid
09-12 16:58:11.384 I/SyncthingService(27098): Starting syncthing according to current state and preferences
09-12 16:58:13.314 I/SyncthingRunnableIoNice(27098): ionice performed on libsyncthing.so
09-12 16:58:17.454 I/SyncthingNativeCode(27098): 14:58:17 WARNING: Key exists; will not overwrite.
09-12 16:58:17.454 I/SyncthingNativeCode(27098): 14:58:17 INFO: Device ID: XXXXXXX-XXXXXXX
09-12 16:58:19.274 I/SyncthingRunnableIoNice(27098): ionice performed on libsyncthing.so
09-12 16:58:21.214 D/topa    (424): change FPS 60 in com.nutomic.syncthingandroid
09-12 16:58:21.214 W/ActivityManager(424): Activity idle timeout for ActivityRecord{2141e8c8 u0 com.nutomic.syncthingandroid/.activities.MainActivity}
09-12 16:58:23.524 I/SyncthingNativeCode(27098): 14:58:23 WARNING: Key exists; will not overwrite.
09-12 16:58:23.524 I/SyncthingNativeCode(27098): 14:58:23 INFO: Device ID: XXXXXXX-XXXXXXX
09-12 16:58:25.184 I/SyncthingRunnableIoNice(27098): ionice performed on libsyncthing.so
09-12 16:58:29.604 I/SyncthingNativeCode(27098): 14:58:29 WARNING: Key exists; will not overwrite.
09-12 16:58:29.604 I/SyncthingNativeCode(27098): 14:58:29 INFO: Device ID: XXXXXXX-XXXXXXX
09-12 16:58:31.234 W/ActivityManager(424): Timeout executing service: ServiceRecord{21e936a0 u0 com.nutomic.syncthingandroid/.syncthing.SyncthingService}
09-12 16:58:31.254 I/SyncthingRunnableIoNice(27098): ionice performed on libsyncthing.so
09-12 16:58:32.684 E/ActivityManager(424): ANR in com.nutomic.syncthingandroid
09-12 16:58:32.684 E/ActivityManager(424): Reason: Executing service com.nutomic.syncthingandroid/.syncthing.SyncthingService
09-12 16:58:32.684 E/ActivityManager(424):   1.3% 27098/com.nutomic.syncthingandroid: 0.3% user + 0.9% kernel / faults: 1351 minor
09-12 16:58:32.684 E/ActivityManager(424):   0.1% 26929/libsyncthing.so: 0% user + 0.1% kernel
09-12 16:58:32.684 E/ActivityManager(424):  +0% 28132/libsyncthing.so: 0% user + 0% kernel
09-12 16:58:32.684 E/ActivityManager(424):   98% 28132/libsyncthing.so: 98% user + 0% kernel / faults: 4 minor
09-12 16:58:32.684 E/ActivityManager(424):     96% 28132/libsyncthing.so: 96% user + 0% kernel
09-12 16:58:34.964 W/ActivityManager(424):   Force finishing activity com.nutomic.syncthingandroid/.activities.MainActivity
09-12 16:58:34.994 I/ActivityManager(424): Killing ProcessRecord{212a0810 27098:com.nutomic.syncthingandroid/u0a10142}: user's request
09-12 16:58:35.014 W/InputDispatcher(424): channel '212d20e8 com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
09-12 16:58:35.014 E/InputDispatcher(424): channel '212d20e8 com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
09-12 16:58:35.014 W/InputDispatcher(424): Attempted to unregister already unregistered input channel '212d20e8 com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.MainActivity (server)'
09-12 16:58:35.014 I/ActivityManager(424): Process com.nutomic.syncthingandroid (pid 27098) has died.
09-12 16:58:35.014 W/ActivityManager(424): send smart intent packageName=com.nutomic.syncthingandroid
09-12 16:58:35.014 I/WindowState(424): WIN DEATH: Window{212d20e8 u0 com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.MainActivity}
09-12 16:58:35.014 W/ActivityManager(424): Service crashed 2 times, stopping: ServiceRecord{21e936a0 u0 com.nutomic.syncthingandroid/.syncthing.SyncthingService}

@licaon-kter Thanks, i checked it. But changing the permissions of the files did not help me either.

I guess it's still the split-brain ( _"root is only given to the syncthing binary, but the folder listing in the app is done from Java"_ ) issue at hand.

you're right. Lets hope @Nutomic will correct it soon. It would be very convenient to have an ability to sync folders in /data/data/

It's not something I personally need, and I'm pretty busy with other things already. So this isn't something I'll likely fix. But if someone wants to contribute this feature, I'll be happy to assist.

Sure, its understandable!
@licaon-kter - if you find a solution, post it here please! I'll do the same!

The workaround for now is to enter the path in the web GUI. Alternatively, you can export the config, edit the path and import again.

Edit: Forgot that it gives you a crash, that's a seperate bug. I'll try and look into that.

Yes, i dont mind to do extra steps, but the crash destroys the efforts.

Thanks a lot for a will to help!!!

is there a reason why syncthing needs root on android at all?

I use an app, that contains its database in /data/data/app_folder. If i could sync that db with my pc, i could work on that database on pc without doing manual copies. That's on particular example.

@gastus1 You could also use adb shell and then sqlite3 app.db instead ;)

Thank you for an advice!
I'm doing probably the same as you offer already: copy the db to a pc and work on it in Firefox SQLLite Manager.
The syncthing could just facilitate the copy process and of course provide automatic sync of two samples.
So if you manage to solve the bug of crashing the app it would be fantastic. But if not, anyway i use and enjoy your app very much and thank you for that!!!

I mean you dont't have to copy the database to your pc, you can access it on the device using adb shell (without copying).

Maybe rename the issue to "Problems using Sync as Root mode".

The title "Enabling root ... in the UI" suggests that the issue is specifically about the UI problem, not about the root mode in general.

"failed to create a syncthing config" still alive and kickin', after that syncthing doesn't even start anymore. Did nothing out of the ordinary by the way, just tried to sync a folder on external sdcard on mobile device, in Android MM. Sure, my device is rooted, but I didn't even pick a restricted folder to sync from. Just DCIM.

Did you enable root mode in Syncthing?

Nope, if it was there I didn't even see a "root mode" option. Like I said, I only tagged the Advanced option to pick my own folders. Since default only selects the internal DCIM, which is silly, since almost all new camera-apps prefer the extsdcard for storage.

Did you perhaps move Syncthing to the SD Card. This doesn't work.

Trying to sync a folder on SD Card shouldn't result in this message. Syncing external SD Card is still not supported though (#29).

Also this issue is about root. As you didn't enable root in Syncthing, this isn't the right issue for your problem.

the app doesn't seem to list /data at all after enabling root. Is this normal ? Is there a workaround ?

Read the posts above, this is an open issue, no fix was implemented yet.

@rom1504 If you are using SuperSU, you'll need to disable mount-space separation (in SuperSU). Could help. But as @licaon-kter said, root support is very experimental and not fully supported.

In my case, the "_failed to create a syncthing config_" error occurred after updating syncthing (have it in root mode to sync folders on SD card).

I tried the chown approach on the config file but this didn't solve it. However what helped me to revive the syncthing app (without setting up everything anew):

  1. back it up with Titanium Backup
  2. uninstall syncthing
  3. restore backup

Syncthing starts and works as usual - with my settings and sync folders preserved. Could this help to solve the issue?

Related to #449 and #434.

@wweich I did not move syncthing anywhere, I just did a standard install. What I find really strange is that I used to run syncthing on my Samsung S3 (9305) for months without issues, and now it's borked. Why? Is it the new permission model of android MM ? If so, how do I disable it entirely? I have never missed it anyway, and I'm no security risk to myself, my phone usage is very strict already. Good grief the waste of time google creates with ideas like this, which are not much more than security theater.

We should close this issue as "invalid" as implementing this would ...
a) risk user data in apps on misusage
b) corrupt app installations - not every app is designed to work consistent with externally changed private app data files.
c) risk android stability on bugs/permission change introduced on the selinux subfolders below /data going as far as bootloop
d) is a niche use case syncing the /data/ partition from Android
e) will get in our way implementing (or in a future android version maybe HAVING to implement) more SAF use in the code "when Google likes us to do so". See #1170
f) we have a lot of constantly changing databases there, databases permanently opened cannot be synced by syncthing.
g) syncthing itself lies in there (dangerous to corrupt or sync itself endlessly)

Root finally works since version 0.10.6 and we can update the wiki about this. Anyway, users trying to backup /data/data can do this correctly without breaking apps private data and functioning using TWRP or TitaniumBackup. This is nothing syncthing wants to provide as its targeted at regular user data and not backing up android related special os parts. /data is FRAGILE.

a) risk user data in apps on misusage

How?

b) corrupt app installations - not every app is designed to work consistent with externally changed private app data files.
c) risk android stability on bugs/permission change introduced on the selinux subfolders below /data going as far as bootloop

The primary use case is likely sendonly.

d) is a niche use case syncing the /data/ partition from Android

Well it's not working yet, so of course it's not popular with synching users. Titanium Backup is very popular though, so not a weird use case at all.

e) will get in our way implementing (or in a future android version maybe HAVING to implement) more SAF use in the code "when Google likes us to do so". See #1170

There will always be a file system, and root processes will have access to it. It's Linux after all. Maybe we'll see containers get in the way at some point.

f) we have a lot of constantly changing databases there, databases permanently opened cannot be synced by syncthing.

The data changes rather often, but there are certainly no databases being synced continuously. That would kill the NANDs.

g) syncthing itself lies in there (dangerous to corrupt or sync itself endlessly)

Again, sendonly is the primary use case here I would imagine.

I think this is the only thing syncthing on Android can be useful for. Other things are most likely already synced in cloud storages (for example Google photos)
/data contain things that cannot be backup by the apps because they don't have a backup feature.

So closing that issue is the same as closing syncthing Android for users that like to backups their phone.

(And indeed it's not a popular feature yet since it doesn't work)

@rom1504 , Scheduled oandrbackup to sdcard + usual Syncthing mode = backups for the rest of apps (more manual, but safer and more reliable).

Other things are most likely already synced in cloud storages

For users which have Google apps installed and generally "live in the cloud". For privacy-demanding or strict-FOSS users Syncthing may be used on typically-already-backed-up things too.

I suggest putting vi's comment with oandrbackup into the wiki and close this.
@AudriusButkevicius Whats your opinion on that? Should I submit a fix for the /data/ browsing problem, should we refer to the Web UI or just point out vi's solution on the wiki?
Suggestion: https://github.com/syncthing/syncthing-android/wiki/Frequently-Asked-Questions#sync-as-root

Why should this be closed? Seems like something is broken if the web ui is able to do things.

The problem would be us violating google guidelines not to mess up with the app individual storage containers of our and foreign or system apps. I can implement this but it may get our apk disapproved by the play store pre checks. Selecting /data and let the sync work on it would only happen in root mode. Risk in an accidentially user configured readwrite scenario to brick android os is high.

How do other backup apps do it?

Syncing /data only for backup is useless as metainfo like shared prefs have to be copied back on restore in a root shell session and telling the package manager to accordingly stop/resume packages. Listing /data can be done read-only on older Android and beginning with selinux since android 5+ often is done by a dir lister running in a root shell. I think this would add much complexity with the risk of data loss or app data corruption if the user does not exactly know the manual steps needed e.g. running pm root shell commands to prepare and end an app restore.

Yeah I don't think we should spend any effort on this. A wiki entry seems enough.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jebeld17 picture jebeld17  路  7Comments

ecxod picture ecxod  路  6Comments

daradib picture daradib  路  8Comments

klausenbusk picture klausenbusk  路  9Comments

Nutomic picture Nutomic  路  5Comments