diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index af7e79a3..768c8935 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -54,10 +54,37 @@ jobs: - name: Setup Gradle uses: gradle/gradle-build-action@v3 + - name: Decode Keystore + id: decode_keystore + uses: timheuer/base64-to-file@v1.2 + with: + fileName: 'keystore.jks' + fileDir: './' + encodedString: ${{ secrets.KEYSTORE }} + - name: 'Build Android Release' run: | cd mobile/android ./gradlew assembleRelease + env: + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + KEY_PASS: ${{ secrets.KEY_PASS }} + KEY_STORE_PASS: ${{ secrets.KEY_STORE_PASS }} + + + - name: 'Check for non-FOSS libraries' + run: | + wget https://github.com/iBotPeaches/Apktool/releases/download/v2.7.0/apktool_2.7.0.jar + wget https://github.com/iBotPeaches/Apktool/raw/master/scripts/linux/apktool + # clone the repo + git clone https://gitlab.com/IzzyOnDroid/repo.git + # create a directory for Apktool and move the apktool* files there + mkdir -p repo/lib/radar/tool + mv apktool* repo/lib/radar/tool + # create an alias for ease of use + chmod u+x repo/lib/radar/tool/apktool + mv repo/lib/radar/tool/apktool_2.7.0.jar repo/lib/radar/tool/apktool.jar + repo/bin/scanapk.php mobile/android/app/build/outputs/apk/release/app-universal-release.apk - name: 'Get Commit Hash' id: commit diff --git a/mobile/android/app/build.gradle b/mobile/android/app/build.gradle index 22e3862c..f3cd2410 100644 --- a/mobile/android/app/build.gradle +++ b/mobile/android/app/build.gradle @@ -238,6 +238,12 @@ android { keyAlias 'androiddebugkey' keyPassword 'android' } + release { + storeFile file("../../../keystore.jks") + keyAlias System.getenv("KEY_ALIAS") + storePassword System.getenv("KEY_STORE_PASS") + keyPassword System.getenv("KEY_PASS") + } } buildTypes { debug { @@ -246,7 +252,7 @@ android { release { // Caution! In production, you need to generate your own keystore file. // see https://reactnative.dev/docs/signed-apk-android. - signingConfig signingConfigs.debug + signingConfig signingConfigs.release minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } @@ -273,6 +279,13 @@ android { exclude "**/libjsc.so" jniLibs.useLegacyPackaging = true } + + dependenciesInfo { + // Disables dependency metadata when building APKs. + includeInApk = false + // Disables dependency metadata when building Android App Bundles. + includeInBundle = false + } } dependencies {