|
|
@ -28,6 +28,8 @@ class SettingFragment : PreferenceFragmentCompat() { |
|
|
|
|
|
|
|
|
|
|
|
private lateinit var fixCodeItemPreference: SwitchPreferenceCompat |
|
|
|
private lateinit var fixCodeItemPreference: SwitchPreferenceCompat |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private lateinit var hookDumpPreference: SwitchPreferenceCompat |
|
|
|
|
|
|
|
|
|
|
|
private val initialDirectory = AppManager.mBlackBoxLoader.getSavePath() |
|
|
|
private val initialDirectory = AppManager.mBlackBoxLoader.getSavePath() |
|
|
|
|
|
|
|
|
|
|
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { |
|
|
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { |
|
|
@ -44,6 +46,10 @@ class SettingFragment : PreferenceFragmentCompat() { |
|
|
|
fixCodeItemPreference.onPreferenceChangeListener = mFixCodeItemChange |
|
|
|
fixCodeItemPreference.onPreferenceChangeListener = mFixCodeItemChange |
|
|
|
fixCodeItemPreference.isChecked = AppManager.mBlackBoxLoader.isFixCodeItem() |
|
|
|
fixCodeItemPreference.isChecked = AppManager.mBlackBoxLoader.isFixCodeItem() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hookDumpPreference = findPreference("hook_dump")!! |
|
|
|
|
|
|
|
hookDumpPreference.onPreferenceChangeListener = mHookDumpChange |
|
|
|
|
|
|
|
hookDumpPreference.isChecked = AppManager.mBlackBoxLoader.isHookDump() |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private val mSavedPathClick = Preference.OnPreferenceClickListener { |
|
|
|
private val mSavedPathClick = Preference.OnPreferenceClickListener { |
|
|
@ -79,6 +85,11 @@ class SettingFragment : PreferenceFragmentCompat() { |
|
|
|
return@OnPreferenceChangeListener true |
|
|
|
return@OnPreferenceChangeListener true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private val mHookDumpChange = Preference.OnPreferenceChangeListener { _, newValue -> |
|
|
|
|
|
|
|
AppManager.mBlackBoxLoader.saveEnable(newValue as Boolean) |
|
|
|
|
|
|
|
return@OnPreferenceChangeListener true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private val mFixCodeItemChange = Preference.OnPreferenceChangeListener { _, newValue -> |
|
|
|
private val mFixCodeItemChange = Preference.OnPreferenceChangeListener { _, newValue -> |
|
|
|
if (newValue as Boolean) { |
|
|
|
if (newValue as Boolean) { |
|
|
|
|
|
|
|
|
|
|
|