From a97420c356462d8fc9f6a8a686dd83c9d01745ea Mon Sep 17 00:00:00 2001 From: Karol Labus Date: Fri, 18 Sep 2026 14:31:06 +0200 Subject: [PATCH] Automate CI/CD, document fork features, and format messages --- .gitea/workflows/build.yml | 69 ++++++++++++++++++++++++++++++++++++++ .gitea/workflows/sync.yml | 41 ++++++++++++++++++++++ README.md | 43 ++++++++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 .gitea/workflows/build.yml create mode 100644 .gitea/workflows/sync.yml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 00000000..017d6d13 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,69 @@ +name: Build and Release APK + +on: + push: + branches: [ main ] + tags: [ 'v*' ] + pull_request: + branches: [ main ] + +jobs: + build: + name: Build APK + runs-on: ubuntu-latest + container: + image: mingc/android-build-box:latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Restore Gradle Cache + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build Debug APK + run: ./gradlew assembleDebug + + - name: Build Release APK + run: ./gradlew assembleRelease + + - name: Upload Debug APK Artifact + uses: actions/upload-artifact@v3 + with: + name: Quik-Debug-APK + path: presentation/build/outputs/apk/debug/*.apk + + - name: Upload Release APK Artifact + uses: actions/upload-artifact@v3 + with: + name: Quik-Release-APK + path: presentation/build/outputs/apk/release/*.apk + + release: + name: Create Gitea Release + needs: build + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Download Artifacts + uses: actions/download-artifact@v3 + + - name: Create Release + uses: ncipollo/release-action@v1 + with: + artifacts: "Quik-Debug-APK/*.apk,Quik-Release-APK/*.apk" + token: ${{ secrets.GITHUB_TOKEN }} + name: Release ${{ github.ref_name }} + body: "Automated release of Quik Fork with Remotrix integration." diff --git a/.gitea/workflows/sync.yml b/.gitea/workflows/sync.yml new file mode 100644 index 00000000..d4f8c9b1 --- /dev/null +++ b/.gitea/workflows/sync.yml @@ -0,0 +1,41 @@ +name: Sync Upstream Quik + +on: + schedule: + - cron: '0 2 * * 1' # Runs every Monday at 02:00 + workflow_dispatch: + +jobs: + sync: + name: Sync with Upstream + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Configure Git + run: | + git config user.name "Gitea Automation" + git config user.email "actions@gitea.local" + + - name: Fetch and Merge Upstream + run: | + git remote add upstream https://gitea.labus.uk/upstream-mirrors/quik.git + git fetch upstream + # Try to merge upstream main into our main branch. + # If it fails, the step exits with a non-zero code. + git merge upstream/main --no-edit + git push origin main + + - name: Notify on Failure + if: failure() + run: | + echo "::error::Merge conflict detected or upstream sync failed! Please resolve manually." + # Automatically create an issue via Gitea API to notify the owner + curl -X POST "${{ github.api_url }}/repos/${{ github.repository }}/issues" \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Content-Type: application/json" \ + -d '{"title": "⚠️ Upstream Sync Failed - Merge Conflict", "body": "The scheduled upstream sync with `quik` encountered a merge conflict or error. Please resolve it manually by pulling from upstream and fixing the conflicts."}' diff --git a/README.md b/README.md index 5ec94726..d91cb4e8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,46 @@ +# Quik Fork with Remotrix Matrix Bridge + +> [!NOTE] +> This project is a hard fork of the open-source **Quik** SMS messenger application. It has been modified to natively integrate **Remotrix**, a background service that bridges your SMS messages to a Matrix homeserver. + +## Why this fork? + +The original Remotrix project was a standalone background bridge that required a separate, default SMS handler application. By deeply integrating Remotrix directly into Quik, we created a single, unified SMS application that offers a beautiful Material Design UI on the phone, while silently syncing all messages to your Matrix account (via Trixnity) in the background. + +**Key enhancements in this fork:** +* **Native Matrix Background Sync**: SMS messages sent or received on the phone are instantly bridged to your Matrix account. +* **Two-way Communication**: Messages sent from Matrix are instantly forwarded as standard SMS messages from the phone. +* **Coroutines Deadlock Fix**: Upgraded Room database dependencies to resolve fatal `SQLiteConnectionPool` deadlocks during the cryptographic key generation phases. +* **Enhanced Visual Formatting**: Matrix messages now use intuitive prefixes (🟢 for outgoing, 🔴 for incoming) to clearly distinguish participants without requiring AppService double puppeting. +* **Gitea Actions CI/CD**: Includes automated builds and automatic upstream fetching from the original Quik repository. + +## Management Room + +When you log into the application with your Matrix bot account (`@remotrix:yourserver.com`) and specify a Manager ID (`@you:yourserver.com`), the bot creates a dedicated **Management Room** and invites you. +From there, you can issue commands: +- `!new ` - Opens a new Matrix room dedicated to chatting with that phone number. +- `!close` - Deletes a chat room. +- `!ping` - Checks bot latency. +- `!reload` - Restarts the background service. + +Any non-command text sent in a dedicated phone number room will be sent as an SMS to that contact. + +## Building and Releasing (Fork CI/CD) + +The project uses Gitea Actions for CI/CD: +- `build.yml`: Automatically builds the Debug and Release APKs (`assembleDebug`, `assembleRelease`) upon pushing to `main` or creating a tag. If a tag (e.g., `v1.0.0`) is pushed, a Gitea Release is created automatically. +- `sync.yml`: Runs weekly to automatically fetch changes from the original `quik` upstream repository and merge them into our fork. + +To build manually: +```bash +./gradlew assembleDebug +``` +The APK will be available in `presentation/build/outputs/apk/debug/`. + +--- + +# Original Quik Documentation Below: + ![octoshrimpy/QUIK](.github/octoshrimpy_quik.jpg) # QUIK