You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
add: base for CMake building (non-working)
This commit will have a rebase soon.
This commit is contained in:
54
zygiskd/src/root_impl/common.c
Normal file
54
zygiskd/src/root_impl/common.c
Normal file
@@ -0,0 +1,54 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "kernelsu.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
static enum RootImpl ROOT_IMPL = None;
|
||||
|
||||
void root_impls_setup(void) {
|
||||
enum RootImplState ksu_version = ksu_get_kernel_su();
|
||||
|
||||
enum RootImpl impl = None;
|
||||
|
||||
if (ksu_version == Supported) impl = KernelSU;
|
||||
|
||||
ROOT_IMPL = impl;
|
||||
}
|
||||
|
||||
enum RootImpl get_impl(void) {
|
||||
return ROOT_IMPL;
|
||||
}
|
||||
|
||||
bool uid_granted_root(uid_t uid) {
|
||||
switch (get_impl()) {
|
||||
case KernelSU: {
|
||||
return ksu_uid_granted_root(uid);
|
||||
}
|
||||
default: {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool uid_should_umount(uid_t uid) {
|
||||
switch (get_impl()) {
|
||||
case KernelSU: {
|
||||
return ksu_uid_should_umount(uid);
|
||||
}
|
||||
default: {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool uid_is_manager(uid_t uid) {
|
||||
switch (get_impl()) {
|
||||
case KernelSU: {
|
||||
return ksu_uid_is_manager(uid);
|
||||
}
|
||||
default: {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user