Home
last modified time | relevance | path

Searched refs:appInstallMetadata (Results 1 – 17 of 17) sorted by relevance

/frameworks/base/core/tests/coretests/src/android/content/integrity/
DCompoundFormulaTest.java101 AppInstallMetadata appInstallMetadata = in testFormulaMatches_notFalse_true() local
104 assertThat(ATOMIC_FORMULA_1.matches(appInstallMetadata)).isFalse(); in testFormulaMatches_notFalse_true()
108 assertThat(compoundFormula.matches(appInstallMetadata)).isTrue(); in testFormulaMatches_notFalse_true()
113 AppInstallMetadata appInstallMetadata = in testFormulaMatches_notTrue_false() local
116 assertThat(ATOMIC_FORMULA_1.matches(appInstallMetadata)).isTrue(); in testFormulaMatches_notTrue_false()
120 assertThat(compoundFormula.matches(appInstallMetadata)).isFalse(); in testFormulaMatches_notTrue_false()
128 AppInstallMetadata appInstallMetadata = in testFormulaMatches_trueAndTrue_true() local
131 assertThat(ATOMIC_FORMULA_1.matches(appInstallMetadata)).isTrue(); in testFormulaMatches_trueAndTrue_true()
132 assertThat(ATOMIC_FORMULA_1.matches(appInstallMetadata)).isTrue(); in testFormulaMatches_trueAndTrue_true()
134 assertThat(compoundFormula.matches(appInstallMetadata)).isTrue(); in testFormulaMatches_trueAndTrue_true()
[all …]
DInstallerAllowedByManifestFormulaTest.java40 AppInstallMetadata appInstallMetadata = getAppInstallMetadataBuilder() in testFormulaMatches_installerAndCertBothInManifest() local
48 assertThat(FORMULA.matches(appInstallMetadata)).isTrue(); in testFormulaMatches_installerAndCertBothInManifest()
53 AppInstallMetadata appInstallMetadata = getAppInstallMetadataBuilder() in testFormulaMatches_installerAndCertDoesNotMatchInManifest() local
61 assertThat(FORMULA.matches(appInstallMetadata)).isFalse(); in testFormulaMatches_installerAndCertDoesNotMatchInManifest()
66 AppInstallMetadata appInstallMetadata = getAppInstallMetadataBuilder() in testFormulaMatches_installerNotInManifest() local
74 assertThat(FORMULA.matches(appInstallMetadata)).isFalse(); in testFormulaMatches_installerNotInManifest()
79 AppInstallMetadata appInstallMetadata = getAppInstallMetadataBuilder() in testFormulaMatches_certificateDoesNotMatchManifest() local
87 assertThat(FORMULA.matches(appInstallMetadata)).isFalse(); in testFormulaMatches_certificateDoesNotMatchManifest()
92 AppInstallMetadata appInstallMetadata = getAppInstallMetadataBuilder() in testFormulaMatches_emptyManifest() local
97 assertThat(FORMULA.matches(appInstallMetadata)).isTrue(); in testFormulaMatches_emptyManifest()
[all …]
DAtomicFormulaTest.java241 AppInstallMetadata appInstallMetadata = in testFormulaMatches_string_packageNameFormula_true() local
244 assertThat(stringAtomicFormula.matches(appInstallMetadata)).isTrue(); in testFormulaMatches_string_packageNameFormula_true()
253 AppInstallMetadata appInstallMetadata = in testFormulaMatches_string_packageNameFormula_false() local
256 assertThat(stringAtomicFormula.matches(appInstallMetadata)).isFalse(); in testFormulaMatches_string_packageNameFormula_false()
264 AppInstallMetadata appInstallMetadata = in testFormulaMatches_string_multipleAppCertificates_true() local
270 assertThat(stringAtomicFormula.matches(appInstallMetadata)).isTrue(); in testFormulaMatches_string_multipleAppCertificates_true()
278 AppInstallMetadata appInstallMetadata = in testFormulaMatches_string_multipleAppCertificates_false() local
284 assertThat(stringAtomicFormula.matches(appInstallMetadata)).isFalse(); in testFormulaMatches_string_multipleAppCertificates_false()
292 AppInstallMetadata appInstallMetadata = in testFormulaMatches_string_multipleInstallerCertificates_true() local
299 assertThat(stringAtomicFormula.matches(appInstallMetadata)).isTrue(); in testFormulaMatches_string_multipleInstallerCertificates_true()
[all …]
/frameworks/base/core/java/android/content/integrity/
DInstallerAllowedByManifestFormula.java62 public boolean matches(AppInstallMetadata appInstallMetadata) { in matches() argument
64 appInstallMetadata.getAllowedInstallersAndCertificates(); in matches()
67 appInstallMetadata, allowedInstallersAndCertificates); in matches()
81 AppInstallMetadata appInstallMetadata, in installerInAllowedInstallersFromManifest() argument
83 String installerPackage = appInstallMetadata.getInstallerName(); in installerInAllowedInstallersFromManifest()
92 return appInstallMetadata.getInstallerCertificates() in installerInAllowedInstallersFromManifest()
95 .get(appInstallMetadata.getInstallerName())); in installerInAllowedInstallersFromManifest()
DAtomicFormula.java204 public boolean matches(AppInstallMetadata appInstallMetadata) { in matches() argument
209 long metadataValue = getLongMetadataValue(appInstallMetadata, getKey()); in matches()
288 private static long getLongMetadataValue(AppInstallMetadata appInstallMetadata, int key) { in getLongMetadataValue() argument
291 return appInstallMetadata.getVersionCode(); in getLongMetadataValue()
403 public boolean matches(AppInstallMetadata appInstallMetadata) { in matches() argument
407 return getMetadataValue(appInstallMetadata, getKey()).contains(mValue); in matches()
469 AppInstallMetadata appInstallMetadata, int key) { in getMetadataValue() argument
472 return Collections.singletonList(appInstallMetadata.getPackageName()); in getMetadataValue()
474 return appInstallMetadata.getAppCertificates(); in getMetadataValue()
476 return appInstallMetadata.getInstallerCertificates(); in getMetadataValue()
[all …]
DCompoundFormula.java118 public boolean matches(AppInstallMetadata appInstallMetadata) { in matches() argument
121 return !getFormulas().get(0).matches(appInstallMetadata); in matches()
124 .allMatch(formula -> formula.matches(appInstallMetadata)); in matches()
127 .anyMatch(formula -> formula.matches(appInstallMetadata)); in matches()
DIntegrityFormula.java182 public abstract boolean matches(AppInstallMetadata appInstallMetadata); in matches() argument
/frameworks/base/services/tests/servicestests/src/com/android/server/integrity/parser/
DRuleIndexingControllerTest.java51 AppInstallMetadata appInstallMetadata = in verifyIndexRangeSearchIsCorrect() local
58 indexingController.identifyRulesToEvaluate(appInstallMetadata); in verifyIndexRangeSearchIsCorrect()
73 AppInstallMetadata appInstallMetadata = in verifyIndexRangeSearchIsCorrect_multipleAppCertificates() local
80 indexingController.identifyRulesToEvaluate(appInstallMetadata); in verifyIndexRangeSearchIsCorrect_multipleAppCertificates()
96 AppInstallMetadata appInstallMetadata = in verifyIndexRangeSearchIsCorrect_keysInFirstAndLastBlock() local
103 indexingController.identifyRulesToEvaluate(appInstallMetadata); in verifyIndexRangeSearchIsCorrect_keysInFirstAndLastBlock()
118 AppInstallMetadata appInstallMetadata = in verifyIndexRangeSearchIsCorrect_keysMatchWithValues() local
125 indexingController.identifyRulesToEvaluate(appInstallMetadata); in verifyIndexRangeSearchIsCorrect_keysMatchWithValues()
150 AppInstallMetadata appInstallMetadata = in verifyIndexRangeSearchIsCorrect_noIndexesAvailable() local
157 indexingController.identifyRulesToEvaluate(appInstallMetadata); in verifyIndexRangeSearchIsCorrect_noIndexesAvailable()
/frameworks/base/services/core/java/com/android/server/integrity/engine/
DRuleEvaluationEngine.java67 AppInstallMetadata appInstallMetadata) { in evaluate() argument
68 List<Rule> rules = loadRules(appInstallMetadata); in evaluate()
69 return RuleEvaluator.evaluateRules(rules, appInstallMetadata); in evaluate()
72 private List<Rule> loadRules(AppInstallMetadata appInstallMetadata) { in loadRules() argument
79 return mIntegrityFileManager.readRules(appInstallMetadata); in loadRules()
DRuleEvaluator.java50 List<Rule> rules, AppInstallMetadata appInstallMetadata) { in evaluateRules() argument
55 .filter(rule -> rule.getFormula().matches(appInstallMetadata)) in evaluateRules()
/frameworks/base/services/tests/servicestests/src/com/android/server/integrity/
DAppIntegrityManagerServiceImplTest.java326 AppInstallMetadata appInstallMetadata = metadataCaptor.getValue(); in handleBroadcast_correctArgs() local
327 assertEquals(PACKAGE_NAME, appInstallMetadata.getPackageName()); in handleBroadcast_correctArgs()
328 assertThat(appInstallMetadata.getAppCertificates()).containsExactly(APP_CERT); in handleBroadcast_correctArgs()
329 assertEquals(INSTALLER_SHA256, appInstallMetadata.getInstallerName()); in handleBroadcast_correctArgs()
331 assertEquals(VERSION_CODE, appInstallMetadata.getVersionCode()); in handleBroadcast_correctArgs()
332 assertFalse(appInstallMetadata.isPreInstalled()); in handleBroadcast_correctArgs()
334 assertFalse(appInstallMetadata.isStampPresent()); in handleBroadcast_correctArgs()
335 assertFalse(appInstallMetadata.isStampVerified()); in handleBroadcast_correctArgs()
336 assertFalse(appInstallMetadata.isStampTrusted()); in handleBroadcast_correctArgs()
337 assertNull(appInstallMetadata.getStampCertificateHash()); in handleBroadcast_correctArgs()
[all …]
DIntegrityFileManagerTest.java141 AppInstallMetadata appInstallMetadata = in testGetRules() local
150 List<Rule> rulesFetched = mIntegrityFileManager.readRules(appInstallMetadata); in testGetRules()
182 AppInstallMetadata appInstallMetadata = in testGetRules_indexedForManyRules() local
191 List<Rule> rulesFetched = mIntegrityFileManager.readRules(appInstallMetadata); in testGetRules_indexedForManyRules()
/frameworks/base/services/core/java/com/android/server/integrity/parser/
DRuleIndexingController.java58 public List<RuleIndexRange> identifyRulesToEvaluate(AppInstallMetadata appInstallMetadata) { in identifyRulesToEvaluate() argument
64 sPackageNameBasedIndexes, appInstallMetadata.getPackageName())); in identifyRulesToEvaluate()
67 for (String appCertificate : appInstallMetadata.getAppCertificates()) { in identifyRulesToEvaluate()
/frameworks/base/services/core/java/com/android/server/integrity/
DAppIntegrityManagerServiceImpl.java316 AppInstallMetadata appInstallMetadata = builder.build(); in handleIntegrityVerification() local
322 + appInstallMetadata in handleIntegrityVerification()
326 IntegrityCheckResult result = mEvaluationEngine.evaluate(appInstallMetadata); in handleIntegrityVerification()
340 appInstallMetadata.getVersionCode(), in handleIntegrityVerification()
485 private void extractSourceStamp(Uri dataUri, AppInstallMetadata.Builder appInstallMetadata) { in extractSourceStamp() argument
507 appInstallMetadata.setIsStampPresent(sourceStampVerificationResult.isPresent()); in extractSourceStamp()
508 appInstallMetadata.setIsStampVerified(sourceStampVerificationResult.isVerified()); in extractSourceStamp()
510 appInstallMetadata.setIsStampTrusted(sourceStampVerificationResult.isVerified()); in extractSourceStamp()
518 appInstallMetadata.setStampCertificateHash(getHexDigest(certificateDigest)); in extractSourceStamp()
DIntegrityFileManager.java153 public List<Rule> readRules(@Nullable AppInstallMetadata appInstallMetadata) in readRules() argument
158 if (appInstallMetadata != null) { in readRules()
161 mRuleIndexingController.identifyRulesToEvaluate(appInstallMetadata); in readRules()
/frameworks/base/services/tests/servicestests/src/com/android/server/integrity/serializer/
DRuleIndexingDetailsIdentifierTest.java298 public boolean matches(AppInstallMetadata appInstallMetadata) { in getInvalidFormula() argument
DRuleBinarySerializerTest.java868 public boolean matches(AppInstallMetadata appInstallMetadata) { in getInvalidFormula() argument