Compare commits

..
Author SHA1 Message Date
vii 0f6847d6d7 fix(webview): launch web Play buttons without waiting for navigation
Roblox defers a launchGame sent from the WebView until the Lua app next
navigates, so joining a private server stalled until a sidebar tab was
clicked. Parse launchGame in the runtime, queue it through the
experience launch pipeline, and close the WebView. Other commands still
reach Roblox.

Fixes #169
2026-09-24 23:01:44 -05:00
珍惜andHttpAnimations 30d50f15d1 Fix catalog unable to tell arm64 from x86_64 profiles for the same version. (#167)
Co-authored-by: HttpAnimations <shawndouglasyt@gmail.com>
2026-09-24 20:12:18 +03:00
komaruworld ab940acfb5 add arm64 ci with build
fog, update faq
2026-09-24 19:03:22 +03:00
farwhile 719b1fdd22 fix/respect host natural scrolling direction (#163) 2026-09-23 18:31:41 +03:00
珍惜andHttpAnimations 1fa2e116b3 Fix crashing on x86 hosts (#162)
Co-authored-by: HttpAnimations <shawndouglasyt@gmail.com>
2026-09-23 12:04:53 +03:00
珍惜andHttpAnimations 40237fae72 arm 64 (#152)
Co-authored-by: HttpAnimations <shawndouglasyt@gmail.com>
2026-09-21 20:09:37 +03:00
komaruworld 854969457f Fix textures and device info from Nightcap
Ported from CoderDayton/nightcap
2026-09-18 16:55:29 +03:00
komaruworld b54c896498 ci hate me? 2026-09-15 19:52:24 +03:00
komaruworld 1cd7b7db8f Fuck ci 2026-09-15 19:42:56 +03:00
komaruworld cdbf9ac1eb revert commit fdce534 2026-09-15 18:26:13 +03:00
komaruworld f383fbbff4 update faq.md 2026-09-15 12:08:18 +03:00
134 changed files with 2154 additions and 2432 deletions

No files matched your search

+2 -3
View File
@@ -1,6 +1,5 @@
# Modified by vii from komaruworld/mocktail. See README "About this fork".
name: Bug report
description: Report a reproducible problem in Nightcap
description: Report a reproducible problem in Mocktail
title: "[Bug]: "
labels:
- bug
@@ -76,7 +75,7 @@ body:
value: |
Latest log:
- Flatpak: `~/.var/app/io.github.CoderDayton.nightcap/.local/state/mocktail/logs/latest.log`
- Flatpak: `~/.var/app/space.bigrat.mocktail/.local/state/mocktail/logs/latest.log`
- Other installs: `~/.local/state/mocktail/logs/latest.log`
Older logs are in the `sessions` directory next to `latest.log`.
+51
View File
@@ -8,22 +8,32 @@ on:
- 'CMakeLists.txt'
- 'Makefile'
- 'README.md'
- '.gitmodules'
- 'cmake/**'
- 'config/**'
- 'include/**'
- 'packaging/**'
- 'scripts/**'
- 'src/**'
- 'stubs/**'
- 'tests/**'
- 'third_party/**'
pull_request:
paths:
- '.github/workflows/**'
- 'CMakeLists.txt'
- 'Makefile'
- 'README.md'
- '.gitmodules'
- 'cmake/**'
- 'config/**'
- 'include/**'
- 'packaging/**'
- 'scripts/**'
- 'src/**'
- 'stubs/**'
- 'tests/**'
- 'third_party/**'
workflow_dispatch:
permissions:
@@ -64,3 +74,44 @@ jobs:
bash tests/managed_payload_build_contract_test.sh .
bash tests/flatpak_packaging_test.sh .
bash tests/native_packaging_test.sh .
bash tests/anylinux_dependencies_test.sh .
native-build:
name: Native build (${{ matrix.arch }})
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
runner: ubuntu-26.04
- arch: aarch64
runner: ubuntu-26.04-arm
steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
- name: Install build dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends \
build-essential binutils cmake git ninja-build pkg-config lld \
libsdl3-dev libsdl3-ttf-dev libcurl4-openssl-dev libssl-dev \
nlohmann-json3-dev libyaml-dev libelf-dev libminizip-dev \
libcapstone-dev libgtk-4-dev libadwaita-1-dev libwebkitgtk-6.0-dev \
libutf8proc-dev libfontconfig1-dev libegl-dev libvulkan-dev \
libplacebo-dev libpng-dev zlib1g-dev
- name: Build and check native executables
shell: bash
run: |
test "$(uname -m)" = "${{ matrix.arch }}"
cmake -S . -B build-ci -G Ninja \
-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF
cmake --build build-ci --parallel 4
./build-ci/mocktail --help
./build-ci/mocktail_updater status
+147 -80
View File
@@ -1,9 +1,9 @@
# Modified by vii from komaruworld/mocktail. See README "About this fork".
name: Flatpak
on:
push:
tags: ['v*']
workflow_run:
workflows: [Native packages]
types: [completed]
pull_request:
paths:
- '.github/workflows/flatpak.yml'
@@ -15,11 +15,13 @@ on:
- 'config/**'
- 'include/**'
- 'packaging/flatpak/**'
- 'packaging/discord-join.html'
- 'packaging/icons/**'
- 'packaging/io.github.CoderDayton.nightcap.desktop'
- 'packaging/io.github.CoderDayton.nightcap.metainfo.xml'
- 'packaging/io.github.CoderDayton.nightcap.svg'
- 'packaging/space.bigrat.mocktail.desktop'
- 'packaging/space.bigrat.mocktail.metainfo.xml'
- 'packaging/space.bigrat.mocktail.svg'
- 'scripts/assemble_flatpak_pages.sh'
- 'scripts/assemble_native_repositories.sh'
- 'site/**'
- 'src/**'
- 'stubs/**'
@@ -27,26 +29,41 @@ on:
workflow_dispatch:
permissions:
actions: read
contents: read
concurrency:
group: flatpak-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: flatpak-${{ github.event.workflow_run.head_sha || github.ref }}
cancel-in-progress: true
jobs:
flatpak:
name: Flatpak build
runs-on: ubuntu-24.04
name: Flatpak build (${{ matrix.arch }})
if: >-
github.event_name != 'workflow_run' ||
(github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event != 'pull_request' &&
github.event.workflow_run.head_branch == 'main')
runs-on: ${{ matrix.runner }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
runner: ubuntu-24.04
- arch: aarch64
runner: ubuntu-24.04-arm
env:
# Publish on release tags and on manual runs from main. Pull requests
# only verify that the manifest still builds.
MOCKTAIL_PUBLISH: ${{ startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') }}
FLATPAK_ARCH: ${{ matrix.arch }}
MOCKTAIL_PUBLISH: ${{ (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event != 'pull_request' && github.event.workflow_run.head_branch == 'main') || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') }}
MOCKTAIL_SOURCE_SHA: ${{ github.event.workflow_run.head_sha || github.sha }}
steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
submodules: recursive
- name: Install Flatpak builder
@@ -57,33 +74,32 @@ jobs:
flatpak remote-add --user --if-not-exists flathub \
https://dl.flathub.org/repo/flathub.flatpakrepo
- name: Build Flatpak repository and bundle
- name: Build Flatpak bundle
shell: bash
env:
FLATPAK_GPG_PRIVATE_KEY: ${{ secrets.FLATPAK_GPG_PRIVATE_KEY }}
FLATPAK_GPG_KEY_ID: ${{ secrets.FLATPAK_GPG_KEY_ID }}
run: |
set -Eeuo pipefail
# The manifest builds the local checkout from refs/heads/main.
git update-ref refs/heads/main "$GITHUB_SHA"
git update-ref refs/heads/main "$MOCKTAIL_SOURCE_SHA"
builder_signing=()
bundle_keys=()
if [[ "$MOCKTAIL_PUBLISH" == true ]]; then
[[ -n "$FLATPAK_GPG_PRIVATE_KEY" && \
-n "$FLATPAK_GPG_KEY_ID" ]]
install -d -m 0700 "$RUNNER_TEMP/nightcap-gnupg"
install -d -m 0700 "$RUNNER_TEMP/mocktail-gnupg"
printf '%s' "$FLATPAK_GPG_PRIVATE_KEY" | \
gpg --batch --homedir "$RUNNER_TEMP/nightcap-gnupg" --import
gpg --batch --homedir "$RUNNER_TEMP/nightcap-gnupg" \
--export "$FLATPAK_GPG_KEY_ID" >nightcap-flatpak.gpg
gpg --batch --homedir "$RUNNER_TEMP/mocktail-gnupg" --import
gpg --batch --homedir "$RUNNER_TEMP/mocktail-gnupg" \
--export "$FLATPAK_GPG_KEY_ID" >mocktail-flatpak.gpg
builder_signing=(
"--gpg-sign=$FLATPAK_GPG_KEY_ID"
"--gpg-homedir=$RUNNER_TEMP/nightcap-gnupg"
"--gpg-homedir=$RUNNER_TEMP/mocktail-gnupg"
)
bundle_keys=(--gpg-keys=nightcap-flatpak.gpg)
bundle_keys=(--gpg-keys=mocktail-flatpak.gpg)
fi
flatpak-builder \
--arch=x86_64 \
--arch="$FLATPAK_ARCH" \
--jobs=4 \
--user \
--install-deps-from=flathub \
@@ -93,50 +109,135 @@ jobs:
--repo=repo \
"${builder_signing[@]}" \
build-flatpak-ci \
packaging/flatpak/io.github.CoderDayton.nightcap.json
if [[ "$MOCKTAIL_PUBLISH" == true ]]; then
flatpak build-update-repo \
--generate-static-deltas \
--static-delta-jobs=2 \
--prune \
--gpg-sign="$FLATPAK_GPG_KEY_ID" \
--gpg-homedir="$RUNNER_TEMP/nightcap-gnupg" \
repo
fi
packaging/flatpak/space.bigrat.mocktail.json
flatpak build-bundle \
--arch=x86_64 \
--arch="$FLATPAK_ARCH" \
"${bundle_keys[@]}" \
repo \
Nightcap-x86_64.flatpak \
io.github.CoderDayton.nightcap \
"Mocktail-${FLATPAK_ARCH}.flatpak" \
space.bigrat.mocktail \
stable
if [[ "$MOCKTAIL_PUBLISH" == true ]]; then
./scripts/assemble_flatpak_pages.sh \
repo Nightcap-x86_64.flatpak nightcap-flatpak.gpg public
fi
- name: Upload Flatpak
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Nightcap-x86_64-flatpak
path: Nightcap-x86_64.flatpak
name: Mocktail-${{ matrix.arch }}-flatpak
path: Mocktail-${{ matrix.arch }}.flatpak
if-no-files-found: error
retention-days: 14
publish:
name: Assemble multi-architecture Flatpak repository
if: >-
(github.event_name == 'workflow_run' &&
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event != 'pull_request' &&
github.event.workflow_run.head_branch == 'main') ||
(github.event_name == 'workflow_dispatch' &&
github.ref == 'refs/heads/main')
needs: flatpak
runs-on: ubuntu-24.04
timeout-minutes: 120
steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
- name: Download both Flatpak bundles
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: Mocktail-*-flatpak
path: flatpak-bundles
merge-multiple: true
- name: Download package repositories
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
set -Eeuo pipefail
run_id="${{ github.event.workflow_run.id }}"
if [[ -z "$run_id" ]]; then
run_id="$(gh run list \
--workflow packages.yml \
--branch main \
--event push \
--status success \
--limit 1 \
--json databaseId \
--jq '.[0].databaseId')"
fi
[[ -n "$run_id" ]]
gh run download "$run_id" \
--name Mocktail-native-repositories \
--dir native-repositories
[[ -d native-repositories/apt && \
-d native-repositories/rpm && \
-d native-repositories/downloads && \
-s native-repositories/mocktail-packages.gpg ]]
- name: Install Flatpak repository tools
shell: bash
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends flatpak gnupg ostree
- name: Sign and publish both architectures
shell: bash
env:
FLATPAK_GPG_PRIVATE_KEY: ${{ secrets.FLATPAK_GPG_PRIVATE_KEY }}
FLATPAK_GPG_KEY_ID: ${{ secrets.FLATPAK_GPG_KEY_ID }}
run: |
set -Eeuo pipefail
[[ -n "$FLATPAK_GPG_PRIVATE_KEY" && -n "$FLATPAK_GPG_KEY_ID" ]]
[[ -s flatpak-bundles/Mocktail-x86_64.flatpak && \
-s flatpak-bundles/Mocktail-aarch64.flatpak ]]
install -d -m 0700 "$RUNNER_TEMP/mocktail-gnupg"
printf '%s' "$FLATPAK_GPG_PRIVATE_KEY" | \
gpg --batch --homedir "$RUNNER_TEMP/mocktail-gnupg" --import
gpg --batch --homedir "$RUNNER_TEMP/mocktail-gnupg" \
--export "$FLATPAK_GPG_KEY_ID" >mocktail-flatpak.gpg
ostree --repo=repo init --mode=archive
for arch in x86_64 aarch64; do
flatpak build-import-bundle \
--gpg-sign="$FLATPAK_GPG_KEY_ID" \
--gpg-homedir="$RUNNER_TEMP/mocktail-gnupg" \
--no-update-summary \
repo "flatpak-bundles/Mocktail-${arch}.flatpak"
ostree --repo=repo refs | \
grep -Fxq "app/space.bigrat.mocktail/${arch}/stable"
done
flatpak build-update-repo \
--generate-static-deltas \
--static-delta-jobs=2 \
--prune \
--gpg-sign="$FLATPAK_GPG_KEY_ID" \
--gpg-homedir="$RUNNER_TEMP/mocktail-gnupg" \
repo
./scripts/assemble_flatpak_pages.sh \
repo flatpak-bundles/Mocktail-x86_64.flatpak \
flatpak-bundles/Mocktail-aarch64.flatpak \
mocktail-flatpak.gpg public native-repositories
- name: Configure GitHub Pages
if: env.MOCKTAIL_PUBLISH == 'true'
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Upload GitHub Pages repository
if: env.MOCKTAIL_PUBLISH == 'true'
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: public
deploy-pages:
name: Publish Flatpak repository
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
needs: flatpak
if: >-
(github.event_name == 'workflow_run' &&
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event != 'pull_request' &&
github.event.workflow_run.head_branch == 'main') ||
(github.event_name == 'workflow_dispatch' &&
github.ref == 'refs/heads/main')
needs: publish
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
@@ -150,37 +251,3 @@ jobs:
- name: Deploy GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
release:
name: Attach bundle to GitHub release
if: startsWith(github.ref, 'refs/tags/v')
needs: flatpak
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: write
steps:
- name: Download Flatpak
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: Nightcap-x86_64-flatpak
path: release
- name: Upload to release
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
set -Eeuo pipefail
tag="${GITHUB_REF_NAME}"
(cd release && sha256sum Nightcap-x86_64.flatpak > Nightcap-x86_64.flatpak.sha256)
# The Release workflow creates the same release; whichever job
# arrives second sees "already exists" and continues.
if ! gh release view "$tag" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
gh release create "$tag" --repo "$GITHUB_REPOSITORY" \
--title "Nightcap $tag" --generate-notes ||
gh release view "$tag" --repo "$GITHUB_REPOSITORY" >/dev/null
fi
gh release upload "$tag" --repo "$GITHUB_REPOSITORY" --clobber \
release/Nightcap-x86_64.flatpak \
release/Nightcap-x86_64.flatpak.sha256
+122 -7
View File
@@ -45,16 +45,19 @@ jobs:
- name: Build AppImage
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
docker run --rm \
--volume "$GITHUB_WORKSPACE:/workspace" \
--workdir /workspace \
--env GH_TOKEN \
ghcr.io/archlinux/archlinux:base-devel@sha256:c3953446016873a756fb7814f10087cac1634c127f7302e80c81c512da796d05 bash -Eeuo pipefail -c '
pacman -Syu --noconfirm --needed \
cmake git ninja pkgconf lld sdl3 sdl3_ttf curl openssl \
nlohmann-json libyaml libelf minizip minizip-ng capstone gtk4 \
libadwaita webkitgtk-6.0 libutf8proc fontconfig libglvnd \
vulkan-headers zlib libplacebo bubblewrap xdg-dbus-proxy \
vulkan-headers zlib libplacebo libpng bubblewrap xdg-dbus-proxy \
patchelf jq unzip file ca-certificates dbus zsync
# Reduced ABI-compatible packages belong only in this builder.
@@ -140,6 +143,117 @@ jobs:
if-no-files-found: error
retention-days: 14
appimage-aarch64:
name: AppImage (AnyLinux aarch64)
runs-on: ubuntu-24.04-arm
timeout-minutes: 120
steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
submodules: recursive
- name: Build aarch64 AppImage
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
docker run --rm --platform linux/arm64 \
--volume "$GITHUB_WORKSPACE:/workspace" \
--workdir /workspace \
--env GH_TOKEN \
ghcr.io/pkgforge-dev/archlinux:latest@sha256:b2507f1964270cab3cc190aa8df858521f6a7e45e969146a012877891d5dfc9b bash -Eeuo pipefail -c '
test "$(uname -m)" = aarch64
pacman-key --init
pacman -Syy --noconfirm archlinux-keyring
pacman -Syu --noconfirm --needed \
base-devel cmake git ninja pkgconf lld sdl3 sdl3_ttf curl openssl \
nlohmann-json libyaml libelf minizip minizip-ng capstone gtk4 \
libadwaita webkitgtk-6.0 libutf8proc fontconfig libglvnd \
vulkan-headers zlib libplacebo libpng bubblewrap xdg-dbus-proxy \
patchelf jq unzip file ca-certificates dbus zsync
./scripts/install_anylinux_dependencies.sh
curl --fail --location --retry 3 \
--output /tmp/quick-sharun \
https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/2a025cef14483c5bc2a75b479071f4d5c58a906f/useful-tools/quick-sharun.sh
echo "fa66d0189e1e87df781c049dfb23cbb1e753786056f693a4483d6d3af61e7ee1 /tmp/quick-sharun" | \
sha256sum --check --strict
chmod 0755 /tmp/quick-sharun
curl --fail --location --retry 3 \
--output /tmp/sharun \
https://github.com/pkgforge-dev/Anylinux-sharun/releases/download/2.2.6/sharun-aarch64
echo "3b64db0727a9d5c8212c4b2342770583ce552deac0644d2d6033e9ec280f7635 /tmp/sharun" | \
sha256sum --check --strict
chmod 0755 /tmp/sharun
curl --fail --location --retry 3 \
--output /tmp/anylinux.c \
https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/2a025cef14483c5bc2a75b479071f4d5c58a906f/useful-tools/lib/anylinux.c
echo "f50650ad96d177559bdd0737df509fa20bd4af08887631c738fc1f31bfac185f /tmp/anylinux.c" | \
sha256sum --check --strict
curl --fail --location --retry 3 \
--output /tmp/appimagetool \
https://github.com/pkgforge-dev/appimagetool/releases/download/0.3.3/appimagetool-aarch64-linux
echo "298f5293c41f9b2b46290b246e6419783940824ce20b98775a5a153b18fe8422 /tmp/appimagetool" | \
sha256sum --check --strict
chmod 0755 /tmp/appimagetool
curl --fail --location --retry 3 \
--output /tmp/uruntime \
https://github.com/VHSgunzo/uruntime/releases/download/v0.5.9/uruntime-appimage-dwarfs-lite-aarch64
echo "5686f126b22d944b2b9c862ee004b4c590b5a5e5215d8790cc0420f1fbbea942 /tmp/uruntime" | \
sha256sum --check --strict
chmod 0755 /tmp/uruntime
curl --fail --location --retry 3 \
--output /tmp/mkdwarfs \
https://github.com/mhx/dwarfs/releases/download/v0.15.6/dwarfs-universal-0.15.6-Linux-aarch64
echo "2d513c43ad652163e5e31c1a96f3c736e7e188e661ff62fc9143ea7147bd936b /tmp/mkdwarfs" | \
sha256sum --check --strict
chmod 0755 /tmp/mkdwarfs
git config --global --add safe.directory /workspace
git config --global --add safe.directory /workspace/third_party/Vulkan-Headers
git config --global --add safe.directory /workspace/third_party/libjnivm
export MOCKTAIL_ANYLINUX_SYSTEM_INSTALL=1
export MOCKTAIL_ANYLINUX_SHARUN=/tmp/sharun
export MOCKTAIL_ANYLINUX_C_SOURCE=/tmp/anylinux.c
export RUNTIME=/tmp/uruntime
export DWARFS_CMD=/tmp/mkdwarfs
make appimage BUILD_DIR=build-appimage-aarch64 JOBS=4 \
APPIMAGE=dist/Mocktail-aarch64.AppImage \
PORTABLE_MODE=standalone APPIMAGE_FORMAT=anylinux \
ANYLINUX_PACKAGER=/tmp/quick-sharun \
ANYLINUX_APPIMAGETOOL=/tmp/appimagetool
test -x dist/Mocktail-aarch64.AppImage
'
- name: Smoke-test aarch64 AppImage without FUSE
shell: bash
run: |
smoke_dir="$(mktemp -d)"
trap 'rm -rf -- "$smoke_dir"' EXIT
export XDG_DATA_HOME="$smoke_dir/data"
export XDG_CONFIG_HOME="$smoke_dir/config"
export XDG_CACHE_HOME="$smoke_dir/cache"
export XDG_STATE_HOME="$smoke_dir/state"
mkdir -p "$XDG_DATA_HOME" "$XDG_CONFIG_HOME" "$XDG_CACHE_HOME" "$XDG_STATE_HOME"
timeout 60s dist/Mocktail-aarch64.AppImage --appimage-extract-and-run --help
timeout 60s dist/Mocktail-aarch64.AppImage --appimage-extract-and-run mocktail_updater status
- name: Upload aarch64 AppImage
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Mocktail-AppImage-aarch64
path: dist/Mocktail-aarch64.AppImage
if-no-files-found: error
retention-days: 14
deb:
name: DEB (Ubuntu 26.04)
runs-on: ubuntu-24.04
@@ -169,7 +283,7 @@ jobs:
libyaml-dev libelf-dev libminizip-dev libcapstone-dev \
libgtk-4-dev libadwaita-1-dev libwebkitgtk-6.0-dev \
libutf8proc-dev libfontconfig1-dev libegl-dev \
libvulkan-dev libplacebo-dev zlib1g-dev
libvulkan-dev libplacebo-dev libpng-dev zlib1g-dev
cmake -S . -B build-deb -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
@@ -217,7 +331,7 @@ jobs:
minizip-ng-compat-devel capstone-devel gtk4-devel libadwaita-devel \
webkitgtk6.0-devel utf8proc-devel fontconfig-devel \
libglvnd-devel vulkan-headers vulkan-loader-devel \
libplacebo-devel zlib-ng-compat-devel
libplacebo-devel libpng-devel zlib-ng-compat-devel
cmake -S . -B build-rpm -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
@@ -261,7 +375,7 @@ jobs:
cmake git ninja pkgconf lld sdl3 sdl3_ttf curl openssl \
nlohmann-json libyaml libelf minizip capstone gtk4 \
libadwaita webkitgtk-6.0 libutf8proc fontconfig \
libplacebo vulkan-headers vulkan-icd-loader libglvnd zlib
libplacebo libpng vulkan-headers vulkan-icd-loader libglvnd zlib
useradd --create-home builder
chown -R builder:builder /workspace
runuser -u builder -- env MOCKTAIL_SOURCE_DIR=/workspace \
@@ -283,7 +397,7 @@ jobs:
publish:
name: Publish continuous packages
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
needs: [appimage, deb, rpm, arch]
needs: [appimage, appimage-aarch64, deb, rpm, arch]
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
@@ -305,7 +419,8 @@ jobs:
shell: bash
run: |
set -Eeuo pipefail
mv -- release/*.AppImage release/mocktail-nightly.AppImage
mv -- release/Mocktail-x86_64.AppImage release/mocktail-nightly.AppImage
mv -- release/Mocktail-aarch64.AppImage release/mocktail-nightly-aarch64.AppImage
mv -- release/*.deb release/mocktail-nightly.deb
mv -- release/*.rpm release/mocktail-nightly.rpm
mv -- release/*.pkg.tar.zst release/mocktail-nightly.pkg.tar.zst
@@ -360,7 +475,7 @@ jobs:
gh release upload continuous release/* --clobber
while IFS= read -r asset; do
case "$asset" in
mocktail-nightly.AppImage|mocktail-nightly.deb|mocktail-nightly.rpm|mocktail-nightly.pkg.tar.zst)
mocktail-nightly.AppImage|mocktail-nightly-aarch64.AppImage|mocktail-nightly.deb|mocktail-nightly.rpm|mocktail-nightly.pkg.tar.zst)
;;
Mocktail-*.AppImage|mocktail_*.deb|mocktail-*.deb|mocktail-*.rpm|mocktail-*.pkg.tar.zst)
gh release delete-asset continuous "$asset" --yes
-154
View File
@@ -1,154 +0,0 @@
name: Release
on:
push:
tags: ['v*']
workflow_dispatch:
permissions:
contents: read
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
appimage:
name: AppImage (AnyLinux)
runs-on: ubuntu-24.04
timeout-minutes: 90
steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
submodules: recursive
- name: Build AppImage
shell: bash
run: |
docker run --rm \
--volume "$GITHUB_WORKSPACE:/workspace" \
--workdir /workspace \
ghcr.io/archlinux/archlinux:base-devel@sha256:c3953446016873a756fb7814f10087cac1634c127f7302e80c81c512da796d05 bash -Eeuo pipefail -c '
pacman -Syu --noconfirm --needed \
cmake git ninja pkgconf lld sdl3 sdl3_ttf curl openssl \
nlohmann-json libyaml libelf minizip minizip-ng capstone gtk4 \
libadwaita webkitgtk-6.0 libutf8proc fontconfig libglvnd \
vulkan-headers zlib libplacebo bubblewrap xdg-dbus-proxy \
patchelf jq unzip file ca-certificates dbus zsync
./scripts/install_anylinux_dependencies.sh
curl --fail --location --retry 3 \
--output /tmp/quick-sharun \
https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/2a025cef14483c5bc2a75b479071f4d5c58a906f/useful-tools/quick-sharun.sh
echo "fa66d0189e1e87df781c049dfb23cbb1e753786056f693a4483d6d3af61e7ee1 /tmp/quick-sharun" | \
sha256sum --check --strict
chmod 0755 /tmp/quick-sharun
curl --fail --location --retry 3 \
--output /tmp/sharun \
https://github.com/pkgforge-dev/Anylinux-sharun/releases/download/2.2.6/sharun-x86_64
echo "a4d51752f9861b4870ca529fea04087310b28f8943cc55b99a95b777d4db92ec /tmp/sharun" | \
sha256sum --check --strict
chmod 0755 /tmp/sharun
curl --fail --location --retry 3 \
--output /tmp/anylinux.c \
https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/2a025cef14483c5bc2a75b479071f4d5c58a906f/useful-tools/lib/anylinux.c
echo "f50650ad96d177559bdd0737df509fa20bd4af08887631c738fc1f31bfac185f /tmp/anylinux.c" | \
sha256sum --check --strict
curl --fail --location --retry 3 \
--output /tmp/appimagetool \
https://github.com/pkgforge-dev/appimagetool/releases/download/0.3.3/appimagetool-x86_64-linux
echo "0d01a4e2628efc897be9663f0faeed6a171e1851270b4e1ce4c22434a36ecebd /tmp/appimagetool" | \
sha256sum --check --strict
chmod 0755 /tmp/appimagetool
curl --fail --location --retry 3 \
--output /tmp/uruntime \
https://github.com/VHSgunzo/uruntime/releases/download/v0.5.9/uruntime-appimage-dwarfs-lite-x86_64
echo "cef962c299f2fa19b2b3cdf2fa1565ee8541796cc89b9a97a591f94041e8b083 /tmp/uruntime" | \
sha256sum --check --strict
chmod 0755 /tmp/uruntime
curl --fail --location --retry 3 \
--output /tmp/mkdwarfs \
https://github.com/mhx/dwarfs/releases/download/v0.15.6/dwarfs-universal-0.15.6-Linux-x86_64
echo "50891c38ba359db8271819a6cbf6aaa8068681523f0c4f2b8242007a45edaa28 /tmp/mkdwarfs" | \
sha256sum --check --strict
chmod 0755 /tmp/mkdwarfs
git config --global --add safe.directory /workspace
git config --global --add safe.directory /workspace/third_party/Vulkan-Headers
git config --global --add safe.directory /workspace/third_party/libjnivm
export MOCKTAIL_ANYLINUX_SYSTEM_INSTALL=1
export MOCKTAIL_ANYLINUX_SHARUN=/tmp/sharun
export MOCKTAIL_ANYLINUX_C_SOURCE=/tmp/anylinux.c
export RUNTIME=/tmp/uruntime
export DWARFS_CMD=/tmp/mkdwarfs
make appimage BUILD_DIR=build-appimage JOBS=4 \
APPIMAGE=dist/Mocktail-x86_64.AppImage \
PORTABLE_MODE=standalone APPIMAGE_FORMAT=anylinux \
ANYLINUX_PACKAGER=/tmp/quick-sharun \
ANYLINUX_APPIMAGETOOL=/tmp/appimagetool
test -x dist/Mocktail-x86_64.AppImage
'
- name: Smoke-test AppImage without FUSE
shell: bash
run: |
smoke_dir="$(mktemp -d)"
trap 'rm -rf -- "$smoke_dir"' EXIT
export XDG_DATA_HOME="$smoke_dir/data"
export XDG_CONFIG_HOME="$smoke_dir/config"
export XDG_CACHE_HOME="$smoke_dir/cache"
export XDG_STATE_HOME="$smoke_dir/state"
mkdir -p "$XDG_DATA_HOME" "$XDG_CONFIG_HOME" "$XDG_CACHE_HOME" "$XDG_STATE_HOME"
timeout 60s dist/Mocktail-x86_64.AppImage --appimage-extract-and-run --help
timeout 60s dist/Mocktail-x86_64.AppImage --appimage-extract-and-run mocktail_updater status
- name: Upload AppImage
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Mocktail-AppImage
path: dist/Mocktail-x86_64.AppImage
if-no-files-found: error
retention-days: 14
publish:
name: Publish GitHub release
if: startsWith(github.ref, 'refs/tags/v')
needs: [appimage]
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: write
steps:
- name: Download AppImage
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: Mocktail-AppImage
path: release
- name: Create release
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
set -Eeuo pipefail
tag="${GITHUB_REF_NAME}"
mv release/Mocktail-x86_64.AppImage release/Nightcap-x86_64.AppImage
(cd release && sha256sum Nightcap-x86_64.AppImage > Nightcap-x86_64.AppImage.sha256)
# The Flatpak workflow creates the same release; whichever job
# arrives second sees "already exists" and continues.
if ! gh release view "$tag" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
gh release create "$tag" --repo "$GITHUB_REPOSITORY" \
--title "Nightcap $tag" --generate-notes ||
gh release view "$tag" --repo "$GITHUB_REPOSITORY" >/dev/null
fi
gh release upload "$tag" --repo "$GITHUB_REPOSITORY" --clobber \
release/Nightcap-x86_64.AppImage \
release/Nightcap-x86_64.AppImage.sha256
-1
View File
@@ -1,6 +1,5 @@
# Build
/build/
/build-test/
/build_*/
/build-flatpak/
/build-anylinux*/
+14 -21
View File
@@ -1,4 +1,3 @@
# Modified by vii from komaruworld/mocktail. See README "About this fork".
# Copyright 2026 Mocktail Project Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -10,7 +9,7 @@
cmake_minimum_required(VERSION 3.20)
project(Mocktail
VERSION 1.0.4
DESCRIPTION "Android x86-64 Roblox compatibility runtime for Linux"
DESCRIPTION "Android Roblox compatibility runtime for Linux"
LANGUAGES CXX
)
@@ -265,6 +264,7 @@ add_library(mocktail_runtime STATIC
src/runtime/command_line.cc
src/runtime/crash_report_policy.cc
src/runtime/discord_rpc.cc
src/runtime/device_memory_profile.cc
src/runtime/device_profile.cc
src/runtime/environment.cc
src/runtime/external_launch_broker.cc
@@ -301,7 +301,6 @@ add_library(mocktail_runtime STATIC
src/runtime/support_bundle.cc
src/runtime/system_proxy.cc
src/runtime/texture_memory_policy.cc
src/runtime/device_memory_profile.cc
)
add_library(Mocktail::Runtime ALIAS mocktail_runtime)
target_include_directories(mocktail_runtime PUBLIC include)
@@ -649,6 +648,11 @@ target_link_options(mocktail PRIVATE
)
# Native FreeBSD helper for Linuxulator's unsupported DF socket option.
# The helper is x86-64 assembly; other host architectures have nothing to
# assemble.
if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|AMD64)$")
set(MOCKTAIL_BUILD_FREEBSD_SOCKET_HELPER OFF)
endif()
option(MOCKTAIL_BUILD_FREEBSD_SOCKET_HELPER
"Build the native FreeBSD Linuxulator socket helper" ON)
if(MOCKTAIL_BUILD_FREEBSD_SOCKET_HELPER)
@@ -726,24 +730,13 @@ install(FILES
config/roblox_signing_certificates.json
DESTINATION "${MOCKTAIL_INSTALL_DATA_DIR}/metadata"
)
# The installed desktop entry names the binary by its install path, so it
# launches from sessions whose PATH lacks the install prefix. Uses the prefix
# given at install time, not the configure-time one.
install(CODE "
file(READ \"${CMAKE_SOURCE_DIR}/packaging/io.github.CoderDayton.nightcap.desktop\"
MOCKTAIL_DESKTOP_ENTRY)
string(REPLACE \"Exec=env SDL_VIDEODRIVER=wayland,x11 mocktail %u\"
\"Exec=env SDL_VIDEODRIVER=wayland,x11 \${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/mocktail %u\"
MOCKTAIL_DESKTOP_ENTRY \"\${MOCKTAIL_DESKTOP_ENTRY}\")
file(WRITE \"${CMAKE_BINARY_DIR}/io.github.CoderDayton.nightcap.desktop\"
\"\${MOCKTAIL_DESKTOP_ENTRY}\")
file(INSTALL \"${CMAKE_BINARY_DIR}/io.github.CoderDayton.nightcap.desktop\"
DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/applications\")
")
install(FILES packaging/io.github.CoderDayton.nightcap.metainfo.xml
install(FILES packaging/space.bigrat.mocktail.desktop
DESTINATION "${CMAKE_INSTALL_DATADIR}/applications"
)
install(FILES packaging/space.bigrat.mocktail.metainfo.xml
DESTINATION "${CMAKE_INSTALL_DATADIR}/metainfo"
)
install(FILES packaging/io.github.CoderDayton.nightcap.svg
install(FILES packaging/space.bigrat.mocktail.svg
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps"
)
set(MOCKTAIL_HICOLOR_ICON_SIZES
@@ -752,7 +745,7 @@ set(MOCKTAIL_HICOLOR_ICON_SIZES
# Generated icons are committed, so ImageMagick is not a build dependency.
foreach(icon_size IN LISTS MOCKTAIL_HICOLOR_ICON_SIZES)
install(FILES
"packaging/icons/hicolor/${icon_size}x${icon_size}/apps/io.github.CoderDayton.nightcap.png"
"packaging/icons/hicolor/${icon_size}x${icon_size}/apps/space.bigrat.mocktail.png"
DESTINATION
"${CMAKE_INSTALL_DATADIR}/icons/hicolor/${icon_size}x${icon_size}/apps"
)
@@ -804,7 +797,7 @@ set(CPACK_PACKAGE_CONTACT "komaruworld <rtysus228@gmail.com>")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/komaruworld/mocktail")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
set(CPACK_PACKAGE_DESCRIPTION
"Runs the Android x86-64 Roblox client on Linux."
"Runs the Android Roblox client on Linux."
)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
+64
View File
@@ -0,0 +1,64 @@
# FAQ
## How do I enable Discord RPC?
RPC is disabled by default. Launch Mocktail once to create the config, then
close it. Open `config.yaml`:
- Native / AppImage: `~/.config/mocktail/config.yaml`
- Flatpak: `~/.var/app/space.bigrat.mocktail/config/mocktail/config.yaml`
For native installs, a custom `$XDG_CONFIG_HOME` replaces `~/.config`.
Set `enabled` to `true` under `integrations.discord_rpc`. If the block is
missing, add it under the existing `integrations` section:
```yaml
integrations:
discord_rpc:
enabled: true
```
Save the file, open Discord Desktop, and restart Mocktail. Set `enabled`
back to `false` to disable RPC.
## Where can I find logs for a bug report?
Mocktail saves logs automatically. Reproduce the issue, close Mocktail, and
attach `latest.log`:
- Native / AppImage: `~/.local/state/mocktail/logs/latest.log`
- Flatpak: `~/.var/app/space.bigrat.mocktail/.local/state/mocktail/logs/latest.log`
For native installs, a custom `$XDG_STATE_HOME` replaces `~/.local/state`.
## Can I run multiple Roblox instances?
No. Mocktail won't add multi-instance launching. It would mean working around
Roblox's restrictions on running several clients. The [Roblox Terms of Use](https://en.help.roblox.com/hc/en-us/articles/115004647846-Roblox-Terms-of-Use)
prohibit bypassing technical protections, and violating the terms can get your
account suspended.
Bloxstrap brought the option back in [v2.9.0](https://github.com/bloxstraplabs/bloxstrap/releases/tag/v2.9.0)
with a "use at your own risk" warning, then removed it in
[v2.10.0](https://github.com/bloxstraplabs/bloxstrap/releases/tag/v2.10.0)
after Roblox added measures against running multiple clients.
## Can I play in VR?
VR is experimental. Install the [build dependencies](README.md#building),
then switch to the `vr` branch and build:
```bash
git fetch origin
git switch vr
git submodule update --init --recursive
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DMOCKTAIL_ENABLE_VR=ON
cmake --build build -j4
```
Start WiVRn or SteamVR/ALVR, connect your headset, then run:
```bash
./build/mocktail -vr
```
+5 -6
View File
@@ -1,4 +1,3 @@
# Modified by vii from komaruworld/mocktail. See README "About this fork".
.DEFAULT_GOAL := all
.PHONY: all build release debug test apk install register-url-handler release-runtime portable portable-test standalone appimage flatpak run-flatpak run run-smoke run-unlimited run-game run-input run-resize run-network auto-run run-gles run-angle update-roblox update-auto update-auto-launch payload-status payload-rollback support-bundle clean submodules help
@@ -20,7 +19,7 @@ ANYLINUX_PACKAGER ?= quick-sharun
ANYLINUX_APPIMAGETOOL ?= appimagetool
PREFIX ?= /usr
FLATPAK_BUILD_DIR ?= build-flatpak
FLATPAK_MANIFEST ?= packaging/flatpak/io.github.CoderDayton.nightcap.json
FLATPAK_MANIFEST ?= packaging/flatpak/space.bigrat.mocktail.json
FLATPAK_JOBS ?= 4
define build_native_runtime
@@ -56,7 +55,7 @@ install: ## Install an already-built dynamic runtime (use: sudo make install)
register-url-handler: build ## Select this build for Roblox website links
@./scripts/register_url_handler.sh --set-default \
--executable "$(abspath $(BINARY))" \
--desktop-file "$(abspath packaging/io.github.CoderDayton.nightcap.desktop)"
--desktop-file "$(abspath packaging/space.bigrat.mocktail.desktop)"
test: ## Build and run all unit tests
$(call build_native_runtime,Debug,ON)
@@ -92,7 +91,7 @@ flatpak: ## Build and install the local x86-64 Flatpak
--jobs "$(FLATPAK_JOBS)"
run-flatpak: ## Run the installed Flatpak
@flatpak run io.github.CoderDayton.nightcap
@flatpak run space.bigrat.mocktail
run: export MOCKTAIL_AUTO_EXIT_AFTER_PRESENT_MS = 0
run: build ## Run the native binary interactively until the window is closed
@@ -130,8 +129,8 @@ auto-run: ## Build/run loop with crash summaries
run-gles: build ## Run strict system EGL/OpenGL ES 3 without Vulkan fallback
@$(BINARY) --graphics opengl
run-angle: ## Run with ANGLE/Vulkan compatibility backend
@MOCKTAIL_GRAPHICS_BACKEND=angle-vulkan ./scripts/run_sober.sh
run-angle: build ## Run with ANGLE/Vulkan compatibility backend
@$(BINARY) --graphics angle-vulkan
update-roblox: ## Validate and import the current x86_64 Roblox bundle cached by Sober
@./scripts/update_roblox_payload.sh
+98 -102
View File
@@ -1,67 +1,20 @@
<!-- Modified by vii from komaruworld/mocktail. See "About this fork" below. -->
# Nightcap
# Mocktail
[![CI](https://github.com/CoderDayton/nightcap/actions/workflows/ci.yml/badge.svg)](https://github.com/CoderDayton/nightcap/actions/workflows/ci.yml)
[![Stars](https://img.shields.io/github/stars/CoderDayton/nightcap?style=flat&logo=github)](https://github.com/CoderDayton/nightcap/stargazers)
[![CI](https://github.com/komaruworld/mocktail/actions/workflows/ci.yml/badge.svg)](https://github.com/komaruworld/mocktail/actions/workflows/ci.yml)
[![Stars](https://img.shields.io/github/stars/komaruworld/mocktail?style=flat&logo=github)](https://github.com/komaruworld/mocktail/stargazers)
[![Downloads](https://img.shields.io/github/downloads/komaruworld/mocktail/total?logo=github)](https://github.com/komaruworld/mocktail/releases/latest)
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
[![Discord](https://img.shields.io/discord/1543955607869063269?label=discord)](https://discord.gg/rhgpfcmFSD)
Nightcap is Mocktail, tuned for playing on a real PC. It runs the Android
`x86_64` Roblox client on Linux, including a Linux userspace hosted by
FreeBSD's Linuxulator. It provides the Android ABI and JNI pieces the client
expects, then connects them to SDL3 and Vulkan or OpenGL on the Linux side.
Mocktail runs the Android `x86_64` Roblox client on Linux and has experimental
`aarch64` builds for the Android `arm64-v8a` client. It also runs in a Linux
userspace hosted by FreeBSD's Linuxulator. Mocktail provides the Android ABI
and JNI pieces the client expects, then connects them to SDL3 and Vulkan or
OpenGL on the Linux side.
Nightcap is an independent community project. It is not affiliated with Roblox
Mocktail is an independent community project. It is not affiliated with Roblox
Corporation or VinegarHQ and does not distribute the Roblox client.
## About this fork
Nightcap is a fork of [komaruworld/mocktail](https://github.com/komaruworld/mocktail)
with extra fixes for playing on a PC. The program and config paths keep the
`mocktail` name so upstream fixes still apply cleanly. The app ID is
`io.github.CoderDayton.nightcap`, so Nightcap and upstream can be installed
side by side.
- **Lower input lag.** Frames are shown as soon as they are ready instead of
waiting in a queue.
- **Sharper textures.** Small textures are upscaled 4x by default, and you
can replace any texture with your own PNG in `~/.config/mocktail/textures`.
Set `MOCKTAIL_SMALL_TEXTURE_UPSCALE=1` to turn the upscale off.
- **ETC2 textures on any GPU.** Games that use compressed mobile textures now
render correctly on desktop GPUs, without stutter.
- **No more error 319 kicks.** Servers no longer drop you shortly after
joining.
- **Correct device info.** Roblox sees your real RAM and screen size.
- **Better desktop launcher.** Runs on Wayland and always finds the installed
binary.
Everything else works the same as upstream. See the
[roadmap](docs/ROADMAP.md) for what is coming next.
## Install with Flatpak
```bash
flatpak install --user https://coderdayton.github.io/nightcap/nightcap.flatpakref
flatpak run io.github.CoderDayton.nightcap
```
Updates arrive through `flatpak update`. Nightcap is not on Flathub yet.
## AppImage
Grab the AppImage from the
[latest release](https://github.com/CoderDayton/nightcap/releases/latest),
make it executable, and run it:
```bash
chmod +x Nightcap-x86_64.AppImage
./Nightcap-x86_64.AppImage
```
Or build and install it from source using the steps under
[Building](#building). There are no AUR, DEB, or RPM packages of Nightcap.
Upstream ships those for unmodified Mocktail, see
[komaruworld/mocktail](https://github.com/komaruworld/mocktail#readme).
## How it works
```
@@ -69,24 +22,91 @@ Roblox APK -> signature and ABI checks -> Bionic + JNI -> SDL3 + Vulkan/OpenGL
```
The APK is checked before any native code is loaded. It is downloaded on first
launch and is not bundled with Nightcap. The last working copy is kept in case
launch and is not bundled with Mocktail. The last working copy is kept in case
an update fails.
## Install with Flatpak
Install the stable release from Flathub:
```bash
flatpak install flathub space.bigrat.mocktail
flatpak run space.bigrat.mocktail
```
Nightly builds are produced automatically from the latest `main` branch:
```bash
flatpak install --user https://mocktail.bigrat.space/mocktail.flatpakref
flatpak run space.bigrat.mocktail
```
## Install from the AUR
Arch Linux users can install either the pinned source release (`mocktail`) or
the current development version (`mocktail-git`) with an AUR helper:
```bash
paru -S mocktail-git
# or
yay -S mocktail-git
```
Use `mocktail` instead of `mocktail-git` to build the pinned release from
source, or install the stable prebuilt package with `paru -S mocktail-bin` or
`yay -S mocktail-bin`.
## Install with DNF
Fedora 44 users can install either the stable `mocktail` package or the
`mocktail-nightly` package built from `main`:
```bash
sudo curl -fsSL https://mocktail.bigrat.space/rpm/mocktail.repo \
-o /etc/yum.repos.d/mocktail.repo
sudo dnf install mocktail
# or
sudo dnf install mocktail-nightly
```
## Install with APT
Ubuntu 26.04 users can install either the stable `mocktail` package or the
`mocktail-nightly` package built from `main`:
```bash
sudo install -d -m 0755 /etc/apt/keyrings
sudo curl -fsSL https://mocktail.bigrat.space/mocktail-packages.gpg \
-o /etc/apt/keyrings/mocktail.gpg
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/mocktail.gpg] https://mocktail.bigrat.space/apt mocktail main" | \
sudo tee /etc/apt/sources.list.d/mocktail.list >/dev/null
sudo apt update
sudo apt install mocktail
# or
sudo apt install mocktail-nightly
```
## Direct downloads
Direct AppImage, DEB, and RPM downloads are available from the
[Website](https://mocktail.bigrat.space/) and
[GitHub Releases](https://github.com/komaruworld/mocktail/releases).
<details>
<summary>Screenshots</summary>
![Roblox home in Nightcap](assets/screenshots/flatpak-home.png)
![Roblox home in Mocktail](assets/screenshots/flatpak-home.png)
![Roblox gameplay in Nightcap](assets/screenshots/flatpak-gameplay-tower.png)
![Roblox gameplay in Mocktail](assets/screenshots/flatpak-gameplay-tower.png)
![Roblox experience in Nightcap](assets/screenshots/flatpak-gameplay-lobby.png)
![Roblox experience in Mocktail](assets/screenshots/flatpak-gameplay-lobby.png)
</details>
## FFlag overrides
Put a JSON object in `$XDG_CONFIG_HOME/mocktail/fflags.json` (usually
`~/.config/mocktail/fflags.json`). Nightcap applies it on the next launch.
`~/.config/mocktail/fflags.json`). Mocktail applies it on the next launch.
PC profiles use the legacy Charts page by default to avoid the blank screen
caused by `Color3` errors in the newer SDUI page. An explicit
@@ -98,20 +118,19 @@ caused by `Color3` errors in the newer SDUI page. An explicit
"DFIntExample": "120"
}
```
## Settings
## FAQ
Edit `~/.config/mocktail/config.yaml`. Useful options:
To see the most Frequently Asked Question go check [FAQ.md](FAQ.md)
- `graphics.frame_rate_limit: display` to unlock FPS to your monitor's rate.
- `graphics.vsync: off` for the lowest lag, at the cost of tearing.
- `graphics.backend: opengl` if Vulkan does not work on your GPU.
## Building
Linux `x86_64` is supported. Experimental FreeBSD 15.1 Linuxulator support has
been tested with an `x86_64` Fedora 44 userspace. On FreeBSD, Nightcap runs
inside Linuxulator; it is not a native FreeBSD binary. Building requires CMake
3.20+, Git, pkg-config, LLD, binutils, a C++17 compiler, SDL 3.4+, SDL3_ttf,
Linux `x86_64` is supported. Linux `aarch64` builds are available, with Roblox
runtime validation still experimental. FreeBSD 15.1 Linuxulator support is
experimental and has been tested with an `x86_64` Fedora 44 userspace. On
FreeBSD, Mocktail runs inside Linuxulator; it is not a native FreeBSD binary.
Building requires CMake 3.20+, Git, pkg-config, LLD, binutils, a C++17
compiler, SDL 3.4+, SDL3_ttf,
Vulkan, EGL, libplacebo, fontconfig, libcurl, OpenSSL, libelf, libyaml, minizip,
Capstone 5, utf8proc, nlohmann/json, GTK4, libadwaita 1.6+, and WebKitGTK 6.0.
@@ -127,7 +146,7 @@ sudo apt install build-essential cmake git ninja-build pkg-config lld \
nlohmann-json3-dev libyaml-dev libelf-dev libminizip-dev \
libcapstone-dev libgtk-4-dev libadwaita-1-dev libwebkitgtk-6.0-dev \
libutf8proc-dev libfontconfig1-dev libegl-dev libvulkan-dev \
libplacebo-dev zlib1g-dev
libplacebo-dev libpng-dev zlib1g-dev
```
</details>
@@ -156,34 +175,17 @@ sudo dnf install gcc-c++ cmake git ninja-build pkgconf-pkg-config lld \
</details>
```bash
git clone --recurse-submodules https://github.com/CoderDayton/nightcap.git
cd nightcap
git clone --recurse-submodules https://github.com/komaruworld/mocktail.git
cd mocktail
make build
./build/mocktail
```
To install it for your user, with an app menu entry and Roblox link handling:
```bash
make install PREFIX=~/.local
```
Use `sudo make install` instead to install system-wide under `/usr`. To make
Roblox website links open the build tree copy without installing, run
`make register-url-handler`.
To run the same checks as CI before each commit and push, install
[lefthook](https://github.com/evilmartians/lefthook) and run once:
```bash
lefthook install
```
## Known limitations
Nightcap does not currently work with `hardened_malloc`. Using
`hardened_malloc` may cause Nightcap to fail to start or crash during runtime.
Run Nightcap without `hardened_malloc` enabled.
Mocktail does not currently work with `hardened_malloc`. Using
`hardened_malloc` may cause Mocktail to fail to start or crash during runtime.
Run Mocktail without `hardened_malloc` enabled.
## License
@@ -191,13 +193,7 @@ Run Nightcap without `hardened_malloc` enabled.
## Support
Support this fork by giving it a star or with cryptocurrency:
- LTC: `LdABR2ELRYrUESWZWrEk1uNx38gHHMuHUU`
- SOL: `tjeDnPoWeyW8zfTf8c5CVAm5QTV8vFPaPouaScAdwfT`
- BCH: `qpktw5jwut9ae8e6898qt3v7rj3km44utgk2r9mj8n`
Support the upstream project, which does most of the heavy lifting:
You can support the project by giving it a star or with cryptocurrency:
- USDT (TON): `UQCi6Yzcc9cOctoij6n_r1K90-OdVxAT0D_xo2UzGKkQaJDY`
- USDT (TRC20): `TNPMG9Vig2xiuo2r1QqnXRChPH7Vu28Jmx`
+1 -2
View File
@@ -1,4 +1,3 @@
# Modified by vii from komaruworld/mocktail. See README "About this fork".
# Copyright 2026 Mocktail Project Authors
# Licensed under the Apache License, Version 2.0.
@@ -13,7 +12,7 @@ find_path(MOCKTAIL_EGL_INCLUDE_DIR EGL/egl.h REQUIRED)
find_path(MOCKTAIL_GLES3_INCLUDE_DIR GLES3/gl3.h REQUIRED)
set(MOCKTAIL_WINDOW_ICON_PNG
"${MOCKTAIL_PLATFORM_GRAPHICS_ROOT}/packaging/icons/hicolor/48x48/apps/io.github.CoderDayton.nightcap.png"
"${MOCKTAIL_PLATFORM_GRAPHICS_ROOT}/packaging/icons/hicolor/48x48/apps/space.bigrat.mocktail.png"
)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
"${MOCKTAIL_WINDOW_ICON_PNG}"
+1 -4
View File
@@ -1,4 +1,3 @@
# Modified by vii from komaruworld/mocktail. See README "About this fork".
# Mocktail configuration.
# The file is created once with mode 0600. Mocktail never replaces your edits.
@@ -47,9 +46,7 @@ graphics:
# display, unlimited, or any positive integer; fixed values are forwarded to
# DFIntTaskSchedulerTargetFps without a whitelist.
# frame_rate_limit: -1
# Optional presentation synchronization override: auto, on, or off. auto
# presents through the lowest-latency synchronized mode the driver offers
# unless frame_rate_limit is unlimited.
# Optional presentation synchronization override: auto, on, or off.
# vsync: off
performance:
+17
View File
@@ -4,6 +4,7 @@
{
"version_name": "2.721.1108",
"version_code": 2350,
"abi": "x86_64",
"elf_build_id": "50e1b0abd123350e794226062fe3a1ef360c5f0d",
"status": "legacy-researched",
"default_allowed": false,
@@ -15,6 +16,7 @@
{
"version_name": "2.725.1142",
"version_code": 2546,
"abi": "x86_64",
"elf_build_id": "d0cb1fa0deb3d9161b4cd77530cbcd2e50de3a21",
"status": "supported",
"default_allowed": true,
@@ -35,6 +37,7 @@
{
"version_name": "2.727.1199",
"version_code": 2628,
"abi": "x86_64",
"elf_build_id": "1686400865ae0e408cd7bd67de7a439625c6fd13",
"status": "supported",
"default_allowed": true,
@@ -46,6 +49,7 @@
{
"version_name": "2.734.917",
"version_code": 2908,
"abi": "x86_64",
"elf_build_id": "63c5109637b7d7b2bdb8ed8f858023ff5ef49326",
"status": "supported",
"default_allowed": true,
@@ -66,6 +70,19 @@
{
"version_name": "2.736.1408",
"version_code": 2998,
"abi": "arm64-v8a",
"elf_build_id": "ed2b035768b1513561d0e6ea7f9bbec35b0e60e5",
"status": "supported",
"default_allowed": true,
"allow_legacy_binary_patches": false,
"allow_host_abi_bridges": true,
"allow_host_constructor_replay": true,
"reason": "AArch64 arm64-v8a payload of the same 2.736.1408 release as the verified x86-64 profile; allocator, constructor replay, and pre-JNI bootstrap RVAs were derived by cross-architecture semantic matching."
},
{
"version_name": "2.736.1408",
"version_code": 2998,
"abi": "x86_64",
"elf_build_id": "ade08266c67aee88ec9c1d00902150e1684dad3a",
"status": "supported",
"default_allowed": true,
-85
View File
@@ -1,85 +0,0 @@
# Nightcap roadmap
What Nightcap is working toward, in priority order. Items move to
[Shipped](#shipped) when they land on `main`. Open an issue to propose a
change to this list.
## 1. Settings UI
Nightcap is configured by editing `~/.config/mocktail/config.yaml`. Most
people never open it, so they never find the FPS unlock or the vsync switch.
Goal: a small GTK4 settings window, reachable from the app menu and from a
`--settings` flag, that reads and writes the same `config.yaml`.
- Graphics tab: backend, frame rate limit, vsync, small texture upscale.
- Input tab: raw mouse and controller options (see item 2).
- Advanced tab: FFlag overrides with a plain text editor for `fflags.json`.
- Discord tab: the `discord_rpc` block (see item 3).
- Changes apply on next launch. A restart button restarts Nightcap.
Done when every option in `config/mocktail.example.yaml` that a player would
touch can be set without a text editor.
## 2. Controller and raw mouse input
Upstream added Xbox and PlayStation gamepad support through SDL. Desktop play
still has rough edges.
- Raw mouse input in first-person games, with no acceleration or clamping.
- Better controller support: hot-plug without a restart, correct button
glyphs for the connected pad, and no stuck inputs after a disconnect.
Done when a mouse feels like a mouse and a plugged-in controller just works.
## 3. Discord Rich Presence
Upstream ships Discord RPC, off by default, behind `discord_rpc.enabled`. It
shows the experience name, elapsed time, and a join button when the server is
public.
- Turn it on by default. It never reads a Discord token, so the privacy cost
is only the experience name, which the player already shares in Roblox.
- Show the experience icon as the large image instead of a static logo.
- Show the current server region and player count when Roblox exposes them.
- Make the join button work for private servers the player has a link for.
- A Discord tab in the settings window to toggle each field.
Done when a friend can see what you are playing and join in one click, and
you can switch it all off in one click.
## 4. Performance profiling
Every performance change should come with numbers. Today they come with a
feeling.
- A frame time overlay, toggled by a key and a config flag, showing CPU time,
GPU time, and present latency.
- Shader compile and pipeline cache tracing, so first-load stutter can be
measured and cut.
- A `--profile` flag that writes a trace file readable by Perfetto.
- A short benchmark guide in `docs/` with a fixed set of experiences, so
before and after numbers can be compared across machines.
Done when a pull request that claims a speedup can show the trace that
proves it.
## Shipped
- Lower input latency: frames are presented as soon as they are ready.
- Small textures upscaled 4x by default, with PNG overrides in
`~/.config/mocktail/textures`.
- ETC2 textures decoded on desktop GPUs without stutter.
- No more error 319 kicks after joining a server.
- Roblox sees the real host RAM and screen size.
- Desktop launcher that works on Wayland and finds the installed binary.
- Own app ID `io.github.CoderDayton.nightcap`, so Nightcap installs next to
upstream.
- AppImage and signed Flatpak releases on every `v*` tag, with the Flatpak
repo on GitHub Pages.
## Not planned
- Replacing the `mocktail` binary and config names. Keeping them makes
upstream merges clean.
- DEB, RPM, and AUR packages. Upstream ships those for unmodified Mocktail.
+30
View File
@@ -33,6 +33,23 @@ void SetLegacyBionicDiagnosticsEnabled(bool enabled);
// guest layout explicit instead of exposing the incompatible host libc type.
using MocktailBionicMutexAttr = int64_t;
// Bionic LP64 pthread_attr_t: 56 bytes with explicit field offsets. The host
// glibc layout is opaque and wider on aarch64, so guest buffers must be read
// and written through this struct only.
struct MocktailBionicPthreadAttr {
std::uint32_t flags;
void* stack_base;
std::size_t stack_size;
std::size_t guard_size;
std::int32_t sched_policy;
std::int32_t sched_priority;
char reserved[16];
};
static_assert(sizeof(MocktailBionicPthreadAttr) == 56);
inline constexpr std::uint32_t kMocktailBionicAttrFlagDetached = 0x1;
inline constexpr std::uint32_t kMocktailBionicAttrFlagUserStack = 0x2;
extern "C" {
void mocktail_set_current_jni_env(void* env);
@@ -84,6 +101,19 @@ int mocktail_pthread_barrier_init(pthread_barrier_t* barrier,
int mocktail_pthread_barrier_destroy(pthread_barrier_t* barrier);
int mocktail_pthread_barrier_wait(pthread_barrier_t* barrier);
int mocktail_pthread_attr_init(MocktailBionicPthreadAttr* attr);
int mocktail_pthread_attr_destroy(MocktailBionicPthreadAttr* attr);
int mocktail_pthread_attr_setstacksize(MocktailBionicPthreadAttr* attr,
size_t stack_size);
int mocktail_pthread_attr_setdetachstate(MocktailBionicPthreadAttr* attr,
int detach_state);
int mocktail_pthread_attr_setschedparam(MocktailBionicPthreadAttr* attr,
const struct sched_param* parameters);
int mocktail_pthread_getattr_np(pthread_t thread,
MocktailBionicPthreadAttr* attr);
int mocktail_pthread_attr_getstack(const MocktailBionicPthreadAttr* attr,
void** stack_base, size_t* stack_size);
extern void* mocktail_gameactivity_on_start_native;
extern void* mocktail_gameactivity_on_resume_native;
extern void* mocktail_gameactivity_on_surface_created_native;
@@ -25,11 +25,12 @@ void ConfigureBionicPthreadThreadInitializer(
} // namespace mocktail::compat
struct MocktailBionicPthreadAttr;
// Rebuilds attributes instead of passing Android pthread_attr_t to glibc.
extern "C" int mocktail_bionic_pthread_create(pthread_t* thread,
const pthread_attr_t* attr,
void* (*start_routine)(void*),
void* argument);
extern "C" int mocktail_bionic_pthread_create(
pthread_t* thread, const MocktailBionicPthreadAttr* attr,
void* (*start_routine)(void*), void* argument);
// Guest real-time scheduling is denied to avoid the host RLIMIT_RTTIME watchdog.
extern "C" int mocktail_bionic_pthread_setschedparam(
+38
View File
@@ -0,0 +1,38 @@
#ifndef MOCKTAIL_COMPAT_GUEST_ABI_H_
#define MOCKTAIL_COMPAT_GUEST_ABI_H_
#include <elf.h>
#include <string_view>
namespace mocktail::compat {
#if defined(__aarch64__)
// Android ABI name as it appears in APK lib/ directories and build metadata.
inline constexpr std::string_view kGuestAbi = "arm64-v8a";
// APK split-config name carrying the guest native libraries.
inline constexpr std::string_view kGuestApkSplitName = "config.arm64_v8a";
// File name the payload store uses for the split APK.
inline constexpr std::string_view kGuestSplitApkFile =
"split_config.arm64_v8a.apk";
// sha256 map key holding the split APK digest in payload metadata.
inline constexpr std::string_view kGuestSplitApkHashKey = "arm64_v8a_split_apk";
// Short CPU label for device metadata and user-facing strings.
inline constexpr std::string_view kGuestCpuName = "aarch64";
inline constexpr int kGuestElfMachine = EM_AARCH64;
#elif defined(__x86_64__)
inline constexpr std::string_view kGuestAbi = "x86_64";
inline constexpr std::string_view kGuestApkSplitName = "config.x86_64";
inline constexpr std::string_view kGuestSplitApkFile = "split_config.x86_64.apk";
inline constexpr std::string_view kGuestSplitApkHashKey = "x86_64_split_apk";
inline constexpr std::string_view kGuestCpuName = "x86_64";
inline constexpr int kGuestElfMachine = EM_X86_64;
#else
#error "mocktail only supports aarch64 and x86_64 hosts"
#endif
// APK zip entry holding the guest libroblox.so.
inline constexpr std::string_view kGuestLibApkEntryPrefix = "lib/";
} // namespace mocktail::compat
#endif // MOCKTAIL_COMPAT_GUEST_ABI_H_
+6
View File
@@ -48,9 +48,15 @@ struct PlatformIdentity {
std::string manufacturer = "Mocktail";
std::string model = "Mocktail Headless";
std::string brand = "Mocktail";
#if defined(__aarch64__)
std::string device_code = "linux-arm64";
std::string device_sku = "mocktail-arm64";
std::string soc_model = "aarch64";
#else
std::string device_code = "linux-x86_64";
std::string device_sku = "mocktail-x86_64";
std::string soc_model = "x86_64";
#endif
};
struct RobloxCredentialView {
@@ -6,6 +6,9 @@
#if defined(__x86_64__)
#include <xmmintrin.h>
#endif
#if defined(__aarch64__)
#include <cstdint>
#endif
namespace mocktail::audio {
@@ -22,16 +25,23 @@ class FmodThreadFloatingPointMode final {
delete;
bool Enable(const char* thread_name) noexcept {
#if defined(__x86_64__)
#if defined(__x86_64__) || defined(__aarch64__)
if (active_ || thread_name == nullptr) return false;
const std::string_view name(thread_name);
if (name != "FMOD mixer thread" && name != "FMOD feeder thread" &&
name != "FMOD Convolution thread" && name != "FMOD Worker Thread") {
return false;
}
#if defined(__x86_64__)
const unsigned int control = _mm_getcsr();
original_mode_ = control & kModeMask;
_mm_setcsr(control | kModeMask);
#else
std::uint64_t control;
__asm__ volatile("mrs %0, fpcr" : "=r"(control));
original_mode_ = control & kModeMask;
__asm__ volatile("msr fpcr, %0" ::"r"(control | kModeMask));
#endif
active_ = true;
return true;
#else
@@ -41,11 +51,18 @@ class FmodThreadFloatingPointMode final {
}
void Restore() noexcept {
#if defined(__x86_64__)
#if defined(__x86_64__) || defined(__aarch64__)
if (active_) {
// Restore only our two bits, preserving rounding, exception masks and
// status flags set by the guest while the thread was attached.
#if defined(__x86_64__)
_mm_setcsr((_mm_getcsr() & ~kModeMask) | original_mode_);
#else
std::uint64_t control;
__asm__ volatile("mrs %0, fpcr" : "=r"(control));
__asm__ volatile("msr fpcr, %0" ::"r"((control & ~kModeMask) |
original_mode_));
#endif
active_ = false;
}
#endif
@@ -56,6 +73,13 @@ class FmodThreadFloatingPointMode final {
static constexpr unsigned int kModeMask = (1U << 15) | (1U << 6);
unsigned int original_mode_ = 0;
bool active_ = false;
#elif defined(__aarch64__)
// FPCR FZ flushes single/double subnormals; FZ16 covers the half-precision
// path used by some voice DSP filters.
static constexpr std::uint64_t kModeMask =
(std::uint64_t{1} << 24) | (std::uint64_t{1} << 19);
std::uint64_t original_mode_ = 0;
bool active_ = false;
#endif
};
+1 -19
View File
@@ -6,9 +6,6 @@
namespace mocktail::graphics {
// ETC2 and EAC block encodings from the OpenGL ES 3.0 / Vulkan core formats.
// sRGB variants share the unorm encoding; the colour space belongs to the
// destination format.
enum class EtcFormat {
kEtc2Rgb8,
kEtc2Rgb8A1,
@@ -19,26 +16,15 @@ enum class EtcFormat {
kEacRg11Signed,
};
// Compressed bytes per 4x4 block.
std::size_t EtcBlockBytes(EtcFormat format);
// Decoded bytes per texel: 4 (RGBA8) for ETC2 formats, 2 per channel
// (16-bit, little-endian) for EAC formats.
std::size_t EtcDecodedTexelBytes(EtcFormat format);
// Decodes a width x height image stored as ceil(width/4) x ceil(height/4)
// blocks into row-major texels. Returns false, writing nothing, when a buffer
// is smaller than the image requires.
bool DecodeEtcImage(EtcFormat format, const std::uint8_t* source,
std::size_t source_bytes, std::uint32_t width,
std::uint32_t height, std::uint8_t* destination,
std::size_t destination_bytes);
// Decodes block rows [first_block_row, first_block_row + block_row_count) of
// the image DecodeEtcImage describes, writing only the texel rows those blocks
// cover. Bands that together cover every block row produce DecodeEtcImage's
// output. Returns false, writing nothing, when a buffer is too small or the
// rows lie outside the image.
bool DecodeEtcImageBlockRows(EtcFormat format, const std::uint8_t* source,
std::size_t source_bytes, std::uint32_t width,
std::uint32_t height,
@@ -47,7 +33,6 @@ bool DecodeEtcImageBlockRows(EtcFormat format, const std::uint8_t* source,
std::uint8_t* destination,
std::size_t destination_bytes);
// One DecodeEtcImage call. Jobs must not share destination bytes.
struct EtcDecodeJob {
EtcFormat format = EtcFormat::kEtc2Rgb8;
const std::uint8_t* source = nullptr;
@@ -56,13 +41,10 @@ struct EtcDecodeJob {
std::uint32_t height = 0;
std::uint8_t* destination = nullptr;
std::size_t destination_bytes = 0;
// Set to DecodeEtcImage's result.
bool ok = false;
};
// Decodes every job before returning. Large batches are split into block-row
// bands decoded on up to worker_count threads, the caller included; small
// batches decode on the caller only.
// Synchronous; job destination buffers must not overlap.
void DecodeEtcJobs(EtcDecodeJob* jobs, std::size_t count,
unsigned worker_count);
@@ -12,45 +12,32 @@
namespace mocktail::graphics {
// Tightly packed RGBA8 pixels, row-major, top row first.
struct RgbaImage {
std::uint32_t width = 0;
std::uint32_t height = 0;
std::vector<std::uint8_t> pixels;
};
// FNV-1a over the bytes; the texture identity used for dump and override
// file names.
std::uint64_t HashBytes(const std::uint8_t* data, std::size_t size);
// 16 lowercase hex digits.
std::string HashName(std::uint64_t hash);
bool ReadPngRgba(const std::string& path, RgbaImage* image);
bool WritePngRgba(const std::string& path, const RgbaImage& image);
// Writes width x height RGBA8 pixels to destination, each destination pixel
// the average of the source box it covers. Growing repeats source pixels.
void ResampleRgba(const RgbaImage& source, std::uint32_t width,
std::uint32_t height, std::uint8_t* destination);
void ResampleRgba(const std::uint8_t* source, std::uint32_t source_width,
std::uint32_t source_height, std::uint32_t width,
std::uint32_t height, std::uint8_t* destination);
// Replacement textures keyed by the hash of a texture's level-0 compressed
// bytes. An override lives at <override_dir>/<hash>.png. With a dump
// directory, every level-0 texture seen is written once as
// <dump_dir>/<hash>_<width>x<height>.png so the hash can be found.
// Thread-safe.
class TextureOverrides {
public:
TextureOverrides(std::string override_dir, std::string dump_dir);
// MOCKTAIL_TEXTURE_OVERRIDE_DIR and MOCKTAIL_TEXTURE_DUMP_DIR.
static TextureOverrides FromEnvironment();
bool enabled() const { return !override_dir_.empty() || !dump_dir_.empty(); }
bool dumping() const { return !dump_dir_.empty(); }
// Null when no override file exists; lookups are cached either way.
std::shared_ptr<const RgbaImage> Lookup(std::uint64_t hash);
void Dump(std::uint64_t hash, std::uint32_t width, std::uint32_t height,
const std::uint8_t* rgba);
@@ -9,52 +9,27 @@
namespace mocktail::graphics {
// Host format that stores a decoded ETC2/EAC image, with its block encoding.
struct Etc2EmulatedFormat {
VkFormat host_format = VK_FORMAT_UNDEFINED;
EtcFormat etc_format = EtcFormat::kEtc2Rgb8;
};
// Maps an ETC2/EAC Vulkan format to its decoded host format. Returns false for
// every other format.
bool LookupEmulatedEtc2Format(VkFormat format, Etc2EmulatedFormat* out);
// Format features reported for an emulated ETC2/EAC format: the host format's
// sampling and transfer features only, as for a native compressed format.
VkFormatFeatureFlags EmulatedEtc2FormatFeatures(
VkFormatFeatureFlags host_features);
// Staging bytes consumed and decoded bytes produced by one 2D upload region.
// Returns false for an empty extent, a depth other than 1, or no layers.
bool Etc2UploadByteCounts(EtcFormat format, const VkExtent3D& extent,
std::uint32_t layer_count, VkDeviceSize* compressed,
VkDeviceSize* decoded);
// Whether emulated ETC2 is reported to the application as a supported
// feature, from the MOCKTAIL_ADVERTISE_ETC2 value: "0" hides it, anything
// else (or unset) reports it. Hidden ETC2 still decodes ETC2 images the
// application creates; it only steers the application toward other formats.
bool Etc2SupportAdvertised(const char* value);
bool Etc2SupportAdvertised();
// Factor applied to emulated ETC2 colour images no larger than
// kSmallTextureMaxExtent, from the MOCKTAIL_SMALL_TEXTURE_UPSCALE value:
// 1 leaves them alone; 2..8 create them that many times larger and resample
// every upload, so a texture override can carry more detail than the
// original. Unset or non-numeric values use kDefaultSmallTextureUpscale;
// numeric values out of range are clamped.
inline constexpr std::uint32_t kSmallTextureMaxExtent = 64;
inline constexpr std::uint32_t kDefaultSmallTextureUpscale = 4;
std::uint32_t SmallTextureUpscale(const char* value);
// Reports ETC2/EAC support on hosts without native ETC2 (desktop GPUs) and
// stores those textures decoded. Images are created with the host format;
// each staged upload into one is redirected to a host-visible staging buffer
// that is filled by decoding the application's staging bytes when the
// command buffer is submitted. Every submit decodes again, as a native copy
// re-reads its source on each execution.
// Staging buffers live until their command buffer is begun, reset or freed.
// MOCKTAIL_DISABLE_ETC2_EMULATION=1 turns the emulation off.
class VulkanEtc2Emulation final {
public:
VulkanEtc2Emulation();
@@ -62,7 +37,6 @@ class VulkanEtc2Emulation final {
VulkanEtc2Emulation(const VulkanEtc2Emulation&) = delete;
VulkanEtc2Emulation& operator=(const VulkanEtc2Emulation&) = delete;
// True when this physical device lacks native ETC2 and emulation is on.
bool PhysicalDeviceNeedsEmulation(VkPhysicalDevice physical_device,
PFN_vkGetPhysicalDeviceFeatures host);
@@ -111,13 +85,10 @@ class VulkanEtc2Emulation final {
std::uint32_t count,
const VkCommandBuffer* secondaries);
// Decodes every upload recorded into these command buffers and the
// secondary command buffers they execute. Large batches decode on worker
// threads; this returns once every upload is decoded.
// Resubmission must reread the source bytes.
void PrepareSubmit(const VkCommandBuffer* command_buffers,
std::uint32_t count);
// Destroys the staging buffers owned by a command buffer that is no longer
// pending.
// Call only after the command buffer is no longer pending.
void ReleaseCommandBuffer(VkCommandBuffer command_buffer);
struct State;
@@ -1,4 +1,3 @@
// Modified by vii from komaruworld/mocktail. See README "About this fork".
#ifndef MOCKTAIL_PLATFORM_SDL_APPLICATION_METADATA_H_
#define MOCKTAIL_PLATFORM_SDL_APPLICATION_METADATA_H_
@@ -7,9 +6,9 @@
namespace mocktail {
namespace platform {
inline constexpr char kMocktailApplicationName[] = "Nightcap";
inline constexpr char kMocktailApplicationName[] = "Mocktail";
inline constexpr char kMocktailApplicationIdentifier[] =
"io.github.CoderDayton.nightcap";
"space.bigrat.mocktail";
// Configures the stable compositor identity before SDL initializes. The
// identifier matches the installed desktop file and icon name so Wayland and
-5
View File
@@ -6,8 +6,6 @@
namespace mocktail {
namespace runtime {
// Android ActivityManager memory values published through DeviceParams.
// Roblox derives its device RAM tier, and tiered render budgets, from them.
struct DeviceMemoryProfile {
std::int32_t total_memory_mb = 0;
std::int32_t memory_class_mb = 0;
@@ -17,9 +15,6 @@ struct DeviceMemoryProfile {
bool low_ram_device = false;
};
// Hosts with at least 4 GiB report their real total memory as a normal-RAM
// device. Smaller hosts, or an unreadable total (0), keep the 2 GiB low-RAM
// profile.
DeviceMemoryProfile BuildDeviceMemoryProfile(std::uint64_t host_memory_bytes);
} // namespace runtime
+1 -8
View File
@@ -7,22 +7,17 @@
namespace mocktail {
namespace runtime {
// Host display or window size in physical pixels, published to the Android
// guest. Header-only so the JNI VM can use it without link dependencies.
struct DisplaySize {
std::int32_t width = 1920;
std::int32_t height = 1080;
};
// Environment handoffs written after the host window exists, as
// "WIDTHxHEIGHT": the window's display mode and the window's initial pixels.
// Physical pixels; window size is captured at startup.
inline constexpr const char* kDisplaySizeEnvironment =
"MOCKTAIL_DISPLAY_SIZE_INTERNAL";
inline constexpr const char* kWindowSizeEnvironment =
"MOCKTAIL_WINDOW_SIZE_INTERNAL";
// Parses "WIDTHxHEIGHT". A null, malformed or non-positive value, or one that
// does not fit a Java int, yields the 1920x1080 fallback.
inline DisplaySize ParseDisplaySize(const char* value) {
const DisplaySize fallback;
if (value == nullptr) {
@@ -60,8 +55,6 @@ inline DisplaySize ParseDisplaySize(const char* value) {
static_cast<std::int32_t>(parts[1])};
}
// Physical length of a pixel span at the guest's fixed 160 dpi, rounded down
// to whole millimetres.
inline std::int32_t PixelsToMillimetersAt160Dpi(std::int32_t pixels) {
return static_cast<std::int32_t>(static_cast<std::int64_t>(pixels) * 254 /
1600);
+7
View File
@@ -19,6 +19,13 @@ inline constexpr std::size_t kMaximumRobloxLaunchUriBytes = 64 * 1024;
Status ParseRobloxLaunchUri(std::string_view uri,
RobloxExperienceLaunchRequest* request);
// Converts a WebView launchGame command
// ({"functionName":"launchGame","params":{"request":{...}}}) into the same
// contract. Returns kUnsupported for other commands and kInvalidArgument for
// a malformed launchGame request.
Status ParseRobloxWebViewLaunchGame(std::string_view command,
RobloxExperienceLaunchRequest* request);
} // namespace runtime
} // namespace mocktail
+1 -1
View File
@@ -14,7 +14,7 @@ struct ActivePayloadPaths {
std::filesystem::path root;
std::filesystem::path roblox_library;
std::filesystem::path base_apk;
std::filesystem::path x86_64_split_apk;
std::filesystem::path arch_split_apk;
std::filesystem::path assets_content;
std::filesystem::path compatibility_manifest;
std::filesystem::path host_abi_profile;
-23
View File
@@ -1,23 +0,0 @@
# Local git hooks. Install once with: lefthook install
# Mirrors the "Repository contracts" job in .github/workflows/ci.yml.
pre-commit:
parallel: true
commands:
shell-syntax:
glob: "{scripts,tests,packaging}/**/*.sh"
run: for f in {staged_files}; do bash -n "$f" || exit 1; done
json:
glob: "{config,packaging}/**/*.json"
run: for f in {staged_files}; do jq empty "$f" || exit 1; done
desktop-entry:
glob: "*.desktop"
run: desktop-file-validate {staged_files}
pre-push:
commands:
packaging-contracts:
run: >-
bash tests/managed_payload_build_contract_test.sh . &&
bash tests/flatpak_packaging_test.sh . &&
bash tests/native_packaging_test.sh .
@@ -0,0 +1,10 @@
# Allowed reduced aarch64 packages from pkgforge-dev/archlinux-pkgs-debloated.
# The installer verifies the rolling release asset IDs and SHA256 digests.
ffmpeg-mini-aarch64.pkg.tar.zst
gdk-pixbuf2-mini-aarch64.pkg.tar.xz
gtk4-mini-aarch64.pkg.tar.zst
icu-mini-aarch64.pkg.tar.zst
librsvg-mini-aarch64.pkg.tar.zst
libxml2-mini-aarch64.pkg.tar.zst
mesa-mini-aarch64.pkg.tar.zst
opus-mini-aarch64.pkg.tar.zst
-12
View File
@@ -1,12 +0,0 @@
# Modified by vii from komaruworld/mocktail. See README "About this fork".
# pkgforge-dev/archlinux-pkgs-debloated, continuous release, 2026-09-15.
# These assets are rolling. Refresh names/hashes together; do not bypass a
# checksum mismatch. Only the disposable AppImage build container installs them.
eb87771dabc819b318e0ddf94e7ea175a662c1b6fbe748661126c520a0fd4627 ffmpeg-mini-x86_64.pkg.tar.zst
e62d30173cc87d3a717a218610c9291b9f647b29b99ee86a0a591226c39a0728 gdk-pixbuf2-mini-x86_64.pkg.tar.zst
ca18bc00a343650cde3d674135fa482b54faa639017f82792906db8c68ca9fb6 gtk4-mini-x86_64.pkg.tar.zst
8500f31bb0f793d159d58f2e428594baba63f0c1a0276394c5a3f1ac1da422ef icu-mini-x86_64.pkg.tar.zst
3d51ee49d0e49a065971703b3f61b610bd1c307cd5165ec16846d75f3efe4a08 librsvg-mini-x86_64.pkg.tar.zst
fd52222372202ac7d37ff3f6ef0a47b0decee224aab37ac2b24086fb623b8b86 libxml2-mini-x86_64.pkg.tar.zst
da5598b3f8e3a33ba0811c225752466a1abd3821053a19b480410937454feb04 mesa-mini-x86_64.pkg.tar.zst
ca23eed050345d8c3f45a21610f91aecc273569b09d8d6eed574014e2e560d89 opus-mini-x86_64.pkg.tar.zst
+12
View File
@@ -0,0 +1,12 @@
# Allowed reduced packages from pkgforge-dev/archlinux-pkgs-debloated.
# continuous is rolling: the installer snapshots GitHub asset IDs and SHA256
# digests together at build time, and verifies every archive before installation.
# Only the disposable AppImage build container installs these packages.
ffmpeg-mini-x86_64.pkg.tar.zst
gdk-pixbuf2-mini-x86_64.pkg.tar.zst
gtk4-mini-x86_64.pkg.tar.zst
icu-mini-x86_64.pkg.tar.zst
librsvg-mini-x86_64.pkg.tar.zst
libxml2-mini-x86_64.pkg.tar.zst
mesa-mini-x86_64.pkg.tar.zst
opus-mini-x86_64.pkg.tar.zst
+1
View File
@@ -16,6 +16,7 @@ depends=(
'libelf'
'libglvnd'
'libplacebo'
'libpng'
'libutf8proc'
'libyaml'
'minizip'
+1
View File
@@ -17,6 +17,7 @@ pkgbase = mocktail-bin
depends = libelf
depends = libglvnd
depends = libplacebo
depends = libpng
depends = libsoup3
depends = libutf8proc
depends = libyaml
+1
View File
@@ -20,6 +20,7 @@ depends=(
'libelf'
'libglvnd'
'libplacebo'
'libpng'
'libsoup3'
'libutf8proc'
'libyaml'
+1
View File
@@ -24,6 +24,7 @@ pkgbase = mocktail-git
depends = libelf
depends = libglvnd
depends = libplacebo
depends = libpng
depends = libsoup3
depends = libutf8proc
depends = libyaml
+1
View File
@@ -20,6 +20,7 @@ depends=(
'libelf'
'libglvnd'
'libplacebo'
'libpng'
'libsoup3'
'libutf8proc'
'libyaml'
+1
View File
@@ -24,6 +24,7 @@ pkgbase = mocktail
depends = libelf
depends = libglvnd
depends = libplacebo
depends = libpng
depends = libsoup3
depends = libutf8proc
depends = libyaml
+1
View File
@@ -20,6 +20,7 @@ depends=(
'libelf'
'libglvnd'
'libplacebo'
'libpng'
'libsoup3'
'libutf8proc'
'libyaml'
@@ -1,5 +1,5 @@
{
"app-id": "io.github.CoderDayton.nightcap",
"app-id": "space.bigrat.mocktail",
"runtime": "org.gnome.Platform",
"runtime-version": "50",
"sdk": "org.gnome.Sdk",
+8 -8
View File
@@ -1,4 +1,3 @@
<!-- Modified by vii from komaruworld/mocktail. See the top-level README "About this fork". -->
# FreeBSD Linuxulator
FreeBSD Linuxulator support is experimental. I tested it on FreeBSD
@@ -16,7 +15,7 @@ tested source revision is `aadd58dddcbc78f4d5594827b46b5633552b15ce`. Run
the following commands as root.
```sh
fetch -o /root/linuxulator.patch https://raw.githubusercontent.com/CoderDayton/nightcap/main/packaging/freebsd/linuxulator.patch
fetch -o /root/linuxulator.patch https://raw.githubusercontent.com/komaruworld/mocktail/main/packaging/freebsd/linuxulator.patch
cd /usr/src
git apply /root/linuxulator.patch
make -j2 kernel-toolchain
@@ -41,10 +40,11 @@ After reboot, verify the result from the Fedora userspace. It must print
chroot /compat/linux stat -f -c %t /proc
```
## Run Nightcap
## Run Mocktail
You can simply run the Nightcap AppImage from the
[latest release](https://github.com/CoderDayton/nightcap/releases/latest)
You can simply run the Mocktail AppImage from the
[latest release](https://github.com/komaruworld/mocktail/releases/latest) or
[nightly build](https://github.com/komaruworld/mocktail/releases/tag/continuous)
inside the Fedora userspace.
## Audio
@@ -72,11 +72,11 @@ ctl.!default {
EOF
```
Launch Nightcap with the ALSA audio driver.
Launch Mocktail with the ALSA audio driver.
```sh
SDL_AUDIO_DRIVER=alsa ./Nightcap-x86_64.AppImage
SDL_AUDIO_DRIVER=alsa ./Mocktail-x86_64.AppImage
```
Nightcap cannot override this check because Roblox reads `/proc` directly. The
Mocktail cannot override this check because Roblox reads `/proc` directly. The
Linuxulator patch fixes the value before Roblox sees it.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 903 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

@@ -1,13 +0,0 @@
# Modified by vii from komaruworld/mocktail. See README "About this fork".
[Desktop Entry]
Type=Application
Name=Nightcap
GenericName=Roblox Player
Comment=Play Roblox on Linux
Exec=env SDL_VIDEODRIVER=wayland,x11 mocktail %u
Icon=io.github.CoderDayton.nightcap
StartupWMClass=io.github.CoderDayton.nightcap
Categories=Game;
Terminal=false
MimeType=x-scheme-handler/roblox;x-scheme-handler/roblox-player;
X-Mocktail-Managed=true
+2
View File
@@ -23,6 +23,7 @@
elfutils,
libglvnd,
libplacebo,
libpng,
libsoup_3,
libutf8proc,
libyaml,
@@ -92,6 +93,7 @@ stdenv.mkDerivation (finalAttrs: {
elfutils
libglvnd
libplacebo
libpng
libsoup_3
libutf8proc
libyaml
+12
View File
@@ -0,0 +1,12 @@
[Desktop Entry]
Type=Application
Name=Mocktail
GenericName=Roblox Player
Comment=Play Roblox on Linux
Exec=mocktail %u
Icon=space.bigrat.mocktail
StartupWMClass=space.bigrat.mocktail
Categories=Game;
Terminal=false
MimeType=x-scheme-handler/roblox;x-scheme-handler/roblox-player;
X-Mocktail-Managed=true
@@ -1,21 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Modified by vii from komaruworld/mocktail. See README "About this fork". -->
<!-- Copyright 2026 Mocktail Project Authors -->
<!-- SPDX-License-Identifier: CC0-1.0 -->
<component type="desktop-application">
<id>io.github.CoderDayton.nightcap</id>
<name>Nightcap</name>
<id>space.bigrat.mocktail</id>
<name>Mocktail</name>
<summary>Play Roblox on Linux</summary>
<metadata_license>CC0-1.0</metadata_license>
<project_license>Apache-2.0</project_license>
<developer id="io.github.coderdayton">
<name>vii</name>
<developer id="space.bigrat">
<name>Mocktail Project Authors</name>
</developer>
<branding>
<color type="primary" scheme_preference="light">#CEB3EF</color>
<color type="primary" scheme_preference="dark">#2F2A6B</color>
</branding>
<url type="homepage">https://github.com/CoderDayton/nightcap</url>
<url type="homepage">https://github.com/komaruworld/mocktail</url>
<description>
<p>
Sign in to Roblox, browse experiences, and play them on Linux.
@@ -39,7 +38,7 @@
<caption>Play DOORS on Linux</caption>
</screenshot>
</screenshots>
<launchable type="desktop-id">io.github.CoderDayton.nightcap.desktop</launchable>
<launchable type="desktop-id">space.bigrat.mocktail.desktop</launchable>
<content_rating type="oars-1.1">
<content_attribute id="violence-cartoon">moderate</content_attribute>
<content_attribute id="violence-fantasy">moderate</content_attribute>
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Modified by vii from komaruworld/mocktail. See README "About this fork". -->
<!-- Copyright 2026 Mocktail Project Authors -->
<!-- SPDX-License-Identifier: Apache-2.0 -->
<svg xmlns="http://www.w3.org/2000/svg"
@@ -7,7 +6,7 @@
height="512"
viewBox="96 96 320 320"
fill="none">
<title>Nightcap</title>
<title>Mocktail</title>
<mask id="mocktail-mark"
mask-type="alpha"
maskUnits="userSpaceOnUse"
@@ -20,12 +19,12 @@
</mask>
<g mask="url(#mocktail-mark)">
<path d="M461.343 267.246L461.165 265.65L444.708 108.145C444.345 105.047 443.009 102.143 440.894 99.8515C438.769 97.5865 436.001 96.028 432.962 95.3864C429.924 94.7448 426.761 95.051 423.903 96.2637C421.056 97.5364 418.67 99.6554 417.07 102.332L356.5 146L206 108.145L193.521 42.4325C193.5 39.3045 192.493 36.2626 190.644 33.7398C188.774 31.2601 186.189 29.4138 183.237 28.4502C180.285 27.4866 177.108 27.4521 174.135 28.3513C171.161 29.2864 168.555 31.1314 166.685 33.6262L73.5931 161.71L72.6616 163.009C59.2667 181.485 52.2413 203.814 52.6444 226.631C53.0476 249.448 60.8576 271.515 74.8967 289.505L75.0459 289.702L75.453 290.192L142.096 374.97L174.978 417.241L195.02 442.943C197.361 445.962 200.625 448.131 204.315 449.12C208.005 450.109 211.918 449.862 215.455 448.418L245.662 436.181L295.274 416.014L395.981 375.674L396.235 375.562C417.35 366.989 435.112 351.794 446.852 332.262C458.593 312.73 463.678 289.915 461.343 267.246Z"
fill="#2F2A6B"/>
fill="#E24329"/>
<path d="M461.403 267.484L461.225 265.887C433.09 264.216 404.933 268.779 378.766 279.25L234.209 337.935C266.844 379.87 295.27 416.324 295.27 416.324L403.5 418L396.231 375.873C417.371 367.306 435.156 352.105 446.91 332.557C458.664 313.009 463.75 290.172 461.403 267.484Z"
fill="#6C4FD1"/>
fill="#FC6D26"/>
<path d="M142.135 375.279L175.016 417.549L195.058 443.252C197.399 446.271 200.664 448.44 204.354 449.429C208.044 450.418 211.956 450.171 215.493 448.727L245.701 436.489L295.313 416.323C295.313 416.323 266.867 379.774 234.21 337.922C185.002 357.838 142.135 375.279 142.135 375.279Z"
fill="#A78BFA"/>
fill="#FCA326"/>
<path d="M138.341 214.829C120.941 192.647 98.8514 174.589 73.6535 161.948L72.722 163.247C59.3272 181.723 52.3017 204.052 52.7049 226.869C53.1081 249.685 60.918 271.752 74.9572 289.743L75.1064 289.94L41.5 337.851L142.156 375.208C142.156 375.208 184.959 357.839 234.232 337.851L138.341 214.829Z"
fill="#6C4FD1"/>
fill="#FC6D26"/>
</g>
</svg>
+51 -30
View File
@@ -1,5 +1,4 @@
#!/usr/bin/env bash
# Modified by vii from komaruworld/mocktail. See README "About this fork".
# Copyright 2026 Mocktail Project Authors
# SPDX-License-Identifier: Apache-2.0
@@ -7,11 +6,12 @@ set -Eeuo pipefail
umask 022
readonly REPOSITORY="${1:?Flatpak repository path is required}"
readonly BUNDLE="${2:?Flatpak bundle path is required}"
readonly PUBLIC_KEY="${3:?GPG public key path is required}"
readonly OUTPUT="${4:?Pages output path is required}"
readonly BASE_URL="https://coderdayton.github.io/nightcap"
readonly APP_ID="io.github.CoderDayton.nightcap"
readonly X86_64_BUNDLE="${2:?x86_64 Flatpak bundle path is required}"
readonly AARCH64_BUNDLE="${3:?aarch64 Flatpak bundle path is required}"
readonly PUBLIC_KEY="${4:?GPG public key path is required}"
readonly OUTPUT="${5:?Pages output path is required}"
readonly NATIVE_REPOSITORIES="${6:?Native repositories path is required}"
readonly BASE_URL="https://mocktail.bigrat.space"
readonly SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
readonly PROJECT_DIR="$(dirname -- "${SCRIPT_DIR}")"
@@ -19,14 +19,23 @@ readonly PROJECT_DIR="$(dirname -- "${SCRIPT_DIR}")"
printf 'Flatpak repository is missing or unsafe: %s\n' "${REPOSITORY}" >&2
exit 1
}
[[ -f "${BUNDLE}" && ! -L "${BUNDLE}" ]] || {
printf 'Flatpak bundle is missing or unsafe: %s\n' "${BUNDLE}" >&2
exit 1
}
for bundle in "${X86_64_BUNDLE}" "${AARCH64_BUNDLE}"; do
[[ -f "${bundle}" && ! -L "${bundle}" ]] || {
printf 'Flatpak bundle is missing or unsafe: %s\n' "${bundle}" >&2
exit 1
}
done
[[ -s "${PUBLIC_KEY}" && ! -L "${PUBLIC_KEY}" ]] || {
printf 'Flatpak public key is missing or unsafe: %s\n' "${PUBLIC_KEY}" >&2
exit 1
}
[[ -d "${NATIVE_REPOSITORIES}/apt" &&
-d "${NATIVE_REPOSITORIES}/rpm" &&
-d "${NATIVE_REPOSITORIES}/downloads" &&
-s "${NATIVE_REPOSITORIES}/mocktail-packages.gpg" ]] || {
printf 'Native repositories are missing: %s\n' "${NATIVE_REPOSITORIES}" >&2
exit 1
}
[[ ! -e "${OUTPUT}" ]] || {
printf 'Pages output already exists: %s\n' "${OUTPUT}" >&2
exit 1
@@ -34,39 +43,51 @@ readonly PROJECT_DIR="$(dirname -- "${SCRIPT_DIR}")"
mkdir -p -- "${OUTPUT}"
cp -a -- "${REPOSITORY}" "${OUTPUT}/repo"
install -m 0644 -- "${BUNDLE}" "${OUTPUT}/Nightcap-x86_64.flatpak"
install -m 0644 -- "${PUBLIC_KEY}" "${OUTPUT}/nightcap-flatpak.gpg"
install -m 0644 -- "${X86_64_BUNDLE}" "${OUTPUT}/Mocktail-x86_64.flatpak"
install -m 0644 -- "${AARCH64_BUNDLE}" "${OUTPUT}/Mocktail-aarch64.flatpak"
install -m 0644 -- "${PUBLIC_KEY}" "${OUTPUT}/mocktail-flatpak.gpg"
install -m 0644 -- \
"${PROJECT_DIR}/packaging/${APP_ID}.svg" \
"${OUTPUT}/nightcap.svg"
touch -- "${OUTPUT}/.nojekyll"
"${PROJECT_DIR}/packaging/space.bigrat.mocktail.svg" \
"${OUTPUT}/mocktail.svg"
install -m 0644 -- \
"${PROJECT_DIR}/packaging/discord-join.html" \
"${OUTPUT}/join.html"
install -m 0644 -- "${PROJECT_DIR}/site/index.html" "${OUTPUT}/index.html"
install -m 0644 -- "${PROJECT_DIR}/site/styles.css" "${OUTPUT}/styles.css"
install -d -- "${OUTPUT}/packaging"
install -m 0644 -- \
"${PROJECT_DIR}/packaging/space.bigrat.mocktail.svg" \
"${OUTPUT}/packaging/space.bigrat.mocktail.svg"
cp -a -- "${NATIVE_REPOSITORIES}/apt" "${OUTPUT}/apt"
cp -a -- "${NATIVE_REPOSITORIES}/rpm" "${OUTPUT}/rpm"
cp -a -- "${NATIVE_REPOSITORIES}/downloads" "${OUTPUT}/downloads"
install -m 0644 -- \
"${NATIVE_REPOSITORIES}/mocktail-packages.gpg" \
"${OUTPUT}/mocktail-packages.gpg"
readonly GPG_KEY="$(base64 --wrap=0 "${PUBLIC_KEY}")"
cat >"${OUTPUT}/nightcap.flatpakrepo" <<EOF
cat >"${OUTPUT}/mocktail.flatpakrepo" <<EOF
[Flatpak Repo]
Title=Nightcap
Title=Mocktail Nightly
Url=${BASE_URL}/repo/
Homepage=https://github.com/CoderDayton/nightcap
Comment=Nightcap releases
Description=Signed x86_64 release builds of Nightcap
Icon=${BASE_URL}/nightcap.svg
Homepage=https://github.com/komaruworld/mocktail
Comment=Nightly builds of Mocktail
Description=Signed x86_64 and aarch64 nightly builds published from the latest Mocktail main branch
Icon=${BASE_URL}/mocktail.svg
GPGKey=${GPG_KEY}
EOF
cat >"${OUTPUT}/nightcap.flatpakref" <<EOF
cat >"${OUTPUT}/mocktail.flatpakref" <<EOF
[Flatpak Ref]
Title=Nightcap
Name=${APP_ID}
Title=Mocktail Nightly
Name=space.bigrat.mocktail
Branch=stable
Url=${BASE_URL}/repo/
RuntimeRepo=https://dl.flathub.org/repo/flathub.flatpakrepo
Homepage=https://github.com/CoderDayton/nightcap
Comment=Roblox on Linux, tuned for a real PC
Icon=${BASE_URL}/nightcap.svg
Homepage=https://github.com/komaruworld/mocktail
Comment=Nightly build from the latest main branch
Icon=${BASE_URL}/mocktail.svg
GPGKey=${GPG_KEY}
IsRuntime=false
EOF
install -m 0644 -- "${PROJECT_DIR}/site/index.html" "${OUTPUT}/index.html"
install -m 0644 -- "${PROJECT_DIR}/site/styles.css" "${OUTPUT}/styles.css"
+2
View File
@@ -461,6 +461,7 @@ LatestSupportedBootstrapProfile() {
.version_code <= ($remote_version_code | tonumber)) and
.status == "supported" and .default_allowed == true and
.allow_legacy_binary_patches == false and
(.abi // "x86_64") == "x86_64" and
(.version_name | type) == "string" and
(.version_name | length) > 0)] |
group_by(.version_code) |
@@ -495,6 +496,7 @@ SelectSupportedBootstrapFallback() {
bootstrap_source="$(jq -er --argjson version_code "${fallback_version_code}" '
[.sources[]? |
select(.version_code == $version_code and
(.abi // "x86_64") == "x86_64" and
.provider == "uptodown")] |
if length == 1 then .[0].provider else empty end
' "${BOOTSTRAP_SOURCES_PATH}" 2>/dev/null || true)"
+2 -1
View File
@@ -329,6 +329,7 @@ def run_trial(args, max_ctors, skipped_offsets, trial_id):
log_path = args.log_dir / f"trial_{trial_id:03d}_max_{max_ctors}.log"
env = os.environ.copy()
env.update({
"ROBLOX_LIB_PATH": str(args.libroblox),
"MOCKTAIL_RUN_LIBROBLOX_CTORS": "1",
"MOCKTAIL_LIBROBLOX_CTOR_POLICY": args.ctor_policy,
"MOCKTAIL_GRAPHICS_BACKEND": args.graphics_backend,
@@ -500,7 +501,7 @@ def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--project-root", type=Path, default=project_root)
parser.add_argument("--run-script", type=Path,
default=project_root / "scripts" / "run_sober.sh")
default=project_root / "build" / "mocktail")
parser.add_argument("--libroblox", type=Path,
default=project_root / "rbx_bin" / "libroblox.so")
parser.add_argument("--log-dir", type=Path,
+8 -6
View File
@@ -1,5 +1,4 @@
#!/usr/bin/env bash
# Modified by vii from komaruworld/mocktail. See README "About this fork".
# Copyright 2026 Mocktail Project Authors
# SPDX-License-Identifier: Apache-2.0
@@ -9,14 +8,14 @@ readonly SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
readonly PROJECT_ROOT="$(cd -- "${SCRIPT_DIR}/.." && pwd -P)"
BUILD_DIR="${PROJECT_ROOT}/build-flatpak"
MANIFEST="${PROJECT_ROOT}/packaging/flatpak/io.github.CoderDayton.nightcap.json"
MANIFEST="${PROJECT_ROOT}/packaging/flatpak/space.bigrat.mocktail.json"
JOBS="${MOCKTAIL_FLATPAK_JOBS:-4}"
Usage() {
cat <<'EOF'
Usage: scripts/build_flatpak.sh [OPTIONS]
Build and install Mocktail as a per-user x86-64 Flatpak.
Build and install Mocktail as a per-user Flatpak for the host architecture.
Options:
--build-dir DIR Builder output directory (default: build-flatpak).
@@ -93,8 +92,11 @@ done
[[ "${JOBS}" =~ ^[1-9][0-9]*$ && "${JOBS}" -le 256 ]] ||
Die "--jobs must be an integer between 1 and 256"
[[ "$(uname -m)" == x86_64 ]] ||
Die "the Roblox payload and Flatpak manifest currently require x86-64"
HOST_ARCH="$(uname -m)"
case "${HOST_ARCH}" in
x86_64|aarch64) ;;
*) Die "Flatpak builds require an x86_64 or aarch64 Linux host" ;;
esac
command -v flatpak >/dev/null 2>&1 || Die "flatpak is required"
MANIFEST="$(realpath -e -- "${MANIFEST}")" ||
@@ -123,7 +125,7 @@ CleanupStaleBuilderMounts
cd -- "${PROJECT_ROOT}"
exec "${builder[@]}" \
--arch=x86_64 \
--arch="${HOST_ARCH}" \
--jobs="${JOBS}" \
--force-clean \
--install-deps-from=flathub \
+1
View File
@@ -61,6 +61,7 @@ def supported_profiles(catalog: dict) -> list[dict]:
if isinstance(profile, dict)
and profile.get("status") == "supported"
and profile.get("default_allowed") is True
and profile.get("abi", ARCHITECTURE) == ARCHITECTURE
and isinstance(profile.get("version_name"), str)
and isinstance(profile.get("version_code"), int)
]
+2 -3
View File
@@ -1,14 +1,13 @@
#!/usr/bin/env bash
# Modified by vii from komaruworld/mocktail. See README "About this fork".
# Copyright 2026 Mocktail Project Authors
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
readonly project_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
readonly source_icon="${project_root}/packaging/io.github.CoderDayton.nightcap.svg"
readonly source_icon="${project_root}/packaging/space.bigrat.mocktail.svg"
readonly output_root="${project_root}/packaging/icons/hicolor"
readonly icon_name="io.github.CoderDayton.nightcap.png"
readonly icon_name="space.bigrat.mocktail.png"
readonly icon_sizes=(16 22 24 32 36 48 64 72 96 128 192 256 512)
if ! command -v magick >/dev/null 2>&1; then
+125 -30
View File
@@ -4,36 +4,131 @@
set -Eeuo pipefail
# The reduced packages are intentionally limited to the disposable builder.
# Never replace a developer's desktop / graphics packages on the host.
[[ -f /.dockerenv || -f /run/.containerenv ]] || {
printf 'AnyLinux dependency installation requires a disposable container\n' >&2
exit 1
}
[[ "$(id -u)" == 0 ]] || {
printf 'AnyLinux dependency installation requires container root\n' >&2
AnyLinuxDependencyDie() {
printf '[anylinux-dependencies] error: %s\n' "$*" >&2
exit 1
}
readonly ROOT="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
readonly MANIFEST="${ROOT}/packaging/anylinux-dependencies.sha256"
readonly DOWNLOADS="$(mktemp -d "${TMPDIR:-/tmp}/mocktail-debloated.XXXXXX")"
trap 'rm -rf -- "${DOWNLOADS}"' EXIT
readonly BASE_URL=https://github.com/pkgforge-dev/archlinux-pkgs-debloated/releases/download/continuous
declare -a packages=()
while read -r digest filename remainder; do
[[ -n "${digest}" && "${digest}" != \#* ]] || continue
[[ "${digest}" =~ ^[0-9a-f]{64}$ &&
"${filename}" =~ ^[a-z0-9-]+-x86_64\.pkg\.tar\.zst$ &&
-z "${remainder}" ]] || {
printf 'Invalid AnyLinux dependency manifest entry\n' >&2
exit 1
}
curl --fail --location --retry 3 --output "${DOWNLOADS}/${filename}" \
"${BASE_URL}/${filename}"
printf '%s %s\n' "${digest}" "${DOWNLOADS}/${filename}" |
sha256sum --check --strict
packages+=("${DOWNLOADS}/${filename}")
done <"${MANIFEST}"
(( ${#packages[@]} > 0 ))
pacman -U --noconfirm --needed "${packages[@]}"
AnyLinuxDependencyRequireContainer() {
# Never replace a developer's desktop / graphics packages on the host.
[[ -f /.dockerenv || -f /run/.containerenv ]] ||
AnyLinuxDependencyDie 'installation requires a disposable container'
[[ "$(id -u)" == 0 ]] ||
AnyLinuxDependencyDie 'installation requires container root'
}
AnyLinuxDependencySnapshot() {
local manifest="$1" release="$2" host_arch="${3:-$(uname -m)}"
local filename remainder names_json
[[ "${host_arch}" == x86_64 || "${host_arch}" == aarch64 ]] ||
AnyLinuxDependencyDie 'unsupported AppImage architecture'
local -a names=()
local -A seen=()
while read -r filename remainder || [[ -n "${filename}" ]]; do
[[ -n "${filename}" && "${filename}" != \#* ]] || continue
[[ "${filename}" =~ ^[a-z0-9-]+-mini-${host_arch}\.pkg\.tar\.(zst|xz)$ &&
-z "${remainder}" && -z "${seen[${filename}]:-}" ]] ||
AnyLinuxDependencyDie 'invalid or duplicate dependency manifest entry'
seen["${filename}"]=1
names+=("${filename}")
done <"${manifest}"
(( ${#names[@]} > 0 )) || AnyLinuxDependencyDie 'empty dependency manifest'
names_json="$(printf '%s\n' "${names[@]}" | jq --raw-input --slurp \
'split("\n")[:-1]')"
# continuous assets are replaced on upstream rebuilds. Resolve all required
# names and GitHub-computed digests in one response, then download by asset ID
# rather than by rolling filename. These are per-build integrity checks, not
# immutable version pins. Never accept absent digests or compute our own trust.
jq --exit-status --raw-output --argjson names "${names_json}" \
--arg base 'https://api.github.com/repos/pkgforge-dev/archlinux-pkgs-debloated/releases/assets/' '
(if .tag_name != "continuous" or (.assets | type) != "array" then
error("invalid continuous release metadata")
else .assets end) as $assets |
$names[] as $name |
[$assets[] | select(.name == $name)] as $matches |
if ($matches | length) != 1 then
error("missing or duplicate dependency asset: " + $name)
else $matches[0] end |
if .state != "uploaded" or (.id | type) != "number" or
.id <= 0 or .id != (.id | floor) or
(.digest | type) != "string" then
error("invalid dependency asset metadata: " + $name)
elif (.digest | test("^sha256:[0-9a-f]{64}$") | not) or
.url != ($base + (.id | tostring)) then
error("invalid dependency digest or URL: " + $name)
else
[(.digest | ltrimstr("sha256:")), $name, .url] | @tsv
end
' "${release}" || AnyLinuxDependencyDie 'cannot resolve verified dependency assets'
}
AnyLinuxDownloadDependencies() {
local manifest="$1" downloads="$2" attempt digest filename url failed
local -a curl_options=(
--fail --silent --show-error --location --retry 3
--proto '=https' --proto-redir '=https'
--connect-timeout 15 --max-time 180
--header 'X-GitHub-Api-Version: 2022-11-28'
)
if [[ -n "${GH_TOKEN:-}" ]]; then
curl_options+=(--header "Authorization: Bearer ${GH_TOKEN}")
fi
for attempt in 1 2 3; do
curl "${curl_options[@]}" --header 'Accept: application/vnd.github+json' \
--output "${downloads}/release.json" \
https://api.github.com/repos/pkgforge-dev/archlinux-pkgs-debloated/releases/tags/continuous ||
AnyLinuxDependencyDie 'cannot fetch upstream release metadata'
AnyLinuxDependencySnapshot "${manifest}" "${downloads}/release.json" \
>"${downloads}/dependencies.tsv"
: >"${downloads}/SHA256SUMS"
failed=false
while IFS=$'\t' read -r digest filename url; do
printf '[anylinux-dependencies] downloading %s (SHA256 %s)\n' \
"${filename}" "${digest}" >&2
if ! curl "${curl_options[@]}" --header 'Accept: application/octet-stream' \
--output "${downloads}/${filename}" "${url}"; then
failed=true
break
fi
printf '%s %s\n' "${digest}" "${filename}" >>"${downloads}/SHA256SUMS"
done <"${downloads}/dependencies.tsv"
if [[ "${failed}" == true ]]; then
# An upstream upload can delete an ID between resolution and download.
# Retry a complete snapshot, never mix old checksums with new filenames.
printf '[anylinux-dependencies] download failed; refreshing snapshot (%s/3)\n' \
"${attempt}" >&2
continue
fi
(cd -- "${downloads}" && sha256sum --check --strict SHA256SUMS) ||
AnyLinuxDependencyDie 'dependency checksum verification failed'
return 0
done
AnyLinuxDependencyDie 'dependency downloads failed after 3 snapshots'
}
AnyLinuxDependenciesMain() (
AnyLinuxDependencyRequireContainer
(( $# == 0 )) || AnyLinuxDependencyDie 'no arguments are supported'
readonly ROOT="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
local host_arch="$(uname -m)" manifest_name
case "${host_arch}" in
x86_64) manifest_name=anylinux-dependencies.txt ;;
aarch64) manifest_name=anylinux-dependencies-aarch64.txt ;;
*) AnyLinuxDependencyDie "unsupported AppImage architecture: ${host_arch}" ;;
esac
readonly MANIFEST="${ROOT}/packaging/${manifest_name}"
readonly DOWNLOADS="$(mktemp -d "${TMPDIR:-/tmp}/mocktail-debloated.XXXXXX")"
trap 'rm -rf -- "${DOWNLOADS}"' EXIT
AnyLinuxDownloadDependencies "${MANIFEST}" "${DOWNLOADS}"
local digest filename url
local -a packages=()
while IFS=$'\t' read -r digest filename url; do
packages+=("${DOWNLOADS}/${filename}")
done <"${DOWNLOADS}/dependencies.tsv"
pacman -U --noconfirm --needed "${packages[@]}"
)
if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
AnyLinuxDependenciesMain "$@"
fi
+3
View File
@@ -119,6 +119,7 @@ libyaml
fontconfig
minizip
libplacebo
libpng
util-linux'
INSTALL_ARGS='-S --needed --noconfirm'
;;
@@ -144,6 +145,7 @@ libyaml
fontconfig
minizip
libplacebo
libpng
util-linux'
if HostUsesMusl; then
PACKAGES="$PACKAGES gcompat"
@@ -172,6 +174,7 @@ libyaml
fontconfig
minizip
libplacebo
libpng
coreutils
findutils
util-linux'
+2 -3
View File
@@ -1,5 +1,4 @@
#!/usr/bin/env bash
# Modified by vii from komaruworld/mocktail. See README "About this fork".
# Copyright 2026 Mocktail Project Authors
# SPDX-License-Identifier: Apache-2.0
@@ -153,8 +152,8 @@ AnyLinuxDeploy() {
local -a deployment_environment=(
"APPDIR=${app_dir}" "MAIN_BIN=mocktail" "LIB_DIR=/usr/lib"
"TMPDIR=${ANYLINUX_WORK}/tmp"
"DESKTOP=/usr/share/applications/io.github.CoderDayton.nightcap.desktop"
"ICON=/usr/share/icons/hicolor/scalable/apps/io.github.CoderDayton.nightcap.svg"
"DESKTOP=/usr/share/applications/space.bigrat.mocktail.desktop"
"ICON=/usr/share/icons/hicolor/scalable/apps/space.bigrat.mocktail.svg"
"DEPLOY_DATADIR=0" "DEPLOY_LOCALE=0" "DEPLOY_VULKAN=0"
"STRACE_MODE=1" "STRACE_BINARY=mocktail" "STRACE_FLAGS=--help"
"STRACE_TIME=1"
+10 -11
View File
@@ -1,5 +1,4 @@
#!/usr/bin/env bash
# Modified by vii from komaruworld/mocktail. See README "About this fork".
# Copyright 2026 Mocktail Project Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -921,25 +920,25 @@ BuildAppImage() {
ln -s "share/mocktail-bundle/run.sh" "${APPDIR}/usr/mocktail"
install -m 0755 -- "${PROJECT_ROOT}/packaging/AppRun" "${APPDIR}/AppRun"
install -m 0644 -- \
"${PROJECT_ROOT}/packaging/io.github.CoderDayton.nightcap.desktop" \
"${APPDIR}/io.github.CoderDayton.nightcap.desktop"
"${PROJECT_ROOT}/packaging/space.bigrat.mocktail.desktop" \
"${APPDIR}/space.bigrat.mocktail.desktop"
install -m 0644 -- \
"${PROJECT_ROOT}/packaging/io.github.CoderDayton.nightcap.desktop" \
"${APPDIR}/usr/share/applications/io.github.CoderDayton.nightcap.desktop"
"${PROJECT_ROOT}/packaging/space.bigrat.mocktail.desktop" \
"${APPDIR}/usr/share/applications/space.bigrat.mocktail.desktop"
install -m 0644 -- \
"${PROJECT_ROOT}/packaging/io.github.CoderDayton.nightcap.svg" \
"${APPDIR}/io.github.CoderDayton.nightcap.svg"
"${PROJECT_ROOT}/packaging/space.bigrat.mocktail.svg" \
"${APPDIR}/space.bigrat.mocktail.svg"
install -m 0644 -- \
"${PROJECT_ROOT}/packaging/io.github.CoderDayton.nightcap.svg" \
"${APPDIR}/usr/share/icons/hicolor/scalable/apps/io.github.CoderDayton.nightcap.svg"
"${PROJECT_ROOT}/packaging/space.bigrat.mocktail.svg" \
"${APPDIR}/usr/share/icons/hicolor/scalable/apps/space.bigrat.mocktail.svg"
for icon_path in \
"${PROJECT_ROOT}"/packaging/icons/hicolor/*x*/apps/io.github.CoderDayton.nightcap.png; do
"${PROJECT_ROOT}"/packaging/icons/hicolor/*x*/apps/space.bigrat.mocktail.png; do
[[ -f "${icon_path}" ]] || Die "hicolor icon set is incomplete"
icon_relative_path="${icon_path#"${PROJECT_ROOT}/packaging/icons/hicolor/"}"
install -D -m 0644 -- "${icon_path}" \
"${APPDIR}/usr/share/icons/hicolor/${icon_relative_path}"
done
ln -s io.github.CoderDayton.nightcap.svg "${APPDIR}/.DirIcon"
ln -s space.bigrat.mocktail.svg "${APPDIR}/.DirIcon"
mkdir -p -- "$(dirname -- "${APPIMAGE_OUTPUT}")"
ARCH=x86_64 appimagetool "${APPDIR}" "${APPIMAGE_OUTPUT}"
rm -rf -- "${APPDIR}"
+4 -7
View File
@@ -1,12 +1,11 @@
#!/usr/bin/env bash
# Modified by vii from komaruworld/mocktail. See README "About this fork".
# Copyright 2026 Mocktail Project Authors
# SPDX-License-Identifier: Apache-2.0
set -Eeuo pipefail
umask 077
readonly DESKTOP_ID="io.github.CoderDayton.nightcap.desktop"
readonly DESKTOP_ID="space.bigrat.mocktail.desktop"
readonly ROBLOX_SCHEME="x-scheme-handler/roblox"
readonly ROBLOX_PLAYER_SCHEME="x-scheme-handler/roblox-player"
@@ -140,9 +139,8 @@ desktop_source="$(ResolveRegularFile "${desktop_source}" "desktop template")"
[[ "$(grep -Fxc '[Desktop Entry]' "${desktop_source}")" == 1 &&
"$(grep -Fxc 'Type=Application' "${desktop_source}")" == 1 &&
"$(grep -Fxc 'Icon=io.github.CoderDayton.nightcap' "${desktop_source}")" == 1 &&
"$(grep -Fxc 'Exec=env SDL_VIDEODRIVER=wayland,x11 mocktail %u' \
"${desktop_source}")" == 1 &&
"$(grep -Fxc 'Icon=space.bigrat.mocktail' "${desktop_source}")" == 1 &&
"$(grep -Fxc 'Exec=mocktail %u' "${desktop_source}")" == 1 &&
"$(grep -Fxc 'MimeType=x-scheme-handler/roblox;x-scheme-handler/roblox-player;' \
"${desktop_source}")" == 1 &&
"$(grep -Fxc 'X-Mocktail-Managed=true' "${desktop_source}")" == 1 &&
@@ -175,8 +173,7 @@ temporary="$(mktemp "${applications_dir}/.${DESKTOP_ID}.XXXXXX.desktop")"
trap 'rm -f -- "${temporary}"' EXIT
while IFS= read -r line || [[ -n "${line}" ]]; do
if [[ "${line}" == Exec=* ]]; then
printf 'Exec=env SDL_VIDEODRIVER=wayland,x11 %s %%u\n' \
"${mocktail_executable}"
printf 'Exec=%s %%u\n' "${mocktail_executable}"
if [[ -n "${launch_working_directory}" ]]; then
printf 'Path=%s\n' "${launch_working_directory}"
fi
+8 -2
View File
@@ -110,8 +110,14 @@ for elf in "$@"; do
fi
machine="$(LC_ALL=C readelf --file-header "${elf}" 2>/dev/null |
sed -n 's/^[[:space:]]*Machine:[[:space:]]*//p')"
if [[ "${machine}" != *X86-64* ]]; then
printf 'ABI check: %s is not x86-64 (%s)\n' "${elf}" "${machine}" >&2
case "$(uname -m)" in
x86_64) expected_machine='X86-64' ;;
aarch64) expected_machine='AArch64' ;;
*) expected_machine='X86-64' ;;
esac
if [[ "${machine}" != *"${expected_machine}"* ]]; then
printf 'ABI check: %s is not %s (%s)\n' "${elf}" "${expected_machine}" \
"${machine}" >&2
status=1
fi
+60 -34
View File
@@ -1,49 +1,75 @@
<!doctype html>
<!-- Modified by vii from komaruworld/mocktail. See README "About this fork". -->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="dark">
<title>Nightcap for Linux</title>
<link rel="icon" href="nightcap.svg" type="image/svg+xml">
<title>Mocktail for Linux</title>
<link rel="stylesheet" href="styles.css">
</head>
<body><main>
<img src="nightcap.svg" alt="Nightcap logo">
<h1>Nightcap</h1>
<p>Play Roblox on Linux like it was made for your PC. Nightcap is Mocktail, tuned to feel fast and look sharp.</p>
<a class="button" href="https://github.com/CoderDayton/nightcap/releases/latest/download/Nightcap-x86_64.AppImage">Download AppImage</a>
<a class="button secondary" href="nightcap.flatpakref">Install with Flatpak</a>
<img src="../packaging/space.bigrat.mocktail.svg" alt="Mocktail logo">
<h1>Mocktail</h1>
<p>Play Roblox on Linux. Use the stable Flathub release, or try the latest nightly build from main. Nightly Flatpaks are available for x86_64 and aarch64; Roblox runtime support on aarch64 is experimental.</p>
<a class="button" href="https://flathub.org/apps/space.bigrat.mocktail">Stable on Flathub</a>
<a class="button secondary" href="https://mocktail.bigrat.space/mocktail.flatpakref">Nightly build</a>
<div class="commands">
<p>AppImage</p>
<code>chmod +x Nightcap-x86_64.AppImage
./Nightcap-x86_64.AppImage</code>
<p>Flatpak</p>
<code>flatpak install --user https://coderdayton.github.io/nightcap/nightcap.flatpakref
flatpak run io.github.CoderDayton.nightcap</code>
<p>Build from source</p>
<code>git clone --recurse-submodules https://github.com/CoderDayton/nightcap.git
cd nightcap &amp;&amp; make build
./build/mocktail</code>
<p>Stable</p>
<code>flatpak install flathub space.bigrat.mocktail</code>
<p>Nightly</p>
<code>flatpak install --user https://mocktail.bigrat.space/mocktail.flatpakref</code>
</div>
<h2>What's different</h2>
<ul>
<li>Lower input lag. Frames are shown as soon as they are ready.</li>
<li>Sharper textures, with your own PNG overrides if you want them.</li>
<li>ETC2 textures render correctly on desktop GPUs.</li>
<li>No more error 319 kicks after joining a server.</li>
<li>Roblox sees your real RAM and screen size.</li>
</ul>
<h2>Direct downloads</h2>
<p>Prebuilt builds for Linux x86_64.</p>
<p class="links">
<a href="https://github.com/CoderDayton/nightcap/releases/latest/download/Nightcap-x86_64.AppImage">AppImage</a>
<a href="Nightcap-x86_64.flatpak">Flatpak bundle</a>
<a href="nightcap-flatpak.gpg">Signing key</a>
<a href="Mocktail-x86_64.flatpak">x86_64 nightly Flatpak</a>
<a href="Mocktail-aarch64.flatpak">aarch64 nightly Flatpak</a>
</p>
<p><a class="source" href="https://github.com/CoderDayton/nightcap">Source code</a> ·
<a class="source" href="https://github.com/komaruworld/mocktail">Upstream Mocktail</a></p>
<p>Nightcap is an independent community project and is not affiliated with Roblox Corporation.</p>
<h2>AUR packages</h2>
<p>Available from the AUR. Choose one package:</p>
<p class="links">
<a href="https://aur.archlinux.org/packages/mocktail">mocktail</a>
<a href="https://aur.archlinux.org/packages/mocktail-bin">mocktail-bin</a>
<a href="https://aur.archlinux.org/packages/mocktail-git">mocktail-git</a>
</p>
<code>yay -S mocktail
yay -S mocktail-bin
yay -S mocktail-git</code>
<h2>DNF repository</h2>
<p>Stable and nightly packages for Fedora 44. Choose one package.</p>
<code>sudo curl -fsSL https://mocktail.bigrat.space/rpm/mocktail.repo -o /etc/yum.repos.d/mocktail.repo</code>
<div class="commands">
<p>Stable</p>
<code>sudo dnf install mocktail</code>
<p>Nightly</p>
<code>sudo dnf install mocktail-nightly</code>
</div>
<h2>APT repository</h2>
<p>Stable and nightly packages for Ubuntu 26.04. Choose one package.</p>
<code>sudo install -d -m 0755 /etc/apt/keyrings
sudo curl -fsSL https://mocktail.bigrat.space/mocktail-packages.gpg -o /etc/apt/keyrings/mocktail.gpg
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/mocktail.gpg] https://mocktail.bigrat.space/apt mocktail main" | sudo tee /etc/apt/sources.list.d/mocktail.list &gt;/dev/null
sudo apt update</code>
<div class="commands">
<p>Stable</p>
<code>sudo apt install mocktail</code>
<p>Nightly</p>
<code>sudo apt install mocktail-nightly</code>
</div>
<h2>Direct downloads</h2>
<p>Prebuilt Linux packages. DEB and RPM are for x86_64; the nightly AppImage also has an aarch64 build.</p>
<p class="download-label">Stable</p>
<p class="links">
<a href="https://github.com/komaruworld/mocktail/releases/latest/download/Mocktail-x86_64.AppImage">AppImage</a>
<a href="https://mocktail.bigrat.space/downloads/mocktail.deb">DEB</a>
<a href="https://mocktail.bigrat.space/downloads/mocktail.rpm">RPM</a>
</p>
<p class="download-label">Nightly</p>
<p class="links">
<a href="https://github.com/komaruworld/mocktail/releases/download/continuous/mocktail-nightly.AppImage">AppImage (x86_64)</a>
<a href="https://github.com/komaruworld/mocktail/releases/download/continuous/mocktail-nightly-aarch64.AppImage">AppImage (aarch64)</a>
<a href="https://github.com/komaruworld/mocktail/releases/download/continuous/mocktail-nightly.deb">DEB</a>
<a href="https://github.com/komaruworld/mocktail/releases/download/continuous/mocktail-nightly.rpm">RPM</a>
</p>
<p><a class="source" href="https://github.com/komaruworld/mocktail">Source code</a></p>
<p>Mocktail is an independent community project and is not affiliated with Roblox Corporation.</p>
</main></body>
</html>
+11 -17
View File
@@ -1,4 +1,3 @@
/* Modified by vii from komaruworld/mocktail. See README "About this fork". */
:root {
font: 17px/1.55 system-ui, sans-serif;
color-scheme: dark;
@@ -6,8 +5,8 @@
body {
margin: 0;
background: #14122b;
color: #ece8ff;
background: #0d1117;
color: #e6edf3;
}
main {
@@ -31,13 +30,8 @@ h2 {
font-size: 1.15rem;
}
p,
li {
color: #b3aad6;
}
ul {
padding-left: 1.2rem;
p {
color: #9da7b3;
}
a.button {
@@ -45,14 +39,14 @@ a.button {
margin: 16px 8px 16px 0;
padding: 12px 18px;
border-radius: 9px;
background: #6c4fd1;
background: #238636;
color: white;
font-weight: 700;
text-decoration: none;
}
a.secondary {
background: #2f2a6b;
background: #21262d;
}
.commands {
@@ -62,7 +56,7 @@ a.secondary {
.commands p,
.download-label {
margin: 14px 0 5px;
color: #ece8ff;
color: #e6edf3;
font-size: .82rem;
font-weight: 700;
letter-spacing: .04em;
@@ -73,9 +67,9 @@ code {
display: block;
padding: 14px;
overflow-wrap: anywhere;
border: 1px solid #3a3470;
border: 1px solid #30363d;
border-radius: 6px;
background: #1d1a3d;
background: #161b22;
white-space: pre-wrap;
}
@@ -86,9 +80,9 @@ code {
.links a {
display: inline-block;
margin: 0 14px 6px 0;
color: #a78bfa;
color: #e6edf3;
}
a.source {
color: #a78bfa;
color: #e6edf3;
}
+16 -2
View File
@@ -16,6 +16,8 @@
#include <cstdlib>
#include <cstring>
#include "compat/bionic_pthread_create_runtime.h"
#include "compat/guest_abi.h"
#include "compat/http_client_spin_guard.h"
#include "window/window.h"
@@ -31,6 +33,14 @@ const char* EnvironmentOr(const char* name, const char* fallback) {
return value != nullptr && value[0] != '\0' ? value : fallback;
}
const char* GuestAbiPropertyValue() {
#if defined(__aarch64__)
return "arm64-v8a";
#else
return "x86_64";
#endif
}
int CallHostVsnprintf(char* dst, size_t count, const char* format,
va_list args) {
using HostVsnprintf = int (*)(char*, size_t, const char*, va_list);
@@ -173,8 +183,12 @@ int __system_property_get(const char* name, char* value) {
result = "35";
} else if (std::strcmp(name, "ro.build.version.release") == 0) {
result = "15";
} else if (std::strcmp(name, "ro.product.cpu.abi") == 0) {
result = "x86_64";
} else if (std::strcmp(name, "ro.product.cpu.abi") == 0 ||
std::strcmp(name, "ro.product.cpu.abilist") == 0 ||
std::strcmp(name, "ro.product.cpu.abilist64") == 0) {
result = GuestAbiPropertyValue();
} else if (std::strcmp(name, "ro.product.cpu.abilist32") == 0) {
result = "";
} else if (std::strcmp(name, "ro.product.manufacturer") == 0) {
result = EnvironmentOr("MOCKTAIL_DEVICE_MANUFACTURER", "Mocktail");
} else if (std::strcmp(name, "ro.product.model") == 0) {
+167 -71
View File
@@ -1,10 +1,14 @@
#include "compat/bionic_pthread_create_runtime.h"
#include "compat/bionic_abi_exports.h"
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <algorithm>
#include <atomic>
#include <cstring>
#include <limits>
#include <new>
@@ -69,24 +73,28 @@ size_t HostStackSizeForGuest(size_t guest_stack_size) noexcept {
return guest_stack_size;
}
int CopySupportedThreadAttributes(const pthread_attr_t& source,
// Guest pthread_attr_t buffers use the Bionic LP64 layout; they are never a
// host pthread_attr_t, so decode the fixed fields directly.
int GuestDetachState(const MocktailBionicPthreadAttr& source) noexcept {
return (source.flags & kMocktailBionicAttrFlagDetached) != 0
? PTHREAD_CREATE_DETACHED
: PTHREAD_CREATE_JOINABLE;
}
size_t GuestStackSize(const MocktailBionicPthreadAttr& source) noexcept {
return source.stack_size != 0 ? source.stack_size
: kBionicLp64DefaultThreadStackSize;
}
int CopySupportedThreadAttributes(const MocktailBionicPthreadAttr& source,
pthread_attr_t* destination) noexcept {
int detach_state = PTHREAD_CREATE_JOINABLE;
int result = pthread_attr_getdetachstate(&source, &detach_state);
if (result != 0) {
return result;
}
result = pthread_attr_setdetachstate(destination, detach_state);
int result =
pthread_attr_setdetachstate(destination, GuestDetachState(source));
if (result != 0) {
return result;
}
size_t guard_size = 0;
result = pthread_attr_getguardsize(&source, &guard_size);
if (result != 0) {
return result;
}
result = pthread_attr_setguardsize(destination, guard_size);
result = pthread_attr_setguardsize(destination, source.guard_size);
if (result != 0) {
return result;
}
@@ -95,53 +103,38 @@ int CopySupportedThreadAttributes(const pthread_attr_t& source,
// pthread_attr_setstack. Copying pthread_attr_getstack's address is unsafe:
// glibc represents an automatically allocated stack with a synthetic
// address derived from its size.
size_t stack_size = 0;
result = pthread_attr_getstacksize(&source, &stack_size);
if (result != 0) {
return result;
}
result = pthread_attr_setstacksize(destination,
HostStackSizeForGuest(stack_size));
result = pthread_attr_setstacksize(
destination, HostStackSizeForGuest(GuestStackSize(source)));
if (result != 0) {
return result;
}
int inherit_scheduler = PTHREAD_INHERIT_SCHED;
result = pthread_attr_getinheritsched(&source, &inherit_scheduler);
if (result != 0) {
return result;
// Bionic applies the attribute's scheduling policy at creation whenever it
// differs from the normal policy.
if (RejectRealtimeScheduling(source.sched_policy)) {
return EPERM;
}
if (inherit_scheduler == PTHREAD_EXPLICIT_SCHED) {
int scheduler_policy = 0;
sched_param scheduler_parameters{};
result = pthread_attr_getschedpolicy(&source, &scheduler_policy);
if (result == 0) {
result = pthread_attr_getschedparam(&source, &scheduler_parameters);
}
if (result == 0 && RejectRealtimeScheduling(scheduler_policy)) {
return EPERM;
}
if (result == 0) {
result = pthread_attr_setschedpolicy(destination, scheduler_policy);
}
if (result == 0) {
result = pthread_attr_setschedparam(destination, &scheduler_parameters);
}
if (source.sched_policy != SCHED_NORMAL) {
result = pthread_attr_setschedpolicy(destination, source.sched_policy);
if (result != 0) {
return result;
}
sched_param scheduler_parameters{};
scheduler_parameters.sched_priority = source.sched_priority;
result = pthread_attr_setschedparam(destination, &scheduler_parameters);
if (result != 0) {
return result;
}
return pthread_attr_setinheritsched(destination, PTHREAD_EXPLICIT_SCHED);
}
return pthread_attr_setinheritsched(destination, inherit_scheduler);
return pthread_attr_setinheritsched(destination, PTHREAD_INHERIT_SCHED);
}
int CopyRequiredThreadAttributes(const pthread_attr_t& source,
int CopyRequiredThreadAttributes(const MocktailBionicPthreadAttr& source,
pthread_attr_t* destination) noexcept {
int detach_state = PTHREAD_CREATE_JOINABLE;
int result = pthread_attr_getdetachstate(&source, &detach_state);
if (result != 0) {
return result;
}
result = pthread_attr_setdetachstate(destination, detach_state);
int result =
pthread_attr_setdetachstate(destination, GuestDetachState(source));
if (result != 0) {
return result;
}
@@ -149,32 +142,20 @@ int CopyRequiredThreadAttributes(const pthread_attr_t& source,
// The retry must retain an explicitly requested guest stack. Falling back
// to a null/default host attr is unsafe on musl, whose default stack is much
// smaller than Bionic's and can be exhausted by a single libroblox frame.
size_t stack_size = 0;
result = pthread_attr_getstacksize(&source, &stack_size);
if (result != 0) {
return result;
}
return pthread_attr_setstacksize(destination,
HostStackSizeForGuest(stack_size));
return pthread_attr_setstacksize(
destination, HostStackSizeForGuest(GuestStackSize(source)));
}
int ConfigureHostSafeStackFallback(const pthread_attr_t* source,
int ConfigureHostSafeStackFallback(const MocktailBionicPthreadAttr* source,
pthread_attr_t* destination) noexcept {
size_t guest_stack_size = 0;
if (source != nullptr) {
int detach_state = PTHREAD_CREATE_JOINABLE;
int result = pthread_attr_getdetachstate(source, &detach_state);
if (result != 0) {
return result;
}
result = pthread_attr_setdetachstate(destination, detach_state);
if (result != 0) {
return result;
}
result = pthread_attr_getstacksize(source, &guest_stack_size);
int result =
pthread_attr_setdetachstate(destination, GuestDetachState(*source));
if (result != 0) {
return result;
}
guest_stack_size = GuestStackSize(*source);
}
size_t host_default_stack_size = 0;
@@ -207,7 +188,8 @@ void ConfigureBionicPthreadThreadInitializer(
g_thread_initializer.store(initializer, std::memory_order_release);
}
int CreateBionicPthread(pthread_t* thread, const pthread_attr_t* attr,
int CreateBionicPthread(pthread_t* thread,
const MocktailBionicPthreadAttr* attr,
void* (*start_routine)(void*), void* argument) {
if (thread == nullptr || start_routine == nullptr) {
return EINVAL;
@@ -289,10 +271,124 @@ int CreateBionicPthread(pthread_t* thread, const pthread_attr_t* attr,
} // namespace mocktail::compat
extern "C" int mocktail_bionic_pthread_create(pthread_t* thread,
const pthread_attr_t* attr,
void* (*start_routine)(void*),
void* argument) {
extern "C" {
int mocktail_pthread_attr_init(MocktailBionicPthreadAttr* attr) {
if (attr == nullptr) {
return EINVAL;
}
attr->flags = 0;
attr->stack_base = nullptr;
attr->stack_size =
mocktail::compat::kBionicLp64DefaultThreadStackSize;
const long page_size = sysconf(_SC_PAGESIZE);
attr->guard_size = page_size > 0 ? static_cast<size_t>(page_size) : 0;
attr->sched_policy = SCHED_OTHER;
attr->sched_priority = 0;
std::memset(attr->reserved, 0, sizeof(attr->reserved));
return 0;
}
int mocktail_pthread_attr_destroy(MocktailBionicPthreadAttr* attr) {
(void)attr;
return 0;
}
int mocktail_pthread_attr_setstacksize(MocktailBionicPthreadAttr* attr,
size_t stack_size) {
if (attr == nullptr || stack_size < PTHREAD_STACK_MIN) {
return EINVAL;
}
attr->stack_size = stack_size;
attr->flags &= ~kMocktailBionicAttrFlagUserStack;
return 0;
}
int mocktail_pthread_attr_setdetachstate(MocktailBionicPthreadAttr* attr,
int detach_state) {
if (attr == nullptr || (detach_state != PTHREAD_CREATE_DETACHED &&
detach_state != PTHREAD_CREATE_JOINABLE)) {
return EINVAL;
}
if (detach_state == PTHREAD_CREATE_DETACHED) {
attr->flags |= kMocktailBionicAttrFlagDetached;
} else {
attr->flags &= ~kMocktailBionicAttrFlagDetached;
}
return 0;
}
int mocktail_pthread_attr_setschedparam(MocktailBionicPthreadAttr* attr,
const struct sched_param* parameters) {
if (attr == nullptr || parameters == nullptr) {
return EINVAL;
}
attr->sched_priority = parameters->sched_priority;
return 0;
}
int mocktail_pthread_getattr_np(pthread_t thread,
MocktailBionicPthreadAttr* attr) {
if (attr == nullptr) {
return EINVAL;
}
pthread_attr_t host_attr;
int result = pthread_getattr_np(thread, &host_attr);
if (result != 0) {
return result;
}
void* stack_base = nullptr;
size_t stack_size = 0;
result = pthread_attr_getstack(&host_attr, &stack_base, &stack_size);
size_t guard_size = 0;
if (result == 0) {
result = pthread_attr_getguardsize(&host_attr, &guard_size);
}
int detach_state = PTHREAD_CREATE_JOINABLE;
if (result == 0) {
result = pthread_attr_getdetachstate(&host_attr, &detach_state);
}
sched_param parameters{};
int policy = SCHED_OTHER;
if (result == 0) {
result = pthread_getschedparam(thread, &policy, &parameters);
}
pthread_attr_destroy(&host_attr);
if (result != 0) {
return result;
}
attr->flags = detach_state == PTHREAD_CREATE_DETACHED
? kMocktailBionicAttrFlagDetached
: 0;
attr->stack_base = stack_base;
attr->stack_size = stack_size;
attr->guard_size = guard_size;
attr->sched_policy = policy;
attr->sched_priority = parameters.sched_priority;
std::memset(attr->reserved, 0, sizeof(attr->reserved));
return 0;
}
int mocktail_pthread_attr_getstack(const MocktailBionicPthreadAttr* attr,
void** stack_base, size_t* stack_size) {
if (attr == nullptr) {
return EINVAL;
}
if (stack_base != nullptr) {
*stack_base = attr->stack_base;
}
if (stack_size != nullptr) {
*stack_size = attr->stack_size;
}
return 0;
}
} // extern "C"
extern "C" int mocktail_bionic_pthread_create(
pthread_t* thread, const MocktailBionicPthreadAttr* attr,
void* (*start_routine)(void*), void* argument) {
return mocktail::compat::CreateBionicPthread(thread, attr, start_routine,
argument);
}
+11
View File
@@ -39,12 +39,23 @@ bool PatchAbsoluteJump(uintptr_t address, void *target) noexcept {
return false;
}
#if defined(__aarch64__)
// ldr x16, #8 ; br x16 ; .quad target
// x16 is the intra-procedure-call scratch register, free to clobber.
unsigned char patch[] = {
0x50, 0x00, 0x00, 0x58, 0x00, 0x02, 0x1f, 0xd6,
0, 0, 0, 0, 0, 0, 0, 0,
};
const uintptr_t target_address = reinterpret_cast<uintptr_t>(target);
std::memcpy(patch + 8, &target_address, sizeof(target_address));
#else
unsigned char patch[] = {
0x48, 0xb8, // movabs rax, imm64
0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xe0, // jmp rax
};
const uintptr_t target_address = reinterpret_cast<uintptr_t>(target);
std::memcpy(patch + 2, &target_address, sizeof(target_address));
#endif
const uintptr_t page_mask = static_cast<uintptr_t>(page_size) - 1;
const uintptr_t page = address & ~page_mask;
+28
View File
@@ -6,6 +6,34 @@ namespace mocktail::compat {
namespace {
constexpr HostAbiProfile kProfiles[] = {
// Roblox 2.736.1408 arm64-v8a. Every RVA was derived from the AArch64
// payload of the same release as the x86-64 reference above, matched by
// allocator internals, init_array call graphs, and static state layout.
// Constructor policy mirrors x86-64 by semantic role: the pre-init
// entries 0..3 stay skipped, index 4 is mi_process_load (thread init
// checkpoint), index 5 is allocator wiring and index 6 is the lazy clock
// singleton getter, both excluded under host bridges only.
{"ed2b035768b1513561d0e6ea7f9bbec35b0e60e5",
{{{0x1d53840, HostBridgeKind::kAllocate, "small-allocate"},
{0x1d56c34, HostBridgeKind::kUsableSize, "usable-size"},
{0x1d6ef80, HostBridgeKind::kReallocate, "reallocate"},
{0x1d53568, HostBridgeKind::kAllocate, "allocate"},
{0x61d3850, HostBridgeKind::kAlignedAllocate,
"aligned-allocate-direct"},
{0x1d57328, HostBridgeKind::kFree, "free"}}},
6,
{0, 0, 0x7296c88, 0x400, 0x1d53c54, 0x1dc76a0,
0x71d6c90, 0x71d2c40, 0x400000},
{0x1d53568, 0x1d57328},
0x6733128,
3565,
{{{4, 5}, {7, 3565}}},
2,
{{{4, 3565}}},
1,
4,
{0x2132c5c, 0x71d6d30},
HostAllocatorStrategy::kNativeMimalloc},
// Roblox 2.736.1408. Derived from the verified 2908 profile and validated
// by two isolated no-recovery Vulkan canaries and real game sessions.
{"ade08266c67aee88ec9c1d00902150e1684dad3a",
+19 -10
View File
@@ -32,6 +32,7 @@
#include <openssl/evp.h>
#include "compat/elf_build_id.h"
#include "compat/guest_abi.h"
namespace mocktail::compat {
namespace {
@@ -611,19 +612,26 @@ std::unique_ptr<OwnedHostAbiProfile> ParseProfile(const Json& root,
*error = "external host ABI profile has inconsistent constructor policy";
return nullptr;
}
if (owned->profile.init_array_count <= 5 ||
// The verified constructor layout is the same on both guest ABIs: a single
// process-load constructor at the thread-initializer checkpoint, two wiring
// entries excluded under host bridges, and one contiguous native-mimalloc
// replay from the checkpoint to the end of .init_array. Only the checkpoint
// index itself differs between payloads.
const std::size_t checkpoint =
owned->profile.native_mimalloc_thread_initializer_after_constructor;
if (owned->profile.init_array_count <= checkpoint + 3 ||
owned->profile.constructor_run_range_count != 2 ||
owned->profile.constructor_run_ranges[0].begin != 2 ||
owned->profile.constructor_run_ranges[0].end_exclusive != 3 ||
owned->profile.constructor_run_ranges[1].begin != 5 ||
owned->profile.constructor_run_ranges[0].begin != checkpoint ||
owned->profile.constructor_run_ranges[0].end_exclusive != checkpoint + 1 ||
owned->profile.constructor_run_ranges[1].begin != checkpoint + 3 ||
owned->profile.constructor_run_ranges[1].end_exclusive !=
owned->profile.init_array_count ||
owned->profile.native_mimalloc_constructor_run_range_count != 1 ||
owned->profile.native_mimalloc_constructor_run_ranges[0].begin != 2 ||
owned->profile.native_mimalloc_constructor_run_ranges[0].begin !=
checkpoint ||
owned->profile.native_mimalloc_constructor_run_ranges[0].end_exclusive !=
owned->profile.init_array_count ||
owned->profile.native_mimalloc_thread_initializer_after_constructor !=
2) {
(kGuestElfMachine == EM_X86_64 && checkpoint != 2)) {
*error =
"external host ABI profile changed the verified constructor policy";
return nullptr;
@@ -669,9 +677,10 @@ bool ValidateProfileAgainstElf(const std::string& payload_path,
}
GElf_Ehdr header{};
if (gelf_getehdr(elf.get(), &header) == nullptr ||
gelf_getclass(elf.get()) != ELFCLASS64 || header.e_machine != EM_X86_64 ||
header.e_type != ET_DYN) {
*error = "payload must be an x86-64 ET_DYN ELF object";
gelf_getclass(elf.get()) != ELFCLASS64 ||
header.e_machine != kGuestElfMachine || header.e_type != ET_DYN) {
*error = "payload must be a " + std::string(kGuestAbi) +
" ET_DYN ELF object";
return false;
}
+2 -6
View File
@@ -1,4 +1,4 @@
// Modified by vii from komaruworld/mocktail. See README "About this fork".
// Includes changes by vii from CoderDayton/nightcap.
// Android Vulkan loader ABI -> host Vulkan loader + SDL3 WSI.
#include <dlfcn.h>
@@ -780,7 +780,6 @@ bool NameInList(const char* name, const char* const* names,
});
}
// Device commands wrapped for ETC2/EAC emulation.
bool IsEtc2DeviceProc(const char* name) {
static constexpr const char* kNames[] = {
"vkCreateImage", "vkDestroyImage",
@@ -798,7 +797,6 @@ bool IsEtc2DeviceProc(const char* name) {
return NameInList(name, kNames, sizeof(kNames) / sizeof(kNames[0]));
}
// Physical-device queries that report emulated ETC2/EAC support.
bool IsEtc2PhysicalDeviceProc(const char* name) {
static constexpr const char* kNames[] = {
"vkGetPhysicalDeviceFeatures",
@@ -1042,7 +1040,6 @@ struct FpsWaitTrace {
std::atomic<std::uint64_t> total_ns{0};
std::atomic<std::uint64_t> max_ns{0};
std::atomic<std::uint64_t> window_start_ns{0};
// Longest time between consecutive call starts; for present, a frame time.
std::atomic<std::uint64_t> max_gap_ns{0};
std::atomic<std::uint64_t> last_start_ns{0};
@@ -1472,8 +1469,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(
host_enabled_features.textureCompressionETC2 = VK_FALSE;
host_info.pEnabledFeatures = &host_enabled_features;
}
// The feature chain is caller-owned; clear the emulated bit only for the
// host call and restore it afterwards.
// Restore the caller-owned feature bit after the host call.
requested_features2 = const_cast<VkPhysicalDeviceFeatures2*>(
reinterpret_cast<const VkPhysicalDeviceFeatures2*>(FindFeature(
create_info->pNext, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2)));
+1 -5
View File
@@ -40,7 +40,7 @@ int Expand5(int value) { return (value << 3) | (value >> 2); }
int Expand6(int value) { return (value << 2) | (value >> 4); }
int Expand7(int value) { return (value << 1) | (value >> 6); }
// Decodes one ETC2 RGB block into 16 column-major RGBA texels (x * 4 + y).
// Texels use column-major indexing: x * 4 + y.
void DecodeRgbBlock(const std::uint8_t* b, bool punchthrough,
std::array<std::uint8_t, 64>* out) {
static constexpr int kDelta[8] = {0, 1, 2, 3, -4, -3, -2, -1};
@@ -159,7 +159,6 @@ void DecodeRgbBlock(const std::uint8_t* b, bool punchthrough,
}
}
// EAC 3-bit index for column-major texel (x * 4 + y).
int EacIndex(const std::uint8_t* b, int texel) {
std::uint64_t bits = 0;
for (int i = 2; i < 8; ++i) {
@@ -213,9 +212,7 @@ std::size_t EtcDecodedTexelBytes(EtcFormat format) {
namespace {
// Blocks per band handed to one worker: about a 256x256 texel image.
constexpr std::uint64_t kBlocksPerBand = 16384;
// Batches smaller than a 1024x1024 texel image decode on the caller.
constexpr std::uint64_t kParallelMinimumBlocks = 65536;
bool ImageFits(EtcFormat format, const std::uint8_t* source,
@@ -315,7 +312,6 @@ void DecodeEtcJobs(EtcDecodeJob* jobs, std::size_t count,
workers.reserve(threads > 0 ? threads - 1 : 0);
for (std::size_t index = 1; index < threads; ++index) {
pthread_t worker;
// The caller decodes whatever workers that failed to start leave behind.
if (pthread_create(&worker, nullptr, RunDecodeBandQueue, &queue) != 0) {
break;
}
+4 -4
View File
@@ -1,4 +1,3 @@
// Modified by vii from komaruworld/mocktail. See README "About this fork".
#include "mocktail/graphics/present_mode_policy.h"
#include <algorithm>
@@ -29,9 +28,10 @@ PresentModePolicy ResolvePresentModePolicy(std::string_view vsync_value,
if (frame_rate_value == "unlimited") {
return PresentModePolicy::kUnthrottled;
}
// Every synchronized target, including the unmanaged Roblox cap, presents
// through the lowest-latency vsync mode the host offers. Roblox's own FIFO
// request queues up to two rendered frames before they reach the display.
if (frame_rate_value.empty() || frame_rate_value == "-1") {
return PresentModePolicy::kHostDefault;
}
// Display or any fixed scheduler target keeps synchronized presentation.
return PresentModePolicy::kVsync;
}
+39 -35
View File
@@ -123,8 +123,6 @@ bool ShouldLog(std::atomic<unsigned>* counter, unsigned limit) {
return counter->fetch_add(1, std::memory_order_relaxed) < limit;
}
// Decode threads for one submit, the submitting thread included. Half the
// host's hardware threads, at most 8, leave cores for the game's own threads.
unsigned DecodeWorkerCount() {
static const unsigned count =
std::min(8U, std::max(1U, std::thread::hardware_concurrency() / 2));
@@ -181,16 +179,10 @@ struct Mapping {
struct ImageRecord {
VkDevice device = VK_NULL_HANDLE;
Etc2EmulatedFormat format;
// Host image dimensions are the application's times this factor.
std::uint32_t scale = 1;
// Application-side level-0 extent; mip extents derive from it.
std::uint32_t width = 0;
std::uint32_t height = 0;
// Replacement pixels chosen from the level-0 upload; smaller mip levels
// are resampled from it.
std::shared_ptr<const RgbaImage> override;
// Decoded level-0 texels of a scaled image; every host mip is resampled
// from them so the texture keeps its detail at every draw size.
std::shared_ptr<const RgbaImage> base;
};
@@ -209,25 +201,23 @@ struct PendingUpload {
VkDevice device = VK_NULL_HANDLE;
VkBuffer source = VK_NULL_HANDLE;
VkDeviceSize source_offset = 0;
VkDeviceSize source_row_stride = 0;
VkDeviceSize source_layer_stride = 0;
VkDeviceSize source_span = 0;
VkDeviceSize compressed = 0;
VkDeviceSize decoded = 0;
VkDeviceSize target_offset = 0;
EtcFormat format = EtcFormat::kEtc2Rgb8;
VkImage image = VK_NULL_HANDLE;
std::uint32_t mip_level = 0;
// Application-side region; `decoded` covers width x height texels.
std::uint32_t width = 0;
std::uint32_t height = 0;
std::uint32_t layers = 0;
std::uint32_t scale = 1;
// Texels of the region inside the application mip (block-rounded
// regions overhang it) and the host region they map to, which takes
// `target_bytes`.
std::uint32_t source_width = 0;
std::uint32_t source_height = 0;
std::uint32_t target_width = 0;
std::uint32_t target_height = 0;
// The region covers the whole application mip.
bool full_mip = false;
VkDeviceSize target_bytes = 0;
std::uint8_t* target = nullptr;
@@ -305,7 +295,6 @@ bool CreateStaging(const HostDevice& dev, VkDeviceSize size, Staging* staging,
return true;
}
// Freeing mapped memory unmaps it implicitly.
void DestroyStaging(const HostDevice& dev, const Staging& staging) {
if (dev.destroy_buffer != nullptr) {
dev.destroy_buffer(dev.device, staging.buffer, nullptr);
@@ -315,10 +304,7 @@ void DestroyStaging(const HostDevice& dev, const Staging& staging) {
}
}
// Maps one axis of an application region at `mip` onto the host image of a
// scaled record. A region reaching the application mip's edge reaches the
// host mip's edge; block-rounded overhang is dropped rather than scaled.
// `texels` receives the application texels inside the mip.
// Clip block padding before scaling to the host mip.
bool ScaledAxis(std::uint32_t base, std::uint32_t scale, std::uint32_t mip,
std::int32_t offset, std::uint32_t extent,
std::uint32_t* texels, std::uint32_t* host_start,
@@ -343,8 +329,6 @@ bool ScaledAxis(std::uint32_t base, std::uint32_t scale, std::uint32_t mip,
return true;
}
// Host-side bounds of an application region on one image; unscaled images
// keep the region as given.
bool HostRegion(const ImageRecord* record, std::uint32_t mip,
VkOffset3D offset, VkExtent3D extent, VkOffset3D* start,
VkOffset3D* end) {
@@ -402,6 +386,23 @@ bool PlanRegions(const ImageRecord& record, VkDevice device, VkBuffer source,
upload.width = region.imageExtent.width;
upload.height = region.imageExtent.height;
upload.layers = region.imageSubresource.layerCount;
const VkDeviceSize row_texels =
region.bufferRowLength != 0 ? region.bufferRowLength : upload.width;
const VkDeviceSize layer_rows =
region.bufferImageHeight != 0 ? region.bufferImageHeight : upload.height;
if (row_texels < upload.width || layer_rows < upload.height) {
return false;
}
const VkDeviceSize block_bytes = EtcBlockBytes(upload.format);
const VkDeviceSize block_rows =
(static_cast<VkDeviceSize>(upload.height) + 3) / 4;
const VkDeviceSize packed_row =
((static_cast<VkDeviceSize>(upload.width) + 3) / 4) * block_bytes;
upload.source_row_stride = ((row_texels + 3) / 4) * block_bytes;
upload.source_layer_stride =
upload.source_row_stride * ((layer_rows + 3) / 4);
upload.source_span = (upload.layers - 1) * upload.source_layer_stride +
(block_rows - 1) * upload.source_row_stride + packed_row;
upload.scale = scale;
upload.source_width = upload.width;
upload.source_height = upload.height;
@@ -465,7 +466,6 @@ struct VulkanEtc2Emulation::State {
std::unordered_map<VkDeviceMemory, Mapping> mappings;
std::unordered_map<VkCommandBuffer, CommandRecord> commands;
std::atomic<bool> has_commands{false};
// Heap buffers reused across submits; they only grow.
std::mutex scratch_mutex;
std::vector<std::uint8_t> scratch_source;
std::vector<std::uint8_t> scratch_decoded;
@@ -473,8 +473,6 @@ struct VulkanEtc2Emulation::State {
const std::uint32_t upscale =
SmallTextureUpscale(std::getenv("MOCKTAIL_SMALL_TEXTURE_UPSCALE"));
// Level-0 colour uploads are hashed, dumped and matched against override
// files; the match is kept on the image so its mip levels follow.
std::shared_ptr<const RgbaImage> FindOverride(const PendingUpload& upload,
const std::uint8_t* compressed,
const std::uint8_t* decoded) {
@@ -502,8 +500,6 @@ struct VulkanEtc2Emulation::State {
return replacement;
}
// Writes the host-side texels of one upload: the override or the decoded
// texels, resampled to the host region size.
void EmitUpload(const PendingUpload& upload, const std::uint8_t* compressed,
const std::uint8_t* decoded) {
const std::shared_ptr<const RgbaImage> replacement =
@@ -999,8 +995,6 @@ void VulkanEtc2Emulation::CmdCopyBufferToImage2(
dev->copy_buffer_to_image2(command_buffer, &host_info);
}
// Copies touching a scaled image become blits, so both sides land on their
// own host bounds. Returns false when no image involved is scaled.
bool VulkanEtc2Emulation::State::BlitScaledCopy(
const HostDevice& dev, VkCommandBuffer command_buffer, VkImage source,
VkImageLayout source_layout, VkImage destination,
@@ -1146,7 +1140,7 @@ void VulkanEtc2Emulation::PrepareSubmit(const VkCommandBuffer* command_buffers,
(mapping->second.size == VK_WHOLE_SIZE ||
(absolute - mapping->second.offset <=
mapping->second.size &&
upload.compressed <= mapping->second.size -
upload.source_span <= mapping->second.size -
(absolute -
mapping->second.offset)))) {
item.source = static_cast<std::uint8_t*>(mapping->second.data) +
@@ -1170,12 +1164,8 @@ void VulkanEtc2Emulation::PrepareSubmit(const VkCommandBuffer* command_buffers,
}
}
}
// Mapped Vulkan memory is uncached or write-combined, which makes the
// decoder's scattered byte reads and writes tens of times slower than on
// heap memory. Compressed bytes are streamed into a heap scratch buffer,
// decoded heap to heap, and the result streamed into the staging buffer.
// Vulkan forbids mapping one memory object twice, so each unmapped source
// memory is mapped once for the whole batch and unmapped after copying.
// Decode in cached RAM; mapped Vulkan memory makes scattered reads slow.
// Map each source allocation once: Vulkan forbids concurrent mappings.
struct TemporaryMapping {
const HostDevice* dev = nullptr;
std::uint8_t* data = nullptr;
@@ -1235,9 +1225,23 @@ void VulkanEtc2Emulation::PrepareSubmit(const VkCommandBuffer* command_buffers,
const PendingUpload& upload = *copied_uploads[index];
std::uint8_t* source = scratch_source.data() + compressed_offset;
std::uint8_t* decoded = scratch_decoded.data() + decoded_offset;
std::memcpy(source, copy.source, copy.compressed);
const VkDeviceSize compressed_layer = upload.compressed / upload.layers;
const VkDeviceSize decoded_layer = upload.decoded / upload.layers;
if (upload.source_span == copy.compressed) {
std::memcpy(source, copy.source, copy.compressed);
} else {
const VkDeviceSize block_rows =
(static_cast<VkDeviceSize>(upload.height) + 3) / 4;
const VkDeviceSize packed_row = compressed_layer / block_rows;
for (std::uint32_t layer = 0; layer < upload.layers; ++layer) {
for (VkDeviceSize row = 0; row < block_rows; ++row) {
std::memcpy(source + layer * compressed_layer + row * packed_row,
copy.source + layer * upload.source_layer_stride +
row * upload.source_row_stride,
packed_row);
}
}
}
for (std::uint32_t layer = 0; layer < upload.layers; ++layer) {
EtcDecodeJob job;
job.format = upload.format;
-25
View File
@@ -1,4 +1,3 @@
// Modified by vii from komaruworld/mocktail. See README "About this fork".
#include "jnivm/jnivm.h"
#include "mocktail/audio/fmod_thread_floating_point.h"
@@ -2500,7 +2499,6 @@ void EnsureAndroidObjectGraph() {
: PlatformIdentity{};
SetIntFieldRaw(configuration, "orientation", 2);
SetIntFieldRaw(configuration, "densityDpi", 160);
// Density is 1.0, so dp equals window pixels.
SetIntFieldRaw(configuration, "screenWidthDp", host_window.width);
SetIntFieldRaw(configuration, "screenHeightDp", host_window.height);
SetIntFieldRaw(configuration, "smallestScreenWidthDp",
@@ -3865,30 +3863,8 @@ jobjectArray MakeObjectArray(jsize len, jobject init) {
return ref;
}
// NativeQuoteInterface.requestResponse([B)[B reply when no Android Keystore
// exists: status byte 1, attestation-available byte 0, then the error text.
// A real device with a keystore answers [1, 1, chain] instead.
jbyteArray MakeQuoteUnavailableResponse() {
static const char kMessage[] =
"java.security.KeyStoreException: AndroidKeyStore is not available";
const std::size_t message_length = sizeof(kMessage) - 1;
jbyteArray result = MakeByteArray(static_cast<jsize>(2 + message_length));
PseudoArray* array = ArrayFromRef(result);
if (array == nullptr || array->bytes.size() != 2 + message_length) {
return nullptr;
}
array->bytes[0] = 1;
array->bytes[1] = 0;
std::memcpy(array->bytes.data() + 2, kMessage, message_length);
return result;
}
jobject StaticObjectResultForMethod(jmethodID method_id) {
const char* name = MethodName(method_id);
if (std::strcmp(name, "requestResponse") == 0 &&
std::strcmp(MethodSignature(method_id), "([B)[B") == 0) {
return MakeQuoteUnavailableResponse();
}
const PlatformIdentity identity = CurrentPlatformIdentity();
jobject android_object = AndroidObjectForMethod(name);
if (android_object) {
@@ -5000,7 +4976,6 @@ jobject CreateAndroidConfiguration(JNIEnv* env) {
SetIntFieldRaw(configuration, "navigation", 1);
SetIntFieldRaw(configuration, "navigationHidden", 1);
SetIntFieldRaw(configuration, "orientation", 2);
// Density is 1.0, so dp equals window pixels.
const mocktail::runtime::DisplaySize config_window =
mocktail::runtime::ParseDisplaySize(
std::getenv(mocktail::runtime::kWindowSizeEnvironment));
+54 -15
View File
@@ -1,4 +1,3 @@
// Modified by vii from komaruworld/mocktail. See README "About this fork".
#include <algorithm>
#include <atomic>
#include <cctype>
@@ -37,7 +36,9 @@
#include <fcntl.h>
#include <unistd.h>
#include <sys/prctl.h>
#if defined(__x86_64__)
#include <asm/prctl.h>
#endif
#include <sys/syscall.h>
#include <vector>
@@ -50,6 +51,7 @@
#include "compat/bionic_socket_runtime.h"
#include "compat/build_profile.h"
#include "compat/elf_build_id.h"
#include "compat/guest_abi.h"
#include "compat/host_abi_experiment.h"
#include "compat/host_abi_profile.h"
#include "compat/host_allocator_bridge.h"
@@ -1007,7 +1009,7 @@ struct BionicAddrInfo {
};
static_assert(sizeof(BionicAddrInfo) == 48,
"unexpected x86_64 bionic addrinfo size");
"unexpected bionic addrinfo size");
bool DnsTraceEnabled() {
return IsEnabled("MOCKTAIL_DNS_TRACE");
@@ -1372,15 +1374,31 @@ bool IsUnsafeSoftTimeoutModule(void* rip) {
void JniOnLoadTimeoutAlarm(int, siginfo_t* info, void* context) {
static_cast<void>(info);
auto* uc = static_cast<ucontext_t*>(context);
#if defined(__x86_64__)
auto rip = uc ? static_cast<uintptr_t>(uc->uc_mcontext.gregs[REG_RIP]) : 0;
auto rsp = uc ? static_cast<uintptr_t>(uc->uc_mcontext.gregs[REG_RSP]) : 0;
auto rbp = uc ? static_cast<uintptr_t>(uc->uc_mcontext.gregs[REG_RBP]) : 0;
auto rax = uc ? static_cast<uintptr_t>(uc->uc_mcontext.gregs[REG_RAX]) : 0;
const char* regs_format =
" [timeout] RIP=0x%016llx RSP=0x%016llx RBP=0x%016llx "
"RAX=0x%016llx\n";
#elif defined(__aarch64__)
auto rip = uc ? static_cast<uintptr_t>(uc->uc_mcontext.pc) : 0;
auto rsp = uc ? static_cast<uintptr_t>(uc->uc_mcontext.sp) : 0;
auto rbp = uc ? static_cast<uintptr_t>(uc->uc_mcontext.regs[29]) : 0;
auto rax = uc ? static_cast<uintptr_t>(uc->uc_mcontext.regs[0]) : 0;
const char* regs_format =
" [timeout] PC=0x%016llx SP=0x%016llx FP=0x%016llx "
"X0=0x%016llx\n";
#else
uintptr_t rip = 0, rsp = 0, rbp = 0, rax = 0;
const char* regs_format =
" [timeout] PC=0x%016llx SP=0x%016llx FP=0x%016llx "
"X0=0x%016llx\n";
#endif
char regs_msg[192];
int len = std::snprintf(
regs_msg, sizeof(regs_msg),
" [timeout] RIP=0x%016llx RSP=0x%016llx RBP=0x%016llx "
"RAX=0x%016llx\n",
regs_msg, sizeof(regs_msg), regs_format,
static_cast<unsigned long long>(rip), static_cast<unsigned long long>(rsp),
static_cast<unsigned long long>(rbp), static_cast<unsigned long long>(rax));
write(2, regs_msg, static_cast<size_t>(len));
@@ -2403,8 +2421,6 @@ mocktail::runtime::DisplaySize HostDisplaySize() {
std::getenv(mocktail::runtime::kDisplaySizeEnvironment));
}
// Live window pixels once the host window exists; the initial window size
// handoff otherwise.
mocktail::runtime::DisplaySize HostWindowPixelSize() {
const mocktail::window::WindowViewportSnapshot viewport =
mocktail::window::GetWindowViewportSnapshot();
@@ -2425,10 +2441,12 @@ jobject BuildDeviceParams(JNIEnv* env) {
GetEnvString("MOCKTAIL_DEVICE_NAME", "Mocktail Linux");
const std::string manufacturer =
GetEnvString("MOCKTAIL_DEVICE_MANUFACTURER", "Mocktail");
const std::string device_sku =
GetEnvString("MOCKTAIL_DEVICE_SKU", "mocktail-x86_64");
const std::string device_sku = GetEnvString(
"MOCKTAIL_DEVICE_SKU",
("mocktail-" + std::string(mocktail::compat::kGuestCpuName)).c_str());
const std::string soc_model =
GetEnvString("MOCKTAIL_DEVICE_SOC_MODEL", "x86_64");
GetEnvString("MOCKTAIL_DEVICE_SOC_MODEL",
std::string(mocktail::compat::kGuestCpuName).c_str());
SetStringField(env, params, "osVersion", "33");
SetStringField(env, params, "deviceName", device_name.c_str());
const std::string app_version =
@@ -2449,8 +2467,6 @@ jobject BuildDeviceParams(JNIEnv* env) {
SetStringField(env, params, "appBuildVariant", "googleProdRelease");
SetStringField(env, params, "testDeviceName", device_name.c_str());
// MOCKTAIL_DISABLE_LOW_RAM_DEVICE forces the normal-RAM profile even when
// the host total cannot be read or is below 4 GiB.
std::uint64_t host_memory_bytes = mocktail::runtime::DetectHostMemoryBytes();
if (IsEnabled("MOCKTAIL_DISABLE_LOW_RAM_DEVICE")) {
host_memory_bytes =
@@ -4626,12 +4642,14 @@ int mocktail::legacy::Run(const runtime::CommandLineOptions& options,
// Roblox internal threads trigger SI_KERNEL traps from CET shadow-stack
// return mismatches. Unsupported kernels ignore this request.
#if defined(__x86_64__)
{
long r = syscall(SYS_arch_prctl, ARCH_SHSTK_DISABLE, ARCH_SHSTK_SHSTK);
if (r == 0) {
std::cout << " [cet] shadow-stack (SHSTK) disabled\n";
}
}
#endif
if (build_profile.allow_legacy_binary_patches) {
std::cerr
@@ -4785,8 +4803,7 @@ int mocktail::legacy::Run(const runtime::CommandLineOptions& options,
const SDL_DisplayMode* mode =
display != 0 ? SDL_GetCurrentDisplayMode(display) : nullptr;
if (mode != nullptr && mode->w > 0 && mode->h > 0) {
// SDL display modes are in desktop units; pixel_density maps them to
// physical pixels.
// SDL mode dimensions need pixel_density to become physical pixels.
const float density = mode->pixel_density > 0.0f ? mode->pixel_density
: 1.0f;
const std::string display_size =
@@ -5551,6 +5568,27 @@ int mocktail::legacy::Run(const runtime::CommandLineOptions& options,
reinterpret_cast<void*>(mocktail_pthread_spin_trylock));
linker::RegisterSymbol("pthread_spin_unlock",
reinterpret_cast<void*>(mocktail_pthread_spin_unlock));
linker::RegisterSymbol(
"pthread_attr_init",
reinterpret_cast<void*>(mocktail_pthread_attr_init));
linker::RegisterSymbol(
"pthread_attr_destroy",
reinterpret_cast<void*>(mocktail_pthread_attr_destroy));
linker::RegisterSymbol(
"pthread_attr_setstacksize",
reinterpret_cast<void*>(mocktail_pthread_attr_setstacksize));
linker::RegisterSymbol(
"pthread_attr_setdetachstate",
reinterpret_cast<void*>(mocktail_pthread_attr_setdetachstate));
linker::RegisterSymbol(
"pthread_attr_setschedparam",
reinterpret_cast<void*>(mocktail_pthread_attr_setschedparam));
linker::RegisterSymbol(
"pthread_getattr_np",
reinterpret_cast<void*>(mocktail_pthread_getattr_np));
linker::RegisterSymbol(
"pthread_attr_getstack",
reinterpret_cast<void*>(mocktail_pthread_attr_getstack));
linker::RegisterSymbol("pthread_barrier_init",
reinterpret_cast<void*>(mocktail_pthread_barrier_init));
linker::RegisterSymbol(
@@ -5670,7 +5708,8 @@ int mocktail::legacy::Run(const runtime::CommandLineOptions& options,
if (roblox_handle == nullptr) {
std::cerr << "\n[FATAL] Could not load '" << library_path << "'.\n"
<< " Extract lib/x86_64/libroblox.so from a Roblox APK and\n"
<< " Extract lib/" << compat::kGuestAbi
<< "/libroblox.so from a Roblox APK and\n"
<< " place it at the path above (or set ROBLOX_LIB_PATH).\n";
return EXIT_FAILURE;
}
+4 -9
View File
@@ -1,7 +1,5 @@
#include "mocktail/platform/sdl_event_converter.h"
#include <SDL3/SDL_mouse.h>
#include <cstdint>
namespace mocktail {
@@ -71,14 +69,11 @@ bool ConvertSdlEvent(SDL_Window* window, const SDL_Event& source,
source.button.x, source.button.y};
return true;
case SDL_EVENT_MOUSE_WHEEL: {
float delta_x = source.wheel.x;
float delta_y = source.wheel.y;
if (source.wheel.direction == SDL_MOUSEWHEEL_FLIPPED) {
delta_x = -delta_x;
delta_y = -delta_y;
}
// SDL already applies the host's natural-scrolling preference to x/y.
// Undoing SDL_MOUSEWHEEL_FLIPPED here would ignore the OS setting.
destination->payload = MouseWheelEvent{
delta_x, delta_y, source.wheel.mouse_x, source.wheel.mouse_y};
source.wheel.x, source.wheel.y, source.wheel.mouse_x,
source.wheel.mouse_y};
return true;
}
case SDL_EVENT_FINGER_DOWN:
+5 -3
View File
@@ -5,6 +5,7 @@
#include <string>
#include <string_view>
#include "compat/guest_abi.h"
#include "runtime/roblox_launch_uri.h"
namespace mocktail {
@@ -241,11 +242,12 @@ std::string CommandLineUsage(const std::string& program_name) {
usage
<< "Usage: " << (program_name.empty() ? "mocktail" : program_name)
<< " [options] [roblox-uri]\n\n"
<< "Normal startup downloads and activates a verified managed x86_64 "
"Roblox payload automatically.\n\n"
<< "Normal startup downloads and activates a verified managed "
<< compat::kGuestAbi
<< " Roblox payload automatically.\n\n"
<< "Options:\n"
<< " --roblox-lib <path> Development override for a specific "
"x86_64 libroblox.so\n"
<< compat::kGuestAbi << " libroblox.so\n"
<< " --headless Run without creating an SDL window\n"
<< " --windowed Force windowed startup (default)\n"
<< " --graphics <backend> direct-vulkan | opengl | system | "
+9 -2
View File
@@ -18,8 +18,6 @@ namespace mocktail {
namespace runtime {
namespace {
// Keep the Vulkan shader workaround narrowly scoped. TextureManager2 is left
// enabled so the runtime can use its normal texture path and mip selection.
constexpr char kVulkanClientSettingsOverrides[] =
R"({"FStringGraphicsVulkanShaderMTDenyPattern":"4318:.*"})";
@@ -29,12 +27,21 @@ constexpr const char* kIcdDirectories[] = {
"/usr/local/share/vulkan/icd.d",
};
#if defined(__aarch64__)
constexpr char kNativeArchitecture[] = "aarch64";
constexpr const char* kForeignArchitectures[] = {
"i686", "i586", "i486", "i386", "x86_64", "x86.",
"amd64", "armhf", "armv7", "ppc64", "riscv64", "s390x",
};
#else
constexpr char kNativeArchitecture[] = "x86_64";
constexpr const char* kForeignArchitectures[] = {
"i686", "i586", "i486", "i386", "x86.", "aarch64",
"arm64", "armhf", "armv7", "ppc64", "riscv64", "s390x",
};
#endif
struct HostGpus {
bool intel = false;
+18 -3
View File
@@ -11,6 +11,7 @@
#include "jnivm/jnivm.h"
#include "runtime/external_launch_broker.h"
#include "runtime/roblox_launch_uri.h"
#include "runtime/webview_helper_launcher.h"
#include "window/window.h"
@@ -951,9 +952,23 @@ Status RobloxExperienceComposition::RouteCurrentWebSurfaceEvent(
route = web_surface_route_;
web_view_bridge = web_view_bridge_.get();
}
return event.type == WebViewHelperEventType::kRobloxCookie
? AcceptWebViewRobloxCookie(event.payload)
: RouteWebSurfaceEvent(route, event, web_view_bridge);
if (event.type == WebViewHelperEventType::kRobloxCookie) {
return AcceptWebViewRobloxCookie(event.payload);
}
if (event.type == WebViewHelperEventType::kExecuteRoblox) {
// Roblox defers a signalled launchGame until the Lua app next navigates.
// A parsed launchGame is launched here and never forwarded, so a deferred
// copy cannot start a second join later.
RobloxExperienceLaunchRequest request;
if (ParseRobloxWebViewLaunchGame(event.payload, &request).ok() &&
Dispatch(request).ok()) {
std::fprintf(stderr,
"[experience] WebView launchGame queued place_id=%lld\n",
static_cast<long long>(request.place_id));
return CloseWebSurface();
}
}
return RouteWebSurfaceEvent(route, event, web_view_bridge);
}
Status RobloxExperienceComposition::DrainPlatformEvents() {
Loaded 100 of 134 files, more files were not shown because too many files have changed in this diff. Show more