mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-25 16:38:50 -05:00
Safeslinger: get all bytes
This commit is contained in:
parent
4872fd5b2d
commit
b1c3bfa157
@ -54,8 +54,11 @@ import org.sufficientlysecure.keychain.util.Log;
|
|||||||
import org.sufficientlysecure.keychain.util.Notify;
|
import org.sufficientlysecure.keychain.util.Notify;
|
||||||
import org.sufficientlysecure.keychain.util.QrCodeUtils;
|
import org.sufficientlysecure.keychain.util.QrCodeUtils;
|
||||||
|
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
import edu.cmu.cylab.starslinger.exchange.ExchangeActivity;
|
import edu.cmu.cylab.starslinger.exchange.ExchangeActivity;
|
||||||
import edu.cmu.cylab.starslinger.exchange.ExchangeConfig;
|
import edu.cmu.cylab.starslinger.exchange.ExchangeConfig;
|
||||||
@ -253,8 +256,15 @@ public class ViewKeyShareFragment extends LoaderFragment implements
|
|||||||
ArrayList<byte[]> theirSecrets = endExchange(data);
|
ArrayList<byte[]> theirSecrets = endExchange(data);
|
||||||
Intent importIntent = new Intent(getActivity(), ImportKeysActivity.class);
|
Intent importIntent = new Intent(getActivity(), ImportKeysActivity.class);
|
||||||
importIntent.setAction(ImportKeysActivity.ACTION_IMPORT_KEY);
|
importIntent.setAction(ImportKeysActivity.ACTION_IMPORT_KEY);
|
||||||
// TODO
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
importIntent.putExtra(ImportKeysActivity.EXTRA_KEY_BYTES, theirSecrets.get(0));
|
for (byte[] t : theirSecrets) {
|
||||||
|
try {
|
||||||
|
out.write(t);
|
||||||
|
} catch (IOException e) {
|
||||||
|
Log.e(Constants.TAG, "IOException", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
importIntent.putExtra(ImportKeysActivity.EXTRA_KEY_BYTES, out.toByteArray());
|
||||||
startActivity(importIntent);
|
startActivity(importIntent);
|
||||||
break;
|
break;
|
||||||
case ExchangeActivity.RESULT_EXCHANGE_CANCELED:
|
case ExchangeActivity.RESULT_EXCHANGE_CANCELED:
|
||||||
|
Loading…
Reference in New Issue
Block a user