1989340_ja-JP

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

1989340_ja-JP

1989340_ja-JP

タグレスポンスでのTaplinx iOSアプリのクラッシュ

こんにちは、私は UG10045.pdfに従ってiOSアプリケーションを作成しました。私はApduExchangeWithByteArrayメソッドを作成し、その内容を実装しました。ただし、タグからtaplinxライブラリに応答を返すと、デバイスログから次のエントリでアプリケーションがクラッシュします。

Time	Device Name	Type	PID	Tag	Message
Nov  6 20:44:31	iPhone	Notice	5223	MobileFacilityApp	Command Set - 1
Nov  6 20:44:31	iPhone	Notice	5223	MobileFacilityApp	Command Set - Native
Nov  6 20:44:31	iPhone	Error	0	kernel(Sandbox)	Sandbox: MobileFacilityApp(5223) deny(1) sysctl-read kern.bootargs
Nov  6 20:44:38	iPhone	Notice	5223	MobileFacilityApp(UIKitCore)	Received memory warning.
Nov  6 20:44:38	iPhone	Notice	5223	MobileFacilityApp(UIKitCore)	Received memory warning.
Nov  6 20:44:40	iPhone	Notice	0	kernel	EXC_RESOURCE -> MobileFacilityApp[5223] exceeded mem limit: InactiveHard 3072 MB (fatal)
Nov  6 20:44:40	iPhone	Notice	0	kernel	memorystatus: killing process 5223 [MobileFacilityApp] in high band FOREGROUND (100) - memorystatus_available_pages: 44859

空の応答をtaplinxライブラリに送り返すと(ResponseDataを設定せずにTL_TagAPDUResponse)、アプリはクラッシュせず、不完全な応答に関するエラーが発生します(これは予想されます)。私は何が間違っていますか?

Re:タグ応答のTaplinx iOSのappcrashについてフォローアップ - 私が自分のものを提供する代わりに提供されたTapLinxApduHandlerを使用するように実装を変更したとき - その後、apduExchangeWithByteArrayはコントラクトに準拠します - (null許容 TL_TagAPDUResponse *)apduExchangeWithByteArray:(NSData *_Nonnull)apduData;Re:タグ応答のTaplinx iOSのappcrashについて

@ukcas - Taplinx iOSライブラリのどのバージョンが「最新」ですか?私は2.0.0を持っており、 apduExchangeメソッドからTL_TagAPDUResponseを返すと間違いなくクラッシュするため、j2objcライブラリからの生のIOSByteArrayである必要があります。私はtaplinxライブラリにC#バインディングを使用していますが、この問題では問題ではありません。

Re:タグ応答のTaplinx iOSのappcrashについてこんにちは
クラッシュは間違いなくTaplinxライブラリから来ています。
- (null 許容 TL_TagAPDUResponse *)apduExchangeWithByteArray:(NSData *_Nonnull)apduData;
実際には:
- (null 許容 IOSByteArray*)apduExchangeWithByteArray:(IOSByteArray*_Nonnull)apduData;
それは動き始めました

Re:タグ応答のTaplinx iOSのappcrashについて

こんにちは、ダミアン。

たぶん、エラーの原因は、TapLinxライブラリではなく、メモリ制限を超えていることですか?

MobileFacilityApp[5223] exceeded mem limit: InactiveHard 3072 MB (fatal)

TapLinxライブラリを統合したアプリケーションは、次のように使用できます(ApduExchangeを上に実装する必要はありません)。

代理オブジェクトを APDUHandler に設定する

let reader = TL_IOSNFCReader(uid: tag.identifier, historicalBytes: tag.historicalBytes ?? Data())

handler = TapLinxApduHandler(reader: reader)

handler.delegate = self

                

libraryManager?.setApduHandlerWithApduHandler(handler)

次のステップは、アプリケーション内にプロトコルメソッドを実装することです


func apduExchange(withByteArray apduData: Data) -> TL_TagAPDUResponse? {

        var tagAPDUResponse: TL_TagAPDUResponse?

       

        if connectedTag != nil {

            // Send Tag Type Native of ISO and the apdu as NFCISO7816APDU

            executeAPDUCommandOn7816Tag(tagType: tagtype, apdu: apdu) { data in

                let appendedData = data


                tagAPDUResponse = TL_TagAPDUResponse(responseData: appendedData, tag: self.currentTag)

                semaphore.signal()

            }

            let _ = semaphore.wait(timeout: .now() + 3.0)

        } else if connectedMifareTag != nil {

            let semaphore = DispatchSemaphore(value: 0)

           

            print("MIFARE CAPDU -> \(apduData.hex)")

           

            executeAPDUCommandOnMIFARETag(apdu: apduData) { data in

                print("RAPDU <- Data: \(data.hex)")

                tagAPDUResponse = TL_TagAPDUResponse(responseData: data, tag: self.currentTag)

                semaphore.signal()

            }

            let _ = semaphore.wait(timeout: .now() + 3.0)

        }

        print("Tag Response \(String(describing: tagAPDUResponse))")

        return tagAPDUResponse

    }

この単純化がお役に立てば幸いです。


よろしくお願いいたします。

TapLinxチーム

Re:タグ応答のTaplinx iOSのappcrashについて

もう 1 つ、apduData は実際には NSData ではなく IOSByteArray でもあります

Re:タグ応答のTaplinx iOSのappcrashについて

どうやらTapLinx-v2.0.0に含まれているヘッダーはすべて間違っているようです。TapLinxApduHandler.hには、宣言があります。

- (nullable TL_TagAPDUResponse *)apduExchangeWithByteArray:(NSData *_Nonnull)apduData;

しかし、実際には IOSByteArray* を返す必要があります、そうでなければ、アプリは前述の症状でクラッシュします

タグ(1)
評価なし
バージョン履歴
最終更新日:
‎11-21-2025 10:28 PM
更新者: