diff --git a/.github/workflows/preview-apk.yml b/.github/workflows/preview-apk.yml index ed66bd3a9..ee9707bf3 100644 --- a/.github/workflows/preview-apk.yml +++ b/.github/workflows/preview-apk.yml @@ -42,16 +42,16 @@ jobs: ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }} run: | export PATH="${PATH}:${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/" - scripts/install-toolchains.sh && scripts/ndk-make.sh + scripts/install-toolchains.sh && scripts/ndk-make.sh armeabi-v7a - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v1 - name: Build APK - run: ./gradlew --no-daemon assembleGplayDebug + run: ./gradlew --no-daemon assembleFossDebug - name: Upload APK uses: actions/upload-artifact@v3 with: name: app-preview.apk - path: 'build/outputs/apk/gplay/debug/*.apk' + path: 'build/outputs/apk/foss/debug/*.apk' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8f73bafd4..824e0ecaf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,7 +54,7 @@ jobs: echo "DC_RELEASE_STORE_PASSWORD=${{ secrets.KEY_STORE_PASSWORD }}" >> ~/.gradle/gradle.properties echo "DC_RELEASE_KEY_ALIAS=${{ secrets.ALIAS }}" >> ~/.gradle/gradle.properties echo "DC_RELEASE_KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}" >> ~/.gradle/gradle.properties - ./gradlew --no-daemon assembleGplayRelease + ./gradlew --no-daemon assembleFossRelease - name: Release uses: softprops/action-gh-release@v1 @@ -63,4 +63,4 @@ jobs: body: "DeltaLab release, download the APK file for your phone's CPU architecture, if you don't know your phone's architecture, use the universal APK which works for all architectures" prerelease: ${{ contains(github.event.ref, '-beta') }} fail_on_unmatched_files: true - files: build/outputs/apk/gplay/release/*.apk + files: build/outputs/apk/foss/release/*.apk diff --git a/build.gradle b/build.gradle index 33459c997..4602fc085 100644 --- a/build.gradle +++ b/build.gradle @@ -33,10 +33,10 @@ android { useLibrary 'org.apache.http.legacy' defaultConfig { - versionCode 685 + versionCode 30000685 versionName "1.46.13" - applicationId "chat.delta" + applicationId "chat.delta.lite" multiDexEnabled true minSdkVersion 21 @@ -49,14 +49,16 @@ android { buildConfigField "boolean", "DEV_BUILD", "false" + ndk { + abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" + } + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" buildConfigField("String", "TEST_ADDR", buildConfigProperty("TEST_ADDR")) buildConfigField("String", "TEST_MAIL_PW", buildConfigProperty("TEST_MAIL_PW")) buildConfigField("String", "NDK_ARCH", getNdkArch()) - ndk { - abiFilters "armeabi-v7a", "arm64-v8a", "x86" - } } compileOptions { @@ -74,6 +76,12 @@ android { signingConfigs { + debug { + // add `DC_DEBUG_STORE_FILE=/path/to/debug.keystore` to `~/.gradle/gradle.properties` + if(project.hasProperty("DC_DEBUG_STORE_FILE" )) { + storeFile file(DC_DEBUG_STORE_FILE ) + } + } release { // can be defined at `~/.gradle/gradle.properties` or at "Build/Generate signed APK" if(project.hasProperty("DC_RELEASE_STORE_FILE")) { @@ -86,8 +94,11 @@ android { } buildTypes { + debug { + minifyEnabled false + applicationIdSuffix ".beta" + } release { - applicationIdSuffix ".lite" // minification and proguard disabled for now. // // when enabled, it can cut down apk size about 6%, @@ -98,11 +109,8 @@ android { // nb: it is highly recommended to use the same settings in debug+release - // otherwise problems might be noticed delayed only minifyEnabled true + signingConfig signingConfigs.release proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - - if(project.hasProperty("DC_RELEASE_STORE_FILE")) { - signingConfig signingConfigs.release - } } } @@ -118,27 +126,12 @@ android { } } - splits { - abi { - enable true - reset() - include "armeabi-v7a", "arm64-v8a", "x86" - universalApk true - } - } - - project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 3, 'arm64-v8a': 3, 'mips': 5, 'mips64': 6, 'x86': 9, 'x86_64': 9] - android.applicationVariants.all { variant -> - variant.outputs.all { output -> - output.outputFileName = output.outputFileName + variant.outputs.all { + outputFileName = outputFileName .replace("deltalab-android", "deltalab") - .replace("-gplay", "") - .replace("-release", "") + .replace("-release", "") .replace(".apk", "-${variant.versionName}.apk") - output.versionCodeOverride = - project.ext.versionCodes.get(output.getFilter( - com.android.build.OutputFile.ABI), 3) * 10000000 + android.defaultConfig.versionCode } } diff --git a/jni/Application.mk b/jni/Application.mk index e3f08394c..016a16dec 100644 --- a/jni/Application.mk +++ b/jni/Application.mk @@ -1,5 +1,5 @@ APP_PLATFORM := android-16 -APP_ABI := armeabi-v7a arm64-v8a x86 +APP_ABI := armeabi-v7a arm64-v8a x86 x86_64 APP_STL := none ifneq ($(NDK_DEBUG),1) diff --git a/scripts/ndk-make.sh b/scripts/ndk-make.sh index 5f1fdc376..81abde831 100755 --- a/scripts/ndk-make.sh +++ b/scripts/ndk-make.sh @@ -141,14 +141,14 @@ if test -z $1 || test $1 = x86; then cp target/i686-linux-android/$RELEASE/libdeltachat.a $jnidir/x86 fi -# if test -z $1 || test $1 = x86_64; then -# echo "-- cross compiling to x86_64-linux-android (x86_64) --" -# TARGET_CC="$TOOLCHAIN/bin/x86_64-linux-android21-clang" \ -# TARGET_AR="$TOOLCHAIN/bin/llvm-ar" \ -# TARGET_RANLIB="$TOOLCHAIN/bin/llvm-ranlib" \ -# cargo build $RELEASEFLAG --target x86_64-linux-android -p deltachat_ffi --features jsonrpc -# cp target/x86_64-linux-android/$RELEASE/libdeltachat.a $jnidir/x86_64 -# fi + if test -z $1 || test $1 = x86_64; then + echo "-- cross compiling to x86_64-linux-android (x86_64) --" + TARGET_CC="$TOOLCHAIN/bin/x86_64-linux-android21-clang" \ + TARGET_AR="$TOOLCHAIN/bin/llvm-ar" \ + TARGET_RANLIB="$TOOLCHAIN/bin/llvm-ranlib" \ + cargo build $RELEASEFLAG --target x86_64-linux-android -p deltachat_ffi --features jsonrpc + cp target/x86_64-linux-android/$RELEASE/libdeltachat.a $jnidir/x86_64 + fi rm -fr "$TMPLIB"