mirror of
https://github.com/azahar-emu/azahar
synced 2025-11-07 07:29:58 +01:00
android: Added MAC address setting from QT
This commit is contained in:
parent
d5745cae8f
commit
58b2ebd5cd
@ -1,4 +1,4 @@
|
|||||||
// Copyright 2023 Citra Emulator Project
|
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
@ -514,6 +514,18 @@ class SettingsAdapter(
|
|||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun onClickRegenerateMAC() {
|
||||||
|
MaterialAlertDialogBuilder(context)
|
||||||
|
.setTitle(R.string.regenerate_mac_address)
|
||||||
|
.setMessage(R.string.regenerate_mac_address_description)
|
||||||
|
.setPositiveButton(android.R.string.ok) { _: DialogInterface, _: Int ->
|
||||||
|
SystemSaveGame.regenerateMac()
|
||||||
|
notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
.setNegativeButton(android.R.string.cancel, null)
|
||||||
|
.show()
|
||||||
|
}
|
||||||
|
|
||||||
fun closeDialog() {
|
fun closeDialog() {
|
||||||
if (dialog != null) {
|
if (dialog != null) {
|
||||||
if (clickedPosition != -1) {
|
if (clickedPosition != -1) {
|
||||||
|
|||||||
@ -391,6 +391,16 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
|
|||||||
{ "0x${SystemSaveGame.getConsoleId().toHexString().uppercase()}" }
|
{ "0x${SystemSaveGame.getConsoleId().toHexString().uppercase()}" }
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
add(
|
||||||
|
RunnableSetting(
|
||||||
|
R.string.mac_address,
|
||||||
|
0,
|
||||||
|
false,
|
||||||
|
0,
|
||||||
|
{ settingsAdapter.onClickRegenerateMAC() },
|
||||||
|
{ SystemSaveGame.getMac() }
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
add(HeaderSetting(R.string.birthday))
|
add(HeaderSetting(R.string.birthday))
|
||||||
val systemBirthdayMonthSetting = object : AbstractShortSetting {
|
val systemBirthdayMonthSetting = object : AbstractShortSetting {
|
||||||
|
|||||||
@ -209,6 +209,7 @@ class SystemFilesFragment : Fragment() {
|
|||||||
textN3ds = getString(R.string.setup_system_files_o3ds_needed)
|
textN3ds = getString(R.string.setup_system_files_o3ds_needed)
|
||||||
colorN3ds = R.color.citra_primary_yellow
|
colorN3ds = R.color.citra_primary_yellow
|
||||||
|
|
||||||
|
buttonO3ds.isChecked = true
|
||||||
buttonN3ds.isEnabled = false
|
buttonN3ds.isEnabled = false
|
||||||
} else {
|
} else {
|
||||||
textO3ds = getString(R.string.setup_system_files_completed)
|
textO3ds = getString(R.string.setup_system_files_completed)
|
||||||
@ -217,9 +218,11 @@ class SystemFilesFragment : Fragment() {
|
|||||||
if (!setupStateCached!![1]) {
|
if (!setupStateCached!![1]) {
|
||||||
textN3ds = getString(R.string.setup_system_files_possible)
|
textN3ds = getString(R.string.setup_system_files_possible)
|
||||||
colorN3ds = R.color.citra_primary_blue
|
colorN3ds = R.color.citra_primary_blue
|
||||||
|
buttonN3ds.isChecked = true
|
||||||
} else {
|
} else {
|
||||||
textN3ds = getString(R.string.setup_system_files_completed)
|
textN3ds = getString(R.string.setup_system_files_completed)
|
||||||
colorN3ds = R.color.citra_primary_green
|
colorN3ds = R.color.citra_primary_green
|
||||||
|
buttonO3ds.isChecked = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
// Copyright 2023 Citra Emulator Project
|
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
@ -44,6 +44,10 @@ object SystemSaveGame {
|
|||||||
external fun getConsoleId(): Long
|
external fun getConsoleId(): Long
|
||||||
|
|
||||||
external fun regenerateConsoleId()
|
external fun regenerateConsoleId()
|
||||||
|
|
||||||
|
external fun getMac(): String
|
||||||
|
|
||||||
|
external fun regenerateMac()
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class BirthdayMonth(val code: Int, val days: Int) {
|
enum class BirthdayMonth(val code: Int, val days: Int) {
|
||||||
|
|||||||
@ -127,4 +127,15 @@ void Java_org_citra_citra_1emu_utils_SystemSaveGame_regenerateConsoleId(
|
|||||||
changes_pending = true;
|
changes_pending = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jstring Java_org_citra_citra_1emu_utils_SystemSaveGame_getMac(JNIEnv* env,
|
||||||
|
[[maybe_unused]] jobject obj) {
|
||||||
|
return ToJString(env, cfg->GetMacAddress());
|
||||||
|
}
|
||||||
|
|
||||||
|
void Java_org_citra_citra_1emu_utils_SystemSaveGame_regenerateMac(JNIEnv* env,
|
||||||
|
[[maybe_unused]] jobject obj) {
|
||||||
|
cfg->GetMacAddress() = Service::CFG::GenerateRandomMAC();
|
||||||
|
cfg->SaveMacAddress();
|
||||||
|
}
|
||||||
|
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
|
|||||||
@ -782,4 +782,7 @@
|
|||||||
<string name="enable_required_online_lle_modules_desc">Enables the LLE modules required for online multiplayer, eShop access, etc.</string>
|
<string name="enable_required_online_lle_modules_desc">Enables the LLE modules required for online multiplayer, eShop access, etc.</string>
|
||||||
<string name="emulation_settings">Emulation Settings</string>
|
<string name="emulation_settings">Emulation Settings</string>
|
||||||
<string name="profile_settings">Profile Settings</string>
|
<string name="profile_settings">Profile Settings</string>
|
||||||
|
<string name="mac_address">MAC Address</string>
|
||||||
|
<string name="regenerate_mac_address">Regenerate MAC Address</string>
|
||||||
|
<string name="regenerate_mac_address_description">This will replace your current MAC address with a new one. It is not recommended to do this if you got the MAC address from your real console using the setup tool. Continue?</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user