Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to invoke interface method 'java.lang.String com.oblador.keychain.cipherStorage.CipherStorage.getCipherStorageName()' on a null object reference #602

Open
MAKARD opened this issue Jun 23, 2023 · 1 comment

Comments

@MAKARD
Copy link

MAKARD commented Jun 23, 2023

Version 8.1.1

Stacktrace:
Error: Attempt to invoke interface method 'java.lang.String com.oblador.keychain.cipherStorage.CipherStorage.getCipherStorageName()' on a null object reference at Object.getGenericPasswordForOptions (index.android.bundle:58:1103) at O (index.android.bundle:748:3104) at Function.<anonymous> (index.android.bundle:747:1739) at Generator.next (<anonymous>) at n (index.android.bundle:8:70) at v (index.android.bundle:8:281) at u (index.android.bundle:100:157) at index.android.bundle:100:869 at index.android.bundle:106:1663 at k (index.android.bundle:106:498)

Affected devices and versions
image

Number of occurrences May 20-Jun 20 - 23.1k

Code sample:

import {
  getGenericPassword,
  ACCESS_CONTROL,
  ACCESSIBLE,
  SECURITY_RULES,
} from 'react-native-keychain';

const SERVICE_CREDENTIALS = 'com.myapp-keychain';

export class CredentialsManager {
  public static get = async () => {
    const options = {
      accessControl: ACCESS_CONTROL.BIOMETRY_ANY_OR_DEVICE_PASSCODE,
      accessible: ACCESSIBLE.ALWAYS,
    };

    const credentials = await getGenericPassword({
      ...options,
      service: SERVICE_CREDENTIALS,
      authenticationPrompt: {
        title: 'Confirm login to continue',
      },
      rules: SECURITY_RULES.NONE,
    });

    if (!credentials || !credentials.username || !credentials.password) {
      return false;
    }

    return {
      username: credentials.username,
      password: credentials.password,
    };
  };
}
@AlixH
Copy link

AlixH commented Sep 27, 2023

up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants