Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(passkit): Signature validation #69

Merged
merged 14 commits into from
Jul 30, 2024
6 changes: 4 additions & 2 deletions app/lib/example/example_passes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ class _ExamplePassesState extends State<ExamplePasses> {
for (final path in examples) {
try {
final data = await rootBundle.load(path);
final pass =
PkPass.fromBytes(data.buffer.asUint8List(), skipVerification: true);
final pass = PkPass.fromBytes(
data.buffer.asUint8List(),
skipChecksumVerification: true,
);
passes.add(pass);
} catch (exception, stackTrace) {
log('$exception\n$stackTrace');
Expand Down
5 changes: 5 additions & 0 deletions apple_passkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ After that, use `await ApplePassKit().passes()` to load your installed passes.
- [Loyalty passes](https://developer.apple.com/wallet/loyalty-passes/)
- [Wallet Developer Guide](https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/PassKit_PG/index.html#//apple_ref/doc/uid/TP40012195-CH1-SW1)

## Failure to add passes

If you run into problems adding a pass to the wallet, you can try
to use ['passkit'](https://pub.dev/packages/passkit) which may give you more specific error messages to work with.

## Contributors

Thanks a lot to all the awesome contributors:
Expand Down
6 changes: 3 additions & 3 deletions apple_passkit/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.0"
version: "1.0.0+1"
async:
dependency: transitive
description:
Expand Down Expand Up @@ -271,5 +271,5 @@ packages:
source: hosted
version: "3.0.3"
sdks:
dart: ">=3.4.3 <4.0.0"
flutter: ">=3.22.2"
dart: ">=3.4.0 <4.0.0"
flutter: ">=3.22.0"
7 changes: 5 additions & 2 deletions passkit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
## 0.0.5

- Add signature validation
- Export [Wallet Order Tracking](https://developer.apple.com/documentation/walletorders) related classes
- Rename `skipVerification` to `skipChecksumVerification`.
- This is a breaking change.
- Rename `PkPassImage` to `PkImage`.
- This is a breaking change
- Export [Wallet Order Tracking](https://developer.apple.com/documentation/walletorders) related classes

## 0.0.4

- Add missing `toJson` methods.
- Improve readme
- Add checksum verification (signature verification is still missing)
- Add checksum validation (signature verification is still missing)
- Change `webServiceUrl` from `String?` to `Uri?`. This is a breaking change
- Fix building URLs for the PassKit web service
- Remove `formatType` from `Barcode`. `Barcode.format` is an enum instead.
Expand Down
6 changes: 6 additions & 0 deletions passkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ void main() {
}
```

## Signature & Checksums

In case iOS runs into an issue with a PkPass it just shows a generic error message. This library is able to point out a more specific error, if a PkPass is malformatted, signed, or whatever.

Due to the closed source nature of the Apple Wallet software, there might be slight differences in this how the Wallet app and this package are working. If you run into such a problem, please create an issue.

## Apple Wallet PassKit docs

- [Wallet Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/wallet)
Expand Down
Loading
Loading