Skip to content

Commit

Permalink
remove unnecessary READ_EXTERNAL_STORAGE permission (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
5ec1cff authored Feb 5, 2025
1 parent 64a69e6 commit 2760de9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />
Expand Down
18 changes: 0 additions & 18 deletions app/src/main/java/com/github/kr328/clash/FilesActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,6 @@ class FilesActivity : BaseActivity<FilesDesign>() {
client.renameDocument(it.file.id, newName)
}
is FilesDesign.Request.ImportFile -> {
if (Build.VERSION.SDK_INT >= 23) {
val hasPermission = ContextCompat.checkSelfPermission(
this@FilesActivity,
Manifest.permission.READ_EXTERNAL_STORAGE
) == PackageManager.PERMISSION_GRANTED

if (!hasPermission) {
val granted = startActivityForResult(
ActivityResultContracts.RequestPermission(),
Manifest.permission.READ_EXTERNAL_STORAGE,
)

if (!granted) {
return@onReceive
}
}
}

val uri: Uri? = startActivityForResult(
ActivityResultContracts.GetContent(),
"*/*"
Expand Down

0 comments on commit 2760de9

Please sign in to comment.