feat: HeaderProvider hook + KIOU-Hook A2 adoption + KF→KIOU rename#16
Merged
Conversation
Wire the new HeaderProvider.SetOrUpdateHeader entry slot in KiouForge's
chinlan dispatcher and bump the KIOU-Hook submodule to carry the
catalog row and hook body.
Dispatcher gains one extern (KFHookHeaderProviderSetOrUpdate) and one
entry_slot assignment at KIOU_HOOK_SLOT_HEADER_PROVIDER_SET_OR_UPDATE_
HEADER. Nothing else in the dispatcher changes.
KIOU-Hook submodule bump brings:
* Static-method typedef fix for BackToTitleSequence.RunAsync,
RunResetUserDataSequenceAsync, and RunDeleteAccountSequenceAsync
(previously (ct)-only, now (ct, mi) with fn(NULL, NULL) at call
sites).
* Catalog + recipe + Hook/GrpcLogging.m rewrite moving the x-user-id
swap from HttpMessageInvoker.SendAsync to Project.Network.
HeaderProvider.SetOrUpdateHeader — a managed-only site upstream
of the Cysharp Yaha borrow that the SendAsync hook could not
survive.
Verified end-to-end on 1.0.2 build 12 chinlan (jailbroken, TrollStore-
installed IPA): account switch completes without crash, [HEADER]
x-user-id swapped fires, and the follow-up LoginReply / SelfProfile
return the target user (openUserId changes from 1054-1001-0520-9241
to 2620-3831-5122-4152 across the switch).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add a make deploy target that builds the patched IPA, scps it to the
device, installs via trollstorehelper install force, and launches the
app. Kept separate from Theos's install:: so `make deploy` does not
also trigger the JB rootless .deb install as a side effect.
Introduce BUNDLE_ID_SUFFIX. Empty (default) leaves CFBundleIdentifier
untouched — the patched IPA overwrites the original app. Setting e.g.
BUNDLE_ID_SUFFIX=chinlan appends ".chinlan" to the bundle id at IPA
build time, so the patched IPA installs side-by-side with the
original App Store / Sideloadly copy of the same app.
INSTALLED_IPA_BUNDLE_ID composes the launch target from TARGET_BUNDLE_
ID + suffix automatically.
Related overrides (all .env-friendly):
* TROLLSTORE_HELPER — /var/jb/Applications/TrollStorePersistenceHelper.
app/trollstorehelper (stable rootless path)
* INSTALLED_IPA_BUNDLE_ID — TARGET_BUNDLE_ID + optional suffix
* DEVICE_USER — root
Requires the shared submodule bump so build_patched_ipa.sh honours
--bundle-id-suffix end-to-end.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add specialized Claude agents, a fix-tweak skill, and crash collection script for KIOU-Hook Tweak diagnosis and repair. Update the devcontainer to support the workflow dependencies and runtime setup. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 tasks
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Accumulated feature branch that bundles three related deliveries so develop picks them up together:
HeaderProvider.SetOrUpdateHeaderentry slot inChinlanDispatcher.mand bumpsvendor/KIOU-Hookfor the hook body.vendor/KIOU-Hookto3079c5e(main HEAD after PR-A2 merge), picking up the 10 KiouEditor-derived hook bodies (Hook/AfkDisable.m,AssistEnable.m,AssistTune.m,Collection.m,MatchingPlayer.m,PremiumUnlock.m,SelectCharacter.m,SyncItemList.m,Version.m,VoiceUnlock.m), the sharedHook/Common.{h,m}, andKIOUSelfUserIdinAccount/Persistence. KiouForge doesn't install these hooks — the bump only tracks the shared library forward.KFSwitchAccount→KIOUSwitchAccount,KFPendingDeviceId→KIOUPendingDeviceId,KFChinlanPublish→KIOUChinlanPublish) plus the KiouForge-internalKF*sweep (dispatcher extern block, hook-body entry names, settings UI, gesture install). The whole tree drops the KiouForge-specific prefix in favour of the neutralKIOU*family. Matches the KIOU-Hook side rename shipped in KIOU-Hook#4.make deploy+BUNDLE_ID_SUFFIX— build →scp→trollstorehelper install force→ app launch. Kept separate from Theos'sinstall::somake deploytargets only the IPA path.BUNDLE_ID_SUFFIX=chinlaninstalls the patched build side-by-side with the App Store copy.Dependencies (all merged)
--bundle-id-suffixflag onbuild_patched_ipa.shWhy the HeaderProvider site change
Hooking
HttpMessageInvoker.SendAsyncto swap x-user-id could not survive: touchingself+0x10or callingHttpHeaders.TryAdd/Removefrom that hook body reliably crashed inside orig SendAsync'sHttpHeaders.GetEnumeratoron a0x20025xxxtruncated pointer, presumably because Cysharp Yaha borrows the request across the SendAsync boundary.HeaderProvider.SetOrUpdateHeader(Project.Network.dll, RVA0x5BD9EE8) is managed-only code well before Yaha ever sees the request, with a(self, string, string, MethodInfo*)signature — no HTTP or Yaha types involved.Test plan
make chinlan— all 27 files compile, link, sign clean.make deploycompletes end-to-end (chinlan → patch → scp → TrollStore force install → launch).Settings → 切り替え → Confirm:[HEADER] x-user-id swapped →fires, no crash.LoginReplyreturns target user'sdeviceId;SelfProfile openUserIdchanges across the switch..ipsgenerated during account switch flows.HttpMessageInvoker.SendAsynchook still installs (bare passthrough); cave / entry_slot wiring unchanged.Follow-up
Hook/Common.m's sprite-helper stubs with the real il2cpp bridge).Overrides for
make deployTROLLSTORE_HELPER— path totrollstorehelper(default:/var/jb/Applications/TrollStorePersistenceHelper.app/trollstorehelper)INSTALLED_IPA_BUNDLE_ID— auto-composed fromTARGET_BUNDLE_ID + BUNDLE_ID_SUFFIXDEVICE_USER— SSH user (default:root)🤖 Generated with Claude Code