I happened to chance upon the file "org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp" in the libcore of android.
I learn that this file seems to be the JNI wrapper that Apache Harmony provider uses to call the under the hood openssl engine for some of its functionality like ssl, signature verification and digest calculation.
Can somebody clarify the following for me:
1) I want to add a few printf statements and see it on the "adb logcat" command. I tried adding printf here and there... Where/how are these files getting compiled? There is a sub.mk(make file) provided along, but who calls this?
After I added the printf statements, I just d开发者_运维百科id an android "make" but in the end I never get to see these. How do I go about now?
2)Is JNI wrapper for openssl used by Apache only for the three functionality I said or are there more?
If I have to allow my Apps to use ssl, do I also have to extend this JNI wrapper to allow it to call other algorithms/functions etc(for eg. RSA)
Thanks in advance
1.
building: i do "mmm -j14 dalvik libcore snod" at the top level. you can do a full rebuild, but it's quicker to just rebuild the bits you need.
logging: i use LOGE("hello %s", "world"). this stuff shows up in "adb logcat".
2.
we use both OpenSSL (via NativeCrypto.cpp) and BouncyCastle to implement the crypto stuff. you can use the java.* APIs to ask for the algorithm you want.
精彩评论