From 92c66743e07b77da21af6236689a276eb23a9b1c Mon Sep 17 00:00:00 2001 From: Daniel Albert Date: Sat, 12 Jul 2014 15:12:35 +0200 Subject: Added Preference for concealing the PgpApplication --- .../java/org/sufficientlysecure/keychain/Constants.java | 1 + .../sufficientlysecure/keychain/helper/Preferences.java | 10 ++++++++++ .../keychain/ui/PreferencesActivity.java | 17 +++++++++++++++++ OpenKeychain/src/main/res/values/strings.xml | 1 + OpenKeychain/src/main/res/xml/adv_preferences.xml | 5 +++++ 5 files changed, 34 insertions(+) (limited to 'OpenKeychain/src') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java index e1bf1afa4..86bc3fa5b 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java @@ -68,6 +68,7 @@ public final class Constants { public static final String FORCE_V3_SIGNATURES = "forceV3Signatures"; public static final String KEY_SERVERS = "keyServers"; public static final String KEY_SERVERS_DEFAULT_VERSION = "keyServersDefaultVersion"; + public static final String CONCEAL_PGP_APPLICATION = "concealPgpApplication"; } public static final class Defaults { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/Preferences.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/Preferences.java index 6f3d38ccd..fd8267a59 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/Preferences.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/Preferences.java @@ -187,4 +187,14 @@ public class Preferences { .commit(); } } + + public void setConcealPgpApplication(boolean conceal) { + SharedPreferences.Editor editor = mSharedPreferences.edit(); + editor.putBoolean(Constants.Pref.CONCEAL_PGP_APPLICATION, conceal); + editor.commit(); + } + + public boolean getConcealPgpApplication() { + return mSharedPreferences.getBoolean(Constants.Pref.CONCEAL_PGP_APPLICATION, false); + } } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/PreferencesActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/PreferencesActivity.java index 448d29156..dcacdbc9d 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/PreferencesActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/PreferencesActivity.java @@ -121,6 +121,9 @@ public class PreferencesActivity extends PreferenceActivity { initializeForceV3Signatures( (CheckBoxPreference) findPreference(Constants.Pref.FORCE_V3_SIGNATURES)); + initializeConcealPgpApplication( + (CheckBoxPreference) findPreference(Constants.Pref.CONCEAL_PGP_APPLICATION)); + } else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { // Load the legacy preferences headers addPreferencesFromResource(R.xml.preference_headers_legacy); @@ -264,6 +267,9 @@ public class PreferencesActivity extends PreferenceActivity { initializeForceV3Signatures( (CheckBoxPreference) findPreference(Constants.Pref.FORCE_V3_SIGNATURES)); + + initializeConcealPgpApplication( + (CheckBoxPreference) findPreference(Constants.Pref.CONCEAL_PGP_APPLICATION)); } } @@ -396,4 +402,15 @@ public class PreferencesActivity extends PreferenceActivity { } }); } + + private static void initializeConcealPgpApplication(final CheckBoxPreference mConcealPgpApplication) { + mConcealPgpApplication.setChecked(sPreferences.getConcealPgpApplication()); + mConcealPgpApplication.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { + public boolean onPreferenceChange(Preference preference, Object newValue) { + mConcealPgpApplication.setChecked((Boolean) newValue); + sPreferences.setConcealPgpApplication((Boolean) newValue); + return false; + } + }); + } } diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 5f04aa6e6..502a0926a 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -110,6 +110,7 @@ Again Algorithm ASCII Armor + Conceal PGP Application (OpenKeychain) Recipients Delete After Encryption Delete After Decryption diff --git a/OpenKeychain/src/main/res/xml/adv_preferences.xml b/OpenKeychain/src/main/res/xml/adv_preferences.xml index fa3974199..b8d90657f 100644 --- a/OpenKeychain/src/main/res/xml/adv_preferences.xml +++ b/OpenKeychain/src/main/res/xml/adv_preferences.xml @@ -38,6 +38,11 @@ android:key="defaultAsciiArmor" android:persistent="false" android:title="@string/label_ascii_armor" /> + + Date: Wed, 16 Jul 2014 18:17:46 +0200 Subject: Final Commit for #662 --- .../main/java/org/sufficientlysecure/keychain/pgp/PgpHelper.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenKeychain/src') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpHelper.java index 969ff1de8..0ceefc4d9 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpHelper.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpHelper.java @@ -24,6 +24,7 @@ import android.content.pm.PackageManager.NameNotFoundException; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; +import org.sufficientlysecure.keychain.helper.Preferences; import org.sufficientlysecure.keychain.util.Log; import java.io.File; @@ -60,7 +61,11 @@ public class PgpHelper { } public static String getFullVersion(Context context) { - return "OpenKeychain v" + getVersion(context); + if(Preferences.getPreferences(context).getConcealPgpApplication()){ + return ""; + } else { + return "OpenKeychain v" + getVersion(context); + } } // public static final class content { -- cgit v1.2.3 From 01046fc0e71809aef89cd05244b4be325279d7ca Mon Sep 17 00:00:00 2001 From: Daniel Albert Date: Thu, 17 Jul 2014 20:01:53 +0200 Subject: Added description to Setting, Changed title to suggested one --- OpenKeychain/src/main/res/values/strings.xml | 3 ++- OpenKeychain/src/main/res/xml/adv_preferences.xml | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'OpenKeychain/src') diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 50f73e73b..5e9c97ad9 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -109,7 +109,8 @@ Again Algorithm ASCII Armor - Conceal PGP Application (OpenKeychain) + Let others know that you're using OpenKeychain + Writes 'OpenKeychain v2.7' to OpenPGP signatures, ciphertext, and exported keys Recipients Delete After Encryption Delete After Decryption diff --git a/OpenKeychain/src/main/res/xml/adv_preferences.xml b/OpenKeychain/src/main/res/xml/adv_preferences.xml index b8d90657f..a07ae06bb 100644 --- a/OpenKeychain/src/main/res/xml/adv_preferences.xml +++ b/OpenKeychain/src/main/res/xml/adv_preferences.xml @@ -42,12 +42,13 @@ + android:title="@string/label_conceal_pgp_application" + android:summary="@string/label_conceal_pgp_application_summary" /> + android:title="@string/label_force_v3_signature"/> -- cgit v1.2.3 From 8a8d8c5a6865cef0637d52bec82217edca7638f8 Mon Sep 17 00:00:00 2001 From: Daniel Albert Date: Thu, 17 Jul 2014 20:53:10 +0200 Subject: Fixed unescaped apostrophe --- OpenKeychain/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenKeychain/src') diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 5e9c97ad9..e7293f21b 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -110,7 +110,7 @@ Algorithm ASCII Armor Let others know that you're using OpenKeychain - Writes 'OpenKeychain v2.7' to OpenPGP signatures, ciphertext, and exported keys + Writes \'OpenKeychain v2.7\' to OpenPGP signatures, ciphertext, and exported keys Recipients Delete After Encryption Delete After Decryption -- cgit v1.2.3 From db002bde7c7370ff0107c36aa93bc789248b6eb8 Mon Sep 17 00:00:00 2001 From: Daniel Albert Date: Thu, 17 Jul 2014 21:17:39 +0200 Subject: Fixed another unescaped apostrophe. --- OpenKeychain/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenKeychain/src') diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index e7293f21b..c1c18effe 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -109,7 +109,7 @@ Again Algorithm ASCII Armor - Let others know that you're using OpenKeychain + Let others know that you\'re using OpenKeychain Writes \'OpenKeychain v2.7\' to OpenPGP signatures, ciphertext, and exported keys Recipients Delete After Encryption -- cgit v1.2.3