Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Android CI

on:
push:
branches: [ "master" ]
jobs:
build:
permissions: write-all
runs-on: ubuntu-latest
if: github.event_name == 'push' && !contains(github.event.head_commit.message, 'Merge')
steps:
- uses: actions/checkout@v6
- name: set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Write key
if: github.event_name != 'pull_request'
run: |
if [ ! -z "${{ secrets.KEY_STORE }}" ]; then
echo androidStorePassword='${{ secrets.KEY_STORE_PASSWORD }}' >> gradle.properties
echo androidKeyAlias='${{ secrets.ALIAS }}' >> gradle.properties
echo androidKeyPassword='${{ secrets.KEY_PASSWORD }}' >> gradle.properties
echo androidStoreFile='key.jks' >> gradle.properties
echo ${{ secrets.KEY_STORE }} | base64 --decode > key.jks
fi

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build all flavor variants
run: |
./gradlew assembleWhatsappDebug assembleBusinessDebug -Pminify=true

- name: Get short SHA
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV

- name: Upload WhatsApp flavor artifacts
uses: actions/upload-artifact@v5
with:
name: whatsapp-debug-app-${{ env.SHORT_SHA }}
path: app/build/outputs/apk/whatsapp/debug/app-whatsapp-debug.apk

- name: Upload Business flavor artifacts
uses: actions/upload-artifact@v5
with:
name: business-debug-app-${{ env.SHORT_SHA }}
path: app/build/outputs/apk/business/debug/app-business-debug.apk

- name: Post to Telegram channel
if: ${{ success() && github.ref == 'refs/heads/master' && github.ref_type != 'tag' }}
env:
CHANNEL_ID: ${{ secrets.CHANNEL_ID }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
COMMIT_URL: ${{ github.event.head_commit.url }}
run: |
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
GITHUB_SHA_SHORT=$(git rev-parse --short HEAD)
export output_whatsapp=app/WaEnhancer_$GITHUB_SHA_SHORT.apk
export output_business=app/WaEnhancer_Business_$GITHUB_SHA_SHORT.apk
cp app/build/outputs/apk/whatsapp/debug/app-whatsapp-debug.apk $output_whatsapp
cp app/build/outputs/apk/business/debug/app-business-debug.apk $output_business
export LOG=$(cat changelog.txt)
ESCAPED=$(python3 -c 'import json,os,urllib.parse; msg = json.dumps(os.getenv("LOG")); print(urllib.parse.quote(msg if len(msg) <= 1024 else json.dumps(os.getenv("COMMIT_URL"))))')

# Send WhatsApp variant
curl "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${CHANNEL_ID}&media=%5B%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2Fwa%22%7D%2C%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2Fw4b%22%2C%22caption%22%3A${ESCAPED}%7D%5D" -F wa="@$output_whatsapp" -F w4b="@$output_business"
fi

- name: Upload to GitHub release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: WaEnhancer ${{ env.SHORT_SHA }}
body_path: changelog.txt
files: |
app/build/outputs/apk/whatsapp/debug/app-whatsapp-debug.apk
app/build/outputs/apk/business/debug/app-business-debug.apk
tag_name: debug-${{ env.SHORT_SHA }}
8 changes: 4 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ android {

defaultConfig {
applicationId = "com.wmods.wppenhacer"
minSdk = 28
targetSdk = 34
minSdk = 26
targetSdk = 36
versionCode = 152
versionName = "1.5.2-DEV ($gitHash)"
versionName = "1.5.8-0556sagar ($gitHash)"
multiDexEnabled = true

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -204,4 +204,4 @@ afterEvaluate {
}
}
}
}
}
2 changes: 2 additions & 0 deletions app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@
<item>2.25.35.xx</item>
<item>2.25.36.xx</item>
<item>2.25.37.xx</item>
<item>2.25.38.xx</item>
<item>2.25.39.xx</item>
</string-array>
<string-array name="supported_versions_business">
<item>2.25.25.xx</item>
Expand Down