Feat/tauri desktop (#1103)

<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

<!-- Please include a summary of the change. Please also include
relevant motivation and context. List any dependencies that are required
for this change. -->

Fixes #

#### Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

### Checklist:

- [x] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings

### AI disclosure:

- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
This commit is contained in:
7w1 authored and GitHub committed 2026-07-19 17:31:08 +00:00
commit db6e1343fa
356 files changed
+25422 -1132

No files matched your search

@@ -0,0 +1,5 @@
---
default: patch
---
Keep the message composer focused when tapping an autocomplete suggestion on mobile, so selecting an emoji, mention, or command no longer unfocuses the input.
+5
View File
@@ -0,0 +1,5 @@
---
default: minor
---
Add beta builds for desktop and mobile.
@@ -0,0 +1,71 @@
// Composes the Tauri updater manifest (latest.json) from the per-platform .sig
// assets already attached to the release.
// Required env: TAG, VERSION, REPO, GH_TOKEN.
import { execSync } from 'node:child_process';
import { readFileSync, readdirSync, writeFileSync, mkdtempSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
const TAG = process.env.TAG;
const VERSION = process.env.VERSION;
const REPO = process.env.REPO;
if (!TAG || !VERSION || !REPO) {
console.error('TAG, VERSION, and REPO env vars are required');
process.exit(1);
}
if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(VERSION)) {
console.error(`VERSION must be valid SemVer (got: ${VERSION})`);
process.exit(1);
}
const version = VERSION;
const dir = mkdtempSync(join(tmpdir(), 'sable-sigs-'));
execSync(`gh release download "${TAG}" --repo "${REPO}" --pattern '*.sig' --dir "${dir}"`, {
stdio: 'inherit',
});
const urlFor = (name) =>
`https://github.com/${REPO}/releases/download/${TAG}/${encodeURIComponent(name)}`;
const platforms = {};
let windowsIsNsis = false;
for (const sig of readdirSync(dir).filter((f) => f.endsWith('.sig'))) {
const artifact = sig.replace(/\.sig$/, '');
const entry = { signature: readFileSync(join(dir, sig), 'utf8').trim(), url: urlFor(artifact) };
const name = artifact.toLowerCase();
if (name.endsWith('.app.tar.gz')) {
platforms['darwin-aarch64'] = entry;
platforms['darwin-x86_64'] = entry;
} else if (name.endsWith('.appimage')) {
platforms['linux-x86_64'] = entry;
} else if (name.endsWith('-setup.exe') || name.endsWith('.nsis.zip')) {
platforms['windows-x86_64'] = entry;
windowsIsNsis = true;
} else if (name.endsWith('.msi') && !windowsIsNsis) {
platforms['windows-x86_64'] = entry;
}
}
if (Object.keys(platforms).length === 0) {
console.warn('No .sig assets found on the release; skipping updater manifest.');
process.exit(0);
}
let notes = `Sable ${version}`;
if (TAG !== 'nightly') {
try {
notes =
execSync(`gh release view "${TAG}" --repo "${REPO}" --json body -q .body`, {
encoding: 'utf8',
}).trim() || notes;
} catch {
// keep the default note
}
}
const manifest = { version, notes, pub_date: new Date().toISOString(), platforms };
writeFileSync('latest.json', JSON.stringify(manifest, null, 2));
console.warn(JSON.stringify(manifest, null, 2));
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env node
/* oxlint-disable no-console */
import { readFileSync } from 'node:fs';
const runNumber = process.argv[2];
const runAttempt = process.argv[3];
const packageJson = JSON.parse(readFileSync('package.json', 'utf8'));
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(packageJson.version);
if (!match) {
console.error(`package.json version must be stable SemVer (got: ${packageJson.version})`);
process.exit(1);
}
if (!/^\d+$/.test(runNumber ?? '') || !/^\d+$/.test(runAttempt ?? '')) {
console.error('Usage: nightly-version.mjs <run-number> <run-attempt>');
process.exit(1);
}
const [, major, minor, patch] = match;
console.log(`${major}.${minor}.${Number(patch) + 1}-nightly.${runNumber}.${runAttempt}`);
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env node
/* oxlint-disable no-console */
// Stamps release-specific settings into src-tauri/tauri.conf.json, which can
// drift from the package.json version Knope tags on. Used by tauri-build.yml.
import { readFileSync, writeFileSync } from 'node:fs';
import process from 'node:process';
const version = process.argv[2];
const updaterEndpoint = process.argv[3];
if (!version || !/^\d+\.\d+\.\d+/.test(version)) {
console.error(
`Usage: set-tauri-version.mjs <version> [updater-endpoint] (got: ${version ?? '<none>'})`
);
process.exit(1);
}
if (updaterEndpoint && !updaterEndpoint.startsWith('https://')) {
console.error(`Updater endpoint must use HTTPS (got: ${updaterEndpoint})`);
process.exit(1);
}
const file = 'src-tauri/tauri.conf.json';
const config = JSON.parse(readFileSync(file, 'utf8'));
config.version = version;
if (updaterEndpoint) {
config.plugins.updater.endpoints = [updaterEndpoint];
}
writeFileSync(file, `${JSON.stringify(config, null, 2)}\n`);
console.log(`Set ${file} version to ${version}`);
if (updaterEndpoint) console.log(`Set ${file} updater endpoint to ${updaterEndpoint}`);
+1 -1
View File
@@ -120,4 +120,4 @@ jobs:
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: false
push-to-registry: true
+81
View File
@@ -0,0 +1,81 @@
name: Rust quality checks
on:
pull_request:
paths:
- 'src-tauri/**'
- '.github/workflows/rust-quality.yml'
push:
branches: [dev]
paths:
- 'src-tauri/**'
- '.github/workflows/rust-quality.yml'
merge_group:
permissions: {}
jobs:
format:
name: Rust format
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Rust
uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # stable
with:
toolchain: stable
components: rustfmt
- name: Check Rust formatting
run: cargo fmt --manifest-path src-tauri/Cargo.toml -- --check
checks:
name: Rust check, test, and Clippy
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install Tauri build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
libayatana-appindicator3-dev \
libgtk-3-dev \
librsvg2-dev \
libsoup-3.0-dev \
libssl-dev \
libwebkit2gtk-4.1-dev \
libxdo-dev \
pkg-config
- name: Setup Rust
uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # stable
with:
toolchain: stable
components: clippy
- name: Cache Rust build
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: src-tauri
- name: Check native app
run: cargo check --locked --manifest-path src-tauri/Cargo.toml
- name: Run Rust tests
run: cargo test --locked --manifest-path src-tauri/Cargo.toml
- name: Run Clippy
run: cargo clippy --locked --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings
+449
View File
@@ -0,0 +1,449 @@
name: Build desktop apps
on:
push:
branches: [dev]
tags: ['v*']
workflow_dispatch:
inputs:
tag:
description: 'Release tag to build and attach desktop bundles to (e.g. v1.20.0)'
required: true
type: string
permissions: {}
concurrency:
group: tauri-build-${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
cancel-in-progress: ${{ github.ref == 'refs/heads/dev' }}
jobs:
setup-release:
name: Resolve release target
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
if: "${{ !(github.event_name == 'push' && github.ref == 'refs/heads/dev' && contains(github.event.head_commit.message, 'chore: prepare release')) }}"
outputs:
tag: ${{ steps.meta.outputs.tag }}
version: ${{ steps.meta.outputs.version }}
ref: ${{ steps.meta.outputs.ref }}
nightly: ${{ steps.meta.outputs.nightly }}
started_at: ${{ steps.meta.outputs.started_at }}
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Resolve target
id: meta
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
INPUT_TAG: ${{ inputs.tag }}
GIT_REF: ${{ github.ref }}
GIT_REF_NAME: ${{ github.ref_name }}
GIT_SHA: ${{ github.sha }}
RUN_NUMBER: ${{ github.run_number }}
RUN_ATTEMPT: ${{ github.run_attempt }}
run: |
STARTED_AT="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
TAG="$INPUT_TAG"; REF="$INPUT_TAG"; NIGHTLY=false
VERSION="${TAG#v}"
elif [ "$GIT_REF" = "refs/heads/dev" ]; then
TAG="nightly"; REF="$GIT_SHA"; NIGHTLY=true
VERSION="$(node .github/scripts/nightly-version.mjs "$RUN_NUMBER" "$RUN_ATTEMPT")"
else
TAG="$GIT_REF_NAME"; REF="$GIT_REF"; NIGHTLY=false
VERSION="${TAG#v}"
fi
{
echo "tag=$TAG"
echo "version=$VERSION"
echo "ref=$REF"
echo "nightly=$NIGHTLY"
echo "started_at=$STARTED_AT"
} >> "$GITHUB_OUTPUT"
- name: Wait for release to exist
if: ${{ steps.meta.outputs.nightly != 'true' }}
shell: bash
env:
TAG: ${{ steps.meta.outputs.tag }}
run: |
for i in $(seq 1 12); do
if gh release view "$TAG" >/dev/null 2>&1; then
echo "Release $TAG found."
exit 0
fi
echo "Waiting for release $TAG to be published ($i/12)…"
sleep 15
done
echo "Release $TAG was not found." >&2
exit 1
- name: Ensure nightly prerelease exists
if: ${{ steps.meta.outputs.nightly == 'true' }}
shell: bash
env:
GIT_SHA: ${{ github.sha }}
run: |
if gh release view nightly >/dev/null 2>&1; then
echo "Reusing the existing nightly release while the new build is prepared."
else
gh release create nightly \
--prerelease \
--target "$GIT_SHA" \
--title "Nightly (dev)" \
--notes "Rolling nightly build from dev — $GIT_SHA"
fi
build:
name: Build ${{ matrix.name }}
needs: setup-release
runs-on: ${{ matrix.platform }}
timeout-minutes: 60
permissions:
contents: write
id-token: write
attestations: write
artifact-metadata: write
strategy:
fail-fast: false
matrix:
include:
- name: macOS
platform: macos-latest
rust-targets: aarch64-apple-darwin,x86_64-apple-darwin
args: --target universal-apple-darwin
- name: Windows
platform: windows-latest
rust-targets: ''
args: ''
- name: Linux (CEF)
platform: ubuntu-22.04
rust-targets: ''
cef: true
env:
TAG: ${{ needs.setup-release.outputs.tag }}
VERSION: ${{ needs.setup-release.outputs.version }}
NODE_OPTIONS: --max-old-space-size=8192
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ needs.setup-release.outputs.ref }}
persist-credentials: false
- name: Install Linux build dependencies
if: matrix.cef
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libsoup-3.0-dev \
libssl-dev \
libxdo-dev \
build-essential \
file \
rpm \
ruby \
ruby-dev
sudo gem install --no-document fpm
- name: Setup app
uses: ./.github/actions/setup
- name: Setup Rust
uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # stable
with:
toolchain: stable
targets: ${{ matrix.rust-targets }}
- name: Cache Rust build
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: src-tauri
- name: Stamp release version into tauri.conf.json
shell: bash
env:
UPDATER_ENDPOINT: ${{ needs.setup-release.outputs.nightly == 'true' && format('https://github.com/{0}/releases/download/nightly/latest.json', github.repository) || '' }}
run: node .github/scripts/set-tauri-version.mjs "$VERSION" "$UPDATER_ENDPOINT"
# --- macOS / Windows: standard wry build via tauri-action ---
- name: Configure updater artifacts
if: ${{ !matrix.cef }}
shell: bash
run: |
if [ -z "${TAURI_SIGNING_PRIVATE_KEY:-}" ]; then
echo 'TAURI_BUILD_ARGS=--config {"bundle":{"createUpdaterArtifacts":false}}' >> "$GITHUB_ENV"
else
echo "TAURI_BUILD_ARGS=" >> "$GITHUB_ENV"
fi
- name: Build desktop bundles
id: tauri
if: ${{ !matrix.cef }}
uses: tauri-apps/tauri-action@1deb371b0cd8bd54025b384f1cd735e725c4060f # action-v1.0.0
with:
args: ${{ matrix.args }} ${{ env.TAURI_BUILD_ARGS }}
- name: Attest Windows bundles
if: ${{ matrix.name == 'Windows' }}
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
with:
subject-path: |
src-tauri/target/release/bundle/msi/*.msi
src-tauri/target/release/bundle/msi/*.sig
src-tauri/target/release/bundle/nsis/*.exe
src-tauri/target/release/bundle/nsis/*.sig
- name: Attach bundles to release
if: ${{ !matrix.cef }}
shell: bash
env:
GH_TOKEN: ${{ github.token }}
ARTIFACTS: ${{ steps.tauri.outputs.artifactPaths }}
run: |
echo "$ARTIFACTS" | jq -r '.[]' | while read -r path; do
[ -n "$path" ] || continue
echo "Uploading $path"
gh release upload "$TAG" "$path" --clobber
done
# --- Linux: CEF runtime, packaged as deb / rpm / AppImage ---
- name: Build frontend
if: matrix.cef
shell: bash
run: pnpm build
- name: Build CEF binary
if: matrix.cef
shell: bash
run: |
cargo build --release --features cef --no-default-features \
--manifest-path src-tauri/Cargo.toml
- name: Build native packages
if: matrix.cef
shell: bash
run: bash scripts/cef-package.sh "$VERSION"
- name: Sign the AppImage for the updater
if: ${{ matrix.cef && env.TAURI_SIGNING_PRIVATE_KEY != '' }}
shell: bash
run: |
for f in src-tauri/target/release/bundle/appimage/Sable_*_amd64.AppImage; do
[ -e "$f" ] || continue
pnpm tauri signer sign "$f"
done
- name: Attest Linux bundles
if: matrix.cef
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
with:
subject-path: |
src-tauri/target/release/bundle/deb/*.deb
src-tauri/target/release/bundle/rpm/*.rpm
src-tauri/target/release/bundle/appimage/*.AppImage
src-tauri/target/release/bundle/appimage/*.sig
- name: Attach native packages to release
if: matrix.cef
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
BUNDLE="src-tauri/target/release/bundle"
for f in "$BUNDLE"/deb/sable_*.deb "$BUNDLE"/rpm/sable-*.rpm \
"$BUNDLE"/appimage/Sable_*_amd64.AppImage \
"$BUNDLE"/appimage/Sable_*_amd64.AppImage.sig; do
[ -e "$f" ] || continue
echo "Uploading $f"
gh release upload "$TAG" "$f" --clobber
done
android:
name: Build Android
needs: setup-release
runs-on: ubuntu-latest
timeout-minutes: 45
permissions:
contents: write
id-token: write
attestations: write
artifact-metadata: write
env:
TAG: ${{ needs.setup-release.outputs.tag }}
VERSION: ${{ needs.setup-release.outputs.version }}
NODE_OPTIONS: --max-old-space-size=8192
ANDROID_KEY_BASE64: ${{ secrets.ANDROID_KEY_BASE64 }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ needs.setup-release.outputs.ref }}
persist-credentials: false
- name: Setup app
uses: ./.github/actions/setup
- name: Setup Java
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
distribution: temurin
java-version: '17'
- name: Setup Android SDK
uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1
- name: Setup Rust
uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # stable
with:
toolchain: stable
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
- name: Cache Rust build
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: src-tauri
- name: Resolve NDK
shell: bash
run: |
echo "NDK_HOME=$ANDROID_HOME/ndk/$(ls -1 "$ANDROID_HOME/ndk" | sort -V | tail -n1)" >> "$GITHUB_ENV"
- name: Stamp release version into tauri.conf.json
shell: bash
run: node .github/scripts/set-tauri-version.mjs "$VERSION"
- name: Setup Android signing
if: ${{ env.ANDROID_KEY_BASE64 != '' }}
shell: bash
run: |
cd src-tauri/gen/android
echo "keyAlias=$ANDROID_KEY_ALIAS" > keystore.properties
echo "password=$ANDROID_KEY_PASSWORD" >> keystore.properties
base64 -d <<< "$ANDROID_KEY_BASE64" > "$RUNNER_TEMP/keystore.jks"
echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties
- name: Build Android bundles
shell: bash
run: pnpm tauri android build --apk --aab
- name: Attest Android bundles
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
with:
subject-path: |
src-tauri/gen/android/app/build/outputs/apk/universal/release/*.apk
src-tauri/gen/android/app/build/outputs/bundle/universalRelease/*.aab
- name: Attach Android bundles to release
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
OUT="src-tauri/gen/android/app/build/outputs"
for f in "$OUT"/apk/universal/release/*.apk \
"$OUT"/bundle/universalRelease/*.aab; do
[ -e "$f" ] || continue
echo "Uploading $f"
gh release upload "$TAG" "$f" --clobber
done
updater-manifest:
name: Publish updater manifest
needs: [setup-release, build, android]
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
id-token: write
attestations: write
artifact-metadata: write
env:
TAG: ${{ needs.setup-release.outputs.tag }}
VERSION: ${{ needs.setup-release.outputs.version }}
REPO: ${{ github.repository }}
STARTED_AT: ${{ needs.setup-release.outputs.started_at }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ needs.setup-release.outputs.ref }}
persist-credentials: false
- name: Build updater manifest
id: manifest
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ "${{ needs.setup-release.outputs.nightly }}" = "true" ]; then
gh release view "$TAG" --json assets \
| jq -r --arg cutoff "$STARTED_AT" \
'.assets[] | select(.updatedAt <= $cutoff and (.name | endswith(".sig"))) | .name' \
| while read -r name; do
[ -n "$name" ] || continue
echo "Removing superseded nightly signature: $name"
gh release delete-asset "$TAG" "$name" --yes
done
fi
node .github/scripts/build-updater-manifest.mjs
if [ -f latest.json ]; then
echo "produced=true" >> "$GITHUB_OUTPUT"
else
echo "produced=false" >> "$GITHUB_OUTPUT"
echo "No updater manifest produced (no signed artifacts); skipping attestation and upload."
fi
- name: Attest updater manifest
if: steps.manifest.outputs.produced == 'true'
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
with:
subject-path: latest.json
- name: Upload updater manifest
if: steps.manifest.outputs.produced == 'true'
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload "$TAG" latest.json --clobber
- name: Finalize nightly release
if: ${{ needs.setup-release.outputs.nightly == 'true' && steps.manifest.outputs.produced == 'true' }}
shell: bash
env:
GH_TOKEN: ${{ github.token }}
GIT_SHA: ${{ needs.setup-release.outputs.ref }}
run: |
gh api --method PATCH "repos/$REPO/git/refs/tags/nightly" \
-f sha="$GIT_SHA" -F force=true
gh release edit nightly \
--prerelease \
--target "$GIT_SHA" \
--title "Nightly (dev)" \
--notes "Rolling nightly build $VERSION from dev — $GIT_SHA"
gh release view nightly --json assets \
| jq -r --arg cutoff "$STARTED_AT" \
'.assets[] | select(.updatedAt <= $cutoff) | .name' \
| while read -r name; do
[ -n "$name" ] || continue
echo "Removing superseded nightly asset: $name"
gh release delete-asset nightly "$name" --yes
done
+28 -1
View File
@@ -6,7 +6,7 @@ devAssets
.DS_Store
.idea
*.code-workspace
.env
.wrangler
@@ -24,6 +24,33 @@ build.sh
# the following line was added with the "git ignore" tool by itsrye.dev, version 0.1.0
.lh
# Tauri
/build
/target/
/gen/schemas
dist-js
# Gradle / Android build artifacts
**/android/build/
**/android/.tauri/
**/android/.gradle/
**/.gradle/
# Rust build artifacts
src-tauri/target/
# Tauri Android build outputs
src-tauri/gen/android/app/build/
# Tauri Apple outputs
src-tauri/gen/apple/*
# Tauri Android release keystore
*.jks
# Tauri-typegen cache
.typecache
# Worktrees
.worktrees
# the following line was added with nvim by Shea because its annoying to clear every so often
.vscode/bookmarks.json
+3
View File
@@ -13,6 +13,9 @@
"[json]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer"
},
"nixEnvSelector.nixFile": "${workspaceFolder}/flake.nix",
"nixEnvSelector.useFlakes": true,
"explorer.fileNesting.enabled": true,
+2 -2
View File
@@ -9,9 +9,9 @@ Join our matrix space [here](https://matrix.to/#/#sable:sable.moe) to discuss fe
Forked from [Cinny](https://github.com/cinnyapp/cinny/).
## Getting started
The web app is available at [app.sable.moe](https://app.sable.moe/) and gets updated on frequently, as soon as a feature is deemed stable.
The stable web app is available at [app.sable.moe](https://app.sable.moe/) and tracks the [latest GitHub release](https://github.com/SableClient/Sable/releases/latest). Nightly builds are available at [dev.sable.moe](https://dev.sable.moe/) and from the [`nightly` GitHub release](https://github.com/SableClient/Sable/releases/tag/nightly).
You can also download our desktop app for windows and linux from [releases](https://github.com/SableClient/Sable/releases/latest).
You can also download our desktop app for Windows and Linux from [releases](https://github.com/SableClient/Sable/releases/latest). Release artifacts include build attestations, and desktop installations update automatically.
## Self-hosting
You have a few options for self hosting, you can:
+3 -1
View File
@@ -10,7 +10,9 @@
"pushNotificationDetails": {
"pushNotifyUrl": "https://sygnal.sable.moe/_matrix/push/v1/notify",
"vapidPublicKey": "BCnS4SbHjeOaqVFW4wjt5xDt_pYIL62qMzKePfYF9fl9PQU14RieIaObh7nLR_9dQf4sykZa-CTrcjkgMIE1mcg",
"webPushAppID": "moe.sable.app.sygnal"
"webPushAppID": "moe.sable.app.sygnal",
"nativePushAppID": "moe.sable.client.android",
"unifiedPushAppID": "moe.sable.up"
},
"themeCatalogBaseUrl": "https://raw.githubusercontent.com/SableClient/themes/main/",
+77
View File
@@ -0,0 +1,77 @@
## Signing secrets for releases
Commands to generate the signing secrets used by the release workflows. Placeholders in `<...>` are chosen or provided by the maintainer.
### Android
```bash
# ANDROID_KEY_ALIAS — e.g. "upload"
# ANDROID_KEY_PASSWORD — a strong password (store & key must match)
keytool -genkeypair -v \
-keystore upload-keystore.jks \
-alias "$ANDROID_KEY_ALIAS" \
-keyalg RSA -keysize 2048 -validity 10000 \
-storepass "$ANDROID_KEY_PASSWORD" \
-keypass "$ANDROID_KEY_PASSWORD" \
-dname "CN=<app>, O=<org>, C=<country>"
# ANDROID_KEY_BASE64
base64 -w0 upload-keystore.jks > android-key-base64.txt
```
Keep `upload-keystore.jks` safe — losing it blocks future Play Store updates.
### macOS — App Store Connect API key
From **App Store Connect → Users and Access → Integrations → App Store Connect API**:
- `APPLE_API_KEY` — the Key ID
- `APPLE_API_ISSUER` — the Issuer ID (UUID at top of the page)
- `APPLE_TEAM_ID` — the Team ID (Apple Developer → Membership)
Key creation gives a one-time download of `AuthKey_<KeyID>.p8`. If the workflow needs it as a secret:
```bash
base64 -w0 AuthKey_<KeyID>.p8 > apple-api-key-base64.txt
```
### Desktop auto-updater
```bash
# TAURI_SIGNING_PRIVATE_KEY_PASSWORD — a chosen password (may be empty)
pnpm tauri signer generate -w ~/.tauri/sable.key
```
This writes `~/.tauri/sable.key` (private) and `~/.tauri/sable.key.pub` (public).
- `TAURI_SIGNING_PRIVATE_KEY` — contents of `~/.tauri/sable.key`
- `TAURI_SIGNING_PRIVATE_KEY_PASSWORD` — the chosen password
- Put the contents of `~/.tauri/sable.key.pub` in `plugins.updater.pubkey` in `tauri.conf.json`
Never share the private key. Losing it prevents publishing updates to installed apps.
### macOS — code signing certificate
```bash
# APPLE_CERTIFICATE_PASSWORD — a chosen password
openssl genrsa -out mac-signing.key 2048
openssl req -new -key mac-signing.key -out mac-signing.csr \
-subj "/emailAddress=<email>/CN=<name>/C=<country>"
# Upload mac-signing.csr at developer.apple.com → Certificates →
# "Developer ID Application"; download developer_id.cer
openssl x509 -inform DER -in developer_id.cer -out developer_id.pem
openssl pkcs12 -export \
-inkey mac-signing.key \
-in developer_id.pem \
-out developer_id.p12 \
-passout pass:"$APPLE_CERTIFICATE_PASSWORD"
# APPLE_CERTIFICATE
base64 -w0 developer_id.p12 > apple-certificate-base64.txt
```
On a Mac, generate the CSR via Keychain Access, export the cert+key as `.p12`, and run only the last step.
Generated
+39
View File
@@ -1,5 +1,26 @@
{
"nodes": {
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1784276287,
"narHash": "sha256-xXONk0mfpVtFSaZZp21bjw1eRud0dFJ2jpVQ/TQX7ZY=",
"owner": "nix-community",
"repo": "fenix",
"rev": "3181005f932fbae4626c6a6dca5b728742656d9e",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
@@ -110,12 +131,30 @@
},
"root": {
"inputs": {
"fenix": "fenix",
"flake-parts": "flake-parts",
"git-hooks": "git-hooks",
"nixpkgs": "nixpkgs",
"treefmt-nix": "treefmt-nix"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1784247776,
"narHash": "sha256-GiZgiGRmDl773Y8wEnS1Vs/KJICXwYYspYSuKS0dhLc=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "7d5fff4b1a86097dda2b8bb899eaf5cf6b6827d5",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
+254 -124
View File
@@ -7,11 +7,14 @@
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [
inputs.git-hooks.flakeModule
inputs.treefmt-nix.flakeModule
@@ -24,108 +27,102 @@
"aarch64-darwin"
];
perSystem =
{
config,
pkgs,
lib,
...
}:
let
self = inputs.self;
perSystem = {
inputs',
config,
system,
lib,
...
}: let
pkgs = import inputs.nixpkgs {
inherit system;
packageJson = builtins.fromJSON (builtins.readFile ./package.json);
config = {
allowUnfree = true;
android_sdk.accept_license = true;
};
};
nodejs = pkgs.nodejs_24;
pnpm = pkgs.pnpm_10;
pnpmConfigHook = pkgs.pnpmConfigHook.override { inherit pnpm; };
rust = (
with inputs'.fenix.packages;
combine [
stable.toolchain
targets.aarch64-linux-android.stable.rust-std
targets.x86_64-linux-android.stable.rust-std
targets.armv7-linux-androideabi.stable.rust-std
targets.i686-linux-android.stable.rust-std
]
);
pnpmNativeBuildInputs = [
nodejs
pnpm
pnpmConfigHook
];
platformVersion = "36";
systemImageType = "default";
currentPath = builtins.getEnv "PWD";
androidEnv = pkgs.androidenv.override {licenseAccepted = true;};
androidComp = (
androidEnv.composeAndroidPackages {
cmdLineToolsVersion = "8.0";
includeNDK = true;
buildToolsVersions = ["35.0.0"];
mkPnpmDeps =
{
src,
version,
pnpmInstallFlags,
}:
pkgs.fetchPnpmDeps {
inherit
pnpm
src
version
pnpmInstallFlags
;
pname = "sable";
fetcherVersion = 3;
hash = "sha256-iBvtMeYUHWhsz1DnKjTzydAt3cGPaisUhaagoaZRg1M=";
};
mkPnpmCheck =
name: script:
pkgs.stdenv.mkDerivation (finalAttrs: {
pname = "sable-${name}";
inherit (packageJson) version;
src = lib.cleanSource ./.;
pnpmInstallFlags = [ "--ignore-scripts" ];
pnpmDeps = mkPnpmDeps {
inherit (finalAttrs) src version pnpmInstallFlags;
};
nativeBuildInputs = pnpmNativeBuildInputs;
buildPhase = ''
runHook preBuild
pnpm run ${script}
runHook postBuild
'';
installPhase = ''
runHook preInstall
touch $out
runHook postInstall
'';
doCheck = false;
});
in
{
treefmt = {
projectRootFile = "flake.nix";
programs = {
nixfmt.enable = true;
oxfmt.enable = true;
};
settings.global.excludes = [
"dist"
"node_modules"
"pnpm-lock.yaml"
"pnpm-workspace.yaml"
"package.json"
"LICENSE"
"CHANGELOG.md"
"./changeset"
platformVersions = [
"30"
platformVersion
];
};
pre-commit.settings.hooks = {
treefmt = {
enable = true;
package = config.treefmt.build.wrapper;
};
includeEmulator = true;
includeSystemImages = true;
systemImageTypes = [
systemImageType
];
abiVersions = [
"x86"
"x86_64"
"armeabi-v7a"
"arm64-v8a"
];
cmakeVersions = ["3.10.2"];
}
);
android-sdk = pkgs.android-studio.withSdk androidComp.androidsdk;
self = inputs.self;
packageJson = builtins.fromJSON (builtins.readFile ./package.json);
nodejs = pkgs.nodejs_24;
pnpm = pkgs.pnpm_10;
pnpmConfigHook = pkgs.pnpmConfigHook.override {inherit pnpm;};
pnpmNativeBuildInputs = [
pkgs.pkg-config
nodejs
pnpm
pnpmConfigHook
];
mkPnpmDeps = {
src,
version,
pnpmInstallFlags,
}:
pkgs.fetchPnpmDeps {
inherit
pnpm
src
version
pnpmInstallFlags
;
pname = "sable";
fetcherVersion = 3;
hash = "sha256-9lHy7/+hVET5c9Mt3F9DvrkW97DMxTISJsrklK/Ls2c=";
};
packages.sable = pkgs.stdenv.mkDerivation (finalAttrs: {
pname = "sable";
mkPnpmCheck = name: script:
pkgs.stdenv.mkDerivation (finalAttrs: {
pname = "sable-${name}";
inherit (packageJson) version;
src = lib.cleanSource ./.;
# ignoring knope for building
pnpmInstallFlags = [ "--ignore-scripts" ];
pnpmInstallFlags = ["--ignore-scripts"];
pnpmDeps = mkPnpmDeps {
inherit (finalAttrs) src version pnpmInstallFlags;
@@ -133,49 +130,182 @@
nativeBuildInputs = pnpmNativeBuildInputs;
env.VITE_BUILD_HASH = self.shortRev or self.dirtyShortRev or "";
env.VITE_IS_RELEASE_TAG = "false";
buildPhase = ''
runHook preBuild
pnpm run build
pnpm run ${script}
runHook postBuild
'';
installPhase = ''
runHook preInstall
cp -r dist $out
touch $out
runHook postInstall
'';
doCheck = false;
});
packages.default = config.packages.sable;
nativeBuildInputs = with pkgs; [
pkg-config
gobject-introspection
cargo
cargo-tauri
nodejs
xdg-utils
desktop-file-utils
wrapGAppsHook3
];
checks = {
build = config.packages.sable;
lint = mkPnpmCheck "lint" "lint";
fmt = mkPnpmCheck "fmt" "fmt:check";
test = mkPnpmCheck "test" "test:run";
typecheck = mkPnpmCheck "typecheck" "typecheck";
knip = mkPnpmCheck "knip" "knip";
buildInputs = with pkgs; [
at-spi2-atk
atkmm
cairo
gdk-pixbuf
glib
glib-networking
gtk3
gsettings-desktop-schemas
harfbuzz
librsvg
libsoup_3
pango
webkitgtk_4_1
openssl
dbus
dbus.dev
libayatana-appindicator
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-bad
gst_all_1.gst-plugins-ugly
gst_all_1.gst-libav
android-sdk
];
defaultPackages = [
nodejs
pnpm
rust
pkgs.cargo
pkgs.cargo-tauri
pkgs.corepack
pkgs.vitejs
pkgs.oxlint
pkgs.oxfmt
pkgs.knope
pkgs.typescript
pkgs.typescript-language-server
pkgs.nil
pkgs.nixd
pkgs.jdk
];
in {
treefmt = {
projectRootFile = "flake.nix";
programs = {
nixfmt.enable = true;
oxfmt.enable = true;
};
devShells.default = pkgs.mkShell {
packages = [
nodejs
pnpm
pkgs.corepack
pkgs.vitejs
pkgs.oxlint
pkgs.oxfmt
pkgs.knope
pkgs.typescript
pkgs.typescript-language-server
pkgs.nil
pkgs.nixd
];
shellHook = config.pre-commit.installationScript;
settings.global.excludes = [
"dist"
"node_modules"
"pnpm-lock.yaml"
"pnpm-workspace.yaml"
"package.json"
"LICENSE"
"CHANGELOG.md"
"./changeset"
];
};
pre-commit.settings.hooks = {
treefmt = {
enable = true;
package = config.treefmt.build.wrapper;
};
};
packages.sable = pkgs.stdenv.mkDerivation (finalAttrs: {
pname = "sable";
inherit (packageJson) version;
src = lib.cleanSource ./.;
# ignoring knope for building
pnpmInstallFlags = ["--ignore-scripts"];
pnpmDeps = mkPnpmDeps {
inherit (finalAttrs) src version pnpmInstallFlags;
};
nativeBuildInputs = pnpmNativeBuildInputs;
env.VITE_BUILD_HASH = self.shortRev or self.dirtyShortRev or "";
env.VITE_IS_RELEASE_TAG = "false";
buildPhase = ''
runHook preBuild
pnpm run build
runHook postBuild
'';
installPhase = ''
runHook preInstall
cp -r dist $out
runHook postInstall
'';
});
packages.android-emulator = androidEnv.emulateApp {
name = "emulate-sable";
platformVersion = platformVersion;
abiVersion = "x86_64"; # arm64-v8a
systemImageType = systemImageType;
};
packages.default = config.packages.sable;
checks = {
build = config.packages.sable;
lint = mkPnpmCheck "lint" "lint";
fmt = mkPnpmCheck "fmt" "fmt:check";
test = mkPnpmCheck "test" "test:run";
typecheck = mkPnpmCheck "typecheck" "typecheck";
knip = mkPnpmCheck "knip" "knip";
};
devShells = {
default = pkgs.mkShell {
inherit buildInputs nativeBuildInputs;
packages = defaultPackages;
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (nativeBuildInputs ++ buildInputs);
GIO_EXTRA_MODULES = "${pkgs.glib-networking}/lib/gio/modules";
GST_PLUGIN_SYSTEM_PATH = "${pkgs.gst_all_1.gst-plugins-base}/lib/gstreamer-1.0:${pkgs.gst_all_1.gst-plugins-good}/lib/gstreamer-1.0:${pkgs.gst_all_1.gst-plugins-bad}/lib/gstreamer-1.0";
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
};
android = pkgs.mkShell {
inherit buildInputs nativeBuildInputs;
packages = defaultPackages ++ [
android-sdk
];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (nativeBuildInputs ++ buildInputs);
ANDROID_HOME = "${androidComp.androidsdk}/libexec/android-sdk";
ANDROID_SDK_ROOT = "${androidComp.androidsdk}/libexec/android-sdk";
ANDROID_NDK_ROOT = "${androidComp.androidsdk}/libexec/android-sdk/ndk-bundle";
GIO_EXTRA_MODULES = "${pkgs.glib-networking}/lib/gio/modules";
GST_PLUGIN_SYSTEM_PATH = "${pkgs.gst_all_1.gst-plugins-base}/lib/gstreamer-1.0:${pkgs.gst_all_1.gst-plugins-good}/lib/gstreamer-1.0:${pkgs.gst_all_1.gst-plugins-bad}/lib/gstreamer-1.0";
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
};
};
};
};
}
+4 -2
View File
@@ -3,7 +3,10 @@
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, viewport-fit=cover"
/>
<title>Sable Client</title>
<meta name="name" content="Sable" />
<meta name="author" content="7w1" />
@@ -141,7 +144,6 @@
window.global ||= window;
</script>
<div id="root"></div>
<div id="portalContainer"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
+3 -2
View File
@@ -1,11 +1,12 @@
{
"$schema": "https://unpkg.com/knip@6/schema.json",
"entry": ["src/sw.ts", "scripts/normalize-imports.js"],
"ignore": ["oxlint.config.ts", "oxfmt.config.ts"],
"entry": ["src/sw.ts", "scripts/**/*.js"],
"ignore": ["src/test/choochmeque-notifications-stub.ts"],
"ignoreExportsUsedInFile": {
"interface": true,
"type": true
},
"ignoreFiles": ["src/app/generated/**/*"],
"ignoreDependencies": [
"buffer",
"@sableclient/sable-call-embedded",
+1 -1
View File
@@ -1,5 +1,5 @@
[package]
versioned_files = ["package.json"]
versioned_files = ["package.json", "src-tauri/tauri.conf.json"]
changelog = "CHANGELOG.md"
extra_changelog_sections = [
{ name = "Security", types = [
+2
View File
@@ -8,6 +8,8 @@ export default {
ignorePatterns: [
'dist',
'node_modules',
'src/app/generated',
'src-tauri/ios-project.yml',
'package.json',
'pnpm-lock.yaml',
'LICENSE',
+1
View File
@@ -1,6 +1,7 @@
import { defineConfig } from 'oxlint';
export default defineConfig({
ignorePatterns: ['src/app/generated/**/*'],
options: {
typeAware: true,
},
+21 -2
View File
@@ -15,6 +15,9 @@
"fmt": "oxfmt .",
"fmt:check": "oxfmt --check .",
"typecheck": "tsc",
"tauri": "tauri",
"tauri:cef": "node scripts/tauri.js cef",
"tauri:wry": "node scripts/tauri.js wry",
"test": "vitest",
"test:ui": "vitest --ui",
"test:run": "vitest run",
@@ -23,13 +26,17 @@
"tunnel": "cloudflared tunnel --url http://localhost:8080",
"knope": "knope",
"document-change": "knope document-change",
"postinstall": "node scripts/install-knope.js"
"postinstall": "node scripts/install-knope.js",
"setup:knope": "node scripts/install-knope.js",
"setup:tauri-icons": "node scripts/symlink-tauri-icons.js",
"lint:normalize-imports": "node scripts/normalize-imports.js"
},
"dependencies": {
"@arborium/arborium": "^2.18.1",
"@atlaskit/pragmatic-drag-and-drop": "^2.0.1",
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.0.0",
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^2.0.0",
"@choochmeque/tauri-plugin-notifications-api": "0.5.0-rc.11",
"@fontsource-variable/nunito": "5.2.7",
"@fontsource/space-mono": "5.2.9",
"@phosphor-icons/react": "^2.1.10",
@@ -38,6 +45,16 @@
"@tanstack/react-query": "^5.101.2",
"@tanstack/react-query-devtools": "^5.101.2",
"@tanstack/react-virtual": "^3.14.5",
"@tauri-apps/api": "2.11.1",
"@tauri-apps/plugin-clipboard-manager": "2.3.2",
"@tauri-apps/plugin-deep-link": "2.4.9",
"@tauri-apps/plugin-dialog": "~2.7.1",
"@tauri-apps/plugin-http": "2.5.9",
"@tauri-apps/plugin-opener": "2.5.4",
"@tauri-apps/plugin-os": "2.3.2",
"@tauri-apps/plugin-process": "~2.3.1",
"@tauri-apps/plugin-store": "^2.4.3",
"@tauri-apps/plugin-updater": "~2.10.1",
"@use-gesture/react": "10.3.1",
"@vanilla-extract/css": "^1.21.1",
"@vanilla-extract/recipes": "^0.5.7",
@@ -88,6 +105,7 @@
"slate-dom": "^0.124.1",
"slate-history": "^0.113.1",
"slate-react": "^0.125.1",
"tauri-plugin-android-fs-api": "28.4.0",
"ua-parser-js": "^2.0.10",
"virtua": "^0.49.2",
"workbox-precaching": "^7.4.1"
@@ -99,6 +117,7 @@
"@rollup/plugin-wasm": "^6.2.2",
"@sableclient/sable-call-embedded": "1.1.7",
"@sentry/vite-plugin": "^5.3.0",
"@tauri-apps/cli": "2.11.4",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
@@ -140,4 +159,4 @@
"jsdom>undici": "^7.28.0"
}
}
}
}
+251
View File
@@ -23,6 +23,9 @@ importers:
'@atlaskit/pragmatic-drag-and-drop-hitbox':
specifier: ^2.0.0
version: 2.0.0
'@choochmeque/tauri-plugin-notifications-api':
specifier: 0.5.0-rc.11
version: 0.5.0-rc.11
'@fontsource-variable/nunito':
specifier: 5.2.7
version: 5.2.7
@@ -47,6 +50,36 @@ importers:
'@tanstack/react-virtual':
specifier: ^3.14.5
version: 3.14.5([email protected]([email protected]))([email protected])
'@tauri-apps/api':
specifier: 2.11.1
version: 2.11.1
'@tauri-apps/plugin-clipboard-manager':
specifier: 2.3.2
version: 2.3.2
'@tauri-apps/plugin-deep-link':
specifier: 2.4.9
version: 2.4.9
'@tauri-apps/plugin-dialog':
specifier: ~2.7.1
version: 2.7.1
'@tauri-apps/plugin-http':
specifier: 2.5.9
version: 2.5.9
'@tauri-apps/plugin-opener':
specifier: 2.5.4
version: 2.5.4
'@tauri-apps/plugin-os':
specifier: 2.3.2
version: 2.3.2
'@tauri-apps/plugin-process':
specifier: ~2.3.1
version: 2.3.1
'@tauri-apps/plugin-store':
specifier: ^2.4.3
version: 2.4.3
'@tauri-apps/plugin-updater':
specifier: ~2.10.1
version: 2.10.1
'@use-gesture/react':
specifier: 10.3.1
version: 10.3.1([email protected])
@@ -197,6 +230,9 @@ importers:
slate-react:
specifier: ^0.125.1
version: 0.125.1([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])
tauri-plugin-android-fs-api:
specifier: 28.4.0
version: 28.4.0
ua-parser-js:
specifier: ^2.0.10
version: 2.0.10
@@ -225,6 +261,9 @@ importers:
'@sentry/vite-plugin':
specifier: ^5.3.0
version: 5.3.0([email protected])
'@tauri-apps/cli':
specifier: 2.11.4
version: 2.11.4
'@testing-library/jest-dom':
specifier: ^6.9.1
version: 6.9.1
@@ -884,6 +923,9 @@ packages:
resolution: {integrity: sha512-ctxtJ/eA+t+6q2++vj5j7FYX3nRu311q1wfYH3xjlLOsczhlhxAg2FWNUXhpGvAw3BWo1xBcvOV6/YLc2r5FJw==}
hasBin: true
'@choochmeque/[email protected]':
resolution: {integrity: sha512-TSuf8HQ4Ayp9IKKB5v2yTdgKMa/I0bqbcACj0IZ46CSpzn/HKner/BKG7rM8tGOarEcyBd/VXnDhK5cJA/YMtw==}
'@cloudflare/[email protected]':
resolution: {integrity: sha512-jxQYkj8dSIzc0cD6cMMNdOc1UVjqSqu8BZdor5s8cGjW2I8BjODt/kWPVdY+u9zj3ms75Q5qaZgnxUad83+eAg==}
engines: {node: '>=22.0.0'}
@@ -2784,6 +2826,112 @@ packages:
'@tanstack/[email protected]':
resolution: {integrity: sha512-8Np/TFELpI0ySuJoVmjvOrQYXH/8sTX0Biv9szhFhY39xOdAAY+smrMxjxOum/ux3eM8MUJQsEJ0/R0UpvC8dw==}
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-M2FPuYND2m+wh5hfW9ZpSdxMPdEJovPBWwoHJmwUpysTYNHaOkVFN419m/K0LIgjb/7KU2vBgsUepJWugQCvAA==}
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-1ryOF3ZhpZ/nemHV5zVwBQBz9jDGKmKPvWPADOhc83ig0P4bMc2iER4NbC6r9sjeIZ6RVQ4g3RZIYvezhcl4TQ==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [darwin]
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-uFsGQAAfuyz1k/yGLmkWfkBlgKAqZfxqlHmLWx81QU27RJWfmbNHCIq8T8w1e+VClleIuZUjpHWfoE4E3DLo3A==}
engines: {node: '>= 10'}
cpu: [x64]
os: [darwin]
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-IaHZn5CdBL21oUmjiVOS1ctw6Ip1O0pjp70FwOWmYz1myWe0SY96ZIj2FYf7pT0m8bI2h/hrs5ZbEXXh44/MkQ==}
engines: {node: '>= 10'}
cpu: [arm]
os: [linux]
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-N41/ukTRVe6XSuUTESuFdGeOW2i7k62tK+6gHK5Kd5/q5RPvvi19GaWAVPPb9u95HSGmTChSolBfzynUsssFaA==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-v277UnT/fB64xAfSroL5N3Km3tLmvATWqJJw/wRI+g6o+HkeD0slyE7gOhNs1MbjE41R7bQOTxMVoL3aomUJmw==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
libc: [musl]
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-qqgNkQ2u1yZHxjhxsZaxUtRDW8dIqIYm33rx/mzwQv0SfY9x1B+iraj8vWeFiXjjSVVhEMepXSOts1TqPzvXNQ==}
engines: {node: '>= 10'}
cpu: [riscv64]
os: [linux]
libc: [glibc]
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-2VRNWl84FOH0m2giiDkO2h0QXlcMJeX+zJDpI5kDIQAx6s+geF3v48F4DXfJez4GS/FdoDGnPnw1C2iYGbQ7bQ==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
libc: [glibc]
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-o9GyhYor/nc7xarmwDE3ka2szuW3uuZzXjHWh64Q8YX5AtSgxdQkFWzrY4O8KiGtVNvFBI14H3Q49Qj5TOIP/A==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
libc: [musl]
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-ld5Ehb598m0VkYyylRPNeCFsBe/km0jxis6KgMpl3IGY6I/i1RwQXO05I1AsXUXO2WC6AvB/Lw4qTf/asiuEiQ==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [win32]
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-12Hxi0XX/H5VFxO/bGgHkFWhml9VMgEOu9CidjeCeTNQ1l6fpUlbiGgSP7CLI3PFtW9/FfbeHieZ+kyWK5H7CA==}
engines: {node: '>= 10'}
cpu: [ia32]
os: [win32]
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-+vDiqBIU5dMISg/wNvX3sF+ZHfgJGJ5T0AcO+EHNXV9GGAG+P5fzodlDXD3QdKCRgZxMoCm5PPvj3BqLNjBthw==}
engines: {node: '>= 10'}
cpu: [x64]
os: [win32]
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-R8xGtMpwyetawSqm9kYOuMmEqkhUbvcUy8n0aNXIxollKBLESUu5f4Fx+64hgASYm1H+jSWq6jCW6zqTnH6hqQ==}
engines: {node: '>= 10'}
hasBin: true
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-CUlb5Hqi2oZbcZf4VUyUH53XWPPdtpw43EUpCza5HWZJwxEoDowFzNUDt1tRUXA8Uq+XPn17Ysfptip33sG4eQ==}
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-u0SKOUHnJ1wqeqXsDFq2+kASCBj9xxbG0g9XZWPy9SOmU4wXtp6b/wiYpm6oH6/5fBTQsLqnLhIvqLBRpgHJlA==}
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-OK1UBXYt+ojcmxMktzzuyonYIFta8CmAASpX+CA+DTGK24KlHjhYI6x2iOJ/TjZF4N7/ACK1oFmEOjIY9IhzOQ==}
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-lCiY0+vs4HvIUSvZrBs8TC3TiCB0MOPRmiUjTq4prW7SlcJE2jdLeT6KBsJrT9Tlplufl7W1pY6SFAO3gCWxDA==}
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-1HnPkb+AmgO29HBazm4uPLKB+r7zzcTBW1d0fyYp1uP+jwtpoiNDGKMMzz58SFp49nOIrxdE3aUJtT57lfO9CQ==}
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-n+nXWeuSeF9wcEsSPmRnBEGrRgOy6jjkSU+UVCOV8YUGKb2erhDOxis7IqRXiRVHhY8XMKks00BJ0OAdkpf6+A==}
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-nCa4fGVaDL/B9ai03VyPOjfAHRHSBz5v6F/ObsB73r/dA3MHHhZtldaDMIc0V/pnUw9ehzr2iEG+XkSEyC0JJA==}
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-9LWPj9yMphRi9czEtUv87XHbl1b6xgd9EXpPrUnq6nG7+nbtoF84d4Kwz9xhAv/Hf30sr58pq7EOlyI936y8qw==}
'@tauri-apps/[email protected]':
resolution: {integrity: sha512-NFYMg+tWOZPJdzE/PpFj2qfqwAWwNS3kXrb1tm1gnBJ9mYzZ4WDRrwy8udzWoAnfGCHLuePNLY1WVCNHnh3eRA==}
'@testing-library/[email protected]':
resolution: {integrity: sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==}
engines: {node: '>=18'}
@@ -3210,6 +3358,10 @@ packages:
typescript:
optional: true
[email protected]:
resolution: {integrity: sha512-ocdWcsi6F8/8f0L/Fsbt3UmPSB+7H5hXR0aRr7Wiu7TXC1Z8vwlwxpeO4+gMgJ8g4TqwM5oTnSid43Jxm2ArwA==}
engines: {node: '>=18.9.0'}
[email protected]:
resolution: {integrity: sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==}
@@ -4747,6 +4899,9 @@ packages:
[email protected]:
resolution: {integrity: sha512-+qfUHz700DWnRutdUsxRRVZ38G1Qr27OetwaMYTdg8hcPxf46U0S1Zf76dQMWRBmusOt2ZCK5kbIaiLkoGO7WQ==}
[email protected]:
resolution: {integrity: sha512-YOo1P+cRjuaoPbTNZprMhr56ruKO4hIDq7kJOum91NqkN+VWY9F+UPAdjZokhzJSsbkeY0nsb1VDLXb2/h3f3w==}
[email protected]:
resolution: {integrity: sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==}
engines: {node: '>=8'}
@@ -6006,6 +6161,10 @@ snapshots:
dependencies:
css-tree: 3.2.1
'@choochmeque/[email protected]':
dependencies:
'@tauri-apps/api': 2.11.1
'@cloudflare/[email protected]': {}
'@cloudflare/[email protected]([email protected])([email protected])':
@@ -7270,6 +7429,91 @@ snapshots:
'@tanstack/[email protected]': {}
'@tauri-apps/[email protected]': {}
'@tauri-apps/[email protected]':
optional: true
'@tauri-apps/[email protected]':
optional: true
'@tauri-apps/[email protected]':
optional: true
'@tauri-apps/[email protected]':
optional: true
'@tauri-apps/[email protected]':
optional: true
'@tauri-apps/[email protected]':
optional: true
'@tauri-apps/[email protected]':
optional: true
'@tauri-apps/[email protected]':
optional: true
'@tauri-apps/[email protected]':
optional: true
'@tauri-apps/[email protected]':
optional: true
'@tauri-apps/[email protected]':
optional: true
'@tauri-apps/[email protected]':
optionalDependencies:
'@tauri-apps/cli-darwin-arm64': 2.11.4
'@tauri-apps/cli-darwin-x64': 2.11.4
'@tauri-apps/cli-linux-arm-gnueabihf': 2.11.4
'@tauri-apps/cli-linux-arm64-gnu': 2.11.4
'@tauri-apps/cli-linux-arm64-musl': 2.11.4
'@tauri-apps/cli-linux-riscv64-gnu': 2.11.4
'@tauri-apps/cli-linux-x64-gnu': 2.11.4
'@tauri-apps/cli-linux-x64-musl': 2.11.4
'@tauri-apps/cli-win32-arm64-msvc': 2.11.4
'@tauri-apps/cli-win32-ia32-msvc': 2.11.4
'@tauri-apps/cli-win32-x64-msvc': 2.11.4
'@tauri-apps/[email protected]':
dependencies:
'@tauri-apps/api': 2.11.1
'@tauri-apps/[email protected]':
dependencies:
'@tauri-apps/api': 2.11.1
'@tauri-apps/[email protected]':
dependencies:
'@tauri-apps/api': 2.11.1
'@tauri-apps/[email protected]':
dependencies:
'@tauri-apps/api': 2.11.1
'@tauri-apps/[email protected]':
dependencies:
'@tauri-apps/api': 2.11.1
'@tauri-apps/[email protected]':
dependencies:
'@tauri-apps/api': 2.11.1
'@tauri-apps/[email protected]':
dependencies:
'@tauri-apps/api': 2.11.1
'@tauri-apps/[email protected]':
dependencies:
'@tauri-apps/api': 2.11.1
'@tauri-apps/[email protected]':
dependencies:
'@tauri-apps/api': 2.11.1
'@testing-library/[email protected]':
dependencies:
'@babel/code-frame': 7.29.7
@@ -7784,6 +8028,8 @@ snapshots:
optionalDependencies:
typescript: 5.9.3
[email protected]: {}
[email protected]:
dependencies:
node-fetch: 2.7.0
@@ -9548,6 +9794,11 @@ snapshots:
[email protected]: {}
[email protected]:
dependencies:
'@tauri-apps/api': 2.11.1
create-web-stream: 1.1.3
[email protected]: {}
[email protected]:
+1
View File
@@ -1,4 +1,5 @@
allowBuilds:
'@sableclient/tauri-plugin-notifications-api': true
'@sentry/cli': true
'@swc/core': true
cloudflared: true
Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

