mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 11:12:15 -05:00
KEY_IMPORT to IMPORT_KEY
This commit is contained in:
parent
1aabeefab7
commit
0ee205d245
@ -48,15 +48,15 @@ import com.google.zxing.integration.android.IntentIntegrator;
|
||||
import com.google.zxing.integration.android.IntentResult;
|
||||
|
||||
public class ImportKeysActivity extends SherlockFragmentActivity {
|
||||
public static final String ACTION_KEY_IMPORT = Constants.INTENT_PREFIX + "KEY_IMPORT";
|
||||
public static final String ACTION_KEY_IMPORT_FROM_QR_CODE = Constants.INTENT_PREFIX
|
||||
+ "KEY_IMPORT_FROM_QR_CODE";
|
||||
public static final String ACTION_IMPORT_KEY = Constants.INTENT_PREFIX + "IMPORT_KEY";
|
||||
public static final String ACTION_IMPORT_KEY_FROM_QR_CODE = Constants.INTENT_PREFIX
|
||||
+ "IMPORT_KEY_FROM_QR_CODE";
|
||||
|
||||
// Actions for internal use only:
|
||||
public static final String ACTION_KEY_IMPORT_FROM_FILE = Constants.INTENT_PREFIX
|
||||
+ "KEY_IMPORT_FROM_FILE";
|
||||
public static final String ACTION_KEY_IMPORT_FROM_NFC = Constants.INTENT_PREFIX
|
||||
+ "KEY_IMPORT_FROM_NFC";
|
||||
public static final String ACTION_IMPOR_KEY_FROM_FILE = Constants.INTENT_PREFIX
|
||||
+ "IMPORT_KEY_FROM_FILE";
|
||||
public static final String ACTION_IMPORT_KEY_FROM_NFC = Constants.INTENT_PREFIX
|
||||
+ "IMPORT_KEY_FROM_NFC";
|
||||
|
||||
// only used by IMPORT
|
||||
public static final String EXTRA_KEYRING_BYTES = "keyring_bytes";
|
||||
@ -145,13 +145,13 @@ public class ImportKeysActivity extends SherlockFragmentActivity {
|
||||
if (Intent.ACTION_VIEW.equals(action)) {
|
||||
// Android's Action when opening file associated to Keychain (see AndroidManifest.xml)
|
||||
// override action to delegate it to Keychains ACTION_IMPORT
|
||||
action = ACTION_KEY_IMPORT;
|
||||
action = ACTION_IMPORT_KEY;
|
||||
}
|
||||
|
||||
/**
|
||||
* APG's own Actions
|
||||
*/
|
||||
if (ACTION_KEY_IMPORT.equals(action)) {
|
||||
if (ACTION_IMPORT_KEY.equals(action)) {
|
||||
if ("file".equals(intent.getScheme()) && intent.getDataString() != null) {
|
||||
mImportFilename = intent.getData().getPath();
|
||||
mImportData = null;
|
||||
@ -160,15 +160,15 @@ public class ImportKeysActivity extends SherlockFragmentActivity {
|
||||
mImportFilename = null;
|
||||
}
|
||||
loadKeyListFragment();
|
||||
} else if (ACTION_KEY_IMPORT_FROM_FILE.equals(action)) {
|
||||
} else if (ACTION_IMPOR_KEY_FROM_FILE.equals(action)) {
|
||||
if ("file".equals(intent.getScheme()) && intent.getDataString() != null) {
|
||||
mImportFilename = intent.getData().getPath();
|
||||
mImportData = null;
|
||||
}
|
||||
showImportFromFileDialog();
|
||||
} else if (ACTION_KEY_IMPORT_FROM_QR_CODE.equals(action)) {
|
||||
} else if (ACTION_IMPORT_KEY_FROM_QR_CODE.equals(action)) {
|
||||
importFromQrCode();
|
||||
} else if (ACTION_KEY_IMPORT_FROM_NFC.equals(action)) {
|
||||
} else if (ACTION_IMPORT_KEY_FROM_NFC.equals(action)) {
|
||||
importFromNfc();
|
||||
}
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ public class KeyListActivity extends SherlockFragmentActivity {
|
||||
|
||||
case Id.menu.option.import_from_file: {
|
||||
Intent intentImportFromFile = new Intent(this, ImportKeysActivity.class);
|
||||
intentImportFromFile.setAction(ImportKeysActivity.ACTION_KEY_IMPORT_FROM_FILE);
|
||||
intentImportFromFile.setAction(ImportKeysActivity.ACTION_IMPOR_KEY_FROM_FILE);
|
||||
startActivityForResult(intentImportFromFile, 0);
|
||||
return true;
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ public class KeyListPublicActivity extends KeyListActivity {
|
||||
}
|
||||
case Id.menu.option.import_from_file: {
|
||||
Intent intentImportFromFile = new Intent(this, ImportKeysActivity.class);
|
||||
intentImportFromFile.setAction(ImportKeysActivity.ACTION_KEY_IMPORT_FROM_FILE);
|
||||
intentImportFromFile.setAction(ImportKeysActivity.ACTION_IMPOR_KEY_FROM_FILE);
|
||||
startActivityForResult(intentImportFromFile, 0);
|
||||
|
||||
return true;
|
||||
@ -75,7 +75,7 @@ public class KeyListPublicActivity extends KeyListActivity {
|
||||
|
||||
case Id.menu.option.import_from_qr_code: {
|
||||
Intent intentImportFromFile = new Intent(this, ImportKeysActivity.class);
|
||||
intentImportFromFile.setAction(ImportKeysActivity.ACTION_KEY_IMPORT_FROM_QR_CODE);
|
||||
intentImportFromFile.setAction(ImportKeysActivity.ACTION_IMPORT_KEY_FROM_QR_CODE);
|
||||
startActivityForResult(intentImportFromFile, Id.request.import_from_qr_code);
|
||||
|
||||
return true;
|
||||
@ -83,7 +83,7 @@ public class KeyListPublicActivity extends KeyListActivity {
|
||||
|
||||
case Id.menu.option.import_from_nfc: {
|
||||
Intent intentImportFromFile = new Intent(this, ImportKeysActivity.class);
|
||||
intentImportFromFile.setAction(ImportKeysActivity.ACTION_KEY_IMPORT_FROM_NFC);
|
||||
intentImportFromFile.setAction(ImportKeysActivity.ACTION_IMPORT_KEY_FROM_NFC);
|
||||
startActivityForResult(intentImportFromFile, 0);
|
||||
|
||||
return true;
|
||||
|
@ -227,7 +227,7 @@ public class KeyServerQueryActivity extends SherlockFragmentActivity {
|
||||
if (mKeyData != null) {
|
||||
Intent intent = new Intent(KeyServerQueryActivity.this,
|
||||
ImportKeysActivity.class);
|
||||
intent.setAction(ImportKeysActivity.ACTION_KEY_IMPORT);
|
||||
intent.setAction(ImportKeysActivity.ACTION_IMPORT_KEY);
|
||||
intent.putExtra(ImportKeysActivity.EXTRA_KEYRING_BYTES, mKeyData.getBytes());
|
||||
startActivity(intent);
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ public class ShareNfcBeamActivity extends SherlockFragmentActivity implements
|
||||
byte[] receivedKeyringBytes = msg.getRecords()[0].getPayload();
|
||||
|
||||
Intent importIntent = new Intent(this, ImportKeysActivity.class);
|
||||
importIntent.setAction(ImportKeysActivity.ACTION_KEY_IMPORT);
|
||||
importIntent.setAction(ImportKeysActivity.ACTION_IMPORT_KEY);
|
||||
importIntent.putExtra(ImportKeysActivity.EXTRA_KEYRING_BYTES, receivedKeyringBytes);
|
||||
|
||||
finish();
|
||||
|
10
README.md
10
README.md
@ -50,17 +50,17 @@ These Intents require user interaction!
|
||||
|
||||
All Intents start with ``org.sufficientlysecure.keychain.action.``
|
||||
|
||||
* ``KEY_IMPORT``
|
||||
* Extras: ``keyring_bytes``
|
||||
* or Uri in data with file schema
|
||||
* ``KEY_IMPORT_FROM_QR_CODE``
|
||||
* without extras
|
||||
* ``ENCRYPT``
|
||||
* TODO: explain extras (see source)
|
||||
* ``ENCRYPT_FILE``
|
||||
* ``DECRYPT``
|
||||
* TODO: explain extras (see source)
|
||||
* ``DECRYPT_FILE``
|
||||
* ``IMPORT_KEY``
|
||||
* Extras: ``keyring_bytes`` (``byte[]``)
|
||||
* or Uri in data with file schema
|
||||
* ``IMPORT_KEY_FROM_QR_CODE``
|
||||
* without extras
|
||||
|
||||
TODO:
|
||||
- new intent REGISTER_APP?
|
||||
|
Loading…
Reference in New Issue
Block a user