diff --git a/AltDaemon/AltDaemon.entitlements b/AltDaemon/AltDaemon.entitlements old mode 100644 new mode 100755 diff --git a/AltDaemon/AnisetteDataManager.swift b/AltDaemon/AnisetteDataManager.swift old mode 100644 new mode 100755 diff --git a/AltDaemon/README.md b/AltDaemon/README.md index ff5f6e1..84dfaf6 100644 --- a/AltDaemon/README.md +++ b/AltDaemon/README.md @@ -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 @@ -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 + `= 1.2) Description: Reliable rootless AltDaemon with current Apple login compatibility. @@ -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 diff --git a/AltDaemon/package/roothide/DEBIAN/postinst b/AltDaemon/package/roothide/DEBIAN/postinst new file mode 100644 index 0000000..9efc233 --- /dev/null +++ b/AltDaemon/package/roothide/DEBIAN/postinst @@ -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|/usr/bin/AltDaemon|$JBROOT/usr/bin/AltDaemon|" "$PLIST" + +launchctl bootout system "$PLIST" >/dev/null 2>&1 || true +launchctl bootstrap system "$PLIST" +launchctl kickstart -k user/foreground/com.rileytestut.altdaemon diff --git a/AltDaemon/package/roothide/DEBIAN/preinst b/AltDaemon/package/roothide/DEBIAN/preinst new file mode 100644 index 0000000..a4bdfc0 --- /dev/null +++ b/AltDaemon/package/roothide/DEBIAN/preinst @@ -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 diff --git a/AltDaemon/package/roothide/DEBIAN/prerm b/AltDaemon/package/roothide/DEBIAN/prerm new file mode 100644 index 0000000..a4bdfc0 --- /dev/null +++ b/AltDaemon/package/roothide/DEBIAN/prerm @@ -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 diff --git a/Compatibility/AltStoreAuthCompat/Tweak.m b/Compatibility/AltStoreAuthCompat/Tweak.m old mode 100644 new mode 100755 index 8d7b921..0a090d8 --- a/Compatibility/AltStoreAuthCompat/Tweak.m +++ b/Compatibility/AltStoreAuthCompat/Tweak.m @@ -1,34 +1,16 @@ #import #import #import +#import -// 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 @" " - -#if AAM_IDENTITY == 1 -#define AAM_CLIENT_INFO @" " -#else -#define AAM_CLIENT_INFO @" " -#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 @" " +#define AAM_MAC_USER_AGENT @"akd/1.0 CFNetwork/3896.300.31 Darwin/27.3.0" typedef NSURLSessionDataTask *(*AAMDataTaskImplementation)(id, SEL, @@ -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, @@ -298,6 +288,20 @@ 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, @@ -305,9 +309,10 @@ static BOOL AAMIsDeveloperServicesRequest(NSURLRequest *request) { 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); @@ -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:@" [!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. diff --git a/RELEASE_NOTES_1.2.3.md b/RELEASE_NOTES_1.2.3.md new file mode 100644 index 0000000..b42c29c --- /dev/null +++ b/RELEASE_NOTES_1.2.3.md @@ -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 ` `, and send the device's akd User-Agent built from its CFNetwork and Darwin versions. + - The Xcode app token request (`apptokens`) is refused for an iOS identity with -80046, so it uses ` ` with `akd/1.0 CFNetwork/3896.300.31 Darwin/27.3.0`. + - developerservices2 requests use the same Mac identity as the app token, as before, to avoid error 1100. + - When the anisette data does not come from the device (anisette v3 fallback), GSA requests still use the Mac identity. +- The previous `Mac15,7` / macOS 15.7.9 identity is no longer used. +- The AltDaemon binary is unchanged from 1.2.3. Only the compatibility module changed. + +## Tested configurations + +- iPad (7th generation), iPadOS 18.3.2, Dopamine rootless: before the fix, every SRP `init` returned `ec=-22410`. With 1.2.4, sign-in, the app token, and all developer-services requests succeeded, and Refresh All renewed apps to 7 days. +- iPhone 11 Pro, iOS 26.0.1, Dopamine RootHide: every GSA request returned `ec=0` and Refresh All succeeded. + +This does not guarantee success on every account, iOS version, or future Apple server change. + +## Installation + +- Dopamine rootless: install `AltDaemonModern_1.2.4_iphoneos-arm64.deb` over the existing package. +- Dopamine RootHide: install `AltDaemonModern_1.2.4_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 -22410 fix, and to the iloader and anisette-v3-server contributors for identifying the client info and ADI platform checks ([nab138/iloader#1243](https://github.com/nab138/iloader/pull/1243), [Dadoum/anisette-v3-server#62](https://github.com/Dadoum/anisette-v3-server/pull/62)). + +Thanks also to Riley Testut, AltStore, SideStore, and the other contributors. AltDaemon Modern remains open source under AGPL-3.0. diff --git a/Repo/README.md b/Repo/README.md new file mode 100644 index 0000000..698f1f5 --- /dev/null +++ b/Repo/README.md @@ -0,0 +1,34 @@ +# Repository packages + +`scripts/build-repo-debs.sh` builds the rootless and RootHide packages for the repository into this directory in one step. + +## Requirements + +- macOS with Xcode +- `ldid` and `dpkg-deb` + +## Build + +Run from the repository root: + +```sh +# Reuse the AltDaemon binary from an existing package (when the daemon source is unchanged) +scripts/build-repo-debs.sh Repo/com.ichitaso.altdaemon_1.2.3_iphoneos-arm64.deb + +# Use an AltDaemon binary you built +scripts/build-repo-debs.sh /path/to/AltDaemon + +# Build AltDaemon first with scripts/build-altdaemon.sh +scripts/build-repo-debs.sh +``` + +## Output + +| File | Jailbreak | +| --- | --- | +| `com.ichitaso.altdaemon__iphoneos-arm64.deb` | Dopamine rootless | +| `com.ichitaso.altdaemon__iphoneos-arm64e.deb` | Dopamine RootHide | + +The version is read from `AltDaemon/package/DEBIAN/control`. To release a new version, update it there and in `Repo/control`, then run the script. + +Both packages contain the same `AltStoreAuthCompat.dylib`. Only the RootHide package signs AltDaemon with the no-sandbox and storage entitlements. `.deb` files are ignored by git. diff --git a/Repo/control b/Repo/control index 71ee32b..204f182 100644 --- a/Repo/control +++ b/Repo/control @@ -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. diff --git a/scripts/build-repo-debs.sh b/scripts/build-repo-debs.sh new file mode 100755 index 0000000..866b649 --- /dev/null +++ b/scripts/build-repo-debs.sh @@ -0,0 +1,57 @@ +#!/bin/sh + +set -eu + +if [ "$#" -gt 1 ]; then + echo "usage: $0 [AltDaemon binary | existing AltDaemon .deb]" >&2 + echo "Without an argument, AltDaemon is built with scripts/build-altdaemon.sh." >&2 + exit 64 +fi + +ALTDAEMON_REPOSITORY_ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) +ALTDAEMON_REPO_DIR="$ALTDAEMON_REPOSITORY_ROOT/Repo" +ALTDAEMON_VERSION=$(sed -n 's/^Version: //p' "$ALTDAEMON_REPOSITORY_ROOT/AltDaemon/package/DEBIAN/control") +ALTDAEMON_WORK_DIR=$(mktemp -d "${TMPDIR:-/tmp}/altdaemon-modern-repo.XXXXXX") + +cleanup() +{ + rm -rf -- "$ALTDAEMON_WORK_DIR" +} +trap cleanup EXIT HUP INT TERM + +if [ "$#" -eq 0 ]; then + "$ALTDAEMON_REPOSITORY_ROOT/scripts/build-altdaemon.sh" + ALTDAEMON_BINARY="${ALTDAEMON_DERIVED_DATA_DIR:-${TMPDIR:-/tmp}/AltDaemonModernDerivedData}/Build/Products/Release-iphoneos/AltDaemon" +else + case "$1" in + *.deb) + dpkg-deb -x "$1" "$ALTDAEMON_WORK_DIR/source" + ALTDAEMON_BINARY=$(find "$ALTDAEMON_WORK_DIR/source" -path '*/usr/bin/AltDaemon' -type f | head -n 1) + ;; + *) + ALTDAEMON_BINARY=$1 + ;; + esac +fi + +if [ -z "$ALTDAEMON_BINARY" ] || [ ! -f "$ALTDAEMON_BINARY" ]; then + echo "error: AltDaemon binary not found" >&2 + exit 1 +fi + +# Build the compatibility module once so both packages ship the same dylib. +export ALTDAEMON_AUTH_COMPAT_BINARY="$ALTDAEMON_WORK_DIR/AltStoreAuthCompat.dylib" +"$ALTDAEMON_REPOSITORY_ROOT/scripts/build-altstore-auth-compat.sh" "$ALTDAEMON_AUTH_COMPAT_BINARY" + +ALTDAEMON_ROOTLESS_DEB="$ALTDAEMON_REPO_DIR/com.ichitaso.altdaemon_${ALTDAEMON_VERSION}_iphoneos-arm64.deb" +ALTDAEMON_ROOTHIDE_DEB="$ALTDAEMON_REPO_DIR/com.ichitaso.altdaemon_${ALTDAEMON_VERSION}_iphoneos-arm64e.deb" + +"$ALTDAEMON_REPOSITORY_ROOT/scripts/build-rootless-deb.sh" "$ALTDAEMON_BINARY" "$ALTDAEMON_ROOTLESS_DEB" +"$ALTDAEMON_REPOSITORY_ROOT/scripts/build-roothide-deb.sh" "$ALTDAEMON_BINARY" "$ALTDAEMON_ROOTHIDE_DEB" + +echo +echo "Repo packages ($ALTDAEMON_VERSION):" +for ALTDAEMON_DEB in "$ALTDAEMON_ROOTLESS_DEB" "$ALTDAEMON_ROOTHIDE_DEB" +do + echo " $(basename -- "$ALTDAEMON_DEB") $(dpkg-deb -f "$ALTDAEMON_DEB" Architecture)" +done diff --git a/scripts/build-roothide-deb.sh b/scripts/build-roothide-deb.sh new file mode 100755 index 0000000..c3eb476 --- /dev/null +++ b/scripts/build-roothide-deb.sh @@ -0,0 +1,89 @@ +#!/bin/sh + +set -eu + +if [ "$#" -lt 1 ] || [ "$#" -gt 2 ]; then + echo "usage: $0 [output.deb]" >&2 + exit 64 +fi + +ALTDAEMON_REPOSITORY_ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) +ALTDAEMON_ROOTLESS_PACKAGE="$ALTDAEMON_REPOSITORY_ROOT/AltDaemon/package" +ALTDAEMON_ROOTHIDE_PACKAGE="$ALTDAEMON_REPOSITORY_ROOT/AltDaemon/package/roothide" +ALTDAEMON_VERSION=$(sed -n 's/^Version: //p' "$ALTDAEMON_ROOTLESS_PACKAGE/DEBIAN/control") +ALTDAEMON_INPUT_BINARY=$1 +ALTDAEMON_DEB_OUTPUT=${2:-"$ALTDAEMON_REPOSITORY_ROOT/AltDaemonModern_${ALTDAEMON_VERSION}_iphoneos-arm64e.deb"} +ALTDAEMON_LDID_TOOL=${ALTDAEMON_LDID_TOOL:-ldid} +ALTDAEMON_DPKG_DEB_TOOL=${ALTDAEMON_DPKG_DEB_TOOL:-dpkg-deb} +ALTDAEMON_PACKAGE_STAGE=$(mktemp -d "${TMPDIR:-/tmp}/altdaemon-modern-roothide.XXXXXX") +ALTDAEMON_COMPAT_BUILD_DIR=$(mktemp -d "${TMPDIR:-/tmp}/altdaemon-modern-compat.XXXXXX") +ALTDAEMON_AUTH_COMPAT_BINARY=${ALTDAEMON_AUTH_COMPAT_BINARY:-"$ALTDAEMON_COMPAT_BUILD_DIR/AltStoreAuthCompat.dylib"} + +cleanup() +{ + rm -rf -- "$ALTDAEMON_PACKAGE_STAGE" "$ALTDAEMON_COMPAT_BUILD_DIR" +} +trap cleanup EXIT HUP INT TERM + +test -f "$ALTDAEMON_INPUT_BINARY" +command -v "$ALTDAEMON_LDID_TOOL" >/dev/null +command -v "$ALTDAEMON_DPKG_DEB_TOOL" >/dev/null + +if [ ! -f "$ALTDAEMON_AUTH_COMPAT_BINARY" ]; then + "$ALTDAEMON_REPOSITORY_ROOT/scripts/build-altstore-auth-compat.sh" "$ALTDAEMON_AUTH_COMPAT_BINARY" +fi + +# roothide installs into a randomized jbroot, so files are staged relative to it (no /var/jb). +mkdir -p \ + "$ALTDAEMON_PACKAGE_STAGE/DEBIAN" \ + "$ALTDAEMON_PACKAGE_STAGE/usr/bin" \ + "$ALTDAEMON_PACKAGE_STAGE/Library/LaunchDaemons" \ + "$ALTDAEMON_PACKAGE_STAGE/Library/MobileSubstrate/DynamicLibraries" \ + "$ALTDAEMON_PACKAGE_STAGE/usr/share/doc/altdaemonmodern" + +chmod 0755 "$ALTDAEMON_PACKAGE_STAGE" + +sed \ + -e 's/^Architecture: .*/Architecture: iphoneos-arm64e/' \ + -e 's/^Description: Reliable rootless AltDaemon/Description: Reliable RootHide AltDaemon/' \ + -e 's/This fork targets standard Dopamine rootless jailbreaks\./This build targets RootHide jailbreaks./' \ + "$ALTDAEMON_ROOTLESS_PACKAGE/DEBIAN/control" > "$ALTDAEMON_PACKAGE_STAGE/DEBIAN/control" +sed 's|/var/jb/|/|g' \ + "$ALTDAEMON_ROOTLESS_PACKAGE/var/jb/Library/LaunchDaemons/com.rileytestut.altdaemon.plist" \ + > "$ALTDAEMON_PACKAGE_STAGE/Library/LaunchDaemons/com.rileytestut.altdaemon.plist" + +cp "$ALTDAEMON_ROOTHIDE_PACKAGE/DEBIAN/preinst" "$ALTDAEMON_PACKAGE_STAGE/DEBIAN/preinst" +cp "$ALTDAEMON_ROOTHIDE_PACKAGE/DEBIAN/postinst" "$ALTDAEMON_PACKAGE_STAGE/DEBIAN/postinst" +cp "$ALTDAEMON_ROOTHIDE_PACKAGE/DEBIAN/prerm" "$ALTDAEMON_PACKAGE_STAGE/DEBIAN/prerm" +cp "$ALTDAEMON_INPUT_BINARY" "$ALTDAEMON_PACKAGE_STAGE/usr/bin/AltDaemon" +cp "$ALTDAEMON_AUTH_COMPAT_BINARY" "$ALTDAEMON_PACKAGE_STAGE/Library/MobileSubstrate/DynamicLibraries/AltStoreAuthCompat.dylib" +cp "$ALTDAEMON_REPOSITORY_ROOT/Compatibility/AltStoreAuthCompat/AltStoreAuthCompat.plist" "$ALTDAEMON_PACKAGE_STAGE/Library/MobileSubstrate/DynamicLibraries/AltStoreAuthCompat.plist" +cp "$ALTDAEMON_REPOSITORY_ROOT/LICENSE" "$ALTDAEMON_PACKAGE_STAGE/usr/share/doc/altdaemonmodern/AGPL-3.0.txt" +cp "$ALTDAEMON_REPOSITORY_ROOT/AltDaemon/NOTICE.md" "$ALTDAEMON_PACKAGE_STAGE/usr/share/doc/altdaemonmodern/NOTICE.md" + +chmod 0755 "$ALTDAEMON_PACKAGE_STAGE/DEBIAN/preinst" "$ALTDAEMON_PACKAGE_STAGE/DEBIAN/postinst" "$ALTDAEMON_PACKAGE_STAGE/DEBIAN/prerm" +chmod 0755 "$ALTDAEMON_PACKAGE_STAGE/usr/bin/AltDaemon" +chmod 0755 "$ALTDAEMON_PACKAGE_STAGE/Library/MobileSubstrate/DynamicLibraries/AltStoreAuthCompat.dylib" +chmod 0644 \ + "$ALTDAEMON_PACKAGE_STAGE/DEBIAN/control" \ + "$ALTDAEMON_PACKAGE_STAGE/Library/LaunchDaemons/com.rileytestut.altdaemon.plist" \ + "$ALTDAEMON_PACKAGE_STAGE/Library/MobileSubstrate/DynamicLibraries/AltStoreAuthCompat.plist" \ + "$ALTDAEMON_PACKAGE_STAGE/usr/share/doc/altdaemonmodern/AGPL-3.0.txt" \ + "$ALTDAEMON_PACKAGE_STAGE/usr/share/doc/altdaemonmodern/NOTICE.md" + +# roothide sandboxes the daemon otherwise, which blocks the peer check on AltStore's connection. +ALTDAEMON_ENTITLEMENTS="$ALTDAEMON_COMPAT_BUILD_DIR/AltDaemon-roothide.entitlements" +cp "$ALTDAEMON_REPOSITORY_ROOT/AltDaemon/AltDaemon.entitlements" "$ALTDAEMON_ENTITLEMENTS" +for ALTDAEMON_ENTITLEMENT in \ + com.apple.private.security.no-sandbox \ + com.apple.private.security.storage.AppBundles \ + com.apple.private.security.storage.AppDataContainers +do + /usr/libexec/PlistBuddy -c "Add :$ALTDAEMON_ENTITLEMENT bool true" "$ALTDAEMON_ENTITLEMENTS" +done + +"$ALTDAEMON_LDID_TOOL" -S"$ALTDAEMON_ENTITLEMENTS" "$ALTDAEMON_PACKAGE_STAGE/usr/bin/AltDaemon" +"$ALTDAEMON_LDID_TOOL" -S "$ALTDAEMON_PACKAGE_STAGE/Library/MobileSubstrate/DynamicLibraries/AltStoreAuthCompat.dylib" +"$ALTDAEMON_DPKG_DEB_TOOL" --build --root-owner-group "$ALTDAEMON_PACKAGE_STAGE" "$ALTDAEMON_DEB_OUTPUT" + +echo "Built roothide package: $ALTDAEMON_DEB_OUTPUT" diff --git a/scripts/build-rootless-deb.sh b/scripts/build-rootless-deb.sh index 40b45b7..9d5621b 100755 --- a/scripts/build-rootless-deb.sh +++ b/scripts/build-rootless-deb.sh @@ -9,7 +9,8 @@ fi ALTDAEMON_REPOSITORY_ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) ALTDAEMON_INPUT_BINARY=$1 -ALTDAEMON_DEB_OUTPUT=${2:-"$ALTDAEMON_REPOSITORY_ROOT/AltDaemonModern_1.2.2_iphoneos-arm64.deb"} +ALTDAEMON_VERSION=$(sed -n 's/^Version: //p' "$ALTDAEMON_REPOSITORY_ROOT/AltDaemon/package/DEBIAN/control") +ALTDAEMON_DEB_OUTPUT=${2:-"$ALTDAEMON_REPOSITORY_ROOT/AltDaemonModern_${ALTDAEMON_VERSION}_iphoneos-arm64.deb"} ALTDAEMON_LDID_TOOL=${ALTDAEMON_LDID_TOOL:-ldid} ALTDAEMON_DPKG_DEB_TOOL=${ALTDAEMON_DPKG_DEB_TOOL:-dpkg-deb} ALTDAEMON_PACKAGE_STAGE=$(mktemp -d "${TMPDIR:-/tmp}/altdaemon-modern-package.XXXXXX")