+34
View File
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Copy the CEF runtime (libcef.so + resources) next to a built binary so the app
# is self-contained: works standalone, when launched by the OS via a sable://
# deep link, or from a release package. Pair with the rpath=$ORIGIN that
# build.rs adds for CEF builds.
#
# Usage: scripts/cef-copy-libs.sh [debug|release] [dest-dir]
# dest-dir defaults to src-tauri/target/<profile> (beside the built binary).
set -euo pipefail
PROFILE="${1:-debug}"
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
DEST="${2:-$ROOT/src-tauri/target/$PROFILE}"
CEF_DIR="$(find "$ROOT/src-tauri/target/$PROFILE/build" -type d -name cef_linux_x86_64 2>/dev/null | head -1)"
if [ -z "$CEF_DIR" ]; then
echo "❌ CEF dist not found under target/$PROFILE/build — build with --features cef first." >&2
exit 1
fi
mkdir -p "$DEST"
echo "→ copying CEF runtime from $CEF_DIR to $DEST"
# Libraries (libcef.so + ANGLE/SwiftShader), crashpad handler, then resources.
cp -f "$CEF_DIR"/*.so* "$DEST/" 2>/dev/null || true
cp -f "$CEF_DIR"/chrome_crashpad_handler "$DEST/" 2>/dev/null || true
cp -f "$CEF_DIR"/*.pak "$CEF_DIR"/*.dat "$CEF_DIR"/*.bin "$CEF_DIR"/*.json "$DEST/" 2>/dev/null || true
cp -rf "$CEF_DIR"/locales "$DEST/" 2>/dev/null || true
# The setuid sandbox helper only works when installed as root (deb/rpm). In a
# nosuid context such as an AppImage, drop chrome-sandbox and let Chromium use
# the user-namespace sandbox instead.
if cp -f "$CEF_DIR"/chrome-sandbox "$DEST/" 2>/dev/null; then
chmod 4755 "$DEST/chrome-sandbox" 2>/dev/null || true
fi
echo "✅ done."
+111
View File
@@ -0,0 +1,111 @@
#!/usr/bin/env bash
# Package the Linux CEF build into deb/rpm/AppImage. Used by CI and locally.
# Run after the binary is built (pnpm tauri:cef build).
# Usage: scripts/cef-package.sh [version]
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
VERSION="${1:-$(grep -m1 '^version' src-tauri/Cargo.toml | sed 's/.*"\(.*\)".*/\1/')}"
DEB_VERSION="$VERSION"
RPM_VERSION="$VERSION"
RPM_ITERATION=1
if [[ "$VERSION" == *-* ]]; then
BASE_VERSION="${VERSION%%-*}"
PRERELEASE="${VERSION#*-}"
# Debian sorts ~ before the final version. RPM uses the release field so its
# Version remains hyphen-free and a 0.* prerelease sorts before release 1.
DEB_VERSION="${BASE_VERSION}~${PRERELEASE}"
RPM_VERSION="$BASE_VERSION"
RPM_ITERATION="0.${PRERELEASE}"
fi
STAGE="src-tauri/target/release"
OUT="$STAGE/bundle"
WORK="$STAGE/cef-pkg"
[ -x "$STAGE/sable" ] || {
echo "missing $STAGE/sable; build it first (pnpm tauri:cef build)" >&2
exit 1
}
rm -rf "$WORK"
mkdir -p "$WORK" "$OUT/deb" "$OUT/rpm" "$OUT/appimage"
stage_runtime() {
local dest="$1"
mkdir -p "$dest"
cp "$STAGE/sable" "$dest/"
bash scripts/cef-copy-libs.sh release "$dest"
}
write_desktop() {
cat > "$1" <<'EOF'
[Desktop Entry]
Type=Application
Name=Sable
Comment=A Matrix client
Exec=sable %U
Icon=sable
Terminal=false
Categories=Network;InstantMessaging;Chat;
StartupWMClass=sable
MimeType=x-scheme-handler/sable;x-scheme-handler/moe.sable.app;
EOF
}
if command -v fpm >/dev/null 2>&1; then
PKGROOT="$WORK/pkgroot"
stage_runtime "$PKGROOT/opt/sable"
mkdir -p "$PKGROOT/usr/bin" "$PKGROOT/usr/share/applications" \
"$PKGROOT/usr/share/icons/hicolor/128x128/apps"
cat > "$PKGROOT/usr/bin/sable" <<'EOF'
#!/bin/sh
exec /opt/sable/sable "$@"
EOF
chmod 755 "$PKGROOT/usr/bin/sable"
write_desktop "$PKGROOT/usr/share/applications/sable.desktop"
cp src-tauri/icons/128x128.png "$PKGROOT/usr/share/icons/hicolor/128x128/apps/sable.png"
COMMON=(-s dir -n sable
--description "Sable, a Matrix client"
--url "https://sable.moe" --maintainer "SableClient"
--category net)
# Stable-named deps only; version-suffixed names break install across releases.
DEB_DEPS=(--depends libwebkit2gtk-4.1-0 --depends libgtk-3-0
--depends libnss3 --depends libnspr4 --depends libgbm1
--depends libdrm2 --depends libxkbcommon0 --depends xdg-utils)
(cd "$OUT/deb" && fpm "${COMMON[@]}" -v "$DEB_VERSION" --iteration 1 \
-t deb -a amd64 "${DEB_DEPS[@]}" -C "$PKGROOT" .)
RPM_DEPS=(--depends webkit2gtk4.1 --depends gtk3 --depends nss
--depends nspr --depends mesa-libgbm --depends libdrm
--depends libxkbcommon --depends xdg-utils)
(cd "$OUT/rpm" && fpm "${COMMON[@]}" -v "$RPM_VERSION" --iteration "$RPM_ITERATION" \
-t rpm -a x86_64 "${RPM_DEPS[@]}" -C "$PKGROOT" .)
else
echo "fpm not found; skipping deb/rpm (building AppImage only)"
fi
APPDIR="$WORK/Sable.AppDir"
stage_runtime "$APPDIR/usr/bin"
# nosuid AppImage mount: drop setuid chrome-sandbox, use the namespace sandbox.
rm -f "$APPDIR/usr/bin/chrome-sandbox"
write_desktop "$APPDIR/sable.desktop"
cp src-tauri/icons/128x128.png "$APPDIR/sable.png"
cat > "$APPDIR/AppRun" <<'EOF'
#!/bin/sh
HERE="$(dirname "$(readlink -f "$0")")"
exec "$HERE/usr/bin/sable" "$@"
EOF
chmod 755 "$APPDIR/AppRun"
APPIMAGETOOL_SHA256=ed4ce84f0d9caff66f50bcca6ff6f35aae54ce8135408b3fa33abfc3cb384eb0
APPIMAGETOOL="$WORK/appimagetool"
curl -fsSL -o "$APPIMAGETOOL" \
https://github.com/AppImage/appimagetool/releases/download/1.9.1/appimagetool-x86_64.AppImage
echo "${APPIMAGETOOL_SHA256} $APPIMAGETOOL" | sha256sum -c -
chmod +x "$APPIMAGETOOL"
APPIMAGE_EXTRACT_AND_RUN=1 ARCH=x86_64 "$APPIMAGETOOL" "$APPDIR" \
"$OUT/appimage/Sable_${VERSION}_amd64.AppImage"
echo "Packages in: $OUT"
+163
View File
@@ -0,0 +1,163 @@
#!/usr/bin/env node
/* eslint-disable no-console */
import fs from 'node:fs';
import path from 'node:path';
import process from 'node:process';
import { createTextHelpers } from './utils/console-style.js';
const ANDROID_ICONS = [
'mipmap-hdpi',
'mipmap-mdpi',
'mipmap-xhdpi',
'mipmap-xxhdpi',
'mipmap-xxxhdpi',
]
.flatMap((dir) => [
`${dir}/ic_launcher.png`,
`${dir}/ic_launcher_round.png`,
`${dir}/ic_launcher_foreground.png`,
`${dir}/ic_notification.png`,
])
.concat(['mipmap-anydpi-v26/ic_launcher.xml', 'values/ic_launcher_background.xml'])
.concat(['drawable/ic_notification.xml', 'drawable/notification_icon.xml']);
const IOS_ICONS = [
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
];
function parseArgs(argv) {
let write = false;
let force = false;
argv.forEach((arg) => {
if (arg === '--write') write = true;
if (arg === '--force') force = true;
if (arg === '--help' || arg === '-h') {
console.log(
[
'Usage: node scripts/symlink-icons.js [--write] [--force]',
'',
'Default mode is dry-run.',
'--write Apply changes (create symlinks).',
'--force Overwrite existing symlinks.',
].join('\n')
);
process.exit(0);
}
});
return { write, force };
}
function createSymlink(src, dest, write, force, helpers) {
const { dim, red, green } = helpers;
if (!fs.existsSync(src)) {
console.log(` ${red('!')} ${dim('source missing, skipping:')} ${src}`);
return false;
}
const exists = fs.existsSync(dest);
if (exists && !force) {
console.log(
` ${dim('~')} ${dim(path.relative(process.cwd(), dest))} ${dim('(exists, skipping)')}`
);
return false;
}
if (write) {
fs.mkdirSync(path.dirname(dest), { recursive: true });
try {
fs.unlinkSync(dest);
} catch {
// dest does not exist — nothing to remove
}
const rel = path.relative(path.dirname(dest), src).split(path.sep).join('/');
fs.symlinkSync(rel, dest);
}
console.log(` ${green('+')} ${dim(path.relative(process.cwd(), dest))}`);
return true;
}
function processGroup(label, srcDir, destDir, files, write, force, helpers) {
const { dim, red } = helpers;
if (!fs.existsSync(destDir)) {
console.log(`\n${label}: ${red('destination not found')}, skipping.\n ${dim(destDir)}`);
return;
}
console.log(`\n${label}`);
const results = files.map((file) => {
try {
return createSymlink(
path.join(srcDir, file),
path.join(destDir, file),
write,
force,
helpers
);
} catch (err) {
console.log(` ${red('-')} ${file}: ${err.message}`);
return false;
}
});
const ok = results.filter(Boolean).length;
const verb = write ? 'created' : 'would create';
console.log(` ${dim(`→ ${ok}/${files.length} symlinks ${verb}.`)}`);
}
function main() {
const ROOT = process.cwd();
const { write, force } = parseArgs(process.argv.slice(2));
const helpers = createTextHelpers();
processGroup(
'Android',
path.join(ROOT, 'src-tauri', 'icons', 'android'),
path.join(ROOT, 'src-tauri', 'gen', 'android', 'app', 'src', 'main', 'res'),
ANDROID_ICONS,
write,
force,
helpers
);
processGroup(
'iOS',
path.join(ROOT, 'src-tauri', 'icons', 'ios'),
path.join(ROOT, 'src-tauri', 'gen', 'apple', 'Assets.xcassets', 'AppIcon.appiconset'),
IOS_ICONS,
write,
force,
helpers
);
const mode = write ? 'Applied' : 'Dry run';
console.log(`\n${mode}.`);
if (!write) console.log('Re-run with --write to apply changes.');
}
main();
+80
View File
@@ -0,0 +1,80 @@
#!/usr/bin/env node
/**
* Script to run tauri commands for a given runtime (wry or cef) with prepended CLI args.
*
* Usage:
* script/tauri <runtime> <command> [prepended-args...]
*
* Examples:
* script/tauri cef dev --verbose
* script/tauri cef dev -- --verbose
* Both will run: cargo tauri dev --features cef -- --verbose --no-default-features
*/
import { spawn } from 'child_process';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
import process from 'node:process';
import { PrefixedLogger, createTextHelpers } from './utils/console-style.js';
const logger = new PrefixedLogger('[tauri]');
const { dim } = createTextHelpers({ useColor: logger.useColor });
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const cmdlineArgs = process.argv.slice(2);
if (cmdlineArgs.length < 2) {
logger.error('Usage: node scripts/tauri <runtime> <command> [prepended-args...]');
logger.error(` ${dim('command:')} dev or build`);
logger.error(` ${dim('runtime:')} wry or cef`);
logger.error(
` ${dim('prepended-args:')} Arguments to prepend to the cargo args (-- separator is optional)`
);
process.exit(1);
}
const [runtime, cmd, ...tauriArgs] = cmdlineArgs;
if (!['wry', 'cef'].includes(runtime)) {
logger.error(`Invalid runtime: ${runtime}. Must be 'wry' or 'cef'`);
process.exit(1);
}
if (!['dev', 'build'].includes(cmd)) {
logger.error(`Invalid command: ${cmd}. Must be 'dev' or 'build'`);
process.exit(1);
}
tauriArgs.unshift('--features', runtime);
// tauri's Linux bundler can't package CEF; scripts/cef-package.sh does that.
if (runtime === 'cef' && cmd === 'build' && !tauriArgs.includes('--no-bundle')) {
tauriArgs.unshift('--no-bundle');
}
if (!tauriArgs.includes('--')) {
tauriArgs.push('--');
}
tauriArgs.push('--no-default-features');
const args = ['tauri', cmd, ...tauriArgs];
const command = 'cargo';
logger.info(`${dim('Running:')} ${command} ${args.join(' ')}`);
// Spawn the tauri process
const proc = spawn(command, args, {
stdio: 'inherit',
shell: false,
cwd: join(__dirname, '..'),
});
proc.on('error', (error) => {
logger.error(`Failed to start process: ${error.message}`);
process.exit(1);
});
proc.on('exit', (code) => {
process.exit(code ?? 0);
});
+4
View File
@@ -0,0 +1,4 @@
# Generated by Cargo
# will have compiled files and executables
/target/
/gen/schemas
+9362
View File
File diff suppressed because it is too large. Load diff
+139
View File
@@ -0,0 +1,139 @@
[package]
name = "sable"
version = "0.1.0"
description = "Yet another matrix client but better"
authors = ["you"]
license = ""
repository = ""
edition = "2021"
rust-version = "1.88.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "app_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2.6.3", features = [] }
tauri-typegen = "0.5"
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
log = "0.4"
tokio = { version = "1", features = ["time", "sync"] }
ts-rs = "12.0.0"
sha2 = "0.10"
percent-encoding = "2"
tauri = { version = "2.11.5", default-features = false, features = [
"tray-icon",
"dynamic-acl",
"compression",
"x11",
"common-controls-v6",
"dbus",
"image-png",
] }
tauri-plugin-log = "2.9.0"
tauri-plugin-opener = "2.5.4"
tauri-plugin-os = "2"
tauri-plugin-deep-link = "2.4.9"
tauri-plugin-http = "2.5.9"
tauri-plugin-store = "2.4.3"
tauri-plugin-clipboard-manager = "2.3.2"
# Debug-only in practice: only initialized under #[cfg(debug_assertions)] in
# lib.rs, so the release build never calls into it.
tauri-plugin-devtools = "2.0.0"
[target.'cfg(target_os = "windows")'.dependencies]
enigo = "0.5.0"
windows = { version = "0.61", features = [
"Win32_Foundation",
"Win32_UI_WindowsAndMessaging",
"Win32_System_Threading",
"Win32_System_ProcessStatus",
] }
[target.'cfg(any(target_os = "macos", windows, target_os = "linux"))'.dependencies]
tauri-plugin-single-instance = { version = "2.4.3", features = ["deep-link"] }
[target.'cfg(any(windows, target_os = "linux"))'.dependencies]
tauri-plugin-notifications = { git = "https://github.com/SableClient/tauri-plugin-notifications.git", rev = "95c1574cf4c2be0f3e7c1d7b8102b2f7b59bcb68" }
# default-features = false drops notify-rust so macOS uses the native
# UNUserNotificationCenter backend (needs a signed .app to deliver).
[target.'cfg(target_os = "macos")'.dependencies]
tauri-plugin-notifications = { git = "https://github.com/SableClient/tauri-plugin-notifications.git", rev = "95c1574cf4c2be0f3e7c1d7b8102b2f7b59bcb68", default-features = false }
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
tauri-plugin-updater = "2"
tauri-plugin-process = "2"
tauri-plugin-dialog = "2"
tauri-plugin-window-state = "2.4.1"
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies]
webkit2gtk = "2.0"
gtk = "0.18"
# CEF (Chromium) runtime — Linux only; other platforms use wry.
# Repackage of tauri's unreleased feat/cef branch. Switch to the official
# tauri-runtime-cef once it lands on crates.io.
[target.'cfg(target_os = "linux")'.dependencies]
tauri-runtime-cef = { git = "https://github.com/byeongsu-hong/tauri-runtime-cef", rev = "c215d6e52dd507956d9b8cc868906d690dc477c2", optional = true }
cef = { version = "=148.0.0", optional = true }
[target.'cfg(any(target_os = "android", target_os = "ios"))'.dependencies]
tauri-plugin-notifications = { git = "https://github.com/SableClient/tauri-plugin-notifications.git", rev = "95c1574cf4c2be0f3e7c1d7b8102b2f7b59bcb68", features = [
"push-notifications",
] }
tauri-plugin-edge-to-edge = { git = "https://github.com/SableClient/tauri-plugin-edge-to-edge.git", rev = "33c6116c27be28c06df5a9d02231ecc5fdeb93c5" }
[target.'cfg(target_os = "ios")'.dependencies]
objc2 = "0.6"
[target.'cfg(target_os = "android")'.dependencies]
tauri-plugin-android-fs = { version = "=28.4.0", features = ["legacy-storage-permission"] }
jni = "0.21"
[features]
default = ["wry"]
custom-protocol = ["tauri/custom-protocol"]
wry = ["tauri/wry"]
# CEF (Chromium) runtime. Build with --no-default-features --features cef.
cef = ["dep:tauri-runtime-cef", "dep:cef"]
[patch.crates-io]
tauri-typegen = { git = "https://github.com/SableClient/tauri-typegen", branch = "fix/nondeterministic-generation-cache" }
# To test unreleased tauri features
# tauri = { git = "https://github.com/tauri-apps/tauri", branch = "dev" }
# tauri-build = { git = "https://github.com/tauri-apps/tauri", branch = "dev" }
# tauri-plugin = { git = "https://github.com/tauri-apps/tauri", branch = "dev" }
# tauri-utils = { git = "https://github.com/tauri-apps/tauri", branch = "dev" }
# tauri-macros = { git = "https://github.com/tauri-apps/tauri", branch = "dev" }
# tauri-runtime = { git = "https://github.com/tauri-apps/tauri", branch = "dev" }
# tauri-runtime-wry = { git = "https://github.com/tauri-apps/tauri", branch = "dev" }
# To test the CEF runtime path, switch this back to `cef = ["tauri/cef"]`
# and uncomment the patch scaffold below.
# cef = ["tauri/cef"]
#
# [patch.crates-io]
# tauri = { git = "https://github.com/tauri-apps/tauri", branch = "feat/cef" }
# tauri-build = { git = "https://github.com/tauri-apps/tauri", branch = "feat/cef" }
# tauri-plugin = { git = "https://github.com/tauri-apps/tauri", branch = "feat/cef" }
# tauri-utils = { git = "https://github.com/tauri-apps/tauri", branch = "feat/cef" }
# tauri-macros = { git = "https://github.com/tauri-apps/tauri", branch = "feat/cef" }
# tauri-runtime = { git = "https://github.com/tauri-apps/tauri", branch = "feat/cef" }
# tauri-runtime-wry = { git = "https://github.com/tauri-apps/tauri", branch = "feat/cef" }
# tauri-plugin-log = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "feat/cef" }
# tauri-plugin-opener = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "feat/cef" }
# tauri-plugin-os = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "feat/cef" }
# tauri-plugin-deep-link = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "feat/cef" }
# tauri-plugin-http = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "feat/cef" }
# tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "feat/cef" }
# tauri-plugin-single-instance = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "feat/cef" }
# tauri-plugin-window-state = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "feat/cef" }
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>Sable</string>
<key>CFBundleName</key>
<string>Sable</string>
<key>NSCameraUsageDescription</key>
<string>Sable needs camera access for video calls.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Sable needs microphone access for voice and video calls.</string>
</dict>
</plist>
+20
View File
@@ -0,0 +1,20 @@
fn main() {
println!("cargo:rustc-env=TS_RS_EXPORT_DIR=../src/app/generated/tauri");
// Find libcef.so next to the binary (CEF ships it there).
if std::env::var_os("CARGO_FEATURE_CEF").is_some()
&& std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("linux")
{
println!("cargo:rustc-link-arg-bins=-Wl,-rpath,$ORIGIN");
}
// The notifications plugin links the Swift runtime via @rpath.
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("macos") {
println!("cargo:rustc-link-arg-bins=-Wl,-rpath,/usr/lib/swift");
}
tauri_typegen::BuildSystem::generate_at_build_time()
.expect("Failed to generate TypeScript bindings");
tauri_build::build()
}
+11
View File
@@ -0,0 +1,11 @@
{
"$schema": "../gen/schemas/mobile-schema.json",
"identifier": "android-capability",
"platforms": ["android"],
"windows": ["main"],
"permissions": [
"android-fs:allow-create-new-public-file",
"android-fs:allow-write-file",
"android-fs:allow-set-public-file-pending"
]
}
+45
View File
@@ -0,0 +1,45 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "enables the default permissions",
"windows": ["*"],
"permissions": [
"core:default",
"core:window:allow-close",
"core:window:allow-minimize",
"core:window:allow-maximize",
"core:window:allow-set-focus",
"core:window:allow-show",
"core:window:allow-is-maximized",
"core:window:allow-toggle-maximize",
"core:window:allow-start-dragging",
"deep-link:default",
"os:default",
"os:allow-platform",
"os:allow-version",
"os:allow-os-type",
"os:allow-family",
"os:allow-arch",
"os:allow-exe-extension",
"os:allow-locale",
"os:allow-hostname",
"opener:default",
"opener:allow-default-urls",
"clipboard-manager:allow-write-text",
"clipboard-manager:allow-read-text",
"clipboard-manager:allow-write-image",
{
"identifier": "http:default",
"allow": [{ "url": "https://*" }]
},
{
"identifier": "opener:allow-open-url",
"allow": [
{
"url": "https://*",
"app": "inAppBrowser"
}
]
}
]
}
+15
View File
@@ -0,0 +1,15 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "desktop-capability",
"platforms": ["macOS", "windows", "linux"],
"windows": ["main"],
"permissions": [
"core:window:allow-set-badge-count",
"window-state:default",
"store:default",
"notifications:default",
"updater:default",
"process:default",
"dialog:default"
]
}
+13
View File
@@ -0,0 +1,13 @@
{
"$schema": "../gen/schemas/mobile-schema.json",
"identifier": "mobile-capability",
"platforms": ["android", "iOS"],
"windows": ["main"],
"permissions": [
"core:default",
"core:window:allow-set-badge-count",
"deep-link:default",
"edge-to-edge:default",
"notifications:default"
]
}
+12
View File
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
+21
View File
@@ -0,0 +1,21 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
.kotlin/
build
/captures
.externalNativeBuild
.cxx
local.properties
key.properties
keystore.properties
/.tauri
/tauri.settings.gradle
+6
View File
@@ -0,0 +1,6 @@
/src/main/**/generated
/src/main/jniLibs/**/*.so
/src/main/assets/tauri.conf.json
/tauri.build.gradle.kts
/proguard-tauri.pro
/tauri.properties
@@ -0,0 +1,92 @@
import java.util.Properties
import java.io.FileInputStream
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("rust")
}
val tauriProperties = Properties().apply {
val propFile = file("tauri.properties")
if (propFile.exists()) {
propFile.inputStream().use { load(it) }
}
}
android {
compileSdk = 36
namespace = "moe.sable.client"
defaultConfig {
manifestPlaceholders["usesCleartextTraffic"] = "false"
applicationId = "moe.sable.client"
minSdk = 24
targetSdk = 36
versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt()
versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0")
}
signingConfigs {
create("release") {
val keystorePropertiesFile = rootProject.file("keystore.properties")
if (keystorePropertiesFile.exists()) {
val keystoreProperties = Properties()
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["password"] as String
storeFile = file(keystoreProperties["storeFile"] as String)
storePassword = keystoreProperties["password"] as String
}
}
}
buildTypes {
getByName("debug") {
manifestPlaceholders["usesCleartextTraffic"] = "true"
isDebuggable = true
isJniDebuggable = true
isMinifyEnabled = false
packaging { jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so")
jniLibs.keepDebugSymbols.add("*/armeabi-v7a/*.so")
jniLibs.keepDebugSymbols.add("*/x86/*.so")
jniLibs.keepDebugSymbols.add("*/x86_64/*.so")
}
}
getByName("release") {
signingConfig = signingConfigs.getByName("release")
isMinifyEnabled = true
proguardFiles(
*fileTree(".") { include("**/*.pro") }
.plus(getDefaultProguardFile("proguard-android-optimize.txt"))
.toList().toTypedArray()
)
}
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
buildConfig = true
}
}
rust {
rootDirRel = "../../../"
}
dependencies {
implementation("androidx.webkit:webkit:1.14.0")
implementation("androidx.appcompat:appcompat:1.7.1")
implementation("androidx.activity:activity-ktx:1.10.1")
implementation("com.google.android.material:material:1.12.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.4")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
}
apply(from = "tauri.build.gradle.kts")
// Native FCM push (Sygnal): applies only once google-services.json is added to this
// directory, so builds without Firebase configured still succeed.
if (file("google-services.json").exists()) {
apply(plugin = "com.google.gms.google-services")
}
+56
View File
@@ -0,0 +1,56 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
# Keep Android bridge symbols used by Wry/Tauri JNI on release builds.
# Without these, R8 can rename/remove methods like WryActivity.getId(),
# which tao resolves by method name via JNI.
-keep class moe.sable.client.* {
native <methods>;
}
-keep class moe.sable.client.WryActivity {
public <init>(...);
void setWebView(moe.sable.client.RustWebView);
java.lang.Class getAppClass(...);
java.lang.String getVersion();
int startActivity(...);
int getId();
}
-keep class moe.sable.client.Ipc {
public <init>(...);
@android.webkit.JavascriptInterface public <methods>;
}
-keep class moe.sable.client.RustWebView {
public <init>(...);
void loadUrlMainThread(...);
void loadHTMLMainThread(...);
void evalScript(...);
}
-keep class moe.sable.client.RustWebChromeClient,moe.sable.client.RustWebViewClient {
public <init>(...);
}
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<!-- WebRTC calls (camera/mic) -->
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.microphone" android:required="false" />
<!-- Location sharing (navigator.geolocation) -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<!-- AndroidTV support -->
<uses-feature android:name="android.software.leanback" android:required="false" />
<application
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:theme="@style/Theme.sable"
android:usesCleartextTraffic="${usesCleartextTraffic}">
<receiver
android:name="app.tauri.notification.TauriUnifiedPushMessagingService"
tools:node="remove" />
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
android:launchMode="singleTask"
android:label="@string/main_activity_title"
android:name="moe.sable.client.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<!-- AndroidTV support -->
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
<!-- DEEP LINK PLUGIN. AUTO-GENERATED. DO NOT REMOVE. -->
<intent-filter >
<action android:name="android.intent.action.VIEW" />
<!-- ChromeOS ARC++ uses a different action for deep links -->
<action android:name="org.chromium.arc.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="sable" />
<data android:scheme="moe.sable.app" />
</intent-filter>
<!-- DEEP LINK PLUGIN. AUTO-GENERATED. DO NOT REMOVE. -->
</activity>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
</application>
<!-- ANDROID FS PLUGIN. AUTO-GENERATED. DO NOT REMOVE. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<!-- ANDROID FS PLUGIN. AUTO-GENERATED. DO NOT REMOVE. -->
</manifest>
@@ -0,0 +1,55 @@
package moe.sable.client
import android.graphics.Color
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.core.view.WindowCompat
class MainActivity : TauriActivity() {
private external fun nativeInitStatusBar()
override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)
instance = this
runCatching { nativeInitStatusBar() }
}
override fun onDestroy() {
if (instance === this) instance = null
super.onDestroy()
}
companion object {
private var instance: MainActivity? = null
// Bars stay transparent (edge-to-edge plugin) so the webview strips supply the color
// on every version; these only adapt icon contrast. setStatusBarColor/setNavigationBarColor
// are no-ops under enforced edge-to-edge on Android 15+, so we avoid them.
@JvmStatic
fun setStatusBarColorNative(color: Int) {
val activity = instance ?: return
activity.runOnUiThread {
val window = activity.window
WindowCompat.getInsetsController(window, window.decorView).isAppearanceLightStatusBars =
isLight(color)
}
}
@JvmStatic
fun setNavigationBarColorNative(color: Int) {
val activity = instance ?: return
activity.runOnUiThread {
val window = activity.window
WindowCompat.getInsetsController(window, window.decorView).isAppearanceLightNavigationBars =
isLight(color)
}
}
private fun isLight(color: Int): Boolean {
val luminance =
(0.299 * Color.red(color) + 0.587 * Color.green(color) + 0.114 * Color.blue(color)) / 255.0
return luminance > 0.5
}
}
}
@@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
@@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
@@ -0,0 +1 @@
../../../../../../../icons/android/drawable/ic_notification.xml
@@ -0,0 +1 @@
../../../../../../../icons/android/drawable/notification_icon.xml
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1 @@
../../../../../../../icons/android/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1 @@
../../../../../../../icons/android/mipmap-hdpi/ic_launcher.png
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1 @@
../../../../../../../icons/android/mipmap-hdpi/ic_launcher_foreground.png
@@ -0,0 +1 @@
../../../../../../../icons/android/mipmap-hdpi/ic_launcher_round.png
Binary file not shown.

