Skip to content

chore: release v0.2.0 - #7

Merged
tkgstrator merged 2 commits into
masterfrom
develop
Jun 25, 2026
Merged

chore: release v0.2.0#7
tkgstrator merged 2 commits into
masterfrom
develop

Conversation

@tkgstrator

@tkgstrator tkgstrator commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Release v0.2.0

developmaster リリース。

Added

  • Account Switching — KIOU公式にはないアカウント切り替え機能。ログインのたびに自動でアカウントを記録し、設定シートから保存済みアカウントへ即時切り替え可能。「新規登録」モードで KIOU の Reset ボタンを経由せず新アカウントを作成。
  • KIOU 1.0.2 サポートTARGET_VERSION 環境変数で v1_0_1 / v1_0_2 を切り替え(既定 1.0.2)。15 個のフック RVA を 1.0.2 の Mach-O に対して再検証済み。

Changed

  • レシピを recipes/common.py + recipes/v1_0_*.py のバージョン分割レイアウトに再構成(KiouEngineBridge と同じ構成)。
  • chinlan の hook slot を 6 → 11 に拡張、アカウント関連フック(5 スロット)を追加。
  • HOOK_SLOT_BASE_RVA をスロット拡張分シフト。
  • README / README.ja に対応バージョン × 機能マトリクスを追加、サポート対象を 1.0.1〜1.0.2 と明記。

Compatibility

  • KIOU 1.0.1 / 1.0.2(Account Switching は 1.0.2 のみ対応)。

Artifacts

  • .deb (JB rootless)、-jailed.dylib (TrollStore)、-chinlan.dylib (Patched IPA build)、SHA256SUMS
  • Patched IPA は配布なし — make ipa DECRYPTED_IPA=... でローカルビルド。

🤖 Generated with Claude Code

* feat: add account switching and multi-version recipe support

Adds account switching ported from KiouEngineBridge: capture every login
via UserSaveDataExtensions.AccountExists + RunLoginSequenceAsync.MoveNext,
persist accounts to NSUserDefaults, and swap LoginArgs.Create deviceId on
demand from the settings sheet. New Register toggle bypasses KIOU's Reset
button by arming a fresh pending_distinct_id + pending_device_id pair.

Restructures recipes/ to match KiouEngineBridge's version-aware layout:
TARGET_VERSION env var selects v1_0_1 or v1_0_2 (default 1.0.2). Cave
builders and slot indices live in recipes/common.py; per-version RVAs in
v1_0_*.py. Both versions verified via tools.verify_sites.

Adds 5 chinlan slots (6..10) for account hooks, bumping KIOU_SLOT_COUNT
to 11 and shifting HOOK_SLOT_BASE_RVA accordingly. Documents the feature
in README / README.ja, marks compatibility as 1.0.1-1.0.2.

bump version to 0.2.0

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs: explain KIOU's lack of official account linking + export/import flow

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* build(makefile): point IPA_RECIPE to recipes.__init__ module

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(recipe): correct cave region address and wire ipa output path

Update CAVE_REGION in v1_0_2 to the correct offset range (0x826F5E8–0x8274000).
Add explicit --output flag to the ipa make target so the patched IPA lands in packages/ipa/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(sites): update hook RVAs for KIOU 1.0.2 build 12

All site and hook RVA constants rebased from build 11 to build 12 across
ChinlanSites, AccountObserve, AfkDisable, AnalysisTune, FrameRate, and KifuObserve.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(chinlan): centralize RVAs in generated ChinlanSites.h and add bypass table

Add a `gen-sites` Makefile target that writes the `@generated` block in
ChinlanSites.h (KIOU_CAVE_REGION_RVA, KIOU_CAVE_ALLOC_*, KIOU_SITE_RVA_*).

Replace scattered hex literals in Hook_*.m with KIOU_SITE_RVA_* macros and
introduce g_kfBypassEntry[], pre-populated by kfPublishAll(), so account hooks
look up their orig-trampolines by alloc index instead of per-hook slot scans.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs: add feature × version matrix and update supported version to 1.0.2

