Files
d2r-mobile/dm/tools/product.sh
T
shenleiandClaude Opus 5.5 4d91f80bae Android port (Adreno): Vulkan backend, GameActivity app, touch HUD, lifecycle, minimap quest goals
- host/android: Vulkan replay backend (nvn_vk.c) with pipeline/descriptor caching, ADPF,
  AChoreographer present link; Linux compat layer; Makefile.android (headless dmhost + APK lib)
- android/app: GameActivity shell without Gradle (build_apk.sh), AAudio output, touch HUD port
  (touch_app.c + TouchOverlay.java, three layers: body / joystick / minimap goals),
  lifecycle save-on-background like iOS, art_from_ipa.py for touch / HUD / mapgoal art
- touch: shared touch controls moved from ios/Sources to dm/touch
- patch_nso.py Android ruleset, dmsh_vk.py shader pack, DM_TOUCH_PRODUCT defaults
- hle_audio: AAudio resume waits through STARTING and reopens once on failure
- .gitignore: local resources/ (original game data) never committed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 14:55:05 +09:00

30 lines
3.0 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 当前改写产物的代号只写在一处:dm/PRODUCT(一行,如 3.3.94012-r28)。换代只改那一行。
# 用法:product.sh name <种类> → 3.3.94012-r28-<种类>(种类:touch / rules / keypage)
# product.sh path <种类> → 本机缺省产物目录 $DM_ROOT/build/cache/dm/out/<name>
# product.sh rev → r28
# product.sh build → 重出三种产物(keypage / rules / touch)到本机缺省目录
# DM_ABI=android(缺省 apple)→ 以上名字 / 目录都带 -android 后缀,改写器出 Linux Bionic 版
# The codename of the current rewrite build output is written in exactly one place: dm/PRODUCT (one line, e.g. 3.3.94012-r28). A revision bump changes only that line.
# Usage: product.sh name <kind> → 3.3.94012-r28-<kind> (kind: touch / rules / keypage)
# product.sh path <kind> → local default build output directory $DM_ROOT/build/cache/dm/out/<name>
# product.sh rev → r28
# product.sh build → rebuild the three kinds of build output (keypage / rules / touch) into the local default directory
# DM_ABI=android (default apple) → the names / directories above get an -android suffix and the rewriter emits the Linux Bionic variant
set -u
P=$(head -1 "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/PRODUCT") || exit 2
[ -n "$P" ] || { echo "dm/PRODUCT 为空" >&2; exit 2; }
case "${DM_ABI:=apple}" in apple) X=;; android) X=-android;; *) echo "未知 DM_ABI=$DM_ABI" >&2; exit 2;; esac; export DM_ABI
case "${1:-}" in
name) echo "$P-${2:?种类}$X";;
path) echo "${DM_ROOT:-$HOME/dm-work}/build/cache/dm/out/$P-${2:?种类}$X";;
rev) echo "${P##*-}";;
build) # 用本工作树的改写器重出三种产物到本机缺省目录(换代 / 改了 patch_nso.py 之后跑)。种类 → 规则集:keypage = 原生;rules = 触屏规则、不带宿主私有门;touch = 触屏规则 + 私有门 | Rebuild the three kinds of build output with this worktree's rewriter into the local default directory (run after a revision bump / after changing patch_nso.py). Kind → rule set: keypage = native; rules = touchscreen rules, without host-private gates; touch = touchscreen rules + private gates
HERE=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd); PY=${DM_PY:-${DM_ROOT:-$HOME/dm-work}/build/cache/dm/venv/bin/python3}; NSO=${DM_NSO_DIR:-${DM_ROOT:-$HOME/dm-work}/data/switch/3.3.94012/Update/ExeFS}
for k in keypage rules touch; do O=${DM_ROOT:-$HOME/dm-work}/build/cache/dm/out/$P-$k$X; mkdir -p "$O"
case $k in keypage) E=(DM_RULESET=native);; rules) E=(DM_RULESET=touch-run-v4 DM_PRIVATE_GATES=0);; touch) E=(DM_RULESET=touch-run-v4);; esac
for m in main sdk subsdk0; do env "${E[@]}" "$PY" "$HERE/patch_nso.py" "$NSO/$m" "$O" "$m" > "$O/$m.patch.log" 2>&1 || { echo "🔴 $k $m 改写失败:$(tail -2 "$O/$m.patch.log")" >&2; exit 1; }; done
echo "$P-$k$X 已出:$(ls "$O" | wc -l | tr -d ' ') 个文件"; done;;
*) echo "用法:product.sh name|path <种类> | rev | build" >&2; exit 2;;
esac