After

Width:  |  Height:  |  Size: 745 B

@@ -0,0 +1 @@
../../../../../../../icons/android/mipmap-mdpi/ic_launcher.png
Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

@@ -0,0 +1 @@
../../../../../../../icons/android/mipmap-mdpi/ic_launcher_foreground.png
@@ -0,0 +1 @@
../../../../../../../icons/android/mipmap-mdpi/ic_launcher_round.png
Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

@@ -0,0 +1 @@
../../../../../../../icons/android/mipmap-xhdpi/ic_launcher.png
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1 @@
../../../../../../../icons/android/mipmap-xhdpi/ic_launcher_foreground.png
@@ -0,0 +1 @@
../../../../../../../icons/android/mipmap-xhdpi/ic_launcher_round.png
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1 @@
../../../../../../../icons/android/mipmap-xxhdpi/ic_launcher.png
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

@@ -0,0 +1 @@
../../../../../../../icons/android/mipmap-xxhdpi/ic_launcher_foreground.png
@@ -0,0 +1 @@
../../../../../../../icons/android/mipmap-xxhdpi/ic_launcher_round.png
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

@@ -0,0 +1 @@
../../../../../../../icons/android/mipmap-xxxhdpi/ic_launcher.png
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

@@ -0,0 +1 @@
../../../../../../../icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png
@@ -0,0 +1 @@
../../../../../../../icons/android/mipmap-xxxhdpi/ic_launcher_round.png
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