Add a compatibility table showing which features are available per KIOU
build, clarify that account switching requires 1.0.2 hook sites, and
simplify the platform section to reflect 1.0.2 as the latest target.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(sites): update account-switching hook RVAs for 1.0.2 build

Refresh the five hook site addresses (AccountExists, LoginArgs.Create,
RegisterUserArgs.Create, RunLoginSequenceAsync, GetSelfUserProfileAsync)
in both ChinlanSites.h and recipes/v1_0_2.py to match the current binary.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(sites): update account-switching hook RVAs for 1.0.2 build 13

Bump the five account-switching site addresses in ChinlanSites.h and
recipes/v1_0_2.py to match the latest 1.0.2 binary revision.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(devcontainer): remove host network mode from compose config

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* revert(devcontainer): restore host network mode in compose config

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(devcontainer): remove host network mode from compose config

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(recipes): replace slot-index tuples with hook_id_name strings in SITES rows

Introduce `HOOK_IDS` dict and `OBSERVER_AUX` dict in common.py so each SITES
row carries a canonical hook ID name instead of a raw slot index + aux integer.
`payload_for_site` centralises cave-builder dispatch; `build_exports` is
simplified to a list comprehension. Rename `HOOK_SLOT_BASE_RVA` → `HOOK_SLOT_RVA`
throughout, and add a startup assertion that `HOOK_IDS` covers exactly `SLOT_COUNT`
distinct slots.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(sites): drop gen-sites codegen in favour of manual RVA maintenance

Remove the `gen-sites` Makefile target and replace the `@generated` block
markers with `@version` markers that invite hand-editing. ChinlanSites.h is now
maintained directly against recipes/v1_0_2.py instead of being regenerated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(grpc): hook HttpMessageInvoker.SendAsync to swap x-user-id header on account switch

Adds Hook_GrpcLogging to rewrite the x-user-id gRPC request header before
each SendAsync call when a pending device switch is armed, fixing the -40004
server rejection that occurred because LoginArgs sent a new deviceId while
the header still named the previous user.

Also removes account-switching sites from v1_0_1.py (unsupported on that build)
and registers the new CAVE_ENTRY slot (slot 11) in both Chinlan and JB paths.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(chinlan): consolidate dispatcher into ChinlanDispatcher.m and unify install functions

Replace ChinlanEntries.m with ChinlanDispatcher.m. Merge the split
KFInstall*/KFPublish*Slots function pairs in each Hook_*.m into a single
KFInstall*Hook that branches on IPA_CHINLAN internally, removing the
duplicate function-body pattern.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(KiouForge): replace stale comment with `#import "chinlan.h"` in Internal.h

The comment pointing to ChinlanSites.h was outdated; the symbols are now
provided via chinlan.h, so import it directly instead.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(KiouForge): drop Account_Persistence and ChinlanSites after chinlan consolidation

Account persistence logic and the cave/slot table header are no longer
needed as standalone files following the dispatcher consolidation and
manual RVA maintenance switch; remove them and drop the stale import.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(KiouForge): reorganize sources into hook/kif/account subdirs and inline slot table

- Move Hook_*.m → hook/, Helpers.m/Kif_Writer.m → kif/
- Add account/Persistence (ported from KiouEngineBridge) with
  save/list/delete/switch/profile APIs
- Inline chinlan slot enum, RVA constants, and cave-alloc indices into
  Internal.h; drop ChinlanSites.h import

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(KiouForge): replace retry polling with `_dyld_register_func_for_add_image` for Unity hooks

Drop `KFChinlanBootstrap`/`KFChinlanPublished` and the `dispatch_after` retry
loops in favour of a `_dyld_register_func_for_add_image` callback (`kfOnImageAdded`).
The dyld callback fires synchronously for already-loaded images and for every
subsequent `dlopen`, so UnityFramework is hooked exactly once with no polling.
Also adds build-flavor logging (chinlan/jailed/jb) in the constructor.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(KiouForge): move KFInstall* calls from ChinlanDispatcher into installUnityHooks

