Giter Site home page Giter Site logo

android-openssl-qt's People

Contributors

ekke avatar

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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-openssl-qt's Issues

Crash when start on mobile

Hello
Thanks for the awesome work
the files generated and i copied them into my project but app crash when start!
i didnt change any configuration , just i changed the location of NDK

also i am using QR 5.9 Armv7

any ideas?

Thanks

How to do it on windows

Sorry i'am a newbie

How do i put this to work on windows.
I m getting an error about .so missing.

thank you

Prebuild directory is empty

This is terminal output:

`
ismails-MacBook-Pro:android-openssl-qt-master ismail$ chmod 755 ./build-all-arch.sh
ismails-MacBook-Pro:android-openssl-qt-master ismail$ chmod 755 ./setenv-android-mod.sh
ismails-MacBook-Pro:android-openssl-qt-master ismail$ export ANDROID_NDK_ROOT=/Users/ismail/Documents/Android/android-ndk-r10e
ismails-MacBook-Pro:android-openssl-qt-master ismail$ export OPENSSL_VERSION="openssl-1.1.1b"
ismails-MacBook-Pro:android-openssl-qt-master ismail$ ./build-all-arch.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8021k 100 8021k 0 0 1824k 0 0:00:04 0:00:04 --:--:-- 1855k
Error: FIPS_SIG does not specify incore module. Please edit this script.
CHECK_CROSS_COMPILER = arm-linux-androideabi-
ANDROID_NDK_ROOT: /Users/ismail/Documents/Android/android-ndk-r10e
ANDROID_ARCH: arch-arm
ANDROID_EABI: arm-linux-androideabi-4.9
ANDROID_API: android-21
ANDROID_SYSROOT: /Users/ismail/Documents/Android/android-ndk-r10e/platforms/android-21/arch-arm
ANDROID_TOOLCHAIN: /Users/ismail/Documents/Android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin
FIPS_SIG:
CROSS_COMPILE: arm-linux-androideabi-
ANDROID_DEV: /Users/ismail/Documents/Android/android-ndk-r10e/platforms/android-21/arch-arm/usr
CROSS COMPILE ENV : arm-linux-androideabi-
Can't open Makefile.org: No such file or directory.
***** Deprecated options: no-ssl2
Configuring OpenSSL version 1.1.1b (0x1010102fL) for android-armv7
Using os-specific seed configuration
Usage: Configure [no- ...] [enable- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]

pick os/compiler from:
BS2000-OSD BSD-generic32 BSD-generic64 BSD-ia64 BSD-sparc64 BSD-sparcv8
BSD-x86 BSD-x86-elf BSD-x86_64 Cygwin Cygwin-i386 Cygwin-i486 Cygwin-i586
Cygwin-i686 Cygwin-x86 Cygwin-x86_64 DJGPP MPE/iX-gcc UEFI UWIN VC-CE VC-WIN32
VC-WIN32-ARM VC-WIN32-ONECORE VC-WIN64-ARM VC-WIN64A VC-WIN64A-ONECORE
VC-WIN64A-masm VC-WIN64I aix-cc aix-gcc aix64-cc aix64-gcc android-arm
android-arm64 android-armeabi android-mips android-mips64 android-x86
android-x86_64 android64 android64-aarch64 android64-mips64 android64-x86_64
bsdi-elf-gcc cc darwin-i386-cc darwin-ppc-cc darwin64-ppc-cc
darwin64-x86_64-cc gcc haiku-x86 haiku-x86_64 hpux-ia64-cc hpux-ia64-gcc
hpux-parisc-cc hpux-parisc-gcc hpux-parisc1_1-cc hpux-parisc1_1-gcc
hpux64-ia64-cc hpux64-ia64-gcc hpux64-parisc2-cc hpux64-parisc2-gcc hurd-x86
ios-cross ios-xcrun ios64-cross ios64-xcrun iossimulator-xcrun iphoneos-cross
irix-mips3-cc irix-mips3-gcc irix64-mips4-cc irix64-mips4-gcc linux-aarch64
linux-alpha-gcc linux-aout linux-arm64ilp32 linux-armv4 linux-c64xplus
linux-elf linux-generic32 linux-generic64 linux-ia64 linux-mips32 linux-mips64
linux-ppc linux-ppc64 linux-ppc64le linux-sparcv8 linux-sparcv9 linux-x32
linux-x86 linux-x86-clang linux-x86_64 linux-x86_64-clang linux32-s390x
linux64-mips64 linux64-s390x linux64-sparcv9 mingw mingw64 nextstep
nextstep3.3 sco5-cc sco5-gcc solaris-sparcv7-cc solaris-sparcv7-gcc
solaris-sparcv8-cc solaris-sparcv8-gcc solaris-sparcv9-cc solaris-sparcv9-gcc
solaris-x86-gcc solaris64-sparcv9-cc solaris64-sparcv9-gcc solaris64-x86_64-cc
solaris64-x86_64-gcc tru64-alpha-cc tru64-alpha-gcc uClinux-dist
uClinux-dist64 unixware-2.0 unixware-2.1 unixware-7 unixware-7-gcc vms-alpha
vms-alpha-p32 vms-alpha-p64 vms-ia64 vms-ia64-p32 vms-ia64-p64 vos-gcc
vxworks-mips vxworks-ppc405 vxworks-ppc60x vxworks-ppc750 vxworks-ppc750-debug
vxworks-ppc860 vxworks-ppcgen vxworks-simlinux

NOTE: If in doubt, on Unix-ish systems use './config'.
`

