Skip to content

Commit

Permalink
feat(mobile): signing and prep for android production APK (#1265)
Browse files Browse the repository at this point in the history
* Android Production APK

* Update build.gradle

* Update gitignore
  • Loading branch information
KoalaSat authored May 5, 2024
1 parent 3143144 commit 77bc7c8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,37 @@ jobs:
- name: Setup Gradle
uses: gradle/gradle-build-action@v3

- name: Decode Keystore
id: decode_keystore
uses: timheuer/[email protected]
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
Expand Down
15 changes: 14 additions & 1 deletion mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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"
}
Expand All @@ -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 {
Expand Down

0 comments on commit 77bc7c8

Please sign in to comment.