mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-14 05:01:55 +00:00
Cleanup SELinux support
This commit is contained in:
@@ -33,6 +33,13 @@ constexpr const char *applet_names[] = { "su", "resetprop", nullptr };
|
||||
#define POST_FS_DATA_WAIT_TIME 40
|
||||
#define POST_FS_DATA_SCRIPT_MAX_TIME 35
|
||||
|
||||
// Unconstrained domain the daemon and root processes run in
|
||||
#define SEPOL_PROC_DOMAIN "magisk"
|
||||
#define MAGISK_PROC_CON "u:r:" SEPOL_PROC_DOMAIN ":s0"
|
||||
// Unconstrained file type that anyone can access
|
||||
#define SEPOL_FILE_TYPE "magisk_file"
|
||||
#define MAGISK_FILE_CON "u:object_r:" SEPOL_FILE_TYPE ":s0"
|
||||
|
||||
extern int SDK_INT;
|
||||
#define APP_DATA_DIR (SDK_INT >= 24 ? "/data/user_de" : "/data/user")
|
||||
|
||||
|
||||
16
native/src/include/selinux.hpp
Normal file
16
native/src/include/selinux.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
void freecon(char *con);
|
||||
int setcon(const char *con);
|
||||
int getfilecon(const char *path, char **con);
|
||||
int lgetfilecon(const char *path, char **con);
|
||||
int fgetfilecon(int fd, char **con);
|
||||
int setfilecon(const char *path, const char *con);
|
||||
int lsetfilecon(const char *path, const char *con);
|
||||
int fsetfilecon(int fd, const char *con);
|
||||
void getfilecon_at(int dirfd, const char *name, char **con);
|
||||
void setfilecon_at(int dirfd, const char *name, const char *con);
|
||||
|
||||
//void enable_selinux();
|
||||
void restorecon();
|
||||
void restore_tmpcon();
|
||||
Reference in New Issue
Block a user