我有一个场景,我有很多表单字段,它们需要在屏幕上动态更新,我正在使用Vuex并将它们存储在商店中,以便可以在其他组件中使用它们。我想添加一个函数,以便private fun isDeviceRooted(): Boolean {
return checkRootMethod1() || checkRootMethod2() || checkRootMethod3()
}
private fun checkRootMethod1(): Boolean {
val buildTags = android.os.Build.TAGS
return buildTags != null && buildTags.contains("test-keys")
}
private fun checkRootMethod2(): Boolean {
val paths = arrayOf("/system/app/Superuser.apk", "/sbin/su", "/system/bin/su", "/system/xbin/su", "/data/local/xbin/su", "/data/local/bin/su", "/system/sd/xbin/su", "/system/bin/failsafe/su", "/data/local/su", "/su/bin/su")
for (path in paths) {
if (File(path).exists()) return true
}
return false
}
private fun checkRootMethod3(): Boolean {
var process: Process? = null
return try {
process = Runtime.getRuntime().exec(arrayOf("/system/xbin/which", "su"))
val `in` = BufferedReader(InputStreamReader(process!!.inputStream))
`in`.readLine() != null
} catch (t: Throwable) {
false
} finally {
process?.destroy()
}
}
在我的字段上将更新商店。
使用VFG我找不到在架构中添加Vue指令的方法。我想在所有输入上使用onblur
,所以有一种方法可以对所有输入执行此操作,或者我必须在每个输入上声明它们。另外,如何使用VFG做到这一点?