[Android-development] openSSL loading on Android not working?

Martin Koller kollix at aon.at
Thu Apr 10 19:26:50 CEST 2014


> On Thu, Apr 10, 2014 at 7:46 PM, Martin Koller <kollix at aon.at> wrote:
> 
> > Hi,
> >
> > I have bundled the latest openSSL libs (1.0.1g) into my apk according to
> > http://qt-project.org/doc/qt-5/opensslsupport.html
> >
> > However my test app, which simply displays
> > QSslSocket::sslLibraryVersionString(),
> > still tells me the older version 1.0.0e
> >
> > I have an Android Tablet (Pengpod 700) and I found out that it has
> > already libcrypto and libssl installed in /system/lib
> >
> > Checking Qt sources I do not find any traces of the ssl libs loading
> > mechanism to first try to load the bundled libs (e.g. giving the absolute
> > path to /data/data/<app>/lib/libcrypto.so)
> >
> > Am I missing something here or is this a bug which should be fixed in Qt ?
> > (e.g. in qsslsocket_openssl_symbols.cpp loadOpenSsl())
> >
> > --

On Thursday 10 April 2014 20:05:10 Robert Iakobashvili wrote:
> Hi Martin,
> 
> Just a check list:
> 
> Have you added to your pro file something like below?
> 
> equals(ANDROID_TARGET_ARCH, x86) {
> 
>         message("Android - x86 SSL libraries.")
> 
>         ANDROID_EXTRA_LIBS = ../../android-openssl/x86/libcrypto.so
> ../../android-openssl/x86/libssl.so
> 
>     }
> 
> 
>     equals(ANDROID_TARGET_ARCH, armeabi-v7a) {
> 
>         message("Android - ARMv7a SSL libraries.")
> 
>         ANDROID_EXTRA_LIBS = ../../android-openssl/arm7/libcrypto.so
> ../../android-openssl/arm7/libssl.so
> 
>     }

yes, I have ANDROID_EXTRA_LIBS defined and I also can find the libs inside the apk:
unzip -l QtApp-debug.apk

Archive:  QtApp-debug.apk
  Length      Date    Time    Name
---------  ---------- -----   ----
      202  2014-04-10 07:44   assets/--Added-by-androiddeployqt--/qt_cache_pregenerated_file_list
      236  2014-04-10 07:44   res/layout/splash.xml
     5820  2014-04-10 07:44   AndroidManifest.xml
     8828  2014-04-10 07:44   resources.arsc
    50720  2014-04-10 07:44   classes.dex
  1795436  2014-04-10 07:44   lib/armeabi-v7a/libcrypto.so
   380788  2014-04-10 07:44   lib/armeabi-v7a/libssl.so
    13556  2014-04-10 07:44   lib/armeabi-v7a/libtest.so
   264772  2014-04-10 07:44   lib/armeabi-v7a/gdbserver
      768  2014-04-10 07:44   META-INF/MANIFEST.MF
      821  2014-04-10 07:44   META-INF/CERT.SF
      776  2014-04-10 07:44   META-INF/CERT.RSA
---------                     -------
  2522723                     12 files


> 
> Try to delete the build directory and re-build everything.
> 
> You are supposed to see in the adb logcat loading of Qt libraries followed
> by loading of  libcrypto and libssl

Yes, dalvikvm is loading the bundled lib, still the result is the OLD "openSSL 1.0.0e 6 Sep 2011" is used.

I/Qt      ( 4994): qt start
D/dalvikvm( 4994): Trying to load lib /data/data/org.qtproject.example.test/lib/libcrypto.so 0x4109c0a8
D/dalvikvm( 4994): Added shared lib /data/data/org.qtproject.example.test/lib/libcrypto.so 0x4109c0a8
D/dalvikvm( 4994): No JNI_OnLoad found in /data/data/org.qtproject.example.test/lib/libcrypto.so 0x4109c0a8, skipping init
D/dalvikvm( 4994): Trying to load lib /data/data/org.qtproject.example.test/lib/libssl.so 0x4109c0a8
D/dalvikvm( 4994): Added shared lib /data/data/org.qtproject.example.test/lib/libssl.so 0x4109c0a8
D/dalvikvm( 4994): No JNI_OnLoad found in /data/data/org.qtproject.example.test/lib/libssl.so 0x4109c0a8, skipping init
D/dalvikvm( 4994): Trying to load lib /data/data/org.qtproject.example.test/lib/libtest.so 0x4106a540
D/dalvikvm( 4994): Added shared lib /data/data/org.qtproject.example.test/lib/libtest.so 0x4106a540
D/dalvikvm( 4994): No JNI_OnLoad found in /data/data/org.qtproject.example.test/lib/libtest.so 0x4106a540, skipping init

-- 
Best regards/Schöne Grüße

Martin
A: Because it breaks the logical sequence of discussion
Q: Why is top posting bad?

()  ascii ribbon campaign - against html e-mail 
/\                        - against proprietary attachments

Geschenkideen, Accessoires, Seifen, Kulinarisches: www.bibibest.at



More information about the Android-development mailing list