diff --git a/app/core/src/main/java/com/topjohnwu/magisk/core/utils/LocaleSetting.kt b/app/core/src/main/java/com/topjohnwu/magisk/core/utils/LocaleSetting.kt index b995ecb4d..4f936ed57 100644 --- a/app/core/src/main/java/com/topjohnwu/magisk/core/utils/LocaleSetting.kt +++ b/app/core/src/main/java/com/topjohnwu/magisk/core/utils/LocaleSetting.kt @@ -4,9 +4,12 @@ import android.annotation.SuppressLint import android.app.LocaleConfig import android.app.LocaleManager import android.content.ContextWrapper +import android.content.Intent import android.content.res.Resources +import android.net.Uri import android.os.Build import android.os.LocaleList +import android.provider.Settings import androidx.annotation.RequiresApi import com.topjohnwu.magisk.core.AppApkPath import com.topjohnwu.magisk.core.AppContext @@ -165,8 +168,9 @@ interface LocaleSetting { } val useLocaleManager get() = - if (isRunningAsStub) Build.VERSION.SDK_INT >= 34 - else Build.VERSION.SDK_INT >= 33 + (if (isRunningAsStub) Build.VERSION.SDK_INT >= 34 else Build.VERSION.SDK_INT >= 33) && + Intent(Settings.ACTION_APP_LOCALE_SETTINGS, Uri.fromParts("package", AppContext.packageName, null)) + .resolveActivity(AppContext.packageManager) != null val instance: LocaleSetting by lazy { // Initialize available locale list