diff --git a/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt b/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt index bfbf7705..71c0b2b5 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt @@ -787,7 +787,7 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener { nav_rail?.itemActiveIndicatorColor = rippleColor nav_view?.itemActiveIndicatorColor = rippleColor - if (!checkWrite() && Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) { + if (!checkWrite()) { requestRW() if (checkWrite()) return } diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/BackupUtils.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/BackupUtils.kt index 028bc21d..f4f4e3be 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/BackupUtils.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/BackupUtils.kt @@ -148,7 +148,7 @@ object BackupUtils { @SuppressLint("SimpleDateFormat") fun FragmentActivity.backup() { try { - if (!checkWrite() && Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) { + if (!checkWrite()) { showToast(this, getString(R.string.backup_failed), Toast.LENGTH_LONG) requestRW() return diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/UIHelper.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/UIHelper.kt index 553860ba..63b3623d 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/UIHelper.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/UIHelper.kt @@ -57,7 +57,10 @@ object UIHelper { this, Manifest.permission.WRITE_EXTERNAL_STORAGE ) - == PackageManager.PERMISSION_GRANTED) + == PackageManager.PERMISSION_GRANTED + // Since Android 13, we can't request external storage permission, + // so don't check it. + || Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) } fun Activity.requestRW() {