Search in sources :

Example 6 with VerificationParams

use of android.content.pm.VerificationParams in project android_frameworks_base by ParanoidAndroid.

the class VerificationParamsTest method testEquals_Referrer_Failure.

public void testEquals_Referrer_Failure() throws Exception {
    VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI, REFERRER, ORIGINATING_UID, MANIFEST_DIGEST);
    VerificationParams params2 = new VerificationParams(Uri.parse(VERIFICATION_URI_STRING), Uri.parse(ORIGINATING_URI_STRING), Uri.parse("http://a.different.uri/"), ORIGINATING_UID, new ManifestDigest(DIGEST_BYTES));
    assertFalse(params1.equals(params2));
}
Also used : VerificationParams(android.content.pm.VerificationParams) ManifestDigest(android.content.pm.ManifestDigest)

Example 7 with VerificationParams

use of android.content.pm.VerificationParams in project android_frameworks_base by ParanoidAndroid.

the class VerificationParamsTest method testEquals_VerificationUri_Failure.

public void testEquals_VerificationUri_Failure() throws Exception {
    VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI, REFERRER, ORIGINATING_UID, MANIFEST_DIGEST);
    VerificationParams params2 = new VerificationParams(Uri.parse("http://a.different.uri/"), Uri.parse(ORIGINATING_URI_STRING), Uri.parse(REFERRER_STRING), ORIGINATING_UID, new ManifestDigest(DIGEST_BYTES));
    assertFalse(params1.equals(params2));
}
Also used : VerificationParams(android.content.pm.VerificationParams) ManifestDigest(android.content.pm.ManifestDigest)

Example 8 with VerificationParams

use of android.content.pm.VerificationParams in project platform_frameworks_base by android.

the class VerificationParamsTest method testHashCode_InstallerUid_Failure.

public void testHashCode_InstallerUid_Failure() throws Exception {
    VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI, REFERRER, ORIGINATING_UID);
    VerificationParams params2 = new VerificationParams(Uri.parse(VERIFICATION_URI_STRING), Uri.parse(ORIGINATING_URI_STRING), Uri.parse(REFERRER_STRING), ORIGINATING_UID);
    params2.setInstallerUid(INSTALLER_UID);
    assertFalse(params1.hashCode() == params2.hashCode());
}
Also used : VerificationParams(android.content.pm.VerificationParams)

Example 9 with VerificationParams

use of android.content.pm.VerificationParams in project platform_frameworks_base by android.

the class VerificationParamsTest method testEquals_Success.

public void testEquals_Success() throws Exception {
    VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI, REFERRER, ORIGINATING_UID);
    VerificationParams params2 = new VerificationParams(Uri.parse(VERIFICATION_URI_STRING), Uri.parse(ORIGINATING_URI_STRING), Uri.parse(REFERRER_STRING), ORIGINATING_UID);
    assertEquals(params1, params2);
}
Also used : VerificationParams(android.content.pm.VerificationParams)

Example 10 with VerificationParams

use of android.content.pm.VerificationParams in project platform_frameworks_base by android.

the class VerificationParamsTest method testParcel.

public void testParcel() throws Exception {
    VerificationParams expected = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI, REFERRER, ORIGINATING_UID);
    Parcel parcel = Parcel.obtain();
    expected.writeToParcel(parcel, 0);
    parcel.setDataPosition(0);
    VerificationParams actual = VerificationParams.CREATOR.createFromParcel(parcel);
    assertEquals(VERIFICATION_URI, actual.getVerificationURI());
    assertEquals(ORIGINATING_URI, actual.getOriginatingURI());
    assertEquals(REFERRER, actual.getReferrer());
    assertEquals(ORIGINATING_UID, actual.getOriginatingUid());
}
Also used : Parcel(android.os.Parcel) VerificationParams(android.content.pm.VerificationParams)

Aggregations

VerificationParams (android.content.pm.VerificationParams)82 ManifestDigest (android.content.pm.ManifestDigest)14 Parcel (android.os.Parcel)6 ContainerEncryptionParams (android.content.pm.ContainerEncryptionParams)1 IPackageInstallObserver (android.content.pm.IPackageInstallObserver)1 Uri (android.net.Uri)1 RemoteException (android.os.RemoteException)1 File (java.io.File)1 InvalidAlgorithmParameterException (java.security.InvalidAlgorithmParameterException)1 SecretKey (javax.crypto.SecretKey)1 IvParameterSpec (javax.crypto.spec.IvParameterSpec)1 SecretKeySpec (javax.crypto.spec.SecretKeySpec)1