quran / quran_android

a quran reading application for android
http://android.quran.com
GNU General Public License v3.0
1.95k stars 881 forks source link

Do not request storage permissions on launch #2697

Closed ahmedre closed 1 month ago

ahmedre commented 1 month ago

New installations of Quran have defaulted to internal storage for some time now, especially due to the requirement of using scoped storage on more modern versions of Android.

The main change this patch makes is that if someone has a directory set that requires external storage permissions while not having permissions, fall back to internal storage. This should be safe, since it implies that either someone who had permission revoked permissions manually, especially since this preference is per installation (i.e. doesn't get backed up).

This does not stop people on older versions of Android from using the sdcard root if they already have it set today. If they don't, they can still switch to it via the advanced settings (for people on or below Android 10).

This patch also simplifies some of the null checking around the app custom location by making the preference methods always return non-null values.

github-actions[bot] commented 1 month ago
OLD: app-madani-debug.apk (signature: V1, V2)
NEW: app-madani-debug.apk (signature: V1, V2)

          │            compressed            │           uncompressed           
          ├───────────┬───────────┬──────────┼───────────┬───────────┬──────────
 APK      │ old       │ new       │ diff     │ old       │ new       │ diff     
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
      dex │  20.4 MiB │  20.4 MiB │ -1.1 KiB │  65.8 MiB │  65.8 MiB │ -2.6 KiB 
     arsc │   2.3 MiB │   2.3 MiB │      0 B │   2.3 MiB │   2.3 MiB │      0 B 
 manifest │   5.6 KiB │   5.6 KiB │      0 B │  27.1 KiB │  27.1 KiB │      0 B 
      res │   1.6 MiB │   1.6 MiB │      0 B │   1.8 MiB │   1.8 MiB │      0 B 
    asset │ 404.2 KiB │ 404.2 KiB │      0 B │ 678.6 KiB │ 678.6 KiB │      0 B 
    other │ 189.1 KiB │ 189.1 KiB │     -8 B │ 386.8 KiB │ 386.8 KiB │      0 B 
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
    total │  24.8 MiB │  24.8 MiB │ -1.1 KiB │  70.9 MiB │  70.9 MiB │ -2.6 KiB