Enable Zygisk

This commit is contained in:
topjohnwu
2021-09-15 01:59:43 -07:00
parent b6298f8602
commit 3b8ce85092
6 changed files with 26 additions and 6 deletions

View File

@ -26,7 +26,7 @@ int fd_pathat(int dirfd, const char *name, char *path, size_t size) {
return 0;
}
int mkdirs(string path, mode_t mode) {
int mkdirs(string_view path, mode_t mode) {
errno = 0;
for (char *p = path.data() + 1; *p; ++p) {
if (*p == '/') {
@ -420,7 +420,7 @@ void restore_folder(const char *dir, vector<raw_file> &files) {
for (raw_file &file : files) {
string path = base + "/" + file.path;
if (S_ISDIR(file.attr.st.st_mode)) {
mkdirs(path.data(), 0);
mkdirs(path, 0);
} else if (S_ISREG(file.attr.st.st_mode)) {
auto fp = xopen_file(path.data(), "we");
if (fp) fwrite(file.buf, 1, file.sz, fp.get());

View File

@ -32,7 +32,7 @@ struct raw_file {
ssize_t fd_path(int fd, char *path, size_t size);
int fd_pathat(int dirfd, const char *name, char *path, size_t size);
int mkdirs(std::string path, mode_t mode);
int mkdirs(std::string_view path, mode_t mode);
void rm_rf(const char *path);
void mv_path(const char *src, const char *dest);
void mv_dir(int src, int dest);

View File

@ -466,7 +466,7 @@ void *xmmap(void *addr, size_t length, int prot, int flags,
ssize_t xsendfile(int out_fd, int in_fd, off_t *offset, size_t count) {
ssize_t ret = sendfile(out_fd, in_fd, offset, count);
if (count != ret) {
if (ret < 0) {
PLOGE("sendfile");
}
return ret;