Compare commits

...

28 Commits

Author SHA1 Message Date
Sylvia van Os
da3eaf36f1 Release Catima 2.34.5 2025-03-22 18:18:24 +01:00
Sylvia van Os
0458c501c8 Merge pull request #2394 from CatimaLoyalty/create-pull-request/patch-1742235107
Update Fastlane changelogs
2025-03-17 19:12:06 +01:00
TheLastProject
632ef8b3a8 Update Fastlane changelogs 2025-03-17 18:11:47 +00:00
Sylvia van Os
40e5014cc6 Update changelog 2025-03-17 19:11:31 +01:00
Sylvia van Os
ba09eb4ca3 Merge pull request #2393 from CatimaLoyalty/fix/2317
Support pkpass files without any extra data
2025-03-17 19:10:57 +01:00
Sylvia van Os
2c77dcadb5 Support pkpass files without any extra data
Previously, the code assumed one of "boardingPass", "coupon", "eventTicket", "generic" existed and refused to pass a pkpass file without any of them
2025-03-17 18:37:28 +01:00
Sylvia van Os
99eaaebf1c Merge pull request #2392 from CatimaLoyalty/bump/tests_35
Run tests on API 35
2025-03-16 18:41:22 +01:00
Sylvia van Os
f2e77cdf09 Run tests on API 35 2025-03-16 18:31:53 +01:00
Sylvia van Os
8f00b17315 Merge pull request #2391 from weblate/weblate-catima-catima
Translations update from Hosted Weblate
2025-03-16 00:50:42 +01:00
Fajar Shiddiq
3a17756532 Translated using Weblate (Indonesian)
Currently translated at 100.0% (333 of 333 strings)

Translation: Catima/Android
Translate-URL: https://hosted.weblate.org/projects/catima/catima/id/
2025-03-16 00:41:45 +01:00
Sylvia van Os
cff3fff971 Merge pull request #2390 from CatimaLoyalty/create-pull-request/patch-1741987875
Update Fastlane changelogs
2025-03-14 22:32:17 +01:00
TheLastProject
2763635f17 Update Fastlane changelogs 2025-03-14 21:31:14 +00:00
Sylvia van Os
1dd1a1273f Update CHANGELOG 2025-03-14 22:31:01 +01:00
Sylvia van Os
3f5b953c16 Merge pull request #2388 from CatimaLoyalty/create-pull-request/patch-1741984134
Update Fastlane changelogs
2025-03-14 22:30:47 +01:00
Sylvia van Os
1539d88d78 Merge pull request #2389 from CatimaLoyalty/fix/pkpassCrash
Fix pkpass reading crashing Catima
2025-03-14 22:30:11 +01:00
Sylvia van Os
91ee846054 Fix pkpass reading crashing Catima 2025-03-14 22:09:04 +01:00
TheLastProject
c5cecee7b1 Update Fastlane changelogs 2025-03-14 20:28:54 +00:00
Sylvia van Os
1e0a52d780 Update CHANGELOG 2025-03-14 21:28:40 +01:00
Sylvia van Os
0792bb1407 Merge pull request #2378 from CatimaLoyalty/feature/android15
Target Android 15
2025-03-14 21:26:58 +01:00
Sylvia van Os
6e9a05389a Merge pull request #2384 from CatimaLoyalty/dependabot/github_actions/peter-evans/create-pull-request-7.0.8
Bump peter-evans/create-pull-request from 7.0.7 to 7.0.8
2025-03-10 12:11:59 +01:00
dependabot[bot]
68833a7ff1 Bump peter-evans/create-pull-request from 7.0.7 to 7.0.8
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 7.0.7 to 7.0.8.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v7.0.7...v7.0.8)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-10 02:58:22 +00:00
Sylvia van Os
cc7553850a Target Android 15
We apply window insets to basically not draw behind the top and bottom
bar. While this is a slight visual downgrade (we used to draw behind the
top bar before), it at least allows us to target Android 15.
2025-03-09 16:51:06 +01:00
Sylvia van Os
e66277d665 Merge pull request #2382 from weblate/weblate-catima-catima
Translations update from Hosted Weblate
2025-03-09 12:06:50 +01:00
Sylvia van Os
caea63ea32 Merge pull request #2383 from CatimaLoyalty/create-pull-request/patch-1741493688
Update contributors
2025-03-09 09:55:44 +01:00
TheLastProject
1761465532 Update contributors 2025-03-09 04:14:48 +00:00
Pixiii
8218cc63c7 Translated using Weblate (Lithuanian)
Currently translated at 93.3% (311 of 333 strings)

