diff --git a/.github/autobuild/android.sh b/.github/autobuild/android.sh index be75d1e72e..a283daacaf 100755 --- a/.github/autobuild/android.sh +++ b/.github/autobuild/android.sh @@ -28,12 +28,12 @@ set -eu # Some of the following version pinnings are semi-automatically checked for # updates. Update .github/workflows/bump-dependencies.yaml when renaming those: -COMMANDLINETOOLS_VERSION=6858069 -ANDROID_NDK_VERSION=r21d -ANDROID_PLATFORM=android-30 -ANDROID_BUILD_TOOLS=30.0.2 +COMMANDLINETOOLS_VERSION=11076708 +ANDROID_NDK_VERSION=r26b +ANDROID_PLATFORM=android-34 +ANDROID_BUILD_TOOLS=34.0.0 AQTINSTALL_VERSION=3.1.18 -QT_VERSION=5.15.2 +QT_VERSION=6.7.2 # Only variables which are really needed by sub-commands are exported. # Definitions have to stay in a specific order due to dependencies. @@ -45,7 +45,7 @@ COMMANDLINETOOLS_DIR="${ANDROID_SDK_ROOT}"/cmdline-tools/latest/ export ANDROID_NDK_ROOT="${ANDROID_BASEDIR}/android-ndk" ANDROID_NDK_HOST="linux-x86_64" ANDROID_SDKMANAGER="${COMMANDLINETOOLS_DIR}/bin/sdkmanager" -export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/" +export JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64/" export PATH="${PATH}:${ANDROID_SDK_ROOT}/tools" export PATH="${PATH}:${ANDROID_SDK_ROOT}/platform-tools" @@ -58,7 +58,7 @@ setup_ubuntu_dependencies() { export DEBIAN_FRONTEND="noninteractive" sudo apt-get -qq update - sudo apt-get -qq --no-install-recommends -y install build-essential zip unzip bzip2 p7zip-full curl chrpath openjdk-8-jdk-headless + sudo apt-get -qq --no-install-recommends -y install build-essential zip unzip bzip2 p7zip-full curl chrpath openjdk-17-jdk-headless } setup_android_sdk() { @@ -117,7 +117,7 @@ build_app_as_apk() { local QT_DIR="${QT_BASEDIR}/${QT_VERSION}/android" local MAKE="${ANDROID_NDK_ROOT}/prebuilt/${ANDROID_NDK_HOST}/bin/make" - "${QT_DIR}/bin/qmake" -spec android-clang + "${QT_DIR}/bin/qmake" -spec android-clang ANDROID_ABIS="armeabi-v7a arm64-v8a x86 x86_64" "${MAKE}" -j "$(nproc)" "${MAKE}" INSTALL_ROOT="${BUILD_DIR}" -f Makefile install "${QT_DIR}"/bin/androiddeployqt --input android-Jamulus-deployment-settings.json --output "${BUILD_DIR}" \ diff --git a/Jamulus.pro b/Jamulus.pro index 3d1d5acd45..e08db5a775 100644 --- a/Jamulus.pro +++ b/Jamulus.pro @@ -244,22 +244,29 @@ win32 { LIBS += -framework AVFoundation \ -framework AudioToolbox } else:android { - ANDROID_ABIS = armeabi-v7a arm64-v8a x86 x86_64 ANDROID_VERSION_NAME = $$VERSION ANDROID_VERSION_CODE = $$system(git log --oneline | wc -l) message("Setting ANDROID_VERSION_NAME=$${ANDROID_VERSION_NAME} ANDROID_VERSION_CODE=$${ANDROID_VERSION_CODE}") + ANDROID_PERMISSIONS += android.permission.INTERNET \ + android.permission.RECORD_AUDIO \ + android.permission.WRITE_EXTERNAL_STORAGE \ + android.permission.MODIFY_AUDIO_SETTINGS + + ANDROID_MIN_SDK_VERSION = 23 + ANDROID_TARGET_SDK_VERSION = 34 + # liboboe requires C++17 for std::timed_mutex CONFIG += c++17 - QT += androidextras + # debug_and_release breaks qmlimportscanner for Android because it can't find the nested qrc file + CONFIG -= debug_and_release + + QT += core-private # enabled only for debugging on android devices DEFINES += ANDROIDDEBUG - target.path = /tmp/your_executable # path on device - INSTALLS += target - HEADERS += src/sound/oboe/sound.h SOURCES += src/sound/oboe/sound.cpp \ @@ -267,7 +274,6 @@ win32 { LIBS += -lOpenSLES ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android - DISTFILES += android/AndroidManifest.xml # if compiling for android you need to use Oboe library which is included as a git submodule # make sure you git pull with submodules to pull the latest Oboe library diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 7725864d27..12d17d9577 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,83 +1,26 @@ - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + diff --git a/src/main.cpp b/src/main.cpp index e9f05c4413..b661abc168 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -40,7 +40,7 @@ #endif #include "util.h" #ifdef ANDROID -# include +# include #endif #if defined( Q_OS_MACOS ) # include "mac/activity.h" @@ -829,13 +829,13 @@ int main ( int argc, char** argv ) #ifdef ANDROID // special Android coded needed for record audio permission handling - auto result = QtAndroid::checkPermission ( QString ( "android.permission.RECORD_AUDIO" ) ); + auto result = QtAndroidPrivate::checkPermission ( QString ( "android.permission.RECORD_AUDIO" ) ).result(); - if ( result == QtAndroid::PermissionResult::Denied ) + if ( result == QtAndroidPrivate::PermissionResult::Denied ) { - QtAndroid::PermissionResultMap resultHash = QtAndroid::requestPermissionsSync ( QStringList ( { "android.permission.RECORD_AUDIO" } ) ); + QtAndroidPrivate::PermissionResult requestResult = QtAndroidPrivate::requestPermission ( QString ( "android.permission.RECORD_AUDIO" ) ).result(); - if ( resultHash["android.permission.RECORD_AUDIO"] == QtAndroid::PermissionResult::Denied ) + if ( requestResult == QtAndroidPrivate::PermissionResult::Denied ) { return 0; }