You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
add: zygiskd C99 APatch support
This commit adds support for zygiskd C99 to recognize APatch rooted devices.
This commit is contained in:
@@ -1,19 +1,16 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "kernelsu.h"
|
||||
#include "apatch.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;
|
||||
if (ksu_get_existence() == Supported) ROOT_IMPL = KernelSU;
|
||||
else if (apatch_get_existence() == Supported) ROOT_IMPL = APatch;
|
||||
else ROOT_IMPL = None;
|
||||
}
|
||||
|
||||
enum RootImpl get_impl(void) {
|
||||
@@ -21,34 +18,43 @@ enum RootImpl get_impl(void) {
|
||||
}
|
||||
|
||||
bool uid_granted_root(uid_t uid) {
|
||||
switch (get_impl()) {
|
||||
case KernelSU: {
|
||||
// switch (get_impl()) {
|
||||
// case KernelSU: {
|
||||
return ksu_uid_granted_root(uid);
|
||||
}
|
||||
default: {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// }
|
||||
// case APatch: {
|
||||
// return apatch_uid_granted_root(uid);
|
||||
// }
|
||||
// default: {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
bool uid_should_umount(uid_t uid) {
|
||||
switch (get_impl()) {
|
||||
case KernelSU: {
|
||||
// switch (get_impl()) {
|
||||
// case KernelSU: {
|
||||
return ksu_uid_should_umount(uid);
|
||||
}
|
||||
default: {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// }
|
||||
// case APatch: {
|
||||
// return apatch_uid_should_umount(uid);
|
||||
// }
|
||||
// default: {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
bool uid_is_manager(uid_t uid) {
|
||||
switch (get_impl()) {
|
||||
case KernelSU: {
|
||||
// switch (get_impl()) {
|
||||
// case KernelSU: {
|
||||
return ksu_uid_is_manager(uid);
|
||||
}
|
||||
default: {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// }
|
||||
// case APatch: {
|
||||
// return apatch_uid_is_manager(uid);
|
||||
// }
|
||||
// default: {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user