Skip to content

Instantly share code, notes, and snippets.

@OleksandrKucherenko
Created February 7, 2020 13:53
Show Gist options
  • Save OleksandrKucherenko/0083f9ac2c85270e70fa58350317ff9f to your computer and use it in GitHub Desktop.
Save OleksandrKucherenko/0083f9ac2c85270e70fa58350317ff9f to your computer and use it in GitHub Desktop.
@Test
@Config(sdk = Build.VERSION_CODES.KITKAT)
public void testExtractFacebookConceal_NoHardware_api19() throws Exception {
// GIVEN:
// API19, minimal Android version
final ReactApplicationContext context = getRNContext();
// WHEN: ask keychain for secured storage
final KeychainModule module = new KeychainModule(context);
final CipherStorage storage = module.getCipherStorageForCurrentAPILevel();
// THEN: expected Facebook cipher storage, its the only one that supports API19
assertThat(storage, notNullValue());
assertThat(storage, instanceOf(CipherStorageFacebookConceal.class));
assertThat(storage.isBiometrySupported(), is(false));
assertThat(storage.securityLevel(), is(SecurityLevel.ANY));
assertThat(storage.getMinSupportedApiLevel(), is(Build.VERSION_CODES.JELLY_BEAN));
assertThat(storage.supportsSecureHardware(), is(false));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment