diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 3269b62..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,11 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - -version: 2 -updates: - - package-ecosystem: 'npm' # See documentation for possible values - directory: '/' # Location of package manifests - schedule: - interval: 'monthly' diff --git a/.release-it.json b/.release-it.json index bce7147..ffc889b 100644 --- a/.release-it.json +++ b/.release-it.json @@ -37,43 +37,43 @@ "types": [ { "type": "feat", - "section": "Features" + "section": "๐ŸŽ‰ Features" }, { "type": "fix", - "section": "Bug Fixes" + "section": "๐Ÿ› Bug Fixes" }, { "type": "perf", - "section": "Performance Improvements" + "section": "โšก๏ธ Performance Improvements" }, { "type": "revert", - "section": "Reverts" + "section": "โช๏ธ Reverts" }, { "type": "docs", - "section": "Documentation" + "section": "๐Ÿ“ Documentation" }, { "type": "style", - "section": "Styles" + "section": "๐ŸŽจ Styles" }, { "type": "refactor", - "section": "Code Refactoring" + "section": "๐Ÿ”€ Code Refactoring" }, { "type": "test", - "section": "Tests" + "section": "๐Ÿงช Tests" }, { "type": "build", - "section": "Build System" + "section": "โš™๏ธ Build System" }, { "type": "ci", - "section": "Continuous Integration" + "section": "๐Ÿš€ Continuous Integration" } ] }, diff --git a/CHANGELOG.md b/CHANGELOG.md index 8715aad..fff3876 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,23 +1,40 @@ -## [1.0.1](https://github.com/evva-sfw/abrevva-react-native/compare/1.0.0...1.0.1) (2024-08-28) +## [2.0.0](https://github.com/evva-sfw/abrevva-react-native/compare/1.0.1...2.0.0) (2024-10-22) + + +### โš  BREAKING CHANGES + +* rename package name + +### chore + +* rename package name ([5cb649d](https://github.com/evva-sfw/abrevva-react-native/commit/5cb649d521859fbfec62ec006cb8b99da4d47a53)) + + +### Features + +* replaced manual disengage logic with AbrevvaSDK disengage function ([#46](https://github.com/evva-sfw/abrevva-react-native/issues/46)) ([b16cf3b](https://github.com/evva-sfw/abrevva-react-native/commit/b16cf3baa897c098d8cf6b431e7c03aa91054395)) ### Bug Fixes -* corrected output Path for decryptFileFromURL (android) ([#44](https://github.com/evva-sfw/abrevva-react-native/issues/44)) ([308c8f2](https://github.com/evva-sfw/abrevva-react-native/commit/308c8f29c059dae8e0ed55b63d15f8b7775736bf)) +* removed cryptoswift from podfile and formating ([0b6d2c5](https://github.com/evva-sfw/abrevva-react-native/commit/0b6d2c512ec5411b5f2c3cc39eb76844c8849a39)) +* removed nfc ([9384a65](https://github.com/evva-sfw/abrevva-react-native/commit/9384a65b4f6d0532964c2690c73cfdbd2dd985d4)) +* removed nfc traces ([bbb4042](https://github.com/evva-sfw/abrevva-react-native/commit/bbb404217a60bf514bbdb7c21072bd110f23c41d)) +* removed whitespace in string, since toInt throws otherwise ([82e3d6d](https://github.com/evva-sfw/abrevva-react-native/commit/82e3d6d21dd8351610762d382e5ba420e9f34327)) ### Documentation -* format readme and add shields.io ([#41](https://github.com/evva-sfw/abrevva-react-native/issues/41)) ([a4efc62](https://github.com/evva-sfw/abrevva-react-native/commit/a4efc6297e72901b61b61ea410ec09b16df15d10)) +* change deprecation alert to important ([1ee4c06](https://github.com/evva-sfw/abrevva-react-native/commit/1ee4c06ebb01a546e77c1cc027fff147b4b414c6)) -### Build System +### Continuous Integration -* add npm-compatibility-check test ([#43](https://github.com/evva-sfw/abrevva-react-native/issues/43)) ([5b18750](https://github.com/evva-sfw/abrevva-react-native/commit/5b187502a987ca58d0ee1d1061a9e92796797be6)) -* add yarn cache to github workflow caching ([#42](https://github.com/evva-sfw/abrevva-react-native/issues/42)) ([b952769](https://github.com/evva-sfw/abrevva-react-native/commit/b9527693868e6a3153c4e036195301a30708cbec)) -* fix workflow cache names ([#40](https://github.com/evva-sfw/abrevva-react-native/issues/40)) ([e72bde1](https://github.com/evva-sfw/abrevva-react-native/commit/e72bde1640ae5cfac07aaa8c7752cb364bc0ac08)) +* fix test-android gradle target ([cb28d88](https://github.com/evva-sfw/abrevva-react-native/commit/cb28d883cdf3b882e4e8c0b065ec9f9527afc9bf)) +* fix version in filename for release ([#45](https://github.com/evva-sfw/abrevva-react-native/issues/45)) ([9e6dbaf](https://github.com/evva-sfw/abrevva-react-native/commit/9e6dbafee8f7f7b748104354213f1d050ddcd6a7)) +* reconfigure auto-changelog to only track merge commits ([#52](https://github.com/evva-sfw/abrevva-react-native/issues/52)) ([089cd1a](https://github.com/evva-sfw/abrevva-react-native/commit/089cd1a9d25300fd831157997271bcf585e18c3a)) ### Changelog @@ -25,8 +42,22 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [2.0.0](https://github.com/evva-sfw/abrevva-react-native/compare/1.0.1...2.0.0) + +- chore!: rename package to @evva/ instead of @evva-sfw/ [`#60`](https://github.com/evva-sfw/abrevva-react-native/pull/60) +- fix!: removed broken nfc code [`#61`](https://github.com/evva-sfw/abrevva-react-native/pull/61) +- chore(deps-dev): bump @release-it/conventional-changelog from 8.0.1 to 8.0.2 [`#56`](https://github.com/evva-sfw/abrevva-react-native/pull/56) +- ci: reconfigure auto-changelog to only track merge commits [`#52`](https://github.com/evva-sfw/abrevva-react-native/pull/52) +- chore(deps-dev): bump commitlint from 19.4.0 to 19.4.1 [`#48`](https://github.com/evva-sfw/abrevva-react-native/pull/48) +- chore(deps-dev): bump @commitlint/config-conventional from 19.2.2 to 19.4.1 [`#50`](https://github.com/evva-sfw/abrevva-react-native/pull/50) +- chore(deps-dev): bump react-native-builder-bob from 0.29.1 to 0.30.0 [`#49`](https://github.com/evva-sfw/abrevva-react-native/pull/49) +- feat: replaced manual disengage logic with AbrevvaSDK disengage function [`#46`](https://github.com/evva-sfw/abrevva-react-native/pull/46) +- ci: fix version in filename for release [`#45`](https://github.com/evva-sfw/abrevva-react-native/pull/45) + #### [1.0.1](https://github.com/evva-sfw/abrevva-react-native/compare/1.0.0...1.0.1) +> 28 August 2024 + - fix: corrected output Path for decryptFileFromURL (android) [`#44`](https://github.com/evva-sfw/abrevva-react-native/pull/44) - build: add npm-compatibility-check test [`#43`](https://github.com/evva-sfw/abrevva-react-native/pull/43) - build: add yarn cache to github workflow caching [`#42`](https://github.com/evva-sfw/abrevva-react-native/pull/42) @@ -47,16 +78,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - build: add attest provenance with lint and release workflow [`#29`](https://github.com/evva-sfw/abrevva-react-native/pull/29) - fix: minor adjustments to scan timeout [`#28`](https://github.com/evva-sfw/abrevva-react-native/pull/28) - feat: tests for android & ios [`#23`](https://github.com/evva-sfw/abrevva-react-native/pull/23) -- chore: release 1.0.0 [`4ecb13c`](https://github.com/evva-sfw/abrevva-react-native/commit/4ecb13c555bf899f3ad45900c4c9e62f9ed0aa80) #### [0.1.5](https://github.com/evva-sfw/abrevva-react-native/compare/0.1.4...0.1.5) > 22 August 2024 -- chore: add CHANGELOG.md [`b337c52`](https://github.com/evva-sfw/abrevva-react-native/commit/b337c5234d389eb3a538de817639afe6b4005616) -- chore: release 0.1.5 [`3a77838`](https://github.com/evva-sfw/abrevva-react-native/commit/3a778385e035379153759d0c368872c4c3f09309) -- ci: enable npm upload on release [`56973c1`](https://github.com/evva-sfw/abrevva-react-native/commit/56973c101119399c3df4b567396efe8e403d56c7) - #### [0.1.4](https://github.com/evva-sfw/abrevva-react-native/compare/0.1.0...0.1.4) > 22 August 2024 @@ -66,9 +92,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore: moved eslint config to package.json [`#25`](https://github.com/evva-sfw/abrevva-react-native/pull/25) - chore: minor UI improvements [`#24`](https://github.com/evva-sfw/abrevva-react-native/pull/24) - chore(deps): bump rexml from 3.2.9 to 3.3.3 in /example [`#22`](https://github.com/evva-sfw/abrevva-react-native/pull/22) -- ci(release-it): checkout via ssh [`fd05e9a`](https://github.com/evva-sfw/abrevva-react-native/commit/fd05e9a0b3da6412acd1f3bdc508ea51e2541fb4) -- ci(release-it): fix release github token for workflow [`425ad0a`](https://github.com/evva-sfw/abrevva-react-native/commit/425ad0ae88de58f74c6efcd8ee449a1121e10477) -- ci: disable npm publish for debugging release-it workflow [`7fdd9d3`](https://github.com/evva-sfw/abrevva-react-native/commit/7fdd9d338e993bbdcb257dfad5ea5c6d68072505) #### 0.1.0 @@ -90,6 +113,3 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix: added missing yarn files [`#6`](https://github.com/evva-sfw/abrevva-react-native/pull/6) - chore: fix internal links [`#3`](https://github.com/evva-sfw/abrevva-react-native/pull/3) - Update LICENSE [`#4`](https://github.com/evva-sfw/abrevva-react-native/pull/4) -- Initital Project upload [`3524503`](https://github.com/evva-sfw/abrevva-react-native/commit/352450306f13773405be10d5f50c53d14d9dea6f) -- chore(deps-dev): bump @release-it/conventional-changelog [`335c87f`](https://github.com/evva-sfw/abrevva-react-native/commit/335c87f2fed18199e73679b47a699e9cdba2e0a6) -- refactor: added interfaces and restructured app accordingly [`436c12b`](https://github.com/evva-sfw/abrevva-react-native/commit/436c12bf624efcbccd694bf577c3d0e2c4591d32) diff --git a/Makefile b/Makefile index 713f6ec..fc760e9 100644 --- a/Makefile +++ b/Makefile @@ -11,4 +11,4 @@ test-ios: test || exit 1 test-android: - cd example/android && ./gradlew :evva-sfw_abrevva-react-native:testDebugUnitTest || exit 1 + cd example/android && ./gradlew :evva_abrevva-react-native:testDebugUnitTest || exit 1 diff --git a/README.md b/README.md index 15c01de..19afe4d 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,15 @@ -

