/frameworks/base/core/tests/coretests/src/android/content/integrity/ |
D | CompoundFormulaTest.java | 102 AppInstallMetadata appInstallMetadata = in testFormulaMatches_notFalse_true() local 105 assertThat(ATOMIC_FORMULA_1.matches(appInstallMetadata)).isFalse(); in testFormulaMatches_notFalse_true() 109 assertThat(compoundFormula.matches(appInstallMetadata)).isTrue(); in testFormulaMatches_notFalse_true() 114 AppInstallMetadata appInstallMetadata = in testFormulaMatches_notTrue_false() local 117 assertThat(ATOMIC_FORMULA_1.matches(appInstallMetadata)).isTrue(); in testFormulaMatches_notTrue_false() 121 assertThat(compoundFormula.matches(appInstallMetadata)).isFalse(); in testFormulaMatches_notTrue_false() 129 AppInstallMetadata appInstallMetadata = in testFormulaMatches_trueAndTrue_true() local 132 assertThat(ATOMIC_FORMULA_1.matches(appInstallMetadata)).isTrue(); in testFormulaMatches_trueAndTrue_true() 133 assertThat(ATOMIC_FORMULA_1.matches(appInstallMetadata)).isTrue(); in testFormulaMatches_trueAndTrue_true() 135 assertThat(compoundFormula.matches(appInstallMetadata)).isTrue(); in testFormulaMatches_trueAndTrue_true() [all …]
|
D | InstallerAllowedByManifestFormulaTest.java | 40 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 …]
|
D | AtomicFormulaTest.java | 241 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/ |
D | InstallerAllowedByManifestFormula.java | 62 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()
|
D | AtomicFormula.java | 203 public boolean matches(AppInstallMetadata appInstallMetadata) { in matches() argument 208 long metadataValue = getLongMetadataValue(appInstallMetadata, getKey()); in matches() 287 private static long getLongMetadataValue(AppInstallMetadata appInstallMetadata, int key) { in getLongMetadataValue() argument 290 return appInstallMetadata.getVersionCode(); in getLongMetadataValue() 399 public boolean matches(AppInstallMetadata appInstallMetadata) { in matches() argument 403 return getMetadataValue(appInstallMetadata, getKey()).contains(mValue); in matches() 465 AppInstallMetadata appInstallMetadata, int key) { in getMetadataValue() argument 468 return Collections.singletonList(appInstallMetadata.getPackageName()); in getMetadataValue() 470 return appInstallMetadata.getAppCertificates(); in getMetadataValue() 472 return appInstallMetadata.getInstallerCertificates(); in getMetadataValue() [all …]
|
D | CompoundFormula.java | 119 public boolean matches(AppInstallMetadata appInstallMetadata) { in matches() argument 122 return !getFormulas().get(0).matches(appInstallMetadata); in matches() 125 .allMatch(formula -> formula.matches(appInstallMetadata)); in matches() 128 .anyMatch(formula -> formula.matches(appInstallMetadata)); in matches()
|
D | IntegrityFormula.java | 180 public abstract boolean matches(AppInstallMetadata appInstallMetadata); in matches() argument
|
/frameworks/base/services/tests/servicestests/src/com/android/server/integrity/parser/ |
D | RuleIndexingControllerTest.java | 53 AppInstallMetadata appInstallMetadata = in verifyIndexRangeSearchIsCorrect() local 60 indexingController.identifyRulesToEvaluate(appInstallMetadata); in verifyIndexRangeSearchIsCorrect() 75 AppInstallMetadata appInstallMetadata = in verifyIndexRangeSearchIsCorrect_multipleAppCertificates() local 82 indexingController.identifyRulesToEvaluate(appInstallMetadata); in verifyIndexRangeSearchIsCorrect_multipleAppCertificates() 98 AppInstallMetadata appInstallMetadata = in verifyIndexRangeSearchIsCorrect_keysInFirstAndLastBlock() local 105 indexingController.identifyRulesToEvaluate(appInstallMetadata); in verifyIndexRangeSearchIsCorrect_keysInFirstAndLastBlock() 120 AppInstallMetadata appInstallMetadata = in verifyIndexRangeSearchIsCorrect_keysMatchWithValues() local 127 indexingController.identifyRulesToEvaluate(appInstallMetadata); in verifyIndexRangeSearchIsCorrect_keysMatchWithValues() 152 AppInstallMetadata appInstallMetadata = in verifyIndexRangeSearchIsCorrect_noIndexesAvailable() local 159 indexingController.identifyRulesToEvaluate(appInstallMetadata); in verifyIndexRangeSearchIsCorrect_noIndexesAvailable()
|
/frameworks/base/services/core/java/com/android/server/integrity/engine/ |
D | RuleEvaluationEngine.java | 67 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()
|
D | RuleEvaluator.java | 50 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/ |
D | AppIntegrityManagerServiceImplTest.java | 326 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 …]
|
D | IntegrityFileManagerTest.java | 141 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/ |
D | RuleIndexingController.java | 58 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/ |
D | AppIntegrityManagerServiceImpl.java | 321 AppInstallMetadata appInstallMetadata = builder.build(); in handleIntegrityVerification() local 327 + appInstallMetadata in handleIntegrityVerification() 331 IntegrityCheckResult result = mEvaluationEngine.evaluate(appInstallMetadata); in handleIntegrityVerification() 344 appInstallMetadata.getVersionCode(), in handleIntegrityVerification() 489 private void extractSourceStamp(Uri dataUri, AppInstallMetadata.Builder appInstallMetadata) { in extractSourceStamp() argument 511 appInstallMetadata.setIsStampPresent(sourceStampVerificationResult.isPresent()); in extractSourceStamp() 512 appInstallMetadata.setIsStampVerified(sourceStampVerificationResult.isVerified()); in extractSourceStamp() 514 appInstallMetadata.setIsStampTrusted(sourceStampVerificationResult.isVerified()); in extractSourceStamp() 522 appInstallMetadata.setStampCertificateHash(getHexDigest(certificateDigest)); in extractSourceStamp()
|
D | IntegrityFileManager.java | 153 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/ |
D | RuleIndexingDetailsIdentifierTest.java | 298 public boolean matches(AppInstallMetadata appInstallMetadata) { in getInvalidFormula() argument
|
D | RuleBinarySerializerTest.java | 868 public boolean matches(AppInstallMetadata appInstallMetadata) { in getInvalidFormula() argument
|