Compare commits

..
177 Commits
Author SHA1 Message Date
waozixyz 9466bf02ed fix no of assets 2026-06-17 16:33:01 -03:00
waozixyz acbd43bc65 bug fixes 2026-06-17 16:30:25 -03:00
waozixyz 06d79002e1 fix appimage 2026-06-17 15:36:27 -03:00
waozixyz 2db5045efb fix merge import 2026-06-17 13:47:05 -03:00
waozixyz 0f6f40cb0a fix orientation change 2026-06-17 13:37:38 -03:00
waozixyz b9ec755e1f bug fixes 2026-06-17 13:21:00 -03:00
waozixyz fc75410dea improve weelky view and dropdowns 2026-06-17 11:46:23 -03:00
waozixyz 4083893ddc fix improt issues and add packaging for appimages 2026-06-17 11:18:21 -03:00
waozixyz 07a2315353 fix font issues mobile 2026-06-17 09:43:41 -03:00
waozixyz 195eef42a9 fix clipping 2026-06-17 09:04:07 -03:00
waozixyz e22ae0f8aa bug fixes, otf chop for 8px 2026-06-17 01:19:52 -03:00
waozixyz 460ac28e0a improve settings page 2026-06-16 23:10:41 -03:00
waozixyz 40b0121c81 improve settings page 2026-06-16 23:04:59 -03:00
waozixyz f49dbc2015 refactor code base 2026-06-16 22:46:15 -03:00
waozixyz bab61346be better tracker managemnt and practice screenr 2026-06-16 22:27:04 -03:00
waozixyz 2c9348c52a refactor tracker and themes 2026-06-16 16:18:45 -03:00
waozixyz 209be9e78b refactor to habits screen 2026-06-16 15:17:06 -03:00
waozixyz 28a5d8fa51 refactor 2026-06-16 11:01:22 -03:00
waozixyz d356cc078f cleaner icon loading 2026-06-16 00:35:29 -03:00
waozixyz e31ff91168 more cleanup 2026-06-14 14:46:27 -03:00
waozixyz 7728a6327e unify icon system 2026-06-14 14:35:54 -03:00
waozixyz 945943dceb simplify play butotn 2026-06-14 12:45:01 -03:00
waozixyz e567ba21c2 cleanup and fixes 2026-06-14 11:40:56 -03:00
waozixyz 0ddb4ddfb8 cleanup 2026-06-14 01:05:09 -03:00
waozixyz 27e1902958 cleanup theme usage 2026-06-14 00:49:25 -03:00
waozixyz 2e83575485 cleanup and add tests 2026-06-13 23:31:30 -03:00
waozixyz bf26a1056f add changelog 2026-06-13 21:47:21 -03:00
waozixyz 3b44d1bc1a improve file browser 2026-06-13 21:43:41 -03:00
waozixyz cafe058420 better data management 2026-06-13 21:11:44 -03:00
waozixyz b0a031136b merge with flint 2026-06-13 21:11:30 -03:00
waozixyz 06d403ed63 add round label 2026-06-12 23:01:59 -03:00
waozixyz 1d0009958d Update Flint web dist packaging 2026-06-12 21:49:08 -03:00
waozixyz 2c0ac20ce3 use latset flint 2026-06-12 11:33:50 -03:00
waozixyz 9181c91a3a fix workflow 2026-06-12 10:34:36 -03:00
waozixyz 63e790f96a fix make 2026-06-12 10:25:56 -03:00
waozixyz aef5f5441b update version 2026-06-12 09:58:40 -03:00
waozixyz 827d5e350b cleanup 2026-06-12 09:56:44 -03:00
waozixyz f64195ec1d clean flint version 2026-06-12 00:42:22 -03:00
waozixyz 60b699f28b flint cli fully working 2026-06-12 00:11:22 -03:00
waozixyz 85b9d3daf5 use flint for cross building 2026-06-12 00:07:56 -03:00
waozixyz 89bb5a63ca clean windows build 2026-06-11 23:45:54 -03:00
waozixyz 94c004b923 Embed runtime assets in desktop builds 2026-06-11 22:20:24 -03:00
waozixyz 9822180288 upload all versions on itch 2026-06-11 16:48:08 -03:00
waozixyz 0976fb82bc update version 2026-06-11 13:06:54 -03:00
waozixyz 8353f49f27 bug fixes and improve setting management 2026-06-11 13:03:51 -03:00
waozixyz 07b46d7bf0 fix versioning 2026-06-10 08:41:39 -03:00
waozixyz 99375c9c4b fix history page 2026-06-10 08:38:18 -03:00
waozixyz 1381311e02 simplify scripts 2026-06-10 00:22:12 -03:00
waozixyz 595f239015 bug fix 2026-06-10 00:18:25 -03:00
waozixyz d43a8de800 fix action 2026-06-09 23:57:51 -03:00
waozixyz 894f8f7da8 Fix web file dialog guard 2026-06-09 23:51:25 -03:00
waozixyz 629aa739f6 Fix font glyphs and web builds 2026-06-09 23:48:13 -03:00
waozixyz 323be33ec4 add submodule 2026-06-09 23:33:40 -03:00
waozixyz 64480683d6 bug fixes and locale fixes 2026-06-09 23:30:10 -03:00
waozixyz 2a4d93f3b6 rm icons 2026-06-09 23:14:59 -03:00
waozixyz 61f5a75634 improve icon setup 2026-06-09 23:14:41 -03:00
waozixyz 085ed5393d import working on linux 2026-06-09 21:55:06 -03:00
waozixyz 015843c4d6 wip file import 2026-06-09 21:41:29 -03:00
waozixyz 5d335ff637 update makefile 2026-06-09 13:36:16 -03:00
waozixyz 61731bd680 add new version 2026-06-09 13:05:43 -03:00
waozixyz e3f6a22d24 fine grained sound, better language support 2026-06-09 11:13:11 -03:00
waozixyz e00245e212 clean text 2026-06-09 00:13:33 -03:00
waozixyz 951309c75f add font loading and asian languages 2026-06-08 23:18:52 -03:00
waozixyz c3d36d8d28 Use Flint UI widgets directly 2026-06-08 15:21:13 -03:00
waozixyz a9b615614b Bump Flint for UI widgets 2026-06-08 15:20:42 -03:00
waozixyz 0fb8630dc9 Bump Flint for DPI cache 2026-06-08 15:09:21 -03:00
waozixyz bda1bf536d Use Flint text layout directly 2026-06-08 15:05:08 -03:00
waozixyz 7e27498379 Bump Flint for text layout 2026-06-08 15:03:28 -03:00
waozixyz 08ef56d788 Move generic UI helpers into flint 2026-06-08 14:57:13 -03:00
waozixyz a3f92aaf5c Update flint theme catalog behavior 2026-06-08 14:21:58 -03:00
waozixyz 447e2b6187 Use flint catalog for theme previews 2026-06-08 14:20:36 -03:00
waozixyz 72fd21dad0 Register themes through flint catalog 2026-06-08 11:04:19 -03:00
waozixyz f9da10204d Use vendored flint UI and themes 2026-06-08 10:54:50 -03:00
waozixyz 1549f5e3bc cleaner makefile 2026-06-08 00:40:01 -03:00
waozixyz 0c650fc94f improved settings page 2026-06-04 22:50:14 -03:00
waozixyz 52716b1edb rm sync 2026-06-04 16:02:20 -03:00
waozixyz 9e40eda25e wip sync data 2026-06-03 00:17:29 -03:00
waozixyz 92985e8a03 fixes for web and version update 2026-06-01 17:00:10 -03:00
waozixyz 5aedde8d80 add on screen keyboard 2026-06-01 16:33:26 -03:00
waozixyz eb25d437a4 improve edit filed 2026-06-01 12:42:01 -03:00
waozixyz 7690e04429 improve tutorial, results saving and statistics 2026-06-01 12:29:36 -03:00
waozixyz 07ca47ee7c add multilingual 2026-05-31 06:08:23 -03:00
waozixyz 7c3275fee3 add progressive speed up for first round 2026-05-30 23:13:41 -03:00
waozixyz 249702ca32 fix for non android plat 2026-05-30 18:59:52 -03:00
waozixyz 2797b3371d implement wakelock 2026-05-30 18:43:50 -03:00
waozixyz bc7514406b implement wakelock 2026-05-30 11:28:58 -03:00
waozixyz 79bcf2c328 rm comments 2026-05-30 00:48:04 -03:00
waozixyz b5962360c1 improve dpi settings 2026-05-30 00:28:07 -03:00
waozixyz 83ecc17423 improve website 2026-05-30 00:19:07 -03:00
waozixyz f01c4d7d81 cleanup code and improve site 2026-05-29 23:57:23 -03:00
waozixyz 03b714aa64 clean up instructions 2026-05-29 20:04:38 -03:00
waozixyz 5f116c29cb fi xscript 2026-05-29 15:07:05 -03:00
waozixyz cdbdcd20cb add copy assets script 2026-05-29 14:57:23 -03:00
waozixyz 6a3362f59e fix padding 2026-05-29 14:53:29 -03:00
waozixyz 43013c64ab massive layout improvements 2026-05-29 14:50:11 -03:00
waozixyz 3f86abb35a update cmake 2026-05-29 13:31:44 -03:00
waozixyz 3e75089266 implement text reflow 2026-05-29 13:29:54 -03:00
waozixyz d51fdea355 update workflow 2026-05-29 12:43:31 -03:00
waozixyz 5bc63e7b13 rm unsigned apk 2026-05-29 12:05:40 -03:00
waozixyz 03e1fccab3 fix gradle for github action 2026-05-29 11:38:47 -03:00
waozixyz ed2e52c13a mistake in workflow 2026-05-29 11:34:46 -03:00
waozixyz 616ef0cb09 fix workflow 2026-05-29 11:33:31 -03:00
waozixyz e7debfc68f update workflow 2026-05-29 11:31:34 -03:00
waozixyz 796f1393de udptae version 2026-05-29 11:27:47 -03:00
waozixyz 99567e68c1 add image fallback 2026-05-29 11:19:29 -03:00
waozixyz f714674e62 bug fix 2026-05-29 09:20:11 -03:00
waozixyz 3d75216483 release fix 2026-05-29 09:14:19 -03:00
waozixyz ac485ea355 fix inset 2026-05-29 09:11:47 -03:00
waozixyz ad59bb0c51 increase inset 2026-05-29 07:50:08 -03:00
waozixyz efbeec104d move scripts 2026-05-29 07:26:04 -03:00
waozixyz f9d109182d fix data issue 2026-05-29 07:23:00 -03:00
waozixyz ccb8c2f2b5 bug fix 2026-05-28 23:58:22 -03:00
waozixyz 2405fb2fcf improve website 2026-05-28 18:48:19 -03:00
waozixyz 8c25a6630b add itch script 2026-05-28 18:14:25 -03:00
waozixyz 97dd375822 rm dependency tracker 2026-05-28 16:31:51 -03:00
waozixyz 93103cc0ea fix bug 2026-05-28 14:44:10 -03:00
waozixyz a0ded8e537 fix script 2026-05-28 14:38:41 -03:00
waozixyz 1f8ada56f9 fastlane changelog 2026-05-28 14:37:35 -03:00
waozixyz e80097fb83 fix versioning 2026-05-28 14:35:31 -03:00
waozixyz 4e0dedf97d add descriptions 2026-05-28 12:37:07 -03:00
waozixyz 675b2c260a fix dropdown passthrough 2026-05-28 10:48:38 -03:00
waozixyz 463c858565 update version 2026-05-28 10:20:02 -03:00
waozixyz 8b739fcbd4 make file sharing work 2026-05-28 10:19:50 -03:00
waozixyz 7b23749f7d implemnet clean zip export 2026-05-28 04:14:31 -03:00
waozixyz 3c3eb9e0f2 wip data management 2026-05-28 02:55:45 -03:00
waozixyz a896ad4f55 refactor code 2026-05-28 02:34:07 -03:00
waozixyz 19ad586e0c add return button func on android 2026-05-28 01:12:11 -03:00
waozixyz bdb1e92a51 new test 2026-05-27 18:38:48 -03:00
waozixyz 8d1cf2b8f9 improve build for fdroid 2026-05-27 18:23:09 -03:00
waozixyz 6547bd9636 cleaner relesae 2026-05-27 15:41:55 -03:00
waozixyz 8d9117bd16 use correct tag 2026-05-27 15:33:30 -03:00
waozixyz 695aafa231 auto tag 2026-05-27 15:29:11 -03:00
waozixyz 88598d830f bug fix 2026-05-27 15:18:55 -03:00
waozixyz 0be5f925a7 enable signing 2026-05-27 15:14:02 -03:00
waozixyz 39096d0dd4 add fastlane metadata 2026-05-27 15:04:40 -03:00
waozixyz 2242553194 prepare for f-droid 2026-05-27 14:24:11 -03:00
waozixyz 5d6985b2b5 finish migration 2026-05-27 14:17:17 -03:00
waozixyz ba216da8e6 bug fixes 2026-05-27 14:01:19 -03:00
waozixyz 13c469166a bug fixes 2026-05-27 13:51:21 -03:00
waozixyz e1298bd262 track drodi stuff correctyl 2026-05-27 13:49:12 -03:00
waozixyz 6c1eb327e3 add waozi icons 2026-05-27 13:12:46 -03:00
waozixyz 3ff05eac4e add flake 2026-05-27 13:03:39 -03:00
waozixyz 93f1bae5b7 add cherry theme andbug fixes 2026-05-27 11:45:27 -03:00
waozixyz 896f0b1c22 implement theming 2026-05-27 00:48:45 -03:00
waozixyz 615e32b0c6 add version upgrade script 2026-05-26 16:15:15 -03:00
waozixyz 77093f27a0 update version 2026-05-26 10:52:06 -03:00
waozixyz c13b7e743d bug fixes 2026-05-26 10:45:01 -03:00
waozixyz 5e61ef5351 improve scaling 2026-05-26 10:18:06 -03:00
waozixyz 79f44d353b add sounds 2026-05-25 21:52:20 -03:00
waozixyz e22e3f98ef fix androdi scaling 2026-05-25 20:24:16 -03:00
waozixyz 14d4594d71 improve mobile view 2026-05-25 14:24:07 -03:00
waozixyz 899500307c finish inbe basic 2026-05-25 12:44:40 -03:00
waozixyz 50527f15b8 cascading windows 2026-05-24 20:57:08 -03:00
waozixyz 94218efc5e fix web shell 2026-05-24 20:27:27 -03:00
waozixyz cf9ff9fb1f improve android inbe 2026-05-24 16:08:10 -03:00
waozixyz 81410ea4ae cleanup 2026-05-23 23:58:31 -03:00
waozixyz 2add9f0f30 unify flake 2026-05-23 23:41:11 -03:00
waozixyz 8bbc5625b7 add lotus 2026-05-23 23:18:56 -03:00
waozixyz ccc2032c50 wip lotus 2026-05-23 18:39:06 -03:00
waozixyz df3d04fa26 cross compile to windows 2026-05-23 13:19:31 -03:00
waozixyz 4c5c76e51e reorg 2026-05-23 10:10:56 -03:00
waozixyz a3db764783 clean and replace with ray 2026-05-23 09:34:33 -03:00
waozixyz 80b2214af3 testray 2026-05-23 08:42:59 -03:00
waozixyz 96ef714ca8 simplify linux version 2026-05-23 00:35:12 -03:00
waozixyz d808bdf985 improve icons 2026-05-22 22:32:32 -03:00
waozixyz c448e5d429 clean bulid and native linux 2026-05-22 22:09:12 -03:00
waozixyz d592c943f0 add banner image for inbe 2026-05-22 10:40:47 -03:00
waozixyz d90336d710 complete basic inner breeze breathing cycle 2026-05-22 09:40:52 -03:00
waozixyz c135464530 drawing primitives, buttons 2026-05-21 23:36:02 -03:00
waozixyz 45a360f498 use liblotus 2026-05-21 22:33:06 -03:00
waozixyz 0fad496a0e stared liblotus 2026-05-21 22:01:57 -03:00
waozixyz 7642a146cc simple android fb manipulation 2026-05-21 16:47:37 -03:00
waozixyz d1633381f4 add results to wasm4 inbe 2026-05-21 14:25:06 -03:00
waozixyz 2825a41d02 cleanup 2026-05-21 10:14:45 -03:00
waozixyz c86d2da631 bug fixes 2026-05-21 02:58:48 -03:00
waozixyz 99d2433283 add subdomains 2026-05-21 02:46:23 -03:00
waozixyz 1650d50c72 rename and refactor 2026-05-21 02:35:11 -03:00
545 changed files with 25876 additions and 71773 deletions

No files matched your search