there is only armeabi-v7a folder in prebuild directory and it's empty. Except this, prebuild directory is completely empty.

Why? Is this issue about ssl version?

Thanks.

EDIT: I tried with ssl version 1.0.2r and it's worked and .so files generated for x86 and armeabi-v7 but there is not arm64. Is it normal?

clang: error: unknown argument: '-mandroid'

I'm trying to run the script in Linux. My NDK Version: 18.1.5063045

export ANDROID_NDK_ROOT=~/Android/Sdk/ndk-bundle/
export OPENSSL_VERSION="openssl-1.0.2o"
./build-all-arch.sh

But got an error:

make[1]: Entering directory '.../android-openssl-qt/openssl-1.0.2o/crypto'
clang: error: unknown argument: '-mandroid'
clang: error: unknown argument: '-mandroid'
make[1]: *** [Makefile:137: local_depend] Error 1
make[1]: Leaving directory '.../android-openssl-qt/openssl-1.0.2o/crypto'
make: *** [Makefile:484: depend] Error 1

Any chance to make it work in Linux or it works only under Mac? Script proposed on qt.io a little bit tricky. Thanks!

support for arm64-v8a

Some feedback when adding support for arm64-v8a.
I first modified build-all-arch.sh and set archs=(armeabi-v7a x86 arm64-v8a)

In setenv-android-mod.sh, I had to replace randlib with ranlib (a typo I guess?)

In android-openssl.pri I would suggest to use
$$PWD/../../android-openssl-qt/prebuilt/$$ANDROID_TARGET_ARCH/libcrypto.so

Note also that Qt5.13 will be packaged with OpenSSL1.1 afaik

How to build OpenSSL on macOS for Android Arm / x86 ? ( removing '-mandroid' from Makefile helps )

Building OpenSSL on macOS is a challenge!! One day wasted and counting...

  • Qt 5.9 Android app works fine on Android Kit Kat 4.4.
  • On Android 7.0 I get run time messages:
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_ctrl

I got past the '-mandroid' issue by removing it from the Makefile

What I have tried so far:

Qt 5.9 Adding OpenSSL Support for Android

Follow this first: Qt 5.9 Adding OpenSSL Support for Android

File: Setenv-android.sh

_ANDROID_NDK="android-ndk-r9"
_ANDROID_EABI="arm-linux-androideabi-4.9"
# _ANDROID_ARCH=arch-x86
_ANDROID_ARCH=arch-arm

Attempt to build OpenSSL

  1. Edit Makefile.shared to remove -Bsymbolic
  2. Edit Makefile.shared to replace -soname with -install_name

Example:

#DO_GNU_SO=$(CALC_VERSIONS); \
#	SHLIB=lib$(LIBNAME).so; \
#	SHLIB_SUFFIX=; \
#	ALLSYMSFLAGS='-Wl,--whole-archive'; \
#	NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
#	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
# https://stackoverflow.com/questions/4580789/ld-unknown-option-soname-on-os-x

O_GNU_SO=$(CALC_VERSIONS); \
	SHLIB=lib$(LIBNAME).so; \
	SHLIB_SUFFIX=; \
	ALLSYMSFLAGS='-Wl,--whole-archive'; \
	NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-install_name,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
  1. Create Makefile
