Compare commits

...
14 Commits
Author SHA1 Message Date
waozi 81032a9dcc bug fix 2026-05-29 09:20:11 -03:00
waozi 2be97ca801 release fix 2026-05-29 09:14:19 -03:00
waozi 324d18fdfb fix inset 2026-05-29 09:11:47 -03:00
waozi 6889777cff increase inset 2026-05-29 07:50:08 -03:00
waozi ea78b73c86 move scripts 2026-05-29 07:26:04 -03:00
waozi 1e5768f6b4 fix data issue 2026-05-29 07:23:00 -03:00
waozi 612f431376 bug fix 2026-05-28 23:58:22 -03:00
waozi f13a88b94e improve website 2026-05-28 18:48:19 -03:00
waozi e7d9843e94 add itch script 2026-05-28 18:14:25 -03:00
waozi ae438d7c14 rm dependency tracker 2026-05-28 16:31:51 -03:00
waozi 879f058d7a fix bug 2026-05-28 14:44:10 -03:00
waozi f208429e08 fix script 2026-05-28 14:38:41 -03:00
waozi 827780347b fastlane changelog 2026-05-28 14:37:35 -03:00
waozi 791ca2eba9 fix versioning 2026-05-28 14:35:31 -03:00
41 changed files with 786 additions and 175 deletions

No files matched your search

