From dd850e5c72db1601aef54f9f35e1a2b11ae719c5 Mon Sep 17 00:00:00 2001 From: Kaladin Light <0.kaladin@gmail.com> Date: Thu, 3 Sep 2015 13:25:09 -0400 Subject: Fixes open-keychain/open-keychain#1515 Move launcher icons to mipmap --- OpenKeychain/src/main/AndroidManifest.xml | 2 +- .../keychain/remote/ui/AppsListFragment.java | 4 ++-- .../keychain/service/KeyserverSyncAdapterService.java | 2 +- .../keychain/service/PassphraseCacheService.java | 4 ++-- .../keychain/ui/DecryptListFragment.java | 2 +- OpenKeychain/src/main/res/drawable-hdpi/ic_launcher.png | Bin 6885 -> 0 bytes OpenKeychain/src/main/res/drawable-mdpi/ic_launcher.png | Bin 4641 -> 0 bytes .../src/main/res/drawable-xhdpi/ic_launcher.png | Bin 8916 -> 0 bytes .../src/main/res/drawable-xxhdpi/ic_launcher.png | Bin 13548 -> 0 bytes .../src/main/res/drawable-xxxhdpi/ic_launcher.png | Bin 16742 -> 0 bytes .../src/main/res/layout/api_app_settings_activity.xml | 2 +- .../src/main/res/layout/api_app_settings_fragment.xml | 4 ++-- .../src/main/res/layout/api_apps_adapter_list_item.xml | 4 ++-- .../src/main/res/layout/help_about_fragment.xml | 2 +- OpenKeychain/src/main/res/layout/view_key_activity.xml | 4 ++-- OpenKeychain/src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 6885 bytes OpenKeychain/src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 4641 bytes OpenKeychain/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 8916 bytes OpenKeychain/src/main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 13548 bytes .../src/main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 16742 bytes OpenKeychain/src/main/res/xml/account_desc.xml | 2 +- 21 files changed, 16 insertions(+), 16 deletions(-) delete mode 100644 OpenKeychain/src/main/res/drawable-hdpi/ic_launcher.png delete mode 100644 OpenKeychain/src/main/res/drawable-mdpi/ic_launcher.png delete mode 100644 OpenKeychain/src/main/res/drawable-xhdpi/ic_launcher.png delete mode 100644 OpenKeychain/src/main/res/drawable-xxhdpi/ic_launcher.png delete mode 100644 OpenKeychain/src/main/res/drawable-xxxhdpi/ic_launcher.png create mode 100644 OpenKeychain/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 OpenKeychain/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 OpenKeychain/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 OpenKeychain/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 OpenKeychain/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/OpenKeychain/src/main/AndroidManifest.xml b/OpenKeychain/src/main/AndroidManifest.xml index cb886ed50..02d1099b0 100644 --- a/OpenKeychain/src/main/AndroidManifest.xml +++ b/OpenKeychain/src/main/AndroidManifest.xml @@ -71,7 +71,7 @@ android:name=".KeychainApplication" android:allowBackup="false" android:hardwareAccelerated="true" - android:icon="@drawable/ic_launcher" + android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/Theme.Keychain.Light"> + android:src="@mipmap/ic_launcher" /> + android:src="@mipmap/ic_launcher" /> - \ No newline at end of file + diff --git a/OpenKeychain/src/main/res/layout/api_apps_adapter_list_item.xml b/OpenKeychain/src/main/res/layout/api_apps_adapter_list_item.xml index 9166f958e..f6eafdbda 100644 --- a/OpenKeychain/src/main/res/layout/api_apps_adapter_list_item.xml +++ b/OpenKeychain/src/main/res/layout/api_apps_adapter_list_item.xml @@ -11,7 +11,7 @@ android:layout_height="48dp" android:layout_marginLeft="8dp" android:layout_centerVertical="true" - android:src="@drawable/ic_launcher" /> + android:src="@mipmap/ic_launcher" /> - \ No newline at end of file + diff --git a/OpenKeychain/src/main/res/layout/help_about_fragment.xml b/OpenKeychain/src/main/res/layout/help_about_fragment.xml index dbcd97bfd..cbe1c3331 100644 --- a/OpenKeychain/src/main/res/layout/help_about_fragment.xml +++ b/OpenKeychain/src/main/res/layout/help_about_fragment.xml @@ -32,7 +32,7 @@ android:layout_height="wrap_content" android:layout_gravity="top" android:layout_marginRight="10dp" - android:src="@drawable/ic_launcher" /> + android:src="@mipmap/ic_launcher" /> + android:src="@mipmap/ic_launcher" /> - \ No newline at end of file + diff --git a/OpenKeychain/src/main/res/mipmap-hdpi/ic_launcher.png b/OpenKeychain/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..6133816d2 Binary files /dev/null and b/OpenKeychain/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/OpenKeychain/src/main/res/mipmap-mdpi/ic_launcher.png b/OpenKeychain/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..d945a01de Binary files /dev/null and b/OpenKeychain/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/OpenKeychain/src/main/res/mipmap-xhdpi/ic_launcher.png b/OpenKeychain/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..825b18b38 Binary files /dev/null and b/OpenKeychain/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/OpenKeychain/src/main/res/mipmap-xxhdpi/ic_launcher.png b/OpenKeychain/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..4809acc39 Binary files /dev/null and b/OpenKeychain/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/OpenKeychain/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/OpenKeychain/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..fab324e93 Binary files /dev/null and b/OpenKeychain/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/OpenKeychain/src/main/res/xml/account_desc.xml b/OpenKeychain/src/main/res/xml/account_desc.xml index e04160c5c..942909dbe 100644 --- a/OpenKeychain/src/main/res/xml/account_desc.xml +++ b/OpenKeychain/src/main/res/xml/account_desc.xml @@ -2,5 +2,5 @@ -- cgit v1.2.3 From e9836372b4fc346bcd96e61de7cd12350ce7ec01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Fri, 4 Sep 2015 13:39:03 +0200 Subject: Use new HashSet<>(Arrays.asList()) instead of static --- .../keychain/pgp/PgpSecurityConstants.java | 74 +++++++++++----------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSecurityConstants.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSecurityConstants.java index 3fa549946..cbd8ce47a 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSecurityConstants.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSecurityConstants.java @@ -23,6 +23,7 @@ import org.spongycastle.bcpg.HashAlgorithmTags; import org.spongycastle.bcpg.PublicKeyAlgorithmTags; import org.spongycastle.bcpg.SymmetricKeyAlgorithmTags; +import java.util.Arrays; import java.util.HashSet; /** @@ -42,24 +43,23 @@ public class PgpSecurityConstants { * Whitelist of accepted symmetric encryption algorithms * all other algorithms are rejected with OpenPgpDecryptionResult.RESULT_INSECURE */ - private static HashSet sSymmetricAlgorithmsWhitelist = new HashSet<>(); - static { - // General remarks: We try to keep the whitelist short to reduce attack surface - // TODO: block IDEA?: Bad key schedule (weak keys), implementation difficulties (easy to make errors) - sSymmetricAlgorithmsWhitelist.add(SymmetricKeyAlgorithmTags.IDEA); - sSymmetricAlgorithmsWhitelist.add(SymmetricKeyAlgorithmTags.TRIPLE_DES); // a MUST in RFC - sSymmetricAlgorithmsWhitelist.add(SymmetricKeyAlgorithmTags.CAST5); // default in many gpg, pgp versions, 128 bit key - // BLOWFISH: Twofish is the successor - // SAFER: not used widely - // DES: < 128 bit security - sSymmetricAlgorithmsWhitelist.add(SymmetricKeyAlgorithmTags.AES_128); - sSymmetricAlgorithmsWhitelist.add(SymmetricKeyAlgorithmTags.AES_192); - sSymmetricAlgorithmsWhitelist.add(SymmetricKeyAlgorithmTags.AES_256); - sSymmetricAlgorithmsWhitelist.add(SymmetricKeyAlgorithmTags.TWOFISH); // 128 bit - // CAMELLIA_128: not used widely - // CAMELLIA_192: not used widely - // CAMELLIA_256: not used widely - } + private static HashSet sSymmetricAlgorithmsWhitelist = new HashSet<>(Arrays.asList( + // General remarks: We try to keep the whitelist short to reduce attack surface + // TODO: block IDEA?: Bad key schedule (weak keys), implementation difficulties (easy to make errors) + SymmetricKeyAlgorithmTags.IDEA, + SymmetricKeyAlgorithmTags.TRIPLE_DES, // a MUST in RFC + SymmetricKeyAlgorithmTags.CAST5, // default in many gpg, pgp versions, 128 bit key + // BLOWFISH: Twofish is the successor + // SAFER: not used widely + // DES: < 128 bit security + SymmetricKeyAlgorithmTags.AES_128, + SymmetricKeyAlgorithmTags.AES_192, + SymmetricKeyAlgorithmTags.AES_256, + SymmetricKeyAlgorithmTags.TWOFISH // 128 bit + // CAMELLIA_128: not used widely + // CAMELLIA_192: not used widely + // CAMELLIA_256: not used widely + )); public static boolean isSecureSymmetricAlgorithm(int id) { return sSymmetricAlgorithmsWhitelist.contains(id); @@ -77,20 +77,19 @@ public class PgpSecurityConstants { * ((collision resistance of 112-bits)) * Implementations SHOULD NOT sign SHA-256 hashes. They MUST NOT default to signing SHA-256 hashes. */ - private static HashSet sHashAlgorithmsWhitelist = new HashSet<>(); - static { - // MD5: broken - // SHA1: broken - // RIPEMD160: same security properties as SHA1 - // DOUBLE_SHA: not used widely - // MD2: not used widely - // TIGER_192: not used widely - // HAVAL_5_160: not used widely - sHashAlgorithmsWhitelist.add(HashAlgorithmTags.SHA256); // compatibility for old Mailvelope versions - sHashAlgorithmsWhitelist.add(HashAlgorithmTags.SHA384); - sHashAlgorithmsWhitelist.add(HashAlgorithmTags.SHA512); - // SHA224: Not used widely, Yahoo argues against it - } + private static HashSet sHashAlgorithmsWhitelist = new HashSet<>(Arrays.asList( + // MD5: broken + // SHA1: broken + // RIPEMD160: same security properties as SHA1 + // DOUBLE_SHA: not used widely + // MD2: not used widely + // TIGER_192: not used widely + // HAVAL_5_160: not used widely + HashAlgorithmTags.SHA256, // compatibility for old Mailvelope versions + HashAlgorithmTags.SHA384, + HashAlgorithmTags.SHA512 + // SHA224: Not used widely, Yahoo argues against it + )); public static boolean isSecureHashAlgorithm(int id) { return sHashAlgorithmsWhitelist.contains(id); @@ -106,12 +105,11 @@ public class PgpSecurityConstants { * bitlength less than 1023 bits. * Implementations MUST NOT accept any RSA keys with bitlength less than 2047 bits after January 1, 2016. */ - private static HashSet sCurveWhitelist = new HashSet<>(); - static { - sCurveWhitelist.add(NISTNamedCurves.getOID("P-256").getId()); - sCurveWhitelist.add(NISTNamedCurves.getOID("P-384").getId()); - sCurveWhitelist.add(NISTNamedCurves.getOID("P-521").getId()); - } + private static HashSet sCurveWhitelist = new HashSet<>(Arrays.asList( + NISTNamedCurves.getOID("P-256").getId(), + NISTNamedCurves.getOID("P-384").getId(), + NISTNamedCurves.getOID("P-521").getId() + )); public static boolean isSecureKey(CanonicalizedPublicKey key) { switch (key.getAlgorithm()) { -- cgit v1.2.3 From 398dd3519c5477a955ee713526ec5bd7bfd56f67 Mon Sep 17 00:00:00 2001 From: Kaladin Light <0.kaladin@gmail.com> Date: Sat, 5 Sep 2015 14:24:08 -0400 Subject: Fixes #1520 Move debug launcher icons to mipmap --- .../src/debug/res/drawable-hdpi/ic_launcher.png | Bin 6863 -> 0 bytes .../src/debug/res/drawable-mdpi/ic_launcher.png | Bin 4609 -> 0 bytes .../src/debug/res/drawable-xhdpi/ic_launcher.png | Bin 8887 -> 0 bytes .../src/debug/res/drawable-xxhdpi/ic_launcher.png | Bin 13422 -> 0 bytes .../src/debug/res/drawable-xxxhdpi/ic_launcher.png | Bin 16655 -> 0 bytes OpenKeychain/src/debug/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 6863 bytes OpenKeychain/src/debug/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 4609 bytes OpenKeychain/src/debug/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 8887 bytes .../src/debug/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 13422 bytes .../src/debug/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 16655 bytes 10 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 OpenKeychain/src/debug/res/drawable-hdpi/ic_launcher.png delete mode 100644 OpenKeychain/src/debug/res/drawable-mdpi/ic_launcher.png delete mode 100644 OpenKeychain/src/debug/res/drawable-xhdpi/ic_launcher.png delete mode 100644 OpenKeychain/src/debug/res/drawable-xxhdpi/ic_launcher.png delete mode 100644 OpenKeychain/src/debug/res/drawable-xxxhdpi/ic_launcher.png create mode 100644 OpenKeychain/src/debug/res/mipmap-hdpi/ic_launcher.png create mode 100644 OpenKeychain/src/debug/res/mipmap-mdpi/ic_launcher.png create mode 100644 OpenKeychain/src/debug/res/mipmap-xhdpi/ic_launcher.png create mode 100644 OpenKeychain/src/debug/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 OpenKeychain/src/debug/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/OpenKeychain/src/debug/res/drawable-hdpi/ic_launcher.png b/OpenKeychain/src/debug/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index bb5104aec..000000000 Binary files a/OpenKeychain/src/debug/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/OpenKeychain/src/debug/res/drawable-mdpi/ic_launcher.png b/OpenKeychain/src/debug/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index e709f735d..000000000 Binary files a/OpenKeychain/src/debug/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/OpenKeychain/src/debug/res/drawable-xhdpi/ic_launcher.png b/OpenKeychain/src/debug/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index fb4f2737a..000000000 Binary files a/OpenKeychain/src/debug/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/OpenKeychain/src/debug/res/drawable-xxhdpi/ic_launcher.png b/OpenKeychain/src/debug/res/drawable-xxhdpi/ic_launcher.png deleted file mode 100644 index 37d0958ff..000000000 Binary files a/OpenKeychain/src/debug/res/drawable-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/OpenKeychain/src/debug/res/drawable-xxxhdpi/ic_launcher.png b/OpenKeychain/src/debug/res/drawable-xxxhdpi/ic_launcher.png deleted file mode 100644 index e5183fb05..000000000 Binary files a/OpenKeychain/src/debug/res/drawable-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/OpenKeychain/src/debug/res/mipmap-hdpi/ic_launcher.png b/OpenKeychain/src/debug/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..bb5104aec Binary files /dev/null and b/OpenKeychain/src/debug/res/mipmap-hdpi/ic_launcher.png differ diff --git a/OpenKeychain/src/debug/res/mipmap-mdpi/ic_launcher.png b/OpenKeychain/src/debug/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..e709f735d Binary files /dev/null and b/OpenKeychain/src/debug/res/mipmap-mdpi/ic_launcher.png differ diff --git a/OpenKeychain/src/debug/res/mipmap-xhdpi/ic_launcher.png b/OpenKeychain/src/debug/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..fb4f2737a Binary files /dev/null and b/OpenKeychain/src/debug/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/OpenKeychain/src/debug/res/mipmap-xxhdpi/ic_launcher.png b/OpenKeychain/src/debug/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..37d0958ff Binary files /dev/null and b/OpenKeychain/src/debug/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/OpenKeychain/src/debug/res/mipmap-xxxhdpi/ic_launcher.png b/OpenKeychain/src/debug/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..e5183fb05 Binary files /dev/null and b/OpenKeychain/src/debug/res/mipmap-xxxhdpi/ic_launcher.png differ -- cgit v1.2.3