Hook slots must be published before any KFInstall* runs so that the chinlan
branch of each installer can read g_kfHookSlot. Removing the calls from
KFChinlanPublish and placing them in installUnityHooks enforces that order.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(KiouForge): simplify load log and add version to build info log

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(KiouForge): collapse observer caves into shared dispatch_one slot and rename hook constants

Replace per-site observer slots with a single KIOU_KF_HOOK_SLOT_RVA pointer to dispatch_one,
which switches on W6=hook_id. Rename KIOU_SLOT_*/KIOU_CAVE_ALLOC_* to KIOU_KF_HOOK_*/
KIOU_KF_ENTRY_SLOT_*, replace g_kfBypassEntry[] with g_inject_entry[], rename g_kfUnityBase
to g_unityBase, drop AfkDisable, and update recipes to the new cave geometry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(KiouForge): navigate back to title scene on account switch instead of relaunch

Add KFNavigateToTitleScene to drive BackToTitleSequence.RunAsync, called by
the Settings UI after the account-switch dialog is confirmed. This re-runs
AccountExists → LoginAsync with the pending_device_id substitution in effect,
so switching accounts no longer requires an app relaunch.

Also resolve the target userId from active_user_id instead of reverse-mapping
deviceId → userId, which broke when one uuid was shared by multiple userIds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 25, 2026 05:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Release PR for v0.2.0, promoting developmaster, adding account switching and restructuring the patched-IPA (“chinlan”) pipeline to support version-selectable recipes (1.0.1 / 1.0.2).

Changes:

  • Reworks hook bootstrap to install hooks when UnityFramework is mapped (dyld add-image callback) and introduces a new chinlan dispatcher/entry-slot wiring.
  • Adds account persistence + Settings UI for switching accounts, plus gRPC header rewriting to avoid -40004 on switch.
  • Splits recipes into versioned modules with a TARGET_VERSION-selected recipes/__init__.py entrypoint and updates docs/build scripts for multi-version assets layout.

Reviewed changes

Copilot reviewed 31 out of 34 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
Sources/KiouForge/Tweak.m Switches UnityFramework detection/installation to dyld add-image; installs new hook set
Sources/KiouForge/kif/Writer.m Adds KIF writer/emitter implementation for autosave pipeline
Sources/KiouForge/kif/Helpers.m Updates Unity base global used for il2cpp RVA resolution
Sources/KiouForge/Internal.h Adds chinlan slot/entry enums + unified RVA constants; new hook installer declarations
Sources/KiouForge/hook/Version.m Stubs removed version-stamp hook (no hooks installed)
Sources/KiouForge/hook/SettingsUI.m Adds Account section + accounts list UI + “New Register” flow wiring
Sources/KiouForge/hook/KifuObserve.m Re-implements OnMatchEnd observer hook wiring for JB + chinlan dispatcher path
Sources/KiouForge/hook/GrpcLogging.m Adds gRPC x-user-id header rewrite for account switching
Sources/KiouForge/hook/FrameRate.m Re-implements FPS override as entry hook + direct apply helper
Sources/KiouForge/hook/AnalysisTune.m Re-implements analysis tuning as entry hooks (hash/skill/depth)
Sources/KiouForge/hook/AccountObserve.m Adds account observation/switching hooks + BackToTitle navigation helper
Sources/KiouForge/Hook_KifuObserve.m Deletes legacy hook file (replaced by hook/KifuObserve.m)
Sources/KiouForge/Hook_FrameRate.m Deletes legacy hook file (replaced by hook/FrameRate.m)
Sources/KiouForge/Hook_AnalysisTune.m Deletes legacy hook file (replaced by hook/AnalysisTune.m)
Sources/KiouForge/Hook_AfkDisable.m Deletes legacy AFK hook implementation
Sources/KiouForge/ChinlanSites.h Deletes legacy chinlan slot-table header (replaced by new dispatcher design)
Sources/KiouForge/ChinlanEntries.m Deletes legacy chinlan bootstrap/publish implementation
Sources/KiouForge/ChinlanDispatcher.m Adds new chinlan dispatcher + entry-slot publish + bypass table wiring
Sources/KiouForge/account/Persistence.m Adds NSUserDefaults-backed account storage + notifications
Sources/KiouForge/account/Persistence.h Adds public account persistence APIs
scripts/pre-commit Updates verify-sites hook to handle multiple staged recipes/modules
recipes/v1_0_2.py Adds 1.0.2-specific cave sites + constants
recipes/v1_0_1.py Adds 1.0.1-specific cave sites + constants (no account/grpc hooks)
recipes/kiouforge.py Removes legacy single-version recipe
recipes/common.py Adds shared cave builders + export surface; adds AFK static patch
recipes/init.py Adds TARGET_VERSION-selected recipe entrypoint
README.md Updates docs for v0.2.0 + account switching + multi-version recipes
README.ja.md Japanese docs updated in parallel with README.md
Makefile Adds TARGET_VERSION-based IPA selection; updates toolchain/target settings
control Bumps package version to 0.2.0
.gitignore Updates assets ignore patterns for per-version layout
.devcontainer/compose.yaml Removes host networking from devcontainer compose
Comments suppressed due to low confidence (3)

