Magisk/native/jni/magiskpolicy/magiskpolicy.h

42 lines
1.5 KiB
C
Raw Normal View History

/* magiskpolicy.h - Public API for policy patching
*/
2019-07-01 02:09:31 +00:00
#pragma once
#include <stdlib.h>
#include <selinux.h>
#define ALL NULL
2019-07-01 02:09:31 +00:00
__BEGIN_DECLS
2018-11-08 09:20:16 +00:00
// policydb functions
int load_policydb(const char *file);
int load_split_cil();
int compile_split_cil();
int dump_policydb(const char *file);
void destroy_policydb();
// Handy functions
2018-11-08 09:20:16 +00:00
int sepol_allow(const char *s, const char *t, const char *c, const char *p);
int sepol_deny(const char *s, const char *t, const char *c, const char *p);
int sepol_auditallow(const char *s, const char *t, const char *c, const char *p);
int sepol_dontaudit(const char *s, const char *t, const char *c, const char *p);
int sepol_typetrans(const char *s, const char *t, const char *c, const char *d);
int sepol_typechange(const char *s, const char *t, const char *c, const char *d);
int sepol_typemember(const char *s, const char *t, const char *c, const char *d);
int sepol_nametrans(const char *s, const char *t, const char *c, const char *d, const char *o);
2018-11-08 09:20:16 +00:00
int sepol_allowxperm(const char *s, const char *t, const char *c, const char *range);
int sepol_auditallowxperm(const char *s, const char *t, const char *c, const char *range);
int sepol_dontauditxperm(const char *s, const char *t, const char *c, const char *range);
int sepol_create(const char *s);
int sepol_permissive(const char *s);
int sepol_enforce(const char *s);
int sepol_attradd(const char *s, const char *a);
int sepol_exists(const char *source);
// Built in rules
void sepol_magisk_rules();
2019-07-01 02:09:31 +00:00
__END_DECLS