首页 \ 问答 \ 使用Android NFC向Java Card发送超过261个字节(Send more than 261 bytes to Java Card with Android NFC)

使用Android NFC向Java Card发送超过261个字节(Send more than 261 bytes to Java Card with Android NFC)

我想通过NFC(Class IsoDep )将长度为1699字节的APDU发送到Java Card智能卡。 我收到了错误

java.io.IOException:收发长度超过支持的最大值

我的手机是三星Galaxy S7。

我在卡片上的小程序中使用了扩展长度。 我已经确认该卡支持延长长度。 我通过pyapdutool测试了这个,通过向卡发送4000字节的APDU。

我发现当我编写这段代码时,结果是false

final Tag t = (Tag) tag;
myTag = IsoDep.get(t);
boolean result = myTag.isExtendedLengthApduSupported();

我的清单中有这个:

<activity
        android:name=".test"
        android:label="@string/title_test"
        android:launchMode="singleTop"
        android:theme="@style/AppTheme.NoActionBar" >
    <action android:name="android.nfc.action.TAG_DISCOVERED" />
    <category android:name="android.intent.category.DEFAULT" />
    <intent-filter>
        <action android:name="android.nfc.action.NDEF_DISCOVERED" />
    </intent-filter>
</activity>

如何通过Android NFC发送1699字节(或任何长度大于261字节)的APDU?


I want to send an APDU with a length of 1699 bytes via NFC (class IsoDep) to a Java Card smartcard. I get the error

java.io.IOException: Transceive length exceeds supported maximum

My phone is a Samsung Galaxy S7.

I use extended-length in my applet on the card. I have verified that the card supports extended length. I tested this via pyapdutool by sending an APDU with 4000 bytes to the card.

I found that when I write this code, the result is false:

final Tag t = (Tag) tag;
myTag = IsoDep.get(t);
boolean result = myTag.isExtendedLengthApduSupported();

I have this in my manifest:

<activity
        android:name=".test"
        android:label="@string/title_test"
        android:launchMode="singleTop"
        android:theme="@style/AppTheme.NoActionBar" >
    <action android:name="android.nfc.action.TAG_DISCOVERED" />
    <category android:name="android.intent.category.DEFAULT" />
    <intent-filter>
        <action android:name="android.nfc.action.NDEF_DISCOVERED" />
    </intent-filter>
</activity>

How can I send an APDU with 1699 bytes (or any length greater than 261 bytes) through Android NFC?


原文:https://stackoverflow.com/questions/40366099
更新时间:2022-07-18 16:07

最满意答案

在这里找到了一个几乎完全相同的问题,接受了答案。

此外,谈到扭曲算法,GIMP使用的算法称为“液体重新缩放”。 你可以在这里找到它并用C / C ++编写,这样你就可以将它集成到你的iOS应用程序中(许可证允许,我没有检查过)。

是另一个类似的问题。

希望这有助于您开始这一点。

编辑: 一些例子 (很快会发布一些代码)

编辑2:我正在寻找一些代码,我发现了一些博客文章,解释了用于实现液体重新缩放算法的过滤算法。 并不容易,我不认为在短时间内,如果没有关于这个主题的先验知识,我可以做的不仅仅是分享这个链接 。 GIMP实施的作者似乎被称为“Shai Avidan”(见本文)。 我建议您尝试联系他或该领域的其他任何人(请参阅有关该主题的维基百科参考资料)。 对不起,如果我帮不了多忙。

编辑3:我找到了一本关于“ 数字图像处理原理:基础技术 ”的JAVA代码的书。

此外, 是斯坦福大学Bernd Girod教授的数字图像处理课程的链接。 有幻灯片和教程。

然后我通过谷歌搜索术语“数字图像处理原理春天”找到了更多的结果。

无论如何..这只是为了补充一些额外的答案,因为我之前正在思考它。


I have found an almost identical question here with an accepted answer.

