Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
Expand Down
1 change: 1 addition & 0 deletions example/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ GeneratedPluginRegistrant.java
key.properties
**/*.keystore
**/*.jks
app/.cxx/
24 changes: 24 additions & 0 deletions example/integration_test/card_basics_sdk_test.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:convert';
import 'dart:ffi';

import 'package:arculus_sdk_flutter/arculus_ffi.dart';
Expand Down Expand Up @@ -32,4 +33,27 @@ void main() {

expect(hex.toUpperCase(), TestAPDUCommands.selectWallet);
});

///[128, 202, 191, 200, 28, 159, 67, 2, 0, 2, 191, 201, 20, 128, 0, 0, 44, 128, 0, 0, 60, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
///80cabfc81c9f43020002bfc9148000002c8000003c800000000000000000000000

test("Create correct APDU command for get public key", () {
final pointer = WalletImpl.init();
final len = SizeTPointer();
final reqPointer = WalletImpl.getPublicKeyFromPathRequest(
pointer,
utf8.encode("m/44'"),
WalletCurve.ed25519,
len,
);

final unsignedBytes = reqPointer.cast<Uint8>().asTypedList(len.getValue());

print(unsignedBytes);

final hex =
unsignedBytes.map((b) => b.toRadixString(16).padLeft(2, '0')).join('');

print(hex);
});
}
22 changes: 22 additions & 0 deletions example/integration_test/sdk_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:arculus_sdk_flutter/arculus_ffi.dart';
import 'package:arculus_sdk_flutter/arculus_sdk_flutter.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

setUp(() {
ArculusSdkFlutter.init();
});

test("Test get public key", () async {
final wallet = ArculusWallet();
final publicKey = await wallet.getPublicKeyFromPath(
"m/0'",
WalletCurve.ed25519,
);

print(publicKey);
});
}
10 changes: 8 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ PODS:
- Flutter
- integration_test (0.0.1):
- Flutter
- nfc_manager (0.0.1):
- Flutter

DEPENDENCIES:
- arculus_sdk_flutter (from `.symlinks/plugins/arculus_sdk_flutter/ios`)
- Flutter (from `Flutter`)
- flutter_nfc_kit (from `.symlinks/plugins/flutter_nfc_kit/ios`)
- integration_test (from `.symlinks/plugins/integration_test/ios`)
- nfc_manager (from `.symlinks/plugins/nfc_manager/ios`)

EXTERNAL SOURCES:
arculus_sdk_flutter:
Expand All @@ -22,13 +25,16 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_nfc_kit/ios"
integration_test:
:path: ".symlinks/plugins/integration_test/ios"
nfc_manager:
:path: ".symlinks/plugins/nfc_manager/ios"

SPEC CHECKSUMS:
arculus_sdk_flutter: 0cce6a74139ca5c8f9d254d73e43956ca82f6d9d
arculus_sdk_flutter: ccc2ce182683969d2ef90268f444922f3d3ad44d
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_nfc_kit: 3985c93f749b9cb4747479205c2f10bd2f877a11
integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573
nfc_manager: d7da7cb781f7744b94df5fe9dbca904ac4a0939e

PODFILE CHECKSUM: 9c46fd01abff66081b39f5fa5767b3f1d0b11d76

COCOAPODS: 1.15.2
COCOAPODS: 1.16.2
119 changes: 62 additions & 57 deletions example/ios/Runner.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
Expand All @@ -24,6 +26,18 @@
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NFCReaderUsageDescription</key>
<string>This app uses NFC to read data from NFC tags.</string>
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>D2760000850101</string>
</array>
<key>com.apple.developer.nfc.readersession.felica.systemcodes</key>
<array>
<string>12FC</string>
</array>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand All @@ -41,9 +55,5 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
10 changes: 10 additions & 0 deletions example/ios/Runner/Runner.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>TAG</string>
</array>
</dict>
</plist>
34 changes: 25 additions & 9 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ class MyApp extends StatefulWidget {
}

class _MyAppState extends State<MyApp> {
late ArculusWallet wallet;
late ArculusWallet _wallet;

String _gguid = '';

@override
void initState() {
wallet = ArculusWallet();
_wallet = ArculusWallet();
super.initState();
}

Expand All @@ -31,21 +34,34 @@ class _MyAppState extends State<MyApp> {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Arculus example app'),
title: const Text('SDK checks'),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
// wallet.getPublicKeyFromPath(
// "m/0'",
// WalletCurve.secp256k1,
// );
onPressed: () async {
final result = await _wallet.getPublicKeyFromPath(
"m/0'",
WalletCurve.secp256k1,
);

//wallet.selectWalletAID();
},
child: const Icon(Icons.add),
),
body: Center(
child: Text('Running on:'),
child: Column(
children: [
Text('GGUID is: $_gguid'),
ElevatedButton(
onPressed: () async {
final gguid = await _wallet.cardGetGGUID();
setState(() {
_gguid = gguid;
});
},
child: const Text('Get GGUID (WalletGetGGUIDRequest)'),
),
],
),
),
),
);
Expand Down
Loading