Android 上有较小版本的 BouncyCastleProvider 吗?
我正在开发一个 Android 蜂窝应用程序,需要使用 BouncyCastle 库 (bcprov-jdk15-143.jar)。我已将此 jar 包含在我的 libs 文件夹中并将其添加到我的构建路径中。不幸的是,它相对较大(1.6 Megs),Eclipse 需要几分钟才能将其打包成 Dalvik 字节代码。这使得开发速度非常慢,因为每次我想测试我的更改时,我都需要等待打包完成。
BouncyCastle 的要求来自于使用 google 的 google-tv-pairing-protocol。 http://code.google.com/p/google-tv-pairing-协议/
有人有什么好主意可以让我的生活更轻松吗?
BouncyCastle 有缩小版吗? 我可以以某种方式仅提取我需要的内容并重新打包吗? 有轻量级的替代品吗?
I'm developing an android honeycomb app that requires the use of the BouncyCastle library (bcprov-jdk15-143.jar). I've included this jar in my libs folder and added it to my build path. Unfortunately, it's relatively large (1.6 Megs) and it takes several minutes for Eclipse to package it up into Dalvik byte code. This is making it very slow to develop as each time I want to test my changes, I need to wait for the packaging to finish.
The requirement for BouncyCastle comes from using google's google-tv-pairing-protocol. http://code.google.com/p/google-tv-pairing-protocol/
Does anyone have any good ideas for making my life easier?
Is there a smaller version of BouncyCastle?
Can I somehow extract only what I need and repackage?
Is there a lightweight alternative?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更重要的是,它可能不起作用。 Bouncy Castle 是 Android 的 javax.crypto 实现的一部分——人们报告了尝试将 BC 作为 JAR 添加到他们的项目时遇到的各种问题。
如果您可以坚持使用 javax.crypto 接口,我会这样做并完全避免 BC。如果没有,请尝试 Spongy Castle,它将 BC 重新打包到单独的 Java 包中以避免 VM 问题。如果您愿意,您也许可以找到方法从 Spongy Castle 副本中删除不需要的内容 —— 由于某种原因,它比您引用的 BC JAR 要大得多。
More importantly, it may not work. Bouncy Castle is part of Android's implementation of
javax.crypto
-- people have reported all sorts of trouble trying to add BC as a JAR to their projects.If you can stick with the
javax.crypto
interface, I would do that and avoid BC entirely. If not, try Spongy Castle, which is a repackaging of BC into a separate Java package to avoid VM issues. If you wanted, you could perhaps find ways to get rid of stuff you didn't need from your copy of Spongy Castle -- it is substantially larger than the BC JAR you cite, for some reason.