Also, speaking about distorsion algorithms there is an algorithm used by GIMP called "liquid rescale". You can find it here and is written in C/C++ so you could integrate it in your iOS App (license permitting, I haven't checked that).

Here is another similar question as well.

Hope that this helps to get you started on this.

EDIT: Some examples (will post some code soon)

EDIT 2: I was looking for some code and I found some blog posts that explain the filtering algorithms used to implement the liquid rescale algorithm. Is not easy and I don't think in short time and with no prior knowledge on the subject I could do more than sharing this link. The author of the GIMP implementation appears to be called "Shai Avidan" (see this post). I suggest you might try to contact him or anyone else in the field (see wikipedia references on the subject). Sorry if I can't help more.

EDIT 3: I found a book with some JAVA code on "Principles of Digital Image Processing: Fundamental Techniques".

Also, this is a link to a Digital Image Processing course by Prof. Bernd Girod at Standford University. There are slides and tutorials.

Then I found some more results by googling the term "Principles of Digital Image Processing spring".

Anyway.. this was just to add some extra to the answer as I was thinking about it before.

相关问答

更多
  • 实际上,Flash 8的DisplacementMapFilter条目描述了给定由像素分量(x,y)组成的位移贴图的一般位移贴图变换,如下所示: (色度Y(x,y)= 128)* scaleY)/ 256] Actually, Flash 8's DisplacementMapFilter entry describes the general displacement map transformation given a displacement map made up of pixels compone ...
  • 没有关于iOS的线索,但外观让我想起了一个薄板样条曲线 。 在OpenGL中实现起来相当容易,快速谷歌搜索示例代码返回了大量的命中。 No clue about iOS, but the look reminds me of a thin-plate spline warp. It's quite easy to implement in OpenGL, a quick Google search for example code returns plenty of hits.
  • 镜头失真通常会将直线变成曲线。 使用OpenGL栅格化线条和三角形时,无论您如何变换顶点,基元的边缘都会保持笔直。 如果你的模型具有足够精细的细分,那么将失真结合到顶点变换中是可行的。 如果您只渲染点,它也可以工作。 但是,当您的目标是普遍适用性时,您必须以某种方式处理直边原语。 一种方法是使用几何着色器进一步细分传入的模型; 或者你可以使用tesselation着色器。 另一种方法是渲染成立方体贴图,然后使用着色器创建相当于它的镜头。 我实际上建议用于生成鱼眼图像。 失真本身通常由3到5的多项式表示,映射 ...
  • 使用高度和宽度的最大值,并使用auto也可以正确地重新缩放: body { margin: 40px; } .wrapper { display: grid; grid-gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); background-color: #fff; color: #444; } .box { background-color: #444; ...
  • 我也在徘徊同样的事情,但我无法在iOS中实现这一点。 在这里,我可以分享我的逻辑。 在ImageMagick中选择“ShepardsDistortion”。 这允许您逐个像素地扭曲图像,因为您必须首先应用人脸检测算法。 https://www.imagemagick.org/Usage/distorts/#freeform_distorts I am also wandering for same thing, but i am not able to implement this in iOS. Here ...
  • 我不确定这是您寻找的内容,但是您可以使用眼睛的位置来确定倾斜角度,如下所示:( 如果您使用的是iOS人脸识别服务) CIFaceFeature *_selectedFace = // the face feature float _rotationAngle = 0.f; if (_selectedFace.leftEyePosition.x != _selectedFace.rightEyePosition.x) { _rotationAngle = atan((_selectedFace ...
  • 正如你所说,Core Image的当前功能在iOS上有一点限制。 特别是,在桌面上找不到类似自定义内核的内容令人失望。 您列出的其他替代方案(除了GLImageProcessing,无法进行此类过滤)都是CPU绑定的库,对于在移动设备上进行实时筛选会太慢。 但是,我可以指出一个名为GPUImage的开放源代码框架,因为我找不到可让您取消自定义效果的东西。 正如其名称所示,GPUImage使用OpenGL ES 2.0着色器对静止图像和视频进行GPU加速处理。 您可以使用这些编写自己的自定义效果,因此您应该可 ...
  • 我在这里找到了一个几乎完全相同的问题,接受了答案。 此外,谈到扭曲算法,GIMP使用的算法称为“液体重新缩放”。 你可以在这里找到它并用C / C ++编写,这样你就可以将它集成到你的iOS应用程序中(许可证允许,我没有检查过)。 这是另一个类似的问题。 希望这有助于您开始这一点。 编辑: 一些例子 (很快会发布一些代码) 编辑2:我正在寻找一些代码,我发现了一些博客文章,解释了用于实现液体重新缩放算法的过滤算法。 并不容易,我不认为在短时间内,如果没有关于这个主题的先验知识,我可以做的不仅仅是分享这个链接 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)