Skip to content

About

SideStore is a fork of AltStore that doesn't require an AltServer.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

 
 

Latest commit

 

History

3,522 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SideStore + iOS 16 心跳

官方 SideStore nightly 0.7.0-20261027.1507+cd260851 只加了一处功能改动:通过网络连手机时,保持 lockdown 的心跳会话。解决 iOS 16 上续签、安装时连接马上被手机断开的问题。

做法是只用源码编译主程序 SideStore.app/SideStore,换进同一个提交的官方 ipa,其余文件(界面、图标、数据模型、小组件、Frameworks)都是官方原件。所以:

  • 产物和官方 ipa 相比只有主程序不同,Bundle ID 还是 com.SideStore.SideStore,iloader 按官方 SideStore 处理(App ID、App Group、证书、配对文件都和官方流程一样)。
  • 不需要 Mac:用 kxbuild 在 Linux 上编译,不签名,由 iloader 安装时签名。

English summary: below.

为什么要心跳

在 iOS 16 上,SideStore 通过 LocalDevVPN 连手机自己。它把东西装进手机的那一步(装描述文件的 misagent、传 ipa 的 AFC、安装的 installation_proxy),连上约 0.1 秒就被手机断开,日志里是:

installProvisioningProfile() misagent_install failed: Socket(Custom { kind: UnexpectedEof,
error: "peer closed connection without sending TLS close_notify" })

也可能是 BrokenPipe、ConnectionReset,或者 InvalidVPN: Failed to open remote AFC file。登录、连通 VPN、向 Apple 要描述文件都正常,只断在这一步。

手机有个系统服务 com.apple.mobile.heartbeat:走网络连过来的电脑要一直应答它的 Marco(「还在吗」),回 Polo(「在」),不然手机就断开。官方版没有保持这个会话。在同一台 iOS 16.7 的手机上:

版本 续签 SideStore 自己
官方 nightly 0.7.0-20261027 5 次都断开
同一版本只加心跳(本仓库) 成功

上游相关讨论:SideStore#1406(提出 iOS 16 及以前要保持心跳会话,没有合入)、SideStore#1466(iOS 16 上同样的报错)。

心跳的实现:通过 lockdown 调用任何服务之前,没有心跳会话就开一个线程连上心跳服务,收 Marco、回 Polo,一直循环;等第一次 Polo 回完再继续(最多等 8 秒);最后一次调用后再保持 60 秒。用 Remote Pairing 配对文件(iOS 17.4 以上才有)连接时不走这段代码。

改了哪些文件

子模块 Dependencies/minimuxer、Dependencies/SideSign、Dependencies/AnisetteKit 都停在上游的提交上,改动放在 patches/ 里,由 build.sh 应用到子模块的工作区,不需要 fork 子模块。

功能

文件 改了什么
patches/minimuxer/0001-…heartbeat….patch(DeviceGateway/idevice/IdeviceGateway.swift) lockdown 心跳会话,约 80 行

为了在非 Mac 上编译

文件 改了什么 为什么
AltStore.xcodeproj/project.pbxproj SideStore target 不编 Core Data 模型、12 个映射模型、两个 .intentdefinition kxbuild 不一定带 momc、mapc、intentbuilderc;这些编译结果直接用官方 ipa 里的
AltStore/Intents/GeneratedIntents.swift(新增) 手写 intentbuilderc 本该生成的 Intent 类 同上,代码里用到了这些类
AltStore.xcodeproj/project.pbxproj 不编译、不嵌入小组件 AltWidgetExtension 小组件也要编 .intentdefinition;用官方 ipa 里的
patches/minimuxer/0002-… Minimuxer 去掉 libimobiledevice 后端 它和默认的 idevice 后端有 132 个同名 C 符号,ld64.lld 报重复符号
.gitmodules、Dependencies/AnisetteKit(新增子模块) AnisetteKit 改成子模块,版本和 Package.resolved 锁定的 db8b410 一样 要改它的清单,见下一行
patches/AnisetteKit/0001-… 清单里 #if canImport(Darwin) 改成 #if true 清单在编译用的电脑上运行,判断的是电脑而不是目标平台;在 Linux 上给 iPhone 编译时会去链接系统的 libunicorn(unicorn/unicorn.h 找不到),而不是下载 iOS 版 Unicorn
patches/SideSign/0001-… SideSign 用 ../AnisetteKit 用上面改过清单的那份
build.sh、.gitignore 编译脚本

build.sh 编译时还会:把 libem_proxy.a 里和 libidevice_ffi.a 重复的两个 Rust 标准库符号改成弱符号(llvm-objcopy --weaken-symbol,改的是下载的依赖,不在仓库里);加上 LLVM_LTO=NO、LD_WARN_DUPLICATE_LIBRARIES=NO、LD_WARN_UNUSED_DYLIBS=NO(kxbuild 和 ld64.lld 不支持的设置)。

怎么编

需要:

  • kxbuild,已激活授权(kxbuild license status)。同一个授权同时只能跑一个 kxbuild build。
  • bash、git、curl、unzip、zip、python3、setsid(util-linux)。llvm-objcopy 用 kxbuild 自带工具链里的,PATH 里有也可以。
git clone --recursive -b heartbeat https://github.com/iosxqpa/SideStore SideStore-heartbeat
cd SideStore-heartbeat
./build.sh

