Skip to content

Commit

Permalink
Fix logs generated by LSPosed manager
Browse files Browse the repository at this point in the history
1. Update Dobby to set log TAG properly
2. Fix log preference settings for debug version
  • Loading branch information
JingMatrix committed Dec 7, 2024
1 parent 6eb133b commit 98565cf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
7 changes: 4 additions & 3 deletions daemon/src/main/jni/logcat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]] {
Expand Down

0 comments on commit 98565cf

Please sign in to comment.