syncthing-android icon indicating copy to clipboard operation
syncthing-android copied to clipboard

Can't create syncthing config for rooted device

Open sorinirimies opened this issue 2 years ago • 1 comments

Rooted OnePlus7 with the latest Oxygen 11 OS update doesn't seem to be able to create the config under '/data/user/0/com.nutomic.syncthingandroid giving me the following error. I ran the debug app to be able to read the logs, but the behavior is the same on the prod app.

2022-04-24 18:47:45.118 15616-31831/com.nutomic.syncthingandroid.debug W/ConfigXml: Cannot read '/data/user/0/com.nutomic.syncthingandroid.debug/files/config.xml' 
   java.io.FileNotFoundException: /data/user/0/com.nutomic.syncthingandroid.debug/files/config.xml: open failed: ENOENT (No such file or directory)
        at libcore.io.IoBridge.open(IoBridge.java:492)
        at java.io.FileInputStream.<init>(FileInputStream.java:160)
        at java.io.FileInputStream.<init>(FileInputStream.java:115)
        at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
        at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:117)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:183)
        at com.nutomic.syncthingandroid.util.ConfigXml.readConfig(ConfigXml.java:100)
        at com.nutomic.syncthingandroid.util.ConfigXml.<init>(ConfigXml.java:72)
        at com.nutomic.syncthingandroid.service.SyncthingService$StartupTask.doInBackground(SyncthingService.java:375)
        at com.nutomic.syncthingandroid.service.SyncthingService$StartupTask.doInBackground(SyncthingService.java:360)
        at android.os.AsyncTask$3.call(AsyncTask.java:394)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
     Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
        at libcore.io.Linux.open(Native Method)
        at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
        at libcore.io.BlockGuardOs.open(BlockGuardOs.java:254)
        at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
        at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7871)
        at libcore.io.IoBridge.open(IoBridge.java:478)
        at java.io.FileInputStream.<init>(FileInputStream.java:160) 
        at java.io.FileInputStream.<init>(FileInputStream.java:115) 
        at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90) 
        at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:117) 
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:183) 
        at com.nutomic.syncthingandroid.util.ConfigXml.readConfig(ConfigXml.java:100) 
        at com.nutomic.syncthingandroid.util.ConfigXml.<init>(ConfigXml.java:72) 
        at com.nutomic.syncthingandroid.service.SyncthingService$StartupTask.doInBackground(SyncthingService.java:375) 
        at com.nutomic.syncthingandroid.service.SyncthingService$StartupTask.doInBackground(SyncthingService.java:360) 
        at android.os.AsyncTask$3.call(AsyncTask.java:394) 

It seems that even though the scoped permission support is there, for rooted devices it doesn't seem to work.

Version Information

App Version: 1.19.2
Syncthing Version: v1.19.2
Android Version: Oxygen 11 Rooted

sorinirimies avatar Apr 24 '22 16:04 sorinirimies

It sounds like the thing you're looking for is syncthing-fork which adds the root functionality.

hashnag avatar Jul 06 '22 13:07 hashnag