Skip to content
Merged
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
46 changes: 16 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,45 +27,31 @@ Sideloading tools tend to fail in a few recurring ways. IPAForge is designed aro

| Common failure | How IPAForge handles it |
|---|---|
| Apple ID sign-in errors (`-80045`) | Anisette servers are health-checked and fall back automatically; macOS uses native anisette |
| Apple ID sign-in errors (`-80045`) | Anisette servers come from SideStore's up-to-date list and fall back automatically, or you choose or add your own in Settings |
| `HTTP 404` when downloading SideStore or LiveContainer | Releases are resolved through the GitHub API from a catalog that can be updated remotely, never from hard-coded URLs |
| "Unable to verify app" after installing | The signer matches Apple `codesign` byte for byte, and each extension gets the entitlements from its own profile |
| Errors that don't say what to do | Every failure has a stable error code, a plain-language explanation and the fixes that apply |

## Features

- **One-click SideStore.** Install SideStore, or LiveContainer with SideStore, from the Stable or Nightly channel. The pairing file and signing certificate are placed automatically.
- **Keep apps working.** The Apps page lists what IPAForge installed, with when each app expires, and refreshes them (signed again, data kept) with one press or by itself before they expire. It updates them from their source too.
- **Preload apps.** Drop .ipa files, choose them, add a link, or browse apps from the catalog (LiveContainer, StikDebug, Feather…), SideStore's source and any AltStore-format source you add. Each app is checked before anything changes: its version, the App IDs it needs, whether the device can run it, and whether it updates one already installed. Then they install in one run.
- **Repair SideStore.** IPAForge checks, line by line, what keeps SideStore from refreshing your apps by itself (who signed it, its certificate, its pairing file, when it expires) and fixes it in one go.
- **SideStore links and QR codes.** Add a source to SideStore on the iPhone, or have SideStore install an app, by scanning a code.
- **A checklist for each device.** What it needs for its iOS version (Trust, a passcode, Developer Mode, trusting your Apple ID, LocalDevVPN for SideStore), ticked as you go.
- **Clear install plan.** Before anything changes, IPAForge shows what the install uses: App IDs and how many are left this week, free-app slots on the device, whether the certificate is reused, and the team.
- **Live progress.** Every step reports what it did, for example the release it found, whether a saved session was reused, or how many App IDs it registered.
- **Recovery, not dead ends.** Failures lead to a screen with the fixes that apply, such as continuing from where the run stopped or switching Apple ID. Diagnostics can be copied, and an issue report opens pre-filled.
- **Multiple Apple IDs.** Saved in the system keychain, with free and paid teams, and a quick switch when one is blocked on a device.
- **One-click SideStore.** SideStore, or LiveContainer with SideStore, Stable or Nightly. The pairing file and certificate are placed for you.
- **Preload your apps.** Drop .ipa files, paste a link, or browse the catalog, SideStore's source and any AltStore-format source you add. Each app is checked before anything changes, then they all install in one run.
- **Apps that don't expire.** See when each app expires. Refresh works like SideStore's: a new profile while your certificate is valid, nothing reinstalled. IPAForge can refresh them by itself before they expire.
- **Repair SideStore.** Checks what keeps SideStore from refreshing by itself, line by line, and fixes it in one go.
- **QR codes for SideStore.** Add a source to SideStore on your iPhone, or have SideStore install an app, by scanning a code.
- **A checklist for each iPhone.** Trust, passcode, Developer Mode, trusting your Apple ID, LocalDevVPN: what your iOS version needs, ticked as you go.
- **Recovery, not dead ends.** Every failure has a screen with the fixes that apply, copyable diagnostics and a pre-filled bug report.
- **Live progress.** Every step shows what it's doing: speed and time left while sending the app, Apple's steps, and iOS's own install progress, over USB or Wi-Fi.
- **Logs you can share.** Every step IPAForge took, with search and filters, saved to a file to attach to a bug report.
- **Several Apple IDs.** Two-factor sign-in with a code on your devices or by text. Kept in your system keychain, free and paid teams, with a quick switch when Apple blocks one on a device.
- **Anisette servers your way.** IPAForge picks a working server by itself from SideStore's list, with its own servers as a backup. Or choose one, add your own (a server on your computer included), and test each one.
- **Works within Apple's limits.** The App ID quota, the three-app limit for free accounts and certificate limits are checked before any change, and each is explained.
- **Your language.** The language follows the system, and right-to-left languages are supported. Six languages today, every language iOS supports by 1.0.
- **Themes.** Six colour palettes, each with light and dark variants.
- **Updates itself.** IPAForge checks for a new version when it opens and installs it, each update checked against its release's Sigstore signature first. **What's new** says what changed, in plain words.
- **Updates itself.** A new version installs when IPAForge opens, after its release signature checks out, and What's new tells you what changed.
- **Your language, your look.** Six languages, right to left included, and six colour themes in light and dark.