./Configure shared android
  1. Remove '''CFLAG''' option '''-mandroid''' from Makefile

  2. Build
    make CALC_VERSIONS="SHLIB_COMPAT=; SHLIB_SOVER="

Resulting error: syntax error near unexpected token `;'

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../libcrypto.a(v3_asid.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../libcrypto.a(v3_addr.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../libcrypto.a(cms_cd.o) has no symbols
if [ -n "libcrypto.so.1.0.0 libssl.so.1.0.0" ]; then \
		(cd ..; /Applications/Xcode.app/Contents/Developer/usr/bin/make libcrypto.so.1.0.0); \
	fi
[ -z "" ] || gcc -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H  -I/include -B/lib -O3 -fomit-frame-pointer -Wall -Iinclude \
		-DFINGERPRINT_PREMAIN_DSO_LOAD -o fips_premain_dso  \
		fips_premain.c fipscanister.o \
		libcrypto.a -ldl
/bin/sh: -c: line 0: syntax error near unexpected token `;'
/bin/sh: -c: line 0: `; SHOBJECTS="libcrypto.a "; ( :; LIBDEPS="${LIBDEPS:--L.  -ldl}"; SHAREDCMD="${SHAREDCMD:-gcc}"; SHAREDFLAGS="${SHAREDFLAGS:--fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H  -I/include -B/lib -O3 -fomit-frame-pointer -Wall }"; LIBPATH=`for x in $LIBDEPS; do echo $x; done | sed -e 's/^ *-L//;t' -e d | uniq`; LIBPATH=`echo $LIBPATH | sed -e 's/ /:/g'`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${SHAREDCMD} ${SHAREDFLAGS} -o $SHLIB$SHLIB_SOVER$SHLIB_SUFFIX $ALLSYMSFLAGS $SHOBJECTS $NOALLSYMSFLAGS $LIBDEPS ) && if [ -n "$INHIBIT_SYMLINKS" ]; then :; else prev=$SHLIB$SHLIB_SOVER$SHLIB_SUFFIX; if [ -n "$SHLIB_COMPAT" ]; then for x in $SHLIB_COMPAT; do ( :; rm -f $SHLIB$x$SHLIB_SUFFIX; ln -s $prev $SHLIB$x$SHLIB_SUFFIX ); prev=$SHLIB$x$SHLIB_SUFFIX; done; fi; if [ -n "$SHLIB_SOVER" ]; then ( :; rm -f $SHLIB$SHLIB_SUFFIX; ln -s $prev $SHLIB$SHLIB_SUFFIX ); fi; fi'

I think there is something still wrong with my -install_name syntax? How do you build OpenSSL on macOS?

I need to build boih arm7 and x86 so I can test in Genymotion emulator.

@ekke @mabedMRD @alexgarret @machinekoder Qt guys? Any tips or suggestions are greatly appreciated.

Not working

                 ^

compilation terminated.
mem.c:59:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
mem_clr.c:60:20: fatal error: string.h: No such file or directory
#include <string.h>
^
compilation terminated.
mem_dbg.c:112:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
In file included from cversion.c:59:0:
cryptlib.h:62:21: fatal error: stdlib.h: No such file or directory

include <stdlib.h>

                 ^

compilation terminated.
In file included from ex_data.c:141:0:
cryptlib.h:62:21: fatal error: stdlib.h: No such file or directory

include <stdlib.h>

                 ^

compilation terminated.
cpt_err.c:62:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
In file included from uid.c:56:0:
../include/openssl/crypto.h:120:21: fatal error: stdlib.h: No such file or directory

include <stdlib.h>

                 ^

compilation terminated.
o_time.c:65:20: fatal error: string.h: No such file or directory
#include <string.h>
^
compilation terminated.
o_str.c:60:19: fatal error: ctype.h: No such file or directory
#include <ctype.h>
^
compilation terminated.
o_dir.c:60:19: fatal error: errno.h: No such file or directory
#include <errno.h>
^
compilation terminated.
In file included from o_fips.c:59:0:
cryptlib.h:62:21: fatal error: stdlib.h: No such file or directory

include <stdlib.h>

                 ^

compilation terminated.
In file included from o_init.c:56:0:
../e_os.h:468:28: fatal error: unistd.h: No such file or directory

include OPENSSL_UNISTD

                        ^

compilation terminated.
make[1]: *** [local_depend] Error 1
make: *** [depend] Error 1

I am on MACOSX High sierra.

any Idea ?

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.