Add missing flags and move debug logging logic to libutils

This commit is contained in:
topjohnwu 2018-10-28 04:25:31 -04:00
parent 8ec3086cdd
commit 2efc423cf8
6 changed files with 9 additions and 4 deletions

View File

@ -18,7 +18,6 @@
#include "utils.h"
#include "daemon.h"
#include "selinux.h"
#include "flags.h"
int setup_done = 0;
int seperate_vendor = 0;
@ -103,9 +102,6 @@ static void *request_handler(void *args) {
static void main_daemon() {
android_logging();
#ifndef MAGISK_DEBUG
log_cb.d = nop_log;
#endif
setsid();
setcon("u:r:"SEPOL_PROC_DOMAIN":s0");
int fd = xopen("/dev/null", O_RDWR | O_CLOEXEC);

View File

@ -9,6 +9,7 @@
#include "magiskboot.h"
#include "logging.h"
#include "utils.h"
#include "flags.h"
/********************
Patch Boot Image

View File

@ -15,6 +15,7 @@
#include "magiskhide.h"
#include "daemon.h"
#include "resetprop.h"
#include "flags.h"
struct vector *hide_list = NULL;

View File

@ -10,6 +10,7 @@
#include "vector.h"
#include "magiskpolicy.h"
#include "magisk.h"
#include "flags.h"
static int syntax_err = 0;
static char err_msg[ARG_MAX];

View File

@ -22,6 +22,7 @@
#include "_resetprop.h"
#include "vector.h"
#include "utils.h"
#include "flags.h"
int prop_verbose = 0;

View File

@ -3,6 +3,7 @@
#include <android/log.h>
#include "logging.h"
#include "flags.h"
int nop_log(const char *fmt, va_list ap) {
return 0;
@ -45,7 +46,11 @@ static int log_e(const char *fmt, va_list ap) {
}
void android_logging() {
#ifdef MAGISK_DEBUG
log_cb.d = log_d;
#else
log_cb.d = nop_log;
#endif
log_cb.i = log_i;
log_cb.w = log_w;
log_cb.e = log_e;