Minor code changes across all sources

This commit is contained in:
topjohnwu
2019-06-30 19:09:31 -07:00
parent db8dd9f186
commit ff3710de66
20 changed files with 50 additions and 82 deletions

View File

@@ -8,7 +8,7 @@
#include <vector>
#include <string>
#include <magisk.h>
#include <logging.h>
#include <utils.h>
#include <flags.h>

View File

@@ -1,17 +1,14 @@
/* magiskpolicy.h - Public API for policy patching
*/
#ifndef _MAGISKPOLICY_H
#define _MAGISKPOLICY_H
#pragma once
#include <stdlib.h>
#include <selinux.h>
#define ALL NULL
#ifdef __cplusplus
extern "C" {
#endif
__BEGIN_DECLS
// policydb functions
int load_policydb(const char *file);
@@ -41,8 +38,4 @@ int sepol_exists(const char *source);
// Built in rules
void sepol_magisk_rules();
#ifdef __cplusplus
};
#endif
#endif
__END_DECLS

View File

@@ -1,8 +1,8 @@
#include <magisk.h>
#include <logging.h>
#include <flags.h>
#include "magiskpolicy.h"
#include "sepolicy.h"
#include "flags.h"
static void allowSuClient(const char *target) {
if (!sepol_exists(target))

View File

@@ -1,14 +1,11 @@
/* sepolicy.h - Header for magiskpolicy non-public APIs
*/
#ifndef _SEPOLICY_H
#define _SEPOLICY_H
#pragma once
#include <sepol/policydb/policydb.h>
#ifdef __cplusplus
extern "C" {
#endif
__BEGIN_DECLS
// Global policydb
extern policydb_t *policydb;
@@ -36,8 +33,4 @@ int add_rule(const char *s, const char *t, const char *c, const char *p, int eff
int add_xperm_rule(const char *s, const char *t, const char *c, const char *range, int effect, int n);
int add_type_rule(const char *s, const char *t, const char *c, const char *d, int effect);
#ifdef __cplusplus
};
#endif
#endif
__END_DECLS