mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-03 06:21:54 +00:00
Add systemless hosts support
This commit is contained in:
@@ -187,7 +187,7 @@ static void trim_img(const char *img) {
|
||||
void exec_common_script(const char* stage) {
|
||||
DIR *dir;
|
||||
struct dirent *entry;
|
||||
snprintf(buf, PATH_MAX, "%s/.core/%s.d", MOUNTPOINT, stage);
|
||||
snprintf(buf, PATH_MAX, "%s/%s.d", COREDIR, stage);
|
||||
|
||||
if (!(dir = opendir(buf)))
|
||||
return;
|
||||
@@ -677,6 +677,12 @@ void post_fs_data(int client) {
|
||||
LOGI("* Running module post-fs-data scripts\n");
|
||||
exec_module_script("post-fs-data");
|
||||
|
||||
// Systemless hosts
|
||||
if (access(HOSTSFILE, F_OK) == 0) {
|
||||
LOGI("* Enabling systemless hosts file support");
|
||||
bind_mount(HOSTSFILE, "/system/etc/hosts");
|
||||
}
|
||||
|
||||
// Start magiskhide if enabled
|
||||
char *hide_prop = getprop("persist.magisk.hide");
|
||||
if (hide_prop) {
|
||||
|
||||
Reference in New Issue
Block a user