Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible fix for 'Could not determine app's private files directory' #767

Closed
wants to merge 2 commits into from

Conversation

balihb
Copy link

@balihb balihb commented Mar 23, 2021

#759
the possible fix I proposed for the issue. this solution won't remove the first element from the list, but instead choose the 2nd one if there is more than one.

@balihb
Copy link
Author

balihb commented Mar 23, 2021

@Catfriend1 is it possible to maybe push this change to the Play Store beta, so I can test if it works? Or how should we step forward?

@Catfriend1
Copy link
Owner

Catfriend1 commented Mar 23, 2021

Hi,

I'm a little bit busy and behind atm, ir it's just testing you can use the compile scripts from this repo to make your own debut build easily without signing stuff or I could do an APK build for you.

I hope to have some free time available for the fork next week.

Meanwhilst, thanks for you help on this, much appreciated :-)!

@Catfriend1
Copy link
Owner

Memo for me: Look up why we changed the path detection in the past (remember crashes? issues with phone manufacturer stock os'es?) There was a ticket, not that we reintroduce the probleme again for others.

@Catfriend1 Catfriend1 self-requested a review March 23, 2021 21:41
@Catfriend1 Catfriend1 added the bug label Mar 23, 2021
@Catfriend1
Copy link
Owner

Ah yes , I should do something here when time allows, still noted!

@Catfriend1 Catfriend1 added this to the v1.15.0 milestone Mar 28, 2021
@Catfriend1 Catfriend1 linked an issue Mar 28, 2021 that may be closed by this pull request
@Catfriend1 Catfriend1 added the testing Community test case - Notice: Consists of maybe unstable syncthing version or code label Mar 28, 2021
@Catfriend1
Copy link
Owner

Merged into "beta" branch.

@Catfriend1
Copy link
Owner

AVD 11:
image

@Catfriend1
Copy link
Owner

Catfriend1 commented Mar 28, 2021

Problem: After this PR it does not save the emergency export to internal storage.

Request: As it was the result before this PR, Syncthing-Fork should export its private keys and config to the phone's internal storage. This may be some path like /storage/ABCD-EFGH/Android/media/[pkg_id] or /storage/emulated/0/Android/media/[pkg_id] . Syncthing-Fork should detect the internal storage's absolute path correctly and export to it.

Next steps to take @balihb : Please show me which File URIs or absolute paths your phone/Android OS returns for

getExternalMediaDirs()

so we can work out a solution not breaking the existing behaviour on other phones implementations, Android versions and the Android emulator.

INTERNAL STORAGE:
image

EXTERNAL SD CARD STORAGE:
image

@Catfriend1 Catfriend1 removed the testing Community test case - Notice: Consists of maybe unstable syncthing version or code label Mar 28, 2021
@Catfriend1 Catfriend1 removed this from the v1.15.0 milestone Mar 28, 2021
Copy link
Owner

@Catfriend1 Catfriend1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

Catfriend1 added a commit that referenced this pull request Mar 28, 2021
@Catfriend1
Copy link
Owner

@balihb Something maybe is wrong what I've stated above. Let's do a test build ( https://drive.google.com/file/d/1FVLHSkIamwFNrhQGOLBj2qNz8Jnqh2KV/view?usp=sharing ) . Could you please check if this build fixes the problem on your phone you've originally had?

@balihb
Copy link
Author

balihb commented Mar 28, 2021

@balihb Something maybe is wrong what I've stated above. Let's do a test build ( https://drive.google.com/file/d/1FVLHSkIamwFNrhQGOLBj2qNz8Jnqh2KV/view?usp=sharing ) . Could you please check if this build fixes the problem on your phone you've originally had?

with this I could grant all file access, but I didn't and I pressed the emergency button. gave me the same failure.

@balihb
Copy link
Author

balihb commented Mar 28, 2021

Failed to export config
java.io.FileNotFoundException: /data/user/0/com.github.catfriend1.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.(FileInputStream.java:160)
at com.google.common.io.Files$FileByteSource.openStream(Files.java:130)
at com.google.common.io.Files$FileByteSource.openStream(Files.java:120)
at com.google.common.io.ByteSource.copyTo(ByteSource.java:264)
at com.google.common.io.Files.copy(Files.java:326)
at com.nutomic.syncthingandroid.activities.FirstStartActivity.exportConfig(FirstStartActivity.java:778)
at com.nutomic.syncthingandroid.activities.FirstStartActivity.access$400(FirstStartActivity.java:54)
at com.nutomic.syncthingandroid.activities.FirstStartActivity$ViewPagerAdapter$1.onClick(FirstStartActivity.java:410)
at android.view.View.performClick(View.java:7496)
at android.view.View.performClickInternal(View.java:7473)
at android.view.View.access$3600(View.java:831)
at android.view.View$PerformClick.run(View.java:28641)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7876)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
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:7762)
at libcore.io.IoBridge.open(IoBridge.java:478)
... 19 more

@Catfriend1
Copy link
Owner

@balihb Did you configure Syncthing first before revoking all files permission and trying the emergency export?

@Catfriend1
Copy link
Owner

We should maybe add the extra code which displays an error more clear if Syncthing has nothing to export when it was'nt configured.

Catfriend1 added a commit that referenced this pull request Mar 31, 2021
@Catfriend1
Copy link
Owner

I'm closing this. Later to be re-opened, when we know what needs exactly to be fixed and how.

@Catfriend1 Catfriend1 closed this Apr 3, 2021
@Catfriend1
Copy link
Owner

Bug on some devices: #541

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

emergency config export fails
2 participants