mirror of
https://github.com/topjohnwu/Magisk.git
synced 2026-01-20 08:31:21 -08:00
Better bytes support in C++
This commit is contained in:
@@ -244,7 +244,9 @@ void MagiskInit::patch_ro_root() {
|
||||
int src = xopen("/init", O_RDONLY | O_CLOEXEC);
|
||||
mmap_data init("/init");
|
||||
// Force disable early mount on original init
|
||||
init.patch({ make_pair("android,fstab", "xxx") });
|
||||
for (size_t off : init.patch("android,fstab", "xxx")) {
|
||||
LOGD("Patch @ %08zX [android,fstab] -> [xxx]\n", off);
|
||||
}
|
||||
int dest = xopen(ROOTOVL "/init", O_CREAT | O_WRONLY | O_CLOEXEC, 0);
|
||||
xwrite(dest, init.buf(), init.sz());
|
||||
fclone_attr(src, dest);
|
||||
|
||||
Reference in New Issue
Block a user