2017-04-15 11:26:29 +00:00
|
|
|
/* magiskpolicy.h - Public API for policy patching
|
|
|
|
*/
|
2017-01-31 16:51:45 +00:00
|
|
|
|
2017-04-15 11:26:29 +00:00
|
|
|
#ifndef _MAGISKPOLICY_H
|
|
|
|
#define _MAGISKPOLICY_H
|
2017-01-31 16:51:45 +00:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
2017-02-03 20:24:22 +00:00
|
|
|
|
2017-04-15 11:26:29 +00:00
|
|
|
#define ALL NULL
|
2017-01-31 16:51:45 +00:00
|
|
|
|
2017-04-15 18:29:42 +00:00
|
|
|
// policydb functions
|
|
|
|
int load_policydb(const char *filename);
|
|
|
|
int dump_policydb(const char *filename);
|
|
|
|
void destroy_policydb();
|
|
|
|
|
2017-01-31 16:51:45 +00:00
|
|
|
// Handy functions
|
2017-04-15 11:26:29 +00:00
|
|
|
int sepol_allow(char *s, char *t, char *c, char *p);
|
|
|
|
int sepol_deny(char *s, char *t, char *c, char *p);
|
|
|
|
int sepol_auditallow(char *s, char *t, char *c, char *p);
|
|
|
|
int sepol_auditdeny(char *s, char *t, char *c, char *p);
|
|
|
|
int sepol_typetrans(char *s, char *t, char *c, char *d, char *o);
|
2017-04-19 20:04:09 +00:00
|
|
|
int sepol_allowxperm(char *s, char *t, char *c, char *range);
|
|
|
|
int sepol_auditallowxperm(char *s, char *t, char *c, char *range);
|
|
|
|
int sepol_dontauditxperm(char *s, char *t, char *c, char *range);
|
2017-04-15 11:26:29 +00:00
|
|
|
int sepol_create(char *s);
|
|
|
|
int sepol_permissive(char *s);
|
|
|
|
int sepol_enforce(char *s);
|
|
|
|
int sepol_attradd(char *s, char *a);
|
|
|
|
int sepol_exists(char *source);
|
2017-01-31 16:51:45 +00:00
|
|
|
|
|
|
|
// Built in rules
|
2017-04-15 11:26:29 +00:00
|
|
|
void sepol_min_rules();
|
2017-04-15 18:29:42 +00:00
|
|
|
void sepol_med_rules();
|
|
|
|
void sepol_full_rules();
|
2017-01-31 16:51:45 +00:00
|
|
|
|
|
|
|
#endif
|