From 154849b5911cc2b99aa0f5c42eea53aaf55ba930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Sun, 16 Feb 2014 01:35:14 +0100 Subject: rename intent helper --- .../keychain/demo/IntentActivity.java | 22 ++++++------- .../keychain/api/KeychainIntents.java | 37 ---------------------- .../keychain/api/OpenKeychainIntents.java | 37 ++++++++++++++++++++++ OpenPGP-Keychain/src/main/AndroidManifest.xml | 8 +++++ .../keychain/api/KeychainIntents.java | 37 ---------------------- .../keychain/api/OpenKeychainIntents.java | 37 ++++++++++++++++++++++ 6 files changed, 93 insertions(+), 85 deletions(-) delete mode 100644 OpenPGP-Keychain-API/libraries/keychain-api-library/src/org/sufficientlysecure/keychain/api/KeychainIntents.java create mode 100644 OpenPGP-Keychain-API/libraries/keychain-api-library/src/org/sufficientlysecure/keychain/api/OpenKeychainIntents.java delete mode 100644 libraries/keychain-api-library/src/org/sufficientlysecure/keychain/api/KeychainIntents.java create mode 100644 libraries/keychain-api-library/src/org/sufficientlysecure/keychain/api/OpenKeychainIntents.java diff --git a/OpenPGP-Keychain-API/example-app/src/main/java/org/sufficientlysecure/keychain/demo/IntentActivity.java b/OpenPGP-Keychain-API/example-app/src/main/java/org/sufficientlysecure/keychain/demo/IntentActivity.java index 0fcc0c248..ad1b55df0 100644 --- a/OpenPGP-Keychain-API/example-app/src/main/java/org/sufficientlysecure/keychain/demo/IntentActivity.java +++ b/OpenPGP-Keychain-API/example-app/src/main/java/org/sufficientlysecure/keychain/demo/IntentActivity.java @@ -28,7 +28,7 @@ import android.provider.MediaStore; import android.util.Log; import android.widget.Toast; -import org.sufficientlysecure.keychain.api.KeychainIntents; +import org.sufficientlysecure.keychain.api.OpenKeychainIntents; import java.io.UnsupportedEncodingException; @@ -68,8 +68,8 @@ public class IntentActivity extends PreferenceActivity { @Override public boolean onPreferenceClick(Preference preference) { try { - Intent intent = new Intent(KeychainIntents.ENCRYPT); - intent.putExtra(KeychainIntents.ENCRYPT_EXTRA_TEXT, "Hello world!"); + Intent intent = new Intent(OpenKeychainIntents.ENCRYPT); + intent.putExtra(OpenKeychainIntents.ENCRYPT_EXTRA_TEXT, "Hello world!"); startActivity(intent); } catch (ActivityNotFoundException e) { Toast.makeText(IntentActivity.this, "Activity not found!", Toast.LENGTH_LONG).show(); @@ -94,8 +94,8 @@ public class IntentActivity extends PreferenceActivity { @Override public boolean onPreferenceClick(Preference preference) { try { - Intent intent = new Intent(KeychainIntents.DECRYPT); - intent.putExtra(KeychainIntents.DECRYPT_EXTRA_TEXT, TEST_SIGNED_MESSAGE); + Intent intent = new Intent(OpenKeychainIntents.DECRYPT); + intent.putExtra(OpenKeychainIntents.DECRYPT_EXTRA_TEXT, TEST_SIGNED_MESSAGE); startActivity(intent); } catch (ActivityNotFoundException e) { Toast.makeText(IntentActivity.this, "Activity not found!", Toast.LENGTH_LONG).show(); @@ -109,14 +109,14 @@ public class IntentActivity extends PreferenceActivity { @Override public boolean onPreferenceClick(Preference preference) { try { - Intent intent = new Intent(KeychainIntents.IMPORT_KEY); + Intent intent = new Intent(OpenKeychainIntents.IMPORT_KEY); byte[] pubkey = null; try { pubkey = TEST_PUBKEY.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } - intent.putExtra(KeychainIntents.IMPORT_KEY_EXTRA_KEY_BYTES, pubkey); + intent.putExtra(OpenKeychainIntents.IMPORT_KEY_EXTRA_KEY_BYTES, pubkey); startActivity(intent); } catch (ActivityNotFoundException e) { Toast.makeText(IntentActivity.this, "Activity not found!", Toast.LENGTH_LONG).show(); @@ -130,8 +130,8 @@ public class IntentActivity extends PreferenceActivity { @Override public boolean onPreferenceClick(Preference preference) { try { - Intent intent = new Intent(KeychainIntents.IMPORT_KEY_FROM_KEYSERVER); - intent.putExtra(KeychainIntents.IMPORT_KEY_FROM_KEYSERVER_QUERY, "Richard Stallman"); + Intent intent = new Intent(OpenKeychainIntents.IMPORT_KEY_FROM_KEYSERVER); + intent.putExtra(OpenKeychainIntents.IMPORT_KEY_FROM_KEYSERVER_QUERY, "Richard Stallman"); startActivity(intent); } catch (ActivityNotFoundException e) { Toast.makeText(IntentActivity.this, "Activity not found!", Toast.LENGTH_LONG).show(); @@ -145,7 +145,7 @@ public class IntentActivity extends PreferenceActivity { @Override public boolean onPreferenceClick(Preference preference) { try { - Intent intent = new Intent(KeychainIntents.IMPORT_KEY_FROM_QR_CODE); + Intent intent = new Intent(OpenKeychainIntents.IMPORT_KEY_FROM_QR_CODE); startActivity(intent); } catch (ActivityNotFoundException e) { Toast.makeText(IntentActivity.this, "Activity not found!", Toast.LENGTH_LONG).show(); @@ -195,7 +195,7 @@ public class IntentActivity extends PreferenceActivity { Log.d(Constants.TAG, "filePath: " + filePath); try { - Intent intent = new Intent(KeychainIntents.ENCRYPT); + Intent intent = new Intent(OpenKeychainIntents.ENCRYPT); Uri dataUri = Uri.parse("file://" + filePath); Log.d(Constants.TAG, "Uri: " + dataUri); intent.setData(dataUri); diff --git a/OpenPGP-Keychain-API/libraries/keychain-api-library/src/org/sufficientlysecure/keychain/api/KeychainIntents.java b/OpenPGP-Keychain-API/libraries/keychain-api-library/src/org/sufficientlysecure/keychain/api/KeychainIntents.java deleted file mode 100644 index 12e32933b..000000000 --- a/OpenPGP-Keychain-API/libraries/keychain-api-library/src/org/sufficientlysecure/keychain/api/KeychainIntents.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2014 Dominik Schürmann - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.sufficientlysecure.keychain.api; - -public class KeychainIntents { - - public static final String ENCRYPT = "org.sufficientlysecure.keychain.action.ENCRYPT"; - public static final String ENCRYPT_EXTRA_TEXT = "text"; - public static final String ENCRYPT_ASCII_ARMOR = "ascii_armor"; - - public static final String DECRYPT = "org.sufficientlysecure.keychain.action.DECRYPT"; - public static final String DECRYPT_EXTRA_TEXT = "text"; - - public static final String IMPORT_KEY = "org.sufficientlysecure.keychain.action.IMPORT_KEY"; - public static final String IMPORT_KEY_EXTRA_KEY_BYTES = "key_bytes"; - - public static final String IMPORT_KEY_FROM_KEYSERVER = "org.sufficientlysecure.keychain.action.IMPORT_KEY_FROM_KEYSERVER"; - public static final String IMPORT_KEY_FROM_KEYSERVER_QUERY = "query"; - public static final String IMPORT_KEY_FROM_KEYSERVER_FINGERPRINT = "fingerprint"; - - public static final String IMPORT_KEY_FROM_QR_CODE = "org.sufficientlysecure.keychain.action.IMPORT_KEY_FROM_QR_CODE"; - -} diff --git a/OpenPGP-Keychain-API/libraries/keychain-api-library/src/org/sufficientlysecure/keychain/api/OpenKeychainIntents.java b/OpenPGP-Keychain-API/libraries/keychain-api-library/src/org/sufficientlysecure/keychain/api/OpenKeychainIntents.java new file mode 100644 index 000000000..15aceb534 --- /dev/null +++ b/OpenPGP-Keychain-API/libraries/keychain-api-library/src/org/sufficientlysecure/keychain/api/OpenKeychainIntents.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2014 Dominik Schürmann + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.sufficientlysecure.keychain.api; + +public class OpenKeychainIntents { + + public static final String ENCRYPT = "org.sufficientlysecure.keychain.action.ENCRYPT"; + public static final String ENCRYPT_EXTRA_TEXT = "text"; // String + public static final String ENCRYPT_ASCII_ARMOR = "ascii_armor"; // boolean + + public static final String DECRYPT = "org.sufficientlysecure.keychain.action.DECRYPT"; + public static final String DECRYPT_EXTRA_TEXT = "text"; // String + + public static final String IMPORT_KEY = "org.sufficientlysecure.keychain.action.IMPORT_KEY"; + public static final String IMPORT_KEY_EXTRA_KEY_BYTES = "key_bytes"; // byte[] + + public static final String IMPORT_KEY_FROM_KEYSERVER = "org.sufficientlysecure.keychain.action.IMPORT_KEY_FROM_KEYSERVER"; + public static final String IMPORT_KEY_FROM_KEYSERVER_QUERY = "query"; // String + public static final String IMPORT_KEY_FROM_KEYSERVER_FINGERPRINT = "fingerprint"; // String + + public static final String IMPORT_KEY_FROM_QR_CODE = "org.sufficientlysecure.keychain.action.IMPORT_KEY_FROM_QR_CODE"; + +} diff --git a/OpenPGP-Keychain/src/main/AndroidManifest.xml b/OpenPGP-Keychain/src/main/AndroidManifest.xml index 58019cd4d..95f148686 100644 --- a/OpenPGP-Keychain/src/main/AndroidManifest.xml +++ b/OpenPGP-Keychain/src/main/AndroidManifest.xml @@ -304,6 +304,14 @@ + + + + + + + + diff --git a/libraries/keychain-api-library/src/org/sufficientlysecure/keychain/api/KeychainIntents.java b/libraries/keychain-api-library/src/org/sufficientlysecure/keychain/api/KeychainIntents.java deleted file mode 100644 index 12e32933b..000000000 --- a/libraries/keychain-api-library/src/org/sufficientlysecure/keychain/api/KeychainIntents.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2014 Dominik Schürmann - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.sufficientlysecure.keychain.api; - -public class KeychainIntents { - - public static final String ENCRYPT = "org.sufficientlysecure.keychain.action.ENCRYPT"; - public static final String ENCRYPT_EXTRA_TEXT = "text"; - public static final String ENCRYPT_ASCII_ARMOR = "ascii_armor"; - - public static final String DECRYPT = "org.sufficientlysecure.keychain.action.DECRYPT"; - public static final String DECRYPT_EXTRA_TEXT = "text"; - - public static final String IMPORT_KEY = "org.sufficientlysecure.keychain.action.IMPORT_KEY"; - public static final String IMPORT_KEY_EXTRA_KEY_BYTES = "key_bytes"; - - public static final String IMPORT_KEY_FROM_KEYSERVER = "org.sufficientlysecure.keychain.action.IMPORT_KEY_FROM_KEYSERVER"; - public static final String IMPORT_KEY_FROM_KEYSERVER_QUERY = "query"; - public static final String IMPORT_KEY_FROM_KEYSERVER_FINGERPRINT = "fingerprint"; - - public static final String IMPORT_KEY_FROM_QR_CODE = "org.sufficientlysecure.keychain.action.IMPORT_KEY_FROM_QR_CODE"; - -} diff --git a/libraries/keychain-api-library/src/org/sufficientlysecure/keychain/api/OpenKeychainIntents.java b/libraries/keychain-api-library/src/org/sufficientlysecure/keychain/api/OpenKeychainIntents.java new file mode 100644 index 000000000..15aceb534 --- /dev/null +++ b/libraries/keychain-api-library/src/org/sufficientlysecure/keychain/api/OpenKeychainIntents.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2014 Dominik Schürmann + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.sufficientlysecure.keychain.api; + +public class OpenKeychainIntents { + + public static final String ENCRYPT = "org.sufficientlysecure.keychain.action.ENCRYPT"; + public static final String ENCRYPT_EXTRA_TEXT = "text"; // String + public static final String ENCRYPT_ASCII_ARMOR = "ascii_armor"; // boolean + + public static final String DECRYPT = "org.sufficientlysecure.keychain.action.DECRYPT"; + public static final String DECRYPT_EXTRA_TEXT = "text"; // String + + public static final String IMPORT_KEY = "org.sufficientlysecure.keychain.action.IMPORT_KEY"; + public static final String IMPORT_KEY_EXTRA_KEY_BYTES = "key_bytes"; // byte[] + + public static final String IMPORT_KEY_FROM_KEYSERVER = "org.sufficientlysecure.keychain.action.IMPORT_KEY_FROM_KEYSERVER"; + public static final String IMPORT_KEY_FROM_KEYSERVER_QUERY = "query"; // String + public static final String IMPORT_KEY_FROM_KEYSERVER_FINGERPRINT = "fingerprint"; // String + + public static final String IMPORT_KEY_FROM_QR_CODE = "org.sufficientlysecure.keychain.action.IMPORT_KEY_FROM_QR_CODE"; + +} -- cgit v1.2.3