Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d67d1186 authored by Jihoon Kang's avatar Jihoon Kang Committed by Automerger Merge Worker
Browse files

Support auto gen module type matching in neverallow am: d546507c

parents 0b39cc3c d546507c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -706,6 +706,9 @@ func (r *rule) appliesToOsClass(osClass OsClass) bool {
}

func (r *rule) appliesToModuleType(moduleType string) bool {
	// Remove prefix for auto-generated modules
	moduleType = strings.TrimSuffix(moduleType, "__loadHookModule")
	moduleType = strings.TrimSuffix(moduleType, "__bottomUpMutatorModule")
	return (len(r.moduleTypes) == 0 || InList(moduleType, r.moduleTypes)) && !InList(moduleType, r.unlessModuleTypes)
}