From aa31abd93f568045d601df2507b228ec71e97926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Wed, 10 Jun 2015 19:47:29 +0200 Subject: Allow debug build besides release build --- .../src/debug/res/drawable-hdpi/ic_launcher.png | Bin 0 -> 6863 bytes .../src/debug/res/drawable-mdpi/ic_launcher.png | Bin 0 -> 4609 bytes .../src/debug/res/drawable-xhdpi/ic_launcher.png | Bin 0 -> 8887 bytes .../src/debug/res/drawable-xxhdpi/ic_launcher.png | Bin 0 -> 13422 bytes .../src/debug/res/drawable-xxxhdpi/ic_launcher.png | Bin 0 -> 16655 bytes OpenKeychain/src/main/AndroidManifest.xml | 10 +++++----- .../java/org/sufficientlysecure/keychain/Constants.java | 9 ++++++--- .../keychain/KeychainApplication.java | 4 +--- .../keychain/provider/KeychainContract.java | 2 +- .../keychain/provider/TemporaryStorageProvider.java | 3 ++- OpenKeychain/src/main/res/xml/account_desc.xml | 2 +- OpenKeychain/src/main/res/xml/sync_adapter_desc.xml | 2 +- 12 files changed, 17 insertions(+), 15 deletions(-) create mode 100644 OpenKeychain/src/debug/res/drawable-hdpi/ic_launcher.png create mode 100644 OpenKeychain/src/debug/res/drawable-mdpi/ic_launcher.png create mode 100644 OpenKeychain/src/debug/res/drawable-xhdpi/ic_launcher.png create mode 100644 OpenKeychain/src/debug/res/drawable-xxhdpi/ic_launcher.png create mode 100644 OpenKeychain/src/debug/res/drawable-xxxhdpi/ic_launcher.png (limited to 'OpenKeychain/src') diff --git a/OpenKeychain/src/debug/res/drawable-hdpi/ic_launcher.png b/OpenKeychain/src/debug/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 000000000..bb5104aec Binary files /dev/null and b/OpenKeychain/src/debug/res/drawable-hdpi/ic_launcher.png differ diff --git a/OpenKeychain/src/debug/res/drawable-mdpi/ic_launcher.png b/OpenKeychain/src/debug/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 000000000..e709f735d Binary files /dev/null and b/OpenKeychain/src/debug/res/drawable-mdpi/ic_launcher.png differ diff --git a/OpenKeychain/src/debug/res/drawable-xhdpi/ic_launcher.png b/OpenKeychain/src/debug/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 000000000..fb4f2737a Binary files /dev/null and b/OpenKeychain/src/debug/res/drawable-xhdpi/ic_launcher.png differ diff --git a/OpenKeychain/src/debug/res/drawable-xxhdpi/ic_launcher.png b/OpenKeychain/src/debug/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..37d0958ff Binary files /dev/null and b/OpenKeychain/src/debug/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/OpenKeychain/src/debug/res/drawable-xxxhdpi/ic_launcher.png b/OpenKeychain/src/debug/res/drawable-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..e5183fb05 Binary files /dev/null and b/OpenKeychain/src/debug/res/drawable-xxxhdpi/ic_launcher.png differ diff --git a/OpenKeychain/src/main/AndroidManifest.xml b/OpenKeychain/src/main/AndroidManifest.xml index 7b74a5b20..81a692e2e 100644 --- a/OpenKeychain/src/main/AndroidManifest.xml +++ b/OpenKeychain/src/main/AndroidManifest.xml @@ -50,9 +50,9 @@ android:name="android.hardware.screen.portrait" android:required="false" /> - + - + @@ -727,7 +727,7 @@ @@ -805,9 +805,9 @@ + android:writePermission="${applicationId}.WRITE_TEMPORARY_STORAGE" /> diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java index 3aa58d024..f0e922a2f 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java @@ -31,14 +31,17 @@ public final class Constants { public static final boolean DEBUG_LOG_DB_QUERIES = false; public static final boolean DEBUG_SYNC_REMOVE_CONTACTS = false; - public static final String TAG = "Keychain"; + public static final String TAG = DEBUG ? "Keychain D" : "Keychain"; public static final String PACKAGE_NAME = "org.sufficientlysecure.keychain"; - public static final String ACCOUNT_NAME = "OpenKeychain"; - public static final String ACCOUNT_TYPE = PACKAGE_NAME + ".account"; + public static final String ACCOUNT_NAME = DEBUG ? "OpenKeychain D" : "OpenKeychain"; + public static final String ACCOUNT_TYPE = BuildConfig.ACCOUNT_TYPE; public static final String CUSTOM_CONTACT_DATA_MIME_TYPE = "vnd.android.cursor.item/vnd.org.sufficientlysecure.keychain.key"; + public static final String PROVIDER_AUTHORITY = BuildConfig.PROVIDER_AUTHORITY; + public static final String TEMPSTORAGE_AUTHORITY = BuildConfig.TEMPSTORAGE_AUTHORITY; + // as defined in http://tools.ietf.org/html/rfc3156, section 7 public static final String NFC_MIME = "application/pgp-keys"; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java index 710dbf8aa..98f19e98f 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java @@ -128,8 +128,6 @@ public class KeychainApplication extends Application { /** * Add OpenKeychain account to Android to link contacts with keys - * - * @param context */ public static void setupAccountAsNeeded(Context context) { try { @@ -165,7 +163,7 @@ public class KeychainApplication extends Application { int edgeDrawableId = context.getResources().getIdentifier("overscroll_edge", "drawable", "android"); Drawable androidEdge = context.getResources().getDrawable(edgeDrawableId); androidEdge.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN); - } catch (Resources.NotFoundException e) { + } catch (Exception ignored) { } } } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainContract.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainContract.java index d5283f01f..0d9a4ac16 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainContract.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainContract.java @@ -90,7 +90,7 @@ public class KeychainContract { String PACKAGE_NAME = "package_name"; // foreign key to api_apps.package_name } - public static final String CONTENT_AUTHORITY = Constants.PACKAGE_NAME + ".provider"; + public static final String CONTENT_AUTHORITY = Constants.PROVIDER_AUTHORITY; private static final Uri BASE_CONTENT_URI_INTERNAL = Uri .parse("content://" + CONTENT_AUTHORITY); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java index 45f806960..2000a6525 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java @@ -45,7 +45,8 @@ public class TemporaryStorageProvider extends ContentProvider { private static final String COLUMN_ID = "id"; private static final String COLUMN_NAME = "name"; private static final String COLUMN_TIME = "time"; - private static final Uri BASE_URI = Uri.parse("content://org.sufficientlysecure.keychain.tempstorage/"); + public static final String CONTENT_AUTHORITY = Constants.TEMPSTORAGE_AUTHORITY; + private static final Uri BASE_URI = Uri.parse("content://" + CONTENT_AUTHORITY); private static final int DB_VERSION = 2; private static File cacheDir; diff --git a/OpenKeychain/src/main/res/xml/account_desc.xml b/OpenKeychain/src/main/res/xml/account_desc.xml index d29395202..6d8d76b02 100644 --- a/OpenKeychain/src/main/res/xml/account_desc.xml +++ b/OpenKeychain/src/main/res/xml/account_desc.xml @@ -1,5 +1,5 @@ diff --git a/OpenKeychain/src/main/res/xml/sync_adapter_desc.xml b/OpenKeychain/src/main/res/xml/sync_adapter_desc.xml index 6871e1a5d..a134fdebe 100644 --- a/OpenKeychain/src/main/res/xml/sync_adapter_desc.xml +++ b/OpenKeychain/src/main/res/xml/sync_adapter_desc.xml @@ -1,7 +1,7 @@