-26
View File
@@ -1,26 +0,0 @@
build-essential
ca-certificates
curl
dpkg
libcurl4-openssl-dev
libdrm-dev
libdrm2
libegl1-mesa-dev
libegl1
libgbm-dev
libgbm1
libgles2-mesa-dev
libgl1
libgl1-mesa-dri
libglvnd0
libgtk-3-dev
libx11-6
libx11-dev
libxext6
libsdl2-2.0-0
libsdl2-dev
patchelf
pkg-config
podman
rpm
zip
-2
View File
@@ -1,2 +0,0 @@
build-essential
zlib1g-dev
-4
View File
@@ -1,4 +0,0 @@
build-essential
zlib1g-dev
zip
tcl
-5
View File
@@ -1,5 +0,0 @@
build-essential
gcc-mingw-w64-i686-win32
gcc-mingw-w64-x86-64-win32
zlib1g-dev
zip
+106
View File
@@ -0,0 +1,106 @@
name: Android Build
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
permissions:
contents: write
jobs:
release:
name: Build Release APK
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Grant execute permission for gradlew
run: chmod +x droid/gradlew
- name: Create keystore directory
run: mkdir -p ~/.android
- name: Decode Keystore
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
run: |
echo "$KEYSTORE_BASE64" | base64 -d > ~/.android/inbe-release.keystore
echo "Keystore decoded successfully"
- name: Copy Assets to Android Project
run: ./scripts/copy-android-assets.sh
- name: Run Tests
run: make test
- name: Build Release APK
working-directory: ./droid
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
./gradlew assembleRelease \
-Pkeystore.password="$KEYSTORE_PASSWORD" \
-Pkeystore.path="/home/runner/.android/inbe-release.keystore" \
--stacktrace
- name: Rename APK
run: |
VERSION=$(grep "versionName" droid/app/build.gradle | awk '{print $2}' | tr -d '"')
find droid/app/build/outputs/apk/release -name "*-universal-release.apk" -exec cp {} inbe-$VERSION.apk \; 2>/dev/null || true
- name: Upload APK to Artifacts
uses: actions/upload-artifact@v4
with:
name: release-apk
path: inbe-*.apk
if-no-files-found: warn
- name: Create and Push Tag (if new version)
id: tag_version
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
VERSION=$(grep "versionName" droid/app/build.gradle | awk '{print $2}' | tr -d '"')
TAG="v$VERSION"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG exists, skipping"
echo "tag_pushed=false" >> $GITHUB_OUTPUT
else
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "$TAG" -m "Release $VERSION"
git push origin "$TAG"
echo "tag_pushed=true" >> $GITHUB_OUTPUT
echo "tag_name=$TAG" >> $GITHUB_OUTPUT
fi
- name: Create GitHub Release
if: steps.tag_version.outputs.tag_pushed == 'true'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag_version.outputs.tag_name }}
files: inbe-*.apk
generate_release_notes: true
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-197
View File
@@ -1,197 +0,0 @@
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test
runs-on: ubuntu-latest
env:
APT_CACHE_DIR: /tmp/apt-cache
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
lfs: true
- name: Cache Test apt packages
uses: actions/cache@v4
with:
path: ${{ env.APT_CACHE_DIR }}
key: test-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/test-packages.txt') }}
restore-keys: |
test-apt-${{ runner.os }}-${{ runner.arch }}-
- name: Install Test Dependencies
run: |
set -euo pipefail
mapfile -t packages < .github/apt/test-packages.txt
mkdir -p "$APT_CACHE_DIR/partial"
sudo apt-get update
sudo apt-get \
-o Dir::Cache::archives="$APT_CACHE_DIR" \
install -y "${packages[@]}"
sudo chown -R "$USER:$USER" "$APT_CACHE_DIR"
- name: Run Tests
run: make test
build-chrome-extension:
name: Build Chrome Extension
runs-on: ubuntu-latest
needs: test
env:
APT_CACHE_DIR: /tmp/apt-cache
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
lfs: true
- name: Cache Web apt packages
uses: actions/cache@v4
with:
path: ${{ env.APT_CACHE_DIR }}
key: web-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/web-packages.txt') }}
restore-keys: |
web-apt-${{ runner.os }}-${{ runner.arch }}-
- name: Install Web Dependencies
run: |
set -euo pipefail
mapfile -t packages < .github/apt/web-packages.txt
mkdir -p "$APT_CACHE_DIR/partial"
sudo apt-get update
sudo apt-get \
-o Dir::Cache::archives="$APT_CACHE_DIR" \
install -y "${packages[@]}"
sudo chown -R "$USER:$USER" "$APT_CACHE_DIR"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Set up Emscripten
run: |
set -euo pipefail
git clone --depth 1 https://github.com/emscripten-core/emsdk.git "$HOME/emsdk"
"$HOME/emsdk/emsdk" install latest
"$HOME/emsdk/emsdk" activate latest
echo "EMSDK=$HOME/emsdk" >> "$GITHUB_ENV"
echo "EM_CONFIG=$HOME/emsdk/.emscripten" >> "$GITHUB_ENV"
echo "$HOME/emsdk" >> "$GITHUB_PATH"
echo "$HOME/emsdk/upstream/emscripten" >> "$GITHUB_PATH"
- name: Build Chrome Extension ZIP
run: |
set -euo pipefail
make package-unpackaged-assets
make chrome-web-store
test -f build/dist/inbe-chrome-web-store.zip
- name: Run Web Smoke Test
run: |
set -euo pipefail
make web-smoke-test
build-firefox-addons:
name: Build Firefox Add-on
runs-on: ubuntu-latest
needs: test
env:
APT_CACHE_DIR: /tmp/apt-cache
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
lfs: true
- name: Cache Web apt packages
uses: actions/cache@v4
with:
path: ${{ env.APT_CACHE_DIR }}
key: web-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/web-packages.txt') }}
restore-keys: |
web-apt-${{ runner.os }}-${{ runner.arch }}-
- name: Install Web Dependencies
run: |
set -euo pipefail
mapfile -t packages < .github/apt/web-packages.txt
mkdir -p "$APT_CACHE_DIR/partial"
sudo apt-get update
sudo apt-get \
-o Dir::Cache::archives="$APT_CACHE_DIR" \
install -y "${packages[@]}"
sudo chown -R "$USER:$USER" "$APT_CACHE_DIR"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Set up Emscripten
run: |
set -euo pipefail
git clone --depth 1 https://github.com/emscripten-core/emsdk.git "$HOME/emsdk"
"$HOME/emsdk/emsdk" install latest
"$HOME/emsdk/emsdk" activate latest
echo "EMSDK=$HOME/emsdk" >> "$GITHUB_ENV"
echo "EM_CONFIG=$HOME/emsdk/.emscripten" >> "$GITHUB_ENV"
echo "$HOME/emsdk" >> "$GITHUB_PATH"
echo "$HOME/emsdk/upstream/emscripten" >> "$GITHUB_PATH"
- name: Build Firefox Add-on ZIP
run: |
set -euo pipefail
make package-unpackaged-assets
make firefox-addons
test -f build/dist/inbe-firefox-addons.zip
make firefox-addons-lint
- name: Install Firefox (Mozilla build)
run: |
set -euo pipefail
sudo apt-get install -y --no-install-recommends xvfb \
libgl1-mesa-dri libgl1 libegl1 mesa-utils || true
sudo apt-get install -y --no-install-recommends \
libgtk-3-0t64 libx11-xcb1 libxcb-shm0 libasound2t64 libdbus-glib-1-2 \
libxt6t64 libxtst6 libpci3 || \
sudo apt-get install -y --no-install-recommends \
libgtk-3-0 libx11-xcb1 libxcb-shm0 libasound2 libdbus-glib-1-2 libxt6 libxtst6 libpci3
curl -sL "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US" \
-o "$HOME/firefox.tar.xz"
tar -xJf "$HOME/firefox.tar.xz" -C "$HOME"
test -x "$HOME/firefox/firefox"
echo "$HOME/firefox" >> "$GITHUB_PATH"
- name: Run Web Smoke Test (Firefox)
env:
LIBGL_ALWAYS_SOFTWARE: '1'
run: |
set -euo pipefail
xvfb-run -a --server-args="-screen 0 1280x1024x24" make web-smoke-test-firefox
-140
View File
@@ -1,140 +0,0 @@
name: Netlify
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: netlify-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build Site
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
lfs: true
- name: Install Packages
run: |
set -euo pipefail
mapfile -t packages < .github/apt/web-packages.txt
sudo apt-get update
sudo apt-get install -y "${packages[@]}" tcl
- name: Set Up Emscripten
run: |
set -euo pipefail
git clone --depth 1 https://github.com/emscripten-core/emsdk.git "$HOME/emsdk"
"$HOME/emsdk/emsdk" install latest
"$HOME/emsdk/emsdk" activate latest
echo "EMSDK=$HOME/emsdk" >> "$GITHUB_ENV"
echo "EM_CONFIG=$HOME/emsdk/.emscripten" >> "$GITHUB_ENV"
echo "$HOME/emsdk" >> "$GITHUB_PATH"
echo "$HOME/emsdk/upstream/emscripten" >> "$GITHUB_PATH"
- name: Build Site
run: |
set -euo pipefail
make site
test -f build/site/index.html
test -f build/site/build/web/index.html
test -f build/site/build/web/index.js
test -f build/site/build/web/index.wasm
- name: Upload Site Artifact
uses: actions/upload-artifact@v4
with:
name: inbe-site
path: build/site
if-no-files-found: error
deploy-preview:
name: Deploy Preview
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'pull_request'
steps:
- name: Download Site Artifact
uses: actions/download-artifact@v4
with:
name: inbe-site
path: build/site
- name: Install Netlify CLI
run: npm install --global netlify-cli
- name: Deploy Preview To Netlify
run: |
set -euo pipefail
auth_token="$(printf '%s' "$NETLIFY_AUTH_TOKEN" | tr -d '\r\n')"
site_id="$(printf '%s' "$NETLIFY_SITE_ID" | tr -d '\r\n')"
netlify deploy \
--dir build/site \
--no-build \
--alias "pr-${{ github.event.pull_request.number }}" \
--message "Preview ${{ github.event.pull_request.number }}" \
--auth "$auth_token" \
--site "$site_id"
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
deploy-production:
name: Deploy Production
runs-on: ubuntu-latest
needs: build
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
steps:
- name: Download Site Artifact
uses: actions/download-artifact@v4
with:
name: inbe-site
path: build/site
- name: Install Packages
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y zip
- name: Package Site
run: |
set -euo pipefail
test -f build/site/index.html
cd build/site
zip -qr ../inbe-site.zip .
test -s ../inbe-site.zip
- name: Deploy Production To Netlify
run: |
set -euo pipefail
auth_token="$(printf '%s' "$NETLIFY_AUTH_TOKEN" | tr -d '\r\n')"
site_id="$(printf '%s' "$NETLIFY_SITE_ID" | tr -d '\r\n')"
test -n "$auth_token" || { echo "::error::NETLIFY_AUTH_TOKEN is empty or missing"; exit 1; }
test -n "$site_id" || { echo "::error::NETLIFY_SITE_ID is empty or missing"; exit 1; }
response="$(curl --fail-with-body --silent --show-error \
-X POST \
-H "Authorization: Bearer $auth_token" \
-H "Content-Type: application/zip" \
--data-binary "@build/inbe-site.zip" \
"https://api.netlify.com/api/v1/sites/$site_id/deploys")"
python3 -c 'import json, sys; deploy = json.loads(sys.argv[1]); state = deploy.get("state", ""); url = deploy.get("ssl_url") or deploy.get("url") or deploy.get("deploy_ssl_url") or deploy.get("deploy_url") or deploy.get("id"); print(f"Netlify deploy {state}: {url}"); raise SystemExit(1 if state in ("error", "failed") else 0)' "$response"
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
-109
View File
@@ -1,109 +0,0 @@
name: Publish OpenStore
on:
workflow_dispatch:
inputs:
changelog:
description: Changelog text for the OpenStore revision
required: false
default: ""
channel:
description: OpenStore channel
required: false
default: focal
release:
types: [published]
push:
tags:
- "v*"
permissions:
contents: read
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 90
env:
OPENSTORE_API_KEY: ${{ secrets.OPENSTORE_API_KEY }}
OPENSTORE_APP_ID: inbe
OPENSTORE_CHANNEL: ${{ github.event.inputs.channel || 'focal' }}
CHANGELOG: ${{ github.event.inputs.changelog || github.event.release.name || github.event.release.tag_name || '' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
lfs: true
- name: Install build dependencies
run: |
sudo dpkg --add-architecture arm64
# Ubuntu's archive/security mirrors only carry amd64/i386; arm64
# lives on ports.ubuntu.com. Pin the stock deb822 sources to amd64
# and add a ports source, otherwise apt-get update 404s on
# binary-arm64 and the install step fails.
sudo sed -i 's/^Types: deb$/Types: deb\nArchitectures: amd64 i386/' /etc/apt/sources.list.d/ubuntu.sources
printf 'Types: deb\nURIs: http://ports.ubuntu.com/ubuntu-ports\nSuites: noble noble-updates noble-backports noble-security\nComponents: main universe restricted multiverse\nArchitectures: arm64\nSigned-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg\n' | sudo tee /etc/apt/sources.list.d/ports-arm64.sources >/dev/null
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
binutils-aarch64-linux-gnu \
ccache \
click \
cmake \
curl \
gcc-aarch64-linux-gnu \
jq \
make \
patchelf \
pkg-config \
tcl \
zlib1g-dev \
libcurl4-openssl-dev:arm64 \
libdrm-dev:arm64 \
libegl-dev:arm64 \
libgbm-dev:arm64 \
libgles-dev:arm64 \
libsdl2-dev:arm64 \
libssl-dev:arm64 \
zlib1g-dev:arm64
- name: Build Click package
run: |
set -euo pipefail
# Absolute paths: CMake cross builds do not resolve bare tool names
# (CMAKE_AR=aarch64-linux-gnu-ar ends up NOTFOUND and the liboqs
# archive step fails with "No such file or directory").
export AARCH64_CC="$(command -v aarch64-linux-gnu-gcc)"
export AARCH64_AR="$(command -v aarch64-linux-gnu-ar)"
export AARCH64_RANLIB="$(command -v aarch64-linux-gnu-ranlib)"
export AARCH64_PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig:/usr/share/pkgconfig
export PKG_CONFIG_LIBDIR="$AARCH64_PKG_CONFIG_PATH"
export AARCH64_RAY_SDL_CFLAGS="$(pkg-config --cflags sdl2)"
export AARCH64_RAY_SDL_LDLIBS="$(pkg-config --libs sdl2)"
export AARCH64_RAY_GL_CFLAGS="$(pkg-config --cflags libdrm gbm egl glesv2)"
export AARCH64_RAY_GL_LDLIBS="$(pkg-config --libs libdrm gbm egl glesv2)"
export AARCH64_RAY_CFLAGS="$AARCH64_RAY_SDL_CFLAGS $AARCH64_RAY_GL_CFLAGS"
export AARCH64_RAY_LDLIBS="$AARCH64_RAY_SDL_LDLIBS $AARCH64_RAY_GL_LDLIBS"
export AARCH64_RAY_SDL_INCLUDE_DIR=/usr/include/SDL2
export AARCH64_KRYON_CURL_CFLAGS="$(pkg-config --cflags libcurl)"
export AARCH64_KRYON_CURL_LDLIBS="$(pkg-config --libs libcurl)"
export AARCH64_CLICK_RUNTIME_LIBS="/usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 /usr/lib/aarch64-linux-gnu/libcurl.so.4 /usr/lib/aarch64-linux-gnu/libssl.so.3 /usr/lib/aarch64-linux-gnu/libcrypto.so.3 /usr/lib/aarch64-linux-gnu/libdrm.so.2 /usr/lib/aarch64-linux-gnu/libgbm.so.1 /usr/lib/aarch64-linux-gnu/libEGL.so.1 /usr/lib/aarch64-linux-gnu/libGLESv2.so.2 /usr/lib/aarch64-linux-gnu/libz.so.1"
make CLICK_ARCH=arm64 click
- name: Show package contents
run: |
set -euo pipefail
click_file="$(ls -t build/dist/click/*.click | head -1)"
echo "Built $click_file"
dpkg-deb --contents "$click_file" | grep -E 'manifest.json|inbe.png|metainfo|inbe.desktop'
- name: Publish to OpenStore
run: |
set -euo pipefail
click_file="$(ls -t build/dist/click/*.click | head -1)"
scripts/publish-openstore.sh "$click_file"
File diff suppressed because it is too large. Load diff
-8
View File
@@ -8,22 +8,16 @@
.claude/
.local/
.codex/
.zcode
.agents/
.kryon-ide-state
.cache/
.ccache
*.wasm
build/
tmp/
vendor-builds/
node_modules
*.nix-defexpr
*.npm
*.nix-profile
.claude.json
.bash_history
.env
*.exe
@@ -53,7 +47,6 @@ Captures/
Thumbs.db
*.bak
*.swp
*.core
local.properties
*.o
@@ -62,4 +55,3 @@ local.properties
*.a
/pro/
.kotlin/
+6 -3
View File
@@ -1,9 +1,12 @@
[submodule "vendor/raylib"]
path = vendor/raylib
url = https://github.com/raysan5/raylib.git
[submodule "vendor/rini"]
path = vendor/rini
url = https://github.com/raysan5/rini.git
[submodule "vendor/otfchop"]
path = vendor/otfchop
url = https://github.com/waozixyz/otfchop
[submodule "vendor/sqlite"]
path = vendor/sqlite
url = https://github.com/sqlite/sqlite
[submodule "vendor/kryon"]
path = vendor/kryon
url = https://github.com/kryonlabs/kryon.git
-480
View File
@@ -1,488 +1,8 @@
# Changelog
## [1.9.2] - 2026-08-17
### Added
- Breathing Patterns with Box, 4-7-8, coherent, extended-exhale and custom timed breathing sessions.
- Android Health Connect export for meditation, breathwork and sun-salutation sessions.
- Android home-screen widget, quick-settings tile and launcher shortcuts for starting practices.
- Interval bells for meditation: chime every 1/2/5/10/15/30 minutes (off by default).
- Weekday schedules and reminder times for habits, with support for up to 32 habits.
- CSV export of session history from Data & export settings.
- Practices can be started directly from a break and count as taking that break.
### Changed
- Profile now uses clear top-level tabs for profile details, sync, data, friends and leaderboard.
- Leaderboard shows all useful statistics together in one sortable table; average hold appears only for Wim Hof sessions.
- The default Meditation habit now tracks sessions from Wim Hof, Meditation and Breathing Patterns.
- Breathing Patterns has a cleaner layout, smoother animation and keeps running when the app loses focus.
- Refreshed the Breathing Patterns and Meditation artwork while retaining the original Wim Hof banner.
- Simplified the Meditation screen and removed the redundant how-to section.
### Fixed
- Profile and leaderboard loading states no longer display misleading zero values while data is loading.
- Fixed delayed or stale leaderboard results, duplicate Wim Hof entries and unreadable selected-button text.
- Fixed profile name display, text-field focus styling and profile picture icon colors.
- Fixed a corrupted notification-icon context menu and removed redundant tray and Practice-screen Show controls.
## [1.9.1] - 2026-08-16
### Added
- Breaks render in their own centered always-on-top OS window (desktop): the main window - even hidden to tray - is no longer taken over; Postpone/Skip/Rest-now are clickable in it and right-click opens Break settings.
- The timer HUD is drag-and-drop movable anywhere on screen, remembers its position across restarts, hides disabled timers entirely, and right-clicking it opens Break settings; it stays visible during a break showing the remaining rest time.
- Desktop Device settings: startup mode (show window / start minimized to tray) and on-close behavior (ask / always keep running / always quit).
- Single-instance: launching replaces an existing instance by default (graceful SIGTERM handover via a PID lock; screenshot mode is exempt).
### Changed
- Micro breaks open their window the moment they are due - the invisible toast-prompt phase is gone (rest/daily keep their prompts).
- Break exercises are removed for now: breaks are just the countdown and controls; the "Exercises" settings row and the tray entry are gone. Running a practice during a break is planned as the follow-up.
- Idle memory: source fonts now rasterize once each at the DPI-scaled base size (plus one lazily built tier for large text) instead of caching up to eight per-size rasterizations, and a burst of new glyphs re-rasterizes at most once per frame per font; language-picker fallback fonts seed ASCII only and grow on demand (kryon `ui_text` change).
- The process no longer links GTK: the system theme reads the desktop's real palette from the theme's gtk.css (kryon `system_theme`), file dialogs shell out to zenity/kdialog/yad (kryon's default backend order), and the GTK tray backend resolves libgtk-3 through kryon's runtime loader only when the tray actually starts. `INBE_NO_TRAY=1` skips the tray entirely (idle RSS drops from ~132 MB to ~103 MB; with the tray it is ~126 MB).
- glibc malloc arenas are capped at four (the app runs ~19 threads; the default ceiling let per-thread arenas inflate idle RSS).
- `KRYON_MEM_DEBUG=1` prints RSS/arena snapshots at startup and steady state (`KryonMemReport`), plus per-font rasterization stats (`UIFontMemoryReport`).
- Vendored Kryon bumped to master (ui_window center/drag/right-click/click-position, per-window XImage buffers, X11 `Time` layout fix; system_theme gtk.css palette).
### Fixed
- Android updates can once again be delivered through F-Droid.
- Restored 32-bit Windows downloads.
- Clicks on extra OS windows (HUD, break window) register correctly: the X11 `Time` field in the event stand-in had the wrong width, shifting button/position reads (right-click and buttons appeared dead).
- Extra OS windows no longer corrupt the heap when two windows of different sizes alternate (per-window XImage buffers).
- The Breaks entry shows in the settings sidebar on desktop again (`#if DESKTOP` resolved against an undefined constant, compiling the mobile branch everywhere).
## [1.9.0] - 2026-08-15
### Added
- Break reminders, Workrave-style: micro, rest and daily break timers with break exercises, statistics, and a desktop timer HUD that lives as a real OS window next to the app (desktop only, off by default, with its own settings tab).
- A dedicated Notifications settings tab. Push delivery uses UnifiedPush (no Google services): "Set up push" opens an in-app picker that lists installed distributor apps with their name and icon and registers with the one you pick; the status line reports the real registration state.
- Reminders are an editable list: add as many as you want, each with a practice dropdown (Wim Hof, Meditation, Sun Salutation), a [-] time [+] stepper, an on/off toggle and delete. Ships with one enabled Wim-Hof 08:00 reminder.
- A notification when new friend requests arrive over social sync (toggleable, on by default).
- Screenshot scenes for the first-run guide and the notifications settings, for regression coverage.
### Changed
- The app is built through the Kir-only k2c pipeline end to end; the legacy kc path and the orphaned wasm4/uxn experimental backends are gone.
- The 2,400-line app.c is split into focused modules (app_audio, app_fonts, app_web_bridge) and the simple screen dispatch is table-driven.
- Material theme is the default everywhere.
- The mobile nav sidebar no longer lists the desktop-only Breaks entry, and its scroll area is sized to the real content height so every entry is reachable on small screens.
- In-practice completion notifications are always on; the redundant "session complete" setting was removed.
- Vendored Kryon bumped through the notification, UIWindow and guide fixes.
### Fixed
- Settings silently stopped persisting across reloads on web (and could drop settings on any platform once enough keys existed): the settings load cache was a fixed 192-entry array that silently discarded entries past the cap, and the notification-era keys pushed the setting count over it. The cache now grows dynamically and logs if its allocation ever fails.
- First-run guide misalignment on small screens: the highlight anchors now come from the rectangles the draw code actually renders, the practice home reserves the exact space below its card (so it no longer flips into scroll mode when everything fits), the guide never starts on the welcome screen, the Android back key closes it, and its progress persists so it does not return after quitting mid-tour.
- "Set up push" did nothing: the UnifiedPush configuration ran via JNI on the native render thread, which has no Looper, and the resulting exception aborted registration before it started. It now runs on the UI thread.
- The reminder time is exactly centered between the - and + buttons and vertically aligned with them.
- Fresh installs now load the default reminder list (the "no saved list" sentinel was being clamped to an empty list).
- Android, web and CI build breaks from the Kryon bumps (ui_window NULL on Android, physics exclusion for web, Firefox smoke test under software GL).
## [1.8.23] - 2026-08-13
### Fixed
- Properly fixed accented characters (ä ö ü ß é ñ č etc.) typed into text fields rendering in a different, broken font. The active UI font is now dynamic in kryon and renders every glyph its file contains in its own typeface, instead of the brittle per-locale codepoint set that missed any character not present in the current locale's file. (1.8.20 only regenerated the font subset; this is the root-cause fix in kryon.)
### Changed
- Bumped the vendored Kryon pointer, and excluded Kryon's 2D physics (Box2D) sources from the Android build (inbe is UI-only) so the APK builds cleanly after the bump.
## [1.8.22] - 2026-08-12
### Fixed
- Fixed a ghost-click bug when closing the sidebar by swiping left on mobile: the pointer release bled through to the newly-shown screen, triggering a stray click on whatever nav item or button was under the release point (e.g. opening About). The release is now consumed before the screen switch.
- Fixed sidebar navigation returning to the wrong screen: closing the sidebar now remembers and returns to the screen it was opened from, and the return-on-back flag is properly cleared on re-open so it can't loop.
## [1.8.21] - 2026-08-12
### Fixed
- Fixed text corruption and overflow at high UI scale: font-shrink loops in the habits weekly view and WHM progressive-speed editor stepped or compared against scaled pixel values instead of logical font sizes, causing text to shrink too fast or never shrink. Title bars, toasts, and empty text fields now use the scaled line height for vertical centering and container sizing.
## [1.8.20] - 2026-08-12
### Fixed
- Fixed Android default scaling being too small by using the best available DPI estimate (maximum of viewport ratio, device density, and window scale) instead of device density alone, which under-scaled on tall screens.
- Regenerated the Latin font subset to include accented characters (ä ö ü ß é ñ č etc.) so German, French, Spanish, Czech and other Latin-script languages no longer fall back to a visually different system font.
- Removed per-frame DPI scale log spam from the embed draw path.
- Fixed the CI release build by upstreaming the SetUIDeviceDensity hook and other kryon fixes that were only present as uncommitted vendor working-tree edits.
## [1.8.19] - 2026-08-11
### Added
- Added a user-facing Scale factor control in Appearance settings, with a slider plus minus/plus steppers, that rescales the whole UI live on top of the device DPI. Shows the effective scale (e.g. 2.0x) and supports shrinking below the default.
### Changed
- Bumped practice screen metadata/subtitle, statistics metric labels, and About version text to the regular font tier so they stay readable at high scale.
- Made the per-practice music track setting keys data-driven so future practices persist automatically, and derived the practice music enable mask from the track selection to prevent drift.
- Updated Kryon Slider widget to allow a caller-supplied value text (e.g. "1.8x") and bumped the vendored Kryon pointer.
## [1.8.18] - 2026-08-10
### Changed
- Fixed Android audio/music import failing with "unsupported audio format": the file picker now preserves the original filename and a correct extension derived from the picked file's MIME type, instead of copying to an extension-less cache path.
- Fixed long custom music titles overlapping the play/pause and remove buttons in Audio settings by fitting them with an ellipsis.
- Moved background music selection out of per-practice customization and into Audio settings, with one track dropdown per practice (Wim Hof, Meditation, Sun Salutation), each defaulting to "None" except Meditation.
- Added a download/redownload button and progress indicator for the bundled meditation music pack directly in Audio settings.
- Showed the "Music by Elijah_K." attribution under a practice's track dropdown only when a bundled track requiring attribution is selected.
## [1.8.17] - 2026-08-10
### Changed
- Updated the WHM tutorial hold preview to use the same progress circle rendering as practice sessions.
- Fixed manual tutorial navigation arrows to use the centered left and right icons.
- Fixed habit edit Save so it returns directly to the habits overview, with a smaller Delete action for existing habits.
- Updated Kryon to allow apps to disable automatic default font loading during UI initialization.
## [1.8.16] - 2026-08-10
### Changed
- Fixed first-run guide overlay alignment under the Material theme by using style-aware tab and bottom navigation measurements.
- Fixed Audio settings scroll height calculation so the page sizes to the actual custom sound, music, output, and import controls.
- Restored Android 6/API 23 native launch compatibility by extracting packaged JNI libraries for older devices.
- Updated Kryon to the canonical widget API and refreshed the vendored Kryon pointer.
## [1.8.15] - 2026-08-09
### Changed
- Updated Kryon to the clean Kryon-owned app API and Material toggle rendering.
- Improved Material spacing in settings toggle rows.
- Updated Habits overview, calendar day cells, and weekly rows to use Material-friendly rounded controls.
- Disabled app audio initialization while running inside Kryon preview.
## [1.8.14] - 2026-08-06
### Changed
- Updated Kryon to the retro-only widget runtime while style selection is paused.
- Fixed deferred dropdown overlays so Inbe dropdown menus open above later controls.
- Restored practice carousel left/right navigation and kept session title bars using close buttons.
- Removed the app-level Animations setting and transition preference storage.
## [1.8.13] - 2026-08-05
### Changed
- Split cue and music volume controls so short practice cues stay on `sound_volume` while streamed meditation music uses the new persisted `music_volume` setting.
- Added an optional WHM retention 30-second marker, defaulting off, with controls in the WHM practice session settings.
- Moved background playback into Device settings and removed the standalone global Session settings tab.
- Updated practice music/settings UI and importable settings to include the new audio preferences, including a cue-volume test button.
## [1.8.12] - 2026-07-29
### Changed
- Fixed the Wim Hof between-round countdown: round 0 always counts down from 3 (the intentional 3-2-1), and rounds 1+ now honor the user's configured "Pause after round" setting. The breath engine now owns the full session state machine, so auto-play and manual round-advance share one path and final-round results are always persisted.
- Added desktop keyboard shortcuts for quitting the app: `Ctrl+Q` quits from any screen, and `Esc` quits when idle on the home screen (deeper screens keep their existing Esc behavior). On tray-enabled builds these go through the keep-running/quit prompt; without a tray they exit immediately, matching the window close button.
- Enabled WAL mode for app storage to improve database concurrency and read/write throughput.
## [1.8.11] - 2026-07-27
### Changed
- Reduced bundled font size by switching shipped UI fonts to Kryon-generated Noto subsets.
- Added Android system font fallback for arbitrary user-entered text while keeping embedded subsets for app UI and non-Android builds.
- Updated Kryon to provide shared font subsetting tooling and dynamic font fallback loading for downstream apps.
## [1.8.10] - 2026-07-26
### Changed
- Migrated `src/storage/import.c` to Kry (`import.kry`, transpiled to `import_impl.c`), following the established `db.kry` pattern; the hand-written `import.h` remains the public contract.
- Bumped the Kryon vendor to `22afa31` plus a one-line fix (`c26b7ec` on the `fix/platform-thread-stddef` branch) adding `#include <stddef.h>` to `platform_thread.c` so the web build can resolve `NULL`. The bump brings persistent text-input focus, a minimal Kry language (sugar verbs removed), and the new `WidgetButton` UI widget used by the practice screen.
- Fixed the web/emscripten build: `src/storage/sync_account.kry` now imports `<emscripten.h>` for its `#intrinsic "web"` declaration (which expands to `EM_ASM_INT`), matching the other two files using that intrinsic. This had broken the web build since the original Kry migration.
- Reworked the desktop close behavior: raylib's built-in ESC-to-exit is now disabled on native/desktop (ESC is handled per-screen, and close goes through our own keep-running/quit prompt when a tray is present); without a tray the window close button quits immediately.
- Habits editor: added description scroll state so long descriptions scroll correctly.
- Renamed a shadowed `text` parameter in `copy_text_checked` to `input` for clarity (meditation music path).
- Various screen and settings UI refinements across habits edit, pet, practice, profile, language, manual, and settings screens.
- Added `.zcode` to `.gitignore`.
### Note
- Meditation audio asset refresh is held back from this release (requires `git-lfs` to be installed locally before committing); will ship in a follow-up.
## [1.8.9] - 2026-07-17
### Changed
- Fixed Android native builds by embedding the current Noto font sources instead of stale generated `assets/fonts/ui.*` files.
- Fixed Android UI font loading by enabling TTF/OTF support in the Android raylib build.
- Updated sun-salutation assets to use pose sheets while keeping the figure setting focused on the man sequence for now.
- Improved release packaging automation, Linux package targets, and store metadata.
## [1.8.8] - 2026-07-13
### Changed
- Updated Flint icon integration to use categorized sprite sheets for app UI, language, payments, platforms, tiles, and profile pictures.
- Updated Inbe to use the new Flint icon categories and removed legacy eye icon usage.
- Fixed profile picture picker selection so it closes the picker, keeps the sidebar open, and does not click through to sidebar links.
## [1.8.7] - 2026-07-12
### Changed
- Fixed Firefox web persistence, mobile habit deletion, and customizable nav tap handling.
- Added a blank-home easter egg screen and updated embedded asset lists.
- Updated release and store packaging automation.
## [1.8.6] - 2026-07-11
### Changed
- Added Firefox add-on packaging, release metadata updates, and CI/release automation.
- Improved web audio asset validation and Firefox/LibreWolf smoke testing.
- Fixed stale screen-local modal state so hidden modals cannot keep input captured after navigation.
## [1.8.5] - 2026-07-11
### Changed
- Updated Flint to improve file dialogs, cursor behavior, focus reset, icon slider popups, and shared raylib build locking.
- Smoothed WHM breath and recovery countdown progress so the ring advances steadily during each breath and countdown.
- Improved session controls, release-store publishing files, and build packaging metadata.
## [1.8.4] - 2026-07-11
### Changed
- Reworked Profile configuration navigation to use a full-width dropdown instead of the tab bar.
- Updated sidebar return behavior for Profile and Settings flows.
- Updated Flint profile widgets and profile picture assets, including sidebar profile image sizing and picker scrolling.
## [1.8.3] - 2026-07-10
### Changed
- Improved ui in practice screen
## [1.8.2] - 2026-07-09
### Changed
- improved desktop experience
- add system themes
## [1.8.1] - 2026-07-03
### Fixed
- storage settings for android 17+
## [1.8.0] - 2026-07-02
### Changed
- upgrade to sync protocol v3
- ui fixes
## [1.7.12] - 2026-07-01
### Changed
- fix web
- deduplicate code
## [1.7.11] - 2026-07-01
### Addded
- add more banners
## [1.7.10] - 2026-07-01
### Changed
- updated whm banner
## [1.7.9] - 2026-07-01
### Fixed
- improve sync review
## [1.7.8] - 2026-07-01
### Changed
- Redesign the Practice home screen around carousel-style practice cards with explicit start, manual, configure, and music actions.
- Move meditation music configuration into a shared practice music panel with per-practice enablement and track selection.
## [1.7.7] - 2026-07-01
### Changed
- Move habit tracking overview out of Profile and into the Habits tab with direct day toggles, reorder controls, and local view persistence.
- Rework Settings into an overview page with section title bars and shared return/title bar UI.
## [1.7.6] - 2026-06-30
### Added
- habit overview
## [1.7.5] - 2026-06-29
### Fixed
- Fix Android 15 relaunch freeze.
- Code cleanup
## [1.7.4] - 2026-06-29
### Fixed
- Clean up practice stats, friend removal, sync review, and Android inset handling.
## [1.7.3] - 2026-06-29
### Fixed
- bottom inset in practice
### Changed
- Improve habit management
## [1.7.2] - 2026-06-29
### Added
- Add local `make install` target.
- Add Profile controls for habit ordering and practice visibility.
### Changed
- Move sync status into the Data view and simplify the habits add option.
- Clean up the README.
## [1.7.1] - 2026-06-28
### Changed
- Move shared Lyra sync protocol code into Flint and simplify Inbe sync client wiring.
## [1.7.0] - 2026-06-28
### Changed
- Rework Android safe-area handling to use one native inset path with stable bottom navigation spacing.
- Move leaderboard stats to synced source data, with local current-user rows shown immediately.
### Fixed
- Fix profile/friend sync freshness, leaderboard empty states, modal input capture, pet asset embedding, and wrapped text previews.
## [1.6.6] - 2026-06-28
### Changed
- updated the practice screen ui/ux
## [1.6.5] - 2026-06-28
### Fixed
- Repair habit-day sync for zero-count completions.
- Require liboqs at build time for every sync-enabled target.
## [1.6.4] - 2026-06-27
### Changed
- Move meditation duration selection into practice configuration with custom time support.
- Add centered in-session meditation add-time controls.
- Use Flint-managed liboqs, LibreSSL, and curl build paths.
### Fixed
- Fix Android native build to use Flint's liboqs submodule.
## [1.6.3] - 2026-06-27
### Changed
- Improve theme, habit, and localization UI polish
## [1.6.2] - 2026-06-27
### Changed
- Improve sun salutation
## [1.6.1] - 2026-06-27
### Changed
- Improved notification in session
- Standardized settings screen1
## [1.6.0] - 2026-06-26
### Added
- Sun Salutation practice with Yoga habit sync support.
### Changed
- Improve sync reliability and review handling.
## [1.5.9] - 2026-06-26
### Fixed
- Android session notification and wakelock for screen-locked playback
## [1.5.8] - 2026-06-25
### Fixed
- Background play for meditation practice
## [1.5.7] - 2026-06-25
- Fix test music
## [1.5.6] - 2026-06-24
### Fixed
- Modal button issue
## [1.5.5] - 2026-06-24
### Fixed
- modal capture bug
- fix sync diff
## [1.5.4] - 2026-06-24
### Changed
- Use Flint-managed modal handling so modal dialogs block background input consistently.
- Add optional sync account aliases, with compact public ID display and full ID reveal modal.
- Make sync state tracking more robust with snapshot hash checks and review flow for unresolved differences.
- Use Flint's built-in font chopping pipeline and verify multilingual locale glyph coverage.
## [1.5.3] - 2026-06-23
### Fixed
- modal issues
## [1.5.2] - 2026-06-23
### Changed
- let you disable screen transitions
- added theme modal
## [1.5.1] - 2026-06-22
### Fixed
- icon scaling
- fix inset bug
### Added
- toggle background music
## [1.5.0] - 2026-06-22
### Changed
- New logo
- improve tabbar ui
### Fixed
- sync issues
## [1.4.11] - 2026-06-21
### Added
- tab bar mode for habits and exercises
### Changed
- fix ut click file
## [1.4.10] - 2026-06-21
### Added
- Added guide to habits page
### Changed
- fix orientation issues
## [1.4.9] - 2026-06-21
### Fixed
- Fix Practice startup, manual navigation, configuration scrolling, and sync backfill issues.
- Add skip feature to on screen guide
## [1.4.8] - 2026-06-21
### Changed
- Fixed start screen
- Fixed schema on first sync
## [1.4.7] - 2026-06-21
### Changed
- Rework Practice into Manual, start, and configuration tabs with a new localized first-run guide.
- Simplify Meditation's manual to one page and make bottom navigation more compact.
## [1.4.6] - 2026-06-20
### Changed
- Move habit weekly, monthly, statistics, and edit views into icon tabs under the habit selector.
- Improve Flint form, modal, tab, and scrollbar widgets for measured layouts and cleaner scrolling.
### Fixed
- Prevent habit info modal text from overlapping the OK button.
## [1.4.5] - 2026-06-20
### Changed
- Fix spacing issues and translations
## [1.4.4] - 2026-06-20
### Added
- Add Russian localization.
- Add a habit stats view with streak, recent activity, weekday, and linked-practice diagrams.
- Add optional in-session volume controls, hidden by default.
- Add Mint and Cobalt themes.
### Changed
- Use one canonical pixel font atlas with Flint-managed DPI scaling and cleaner title sizing.
- Simplify habit counting so multiple counts are opt-in and independent of linked practices.
- Improve habit weekly/calendar spacing, mobile calendar touch feedback, and theme picker ordering.
- Reorganize repeated screen UI into reusable Flint helpers.
### Fixed
- Build the Ubuntu Touch Click package with the OpenStore package id
- Refactor code base
- Sync habit multiple-count settings correctly across clients and preserve queued local habit edits.
- Preserve linked session day behavior while hiding redundant count badges.
## [1.4.3] - 2026-06-20
### Fixed
- Refresh expired native sync auth tokens before sending queued changes.
- Require first-time meditation users to continue through the tutorial before starting.
## [1.4.2] - 2026-06-20
### Fixed
- Improve sync auth, websocket reconnects, and queued habit/session updates.
- Reduce SQLite-related UI flicker and speed up bulk import sync queueing.
- Fixed dropdown menus so temporary option lists cannot crash theme/device selection.
- Fixed Linux test and release builds to link against the vendored curl library path.
## [1.4.1] - 2026-06-19
### Changed
- Improve account management
## [1.4.0] - 2026-06-19
### Added
- optional sync client, offline account creation
- simplify tutorial
## [1.3.6] - 2026-06-18
### Fixed
- Fixed Tickmate `.db` imports so zero-based months map correctly and long habit histories load without dropping later dates.
## [1.3.5] - 2026-06-18
### Fixed
- Improved Android data import for `.db` backups, weekly habit rows, and import conflict handling.
## [1.3.4] - 2026-06-18
### Changed
- Reorganized WHM and Meditation into practice-owned modules for cleaner code boundaries.
- Split the meditation manual into an image intro page and a shorter music/gong setup page.
- Expanded release automation to build Web, Linux AppImage, Windows, APK, and AAB artifacts after tests pass.
## [1.3.3] - 2026-06-17
### Fixed
- Import now restores habits, habit sync settings, and optionally app settings from Inbe SQLite exports.
## [1.3.2] - 2026-06-17
### Fixed
- Unified scroll containers so content stays out of scrollbar tracks and scroll positions clamp cleanly at the bottom.
- Android meditation audio downloads now show a localized network-permission/connectivity modal when the host cannot be resolved.
- Windows builds now support runtime meditation audio downloads.
## [1.3.1] - 2026-06-17
### Fixed
-1
View File
@@ -1 +0,0 @@
include Makefile
+17 -24
View File
@@ -1,28 +1,21 @@
BSD 3-Clause License
MIT License
Copyright (c) 2026, waozi
Copyright (c) 2026 waozi
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+204 -1216
View File
File diff suppressed because it is too large. Load diff
+61 -203
View File
@@ -1,230 +1,88 @@
# Inner Breeze
Inner Breeze is a free, open-source app for breathing, meditation, and habit tracking.
Inner Breeze is a free, open-source practice app for breathing, meditation, and habit tracking.
## Build
## Features
Build with the system toolchain and project Makefile:
- Guided practice sessions with visual and audio cues
- Mind, Yoga, and Fitness organization for habits and practice views
- Configurable breathing sessions and meditation timers
- Habit tracking with session history
- Local SQLite storage with import/export support
- Theme customization with light and dark variants
- Touch-optimized UI for desktop and mobile
## Building
inbe uses [raylib](https://github.com/raysan5/raylib) and requires a Nix development environment.
### Prerequisites
- [Nix](https://nixos.org/download.html) with flakes enabled
- For Android builds: Java 17+ JDK
### Native Build
```bash
# Enter the development shell
nix develop
# Build for your current platform
make native
# Run
make run
```
On FreeBSD, use GNU Make:
```bash
gmake native
gmake run
```
To debug Inbe against the root Kryon checkout instead of the vendored
submodule, override `KRYON_DIR`:
```bash
make run KRYON_DIR=../kryon
```
On FreeBSD:
```bash
gmake run KRYON_DIR=../kryon
```
Use this only for local debugging. Permanent Kryon fixes should be committed in
the root Kryon repository and then brought into Inbe by updating
`vendor/kryon`.
Native binaries are written to `build/bin/<platform>/`, for example
`build/bin/freebsd/inbe-freebsd-x86_64` on FreeBSD.
Install into the system prefix:
```bash
make install
```
By default this installs the binary, desktop entry, icon, and AppStream
metadata under `/usr/local`. Use `DESTDIR` for staged/package installs, or
`PREFIX` to choose another install root.
Install for only the current user:
```bash
make install-user
```
This installs under `~/.local`, including the desktop entry and icon.
## FreeBSD Package
Build a native FreeBSD package from inside the repo:
```bash
gmake package-freebsd
```
The package is written to `build/dist/freebsd/`, for example:
```bash
build/dist/freebsd/inbe-1.8.3-freebsd-x86_64.pkg
```
Install it with FreeBSD `pkg`:
```bash
sudo pkg install -y ./build/dist/freebsd/inbe-1.8.3-freebsd-x86_64.pkg
```
The package installs the `inbe` command plus desktop integration for menus such
as Xfce: `Inner Breeze` appears from the `.desktop` file, uses the bundled icon,
and includes AppStream metadata.
## Other Targets
General:
```bash
make test
make dist
make clean
```
Native desktop:
```bash
make native
make run
make install-user
make uninstall
```
FreeBSD:
```bash
gmake package-freebsd
```
Android:
### Cross-Platform Builds
```bash
# Android debug APK
make android-debug
make android-release
make android-bundle
# Android release APK
make android-release PASSWORD=your-keystore-password
```
Web:
### Android Emulator Testing
For automated testing with camera notch (cutout) support:
```bash
make web
make site
make chrome-web-store
make firefox-addons
# Enter the development shell and run everything automatically
nix develop
./scripts/emulator.sh # Creates and launches the test AVD
make android-install # Builds, installs, and launches the app
```
Firefox add-on source-review build:
This single script handles:
- AVD creation (if missing)
- Emulator launch
- APK build
- App installation and launch
```bash
sh scripts/build-firefox-addons-source.sh
```
The AVD is configured with:
- **Device**: Pixel 6 (punch-hole camera style)
- **Display**: 1080×2400 @ 420dpi
- **RAM**: 4GB with hardware acceleration
- **Cutout**: Punch-hole camera for testing window insets
The Firefox reviewer build script creates `build/dist/inbe-firefox-addons.zip`
and runs Mozilla `addons-linter`. Environment requirements and step-by-step
reviewer notes are documented in `packaging/firefox-addons/README.md`.
### Platform-Specific Notes
Firefox source upload zip:
- **Linux**: Requires SDL2 runtime libraries
- **Windows**: Standalone executable, no dependencies
- **Android**: Requires Android NDK in the development shell
- **Web**: Requires Emscripten toolchain
```bash
make firefox-addons-source-zip
```
## Project Structure
This creates `build/dist/inbe-firefox-addons-source.zip`.
Linux:
```bash
make appimage
```
Ubuntu Touch:
```bash
make click
```
Windows:
```bash
make windows
```
Common outputs:
- `make native` builds `build/bin/<platform>/inbe-<platform>-<arch>`.
- `make appimage` builds a Linux AppImage under `build/dist/linux/`.
- `make web` builds and smoke-tests the web app, then writes `build/dist/inbe-web.zip`.
- `make windows` builds 64-bit and 32-bit Windows binaries and writes a zip under `build/dist/windows/`.
- `make click` builds the Ubuntu Touch Click package under `build/dist/click/`.
- `make dist` builds release artifacts; Android release targets require `PASSWORD`.
## Android
Build a debug APK:
```bash
make android-debug
```
Create and launch an Android 17/API 37.1 AVD for Pixel storage testing:
```bash
ANDROID_API=37.1 bash scripts/create-avd.sh inbe-android-37-1
AVD_NAME=inbe-android-37-1 bash scripts/emulator.sh
```
Android 17 system images are listed by Google as `android-37.0`,
`android-37.1`, and `android-CinnamonBun`. The repo AVD script supports the
16 KB page-size image types such as `google_apis_playstore_ps16k`.
Native Android storage must use the app's private internal data directory from
`ANativeActivity->internalDataPath`, not the process working directory. Inbe's
SQLite database lives under that app-private root and is removed when the app is
uninstalled.
## Project Layout
- `src/` - app code
- `assets/` - images, fonts, and sounds
- `locales/` - translations
- `droid/` - Android project
- `site/` - website
- `vendor/kryon/` - Kryon UI/runtime submodule
## Notes
Inbe stores app data locally in SQLite. Optional sync can mirror user-owned
data through a Ksync-compatible sync server.
## Support
Monero:
```text
48ms5LfFrPJ2LUvqP9Mm5BhDSnZnqu14jB8XpAukw3jDBKxRAxYvq3k4fEwXY7kCY3LrtycMUayJZR1YJuyvJHCDCcyw6pA
```
Bitcoin:
```text
bc1qxzcetg50f6epgddc09n82xqn3zswlmk44235y5
```
Lightning:
```text
[email protected]
```
- `src/` - Inbe application code
- `flint/` - first-party UI/runtime support code used directly by Inbe
- `vendor/` - external third-party dependencies
- `wasm4/` - Standalone WASM-4 version
- `assets/` - Images and sounds
- `droid/` - Android build configuration
## License
BSD 3-Clause. See [LICENSE](LICENSE).
MIT - see [LICENSE](LICENSE)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 995 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

-13
View File
@@ -1,13 +0,0 @@
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
 
ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞß
àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ
ĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚě
ĞğĪīŁłŃńŇňŌōŘřŚśŞşŠšŤťŪūŮůŰűŹźŻżŽž
АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ
абвгдеёжзийклмнопрстуфхцчшщъыьэюя
。,、!?:;()[]「」『』ー〜・
中文简体繁體日本語한국어
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

+8 -27
View File
@@ -1,20 +1,16 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
namespace 'xyz.waozi.inbe'
compileSdk 36
ndkVersion "28.2.13676358"
compileSdk 35
ndkVersion "25.1.8937393"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
def keystorePropsFile = rootProject.file("local.properties")
def keystoreProps = new Properties()
@@ -22,7 +18,7 @@ android {
keystoreProps.load(new FileInputStream(keystorePropsFile))
}
def getKeystorePath = { -> project.findProperty('keystore.path') ?: keystoreProps['keystore.path'] ?: System.getenv("HOME") + "/.android/kryon-release.keystore" }
def getKeystorePath = { -> project.findProperty('keystore.path') ?: keystoreProps['keystore.path'] ?: System.getenv("HOME") + "/.android/flint-release.keystore" }
def getKeystoreAlias = { -> project.findProperty('keystore.alias') ?: keystoreProps['keystore.alias'] ?: "inbe-key" }
def releasePassword = project.findProperty('keystore.password') ?: ""
@@ -37,18 +33,10 @@ android {
}
defaultConfig {
minSdk 21
targetSdk 36
versionCode 101
versionName "1.9.2"
externalNativeBuild {
cmake {
if (System.getProperty('os.name').toLowerCase().contains('freebsd')) {
arguments '-DANDROID_HOST_TAG=linux-x86_64',
'-DANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON'
}
}
}
minSdk 19
targetSdk 35
versionCode 30
versionName "1.3.2"
}
@@ -65,6 +53,7 @@ android {
externalNativeBuild {
cmake {
path 'src/main/cpp/CMakeLists.txt'
version '3.22.1'
}
}
@@ -80,12 +69,6 @@ android {
dependenciesInfo {
includeInApk = false
}
packaging {
jniLibs {
useLegacyPackaging = true
}
}
}
gradle.taskGraph.whenReady { taskGraph ->
@@ -98,6 +81,4 @@ gradle.taskGraph.whenReady { taskGraph ->
dependencies {
implementation 'androidx.core:core:1.12.0'
implementation 'org.unifiedpush.android:connector:3.3.3-rc1'
implementation 'androidx.health.connect:connect-client:1.1.0'
}
+2 -71
View File
@@ -1,23 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<!-- connect-client needs API 26; on older devices the export button is a
no-op (runtime SDK guard in HealthConnectExport). -->
<uses-sdk tools:overrideLibrary="androidx.health.connect.client" />
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
<!-- Health Connect one-way session export (Data & export settings). -->
<uses-permission android:name="android.permission.health.EXERCISE" />
<uses-permission android:name="android.permission.health.MINDFULNESS" />
<queries>
<package android:name="com.google.android.apps.healthdata" />
<intent>
<action android:name="androidx.health.ACTION_SHOW_PERMISSIONS_RATIONALE" />
</intent>
</queries>
<application
android:hasCode="true"
android:icon="@mipmap/ic_launcher"
@@ -25,38 +10,19 @@
android:roundIcon="@mipmap/ic_launcher_round">
<activity
android:name="xyz.waozi.inbe.MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize|uiMode"
android:configChanges="orientation|keyboardHidden|screenSize|uiMode"
android:exported="true"
android:launchMode="singleTask"
android:theme="@android:style/Theme.DeviceDefault.NoActionBar"
android:windowLayoutInDisplayCutoutMode="never">
<meta-data
android:name="android.app.lib_name"
android:value="main" />
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- Health Connect: app info can deep-link to the permissions page. -->
<intent-filter>
<action android:name="androidx.health.ACTION_SHOW_PERMISSIONS_RATIONALE" />
</intent-filter>
</activity>
<!-- Health Connect on API 34+ routes the rationale through this alias. -->
<activity-alias
android:name="ViewPermissionActivity"
android:exported="true"
android:permission="android.permission.START_VIEW_PERMISSION_USAGE"
android:targetActivity="xyz.waozi.inbe.MainActivity">
<intent-filter>
<action android:name="androidx.health.ACTION_SHOW_PERMISSIONS_RATIONALE" />
</intent-filter>
</activity-alias>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="xyz.waozi.inbe.fileprovider"
@@ -66,40 +32,5 @@
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
<receiver
android:name="xyz.waozi.inbe.StartPracticeWidget"
android:exported="false"
android:label="@string/widget_breathe_label">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_breathe_info" />
</receiver>
<service
android:name="xyz.waozi.inbe.StartPracticeTile"
android:exported="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/tile_breathe_label"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>
<service
android:name="xyz.waozi.inbe.SessionForegroundService"
android:exported="false"
android:foregroundServiceType="mediaPlayback" />
<service
android:name="xyz.waozi.inbe.PushServiceImpl"
android:exported="false">
<intent-filter>
<action android:name="org.unifiedpush.android.connector.PUSH_EVENT" />
</intent-filter>
</service>
</application>
</manifest>
+34 -127
View File
@@ -1,121 +1,27 @@
cmake_minimum_required(VERSION 3.22)
project(Inbe C)
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM AND EXISTS "${CCACHE_PROGRAM}")
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
else()
set(CMAKE_C_COMPILER_LAUNCHER "")
set(CMAKE_C_COMPILER_LAUNCHER "" CACHE STRING "" FORCE)
endif()
set(REPO_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../../../..")
set(SRC_DIR "${REPO_ROOT}/src")
set(KRYON_DIR "${REPO_ROOT}/vendor/kryon")
set(RAYLIB_DIR "${KRYON_DIR}/vendor/raylib/src")
set(RAYLIB_DIR "${REPO_ROOT}/vendor/raylib/src")
set(FLINT_DIR "${REPO_ROOT}/flint")
set(SQLITE_DIR "${REPO_ROOT}/vendor/sqlite")
set(SQLITE_BUILD_DIR "${CMAKE_BINARY_DIR}/sqlite")
set(SQLITE_AMALGAMATION_C "${SQLITE_BUILD_DIR}/sqlite3.c")
set(SQLITE_AMALGAMATION_H "${SQLITE_BUILD_DIR}/sqlite3.h")
set(NATIVE_APP_GLUE_DIR "${ANDROID_NDK}/sources/android/native_app_glue")
set(OQS_BUILD_ONLY_LIB ON CACHE BOOL "" FORCE)
set(OQS_USE_OPENSSL OFF CACHE BOOL "" FORCE)
set(OQS_MINIMAL_BUILD "SIG_ml_dsa_44" CACHE STRING "" FORCE)
set(OQS_DIST_BUILD OFF CACHE BOOL "" FORCE)
set(OQS_OPT_TARGET generic CACHE STRING "" FORCE)
foreach(oqs_x86_feature
ADX AES AVX AVX2 AVX512 AVX512BW AVX512DQ AVX512F
BMI1 BMI2 FMA PCLMULQDQ POPCNT SSE SSE2 SSE3 VPCLMULQDQ)
set(OQS_USE_${oqs_x86_feature}_INSTRUCTIONS OFF CACHE BOOL "" FORCE)
endforeach()
add_subdirectory("${KRYON_DIR}/vendor/liboqs" "${CMAKE_BINARY_DIR}/liboqs")
if(NOT TARGET oqs)
message(FATAL_ERROR "Inbe Android builds require liboqs for sync account crypto")
endif()
file(GLOB_RECURSE KRYON_SOURCES CONFIGURE_DEPENDS "${KRYON_DIR}/src/*.c")
list(REMOVE_ITEM KRYON_SOURCES "${KRYON_DIR}/src/file_dialog/file_dialog.c")
# The src/backend/ software renderer implements raylib-named functions
# (math, input, drawing) for no-raylib hosts; Android links real raylib, so
# compiling both is a duplicate-symbol link error. Only krb.c (cartridge
# tooling) uses the backend API.
list(FILTER KRYON_SOURCES EXCLUDE REGEX "${KRYON_DIR}/src/backend/.*")
# inbe is a UI-only app: drop the 2D physics subsystem (Box2D). Mirror the
# KRYON_PHYSICS_SRCS filter the desktop Makefile applies via vendor.mk.
list(REMOVE_ITEM KRYON_SOURCES
"${KRYON_DIR}/src/scene/physics_world.c"
"${KRYON_DIR}/src/scene/node_body2d.c"
"${KRYON_DIR}/src/scene/node_area2d.c"
"${KRYON_DIR}/src/scene/node_collision_shape2d.c")
file(GLOB KRYON_K2C_SOURCES CONFIGURE_DEPENDS "${KRYON_DIR}/cmd/k2c/*.c")
list(APPEND KRYON_K2C_SOURCES
"${KRYON_DIR}/cmd/kir/kir.c"
"${KRYON_DIR}/cmd/kir/kir_parse.c")
find_program(HOST_CC NAMES cc clang gcc REQUIRED)
set(KRYON_K2C "${CMAKE_BINARY_DIR}/host-tools/k2c")
# needs the kir headers on the include path
set(INBE_KRY_GEN_DIR "${CMAKE_BINARY_DIR}/kryon/generated")
file(GLOB_RECURSE INBE_KRY_SOURCES CONFIGURE_DEPENDS "${SRC_DIR}/*.kry")
list(SORT INBE_KRY_SOURCES)
# App-layer sources are cross-platform modules that belong in every build.
# Glob them so adding an app .c file needs no edit here -- this list had
# drifted out of sync with the Makefile APP_SRCS more than once.
file(GLOB APP_C_SOURCES CONFIGURE_DEPENDS "${SRC_DIR}/app/*.c")
list(SORT APP_C_SOURCES)
set(INBE_KRY_GENERATED_SOURCES)
set(INBE_KRY_GENERATED_HEADERS)
set(INBE_KRY_COMMAND_SOURCES)
foreach(kry_source ${INBE_KRY_SOURCES})
file(RELATIVE_PATH kry_rel "${REPO_ROOT}" "${kry_source}")
list(APPEND INBE_KRY_COMMAND_SOURCES "${kry_rel}")
get_filename_component(kry_rel_dir "${kry_rel}" DIRECTORY)
get_filename_component(kry_name "${kry_rel}" NAME_WE)
set(kry_output_c "${INBE_KRY_GEN_DIR}/${kry_rel_dir}/${kry_name}.c")
set(kry_output_h "${INBE_KRY_GEN_DIR}/${kry_rel_dir}/${kry_name}.h")
list(APPEND INBE_KRY_GENERATED_SOURCES "${kry_output_c}")
list(APPEND INBE_KRY_GENERATED_HEADERS "${kry_output_h}")
endforeach()
set(INBE_KRY_PROJECT_HEADER "${INBE_KRY_GEN_DIR}/kryon_project.h")
add_custom_command(
OUTPUT ${INBE_KRY_GENERATED_SOURCES} ${INBE_KRY_GENERATED_HEADERS} "${INBE_KRY_PROJECT_HEADER}"
COMMAND ${CMAKE_COMMAND} -E remove_directory "${INBE_KRY_GEN_DIR}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${INBE_KRY_GEN_DIR}"
COMMAND "${KRYON_K2C}" --root "${REPO_ROOT}" -o "${INBE_KRY_GEN_DIR}" ${INBE_KRY_COMMAND_SOURCES}
DEPENDS ${INBE_KRY_SOURCES} "${KRYON_K2C}"
WORKING_DIRECTORY "${REPO_ROOT}"
VERBATIM
)
add_custom_command(
OUTPUT "${KRYON_K2C}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/host-tools"
# VERBATIM escapes embedded quotes, so unquoted -I paths (no spaces here)
COMMAND "${HOST_CC}" -Wall -Wextra -O2 -I${KRYON_DIR}/cmd/kir -I${KRYON_DIR}/cmd/k2c -o "${KRYON_K2C}" ${KRYON_K2C_SOURCES}
DEPENDS ${KRYON_K2C_SOURCES}
VERBATIM
)
add_custom_target(inbe_kry_generated DEPENDS
${INBE_KRY_GENERATED_SOURCES}
${INBE_KRY_GENERATED_HEADERS}
"${INBE_KRY_PROJECT_HEADER}"
)
file(GLOB FLINT_SOURCES CONFIGURE_DEPENDS "${FLINT_DIR}/src/*.c")
list(REMOVE_ITEM FLINT_SOURCES "${FLINT_DIR}/src/flint_file_dialog.c")
file(GLOB INBE_LOCALE_ASSETS RELATIVE "${REPO_ROOT}" CONFIGURE_DEPENDS "${REPO_ROOT}/locales/*.txt")
file(GLOB INBE_SOUND_ASSETS RELATIVE "${REPO_ROOT}" CONFIGURE_DEPENDS "${REPO_ROOT}/assets/sounds/*.ogg")
file(GLOB INBE_PRACTICE_BANNER_ASSETS RELATIVE "${REPO_ROOT}" CONFIGURE_DEPENDS "${REPO_ROOT}/assets/practices/*/banner.png")
set(INBE_EMBEDDED_INPUTS
${INBE_LOCALE_ASSETS}
assets/easteregg/art.png
assets/easteregg/waozi.png
assets/practices/whm/1.png
assets/practices/whm/2.png
assets/practices/meditation/1.png
assets/pet/egg1.png
${INBE_PRACTICE_BANNER_ASSETS}
assets/practices/sunsalutation/poses_man_sheet.png
assets/practices/sunsalutation/poses_woman_sheet.png
assets/fonts/subset/NotoSans-Inbe-Regular.ttf
assets/fonts/subset/NotoSansSC-Inbe-Regular.otf
assets/fonts/subset/NotoSansJP-Inbe-Regular.otf
assets/fonts/subset/NotoSansKR-Inbe-Regular.otf
assets/fonts/subset/NotoSansTC-Inbe-Regular.otf
assets/whm/1.jpg
assets/whm/2.jpg
assets/fonts/locales.png
assets/fonts/locales.dat
assets/fonts/locales-8.png
assets/fonts/locales-8.dat
${INBE_SOUND_ASSETS}
)
set(INBE_EMBEDDED_DEPS)
@@ -126,8 +32,8 @@ set(INBE_EMBEDDED_ASSETS_C "${CMAKE_BINARY_DIR}/inbe_embedded_assets.c")
add_custom_command(
OUTPUT "${INBE_EMBEDDED_ASSETS_C}"
COMMAND sh "${KRYON_DIR}/scripts/embed-assets.sh" "${INBE_EMBEDDED_ASSETS_C}" ${INBE_EMBEDDED_INPUTS}
DEPENDS "${KRYON_DIR}/scripts/embed-assets.sh" ${INBE_EMBEDDED_DEPS}
COMMAND sh "${FLINT_DIR}/scripts/embed-assets.sh" "${INBE_EMBEDDED_ASSETS_C}" ${INBE_EMBEDDED_INPUTS}
DEPENDS "${FLINT_DIR}/scripts/embed-assets.sh" ${INBE_EMBEDDED_DEPS}
WORKING_DIRECTORY "${REPO_ROOT}"
VERBATIM
)
@@ -160,7 +66,7 @@ target_compile_definitions(raylib PRIVATE
SUPPORT_FILEFORMAT_GIF=0
SUPPORT_FILEFORMAT_QOI=0
SUPPORT_FILEFORMAT_DDS=0
SUPPORT_FILEFORMAT_TTF=1
SUPPORT_FILEFORMAT_TTF=0
SUPPORT_FILEFORMAT_JPG=1
SUPPORT_FILEFORMAT_PNG=1
SUPPORT_FILEFORMAT_OGG=1
@@ -180,45 +86,51 @@ target_include_directories(raylib PUBLIC
add_library(main SHARED
"${SRC_DIR}/main.c"
${APP_C_SOURCES}
"${SRC_DIR}/core/breath_engine.c"
"${SRC_DIR}/app/app.c"
"${SRC_DIR}/app/device_preferences.c"
"${SRC_DIR}/session/session.c"
"${SRC_DIR}/screens/habits_screen.c"
"${SRC_DIR}/session/meditation_music.c"
"${SRC_DIR}/core/locale.c"
"${SRC_DIR}/core/theme.c"
"${SRC_DIR}/storage/data.c"
"${SRC_DIR}/storage/storage.c"
"${SRC_DIR}/storage/sync_client.c"
"${SRC_DIR}/third_party/miniz.c"
"${SQLITE_AMALGAMATION_C}"
"${SRC_DIR}/platform/android/android_device.c"
"${SRC_DIR}/platform/android/android_import.c"
"${SRC_DIR}/platform/android/android_runtime_assets.c"
"${SRC_DIR}/platform/android/android_share.c"
"${SRC_DIR}/screens/practice_screen.c"
"${SRC_DIR}/screens/language_screen.c"
"${SRC_DIR}/screens/manual_screen.c"
"${SRC_DIR}/screens/settings/settings_screen.c"
"${INBE_EMBEDDED_ASSETS_C}"
${INBE_KRY_GENERATED_SOURCES}
${KRYON_SOURCES}
${FLINT_SOURCES}
"${SRC_DIR}/platform/android/android_insets.c"
"${SRC_DIR}/platform/android/android_wakelock.c"
"${SRC_DIR}/platform/android/android_timer.c"
"${NATIVE_APP_GLUE_DIR}/android_native_app_glue.c"
)
add_dependencies(main inbe_kry_generated)
target_include_directories(main PRIVATE
"${KRYON_DIR}/include"
"${KRYON_DIR}/src"
"${SRC_DIR}"
"${SRC_DIR}/app"
"${SRC_DIR}/core"
"${SRC_DIR}/screens"
"${SRC_DIR}/screens/settings"
"${SRC_DIR}/practices"
"${SRC_DIR}/practices/whm"
"${SRC_DIR}/practices/meditation"
"${SRC_DIR}/practices/sun_salutation"
"${SRC_DIR}/session"
"${SRC_DIR}/storage"
"${SRC_DIR}/platform/android"
"${SRC_DIR}/third_party"
"${INBE_KRY_GEN_DIR}"
"${INBE_KRY_GEN_DIR}/src"
"${NATIVE_APP_GLUE_DIR}"
"${FLINT_DIR}/include"
"${SQLITE_BUILD_DIR}"
)
target_compile_definitions(main PRIVATE
PLATFORM_ANDROID
ANDROID_BUILD=1
_DEFAULT_SOURCE
_GNU_SOURCE
_FILE_OFFSET_BITS=64
@@ -228,9 +140,7 @@ target_compile_definitions(main PRIVATE
MG_ENABLE_POSIX_FS=0
SUPPORT_MODULE_RAUDIO=1
SUPPORT_FILEFORMAT_OGG=1
UI_EMBEDDED_ONLY=1
HAS_LIBOQS=1
KRYON_WITH_PHYSICS=0
FLINT_EMBEDDED_ONLY=1
)
target_compile_options(main PRIVATE
@@ -243,14 +153,11 @@ target_compile_options(main PRIVATE
target_link_options(main PRIVATE
-Wl,--gc-sections
-Wl,--strip-all
-Wl,-z,max-page-size=16384
-Wl,-z,common-page-size=16384
-Wl,--wrap=fopen
)
target_link_libraries(main
raylib
oqs
android
log
OpenSLES
@@ -1,160 +0,0 @@
package xyz.waozi.inbe
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Handler
import android.os.Looper
import android.widget.Toast
import androidx.health.connect.client.feature.ExperimentalMindfulnessSessionApi
import androidx.health.connect.client.HealthConnectClient
import androidx.health.connect.client.PermissionController
import androidx.health.connect.client.permission.HealthPermission
import androidx.health.connect.client.records.ExerciseSessionRecord
import androidx.health.connect.client.records.MindfulnessSessionRecord
import androidx.health.connect.client.records.Record
import androidx.health.connect.client.records.metadata.Metadata as HcMetadata
import java.io.File
import java.time.Instant
import kotlin.coroutines.Continuation
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.EmptyCoroutineContext
import kotlin.coroutines.startCoroutine
/**
* One-way push of finished inbe sessions into Health Connect: meditation
* and the breathwork practices become mindfulness sessions (meditation /
* breathing types), sun salutation becomes a yoga exercise session. The
* native side writes the session list (start,end,activity per CSV line);
* this object owns permissions, the incremental export marker and the
* result toasts.
*/
@OptIn(ExperimentalMindfulnessSessionApi::class)
object HealthConnectExport {
const val REQUEST_CODE = 1003
private val PERMISSIONS = setOf(
HealthPermission.getWritePermission(ExerciseSessionRecord::class),
HealthPermission.getWritePermission(MindfulnessSessionRecord::class))
private val contract = PermissionController.createRequestPermissionResultContract()
/** Called from native settings via JNI; must run on the UI thread. */
@JvmStatic
fun start(activity: MainActivity, csvPath: String?) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O ||
HealthConnectClient.getSdkStatus(activity) != HealthConnectClient.SDK_AVAILABLE) {
toast(activity, activity.getString(R.string.health_connect_unavailable))
return
}
activity.startActivityForResult(contract.createIntent(activity, PERMISSIONS), REQUEST_CODE)
activity.lastHealthConnectPath = csvPath
}
@JvmStatic
fun handleResult(activity: Activity, resultCode: Int, data: Intent?, csvPath: String?) {
if (resultCode != Activity.RESULT_OK) {
toast(activity, activity.getString(R.string.health_connect_cancelled))
return
}
val granted = contract.parseResult(resultCode, data)
if (!granted.containsAll(PERMISSIONS)) {
toast(activity, activity.getString(R.string.health_connect_denied))
return
}
if (csvPath == null) {
toast(activity, activity.getString(R.string.health_connect_failed))
return
}
Thread {
try {
val count = export(activity, csvPath)
val message = activity.getString(
if (count > 0) R.string.health_connect_exported
else R.string.health_connect_nothing_new, count)
toast(activity, message)
} catch (e: SecurityException) {
toast(activity, activity.getString(R.string.health_connect_denied))
} catch (e: Exception) {
toast(activity, activity.getString(R.string.health_connect_failed))
}
}.start()
}
private fun export(context: Context, csvPath: String): Int {
val client = HealthConnectClient.getOrCreate(context)
val prefs = context.getSharedPreferences("health_connect", Context.MODE_PRIVATE)
val marker = prefs.getLong("last_export", 0L)
val records = mutableListOf<Record>()
var maxEnd = marker
for (line in File(csvPath).readLines().drop(1)) {
val parts = line.split(',')
if (parts.size < 3) continue
val start = parts[0].toLongOrNull() ?: continue
val end = parts[1].toLongOrNull() ?: continue
val activityId = parts[2].toIntOrNull() ?: continue
if (end <= marker || end <= start) continue
maxEnd = maxOf(maxEnd, end)
val startTime = Instant.ofEpochSecond(start)
val endTime = Instant.ofEpochSecond(end)
if (activityId == 2) {
records.add(
ExerciseSessionRecord(
startTime = startTime,
startZoneOffset = null,
endTime = endTime,
endZoneOffset = null,
metadata = HcMetadata.manualEntry(),
exerciseType = ExerciseSessionRecord.EXERCISE_TYPE_YOGA,
title = context.getString(R.string.health_connect_title_yoga)))
} else {
records.add(
MindfulnessSessionRecord(
startTime = startTime,
startZoneOffset = null,
endTime = endTime,
endZoneOffset = null,
metadata = HcMetadata.manualEntry(),
mindfulnessSessionType =
if (activityId == 1) MindfulnessSessionRecord.MINDFULNESS_SESSION_TYPE_MEDITATION
else MindfulnessSessionRecord.MINDFULNESS_SESSION_TYPE_BREATHING,
title =
if (activityId == 1) context.getString(R.string.health_connect_title_meditation)
else context.getString(R.string.health_connect_title_breathing)))
}
}
if (records.isEmpty()) return 0
runSuspend { client.insertRecords(records) }
prefs.edit().putLong("last_export", maxEnd).apply()
return records.size
}
/**
* Runs a suspend call to completion on the current (background) thread
* without pulling in kotlinx-coroutines: the stdlib startCoroutine
* trampoline plus a latch.
*/
private fun <T> runSuspend(block: suspend () -> T): T {
val latch = java.util.concurrent.CountDownLatch(1)
var outcome: Result<T>? = null
block.startCoroutine(object : Continuation<T> {
override val context: CoroutineContext
get() = EmptyCoroutineContext
override fun resumeWith(result: Result<T>) {
outcome = result
latch.countDown()
}
})
latch.await()
return outcome!!.getOrThrow()
}
private fun toast(context: Context, text: String) {
Handler(Looper.getMainLooper()).post {
Toast.makeText(context, text, Toast.LENGTH_LONG).show()
}
}
}
@@ -10,75 +10,50 @@ import android.content.pm.PackageManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.graphics.Insets;
import android.net.Uri;
import android.widget.Toast;
import android.app.AlertDialog;
import java.io.File;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;
import org.unifiedpush.android.connector.UnifiedPush;
import android.os.Build;
import android.os.Bundle;
import android.os.PowerManager;
import android.util.Log;
import android.webkit.MimeTypeMap;
import android.view.DisplayCutout;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewTreeObserver;
import android.util.DisplayMetrics;
import android.view.WindowInsets;
import android.view.WindowInsetsController;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import androidx.core.view.WindowCompat;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.net.URL;
import java.util.Arrays;
public class MainActivity extends NativeActivity {
private static final String TAG = "InbeMainActivity";
private static final int REQUEST_IMPORT_ZIP = 1001;
private static final int REQUEST_POST_NOTIFICATIONS = 1002;
private static final int REQUEST_HEALTH_CONNECT = HealthConnectExport.REQUEST_CODE;
private static final String DOWNLOAD_CHANNEL_ID = "runtime_downloads";
private static final int DOWNLOAD_NOTIFICATION_ID = 2001;
/** Fired by the home-screen widget, the quick-settings tile and the launcher shortcuts. */
public static final String ACTION_START_PRACTICE = "xyz.waozi.inbe.action.START_PRACTICE";
public static final String EXTRA_PRACTICE_ID = "practice_id";
static {
System.loadLibrary("main");
}
// [status_bar, nav_bar, cutouts] mirrored in native.
// [status_bar, nav_bar, cutout_left, cutout_top, cutout_right, cutout_bottom]
private final int[] cachedInsets = new int[6];
private boolean insetsInitialized = false;
private PowerManager.WakeLock wakeLock = null;
private boolean activityPaused = false;
private boolean windowFocused = true;
private boolean backgroundExecutionActive = false;
private boolean autoPausedForLifecycle = false;
private boolean notificationPermissionRequestInFlight = false;
private int lastDeleteRepeatCount = -1;
private int pendingImportKind = 0;
String lastHealthConnectPath = null;
private boolean pendingStartPractice = false;
private int pendingStartPracticeId = -1;
private native void nativeSetInsets(int status, int nav,
int cutoutLeft, int cutoutTop, int cutoutRight, int cutoutBottom);
private native void nativeSetDeviceDensity(float density);
private native void nativeSetSystemDark(int dark);
private native void nativeSetOrientation(int orientation);
private native void nativeWakeLockReady();
@@ -86,28 +61,23 @@ public class MainActivity extends NativeActivity {
private native int nativeGetPlayInBackground();
private native int nativePauseSession();
private native void nativeResumeSession();
private native void nativeImportSelectedFile(int kind, String path);
private native void nativeImportCancelled(int kind);
private native void nativeImportSelectedFile(String path);
private native void nativeImportCancelled();
private native void nativeRuntimeAssetDownloadSucceeded(long handle, long bytes, int httpStatus);
private native void nativeRuntimeAssetDownloadProgress(long handle, long bytes, long totalBytes);
private native void nativeRuntimeAssetDownloadFailed(long handle, int httpStatus, String error);
private native void nativeTextInputCommit(int codepoint);
private native void nativeTextInputBackspace();
private native void nativeTextInputEnter();
private native void nativeInvalidateGraphicsResources();
private native boolean nativeStartPractice(int practiceId);
private void requestNotificationPermissionIfNeeded() {
private void requestDownloadNotificationPermissionIfNeeded() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU &&
checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED &&
!notificationPermissionRequestInFlight) {
checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU &&
checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED &&
!notificationPermissionRequestInFlight) {
notificationPermissionRequestInFlight = true;
checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) {
requestPermissions(new String[] { Manifest.permission.POST_NOTIFICATIONS },
REQUEST_POST_NOTIFICATIONS);
}
@@ -116,19 +86,8 @@ public class MainActivity extends NativeActivity {
}
}
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == REQUEST_POST_NOTIFICATIONS) {
notificationPermissionRequestInFlight = false;
boolean granted = grantResults.length > 0 &&
grantResults[0] == PackageManager.PERMISSION_GRANTED;
Log.d(TAG, "Notification permission result: granted=" + granted);
}
}
private NotificationManager getDownloadNotificationManager() {
requestNotificationPermissionIfNeeded();
requestDownloadNotificationPermissionIfNeeded();
NotificationManager manager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
if (manager != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel = new NotificationChannel(
@@ -190,32 +149,18 @@ public class MainActivity extends NativeActivity {
if (event != null && event.getAction() == KeyEvent.ACTION_DOWN) {
int keyCode = event.getKeyCode();
if (keyCode == KeyEvent.KEYCODE_DEL) {
int repeatCount = event.getRepeatCount();
int deleteCount = lastDeleteRepeatCount < 0
? 1
: Math.max(1, repeatCount - lastDeleteRepeatCount);
lastDeleteRepeatCount = repeatCount;
for (int i = 0; i < deleteCount; i++) {
nativeTextInputBackspace();
}
nativeTextInputBackspace();
} else if (keyCode == KeyEvent.KEYCODE_ENTER ||
keyCode == KeyEvent.KEYCODE_NUMPAD_ENTER) {
lastDeleteRepeatCount = -1;
nativeTextInputEnter();
} else {
lastDeleteRepeatCount = -1;
int unicode = event.getUnicodeChar();
if (unicode >= 32) {
nativeTextInputCommit(unicode);
}
}
} else if (event != null && event.getAction() == KeyEvent.ACTION_UP) {
if (event.getKeyCode() == KeyEvent.KEYCODE_DEL) {
lastDeleteRepeatCount = -1;
}
} else if (event != null && event.getAction() == KeyEvent.ACTION_MULTIPLE &&
event.getCharacters() != null) {
lastDeleteRepeatCount = -1;
String chars = event.getCharacters();
for (int i = 0; i < chars.length();) {
int codepoint = chars.codePointAt(i);
@@ -277,7 +222,7 @@ public class MainActivity extends NativeActivity {
connection.setInstanceFollowRedirects(true);
connection.setConnectTimeout(15000);
connection.setReadTimeout(30000);
connection.setRequestProperty("User-Agent", "kryon-runtime-assets/1");
connection.setRequestProperty("User-Agent", "flint-runtime-assets/1");
status = connection.getResponseCode();
if (status < 200 || status >= 300) {
@@ -323,375 +268,98 @@ public class MainActivity extends NativeActivity {
}, "inbe-runtime-asset-download").start();
}
public String syncHttpRequest(String method, String urlText, String body, String[] headers) {
return SyncNetwork.httpRequest(TAG, method, urlText, body, headers);
}
public String syncWebSocketWait(String urlText, String[] headers) {
return SyncNetwork.webSocketWait(TAG, urlText, headers);
}
public void openImportPicker(final String mimeTypesCsv, final int kind) {
public void openImportPicker() {
runOnUiThread(new Runnable() {
@Override
public void run() {
try {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
String[] mimeTypes = parseMimeTypes(mimeTypesCsv);
intent.setType(primaryMimeType(mimeTypes));
if (mimeTypes.length > 0) {
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);
}
pendingImportKind = kind;
Log.d(TAG, "Opening import picker - kind=" + kind + ", mimeTypes=" + mimeTypesCsv + ", parsed=" + Arrays.toString(mimeTypes));
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_MIME_TYPES, new String[] {
"application/zip",
"application/x-zip-compressed",
"application/vnd.sqlite3",
"application/x-sqlite",
"application/x-sqlite3"
});
startActivityForResult(intent, REQUEST_IMPORT_ZIP);
} catch (Exception e) {
Log.e(TAG, "Failed to open import picker", e);
nativeImportCancelled(kind);
nativeImportCancelled();
}
}
});
}
private static String[] parseMimeTypes(String mimeTypesCsv) {
if (mimeTypesCsv == null || mimeTypesCsv.trim().isEmpty()) {
return new String[0];
}
String[] raw = mimeTypesCsv.split(",");
java.util.ArrayList<String> result = new java.util.ArrayList<>();
for (String mimeType : raw) {
String trimmed = mimeType.trim();
if (!trimmed.isEmpty()) {
result.add(trimmed);
}
}
return result.toArray(new String[0]);
}
private static String primaryMimeType(String[] mimeTypes) {
if (mimeTypes == null || mimeTypes.length == 0) {
return "*/*";
}
for (String mimeType : mimeTypes) {
if (mimeType != null && mimeType.endsWith("/*")) {
return mimeType;
}
}
return mimeTypes[0] != null && !mimeTypes[0].isEmpty()
? mimeTypes[0]
: "*/*";
}
private String extensionForUri(Uri uri) {
if (uri == null) return null;
// Prefer the MIME type reported by the content resolver; it is the most
// reliable signal for content:// URIs and maps unambiguously to an ext.
String mimeType = null;
try {
mimeType = getContentResolver().getType(uri);
} catch (Exception e) {
Log.w(TAG, "Failed to resolve MIME type for uri=" + uri, e);
}
String ext = mimeType != null ? extensionForMimeType(mimeType) : null;
if (ext != null && !ext.isEmpty()) return ext;
// Fall back to whatever extension the URI itself exposes. For Media Store
// documents this is usually absent, but it covers file:// and some providers.
String uriExt = MimeTypeMap.getFileExtensionFromUrl(uri.getLastPathSegment());
return (uriExt != null && !uriExt.isEmpty()) ? uriExt : null;
}
private static String extensionForMimeType(String mimeType) {
if (mimeType == null) return null;
String ext = MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType);
if (ext != null && !ext.isEmpty()) return ext;
// Handle audio types the system map does not always resolve.
switch (mimeType) {
case "audio/mpeg":
case "audio/mp3":
return "mp3";
case "audio/ogg":
case "application/ogg":
return "ogg";
case "audio/flac":
return "flac";
case "audio/mp4":
case "audio/x-m4a":
case "audio/m4a":
return "m4a";
case "audio/opus":
case "audio/x-opus+ogg":
return "opus";
case "audio/x-wav":
case "audio/wav":
return "wav";
default:
return null;
}
}
private String displayNameForUri(Uri uri) {
if (uri == null) return null;
// Query the provider's DISPLAY_NAME column; this is the canonical way to
// get the original filesystem filename for a content:// URI.
try (android.database.Cursor cursor = getContentResolver().query(
uri, new String[]{android.provider.OpenableColumns.DISPLAY_NAME},
null, null, null)) {
if (cursor != null && cursor.moveToFirst()) {
int idx = cursor.getColumnIndex(android.provider.OpenableColumns.DISPLAY_NAME);
if (idx >= 0) {
String name = cursor.getString(idx);
if (name != null && !name.isEmpty()) return name;
}
}
} catch (Exception e) {
Log.w(TAG, "Failed to query display name for uri=" + uri, e);
}
// Fall back to the URI's last path segment (useful for file:// URIs).
String last = uri.getLastPathSegment();
return (last != null && !last.isEmpty()) ? last : null;
}
private static String sanitizeFileName(String name) {
if (name == null || name.isEmpty()) return null;
// Strip path separators / parent refs so a crafted name can't escape the
// import directory, and trim surrounding whitespace.
String cleaned = name.replaceAll("[\\\\/]", "_").trim();
return cleaned.isEmpty() ? null : cleaned;
}
/**
* Called from native settings (Data & export): run the Health Connect
* permission flow and insert the sessions Java-side.
*/
public void healthConnectExport(final String csvPath) {
runOnUiThread(new Runnable() {
@Override
public void run() {
HealthConnectExport.start(MainActivity.this, csvPath);
}
});
}
private void handleStartPracticeIntent(Intent intent) {
if (intent == null || !ACTION_START_PRACTICE.equals(intent.getAction())) {
return;
}
int practiceId = intent.getIntExtra(EXTRA_PRACTICE_ID, -1);
if (practiceId < 0) {
// Static-shortcut extras arrive as strings; widget/tile extras are ints.
String raw = intent.getStringExtra(EXTRA_PRACTICE_ID);
if (raw != null) {
try {
practiceId = Integer.parseInt(raw);
} catch (NumberFormatException e) {
practiceId = -1;
}
}
}
if (nativeStartPractice(practiceId)) {
pendingStartPractice = false;
} else {
// The native app is not up yet (cold launch from the widget);
// retry once the window gains focus after initialization.
pendingStartPractice = true;
pendingStartPracticeId = practiceId;
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_HEALTH_CONNECT) {
HealthConnectExport.handleResult(this, resultCode, data, lastHealthConnectPath);
return;
}
if (requestCode != REQUEST_IMPORT_ZIP) return;
if (resultCode != RESULT_OK || data == null || data.getData() == null) {
Log.d(TAG, "Import cancelled - kind=" + pendingImportKind + ", resultCode=" + resultCode + ", data=" + (data != null));
nativeImportCancelled(pendingImportKind);
nativeImportCancelled();
return;
}
Uri uri = data.getData();
Log.d(TAG, "File selected for import - kind=" + pendingImportKind + ", uri=" + uri);
File importDir = new File(getCacheDir(), "imports");
String extension = extensionForUri(uri);
String displayName = sanitizeFileName(displayNameForUri(uri));
String importName;
if (displayName != null) {
// Use the real filesystem name. If it already carries the right
// extension (per MIME type) keep it; otherwise append the MIME-derived
// extension so native validation accepts it.
boolean hasExt = displayName.lastIndexOf('.') > 0
&& extension != null
&& !extension.isEmpty()
&& displayName.toLowerCase().endsWith("." + extension.toLowerCase());
importName = hasExt ? displayName : displayName + "."
+ (extension != null && !extension.isEmpty() ? extension : "bin");
} else {
importName = "inbe-import-" + pendingImportKind
+ (extension != null && !extension.isEmpty() ? "." + extension : "");
}
File importFile = new File(importDir, importName);
File importFile = new File(importDir, "inbe-import");
try {
if (!importDir.exists() && !importDir.mkdirs()) {
Log.e(TAG, "Failed to create import directory");
nativeImportSelectedFile(pendingImportKind, "");
nativeImportSelectedFile("");
return;
}
try (InputStream input = getContentResolver().openInputStream(uri);
FileOutputStream output = new FileOutputStream(importFile)) {
if (input == null) {
Log.e(TAG, "Failed to open input stream for uri=" + uri);
nativeImportSelectedFile(pendingImportKind, "");
nativeImportSelectedFile("");
return;
}
byte[] buffer = new byte[8192];
int read;
long totalBytes = 0;
while ((read = input.read(buffer)) != -1) {
output.write(buffer, 0, read);
totalBytes += read;
}
Log.d(TAG, "File copied successfully - kind=" + pendingImportKind + ", path=" + importFile.getAbsolutePath() + ", size=" + totalBytes + " bytes");
}
String mimeType = getContentResolver().getType(uri);
Log.d(TAG, "Calling nativeImportSelectedFile - kind=" + pendingImportKind + ", path=" + importFile.getAbsolutePath() + ", mimeType=" + mimeType);
nativeImportSelectedFile(pendingImportKind, importFile.getAbsolutePath());
nativeImportSelectedFile(importFile.getAbsolutePath());
} catch (Exception e) {
Log.e(TAG, "Failed to import selected file", e);
nativeImportSelectedFile(pendingImportKind, "");
nativeImportSelectedFile("");
}
}
/**
* Called from native settings: set up UnifiedPush. With no distributor
* installed, offer Sunup on F-Droid; with several, let the user pick.
*/
public boolean isUnifiedPushRegistered() {
return PushServiceImpl.getEndpoint(this) != null;
}
public String[] getUnifiedPushDistributors() {
final List<String> distributors = UnifiedPush.getDistributors(this);
return distributors.toArray(new String[0]);
}
public String[] getUnifiedPushDistributorLabels() {
PackageManager pm = getPackageManager();
List<String> labels = new ArrayList<>();
for (String pkg : UnifiedPush.getDistributors(this)) {
try {
labels.add(pm.getApplicationLabel(
pm.getApplicationInfo(pkg, 0)).toString());
} catch (PackageManager.NameNotFoundException e) {
labels.add(pkg);
}
}
return labels.toArray(new String[0]);
}
public String[] getUnifiedPushDistributorIcons() {
PackageManager pm = getPackageManager();
File dir = new File(getCacheDir(), "push-icons");
if (!dir.exists()) {
dir.mkdirs();
}
List<String> paths = new ArrayList<>();
List<String> distributors = UnifiedPush.getDistributors(this);
for (int i = 0; i < distributors.size(); i++) {
File out = new File(dir, "icon_" + i + ".png");
try {
Drawable drawable = pm.getApplicationIcon(distributors.get(i));
Bitmap bmp = Bitmap.createBitmap(96, 96, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bmp);
drawable.setBounds(0, 0, 96, 96);
drawable.draw(canvas);
FileOutputStream fos = new FileOutputStream(out);
bmp.compress(Bitmap.CompressFormat.PNG, 100, fos);
fos.close();
paths.add(out.getAbsolutePath());
} catch (Exception e) {
Log.w(TAG, "icon export failed for " + distributors.get(i), e);
paths.add("");
}
}
return paths.toArray(new String[0]);
}
public void configureUnifiedPushWith(final String pkg) {
runOnUiThread(new Runnable() {
@Override
public void run() {
requestNotificationPermissionIfNeeded();
UnifiedPush.saveDistributor(MainActivity.this, pkg);
UnifiedPush.register(MainActivity.this, "inbe", "Inner Breeze", null);
Toast.makeText(MainActivity.this,
"Push: registering with " + pkg,
Toast.LENGTH_SHORT).show();
}
});
}
public void configureUnifiedPush() {
// Called via JNI from the native render thread; toasts, dialogs and
// permission requests need the UI thread's Looper. Only reached when
// no distributor is installed at all.
runOnUiThread(new Runnable() {
@Override
public void run() {
if (!UnifiedPush.getDistributors(MainActivity.this).isEmpty()) {
return;
}
Toast.makeText(MainActivity.this,
"Install a UnifiedPush distributor (e.g. Sunup)",
Toast.LENGTH_LONG).show();
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(
"https://f-droid.org/en/packages/org.unifiedpush.distributor.sunup/")));
} catch (Exception e) {
Log.w(TAG, "no activity to open F-Droid");
}
}
});
}
public void acquireWakeLock() {
Log.d(TAG, "Starting session foreground service");
requestNotificationPermissionIfNeeded();
Intent intent = new Intent(this, SessionForegroundService.class);
intent.setAction(SessionForegroundService.ACTION_START);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForegroundService(intent);
Log.d(TAG, "acquireWakeLock called - wakeLock=" + wakeLock);
if (wakeLock == null) {
Log.d(TAG, "Creating new PARTIAL_WAKE_LOCK");
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
wakeLock = pm.newWakeLock(
PowerManager.PARTIAL_WAKE_LOCK,
"inbe:meditation_session"
);
wakeLock.acquire();
Log.d(TAG, "Wake lock acquired successfully - held=" + wakeLock.isHeld());
} else {
startService(intent);
Log.d(TAG, "Wake lock already exists - held=" + wakeLock.isHeld());
}
}
public void releaseWakeLock() {
Log.d(TAG, "Stopping session foreground service");
Intent intent = new Intent(this, SessionForegroundService.class);
intent.setAction(SessionForegroundService.ACTION_STOP);
startService(intent);
}
public void updateSessionNotification(final String statusText) {
SessionForegroundService.updateStatus(statusText == null ? "" : statusText);
Log.d(TAG, "releaseWakeLock called - wakeLock=" + wakeLock);
if (wakeLock != null && wakeLock.isHeld()) {
Log.d(TAG, "Releasing wake lock - was held=" + wakeLock.isHeld());
wakeLock.release();
Log.d(TAG, "Wake lock released successfully");
wakeLock = null;
} else {
Log.d(TAG, "Wake lock not held - wakeLock=" + wakeLock + " isHeld=" + (wakeLock != null ? wakeLock.isHeld() : "null"));
}
}
public void keepScreenOn() {
@@ -716,9 +384,7 @@ public class MainActivity extends NativeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
configureSystemBars();
super.onCreate(savedInstanceState);
configureSystemBars();
synchronized (cachedInsets) {
for (int i = 0; i < 6; i++) {
@@ -731,64 +397,15 @@ public class MainActivity extends NativeActivity {
// Notify native code that activity is ready for wake lock
nativeWakeLockReady();
// Widget/tile/shortcut launch: the intent that started this activity.
handleStartPracticeIntent(getIntent());
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
nativeInvalidateGraphicsResources();
configureSystemBars();
pushDeviceConfiguration();
requestInsetRefresh();
}
private void configureSystemBars() {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
WindowManager.LayoutParams attrs = getWindow().getAttributes();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
attrs.layoutInDisplayCutoutMode =
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
} else {
attrs.layoutInDisplayCutoutMode =
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
}
getWindow().setAttributes(attrs);
}
int flags = getWindow().getDecorView().getSystemUiVisibility();
flags |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
flags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
flags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
flags &= ~View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
flags &= ~View.SYSTEM_UI_FLAG_FULLSCREEN;
flags &= ~View.SYSTEM_UI_FLAG_IMMERSIVE;
flags &= ~View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
flags &= ~View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
}
getWindow().getDecorView().setSystemUiVisibility(flags);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
WindowInsetsController controller = getWindow().getInsetsController();
if (controller != null) {
controller.hide(WindowInsets.Type.statusBars());
controller.show(WindowInsets.Type.navigationBars());
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q &&
Build.VERSION.SDK_INT < Build.VERSION_CODES.VANILLA_ICE_CREAM) {
getWindow().setNavigationBarContrastEnforced(false);
}
}
private void pushDeviceConfiguration() {
Configuration config = getResources().getConfiguration();
int nightMask = config.uiMode & Configuration.UI_MODE_NIGHT_MASK;
@@ -855,9 +472,38 @@ public class MainActivity extends NativeActivity {
}
}
});
} else {
fallbackForOldPhones();
}
}
private void fallbackForOldPhones() {
int statusBarHeight = 0;
int navBarHeight = 0;
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
statusBarHeight = getResources().getDimensionPixelSize(resourceId);
}
int navResourceId = getResources().getIdentifier("navigation_bar_height", "dimen", "android");
if (navResourceId > 0) {
navBarHeight = getResources().getDimensionPixelSize(navResourceId);
}
synchronized (cachedInsets) {
cachedInsets[0] = statusBarHeight;
cachedInsets[1] = navBarHeight;
cachedInsets[2] = 0;
cachedInsets[3] = 0;
cachedInsets[4] = 0;
cachedInsets[5] = 0;
}
insetsInitialized = true;
nativeSetInsets(statusBarHeight, navBarHeight, 0, 0, 0, 0);
}
private void updateInsets(WindowInsets insets) {
if (insets == null) return;
@@ -866,8 +512,7 @@ public class MainActivity extends NativeActivity {
int navBar = 0;
int cLeft = 0, cTop = 0, cRight = 0, cBottom = 0;
// Inbe owns a single edge-to-edge native surface. Java reports the
// system bar insets; native applies them once against the real GL surface.
// System bar calculations
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
Insets systemBars = insets.getInsetsIgnoringVisibility(WindowInsets.Type.systemBars());
statusBar = systemBars.top;
@@ -876,6 +521,7 @@ public class MainActivity extends NativeActivity {
statusBar = insets.getSystemWindowInsetTop();
navBar = insets.getSystemWindowInsetBottom();
}
// Display cutout calculations
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
DisplayCutout cutout = insets.getDisplayCutout();
@@ -896,13 +542,9 @@ public class MainActivity extends NativeActivity {
cachedInsets[5] = cBottom;
}
insetsInitialized = true;
nativeSetInsets(statusBar, navBar, cLeft, cTop, cRight, cBottom);
// Set device density for proper DPI scaling
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
nativeSetDeviceDensity(metrics.density);
} catch (Exception e) {
Log.e(TAG, "Error structuralizing window layout properties: " + e.getMessage());
}
@@ -922,7 +564,7 @@ public class MainActivity extends NativeActivity {
private void syncLifecycleState(String reason) {
int playInBackground = nativeGetPlayInBackground();
boolean shouldRunInBackground = playInBackground != 0 && activityPaused;
boolean shouldRunInBackground = playInBackground != 0 && (activityPaused || !windowFocused);
Log.d(TAG, reason + ": play_in_background=" + playInBackground
+ " activityPaused=" + activityPaused
@@ -958,35 +600,13 @@ public class MainActivity extends NativeActivity {
protected void onResume() {
super.onResume();
activityPaused = false;
configureSystemBars();
nativeInvalidateGraphicsResources();
requestInsetRefresh();
syncLifecycleState("onResume");
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
configureSystemBars();
requestInsetRefresh();
syncLifecycleState("onNewIntent");
handleStartPracticeIntent(intent);
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
windowFocused = hasFocus;
if (hasFocus) {
configureSystemBars();
requestInsetRefresh();
if (pendingStartPractice) {
handleStartPracticeIntent(
new Intent(ACTION_START_PRACTICE)
.putExtra(EXTRA_PRACTICE_ID, pendingStartPracticeId));
}
}
syncLifecycleState("onWindowFocusChanged");
}
@@ -1,113 +0,0 @@
package xyz.waozi.inbe;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.util.Log;
import org.unifiedpush.android.connector.FailedReason;
import org.unifiedpush.android.connector.PushService;
import org.unifiedpush.android.connector.data.PushEndpoint;
import org.unifiedpush.android.connector.data.PushMessage;
import org.unifiedpush.android.connector.data.PublicKeySet;
/**
* UnifiedPush message entry point (unifiedpush.org, spec AND_3.1.0).
*
* The user installs any distributor -- Sunup from F-Droid
* (org.unifiedpush.distributor.sunup), ntfy, NextPush, ... -- and this app
* receives pushes without Google services. The distributor starts this
* service directly, so it works while the native app is not running.
*
* Message protocol (v1): the pushed bytes are UTF-8 text; the first line is
* the notification title, the rest is the body. Cleartext only -- keep
* payloads under the ~3993-byte spec limit; encryption is a follow-up.
*/
public class PushServiceImpl extends PushService {
private static final String TAG = "INBE_PUSH";
private static final String PREFS = "inbe_push";
private static final String PREF_ENDPOINT = "endpoint";
private static final String PREF_AUTH = "auth";
private static final String PREF_P256DH = "p256dh";
private static final String CHANNEL_ID = "inbe.push";
private static final int NOTIFICATION_ID = 0x7042;
@Override
public void onMessage(PushMessage message, String instance) {
String text = new String(message.getContent());
String title = "Inner Breeze";
String body = text;
int nl = text.indexOf('\n');
if (nl >= 0) {
title = text.substring(0, nl);
body = text.substring(nl + 1);
}
showNotification(title, body);
}
@Override
public void onNewEndpoint(PushEndpoint endpoint, String instance) {
Log.d(TAG, "new endpoint (temporary=" + endpoint.getTemporary() + ")");
SharedPreferences.Editor e = prefs().edit()
.putString(PREF_ENDPOINT, endpoint.getUrl());
// Encrypted distributors (Sunup/Mozilla) require RFC8291 aes128gcm
// payloads: the sender encrypts with these keys, and the connector
// decrypts on receipt. Stored so the sync server can use them.
PublicKeySet keys = endpoint.getPubKeySet();
if (keys != null) {
e.putString(PREF_AUTH, keys.getAuth())
.putString(PREF_P256DH, keys.getPubKey());
} else {
e.remove(PREF_AUTH).remove(PREF_P256DH);
}
e.apply();
}
@Override
public void onRegistrationFailed(FailedReason reason, String instance) {
Log.w(TAG, "registration failed: " + reason);
prefs().edit().remove(PREF_ENDPOINT).apply();
}
@Override
public void onUnregistered(String instance) {
prefs().edit().remove(PREF_ENDPOINT).apply();
}
public static String getEndpoint(Context context) {
return context.getSharedPreferences(PREFS, Context.MODE_PRIVATE)
.getString(PREF_ENDPOINT, null);
}
private SharedPreferences prefs() {
return getSharedPreferences(PREFS, Context.MODE_PRIVATE);
}
private void showNotification(String title, String body) {
NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
if (nm == null)
return;
if (Build.VERSION.SDK_INT >= 26 &&
nm.getNotificationChannel(CHANNEL_ID) == null) {
nm.createNotificationChannel(new NotificationChannel(CHANNEL_ID,
"Push messages", NotificationManager.IMPORTANCE_DEFAULT));
}
PendingIntent pi = PendingIntent.getActivity(this, 0,
getPackageManager().getLaunchIntentForPackage(getPackageName()),
PendingIntent.FLAG_IMMUTABLE);
Notification.Builder b = Build.VERSION.SDK_INT >= 26
? new Notification.Builder(this, CHANNEL_ID)
: new Notification.Builder(this);
b.setSmallIcon(getApplicationInfo().icon)
.setContentTitle(title)
.setContentText(body)
.setAutoCancel(true)
.setContentIntent(pi);
nm.notify(NOTIFICATION_ID, b.build());
}
}
@@ -1,200 +0,0 @@
package xyz.waozi.inbe;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ServiceInfo;
import android.os.Build;
import android.os.IBinder;
import android.os.PowerManager;
import android.util.Log;
public class SessionForegroundService extends Service {
public static final String ACTION_START = "xyz.waozi.inbe.action.START_SESSION_FOREGROUND";
public static final String ACTION_STOP = "xyz.waozi.inbe.action.STOP_SESSION_FOREGROUND";
private static final String TAG = "InbeSessionService";
private static final String CHANNEL_ID = "active_session";
private static final int NOTIFICATION_ID = 3001;
private static String currentStatusText = "";
private static SessionForegroundService activeService = null;
private PowerManager.WakeLock wakeLock = null;
private boolean foregroundActive = false;
@Override
public void onCreate() {
super.onCreate();
activeService = this;
ensureNotificationChannel();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
String action = intent != null ? intent.getAction() : ACTION_START;
if (ACTION_STOP.equals(action)) {
stopSession();
return START_NOT_STICKY;
}
startSession();
return START_NOT_STICKY;
}
@Override
public void onDestroy() {
releaseWakeLock();
clearForeground();
if (activeService == this) {
activeService = null;
}
super.onDestroy();
}
@Override
public IBinder onBind(Intent intent) {
return null;
}
private void startSession() {
currentStatusText = "";
Notification notification = buildNotification();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
startForeground(
NOTIFICATION_ID,
notification,
ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK
);
} else {
startForeground(NOTIFICATION_ID, notification);
}
foregroundActive = true;
acquireWakeLock();
Log.d(TAG, "Session foreground service started");
}
private void stopSession() {
currentStatusText = "";
releaseWakeLock();
clearForeground();
stopSelf();
Log.d(TAG, "Session foreground service stopped");
}
public static void updateStatus(String statusText) {
currentStatusText = statusText != null ? statusText : "";
SessionForegroundService service = activeService;
if (service == null) {
return;
}
if (!service.foregroundActive) {
return;
}
NotificationManager manager =
(NotificationManager)service.getSystemService(Context.NOTIFICATION_SERVICE);
if (manager != null) {
manager.notify(NOTIFICATION_ID, service.buildNotification());
}
}
private void stopForegroundCompat() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
stopForeground(STOP_FOREGROUND_REMOVE);
} else {
stopForeground(true);
}
}
private void clearForeground() {
foregroundActive = false;
stopForegroundCompat();
cancelNotification();
}
private void cancelNotification() {
NotificationManager manager =
(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
if (manager != null) {
manager.cancel(NOTIFICATION_ID);
}
}
private void acquireWakeLock() {
if (wakeLock != null && wakeLock.isHeld()) {
return;
}
PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE);
if (pm == null) {
Log.e(TAG, "PowerManager unavailable; cannot acquire wakelock");
return;
}
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "inbe:active_session");
wakeLock.setReferenceCounted(false);
wakeLock.acquire();
Log.d(TAG, "Session wakelock acquired");
}
private void releaseWakeLock() {
if (wakeLock != null && wakeLock.isHeld()) {
wakeLock.release();
Log.d(TAG, "Session wakelock released");
}
wakeLock = null;
}
private Notification buildNotification() {
Intent launchIntent = new Intent(this, MainActivity.class);
launchIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
int pendingFlags = PendingIntent.FLAG_UPDATE_CURRENT;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
pendingFlags |= PendingIntent.FLAG_IMMUTABLE;
}
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, launchIntent, pendingFlags);
Notification.Builder builder = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
? new Notification.Builder(this, CHANNEL_ID)
: new Notification.Builder(this);
CharSequence title = getApplicationInfo().loadLabel(getPackageManager());
builder.setSmallIcon(android.R.drawable.ic_media_play)
.setContentTitle(title)
.setContentText(currentStatusText)
.setContentIntent(pendingIntent)
.setOngoing(true)
.setOnlyAlertOnce(true)
.setShowWhen(false);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
builder.setCategory(Notification.CATEGORY_TRANSPORT)
.setVisibility(Notification.VISIBILITY_PUBLIC);
}
return builder.build();
}
private void ensureNotificationChannel() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
return;
}
NotificationManager manager =
(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
if (manager == null) {
return;
}
NotificationChannel channel = new NotificationChannel(
CHANNEL_ID,
getApplicationInfo().loadLabel(getPackageManager()),
NotificationManager.IMPORTANCE_LOW
);
manager.createNotificationChannel(channel);
}
}
@@ -11,40 +11,6 @@ import java.io.FileOutputStream;
public class ShareHelper {
private static final String TAG = "InbeShare";
public static void shareFile(Activity activity, byte[] data, String filename, String mimeType, String chooserTitle) {
if (activity == null || data == null) return;
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
try {
File cacheFile = new File(activity.getCacheDir(), filename);
FileOutputStream fos = new FileOutputStream(cacheFile);
fos.write(data);
fos.close();
Uri contentUri = FileProvider.getUriForFile(
activity,
"xyz.waozi.inbe.fileprovider",
cacheFile
);
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setType(mimeType != null ? mimeType : "application/octet-stream");
sendIntent.putExtra(Intent.EXTRA_STREAM, contentUri);
sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
Intent shareIntent = Intent.createChooser(sendIntent, chooserTitle);
activity.startActivity(shareIntent);
Log.i(TAG, "Share sheet shown");
} catch (Exception e) {
Log.e(TAG, "Share failed", e);
}
}
});
}
public static void shareZipFile(Activity activity, byte[] zipData, String filename, String chooserTitle) {
if (activity == null || zipData == null) return;
@@ -1,30 +0,0 @@
package xyz.waozi.inbe;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.Build;
import android.service.quicksettings.TileService;
/**
* Quick-settings tile: "Breathe" starts the last-used practice with one
* tap from anywhere in the system.
*/
public class StartPracticeTile extends TileService {
@Override
public void onClick() {
super.onClick();
Intent intent = new Intent(this, MainActivity.class);
intent.setAction(MainActivity.ACTION_START_PRACTICE);
intent.putExtra(MainActivity.EXTRA_PRACTICE_ID, -1);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
if (Build.VERSION.SDK_INT >= 34) {
int flags = PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE;
PendingIntent pending = PendingIntent.getActivity(this, 0, intent, flags);
startActivityAndCollapse(pending);
} else {
startActivityAndCollapse(intent);
}
}
}
@@ -1,36 +0,0 @@
package xyz.waozi.inbe;
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.widget.RemoteViews;
/**
* Home-screen widget: a single "Breathe" button that opens the app and
* starts the last-used practice straight away (the practice can also be
* pinned per-shortcut via the launcher's long-press shortcuts).
*/
public class StartPracticeWidget extends AppWidgetProvider {
@Override
public void onUpdate(Context context, AppWidgetManager manager, int[] appWidgetIds) {
Intent intent = new Intent(context, MainActivity.class);
intent.setAction(MainActivity.ACTION_START_PRACTICE);
intent.putExtra(MainActivity.EXTRA_PRACTICE_ID, -1);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
int flags = PendingIntent.FLAG_UPDATE_CURRENT;
if (Build.VERSION.SDK_INT >= 23) {
flags |= PendingIntent.FLAG_IMMUTABLE;
}
PendingIntent pending = PendingIntent.getActivity(
context, 0, intent, flags);
RemoteViews views = new RemoteViews(context.getPackageName(),
R.layout.widget_breathe);
views.setOnClickPendingIntent(R.id.widget_root, pending);
manager.updateAppWidget(appWidgetIds, views);
}
}
@@ -1,240 +0,0 @@
package xyz.waozi.inbe;
import android.util.Base64;
import android.util.Log;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.Socket;
import java.net.URI;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.SecureRandom;
import javax.net.ssl.SSLSocketFactory;
final class SyncNetwork {
private SyncNetwork() {
}
static String httpRequest(String logTag, String method, String urlText, String body,
String[] headers) {
HttpURLConnection connection = null;
int status = 0;
try {
byte[] bodyBytes = body != null ? body.getBytes(StandardCharsets.UTF_8) : new byte[0];
connection = (HttpURLConnection)new URL(urlText).openConnection();
connection.setInstanceFollowRedirects(false);
connection.setConnectTimeout(15000);
connection.setReadTimeout(30000);
connection.setRequestMethod(method);
connection.setRequestProperty("User-Agent", "inbe-sync/1");
if (headers != null) {
for (String header : headers) {
if (header == null) continue;
int colon = header.indexOf(':');
if (colon <= 0) continue;
String key = header.substring(0, colon).trim();
String value = header.substring(colon + 1).trim();
if (!key.isEmpty()) {
connection.setRequestProperty(key, value);
}
}
}
if (bodyBytes.length > 0) {
connection.setDoOutput(true);
connection.setFixedLengthStreamingMode(bodyBytes.length);
try (OutputStream output = connection.getOutputStream()) {
output.write(bodyBytes);
}
}
status = connection.getResponseCode();
InputStream stream = status >= 400 ? connection.getErrorStream() : connection.getInputStream();
String response = "";
if (stream != null) {
try (InputStream input = stream) {
byte[] bytes = readAllBytesCompat(input);
response = new String(bytes, StandardCharsets.UTF_8);
}
}
return status + "\n" + response;
} catch (Exception e) {
Log.e(logTag, "Sync HTTP request failed", e);
return status + "\n" + (e.getMessage() != null ? e.getMessage() : "request failed");
} finally {
if (connection != null) {
connection.disconnect();
}
}
}
static String webSocketWait(String logTag, String urlText, String[] headers) {
Socket socket = null;
try {
URI url = new URI(urlText);
String protocol = url.getScheme();
boolean secure = "wss".equals(protocol);
int port = url.getPort();
String path = url.getRawPath();
if (path == null || path.isEmpty()) path = "/";
if (url.getRawQuery() != null && !url.getRawQuery().isEmpty()) {
path += "?" + url.getRawQuery();
}
if (port <= 0) port = secure ? 443 : 80;
if (!secure && !"ws".equals(protocol)) {
return "0\ninvalid websocket url";
}
socket = secure
? SSLSocketFactory.getDefault().createSocket(url.getHost(), port)
: new Socket(url.getHost(), port);
socket.setTcpNoDelay(true);
byte[] keyBytes = new byte[16];
new SecureRandom().nextBytes(keyBytes);
String key = Base64.encodeToString(keyBytes, Base64.NO_WRAP);
StringBuilder request = new StringBuilder();
request.append("GET ").append(path).append(" HTTP/1.1\r\n");
request.append("Host: ").append(url.getHost());
if ((secure && port != 443) || (!secure && port != 80)) {
request.append(":").append(port);
}
request.append("\r\n");
request.append("Upgrade: websocket\r\n");
request.append("Connection: Upgrade\r\n");
request.append("Sec-WebSocket-Version: 13\r\n");
request.append("Sec-WebSocket-Key: ").append(key).append("\r\n");
request.append("User-Agent: inbe-sync/1\r\n");
if (headers != null) {
for (String header : headers) {
if (header != null && !header.isEmpty()) {
request.append(header).append("\r\n");
}
}
}
request.append("\r\n");
socket.getOutputStream().write(request.toString().getBytes(StandardCharsets.US_ASCII));
socket.getOutputStream().flush();
String statusLine = readAsciiLine(socket);
int status = parseHttpStatus(statusLine);
while (true) {
String line = readAsciiLine(socket);
if (line == null || line.isEmpty()) break;
}
if (status != 101) {
return status + "\nwebsocket upgrade failed";
}
Log.i(logTag, "Sync WebSocket connected");
while (true) {
String message = readWebSocketText(socket);
if (message == null) {
return "0\nwebsocket closed";
}
if (message.contains("\"type\":\"sync_changed\"")) {
return "101\n" + message;
}
}
} catch (Exception e) {
Log.w(logTag, "WebSocket wait failed", e);
return "0\n" + (e.getMessage() != null ? e.getMessage() : "websocket failed");
} finally {
if (socket != null) {
try {
socket.close();
} catch (Exception ignored) {
}
}
}
}
private static int parseHttpStatus(String statusLine) {
if (statusLine == null) return 0;
String[] parts = statusLine.split(" ", 3);
if (parts.length < 2) return 0;
try {
return Integer.parseInt(parts[1]);
} catch (NumberFormatException e) {
return 0;
}
}
private static String readAsciiLine(Socket socket) throws java.io.IOException {
StringBuilder line = new StringBuilder();
while (true) {
int b = socket.getInputStream().read();
if (b < 0) {
return line.length() > 0 ? line.toString() : null;
}
if (b == '\n') break;
if (b != '\r') line.append((char)b);
}
return line.toString();
}
private static String readWebSocketText(Socket socket) throws java.io.IOException {
int b0 = socket.getInputStream().read();
int b1 = socket.getInputStream().read();
if (b0 < 0 || b1 < 0) return null;
int opcode = b0 & 0x0f;
boolean masked = (b1 & 0x80) != 0;
long length = b1 & 0x7f;
if (length == 126) {
length = ((long)readByte(socket) << 8) | readByte(socket);
} else if (length == 127) {
length = 0;
for (int i = 0; i < 8; i++) {
length = (length << 8) | readByte(socket);
}
}
if (length < 0 || length > 1024 * 1024) {
throw new java.io.IOException("websocket frame too large");
}
byte[] mask = null;
if (masked) {
mask = readExact(socket, 4);
}
byte[] payload = readExact(socket, (int)length);
if (masked) {
for (int i = 0; i < payload.length; i++) {
payload[i] = (byte)(payload[i] ^ mask[i % 4]);
}
}
if (opcode == 8) return null;
if (opcode != 1) return "";
return new String(payload, StandardCharsets.UTF_8);
}
private static int readByte(Socket socket) throws java.io.IOException {
int b = socket.getInputStream().read();
if (b < 0) throw new java.io.IOException("unexpected eof");
return b;
}
private static byte[] readExact(Socket socket, int count) throws java.io.IOException {
byte[] data = new byte[count];
int offset = 0;
while (offset < count) {
int read = socket.getInputStream().read(data, offset, count - offset);
if (read < 0) throw new java.io.IOException("unexpected eof");
offset += read;
}
return data;
}
private static byte[] readAllBytesCompat(InputStream input) throws java.io.IOException {
byte[] buffer = new byte[8192];
int read;
java.io.ByteArrayOutputStream output = new java.io.ByteArrayOutputStream();
while ((read = input.read(buffer)) != -1) {
output.write(buffer, 0, read);
}
return output.toByteArray();
}
}
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#87CEEB" />
<solid android:color="#E2EEFC" />
</shape>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#E6201F24" />
<corners android:radius="18dp" />
<stroke
android:width="1dp"
android:color="#33FFFFFF" />
</shape>
@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/widget_breathe_bg"
android:gravity="center"
android:orientation="vertical"
android:padding="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/widget_breathe_app"
android:textColor="#B8FFFFFF"
android:textSize="11sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/widget_breathe_action"
android:textColor="#FFFFFFFF"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 511 B

After

Width:  |  Height:  |  Size: 638 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 511 B

After

Width:  |  Height:  |  Size: 638 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 B

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 B

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 559 B

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 559 B

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 657 B

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 657 B

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 720 B

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 720 B

After

Width:  |  Height:  |  Size: 670 B

-21
View File
@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="widget_breathe_label">Breathe</string>
<string name="widget_breathe_app">Inner Breeze</string>
<string name="widget_breathe_action">Breathe</string>
<string name="tile_breathe_label">Breathe</string>
<string name="shortcut_whm">Wim Hof</string>
<string name="shortcut_meditation">Meditation</string>
<string name="shortcut_sun_salutation">Sun salutation</string>
<string name="shortcut_patterns">Breathing patterns</string>
<string name="health_connect_unavailable">Health Connect is not available on this device</string>
<string name="health_connect_cancelled">Health Connect export cancelled</string>
<string name="health_connect_denied">Health Connect permission was denied</string>
<string name="health_connect_nothing_new">No new sessions to export</string>
<string name="health_connect_exported">Exported %1$d sessions to Health Connect</string>
<string name="health_connect_failed">Health Connect export failed</string>
<string name="health_connect_title_meditation">Meditation</string>
<string name="health_connect_title_breathing">Breathing exercise</string>
<string name="health_connect_title_yoga">Sun salutation</string>
<string name="health_connect_title_patterns">Breathing patterns</string>
</resources>
-59
View File
@@ -1,59 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
android:shortcutId="start_wim_hof"
android:enabled="true"
android:icon="@mipmap/ic_launcher"
android:shortcutShortLabel="@string/shortcut_whm">
<intent
android:action="xyz.waozi.inbe.action.START_PRACTICE"
android:targetPackage="xyz.waozi.inbe"
android:targetClass="xyz.waozi.inbe.MainActivity">
<extra
android:name="practice_id"
android:value="0" />
</intent>
</shortcut>
<shortcut
android:shortcutId="start_meditation"
android:enabled="true"
android:icon="@mipmap/ic_launcher"
android:shortcutShortLabel="@string/shortcut_meditation">
<intent
android:action="xyz.waozi.inbe.action.START_PRACTICE"
android:targetPackage="xyz.waozi.inbe"
android:targetClass="xyz.waozi.inbe.MainActivity">
<extra
android:name="practice_id"
android:value="1" />
</intent>
</shortcut>
<shortcut
android:shortcutId="start_sun_salutation"
android:enabled="true"
android:icon="@mipmap/ic_launcher"
android:shortcutShortLabel="@string/shortcut_sun_salutation">
<intent
android:action="xyz.waozi.inbe.action.START_PRACTICE"
android:targetPackage="xyz.waozi.inbe"
android:targetClass="xyz.waozi.inbe.MainActivity">
<extra
android:name="practice_id"
android:value="2" />
</intent>
</shortcut>
<shortcut
android:shortcutId="start_patterns"
android:enabled="true"
android:icon="@mipmap/ic_launcher"
android:shortcutShortLabel="@string/shortcut_patterns">
<intent
android:action="xyz.waozi.inbe.action.START_PRACTICE"
android:targetPackage="xyz.waozi.inbe"
android:targetClass="xyz.waozi.inbe.MainActivity">
<extra
android:name="practice_id"
android:value="3" />
</intent>
</shortcut>
</shortcuts>
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="110dp"
android:minHeight="40dp"
android:targetCellWidth="2"
android:targetCellHeight="1"
android:updatePeriodMillis="0"
android:initialLayout="@layout/widget_breathe"
android:resizeMode="horizontal|vertical"
android:widgetCategory="home_screen" />
+1 -2
View File
@@ -1,4 +1,3 @@
plugins {
id 'com.android.application' version '8.9.1' apply false
id 'org.jetbrains.kotlin.android' version '2.3.0' apply false
id 'com.android.application' version '8.4.2' apply false
}
@@ -0,0 +1,7 @@
Initial release
• Breathing exercise tutorial with 5 steps
• Configurable settings: speed, rounds, breaths, pause duration
• Session history tracking and statistics
• Support for Linux, Windows, Android, and WebAssembly
• Dark theme with customizable colors
+1 -6
View File
@@ -1,7 +1,2 @@
android.useAndroidX=true
android.suppressUnsupportedCompileSdk=36
org.gradle.caching=true
org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=1024m -Dfile.encoding=UTF-8
org.gradle.parallel=false
org.gradle.workers.max=2
android.nativeBuildCache.enabled=true
android.suppressUnsupportedCompileSdk=35
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
@@ -2,9 +2,11 @@ Eine freie, quelloffene App für Atmung, Meditation und Gewohnheiten.
Funktionen:
- Geführte Übungen mit visuellen und akustischen Hinweisen
- Mind, Yoga und Fitness für verschiedene Übungsroutinen
- Anpassbare Atemsitzungen, Meditationstimer und Zähler
- Gewohnheitstracking mit Verlauf und verknüpften Übungszahlen
- Optionale Synchronisierung von Gewohnheiten, Sitzungen und Fortschritt
- Mind, Yoga und Fitness für Gewohnheiten und Übungen
- Anpassbare Atemsitzungen und Meditationstimer
- Gewohnheitstracking mit Sitzungsverlauf
- Lokale Speicherung mit Import und Export
- Anpassbare Designs mit hellen und dunklen Varianten
- Touch-optimierte Oberfläche für Mobilgeräte
Verfügbare Plattformen: Linux, Windows, Android, WebAssembly.
@@ -1 +1 @@
Atmung, Meditation und Gewohnheiten mit Synchronisierung.
Eine freie App für Atmung, Meditation und Gewohnheiten.
@@ -1,22 +0,0 @@
Added
---
- Breaks render in their own centered always-on-top OS window (desktop): the main window - even hidden to tray - is no longer taken over; Postpone/Skip/Rest-now are clickable in it and right-click opens Break settings.
- The timer HUD is drag-and-drop movable anywhere on screen, remembers its position across restarts, hides disabled timers entirely, and right-clicking it opens Break settings; it stays visible during a break showing the remaining rest time.
- Desktop Device settings: startup mode (show window / start minimized to tray) and on-close behavior (ask / always keep running / always quit).
- Single-instance: launching replaces an existing instance by default (graceful SIGTERM handover via a PID lock; screenshot mode is exempt).
Changed
---
- Micro breaks open their window the moment they are due - the invisible toast-prompt phase is gone (rest/daily keep their prompts).
- Break exercises are removed for now: breaks are just the countdown and controls; the "Exercises" settings row and the tray entry are gone. Running a practice during a break is planned as the follow-up.
- Idle memory: source fonts now rasterize once each at the DPI-scaled base size (plus one lazily built tier for large text) instead of caching up to eight per-size rasterizations, and a burst of new glyphs re-rasterizes at most once per frame per font; language-picker fallback fonts seed ASCII only and grow on demand (kryon `ui_text` change).
- The process no longer links GTK: the system theme reads the desktop's real palette from the theme's gtk.css (kryon `system_theme`), file dialogs shell out to zenity/kdialog/yad (kryon's default backend order), and the GTK tray backend resolves libgtk-3 through kryon's runtime loader only when the tray actually starts. `INBE_NO_TRAY=1` skips the tray entirely (idle RSS drops from ~132 MB to ~103 MB; with the tray it is ~126 MB).
- glibc malloc arenas are capped at four (the app runs ~19 threads; the default ceiling let per-thread arenas inflate idle RSS).
- `KRYON_MEM_DEBUG=1` prints RSS/arena snapshots at startup and steady state (`KryonMemReport`), plus per-font rasterization stats (`UIFontMemoryReport`).
- Vendored Kryon bumped to master (ui_window center/drag/right-click/click-position, per-window XImage buffers, X11 `Time` layout fix; system_theme gtk.css palette).
Fixed
---
- Android updates can once again be delivered through F-Droid.
- Restored 32-bit Windows downloads.
- Clicks on extra OS windows (HUD, break window) register correctly: the X11 `Time` field in the event stand-in had the wrong width, shifting button/position reads (right-click and buttons appeared dead).
- Extra OS windows no longer corrupt the heap when two windows of different sizes alternate (per-window XImage buffers).
- The Breaks entry shows in the settings sidebar on desktop again (`#if DESKTOP` resolved against an undefined constant, compiling the mobile branch everywhere).
@@ -1,23 +0,0 @@
Added
---
- Breathing Patterns with Box, 4-7-8, coherent, extended-exhale and custom timed breathing sessions.
- Android Health Connect export for meditation, breathwork and sun-salutation sessions.
- Android home-screen widget, quick-settings tile and launcher shortcuts for starting practices.
- Interval bells for meditation: chime every 1/2/5/10/15/30 minutes (off by default).
- Weekday schedules and reminder times for habits, with support for up to 32 habits.
- CSV export of session history from Data & export settings.
- Practices can be started directly from a break and count as taking that break.
Changed
---
- Profile now uses clear top-level tabs for profile details, sync, data, friends and leaderboard.
- Leaderboard shows all useful statistics together in one sortable table; average hold appears only for Wim Hof sessions.
- The default Meditation habit now tracks sessions from Wim Hof, Meditation and Breathing Patterns.
- Breathing Patterns has a cleaner layout, smoother animation and keeps running when the app loses focus.
- Refreshed the Breathing Patterns and Meditation artwork while retaining the original Wim Hof banner.
- Simplified the Meditation screen and removed the redundant how-to section.
Fixed
---
- Profile and leaderboard loading states no longer display misleading zero values while data is loading.
- Fixed delayed or stale leaderboard results, duplicate Wim Hof entries and unreadable selected-button text.
- Fixed profile name display, text-field focus styling and profile picture icon colors.
- Fixed a corrupted notification-icon context menu and removed redundant tray and Practice-screen Show controls.
@@ -1,4 +1,4 @@
### Fixed
- Icon button fallback system - buttons now render with procedural graphics when asset images fail to load (prevents empty buttons on devices with asset loading issues)
- Added UIIconType system for icon identification and fallback rendering
- Updated all icon button functions to support fallback graphics (DrawUIIconBtn, DrawUIPaddedIconBtn, DrawUIIconLink, ui_draw_nav_button, ui_draw_nav_button_expand)
- Updated all icon button functions to support fallback graphics (ui_draw_icon_btn, ui_draw_icon_btn_padded, ui_draw_icon_link, ui_draw_nav_button, ui_draw_nav_button_expand)
@@ -1,3 +0,0 @@
Fixed
---
- Import now restores habits, habit sync settings, and optionally app settings from Inbe SQLite exports.
@@ -1,3 +0,0 @@
### Changed
- Reorganized WHM and Meditation into practice-owned modules for cleaner code boundaries.
- Split the meditation manual into an image intro page and a shorter music/gong setup page.
@@ -1,2 +0,0 @@
### Fixed
- Improved Android data import for `.db` backups, weekly habit rows, and import conflict handling.
@@ -1,2 +0,0 @@
### Fixed
- Fixed Tickmate `.db` imports so zero-based months map correctly and long habit histories load without dropping later dates.
@@ -1,2 +0,0 @@
### Added
- optional sync client, offline account creation
@@ -1,2 +0,0 @@
### Changed
- Improve account management
@@ -1,3 +0,0 @@
### Fixed
- Improve sync auth, websocket reconnects, and queued habit/session updates.
- Reduce SQLite-related UI flicker and speed up bulk import sync queueing.
@@ -1,3 +0,0 @@
### Fixed
- Refresh expired native sync auth tokens before sending queued changes.
- Require first-time meditation users to continue through the tutorial before starting.
@@ -1,3 +0,0 @@
### Fixed
- Build the Ubuntu Touch Click package with the OpenStore package id and review-compatible control metadata.
- Omit Click AppStream metadata by default to avoid OpenStore revision import failures.
@@ -1,2 +0,0 @@
### Changed
- Fix spacing issues and translations
@@ -1,4 +0,0 @@
### Changed
- Add a responsive Flint sidebar, configurable bottom navigation, and independent Statistics screen.
### Fixed
- Preserve queued local habit counter settings when applying sync responses.
@@ -1,3 +0,0 @@
### Changed
- Rework Practice into Manual, start, and configuration tabs with a new localized first-run guide.
- Simplify Meditation's manual to one page and make bottom navigation more compact.
@@ -1,2 +0,0 @@
### Changed
- Fixed start screen
@@ -1,2 +0,0 @@
### Fixed
- Fix Practice startup, manual navigation, configuration scrolling, and sync backfill issues.
@@ -1,4 +0,0 @@
### Added
- Added guide to habits page
### Changed
- fix orientation issues
@@ -1,4 +0,0 @@
### Added
- tab bar mode for habits and exercises
### Changed
- fix ut click file
@@ -1,3 +0,0 @@
### Changed
- New logo
- improve tabbar ui
@@ -1,3 +0,0 @@
Fixed
---
- icon scaling
@@ -1,4 +0,0 @@
Changed
---
- let you disable screen transitions
- added theme modal
Loaded 100 of 545 files, more files were not shown because too many files have changed in this diff. Show more