Remove write permission in share intent

This commit is contained in:
Ming Ming 2023-08-04 01:23:55 +08:00
parent d5de52a789
commit 88cda20582

View file

@ -71,7 +71,6 @@ class ShareChannelHandler(activity: Activity) :
ClipData.newUri(_context.contentResolver, "Share", uris[0]) ClipData.newUri(_context.contentResolver, "Share", uris[0])
type = mimeTypes[0] ?: "*/*" type = mimeTypes[0] ?: "*/*"
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
} else Intent().apply { } else Intent().apply {
action = Intent.ACTION_SEND_MULTIPLE action = Intent.ACTION_SEND_MULTIPLE
putParcelableArrayListExtra(Intent.EXTRA_STREAM, ArrayList(uris)) putParcelableArrayListExtra(Intent.EXTRA_STREAM, ArrayList(uris))
@ -86,7 +85,6 @@ class ShareChannelHandler(activity: Activity) :
it?.startsWith("image/") == true it?.startsWith("image/") == true
}) "image/*" else "*/*" }) "image/*" else "*/*"
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
} }
val shareChooser = Intent.createChooser( val shareChooser = Intent.createChooser(
shareIntent, _context.getString( shareIntent, _context.getString(