Java Code Examples for org.telegram.messenger.support.fingerprint.FingerprintManagerCompat#CryptoObject

The following examples show how to use org.telegram.messenger.support.fingerprint.FingerprintManagerCompat#CryptoObject . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestActivity.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
private void prepareSensor() {
    isKeyCreated();
    initCipher(Cipher.DECRYPT_MODE);
    FingerprintManagerCompat.CryptoObject cryptoObject = new FingerprintManagerCompat.CryptoObject(cipher);

    if (cryptoObject != null) {
        Toast.makeText(getParentActivity(), "use fingerprint to login", Toast.LENGTH_LONG).show();
        fingerprintHelper = new FingerprintHelper(getParentActivity());
        fingerprintHelper.startAuth(cryptoObject);
    } else {
        Toast.makeText(getParentActivity(), "new fingerprint enrolled. enter pin again", Toast.LENGTH_SHORT).show();
    }
}
 
Example 2
Source File: TestActivity.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
private void prepareSensor() {
    isKeyCreated();
    initCipher(Cipher.DECRYPT_MODE);
    FingerprintManagerCompat.CryptoObject cryptoObject = new FingerprintManagerCompat.CryptoObject(cipher);

    if (cryptoObject != null) {
        Toast.makeText(getParentActivity(), "use fingerprint to login", Toast.LENGTH_LONG).show();
        fingerprintHelper = new FingerprintHelper(getParentActivity());
        fingerprintHelper.startAuth(cryptoObject);
    } else {
        Toast.makeText(getParentActivity(), "new fingerprint enrolled. enter pin again", Toast.LENGTH_SHORT).show();
    }
}
 
Example 3
Source File: TestActivity.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
void startAuth(FingerprintManagerCompat.CryptoObject cryptoObject) {
    mCancellationSignal = new CancellationSignal();
    FingerprintManagerCompat manager = FingerprintManagerCompat.from(mContext);
    manager.authenticate(cryptoObject, 0, mCancellationSignal, this, null);
}
 
Example 4
Source File: TestActivity.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
void startAuth(FingerprintManagerCompat.CryptoObject cryptoObject) {
    mCancellationSignal = new CancellationSignal();
    FingerprintManagerCompat manager = FingerprintManagerCompat.from(mContext);
    manager.authenticate(cryptoObject, 0, mCancellationSignal, this, null);
}