Merge pull request #318 from alexbakker/fix-bna

Make the parsing logic of the QR code URI more robust
This commit is contained in:
Michael Schättgen 2020-02-24 21:31:37 +01:00 committed by GitHub
commit 2519633265
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -101,7 +101,7 @@ public class GoogleAuthInfo {
default:
throw new GoogleAuthInfoException(String.format("unsupported otp type: %s", type));
}
} catch (OtpInfoException e) {
} catch (OtpInfoException | NumberFormatException e) {
throw new GoogleAuthInfoException(e);
}
@ -141,7 +141,7 @@ public class GoogleAuthInfo {
if (digits != null) {
info.setDigits(Integer.parseInt(digits));
}
} catch (OtpInfoException e) {
} catch (OtpInfoException | NumberFormatException e) {
throw new GoogleAuthInfoException(e);
}

View file

@ -108,7 +108,7 @@ public class ScannerActivity extends AegisActivity implements ZXingScannerView.R
public void handleResult(Result rawResult) {
try {
// parse google auth uri
GoogleAuthInfo info = GoogleAuthInfo.parseUri(rawResult.getText());
GoogleAuthInfo info = GoogleAuthInfo.parseUri(rawResult.getText().trim());
VaultEntry entry = new VaultEntry(info);
Intent intent = new Intent();