Update to latest zxing QR code scanner.

Closes #2078

// FREEBIE
This commit is contained in:
Moxie Marlinspike
2014-11-22 09:47:02 -08:00
parent 31eddbf346
commit d42c4229fd
4 changed files with 10 additions and 339 deletions

View File

@@ -23,13 +23,13 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.Toast;
import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;
import org.thoughtcrime.securesms.util.Base64;
import org.whispersystems.libaxolotl.IdentityKey;
import org.thoughtcrime.securesms.util.Dialogs;
import org.thoughtcrime.securesms.util.DynamicTheme;
import org.whispersystems.textsecure.zxing.integration.IntentIntegrator;
import org.whispersystems.textsecure.zxing.integration.IntentResult;
import org.whispersystems.libaxolotl.IdentityKey;
/**
* Activity for initiating/receiving key QR code scans.
@@ -99,11 +99,13 @@ public abstract class KeyScanningActivity extends PassphraseRequiredActionBarAct
}
protected void initiateScan() {
IntentIntegrator.initiateScan(this);
IntentIntegrator intentIntegrator = new IntentIntegrator(this);
intentIntegrator.initiateScan();
}
protected void initiateDisplay() {
IntentIntegrator.shareText(this, Base64.encodeBytes(getIdentityKeyToDisplay().serialize()));
IntentIntegrator intentIntegrator = new IntentIntegrator(this);
intentIntegrator.shareText(Base64.encodeBytes(getIdentityKeyToDisplay().serialize()));
}
protected abstract String getScanString();