Integrate QR Code library instead of requiring the app to be installed, also due to security reasons
This commit is contained in:
@@ -10,8 +10,6 @@ dependencies {
|
||||
compile project(':extern:openkeychain-api-lib')
|
||||
compile project(':extern:html-textview')
|
||||
compile project(':extern:StickyListHeaders:library')
|
||||
compile project(':extern:zxing-qr-code')
|
||||
compile project(':extern:zxing-android-integration')
|
||||
compile project(':extern:spongycastle:core')
|
||||
compile project(':extern:spongycastle:pg')
|
||||
compile project(':extern:spongycastle:pkix')
|
||||
@@ -22,6 +20,11 @@ dependencies {
|
||||
compile project(':extern:TokenAutoComplete:library')
|
||||
compile project(':extern:safeslinger-exchange')
|
||||
compile project(':extern:android-lockpattern:code')
|
||||
|
||||
// TODO: include as submodule?:
|
||||
compile 'com.journeyapps:zxing-android-embedded:2.0.1@aar'
|
||||
compile 'com.journeyapps:zxing-android-integration:2.0.1@aar'
|
||||
compile 'com.google.zxing:core:3.0.1'
|
||||
}
|
||||
|
||||
android {
|
||||
|
||||
@@ -78,7 +78,11 @@ public class QrCodeScanActivity extends FragmentActivity {
|
||||
// scan using xzing's Barcode Scanner and return result parcel in OpenKeychain
|
||||
|
||||
returnResult = true;
|
||||
new IntentIntegrator(this).initiateScan();
|
||||
IntentIntegrator integrator = new IntentIntegrator(this);
|
||||
integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES)
|
||||
.setPrompt(getString(R.string.import_qr_code_text))
|
||||
.setResultDisplayDuration(0)
|
||||
.initiateScan();
|
||||
} else if (ACTION_QR_CODE_API.equals(action)) {
|
||||
// scan using xzing's Barcode Scanner from outside OpenKeychain
|
||||
|
||||
@@ -168,7 +172,7 @@ public class QrCodeScanActivity extends FragmentActivity {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! result.success()) {
|
||||
if (!result.success()) {
|
||||
// only return if no success...
|
||||
Intent data = new Intent();
|
||||
data.putExtras(returnData);
|
||||
|
||||
@@ -395,6 +395,7 @@
|
||||
<string name="import_qr_code_wrong">"QR Code malformed! Please try again!"</string>
|
||||
<string name="import_qr_code_too_short_fingerprint">"Fingerprint is too short (< 16 characters)"</string>
|
||||
<string name="import_qr_code_button">"Scan QR Code"</string>
|
||||
<string name="import_qr_code_text">"Place your camera over the QR Code!"</string>
|
||||
|
||||
<!-- Generic result toast -->
|
||||
<string name="view_log">"View Log"</string>
|
||||
|
||||
Reference in New Issue
Block a user