From 98565cf9b85c69b35d1b33ac461b75b22915899f Mon Sep 17 00:00:00 2001 From: JingMatrix Date: Sat, 7 Dec 2024 12:56:50 +0100 Subject: [PATCH] Fix logs generated by LSPosed manager 1. Update Dobby to set log TAG properly 2. Fix log preference settings for debug version --- .../manager/ui/fragment/SettingsFragment.java | 12 +++++++----- daemon/src/main/jni/logcat.cpp | 7 ++++--- external/dobby | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/lsposed/manager/ui/fragment/SettingsFragment.java b/app/src/main/java/org/lsposed/manager/ui/fragment/SettingsFragment.java index 45e1a6254ba..ef8c5f72805 100644 --- a/app/src/main/java/org/lsposed/manager/ui/fragment/SettingsFragment.java +++ b/app/src/main/java/org/lsposed/manager/ui/fragment/SettingsFragment.java @@ -156,15 +156,17 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { MaterialSwitchPreference prefVerboseLogs = findPreference("disable_verbose_log"); if (prefVerboseLogs != null) { prefVerboseLogs.setEnabled(!BuildConfig.DEBUG && installed); + if (BuildConfig.DEBUG) ConfigManager.setVerboseLogEnabled(false); prefVerboseLogs.setChecked(!installed || !ConfigManager.isVerboseLogEnabled()); prefVerboseLogs.setOnPreferenceChangeListener((preference, newValue) -> ConfigManager.setVerboseLogEnabled(!(boolean) newValue)); } - MaterialSwitchPreference prefEnableLog = findPreference("enable_log_watchdog"); - if (prefEnableLog != null) { - prefEnableLog.setEnabled(!BuildConfig.DEBUG && installed); - prefEnableLog.setChecked(!installed || ConfigManager.isLogWatchdogEnabled()); - prefEnableLog.setOnPreferenceChangeListener((preference, newValue) -> ConfigManager.setLogWatchdog((boolean) newValue)); + MaterialSwitchPreference prefLogWatchDog = findPreference("enable_log_watchdog"); + if (prefLogWatchDog != null) { + prefLogWatchDog.setEnabled(!BuildConfig.DEBUG && installed); + if (BuildConfig.DEBUG) ConfigManager.setLogWatchdog(true); + prefLogWatchDog.setChecked(!installed || ConfigManager.isLogWatchdogEnabled()); + prefLogWatchDog.setOnPreferenceChangeListener((preference, newValue) -> ConfigManager.setLogWatchdog((boolean) newValue)); } MaterialSwitchPreference prefDexObfuscate = findPreference("enable_dex_obfuscate"); diff --git a/daemon/src/main/jni/logcat.cpp b/daemon/src/main/jni/logcat.cpp index 598d29810d1..12f0ca9b503 100644 --- a/daemon/src/main/jni/logcat.cpp +++ b/daemon/src/main/jni/logcat.cpp @@ -227,9 +227,10 @@ void Logcat::ProcessBuffer(struct log_msg *buf) { modules_print_count_ += PrintLogLine(entry, modules_file_.get()); shortcut = true; } - if (verbose_ && (shortcut || buf->id() == log_id::LOG_ID_CRASH || entry.pid == my_pid_ || - tag == "Magisk"sv || tag == "LSPlt"sv || tag.starts_with("zygisk"sv) || - tag == "LSPlant"sv || tag.starts_with("LSPosed"sv))) [[unlikely]] { + if (verbose_ && + (shortcut || buf->id() == log_id::LOG_ID_CRASH || entry.pid == my_pid_ || + tag == "Dobby"sv || tag == "Magisk"sv || tag == "LSPlant"sv || tag == "LSPlt"sv || + tag.starts_with("LSPosed"sv) || tag.starts_with("zygisk"sv))) [[unlikely]] { verbose_print_count_ += PrintLogLine(entry, verbose_file_.get()); } if (entry.pid == my_pid_ && tag == "LSPosedLogcat"sv) [[unlikely]] { diff --git a/external/dobby b/external/dobby index 389938ae5e7..e430ce2f08a 160000 --- a/external/dobby +++ b/external/dobby @@ -1 +1 @@ -Subproject commit 389938ae5e7f2fbc45fc62f94a20192a29d37435 +Subproject commit e430ce2f08ab433093e05b38ee3da7cecb474575