@SuppressLint("WrongConstant")
fun restartXiaomiSystemUI(context: Context) {val bundle = Bundle().apply {putString("package_name", BuildConfig.APPLICATION_ID)
putString("strong_toast_category", "text_bitmap")
putString("param", "{\"a\":{\"a\":{\"a\":\"a\"}}}") // 哎嘿,包崩溃的
putString("status_bar_strong_toast", "show_custom_strong_toast")
}
val service = context.getSystemService(Context.STATUS_BAR_SERVICE)
service.javaClass.getMethod("setStatus", Int::class.javaPrimitiveType, String::class.java, Bundle::class.java)
.invoke(service, 1, "strong_toast_action", bundle)
}
一个非常简单的重启 HyperOS 系统界面实现。
无需任何权限,利用小米的灵动额头即可。
当时刚出的时候就发现了,至今没修复。
#Xiaomi #HyperOS