Coming next: guided onboarding, management tools for certificates and App IDs, and wireless pairing with the iOS 17+ remote pairing file. Installing over Wi-Fi to a device paired before already works.
Sideload signing has been verified against real devices and Apple accounts: Apple's own `codesign --verify --deep --strict` accepts the output, including a full SideStore build signed in about half a second. Details: [Code Signing](docs/signing.md).

## Project status

| Component | Package | Status |
|---|---|---|
| Code signing | `@ipaforge/signer` | ✅ Complete: matches Apple `codesign` on golden fixtures, verified with a real Apple Development certificate |
| Device communication | `@ipaforge/device` | ✅ Complete: usbmux, lockdown, pairing, AFC, house_arrest, installation_proxy, misagent |
| Apple account | `@ipaforge/apple` | ✅ Complete: sign-in with two-factor authentication, anisette with fallback, saved accounts |
| Developer services | `@ipaforge/apple` | ✅ Complete: teams, certificates, App IDs, app groups, devices, provisioning profiles |
| Release catalog | `@ipaforge/catalog` | ✅ Complete: GitHub release resolution, mirrors, verified downloads, cache, AltStore-format app sources |
| Install engine | `@ipaforge/installer` | ✅ Complete: resumable pipelines, install flows, free-app limit, error catalogue |
| Engine ⇄ UI protocol | `@ipaforge/rpc` | ✅ Complete: typed, validated messages over Electron IPC, and the update channel |
| User interface | `@ipaforge/ui` | ✅ Install and preload complete: accounts, devices with their checklist, the install run with its questions, step details and recovery, Preload with app sources, Apps with refresh, Repair SideStore, the log viewer, and What's new, in six languages, checked by screenshot and WCAG 2.2 AA tests; onboarding comes next |
| Desktop app | `apps/desktop` | ✅ Complete: installers for macOS (DMG, zip), Windows (NSIS, MSI) and Linux (AppImage, deb, rpm), built, Sigstore-signed and published by CI on a version tag; updates itself, checking each update's signature. Windows code signing and Apple notarisation come with 1.0 |

Sideload signing has been verified against real devices and Apple accounts. Apple's own `codesign --verify --deep --strict` accepts the output, including a full SideStore build signed in about half a second. Details: [Code Signing](docs/signing.md).
Coming next: guided onboarding, management tools for certificates and App IDs, and wireless pairing with the iOS 17+ remote pairing file. Installing over Wi-Fi to a device paired before already works.

## Requirements

Expand Down
31 changes: 31 additions & 0 deletions apps/desktop/src/main/adapters/adapters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,37 @@ describe('encrypted file secret store', () => {
})
})

describe('encrypted file secret store, when the keychain says no', () => {
it('asks for the key again next time, so a later Allow is used', async () => {
const { createEncryptedFileSecretStore } = await import(
'@desktop/main/adapters/encrypted-file-secret-store.ts'
)
const dir = await mkdtemp(join(tmpdir(), 'ipaforge-enc-'))
try {
const key = crypto.getRandomValues(new Uint8Array(32))
let asked = 0
const store = createEncryptedFileSecretStore(
join(dir, 'secrets.enc'),
async () => {
asked += 1
if (asked === 1) throw new Error('denied')
return key
}
)
await expect(
store.set('apple/session/x', utf8Encode('value'))
).rejects.toThrow('denied')
await store.set('apple/session/x', utf8Encode('value'))
expect(
utf8Decode((await store.get('apple/session/x')) ?? new Uint8Array())
).toBe('value')
expect(asked).toBe(2)
} finally {
await rm(dir, { recursive: true, force: true })
}
})
})

