Git Product home page Git Product logo

android-ndk-openssl's Introduction

Hi there 👋

android-ndk-openssl's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

android-ndk-openssl's Issues

maybe the wrong path?

Reading your great article: https://juejin.im/entry/56d7a4705bbb50004ca31cf5

from programing standing of point, it is fine. In practice, it is too risky with this hack way though: if OS changes something for those 2 libs in next release, the app will not function at all. If really go this way ( using the existing lib baked inside OS image, but there is NDK header/so files ), probably use dlopen()/dlsym(). that way app at least get change to check whether the required functions are supported in the running OS; plus your APK size will be smaller -- you do not have to include them inside APK.

The proposed way in the article is too risky to be used in production application, might giving local developer community wrong direction... just my personal view.

Thanks

运行报错,java.lang.UnsatisfiedLinkError

terro,你好!非常感谢你为大家提供了这个在Android中应用OpenSSL的demo!但是,在我这里运行会报错,错误日志如下:

3-14 17:30:48.402 3617-3617/com.example.openssltest E/AndroidRuntime: FATAL EXCEPTION: main
                                                                       Process: com.example.openssltest, PID: 3617
                                                                       java.lang.UnsatisfiedLinkError: No implementation found for byte[] com.example.openssltest.MainActivity.hmacSha256(byte[]) (tried Java_com_example_openssltest_MainActivity_hmacSha256 and Java_com_example_openssltest_MainActivity_hmacSha256___3B)
                                                                           at com.example.openssltest.MainActivity.hmacSha256(Native Method)
                                                                           at com.example.openssltest.MainActivity.onCreate(MainActivity.java:14)
                                                                           at android.app.Activity.performCreate(Activity.java:6251)
                                                                           at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
                                                                           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
                                                                           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                                           at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                                           at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                           at android.os.Looper.loop(Looper.java:148)
                                                                           at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                           at java.lang.reflect.Method.invoke(Native Method)
                                                                           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                                           at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:102)

我查了一下这个错误原因,网上大多数情况都是因为JNI的方法名称定义没有按照规定定义,可是在你的demo里面可以看到JNI的方法名称定义是没有问题的,所以不知道问题出在哪里,还望不吝赐教!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.