Compare commits

...

2 Commits

@ -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"
} }

@ -72,13 +72,13 @@ class MainActivity : AppCompatActivity() {
if (nfcAdapter == null) { if (nfcAdapter == null) {
Log.e(TAG, "NFC not supported") Log.e(TAG, "NFC not supported")
AlertDialog.Builder(this) AlertDialog.Builder(this)
.setTitle(R.string.error).setMessage(R.string.nfc_not_supported).setCancelable(false).show() .setTitle(R.string.error).setMessage(R.string.nfc_not_supported).setCancelable(true).show()
return return
} }
if (!nfcAdapter!!.isEnabled) { if (!nfcAdapter!!.isEnabled) {
Log.e(TAG, "NFC is off") Log.e(TAG, "NFC is off")
AlertDialog.Builder(this) AlertDialog.Builder(this)
.setTitle(R.string.error).setMessage(R.string.nfc_not_on).setCancelable(false).show() .setTitle(R.string.error).setMessage(R.string.nfc_not_on).setCancelable(true).show()
return return
} }

@ -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