describe('file download store', () => {
it('keeps only verified downloads and never leaves partial files', async () => {
const { createFileDownloadStore } = await import(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ export const createEncryptedFileSecretStore = (
let loading: Promise<SecretRecord> | undefined

const cryptoKey = (): Promise<CryptoKey> => {
key ??= keyProvider().then(importAesKey)
key ??= keyProvider()
.then(importAesKey)
.catch((error: unknown) => {
// The keychain said no (or was dismissed): ask again next time, so a later Allow is not ignored.
key = undefined
throw error
})
return key
}

Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ const createUpdates = (logger: Logger) =>
readText
}),
arch: process.arch,
translated: app.runningUnderARM64Translation,
logger
})

Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src/main/updates/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export const RELEASE_WORKFLOWS = [
export const UNTRUSTED_SIGNER = 'UNTRUSTED_SIGNER_ERROR'
export const SIGSTORE_ISSUER = 'https://token.actions.githubusercontent.com'

/** Where an Intel build running under Rosetta sends the user for the Apple silicon one. */
export const NATIVE_BUILD_URL = `${RELEASES_URL}/latest`

/** How long the check may take before IPAForge opens without it (offline, a slow network). */
export const CHECK_TIMEOUT_MS = 15_000

Expand Down
2 changes: 2 additions & 0 deletions apps/desktop/src/main/updates/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export type UpdateServiceDeps = {
readonly kind: InstallKind
/** `process.arch`, to name the right file for a package that can't update itself. */
readonly arch: string
/** The Intel build running under Rosetta on Apple silicon (Electron's `app.runningUnderARM64Translation`). */
readonly translated?: boolean
readonly logger: Logger
readonly checkTimeoutMs?: number
readonly installDelayMs?: number
Expand Down
20 changes: 20 additions & 0 deletions apps/desktop/src/main/updates/update-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,26 @@ describe('createUpdateService', () => {
expect(service.current()).toEqual({ phase: 'idle' })
})

it('says where the Apple silicon build is when the Intel one runs under Rosetta', async () => {
const service = createUpdateService({
updater: fakeUpdater(undefined).port,
verifier: signedBy(),
kind: 'self',
arch: 'x64',
translated: true,
logger
})
service.start()
await vi.runAllTimersAsync()

expect(service.current()).toEqual({
phase: 'idle',
nativeBuild: {
url: 'https://github.com/IPAForge/ipaforge/releases/latest'
}
})
})

it('downloads a newer version with progress, then installs it', async () => {
const updater = fakeUpdater(NEXT)
const { service } = start(updater.port)
Expand Down
9 changes: 7 additions & 2 deletions apps/desktop/src/main/updates/update-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
// on. A package that can't update itself only says which file to download.
import {
CHECK_TIMEOUT_MS,
INSTALL_DELAY_MS
INSTALL_DELAY_MS,
NATIVE_BUILD_URL
} from '@desktop/main/updates/constants.ts'
import {
manualUpdate,
Expand All @@ -17,7 +18,6 @@ import type {
} from '@desktop/main/updates/types.ts'
import type { UpdateState } from '@ipaforge/rpc'

const IDLE: UpdateState = { phase: 'idle' }
const MAX_REASON_LENGTH = 500

const reasonOf = (error: unknown): string =>
Expand All @@ -41,11 +41,16 @@ export const createUpdateService = ({
verifier,
kind,
arch,
translated = false,
logger,
checkTimeoutMs = CHECK_TIMEOUT_MS,
installDelayMs = INSTALL_DELAY_MS
}: UpdateServiceDeps): UpdateService => {
const log = logger.child({ scope: 'updates' })
// Done; an Intel build on Apple silicon also says where the faster one is.
const IDLE: UpdateState = translated
? { phase: 'idle', nativeBuild: { url: NATIVE_BUILD_URL } }
: { phase: 'idle' }
const listeners = new Set<(state: UpdateState) => void>()
let state: UpdateState = updater ? { phase: 'checking' } : IDLE
let isRunning = false
Expand Down
8 changes: 6 additions & 2 deletions docs/apple-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
- The server never sees your Apple ID or password.
- IPAForge keeps one identity per server and reuses it. Apple distrusts a new machine on every attempt.
- If a server is down, the next one is used automatically.
- The servers are a custom one (if set), the built-in ones, then the community list (`servers.sidestore.io/servers.json`, HTTPS servers only). The list is fetched when anisette is first needed and again once it is an hour old (on the next request, never polled); after a failed fetch it is tried again a minute later. The last list fetched is kept in the secret store, so an offline start or a failed fetch still uses it (`anisetteServerListMaxAgeMs`, `anisetteServerListRetryMs` in the config).
- **Automatic** (the default) tries the servers you added (newest first), then the one that worked last, then SideStore's list (`servers.sidestore.io/servers.json`, HTTPS servers only, in its order), then IPAForge's built-in servers that list lacks, as a backup.
- **Settings → Anisette servers** shows them in that order with where each comes from, and lets you test one or all (how fast each answers), update SideStore's list now, and add, edit or remove your own (name and address; plain `http://` is allowed only for a server you add, such as one on your own computer). **Choose a server** uses only the one you pick; a server you add while choosing is the one picked. Until you pick one, IPAForge still chooses by itself. The settings are kept in `anisette/settings`, next to the machine identity. Switching servers gives Apple a new machine identity, so the next sign-in may ask for a code.
- The community list is fetched when anisette is first needed and again once it is an hour old (on the next request, never polled); after a failed fetch it is tried again a minute later. The last list fetched is kept in the secret store, so an offline start or a failed fetch still uses it (`anisetteServerListMaxAgeMs`, `anisetteServerListRetryMs` in the config).
2. **Password check (SRP).** Apple checks a proof of your password and returns encrypted session data.
3. **Second factor.** If your account has trusted devices, IPAForge asks Apple to show a code on them straight away and opens the code step; you tap **Allow** on the device and type the code. **Didn't get a code?** offers **Send a new code** and, when the account has phone numbers, **Text** a number instead. When Apple refuses to send another (too many in a row), the step says so and stays open.
4. **Developer token.** IPAForge requests the token Xcode uses for developer services. It is valid for about a year.
Expand Down Expand Up @@ -69,7 +71,9 @@ After sign-in, IPAForge uses the same developer API Xcode uses, through `apple.d

| Code | Meaning | What to do |
|---|---|---|
| `apple.anisette_unavailable` | No anisette server answered | Check the connection; try again later, or set a custom server |
| `apple.anisette_unavailable` | No anisette server answered (with a chosen server, `chosen` names it) | Check the connection; **Choose another anisette server** opens Settings at the servers |
| `apple.anisette_server_invalid` | A server you added has no name, an address that isn't `http(s)://`, or a placeholder address | Correct the name or address |
| `apple.anisette_server_exists` | A server you added is in the list already | Choose it from the list instead |
| `apple.client_rejected` (`-80045`, `-90010`) | Apple is rejecting this sign-in method right now | Update IPAForge; it usually needs a config update |
| `apple.invalid_credentials` (`-22406`, `-20970`) | Wrong Apple ID or password | Check them. IPAForge never retries a wrong password, so your account cannot be locked by repeated attempts |
| `apple.account_locked` | Apple locked the account | Unlock it at iforgot.apple.com |
Expand Down
1 change: 1 addition & 0 deletions docs/design/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Every feature below maps to the phases that deliver it. "Automatic" means the us
- later: AltStore as an install target (`ALTDeviceId` in `Info.plist` and an encrypted `ALTPairingFile.dat` at the bundle root)
- when Apple reports a negative number of App IDs left, the error says the count looks wrong and Try anyway asks Apple to create them (#73)
- an app IPAForge didn't install is never installed again first from a source whose version is older than the device's; the picker says "older than installed" (#73)
- anisette servers in Settings: Automatic (the user's servers, then the last that worked, SideStore's list in its order, then the built-in servers as a backup) or one chosen server; test one or all, update SideStore's list, add, edit and remove your own (http allowed only for these), a note on the list's non-HTTPS servers, a warning when the chosen server doesn't answer; "Choose another anisette server" opens the card. Also: background checks never ask Apple for a 2FA code, Sign in again uses the saved password and asks only for the code, a refused keychain prompt is asked again, nothing but the update check runs until it's done, the app's mark in the top bar, and a note when the Intel build runs under Rosetta (#80)
- [x] **9. Desktop app**: Electron 44 shell with Node adapters, a hardened preload (`contextIsolation`, typed RPC only), electron-builder packages (Windows NSIS, macOS DMG signed and notarized, Linux AppImage, deb and rpm), and auto-update
- status: the shell (one window with `contextIsolation`, `sandbox`, a strict CSP and blocked navigation, rendering `@ipaforge/ui`) runs the real Engine over the rpc MessagePort, CI builds and Sigstore-signs it on Linux, Windows and macOS, and it updates itself (each update's signature checked); Windows code signing and Apple notarisation moved to 1.0
- progress:
Expand Down
Loading
Loading