This commit is contained in:
Cloudburst 2023-01-02 11:25:12 +00:00
parent c433df0f29
commit 30ff7d988f

View file

@ -357,31 +357,31 @@ class InAppUpdater {
}
return false
}
}
fun isMiUi(): Boolean {
return !TextUtils.isEmpty(getSystemProperty("ro.miui.ui.version.name"))
}
fun isMiUi(): Boolean {
return !TextUtils.isEmpty(getSystemProperty("ro.miui.ui.version.name"))
}
fun getSystemProperty(propName: String): String? {
var line: String? = null
var input: BufferedReader? = null
try {
val p = Runtime.getRuntime().exec("getprop $propName")
input = BufferedReader(InputStreamReader(p.inputStream), 1024)
line = input.readLine()
input.close()
} catch (ex: IOException) {
return null
} finally {
if (input != null) {
try {
input.close()
} catch (e: IOException) {
e.printStackTrace()
fun getSystemProperty(propName: String): String? {
var line: String? = null
var input: BufferedReader? = null
try {
val p = Runtime.getRuntime().exec("getprop $propName")
input = BufferedReader(InputStreamReader(p.inputStream), 1024)
line = input.readLine()
input.close()
} catch (ex: IOException) {
return null
} finally {
if (input != null) {
try {
input.close()
} catch (e: IOException) {
e.printStackTrace()
}
}
}
return line
}
return line
}
}