|
|
|
@ -4,15 +4,17 @@ import android.annotation.SuppressLint
|
|
|
|
|
import android.content.pm.PackageManager
|
|
|
|
|
import android.graphics.Color
|
|
|
|
|
import android.os.Build
|
|
|
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
|
|
|
import android.os.Bundle
|
|
|
|
|
import android.util.Log
|
|
|
|
|
import android.widget.TextView
|
|
|
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
|
|
|
import org.lsposed.hiddenapibypass.HiddenApiBypass
|
|
|
|
|
import java.lang.reflect.Method
|
|
|
|
|
|
|
|
|
|
class SettingActivity : AppCompatActivity() {
|
|
|
|
|
private var isHCEFSupported: Boolean = false
|
|
|
|
|
private var isHCEFUnlocked: Boolean = false
|
|
|
|
|
private var pmmtoolStatus: String? = ""
|
|
|
|
|
val TAG: String = "AICEmu"
|
|
|
|
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
|
@ -49,6 +51,22 @@ class SettingActivity : AppCompatActivity() {
|
|
|
|
|
e.printStackTrace()
|
|
|
|
|
textUnlocker.setText(R.string.Unlocker_work_error)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val textPmmtool = findViewById<TextView>(R.id.pmmtool_work_text)
|
|
|
|
|
pmmtoolStatus = getProperty("tmp.AICEmu.pmmtool");
|
|
|
|
|
if (pmmtoolStatus == "") {
|
|
|
|
|
textPmmtool.setText(R.string.Pmmtool_work_false)
|
|
|
|
|
textPmmtool.setTextColor(Color.RED)
|
|
|
|
|
}
|
|
|
|
|
else if (pmmtoolStatus == "0") {
|
|
|
|
|
textPmmtool.setText(R.string.Pmmtool_work_hook_failed)
|
|
|
|
|
textPmmtool.setTextColor(Color.RED)
|
|
|
|
|
}
|
|
|
|
|
else if (pmmtoolStatus == "1") {
|
|
|
|
|
textPmmtool.setText(R.string.Pmmtool_work_true)
|
|
|
|
|
textPmmtool.setTextColor(Color.GREEN)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -63,5 +81,18 @@ class SettingActivity : AppCompatActivity() {
|
|
|
|
|
HiddenApiBypass.invoke(clazz, null, "isValidSystemCode", systemCode) as Boolean
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@SuppressLint("PrivateApi")
|
|
|
|
|
fun getProperty(key: String?): String? {
|
|
|
|
|
try {
|
|
|
|
|
val c = Class.forName("android.os.SystemProperties")
|
|
|
|
|
val set: Method = c.getMethod("get", String::class.java)
|
|
|
|
|
return set.invoke(c, key)?.toString()
|
|
|
|
|
} catch (e: java.lang.Exception) {
|
|
|
|
|
Log.d("AICEmu", "getProperty exception")
|
|
|
|
|
e.printStackTrace()
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|