Use preprocessor for 64bit detection

This commit is contained in:
topjohnwu 2025-01-10 23:42:24 +08:00 committed by John Wu
parent 7c1d2ec61e
commit 049db49dc8
2 changed files with 10 additions and 2 deletions

View File

@ -39,7 +39,11 @@ int remote_get_info(int uid, const char *process, uint32_t *flags, vector<int> &
if (int fd = zygisk_request(ZygiskRequest::GET_INFO); fd >= 0) {
write_int(fd, uid);
write_string(fd, process);
write_int(fd, sizeof(void*) == 8 ? 1 : 0);
#ifdef __LP64__
write_int(fd, 1);
#else
write_int(fd, 0);
#endif
xxread(fd, flags, sizeof(*flags));
if (should_load_modules(*flags)) {
fds = recv_fds(fd);

View File

@ -78,7 +78,11 @@ bool ZygiskModule::valid() const {
int ZygiskModule::connectCompanion() const {
if (int fd = zygisk_request(ZygiskRequest::CONNECT_COMPANION); fd >= 0) {
write_int(fd, sizeof(void*) == 8 ? 1 : 0);
#ifdef __LP64__
write_int(fd, 1);
#else
write_int(fd, 0);
#endif
write_int(fd, id);
return fd;
}