-

EVVA React-Native Module

-

- -

- - NPM Version - - NPM Downloads - GitHub package.json dynamic - NPM Unpacked Size (with version) - GitHub last commit - GitHub branch check runs - EVVA License - -

+# Abrevva React-Native Module + +[![NPM Version](https://img.shields.io/npm/v/%40evva%2Fabrevva-react-native)](https://www.npmjs.com/package/@evva/abrevva-react-native) +[![NPM Downloads](https://img.shields.io/npm/dy/%40evva%2Fabrevva-react-native)](https://www.npmjs.com/package/@evva/abrevva-react-native) +![GitHub package.json dynamic](https://img.shields.io/github/package-json/packageManager/evva-sfw/abrevva-react-native) +![NPM Unpacked Size (with version)](https://img.shields.io/npm/unpacked-size/%40evva%2Fabrevva-react-native/latest) +![GitHub last commit](https://img.shields.io/github/last-commit/evva-sfw/abrevva-react-native) +[![GitHub branch check runs](https://img.shields.io/github/check-runs/evva-sfw/abrevva-react-native/main)]([URL](https://github.com/evva-sfw/abrevva-react-native/actions)) +[![EVVA License](https://img.shields.io/badge/license-EVVA_License-yellow.svg?color=fce500&logo=data:image/svg+xml;base64,PCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjY0MCIgaGVpZ2h0PSIxMDI0IiB2aWV3Qm94PSIwIDAgNjQwIDEwMjQiPgo8ZyBpZD0iaWNvbW9vbi1pZ25vcmUiPgo8L2c+CjxwYXRoIGZpbGw9IiNmY2U1MDAiIGQ9Ik02MjIuNDIzIDUxMS40NDhsLTMzMS43NDYtNDY0LjU1MmgtMjg4LjE1N2wzMjkuODI1IDQ2NC41NTItMzI5LjgyNSA0NjYuNjY0aDI3NS42MTJ6Ij48L3BhdGg+Cjwvc3ZnPgo=)](LICENSE) + +> [!IMPORTANT] +> This package was renamed please use the new package name! __@evva/abrevva-react-native__ The EVVA React-Native Module is a collection of tools to work with electronical EVVA access components. It allows for scanning and connecting via BLE. @@ -41,7 +37,7 @@ The EVVA React-Native Module is a collection of tools to work with electronical ## Installation ``` -yarn add @evva-sfw/abrevva-react-native +yarn add @evva/abrevva-react-native ``` ### iOS @@ -59,7 +55,7 @@ Perform a gradle sync. To start off first import `AbrevvaBle` from this module ```typescript -import { AbrevvaBle } from '@evva-sfw/abrevva-react-native'; +import { AbrevvaBle } from '@evva/abrevva-react-native'; async function scanForBleDevices(androidNeverForLocation: Boolean = true, timeout: Number) { await AbrevvaBle.initialize(androidNeverForLocation); diff --git a/abrevva-react-native.podspec b/abrevva-react-native.podspec index 7f2fe3e..f14d184 100644 --- a/abrevva-react-native.podspec +++ b/abrevva-react-native.podspec @@ -18,7 +18,7 @@ Pod::Spec.new do |s| s.dependency "CocoaMQTT" s.dependency "CryptoSwift" - s.dependency "AbrevvaSDK", '~> 1.0.23' + s.dependency "AbrevvaSDK", '1.0.31' # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0. # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79. diff --git a/android/build.gradle b/android/build.gradle index 71e50ed..9c8964e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -91,7 +91,7 @@ repositories { def kotlin_version = getExtOrDefault("kotlinVersion") dependencies { - implementation group: "com.evva.xesar", name: "abrevva-sdk-android", version: "1.0.19" + implementation group: "com.evva.xesar", name: "abrevva-sdk-android", version: "1.0.21" implementation "com.facebook.react:react-native:0.20.1" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index be24cc6..1a1fca2 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@ - diff --git a/android/src/main/java/com/evva/xesar/abrevva/reactnative/AbrevvaBleModule.kt b/android/src/main/java/com/evva/xesar/abrevva/reactnative/AbrevvaBleModule.kt index 30f0087..b11276d 100644 --- a/android/src/main/java/com/evva/xesar/abrevva/reactnative/AbrevvaBleModule.kt +++ b/android/src/main/java/com/evva/xesar/abrevva/reactnative/AbrevvaBleModule.kt @@ -10,7 +10,6 @@ import androidx.annotation.RequiresPermission import androidx.core.app.ActivityCompat import androidx.core.content.ContextCompat import com.evva.xesar.abrevva.ble.BleManager -import com.evva.xesar.abrevva.nfc.toHexString import com.evva.xesar.abrevva.util.bytesToString import com.evva.xesar.abrevva.util.stringToBytes import com.facebook.react.bridge.Arguments @@ -448,12 +447,10 @@ class AbrevvaBleModule(reactContext: ReactApplicationContext) : if (scanRecordBytes != null) { try { // Extract EVVA manufacturer-id - val arr = byteArrayOf(0x01) - arr.toHexString() - val keyHex = byteArrayOf(scanRecordBytes.getByte(6)!!).toHexString() + byteArrayOf( + val keyHex = byteArrayOf(scanRecordBytes.getByte(6)!!) + byteArrayOf( scanRecordBytes.getByte(5)!! - ).toHexString() - val keyDec = keyHex.toInt(16) + ) + val keyDec = bytesToString(keyHex).replace(" ", "").toInt(16) // Slice out manufacturer data val bytes = scanRecordBytes.copyOfRange(7, scanRecordBytes.size) diff --git a/android/src/main/java/com/evva/xesar/abrevva/reactnative/AbrevvaNfcModule.kt b/android/src/main/java/com/evva/xesar/abrevva/reactnative/AbrevvaNfcModule.kt deleted file mode 100644 index 52641b5..0000000 --- a/android/src/main/java/com/evva/xesar/abrevva/reactnative/AbrevvaNfcModule.kt +++ /dev/null @@ -1,163 +0,0 @@ -package com.evva.xesar.abrevva.reactnative - -import android.content.Intent -import android.nfc.NfcAdapter -import com.evva.xesar.abrevva.nfc.KeyStoreHandler -import com.evva.xesar.abrevva.nfc.Message -import com.evva.xesar.abrevva.nfc.Mqtt5Client -import com.evva.xesar.abrevva.nfc.NfcDelegate -import com.evva.xesar.abrevva.nfc.asByteArray -import com.evva.xesar.abrevva.nfc.toHexString -import com.facebook.react.bridge.BaseActivityEventListener -import com.facebook.react.bridge.LifecycleEventListener -import com.facebook.react.bridge.Promise -import com.facebook.react.bridge.ReactApplicationContext -import com.facebook.react.bridge.ReactContextBaseJavaModule -import com.facebook.react.bridge.ReactMethod -import com.hivemq.client.mqtt.mqtt5.message.publish.Mqtt5Publish -import java.util.Timer -import java.util.TimerTask - -class AbrevvaNfcModule(reactContext: ReactApplicationContext) : - ReactContextBaseJavaModule(reactContext) { - - private val host = "172.16.2.91" - private val port = 1883 - private val clientID = "96380897-0eee-479e-80c3-84c0dde286cd" - - private val STATUS_NFC_OK = "enabled" - - private val kyOffTimer = Timer() - private val hbTimer = Timer() - - private var mqtt5Client: Mqtt5Client? = null - private var nfcDelegate = NfcDelegate() - - private var clientId: String? = null - - private val adapterStatus: String - get() = nfcDelegate.setAdapterStatus() - - private val activityEventListener = object : BaseActivityEventListener() { - override fun onNewIntent(intent: Intent?) { - super.onNewIntent(intent) - if (intent != null) { - currentActivity!!.intent = intent - nfcDelegate.processTag(intent) { - mqtt5Client?.subscribe("readers/1/$clientId/t", ::messageReceivedCallback) - mqtt5Client?.publish( - "readers/1/$clientId", - Message( - "ky", - "on", - nfcDelegate.getIdentifier(), - nfcDelegate.getHistoricalBytesAsHexString(), - "BAKA" - ).asByteArray() - ) - setDisconnectTimer() - setHbTimer() - } - } - } - } - - private val lifecycleEventListener = object : LifecycleEventListener { - override fun onHostResume() { - nfcDelegate.restartForegroundDispatch(reactContext, currentActivity) - } - - override fun onHostPause() { - nfcDelegate.disableForegroundDispatch(reactContext, currentActivity) - } - - override fun onHostDestroy() { - } - } - - init { - reactContext.addActivityEventListener(activityEventListener) - reactContext.addLifecycleEventListener(lifecycleEventListener) - nfcDelegate.setAdapter(NfcAdapter.getDefaultAdapter(reactContext)) - } - - private fun messageReceivedCallback(response: Mqtt5Publish) { - try { - val resp = nfcDelegate.transceive(response.payloadAsBytes) - mqtt5Client?.publish("readers/1/$clientId/f", resp) - } catch (e: Exception) { - println(e) - } - } - - private fun setDisconnectTimer() { - kyOffTimer.scheduleAtFixedRate(object : TimerTask() { - override fun run() { - try { - // .isConnected throws SecurityException when Tag is outdated - nfcDelegate.isConnected() - } catch (ex: java.lang.Exception) { - mqtt5Client?.publish( - "readers/1", - Message("ky", "off", oid = clientId).asByteArray() - ) - this.cancel() - } - } - }, 250, 250) - } - - private fun setHbTimer() { - hbTimer.scheduleAtFixedRate(object : TimerTask() { - override fun run() { - mqtt5Client?.publish("readers/1", Message("cr", "hb", oid = clientId).asByteArray()) - } - }, 30000, 30000) - } - - @ReactMethod - fun read(promise: Promise) { - if (adapterStatus != STATUS_NFC_OK) { - // No NFC hardware or NFC is disabled by the user - promise.reject(adapterStatus) - return - } - nfcDelegate.restartForegroundDispatch(reactApplicationContext, currentActivity) - } - - @OptIn(ExperimentalStdlibApi::class) - @ReactMethod - fun connect() { - val ksh = KeyStoreHandler() - try { - val cacheDir = reactApplicationContext.cacheDir - ksh.parseP12File("$cacheDir/client-android.p12", "123") - ksh.initKeyManagerFactory() - ksh.initTrustManagerFactory() - } catch (ex: Exception) { - println(ex) - return - } - - this.clientId = clientID - this.mqtt5Client = Mqtt5Client(clientID, port, host, ksh) - mqtt5Client?.connect() - print(Message("ky", "off", oid = "oidValue").asByteArray().toHexString()) - } - - @ReactMethod - fun disconnect() { - hbTimer.cancel() - kyOffTimer.cancel() - mqtt5Client?.publish("readers/1", Message("cr", "off", oid = clientID).asByteArray()) - mqtt5Client?.disconnect() - } - - override fun getName(): String { - return NAME - } - - companion object { - const val NAME = "AbrevvaNfc" - } -} diff --git a/android/src/main/java/com/evva/xesar/abrevva/reactnative/ExampleAppPackage.kt b/android/src/main/java/com/evva/xesar/abrevva/reactnative/ExampleAppPackage.kt index 8670457..c8b1596 100644 --- a/android/src/main/java/com/evva/xesar/abrevva/reactnative/ExampleAppPackage.kt +++ b/android/src/main/java/com/evva/xesar/abrevva/reactnative/ExampleAppPackage.kt @@ -7,7 +7,7 @@ import com.facebook.react.uimanager.ViewManager class ExampleAppPackage : ReactPackage { override fun createNativeModules(reactContext: ReactApplicationContext): List { - return listOf(AbrevvaCryptoModule(reactContext)) + listOf(AbrevvaNfcModule(reactContext)) + listOf( + return listOf(AbrevvaCryptoModule(reactContext)) + listOf( AbrevvaBleModule(reactContext) ) } diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 2499a4f..4122f36 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 59D3BAD406D244112EDD8B5C /* [CP] Check Pods Manifest.lock */ = { + 19905B8CF9CAE6AA1D1D84D6 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-ExampleAppExample-ExampleAppExampleTests/Pods-ExampleAppExample-ExampleAppExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-ExampleAppExample-ExampleAppExampleTests-checkManifestLockResult.txt", + "${PODS_ROOT}/Target Support Files/Pods-ExampleAppExample-ExampleAppExampleTests/Pods-ExampleAppExample-ExampleAppExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ExampleAppExample-ExampleAppExampleTests/Pods-ExampleAppExample-ExampleAppExampleTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 88569654A39B7F4943A4ECB5 /* [CP] Check Pods Manifest.lock */ = { + 20635155BD5ADF3EF1109A16 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-ExampleAppExample/Pods-ExampleAppExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-ExampleAppExample-checkManifestLockResult.txt", + "${PODS_ROOT}/Target Support Files/Pods-ExampleAppExample/Pods-ExampleAppExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ExampleAppExample/Pods-ExampleAppExample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 92BE6BC0CFAA17A0C2386446 /* [CP] Embed Pods Frameworks */ = { + AA1E527239C7DC8BC535B9F1 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-ExampleAppExample-ExampleAppExampleTests/Pods-ExampleAppExample-ExampleAppExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-ExampleAppExample-ExampleAppExampleTests/Pods-ExampleAppExample-ExampleAppExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-ExampleAppExample-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ExampleAppExample-ExampleAppExampleTests/Pods-ExampleAppExample-ExampleAppExampleTests-frameworks.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -374,7 +374,7 @@ /* Begin XCBuildConfiguration section */ 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 88BFDD102C005583A3DDE543 /* Pods-ExampleAppExample.debug.xcconfig */; + baseConfigurationReference = 6CDCDB6EBD657F5AB82D4529 /* Pods-ExampleAppExample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -407,7 +407,7 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 68BC1AF6EDA113C27D65AC10 /* Pods-ExampleAppExample.release.xcconfig */; + baseConfigurationReference = 8A4DF353A54EAC9B7D836744 /* Pods-ExampleAppExample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -438,7 +438,7 @@ }; 39FBC3E42C64DE9800BEE979 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 20389187CDDBF5F10F171A64 /* Pods-ExampleAppExample-ExampleAppExampleTests.debug.xcconfig */; + baseConfigurationReference = 95A96E601730AC9031B18B92 /* Pods-ExampleAppExample-ExampleAppExampleTests.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; @@ -475,7 +475,7 @@ }; 39FBC3E52C64DE9800BEE979 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9A974A4BFAF3C7FA0946ABAC /* Pods-ExampleAppExample-ExampleAppExampleTests.release.xcconfig */; + baseConfigurationReference = 791740A1319B42B285B9B9D9 /* Pods-ExampleAppExample-ExampleAppExampleTests.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; diff --git a/example/ios/ExampleAppExample/Info.plist b/example/ios/ExampleAppExample/Info.plist index e17ceff..12ab5c2 100644 --- a/example/ios/ExampleAppExample/Info.plist +++ b/example/ios/ExampleAppExample/Info.plist @@ -31,6 +31,8 @@ NSAllowsLocalNetworking + NSBluetoothAlwaysUsageDescription + Our app does not request this permission or utilize this functionality but it is included in our info.plist since our app utilizes the react-native-permissions library, which references this permission in its code. NSLocationWhenInUseUsageDescription UILaunchStoryboardName @@ -47,15 +49,5 @@ UIViewControllerBasedStatusBarAppearance - com.apple.developer.nfc.readersession.felica.systemcodes - - 12FC - - NFCReaderUsageDescription - NFC tag to read NDEF messages into the application -NSBluetoothAlwaysUsageDescription -Our app does not request this permission or utilize this functionality but it is included in our info.plist since our app utilizes the react-native-permissions library, which references this permission in its code. - - diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index eb28ed5..bc7ad65 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - abrevva-react-native (0.1.5): + - abrevva-react-native (1.0.1): - AbrevvaSDK (~> 1.0.23) - CocoaMQTT - CryptoSwift @@ -23,7 +23,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - AbrevvaSDK (1.0.23): + - AbrevvaSDK (1.0.31): - CocoaMQTT - CryptoSwift - boost (1.83.0) @@ -32,15 +32,15 @@ PODS: - CocoaMQTT/Core (2.1.6): - MqttCocoaAsyncSocket (~> 1.0.8) - CryptoSwift (1.8.3) - - CwlCatchException (2.2.0): - - CwlCatchExceptionSupport (~> 2.2.0) - - CwlCatchExceptionSupport (2.2.0) - - CwlMachBadInstructionHandler (2.2.0) - - CwlPosixPreconditionTesting (2.2.0) - - CwlPreconditionTesting (2.2.1): - - CwlCatchException (~> 2.2.0) - - CwlMachBadInstructionHandler (~> 2.2.0) - - CwlPosixPreconditionTesting (~> 2.2.0) + - CwlCatchException (2.2.1): + - CwlCatchExceptionSupport (~> 2.2.1) + - CwlCatchExceptionSupport (2.2.1) + - CwlMachBadInstructionHandler (2.2.2) + - CwlPosixPreconditionTesting (2.2.2) + - CwlPreconditionTesting (2.2.2): + - CwlCatchException (~> 2.2.1) + - CwlMachBadInstructionHandler (~> 2.2.2) + - CwlPosixPreconditionTesting (~> 2.2.2) - DoubleConversion (1.1.6) - FBLazyVector (0.74.3) - fmt (9.1.0) @@ -50,7 +50,7 @@ PODS: - hermes-engine/Pre-built (0.74.3) - MockingbirdFramework (0.20.0) - MqttCocoaAsyncSocket (1.0.8) - - Nimble (13.4.0): + - Nimble (13.5.0): - CwlPreconditionTesting (~> 2.2.0) - Quick (7.6.2) - RCT-Folly (2024.01.01.00): @@ -1440,16 +1440,16 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/yoga" SPEC CHECKSUMS: - abrevva-react-native: 6980035371bf192213003a60418276baced5d569 - AbrevvaSDK: 4edd60273dd1b2d171e8adb5a84756aa5084347c + abrevva-react-native: bad5d64a489a5cc76813d5ac9ef5747081fc7f6c + AbrevvaSDK: 87be0b144be7212470f79d2cbc5d3b3c72df4da4 boost: d3f49c53809116a5d38da093a8aa78bf551aed09 CocoaMQTT: 1f206228b29318eabdacad0c2e4e88575922c27a CryptoSwift: 967f37cea5a3294d9cce358f78861652155be483 - CwlCatchException: 51bf8319009a31104ea6f0568730d1ecc25b6454 - CwlCatchExceptionSupport: 1345d6adb01a505933f2bc972dab60dcb9ce3e50 - CwlMachBadInstructionHandler: ea1030428925d9bf340882522af30712fb4bf356 - CwlPosixPreconditionTesting: a125dee731883f2582715f548c6b6c92c7fde145 - CwlPreconditionTesting: ccfd08aca58d14e04062b2a3dd2fd52e09857453 + CwlCatchException: 7acc161b299a6de7f0a46a6ed741eae2c8b4d75a + CwlCatchExceptionSupport: 54ccab8d8c78907b57f99717fb19d4cc3bce02dc + CwlMachBadInstructionHandler: dae4fdd124d45c9910ac240287cc7b898f4502a1 + CwlPosixPreconditionTesting: ecd095aa2129e740b44301c34571e8d85906fb88 + CwlPreconditionTesting: 67a0047dd4de4382b93442c0e3f25207f984f35a DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 FBLazyVector: 7e977dd099937dc5458851233141583abba49ff2 fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 @@ -1457,7 +1457,7 @@ SPEC CHECKSUMS: hermes-engine: 1f547997900dd0752dc0cc0ae6dd16173c49e09b MockingbirdFramework: 54e35fbbb47b806c1a1fae2cf3ef99f6eceb55e5 MqttCocoaAsyncSocket: 77d3b74f76228dd5a05d1f9526eab101d415b30c - Nimble: c3d7c9848a0adae88a665ca52f8da23dd4d2cd94 + Nimble: cc0469644d253140c6bab7e88d4ee3bbed59a25c Quick: b8bec97cd4b9f21da0472d45580f763b801fc353 RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47 RCTDeprecation: 4c7eeb42be0b2e95195563c49be08d0b839d22b4 @@ -1514,4 +1514,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: c2b657d91fc21203dd436e57c3a2a27527cbae3b -COCOAPODS: 1.14.3 +COCOAPODS: 1.15.2 diff --git a/example/src/App.tsx b/example/src/App.tsx index 42e6dba..5285df6 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -1,18 +1,8 @@ -import { AbrevvaCrypto, AbrevvaNfc } from '@evva-sfw/abrevva-react-native'; +import { AbrevvaCrypto } from '@evva/abrevva-react-native'; import { NavigationContainer } from '@react-navigation/native'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; -import { useEffect } from 'react'; import { useState } from 'react'; -import { - Dimensions, - Platform, - ScrollView, - StyleSheet, - Text, - TouchableOpacity, - View, -} from 'react-native'; -import RNFS from 'react-native-fs'; +import { Dimensions, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; import { BleScreen } from './BleScreenComponents'; @@ -23,7 +13,6 @@ const App = () => { - @@ -34,9 +23,6 @@ const App = () => { const HomeScreen = ({ navigation }) => { return ( - navigation.navigate('nfc')}> - NFC Test - navigation.navigate('crypto')}> Crpto Test @@ -47,28 +33,6 @@ const HomeScreen = ({ navigation }) => { ); }; -const NfcScreen = () => { - useEffect(() => { - if (Platform.OS === 'ios' || Platform.OS === 'android') { - RNFS.exists(`${RNFS.DocumentDirectoryPath}/client-${Platform.OS}.p12`).then((exists) => { - if (!exists) { - void RNFS.copyFile( - RNFS.MainBundlePath + `/client-${Platform.OS}.p12`, - `${RNFS.DocumentDirectoryPath}/client-${Platform.OS}.p12`, - ); - } - }); - } - }, []); - return ( - -