kernel: add CONFIG_KSU_DEBUG (#19)

* Kconfig: add KSU_DEBUG

* print alert on debug mode

* allow shell by default

* store signature to var on debug mode

* format

* export as module_param

* rename apk_sign to kernelsu
This commit is contained in:
Ylarod
2023-01-14 21:45:34 +08:00
committed by GitHub
parent 50f44fff9e
commit 5e77d1cd5b
5 changed files with 43 additions and 3 deletions

View File

@@ -181,7 +181,16 @@ void do_load_allow_list(struct work_struct *work)
fp = filp_open(KERNEL_SU_ALLOWLIST, O_RDONLY, 0);
if (IS_ERR(fp)) {
#ifdef CONFIG_KSU_DEBUG
int errno = PTR_ERR(fp);
if (errno == -ENOENT) {
ksu_allow_uid(2000, true); // allow adb shell by default
} else {
pr_err("load_allow_list open file failed: %d\n", PTR_ERR(fp));
}
#else
pr_err("load_allow_list open file failed: %d\n", PTR_ERR(fp));
#endif
return;
}