Translation: Catima/Android
Translate-URL: https://hosted.weblate.org/projects/catima/catima/lt/
2025-03-08 18:30:12 +01:00
Sylvia van Os
c2ff763311 Merge pull request #2375 from CatimaLoyalty/create-pull-request/patch-1741191680
Update locales
2025-03-07 20:07:08 +01:00
TheLastProject
d66066c195 Update locales 2025-03-05 16:21:19 +00:00
33 changed files with 169 additions and 48 deletions

View File

@@ -58,10 +58,10 @@ jobs:
api-level: 21
arch: x86_64
script: ./gradlew connected${{ matrix.flavor }}DebugAndroidTest
- name: Run instrumented tests (API 34)
- name: Run instrumented tests (API 35)
uses: ReactiveCircus/android-emulator-runner@v2
with:
api-level: 34
api-level: 35
arch: x86_64
script: ./gradlew connected${{ matrix.flavor }}DebugAndroidTest
- name: SpotBugs

View File

@@ -35,7 +35,7 @@ jobs:
- name: Run converter script
run: python .scripts/changelog_to_fastlane.py
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7.0.7
uses: peter-evans/create-pull-request@v7.0.8
with:
title: "Update Fastlane changelogs"
commit-message: "Update Fastlane changelogs"

View File

@@ -33,7 +33,7 @@ jobs:
file_in_repo: app/src/main/res/raw/contributors.txt
min_commit_count: 5
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7.0.7
uses: peter-evans/create-pull-request@v7.0.8
with:
title: "Update contributors"
commit-message: "Update contributors"

View File

@@ -39,7 +39,7 @@ jobs:
- name: Generate featureGraphic.png for each language
run: .scripts/generate_feature_graphic/generate_feature_graphic.sh
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7.0.7
uses: peter-evans/create-pull-request@v7.0.8
with:
title: "Update feature graphic"
commit-message: "Update feature graphic"

View File

@@ -26,7 +26,7 @@ jobs:
id: gradle-update
- uses: gradle/actions/wrapper-validation@v4
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7.0.7
uses: peter-evans/create-pull-request@v7.0.8
with:
title: "Update Gradle to ${{ steps.gradle-update.outputs.version }}"
commit-message: "Update Gradle to ${{ steps.gradle-update.outputs.version }}"

View File

@@ -31,7 +31,7 @@ jobs:
- name: Update locales
run: .scripts/locales.py
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7.0.7
uses: peter-evans/create-pull-request@v7.0.8
with:
title: "Update locales"
commit-message: "Update locales"

View File

@@ -1,5 +1,11 @@
# Changelog
## v2.34.5 - 147 (2025-03-22)
- Target Android 15
- Fix crash reading unsupported pkpass files
- Import pkpass support
## v2.34.4 - 146 (2025-01-17)
- Ability to sort cards by start of validity

View File

