Skip to content

Commit

Permalink
remove: non-working info in zygisk-ptraceXX info response
Browse files Browse the repository at this point in the history
This commit removes information given in the response of info command of "zygisk-ptrace64" or "zygisk-ptrace32" that leads to failing builds, as it is not exported from monitor.cpp.
  • Loading branch information
ThePedroo committed Nov 11, 2024
1 parent b1d118d commit f356808
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 105 deletions.
33 changes: 0 additions & 33 deletions loader/src/ptracer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,39 +82,6 @@ int main(int argc, char **argv) {
}
}

#ifdef __LP64__
printf("Daemon64 running: %d\n", status64.daemon_running);
printf("Zygote64 injected: %s\n", status64.zygote_injected ? "yes" : "no");
#else
printf("Daemon32 running: %s\n", status32.daemon_running ? "yes" : "no");
printf("Zygote32 injected: %s\n", status32.zygote_injected ? "yes" : "no");
#endif

switch (tracing_state) {
case TRACING: {
printf("Tracing state: TRACING\n");

break;
}
case STOPPING: {
printf("Tracing state: STOPPING\n");
printf("Stop reason: %s\n", monitor_stop_reason);

break;
}
case STOPPED: {
printf("Tracing state: STOPPED\n");
printf("Stop reason: %s\n", monitor_stop_reason);

break;
}
case EXITING: {
printf("Tracing state: EXITING\n");

break;
}
}

if (info.modules->modules_count != 0) {
printf("Modules: %zu\n", info.modules->modules_count);

Expand Down
72 changes: 0 additions & 72 deletions loader/src/ptracer/monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,77 +744,6 @@ static void updateStatus() {
fprintf(prop, "%s[%s] %s", pre_section, status_text, post_section);

fclose(prop);

struct zygote_info info;
zygiskd::GetInfo(&info);

/* TODO: Perhaps change to binary reading and writing? */
FILE *fd_state = fopen("/data/adb/rezygisk/state.json", "w");
if (fd_state == NULL) {
PLOGE("failed to open state.json");

return;
}

fprintf(fd_state, "{\n"
" \"tracing_state\": %d,\n"
" \"status64\": {\n"
" \"supported\": %d,\n"
" \"zygote_injected\": %d,\n"
" \"daemon_running\": %d,\n"
" \"daemon_pid\": %d,\n"
" \"daemon_info\": \"%s\",\n"
" \"daemon_error_info\": \"%s\"\n"
" },\n"
" \"status32\": {\n"
" \"supported\": %d,\n"
" \"zygote_injected\": %d,\n"
" \"daemon_running\": %d,\n"
" \"daemon_pid\": %d,\n"
" \"daemon_info\": \"%s\",\n"
" \"daemon_error_info\": \"%s\"\n"
" },\n"
" \"modules_info\": {\n"
" \"amount\": %d,\n",
tracing_state,

status64.supported,
status64.zygote_injected,
status64.daemon_running,
status64.daemon_pid,
status64.daemon_info,
status64.daemon_error_info,

status32.supported,
status32.zygote_injected,
status32.daemon_running,
status32.daemon_pid,
status32.daemon_info,
status32.daemon_error_info,

info.modules->modules_count);

if (info.modules->modules_count != 0) {
fprintf(fd_state, " \"modules\": [\n");

for (int i = 0; i < info.modules->modules_count; i++) {
fprintf(fd_state, " \"%s\"%s\n",
info.modules->modules[i],
i == info.modules->modules_count - 1 ? "" : ",");

free(info.modules->modules[i]);
}

fprintf(fd_state, " ]\n");

free(info.modules->modules);
} else {
fprintf(fd_state, " \"modules\": []\n");
}

fprintf(fd_state, "}\n");

fclose(fd_state);
}

static bool prepare_environment() {
Expand Down Expand Up @@ -850,7 +779,6 @@ static bool prepare_environment() {

/* TODO: See if ZYGISK_ENABLED flag is already set,
if so, set a status saying to disable built-in Zygisk. */
A
updateStatus();

return true;
Expand Down

0 comments on commit f356808

Please sign in to comment.