Add AppIntsallMetadata class.

Bug: 141907044
Test: No logic added.
Change-Id: Ieea365014e8907fa51b06a1dc6943e480fd04e66
This commit is contained in:
Khaled Abdelmohsen
2019-10-01 11:17:51 +01:00
parent c71dbf9c7b
commit 5ada5987a3
2 changed files with 73 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.server.integrity.engine;
/**
* The app install metadata.
*
* <p>The integrity component retrieves metadata for app installs from package manager, passing it
* to the rule evaluation engine to evaluate the metadata against the rules.
*/
public final class AppInstallMetadata {
final String mPackageName;
// Raw string encoding for the SHA-256 hash of the certificate of the app.
final String mAppCertificate;
final String mInstallerName;
// Raw string encoding for the SHA-256 hash of the certificate of the installer.
final String mInstallerCertificate;
final int mVersionCode;
final boolean mIsPreInstalled;
AppInstallMetadata(String packageName, String appCertificate, String installerName,
String installerCertificate, int versionCode, boolean isPreInstalled) {
this.mPackageName = packageName;
this.mAppCertificate = appCertificate;
this.mInstallerName = installerName;
this.mInstallerCertificate = installerCertificate;
this.mVersionCode = versionCode;
this.mIsPreInstalled = isPreInstalled;
}
}

View File

@@ -0,0 +1,29 @@
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.server.integrity.engine;
/**
* The engine used to evaluate rules against app installs.
*
* <p>Every app install is evaluated against rules (pushed by the verifier) by the evaluation engine
* to allow/block that install.
*/
public final class RuleEvaluation {
private static final String TAG = "RuleEvaluation";
// TODO: Add singleton injection.
}