Skip to content

Commit

Permalink
增强调试模式权限
Browse files Browse the repository at this point in the history
  • Loading branch information
Eanya-Tonic committed Feb 3, 2025
1 parent dbe4ecf commit 0b53f90
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
// 获取 SwitchPreference
sysWebViewPreference = findPreference("sys_webview");
x5WebViewVersion = findPreference("x5_webview_version");
boolean debugModeValue = sharedPreferences.getBoolean("debug_mode", false);
boolean exists = AssetUtil.fileExistsInAssets(getContext(), "045738_x5.tbs.apk");

if (x5WebViewVersion != null && (!exists || isCpu64Bit())) {
if (x5WebViewVersion != null && (!exists || isCpu64Bit()) && !debugModeValue) {
x5WebViewVersion.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(@NonNull Preference preference, Object newValue) {
Expand Down Expand Up @@ -87,7 +88,7 @@ public boolean onPreferenceChange(@NonNull Preference preference, Object newValu

if (sysWebViewPreference != null) {
boolean switchValue = sharedPreferences.getBoolean("sys_webview", true);
boolean debugModeValue = sharedPreferences.getBoolean("debug_mode", false);
debugModeValue = sharedPreferences.getBoolean("debug_mode", false);

// 如果开关被关闭,禁用它
if (!switchValue && !debugModeValue) {
Expand Down

0 comments on commit 0b53f90

Please sign in to comment.