This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fatal Exception: java.lang.InternalError | |
at java.io.ObjectStreamClass.(ObjectStreamClass.java) | |
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:354) | |
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1165) | |
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346) | |
at java.util.ArrayList.writeObject(ArrayList.java:734) | |
at java.lang.reflect.Method.invoke(Method.java) | |
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:977) | |
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1536) | |
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1472) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Facebook SDK | |
# https://github.com/facebook/facebook-android-sdk/blob/45482361eb182bb3392386182f8f4e6c4896c2b9/facebook/proguard-project.txt | |
# https://github.com/facebook/facebook-android-sdk/blob/master/facebook-core/proguard-rules.pro | |
# https://www.guardsquare.com/en/proguard/manual/examples#serializable | |
# | |
-keepnames class * implements java.io.Serializable | |
-keepclassmembers class * implements java.io.Serializable { | |
private static final java.io.ObjectStreamField[] serialPersistentFields; | |
private void writeObject(java.io.ObjectOutputStream); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
ext { | |
jacocoVersion = project.JACOCO_VERSION | |
} | |
dependencies { | |
// To confirm JaCoCo version run: $ ./gradlew buildEnvironment | |
//region classpath "org.jacoco:org.jacoco.core:${jacocoVersion}" | |
// Resolves issue of incorrect version use in one of jacoco/android plugin inner tasks | |
classpath "org.jacoco:org.jacoco.core:${jacocoVersion}" | |
classpath "org.jacoco:org.jacoco.report:${jacocoVersion}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Force Jacoco Agent version upgrade | |
subprojects { | |
configurations.all { | |
resolutionStrategy { | |
eachDependency { details -> | |
if ('org.jacoco' == details.requested.group) { | |
details.useVersion "${jacocoVersion}" | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Copyright: 2019-*, Oleksandr Kucherenko ([email protected]) */ | |
apply plugin: 'com.android.library' | |
android { | |
/* ... default android lib OR app configuration ... */ | |
} | |
configurations { | |
repack { transitive = false } | |
compatibility { transitive = false } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val updateLibrarySourcesInExample by tasks.registering(Copy::class) { | |
into("${rootProject.projectDir}/KeychainExample/node_modules/react-native-keychain/") | |
from("${rootProject.projectDir}/android/src/"){ | |
into("android/src") | |
} | |
from("${rootProject.projectDir}/typings/"){ | |
into("typings") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.oblador.keychain; | |
import android.content.Context; | |
import android.content.SharedPreferences; | |
import android.content.pm.PackageManager; | |
import android.hardware.fingerprint.FingerprintManager; | |
import android.os.Build; | |
import androidx.annotation.NonNull; | |
import androidx.biometric.BiometricManager; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://gist.github.com/OleksandrKucherenko/34b5c72445bcf9d5519af6898afcb8fb#file-keychainmoduletests-java-L87-L92 | |
@RunWith(RobolectricTestRunner.class) | |
public class KeychainModuleTests { | |
/** | |
* Security fake provider. | |
*/ | |
private FakeProvider provider = new FakeProvider(); | |
@Before |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.oblador.keychain; | |
import java.security.Provider; | |
import java.util.HashMap; | |
public final class FakeProvider extends Provider { | |
public static final String NAME = "AndroidKeyStore"; | |
public final HashMap<String, HashMap<String, MocksForProvider>> mocks = new HashMap<>(); | |
public final HashMap<String, Object> configuration = new HashMap<>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.oblador.keychain; | |
import android.security.keystore.KeyInfo; | |
import androidx.annotation.NonNull; | |
import androidx.annotation.Nullable; | |
import org.mockito.MockSettings; | |
import org.mockito.Mockito; |