Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified AltDaemon/AltDaemon.entitlements
100644 → 100755
Empty file.
Empty file modified AltDaemon/AnisetteDataManager.swift
100644 → 100755
Empty file.
26 changes: 20 additions & 6 deletions AltDaemon/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# AltDaemonModern

This fork repairs AltDaemon for rootless jailbreaks. Version 1.2.2 tries on-device AuthKit anisette first and retains the anisette v3 client as fallback. It preserves AltStore's existing XPC protocol, so compatible AltStore Classic builds do not need a protocol change.
This fork repairs AltDaemon for rootless and Dopamine RootHide jailbreaks. Version 1.2.4 tries on-device AuthKit anisette first and retains the anisette v3 client as fallback. It preserves AltStore's existing XPC protocol, so compatible AltStore Classic builds do not need a protocol change.

Thanks to [ichitaso](https://github.com/ichitaso/AltDaemonModern) for the on-device anisette and authentication/retry fixes in 1.2.2. See the [release notes](../RELEASE_NOTES_1.2.2.md) for validation details.
Thanks to [ichitaso](https://github.com/ichitaso/AltDaemonModern) for the on-device anisette and authentication/retry fixes in 1.2.2, the HTTP 503 fix and RootHide package in 1.2.3, and the -22410 fix in 1.2.4. See the [release notes](../RELEASE_NOTES_1.2.4.md) for validation details.

## What changed

Expand All @@ -15,8 +15,14 @@ Thanks to [ichitaso](https://github.com/ichitaso/AltDaemonModern) for the on-dev
- Retries only transient `get_headers` failures with a short bounded backoff.
- In v3 mode, automatically fails over between three HTTPS SideStore anisette endpoints and
remembers the last endpoint that succeeded.
- Applies the 1.2.2 compatibility client-info headers to both GSA authentication
and developer-services requests.
- Applies the compatibility client-info headers to both GSA authentication
and developer-services requests. Since 2026-11-20 Apple's GSA edge answers
HTTP 503 when the OS name is `macOS;`, so 1.2.3 sends `Mac OS X;` and rewrites
`<macOS;` in any other GSA request.
- Since 2026-11-21 GSA answers -22410 when the client-info platform differs from
the ADI that produced the anisette data. With on-device anisette, 1.2.4 keeps
the device's own client info and akd User-Agent for SRP sign-in, and uses a
Mac identity only for the Xcode app token and developer services.
- Includes an AltStore-only compatibility module for Classic 2.2.1 that updates
its obsolete GSA authentication identity to `com.apple.akd`, retries transient
Apple HTTP 429/5xx responses with bounded backoff, and reports an accurate
Expand All @@ -36,7 +42,7 @@ Thanks to [ichitaso](https://github.com/ichitaso/AltDaemonModern) for the on-dev
communication failures.
- Includes daemon-specific target fixes needed to build current upstream source.

The minimum deployment target is iOS 15.0. The primary target is Dopamine's standard rootless environment; RootHide is not currently supported.
The minimum deployment target is iOS 15.0. Supported environments are Dopamine's standard rootless environment and Dopamine RootHide. The legacy RootHide Bootstrap is not tested.

## Build

Expand Down Expand Up @@ -64,6 +70,14 @@ scripts/build-rootless-deb.sh /path/to/AltDaemon /path/to/AltDaemonModern.deb

The package builder stages files under `/var/jb`, signs a private copy of the input binary, and includes the AGPL and third-party notices. It never changes the input binary.

To build a Dopamine RootHide package from the same binary:

```sh
scripts/build-roothide-deb.sh /path/to/AltDaemon /path/to/AltDaemonModern.deb
```

The RootHide package uses architecture `iphoneos-arm64e` and stages files relative to the jbroot instead of `/var/jb`. Because the jbroot path is randomized, `postinst` resolves it with `jbroot /` and writes the absolute daemon path into the LaunchDaemon plist before bootstrapping it. The daemon is also signed with `com.apple.private.security.no-sandbox` and the RootHide storage entitlements; without them RootHide sandboxes AltDaemon, the peer check on AltStore's connection is denied, and AltStore reports that AltServer could not be found. The version is read from the rootless `control`, so both packages stay in step.

## Configuration

By default, the daemon tries on-device AuthKit first. If that path fails, the
Expand Down Expand Up @@ -116,6 +130,6 @@ Do not add raw header logging. `X-Apple-I-MD`, `X-Apple-I-MD-M`, and `adi.pb` mu

## Installation

The build product is unsigned. A rootless installation must be signed with the entitlements in `AltDaemon.entitlements`, installed as `/var/jb/usr/bin/AltDaemon`, and bootstrapped with the rootless plist at `AltDaemon/package/var/jb/Library/LaunchDaemons/com.rileytestut.altdaemon.plist`. Back up an existing executable and validate a separately named, signed copy with `--self-test-anisette` before replacing anything. Version 1.2.2 includes the private AuthKit client entitlement for the on-device path.
The build product is unsigned. A rootless installation must be signed with the entitlements in `AltDaemon.entitlements`, installed as `/var/jb/usr/bin/AltDaemon`, and bootstrapped with the rootless plist at `AltDaemon/package/var/jb/Library/LaunchDaemons/com.rileytestut.altdaemon.plist`. Back up an existing executable and validate a separately named, signed copy with `--self-test-anisette` before replacing anything. The private AuthKit client entitlement for the on-device path is included since 1.2.2.

The standard build script does not create a `.deb` or modify a connected device. Packaging and installation are separate, explicit steps.
5 changes: 4 additions & 1 deletion AltDaemon/package/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: com.rileytestut.altdaemon
Name: AltDaemon Modern
Version: 1.2.2
Version: 1.2.4
Architecture: iphoneos-arm64
Depends: ellekit (>= 1.2)
Description: Reliable rootless AltDaemon with current Apple login compatibility.
Expand All @@ -10,3 +10,6 @@ Maintainer: AltDaemonModern contributors
Author: Riley Testut and AltDaemonModern contributors
Homepage: https://github.com/altstoreio/AltStore
Section: Tweaks
Depiction: https://cydia.ichitaso.com/depiction/altdaemon.html
SileoDepiction: https://cydia.ichitaso.com/depiction/altdaemon.json
Icon: https://raw.githubusercontent.com/ichitaso/AltDaemonModern/refs/heads/main/Repo/Icon-60%403x.png
13 changes: 13 additions & 0 deletions AltDaemon/package/roothide/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
set -e

PLIST=/Library/LaunchDaemons/com.rileytestut.altdaemon.plist
JBROOT=$(jbroot /)
JBROOT=${JBROOT%/}

# The jbroot path is randomized, so launchd needs the resolved absolute binary path.
sed -i "s|<string>/usr/bin/AltDaemon</string>|<string>$JBROOT/usr/bin/AltDaemon</string>|" "$PLIST"

launchctl bootout system "$PLIST" >/dev/null 2>&1 || true
launchctl bootstrap system "$PLIST"
launchctl kickstart -k user/foreground/com.rileytestut.altdaemon
5 changes: 5 additions & 0 deletions AltDaemon/package/roothide/DEBIAN/preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
set -e

launchctl bootout system/com.rileytestut.altdaemon >/dev/null 2>&1 || true
launchctl bootout user/foreground/com.rileytestut.altdaemon >/dev/null 2>&1 || true
5 changes: 5 additions & 0 deletions AltDaemon/package/roothide/DEBIAN/prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
set -e

launchctl bootout system/com.rileytestut.altdaemon >/dev/null 2>&1 || true
launchctl bootout user/foreground/com.rileytestut.altdaemon >/dev/null 2>&1 || true
98 changes: 59 additions & 39 deletions Compatibility/AltStoreAuthCompat/Tweak.m
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,34 +1,16 @@
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
#import <dispatch/dispatch.h>
#import <sys/utsname.h>

// 0: GSA and developer-services requests are rewritten to one coherent Mac identity
// (see below). Required with on-device anisette: Apple answers /services/v1/certificates
// with 403 FORBIDDEN_ERROR when the iPhone's own client info is sent.
// 0: GSA and developer-services identities are rewritten (see AAMDataTaskWithRequest).
// 1: pure logger; requests are not modified.
#define AAM_LOG_ONLY 0

// Client info used for every GSA request when AAM_LOG_ONLY is 0.
// 1: legacy MacBookPro13,2 tuple (matched the old public anisette servers).
// 2: Mac15,7 / macOS 15.7.9 tuple (the one observed from a working Mac AltServer run).
#define AAM_IDENTITY 2

// Same tuple for developerservices2.apple.com requests. It must match the GSA identity:
// mixing an iPhone sign-in with a Mac developer-services request is answered with
// "session expired" (AltStore error 1100).
// 1: apply the override (working configuration). 0: leave AltSign's value untouched.
#define AAM_DEV_IDENTITY 1
#define AAM_DEV_CLIENT_INFO @"<Mac15,7> <macOS;15.7.9;24G830> <com.apple.AuthKit/1 (com.apple.akd/1.0)>"

#if AAM_IDENTITY == 1
#define AAM_CLIENT_INFO @"<MacBookPro13,2> <macOS;13.1;22C65> <com.apple.AuthKit/1 (com.apple.akd/1.0)>"
#else
#define AAM_CLIENT_INFO @"<Mac15,7> <macOS;15.7.9;24G830> <com.apple.AuthKit/1 (com.apple.akd/1.0)>"
#endif

// The User-Agent AltSign sends (unmodified). It contains com.apple.dt.Xcode/26.0 and
// is accepted; only X-MMe-Client-Info is filtered.
#define AAM_USER_AGENT @"AuthKit/1 (Macintosh; OS X 26.5.2) (com.apple.dt.Xcode/26.0)"
// Mac identity for the Xcode app token, developer services, and non-iOS anisette.
// Mac15,7 / 15.7.9 has been rejected with ec=-22410 since 2026-11-21.
#define AAM_MAC_CLIENT_INFO @"<MacBookAir10,1> <Mac OS X;27.3;26C5035r> <com.apple.AuthKit/1 (com.apple.akd/1.0)>"
#define AAM_MAC_USER_AGENT @"akd/1.0 CFNetwork/3896.300.31 Darwin/27.3.0"

typedef NSURLSessionDataTask *(*AAMDataTaskImplementation)(id,
SEL,
Expand Down Expand Up @@ -201,6 +183,14 @@ static NSTimeInterval AAMRetryDelay(NSHTTPURLResponse *response, NSUInteger atte
}
}

static BOOL AAMIsAppTokensRequest(NSURLRequest *request)
{
if (request.HTTPBody == nil) return NO;
id plist = [NSPropertyListSerialization propertyListWithData:request.HTTPBody options:NSPropertyListImmutable format:NULL error:NULL];
NSDictionary *inner = [plist isKindOfClass:[NSDictionary class]] ? plist[@"Request"] : nil;
return [inner isKindOfClass:[NSDictionary class]] && [inner[@"o"] isEqual:@"apptokens"];
}

static NSURLSessionDataTask *AAMCreateAppleAuthenticationTask(id object,
SEL selector,
NSURLRequest *request,
Expand Down Expand Up @@ -298,16 +288,31 @@ static BOOL AAMIsDeveloperServicesRequest(NSURLRequest *request)
[host hasSuffix:@".developerservices2.apple.com"];
}

// akd's User-Agent on this device, e.g. "akd/1.0 CFNetwork/3826.400.120 Darwin/24.3.0".
static NSString *AAMNativeUserAgent(void)
{
static NSString *userAgent;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSString *cfnetwork = [NSBundle bundleWithIdentifier:@"com.apple.CFNetwork"].infoDictionary[@"CFBundleVersion"] ?: @"3826.400.120";
struct utsname name;
NSString *darwin = uname(&name) == 0 ? @(name.release) : @"24.3.0";
userAgent = [NSString stringWithFormat:@"akd/1.0 CFNetwork/%@ Darwin/%@", cfnetwork, darwin];
});
return userAgent;
}

static NSURLSessionDataTask *AAMDataTaskWithRequest(id object,
SEL selector,
NSURLRequest *request,
void (^completionHandler)(NSData *, NSURLResponse *, NSError *))
{
if (AAMIsDeveloperServicesRequest(request))
{
#if AAM_DEV_IDENTITY == 1
#if !AAM_LOG_ONLY
// Must match the identity of the Xcode app token, or Apple answers 1100.
NSMutableURLRequest *devRequest = [request mutableCopy];
[devRequest setValue:AAM_DEV_CLIENT_INFO forHTTPHeaderField:@"X-MMe-Client-Info"];
[devRequest setValue:AAM_MAC_CLIENT_INFO forHTTPHeaderField:@"X-MMe-Client-Info"];
return AAMOriginalDataTaskImplementation(object, selector, devRequest, completionHandler);
#else
return AAMOriginalDataTaskImplementation(object, selector, request, completionHandler);
Expand All @@ -316,27 +321,42 @@ static BOOL AAMIsDeveloperServicesRequest(NSURLRequest *request)

if (!AAMIsAppleAuthenticationRequest(request))
{
// Since 2026-11-20 the GSA edge answers 503 when client info contains "macOS;".
NSString *clientInfo = [request valueForHTTPHeaderField:@"X-MMe-Client-Info"];
if ([request.URL.host.lowercaseString isEqualToString:@"gsa.apple.com"] && [clientInfo containsString:@"<macOS;"])
{
NSMutableURLRequest *gsaRequest = [request mutableCopy];
[gsaRequest setValue:[clientInfo stringByReplacingOccurrencesOfString:@"<macOS;" withString:@"<Mac OS X;"]
forHTTPHeaderField:@"X-MMe-Client-Info"];
return AAMOriginalDataTaskImplementation(object, selector, gsaRequest, completionHandler);
}
return AAMOriginalDataTaskImplementation(object, selector, request, completionHandler);
}

NSMutableURLRequest *updatedRequest = [request mutableCopy];
NSString *originalClientInfo = [updatedRequest valueForHTTPHeaderField:@"X-MMe-Client-Info"];
BOOL hadCorrectClientInfo = [originalClientInfo containsString:@"com.apple.akd/1.0"];
BOOL nativeIdentity = [originalClientInfo containsString:@"<iPhone OS;"] || [originalClientInfo containsString:@"<iPadOS;"];
BOOL appTokens = AAMIsAppTokensRequest(request);

// AltStore 2.2.1 identifies the GSA request as a 2018 AuthKit client.
// Apple now rejects GSA requests identifying as Xcode. The client-info
// header is enforced here so the request cannot reuse that blocked token.
// Since 2026-11-21 GSA refuses SRP with ec=-22410 when the client info platform differs
// from the ADI that produced the OTP, so on-device (iOS) anisette keeps its own identity.
// The Xcode app token is refused for iOS (ec=-80046) and is still issued to a Mac identity.
#if !AAM_LOG_ONLY
[updatedRequest setValue:AAM_USER_AGENT forHTTPHeaderField:@"User-Agent"];
[updatedRequest setValue:AAM_CLIENT_INFO forHTTPHeaderField:@"X-MMe-Client-Info"];
if (nativeIdentity && !appTokens)
{
[updatedRequest setValue:AAMNativeUserAgent() forHTTPHeaderField:@"User-Agent"];
}
else
{
[updatedRequest setValue:AAM_MAC_USER_AGENT forHTTPHeaderField:@"User-Agent"];
[updatedRequest setValue:AAM_MAC_CLIENT_INFO forHTTPHeaderField:@"X-MMe-Client-Info"];
}
#endif

NSString *requestMessage = [NSString stringWithFormat:@"request path=%@ method=%@ correctedClientInfo=%@ headersOverridden=%@",
updatedRequest.URL.path ?: @"(none)",
updatedRequest.HTTPMethod ?: @"(none)",
hadCorrectClientInfo ? @"yes" : @"no",
AAM_LOG_ONLY ? @"no" : @"yes"];
AAMAppendDiagnostic(requestMessage);
AAMAppendDiagnostic([NSString stringWithFormat:@"request path=%@ op=%@ identity=%@",
updatedRequest.URL.path ?: @"(none)",
appTokens ? @"apptokens" : @"auth",
[updatedRequest valueForHTTPHeaderField:@"X-MMe-Client-Info"] ?: @"(none)"]);

return AAMCreateAppleAuthenticationTask(object, selector, updatedRequest, completionHandler, 0);
}
Expand Down Expand Up @@ -364,7 +384,7 @@ static void AAMInitialize(void)
method_setImplementation(class_getInstanceMethod(sessionClass, selector), (IMP)AAMDataTaskWithRequest);
}

AAMAppendDiagnostic([NSString stringWithFormat:@"loaded build=native-final in %@ sessionClass=%@",
AAMAppendDiagnostic([NSString stringWithFormat:@"loaded build=native-ios in %@ sessionClass=%@",
NSBundle.mainBundle.bundleIdentifier ?: @"(unknown)",
NSStringFromClass(sessionClass)]);
[probeSession invalidateAndCancel];
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# AltStore

> [!IMPORTANT]
> This fork contains **AltDaemonModern**, a source-level repair for rootless jailbreaks with on-device AuthKit anisette and anisette v3 fallback. See the [AltDaemonModern documentation](AltDaemon/README.md) for scope, build instructions, security notes, and device-testing guidance. The installed daemon is never modified by the build scripts.
> This fork contains **AltDaemonModern**, a source-level repair for rootless and RootHide jailbreaks with on-device AuthKit anisette and anisette v3 fallback. See the [AltDaemonModern documentation](AltDaemon/README.md) for scope, build instructions, security notes, and device-testing guidance. The installed daemon is never modified by the build scripts.

**[AltDaemon Modern 1.2.2](https://github.com/emp0ry/AltDaemonModern/releases/tag/v1.2.2)** addresses Apple authentication error `-80045` and an AltStore authentication-retry crash. Thanks to [ichitaso](https://github.com/ichitaso/AltDaemonModern) for the 1.2.2 fixes. See the [release notes](RELEASE_NOTES_1.2.2.md) for details and the tested configuration.
**[AltDaemon Modern 1.2.4](https://github.com/ichitaso/AltDaemonModern/releases/tag/v1.2.4)** fixes error -22410 that Apple began returning on 2026-11-21 for AltStore sign-in and refresh. See the [release notes](RELEASE_NOTES_1.2.4.md) for details and the tested configurations.

> AltStore is an alternative app store for non-jailbroken iOS devices.

Expand Down
30 changes: 30 additions & 0 deletions RELEASE_NOTES_1.2.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# AltDaemon Modern 1.2.3

## Changes

- Fixes the HTTP 503 that Apple's authentication server began returning on 2026-11-20 for AltStore sign-in, refresh, and installation. Apple's GSA edge now rejects `X-MMe-Client-Info` values whose OS name is `macOS;`. The AltStore compatibility module now sends `Mac OS X;`, and rewrites `<macOS;` in any other GSA request, such as values supplied by an anisette v3 server.
- Adds a Dopamine RootHide package, `AltDaemonModern_1.2.3_iphoneos-arm64e.deb`, built with the new `scripts/build-roothide-deb.sh`.
- Files are staged relative to the jbroot instead of `/var/jb`.
- `postinst` resolves the randomized jbroot with `jbroot /` and writes the absolute daemon path into the LaunchDaemon plist before bootstrapping it.
- AltDaemon is signed with `com.apple.private.security.no-sandbox` and the RootHide storage entitlements. Without them RootHide sandboxes the daemon, which denies the peer check on AltStore's connection and makes AltStore report that AltServer could not be found.
- The AltDaemon binary is unchanged from 1.2.2. Only the compatibility module and packaging changed.

## Tested configurations

- iPad (7th generation), iPadOS 18.3.2, Dopamine rootless: before the fix, every `GsService2` request returned a 190-byte HTML 503. With 1.2.3 the requests returned `hsc=200` with `ec=0`, and Refresh All succeeded.
- iPhone 11 Pro, iOS 26.0.1, Dopamine RootHide: the package installed and upgraded cleanly, the daemon started with both Mach services active, and Refresh All succeeded.

This does not guarantee success on every account, iOS version, or future Apple server change. The legacy RootHide Bootstrap was not tested.

## Installation

- Dopamine rootless: install `AltDaemonModern_1.2.3_iphoneos-arm64.deb` over the existing package.
- Dopamine RootHide: install `AltDaemonModern_1.2.3_iphoneos-arm64e.deb`.

Then fully close and reopen AltStore before trying Refresh All. Do not reset anisette state or sign out of Apple ID as a routine update step.

## Credits

Thanks to [ichitaso](https://github.com/ichitaso/AltDaemonModern) for the 503 fix and the RootHide package, and to the LiveContainer and SideStore communities for isolating the `macOS;` client-info change.

Thanks also to Riley Testut, AltStore, SideStore, and the other contributors. AltDaemon Modern remains open source under AGPL-3.0.
Loading
Loading