Skip to content

Commit

Permalink
Fix terminal on android 8
Browse files Browse the repository at this point in the history
No need to handle untrusted_app_all_devpts on modern devices, but devpts policy is different for older devices.
  • Loading branch information
vvb2060 authored and topjohnwu committed Sep 25, 2021
1 parent ecd332c commit cb4361b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions native/jni/magiskpolicy/rules.cpp
Expand Up @@ -54,6 +54,14 @@ void sepolicy::magisk_rules() {
allow(SEPOL_CLIENT_DOMAIN, SEPOL_EXEC_TYPE, "file", ALL);
allow(SEPOL_CLIENT_DOMAIN, SEPOL_CLIENT_DOMAIN, ALL, ALL);

const char *pts[]{"devpts", "untrusted_app_devpts", "untrusted_app_25_devpts"};
for (auto type : pts) {
allow(SEPOL_CLIENT_DOMAIN, type, "chr_file", "getattr");
allow(SEPOL_CLIENT_DOMAIN, type, "chr_file", "read");
allow(SEPOL_CLIENT_DOMAIN, type, "chr_file", "write");
allow(SEPOL_CLIENT_DOMAIN, type, "chr_file", "ioctl");
}

// Allow these processes to access MagiskSU
vector<const char *> clients{ "init", "shell", "update_engine", "appdomain" };
for (auto type : clients) {
Expand Down

0 comments on commit cb4361b

Please sign in to comment.