- 论坛徽章:
- 39
|
2个修改
1.修改mk文件- LOCAL_PATH := $(call my-dir)
- include $(CLEAR_VARS)
- LOCAL_MODULE := crypto
- LOCAL_SRC_FILES := lib/libcrypto.so
- LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
- include $(PREBUILT_SHARED_LIBRARY)
- include $(CLEAR_VARS)
- LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
- LOCAL_LIBS := $(LOCAL_PATH)/lib
- LOCAL_STATIC_LIBRARIES := libcrypto libssl
- LOCAL_LDLIBS := -llog
- LOCAL_MODULE := jni
- LOCAL_SRC_FILES := jni.c
- include $(BUILD_SHARED_LIBRARY)
复制代码 2.修改openssl中的android-config.mk重新编译
#LOCAL_CFLAGS += -DOPENSSL_NO_DEPRECATED
这一行注释掉
查看rsa.h可以看到原因:- /* Deprecated version */
- #ifndef OPENSSL_NO_DEPRECATED
- RSA * RSA_generate_key(int bits, unsigned long e,void
- (*callback)(int,int,void *),void *cb_arg);
- #endif /* !defined(OPENSSL_NO_DEPRECATED) */
- /* New version */
- int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
复制代码 一测试通过.
如果不改2,你可以用new版本的RSA_generate_key_ex |
|