@@ -0,0 +1,7 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.sable" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="android:windowSplashScreenBackground">#1A1C28</item>
<item name="android:windowSplashScreenAnimatedIcon">@mipmap/ic_launcher</item>
</style>
</resources>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>
@@ -0,0 +1 @@
../../../../../../../icons/android/values/ic_launcher_background.xml
@@ -0,0 +1,4 @@
<resources>
<string name="app_name">Sable</string>
<string name="main_activity_title">Sable</string>
</resources>
@@ -0,0 +1,7 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.sable" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="android:windowSplashScreenBackground">#1A1C28</item>
<item name="android:windowSplashScreenAnimatedIcon">@mipmap/ic_launcher</item>
</style>
</resources>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="my_images" path="." />
<cache-path name="my_cache_images" path="." />
</paths>
+23
View File
@@ -0,0 +1,23 @@
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:8.11.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.2.0")
classpath("com.google.gms:google-services:4.5.0")
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
tasks.register("clean").configure {
delete("build")
}
@@ -0,0 +1,23 @@
plugins {
`kotlin-dsl`
}
gradlePlugin {
plugins {
create("pluginsForCoolKids") {
id = "rust"
implementationClass = "RustPlugin"
}
}
}
repositories {
google()
mavenCentral()
}
dependencies {
compileOnly(gradleApi())
implementation("com.android.tools.build:gradle:8.11.0")
}
@@ -0,0 +1,68 @@
import java.io.File
import org.apache.tools.ant.taskdefs.condition.Os
import org.gradle.api.DefaultTask
import org.gradle.api.GradleException
import org.gradle.api.logging.LogLevel
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.TaskAction
open class BuildTask : DefaultTask() {
@Input
var rootDirRel: String? = null
@Input
var target: String? = null
@Input
var release: Boolean? = null
@TaskAction
fun assemble() {
val executable = """pnpm""";
try {
runTauriCli(executable)
} catch (e: Exception) {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
// Try different Windows-specific extensions
val fallbacks = listOf(
"$executable.exe",
"$executable.cmd",
"$executable.bat",
)
var lastException: Exception = e
for (fallback in fallbacks) {
try {
runTauriCli(fallback)
return
} catch (fallbackException: Exception) {
lastException = fallbackException
}
}
throw lastException
} else {
throw e;
}
}
}
fun runTauriCli(executable: String) {
val rootDirRel = rootDirRel ?: throw GradleException("rootDirRel cannot be null")
val target = target ?: throw GradleException("target cannot be null")
val release = release ?: throw GradleException("release cannot be null")
val args = listOf("tauri", "android", "android-studio-script");
project.exec {
workingDir(File(project.projectDir, rootDirRel))
executable(executable)
args(args)
if (project.logger.isEnabled(LogLevel.DEBUG)) {
args("-vv")
} else if (project.logger.isEnabled(LogLevel.INFO)) {
args("-v")
}
if (release) {
args("--release")
}
args(listOf("--target", target))
}.assertNormalExitValue()
}
}
@@ -0,0 +1,85 @@
import com.android.build.api.dsl.ApplicationExtension
import org.gradle.api.DefaultTask
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.get
const val TASK_GROUP = "rust"
open class Config {
lateinit var rootDirRel: String
}
open class RustPlugin : Plugin<Project> {
private lateinit var config: Config
override fun apply(project: Project) = with(project) {
config = extensions.create("rust", Config::class.java)
val defaultAbiList = listOf("arm64-v8a", "armeabi-v7a", "x86", "x86_64");
val abiList = (findProperty("abiList") as? String)?.split(',') ?: defaultAbiList
val defaultArchList = listOf("arm64", "arm", "x86", "x86_64");
val archList = (findProperty("archList") as? String)?.split(',') ?: defaultArchList
val targetsList = (findProperty("targetList") as? String)?.split(',') ?: listOf("aarch64", "armv7", "i686", "x86_64")
extensions.configure<ApplicationExtension> {
@Suppress("UnstableApiUsage")
flavorDimensions.add("abi")
productFlavors {
create("universal") {
dimension = "abi"
ndk {
abiFilters += abiList
}
}
defaultArchList.forEachIndexed { index, arch ->
create(arch) {
dimension = "abi"
ndk {
abiFilters.add(defaultAbiList[index])
}
}
}
}
}
afterEvaluate {
for (profile in listOf("debug", "release")) {
val profileCapitalized = profile.replaceFirstChar { it.uppercase() }
val buildTask = tasks.maybeCreate(
"rustBuildUniversal$profileCapitalized",
DefaultTask::class.java
).apply {
group = TASK_GROUP
description = "Build dynamic library in $profile mode for all targets"
}
tasks["mergeUniversal${profileCapitalized}JniLibFolders"].dependsOn(buildTask)
for (targetPair in targetsList.withIndex()) {
val targetName = targetPair.value
val targetArch = archList[targetPair.index]
val targetArchCapitalized = targetArch.replaceFirstChar { it.uppercase() }
val targetBuildTask = project.tasks.maybeCreate(
"rustBuild$targetArchCapitalized$profileCapitalized",
BuildTask::class.java
).apply {
group = TASK_GROUP
description = "Build dynamic library in $profile mode for $targetArch"
rootDirRel = config.rootDirRel
target = targetName
release = profile == "release"
}
buildTask.dependsOn(targetBuildTask)
tasks["merge$targetArchCapitalized${profileCapitalized}JniLibFolders"].dependsOn(
targetBuildTask
)
}
}
}
}
}
+24
View File
@@ -0,0 +1,24 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonFinalResIds=false
Binary file not shown.
@@ -0,0 +1,6 @@
#Tue May 10 19:22:52 CST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
+185
View File
@@ -0,0 +1,185 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"
+89
View File
@@ -0,0 +1,89 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
+3
View File
@@ -0,0 +1,3 @@
include ':app'
apply from: 'tauri.settings.gradle'
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Loaded 100 of 356 files, more files were not shown because too many files have changed in this diff. Show more