Skip to content

Process

Process #22169

Workflow file for this run

name: Process
on:
schedule:
- cron: "*/30 0-13 * * *"
workflow_dispatch:
jobs:
Process:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Write secrets
env:
ANDROID_ID: ${{ secrets.ANDROID_ID }}
TOKEN: ${{ secrets.TOKEN }}
run: |
mkdir ~/googleplay
echo "{\"AndroidID\": $ANDROID_ID}" > ~/googleplay/arm64-v8a.json
echo "{\"Token\": \"$TOKEN\"}" > ~/googleplay/token.json
- name: Check version
run: |
chmod +x ./googleplay
info=$(./googleplay -a com.cygames.Shadowverse -p 2)
echo "$info"
version_string=$(echo "$info" | grep "VersionString")
store_version=$(echo "$info" | grep "VersionCode")
version=$(cat version)
echo "current version:"
echo "$version"
echo "current playstore version:"
echo "$store_version"
if [[ $store_version > $version ]]; then
echo "New version $version_string found."
echo "new_version=true" >> $GITHUB_ENV
echo "store_version=$store_version" >> $GITHUB_ENV
echo "version_string=$(echo ${version_string##* })" >> $GITHUB_ENV
echo "version=$(echo ${store_version##* })" >> $GITHUB_ENV
else
echo "new_version=false" >> $GITHUB_ENV
fi
- name: Cancel if no new version
if: ${{ env.new_version == 'false' }}
uses: andymckay/[email protected]
- name: Download new apk
if: ${{ env.new_version == 'true' }}
run: |
./googleplay -a com.cygames.Shadowverse -p 2 -v ${{ env.version }} -s
- name: Setup Java JDK
if: ${{ env.new_version == 'true' }}
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '17'
- name: Decompile apk
if: ${{ env.new_version == 'true' }}
run: |
mv *.apk original.apk
java -jar ./apktool_2.6.1.jar d original.apk
- name: Process apk
if: ${{ env.new_version == 'true' }}
run: |
sed -i 's/android:maxAspectRatio="2.16"/android:maxAspectRatio="2.4"/' original/AndroidManifest.xml
sed -i 's/"android.max_aspect" android:value="2.16"/"android.max_aspect" android:value="2.4"/' original/AndroidManifest.xml
xxd -p -c 1000000 original/lib/arm64-v8a/libil2cpp.so | sed 's/4218201e4008201e4108211e/1f2003d51f2003d51f2003d5/' | xxd -r -p -c 1000000 > original/lib/arm64-v8a/libil2cpp2.so
rm original/lib/arm64-v8a/libil2cpp.so
mv original/lib/arm64-v8a/libil2cpp2.so original/lib/arm64-v8a/libil2cpp.so
- name: Recompile apk
if: ${{ env.new_version == 'true' }}
run: |
java -jar ./apktool_2.6.1.jar b --use-aapt2 original
mv original/dist/original.apk original/dist/Shadowverse-${{ env.version_string }}.apk
- name: Zipalign and sign apk
if: ${{ env.new_version == 'true' }}
uses: kevin-david/[email protected]
with:
releaseDirectory: original/dist
alias: ${{ secrets.SIGNING_KEY_ALIAS }}
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
keyStorePassword: ${{ secrets.SIGNING_KEY_PASSWD }}
zipAlign: true
- name: Upload artifact
if: ${{ env.new_version == 'true' }}
uses: actions/upload-artifact@v3
with:
name: Shadowverse-${{ env.version_string }}-signed.apk
path: original/dist/Shadowverse-${{ env.version_string }}-signed.apk
- name: Commit files
if: ${{ env.new_version == 'true' }}
run: |
echo ${{ env.store_version }} > version
git add version
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Version ${{ env.version_string }}"
- name: Push changes
if: ${{ env.new_version == 'true' }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: Create release
if: ${{ env.new_version == 'true' }}
uses: ncipollo/[email protected]
with:
name: ShadowverseHD-${{ env.version_string }}
artifacts: original/dist/Shadowverse-${{ env.version_string }}-signed.apk
tag: ${{ env.version_string }}
body: "Version ${{ env.version_string }}."