Skip to content

Commit

Permalink
remove: unnecessary permanent logs in libzygisk.so
Browse files Browse the repository at this point in the history
This commit changes logs from LOGI to LOGD. This change is explained by the fact that libzygisk.so logs inside the app, which is easily detectable, and LOGI is not removed in release builds, where LOGD and LOGV are, being a better solution in the meanwhile.
  • Loading branch information
ThePedroo committed Dec 28, 2024
1 parent 4b5b590 commit 4e12e32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions loader/src/injector/entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ size_t block_size = 0;

extern "C" [[gnu::visibility("default")]]
void entry(void* addr, size_t size, const char* path) {
LOGI("Zygisk library injected, version %s", ZKSU_VERSION);
LOGD("Zygisk library injected, version %s", ZKSU_VERSION);
start_addr = addr;
block_size = size;
zygiskd::Init(path);
Expand All @@ -23,7 +23,7 @@ void entry(void* addr, size_t size, const char* path) {
logging::setfd(zygiskd::RequestLogcatFd());
#endif

LOGI("start plt hooking");
LOGD("start plt hooking");
hook_functions();
clean_trace(path, 1, 0, false);
}
4 changes: 2 additions & 2 deletions loader/src/injector/hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ DCL_HOOK_FUNC(int, pthread_attr_setstacksize, void *target, size_t size) {
// Because both `pthread_attr_setstacksize` and `dlclose` have the same function signature,
// we can use `musttail` to let the compiler reuse our stack frame and thus
// `dlclose` will directly return to the caller of `pthread_attr_setstacksize`.
LOGI("unmap libzygisk.so loaded at %p with size %zu", start_addr, block_size);
LOGD("unmap libzygisk.so loaded at %p with size %zu", start_addr, block_size);

[[clang::musttail]] return munmap(start_addr, block_size);
}
Expand Down Expand Up @@ -603,7 +603,7 @@ void ZygiskContext::app_specialize_pre() {
}

if ((info_flags & (PROCESS_IS_MANAGER | PROCESS_ROOT_IS_MAGISK)) == (PROCESS_IS_MANAGER | PROCESS_ROOT_IS_MAGISK)) {
LOGI("Manager process detected. Notifying that Zygisk has been enabled.");
LOGD("Manager process detected. Notifying that Zygisk has been enabled.");

setenv("ZYGISK_ENABLED", "1", 1);
} else {
Expand Down

0 comments on commit 4e12e32

Please sign in to comment.