fix bug: pmmtool switch (ver.1.0-Beta4.1)

master 1.0-Beta4.1
wlt233 1 year ago
parent d002ba021c
commit d1836091a2

@ -11,8 +11,8 @@ android {
applicationId "moe.tqlwsl.aicemu" applicationId "moe.tqlwsl.aicemu"
minSdk 28 minSdk 28
targetSdk 33 targetSdk 33
versionCode 5 versionCode 6
versionName "1.0-Beta4" versionName "1.0-Beta4.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }

@ -17,6 +17,7 @@ import java.lang.reflect.Method
class SettingActivity : AppCompatActivity() { class SettingActivity : AppCompatActivity() {
private lateinit var prefs: SharedPreferences
private var isHCEFSupported: Boolean = false private var isHCEFSupported: Boolean = false
private var isHCEFUnlocked: Boolean = false private var isHCEFUnlocked: Boolean = false
private var pmmtoolStatus: String? = "" private var pmmtoolStatus: String? = ""
@ -72,10 +73,11 @@ class SettingActivity : AppCompatActivity() {
// textPmmtool.setTextColor(Color.GREEN) // textPmmtool.setTextColor(Color.GREEN)
// } // }
prefs = applicationContext.getSharedPreferences("AICEmu", Context.MODE_WORLD_READABLE)
val loadPmmtool = prefs.getBoolean("loadPmmtool", false)
val pmmtoolSwitch = findViewById<SwitchCompat>(R.id.pmmtool_switch) val pmmtoolSwitch = findViewById<SwitchCompat>(R.id.pmmtool_switch)
pmmtoolSwitch.isChecked = loadPmmtool
pmmtoolSwitch.setOnCheckedChangeListener { _, isChecked -> pmmtoolSwitch.setOnCheckedChangeListener { _, isChecked ->
var prefs: SharedPreferences =
applicationContext.getSharedPreferences("AICEmu", Context.MODE_WORLD_READABLE)
val editor = prefs.edit() val editor = prefs.edit()
editor.putBoolean("loadPmmtool", isChecked) editor.putBoolean("loadPmmtool", isChecked)
editor.apply() editor.apply()

@ -34,5 +34,5 @@
<string name="apdu_service_desc">Emulate AIC Card</string> <string name="apdu_service_desc">Emulate AIC Card</string>
<string name="pmmtool_switch">Change PMm with Pmmtool</string> <string name="pmmtool_switch">Change PMm with Pmmtool</string>
<string name="author_info" translatable="false">made by wlt233 with ❤\ntqlwsl.moe | 2709684396</string> <string name="author_info" translatable="false">made by wlt233 with ❤\ntqlwsl.moe | 2709684396</string>
<string name="version_info" translatable="false">1.0-Beta4 (2023.09.01)</string> <string name="version_info" translatable="false">1.0-Beta4.1 (2023.09.01)</string>
</resources> </resources>
Loading…
Cancel
Save