diff --git a/.github/workflows/flutter-build.yml b/.github/workflows/flutter-build.yml index 0e2b45063..6439764a6 100644 --- a/.github/workflows/flutter-build.yml +++ b/.github/workflows/flutter-build.yml @@ -776,13 +776,22 @@ jobs: arch: aarch64, target: aarch64-linux-android, os: ubuntu-20.04, - openssl-arch: android-arm64, + reltype: release, + suffix: "", } - { arch: armv7, target: armv7-linux-androideabi, os: ubuntu-20.04, - openssl-arch: android-arm, + reltype: release, + suffix: "", + } + - { + arch: x86_64, + target: x86_64-linux-android, + os: ubuntu-20.04, + reltype: release, + suffix: "", } steps: - name: Export GitHub Actions cache environment variables @@ -855,6 +864,12 @@ jobs: armv7-linux-androideabi) ./flutter/build_android_deps.sh armeabi-v7a ;; + x86_64-linux-android) + ./flutter/build_android_deps.sh x86_64 + ;; + i686-linux-android) + ./flutter/build_android_deps.sh x86 + ;; esac shell: bash @@ -900,6 +915,16 @@ jobs: mkdir -p ./flutter/android/app/src/main/jniLibs/armeabi-v7a cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/armeabi-v7a/librustdesk.so ;; + x86_64-linux-android) + ./flutter/ndk_x64.sh + mkdir -p ./flutter/android/app/src/main/jniLibs/x86_64 + cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/x86_64/librustdesk.so + ;; + i686-linux-android) + ./flutter/ndk_x86.sh + mkdir -p ./flutter/android/app/src/main/jniLibs/x86 + cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/x86/librustdesk.so + ;; esac - name: Build rustdesk @@ -917,8 +942,8 @@ jobs: cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/arm64-v8a/librustdesk.so # build flutter pushd flutter - flutter build apk --release --target-platform android-arm64 --split-per-abi - mv build/app/outputs/flutter-apk/app-arm64-v8a-release.apk ../rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.apk + flutter build apk "--${{ matrix.job.reltype }}" --target-platform android-arm64 --split-per-abi + mv build/app/outputs/flutter-apk/app-arm64-v8a-${{ matrix.job.reltype }}.apk ../rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}${{ matrix.job.suffix }}.apk ;; armv7-linux-androideabi) mkdir -p ./flutter/android/app/src/main/jniLibs/armeabi-v7a @@ -926,13 +951,31 @@ jobs: cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/armeabi-v7a/librustdesk.so # build flutter pushd flutter - flutter build apk --release --target-platform android-arm --split-per-abi - mv build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk ../rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.apk + flutter build apk "--${{ matrix.job.reltype }}" --target-platform android-arm --split-per-abi + mv build/app/outputs/flutter-apk/app-armeabi-v7a-${{ matrix.job.reltype }}.apk ../rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}${{ matrix.job.suffix }}.apk + ;; + x86_64-linux-android) + mkdir -p ./flutter/android/app/src/main/jniLibs/x86_64 + cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/libc++_shared.so ./flutter/android/app/src/main/jniLibs/x86_64/ + cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/x86_64/librustdesk.so + # build flutter + pushd flutter + flutter build apk "--${{ matrix.job.reltype }}" --target-platform android-x64 --split-per-abi + mv build/app/outputs/flutter-apk/app-x86_64-${{ matrix.job.reltype }}.apk ../rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}${{ matrix.job.suffix }}.apk + ;; + i686-linux-android) + mkdir -p ./flutter/android/app/src/main/jniLibs/x86 + cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/i686-linux-android/libc++_shared.so ./flutter/android/app/src/main/jniLibs/x86/ + cp ./target/${{ matrix.job.target }}/debug/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/x86/librustdesk.so + # build flutter + pushd flutter + flutter build apk "--${{ matrix.job.reltype }}" --target-platform android-x86 --split-per-abi + mv build/app/outputs/flutter-apk/app-x86-${{ matrix.job.reltype }}.apk ../rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}${{ matrix.job.suffix }}.apk ;; esac popd mkdir -p signed-apk; pushd signed-apk - mv ../rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.apk . + mv ../rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}${{ matrix.job.suffix }}.apk . - uses: r0adkll/sign-android-release@v1 name: Sign app APK diff --git a/flutter/ndk_x86.sh b/flutter/ndk_x86.sh new file mode 100755 index 000000000..617c25f65 --- /dev/null +++ b/flutter/ndk_x86.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +cargo ndk --platform 21 --target i686-linux-android build --release --features flutter