-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Expand file tree
/
Copy pathksu.h
More file actions
57 lines (36 loc) · 999 Bytes
/
Copy pathksu.h
File metadata and controls
57 lines (36 loc) · 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// Created by weishu on 2022/12/9.
//
#ifndef KERNELSU_KSU_H
#define KERNELSU_KSU_H
#include <cstdint>
#include <sys/ioctl.h>
#include <sys/prctl.h>
#include <utility>
#include "uapi/ksu.h"
bool is_uapi_version_mismatch();
uint32_t get_version();
bool uid_should_umount(int uid);
bool is_safe_mode();
bool is_lkm_mode();
bool is_late_load_mode();
bool is_manager();
bool is_pr_build();
using p_key_t = char[KSU_MAX_PACKAGE_NAME];
bool set_app_profile(const app_profile *profile);
int get_app_profile(app_profile *profile);
// Su compat
bool set_su_enabled(bool enabled);
bool is_su_enabled();
// Kernel umount
bool set_kernel_umount_enabled(bool enabled);
bool is_kernel_umount_enabled();
bool get_allow_list(struct ksu_new_get_allow_list_cmd *);
inline std::pair<int, int> legacy_get_info() {
int32_t version = -1;
int32_t flags = 0;
int32_t result = 0;
prctl(0xDEADBEEF, 2, &version, &flags, &result);
return {version, flags};
}
#endif //KERNELSU_KSU_H