Fix magiskhide daemon enable/disable

This commit is contained in:
topjohnwu
2017-04-18 19:32:50 +08:00
parent 08527dde9b
commit e9afc15719
6 changed files with 58 additions and 38 deletions

View File

@@ -20,8 +20,10 @@ static void *logger_thread(void *args) {
// Disable buffering
setbuf(logfile, NULL);
// Start logcat
FILE *log_monitor = popen("logcat -s Magisk -v time", "r");
while (fgets(buffer, sizeof(buffer), log_monitor)) {
char *const command[] = { "logcat", "-s", "Magisk", "-v", "time", NULL };
int fd;
run_command(&fd, "/system/bin/logcat", command);
while (fdgets(buffer, sizeof(buffer), fd)) {
fprintf(logfile, "%s", buffer);
}
return NULL;

View File

@@ -37,7 +37,7 @@ static char *loopsetup(const char *img) {
char *mount_image(const char *img, const char *target) {
char *device = loopsetup(img);
if (device)
mount(device, target, "ext4", 0, NULL);
xmount(device, target, "ext4", 0, NULL);
return device;
}