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

fix!: removed broken nfc code #61

Merged
merged 4 commits into from
Oct 22, 2024
Merged
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: 1 addition & 1 deletion abrevva-react-native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.evva.xesar.abrevva.reactnative">

<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import com.facebook.react.uimanager.ViewManager

class ExampleAppPackage : ReactPackage {
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
return listOf(AbrevvaCryptoModule(reactContext)) + listOf(AbrevvaNfcModule(reactContext)) + listOf(
return listOf(AbrevvaCryptoModule(reactContext)) + listOf(
AbrevvaBleModule(reactContext)
)
}
Expand Down
1 change: 0 additions & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.NFC"/>
<uses-permission android:name="android.permission.INTERNET" />

<application
Expand Down
Loading
Loading