Files
DroidDeck/tools/bionic-runtime/tool/proton
T
The412Banner dca443e3aa feat(bionic): DroidDeck-Bionic compatibility tool (Wine on Android's libc, no proot)
DroidDeck-Bionic is a Steam compatibility tool that runs the game itself with
Android's own libc (bionic) instead of glibc inside proot. Steam, the stores and
the session stay on DroidDeck's Linux side unchanged; only the game process
leaves proot. It is listed in the Proton list only when "Run without proot" is
on, and it is shipped as a pre-release runtime pack (DroidDeck-Bionic-12.8-rNN
on Droid-Deck/DroidDeck-Proton), never as the default for other users.

Runtime pack (tools/bionic-runtime, .github/workflows/build-bionic-runtime.yml)
- CI builds an aarch64 bionic pack: the Wine layer from The412Banner/proton-wine
  (bionic build), an exec shim, launcher (tool/launch.sh + proton verbs run,
  runinprefix, waitforexitandrun), gamescope's WSI layer (patches 0117 + 0119),
  DroidDeck's GPU-load layer, fake input (fakeinput_steam.cpp), GStreamer
  plugins, Zink/Fast OpenGL Mesa, DXVK, VKD3D-Proton, D7VK and FEX (ARM64EC).
- Games run on gamescope's X server; Steam store games reach DroidDeck's Steam
  (lsteamclient), Steam Input works (shared /dev/shm via libsteamshm), and
  Steam Cloud maps Windows save folders (tool name contains "Proton").
- DroidDeck's game settings, game-environment fixes, in-game layers and DXVK /
  VKD3D / FEX choices reach bionic games the same way they reach
  DroidDeck-Proton games (DD_* setting names).
- Prefixes stay compatible both ways with DroidDeck-Proton: dead links are
  removed, the tool's .NET stubs and comctl32 v6 survive Wine updates, a stale
  FEX code cache from another FEX build is cleared, drive Z: is the whole device.
- Store launches: Xbox (Windows exe path + Xbox runtime environment), GOG and
  Epic (.bat launchers, games that rename their process).

App changes (all additive)
- ProtonExtras / ProtonMenu / ExperimentalProtons / droiddeck-proton-extra:
  DroidDeck-Bionic pre-releases are checked and listed only with Run without
  proot on, in their own row (not under Experimental); updates replace the
  older build and carry the default tool and per-game picks over; deleting a
  tool removes links inside it, never what they point to.
- ProtonDefault: a default or game pick left on an older bionic build moves to
  the installed one; bionic picks start on DroidDeck-Proton when Run without
  proot is off.
- ComponentsManager / ComponentUpdates / ComponentUpdater / ComponentsPage /
  SessionOverlay: FEX components for DroidDeck-Bionic (bionic-stable on
  DroidDeck-Components); each tool is offered only FEX builds that fit it.
- SessionService: DROIDDECK_DISPLAY_DRIVER tells bionic games which Turnip the
  display uses when the chosen runtime driver has no Android build.
- steam-compatibility: with proot on, a launch sent to a DroidDeck-Bionic tool
  goes to the newest DroidDeck-Proton (picks stay as set); glibc FEX rows are
  never applied to a DroidDeck-Bionic tool.
- droiddeck-game-env: Steam's install-script evaluator is skipped when its
  scripts only run processes already marked as done.

Tests
- New: ComponentsBionicFexTest; extended ComponentsRepublishTest,
  ExperimentalProtonsTest, ProtonDefaultTest, ProtonExtrasTest,
  test_game_environment.py, test_proton_extra.py.

Device testing (Pocket FIT, Adreno 750; Pocket FIT Elite, Adreno 830)
- Steam (Brawlhalla online, Left 4 Dead 2 controller, Black Ops II, Steam
  Cloud), Xbox, GOG, Epic and Amazon games run; saves carry both ways between
  DroidDeck-Bionic and DroidDeck-Proton on Xbox, GOG, Epic and Amazon.
- Not tested: EA, Ubisoft, Battle.net (no owned game / not signed in).
2026-11-22 17:12:43 -05:00

87 lines
3.7 KiB
Bash

#!/bin/bash
# DroidDeck-Bionic: a Steam compatibility tool that runs Windows games on the bionic (Android libc) Proton layer
# under files/, outside the Linux userland. Steam calls it inside DroidDeck's no-proot guest; it turns guest paths
# into Android paths and hands over to bionic/launch.sh, an Android /system/bin/sh script.
# Verbs: run/waitforexitandrun (start the game), runinprefix (run a program in the prefix), getcompatpath/
# getnativepath (path conversion); the rest are accepted and ignored.
set -u
verb=${1:-}
[ $# -gt 0 ] && shift
if [ -z "${DDNATV_ROOT:-}" ]; then
echo "DroidDeck-Bionic needs Settings > Run without proot" >&2
exit 1
fi
# guest path -> Android path: the longest no-proot bind whose guest side starts the path, else inside the rootfs
real() {
local p="$1" best="" host="" b g h
local -a binds
IFS='|' read -r -a binds <<< "${DDNATV_BINDS:-}"
for b in "${binds[@]}"; do
h="${b%%:*}"; g="${b#*:}"
case "$p" in "$g"|"$g"/*) [ ${#g} -gt ${#best} ] && { best="$g"; host="$h"; } ;; esac
done
if [ -n "$best" ]; then echo "$host${p#"$best"}"; return; fi
case "$p" in /data/*|/storage/*|/sdcard/*|/system/*|/apex/*|/vendor/*) echo "$p" ;; *) echo "$DDNATV_ROOT$p" ;; esac
}
here=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
tool=$(real "$here")
compat=$(real "${STEAM_COMPAT_DATA_PATH:-$HOME/.local/share/Steam/steamapps/compatdata/0}")
case "$verb" in
run|waitforexitandrun|runinprefix)
[ $# -gt 0 ] || exit 0
# A Windows path (DroidDeck's Xbox launch names the game on a drive letter of its own) or a bare program name
# (DroidDeck's store steps run cmd.exe, which Wine finds in system32) goes to Wine unchanged.
case "$1" in
[A-Za-z]:[\\/]*) exe=$1 ;;
/*) exe=$(real "$1") ;;
*/*) exe=$(real "$PWD/$1") ;;
*) exe=$1 ;;
esac
shift
export DROIDDECK_BIONIC_ROOT="$DDNATV_ROOT"
# The Xbox runtime's DLC and mount folders come as Z: paths of the guest; this Wine sees the Android side.
zreal() {
local out="" part p
local -a parts
IFS=';' read -r -a parts <<< "$1"
for part in "${parts[@]}"; do
case "$part" in [Zz]:\\*) p=${part:2}; p=$(real "${p//\\//}"); part="Z:${p//\//\\}" ;; esac
out="${out:+$out;}$part"
done
echo "$out"
}
for v in XODUS_MOUNT_ROOT XODUS_CONTENT_ROOTS; do
[ -n "${!v:-}" ] && { printf -v "$v" '%s' "$(zreal "${!v}")"; export "${v?}"; }
done
# The HUD's GPU-load folder is a guest path; the bionic game writes to it by its Android path.
[ -n "${DROIDDECK_GPU_LOAD_DIR:-}" ] && { DROIDDECK_GPU_LOAD_DIR=$(real "$DROIDDECK_GPU_LOAD_DIR"); export DROIDDECK_GPU_LOAD_DIR; }
# DroidDeck's game environment (shared entries and this game's), already applied by droiddeck-game-env: the
# names launch.sh keeps when it drops the rest of the guest environment.
DROIDDECK_BIONIC_KEEP=$(python3 - "${STEAM_COMPAT_DATA_PATH:-}" 2>/dev/null <<'PY'
import json, os, re, sys
try:
config = json.load(open(os.path.expanduser("~/.config/droiddeck/game-environment.json"), encoding="utf-8"))
except (OSError, ValueError):
sys.exit(0)
scope = os.path.basename(sys.argv[1].rstrip("/"))
names = set((config.get("shared") or {}).keys())
if re.fullmatch(r"[1-9][0-9]{0,9}", scope):
names |= set(((config.get("games") or {}).get(scope) or {}).keys())
print(" ".join(sorted(n for n in names if re.fullmatch(r"[A-Za-z_][A-Za-z0-9_]*", n) and n in os.environ)))
PY
)
export DROIDDECK_BIONIC_KEEP
exec /system/bin/sh "$tool/bionic/launch.sh" "$verb" "$compat" "$exe" "$@" ;;
getcompatpath)
p=$(real "${1:-}")
printf 'Z:%s\n' "${p//\//\\}" ;;
getnativepath)
p=${1:-}; p=${p#[Zz]:}; p=${p//\\//}
echo "$p" ;;
*) exit 0 ;;
esac