Compare commits

...
6 Commits
Author SHA1 Message Date
waozi 44725b5bf6 fix changelog 2026-06-27 18:55:59 -03:00
waozi 894552e1b6 update version 2026-06-27 18:55:11 -03:00
waozi 2695cf99a1 Update Flint vendor runtime paths 2026-06-27 18:39:48 -03:00
waozi 62317fa294 improved meditation practice 2026-06-27 18:15:36 -03:00
waozi b492e59c90 move liboqs account managemnt to flint 2026-06-27 16:14:13 -03:00
waozi 86e529db36 polish theme and translations 2026-06-27 15:37:08 -03:00
46 changed files with 997 additions and 748 deletions

No files matched your search

+47 -1
View File
@@ -393,7 +393,7 @@ jobs:
- name: Copy Android Assets
run: ./scripts/copy-android-assets.sh
- name: Build Android APK
- name: Build Android APK and AAB
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
@@ -405,7 +405,13 @@ jobs:
-Pkeystore.alias="$KEY_ALIAS" \
-Pkeystore.password="$KEYSTORE_PASSWORD" \
--stacktrace
./droid/gradlew -p droid bundleRelease \
-Pkeystore.path="$HOME/.android/inbe-release.keystore" \
-Pkeystore.alias="$KEY_ALIAS" \
-Pkeystore.password="$KEYSTORE_PASSWORD" \
--stacktrace
make android-copy-release-apks
make android-copy-bundle
- name: Collect Android Release Files
run: |
@@ -417,6 +423,12 @@ jobs:
exit 1
fi
cp "build/android/inbe-$VERSION.apk" build/release/android/
aab="$(find droid/app/build/outputs/bundle/release build/android -type f -name '*.aab' | head -n 1)"
if [ -z "$aab" ]; then
echo "No release AAB was produced"
exit 1
fi
cp "$aab" "build/release/android/inbe-$VERSION.aab"
- name: Upload Android Artifacts
uses: actions/upload-artifact@v4
@@ -557,3 +569,37 @@ jobs:
butler push "$android_apk" waozi/inbe:android --userversion "$VERSION"
butler push "$windows_zip" waozi/inbe:windows --userversion "$VERSION"
butler push "$linux_appimage" waozi/inbe:linux --userversion "$VERSION"
publish-google-play:
name: Publish Google Play Alpha
runs-on: ubuntu-latest
needs:
- build-android
- release
if: needs.release.outputs.tag_pushed == 'true'
steps:
- name: Check Google Play Secret
env:
PLAY_STORE_JSON_KEY: ${{ secrets.PLAY_STORE_JSON_KEY }}
run: |
set -euo pipefail
if [ -z "${PLAY_STORE_JSON_KEY:-}" ]; then
echo "PLAY_STORE_JSON_KEY secret is required to publish Google Play"
exit 1
fi
- name: Download Android Release Artifact
uses: actions/download-artifact@v4
with:
name: release-android
path: build/release/android
- name: Publish AAB to Closed Testing Alpha
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.PLAY_STORE_JSON_KEY }}
packageName: xyz.waozi.inbe
releaseFiles: build/release/android/*.aab
track: alpha
status: completed
-6
View File
@@ -4,12 +4,6 @@
[submodule "vendor/sqlite"]
path = vendor/sqlite
url = https://github.com/sqlite/sqlite
[submodule "vendor/liboqs"]
path = vendor/liboqs
url = https://github.com/open-quantum-safe/liboqs.git
[submodule "vendor/curl"]
path = vendor/curl
url = https://github.com/curl/curl.git
[submodule "vendor/flint"]
path = vendor/flint
url = [email protected]:waozixyz/flint.git
+15 -2
View File
@@ -1,10 +1,23 @@
# Changelog
## [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
### Changed
- Improve sun salutation
## [1.6.1] - 2026-06-27
## Changed
### Changed
- Improved notification in session
- Standardized settings screen1
+41 -96
View File
@@ -102,22 +102,37 @@ FLINT_SRCS := $(filter-out $(FLINT_ICON_ASSETS_C),$(wildcard $(FLINT_DIR)/src/*.
FLINT_WEB_SRCS := $(filter-out $(FLINT_DIR)/src/flint_file_dialog.c,$(FLINT_SRCS))
FLINT_WINDOWS_SRCS := $(filter-out $(FLINT_DIR)/src/flint_file_dialog.c,$(FLINT_SRCS))
FLINT_INCLUDE := -I$(FLINT_DIR)/include
CURL_DIR := vendor/curl
CURL_BUILD_DIR := $(VENDOR_BUILD_DIR)/linux/$(ARCH)/curl
CURL_INCLUDE_DIR := $(CURL_BUILD_DIR)/include
CURL_LIB_DIR := $(CURL_BUILD_DIR)/lib64
CURL_SO := $(CURL_LIB_DIR)/libcurl.so
CURL_PROTOCOL_CHECK := $(CURL_BUILD_DIR)/.protocols-ok
OPENSSL_ROOT_DIR ?= $(shell pkg-config --variable=prefix openssl 2>/dev/null)
OPENSSL_CMAKE_OPT := $(if $(strip $(OPENSSL_ROOT_DIR)),-DOPENSSL_ROOT_DIR=$(OPENSSL_ROOT_DIR),)
OPENSSL_INCLUDE_CMAKE_OPT := $(if $(strip $(OPENSSL_INCLUDE_DIR)),-DOPENSSL_INCLUDE_DIR=$(OPENSSL_INCLUDE_DIR),)
OPENSSL_SSL_CMAKE_OPT := $(if $(strip $(OPENSSL_SSL_LIBRARY)),-DOPENSSL_SSL_LIBRARY=$(OPENSSL_SSL_LIBRARY),)
OPENSSL_CRYPTO_CMAKE_OPT := $(if $(strip $(OPENSSL_CRYPTO_LIBRARY)),-DOPENSSL_CRYPTO_LIBRARY=$(OPENSSL_CRYPTO_LIBRARY),)
OPENSSL_LIB_DIR := $(patsubst %/,%,$(dir $(OPENSSL_SSL_LIBRARY)))
OPENSSL_LDLIBS := $(if $(strip $(OPENSSL_SSL_LIBRARY) $(OPENSSL_CRYPTO_LIBRARY)),-Xlinker -rpath -Xlinker $(OPENSSL_LIB_DIR) $(OPENSSL_SSL_LIBRARY) $(OPENSSL_CRYPTO_LIBRARY),$(or $(shell pkg-config --libs openssl 2>/dev/null),-lssl -lcrypto))
FLINT_CURL_CFLAGS := -I$(CURL_INCLUDE_DIR)
FLINT_CURL_LDLIBS := -L$(CURL_LIB_DIR) -Wl,-rpath,$(abspath $(CURL_LIB_DIR)) -lcurl $(OPENSSL_LDLIBS)
FLINT_CURL_VERSION_NUM ?= $(shell printf '%s\n' '#include <curl/curlver.h>' 'LIBCURL_VERSION_NUM' | $(CC) -I$(CURL_DIR)/include -E -P - 2>/dev/null | tail -n 1)
FLINT_VENDOR_BUILD_DIR := $(VENDOR_BUILD_DIR)/linux/$(ARCH)
FLINT_LIBOQS_BUILD_DIR := $(FLINT_VENDOR_BUILD_DIR)/liboqs
FLINT_WEB_LIBOQS_BUILD_DIR := $(VENDOR_BUILD_DIR)/web/liboqs
FLINT_CURL_BUILD_DIR := $(FLINT_VENDOR_BUILD_DIR)/curl
FLINT_CURL_REQUIRE_WEBSOCKETS := 1
FLINT_CURL_EXTRA_CMAKE_FLAGS := \
-DCURL_DISABLE_WEBSOCKETS=OFF \
-DCURL_DISABLE_INSTALL=OFF \
-DCURL_DISABLE_DICT=ON \
-DCURL_DISABLE_FILE=ON \
-DCURL_DISABLE_FTP=ON \
-DCURL_DISABLE_GOPHER=ON \
-DCURL_DISABLE_IMAP=ON \
-DCURL_DISABLE_MQTT=ON \
-DCURL_DISABLE_POP3=ON \
-DCURL_DISABLE_RTSP=ON \
-DCURL_DISABLE_SMTP=ON \
-DCURL_DISABLE_TELNET=ON \
-DCURL_DISABLE_TFTP=ON \
-DCURL_DISABLE_LIBCURL_OPTION=ON \
-DCURL_ZLIB=OFF \
-DCURL_BROTLI=OFF \
-DCURL_ZSTD=OFF
include $(FLINT_DIR)/mk/vendor.mk
CURL_DIR := $(FLINT_CURL_DIR)
CURL_BUILD_DIR := $(FLINT_CURL_BUILD_DIR)
CURL_INCLUDE_DIR := $(FLINT_CURL_INCLUDE_DIR)
CURL_LIB_DIR := $(FLINT_CURL_LIB_DIR)
CURL_SO := $(FLINT_CURL_SO)
CURL_PROTOCOL_CHECK := $(FLINT_CURL_PROTOCOL_CHECK)
FLINT_CURL_VERSION_NUM ?= $(shell printf '%s\n' '#include <curl/curlver.h>' 'LIBCURL_VERSION_NUM' | $(CC) -I$(FLINT_CURL_DIR)/include -E -P - 2>/dev/null | tail -n 1)
FLINT_CURL_VERSION_HEX := $(patsubst 0x%,%,$(FLINT_CURL_VERSION_NUM))
SQLITE_DIR := vendor/sqlite
SQLITE_BUILD_DIR := $(VENDOR_BUILD_DIR)/sqlite
@@ -125,12 +140,12 @@ SQLITE_AMALGAMATION_C := $(SQLITE_BUILD_DIR)/sqlite3.c
SQLITE_AMALGAMATION_H := $(SQLITE_BUILD_DIR)/sqlite3.h
SQLITE_SRC := $(SQLITE_AMALGAMATION_C)
SQLITE_INCLUDE := -I$(SQLITE_BUILD_DIR)
LIBOQS_DIR := vendor/liboqs
LIBOQS_BUILD_DIR := $(VENDOR_BUILD_DIR)/linux/$(ARCH)/liboqs
LIBOQS_A := $(LIBOQS_BUILD_DIR)/lib/liboqs.a
LIBOQS_INCLUDE := -I$(LIBOQS_BUILD_DIR)/include
WEB_LIBOQS_BUILD_DIR := $(VENDOR_BUILD_DIR)/web/liboqs
WEB_LIBOQS_A := $(WEB_LIBOQS_BUILD_DIR)/lib/liboqs.a
LIBOQS_DIR := $(FLINT_LIBOQS_DIR)
LIBOQS_BUILD_DIR := $(FLINT_LIBOQS_BUILD_DIR)
LIBOQS_A := $(FLINT_LIBOQS_A)
LIBOQS_INCLUDE := $(FLINT_LIBOQS_INCLUDE)
WEB_LIBOQS_BUILD_DIR := $(FLINT_WEB_LIBOQS_BUILD_DIR)
WEB_LIBOQS_A := $(FLINT_WEB_LIBOQS_A)
WEB_LIBOQS_INCLUDE := -I$(WEB_LIBOQS_BUILD_DIR)/include
TEST_BIN_DIR := $(BUILD_BIN_DIR)/tests
STORAGE_IMPORT_TEST := $(TEST_BIN_DIR)/storage_import_test
@@ -353,11 +368,11 @@ $(SYNC_URL_TEST): tests/sync_url_test.c src/storage/sync_client.c src/storage/sy
tests/sync_url_test.c src/storage/sync_client.c \
-Wl,--gc-sections $(FLINT_CURL_LDLIBS)
$(SYNC_ACCOUNT_TEST): tests/sync_account_test.c src/storage/sync_account.c src/storage/sync_account.h src/storage/storage.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/storage/storage.h src/storage/db.h src/storage/import.h src/third_party/miniz.c src/third_party/miniz.h $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
$(SYNC_ACCOUNT_TEST): tests/sync_account_test.c src/storage/sync_account.c src/storage/sync_account.h $(FLINT_DIR)/src/flint_lyra_account.c $(FLINT_DIR)/include/flint_lyra_account.h src/storage/storage.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/storage/storage.h src/storage/db.h src/storage/import.h src/third_party/miniz.c src/third_party/miniz.h $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE -D_GNU_SOURCE -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -ffunction-sections -fdata-sections \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/practices -Isrc/practices/whm -Isrc/practices/meditation -Isrc/storage -Isrc/platform/android -Isrc/third_party $(FLINT_INCLUDE) -I$(RAYLIB_DIR) $(SQLITE_INCLUDE) \
-o $@ \
tests/sync_account_test.c src/storage/sync_account.c src/storage/storage.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/third_party/miniz.c $(SQLITE_SRC) \
tests/sync_account_test.c src/storage/sync_account.c $(FLINT_DIR)/src/flint_lyra_account.c src/storage/storage.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/third_party/miniz.c $(SQLITE_SRC) \
-Wl,--gc-sections -lm -lpthread -ldl
$(SYNC_REVIEW_TEST): tests/sync_review_test.c src/storage/storage.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/storage/storage.h src/storage/db.h src/storage/import.h src/third_party/miniz.c src/third_party/miniz.h $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
@@ -492,76 +507,6 @@ $(SQLITE_AMALGAMATION_C) $(SQLITE_AMALGAMATION_H): $(SQLITE_DIR)/configure $(SQL
cd $(SQLITE_BUILD_DIR) && $(abspath $(SQLITE_DIR))/configure
$(MAKE) -C $(SQLITE_BUILD_DIR) sqlite3.c sqlite3.h
$(LIBOQS_A): $(LIBOQS_DIR)/CMakeLists.txt | $(BUILD_OBJ_DIR)
$(CMAKE) -S $(LIBOQS_DIR) -B $(LIBOQS_BUILD_DIR) \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DBUILD_SHARED_LIBS=OFF \
-DOQS_BUILD_ONLY_LIB=ON \
-DOQS_USE_OPENSSL=OFF \
-DOQS_MINIMAL_BUILD=SIG_ml_dsa_44
$(CMAKE) --build $(LIBOQS_BUILD_DIR) --target oqs
$(WEB_LIBOQS_A): $(LIBOQS_DIR)/CMakeLists.txt | $(BUILD_OBJ_DIR)
emcmake $(CMAKE) -S $(LIBOQS_DIR) -B $(WEB_LIBOQS_BUILD_DIR) \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DBUILD_SHARED_LIBS=OFF \
-DOQS_BUILD_ONLY_LIB=ON \
-DOQS_USE_OPENSSL=OFF \
-DOQS_DIST_BUILD=OFF \
-DOQS_OPT_TARGET=generic \
-DOQS_MINIMAL_BUILD=SIG_ml_dsa_44
$(CMAKE) --build $(WEB_LIBOQS_BUILD_DIR) --target oqs
$(CURL_SO): $(CURL_DIR)/CMakeLists.txt
$(CMAKE) -S $(CURL_DIR) -B $(CURL_BUILD_DIR) \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX=$(abspath $(CURL_BUILD_DIR)) \
-DCMAKE_INSTALL_LIBDIR=lib64 \
-DBUILD_CURL_EXE=OFF \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=OFF \
-DCURL_USE_OPENSSL=ON \
$(OPENSSL_CMAKE_OPT) \
$(OPENSSL_INCLUDE_CMAKE_OPT) \
$(OPENSSL_SSL_CMAKE_OPT) \
$(OPENSSL_CRYPTO_CMAKE_OPT) \
-DCURL_DISABLE_WEBSOCKETS=OFF \
-DCURL_DISABLE_INSTALL=OFF \
-DCURL_DISABLE_LDAP=ON \
-DCURL_DISABLE_LDAPS=ON \
-DCURL_DISABLE_DICT=ON \
-DCURL_DISABLE_FILE=ON \
-DCURL_DISABLE_FTP=ON \
-DCURL_DISABLE_GOPHER=ON \
-DCURL_DISABLE_IMAP=ON \
-DCURL_DISABLE_MQTT=ON \
-DCURL_DISABLE_POP3=ON \
-DCURL_DISABLE_RTSP=ON \
-DCURL_DISABLE_SMB=ON \
-DCURL_DISABLE_SMTP=ON \
-DCURL_DISABLE_TELNET=ON \
-DCURL_DISABLE_TFTP=ON \
-DCURL_DISABLE_LIBCURL_OPTION=ON \
-DCURL_ZLIB=OFF \
-DCURL_BROTLI=OFF \
-DCURL_ZSTD=OFF \
-DCURL_USE_LIBPSL=OFF \
-DCURL_USE_LIBSSH2=OFF \
-DCURL_USE_GSSAPI=OFF \
-DUSE_NGHTTP2=OFF \
-DUSE_LIBIDN2=OFF \
-DENABLE_CURL_MANUAL=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_LIBCURL_DOCS=OFF \
-DBUILD_MISC_DOCS=OFF \
-DBUILD_TESTING=OFF
$(CMAKE) --build $(CURL_BUILD_DIR) --target install
$(CURL_PROTOCOL_CHECK): $(CURL_SO)
@$(CURL_BUILD_DIR)/bin/curl-config --protocols | grep -Eq '(^|[[:space:]])WS([[:space:]]|$$)' || { echo "vendored libcurl was built without WS protocol support"; exit 1; }
@$(CURL_BUILD_DIR)/bin/curl-config --protocols | grep -Eq '(^|[[:space:]])WSS([[:space:]]|$$)' || { echo "vendored libcurl was built without WSS protocol support"; exit 1; }
@touch $@
$(WIN64_CURL_A): $(CURL_DIR)/CMakeLists.txt
rm -rf $(WIN64_CURL_BUILD_DIR)
$(CMAKE) -S $(CURL_DIR) -B $(WIN64_CURL_BUILD_DIR) \
@@ -632,7 +577,7 @@ $(TARGET): Makefile $(SRC) $(FLINT_SRCS) $(FLINT_ICON_STAMP) $(SQLITE_SRC) $(SQL
$(LIBOQS_INCLUDE) \
-I$(RAYLIB_DIR) \
$(RAY_CFLAGS) \
-DINBE_HAS_LIBOQS=1 \
-DFLINT_HAS_LIBOQS=1 \
-DSUPPORT_MODULE_RAUDIO=1 \
-DSUPPORT_FILEFORMAT_OGG=1 \
-DSUPPORT_FILEFORMAT_MP3=0 \
@@ -819,7 +764,7 @@ $(WEB_TARGET): Makefile $(SRC) $(FLINT_WEB_SRCS) $(FLINT_ICON_STAMP) $(SQLITE_SR
$(SQLITE_INCLUDE) \
$(WEB_LIBOQS_INCLUDE) \
-I$(RAYLIB_DIR) \
-DINBE_HAS_LIBOQS=1 \
-DFLINT_HAS_LIBOQS=1 \
-DPLATFORM_WEB \
-DSUPPORT_MODULE_RAUDIO=1 \
-DSUPPORT_FILEFORMAT_OGG=1 \
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 102 KiB

+2 -2
View File
@@ -35,8 +35,8 @@ android {
defaultConfig {
minSdk 21
targetSdk 35
versionCode 58
versionName "1.6.2"
versionCode 60
versionName "1.6.4"
}
+1 -1
View File
@@ -21,7 +21,7 @@ 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)
add_subdirectory("${REPO_ROOT}/vendor/liboqs" "${CMAKE_BINARY_DIR}/liboqs")
add_subdirectory("${FLINT_DIR}/vendor/liboqs" "${CMAKE_BINARY_DIR}/liboqs")
file(GLOB FLINT_SOURCES CONFIGURE_DEPENDS "${FLINT_DIR}/src/*.c" "${FLINT_DIR}/src/ui/*.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")
@@ -0,0 +1 @@
- Improve theme, habit, and localization UI polish
@@ -0,0 +1,4 @@
- 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.
- Fix Android native build to use Flint's liboqs submodule.
+40 -10
View File
@@ -157,6 +157,21 @@ Nelze načíst soubor s meditační hudbou. Zkontrolujte připojení k internetu
[duration_2h]
2 h
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
DÝCHAT
---
@@ -305,10 +320,19 @@ Pauza po kole
Pokročilé ovládání sezení
---
[double_tap_to_breathe_label]
Double tap to breathe
Dvojí klepnutí pro nádech
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
Dvakrát klepněte na obrazovku pro nádech
---
[session_count_singular]
%d sezení
---
[session_count_plural]
%d sezení
---
[no_sessions]
Žádná sezení
---
[hold_display_label]
Zobrazeni zadrze
@@ -323,7 +347,7 @@ Kruh
Hlasitost
---
[show_session_volume_control_label]
Zobrazit ovladani hlasitosti
Zobrazit ovládání hlasitosti
---
[reset_to_defaults_label]
Obnovit výchozí
@@ -549,7 +573,7 @@ Oceán
Les
---
[theme_sunset]
Západ slunce
Soumrak
---
[theme_lavender]
Levandule
@@ -738,10 +762,10 @@ Název
Podtržení
---
[habit_practice_list_title]
Session Data From
Data sezení z
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
Vyberte, která cvičební sezení se počítají do tohoto návyku. Odpovídající dny se zobrazí jako splněné a mohou otevřít editor sezení.
---
[habit_counting_title]
Počítání
@@ -800,6 +824,12 @@ Celková zádrž
[habit_stats_best_streak]
Nejlepší série
---
[habit_stats_day_singular]
%d den
---
[habit_stats_day_plural]
%d dní
---
[bottom_nav_customize_button]
Upravit spodní navigaci
---
@@ -871,13 +901,13 @@ Karty
---
[transition_label]
Transition
Přechod
[transition_none]
None
Žádný
[transition_fade]
Fade
Prolnutí
[theme_picker_title]
Choose Theme
Vybrat motiv
[skip_button]
Skip
---
+42 -12
View File
@@ -157,6 +157,21 @@ Der Meditations-Musikserver konnte nicht erreicht werden. Prüfe die Android-Net
[duration_2h]
2 Std.
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
ATEM
---
@@ -305,10 +320,19 @@ Pause nach Runde
Erweiterte Sitzungssteuerung
---
[double_tap_to_breathe_label]
Double tap to breathe
Doppeltippen zum Atmen
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
Doppeltippe auf den Bildschirm, um zu atmen
---
[session_count_singular]
%d Sitzung
---
[session_count_plural]
%d Sitzungen
---
[no_sessions]
Keine Sitzungen
---
[hold_display_label]
Atemhalteanzeige
@@ -323,7 +347,7 @@ Kreis
Lautstärke
---
[show_session_volume_control_label]
Lautstaerkeregler anzeigen
Lautstärkeregler anzeigen
---
[reset_to_defaults_label]
Auf Standard zurücksetzen
@@ -549,7 +573,7 @@ Ozean
Wald
---
[theme_sunset]
Sonnenuntergang
Abendrot
---
[theme_lavender]
Lavendel
@@ -738,10 +762,10 @@ Bezeichnung
Unterstreichung
---
[habit_practice_list_title]
Session Data From
Sitzungsdaten aus
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
Wähle, welche Übungssitzungen für diese Gewohnheit zählen. Passende Tage werden als erledigt angezeigt und können den Sitzungseditor öffnen.
---
[habit_counting_title]
Zählen
@@ -800,6 +824,12 @@ Gesamte Atemhaltezeit
[habit_stats_best_streak]
Beste Serie
---
[habit_stats_day_singular]
%d Tag
---
[habit_stats_day_plural]
%d Tage
---
[bottom_nav_customize_button]
Untere Navigation anpassen
---
@@ -864,20 +894,20 @@ Sieh dir hier deine Gewohnheitsstatistiken an.
Navigation
---
[nav_mode_dropdown]
Dropdown
Liste
---
[nav_mode_tabbar]
Tabs
Reiter
---
[transition_label]
Transition
Übergang
[transition_none]
None
Keine
[transition_fade]
Fade
Blende
[theme_picker_title]
Choose Theme
Thema wählen
[skip_button]
Skip
---
+31 -1
View File
@@ -160,6 +160,21 @@ Music by Elijah_K.
[duration_2h]
2h
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
BREATH
---
@@ -370,6 +385,15 @@ Double tap to breathe
[double_tap_to_breathe_hint]
Double tap screen to breathe
---
[session_count_singular]
%d session
---
[session_count_plural]
%d sessions
---
[no_sessions]
No sessions
---
[hold_display_label]
Hold display
---
@@ -780,7 +804,7 @@ Name
Underline
---
[habit_practice_list_title]
Practice list
Session data from
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
@@ -842,6 +866,12 @@ Total hold
[habit_stats_best_streak]
Best streak
---
[habit_stats_day_singular]
%d day
---
[habit_stats_day_plural]
%d days
---
[bottom_nav_customize_button]
Customize bottom navigation
---
+38 -8
View File
@@ -157,6 +157,21 @@ No se pudo acceder al archivo de música de meditación. Revisa tu conexión a i
[duration_2h]
2 h
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
RESPIRACIÓN
---
@@ -305,10 +320,19 @@ Pausa después de ronda
Controles avanzados de sesión
---
[double_tap_to_breathe_label]
Double tap to breathe
Doble toque para respirar
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
Toca dos veces la pantalla para respirar
---
[session_count_singular]
%d sesión
---
[session_count_plural]
%d sesiones
---
[no_sessions]
Sin sesiones
---
[hold_display_label]
Visualizacion de retencion
@@ -738,10 +762,10 @@ Nombre
Subrayado
---
[habit_practice_list_title]
Session Data From
Datos de sesión
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
Elige qué sesiones de práctica cuentan para este hábito. Los días coincidentes se muestran como completados y pueden abrir el editor de sesión.
---
[habit_counting_title]
Conteo
@@ -800,6 +824,12 @@ Retención total
[habit_stats_best_streak]
Mejor racha
---
[habit_stats_day_singular]
%d día
---
[habit_stats_day_plural]
%d días
---
[bottom_nav_customize_button]
Personalizar navegación inferior
---
@@ -871,13 +901,13 @@ Pestañas
---
[transition_label]
Transition
Transición
[transition_none]
None
Ninguna
[transition_fade]
Fade
Fundido
[theme_picker_title]
Choose Theme
Elegir tema
[skip_button]
Skip
---
+40 -10
View File
@@ -157,6 +157,21 @@ Impossible de joindre le fichier de musique de méditation. Vérifiez votre conn
[duration_2h]
2 h
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
RESPIRER
---
@@ -308,10 +323,19 @@ Pause après cycle
Contrôles avancés de séance
---
[double_tap_to_breathe_label]
Double tap to breathe
Double toucher pour respirer
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
Touchez deux fois l'écran pour respirer
---
[session_count_singular]
%d session
---
[session_count_plural]
%d sessions
---
[no_sessions]
Aucune session
---
[hold_display_label]
Affichage de la retention
@@ -326,7 +350,7 @@ Cercle
Volume
---
[show_session_volume_control_label]
Afficher le controle du volume
Afficher le contrôle du volume
---
[reset_to_defaults_label]
Réinitialiser
@@ -552,7 +576,7 @@ Océan
Forêt
---
[theme_sunset]
Coucher de soleil
Crépuscule
---
[theme_lavender]
Lavande
@@ -780,10 +804,10 @@ Nom
Soulignement
---
[habit_practice_list_title]
Session Data From
Données de session
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
Choisissez quelles sessions de pratique comptent pour cette habitude. Les jours correspondants sont marqués comme faits et peuvent ouvrir l'éditeur de session.
---
[habit_counting_title]
Comptage
@@ -842,6 +866,12 @@ Rétention totale
[habit_stats_best_streak]
Meilleure série
---
[habit_stats_day_singular]
%d jour
---
[habit_stats_day_plural]
%d jours
---
[bottom_nav_customize_button]
Personnaliser la navigation du bas
---
@@ -913,13 +943,13 @@ Onglets
---
[transition_label]
Transition
Effet
[transition_none]
None
Aucune
[transition_fade]
Fade
Fondu
[theme_picker_title]
Choose Theme
Choisir un thème
---
[notification_session_active]
Session active
+39 -9
View File
@@ -157,6 +157,21 @@ Tidak dapat membuka file musik meditasi. Periksa koneksi internetmu, lalu coba l
[duration_2h]
2j
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
NAFAS
---
@@ -305,10 +320,19 @@ Jeda setelah ronde
Kontrol sesi lanjutan
---
[double_tap_to_breathe_label]
Double tap to breathe
Ketuk dua kali untuk bernapas
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
Ketuk layar dua kali untuk bernapas
---
[session_count_singular]
%d sesi
---
[session_count_plural]
%d sesi
---
[no_sessions]
Tidak ada sesi
---
[hold_display_label]
Tampilan tahan napas
@@ -738,10 +762,10 @@ Nama
Garis bawah
---
[habit_practice_list_title]
Session Data From
Data sesi dari
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
Pilih sesi latihan mana yang dihitung untuk kebiasaan ini. Hari yang cocok ditandai selesai dan dapat membuka editor sesi.
---
[habit_counting_title]
Penghitungan
@@ -800,6 +824,12 @@ Total tahan
[habit_stats_best_streak]
Rangkaian terbaik
---
[habit_stats_day_singular]
%d hari
---
[habit_stats_day_plural]
%d hari
---
[bottom_nav_customize_button]
Sesuaikan navigasi bawah
---
@@ -864,20 +894,20 @@ Lihat statistik kebiasaan Anda di sini.
Navigasi
---
[nav_mode_dropdown]
Dropdown
Menu
---
[nav_mode_tabbar]
Tab
---
[transition_label]
Transition
Transisi
[transition_none]
None
Tidak ada
[transition_fade]
Fade
Pudar
[theme_picker_title]
Choose Theme
Pilih Tema
[skip_button]
Skip
---
+40 -10
View File
@@ -157,6 +157,21 @@ Impossibile raggiungere il file musicale per la meditazione. Controlla la connes
[duration_2h]
2 ore
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
RESPIRO
---
@@ -359,10 +374,19 @@ Pausa dopo round
Controlli avanzati sessione
---
[double_tap_to_breathe_label]
Double tap to breathe
Doppio tap per respirare
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
Tocca due volte lo schermo per respirare
---
[session_count_singular]
%d sessione
---
[session_count_plural]
%d sessioni
---
[no_sessions]
Nessuna sessione
---
[hold_display_label]
Visualizzazione trattenuta
@@ -377,7 +401,7 @@ Cerchio
Volume
---
[show_session_volume_control_label]
Mostra il controllo volume
Mostra controllo volume
---
[reset_to_defaults_label]
Ripristina predefiniti
@@ -738,10 +762,10 @@ Nome
Sottolineatura
---
[habit_practice_list_title]
Session Data From
Dati sessione da
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
Scegli quali sessioni di pratica contano per questa abitudine. I giorni corrispondenti risultano completati e possono aprire l'editor della sessione.
---
[habit_counting_title]
Conteggio
@@ -800,6 +824,12 @@ Apnea totale
[habit_stats_best_streak]
Migliore serie
---
[habit_stats_day_singular]
%d giorno
---
[habit_stats_day_plural]
%d giorni
---
[bottom_nav_customize_button]
Personalizza navigazione inferiore
---
@@ -864,20 +894,20 @@ Visualizza qui le statistiche delle abitudini.
Navigazione
---
[nav_mode_dropdown]
Dropdown
Menu
---
[nav_mode_tabbar]
Schede
---
[transition_label]
Transition
Transizione
[transition_none]
None
Nessuna
[transition_fade]
Fade
Dissolvenza
[theme_picker_title]
Choose Theme
Scegli tema
[skip_button]
Skip
---
+38 -8
View File
@@ -157,6 +157,21 @@ Sun Salutation
[duration_2h]
2時間
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
呼吸
---
@@ -305,10 +320,19 @@ OK
詳細なセッション設定
---
[double_tap_to_breathe_label]
Double tap to breathe
ダブルタップで呼吸
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
画面をダブルタップして呼吸
---
[session_count_singular]
%dセッション
---
[session_count_plural]
%dセッション
---
[no_sessions]
セッションなし
---
[hold_display_label]
ホールド表示
@@ -738,10 +762,10 @@ https:// または localhost:8080 のようなループバックを使用して
下線
---
[habit_practice_list_title]
Session Data From
セッションデータ
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
この習慣に含める練習セッションを選びます。一致する日は完了として表示され、セッション編集画面を開けます。
---
[habit_counting_title]
カウント
@@ -800,6 +824,12 @@ Choose which practice sessions count for this habit. Matching days show as compl
[habit_stats_best_streak]
最長連続記録
---
[habit_stats_day_singular]
%d日
---
[habit_stats_day_plural]
%d日
---
[bottom_nav_customize_button]
下部ナビゲーションをカスタマイズ
---
@@ -871,13 +901,13 @@ Choose which practice sessions count for this habit. Matching days show as compl
---
[transition_label]
Transition
切り替え
[transition_none]
None
なし
[transition_fade]
Fade
フェード
[theme_picker_title]
Choose Theme
テーマ選択
[skip_button]
Skip
---
+38 -8
View File
@@ -157,6 +157,21 @@ Sun Salutation
[duration_2h]
2시간
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
호흡
---
@@ -359,10 +374,19 @@ Sun Salutation
고급 세션 제어
---
[double_tap_to_breathe_label]
Double tap to breathe
두 번 탭해 호흡
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
화면을 두 번 탭해 호흡
---
[session_count_singular]
%d개 세션
---
[session_count_plural]
%d개 세션
---
[no_sessions]
세션 없음
---
[hold_display_label]
홀드 표시
@@ -737,10 +761,10 @@ https:// 또는 localhost:8080 같은 루프백을 사용하세요
밑줄
---
[habit_practice_list_title]
Session Data From
세션 데이터
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
이 습관에 포함할 연습 세션을 선택하세요. 일치하는 날은 완료로 표시되며 세션 편집기를 열 수 있습니다.
---
[habit_counting_title]
횟수
@@ -799,6 +823,12 @@ Choose which practice sessions count for this habit. Matching days show as compl
[habit_stats_best_streak]
최고 연속 기록
---
[habit_stats_day_singular]
%d일
---
[habit_stats_day_plural]
%d일
---
[bottom_nav_customize_button]
하단 내비게이션 사용자화
---
@@ -870,13 +900,13 @@ Choose which practice sessions count for this habit. Matching days show as compl
---
[transition_label]
Transition
전환
[transition_none]
None
없음
[transition_fade]
Fade
페이드
[theme_picker_title]
Choose Theme
테마 선택
[skip_button]
Skip
---
+40 -10
View File
@@ -157,6 +157,21 @@ Não foi possível acessar o arquivo de música de meditação. Verifique sua co
[duration_2h]
2 h
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
RESPIRAR
---
@@ -305,10 +320,19 @@ Pausa após rodada
Controles avançados da sessão
---
[double_tap_to_breathe_label]
Double tap to breathe
Toque duplo para respirar
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
Toque duas vezes na tela para respirar
---
[session_count_singular]
%d sessão
---
[session_count_plural]
%d sessões
---
[no_sessions]
Sem sessões
---
[hold_display_label]
Exibicao da retencao
@@ -549,7 +573,7 @@ Oceano
Floresta
---
[theme_sunset]
Pôr do sol
Poente
---
[theme_lavender]
Lavanda
@@ -738,10 +762,10 @@ Nome
Sublinhado
---
[habit_practice_list_title]
Session Data From
Dados de sessão
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
Escolha quais sessões de prática contam para este hábito. Dias correspondentes aparecem como concluídos e podem abrir o editor de sessão.
---
[habit_counting_title]
Contagem
@@ -800,6 +824,12 @@ Retenção total
[habit_stats_best_streak]
Melhor sequência
---
[habit_stats_day_singular]
%d dia
---
[habit_stats_day_plural]
%d dias
---
[bottom_nav_customize_button]
Personalizar navegação inferior
---
@@ -864,20 +894,20 @@ Veja suas estatisticas de habitos aqui.
Navegação
---
[nav_mode_dropdown]
Dropdown
Menu
---
[nav_mode_tabbar]
Abas
---
[transition_label]
Transition
Transição
[transition_none]
None
Nenhuma
[transition_fade]
Fade
Desvanecer
[theme_picker_title]
Choose Theme
Escolher tema
[skip_button]
Skip
---
+38 -8
View File
@@ -160,6 +160,21 @@ Sun Salutation
[duration_2h]
2 ч
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
ДЫШАТЬ
---
@@ -362,10 +377,19 @@ OK
Расширенное управление сессией
---
[double_tap_to_breathe_label]
Double tap to breathe
Двойное касание для вдоха
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
Коснитесь экрана дважды, чтобы вдохнуть
---
[session_count_singular]
%d сессия
---
[session_count_plural]
%d сессий
---
[no_sessions]
Нет сессий
---
[hold_display_label]
Отображение задержки
@@ -738,10 +762,10 @@ liboqs не собран для этой платформы.
Подчеркивание
---
[habit_practice_list_title]
Session Data From
Данные сессий из
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
Выберите, какие сессии практик учитываются для этой привычки. Совпадающие дни отмечаются как выполненные и могут открыть редактор сессии.
---
[habit_counting_title]
Подсчет
@@ -800,6 +824,12 @@ Choose which practice sessions count for this habit. Matching days show as compl
[habit_stats_best_streak]
Лучшая серия
---
[habit_stats_day_singular]
%d день
---
[habit_stats_day_plural]
%d дней
---
[bottom_nav_customize_button]
Настроить нижнюю навигацию
---
@@ -871,13 +901,13 @@ Choose which practice sessions count for this habit. Matching days show as compl
---
[transition_label]
Transition
Переход
[transition_none]
None
Нет
[transition_fade]
Fade
Плавно
[theme_picker_title]
Choose Theme
Выбор темы
[skip_button]
Skip
---
+38 -8
View File
@@ -157,6 +157,21 @@ Sun Salutation
[duration_2h]
2小时
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
呼吸
---
@@ -305,10 +320,19 @@ Sun Salutation
高级练习控制
---
[double_tap_to_breathe_label]
Double tap to breathe
双击呼吸
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
双击屏幕开始呼吸
---
[session_count_singular]
%d次会话
---
[session_count_plural]
%d次会话
---
[no_sessions]
没有会话
---
[hold_display_label]
屏息显示
@@ -736,10 +760,10 @@ liboqs 未为此目标构建。
下划线
---
[habit_practice_list_title]
Session Data From
会话数据来自
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
选择哪些练习会话计入此习惯。匹配的日期会显示为已完成,并可打开会话编辑器。
---
[habit_counting_title]
计数
@@ -798,6 +822,12 @@ Wim Hof 屏息轮次
[habit_stats_best_streak]
最佳连续记录
---
[habit_stats_day_singular]
%d天
---
[habit_stats_day_plural]
%d天
---
[bottom_nav_customize_button]
自定义底部导航
---
@@ -869,13 +899,13 @@ Wim Hof 屏息轮次
---
[transition_label]
Transition
过渡
[transition_none]
None
无
[transition_fade]
Fade
淡入淡出
[theme_picker_title]
Choose Theme
选择主题
[skip_button]
Skip
---
+5 -3
View File
@@ -131,13 +131,15 @@
form.addEventListener("submit", async (event) => {
event.preventDefault();
const exportedKey = keyText.value.trim();
if (!exportedKey.startsWith("inbe-sync-key-v1")) {
setStatus("error", "Upload the exported inbe-sync.key file.");
if (!exportedKey.startsWith("lyra-account-key-v1") &&
!exportedKey.startsWith("inbe-sync-key-v1") &&
!exportedKey.startsWith("account-key-v1")) {
setStatus("error", "Upload the exported account key file.");
return;
}
const userID = keyField(exportedKey, "public_id").toLowerCase();
if (!/^[0-9a-f]{64}$/.test(userID)) {
setStatus("error", "This key file does not include public_id. Export a new inbe-sync.key from the current Inner Breeze app.");
setStatus("error", "This key file does not include public_id. Export a new account key from the current app.");
return;
}
button.disabled = true;
+5 -3
View File
@@ -131,13 +131,15 @@
form.addEventListener("submit", async (event) => {
event.preventDefault();
const exportedKey = keyText.value.trim();
if (!exportedKey.startsWith("inbe-sync-key-v1")) {
setStatus("error", "Upload the exported inbe-sync.key file.");
if (!exportedKey.startsWith("lyra-account-key-v1") &&
!exportedKey.startsWith("inbe-sync-key-v1") &&
!exportedKey.startsWith("account-key-v1")) {
setStatus("error", "Upload the exported account key file.");
return;
}
const userID = keyField(exportedKey, "public_id").toLowerCase();
if (!/^[0-9a-f]{64}$/.test(userID)) {
setStatus("error", "This key file does not include public_id. Export a new inbe-sync.key from the current Inner Breeze app.");
setStatus("error", "This key file does not include public_id. Export a new account key from the current app.");
return;
}
button.disabled = true;
+4
View File
@@ -163,6 +163,10 @@ typedef struct MeditationPracticeState {
int duration_seconds;
int remaining_seconds;
int frame_ticks;
int complete_waiting;
int duration_mode;
int custom_minutes;
int show_extend_controls;
int music_enabled;
int music_shuffle;
int music_track;
+8
View File
@@ -190,6 +190,9 @@ save_settings(InbeApp *app)
{"sun_salutation_repetitions", app->sun_salutation.repetitions},
{"sun_salutation_start_seconds", app->sun_salutation.start_seconds},
{"sun_salutation_end_seconds", app->sun_salutation.end_seconds},
{"meditation_duration_mode", app->meditation.duration_mode},
{"meditation_custom_minutes", app->meditation.custom_minutes},
{"meditation_show_extend_controls", app->meditation.show_extend_controls ? 1 : 0},
{"meditation_music_enabled", app->meditation.music_enabled ? 1 : 0},
{"meditation_music_shuffle", app->meditation.music_shuffle ? 1 : 0},
{"meditation_music_track", app->meditation.music_track},
@@ -275,6 +278,7 @@ app_load_settings(InbeApp *app)
{&app->advanced_session_controls, "advanced_session_controls", 0},
{&app->double_tap_to_breathe, "double_tap_to_breathe", 0},
{&app->show_session_volume_control, "show_session_volume_control", 0},
{&app->meditation.show_extend_controls, "meditation_show_extend_controls", 1},
{&app->meditation.music_enabled, "meditation_music_enabled", 1},
{&app->meditation.music_shuffle, "meditation_music_shuffle", 0},
};
@@ -324,6 +328,10 @@ app_load_settings(InbeApp *app)
3, 12},
{&app->sun_salutation.end_seconds, "sun_salutation_end_seconds", 5,
3, 12},
{&app->meditation.duration_mode, "meditation_duration_mode", 1,
0, 5},
{&app->meditation.custom_minutes, "meditation_custom_minutes", 20,
1, 240},
{&app->meditation.music_track, "meditation_music_track", 0,
0, MEDITATION_MUSIC_TRACK_COUNT - 1},
{&app->practice_category_tab, "practice_category_tab", PRACTICE_CATEGORY_MIND,
+2 -2
View File
@@ -3,7 +3,7 @@
#define INBE_VERSION_MAJOR 1
#define INBE_VERSION_MINOR 6
#define INBE_VERSION_PATCH 2
#define INBE_VERSION_STRING "1.6.2"
#define INBE_VERSION_PATCH 4
#define INBE_VERSION_STRING "1.6.4"
#endif
+118 -1
View File
@@ -7,16 +7,132 @@
#include "flint_ui.h"
#include "raylib.h"
#include <stdio.h>
extern int view_width;
extern int view_height;
static const int meditation_config_preset_count = 5;
static int
meditation_config_duration_height(int content_w)
{
int columns = content_w >= flint_px(520) ? 3 : 2;
int count = meditation_config_preset_count + 1;
int rows = (count + columns - 1) / columns;
return flint_px(30) + rows * flint_px(42) + (rows - 1) * flint_px(8) +
flint_px(96) + flint_px(78) + flint_px(18);
}
static int
meditation_config_content_height(InbeApp *app, int content_w)
{
return meditation_music_measure_settings(app, content_w, 1, 1) +
return meditation_config_duration_height(content_w) +
meditation_music_measure_settings(app, content_w, 1, 1) +
app_content_bottom_reserved(app) + flint_px(24);
}
static void
meditation_config_save(InbeApp *app)
{
if(app == NULL)
return;
app->settings_dirty = 1;
save_settings(app);
}
static void
meditation_config_draw_duration(InbeApp *app, int x, int w, int *y)
{
const char *labels[] = {
locale_get("duration_5m"),
locale_get("duration_15m"),
locale_get("duration_30m"),
locale_get("duration_1h"),
locale_get("duration_2h"),
locale_get("meditation_duration_custom")
};
int mode;
int columns;
int gap = flint_px(8);
int btn_h = flint_px(36);
int btn_w;
int row_y;
int custom_row_y;
int toggle_value;
int hover = 0;
char custom_text[64];
if(app == NULL || y == NULL)
return;
mode = clampi(app->meditation.duration_mode, 0, meditation_config_preset_count);
app->meditation.duration_mode = mode;
app->meditation.custom_minutes = clampi(app->meditation.custom_minutes, 1, 240);
flint_text_draw(locale_get("meditation_duration_setting"), x, *y,
flint_ui_font(), flint_theme_get_text());
*y += flint_px(30);
columns = w >= flint_px(520) ? 3 : 2;
btn_w = (w - gap * (columns - 1)) / columns;
for(int i = 0; i < meditation_config_preset_count + 1; i++) {
int col = i % columns;
int row = i / columns;
int bx = x + col * (btn_w + gap);
int by = *y + row * (btn_h + gap);
int style = i == mode ? UI_BUTTON_STYLE_PRIMARY : UI_BUTTON_STYLE_SECONDARY;
if(ui_draw_generic_button(bx, by, btn_w, btn_h, labels[i], style, 0, &hover)) {
app->meditation.duration_mode = i;
meditation_config_save(app);
}
}
row_y = *y + ((meditation_config_preset_count + 1 + columns - 1) / columns) *
(btn_h + gap);
*y = row_y + flint_px(8);
custom_row_y = *y;
snprintf(custom_text, sizeof(custom_text), "%s: %d min",
locale_get("meditation_custom_minutes"), app->meditation.custom_minutes);
flint_text_draw(custom_text, x, custom_row_y,
flint_ui_font(), flint_theme_get_text());
{
const char *adjust_labels[] = {"-5", "-1", "+1", "+5"};
const int adjust_values[] = {-5, -1, 1, 5};
int adjust_w = flint_px(50);
int adjust_total = adjust_w * 4 + gap * 3;
int adjust_x = x + (w - adjust_total) / 2;
int adjust_y = custom_row_y + flint_px(34);
for(int i = 0; i < 4; i++) {
if(ui_draw_generic_button(adjust_x + i * (adjust_w + gap), adjust_y,
adjust_w, btn_h, adjust_labels[i],
UI_BUTTON_STYLE_SECONDARY, 0, &hover)) {
app->meditation.custom_minutes =
clampi(app->meditation.custom_minutes + adjust_values[i], 1, 240);
app->meditation.duration_mode = meditation_config_preset_count;
meditation_config_save(app);
}
}
}
*y += flint_px(96);
flint_text_draw(locale_get("meditation_extend_controls_label"), x, *y,
flint_ui_font(), flint_theme_get_text());
toggle_value = app->meditation.show_extend_controls;
if(ui_draw_toggle_switch(x, *y + flint_px(26), flint_px(56), flint_px(30),
&toggle_value, locale_get("toggle_off"),
locale_get("toggle_on"))) {
app->meditation.show_extend_controls = toggle_value;
meditation_config_save(app);
}
*y += flint_px(78);
}
typedef struct MeditationConfigScrollPageContext {
InbeApp *app;
} MeditationConfigScrollPageContext;
@@ -68,6 +184,7 @@ meditation_config_screen_draw(InbeApp *app)
});
int y = page.content_y;
meditation_config_draw_duration(app, page.content_x, page.content_w, &y);
meditation_music_draw_settings(app, page.content_x, page.content_w,
&y, 1, 1);
ui_scroll_page_end(page);
@@ -25,8 +25,7 @@ meditation_practice_start(InbeApp *app)
if(app == NULL)
return;
mark_exercise_manual_seen(app, EXERCISE_MEDITATION);
app_open_modal(app, UIModalMeditationSetup);
app_switch_screen(app, InbeScreenStart);
meditation_start_configured(app);
}
void
@@ -8,6 +8,8 @@ void meditation_practice_destroy(InbeApp *app);
void meditation_practice_start(InbeApp *app);
void meditation_practice_update(InbeApp *app);
void meditation_practice_leave_config(InbeApp *app);
int meditation_configured_duration_seconds(const InbeApp *app);
void meditation_start_configured(InbeApp *app);
void meditation_manual_draw(InbeApp *app);
void meditation_manual_close(InbeApp *app, int mark_seen);
void meditation_config_screen_draw(InbeApp *app);
+120 -3
View File
@@ -16,6 +16,16 @@ extern int view_height;
static int meditation_background_remainder_ms = 0;
static const int meditation_duration_presets[] = {
5 * 60,
15 * 60,
30 * 60,
60 * 60,
2 * 60 * 60
};
static void meditation_timer_complete(InbeApp *app);
static Texture2D
meditation_sound_icon_for_volume(InbeApp *app)
{
@@ -35,9 +45,13 @@ meditation_start(InbeApp *app, int seconds)
if(app == NULL)
return;
if(seconds < 60)
seconds = 60;
app->meditation.duration_seconds = seconds;
app->meditation.remaining_seconds = seconds;
app->meditation.frame_ticks = 0;
app->meditation.complete_waiting = 0;
meditation_background_remainder_ms = 0;
app->session_paused = 0;
app->volume_popup_active = 0;
@@ -48,6 +62,28 @@ meditation_start(InbeApp *app, int seconds)
practice_background_start(app, PRACTICE_MEDITATION);
}
int
meditation_configured_duration_seconds(const InbeApp *app)
{
int mode;
if(app == NULL)
return meditation_duration_presets[1];
mode = app->meditation.duration_mode;
if(mode >= 0 && mode < (int)(sizeof(meditation_duration_presets) /
sizeof(meditation_duration_presets[0])))
return meditation_duration_presets[mode];
return clampi(app->meditation.custom_minutes, 1, 240) * 60;
}
void
meditation_start_configured(InbeApp *app)
{
meditation_start(app, meditation_configured_duration_seconds(app));
}
static void
meditation_finish(InbeApp *app)
{
@@ -65,10 +101,12 @@ meditation_finish(InbeApp *app)
app_auto_sync(app);
}
}
app_play_sound(app, app->bell_sound, 1.0f);
if(!app->meditation.complete_waiting)
app_play_sound(app, app->bell_sound, 1.0f);
app->meditation.duration_seconds = 0;
app->meditation.remaining_seconds = 0;
app->meditation.frame_ticks = 0;
app->meditation.complete_waiting = 0;
meditation_background_remainder_ms = 0;
app->session_paused = 0;
app->volume_popup_active = 0;
@@ -77,6 +115,25 @@ meditation_finish(InbeApp *app)
app_switch_screen(app, InbeScreenStart);
}
static void
meditation_timer_complete(InbeApp *app)
{
if(app == NULL)
return;
if(app->meditation.show_extend_controls) {
app->meditation.remaining_seconds = 0;
app->meditation.frame_ticks = 0;
if(!app->meditation.complete_waiting) {
app->meditation.complete_waiting = 1;
app_play_sound(app, app->bell_sound, 1.0f);
}
return;
}
meditation_finish(app);
}
void
meditation_advance_elapsed(InbeApp *app, int elapsed_ms)
{
@@ -103,7 +160,7 @@ meditation_advance_elapsed(InbeApp *app, int elapsed_ms)
app->meditation.frame_ticks = 0;
if(app->meditation.remaining_seconds <= 0)
meditation_finish(app);
meditation_timer_complete(app);
}
static int
@@ -148,6 +205,7 @@ meditation_exit_to_start(InbeApp *app)
app->meditation.duration_seconds = 0;
app->meditation.remaining_seconds = 0;
app->meditation.frame_ticks = 0;
app->meditation.complete_waiting = 0;
meditation_background_remainder_ms = 0;
app->session_paused = 0;
app->volume_popup_active = 0;
@@ -193,6 +251,18 @@ draw_meditation_duration_button(int x, int y, int w, int h, const char *label)
return ui_draw_generic_button(x, y, w, h, label, UI_BUTTON_STYLE_PRIMARY, 0, &hover);
}
static void
meditation_extend_session(InbeApp *app, int seconds)
{
if(app == NULL || seconds <= 0)
return;
app->meditation.duration_seconds += seconds;
app->meditation.remaining_seconds += seconds;
app->meditation.complete_waiting = 0;
app->meditation.frame_ticks = 0;
}
void
meditation_draw_setup_modal(InbeApp *app)
{
@@ -294,6 +364,49 @@ draw_meditation_sound_controls(InbeApp *app)
}
}
static void
draw_meditation_extend_controls(InbeApp *app, int center_x, int y)
{
static const int add_seconds[] = {60, 5 * 60, 10 * 60};
const char *labels[] = {"+1", "+5", "+10"};
int gap = flint_px(8);
int btn_h = flint_px(34);
int btn_w = flint_px(58);
int finish_w = flint_px(96);
int total_w = btn_w * 3 + gap * 2;
int x = center_x - total_w / 2;
int hover = 0;
if(app == NULL || !app->meditation.show_extend_controls)
return;
if(x < flint_px(12))
x = flint_px(12);
if(x + total_w > view_width - flint_px(12))
x = view_width - flint_px(12) - total_w;
for(int i = 0; i < 3; i++) {
if(ui_draw_generic_button(x + i * (btn_w + gap), y, btn_w, btn_h, labels[i],
UI_BUTTON_STYLE_SECONDARY, 0, &hover))
meditation_extend_session(app, add_seconds[i]);
}
if(app->meditation.complete_waiting) {
int finish_x = center_x - finish_w / 2;
int finish_y = y + btn_h + flint_px(10);
if(finish_x < flint_px(12))
finish_x = flint_px(12);
if(finish_x + finish_w > view_width - flint_px(12))
finish_x = view_width - flint_px(12) - finish_w;
if(ui_draw_generic_button(finish_x, finish_y, finish_w, btn_h,
locale_get("finish_button"), UI_BUTTON_STYLE_PRIMARY,
0, &hover))
meditation_finish(app);
}
}
void
meditation_draw_screen(InbeApp *app, int center_x, int center_y)
{
@@ -352,6 +465,10 @@ meditation_draw_screen(InbeApp *app, int center_x, int center_y)
flint_ui_text_y(time_text, center_y - font, font * 2, font),
font, flint_theme_get_text());
draw_meditation_extend_controls(app, center_x, center_y + flint_px(42));
if(app->meditation.complete_waiting)
return;
if((
#if defined(PLATFORM_WEB)
!app->backgrounded
@@ -365,7 +482,7 @@ meditation_draw_screen(InbeApp *app, int center_x, int center_y)
if(app->meditation.remaining_seconds > 0)
app->meditation.remaining_seconds--;
if(app->meditation.remaining_seconds <= 0)
meditation_finish(app);
meditation_timer_complete(app);
}
}
}
+16 -3
View File
@@ -85,6 +85,7 @@ habit_edit_info_modal(const char *title, const char *message)
FlintUIScrollArea scroll_area;
int y;
int modal_h;
int modal_w;
int paragraph_h;
int button_w = flint_px(112);
int button_h = flint_px(36);
@@ -93,19 +94,31 @@ habit_edit_info_modal(const char *title, const char *message)
int hover = 0;
int result = 0;
modal_w = view_width - flint_px(36);
if(modal_w > flint_px(420))
modal_w = flint_px(420);
if(modal_w < flint_px(320))
modal_w = flint_px(320);
if(modal_w > view_width - flint_px(24))
modal_w = view_width - flint_px(24);
if(modal_w < flint_px(240))
modal_w = flint_px(240);
paragraph = (FlintUIParagraph){
.text = message,
.width = flint_px(320) - flint_px(36)
.width = modal_w - flint_px(36),
.font = flint_ui_font(),
.line_gap = flint_px(4)
};
modal_h = ui_paragraph_modal_height((FlintUIParagraphModalMeasure){
.message = message,
.width = flint_px(320),
.width = modal_w,
.button_h = button_h,
.extra_lines = 2,
.min_height = flint_px(196)
});
frame = ui_draw_modal_frame(flint_px(320), modal_h, title,
frame = ui_draw_modal_frame(modal_w, modal_h, title,
(Texture2D){0}, (Texture2D){0});
paragraph.width = frame.content_w;
paragraph_h = flint_ui_paragraph_height(paragraph);
+4 -2
View File
@@ -239,7 +239,8 @@ draw_habit_session_edit_content(InbeApp *app, HabitLinkedContext *ctx, int conte
if(ctx->count <= 0) {
if(draw)
flint_text_draw("No sessions", content_x, y, flint_ui_font(), flint_theme_get_text());
flint_text_draw(locale_get("no_sessions"), content_x, y,
flint_ui_font(), flint_theme_get_text());
return y + row_h;
}
@@ -277,7 +278,8 @@ draw_habit_session_edit_content(InbeApp *app, HabitLinkedContext *ctx, int conte
snprintf(time_text, sizeof(time_text), "%02d:%02d",
ctx->entries[i].hour, ctx->entries[i].minute);
if(activity == EXERCISE_SUN_SALUTATION)
snprintf(summary_text, sizeof(summary_text), "1 session");
locale_format(summary_text, sizeof(summary_text),
"session_count_singular", 1);
else if(activity == EXERCISE_MEDITATION)
habit_format_duration(ctx->entries[i].total_seconds,
summary_text, sizeof(summary_text));
+30 -2
View File
@@ -1246,11 +1246,36 @@ habit_weekly_draw_text_line(const char *text, int x, int y, int w, int h,
int text_size, Color color)
{
int font_size;
const char *draw_text = text;
char fitted[128];
if(text == NULL || text[0] == '\0' || w <= 0 || h <= 0)
return;
font_size = text_size;
flint_text_draw(text, x, flint_text_y(text, y, h, font_size), font_size, color);
while(font_size > FLINT_TEXT_8 && flint_text_measure(text, font_size) > w)
font_size -= flint_px(1);
if(flint_text_measure(text, font_size) > w) {
snprintf(fitted, sizeof(fitted), "%s", text);
while(fitted[0] != '\0' && flint_text_measure(fitted, font_size) > w) {
size_t len = strlen(fitted);
size_t cut = len;
if(len <= 3)
break;
if(len > 3 && strcmp(fitted + len - 3, "...") == 0)
len -= 3;
cut = len;
do {
cut--;
} while(cut > 0 && (((unsigned char)fitted[cut] & 0xC0) == 0x80));
fitted[cut] = '\0';
if(cut + 3 < sizeof(fitted))
strncat(fitted, "...", sizeof(fitted) - strlen(fitted) - 1);
}
draw_text = fitted;
}
flint_text_draw(draw_text, x + (w - flint_text_measure(draw_text, font_size)) / 2,
flint_text_y(draw_text, y, h, font_size), font_size, color);
}
static int
@@ -1290,7 +1315,10 @@ habit_weekly_summary(const HabitLinkedContext *ctx, int day_index,
mixed ? "Mixed practice" : practice_activity_label(first_activity));
}
if(secondary != NULL && secondary_size > 0)
snprintf(secondary, secondary_size, "%d session%s", count, count == 1 ? "" : "s");
locale_format(secondary, secondary_size,
count == 1 ? "session_count_singular"
: "session_count_plural",
count);
return count;
}
+34 -3
View File
@@ -143,6 +143,10 @@ settings_screen_draw_theme_picker_modal(InbeApp *app)
int modal_h = flint_px(360);
const char *title = locale_get("theme_picker_title");
FlintUIPanelFrame frame;
FlintUIScrollArea scroll_area;
FlintUIScrollView scroll_view;
int picker_h;
int draw_w;
frame = ui_draw_modal_frame(modal_w, modal_h, title,
(Texture2D){0},
@@ -153,13 +157,40 @@ settings_screen_draw_theme_picker_modal(InbeApp *app)
return;
}
// Draw theme picker in modal content area
if(ui_draw_theme_picker(frame.content_x, frame.content_y,
frame.content_w, app->dark_mode, &app->theme_id)) {
draw_w = frame.content_w;
picker_h = ui_theme_picker_height(draw_w);
scroll_area = (FlintUIScrollArea){
.bounds = {
(float)frame.content_x,
(float)frame.content_y,
(float)frame.content_w,
(float)frame.content_h
},
.content_height = picker_h,
.content_x = frame.content_x,
.content_width = frame.content_w,
.scroll_offset = &app->theme_state.theme_picker_scroll,
.wheel_step = flint_px(42),
.scrollbar_x = frame.content_x + frame.content_w - flint_px(8)
};
for(int i = 0; i < 3; i++) {
FlintUIScrollView measured = ui_scroll_container_measure(scroll_area);
if(measured.content_w == draw_w)
break;
draw_w = measured.content_w;
scroll_area.content_height = ui_theme_picker_height(draw_w);
}
picker_h = ui_theme_picker_height(draw_w);
scroll_area.content_height = picker_h;
scroll_view = ui_scroll_container_begin(scroll_area);
if(ui_draw_theme_picker(scroll_view.content_x, scroll_view.content_y,
scroll_view.content_w, app->dark_mode, &app->theme_id)) {
app->theme_id = clampi(app->theme_id, 0, FLINT_THEME_COUNT - 1);
app_refresh_theme(app);
app->settings_dirty = 1;
save_settings(app);
app_close_modal(app);
}
ui_scroll_container_end(scroll_area, scroll_view);
}
+1
View File
@@ -8,6 +8,7 @@ typedef struct SettingsThemeState {
int draw_nav_mode_menu;
int draw_transition_menu;
int theme_picker_modal_open;
int theme_picker_scroll;
} SettingsThemeState;
int settings_theme_content_height(int content_w);
+32 -13
View File
@@ -4,6 +4,7 @@
#include "habits/habits.h"
#include "flint_locale.h"
#include "flint_theme.h"
#include "flint_ui.h"
extern int view_width;
extern int view_height;
@@ -62,10 +63,30 @@ statistics_draw_metric(int x, int y, int w, int h, const char *label,
value_font, flint_theme_get_text());
}
static void
statistics_draw_section_title(const char *title, int x, int y)
static int
statistics_draw_section_title(const char *title, int x, int y, int w)
{
flint_text_draw(title, x, y, FLINT_TEXT_16, flint_theme_get_text());
FlintUIParagraph paragraph = {
.text = title,
.width = w,
.font = FLINT_TEXT_16,
.line_gap = flint_px(3),
.color = flint_theme_get_text()
};
int title_y = y;
int height = flint_ui_paragraph_height(paragraph);
flint_ui_paragraph_draw(paragraph, x, &title_y);
return height;
}
static void
statistics_format_day_count(char *out, size_t out_size, int count)
{
locale_format(out, out_size,
count == 1 ? "habit_stats_day_singular"
: "habit_stats_day_plural",
count);
}
static int
@@ -330,8 +351,7 @@ statistics_draw_view(InbeApp *app, InbeHabit *active,
}
metric_w = (content_w - metrics_gap) / 2;
snprintf(value, sizeof(value), "%d day%s", current_streak,
current_streak == 1 ? "" : "s");
statistics_format_day_count(value, sizeof(value), current_streak);
statistics_draw_metric(content_x, y, metric_w, metric_h,
locale_get("habit_stats_current_streak"), value, active->color);
snprintf(value, sizeof(value), "%d/%d", last_30_done, last_30_total);
@@ -341,16 +361,16 @@ statistics_draw_view(InbeApp *app, InbeHabit *active,
y += metric_h + flint_px(22);
if(has_wim_hof_rounds) {
statistics_draw_section_title(locale_get("habit_stats_wim_hof_hold_rounds"), content_x, y);
y += flint_px(28);
y += statistics_draw_section_title(locale_get("habit_stats_wim_hof_hold_rounds"),
content_x, y, content_w) + flint_px(10);
statistics_draw_hold_graph(app, linked_ctx, content_x, y, content_w,
&today_tm, EXERCISE_WIM_HOF,
active->color);
y += flint_px(194);
}
statistics_draw_section_title(locale_get("habit_stats_weekday_pattern"), content_x, y);
y += flint_px(28);
y += statistics_draw_section_title(locale_get("habit_stats_weekday_pattern"),
content_x, y, content_w) + flint_px(10);
DrawRectangle(content_x, y, content_w, chart_h, flint_darken(flint_theme_get_bg(), 7));
{
const char *labels[7] = {"S", "M", "T", "W", "T", "F", "S"};
@@ -378,8 +398,8 @@ statistics_draw_view(InbeApp *app, InbeHabit *active,
if(linked_ctx != NULL && linked_ctx->count > 0) {
char best[32];
char total[32];
statistics_draw_section_title(locale_get("habit_stats_practice_time"), content_x, y);
y += flint_px(28);
y += statistics_draw_section_title(locale_get("habit_stats_practice_time"),
content_x, y, content_w) + flint_px(10);
habit_format_duration(linked_ctx->best_seconds, best, sizeof(best));
habit_format_duration(linked_ctx->total_seconds, total, sizeof(total));
statistics_draw_metric(content_x, y, metric_w, metric_h,
@@ -388,8 +408,7 @@ statistics_draw_view(InbeApp *app, InbeHabit *active,
content_w - metric_w - metrics_gap, metric_h,
locale_get("habit_stats_total_hold"), total, flint_lighten(active->color, 20));
} else {
snprintf(value, sizeof(value), "%d day%s", best_streak,
best_streak == 1 ? "" : "s");
statistics_format_day_count(value, sizeof(value), best_streak);
statistics_draw_metric(content_x, y, content_w, metric_h,
locale_get("habit_stats_best_streak"), value, active->color);
}
+3
View File
@@ -94,6 +94,9 @@ static const char *const importable_setting_keys[] = {
"advanced_session_controls",
"hold_display_mode",
"exercise_type",
"meditation_duration_mode",
"meditation_custom_minutes",
"meditation_show_extend_controls",
"meditation_music_enabled",
"meditation_music_shuffle",
"meditation_music_track",
+25 -481
View File
@@ -13,390 +13,41 @@
#include <emscripten.h>
#endif
#if defined(INBE_HAS_LIBOQS)
#include <oqs/oqs.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SYNC_PUBLIC_ID_KEY "sync_public_id"
#define SYNC_PUBLIC_KEY_KEY "sync_public_key"
#define SYNC_PRIVATE_KEY_KEY "sync_private_key"
typedef struct Sha256Ctx {
uint32_t state[8];
uint64_t bit_len;
uint8_t data[64];
size_t data_len;
} Sha256Ctx;
static int account_has_values(const InbeSyncAccount *account);
static const uint32_t sha256_k[64] = {
0x428a2f98U, 0x71374491U, 0xb5c0fbcfU, 0xe9b5dba5U, 0x3956c25bU, 0x59f111f1U,
0x923f82a4U, 0xab1c5ed5U, 0xd807aa98U, 0x12835b01U, 0x243185beU, 0x550c7dc3U,
0x72be5d74U, 0x80deb1feU, 0x9bdc06a7U, 0xc19bf174U, 0xe49b69c1U, 0xefbe4786U,
0x0fc19dc6U, 0x240ca1ccU, 0x2de92c6fU, 0x4a7484aaU, 0x5cb0a9dcU, 0x76f988daU,
0x983e5152U, 0xa831c66dU, 0xb00327c8U, 0xbf597fc7U, 0xc6e00bf3U, 0xd5a79147U,
0x06ca6351U, 0x14292967U, 0x27b70a85U, 0x2e1b2138U, 0x4d2c6dfcU, 0x53380d13U,
0x650a7354U, 0x766a0abbU, 0x81c2c92eU, 0x92722c85U, 0xa2bfe8a1U, 0xa81a664bU,
0xc24b8b70U, 0xc76c51a3U, 0xd192e819U, 0xd6990624U, 0xf40e3585U, 0x106aa070U,
0x19a4c116U, 0x1e376c08U, 0x2748774cU, 0x34b0bcb5U, 0x391c0cb3U, 0x4ed8aa4aU,
0x5b9cca4fU, 0x682e6ff3U, 0x748f82eeU, 0x78a5636fU, 0x84c87814U, 0x8cc70208U,
0x90befffaU, 0xa4506cebU, 0xbef9a3f7U, 0xc67178f2U
};
static uint32_t
rotr32(uint32_t value, uint32_t bits)
{
return (value >> bits) | (value << (32U - bits));
}
static void
sha256_transform(Sha256Ctx *ctx, const uint8_t data[64])
{
uint32_t m[64];
uint32_t a, b, c, d, e, f, g, h;
for(int i = 0; i < 16; i++) {
m[i] = ((uint32_t)data[i * 4] << 24) |
((uint32_t)data[i * 4 + 1] << 16) |
((uint32_t)data[i * 4 + 2] << 8) |
(uint32_t)data[i * 4 + 3];
}
for(int i = 16; i < 64; i++) {
uint32_t s0 = rotr32(m[i - 15], 7) ^ rotr32(m[i - 15], 18) ^ (m[i - 15] >> 3);
uint32_t s1 = rotr32(m[i - 2], 17) ^ rotr32(m[i - 2], 19) ^ (m[i - 2] >> 10);
m[i] = m[i - 16] + s0 + m[i - 7] + s1;
}
a = ctx->state[0];
b = ctx->state[1];
c = ctx->state[2];
d = ctx->state[3];
e = ctx->state[4];
f = ctx->state[5];
g = ctx->state[6];
h = ctx->state[7];
for(int i = 0; i < 64; i++) {
uint32_t s1 = rotr32(e, 6) ^ rotr32(e, 11) ^ rotr32(e, 25);
uint32_t ch = (e & f) ^ ((~e) & g);
uint32_t temp1 = h + s1 + ch + sha256_k[i] + m[i];
uint32_t s0 = rotr32(a, 2) ^ rotr32(a, 13) ^ rotr32(a, 22);
uint32_t maj = (a & b) ^ (a & c) ^ (b & c);
uint32_t temp2 = s0 + maj;
h = g;
g = f;
f = e;
e = d + temp1;
d = c;
c = b;
b = a;
a = temp1 + temp2;
}
ctx->state[0] += a;
ctx->state[1] += b;
ctx->state[2] += c;
ctx->state[3] += d;
ctx->state[4] += e;
ctx->state[5] += f;
ctx->state[6] += g;
ctx->state[7] += h;
}
static void
sha256_init(Sha256Ctx *ctx)
{
memset(ctx, 0, sizeof(*ctx));
ctx->state[0] = 0x6a09e667U;
ctx->state[1] = 0xbb67ae85U;
ctx->state[2] = 0x3c6ef372U;
ctx->state[3] = 0xa54ff53aU;
ctx->state[4] = 0x510e527fU;
ctx->state[5] = 0x9b05688cU;
ctx->state[6] = 0x1f83d9abU;
ctx->state[7] = 0x5be0cd19U;
}
static void
sha256_update(Sha256Ctx *ctx, const uint8_t *data, size_t len)
{
for(size_t i = 0; i < len; i++) {
ctx->data[ctx->data_len++] = data[i];
if(ctx->data_len == 64) {
sha256_transform(ctx, ctx->data);
ctx->bit_len += 512;
ctx->data_len = 0;
}
}
}
static void
sha256_final(Sha256Ctx *ctx, uint8_t hash[32])
{
size_t i = ctx->data_len;
ctx->data[i++] = 0x80;
if(i > 56) {
while(i < 64)
ctx->data[i++] = 0;
sha256_transform(ctx, ctx->data);
i = 0;
}
while(i < 56)
ctx->data[i++] = 0;
ctx->bit_len += ctx->data_len * 8;
for(int j = 0; j < 8; j++)
ctx->data[63 - j] = (uint8_t)(ctx->bit_len >> (j * 8));
sha256_transform(ctx, ctx->data);
for(i = 0; i < 4; i++) {
for(int j = 0; j < 8; j++)
hash[j * 4 + i] = (uint8_t)(ctx->state[j] >> (24 - i * 8));
}
}
static void
bytes_to_hex(const uint8_t *bytes, size_t len, char *out, size_t out_size)
{
static const char hex[] = "0123456789abcdef";
size_t needed = len * 2 + 1;
if(out == NULL || out_size < needed)
return;
for(size_t i = 0; i < len; i++) {
out[i * 2] = hex[bytes[i] >> 4];
out[i * 2 + 1] = hex[bytes[i] & 0x0f];
}
out[len * 2] = '\0';
}
static int
hex_to_bytes(const char *hex, uint8_t *out, size_t out_len)
account_has_values(const InbeSyncAccount *account)
{
size_t len;
if(hex == NULL || out == NULL)
return 0;
len = strlen(hex);
if(len != out_len * 2)
return 0;
for(size_t i = 0; i < out_len; i++) {
unsigned int value;
if(sscanf(hex + i * 2, "%2x", &value) != 1)
return 0;
out[i] = (uint8_t)value;
}
return 1;
}
static int
hex_string_valid(const char *hex, size_t expected_len)
{
if(hex == NULL || strlen(hex) != expected_len)
return 0;
for(size_t i = 0; i < expected_len; i++) {
char c = hex[i];
if(!((c >= '0' && c <= '9') ||
(c >= 'a' && c <= 'f') ||
(c >= 'A' && c <= 'F')))
return 0;
}
return 1;
return flint_lyra_account_has_values(account);
}
static void
copy_key_value(char *out, size_t out_size, const char *value, size_t value_len)
sync_account_save_and_reset(const InbeSyncAccount *account)
{
if(out == NULL || out_size == 0)
return;
if(value_len >= out_size)
value_len = out_size - 1;
memcpy(out, value, value_len);
out[value_len] = '\0';
}
static void
parse_sync_key_line(InbeSyncAccount *account, const char *line, size_t line_len)
{
const char *value;
size_t value_len;
if(account == NULL || line == NULL)
return;
if(line_len > 0 && line[line_len - 1] == '\r')
line_len--;
if(line_len > 10 && strncmp(line, "public_id=", 10) == 0) {
value = line + 10;
value_len = line_len - 10;
copy_key_value(account->public_id, sizeof(account->public_id), value, value_len);
} else if(line_len > 11 && strncmp(line, "public_key=", 11) == 0) {
value = line + 11;
value_len = line_len - 11;
copy_key_value(account->public_key_hex, sizeof(account->public_key_hex), value, value_len);
} else if(line_len > 12 && strncmp(line, "private_key=", 12) == 0) {
value = line + 12;
value_len = line_len - 12;
copy_key_value(account->private_key_hex, sizeof(account->private_key_hex), value, value_len);
} else if(line_len > 11 && strncmp(line, "secret_key=", 11) == 0) {
value = line + 11;
value_len = line_len - 11;
copy_key_value(account->private_key_hex, sizeof(account->private_key_hex), value, value_len);
}
}
static int
extract_json_string_field(const char *json, const char *field, char *out, size_t out_size)
{
char key[64];
const char *p;
char *dst;
char *end;
if(json == NULL || field == NULL || out == NULL || out_size == 0)
return 0;
out[0] = '\0';
if(strlen(field) + 3 > sizeof(key))
return 0;
snprintf(key, sizeof(key), "\"%s\"", field);
p = strstr(json, key);
if(p == NULL)
return 0;
p += strlen(key);
while(*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n')
p++;
if(*p != ':')
return 0;
p++;
while(*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n')
p++;
if(*p != '"')
return 0;
p++;
dst = out;
end = out + out_size - 1;
while(*p != '\0' && *p != '"' && dst < end) {
if(*p == '\\') {
p++;
if(*p == 'n')
*dst++ = '\n';
else if(*p == 'r')
*dst++ = '\r';
else if(*p == 't')
*dst++ = '\t';
else if(*p == '\\' || *p == '"')
*dst++ = *p;
else
return 0;
if(*p != '\0')
p++;
continue;
}
*dst++ = *p++;
}
*dst = '\0';
return *p == '"';
}
static int
parse_sync_key_text(const char *text, InbeSyncAccount *account)
{
const char *line;
const char *next;
char exported_key[8200];
if(text == NULL || account == NULL)
return 0;
if(extract_json_string_field(text, "exported_key", exported_key, sizeof(exported_key)))
text = exported_key;
memset(account, 0, sizeof(*account));
line = text;
if((unsigned char)line[0] == 0xef &&
(unsigned char)line[1] == 0xbb &&
(unsigned char)line[2] == 0xbf)
line += 3;
while(*line != '\0') {
next = strchr(line, '\n');
if(next == NULL) {
parse_sync_key_line(account, line, strlen(line));
break;
}
parse_sync_key_line(account, line, (size_t)(next - line));
line = next + 1;
}
return account->public_key_hex[0] != '\0' &&
account->private_key_hex[0] != '\0';
}
static int
sync_account_validate_import(InbeSyncAccount *account)
{
uint8_t public_key[1312];
char expected_public_id[65];
if(account == NULL)
return 0;
if(!hex_string_valid(account->public_key_hex, 2624) ||
!hex_string_valid(account->private_key_hex, 5120))
return 0;
if(!hex_to_bytes(account->public_key_hex, public_key, sizeof(public_key)))
return 0;
sync_sha256_hex(public_key, sizeof(public_key), expected_public_id);
if(account->public_id[0] == '\0') {
snprintf(account->public_id, sizeof(account->public_id), "%s", expected_public_id);
return 1;
}
if(!hex_string_valid(account->public_id, 64))
return 0;
return strcmp(account->public_id, expected_public_id) == 0;
storage_settings_begin_write();
storage_set_setting_text(SYNC_PUBLIC_ID_KEY, account != NULL ? account->public_id : "");
storage_set_setting_text(SYNC_PUBLIC_KEY_KEY, account != NULL ? account->public_key_hex : "");
storage_set_setting_text(SYNC_PRIVATE_KEY_KEY, account != NULL ? account->private_key_hex : "");
sync_client_clear_auth_token();
storage_reset_sync_state();
storage_settings_end_write();
}
void
sync_sha256_hex(const uint8_t *data, size_t len, char out_hex[65])
{
uint8_t digest[32];
Sha256Ctx sha;
if(out_hex == NULL)
return;
out_hex[0] = '\0';
if(data == NULL && len > 0)
return;
sha256_init(&sha);
sha256_update(&sha, data, len);
sha256_final(&sha, digest);
bytes_to_hex(digest, sizeof(digest), out_hex, 65);
}
static int
account_has_values(const InbeSyncAccount *account)
{
return account != NULL &&
account->public_id[0] != '\0' &&
account->public_key_hex[0] != '\0' &&
account->private_key_hex[0] != '\0';
flint_lyra_sha256_hex(data, len, out_hex);
}
int
sync_account_available(void)
{
#if defined(INBE_HAS_LIBOQS)
return 1;
#else
return 0;
#endif
return flint_lyra_account_available();
}
int
@@ -426,93 +77,31 @@ sync_account_load(InbeSyncAccount *account)
int
sync_account_create(InbeSyncAccount *account)
{
#if defined(INBE_HAS_LIBOQS)
OQS_SIG *sig;
uint8_t public_key[1312];
uint8_t private_key[2560];
uint8_t digest[32];
Sha256Ctx sha;
InbeSyncAccount generated;
data_init();
if(account == NULL)
return 0;
memset(&generated, 0, sizeof(generated));
sig = OQS_SIG_new(OQS_SIG_alg_ml_dsa_44);
if(sig == NULL ||
sig->length_public_key != sizeof(public_key) ||
sig->length_secret_key != sizeof(private_key)) {
if(sig != NULL)
OQS_SIG_free(sig);
if(!flint_lyra_account_create(&generated))
return 0;
}
if(OQS_SIG_keypair(sig, public_key, private_key) != OQS_SUCCESS) {
OQS_SIG_free(sig);
return 0;
}
OQS_SIG_free(sig);
sha256_init(&sha);
sha256_update(&sha, public_key, sizeof(public_key));
sha256_final(&sha, digest);
bytes_to_hex(digest, sizeof(digest), generated.public_id, sizeof(generated.public_id));
bytes_to_hex(public_key, sizeof(public_key), generated.public_key_hex,
sizeof(generated.public_key_hex));
bytes_to_hex(private_key, sizeof(private_key), generated.private_key_hex,
sizeof(generated.private_key_hex));
storage_settings_begin_write();
storage_set_setting_text(SYNC_PUBLIC_ID_KEY, generated.public_id);
storage_set_setting_text(SYNC_PUBLIC_KEY_KEY, generated.public_key_hex);
storage_set_setting_text(SYNC_PRIVATE_KEY_KEY, generated.private_key_hex);
sync_client_clear_auth_token();
storage_reset_sync_state();
storage_settings_end_write();
sync_account_save_and_reset(&generated);
*account = generated;
return 1;
#else
(void)account;
return 0;
#endif
}
int
sync_account_import_private_key(InbeSyncAccount *account, const char *filename)
{
char *body;
InbeSyncAccount imported;
data_init();
if(account == NULL || filename == NULL || filename[0] == '\0')
return 0;
body = LoadFileText(filename);
if(body == NULL)
return 0;
if(!parse_sync_key_text(body, &imported)) {
TraceLog(LOG_WARNING, "SYNC: Private key import failed: missing public_key/private_key fields");
UnloadFileText(body);
if(!flint_lyra_account_import_file(filename, &imported)) {
TraceLog(LOG_WARNING, "SYNC: Private key import failed: invalid key file");
return 0;
}
if(!sync_account_validate_import(&imported)) {
TraceLog(LOG_WARNING, "SYNC: Private key import failed: invalid key values");
UnloadFileText(body);
return 0;
}
UnloadFileText(body);
storage_settings_begin_write();
storage_set_setting_text(SYNC_PUBLIC_ID_KEY, imported.public_id);
storage_set_setting_text(SYNC_PUBLIC_KEY_KEY, imported.public_key_hex);
storage_set_setting_text(SYNC_PRIVATE_KEY_KEY, imported.private_key_hex);
sync_client_clear_auth_token();
storage_reset_sync_state();
storage_settings_end_write();
sync_account_save_and_reset(&imported);
*account = imported;
return 1;
}
@@ -521,30 +110,21 @@ int
sync_account_clear(void)
{
data_init();
storage_settings_begin_write();
storage_set_setting_text(SYNC_PUBLIC_ID_KEY, "");
storage_set_setting_text(SYNC_PUBLIC_KEY_KEY, "");
storage_set_setting_text(SYNC_PRIVATE_KEY_KEY, "");
sync_client_clear_auth_token();
storage_reset_sync_state();
storage_settings_end_write();
sync_account_save_and_reset(NULL);
return 1;
}
int
sync_account_export_private_key(const InbeSyncAccount *account, const char *filename)
{
char body[8200];
char body[FLINT_LYRA_ACCOUNT_EXPORT_TEXT_SIZE];
int len;
if(!account_has_values(account) || filename == NULL || filename[0] == '\0')
return 0;
len = snprintf(body, sizeof(body),
"inbe-sync-key-v1\nalgorithm=ML-DSA-44\npublic_id=%s\npublic_key=%s\nprivate_key=%s\n",
account->public_id, account->public_key_hex, account->private_key_hex);
if(len <= 0 || (size_t)len >= sizeof(body))
if(!flint_lyra_account_export_text(account, body, sizeof(body)))
return 0;
len = (int)strlen(body);
#if ANDROID_BUILD
return android_share_bytes((const unsigned char *)body, (size_t)len, filename,
@@ -559,7 +139,7 @@ sync_account_export_private_key(const InbeSyncAccount *account, const char *file
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = filename || "inbe-sync.key";
a.download = filename || "lyra-account.key";
a.style.display = "none";
document.body.appendChild(a);
a.click();
@@ -580,48 +160,12 @@ sync_account_export_private_key(const InbeSyncAccount *account, const char *file
int
sync_account_sign_hex(const uint8_t *message, size_t message_len,
char *out_signature_hex, size_t out_size)
char *out_signature_hex, size_t out_size)
{
#if defined(INBE_HAS_LIBOQS)
InbeSyncAccount account;
OQS_SIG *sig;
uint8_t private_key[2560];
uint8_t signature[2420];
size_t signature_len = 0;
if(out_signature_hex == NULL || out_size < sizeof(signature) * 2 + 1 ||
(message == NULL && message_len > 0))
return 0;
out_signature_hex[0] = '\0';
if(!sync_account_load(&account))
return 0;
if(!hex_to_bytes(account.private_key_hex, private_key, sizeof(private_key)))
return 0;
sig = OQS_SIG_new(OQS_SIG_alg_ml_dsa_44);
if(sig == NULL ||
sig->length_secret_key != sizeof(private_key) ||
sig->length_signature != sizeof(signature)) {
if(sig != NULL)
OQS_SIG_free(sig);
return 0;
}
if(OQS_SIG_sign(sig, signature, &signature_len, message, message_len,
private_key) != OQS_SUCCESS ||
signature_len != sizeof(signature)) {
OQS_SIG_free(sig);
return 0;
}
OQS_SIG_free(sig);
bytes_to_hex(signature, sizeof(signature), out_signature_hex, out_size);
return out_signature_hex[0] != '\0';
#else
(void)message;
(void)message_len;
(void)out_signature_hex;
(void)out_size;
return 0;
#endif
return flint_lyra_account_sign_hex(&account, message, message_len, out_signature_hex,
out_size);
}
+6 -8
View File
@@ -4,17 +4,15 @@
#include <stddef.h>
#include <stdint.h>
#include "flint_lyra_account.h"
enum {
INBE_SYNC_PUBLIC_ID_HEX_SIZE = 65,
INBE_SYNC_PUBLIC_KEY_HEX_SIZE = 2625,
INBE_SYNC_PRIVATE_KEY_HEX_SIZE = 5121
INBE_SYNC_PUBLIC_ID_HEX_SIZE = FLINT_LYRA_PUBLIC_ID_HEX_SIZE,
INBE_SYNC_PUBLIC_KEY_HEX_SIZE = FLINT_LYRA_PUBLIC_KEY_HEX_SIZE,
INBE_SYNC_PRIVATE_KEY_HEX_SIZE = FLINT_LYRA_PRIVATE_KEY_HEX_SIZE
};
typedef struct InbeSyncAccount {
char public_id[INBE_SYNC_PUBLIC_ID_HEX_SIZE];
char public_key_hex[INBE_SYNC_PUBLIC_KEY_HEX_SIZE];
char private_key_hex[INBE_SYNC_PRIVATE_KEY_HEX_SIZE];
} InbeSyncAccount;
typedef FlintLyraAccount InbeSyncAccount;
int sync_account_available(void);
int sync_account_load(InbeSyncAccount *account);
+1 -5
View File
@@ -1656,7 +1656,6 @@ sync_client_delete_account(const char *base_url)
SyncBuffer response = {0};
const char *headers[1] = {"Content-Type: application/json"};
long status = 0;
int len;
int ok;
if(!sync_client_url_valid(base_url))
@@ -1664,10 +1663,7 @@ sync_client_delete_account(const char *base_url)
if(!sync_account_load(&account))
return INBE_SYNC_CLIENT_NO_ACCOUNT;
len = snprintf(exported_key, sizeof(exported_key),
"inbe-sync-key-v1\nalgorithm=ML-DSA-44\npublic_id=%s\npublic_key=%s\nprivate_key=%s\n",
account.public_id, account.public_key_hex, account.private_key_hex);
if(len <= 0 || (size_t)len >= sizeof(exported_key))
if(!flint_lyra_account_export_text(&account, exported_key, sizeof(exported_key)))
return INBE_SYNC_CLIENT_PAYLOAD_FAILED;
if(!sync_buffer_append(&body, "{\"user_id_hash\":", strlen("{\"user_id_hash\":")) ||
+2
View File
@@ -251,6 +251,8 @@ test_import_export_clear(void)
exported = LoadFileText(export_path);
check_true("read exported key", exported != NULL);
if(exported != NULL) {
check_true("export uses generic key header",
strstr(exported, "lyra-account-key-v1\n") == exported);
check_true("export includes public key", strstr(exported, "\npublic_key=") != NULL);
UnloadFileText(exported);
}
Vendored
-1
Submodule vendor/curl deleted from bb837dda23.
+1 -1
-1
Submodule vendor/liboqs deleted from d95fc734f5.
+4 -4
View File
@@ -3,8 +3,8 @@
IDI_APP_ICON ICON "inbe.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,6,2,0
PRODUCTVERSION 1,6,2,0
FILEVERSION 1,6,4,0
PRODUCTVERSION 1,6,4,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -21,11 +21,11 @@ BEGIN
BEGIN
VALUE "CompanyName", "waozi"
VALUE "FileDescription", "Inner Breeze"
VALUE "FileVersion", "1.6.2"
VALUE "FileVersion", "1.6.4"
VALUE "InternalName", "inbe"
VALUE "OriginalFilename", "inbe-windows-x86_64.exe"
VALUE "ProductName", "Inner Breeze"
VALUE "ProductVersion", "1.6.2"
VALUE "ProductVersion", "1.6.4"
END
END
BLOCK "VarFileInfo"