问题
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?
回答1:
I need to wait for the packaging to finish
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.
来源:https://stackoverflow.com/questions/7798737/is-there-a-smaller-version-of-the-bouncycastleprovider-on-android