From c78b664e31973abd9b4f048a504bd810114f626e Mon Sep 17 00:00:00 2001 From: HolographicHat <58809250+HolographicHat@users.noreply.github.com> Date: Tue, 22 Nov 2022 17:16:08 +0800 Subject: [PATCH] Create android.yml --- .github/workflows/android.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..1015ab9 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,41 @@ +name: Android CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + cache: gradle + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew assembleRelease + - name: Install jq + run: sudo apt-get install -y jq + - name: Download package + run: "curl -H 'x-rpc-client_type: 2' -H 'x-rpc-app_version: 2.37.1' -H 'x-rpc-channel: miyousheluodi' https://api-takumi.mihoyo.com/ptolemaios/api/getLatestRelease | jq --raw-output '.data.package_url' | xargs curl -o origin.apk" + - name: Patch package + run: "java -jar gradle/lspatch/jar-v0.5.1-361-release.jar -f -l 2 -m app/build/outputs/apk/release/app-release-unsigned.apk -o pout origin.apk" + - name: Upload build artifacts + uses: actions/upload-artifact@v2 + with: + name: Artifacts + path: app/build/outputs/apk/release/app-release-unsigned.apk + - name: Upload patched package + uses: actions/upload-artifact@v2 + with: + name: Artifacts + path: pout