Don't let remote errors crash Zygisk

Fix #6095
This commit is contained in:
残页 2022-08-07 20:09:46 +08:00 committed by GitHub
parent 7357a35f8d
commit 52ba6d11bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -447,13 +447,13 @@ int connect_daemon(int req, bool create) {
break;
case MainResponse::ERROR:
LOGE("Daemon error\n");
exit(-1);
return -1;
case MainResponse::ROOT_REQUIRED:
LOGE("Root is required for this operation\n");
exit(-1);
return -1;
case MainResponse::ACCESS_DENIED:
LOGE("Access denied\n");
exit(-1);
return -1;
default:
__builtin_unreachable();
}

View File

@ -59,6 +59,7 @@ int remote_request_unmount();
inline int zygisk_request(int req) {
int fd = connect_daemon(MainRequest::ZYGISK);
if (fd < 0) return fd;
write_int(fd, req);
return fd;
}