Sources/KiouForge/kif/Helpers.m:176

  • KIF exporter il2cpp callsites are still hard-coded to “KIOU 1.0.1 build 11” RVAs (see this file’s RVA_* definitions), but this release sets the default target to 1.0.2 and claims multi-version support. If those RVAs drifted in 1.0.2 (as the PR description suggests), resolveIl2cppFunctions() will resolve incorrect function pointers and can crash or emit invalid KIF on 1.0.2.
    Sources/KiouForge/hook/SettingsUI.m:120
  • Account rows assume userName and openId are NSStrings and call .length unconditionally. Since the account list is persisted and can be imported/exported, malformed data (e.g. NSNumber/NSNull) would crash the settings UI here. Please defensively type-check these fields before using .length.
    Sources/KiouForge/hook/SettingsUI.m:139
  • Row selection uses uuid.length and userName.length without validating types. If an imported/persisted account entry has non-string values for these keys, this will crash when the user taps the row.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/KiouForge/Tweak.m
Comment on lines 53 to +57
KFInstallFrameRateHook(unityBase);
KFInstallAfkDisableHook(unityBase);
KFInstallAnalysisTuneHook(unityBase);
KFInstallKifuObserveHook(unityBase);
KFInstallAccountObserveHook(unityBase);
KFInstallGrpcLoggingHook(unityBase);
Comment thread recipes/common.py
Comment on lines +206 to +217
def build_exports(sites, afk_site, afk_orig_8, hook_slot_rva, entry_slot_base_rva):
"""Build PATCHES, CAVE_PATCHES, and _SITES from per-version data."""
from tools.encode import mov_w0_imm_ret

