Skip to content

Commit 2dda710

Browse files
committed
fix: DebugMode incorrect detection logic
1 parent 566f823 commit 2dda710

4 files changed

Lines changed: 22 additions & 5 deletions

File tree

app/src/main/res/values-zh-rCN/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
<string name="logo_egg3">这里没有 Android Eggs… 但是有 HyperCeiler Eggs!</string>
115115
<string name="uninstall_title">卸载 HyperCeiler</string>
116116
<string name="uninstall_summary">从此入口卸载 HyperCeiler 后,您的模块配置将仍然保留在 Xposed 框架数据库中,如需彻底清除请先前往模块设置中重置模块配置,再进行卸载。</string>
117-
<string name="unsupported_func_tips">当前目标作用域来源可能并不是 Xiaomi 官方,出于安全考虑,已停止加载此作用域的所有功能,请尝试更改为 Xiaomi 官方发布的应用包,或前往 \"设置-开发者选项-调试模式\" 指定挂载版本后重试。</string>
117+
<string name="unsupported_func_tips">当前目标作用域来源可能并不是 Xiaomi 官方,出于安全考虑,已停止加载此作用域的所有功能,请尝试更改为 Xiaomi 官方发布的应用包,或前往 \"HyperCeiler 设置-开发者选项-调试模式\" 指定挂载版本后重试。</string>
118118
<string name="debug_mode">调试模式</string>
119119
<string name="open_debug_mode_tips">该选项仅用于正确处理目标应用的挂载版本,仅供需要时使用。\n对于被调试的目标应用,无法确保功能能正常使用,开启后对于该目标应用出现的任何问题请**不要**反馈给开发者。</string>
120120
<string name="debug_mode_running">当前目标作用域正处于调试模式,若无必要开启请前往关闭。\n当前应用版本:%1$s\n选择目标版本:%2$s\n是否成功挂钩:%3$s</string>

app/src/main/res/values-zh-rTW/strings.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,19 @@
103103
<string name="log_level_none">關閉</string>
104104
<string name="disable_suggest">關閉建議</string>
105105
<string name="enable_suggest">開啟建議</string>
106+
<string name="logo_egg_NotificationName">彩蛋通知</string>
107+
<string name="logo_egg_NotificationName_tips">這是彩蛋通知</string>
108+
<string name="logo_egg_Notification_tips">請在設定裡打開通知以查看彩蛋</string>
109+
<string name="logo_egg1">哇,你居然能找到這裡,太厲害了</string>
110+
<string name="logo_egg2">可惡,藏在這裡也會被發現嗎…</string>
111+
<string name="logo_egg3">這裡沒有 Android Eggs… 但是有 HyperCeiler Eggs!</string>
112+
<string name="uninstall_title">解除安裝 HyperCeiler</string>
113+
<string name="uninstall_summary">從此入口解除安裝 HyperCeiler 後,您的模組配置將仍然保留在 Xposed 框架資料庫中,如需徹底清除請先前往模組設定中重置模組配置,再進行解除安裝。</string>
114+
<string name="unsupported_func_tips">當前目標作用域來源可能並不是 Xiaomi 官方,出於安全考量,已停止載入此作用域的所有功能,請嘗試更改為 Xiaomi 官方發布的應用包,或前往 "HyperCeiler 設定-開發者選項-調試模式" 指定掛載版本後重試。</string>
115+
<string name="debug_mode">調試模式</string>
116+
<string name="open_debug_mode_tips">該選項僅用於正確處理目標應用的掛載版本,僅供需要時使用。\n對於被調試的目標應用,無法確保功能能正常使用,開啟後對於該目標應用出現的任何問題請**不要**回報給開發者。</string>
117+
<string name="debug_mode_running">當前目標作用域正處於調試模式,若無必要開啟請前往關閉。\n當前應用版本:%1$s\n選擇目標版本:%2$s\n是否成功掛鉤:%3$s</string>
118+
<string name="debug_mode_switch">調試版本</string>
119+
<string name="debug_mode_home_version">設定 系統桌面 版本號</string>
120+
<string name="debug_mode_home_version_desc">過高的版本號仍舊會被攔截,請認真填寫</string>
106121
</resources>

library/core/src/main/java/com/sevtinge/hyperceiler/dashboard/DashboardFragment.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ public void setHide(Preference p, boolean b) {
136136

137137
public void setAppModWarn(Preference p, String pkgName) {
138138
boolean check = CheckModifyUtils.INSTANCE.getCheckResult(getContext(), pkgName);
139-
boolean isDebugMode = getSharedPreferences().getInt("prefs_key_debug_choose_" + pkgName, 0) != 0;
139+
boolean isDebugMode = getSharedPreferences().getBoolean("prefs_key_development_debug_mode", false);
140+
boolean isDebugVersion = getSharedPreferences().getInt("prefs_key_debug_choose_" + pkgName, 0) == 0;
140141

141-
p.setVisible(check && !isDebugMode);
142+
p.setVisible(check && !isDebugMode && isDebugVersion);
142143
}
143144
}

library/hook/src/main/java/com/sevtinge/hyperceiler/hook/module/base/BaseModule.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,12 @@ public void init(LoadPackageParam lpparam) {
8282
HCInit.initLoadPackageParam(lpparam);
8383

8484
try {
85+
boolean isDebug = mPrefsMap.getBoolean("development_debug_mode");
8586
for (String pkg : checkList) {
8687
if (Objects.equals(lpparam.packageName, pkg)) {
8788
boolean check = CheckModifyUtils.INSTANCE.getCheckResult(lpparam.packageName);
88-
boolean isDebug = DebugModeUtils.INSTANCE.getChooseResult(lpparam.packageName) != 0;
89-
if (check && !isDebug) return;
89+
boolean isVersion = DebugModeUtils.INSTANCE.getChooseResult(lpparam.packageName) == 0;
90+
if (check && !isDebug && isVersion) return;
9091
break;
9192
}
9293
}

0 commit comments

Comments
 (0)