kontalk / androidclient

Kontalk official Android client
https://www.kontalk.org
GNU General Public License v3.0
571 stars 194 forks source link

Root of external storage not configured in FileProvider #1273

Closed daniele-athome closed 4 years ago

daniele-athome commented 5 years ago

Add a new entry for the root of the external storage:

    <external-path name="external_path" path="." />

FileProvider will canonicalize the path, resulting in anything inside external storage readable.

java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/emulated/0/Pictures/Kontalk/Sent/IMG_20190906_163658239.jpg
       at android.support.v4.content.FileProvider$SimplePathStrategy.getUriForFile + 739(FileProvider.java:739)
       at android.support.v4.content.FileProvider.getUriForFile + 418(FileProvider.java:418)
       at org.kontalk.util.MediaStorage.getWorldAccessibleUri + 158(MediaStorage.java:158)
       at org.kontalk.util.MediaStorage.getWorldReadableUri + 134(MediaStorage.java:134)
       at org.kontalk.ui.AbstractComposeFragment.openFile + 1167(AbstractComposeFragment.java:1167)
       at org.kontalk.ui.AbstractComposeFragment.onListItemClick + 1078(AbstractComposeFragment.java:1078)
       at android.support.v4.app.ListFragment$2.onItemClick + 63(ListFragment.java:63)
       at android.widget.AdapterView.performItemClick + 318(AdapterView.java:318)
       at android.widget.AbsListView.performItemClick + 1159(AbsListView.java:1159)
       at android.widget.AbsListView$PerformClick.run + 3136(AbsListView.java:3136)
       at android.widget.AbsListView$3.run + 4052(AbsListView.java:4052)
       at android.os.Handler.handleCallback + 873(Handler.java:873)
       at android.os.Handler.dispatchMessage + 99(Handler.java:99)
       at android.os.Looper.loop + 193(Looper.java:193)
       at android.app.ActivityThread.main + 6718(ActivityThread.java:6718)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run + 493(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main + 858(ZygoteInit.java:858)