产物是 build/SideStore-heartbeat.ipa。脚本按顺序做:

  1. 检查工具和 kxbuild 授权,有别的 kxbuild build 在跑就停下。
  2. 下载官方 nightly ipa,核对 sha256、版本号 0.7.0-20261027.1507+cd260851 和 Bundle ID。
  3. 初始化子模块,应用 patches/(已经应用过的跳过)。
  4. 解析 Swift 包,给 libem_proxy.a 改弱符号。在第一次编译前做,所以一次就能编过。
  5. 用 kxbuild 编译主程序,不签名(CODE_SIGNING_ALLOWED=NO)。主程序链接好就停止构建:后面剩下的素材编译(actool)在 kxbuild 的服务器上进行,可能很慢,而素材本来就用官方的。要等它编完,加 --wait-actool。
  6. 把主程序换进官方 ipa(只替换这一个文件),再逐个文件和官方 ipa 比对:应该只有主程序不同、Bundle ID 相同,否则报错。

可以重复运行,第二次起是增量编译。所有产物和临时文件都在 build/ 下:

路径 内容
build/SideStore-heartbeat.ipa 产物
build/downloads/ 官方 ipa
build/DerivedData/ kxbuild 的编译目录
build/logs/ 解析和编译日志
build/stage/ 打包用的临时目录

选项和环境变量:

--clean 删掉 build/DerivedData 后重新编译
--wait-actool 等整个构建结束,不在主程序链接好时停下
BUILD_DIR=<目录> 产物和临时文件换个位置
KXBUILD=<路径> kxbuild 不在 PATH 里时指定
OFFICIAL_IPA=<文件> 用已有的官方 ipa,不下载
OFFICIAL_IPA_URL=<地址> 从别的地址下载官方 ipa
OFFICIAL_IPA_SHA256=<值> 或 skip 官方 ipa 的 sha256;skip 只核对版本号

官方 nightly 的下载地址 releases/download/nightly/SideStore.ipa 每出一个新 nightly 就会被覆盖。覆盖以后 sha256 对不上,脚本会停下;这时要自己找到 0.7.0-20261027.1507+cd260851 的官方 ipa,用 OFFICIAL_IPA= 指定。主程序必须和同一个提交的官方 ipa 配对,不能换进别的版本。

只在 Linux 上验证过。Windows 上的 kxbuild 没有试过这个脚本。

怎么装

和官方流程一样,只是在 iloader 里不选内置的 SideStore,而是点 Import IPA(中文界面「导入 IPA」),选 build/SideStore-heartbeat.ipa。iloader 会签名、注册 App ID、配好 App Group 和配对文件。之后登录、连 LocalDevVPN、续签都和官方版一样。

续签成功时,SideStore 的日志里有:

lockdown heartbeat established, interval: 10
installProvisioningProfile() misagent_install succeeded

不要在 SideStore 里更新 SideStore 自己,更新后会换回官方版。

已知限制

  • 只验证过续签 SideStore 自己(iPhone X,iOS 16.7)。用这个版本装别的 App、续签别的 App 还没有试过。
  • 主程序里少了 intentbuilderc 生成的两个类(AppResolutionResult、ViewAppIntentResponse),小组件和 Siri / 快捷指令的配置可能不正常,没有试过。
  • 设置里的后端(Settings → User Customizations)不要切到 libimobiledevice:这个后端编译时去掉了,选它实际用的还是 idevice。
  • 和官方主程序相比,还少了 swift-crypto、ZIPFoundation 的 4 个资源定位类;对应的资源 bundle 在官方 ipa 里还在。
  • 产物不签名,主程序换过后官方 ipa 里原来的签名也失效了,要由 iloader 之类的工具重新签名才能装。

许可

SideStore 是 AGPL-3.0,本仓库沿用。分发编出来的 ipa 时要同时提供源码,也就是本仓库(含 patches/)。上游原来的说明见 README.upstream.md。


English

This is the official SideStore nightly 0.7.0-20261027.1507+cd260851 with one functional change: it keeps a lockdown heartbeat session (com.apple.mobile.heartbeat) while talking to the device over the network. Without it, iOS 16 drops misagent / AFC / installation_proxy connections about 0.1 s after they open (peer closed connection without sending TLS close_notify, BrokenPipe, ConnectionReset), so refreshing and installing apps fail. On an iOS 16.7 device the official nightly failed to refresh itself 5 times in a row; the same build with the heartbeat succeeded. Upstream context: SideStore#1406, SideStore#1466.

Only the main executable is built from source, with kxbuild on Linux (no Mac, unsigned). build.sh swaps it into the official ipa of the same commit and checks that the executable is the only file that differs; the bundle ID stays com.SideStore.SideStore.

git clone --recursive -b heartbeat https://github.com/iosxqpa/SideStore SideStore-heartbeat && cd SideStore-heartbeat
./build.sh          # -> build/SideStore-heartbeat.ipa

Install it with iloader → Import IPA; everything else is the same as the official setup.

  • The feature is patches/minimuxer/0001-*.patch. The other changes only make the executable build without a Mac: models, mapping models, .intentdefinition files and the widget are left out of the build (their compiled versions come from the official ipa) with hand-written Intent classes in AltStore/Intents/GeneratedIntents.swift; the libimobiledevice backend is removed (duplicate symbols with idevice); AnisetteKit becomes a submodule whose manifest always uses the iOS Unicorn xcframework (its #if canImport(Darwin) checks the build host, not the target).
  • Submodules stay on their upstream commits; build.sh applies patches/ to them.
  • The nightly release download is overwritten by newer nightlies. If the sha256 no longer matches, obtain the 0.7.0-20261027.1507+cd260851 ipa yourself and pass OFFICIAL_IPA=/path/to/SideStore.ipa.
  • Known limitations: only refreshing SideStore itself has been tested (iOS 16.7). Widgets and Siri/Shortcuts configuration may not work (two generated Intent classes are missing). Do not switch the backend to libimobiledevice in settings; it is compiled out and falls back to idevice.
  • License: AGPL-3.0, like upstream. If you distribute the ipa, provide this repository as its source.

About

SideStore is a fork of AltStore that doesn't require an AltServer.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages