Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,5 @@ jobs:
- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Build debug APK
run: ./gradlew assembleDebug -x lint
- name: Build both flavors (playstore + sms)
run: ./gradlew assemblePlaystoreDebug assembleSmsDebug -x lint
27 changes: 18 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,20 @@ jobs:
- name: Make gradlew executable
run: chmod +x ./gradlew

# Build debug APK (auto-signed with Android's debug keystore)
# so users can actually install it via sideload. An unsigned release
# APK is rejected by Android with "package appears to be invalid".
- name: Build debug APK
run: ./gradlew assembleDebug -x lint

- name: Rename APK
# Build both flavor variants as debug APKs (auto-signed with Android's
# debug keystore so they install via sideload):
# - playstore flavor: no SMS permission (matches Play Store build)
# - sms flavor: SEND_SMS permission included (optional variant)
- name: Build debug APKs (playstore + sms flavors)
run: ./gradlew assemblePlaystoreDebug assembleSmsDebug -x lint

- name: Rename APKs
run: |
mkdir -p release-artifacts
cp app/build/outputs/apk/debug/app-debug.apk \
cp app/build/outputs/apk/playstore/debug/app-playstore-debug.apk \
"release-artifacts/zenlock-v${{ steps.bump.outputs.new_version }}-debug.apk"
cp app/build/outputs/apk/sms/debug/app-sms-debug.apk \
"release-artifacts/zenlock-v${{ steps.bump.outputs.new_version }}-sms-debug.apk"

- name: Commit version bump
run: |
Expand Down Expand Up @@ -230,7 +233,13 @@ jobs:
${{ steps.changelog.outputs.changelog }}

---
**The APK attached below is a debug build** (for developers and testers only).
### Downloads

Two debug APKs are attached below (both auto-signed with Android's debug keystore so they install via sideload):

- **`zenlock-vX.Y.Z-debug.apk`** — default build, matches the Play Store version (no SMS permission).
- **`zenlock-vX.Y.Z-sms-debug.apk`** — same app with SMS accountability-partner support enabled.

You may need to uninstall the Play Store version first (different signature).
For the official release, install from [Google Play](https://play.google.com/store/apps/details?id=com.grepguru.zenlock).
files: release-artifacts/*.apk
Expand Down
23 changes: 23 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,31 @@ android {
sourceCompatibility = JavaVersion.VERSION_15
targetCompatibility = JavaVersion.VERSION_15
}

// Product flavors:
// playstore = default build, no SMS permission. Used for Google Play releases
// and for the default GitHub artifact.
// sms = adds SEND_SMS permission via a flavor-specific manifest in
// app/src/sms/AndroidManifest.xml. Built only by CI and
// attached to GitHub Releases as an optional "SMS-enabled" variant.
// Named "sms" (not "github") so CI task names and APK filenames
// clearly indicate which variant includes the SMS feature.
flavorDimensions += "dist"
productFlavors {
create("playstore") {
dimension = "dist"
isDefault = true
}
create("sms") {
dimension = "dist"
versionNameSuffix = "-sms"
}
}
}

// Android Studio Build Variants panel defaults to playstoreDebug / playstoreRelease
// so local builds never accidentally include the SMS permission.

dependencies {

implementation(libs.appcompat)
Expand Down
10 changes: 10 additions & 0 deletions app/src/sms/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This manifest is merged only into the "sms" product flavor.
It adds the SEND_SMS permission so the accountability-partner OTP feature
works in the SMS-enabled variant distributed on GitHub Releases.
The default "playstore" flavor does NOT include this permission.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.SEND_SMS" />
</manifest>