Use magiskd to setup files

This commit is contained in:
topjohnwu
2021-08-18 03:44:32 -07:00
parent 003fea52b1
commit 9b3efffba9
6 changed files with 118 additions and 62 deletions

View File

@@ -158,6 +158,16 @@ void magisk_logging() {
log_cb.ex = nop_ex;
}
#define alog(prio) [](auto fmt, auto ap){ \
return __android_log_vprint(ANDROID_LOG_##prio, "Magisk", fmt, ap); }
void android_logging() {
log_cb.d = alog(DEBUG);
log_cb.i = alog(INFO);
log_cb.w = alog(WARN);
log_cb.e = alog(ERROR);
log_cb.ex = nop_ex;
}
void start_log_daemon() {
int fds[2];
if (pipe2(fds, O_CLOEXEC) == 0) {