diff --git a/CMakeLists.txt b/CMakeLists.txt index 9bff146..1a67348 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,10 +12,10 @@ set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}") set(META_APP_DESCRIPTION "A simple password store using AES-256-CBC encryption via OpenSSL") set(META_GUI_OPTIONAL YES) set(META_USE_QQC2 ON) +set(META_ANDROID_PACKAGE_NAME "org.martchus.passwordmanager") set(META_VERSION_MAJOR 4) set(META_VERSION_MINOR 1) set(META_VERSION_PATCH 0) -set(META_APP_VERSION ${META_VERSION_MAJOR}.${META_VERSION_MINOR}.${META_VERSION_PATCH}) set(PNG_ICON_NO_CROP ON) # add project files diff --git a/README.md b/README.md index 9fe365a..696e56a 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ export PATH=/usr/lib/jvm/java-8-openjdk/jre/bin/:$PATH # configure with the toolchain file provided by the Android NDK (still WIP) # note: This configuration is likely required in the future to resolve https://gitlab.kitware.com/cmake/cmake/issues/18739. But for now -# better keep using CMake's internal Android support. +# better keep using CMake's internal Android support because this config has its own pitfalls (see CMAKE_CXX_FLAGS). cmake \ -DCMAKE_BUILD_TYPE=Release \ -DANDROID_ABI=$_android_arch \ @@ -148,7 +148,7 @@ cmake \ -DCMAKE_INSTALL_PREFIX=$other_libs_root \ -DCMAKE_PREFIX_PATH="$root" \ -DCMAKE_FIND_ROOT_PATH="$root;$root/libs" \ - -DCMAKE_CXX_FLAGS="-I/opt/android-ndk/sources/cxx-stl/llvm-libc++/include" \ + -DCMAKE_CXX_FLAGS="-include $android_ndk_root/sysroot/usr/include/math.h -include $android_ndk_root/sources/cxx-stl/llvm-libc++/include/math.h -I$other_libs_include" \ -DBUILD_SHARED_LIBS=ON \ -DZLIB_LIBRARY="$android_ndk_root/platforms/android-$_android_api_level/arch-$_android_arch2/usr/lib/libz.so" \ -DCLANG_FORMAT_ENABLED=ON \ @@ -165,6 +165,8 @@ cmake \ -DANDROID_APK_KEYSTORE_URL="$keystore_url" \ -DANDROID_APK_KEYSTORE_ALIAS="$keystore_alias" \ -DANDROID_APK_KEYSTORE_PASSWORD="$keystore_password" \ + -DANDROID_APK_APPLICATION_ID_SUFFIX=".unstable" \ + -DANDROID_APK_APPLICATION_LABEL="Password Manager (unstable)" \ $SOURCES/subdirs/$_reponame # configure with CMake's internal Android support @@ -194,6 +196,8 @@ cmake \ -DANDROID_APK_KEYSTORE_URL="$keystore_url" \ -DANDROID_APK_KEYSTORE_ALIAS="$keystore_alias" \ -DANDROID_APK_KEYSTORE_PASSWORD="$keystore_password" \ + -DANDROID_APK_APPLICATION_ID_SUFFIX=".unstable" \ + -DANDROID_APK_APPLICATION_LABEL="Password Manager (unstable)" \ $SOURCES/subdirs/$_reponame # build all binaries and make APK file using all CPU cores diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml.in similarity index 93% rename from android/AndroidManifest.xml rename to android/AndroidManifest.xml.in index f932f0f..38197f9 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml.in @@ -1,5 +1,5 @@ - + diff --git a/android/build.gradle b/android/build.gradle.in similarity index 91% rename from android/build.gradle rename to android/build.gradle.in index df2e987..7cbc260 100644 --- a/android/build.gradle +++ b/android/build.gradle.in @@ -39,6 +39,11 @@ android { buildToolsVersion androidBuildToolsVersion + defaultConfig { + applicationId "@META_ANDROID_PACKAGE_NAME@" + applicationIdSuffix "@ANDROID_APK_APPLICATION_ID_SUFFIX@" + } + sourceSets { main { manifest.srcFile 'AndroidManifest.xml' diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml deleted file mode 100644 index 77147bb..0000000 --- a/android/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - Password Manager - diff --git a/android/res/values/strings.xml.in b/android/res/values/strings.xml.in new file mode 100644 index 0000000..4e43e13 --- /dev/null +++ b/android/res/values/strings.xml.in @@ -0,0 +1,4 @@ + + + @ANDROID_APK_APPLICATION_LABEL@ +