Rename to minimal rules

This commit is contained in:
topjohnwu 2017-02-01 23:07:37 +08:00
parent ea61d5c1a5
commit abaffc1908
3 changed files with 9 additions and 9 deletions

14
main.c
View File

@ -20,7 +20,7 @@ static void usage(char *arg0) {
int main(int argc, char **argv) { int main(int argc, char **argv) {
char *infile = NULL, *source = NULL, *target = NULL, *class = NULL, *perm = NULL; char *infile = NULL, *source = NULL, *target = NULL, *class = NULL, *perm = NULL;
char *fcon = NULL, *outfile = NULL, *permissive = NULL, *attr = NULL, *filetrans = NULL; char *fcon = NULL, *outfile = NULL, *permissive = NULL, *attr = NULL, *filetrans = NULL;
int exists = 0, not = 0, live = 0, builtin = 0, magisk = 0; int exists = 0, not = 0, live = 0, builtin = 0, minimal = 0;
policydb_t policydb; policydb_t policydb;
struct policy_file pf, outpf; struct policy_file pf, outpf;
sidtab_t sidtab; sidtab_t sidtab;
@ -44,7 +44,7 @@ int main(int argc, char **argv) {
{"not-permissive", required_argument, NULL, 'z'}, {"not-permissive", required_argument, NULL, 'z'},
{"not", no_argument, NULL, 0}, {"not", no_argument, NULL, 0},
{"live", no_argument, NULL, 0}, {"live", no_argument, NULL, 0},
{"magisk", no_argument, NULL, 0}, {"minimal", no_argument, NULL, 0},
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
}; };
@ -56,8 +56,8 @@ int main(int argc, char **argv) {
not = 1; not = 1;
else if(strcmp(long_options[option_index].name, "live") == 0) else if(strcmp(long_options[option_index].name, "live") == 0)
live = 1; live = 1;
else if(strcmp(long_options[option_index].name, "magisk") == 0) else if(strcmp(long_options[option_index].name, "minimal") == 0)
magisk = 1; minimal = 1;
else else
usage(argv[0]); usage(argv[0]);
break; break;
@ -108,7 +108,7 @@ int main(int argc, char **argv) {
} }
// Use builtin rules if nothing specified // Use builtin rules if nothing specified
if (!magisk && !source && !target && !class && !perm && !permissive && !fcon && !attr &&!filetrans && !exists) if (!minimal && !source && !target && !class && !perm && !permissive && !fcon && !attr &&!filetrans && !exists)
builtin = 1; builtin = 1;
// Overwrite original if not specified // Overwrite original if not specified
@ -135,8 +135,8 @@ int main(int argc, char **argv) {
if (builtin) { if (builtin) {
su_rules(); su_rules();
} }
else if (magisk) { else if (minimal) {
magisk_rules(); min_rules();
} }
else if (permissive) { else if (permissive) {
type_datum_t *type; type_datum_t *type;

View File

@ -174,7 +174,7 @@ void su_rules() {
} }
// Minimal to run Magisk script before live patching // Minimal to run Magisk script before live patching
void magisk_rules() { void min_rules() {
permissive("su"); permissive("su");
permissive("init"); permissive("init");

View File

@ -45,6 +45,6 @@ int exists(char *source);
// Built in rules // Built in rules
void su_rules(); void su_rules();
void magisk_rules(); void min_rules();
#endif #endif