Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android - How to install .so file?
Forum Updated to NodeBB v4.3 + New Features

Android - How to install .so file?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
31 Posts 6 Posters 13.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L luca

    @ekkescorner Ok,
    anyway I just tryed on my Linux PC and it worked:

    cd openssl-1.0.2h
    export AR=/home/luca/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar
    export CC=/home/luca/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
    export LD=/home/luca/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld
    export ANDROID_DEV=/home/luca/android-ndk-r10e/platforms/android-21/arch-arm/usr
    ./Configure shared android-armv7
    make depend
    make build_libs
    
    ekkescornerE Offline
    ekkescornerE Offline
    ekkescorner
    Qt Champions 2016
    wrote on last edited by
    #17

    @luca said in Android - How to install .so file?:

    @ekkescorner Ok,
    anyway I just tryed on my Linux PC and it worked:

    cd openssl-1.0.2h
    

    ...

    export LD=/home/luca/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld

    why have you added this line ?
    and should I use 'export AR= and CC=' instead of AR= and CC= in docs ?

    thx again

    ekke ... Qt Champion 2016 | 2024 ... mobile business apps
    5.15 --> 6.8 https://t1p.de/ekkeChecklist
    QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

    ekkescornerE L 2 Replies Last reply
    0
    • ekkescornerE ekkescorner

      @luca said in Android - How to install .so file?:

      @ekkescorner Ok,
      anyway I just tryed on my Linux PC and it worked:

      cd openssl-1.0.2h
      

      ...

      export LD=/home/luca/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld

      why have you added this line ?
      and should I use 'export AR= and CC=' instead of AR= and CC= in docs ?

      thx again

      ekkescornerE Offline
      ekkescornerE Offline
      ekkescorner
      Qt Champions 2016
      wrote on last edited by
      #18

      found https://github.com/openssl/openssl/issues/1531 and https://bruteforce.gr/bypassing-clang-error-unknown-argument.html
      and tried to add at first line
      ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future

      didn't work - same error
      also I guess GCC is used because of
      CC=$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc
      so the error shouldn't happen ?

      also found https://github.com/android-ndk/ndk/issues/5 mentioning 1.0.2g added -mandroid,
      so I tried downloading 1.0.2f
      same error

      I'm lost now - no one out there on OSX already added openssl libs to Qt 5.8 ?

      thx
      ekke

      ekke ... Qt Champion 2016 | 2024 ... mobile business apps
      5.15 --> 6.8 https://t1p.de/ekkeChecklist
      QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

      1 Reply Last reply
      0
      • ekkescornerE ekkescorner

        @luca said in Android - How to install .so file?:

        @ekkescorner Ok,
        anyway I just tryed on my Linux PC and it worked:

        cd openssl-1.0.2h
        

        ...

        export LD=/home/luca/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld

        why have you added this line ?
        and should I use 'export AR= and CC=' instead of AR= and CC= in docs ?

        thx again

        L Offline
        L Offline
        luca
        wrote on last edited by
        #19

        @ekkescorner I used "export" because otherwise my bash terminal didn't use the environmental variables.
        LD is used to force the android version of the linker. Don't know if you can avoid it.

        ekkescornerE 1 Reply Last reply
        0
        • L luca

          @ekkescorner I used "export" because otherwise my bash terminal didn't use the environmental variables.
          LD is used to force the android version of the linker. Don't know if you can avoid it.

          ekkescornerE Offline
          ekkescornerE Offline
          ekkescorner
          Qt Champions 2016
          wrote on last edited by
          #20

          @luca said in Android - How to install .so file?:

          @ekkescorner I used "export" because otherwise my bash terminal didn't use the environmental variables.
          LD is used to force the android version of the linker. Don't know if you can avoid it.

          did the same

          now another error - probably the LD is only needed on Linux ?

          ekkes-MBP:openssl-1.0.2k admin$ make build_libs
          making all in crypto...
          /usr/bin/perl ../util/mkbuildinf.pl "/daten/_android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc -I. -I.. -I../include  -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -I/include -B/lib -O3 -fomit-frame-pointer -Wall -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM" "android-armv7" >buildinf.h
          /daten/_android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc -I. -I.. -I../include  -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -march=armv7-a -mandroid -I/include -B/lib -O3 -fomit-frame-pointer -Wall -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM   -c -o cryptlib.o cryptlib.c
          In file included from cryptlib.c:117:0:
          cryptlib.h:62:21: fatal error: stdlib.h: No such file or directory
           # include <stdlib.h>
                               ^
          compilation terminated.
          make[1]: *** [cryptlib.o] Error 1
          make: *** [build_crypto] Error 1
          

          ekke ... Qt Champion 2016 | 2024 ... mobile business apps
          5.15 --> 6.8 https://t1p.de/ekkeChecklist
          QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

          1 Reply Last reply
          0
          • ekkescornerE Offline
            ekkescornerE Offline
            ekkescorner
            Qt Champions 2016
            wrote on last edited by
            #21

            created a Bug: https://bugreports.qt.io/browse/QTBUG-59375 - will make it easier to follow

            ekke ... Qt Champion 2016 | 2024 ... mobile business apps
            5.15 --> 6.8 https://t1p.de/ekkeChecklist
            QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

            ekkescornerE 1 Reply Last reply
            1
            • ekkescornerE ekkescorner

              created a Bug: https://bugreports.qt.io/browse/QTBUG-59375 - will make it easier to follow

              ekkescornerE Offline
              ekkescornerE Offline
              ekkescorner
              Qt Champions 2016
              wrote on last edited by
              #22

              from Android list I got a link to: https://github.com/orangefour/android-openssl

              cloned this repo, modified pathes in .pri

              build and run app on Android 7 and it works - so I can go on :)

              but this way is no solution for my projects because prebuilt .so are used
              would be a security hole

              so I'm still waiting for an answer HowTo install openssl on OSX following https://github.com/orangefour/android-openssl

              ekke ... Qt Champion 2016 | 2024 ... mobile business apps
              5.15 --> 6.8 https://t1p.de/ekkeChecklist
              QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

              ekkescornerE 1 Reply Last reply
              0
              • ekkescornerE ekkescorner

                from Android list I got a link to: https://github.com/orangefour/android-openssl

                cloned this repo, modified pathes in .pri

                build and run app on Android 7 and it works - so I can go on :)

                but this way is no solution for my projects because prebuilt .so are used
                would be a security hole

                so I'm still waiting for an answer HowTo install openssl on OSX following https://github.com/orangefour/android-openssl

                ekkescornerE Offline
                ekkescornerE Offline
                ekkescorner
                Qt Champions 2016
                wrote on last edited by
                #23

                finally did it the secure way and built from openssl sources on OSX :)

                used the .sh scripts from https://github.com/orangefour/android-openssl

                in Terminal:

                cd <path/to/scripts>
                chmod 755 ./build-all-arch.sh
                chmod 755 ./setenv-android-mod.sh
                export ANDROID_NDK_ROOT=/daten/_android/android-ndk-r10e
                export OPENSSL_VERSION="openssl-1.0.2k"
                ./build-all-arch.sh
                

                inside projects adding a .pri pointing to the .so files:

                android {
                  ANDROID_EXTRA_LIBS += $$PWD/my/path/to/prebuilt/armeabi-v7a/libcrypto.so
                  ANDROID_EXTRA_LIBS += $$PWD/my/path/to/android-openssl/prebuilt/armeabi-v7a/libssl.so
                }
                

                will blog about in detail

                ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                5.15 --> 6.8 https://t1p.de/ekkeChecklist
                QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                ekkescornerE 1 Reply Last reply
                1
                • ekkescornerE ekkescorner

                  finally did it the secure way and built from openssl sources on OSX :)

                  used the .sh scripts from https://github.com/orangefour/android-openssl

                  in Terminal:

                  cd <path/to/scripts>
                  chmod 755 ./build-all-arch.sh
                  chmod 755 ./setenv-android-mod.sh
                  export ANDROID_NDK_ROOT=/daten/_android/android-ndk-r10e
                  export OPENSSL_VERSION="openssl-1.0.2k"
                  ./build-all-arch.sh
                  

                  inside projects adding a .pri pointing to the .so files:

                  android {
                    ANDROID_EXTRA_LIBS += $$PWD/my/path/to/prebuilt/armeabi-v7a/libcrypto.so
                    ANDROID_EXTRA_LIBS += $$PWD/my/path/to/android-openssl/prebuilt/armeabi-v7a/libssl.so
                  }
                  

                  will blog about in detail

                  ekkescornerE Offline
                  ekkescornerE Offline
                  ekkescorner
                  Qt Champions 2016
                  wrote on last edited by
                  #24

                  and here's my github repo

                  https://github.com/ekke/android-openssl-qt

                  blogpost will follow

                  ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                  5.15 --> 6.8 https://t1p.de/ekkeChecklist
                  QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                  L 1 Reply Last reply
                  3
                  • ekkescornerE ekkescorner

                    and here's my github repo

                    https://github.com/ekke/android-openssl-qt

                    blogpost will follow

                    L Offline
                    L Offline
                    luca
                    wrote on last edited by
                    #25

                    @ekkescorner Thanks for sharing !

                    1 Reply Last reply
                    0
                    • T Offline
                      T Offline
                      Tiago Torre do Vale
                      wrote on last edited by
                      #26

                      Hi, could you share the .so files?
                      I cant't compiled them, I'm in a windows box.

                      thanks

                      ekkescornerE 1 Reply Last reply
                      0
                      • T Tiago Torre do Vale

                        Hi, could you share the .so files?
                        I cant't compiled them, I'm in a windows box.

                        thanks

                        ekkescornerE Offline
                        ekkescornerE Offline
                        ekkescorner
                        Qt Champions 2016
                        wrote on last edited by
                        #27

                        @Tiago-Torre-do-Vale take a look at https://github.com/orangefour/android-openssl - there are .so files

                        from my POV it's not recommended to use prebuilt .so files for libs like ssl and crypto.

                        the scripts should also work on windows. you should have installed cygwin or so.
                        I'm doing all my dev work on osx but I'm sure others will help you to make the .sh work on windows

                        ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                        5.15 --> 6.8 https://t1p.de/ekkeChecklist
                        QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                        1 Reply Last reply
                        0
                        • T Offline
                          T Offline
                          Tiago Torre do Vale
                          wrote on last edited by
                          #28

                          Hi, thanks !!!
                          I managed to work with the prebuilt.

                          ekkescornerE 1 Reply Last reply
                          0
                          • T Tiago Torre do Vale

                            Hi, thanks !!!
                            I managed to work with the prebuilt.

                            ekkescornerE Offline
                            ekkescornerE Offline
                            ekkescorner
                            Qt Champions 2016
                            wrote on last edited by
                            #29

                            @Tiago-Torre-do-Vale great to hear
                            Attention: APP can randomly crash if executing some requests via QNAM
                            I opened another tread on this: https://forum.qt.io/topic/77150/qt-5-8-qnam-openssl-crash-openssl_threads

                            ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                            5.15 --> 6.8 https://t1p.de/ekkeChecklist
                            QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                            1 Reply Last reply
                            0
                            • T Offline
                              T Offline
                              Tchaumont
                              wrote on last edited by
                              #30

                              Hi,

                              I did libcrypt.so and libssl.so using ./Configure shared android because ./Configure shared android-armv7 said that target was not existing.
                              I include the .so files in my Qt Project but still have crach with XMLHttpRequest.

                              Get openSSL with android or android-armv7 change something?

                              1 Reply Last reply
                              0
                              • B Offline
                                B Offline
                                BjoernK
                                wrote on last edited by
                                #31

                                Hi!

                                A few days ago I compiled libcrypto and libssl for android (arm-linux-androideabi) because android 7 does not provide access to openssl.
                                You can find the .so files here:
                                https://github.com/bkweb/openssl-1.0.2k-prebuilt-for-android

                                In the README.md file I give some instructions for including the files in a Qt-project and how to view the version of the openssl suite in use.
                                The Google App Store accepts my apps with these files.

                                Best regards,
                                Björn

                                Best regards,
                                Björn

                                1 Reply Last reply
                                0

                                • Login

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups
                                • Search
                                • Get Qt Extensions
                                • Unsolved