forked from rovo89/Xposed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xposed_service.h
35 lines (26 loc) · 849 Bytes
/
xposed_service.h
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
#ifndef XPOSED_SERVICE_H_
#define XPOSED_SERVICE_H_
#include <sys/stat.h>
#include <unistd.h>
namespace xposed {
namespace service {
bool startAll();
#if XPOSED_WITH_SELINUX
bool startMembased();
namespace membased {
int accessFile(const char* path, int mode);
int statFile(const char* path, struct stat* stat);
char* readFile(const char* path, int* bytesRead);
void restrictMemoryInheritance();
} // namespace membased
#endif // XPOSED_WITH_SELINUX
} // namespace service
static inline int zygote_access(const char *pathname, int mode) {
#if XPOSED_WITH_SELINUX
if (xposed->isSELinuxEnabled)
return xposed::service::membased::accessFile(pathname, mode);
#endif // XPOSED_WITH_SELINUX
return access(pathname, mode);
}
} // namespace xposed
#endif /* XPOSED_SERVICE_H_ */