react-native-share / react-native-share

Social share, sending simple data to other apps.

Home Page:https://react-native-share.github.io/react-native-share

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Permission issue at AndroidTV 10

ZygmuntMalek opened this issue · comments

for some platform it works properly eg. Android 11 Samsung a10 but at other's like SEI AndroidTV box there is reported lack of permissions

Steps to reproduce

  1. Share open from internal storage, eg
    Share.open({ title, urls, failOnCancel: false, })

where looks like [ 'file:///data/user/0/com.schange.client.vanilla.android.tv/files/nitrox5log2023-11-22_0_11-15-41.txt', 'file:///data/user/0/com.schange.client.vanilla.android.tv/files/nitrox5log2023-11-22_1_11-17-47.txt', file:///data/user/0/com.schange.client.vanilla.android.tv/files/nitrox5log2023-11-22_2_13-49-09.txt', 'file:///data/user/0/com.schange.client.vanilla.android.tv/files/nitrox5_logcat_2023-11-22_13-49-15.log' ]

error:

11-22 13:49:15.246 W/ChooserActivity( 4717): Ignoring intent's EXTRA_TITLE, deprecated in P. You may wish to set a preview title by using EXTRA_TITLE property of the wrapped EXTRA_INTENT.
11-22 13:49:15.370 W/View ( 4717): requestLayout() improperly called by android.widget.ListView{3c24d65 VFED..C.. .F....ID 0,1080-1920,1998 #102045b android:id/resolver_list} during layout: running second layout pass
11-22 13:49:15.382 W/Binder ( 3695): Outgoing transactions from this process must be FLAG_ONEWAY
11-22 13:49:15.382 W/Binder ( 3695): java.lang.Throwable
11-22 13:49:15.382 W/Binder ( 3695): at android.os.BinderProxy.transact(BinderProxy.java:480)
11-22 13:49:15.382 W/Binder ( 3695): at android.content.ContentProviderProxy.getType(ContentProviderNative.java:456)
11-22 13:49:15.382 W/Binder ( 3695): at com.android.server.am.ActivityManagerService.getProviderMimeType(ActivityManagerService.java:7679)
11-22 13:49:15.382 W/Binder ( 3695): at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3207)
11-22 13:49:15.382 W/Binder ( 3695): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2741)
11-22 13:49:15.382 W/Binder ( 3695): at android.os.Binder.execTransactInternal(Binder.java:1021)
11-22 13:49:15.382 W/Binder ( 3695): at android.os.Binder.execTransact(Binder.java:994)
11-22 13:49:15.394 E/DatabaseUtils( 6030): Writing exception to parcel
11-22 13:49:15.394 E/DatabaseUtils( 6030): java.lang.SecurityException: Permission Denial: reading cl.json.RNShareFileProvider uri content://com.schange.client.vanilla.android.tv.rnshare.fileprovider/rnshare_sdcard/data/data/com.schange.client.vanilla.android.tv/files/nitrox5log2023-11-22_0_11-15-41.txt from pid=4717, uid=1000 requires the provider be exported, or grantUriPermission()
11-22 13:49:15.394 E/DatabaseUtils( 6030): at android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:729)
11-22 13:49:15.394 E/DatabaseUtils( 6030): at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:602)
11-22 13:49:15.394 E/DatabaseUtils( 6030): at android.content.ContentProvider$Transport.query(ContentProvider.java:231)
11-22 13:49:15.394 E/DatabaseUtils( 6030): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:104)
11-22 13:49:15.394 E/DatabaseUtils( 6030): at android.os.Binder.execTransactInternal(Binder.java:1021)
11-22 13:49:15.394 E/DatabaseUtils( 6030): at android.os.Binder.execTransact(Binder.java:994)
11-22 13:49:15.395 W/ChooserActivity( 4717): Could not load (content://com.schange.client.vanilla.android.tv.rnshare.fileprovider/rnshare_sdcard/data/data/com.schange.client.vanilla.android.tv/files/nitrox5log2023-11-22_0_11-15-41.txt)

Expected behavior

Sharing files should work properly as on other platforms (It work in the past on that device but as this is quite old issue I can't point configuration at which it worked properly )

Actual behavior

Files could not be shared

Environment

  • React Native version: react-native-tvos@0.71.13-1
  • React Native platform + platform version: Android TV 10
  • logs_androidtv_evopro.txt
  • Typescript version (if using typescript): 5.1.6

react-native-share

Version: Logs are from 9.4.1 but I verified multiple versions also 10.0.1 with same result

Link to repo (highly encouraged)

logs_android_samsung_a10.txt
deviceInfo_androidtv_evopro.txt
deviceInfo_android_samsung_a10.txt

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and i will leave this open