@@ -21,14 +21,14 @@ android {
defaultConfig {
applicationId = "me.hackerchick.catima"
minSdk = 21
targetSdk = 34
versionCode = 146
versionName = "2.34.4"
targetSdk = 35
versionCode = 147
versionName = "2.34.5"
vectorDrawables.useSupportLibrary = true
multiDexEnabled = true
resourceConfigurations += listOf("ar", "bg", "bn", "bn-rIN", "bs", "cs", "da", "de", "el-rGR", "en", "eo", "es", "es-rAR", "et", "fi", "fr", "gl", "he-rIL", "hi", "hr", "hu", "in-rID", "is", "it", "ja", "ko", "lt", "lv", "nb-rNO", "nl", "oc", "pl", "pt-rBR", "pt-rPT", "ro-rRO", "ru", "sk", "sl", "sr", "sv", "ta", "tr", "uk", "vi", "zh-rCN", "zh-rTW")
resourceConfigurations += listOf("ar", "bg", "bn", "bn-rIN", "bs", "cs", "da", "de", "el-rGR", "en", "eo", "es", "es-rAR", "et", "fi", "fr", "gl", "he-rIL", "hi", "hr", "hu", "in-rID", "is", "it", "ja", "ko", "lt", "lv", "nb-rNO", "nl", "oc", "pl", "pt", "pt-rBR", "pt-rPT", "ro-rRO", "ru", "sk", "sl", "sr", "sv", "ta", "tr", "uk", "vi", "zh-rCN", "zh-rTW")
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

View File

@@ -45,6 +45,7 @@ public class BarcodeSelectorActivity extends CatimaAppCompatActivity implements
binding = BarcodeSelectorActivityBinding.inflate(getLayoutInflater());
setTitle(R.string.selectBarcodeTitle);
setContentView(binding.getRoot());
Utils.applyWindowInsets(binding.getRoot());
Toolbar toolbar = binding.toolbar;
setSupportActionBar(toolbar);
enableToolbarBackButton();

View File

@@ -36,6 +36,7 @@ public class CardShortcutConfigure extends CatimaAppCompatActivity implements Lo
setResult(RESULT_CANCELED);
setContentView(binding.getRoot());
Utils.applyWindowInsets(binding.getRoot());
Toolbar toolbar = binding.toolbar;
toolbar.setTitle(R.string.shortcutSelectCard);
setSupportActionBar(toolbar);

View File

@@ -7,6 +7,7 @@ import android.os.Bundle;
import android.view.View;
import android.view.Window;
import androidx.activity.EdgeToEdge;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar;
@@ -24,6 +25,7 @@ public class CatimaAppCompatActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
EdgeToEdge.enable(this);
super.onCreate(savedInstanceState);
Utils.patchColors(this);
}

View File

@@ -60,6 +60,7 @@ public class ImportExportActivity extends CatimaAppCompatActivity {
binding = ImportExportActivityBinding.inflate(getLayoutInflater());
setTitle(R.string.importExport);
setContentView(binding.getRoot());
Utils.applyWindowInsets(binding.getRoot());
Toolbar toolbar = binding.toolbar;
setSupportActionBar(toolbar);
enableToolbarBackButton();

View File

@@ -297,6 +297,7 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity implements
super.onCreate(savedInstanceState);
binding = LoyaltyCardEditActivityBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
Utils.applyWindowInsets(binding.getRoot());
viewModel = new ViewModelProvider(this).get(LoyaltyCardEditActivityViewModel.class);

View File

@@ -248,6 +248,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
super.onCreate(savedInstanceState);
binding = LoyaltyCardViewLayoutBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
Utils.applyWindowInsets(binding.getRoot());
Toolbar toolbar = binding.toolbar;
setSupportActionBar(toolbar);

View File

@@ -229,6 +229,7 @@ public class MainActivity extends CatimaAppCompatActivity implements LoyaltyCard
binding = MainActivityBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
Utils.applyWindowInsets(binding.getRoot());
setSupportActionBar(binding.toolbar);
groupsTabLayout = binding.groups;
contentMainBinding = ContentMainBinding.bind(binding.include.getRoot());

View File

@@ -48,6 +48,7 @@ public class ManageGroupActivity extends CatimaAppCompatActivity implements Mana
super.onCreate(inputSavedInstanceState);
binding = ActivityManageGroupBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
Utils.applyWindowInsets(binding.getRoot());
Toolbar toolbar = binding.toolbar;
setSupportActionBar(toolbar);

View File

@@ -42,6 +42,7 @@ public class ManageGroupsActivity extends CatimaAppCompatActivity implements Gro
binding = ManageGroupsActivityBinding.inflate(getLayoutInflater());
setTitle(R.string.groups);
setContentView(binding.getRoot());
Utils.applyWindowInsets(binding.getRoot());
Toolbar toolbar = binding.toolbar;
setSupportActionBar(toolbar);
enableToolbarBackButton();

View File

@@ -296,30 +296,22 @@ class PkpassParser(context: Context, uri: Uri?) {
}
// Append type-specific info to the pass
noteText.append("\n\n")
// Find the relevant pass type and parse it
var hasPassData = false
for (passType in listOf("boardingPass", "coupon", "eventTicket", "generic")) {
try {
noteText.append(
parsePassJSONPassFields(
jsonObject.getJSONObject(passType),
locale
)
var extraText = parsePassJSONPassFields(
jsonObject.getJSONObject(passType),
locale
)
hasPassData = true
noteText.append("\n\n")
noteText.append(extraText)
break
} catch (ignored: JSONException) {}
}
// Failed to parse anything, error out
if (!hasPassData) {
throw FormatException(mContext.getString(R.string.errorReadingFile))
}
note = noteText.toString()
}

View File

@@ -100,6 +100,7 @@ public class ScanActivity extends CatimaAppCompatActivity {
customBarcodeScannerBinding = CustomBarcodeScannerBinding.bind(binding.zxingBarcodeScanner);
setTitle(R.string.scanCardBarcode);
setContentView(binding.getRoot());
Utils.applyWindowInsets(binding.getRoot());
Toolbar toolbar = binding.toolbar;
setSupportActionBar(toolbar);
enableToolbarBackButton();

View File

@@ -24,6 +24,13 @@ import com.yalantis.ucrop.UCropActivity;
public class UCropWrapper extends UCropActivity {
public static final String UCROP_TOOLBAR_TYPEFACE_STYLE = "ucop_toolbar_typeface_style";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Utils.applyWindowInsets(findViewById(android.R.id.content));
}
@Override
protected void onPostCreate(@Nullable Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);

View File

@@ -27,6 +27,7 @@ import android.util.Log;
import android.util.TypedValue;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;
@@ -38,7 +39,10 @@ import androidx.annotation.RawRes;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.graphics.ColorUtils;
import androidx.core.graphics.Insets;
import androidx.core.os.LocaleListCompat;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.core.view.WindowInsetsControllerCompat;
import androidx.core.widget.TextViewCompat;
import androidx.exifinterface.media.ExifInterface;
@@ -194,12 +198,25 @@ public class Utils {
List<String> locales = pkpassParser.listLocales();
if (locales.isEmpty()) {
return Collections.singletonList(new ParseResult(ParseResultType.FULL, pkpassParser.toLoyaltyCard(null)));
try {
return Collections.singletonList(new ParseResult(ParseResultType.FULL, pkpassParser.toLoyaltyCard(null)));
} catch (Exception e) {
Log.e(TAG, "Error calling toLoyaltyCard on pkpass file", e);
Toast.makeText(context, R.string.errorReadingFile, Toast.LENGTH_LONG).show();
return new ArrayList<>();
}
}
List<ParseResult> parseResultList = new ArrayList<>();
for (String locale : locales) {
ParseResult parseResult = new ParseResult(ParseResultType.FULL, pkpassParser.toLoyaltyCard(locale));
ParseResult parseResult;
try {
parseResult = new ParseResult(ParseResultType.FULL, pkpassParser.toLoyaltyCard(locale));
} catch (Exception e) {
Log.e(TAG, "Error calling toLoyaltyCard on pkpass file", e);
Toast.makeText(context, R.string.errorReadingFile, Toast.LENGTH_LONG).show();
return new ArrayList<>();
}
parseResult.setNote(locale);
parseResultList.add(parseResult);
}
@@ -1093,4 +1110,20 @@ public class Utils {
return false;
}
}
public static void applyWindowInsets(View root) {
/* This function basically fakes the activity being edge-to-edge. Useful for those activities that are really hard to get to behave well */
ViewCompat.setOnApplyWindowInsetsListener(root, (view, windowInsets) -> {
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
layoutParams.leftMargin = insets.left;
layoutParams.bottomMargin = insets.bottom;
layoutParams.rightMargin = insets.right;
layoutParams.topMargin = insets.top;
view.setLayoutParams(layoutParams);
return WindowInsetsCompat.CONSUMED;
});
}
}

View File

@@ -42,6 +42,7 @@ public class SettingsActivity extends CatimaAppCompatActivity {
binding = SettingsActivityBinding.inflate(getLayoutInflater());
setTitle(R.string.settings);
setContentView(binding.getRoot());
Utils.applyWindowInsets(binding.getRoot());
Toolbar toolbar = binding.toolbar;
setSupportActionBar(toolbar);
enableToolbarBackButton();

View File

@@ -6,7 +6,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="protect.card_locker.MainActivity"
tools:context="protect.card_locker.ManageGroupActivity"
tools:showIn="@layout/main_activity">
<TextView

View File

@@ -16,8 +16,8 @@ Altonss
Michael Moroni
Eric
GM
Petr Novák
laralem
Petr Novák
Joel A
B o d o
Priit Jõerüüt
@@ -27,31 +27,31 @@ Aayush Gupta
Scrambled777
Максим Горпиніч
ikanakova
Giovanni Donisi
HudobniVolk
Nyatsuki
Giovanni Donisi
Jiri Grönroos
Nyatsuki
Edgars Andersons
Balázs Meskó
Milo Ivir
Samantaz Fox
Balázs Meskó
Arno-github
josé m
Ankit Tiwari
Cliff Heraldo
Sergio Paredes
Ankit Tiwari
Silvério Santos
josé m
Arno-github
Jose Delvani
mdvhimself
Milan Šalka
huuhaa
Skrripy
Kachelkaiser
Projjal Moitra
Quentin PAGÈS
ngocanhtve
Silvério Santos
Marnick L'Eau
Skrripy
huuhaa
waffshappen
Marnick L'Eau
ngocanhtve
Quentin PAGÈS
Projjal Moitra
Robin
JungHee Lee
தமிழ் நேரம்

View File

@@ -302,4 +302,5 @@
<string name="addFromPkpass">Pilih file Buku Tabungan (.pkpass)</string>
<string name="unsupportedFile">File ini tidak didukung</string>
<string name="generic_error_please_retry">Maaf, terjadi kesalahan, silakan coba lagi...</string>
</resources>
<string name="sort_by_valid_from">Berlaku dari</string>
</resources>

View File

@@ -42,7 +42,7 @@
<string name="importLoyaltyCardKeychain">Importuoti iš Loyalty Card Keychain</string>
<string name="app_loyalty_card_keychain">Lojalumo kortelės</string>
<string name="moveBarcodeToTopOfScreen">Perkelti brūkšninį kodą į ekrano viršų</string>
<string name="settings_display_barcode_max_brightness">Šviesinti brūkšninio kodo rodinį</string>
<string name="settings_display_barcode_max_brightness">Šviesinti ekraną</string>
<string name="failedParsingImportUriError">Nepavyko iššifruoti importo URI</string>
<string name="turn_flashlight_off">Išjunkti žibintuvėlį</string>
<string name="turn_flashlight_on">Įjunkti žibintuvėlį</string>
@@ -196,7 +196,7 @@
<string name="noGiftCardsGroup">Sukurkite keletą kortelių ir priskirkite jas grupei čia.</string>
<string name="setIcon">Nustatyti piktogramą</string>
<string name="selectColor">Pasirinkti spalvą</string>
<string name="settings_card_orientation">Brūkšninio kodo orientacija</string>
<string name="settings_card_orientation">Ekrano orientacija</string>
<string name="failedLaunchingPhotoPicker">Nepavyko rasti palaikomos galerijos programėlės</string>
<string name="previousCard">Ankstesnė</string>
<string name="nextCard">Kita</string>
@@ -264,7 +264,7 @@
<string name="enter_card_id">Įveskite ID numerį arba tekstą ant jūsų kortelės</string>
<string name="noCameraFoundGuideText">Atrodo, kad jūsų įrenginys neturi kameros. Jei jis turi kamerą, pabandykite perkrauti įrenginį. Naudokite žemiau esantį „Daugiau galimybių“ mygtuką, kad pridėtumėte brūkšninį kodą kitu būdu.</string>
<string name="settings_display_barcode_max_brightness_summary">Būtina, kad veiktų kai kurie skeneriai</string>
<string name="settings_disable_lockscreen_while_viewing_card_summary">Išjungti ekrano užraktą kol peržiūrite kortelę</string>
<string name="settings_disable_lockscreen_while_viewing_card_summary">Išjungia ekrano užraktą kol peržiūrite kortelę</string>
<string name="settings_allow_content_provider_read_title">Leisti kitoms programoms išrinkti mano informaciją</string>
<string name="settings_allow_content_provider_read_summary">Programos vis tiek turės prašyti leidimo, kad gautu informaciją</string>
<string name="show_name_below_image_thumbnail">Rodyti pavadinimą po piktogramą</string>
@@ -273,7 +273,7 @@
<string name="continue_">Tęsti</string>
<string name="add_manually_warning_message">Kai kuriuose parduotuvėse brūkšninio kodo vertė gali skirtis nuo kortelėje nurodyto numerio. Dėlto įvedus brūkšninį kodą rankiniu būdu gali nepavykti. Vietoj to, labai rekomenduojama nuskaityti brūkšninį kodą naudojant kamerą. Ar vis tiek norite tęsti?</string>
<string name="permissionReadCardsLabel">Skenuoti Catima Korteles</string>
<string name="settings_category_title_cards">Kortelės</string>
<string name="settings_category_title_cards">Kortelių peržiūra</string>
<string name="settings_category_title_general">Bendri</string>
<string name="settings_category_title_privacy">Privatumąi</string>
<string name="importCancelled">Importas atšauktas</string>
@@ -298,4 +298,7 @@
<string name="app_copyright_short">Autorių teisės © Sylvia van Os ir Pagalbininkai</string>
<string name="useFrontImage">Naudoti priekinį vaizdą</string>
<string name="useBackImage">Naudoti galinį vaizdą</string>
</resources>
<string name="sort_by_valid_from">Teisinga forma</string>
<string name="settings_use_volume_keys_navigation">Keisti korteles su garso mygtukais</string>
<string name="settings_use_volume_keys_navigation_summary">Naudokite garso mygtukus kortelių pakeitimui</string>
</resources>

View File

@@ -140,6 +140,7 @@
<item>nl</item>
<item>oc</item>
<item>pl</item>
<item>pt</item>
<item>pt-rBR</item>
<item>pt-rPT</item>
<item>ro-rRO</item>

View File

@@ -32,6 +32,7 @@
<locale android:name="nl" />
<locale android:name="oc" />
<locale android:name="pl" />
<locale android:name="pt" />
<locale android:name="pt-BR" />
<locale android:name="pt-PT" />
<locale android:name="ro-RO" />

View File

@@ -176,6 +176,69 @@ class PkpassTest {
Assert.assertTrue(imageBitmap.sameAs(parser.image))
}
@Test
fun testFakeEmptyEurowingsPassForGitHubIssue2317() {
// Prepare
val context: Context = ApplicationProvider.getApplicationContext()
val pkpass = "pkpass/Eurowings_fake_empty_for_gh_issue_2317/Eurowings.pkpass"
val image = "pkpass/Eurowings_fake_empty_for_gh_issue_2317/logo@2x.png"
val pkpassUri = Uri.parse(pkpass)
val imageUri = Uri.parse(image)
ShadowContentResolver().registerInputStream(pkpassUri, javaClass.getResourceAsStream(pkpass))
ShadowContentResolver().registerInputStream(imageUri, javaClass.getResourceAsStream(image))
val parser = PkpassParser(context, pkpassUri)
val imageBitmap = BitmapFactory.decodeStream(context.contentResolver.openInputStream(imageUri))
// Confirm this does not have languages
Assert.assertEquals(listOf("de", "en"), parser.listLocales())
// Confirm correct parsing (en)
var parsedCard = parser.toLoyaltyCard("de")
Assert.assertEquals(-1, parsedCard.id)
Assert.assertEquals("EUROWINGS", parsedCard.store)
Assert.assertEquals("Eurowings Boarding Pass", parsedCard.note)
Assert.assertEquals(Date(1567911600000), parsedCard.validFrom)
Assert.assertEquals(null, parsedCard.expiry)
Assert.assertEquals(BigDecimal(0), parsedCard.balance)
Assert.assertEquals(null, parsedCard.balanceType)
Assert.assertEquals("M1DOE/JOHN JBZPPP CGNDBVEW 0954 251A012D0073 148>5181W 9250BEW 00000000000002A0000000000000 0 N", parsedCard.cardId)
Assert.assertEquals(null, parsedCard.barcodeId)
Assert.assertEquals(BarcodeFormat.AZTEC, parsedCard.barcodeType!!.format())
Assert.assertEquals(Color.parseColor("#FFFFFF"), parsedCard.headerColor)
Assert.assertEquals(0, parsedCard.starStatus)
Assert.assertEquals(0, parsedCard.archiveStatus)
Assert.assertEquals(0, parsedCard.lastUsed)
Assert.assertEquals(DBHelper.DEFAULT_ZOOM_LEVEL, parsedCard.zoomLevel)
// Confirm correct image is used
Assert.assertTrue(imageBitmap.sameAs(parser.image))
// Confirm correct parsing (en)
parsedCard = parser.toLoyaltyCard("en")
Assert.assertEquals(-1, parsedCard.id)
Assert.assertEquals("EUROWINGS", parsedCard.store)
Assert.assertEquals("Eurowings Boarding Pass", parsedCard.note)
Assert.assertEquals(Date(1567911600000), parsedCard.validFrom)
Assert.assertEquals(null, parsedCard.expiry)
Assert.assertEquals(BigDecimal(0), parsedCard.balance)
Assert.assertEquals(null, parsedCard.balanceType)
Assert.assertEquals("M1DOE/JOHN JBZPPP CGNDBVEW 0954 251A012D0073 148>5181W 9250BEW 00000000000002A0000000000000 0 N", parsedCard.cardId)
Assert.assertEquals(null, parsedCard.barcodeId)
Assert.assertEquals(BarcodeFormat.AZTEC, parsedCard.barcodeType!!.format())
Assert.assertEquals(Color.parseColor("#FFFFFF"), parsedCard.headerColor)
Assert.assertEquals(0, parsedCard.starStatus)
Assert.assertEquals(0, parsedCard.archiveStatus)
Assert.assertEquals(0, parsedCard.lastUsed)
Assert.assertEquals(DBHelper.DEFAULT_ZOOM_LEVEL, parsedCard.zoomLevel)
// Confirm correct image is used
Assert.assertTrue(imageBitmap.sameAs(parser.image))
}
@Test
fun testDCBPkPass() {
// Prepare

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@@ -0,0 +1,3 @@
- Target Android 15
- Fix crash reading unsupported pkpass files
- Import pkpass support

View File

@@ -15,7 +15,6 @@ dependencyResolutionManagement {
filter {
// limit jitpack repository to these groups
includeGroup("com.github.yalantis")
includeGroup("com.github.invissvenska")
}
}
}