Get app validated by the Play store moderation team
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a68032508..04801d225 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -6,7 +6,8 @@
   <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
   <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
-  <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
+  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
     tools:ignore="ScopedStorage" />
 
   <queries>
@@ -32,7 +33,8 @@
       android:label="@string/app_name"
       android:launchMode="singleTop"
       android:theme="@style/KiwixTheme.Launcher"
-      android:windowSoftInputMode="adjustPan">
+      android:windowSoftInputMode="adjustPan"
+      android:exported="true">
       <meta-data
         android:name="android.app.shortcuts"
         android:resource="@xml/shortcuts" />
@@ -145,7 +147,8 @@
 
     <service android:name=".webserver.wifi_hotspot.HotspotService" />
 
-    <receiver android:name=".main.KiwixSearchWidget">
+    <receiver android:name=".main.KiwixSearchWidget"
+      android:exported="false">
       <meta-data
         android:name="android.appwidget.provider"
         android:resource="@xml/kiwix_widget_provider_info" />
diff --git a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/LocalLibraryFragment.kt b/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/LocalLibraryFragment.kt
index e97562289..45af310d3 100644
--- a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/LocalLibraryFragment.kt
+++ b/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/LocalLibraryFragment.kt
@@ -214,6 +214,7 @@ class LocalLibraryFragment : BaseFragment() {
           // We already have permission!!
           requestFileSystemCheck()
         } else {
+          sharedPreferenceUtil.manageExternalFilesPermissionDialog = false
           if (sharedPreferenceUtil.manageExternalFilesPermissionDialog) {
             // We should only ask for first time, If the users wants to revoke settings
             // then they can directly toggle this feature from settings screen
diff --git a/app/src/main/java/org/kiwix/kiwixmobile/settings/KiwixPrefsFragment.kt b/app/src/main/java/org/kiwix/kiwixmobile/settings/KiwixPrefsFragment.kt
index 948466170..d9e09252e 100644
--- a/app/src/main/java/org/kiwix/kiwixmobile/settings/KiwixPrefsFragment.kt
+++ b/app/src/main/java/org/kiwix/kiwixmobile/settings/KiwixPrefsFragment.kt
@@ -18,16 +18,16 @@
 
 package org.kiwix.kiwixmobile.settings
 
+import android.Manifest
+import android.content.pm.PackageManager
 import android.os.Build
 import android.os.Bundle
-import android.os.Environment
 import androidx.core.content.ContextCompat
-import androidx.fragment.app.FragmentActivity
 import androidx.preference.Preference
 import androidx.preference.PreferenceCategory
 import org.kiwix.kiwixmobile.R
-import org.kiwix.kiwixmobile.core.navigateToSettings
 import org.kiwix.kiwixmobile.core.settings.CorePrefsFragment
+import org.kiwix.kiwixmobile.core.utils.REQUEST_STORAGE_PERMISSION
 import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil
 import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil.Companion.PREF_STORAGE
 
@@ -54,15 +54,26 @@ class KiwixPrefsFragment : CorePrefsFragment() {
     val permissionPref = findPreference<Preference>(PREF_MANAGE_EXTERNAL_STORAGE_PERMISSION)
     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
       showPermissionPreference()
-      val externalStorageManager = Environment.isExternalStorageManager()
-      if (externalStorageManager) {
+
+      val isPermission = ContextCompat.checkSelfPermission(
+        requireActivity(),
+        Manifest.permission.READ_EXTERNAL_STORAGE
+      ) == PackageManager.PERMISSION_GRANTED
+
+      if (isPermission) {
         permissionPref!!.setSummary(org.kiwix.kiwixmobile.core.R.string.allowed)
       } else {
         permissionPref!!.setSummary(org.kiwix.kiwixmobile.core.R.string.not_allowed)
       }
       permissionPref.onPreferenceClickListener =
         Preference.OnPreferenceClickListener {
-          activity?.let(FragmentActivity::navigateToSettings)
+          if (!isPermission) {
+            requestPermissions(
+              arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE),
+              REQUEST_STORAGE_PERMISSION
+            )
+          }
+          // activity?.let(FragmentActivity::navigateToSettings)
           true
         }
     }
diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/main/AddNoteDialog.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/main/AddNoteDialog.kt
index 29cb8cb03..9f91dc3d4 100644
--- a/core/src/main/java/org/kiwix/kiwixmobile/core/main/AddNoteDialog.kt
+++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/AddNoteDialog.kt
@@ -18,6 +18,7 @@
 package org.kiwix.kiwixmobile.core.main
 
 import android.Manifest
+import android.annotation.SuppressLint
 import android.app.Dialog
 import android.content.Context
 import android.content.Intent
@@ -25,7 +26,6 @@ import android.content.pm.PackageManager
 import android.net.Uri
 import android.os.Build
 import android.os.Bundle
-import android.os.Environment
 import android.util.Log
 import android.view.LayoutInflater
 import android.view.MenuItem
@@ -346,6 +346,7 @@ class AddNoteDialog : DialogFragment() {
     enableDeleteNoteMenuItem()
   }
 
+  @SuppressLint("QueryPermissionsNeeded")
   private fun shareNote() {
 
     /* The note text file corresponding to the currently open article, given at:
@@ -399,7 +400,7 @@ class AddNoteDialog : DialogFragment() {
 
   companion object {
     @JvmField val NOTES_DIRECTORY =
-      Environment.getExternalStorageDirectory().toString() + "/Kiwix/Notes/"
+      instance.getExternalFilesDir("").toString() + "/Kiwix/Notes/"
     const val TAG = "AddNoteDialog"
   }
 }
['app/src/main/java/org/kiwix/kiwixmobile/settings/KiwixPrefsFragment.kt', 'app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/LocalLibraryFragment.kt', 'core/src/main/java/org/kiwix/kiwixmobile/core/main/AddNoteDialog.kt', 'app/src/main/AndroidManifest.xml']