Update to Google CTS (2017.7.17)

This commit is contained in:
topjohnwu 2017-07-18 12:26:23 +08:00
parent 5b36b4472c
commit 9c1005ff0c
4 changed files with 16 additions and 4 deletions

View File

@ -58,6 +58,17 @@ void hide_sensitive_props() {
} }
} }
static void rm_magisk_prop(const char *name) {
if (strstr(name, "magisk")) {
deleteprop(name, 0);
}
}
void clean_magisk_props() {
LOGD("hide_utils: Cleaning magisk props\n");
getprop_all(rm_magisk_prop);
}
void relink_sbin() { void relink_sbin() {
struct stat st; struct stat st;
if (stat("/sbin_orig", &st) == -1 && errno == ENOENT) { if (stat("/sbin_orig", &st) == -1 && errno == ENOENT) {

View File

@ -55,10 +55,7 @@ void launch_magiskhide(int client) {
hideEnabled = 1; hideEnabled = 1;
LOGI("* Starting MagiskHide\n"); LOGI("* Starting MagiskHide\n");
if (client > 0) { deleteprop(MAGISKHIDE_PROP, 1);
if (setprop(MAGISKHIDE_PROP, "1"))
goto error;
}
hide_sensitive_props(); hide_sensitive_props();
@ -104,6 +101,8 @@ void stop_magiskhide(int client) {
hideEnabled = 0; hideEnabled = 0;
setprop(MAGISKHIDE_PROP, "0"); setprop(MAGISKHIDE_PROP, "0");
// Remove without actually removing persist props
deleteprop(MAGISKHIDE_PROP, 0);
pthread_kill(proc_monitor_thread, SIGUSR1); pthread_kill(proc_monitor_thread, SIGUSR1);
write_int(client, DAEMON_SUCCESS); write_int(client, DAEMON_SUCCESS);

View File

@ -13,6 +13,7 @@ void proc_monitor();
void manage_selinux(); void manage_selinux();
void hide_sensitive_props(); void hide_sensitive_props();
void relink_sbin(); void relink_sbin();
void clean_magisk_props();
// List managements // List managements
int add_list(char *proc); int add_list(char *proc);

View File

@ -91,6 +91,7 @@ static void hide_daemon(int pid) {
manage_selinux(); manage_selinux();
relink_sbin(); relink_sbin();
clean_magisk_props();
if (switch_mnt_ns(pid)) if (switch_mnt_ns(pid))
return; return;