diff --git a/.gitmodules b/.gitmodules index c47499f1..c5eacef1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ [submodule "external/lsplant"] path = external/lsplant url = https://github.com/JingMatrix/LSPlant.git -[submodule "external/dobby"] - path = external/dobby - url = https://github.com/chiteroman/Dobby.git +[submodule "external/lsplt"] + path = external/lsplt + url = https://github.com/LSPosed/LSPlt [submodule "external/fmt"] path = external/fmt url = https://github.com/fmtlib/fmt.git diff --git a/README.md b/README.md index 1421f00f..4731d132 100644 --- a/README.md +++ b/README.md @@ -58,9 +58,10 @@ You can contribute translation [here](https://crowdin.com/project/lsposed_jingma - [Magisk](https://github.com/topjohnwu/Magisk/): makes all these possible - [Riru](https://github.com/RikkaApps/Riru): provides a way to inject code into zygote process - [XposedBridge](https://github.com/rovo89/XposedBridge): the OG Xposed framework APIs -- [Dobby](https://github.com/chiteroman/Dobby): used for inline hooking +- [LSPlt](https://github.com/LSPosed/LSPlt): used for inline hooking - [LSPlant](https://github.com/JingMatrix/LSPlant): the core ART hooking framework - [EdXposed](https://github.com/ElderDrivers/EdXposed): fork source +- ~[Dobby](https://github.com/chiteroman/Dobby): used for inline hooking~ - ~[SandHook](https://github.com/ganyao114/SandHook/): ART hooking framework for SandHook variant~ - ~[YAHFA](https://github.com/rk700/YAHFA): previous ART hooking framework~ - ~[dexmaker](https://github.com/linkedin/dexmaker) and [dalvikdx](https://github.com/JakeWharton/dalvik-dx): to dynamically generate YAHFA hooker classes~ diff --git a/core/src/main/jni/CMakeLists.txt b/core/src/main/jni/CMakeLists.txt index 03113fe5..62e5b150 100644 --- a/core/src/main/jni/CMakeLists.txt +++ b/core/src/main/jni/CMakeLists.txt @@ -12,5 +12,5 @@ add_library(${PROJECT_NAME} STATIC ${SRC_LIST}) target_include_directories(${PROJECT_NAME} PUBLIC include) target_include_directories(${PROJECT_NAME} PRIVATE src) -target_link_libraries(${PROJECT_NAME} PUBLIC dobby_static lsplant_static log fmt-header-only) +target_link_libraries(${PROJECT_NAME} PUBLIC lsplt_static lsplant_static log fmt-header-only) target_link_libraries(${PROJECT_NAME} PRIVATE dex_builder_static) diff --git a/core/src/main/jni/include/native_util.h b/core/src/main/jni/include/native_util.h index a78c62f0..5f06e441 100644 --- a/core/src/main/jni/include/native_util.h +++ b/core/src/main/jni/include/native_util.h @@ -19,7 +19,6 @@ */ #include -#include "dobby.h" #include #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-value" @@ -83,7 +82,8 @@ inline int HookFunction(void *original, void *replace, void **backup) { info.dli_sname ? info.dli_sname : "(unknown symbol)", info.dli_saddr, info.dli_fname ? info.dli_fname : "(unknown file)", info.dli_fbase); } - return DobbyHook(original, reinterpret_cast(replace), reinterpret_cast(backup)); + /* return DobbyHook(original, reinterpret_cast(replace), reinterpret_cast(backup)); */ + return 1; } inline int UnhookFunction(void *original) { @@ -94,7 +94,8 @@ inline int UnhookFunction(void *original) { info.dli_sname ? info.dli_sname : "(unknown symbol)", info.dli_saddr, info.dli_fname ? info.dli_fname : "(unknown file)", info.dli_fbase); } - return DobbyDestroy(original); + /* return DobbyDestroy(original); */ + return 1; } inline std::string GetNativeBridgeSignature() { diff --git a/core/src/main/jni/src/native_api.cpp b/core/src/main/jni/src/native_api.cpp index 01ffaaa9..ca148045 100644 --- a/core/src/main/jni/src/native_api.cpp +++ b/core/src/main/jni/src/native_api.cpp @@ -26,7 +26,6 @@ #include "logging.h" #include "utils/hook_helper.hpp" #include -#include #include #include #include "native_util.h" diff --git a/core/src/main/jni/src/symbol_cache.cpp b/core/src/main/jni/src/symbol_cache.cpp index 4c35d018..826333f8 100644 --- a/core/src/main/jni/src/symbol_cache.cpp +++ b/core/src/main/jni/src/symbol_cache.cpp @@ -24,7 +24,6 @@ #include "symbol_cache.h" #include "elf_util.h" -#include #include "macros.h" #include "config.h" #include diff --git a/daemon/src/main/jni/logcat.cpp b/daemon/src/main/jni/logcat.cpp index 1dffc263..af5aeb73 100644 --- a/daemon/src/main/jni/logcat.cpp +++ b/daemon/src/main/jni/logcat.cpp @@ -225,7 +225,7 @@ void Logcat::ProcessBuffer(struct log_msg *buf) { shortcut = true; } if (verbose_ && (shortcut || buf->id() == log_id::LOG_ID_CRASH || - entry.pid == my_pid_ || tag == "Magisk"sv || tag == "Dobby"sv || + entry.pid == my_pid_ || tag == "Magisk"sv || tag == "LSPlt"sv || tag.starts_with("Riru"sv) || tag.starts_with("zygisk"sv) || tag == "LSPlant"sv || tag.starts_with("LSPosed"sv))) [[unlikely]] { verbose_print_count_ += PrintLogLine(entry, verbose_file_.get()); diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index dacff51f..52b67d1e 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -103,7 +103,8 @@ target_include_directories(cxx PRIVATE ${LIBCXX_INCLUDES} ${LIBCXXABI_INCLUDES}) link_libraries(cxx) OPTION(LSPLANT_BUILD_SHARED OFF) +OPTION(LSPLT_BUILD_SHARED OFF) add_subdirectory(lsplant/lsplant/src/main/jni) -add_subdirectory(dobby) +add_subdirectory(lsplt/lsplt/src/main/jni) add_subdirectory(fmt) target_compile_definitions(fmt-header-only INTERFACE FMT_STATIC_THOUSANDS_SEPARATOR=1 FMT_USE_FLOAT=0 FMT_USE_DOUBLE=0 FMT_USE_LONG_DOUBLE=0) diff --git a/external/dobby b/external/dobby deleted file mode 160000 index 7447fd92..00000000 --- a/external/dobby +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7447fd9209bb43eba1e307f84df17613af5203dd diff --git a/external/lsplt b/external/lsplt new file mode 160000 index 00000000..cef80a97 --- /dev/null +++ b/external/lsplt @@ -0,0 +1 @@ +Subproject commit cef80a97a73184b4def9b3e1148884365fc173fd diff --git a/magisk-loader/src/main/jni/src/service.cpp b/magisk-loader/src/main/jni/src/service.cpp index 109553b8..a129a172 100644 --- a/magisk-loader/src/main/jni/src/service.cpp +++ b/magisk-loader/src/main/jni/src/service.cpp @@ -21,7 +21,6 @@ // Created by loves on 2/7/2021. // -#include #include #include #include