mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-01 08:15:37 +08:00
fix: try-catch Context.MODE_WORLD_READABLE if failure of non-hook environment in ModulePreferenceFragment
This commit is contained in:
@@ -66,8 +66,10 @@ abstract class ModulePreferenceFragment : PreferenceFragmentCompat(), SharedPref
|
||||
* 获取应用默认的 [SharedPreferences]
|
||||
* @return [SharedPreferences]
|
||||
*/
|
||||
@Suppress("DEPRECATION", "WorldReadableFiles")
|
||||
private val currentSharedPrefs get() = currentActivity.getSharedPreferences(prefsName, Context.MODE_WORLD_READABLE)
|
||||
private val currentSharedPrefs get() = runCatching {
|
||||
@Suppress("DEPRECATION", "WorldReadableFiles")
|
||||
currentActivity.getSharedPreferences(prefsName, Context.MODE_WORLD_READABLE)
|
||||
}.getOrNull() ?: PreferenceManager.getDefaultSharedPreferences(currentActivity)
|
||||
|
||||
@CallSuper
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
|
Reference in New Issue
Block a user