Update robolectric to 4.11.1
This commit is contained in:
@@ -68,7 +68,7 @@ dependencies {
|
|||||||
// http://robolectric.org/getting-started/
|
// http://robolectric.org/getting-started/
|
||||||
// http://www.vogella.com/tutorials/Robolectric/article.html
|
// http://www.vogella.com/tutorials/Robolectric/article.html
|
||||||
testImplementation 'junit:junit:4.13'
|
testImplementation 'junit:junit:4.13'
|
||||||
testImplementation ('org.robolectric:robolectric:3.8') {
|
testImplementation ('org.robolectric:robolectric:4.11.1') {
|
||||||
exclude group: 'org.bouncycastle', module: 'bcprov-jdk18on'
|
exclude group: 'org.bouncycastle', module: 'bcprov-jdk18on'
|
||||||
}
|
}
|
||||||
testImplementation 'org.mockito:mockito-core:2.18.0'
|
testImplementation 'org.mockito:mockito-core:2.18.0'
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ public class KeychainTestRunner extends RobolectricTestRunner {
|
|||||||
protected Config buildGlobalConfig() {
|
protected Config buildGlobalConfig() {
|
||||||
return new Config.Builder()
|
return new Config.Builder()
|
||||||
.setSdk(27)
|
.setSdk(27)
|
||||||
.setConstants(WorkaroundBuildConfig.class)
|
|
||||||
.setShadows(new Class[] { ShadowWorkManager.class })
|
.setShadows(new Class[] { ShadowWorkManager.class })
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
package org.sufficientlysecure.keychain;
|
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.BuildConfig;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Temporary workaround for https://github.com/robolectric/robolectric/issues/1747
|
|
||||||
*/
|
|
||||||
public final class WorkaroundBuildConfig {
|
|
||||||
public static final boolean DEBUG = BuildConfig.DEBUG;
|
|
||||||
// Workaround: Use real packageName not applicationId
|
|
||||||
public static final String APPLICATION_ID = "org.sufficientlysecure.keychain";
|
|
||||||
public static final String BUILD_TYPE = BuildConfig.BUILD_TYPE;
|
|
||||||
public static final String FLAVOR = BuildConfig.FLAVOR;
|
|
||||||
public static final int VERSION_CODE = BuildConfig.VERSION_CODE;
|
|
||||||
public static final String VERSION_NAME = BuildConfig.VERSION_NAME;
|
|
||||||
}
|
|
||||||
@@ -133,7 +133,7 @@ public class AuthenticationOperationTest {
|
|||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
KeyWritableRepository databaseInteractor =
|
KeyWritableRepository databaseInteractor =
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication());
|
||||||
|
|
||||||
// don't log verbosely here, we're not here to test imports
|
// don't log verbosely here, we're not here to test imports
|
||||||
ShadowLog.stream = oldShadowStream;
|
ShadowLog.stream = oldShadowStream;
|
||||||
@@ -153,13 +153,13 @@ public class AuthenticationOperationTest {
|
|||||||
byte[] challenge = "dies ist ein challenge ☭".getBytes();
|
byte[] challenge = "dies ist ein challenge ☭".getBytes();
|
||||||
byte[] signature;
|
byte[] signature;
|
||||||
|
|
||||||
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.application);
|
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.getApplication());
|
||||||
|
|
||||||
long masterKeyId = mStaticRingRsa.getMasterKeyId();
|
long masterKeyId = mStaticRingRsa.getMasterKeyId();
|
||||||
Long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
|
Long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
|
||||||
|
|
||||||
{ // sign challenge
|
{ // sign challenge
|
||||||
AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.application,
|
AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.getApplication(),
|
||||||
keyRepository);
|
keyRepository);
|
||||||
|
|
||||||
AuthenticationData.Builder authData = AuthenticationData.builder();
|
AuthenticationData.Builder authData = AuthenticationData.builder();
|
||||||
@@ -199,13 +199,13 @@ public class AuthenticationOperationTest {
|
|||||||
byte[] challenge = "dies ist ein challenge ☭".getBytes();
|
byte[] challenge = "dies ist ein challenge ☭".getBytes();
|
||||||
byte[] signature;
|
byte[] signature;
|
||||||
|
|
||||||
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.application);
|
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.getApplication());
|
||||||
|
|
||||||
long masterKeyId = mStaticRingEcDsa.getMasterKeyId();
|
long masterKeyId = mStaticRingEcDsa.getMasterKeyId();
|
||||||
Long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
|
Long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
|
||||||
|
|
||||||
{ // sign challenge
|
{ // sign challenge
|
||||||
AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.application,
|
AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.getApplication(),
|
||||||
keyRepository);
|
keyRepository);
|
||||||
|
|
||||||
AuthenticationData.Builder authData = AuthenticationData.builder();
|
AuthenticationData.Builder authData = AuthenticationData.builder();
|
||||||
@@ -245,13 +245,13 @@ public class AuthenticationOperationTest {
|
|||||||
byte[] challenge = "dies ist ein challenge ☭".getBytes();
|
byte[] challenge = "dies ist ein challenge ☭".getBytes();
|
||||||
byte[] signature;
|
byte[] signature;
|
||||||
|
|
||||||
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.application);
|
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.getApplication());
|
||||||
|
|
||||||
long masterKeyId = mStaticRingEdDsa.getMasterKeyId();
|
long masterKeyId = mStaticRingEdDsa.getMasterKeyId();
|
||||||
Long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
|
Long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
|
||||||
|
|
||||||
{ // sign challenge
|
{ // sign challenge
|
||||||
AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.application,
|
AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.getApplication(),
|
||||||
keyRepository);
|
keyRepository);
|
||||||
|
|
||||||
AuthenticationData.Builder authData = AuthenticationData.builder();
|
AuthenticationData.Builder authData = AuthenticationData.builder();
|
||||||
@@ -294,13 +294,13 @@ public class AuthenticationOperationTest {
|
|||||||
byte[] challenge = "dies ist ein challenge ☭".getBytes();
|
byte[] challenge = "dies ist ein challenge ☭".getBytes();
|
||||||
byte[] signature;
|
byte[] signature;
|
||||||
|
|
||||||
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.application);
|
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.getApplication());
|
||||||
|
|
||||||
long masterKeyId = mStaticRingDsa.getMasterKeyId();
|
long masterKeyId = mStaticRingDsa.getMasterKeyId();
|
||||||
Long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
|
Long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
|
||||||
|
|
||||||
{ // sign challenge
|
{ // sign challenge
|
||||||
AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.application,
|
AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.getApplication(),
|
||||||
keyRepository);
|
keyRepository);
|
||||||
|
|
||||||
AuthenticationData.Builder authData = AuthenticationData.builder();
|
AuthenticationData.Builder authData = AuthenticationData.builder();
|
||||||
@@ -339,13 +339,13 @@ public class AuthenticationOperationTest {
|
|||||||
|
|
||||||
byte[] challenge = "dies ist ein challenge ☭".getBytes();
|
byte[] challenge = "dies ist ein challenge ☭".getBytes();
|
||||||
|
|
||||||
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.application);
|
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.getApplication());
|
||||||
|
|
||||||
long masterKeyId = mStaticRingEcDsa.getMasterKeyId();
|
long masterKeyId = mStaticRingEcDsa.getMasterKeyId();
|
||||||
Long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
|
Long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
|
||||||
|
|
||||||
{ // sign challenge - should succeed with selected key allowed
|
{ // sign challenge - should succeed with selected key allowed
|
||||||
AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.application,
|
AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.getApplication(),
|
||||||
keyRepository);
|
keyRepository);
|
||||||
|
|
||||||
AuthenticationData.Builder authData = AuthenticationData.builder();
|
AuthenticationData.Builder authData = AuthenticationData.builder();
|
||||||
@@ -368,7 +368,7 @@ public class AuthenticationOperationTest {
|
|||||||
Assert.assertTrue("authentication must succeed with selected key allowed", result.success());
|
Assert.assertTrue("authentication must succeed with selected key allowed", result.success());
|
||||||
}
|
}
|
||||||
{ // sign challenge - should fail with selected key disallowed
|
{ // sign challenge - should fail with selected key disallowed
|
||||||
AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.application,
|
AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.getApplication(),
|
||||||
keyRepository);
|
keyRepository);
|
||||||
|
|
||||||
AuthenticationData.Builder authData = AuthenticationData.builder();
|
AuthenticationData.Builder authData = AuthenticationData.builder();
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ public class BackupOperationTest {
|
|||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
KeyWritableRepository databaseInteractor =
|
KeyWritableRepository databaseInteractor =
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication());
|
||||||
|
|
||||||
// don't log verbosely here, we're not here to test imports
|
// don't log verbosely here, we're not here to test imports
|
||||||
ShadowLog.stream = oldShadowStream;
|
ShadowLog.stream = oldShadowStream;
|
||||||
@@ -149,8 +149,8 @@ public class BackupOperationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExportAllLocalStripped() throws Exception {
|
public void testExportAllLocalStripped() throws Exception {
|
||||||
BackupOperation op = new BackupOperation(RuntimeEnvironment.application,
|
BackupOperation op = new BackupOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
// make sure there is a local cert (so the later checks that there are none are meaningful)
|
// make sure there is a local cert (so the later checks that there are none are meaningful)
|
||||||
assertTrue("second keyring has local certification", checkForLocal(mStaticRing2));
|
assertTrue("second keyring has local certification", checkForLocal(mStaticRing2));
|
||||||
@@ -230,8 +230,8 @@ public class BackupOperationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExportWithExtraHeaders() throws Exception {
|
public void testExportWithExtraHeaders() throws Exception {
|
||||||
BackupOperation op = new BackupOperation(RuntimeEnvironment.application,
|
BackupOperation op = new BackupOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
boolean result = op.exportKeysToStream(
|
boolean result = op.exportKeysToStream(
|
||||||
@@ -252,11 +252,11 @@ public class BackupOperationTest {
|
|||||||
ByteArrayOutputStream outStream1 = new ByteArrayOutputStream();
|
ByteArrayOutputStream outStream1 = new ByteArrayOutputStream();
|
||||||
when(mockResolver.openOutputStream(fakeOutputUri)).thenReturn(outStream1);
|
when(mockResolver.openOutputStream(fakeOutputUri)).thenReturn(outStream1);
|
||||||
|
|
||||||
Application spyApplication = spy(RuntimeEnvironment.application);
|
Application spyApplication = spy(RuntimeEnvironment.getApplication());
|
||||||
when(spyApplication.getContentResolver()).thenReturn(mockResolver);
|
when(spyApplication.getContentResolver()).thenReturn(mockResolver);
|
||||||
|
|
||||||
BackupOperation op = new BackupOperation(spyApplication,
|
BackupOperation op = new BackupOperation(spyApplication,
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
BackupKeyringParcel parcel = BackupKeyringParcel.create(
|
BackupKeyringParcel parcel = BackupKeyringParcel.create(
|
||||||
new long[] { mStaticRing1.getMasterKeyId() }, false, false, true, fakeOutputUri);
|
new long[] { mStaticRing1.getMasterKeyId() }, false, false, true, fakeOutputUri);
|
||||||
@@ -305,7 +305,7 @@ public class BackupOperationTest {
|
|||||||
outStream = new ByteArrayOutputStream();
|
outStream = new ByteArrayOutputStream();
|
||||||
when(mockResolver.openOutputStream(fakeOutputUri)).thenReturn(outStream);
|
when(mockResolver.openOutputStream(fakeOutputUri)).thenReturn(outStream);
|
||||||
|
|
||||||
spyApplication = spy(RuntimeEnvironment.application);
|
spyApplication = spy(RuntimeEnvironment.getApplication());
|
||||||
when(spyApplication.getContentResolver()).thenReturn(mockResolver);
|
when(spyApplication.getContentResolver()).thenReturn(mockResolver);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -313,7 +313,7 @@ public class BackupOperationTest {
|
|||||||
|
|
||||||
{ // export encrypted
|
{ // export encrypted
|
||||||
BackupOperation op = new BackupOperation(spyApplication,
|
BackupOperation op = new BackupOperation(spyApplication,
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
BackupKeyringParcel parcel = BackupKeyringParcel.create(
|
BackupKeyringParcel parcel = BackupKeyringParcel.create(
|
||||||
new long[] { mStaticRing1.getMasterKeyId() }, false, true, true, fakeOutputUri);
|
new long[] { mStaticRing1.getMasterKeyId() }, false, true, true, fakeOutputUri);
|
||||||
@@ -330,8 +330,8 @@ public class BackupOperationTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
PgpDecryptVerifyOperation op = new PgpDecryptVerifyOperation(RuntimeEnvironment.application,
|
PgpDecryptVerifyOperation op = new PgpDecryptVerifyOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
PgpDecryptVerifyInputParcel input = PgpDecryptVerifyInputParcel.builder()
|
PgpDecryptVerifyInputParcel input = PgpDecryptVerifyInputParcel.builder()
|
||||||
.setAllowSymmetricDecryption(true)
|
.setAllowSymmetricDecryption(true)
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ public class BenchmarkOperationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBenchmark() throws Exception {
|
public void testBenchmark() throws Exception {
|
||||||
BenchmarkOperation op = new BenchmarkOperation(RuntimeEnvironment.application,
|
BenchmarkOperation op = new BenchmarkOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
op.execute(BenchmarkInputParcel.newInstance(), null);
|
op.execute(BenchmarkInputParcel.newInstance(), null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public class CertifyOperationTest {
|
|||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
KeyWritableRepository databaseInteractor =
|
KeyWritableRepository databaseInteractor =
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication());
|
||||||
|
|
||||||
// don't log verbosely here, we're not here to test imports
|
// don't log verbosely here, we're not here to test imports
|
||||||
ShadowLog.stream = oldShadowStream;
|
ShadowLog.stream = oldShadowStream;
|
||||||
@@ -133,7 +133,7 @@ public class CertifyOperationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testSelfCertifyFlag() throws Exception {
|
public void testSelfCertifyFlag() throws Exception {
|
||||||
|
|
||||||
CanonicalizedPublicKeyRing ring = KeyWritableRepository.create(RuntimeEnvironment.application)
|
CanonicalizedPublicKeyRing ring = KeyWritableRepository.create(RuntimeEnvironment.getApplication())
|
||||||
.getCanonicalizedPublicKeyRing(mStaticRing1.getMasterKeyId());
|
.getCanonicalizedPublicKeyRing(mStaticRing1.getMasterKeyId());
|
||||||
Assert.assertEquals("secret key must be marked self-certified in database",
|
Assert.assertEquals("secret key must be marked self-certified in database",
|
||||||
// TODO this should be more correctly be VERIFIED_SELF at some point!
|
// TODO this should be more correctly be VERIFIED_SELF at some point!
|
||||||
@@ -143,11 +143,11 @@ public class CertifyOperationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCertifyId() throws Exception {
|
public void testCertifyId() throws Exception {
|
||||||
CertifyOperation op = new CertifyOperation(RuntimeEnvironment.application,
|
CertifyOperation op = new CertifyOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null, null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null, null);
|
||||||
|
|
||||||
{
|
{
|
||||||
CanonicalizedPublicKeyRing ring = KeyWritableRepository.create(RuntimeEnvironment.application)
|
CanonicalizedPublicKeyRing ring = KeyWritableRepository.create(RuntimeEnvironment.getApplication())
|
||||||
.getCanonicalizedPublicKeyRing(mStaticRing2.getMasterKeyId());
|
.getCanonicalizedPublicKeyRing(mStaticRing2.getMasterKeyId());
|
||||||
Assert.assertNull("public key must not be marked verified prior to certification",
|
Assert.assertNull("public key must not be marked verified prior to certification",
|
||||||
ring.getVerified());
|
ring.getVerified());
|
||||||
@@ -161,7 +161,7 @@ public class CertifyOperationTest {
|
|||||||
Assert.assertTrue("certification must succeed", result.success());
|
Assert.assertTrue("certification must succeed", result.success());
|
||||||
|
|
||||||
{
|
{
|
||||||
CanonicalizedPublicKeyRing ring = KeyWritableRepository.create(RuntimeEnvironment.application)
|
CanonicalizedPublicKeyRing ring = KeyWritableRepository.create(RuntimeEnvironment.getApplication())
|
||||||
.getCanonicalizedPublicKeyRing(mStaticRing2.getMasterKeyId());
|
.getCanonicalizedPublicKeyRing(mStaticRing2.getMasterKeyId());
|
||||||
Assert.assertEquals("new key must be verified now",
|
Assert.assertEquals("new key must be verified now",
|
||||||
VerificationStatus.VERIFIED_SECRET, ring.getVerified());
|
VerificationStatus.VERIFIED_SECRET, ring.getVerified());
|
||||||
@@ -171,8 +171,8 @@ public class CertifyOperationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCertifyAttribute() throws Exception {
|
public void testCertifyAttribute() throws Exception {
|
||||||
KeyWritableRepository keyWritableRepository = KeyWritableRepository.create(RuntimeEnvironment.application);
|
KeyWritableRepository keyWritableRepository = KeyWritableRepository.create(RuntimeEnvironment.getApplication());
|
||||||
CertifyOperation op = new CertifyOperation(RuntimeEnvironment.application, keyWritableRepository, null, null);
|
CertifyOperation op = new CertifyOperation(RuntimeEnvironment.getApplication(), keyWritableRepository, null, null);
|
||||||
|
|
||||||
{
|
{
|
||||||
CanonicalizedPublicKeyRing ring = keyWritableRepository.getCanonicalizedPublicKeyRing(mStaticRing2.getMasterKeyId());
|
CanonicalizedPublicKeyRing ring = keyWritableRepository.getCanonicalizedPublicKeyRing(mStaticRing2.getMasterKeyId());
|
||||||
@@ -198,8 +198,8 @@ public class CertifyOperationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCertifySelf() throws Exception {
|
public void testCertifySelf() throws Exception {
|
||||||
CertifyOperation op = new CertifyOperation(RuntimeEnvironment.application,
|
CertifyOperation op = new CertifyOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null, null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null, null);
|
||||||
|
|
||||||
CertifyActionsParcel.Builder actions = CertifyActionsParcel.builder(mStaticRing1.getMasterKeyId());
|
CertifyActionsParcel.Builder actions = CertifyActionsParcel.builder(mStaticRing1.getMasterKeyId());
|
||||||
actions.addAction(CertifyAction.createForUserIds(mStaticRing1.getMasterKeyId(),
|
actions.addAction(CertifyAction.createForUserIds(mStaticRing1.getMasterKeyId(),
|
||||||
@@ -215,8 +215,8 @@ public class CertifyOperationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testCertifyNonexistent() throws Exception {
|
public void testCertifyNonexistent() throws Exception {
|
||||||
|
|
||||||
CertifyOperation op = new CertifyOperation(RuntimeEnvironment.application,
|
CertifyOperation op = new CertifyOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null, null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null, null);
|
||||||
|
|
||||||
{
|
{
|
||||||
CertifyActionsParcel.Builder actions = CertifyActionsParcel.builder(mStaticRing1.getMasterKeyId());
|
CertifyActionsParcel.Builder actions = CertifyActionsParcel.builder(mStaticRing1.getMasterKeyId());
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public class PromoteKeyOperationTest {
|
|||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
KeyWritableRepository databaseInteractor =
|
KeyWritableRepository databaseInteractor =
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication());
|
||||||
|
|
||||||
// don't log verbosely here, we're not here to test imports
|
// don't log verbosely here, we're not here to test imports
|
||||||
ShadowLog.stream = oldShadowStream;
|
ShadowLog.stream = oldShadowStream;
|
||||||
@@ -105,8 +105,8 @@ public class PromoteKeyOperationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPromote() throws Exception {
|
public void testPromote() throws Exception {
|
||||||
KeyWritableRepository keyRepository = KeyWritableRepository.create(RuntimeEnvironment.application);
|
KeyWritableRepository keyRepository = KeyWritableRepository.create(RuntimeEnvironment.getApplication());
|
||||||
PromoteKeyOperation op = new PromoteKeyOperation(RuntimeEnvironment.application,
|
PromoteKeyOperation op = new PromoteKeyOperation(RuntimeEnvironment.getApplication(),
|
||||||
keyRepository, null, null);
|
keyRepository, null, null);
|
||||||
|
|
||||||
PromoteKeyResult result = op.execute(
|
PromoteKeyResult result = op.execute(
|
||||||
@@ -130,8 +130,8 @@ public class PromoteKeyOperationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPromoteDivert() throws Exception {
|
public void testPromoteDivert() throws Exception {
|
||||||
PromoteKeyOperation op = new PromoteKeyOperation(RuntimeEnvironment.application,
|
PromoteKeyOperation op = new PromoteKeyOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null, null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null, null);
|
||||||
|
|
||||||
byte[] aid = Hex.decode("D2760001240102000000012345670000");
|
byte[] aid = Hex.decode("D2760001240102000000012345670000");
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ public class PromoteKeyOperationTest {
|
|||||||
Assert.assertTrue("promotion must succeed", result.success());
|
Assert.assertTrue("promotion must succeed", result.success());
|
||||||
|
|
||||||
{
|
{
|
||||||
CanonicalizedSecretKeyRing ring = KeyWritableRepository.create(RuntimeEnvironment.application)
|
CanonicalizedSecretKeyRing ring = KeyWritableRepository.create(RuntimeEnvironment.getApplication())
|
||||||
.getCanonicalizedSecretKeyRing(mStaticRing.getMasterKeyId());
|
.getCanonicalizedSecretKeyRing(mStaticRing.getMasterKeyId());
|
||||||
|
|
||||||
for (CanonicalizedSecretKey key : ring.secretKeyIterator()) {
|
for (CanonicalizedSecretKey key : ring.secretKeyIterator()) {
|
||||||
@@ -156,8 +156,8 @@ public class PromoteKeyOperationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPromoteDivertSpecific() throws Exception {
|
public void testPromoteDivertSpecific() throws Exception {
|
||||||
PromoteKeyOperation op = new PromoteKeyOperation(RuntimeEnvironment.application,
|
PromoteKeyOperation op = new PromoteKeyOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null, null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null, null);
|
||||||
|
|
||||||
byte[] aid = Hex.decode("D2760001240102000000012345670000");
|
byte[] aid = Hex.decode("D2760001240102000000012345670000");
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ public class PromoteKeyOperationTest {
|
|||||||
Assert.assertTrue("promotion must succeed", result.success());
|
Assert.assertTrue("promotion must succeed", result.success());
|
||||||
|
|
||||||
{
|
{
|
||||||
CanonicalizedSecretKeyRing ring = KeyWritableRepository.create(RuntimeEnvironment.application)
|
CanonicalizedSecretKeyRing ring = KeyWritableRepository.create(RuntimeEnvironment.getApplication())
|
||||||
.getCanonicalizedSecretKeyRing(mStaticRing.getMasterKeyId());
|
.getCanonicalizedSecretKeyRing(mStaticRing.getMasterKeyId());
|
||||||
|
|
||||||
for (CanonicalizedSecretKey key : ring.secretKeyIterator()) {
|
for (CanonicalizedSecretKey key : ring.secretKeyIterator()) {
|
||||||
|
|||||||
@@ -126,11 +126,11 @@ public class InputDataOperationTest {
|
|||||||
.thenReturn(fakeOutputUri1, fakeOutputUri2);
|
.thenReturn(fakeOutputUri1, fakeOutputUri2);
|
||||||
|
|
||||||
// application which returns mockresolver
|
// application which returns mockresolver
|
||||||
Application spyApplication = spy(RuntimeEnvironment.application);
|
Application spyApplication = spy(RuntimeEnvironment.getApplication());
|
||||||
when(spyApplication.getContentResolver()).thenReturn(mockResolver);
|
when(spyApplication.getContentResolver()).thenReturn(mockResolver);
|
||||||
|
|
||||||
InputDataOperation op = new InputDataOperation(spyApplication,
|
InputDataOperation op = new InputDataOperation(spyApplication,
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
InputDataParcel input = InputDataParcel.createInputDataParcel(fakeInputUri, null);
|
InputDataParcel input = InputDataParcel.createInputDataParcel(fakeInputUri, null);
|
||||||
|
|
||||||
@@ -306,11 +306,11 @@ public class InputDataOperationTest {
|
|||||||
.thenReturn(fakeOutputUri1);
|
.thenReturn(fakeOutputUri1);
|
||||||
|
|
||||||
// application which returns mockresolver
|
// application which returns mockresolver
|
||||||
Application spyApplication = spy(RuntimeEnvironment.application);
|
Application spyApplication = spy(RuntimeEnvironment.getApplication());
|
||||||
when(spyApplication.getContentResolver()).thenReturn(mockResolver);
|
when(spyApplication.getContentResolver()).thenReturn(mockResolver);
|
||||||
|
|
||||||
InputDataOperation op = new InputDataOperation(spyApplication,
|
InputDataOperation op = new InputDataOperation(spyApplication,
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
InputDataParcel input = InputDataParcel.createInputDataParcel(FAKE_CONTENT_INPUT_URI_1, null);
|
InputDataParcel input = InputDataParcel.createInputDataParcel(FAKE_CONTENT_INPUT_URI_1, null);
|
||||||
return op.execute(input, CryptoInputParcel.createCryptoInputParcel());
|
return op.execute(input, CryptoInputParcel.createCryptoInputParcel());
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ public class PgpEncryptDecryptTest {
|
|||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
KeyWritableRepository databaseInteractor =
|
KeyWritableRepository databaseInteractor =
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication());
|
||||||
|
|
||||||
// don't log verbosely here, we're not here to test imports
|
// don't log verbosely here, we're not here to test imports
|
||||||
ShadowLog.stream = oldShadowStream;
|
ShadowLog.stream = oldShadowStream;
|
||||||
@@ -171,8 +171,8 @@ public class PgpEncryptDecryptTest {
|
|||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
||||||
|
|
||||||
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.application,
|
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
InputData data = new InputData(in, in.available());
|
InputData data = new InputData(in, in.available());
|
||||||
|
|
||||||
@@ -195,8 +195,8 @@ public class PgpEncryptDecryptTest {
|
|||||||
ByteArrayInputStream in = new ByteArrayInputStream(ciphertext);
|
ByteArrayInputStream in = new ByteArrayInputStream(ciphertext);
|
||||||
InputData data = new InputData(in, in.available());
|
InputData data = new InputData(in, in.available());
|
||||||
|
|
||||||
PgpDecryptVerifyOperation op = new PgpDecryptVerifyOperation(RuntimeEnvironment.application,
|
PgpDecryptVerifyOperation op = new PgpDecryptVerifyOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
PgpDecryptVerifyInputParcel input = PgpDecryptVerifyInputParcel.builder()
|
PgpDecryptVerifyInputParcel input = PgpDecryptVerifyInputParcel.builder()
|
||||||
.setAllowSymmetricDecryption(true)
|
.setAllowSymmetricDecryption(true)
|
||||||
.build();
|
.build();
|
||||||
@@ -226,8 +226,8 @@ public class PgpEncryptDecryptTest {
|
|||||||
ByteArrayInputStream in = new ByteArrayInputStream(ciphertext);
|
ByteArrayInputStream in = new ByteArrayInputStream(ciphertext);
|
||||||
InputData data = new InputData(in, in.available());
|
InputData data = new InputData(in, in.available());
|
||||||
|
|
||||||
PgpDecryptVerifyOperation op = new PgpDecryptVerifyOperation(RuntimeEnvironment.application,
|
PgpDecryptVerifyOperation op = new PgpDecryptVerifyOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
PgpDecryptVerifyInputParcel input = PgpDecryptVerifyInputParcel.builder()
|
PgpDecryptVerifyInputParcel input = PgpDecryptVerifyInputParcel.builder()
|
||||||
.setAllowSymmetricDecryption(true)
|
.setAllowSymmetricDecryption(true)
|
||||||
.build();
|
.build();
|
||||||
@@ -249,8 +249,8 @@ public class PgpEncryptDecryptTest {
|
|||||||
ByteArrayInputStream in = new ByteArrayInputStream(ciphertext);
|
ByteArrayInputStream in = new ByteArrayInputStream(ciphertext);
|
||||||
InputData data = new InputData(in, in.available());
|
InputData data = new InputData(in, in.available());
|
||||||
|
|
||||||
PgpDecryptVerifyOperation op = new PgpDecryptVerifyOperation(RuntimeEnvironment.application,
|
PgpDecryptVerifyOperation op = new PgpDecryptVerifyOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
PgpDecryptVerifyInputParcel input = PgpDecryptVerifyInputParcel.builder()
|
PgpDecryptVerifyInputParcel input = PgpDecryptVerifyInputParcel.builder()
|
||||||
.setAllowSymmetricDecryption(true)
|
.setAllowSymmetricDecryption(true)
|
||||||
.build();
|
.build();
|
||||||
@@ -271,8 +271,8 @@ public class PgpEncryptDecryptTest {
|
|||||||
ByteArrayInputStream in = new ByteArrayInputStream(ciphertext);
|
ByteArrayInputStream in = new ByteArrayInputStream(ciphertext);
|
||||||
InputData data = new InputData(in, in.available());
|
InputData data = new InputData(in, in.available());
|
||||||
|
|
||||||
PgpDecryptVerifyOperation op = new PgpDecryptVerifyOperation(RuntimeEnvironment.application,
|
PgpDecryptVerifyOperation op = new PgpDecryptVerifyOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
PgpDecryptVerifyInputParcel input = PgpDecryptVerifyInputParcel.builder().build();
|
PgpDecryptVerifyInputParcel input = PgpDecryptVerifyInputParcel.builder().build();
|
||||||
DecryptVerifyResult result = op.execute(input,
|
DecryptVerifyResult result = op.execute(input,
|
||||||
CryptoInputParcel.createCryptoInputParcel(), data, out);
|
CryptoInputParcel.createCryptoInputParcel(), data, out);
|
||||||
@@ -297,8 +297,8 @@ public class PgpEncryptDecryptTest {
|
|||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
||||||
|
|
||||||
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.application,
|
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
InputData data = new InputData(in, in.available());
|
InputData data = new InputData(in, in.available());
|
||||||
|
|
||||||
@@ -352,8 +352,8 @@ public class PgpEncryptDecryptTest {
|
|||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
||||||
|
|
||||||
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.application,
|
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
InputData data = new InputData(in, in.available());
|
InputData data = new InputData(in, in.available());
|
||||||
|
|
||||||
@@ -413,8 +413,8 @@ public class PgpEncryptDecryptTest {
|
|||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
||||||
|
|
||||||
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.application,
|
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
InputData data = new InputData(in, in.available());
|
InputData data = new InputData(in, in.available());
|
||||||
|
|
||||||
@@ -470,8 +470,8 @@ public class PgpEncryptDecryptTest {
|
|||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
||||||
|
|
||||||
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.application,
|
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
InputData data = new InputData(in, in.available());
|
InputData data = new InputData(in, in.available());
|
||||||
|
|
||||||
@@ -572,8 +572,8 @@ public class PgpEncryptDecryptTest {
|
|||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
||||||
|
|
||||||
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.application,
|
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
InputData data = new InputData(in, in.available());
|
InputData data = new InputData(in, in.available());
|
||||||
|
|
||||||
@@ -624,11 +624,11 @@ public class PgpEncryptDecryptTest {
|
|||||||
CryptoInputParcel.createCryptoInputParcel(new Date(), mKeyPhrase1));
|
CryptoInputParcel.createCryptoInputParcel(new Date(), mKeyPhrase1));
|
||||||
|
|
||||||
KeyWritableRepository databaseInteractor =
|
KeyWritableRepository databaseInteractor =
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication());
|
||||||
databaseInteractor.saveSecretKeyRing(modified);
|
databaseInteractor.saveSecretKeyRing(modified);
|
||||||
|
|
||||||
PgpDecryptVerifyOperation op = new PgpDecryptVerifyOperation(RuntimeEnvironment.application,
|
PgpDecryptVerifyOperation op = new PgpDecryptVerifyOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
PgpDecryptVerifyInputParcel input = PgpDecryptVerifyInputParcel.builder()
|
PgpDecryptVerifyInputParcel input = PgpDecryptVerifyInputParcel.builder()
|
||||||
.setInputBytes(ciphertext)
|
.setInputBytes(ciphertext)
|
||||||
.build();
|
.build();
|
||||||
@@ -649,11 +649,11 @@ public class PgpEncryptDecryptTest {
|
|||||||
CryptoInputParcel.createCryptoInputParcel(new Date(), mKeyPhrase1));
|
CryptoInputParcel.createCryptoInputParcel(new Date(), mKeyPhrase1));
|
||||||
|
|
||||||
KeyWritableRepository databaseInteractor =
|
KeyWritableRepository databaseInteractor =
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication());
|
||||||
databaseInteractor.saveSecretKeyRing(modified);
|
databaseInteractor.saveSecretKeyRing(modified);
|
||||||
|
|
||||||
PgpDecryptVerifyOperation op = new PgpDecryptVerifyOperation(RuntimeEnvironment.application,
|
PgpDecryptVerifyOperation op = new PgpDecryptVerifyOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
PgpDecryptVerifyInputParcel input = PgpDecryptVerifyInputParcel.builder()
|
PgpDecryptVerifyInputParcel input = PgpDecryptVerifyInputParcel.builder()
|
||||||
.setInputBytes(ciphertext)
|
.setInputBytes(ciphertext)
|
||||||
.build();
|
.build();
|
||||||
@@ -680,7 +680,7 @@ public class PgpEncryptDecryptTest {
|
|||||||
CryptoInputParcel.createCryptoInputParcel(new Date(), mKeyPhrase1));
|
CryptoInputParcel.createCryptoInputParcel(new Date(), mKeyPhrase1));
|
||||||
|
|
||||||
KeyWritableRepository databaseInteractor =
|
KeyWritableRepository databaseInteractor =
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication());
|
||||||
databaseInteractor.saveSecretKeyRing(modified);
|
databaseInteractor.saveSecretKeyRing(modified);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -689,8 +689,8 @@ public class PgpEncryptDecryptTest {
|
|||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
||||||
|
|
||||||
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.application,
|
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
InputData data = new InputData(in, in.available());
|
InputData data = new InputData(in, in.available());
|
||||||
|
|
||||||
@@ -733,8 +733,8 @@ public class PgpEncryptDecryptTest {
|
|||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
||||||
|
|
||||||
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.application,
|
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
InputData data = new InputData(in, in.available());
|
InputData data = new InputData(in, in.available());
|
||||||
|
|
||||||
@@ -829,7 +829,7 @@ public class PgpEncryptDecryptTest {
|
|||||||
{ // decryption with passphrase cached should succeed for the other key if first is gone
|
{ // decryption with passphrase cached should succeed for the other key if first is gone
|
||||||
|
|
||||||
// delete first key from database
|
// delete first key from database
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application).deleteKeyRing(mStaticRing1.getMasterKeyId());
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()).deleteKeyRing(mStaticRing1.getMasterKeyId());
|
||||||
|
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(ciphertext);
|
ByteArrayInputStream in = new ByteArrayInputStream(ciphertext);
|
||||||
@@ -861,8 +861,8 @@ public class PgpEncryptDecryptTest {
|
|||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
ByteArrayInputStream in = new ByteArrayInputStream(plaintext.getBytes());
|
||||||
|
|
||||||
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.application,
|
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
InputData data = new InputData(in, in.available());
|
InputData data = new InputData(in, in.available());
|
||||||
|
|
||||||
@@ -908,7 +908,7 @@ public class PgpEncryptDecryptTest {
|
|||||||
{ // decryption with passphrase cached should succeed for the other key if first is gone
|
{ // decryption with passphrase cached should succeed for the other key if first is gone
|
||||||
|
|
||||||
// delete first key from database
|
// delete first key from database
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application).deleteKeyRing(mStaticRing1.getMasterKeyId());
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()).deleteKeyRing(mStaticRing1.getMasterKeyId());
|
||||||
|
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(ciphertext);
|
ByteArrayInputStream in = new ByteArrayInputStream(ciphertext);
|
||||||
@@ -944,8 +944,8 @@ public class PgpEncryptDecryptTest {
|
|||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(plaindata);
|
ByteArrayInputStream in = new ByteArrayInputStream(plaindata);
|
||||||
|
|
||||||
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.application,
|
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
InputData data = new InputData(in, in.available());
|
InputData data = new InputData(in, in.available());
|
||||||
|
|
||||||
@@ -1081,8 +1081,8 @@ public class PgpEncryptDecryptTest {
|
|||||||
private PgpDecryptVerifyOperation operationWithFakePassphraseCache(
|
private PgpDecryptVerifyOperation operationWithFakePassphraseCache(
|
||||||
final Passphrase passphrase, final Long checkMasterKeyId, final Long checkSubKeyId) {
|
final Passphrase passphrase, final Long checkMasterKeyId, final Long checkSubKeyId) {
|
||||||
|
|
||||||
return new PgpDecryptVerifyOperation(RuntimeEnvironment.application,
|
return new PgpDecryptVerifyOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application), null) {
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication()), null) {
|
||||||
@Override
|
@Override
|
||||||
public Passphrase getCachedPassphrase(long masterKeyId, long subKeyId)
|
public Passphrase getCachedPassphrase(long masterKeyId, long subKeyId)
|
||||||
throws NoSecretKeyException {
|
throws NoSecretKeyException {
|
||||||
@@ -1112,8 +1112,8 @@ public class PgpEncryptDecryptTest {
|
|||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream("dies ist ein plaintext ☭".getBytes());
|
ByteArrayInputStream in = new ByteArrayInputStream("dies ist ein plaintext ☭".getBytes());
|
||||||
|
|
||||||
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.application,
|
PgpSignEncryptOperation op = new PgpSignEncryptOperation(RuntimeEnvironment.getApplication(),
|
||||||
KeyWritableRepository.createDatabaseReadWriteInteractor(RuntimeEnvironment.application), null);
|
KeyWritableRepository.createDatabaseReadWriteInteractor(RuntimeEnvironment.getApplication()), null);
|
||||||
|
|
||||||
InputData data = new InputData(in, in.available());
|
InputData data = new InputData(in, in.available());
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class Cv25519Test {
|
|||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
context = RuntimeEnvironment.application;
|
context = RuntimeEnvironment.getApplication();
|
||||||
keyRepository = KeyWritableRepository.create(context);
|
keyRepository = KeyWritableRepository.create(context);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public class EddsaTest {
|
|||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
context = RuntimeEnvironment.application;
|
context = RuntimeEnvironment.getApplication();
|
||||||
keyRepository = KeyWritableRepository.create(context);
|
keyRepository = KeyWritableRepository.create(context);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,14 +228,14 @@ public class InteropTest {
|
|||||||
|
|
||||||
private PgpDecryptVerifyOperation makeOperation(final String msg, final Passphrase passphrase,
|
private PgpDecryptVerifyOperation makeOperation(final String msg, final Passphrase passphrase,
|
||||||
UncachedKeyRing decrypt, UncachedKeyRing verify) {
|
UncachedKeyRing decrypt, UncachedKeyRing verify) {
|
||||||
KeyWritableRepository keyRepository = KeyWritableRepository.create(RuntimeEnvironment.application);
|
KeyWritableRepository keyRepository = KeyWritableRepository.create(RuntimeEnvironment.getApplication());
|
||||||
|
|
||||||
Assert.assertTrue(keyRepository.saveSecretKeyRing(decrypt).success());
|
Assert.assertTrue(keyRepository.saveSecretKeyRing(decrypt).success());
|
||||||
if (verify != null) {
|
if (verify != null) {
|
||||||
Assert.assertTrue(keyRepository.savePublicKeyRing(verify).success());
|
Assert.assertTrue(keyRepository.savePublicKeyRing(verify).success());
|
||||||
}
|
}
|
||||||
|
|
||||||
return new PgpDecryptVerifyOperation(RuntimeEnvironment.application, keyRepository, null) {
|
return new PgpDecryptVerifyOperation(RuntimeEnvironment.getApplication(), keyRepository, null) {
|
||||||
@Override
|
@Override
|
||||||
public Passphrase getCachedPassphrase(long masterKeyId, long subKeyId) {
|
public Passphrase getCachedPassphrase(long masterKeyId, long subKeyId) {
|
||||||
Assert.assertEquals(msg + ": passphrase should be for the secret key",
|
Assert.assertEquals(msg + ": passphrase should be for the secret key",
|
||||||
|
|||||||
@@ -34,14 +34,14 @@ public class KeyRepositoryKeyringTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSavePublicKeyring() throws Exception {
|
public void testSavePublicKeyring() throws Exception {
|
||||||
Assert.assertTrue(new KeyringTestingHelper(RuntimeEnvironment.application).addKeyring(Collections.singleton(
|
Assert.assertTrue(new KeyringTestingHelper(RuntimeEnvironment.getApplication()).addKeyring(Collections.singleton(
|
||||||
"/public-key-for-sample.blob"
|
"/public-key-for-sample.blob"
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Test
|
// @Test
|
||||||
public void testSavePublicKeyringRsa() throws Exception {
|
public void testSavePublicKeyringRsa() throws Exception {
|
||||||
Assert.assertTrue(new KeyringTestingHelper(RuntimeEnvironment.application).addKeyring(prependResourcePath(Arrays.asList(
|
Assert.assertTrue(new KeyringTestingHelper(RuntimeEnvironment.getApplication()).addKeyring(prependResourcePath(Arrays.asList(
|
||||||
"000001-006.public_key",
|
"000001-006.public_key",
|
||||||
"000002-013.user_id",
|
"000002-013.user_id",
|
||||||
"000003-002.sig",
|
"000003-002.sig",
|
||||||
@@ -62,7 +62,7 @@ public class KeyRepositoryKeyringTest {
|
|||||||
|
|
||||||
// @Test
|
// @Test
|
||||||
public void testSavePublicKeyringDsa() throws Exception {
|
public void testSavePublicKeyringDsa() throws Exception {
|
||||||
Assert.assertTrue(new KeyringTestingHelper(RuntimeEnvironment.application).addKeyring(prependResourcePath(Arrays.asList(
|
Assert.assertTrue(new KeyringTestingHelper(RuntimeEnvironment.getApplication()).addKeyring(prependResourcePath(Arrays.asList(
|
||||||
"000016-006.public_key",
|
"000016-006.public_key",
|
||||||
"000017-002.sig",
|
"000017-002.sig",
|
||||||
"000018-012.ring_trust",
|
"000018-012.ring_trust",
|
||||||
@@ -79,7 +79,7 @@ public class KeyRepositoryKeyringTest {
|
|||||||
|
|
||||||
// @Test
|
// @Test
|
||||||
public void testSavePublicKeyringDsa2() throws Exception {
|
public void testSavePublicKeyringDsa2() throws Exception {
|
||||||
Assert.assertTrue(new KeyringTestingHelper(RuntimeEnvironment.application).addKeyring(prependResourcePath(Arrays.asList(
|
Assert.assertTrue(new KeyringTestingHelper(RuntimeEnvironment.getApplication()).addKeyring(prependResourcePath(Arrays.asList(
|
||||||
"000027-006.public_key",
|
"000027-006.public_key",
|
||||||
"000028-002.sig",
|
"000028-002.sig",
|
||||||
"000029-012.ring_trust",
|
"000029-012.ring_trust",
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ import java.util.Iterator;
|
|||||||
public class KeyRepositorySaveTest {
|
public class KeyRepositorySaveTest {
|
||||||
|
|
||||||
KeyWritableRepository mDatabaseInteractor =
|
KeyWritableRepository mDatabaseInteractor =
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication());
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setUpOnce() {
|
public static void setUpOnce() {
|
||||||
@@ -65,9 +65,9 @@ public class KeyRepositorySaveTest {
|
|||||||
SaveKeyringResult result;
|
SaveKeyringResult result;
|
||||||
|
|
||||||
// insert both keys, second should fail
|
// insert both keys, second should fail
|
||||||
result = KeyWritableRepository.create(RuntimeEnvironment.application).savePublicKeyRing(first);
|
result = KeyWritableRepository.create(RuntimeEnvironment.getApplication()).savePublicKeyRing(first);
|
||||||
Assert.assertTrue("first keyring import should succeed", result.success());
|
Assert.assertTrue("first keyring import should succeed", result.success());
|
||||||
result = KeyWritableRepository.create(RuntimeEnvironment.application).savePublicKeyRing(second);
|
result = KeyWritableRepository.create(RuntimeEnvironment.getApplication()).savePublicKeyRing(second);
|
||||||
Assert.assertFalse("second keyring import should fail", result.success());
|
Assert.assertFalse("second keyring import should fail", result.success());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,9 +81,9 @@ public class KeyRepositorySaveTest {
|
|||||||
|
|
||||||
SaveKeyringResult result;
|
SaveKeyringResult result;
|
||||||
|
|
||||||
result = KeyWritableRepository.create(RuntimeEnvironment.application).savePublicKeyRing(second);
|
result = KeyWritableRepository.create(RuntimeEnvironment.getApplication()).savePublicKeyRing(second);
|
||||||
Assert.assertTrue("first keyring import should succeed", result.success());
|
Assert.assertTrue("first keyring import should succeed", result.success());
|
||||||
result = KeyWritableRepository.create(RuntimeEnvironment.application).savePublicKeyRing(first);
|
result = KeyWritableRepository.create(RuntimeEnvironment.getApplication()).savePublicKeyRing(first);
|
||||||
Assert.assertFalse("second keyring import should fail", result.success());
|
Assert.assertFalse("second keyring import should fail", result.success());
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -102,14 +102,14 @@ public class KeyRepositorySaveTest {
|
|||||||
SaveKeyringResult result;
|
SaveKeyringResult result;
|
||||||
|
|
||||||
// insert secret, this should fail because of missing self-cert
|
// insert secret, this should fail because of missing self-cert
|
||||||
result = KeyWritableRepository.create(RuntimeEnvironment.application)
|
result = KeyWritableRepository.create(RuntimeEnvironment.getApplication())
|
||||||
.saveSecretKeyRing(seckey);
|
.saveSecretKeyRing(seckey);
|
||||||
Assert.assertFalse("secret keyring import before pubring import should fail", result.success());
|
Assert.assertFalse("secret keyring import before pubring import should fail", result.success());
|
||||||
|
|
||||||
// insert pubkey, then seckey - both should succeed
|
// insert pubkey, then seckey - both should succeed
|
||||||
result = KeyWritableRepository.create(RuntimeEnvironment.application).savePublicKeyRing(pubkey);
|
result = KeyWritableRepository.create(RuntimeEnvironment.getApplication()).savePublicKeyRing(pubkey);
|
||||||
Assert.assertTrue("public keyring import should succeed", result.success());
|
Assert.assertTrue("public keyring import should succeed", result.success());
|
||||||
result = KeyWritableRepository.create(RuntimeEnvironment.application)
|
result = KeyWritableRepository.create(RuntimeEnvironment.getApplication())
|
||||||
.saveSecretKeyRing(seckey);
|
.saveSecretKeyRing(seckey);
|
||||||
Assert.assertTrue("secret keyring import after pubring import should succeed", result.success());
|
Assert.assertTrue("secret keyring import after pubring import should succeed", result.success());
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class KeyRepositoryTest {
|
|||||||
testKeyring = KeyringTestingHelper.readRingFromResource("/test-keys/authenticate_multisub_with_revoked.asc");
|
testKeyring = KeyringTestingHelper.readRingFromResource("/test-keys/authenticate_multisub_with_revoked.asc");
|
||||||
|
|
||||||
KeyWritableRepository databaseInteractor =
|
KeyWritableRepository databaseInteractor =
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication());
|
||||||
databaseInteractor.saveSecretKeyRing(testKeyring);
|
databaseInteractor.saveSecretKeyRing(testKeyring);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ public class KeyRepositoryTest {
|
|||||||
long expectedEncryptSubKeyId = KeyFormattingUtils.convertKeyIdHexToKeyId("0xDA7207E385A44339");
|
long expectedEncryptSubKeyId = KeyFormattingUtils.convertKeyIdHexToKeyId("0xDA7207E385A44339");
|
||||||
long expectedSignSubKeyId = KeyFormattingUtils.convertKeyIdHexToKeyId("0xB8ECA89E054028D5");
|
long expectedSignSubKeyId = KeyFormattingUtils.convertKeyIdHexToKeyId("0xB8ECA89E054028D5");
|
||||||
|
|
||||||
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.application);
|
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.getApplication());
|
||||||
|
|
||||||
long masterKeyId = testKeyring.getMasterKeyId();
|
long masterKeyId = testKeyring.getMasterKeyId();
|
||||||
long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
|
long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class KeychainExternalProviderTest {
|
|||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
ShadowLog.stream = System.out;
|
ShadowLog.stream = System.out;
|
||||||
|
|
||||||
ShadowPackageManager packageManager = shadowOf(RuntimeEnvironment.application.getPackageManager());
|
ShadowPackageManager packageManager = shadowOf(RuntimeEnvironment.getApplication().getPackageManager());
|
||||||
packageManager.setPackagesForUid(PACKAGE_UID, PACKAGE_NAME);
|
packageManager.setPackagesForUid(PACKAGE_UID, PACKAGE_NAME);
|
||||||
PackageInfo packageInfo = new PackageInfo();
|
PackageInfo packageInfo = new PackageInfo();
|
||||||
packageInfo.signatures = new Signature[] { new Signature(PACKAGE_SIGNATURE) };
|
packageInfo.signatures = new Signature[] { new Signature(PACKAGE_SIGNATURE) };
|
||||||
@@ -81,9 +81,9 @@ public class KeychainExternalProviderTest {
|
|||||||
info.authority = KeychainExternalContract.CONTENT_AUTHORITY_EXTERNAL;
|
info.authority = KeychainExternalContract.CONTENT_AUTHORITY_EXTERNAL;
|
||||||
Robolectric.buildContentProvider(KeychainExternalProvider.class).create(info);
|
Robolectric.buildContentProvider(KeychainExternalProvider.class).create(info);
|
||||||
|
|
||||||
apiAppDao = ApiAppDao.getInstance(RuntimeEnvironment.application);
|
apiAppDao = ApiAppDao.getInstance(RuntimeEnvironment.getApplication());
|
||||||
apiPermissionHelper = new ApiPermissionHelper(RuntimeEnvironment.application, apiAppDao);
|
apiPermissionHelper = new ApiPermissionHelper(RuntimeEnvironment.getApplication(), apiAppDao);
|
||||||
autocryptPeerDao = AutocryptPeerDao.getInstance(RuntimeEnvironment.application);
|
autocryptPeerDao = AutocryptPeerDao.getInstance(RuntimeEnvironment.getApplication());
|
||||||
|
|
||||||
apiAppDao.insertApiApp(PACKAGE_NAME, PACKAGE_SIGNATURE);
|
apiAppDao.insertApiApp(PACKAGE_NAME, PACKAGE_SIGNATURE);
|
||||||
}
|
}
|
||||||
@@ -329,7 +329,7 @@ public class KeychainExternalProviderTest {
|
|||||||
certifyActionsParcel.addAction(
|
certifyActionsParcel.addAction(
|
||||||
CertifyAction.createForUserIds(publicMasterKeyId, Collections.singletonList(userId)));
|
CertifyAction.createForUserIds(publicMasterKeyId, Collections.singletonList(userId)));
|
||||||
CertifyOperation op = new CertifyOperation(
|
CertifyOperation op = new CertifyOperation(
|
||||||
RuntimeEnvironment.application, databaseInteractor, new ProgressScaler(), null);
|
RuntimeEnvironment.getApplication(), databaseInteractor, new ProgressScaler(), null);
|
||||||
CertifyResult certifyResult = op.execute(certifyActionsParcel.build(), CryptoInputParcel.createCryptoInputParcel());
|
CertifyResult certifyResult = op.execute(certifyActionsParcel.build(), CryptoInputParcel.createCryptoInputParcel());
|
||||||
|
|
||||||
assertTrue(certifyResult.success());
|
assertTrue(certifyResult.success());
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class SecurityTokenConnectionTest {
|
|||||||
"c59cd0f2a59cd0af059cd0c959000"); // get application related data
|
"c59cd0f2a59cd0af059cd0c959000"); // get application related data
|
||||||
|
|
||||||
|
|
||||||
securityTokenConnection.connectToDevice(RuntimeEnvironment.application);
|
securityTokenConnection.connectToDevice(RuntimeEnvironment.getApplication());
|
||||||
|
|
||||||
|
|
||||||
verify(transport).connect();
|
verify(transport).connect();
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class SshPublicKeyTest {
|
|||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
KeyWritableRepository databaseInteractor =
|
KeyWritableRepository databaseInteractor =
|
||||||
KeyWritableRepository.create(RuntimeEnvironment.application);
|
KeyWritableRepository.create(RuntimeEnvironment.getApplication());
|
||||||
|
|
||||||
// don't log verbosely here, we're not here to test imports
|
// don't log verbosely here, we're not here to test imports
|
||||||
ShadowLog.stream = oldShadowStream;
|
ShadowLog.stream = oldShadowStream;
|
||||||
@@ -73,7 +73,7 @@ public class SshPublicKeyTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testECDSA() throws Exception {
|
public void testECDSA() throws Exception {
|
||||||
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.application);
|
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.getApplication());
|
||||||
|
|
||||||
long masterKeyId = mStaticRingEcDsa.getMasterKeyId();
|
long masterKeyId = mStaticRingEcDsa.getMasterKeyId();
|
||||||
long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
|
long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class ParcelableFileCacheTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testInputOutput() throws Exception {
|
public void testInputOutput() throws Exception {
|
||||||
|
|
||||||
ParcelableFileCache<Bundle> cache = new ParcelableFileCache<Bundle>(RuntimeEnvironment.application, "test.pcl");
|
ParcelableFileCache<Bundle> cache = new ParcelableFileCache<Bundle>(RuntimeEnvironment.getApplication(), "test.pcl");
|
||||||
|
|
||||||
ArrayList<Bundle> list = new ArrayList<Bundle>();
|
ArrayList<Bundle> list = new ArrayList<Bundle>();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user