syncthing/syncthing-android

FileUriExposedException on editing ignores

imsodin opened this issue · 2 comments

Google play console showes a bunch of crashes like this since 1.27.1.1

Looks like the magic incantation that was previously used all the time avoids this issue - the comment should have been a hint.

Regression from #2002

I'll get a quick revert in to fix it in the release that's about to happen (well it is already happening, but ...)

🙈
Well, that was a bit unexpected, for some reason I didn't experience this crash on my device.
This also means that a bigger refactor is needed to avoid exposing the file URI as it's a requirement for Android Nougat and newer versions.
See also: https://developer.android.com/reference/android/os/FileUriExposedException

Yeah, however this is not thrown if we explicitly disable it in the VmPolicy as we do now. As that page says, it's "only discouraged" to do so. We could still fix it, but I don't see any strong need to do so.

For your original intent of avoiding the overhead of these checks in releases, we can still remove the detectAll and penaltyLog parts on the builder. However in hindsight it seems better to only do that on real releases, and keep it on RCs. So BuildConfig.DEBUG isn't the right thing to check that on, we need some way to discern RC from non-RC releases.