+16
View File
@@ -1,4 +1,20 @@
# Changelog
## [1.1.2] - 2026-05-29
## Fixed
- Data storage location
- Punch hole spacing
- Crashes on newer devices
## [1.1.1] - 2026-05-28
### Fixed
- Slider focus now properly releases when mouse button is released (prevented adjusting sliders when clicking outside)
## [1.1.0] - 2026-05-28
### Added
- Tiny version bump
### Fixed
- Changelog extraction now correctly populates fastlane metadata
## [1.0.9] - 2026-05-28
### Added
- Android share sheet for data export (native Intent integration)
+1
View File
@@ -591,3 +591,4 @@ FORCE:
android-install-release \
android-clean \
FORCE
+22
View File
@@ -50,6 +50,28 @@ make android
make web
```
### Android Emulator Testing
For automated testing with camera notch (cutout) support:
```bash
# Enter the development shell and run everything automatically
nix develop
./scripts/emulator.sh # Creates AVD, launches emulator, builds & runs app
```
This single script handles:
- AVD creation (if missing)
- Emulator launch
- APK build
- App installation and launch
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
### Platform-Specific Notes
- **Linux**: Requires SDL2 runtime libraries
+72
View File
@@ -0,0 +1,72 @@
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8" />
<head>
<title>Inner Breeze - All Builds</title>
<link href="/style.css" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Inner Breeze - All available builds and implementations.">
<link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png">
<meta name="theme-color" content="#5566aa">
</head>
<body>
<div class="content">
<section>
<h1>All Builds</h1>
<p><a href="/">← Back to Inner Breeze</a></p>
</section>
<section>
<div class="platform-section">
<div class="platform-header">
<img src="/icons/ray.png" alt="raylib"/>
<div>
<strong><a href="https://raylib.com">Raylib</a></strong>
<p>A C library for video game programming - the primary implementation.</p>
</div>
</div>
<div class="downloads-grid">
<a href="/build/web/index.html" class="download-item">Web (WASM)</a>
<a href="/build/linux/inbe-linux.tar.gz" class="download-item">Linux</a>
<a href="/build/windows/inbe-windows.zip" class="download-item">Windows</a>
<a href="/build/android/inbe-latest.apk" class="download-item">Android APK</a>
</div>
</div>
<div class="platform-section">
<div class="platform-header">
<img src="/icons/wasm4.png" alt="wasm4"/>
<div>
<strong><a href="https://wasm4.org">WASM-4</a></strong>
<p>A tiny fantasy console that runs WebAssembly cartridges.</p>
</div>
</div>
<div class="downloads-grid">
<a href="/wasm4/build/index.html" class="download-item">Web</a>
<a href="/wasm4/build/cart.wasm" class="download-item">cart.wasm</a>
<a href="/wasm4/build/inbe-windows.zip" class="download-item">Windows</a>
<a href="/wasm4/build/inbe-linux.tar.gz" class="download-item">Linux</a>
</div>
</div>
<div class="platform-section">
<div class="platform-header">
<img src="/icons/uxn.png" alt="uxn"/>
<div>
<strong><a href="https://100r.co/site/uxn.html">Uxn</a></strong>
<p>A small virtual computer; <code>.rom</code> runs in a Uxn emulator.</p>
</div>
</div>
<div class="downloads-grid">
<a href="/uxn/index.html" class="download-item">Web</a>
<a href="/uxn/inbe.rom" class="download-item">inbe.rom</a>
</div>
</div>
</section>
<footer>
<p>&copy; 2026 <a href="https://waozi.xyz">Waozi</a> | <a href="https://git.sr.ht/~waozi/inbe" target="_blank" rel="noopener">hosted on sr.ht</a></p>
</footer>
</div>
</body>
</html>
+6 -2
View File
@@ -34,8 +34,8 @@ android {
defaultConfig {
minSdk 19
targetSdk 35
versionCode 10
versionName "1.0.9"
versionCode 13
versionName "1.1.2"
}
@@ -64,6 +64,10 @@ android {
universalApk true
}
}
dependenciesInfo {
includeInApk = false
}
}
gradle.taskGraph.whenReady { taskGraph ->
+2 -2
View File
@@ -10,8 +10,8 @@
android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="true"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.DeviceDefault.NoActionBar.Fullscreen"
android:windowLayoutInDisplayCutoutMode="shortEdges">
android:theme="@android:style/Theme.DeviceDefault.NoActionBar"
android:windowLayoutInDisplayCutoutMode="never">
<meta-data
android:name="android.app.lib_name"
android:value="main" />
@@ -1,8 +1,165 @@
package xyz.waozi.inbe;
import android.app.NativeActivity;
import android.graphics.Insets;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.DisplayCutout;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.WindowInsets;
public class MainActivity extends NativeActivity {
// Empty - just to trigger Java compilation
// Raylib handles everything via native code
private static final String TAG = "InbeMainActivity";
static {
System.loadLibrary("main");
}
// [status_bar, nav_bar, cutout_left, cutout_top, cutout_right, cutout_bottom]
private final int[] cachedInsets = new int[6];
private boolean insetsInitialized = false;
private native void nativeSetInsets(int status, int nav,
int cutoutLeft, int cutoutTop, int cutoutRight, int cutoutBottom);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
synchronized (cachedInsets) {
for (int i = 0; i < 6; i++) {
cachedInsets[i] = 0;
}
}
setupInsetsListener();
}
private void setupInsetsListener() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
final View decorView = getWindow().getDecorView();
// 1. Primary listener for runtime inset modifications (swiping, rotating)
decorView.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() {
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
updateInsets(insets);
return insets;
}
});
// 2. Startup safety net: Catches frame sizing on the initial layout pass
decorView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
WindowInsets insets = decorView.getRootWindowInsets();
if (insets != null) {
updateInsets(insets);
}
}
decorView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
});
// 3. Force synchronous scheduling update pass
decorView.post(new Runnable() {
@Override
public void run() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
decorView.requestApplyInsets();
}
}
});
} 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;
try {
int statusBar = 0;
int navBar = 0;
int cLeft = 0, cTop = 0, cRight = 0, cBottom = 0;
// System bar calculations
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
Insets systemBars = insets.getInsetsIgnoringVisibility(WindowInsets.Type.systemBars());
statusBar = systemBars.top;
navBar = systemBars.bottom;
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
statusBar = insets.getSystemWindowInsetTop();
navBar = insets.getSystemWindowInsetBottom();
}
// Display cutout calculations
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
DisplayCutout cutout = insets.getDisplayCutout();
if (cutout != null) {
cLeft = cutout.getSafeInsetLeft();
cTop = cutout.getSafeInsetTop();
cRight = cutout.getSafeInsetRight();
cBottom = cutout.getSafeInsetBottom();
}
}
synchronized (cachedInsets) {
cachedInsets[0] = statusBar;
cachedInsets[1] = navBar;
cachedInsets[2] = cLeft;
cachedInsets[3] = cTop;
cachedInsets[4] = cRight;
cachedInsets[5] = cBottom;
}
insetsInitialized = true;
nativeSetInsets(statusBar, navBar, cLeft, cTop, cRight, cBottom);
} catch (Exception e) {
Log.e(TAG, "Error structuralizing window layout properties: " + e.getMessage());
}
}
/**
* Called from native code via JNI to pull array memory safely.
* * @return Array copy containing [status, nav, left, top, right, bottom]
*/
public int[] getInsetsNative() {
int[] result = new int[6];
synchronized (cachedInsets) {
System.arraycopy(cachedInsets, 0, result, 0, 6);
}
return result;
}
}
@@ -1 +1,6 @@
### Added
- Initial release
- Breathing exercise tutorial with 5 steps
- Configurable settings: speed (1-9), rounds (1-10), breaths (15-80), pause duration (0-30s)
- Session history tracking and statistics
- Support for Linux, Windows, Android, and WebAssembly platforms
@@ -1 +1,7 @@
### Added
- Android share sheet for data export (native Intent integration)
- Direct sharing to Telegram, Downloads, or any app that handles ZIP files
- FileProvider support for secure file sharing on Android 7.0+
### Fixed
- ZIP export now uses native Android share sheet instead of saving to private storage
- JNI class loading fix for ShareHelper on native threads
@@ -0,0 +1,4 @@
### Added
- Tiny version bump
### Fixed
- Changelog extraction now correctly populates fastlane metadata
@@ -0,0 +1,2 @@
### Fixed
- Slider focus now properly releases when mouse button is released (prevented adjusting sliders when clicking outside)
@@ -0,0 +1,3 @@
- Data storage location
- Punch hole spacing
- Crashes on newer devices
@@ -1 +1,3 @@
### Fixed
- Fixed WebAssembly local storage persistence
- Updated Android target SDK version
@@ -1 +1,7 @@
### Fixed
- Fixed "Starting in" countdown text positioning (now displays above circle)
- Fixed first round to always use 3-second countdown regardless of settings
- Fixed slider knob vertical centering (DPI scaling issue)
- Fixed slider touch hit area scaling for better mobile interaction
- Fixed speed meter position in tutorial (removed double DPI scaling)
- Fixed results screen DPI scaling for consistent appearance
@@ -1 +1,9 @@
### Fixed
- Improved DPI scaling for scrollbars (width and thumb height now scale properly)
- Fixed scrollbar not appearing on tall viewports/settings screens (content height now scales correctly)
- Fixed X icon too small on mobile (increased max size from 18px to 28px for better touch targets)
- Improved scrollbar thumb touch hit area for easier grabbing
- Fixed missing breath sounds during recovery phase (breath in at start, breath out after 15-second hold)
### Added
- Added external links in settings (Telegram, Website, Monero, Stripe donation)
- Added content-area drag scrolling for mobile (click and drag anywhere to scroll)
@@ -1 +1,9 @@
### Added
- Centralized icon size management system (SMALL, MEDIUM, LARGE)
- Standardized icon button functions for consistent sizing
### Fixed
- Improved accessibility with larger icons for older users (+25-37%)
- DPI scaling for all button padding and bevel borders on mobile
- X button positioning and scaling on high DPI screens
- Button dimensions and icon centering across all screens
- Missing icons (telegram, globe, stripe, monero, home, trash) in WebAssembly build
@@ -1 +1,8 @@
### Added
- Theme system with 8 color themes (Forest, Ocean, Sky, Sunset, Lavender - each with light/dark variants)
- Settings dropdown menu for easier navigation
- Improved fullscreen mode with better DPI scaling
### Fixed
- Touch input scaling for dropdown menus and toggle switches
- Tab bar positioning on Android (now accounts for system navbar)
- Removed toggle switch circle indicator for cleaner UI
@@ -1 +1,4 @@
### Fixed
- Bell now plays before the last breath (at maxbreaths - 1) instead of after
- Session history not loading and potential segfault due to path buffer overflow (increased HISTORY_PATH_SIZE from 96 to 256)
- Tutorial text clarified to explicitly mention Wim Hof Method
@@ -1 +1,4 @@
### Added
- F-Droid metadata (screenshots, feature graphic, icon)
- Automatic version tag generation for releases
- Fastlane changelog integration
@@ -1 +1,7 @@
### Added
- Android back button support with screen-aware behavior
- Confirmation modal when exiting active sessions (Save & Exit, Discard, or Cancel)
- Session data preservation: completed rounds can be saved before exiting
### Fixed
- Modal text word wrap to handle last word correctly
- Back button closes modal (cancel action) when pressed during confirmation
+3 -1
View File
@@ -48,6 +48,7 @@
includeNDK = true;
ndkVersions = [ "25.1.8937393" ];
cmakeVersions = [ "3.22.1" ];
includeEmulator = true;
};
sdk = androidComposition.androidsdk;
@@ -94,6 +95,7 @@
targetPkgs = pkgs: with pkgs; [
SDL2
SDL2.dev
butler
cmake
emscripten
gcc
@@ -144,7 +146,7 @@
export RAY_RAYLIB_CONFIG="-DSUPPORT_SCREEN_CAPTURE=0 -DSUPPORT_COMPRESSION_API=0 -DSUPPORT_AUTOMATION_EVENTS=0 -DSUPPORT_CLIPBOARD_IMAGE=0 -DSUPPORT_FILEFORMAT_BMP=0 -DSUPPORT_FILEFORMAT_GIF=0 -DSUPPORT_FILEFORMAT_QOI=0 -DSUPPORT_FILEFORMAT_DDS=0 -DSUPPORT_FILEFORMAT_TTF=0"
export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH"
export PATH="$ANDROID_HOME/cmdline-tools/11.0/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH"
export WEB_CC="emcc"
export WEB_AR="emar"
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

+17 -50
View File
@@ -32,7 +32,7 @@
<body>
<div class="content">
<section>
<section class="hero">
<img class="tk-img" src="/icons/inbe.png" width="128px" alt="Inner Breeze"/>
<h1>Inner Breeze</h1>
@@ -56,66 +56,33 @@
<span>Linux</span>
</a>
</div>
<div class="platform-buttons">
<a href="https://play.google.com/store/apps/details?id=xyz.waozi.inbe" class="platform-btn android">
<img src="/icons/playstore.png" alt="play store"/>
<span>Play Store</span>
</a>
<a href="https://f-droid.org/packages/xyz.waozi.inbe/" class="platform-btn android">
<img src="/icons/fdroid.png" alt="F-Droid"/>
<span>F-Droid</span>
</a>
<a href="https://waozi.itch.io/inbe" class="platform-btn web">
<img src="/icons/itch.png" alt="itch.io"/>
<span>itch.io</span>
</a>
</div>
<p style="text-align:center; margin-top:8px; font-size:14px;"><a href="/builds.html">Other builds (WASM-4, Uxn) →</a></p>
</section>
<section>
<details>
<summary>All implementations</summary>
<br/>
<div class="platform-section">
<div class="platform-header">
<img src="/icons/ray.png" alt="raylib"/>
<div>
<strong><a href="https://raylib.com">Raylib</a></strong>
<p>A C library for video game programming - the primary implementation.</p>
</div>
</div>
<div class="downloads-grid">
<a href="/build/web/index.html" class="download-item">Web (WASM)</a>
<a href="/build/linux/inbe-linux.tar.gz" class="download-item">Linux</a>
<a href="/build/windows/inbe-windows.zip" class="download-item">Windows</a>
<a href="/build/android/inbe-latest.apk" class="download-item">Android APK</a>
</div>
</div>
<div class="platform-section">
<div class="platform-header">
<img src="/icons/wasm4.png" alt="wasm4"/>
<div>
<strong><a href="https://wasm4.org">WASM-4</a></strong>
<p>A tiny fantasy console that runs WebAssembly cartridges.</p>
</div>
</div>
<div class="downloads-grid">
<a href="/wasm4/build/index.html" class="download-item">Web</a>
<a href="/wasm4/build/cart.wasm" class="download-item">cart.wasm</a>
<a href="/wasm4/build/inbe-windows.zip" class="download-item">Windows</a>
<a href="/wasm4/build/inbe-linux.tar.gz" class="download-item">Linux</a>
</div>
</div>
<div class="platform-section">
<div class="platform-header">
<img src="/icons/uxn.png" alt="uxn"/>
<div>
<strong><a href="https://100r.co/site/uxn.html">Uxn</a></strong>
<p>A small virtual computer; <code>.rom</code> runs in a Uxn emulator.</p>
</div>
</div>
<div class="downloads-grid">
<a href="/uxn/index.html" class="download-item">Web</a>
<a href="/uxn/inbe.rom" class="download-item">inbe.rom</a>
</div>
</div>
</details>
<details>
<summary>donate</summary>
<br/>
<div class="donation-buttons">
<!-- Stripe Redirect Button -->
<a href="https://donate.stripe.com/4gM3cv5boaR98HH9VvfAc04" target="_blank" rel="noopener" class="platform-btn stripe-btn">
<img src="/icons/stripe.png" alt="stripe" class="platform-icon-btn"/>
<span>Donate via Stripe</span>
</a>
<!-- Trocador Monero Redirect Button -->
<a href="https://trocador.app/en/anonpay/?ticker_to=xmr&network_to=Mainnet&address=86CbC3d4a2GhT9auh6X99JhmhTMFKVVk8Q9cLrKTHkBu8LLkoNWgkBeAT3YZrvDM6NczYe8brUJNsTiFmwpWDZYnFG5kzSH&donation=True&simple_mode=True&amount=0.1&name=Inner+Breeze&[email protected]&ticker_from=xmr&network_from=Mainnet&buttonbgcolor=445588&textcolor=ffffff&bgcolor=eaeaffff" target="_blank" rel="noopener" class="platform-btn xmr-btn">
<img src="/icons/monero.png" alt="monero" class="platform-icon-btn"/>
<span>Donate via Crypto</span>
+44
View File
@@ -0,0 +1,44 @@
#!/bin/bash
# Publish inbe HTML5 to itch.io using butler
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR"
# Check if butler is installed
if ! command -v butler &> /dev/null; then
echo "Error: 'butler' command not found"
echo "Install it from: https://itch.io/docs/butler/"
exit 1
fi
WEB_BUILD_DIR="build/web"
# Verify the web build exists
if [ ! -f "$WEB_BUILD_DIR/index.html" ]; then
echo "Error: Web build not found at $WEB_BUILD_DIR/index.html"
echo "Run 'make web' first."
exit 1
fi
# Read version from src/version.h
VERSION=$(grep INBE_VERSION_STRING src/version.h | grep -o '"[^"]*"' | tr -d '"')
if [ -z "$VERSION" ]; then
echo "Error: Could not determine version from src/version.h"
exit 1
fi
ITCH_USER="waozi"
ITCH_GAME="inbe"
ITCH_CHANNEL="html5"
echo "Publishing inbe v$VERSION ($ITCH_CHANNEL) to itch.io..."
echo " User: $ITCH_USER"
echo " Game: $ITCH_GAME"
echo " Channel: $ITCH_CHANNEL"
echo " Build dir: $WEB_BUILD_DIR"
echo ""
butler push "$WEB_BUILD_DIR" "$ITCH_USER/$ITCH_GAME:$ITCH_CHANNEL" --userversion "$VERSION"
echo "✓ Published inbe v$VERSION to https://$ITCH_USER.itch.io/$ITCH_GAME"
-23
View File
@@ -1,23 +0,0 @@
#!/usr/bin/env bash
# Exit immediately if a command exits with a non-zero status
set -e
# 1. Define paths and package configuration
APK_PATH="build/android/app-universal-debug.apk"
# TODO: Replace with your actual Android package name from AndroidManifest.xml
PACKAGE_NAME="xyz.waozi.inbe"
LAUNCHER_ACTIVITY="xyz.waozi.inbe.MainActivity"
echo "🔄 Waiting for device..."
adb wait-for-device
echo "📦 Installing universal debug APK..."
# The -r flag replaces the existing application if it's already there
adb install -r "$APK_PATH"
echo "🚀 Launching application..."
# Starts the main activity
adb shell am start -n "$PACKAGE_NAME/$LAUNCHER_ACTIVITY"
echo "✅ Done!"
+95
View File
@@ -0,0 +1,95 @@
#!/usr/bin/env bash
set -e
AVD_NAME="inbe-test"
echo "🚀 Android Emulator Manager"
echo " This script handles emulator creation and launching"
echo " Use './scripts/run-android.sh' to build and install the app"
echo ""
# Check for Android SDK location
if [ -z "$ANDROID_SDK_ROOT" ] && [ -z "$ANDROID_HOME" ]; then
echo "❌ Error: Neither ANDROID_SDK_ROOT nor ANDROID_HOME environment variable is set"
echo " Make sure to run this script within 'nix develop'"
exit 1
fi
# Set up writable SDK location
WRITABLE_SDK="/mnt/storage/Android/Sdk"
if [ -d "$WRITABLE_SDK" ] && [ -w "$WRITABLE_SDK" ]; then
export ANDROID_SDK_ROOT="$WRITABLE_SDK"
export ANDROID_SDK_HOME="$WRITABLE_SDK"
export ANDROID_AVD_HOME="$WRITABLE_SDK/avd"
echo "📂 Using writable Android SDK: $ANDROID_SDK_ROOT"
else
echo "❌ Error: No writable Android SDK location found"
exit 1
fi
# Step 1: Create AVD if missing
if [ ! -d "$ANDROID_SDK_ROOT/avd/$AVD_NAME.avd" ]; then
echo "📱 AVD not found. Creating..."
bash scripts/create-avd.sh "$AVD_NAME"
echo ""
else
echo "✅ AVD already exists: $AVD_NAME"
echo ""
fi
# Step 2: Check if emulator is running
if adb devices | grep -q "emulator"; then
echo "✅ Emulator already running"
echo ""
echo "To stop the emulator:"
echo " adb emu kill"
else
echo "🚀 Launching emulator..."
# Set environment for emulator (unset ANDROID_HOME to avoid conflicts)
unset ANDROID_HOME
export ANDROID_SDK_ROOT="$ANDROID_SDK_ROOT"
# Launch emulator in background
emulator @"$AVD_NAME" \
-gpu host \
-skin 1080x2400 \
-no-snapshot-load \
-no-boot-anim \
-show-kernel \
-verbose > /tmp/emulator.log 2>&1 &
echo "⏳ Waiting for emulator to boot..."
timeout_seconds=120
elapsed=0
while ! adb shell getprop sys.boot_completed 2>/dev/null | grep -q "1"; do
if [ $elapsed -ge $timeout_seconds ]; then
echo "❌ Timeout waiting for emulator to boot"
echo " Check /tmp/emulator.log for details"
exit 1
fi
echo -n "⏳ "
date +"%T"
sleep 5
elapsed=$((elapsed + 5))
# Check if emulator process died
if ! pgrep -f "emulator.*$AVD_NAME" > /dev/null; then
echo "❌ Emulator process died"
echo " Check /tmp/emulator.log for details"
exit 1
fi
done
echo "✅ Emulator booted successfully"
echo ""
fi
echo "📱 Emulator ready!"
echo ""
echo "Next steps:"
echo " 1. Build and install the app:"
echo " ./scripts/run-android.sh"
+64
View File
@@ -0,0 +1,64 @@
#!/usr/bin/env bash
set -e
APK_PATH="build/android/app-universal-debug.apk"
PACKAGE_NAME="xyz.waozi.inbe"
echo "🚀 Android App Builder & Installer"
echo " This script builds the APK and installs it to your chosen device"
echo ""
# Build APK
echo "🔨 Building APK..."
make android-debug
echo "✅ APK built: $APK_PATH"
echo ""
# Get list of connected devices
mapfile -t DEVICES < <(adb devices | grep -v "List" | grep -v "^$" | awk '{print $1}')
if [ ${#DEVICES[@]} -eq 0 ]; then
echo "❌ No Android devices found"
echo " Connect a device or start an emulator:"
echo " ./scripts/emulator.sh"
exit 1
fi
echo "📱 Found ${#DEVICES[@]} device(s):"
for i in "${!DEVICES[@]}"; do
DEVICE_ID="${DEVICES[$i]}"
# Get device info
DEVICE_NAME=$(adb -s "$DEVICE_ID" shell getprop ro.product.model 2>/dev/null | tr -d '\r')
DEVICE_ANDROID=$(adb -s "$DEVICE_ID" shell getprop ro.build.version.release 2>/dev/null | tr -d '\r')
echo " [$i] $DEVICE_ID"
echo " Model: $DEVICE_NAME"
echo " Android: $DEVICE_ANDROID"
echo ""
done
# Select device
if [ ${#DEVICES[@]} -eq 1 ]; then
SELECTED_DEVICE="${DEVICES[0]}"
echo "✅ Using only available device"
else
echo -n "👉 Select device number [0-$((${#DEVICES[@]}-1))]: "
read -r SELECTION
SELECTED_DEVICE="${DEVICES[$SELECTION]}"
fi
echo ""
echo "📦 Installing APK to $SELECTED_DEVICE..."
adb -s "$SELECTED_DEVICE" install -r "$APK_PATH"
echo "🚀 Launching app..."
adb -s "$SELECTED_DEVICE" shell am start -n "$PACKAGE_NAME/.MainActivity"
echo ""
echo "🎉 App is running!"
echo ""
echo "To rebuild and reinstall:"
echo " ./scripts/run-android.sh"
echo ""
echo "To view logs:"
echo " adb -s $SELECTED_DEVICE logcat | grep inbe"
+3 -3
View File
@@ -1,6 +1,6 @@
speed 6
max_rounds 5
max_breaths 38
speed 8
max_rounds 7
max_breaths 32
pause_seconds 2
sound_volume 100
tutorial_seen 1
+64 -26
View File
@@ -5,9 +5,17 @@
#include <raylib.h>
#include <pthread.h>
#include <android_native_app_glue.h>
#include <jni.h>
#ifndef JNI_VERSION_1_6
#define JNI_VERSION_1_6 0x10060000
#endif
extern struct android_app *GetAndroidApp(void);
static JavaVM *g_jvm = NULL;
static jobject g_activity = NULL;
static volatile struct {
int status_bar;
int nav_bar;
@@ -17,53 +25,83 @@ static volatile struct {
int cutout_bottom;
} current_insets = {0};
static pthread_mutex_t insets_mutex = PTHREAD_MUTEX_INITIALIZER;
static int insets_initialized = 0;
static void query_insets_ndk(void) {
if (insets_initialized) return;
struct android_app *app = GetAndroidApp();
if (!app || !app->window) {
insets_initialized = 0;
return;
}
insets_initialized = 1;
int density = AConfiguration_getDensity(app->config);
/* Status bar: ~24dp, Navbar: ~48dp */
int status_height_px = (24 * density + 160) / 160;
int nav_height_px = (48 * density + 160) / 160;
// JNI function - Java calls this to push inset values
static void nativeSetInsets(JNIEnv *env, jobject thiz,
jint status_bar, jint nav_bar,
jint cutout_left, jint cutout_top, jint cutout_right, jint cutout_bottom)
{
TraceLog(LOG_INFO, "INBE: Java insets: status=%d, nav=%d, cutout_top=%d",
status_bar, nav_bar, cutout_top);
pthread_mutex_lock(&insets_mutex);
current_insets.status_bar = status_height_px;
current_insets.nav_bar = nav_height_px;
current_insets.cutout_left = 0;
current_insets.cutout_top = 0;
current_insets.cutout_right = 0;
current_insets.cutout_bottom = 0;
current_insets.status_bar = status_bar;
current_insets.nav_bar = nav_bar;
current_insets.cutout_left = cutout_left;
current_insets.cutout_top = cutout_top;
current_insets.cutout_right = cutout_right;
current_insets.cutout_bottom = cutout_bottom;
pthread_mutex_unlock(&insets_mutex);
// Memory barrier to ensure all threads see the updated values
__sync_synchronize();
}
// JNI method table
static const JNINativeMethod g_methods[] = {
{"nativeSetInsets", "(IIIIII)V", (void*)nativeSetInsets},
};
// JNI_OnLoad - Register native methods
JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved)
{
JNIEnv *env = NULL;
jint result;
g_jvm = vm;
result = (*vm)->GetEnv(vm, (void**)&env, JNI_VERSION_1_6);
if (result != JNI_OK) {
TraceLog(LOG_ERROR, "INBE: Failed to get JNI environment");
return result;
}
// Find the MainActivity class
jclass clazz = (*env)->FindClass(env, "xyz/waozi/inbe/MainActivity");
if (clazz == NULL) {
TraceLog(LOG_ERROR, "INBE: Failed to find MainActivity class");
return JNI_ERR;
}
// Register native methods
result = (*env)->RegisterNatives(env, clazz, g_methods, sizeof(g_methods) / sizeof(g_methods[0]));
if (result != JNI_OK) {
TraceLog(LOG_ERROR, "INBE: Failed to register native methods");
return result;
}
return JNI_VERSION_1_6;
}
void android_insets_init(void) {
pthread_mutex_lock(&insets_mutex);
memset((void *)&current_insets, 0, sizeof(current_insets));
pthread_mutex_unlock(&insets_mutex);
insets_initialized = 0;
}
void android_insets_get(AndroidInsets *out) {
query_insets_ndk();
pthread_mutex_lock(&insets_mutex);
// Simply return the current values
if (out) {
pthread_mutex_lock(&insets_mutex);
out->status_bar = current_insets.status_bar;
out->nav_bar = current_insets.nav_bar;
out->cutout_left = current_insets.cutout_left;
out->cutout_top = current_insets.cutout_top;
out->cutout_right = current_insets.cutout_right;
out->cutout_bottom = current_insets.cutout_bottom;
pthread_mutex_unlock(&insets_mutex);
}
pthread_mutex_unlock(&insets_mutex);
}
#endif
-2
View File
@@ -23,8 +23,6 @@ typedef struct {
int cutout_bottom;
} AndroidInsets;
static inline void android_insets_init(void) {}
static inline void android_insets_get(AndroidInsets *out) { (void)out; }
#endif
#endif
+3 -1
View File
@@ -1,4 +1,3 @@
#define RINI_IMPLEMENTATION
#include "app.h"
#include "data.h"
#include "tabs/history_tab.h"
@@ -8,6 +7,9 @@
#include "theme_meta.h"
#include "version.h"
#include "ui.h"
#if !defined(LOTUS_BUILD)
#define RINI_IMPLEMENTATION
#endif
#include "../vendor/rini/src/rini.h"
#include <dirent.h>
+15 -5
View File
@@ -51,9 +51,6 @@ int_from_count(const char src[4])
static int
ensure_dir(const char *path)
{
char temp[FS_PATH_MAX];
char *p;
if(path == NULL || path[0] == '\0')
return 0;
@@ -62,6 +59,18 @@ ensure_dir(const char *path)
if(DirectoryExists(path))
return 1;
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
/* On Android, just create the full path directly - Raylib's MakeDirectory handles recursion */
TraceLog(LOG_INFO, "DATA: Creating final directory: %s", path);
if(MakeDirectory(path))
return 1;
TraceLog(LOG_ERROR, "DATA: failed to create directory: %s", path);
return 0;
#else
char temp[FS_PATH_MAX];
char *p;
/* Make a temporary copy to modify */
strncpy(temp, path, sizeof(temp) - 1);
temp[sizeof(temp) - 1] = '\0';
@@ -92,6 +101,7 @@ ensure_dir(const char *path)
TraceLog(LOG_ERROR, "DATA: failed to create directory: %s", path);
return 0;
#endif
}
/* Check if a path refers to a session file (starts with "inbe-")
@@ -229,8 +239,8 @@ data_root(void)
} catch(e) {}
});
#elif defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
/* On Android, use simple relative path - Raylib handles storage */
snprintf(g_data_root, sizeof(g_data_root), "lotus");
/* On Android, use app's files directory which is already created */
snprintf(g_data_root, sizeof(g_data_root), "/data/data/xyz.waozi.inbe/files/lotus");
#else
const char *xdg = getenv("XDG_DATA_HOME");
const char *home = getenv("HOME");
+9 -2
View File
@@ -60,12 +60,14 @@ frame(void)
BeginDrawing();
ClearBackground(BLACK);
BeginScissorMode(content_x, content_y, content_width, content_height);
inbe_app_update_draw(&inbe_app, (Rectangle){
(float)content_x,
(float)content_y,
(float)content_width,
(float)content_height
});
EndScissorMode();
if(inbe_app.cursor_clickable)
SetMouseCursor(MOUSE_CURSOR_POINTING_HAND);
else
@@ -96,17 +98,22 @@ int main(int argc, char **argv) {
#if !defined(PLATFORM_ANDROID) && !defined(__ANDROID__) && !defined(ANDROID) && !defined(PLATFORM_WEB)
SetConfigFlags(FLAG_WINDOW_RESIZABLE);
#endif
InitWindow(window_w, window_h, inbe_app_title());
#if INBE_ANDROID_BUILD
android_insets_init(); // MUST be first, before app init
if(!ChangeDirectory("/data/user/0/xyz.waozi.inbe/files"))
TraceLog(LOG_WARNING, "INBE: failed to switch to Android files directory");
android_insets_init();
#endif
InitWindow(window_w, window_h, inbe_app_title());
inbe_app_init(&inbe_app);
/* Apply fullscreen setting on startup */
#if INBE_ANDROID_BUILD
inbe_app.fullscreen_enabled = 0; // Force fullscreen off on Android
#endif
if(inbe_app.fullscreen_enabled && !IsWindowFullscreen())
ToggleFullscreen();
+5
View File
@@ -107,6 +107,11 @@ settings_tab_draw(InbeApp *app)
ui_centered_column(CONTENT_MAX_W, CONTENT_SIDE_PAD, &content_x, &content_w);
/* Reset slider drag state when mouse is released */
if(IsMouseButtonReleased(MOUSE_BUTTON_LEFT)) {
app->settings_drag_slider = 0;
}
close_clicked = ui_draw_screen_header(app, "Settings", 1);
if(close_clicked) {
if(app->settings_dirty)
+62 -21
View File
@@ -133,43 +133,64 @@ static LotusThemeValue *scope_add_value(LotusThemeScope *scope, const char *key,
static void load_scope_file(LotusThemeScope *scope)
{
FILE *file;
char line[256];
char *fileText;
char *cursor;
char lineBuffer[256];
if(scope == NULL || scope->path[0] == '\0')
return;
file = fopen(scope->path, "r");
if(file == NULL)
// Use raylib's file loading which works with Android assets
fileText = LoadFileText(scope->path);
if(fileText == NULL || fileText[0] == '\0') {
TraceLog(LOG_WARNING, "THEME: Failed to load theme file: %s", scope->path);
return;
}
while(fgets(line, sizeof(line), file) != NULL) {
// Parse line by line
cursor = fileText;
while(*cursor != '\0') {
// Extract single line
char *newline = strchr(cursor, '\n');
if(newline != NULL) {
*newline = '\0'; // Temporarily null-terminate
strncpy(lineBuffer, cursor, sizeof(lineBuffer) - 1);
lineBuffer[sizeof(lineBuffer) - 1] = '\0';
*newline = '\n'; // Restore for next iteration
cursor = newline + 1;
} else {
strncpy(lineBuffer, cursor, sizeof(lineBuffer) - 1);
lineBuffer[sizeof(lineBuffer) - 1] = '\0';
cursor += strlen(cursor);
}
// Parse line (same logic as before)
char *line_cursor = lineBuffer;
char key[LOTUS_THEME_NAME_SIZE];
char value[32];
char *cursor = line;
int key_len = 0;
Color color;
while(isspace((unsigned char)*cursor))
cursor++;
if(*cursor == '#' || *cursor == '\0')
while(isspace((unsigned char)*line_cursor))
line_cursor++;
if(*line_cursor == '#' || *line_cursor == '\0')
continue;
while(*cursor != '\0' && !isspace((unsigned char)*cursor) &&
while(*line_cursor != '\0' && !isspace((unsigned char)*line_cursor) &&
key_len < LOTUS_THEME_NAME_SIZE - 1) {
key[key_len++] = *cursor++;
key[key_len++] = *line_cursor++;
}
key[key_len] = '\0';
while(isspace((unsigned char)*cursor))
cursor++;
if(*cursor == '"')
cursor++;
while(isspace((unsigned char)*line_cursor))
line_cursor++;
if(*line_cursor == '"')
line_cursor++;
int value_len = 0;
while(*cursor != '\0' && *cursor != '"' && *cursor != '\n' &&
!isspace((unsigned char)*cursor) && value_len < (int)sizeof(value) - 1) {
value[value_len++] = *cursor++;
while(*line_cursor != '\0' && *line_cursor != '"' && *line_cursor != '\n' &&
!isspace((unsigned char)*line_cursor) && value_len < (int)sizeof(value) - 1) {
value[value_len++] = *line_cursor++;
}
value[value_len] = '\0';
@@ -177,7 +198,7 @@ static void load_scope_file(LotusThemeScope *scope)
scope_add_value(scope, key, color);
}
fclose(file);
UnloadFileText(fileText);
}
LotusThemeScope *theme_register_scope(const char *name, const char *path)
@@ -202,10 +223,30 @@ Color theme_get(const char *scope_name, const char *key)
if(value != NULL)
return value->value;
fprintf(stderr, "missing theme color: %s.%s\n",
fprintf(stderr, "missing theme color: %s.%s, using clean light sky default\n",
scope_name != NULL ? scope_name : "(null)",
key != NULL ? key : "(null)");
abort();
// Use clean light sky theme colors as defaults
if(key != NULL) {
if(strstr(key, "background") != NULL)
return (Color){0xE2, 0xEE, 0xFC, 0xFF}; // #E2EEFCFF
if(strstr(key, "text") != NULL || strstr(key, "foreground") != NULL)
return (Color){0x24, 0x48, 0x7C, 0xFF}; // #24487CFF
if(strstr(key, "circle") != NULL)
return (Color){0x7E, 0xB7, 0xE6, 0xFF}; // #7EB7E6FF
if(strstr(key, "button_hover") != NULL)
return (Color){0x68, 0x9E, 0xD7, 0xFF}; // #689ED7FF
if(strstr(key, "button") != NULL)
return (Color){0xA6, 0xCF, 0xF2, 0xFF}; // #A6CFF2FF
if(strstr(key, "icon") != NULL)
return (Color){0xE2, 0xEE, 0xFC, 0xFF}; // #E2EEFCFF
if(strstr(key, "link") != NULL)
return (Color){0x4A, 0x90, 0xE2, 0xFF}; // #4A90E2FF
}
// Default fallback: sky background
return (Color){0xE2, 0xEE, 0xFC, 0xFF};
}
bool theme_set_color(const char *scope_name, const char *key, Color color)
-3
View File
@@ -1,5 +1,4 @@
#include "ui.h"
#include "android_insets.h"
#include "app.h"
#include <stdio.h>
#include <stdlib.h>
@@ -791,8 +790,6 @@ void
ui_draw_tab_bar(UITab *tabs, int count, InbeApp *app)
{
int bar_h = ui_clamp_px(58, 54, 66);
AndroidInsets insets = {0};
android_insets_get(&insets);
int bar_y = ui_view_height - bar_h;
int button_size = ui_clamp_px(ICON_SIZE_LARGE, ICON_SIZE_LARGE_MIN, ICON_SIZE_LARGE_MAX);
int button_h = button_size + ui_px(12);
+3 -3
View File
@@ -2,8 +2,8 @@
#define INBE_VERSION_H
#define INBE_VERSION_MAJOR 1
#define INBE_VERSION_MINOR 0
#define INBE_VERSION_PATCH 9
#define INBE_VERSION_STRING "1.0.9"
#define INBE_VERSION_MINOR 1
#define INBE_VERSION_PATCH 2
#define INBE_VERSION_STRING "1.1.2"
#endif
+22 -6
View File
@@ -6,17 +6,17 @@
:root {
--page-bg: #000000;
--page-tile: url('/icons/tile.png');
--page-tile: url('/icons/tile2.png');
--page-tile-opacity: 0.32;
--panel-bg: #ffffea;
--dark: #557777;
--panel-bg: #E2EEFC;
--dark: #24487C;
--shadow: #000000;
--light: #ffffff;
--button-bg: #d9d9d9;
--button-bg: #A6CFF2;
--button-highlight: #ffffff;
--button-inset: #ffffff;
--link: #1133aa;
--link-hover: #0044cc;
--link: #4A90E2;
--link-hover: #689ED7;
}
html, body {
@@ -62,6 +62,14 @@ body::before {
2px 2px 0 0 var(--light);
}
.hero {
text-align: center;
}
.hero img {
margin: 0 auto;
}
section {
margin-bottom: 80px;
}
@@ -81,6 +89,10 @@ img {
image-rendering: pixelated;
}
.hero .tk-img {
margin-bottom: 24px;
}
.tk-img {
border: 2px solid var(--dark);
border-right-color: var(--button-highlight);
@@ -278,6 +290,10 @@ input[type="text"] {
background-color: var(--button-highlight);
}
details {
text-align: center;
}
.donation-buttons {
display: flex;
justify-content: space-around;
+26 -13
View File
@@ -19,13 +19,19 @@ fi
# Get latest version for gradle update
LATEST_VERSION=$(echo "$VERSIONS" | head -n 1)
# versionCode = patch + 1 (since 1.0.0 = code 1)
VERSION_CODE=$(($(echo "$LATEST_VERSION" | cut -d. -f3) + 1))
# Get current versionName
# Get current gradle values
CURRENT_NAME=$(grep "versionName" "$GRADLE_FILE" | sed 's/.*"\([^"]*\)".*/\1/')
CURRENT_CODE=$(grep "versionCode" "$GRADLE_FILE" | awk '{print $2}')
# Android versionCode: just increment by 1 for new versions
# If version hasn't changed, keep the same code
if [ "$LATEST_VERSION" = "$CURRENT_NAME" ]; then
VERSION_CODE=$CURRENT_CODE
else
VERSION_CODE=$((CURRENT_CODE + 1))
fi
echo "Updating to: $LATEST_VERSION (code $VERSION_CODE)"
echo "Current: $CURRENT_NAME (code $CURRENT_CODE)"
@@ -51,10 +57,14 @@ echo "✓ Updated $VERSION_H_FILE"
# Create changelog directory
mkdir -p "$CHANGELOG_DIR"
# Generate only missing changelog files
# Generate changelog files (position-based: oldest = 1, newest = N)
# Reverse versions so oldest is processed first
TOTAL_VERSIONS=$(echo "$VERSIONS" | wc -l)
POSITION=0
while IFS= read -r VERSION; do
# versionCode = patch + 1
CODE=$(($(echo "$VERSION" | cut -d. -f3) + 1))
POSITION=$((POSITION + 1))
# Calculate position from end (newest gets highest number)
CODE=$((TOTAL_VERSIONS - POSITION + 1))
OUTPUT_FILE="$CHANGELOG_DIR/$CODE.txt"
# Skip if file already exists
@@ -63,17 +73,20 @@ while IFS= read -r VERSION; do
fi
# Extract changelog content for this version
CHANGELOG_CONTENT=$(awk -v version="[$VERSION]" '
CHANGELOG_CONTENT=$(awk -v ver="$VERSION" '
BEGIN { in_section=0 }
/^## \[/ {
if (found) exit
if ($0 ~ "\\[\\[" version "\\]\\]") {
found=1
if (in_section) exit
if (index($0, ver) > 0) {
in_section=1
next
}
}
found && /^### / { subsection=1 }
found { print }
' "$CHANGELOG_FILE" | sed '1d;/^$/d' | head -n -1)
in_section {
# Print section headers and bullet points
if (/^### / || /^- /) print
}
' "$CHANGELOG_FILE")
echo "$CHANGELOG_CONTENT" > "$OUTPUT_FILE"
echo "✓ Created $OUTPUT_FILE"