patches = [
(
afk_site,
bytes.fromhex(afk_orig_8),
mov_w0_imm_ret(0),
"IsAfkEnabled: return false (MOVZ W0,#0; RET)",
),
]
Comment on lines +408 to +418
bool KFHookAccountExistsEntry(void *data) {
bool origResult = false;
AccountExists_t bypass = (AccountExists_t)
g_inject_entry[KIOU_KF_HOOK_ACCOUNT_EXISTS];
@try { origResult = bypass(data); }
@catch (NSException *e) {
IPALog([NSString stringWithFormat:
@"[ACCOUNT] AccountExists bypass threw: %@", e]);
}
return accountExistsBody(data, origResult, "chinlan");
}
Comment on lines +26 to +34
// Direct call from the settings slider callback so the new value takes
// effect immediately without waiting for KIOU's next settings apply.
void KFApplyFPS(int32_t fps) {
if (g_unityBase == 0) return;
SetTargetFrameRate_t fn =
(SetTargetFrameRate_t)(g_unityBase + RVA_SET_TARGET_FRAMERATE);
fn(fps, NULL);
IPALog([NSString stringWithFormat:@"[FPS] applied %d fps (direct)", fps]);
}
Comment thread Makefile
# Theos boilerplate.
# ---------------------------------------------------------------------------
TARGET := iphone:clang:latest:13.0
TARGET := iphone:clang:16.5:15.0
Comment on lines +455 to +463
void KFNavigateToTitleScene(void) {
if (g_unityBase == 0) {
IPALog(@"[ACCOUNT] KFNavigateToTitleScene: unityBase not yet set");
return;
}
BackToTitleRunAsync_t fn =
(BackToTitleRunAsync_t)(g_unityBase + KIOU_KF_SITE_RVA_BACK_TO_TITLE_RUN_ASYNC);
@try {
(void)fn(NULL);
…commitlint (#8)

Disable body-max-line-length and footer-max-line-length so squash-merge
commits (which auto-embed every original commit message as bullets) can pass
Commit Lint on the release PR. Header limits stay in place.

Add the v0.2.0 CHANGELOG entry covering the 1.0.2 hook RVAs and the new
account-switching feature.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
@tkgstrator
tkgstrator merged commit dd26a4c into master Jun 25, 2026
8 checks passed
tkgstrator added a commit that referenced this pull request Jul 1, 2026
…#18)

* fix(hooks): install KIOUAfkDisableAlwaysFalseInstall after AFK cave migration

Bumps vendor/KIOU-Hook to 2ef91df to pick up KIOU-Hook PR #7, which
retires the AFK_SITE inline patch on 1.0.2 and routes
GameOrchestrator.IsAfkEnabled through a CAVE_ENTRY instead. Without a
matching consumer-side install, the next `make chinlan` build would
patch the cave in but leave its slot unpublished, so the first
IsAfkEnabled call would BLR-jump to a null slot pointer and crash.

Adds one line to Sources/KiouForge/Tweak.m — after the existing
KIOUInstall* chain — that calls the convenience installer
KIOUAfkDisableAlwaysFalseInstall(unityBase). The installer publishes
a static `return false` hook body into the AFK cave slot, so
IsAfkEnabled unconditionally reports "off" — matching the historic
KiouForge behaviour the AFK_SITE inline patch delivered before the
migration.

No feature-flag storage or UI wiring involved — KiouForge's
"AFK always off" stance is unchanged, only the transport swapped
from inline patch to cave dispatch.

Verified: `make chinlan` compiles + links + signs clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* refactor(naming): sweep leftover kf* / g_* identifiers to KIOU / s_ conventions

The KF -> KIOU rename earlier this cycle only caught uppercase KF-
followed-by-uppercase identifiers via `\bKF([A-Z])` regex. Lowercase
`kf*` leftovers and one C-style `g_*` static file-local remained.
Bring the last few into line so the tree stops carrying the retired
"KiouForge-specific" prefix:

  Tweak.m
    - kfOnImageAdded    -> KIOUOnImageAdded (static callback with
                           the project prefix that matches every
                           other exported identifier)
    - g_unityHooked     -> s_unityHooked   (static file-local — matches
                           the KIOU-Hook `s_origXxx` pattern rather
                           than the C-style `g_*` prefix which
                           implies extern)
    - init              -> KIOUForgeInit  (the constructor was named
                           generically enough to collide with anything
                           else linking as `init`)
    - stale comment referencing `g_kfHookSlot` corrected to
      `g_inject_entry` (its actual name from KIOU-Hook)

  Kif/Writer.m
    - kf_resolveGameController -> KIOUResolveGameController

  Hook/SettingsUI.m
    - kfActiveWindow    -> KIOUActiveWindow
    - Cell reuse identifiers `kf_account_row` / `kf_account_active` /
      `kf_force_register` -> `kiou_*` variants. Internal only; each is
      scoped to its UITableView subclass, no external reader.
    - Temporary export path `kf_accounts.json` (NSTemporaryDirectory)
      -> `kiou_accounts.json`. Temp files are recreated each session,
      so no user-visible migration.

KIOU-Hook-owned externs `g_unityBase` and `g_inject_entry` stay as-is
— they're part of the shared library's public API convention (the
`g_*` prefix mirrors the KIOU-Hook side's declaration in KIOUHook.h)
and renaming them belongs to a KIOU-Hook PR, not this one.

Verified: `make chinlan` compiles + links + signs clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* chore(submodules): bump KIOU-Hook submodule

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(hooks): filter cave entries to published hook slots

Limit KIOU-Hook patching to hook IDs KiouForge actually publishes so unpublished slots cannot produce NULL BLR crashes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(hooks): adopt shared slot filtering from KIOU-Hook

Remove the local hook allowlist now that the submodule handles slot filtering, and align KiouForge-only symbols back to the kf namespace.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(hooks): restrict IPA hook IDs for baseline bisection

Limit the IPA build to the 16 baseline KIOU hook sites while bumping KIOU-Hook.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(hooks): restore shared hook catalog selection

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(submodule): bump KIOU-Hook to 23d7d4a (tools namespace fix)

Baseline restore point before the AFK CAVE_ENTRY migration.

23d7d4a drops the empty tools/__init__.py from KIOU-Hook so the
`tools` package name can PEP-420-merge with Kanade's shared/tools/.
Prior to this bump `make ipa` failed at the extract-recipe step
because `python -m tools.patch_macho` couldn't be found under the
`tools/` rooted in KIOU-Hook. Behavior for the on-device tweak is
unchanged — only build-time module resolution is affected.

Verified: `make deploy` produces a launching KIOU with baseline
KiouForge behavior (16 KIOU-Hook sites + inline AFK).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* feat(hooks): enable AFK suppress hook

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(kif): update helper RVAs for KIOU 1.0.2

Pin KIF helper callsites to dump.cs-verified 1.0.2 RVAs to avoid match-end crashes from stale 1.0.1 method addresses.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(submodule): bump KIOU-Hook to be4cc6a (observer slot fix)

Picks up the HOOK_SLOT_RVA move from __DATA.__bss (0x8F90C80) to
__DATA.__common (0x091E92B8). Without this bump, CPUStreamMode /
AIMatchMode / OnlinePvPMode / LocalPvPMode / RecordReplayMode
OnMatchEndAsync observers would fire into a slot that il2cpp has
already overwritten with garbage and the process would die with a
PC alignment fault at the cave BLR X16.

Paired with 33e056c (fix(kif): update helper RVAs for KIOU 1.0.2)
this is what took resign from "crash" to "kifu saved cleanly".

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* feat(kif): read player names from match mode state stores

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
tkgstrator added a commit that referenced this pull request Jul 27, 2026
…#18)

* fix(hooks): install KIOUAfkDisableAlwaysFalseInstall after AFK cave migration

Bumps vendor/KIOU-Hook to 2ef91df to pick up KIOU-Hook PR #7, which
retires the AFK_SITE inline patch on 1.0.2 and routes
GameOrchestrator.IsAfkEnabled through a CAVE_ENTRY instead. Without a
matching consumer-side install, the next `make chinlan` build would
patch the cave in but leave its slot unpublished, so the first
IsAfkEnabled call would BLR-jump to a null slot pointer and crash.

Adds one line to Sources/KiouForge/Tweak.m — after the existing
KIOUInstall* chain — that calls the convenience installer
KIOUAfkDisableAlwaysFalseInstall(unityBase). The installer publishes
a static `return false` hook body into the AFK cave slot, so
IsAfkEnabled unconditionally reports "off" — matching the historic
KiouForge behaviour the AFK_SITE inline patch delivered before the
migration.

No feature-flag storage or UI wiring involved — KiouForge's
"AFK always off" stance is unchanged, only the transport swapped
from inline patch to cave dispatch.

Verified: `make chinlan` compiles + links + signs clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* refactor(naming): sweep leftover kf* / g_* identifiers to KIOU / s_ conventions

The KF -> KIOU rename earlier this cycle only caught uppercase KF-
followed-by-uppercase identifiers via `\bKF([A-Z])` regex. Lowercase
`kf*` leftovers and one C-style `g_*` static file-local remained.
Bring the last few into line so the tree stops carrying the retired
"KiouForge-specific" prefix:

  Tweak.m
    - kfOnImageAdded    -> KIOUOnImageAdded (static callback with
                           the project prefix that matches every
                           other exported identifier)
    - g_unityHooked     -> s_unityHooked   (static file-local — matches
                           the KIOU-Hook `s_origXxx` pattern rather
                           than the C-style `g_*` prefix which
                           implies extern)
    - init              -> KIOUForgeInit  (the constructor was named
                           generically enough to collide with anything
                           else linking as `init`)
    - stale comment referencing `g_kfHookSlot` corrected to
      `g_inject_entry` (its actual name from KIOU-Hook)

  Kif/Writer.m
    - kf_resolveGameController -> KIOUResolveGameController

  Hook/SettingsUI.m
    - kfActiveWindow    -> KIOUActiveWindow
    - Cell reuse identifiers `kf_account_row` / `kf_account_active` /
      `kf_force_register` -> `kiou_*` variants. Internal only; each is
      scoped to its UITableView subclass, no external reader.
    - Temporary export path `kf_accounts.json` (NSTemporaryDirectory)
      -> `kiou_accounts.json`. Temp files are recreated each session,
      so no user-visible migration.

KIOU-Hook-owned externs `g_unityBase` and `g_inject_entry` stay as-is
— they're part of the shared library's public API convention (the
`g_*` prefix mirrors the KIOU-Hook side's declaration in KIOUHook.h)
and renaming them belongs to a KIOU-Hook PR, not this one.

Verified: `make chinlan` compiles + links + signs clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* chore(submodules): bump KIOU-Hook submodule

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(hooks): filter cave entries to published hook slots

Limit KIOU-Hook patching to hook IDs KiouForge actually publishes so unpublished slots cannot produce NULL BLR crashes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(hooks): adopt shared slot filtering from KIOU-Hook

Remove the local hook allowlist now that the submodule handles slot filtering, and align KiouForge-only symbols back to the kf namespace.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(hooks): restrict IPA hook IDs for baseline bisection

Limit the IPA build to the 16 baseline KIOU hook sites while bumping KIOU-Hook.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(hooks): restore shared hook catalog selection

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(submodule): bump KIOU-Hook to 23d7d4a (tools namespace fix)

Baseline restore point before the AFK CAVE_ENTRY migration.

23d7d4a drops the empty tools/__init__.py from KIOU-Hook so the
`tools` package name can PEP-420-merge with Kanade's shared/tools/.
Prior to this bump `make ipa` failed at the extract-recipe step
because `python -m tools.patch_macho` couldn't be found under the
`tools/` rooted in KIOU-Hook. Behavior for the on-device tweak is
unchanged — only build-time module resolution is affected.

Verified: `make deploy` produces a launching KIOU with baseline
KiouForge behavior (16 KIOU-Hook sites + inline AFK).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* feat(hooks): enable AFK suppress hook

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(kif): update helper RVAs for KIOU 1.0.2

Pin KIF helper callsites to dump.cs-verified 1.0.2 RVAs to avoid match-end crashes from stale 1.0.1 method addresses.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(submodule): bump KIOU-Hook to be4cc6a (observer slot fix)

Picks up the HOOK_SLOT_RVA move from __DATA.__bss (0x8F90C80) to
__DATA.__common (0x091E92B8). Without this bump, CPUStreamMode /
AIMatchMode / OnlinePvPMode / LocalPvPMode / RecordReplayMode
OnMatchEndAsync observers would fire into a slot that il2cpp has
already overwritten with garbage and the process would die with a
PC alignment fault at the cave BLR X16.

Paired with 33e056c (fix(kif): update helper RVAs for KIOU 1.0.2)
this is what took resign from "crash" to "kifu saved cleanly".

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* feat(kif): read player names from match mode state stores

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants