* commit 'd172419e9a36f61af8c98d316ec2625e1f1304f6': Allow different SELinux policies for third party apps.
This commit is contained in:
@ -346,31 +346,21 @@ public final class SELinuxMMAC {
|
|||||||
*/
|
*/
|
||||||
public static boolean assignSeinfoValue(PackageParser.Package pkg) {
|
public static boolean assignSeinfoValue(PackageParser.Package pkg) {
|
||||||
|
|
||||||
/*
|
// We just want one of the signatures to match.
|
||||||
* Non system installed apps should be treated the same. This
|
for (Signature s : pkg.mSignatures) {
|
||||||
* means that any post-loaded apk will be assigned the default
|
if (s == null)
|
||||||
* tag, if one exists in the policy, else null, without respect
|
continue;
|
||||||
* to the signing key.
|
|
||||||
*/
|
|
||||||
if (((pkg.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) ||
|
|
||||||
((pkg.applicationInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0)) {
|
|
||||||
|
|
||||||
// We just want one of the signatures to match.
|
Policy policy = sSigSeinfo.get(s);
|
||||||
for (Signature s : pkg.mSignatures) {
|
if (policy != null) {
|
||||||
if (s == null)
|
String seinfo = policy.checkPolicy(pkg.packageName);
|
||||||
continue;
|
if (seinfo != null) {
|
||||||
|
pkg.applicationInfo.seinfo = seinfo;
|
||||||
|
if (DEBUG_POLICY_INSTALL)
|
||||||
|
Slog.i(TAG, "package (" + pkg.packageName +
|
||||||
|
") labeled with seinfo=" + seinfo);
|
||||||
|
|
||||||
Policy policy = sSigSeinfo.get(s);
|
return true;
|
||||||
if (policy != null) {
|
|
||||||
String seinfo = policy.checkPolicy(pkg.packageName);
|
|
||||||
if (seinfo != null) {
|
|
||||||
pkg.applicationInfo.seinfo = seinfo;
|
|
||||||
if (DEBUG_POLICY_INSTALL)
|
|
||||||
Slog.i(TAG, "package (" + pkg.packageName +
|
|
||||||
") labeled with seinfo=" + seinfo);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user