Skip to content

Commit

Permalink
修复在部分设备无法使用
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaowine committed Nov 14, 2023
1 parent 49315fe commit 9834e9f
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package cn.fuckhome.xiaowine.activity

import android.annotation.SuppressLint
import android.content.*
import android.content.pm.PackageManager
import android.graphics.Color
import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.os.Looper
Expand Down Expand Up @@ -350,12 +352,17 @@ class SettingsActivity : MIUIActivity() {
}


@SuppressLint("UnspecifiedRegisterReceiverFlag")
override fun onCreate(savedInstanceState: Bundle?) {
ActivityOwnSP.activity = this
if (!checkLSPosed()) isLoad = false
super.onCreate(savedInstanceState)
if (isLoad) {
registerReceiver(AppReceiver(), IntentFilter().apply { addAction("MIUIHOME_App_Server") })
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
registerReceiver(AppReceiver(), IntentFilter().apply { addAction("MIUIHOME_App_Server") }, RECEIVER_NOT_EXPORTED)
}else{
registerReceiver(AppReceiver(), IntentFilter().apply { addAction("MIUIHOME_App_Server") })
}
if (BuildConfig.DEBUG) {
config.setValue("MemoryView", true)
config.setValue("ZarmView", true)
Expand All @@ -369,7 +376,8 @@ class SettingsActivity : MIUIActivity() {
return try {
Utils.getSP(this, "Fuck_Home_Config")?.let { setSP(it) }
true
} catch (e: Throwable) {
} catch (e: Exception) {
e.printStackTrace()
MIUIDialog(activity) {
setTitle(R.string.Tips)
setMessage(R.string.NotSupport)
Expand Down

0 comments on commit 9834e9f

Please sign in to comment.