From 6df8b7b1ea889dd966849496c488338c00ee093b Mon Sep 17 00:00:00 2001 From: Sylvia van Os Date: Sun, 11 Jul 2021 13:31:03 +0200 Subject: [PATCH] Generate catima.app share links --- app/src/main/AndroidManifest.xml | 13 +++++---- .../protect/card_locker/ImportURIHelper.java | 28 +++++++++++-------- app/src/main/res/values/strings.xml | 10 ++++--- .../protect/card_locker/ImportURITest.java | 6 ++-- 4 files changed, 35 insertions(+), 22 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8a61d1a1e..9d7b68535 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -60,13 +60,16 @@ - + + android:host="@string/intent_import_card_from_url_host_catima_app" + android:pathPrefix="@string/intent_import_card_from_url_path_prefix_catima_app" /> + android:host="@string/intent_import_card_from_url_host_thelastproject" + android:pathPrefix="@string/intent_import_card_from_url_path_prefix_thelastproject" /> + sharedpreference_privacy_policy_shown I want to share a card with you - thelastproject.github.io - /Catima/share - brarcher.github.io - /loyalty-card-locker/share + catima.app + /share + thelastproject.github.io + /Catima/share + brarcher.github.io + /loyalty-card-locker/share Card data imported Card data exported diff --git a/app/src/test/java/protect/card_locker/ImportURITest.java b/app/src/test/java/protect/card_locker/ImportURITest.java index a2b6b75d9..3a15d4796 100644 --- a/app/src/test/java/protect/card_locker/ImportURITest.java +++ b/app/src/test/java/protect/card_locker/ImportURITest.java @@ -109,9 +109,10 @@ public class ImportURITest { @Test public void failToParseBadData() { - String[] urls = new String[2]; + String[] urls = new String[3]; urls[0] = "https://brarcher.github.io/loyalty-card-locker/share?stare=store¬e=note&cardid=12345&barcodetype=ITF&headercolor=-416706"; urls[1] = "https://thelastproject.github.io/Catima/share#stare%3Dstore%26note%3Dnote%26balance%3D0%26cardid%3D12345%26barcodetype%3DITF%26headercolor%3D-416706"; + urls[2] = "https://catima.app/share#stare%3Dstore%26note%3Dnote%26balance%3D0%26cardid%3D12345%26barcodetype%3DITF%26headercolor%3D-416706"; for (String url : urls) { try { @@ -126,9 +127,10 @@ public class ImportURITest { @Test public void parseAdditionalUnforeseenData() { - String[] urls = new String[2]; + String[] urls = new String[3]; urls[0] = "https://brarcher.github.io/loyalty-card-locker/share?store=store¬e=note&cardid=12345&barcodetype=ITF&headercolor=-416706&headertextcolor=-1¬foreseen=no"; urls[1] = "https://thelastproject.github.io/Catima/share#store%3Dstore%26note%3Dnote%26balance%3D0%26cardid%3D12345%26barcodetype%3DITF%26headercolor%3D-416706%26notforeseen%3Dno"; + urls[2] = "https://catima.app/share#store%3Dstore%26note%3Dnote%26balance%3D0%26cardid%3D12345%26barcodetype%3DITF%26headercolor%3D-416706%26notforeseen%3Dno"; for (String url : urls) { LoyaltyCard parsedCard = null;