You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
fix: merge conflicts
This commit fixes merge conflicts while merging to main.
This commit is contained in:
@@ -53,7 +53,7 @@ androidComponents.onVariants { variant ->
|
|||||||
into(moduleDir)
|
into(moduleDir)
|
||||||
from("${rootProject.projectDir}/README.md")
|
from("${rootProject.projectDir}/README.md")
|
||||||
from("$projectDir/src") {
|
from("$projectDir/src") {
|
||||||
exclude("module.prop", "customize.sh", "post-fs-data.sh", "service.sh", "uninstall.sh", "mazoku")
|
exclude("module.prop", "customize.sh", "post-fs-data.sh", "service.sh", "uninstall.sh")
|
||||||
filter<FixCrLfFilter>("eol" to FixCrLfFilter.CrLf.newInstance("lf"))
|
filter<FixCrLfFilter>("eol" to FixCrLfFilter.CrLf.newInstance("lf"))
|
||||||
}
|
}
|
||||||
from("$projectDir/src") {
|
from("$projectDir/src") {
|
||||||
@@ -65,7 +65,6 @@ androidComponents.onVariants { variant ->
|
|||||||
"versionCode" to verCode
|
"versionCode" to verCode
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
from("$projectDir/src/mazoku")
|
|
||||||
from("$projectDir/src") {
|
from("$projectDir/src") {
|
||||||
include("customize.sh", "post-fs-data.sh", "service.sh", "uninstall.sh")
|
include("customize.sh", "post-fs-data.sh", "service.sh", "uninstall.sh")
|
||||||
val tokens = mapOf(
|
val tokens = mapOf(
|
||||||
@@ -122,7 +121,6 @@ androidComponents.onVariants { variant ->
|
|||||||
set.add(Pair(root.file("sepolicy.rule").asFile, null))
|
set.add(Pair(root.file("sepolicy.rule").asFile, null))
|
||||||
set.add(Pair(root.file("post-fs-data.sh").asFile, null))
|
set.add(Pair(root.file("post-fs-data.sh").asFile, null))
|
||||||
set.add(Pair(root.file("service.sh").asFile, null))
|
set.add(Pair(root.file("service.sh").asFile, null))
|
||||||
set.add(Pair(root.file("mazoku").asFile, null))
|
|
||||||
set.add(
|
set.add(
|
||||||
Pair(
|
Pair(
|
||||||
root.file("lib/libzygisk.so").asFile,
|
root.file("lib/libzygisk.so").asFile,
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ extract "$ZIPFILE" 'module.prop' "$MODPATH"
|
|||||||
extract "$ZIPFILE" 'post-fs-data.sh' "$MODPATH"
|
extract "$ZIPFILE" 'post-fs-data.sh' "$MODPATH"
|
||||||
extract "$ZIPFILE" 'service.sh' "$MODPATH"
|
extract "$ZIPFILE" 'service.sh' "$MODPATH"
|
||||||
extract "$ZIPFILE" 'uninstall.sh' "$MODPATH"
|
extract "$ZIPFILE" 'uninstall.sh' "$MODPATH"
|
||||||
extract "$ZIPFILE" 'mazoku' "$MODPATH"
|
|
||||||
mv "$TMPDIR/sepolicy.rule" "$MODPATH"
|
mv "$TMPDIR/sepolicy.rule" "$MODPATH"
|
||||||
|
|
||||||
mkdir "$MODPATH/bin"
|
mkdir "$MODPATH/bin"
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
c<EFBFBD><EFBFBD><EFBFBD>]<5D><> <20>[{ڭ<11>B<EFBFBD>u<EFBFBD>5=<3D>rEU<45>Z<>ʿ<EFBFBD><CABF><<3C>5<EFBFBD>_o<><6F>M<>L<>l<EFBFBD><6C><EFBFBD>Q#<23><><EFBFBD>C<EFBFBD>}<7D> e<><65>fjق/<2F>7<EFBFBD><11><>(<28><>g<b<>Rg<07>m<EFBFBD>d
|
|
||||||
@@ -9,6 +9,7 @@ allow zygote su dir search
|
|||||||
allow zygote su {lnk_file file} read
|
allow zygote su {lnk_file file} read
|
||||||
|
|
||||||
allow zygote adb_data_file dir search
|
allow zygote adb_data_file dir search
|
||||||
|
allow zygote adb_data_file file *
|
||||||
allow zygote zygote process execmem
|
allow zygote zygote process execmem
|
||||||
allow system_server system_server process execmem
|
allow system_server system_server process execmem
|
||||||
allow zygote tmpfs file *
|
allow zygote tmpfs file *
|
||||||
|
|||||||
@@ -30,53 +30,36 @@ char *magisk_managers[] = {
|
|||||||
|
|
||||||
enum magisk_variants variant = Official;
|
enum magisk_variants variant = Official;
|
||||||
/* INFO: Longest path */
|
/* INFO: Longest path */
|
||||||
static char path_to_magisk[sizeof(DEBUG_RAMDISK_MAGISK)];
|
static char path_to_magisk[sizeof(DEBUG_RAMDISK_MAGISK)] = { 0 };
|
||||||
bool is_using_sulist = false;
|
bool is_using_sulist = false;
|
||||||
|
|
||||||
void magisk_get_existence(struct root_impl_state *state) {
|
void magisk_get_existence(struct root_impl_state *state) {
|
||||||
struct stat s;
|
const char *magisk_files[] = {
|
||||||
if (stat(SBIN_MAGISK, &s) != 0) {
|
SBIN_MAGISK,
|
||||||
if (errno != ENOENT) {
|
BITLESS_SBIN_MAGISK,
|
||||||
LOGE("Failed to stat Magisk /sbin/magisk binary: %s\n", strerror(errno));
|
DEBUG_RAMDISK_MAGISK,
|
||||||
}
|
BITLESS_DEBUG_RAMDISK_MAGISK
|
||||||
errno = 0;
|
};
|
||||||
|
|
||||||
if (stat(BITLESS_SBIN_MAGISK, &s) != 0) {
|
for (size_t i = 0; i < sizeof(magisk_files) / sizeof(magisk_files[0]); i++) {
|
||||||
|
if (access(magisk_files[i], F_OK) != 0) {
|
||||||
if (errno != ENOENT) {
|
if (errno != ENOENT) {
|
||||||
LOGE("Failed to stat Magisk %s binary: %s\n", BITLESS_SBIN_MAGISK, strerror(errno));
|
LOGE("Failed to access Magisk binary: %s\n", strerror(errno));
|
||||||
}
|
}
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
|
||||||
if (stat(DEBUG_RAMDISK_MAGISK, &s) != 0) {
|
continue;
|
||||||
if (errno != ENOENT) {
|
|
||||||
LOGE("Failed to stat Magisk %s binary: %s\n", DEBUG_RAMDISK_MAGISK, strerror(errno));
|
|
||||||
}
|
|
||||||
errno = 0;
|
|
||||||
|
|
||||||
if (stat(BITLESS_DEBUG_RAMDISK_MAGISK, &s) != 0) {
|
|
||||||
if (errno != ENOENT) {
|
|
||||||
LOGE("Failed to stat Magisk /debug_ramdisk/magisk binary: %s\n", strerror(errno));
|
|
||||||
}
|
|
||||||
errno = 0;
|
|
||||||
|
|
||||||
state->state = Inexistent;
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* INFO: /debug_ramdisk/magisk64 (or 32) doesn't exist but /debug_ramdisk/magisk does */
|
|
||||||
strcpy(path_to_magisk, BITLESS_DEBUG_RAMDISK_MAGISK);
|
|
||||||
} else {
|
|
||||||
/* INFO: /sbin/magisk doesn't exist but /debug_ramdisk/magisk does */
|
|
||||||
strcpy(path_to_magisk, DEBUG_RAMDISK_MAGISK);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* INFO: /sbin/magisk64 (or 32) doesn't exist but /sbin/magisk does */
|
|
||||||
strcpy(path_to_magisk, BITLESS_SBIN_MAGISK);
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
/* INFO: /sbin/magisk64 (or 32) exists */
|
strcpy(path_to_magisk, magisk_files[i]);
|
||||||
strcpy(path_to_magisk, SBIN_MAGISK);
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (path_to_magisk[0] == '\0') {
|
||||||
|
state->state = Inexistent;
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *argv[4] = { "magisk", "-v", NULL, NULL };
|
char *argv[4] = { "magisk", "-v", NULL, NULL };
|
||||||
|
|||||||
@@ -358,7 +358,7 @@ bool exec_command(char *restrict buf, size_t len, const char *restrict file, cha
|
|||||||
dup2(link[1], STDOUT_FILENO);
|
dup2(link[1], STDOUT_FILENO);
|
||||||
close(link[0]);
|
close(link[0]);
|
||||||
close(link[1]);
|
close(link[1]);
|
||||||
|
|
||||||
execv(file, argv);
|
execv(file, argv);
|
||||||
|
|
||||||
LOGE("execv failed: %s\n", strerror(errno));
|
LOGE("execv failed: %s\n", strerror(errno));
|
||||||
@@ -626,7 +626,7 @@ enum mns_umount_state unmount_root(bool modules_only, struct root_impl impl) {
|
|||||||
char source_name[LONGEST_ROOT_IMPL_NAME];
|
char source_name[LONGEST_ROOT_IMPL_NAME];
|
||||||
if (impl.impl == KernelSU) strcpy(source_name, "KSU");
|
if (impl.impl == KernelSU) strcpy(source_name, "KSU");
|
||||||
else strcpy(source_name, "APatch");
|
else strcpy(source_name, "APatch");
|
||||||
|
|
||||||
const char **targets_to_unmount = NULL;
|
const char **targets_to_unmount = NULL;
|
||||||
size_t num_targets = 0;
|
size_t num_targets = 0;
|
||||||
|
|
||||||
@@ -639,6 +639,8 @@ enum mns_umount_state unmount_root(bool modules_only, struct root_impl impl) {
|
|||||||
if (strncmp(mount.target, "/debug_ramdisk", strlen("/debug_ramdisk")) == 0)
|
if (strncmp(mount.target, "/debug_ramdisk", strlen("/debug_ramdisk")) == 0)
|
||||||
should_unmount = true;
|
should_unmount = true;
|
||||||
} else {
|
} else {
|
||||||
|
if (strncmp(mount.target, "/system/", strlen("/system/")) == 0) continue;
|
||||||
|
|
||||||
if (strcmp(mount.source, source_name) == 0) should_unmount = true;
|
if (strcmp(mount.source, source_name) == 0) should_unmount = true;
|
||||||
if (strncmp(mount.root, "/adb/modules", strlen("/adb/modules")) == 0) should_unmount = true;
|
if (strncmp(mount.root, "/adb/modules", strlen("/adb/modules")) == 0) should_unmount = true;
|
||||||
if (strncmp(mount.target, "/data/adb/modules", strlen("/data/adb/modules")) == 0) should_unmount = true;
|
if (strncmp(mount.target, "/data/adb/modules", strlen("/data/adb/modules")) == 0) should_unmount = true;
|
||||||
@@ -675,7 +677,7 @@ enum mns_umount_state unmount_root(bool modules_only, struct root_impl impl) {
|
|||||||
}
|
}
|
||||||
case Magisk: {
|
case Magisk: {
|
||||||
LOGI("[Magisk] Unmounting root %s modules\n", modules_only ? "only" : "with");
|
LOGI("[Magisk] Unmounting root %s modules\n", modules_only ? "only" : "with");
|
||||||
|
|
||||||
const char **targets_to_unmount = NULL;
|
const char **targets_to_unmount = NULL;
|
||||||
size_t num_targets = 0;
|
size_t num_targets = 0;
|
||||||
|
|
||||||
@@ -683,27 +685,18 @@ enum mns_umount_state unmount_root(bool modules_only, struct root_impl impl) {
|
|||||||
struct mountinfo mount = mounts.mounts[i];
|
struct mountinfo mount = mounts.mounts[i];
|
||||||
|
|
||||||
bool should_unmount = false;
|
bool should_unmount = false;
|
||||||
if (
|
if (modules_only) {
|
||||||
(
|
if (strcmp(mount.source, "magisk") == 0) should_unmount = true;
|
||||||
modules_only &&
|
if (strncmp(mount.target, "/debug_ramdisk", strlen("/debug_ramdisk")) == 0) should_unmount = true;
|
||||||
(
|
if (strncmp(mount.target, "/system/bin", strlen("/system/bin")) == 0) should_unmount = true;
|
||||||
strcmp(mount.source, "magisk") == 0 ||
|
} else {
|
||||||
strncmp(mount.target, "/debug_ramdisk", strlen("/debug_ramdisk")) == 0 ||
|
if (strncmp(mount.target, "/system/", strlen("/system/")) == 0) continue;
|
||||||
strncmp(mount.target, "/system/bin", strlen("/system/bin")) == 0
|
|
||||||
)
|
if (strcmp(mount.source, "magisk") == 0) should_unmount = true;
|
||||||
) ||
|
if (strncmp(mount.target, "/debug_ramdisk", strlen("/debug_ramdisk")) == 0) should_unmount = true;
|
||||||
(
|
if (strncmp(mount.target, "/data/adb/modules", strlen("/data/adb/modules")) == 0) should_unmount = true;
|
||||||
!modules_only &&
|
if (strncmp(mount.root, "/adb/modules", strlen("/adb/modules")) == 0) should_unmount = true;
|
||||||
(
|
if (strncmp(mount.target, "/system/bin", strlen("/system/bin")) == 0) should_unmount = true;
|
||||||
strcmp(mount.source, "magisk") == 0 ||
|
|
||||||
strncmp(mount.target, "/debug_ramdisk", strlen("/debug_ramdisk")) == 0 ||
|
|
||||||
strncmp(mount.target, "/data/adb/modules", strlen("/data/adb/modules")) == 0 ||
|
|
||||||
strncmp(mount.root, "/adb/modules", strlen("/adb/modules")) == 0 ||
|
|
||||||
strncmp(mount.target, "/system/bin", strlen("/system/bin")) == 0
|
|
||||||
)
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
should_unmount = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!should_unmount) continue;
|
if (!should_unmount) continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user