From cfe3dc3d40de1d3c8af40cccc842faf2e38e0985 Mon Sep 17 00:00:00 2001 From: JingMatrix Date: Mon, 30 Dec 2024 12:31:26 +0100 Subject: [PATCH] Add debugging support for APatch `APatchD` is the log tag of APatch --- daemon/src/main/jni/logcat.cpp | 6 +++--- magisk-loader/build.gradle.kts | 13 +++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/daemon/src/main/jni/logcat.cpp b/daemon/src/main/jni/logcat.cpp index 0c3f837801d..8d98b5eb455 100644 --- a/daemon/src/main/jni/logcat.cpp +++ b/daemon/src/main/jni/logcat.cpp @@ -226,9 +226,9 @@ void Logcat::ProcessBuffer(struct log_msg *buf) { shortcut = true; } 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 == "SELinux"sv || - tag.starts_with("zygisk"sv))) [[unlikely]] { + tag == "APatchD"sv || tag == "Dobby"sv || tag == "Magisk"sv || + tag == "LSPlant"sv || tag == "LSPlt"sv || tag.starts_with("LSPosed"sv) || + tag == "SELinux"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/magisk-loader/build.gradle.kts b/magisk-loader/build.gradle.kts index 940c30c598d..cf3d0570782 100644 --- a/magisk-loader/build.gradle.kts +++ b/magisk-loader/build.gradle.kts @@ -296,6 +296,19 @@ fun afterEval() = android.applicationVariants.forEach { variant -> dependsOn(flashKsuTask) commandLine(adb, "shell", "su", "-c", "/system/bin/svc", "power", "reboot") } + val flashAPatchTask = task("flashAPatch${variantCapped}") { + group = "LSPosed" + dependsOn(pushTask) + commandLine( + adb, "shell", "su", "-c", + "apd module install /data/local/tmp/${zipFileName}" + ) + } + task("flashAPatchAndReboot${variantCapped}") { + group = "LSPosed" + dependsOn(flashAPatchTask) + commandLine(adb, "shell", "su", "-c", "/system/bin/svc", "power", "reboot") + } } afterEvaluate {