You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
fix: compiling errors
This commit fixes compiling errors from missing declaration of variables and missing macros.
This commit is contained in:
@@ -103,7 +103,7 @@ void entry(int fd) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
int fd = read_fd(fd);
|
int client_fd = read_fd(fd);
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
LOGE("Failed to receive client fd\n");
|
LOGE("Failed to receive client fd\n");
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ void entry(int fd) {
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
args->fd = fd;
|
args->fd = client_fd;
|
||||||
args->entry = module_entry;
|
args->entry = module_entry;
|
||||||
|
|
||||||
LOGI("New companion request.\n - Module name: %.*s\n - Client fd: %d\n", (int)ret, name, args->fd);
|
LOGI("New companion request.\n - Module name: %.*s\n - Client fd: %d\n", (int)ret, name, args->fd);
|
||||||
|
|||||||
@@ -16,6 +16,48 @@
|
|||||||
__android_log_print(ANDROID_LOG_ERROR , lp_select("zygiskd32", "zygiskd64"), __VA_ARGS__); \
|
__android_log_print(ANDROID_LOG_ERROR , lp_select("zygiskd32", "zygiskd64"), __VA_ARGS__); \
|
||||||
printf(__VA_ARGS__);
|
printf(__VA_ARGS__);
|
||||||
|
|
||||||
|
#define ASSURE_SIZE_WRITE(area_name, subarea_name, sent_size, expected_size) \
|
||||||
|
if (sent_size != (ssize_t)(expected_size)) { \
|
||||||
|
LOGE("Failed to sent " subarea_name " in " area_name ": Expected %zu, got %zd\n", expected_size, sent_size); \
|
||||||
|
\
|
||||||
|
return; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ASSURE_SIZE_READ(area_name, subarea_name, sent_size, expected_size) \
|
||||||
|
if (sent_size != (ssize_t)(expected_size)) { \
|
||||||
|
LOGE("Failed to read " subarea_name " in " area_name ": Expected %zu, got %zd\n", expected_size, sent_size); \
|
||||||
|
\
|
||||||
|
return; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ASSURE_SIZE_WRITE_BREAK(area_name, subarea_name, sent_size, expected_size) \
|
||||||
|
if (sent_size != (ssize_t)(expected_size)) { \
|
||||||
|
LOGE("Failed to sent " subarea_name " in " area_name ": Expected %zu, got %zd\n", expected_size, sent_size); \
|
||||||
|
\
|
||||||
|
break; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ASSURE_SIZE_READ_BREAK(area_name, subarea_name, sent_size, expected_size) \
|
||||||
|
if (sent_size != (ssize_t)(expected_size)) { \
|
||||||
|
LOGE("Failed to read " subarea_name " in " area_name ": Expected %zu, got %zd\n", expected_size, sent_size); \
|
||||||
|
\
|
||||||
|
break; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ASSURE_SIZE_WRITE_WR(area_name, subarea_name, sent_size, expected_size) \
|
||||||
|
if (sent_size != (ssize_t)(expected_size)) { \
|
||||||
|
LOGE("Failed to sent " subarea_name " in " area_name ": Expected %zu, got %zd\n", expected_size, sent_size); \
|
||||||
|
\
|
||||||
|
return -1; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ASSURE_SIZE_READ_WR(area_name, subarea_name, sent_size, expected_size) \
|
||||||
|
if (sent_size != (ssize_t)(expected_size)) { \
|
||||||
|
LOGE("Failed to read " subarea_name " in " area_name ": Expected %zu, got %zd\n", expected_size, sent_size); \
|
||||||
|
\
|
||||||
|
return -1; \
|
||||||
|
}
|
||||||
|
|
||||||
#define write_func_def(type) \
|
#define write_func_def(type) \
|
||||||
ssize_t write_## type(int fd, type val)
|
ssize_t write_## type(int fd, type val)
|
||||||
|
|
||||||
|
|||||||
@@ -47,48 +47,6 @@ enum Architecture {
|
|||||||
#define ZYGISKD_FILE PATH_MODULES_DIR "/zygisksu/bin/zygiskd" lp_select("32", "64")
|
#define ZYGISKD_FILE PATH_MODULES_DIR "/zygisksu/bin/zygiskd" lp_select("32", "64")
|
||||||
#define ZYGISKD_PATH "/data/adb/modules/zygisksu/bin/zygiskd" lp_select("32", "64")
|
#define ZYGISKD_PATH "/data/adb/modules/zygisksu/bin/zygiskd" lp_select("32", "64")
|
||||||
|
|
||||||
#define ASSURE_SIZE_WRITE(area_name, subarea_name, sent_size, expected_size) \
|
|
||||||
if (sent_size != (ssize_t)(expected_size)) { \
|
|
||||||
LOGE("Failed to sent " subarea_name " in " area_name ": Expected %zu, got %zd\n", expected_size, sent_size); \
|
|
||||||
\
|
|
||||||
return; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ASSURE_SIZE_READ(area_name, subarea_name, sent_size, expected_size) \
|
|
||||||
if (sent_size != (ssize_t)(expected_size)) { \
|
|
||||||
LOGE("Failed to read " subarea_name " in " area_name ": Expected %zu, got %zd\n", expected_size, sent_size); \
|
|
||||||
\
|
|
||||||
return; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ASSURE_SIZE_WRITE_BREAK(area_name, subarea_name, sent_size, expected_size) \
|
|
||||||
if (sent_size != (ssize_t)(expected_size)) { \
|
|
||||||
LOGE("Failed to sent " subarea_name " in " area_name ": Expected %zu, got %zd\n", expected_size, sent_size); \
|
|
||||||
\
|
|
||||||
break; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ASSURE_SIZE_READ_BREAK(area_name, subarea_name, sent_size, expected_size) \
|
|
||||||
if (sent_size != (ssize_t)(expected_size)) { \
|
|
||||||
LOGE("Failed to read " subarea_name " in " area_name ": Expected %zu, got %zd\n", expected_size, sent_size); \
|
|
||||||
\
|
|
||||||
break; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ASSURE_SIZE_WRITE_WR(area_name, subarea_name, sent_size, expected_size) \
|
|
||||||
if (sent_size != (ssize_t)(expected_size)) { \
|
|
||||||
LOGE("Failed to sent " subarea_name " in " area_name ": Expected %zu, got %zd\n", expected_size, sent_size); \
|
|
||||||
\
|
|
||||||
return -1; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ASSURE_SIZE_READ_WR(area_name, subarea_name, sent_size, expected_size) \
|
|
||||||
if (sent_size != (ssize_t)(expected_size)) { \
|
|
||||||
LOGE("Failed to read " subarea_name " in " area_name ": Expected %zu, got %zd\n", expected_size, sent_size); \
|
|
||||||
\
|
|
||||||
return -1; \
|
|
||||||
}
|
|
||||||
|
|
||||||
static enum Architecture get_arch(void) {
|
static enum Architecture get_arch(void) {
|
||||||
char system_arch[32];
|
char system_arch[32];
|
||||||
get_property("ro.product.cpu.abi", system_arch);
|
get_property("ro.product.cpu.abi", system_arch);
|
||||||
@@ -785,7 +743,7 @@ void zygiskd_start(char *restrict argv[]) {
|
|||||||
}
|
}
|
||||||
case GetModuleDir: {
|
case GetModuleDir: {
|
||||||
size_t index = 0;
|
size_t index = 0;
|
||||||
read_size_t(client_fd, &index);
|
ssize_t ret = read_size_t(client_fd, &index);
|
||||||
ASSURE_SIZE_READ_BREAK("GetModuleDir", "index", ret, sizeof(index));
|
ASSURE_SIZE_READ_BREAK("GetModuleDir", "index", ret, sizeof(index));
|
||||||
|
|
||||||
char module_dir[PATH_MAX];
|
char module_dir[PATH_MAX];
|
||||||
|
|||||||
Reference in New Issue
Block a user