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
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

All notable changes to SideInstaller are documented here.

## Unreleased

### Added
- **Tools › Pairing imports a pairing file** (#126). The page that generates and exports the
pairing file now has **Import pairing file** too, the same import as under the Install tab's
Advanced section.

### Fixed
- **SideStore's certificate opens when SideStore sends the wrong password** (#130). SideStore
0.6.4 sends a certificate it kept from SideStore 0.5.x with the certificate's machine identifier
as the password, while that certificate was written with the empty password, and SideInstaller
turned it down as "MAC tag mismatch". It now also tries the empty password, then the machine
identifiers and serial numbers of the team's certificates, as SideStore does with its own.
- **The certificate SideInstaller itself is signed with is marked** (#133). When Apple won't
issue another certificate, "Which certificate should be revoked?" now marks the one this copy
of SideInstaller was signed with, lists it last, and says that revoking it stops SideInstaller
from opening until it's installed again. Tools › Certificates marks it too. It's read from
SideInstaller's own code signature.
- **The developer disk image downloads when github.com doesn't answer** (#179). JIT and Location
spoofing stopped at "Downloading BuildManifest.plist failed (HTTP 504)"; each file now comes
from raw.githubusercontent.com, then jsDelivr, when github.com fails.
- **An IPA whose files carry setuid or setgid installs** (#119). Its extraction stopped at "Sign
the app" with "Operation not permitted", as iOS refuses those bits in an app's folder. They're
left out now, and a read-only file comes out writable, as signing needs.

## 2.4.1

### Fixed
Expand Down
9 changes: 9 additions & 0 deletions ios-app/CertManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ struct DevCert: Identifiable, Decodable, Equatable {
/// The certificate SideInstaller signs with: the only one whose private key
/// is on this iPhone, so the only one it can export.
var isSigning: Bool { signing == true }

/// The certificate this copy of SideInstaller was signed with, by whatever
/// installed it: revoking it stops SideInstaller from opening.
var signedSideInstaller: Bool { signedSideInstaller(serials: InstalledSigner.certificateSerials) }

/// `signedSideInstaller` against the serials of a signature's certificates.
func signedSideInstaller(serials: Set<String>) -> Bool {
!serialNumber.isEmpty && serials.contains(CodeSignature.portalSerial(serialNumber))
}
}

/// What `si_cert_import` reports: the team's certificate SideInstaller now signs
Expand Down
11 changes: 10 additions & 1 deletion ios-app/CertsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ struct CertsView: View {
} message: {
if let cert = pendingRevoke {
Text(L("“%@” will be revoked. Apps already signed with it will stop launching on every device. This can't be undone.",
cert.displayName))
cert.displayName)
+ (cert.signedSideInstaller
? " " + L("Revoking the certificate SideInstaller itself is signed with stops it from opening too, until it's installed again.")
: ""))
}
}
}
Expand Down Expand Up @@ -204,6 +207,12 @@ struct CertsView: View {
.font(.caption.weight(.medium))
.foregroundStyle(Theme.positive)
}
// Revoking this one stops SideInstaller from opening.
if cert.signedSideInstaller {
Label(L("SideInstaller itself is signed with this one"), systemImage: "exclamationmark.shield")
.font(.caption.weight(.medium))
.foregroundStyle(Theme.warning)
}
}
Spacer()
if cert.isExpired {
Expand Down
4 changes: 4 additions & 0 deletions ios-app/ChineseStrings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ let chineseStrings: [String: String] = [
"SideInstaller can export only the certificate it signs with, and none of these is it: a certificate's private key stays on the device that asked Apple for it.":
"SideInstaller 只能导出它用来签名的证书,而这里没有:证书的私钥只保存在向 Apple 申请它的设备上。",
"SideInstaller signs with this one": "SideInstaller 用此证书签名",
"SideInstaller itself is signed with this one": "SideInstaller 本身由此证书签名",

// MARK: - SideStore's certificate (sidestore://certificate)

Expand Down Expand Up @@ -972,6 +973,9 @@ let chineseStrings: [String: String] = [
"Every app already signed with the certificate you pick will stop launching, on every device — including apps installed by AltStore, SideStore, or a computer. This can't be undone. The install retries straight afterwards.":
"所有已用你选择的证书签名的 App 都将无法启动,在所有设备上都是如此——包括通过 AltStore、SideStore 或电脑安装的 App。此操作无法撤回。安装会紧接着重试。",
" (expired)": "(已过期)",
" (signed SideInstaller)": "(SideInstaller 由它签名)",
"Revoking the certificate SideInstaller itself is signed with stops it from opening too, until it's installed again.":
"吊销 SideInstaller 自身所用的签名证书后,SideInstaller 也将无法打开,直到重新安装。",

"Couldn't register this device": "无法注册此设备",
"Your Apple ID has hit its limit of registered devices. Free accounts can only register a handful of devices per year and can't remove old ones until the year resets.":
Expand Down
16 changes: 13 additions & 3 deletions ios-app/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@ struct InstallPopup: View {
.confirmationDialog(L("Which certificate should be revoked?"),
isPresented: $showRevokeChooser,
titleVisibility: .visible) {
ForEach(certManager.certs) { cert in
ForEach(revokeChoices) { cert in
Button(revokeButtonLabel(for: cert), role: .destructive) {
certManager.revoke(cert) {
engine.log("Retrying the install after revoking \(cert.displayName).")
Expand All @@ -1364,15 +1364,25 @@ struct InstallPopup: View {
} message: {
Text(certManager.certs.isEmpty
? L("Apple reports a certificate on this Apple ID, but none came back in the list. It may be a request that's still pending — wait a few minutes and tap Install again.")
: L("Every app already signed with the certificate you pick will stop launching, on every device — including apps installed by AltStore, SideStore, or a computer. This can't be undone. The install retries straight afterwards."))
: L("Every app already signed with the certificate you pick will stop launching, on every device — including apps installed by AltStore, SideStore, or a computer. This can't be undone. The install retries straight afterwards.")
+ (certManager.certs.contains(where: \.signedSideInstaller)
? " " + L("Revoking the certificate SideInstaller itself is signed with stops it from opening too, until it's installed again.")
: ""))
}
}

/// Names a certificate in the chooser, with its machine and expiry.
/// The chooser's certificates, the one SideInstaller was signed with last.
private var revokeChoices: [DevCert] {
certManager.certs.filter { !$0.signedSideInstaller } + certManager.certs.filter(\.signedSideInstaller)
}

/// Names a certificate in the chooser, with its machine and expiry, and
/// marks the one SideInstaller was signed with.
private func revokeButtonLabel(for cert: DevCert) -> String {
var label = cert.displayName
if let machine = cert.machineLabel { label += " — \(machine)" }
if cert.isExpired { label += L(" (expired)") }
if cert.signedSideInstaller { label += L(" (signed SideInstaller)") }
return label
}
}
Expand Down
4 changes: 4 additions & 0 deletions ios-app/FrenchStrings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ let frenchStrings: [String: String] = [
"SideInstaller can export only the certificate it signs with, and none of these is it: a certificate's private key stays on the device that asked Apple for it.":
"SideInstaller ne peut exporter que le certificat avec lequel il signe, et aucun de ceux-ci ne l'est : la clé privée d'un certificat reste sur l'appareil qui l'a demandé à Apple.",
"SideInstaller signs with this one": "SideInstaller signe avec celui-ci",
"SideInstaller itself is signed with this one": "SideInstaller lui-même est signé avec celui-ci",

// MARK: - SideStore's certificate (sidestore://certificate)

Expand Down Expand Up @@ -1009,6 +1010,9 @@ let frenchStrings: [String: String] = [
"Every app already signed with the certificate you pick will stop launching, on every device — including apps installed by AltStore, SideStore, or a computer. This can't be undone. The install retries straight afterwards.":
"Toutes les apps déjà signées avec le certificat choisi cesseront de se lancer, sur tous les appareils — y compris celles installées par AltStore, SideStore ou depuis un ordinateur. C'est irréversible. L'installation reprend juste après.",
" (expired)": " (expiré)",
" (signed SideInstaller)": " (a signé SideInstaller)",
"Revoking the certificate SideInstaller itself is signed with stops it from opening too, until it's installed again.":
"Révoquer le certificat avec lequel SideInstaller lui-même est signé l'empêche aussi de s'ouvrir, jusqu'à ce qu'il soit réinstallé.",

"Couldn't register this device": "Impossible d'enregistrer cet appareil",
"Your Apple ID has hit its limit of registered devices. Free accounts can only register a handful of devices per year and can't remove old ones until the year resets.":
Expand Down
4 changes: 4 additions & 0 deletions ios-app/ItalianStrings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ let italianStrings: [String: String] = [
"SideInstaller can export only the certificate it signs with, and none of these is it: a certificate's private key stays on the device that asked Apple for it.":
"SideInstaller può esportare solo il certificato con cui firma, e nessuno di questi lo è: la chiave privata di un certificato resta sul dispositivo che l'ha chiesto ad Apple.",
"SideInstaller signs with this one": "SideInstaller firma con questo",
"SideInstaller itself is signed with this one": "SideInstaller stesso è firmato con questo",

// MARK: - SideStore's certificate (sidestore://certificate)

Expand Down Expand Up @@ -1002,6 +1003,9 @@ let italianStrings: [String: String] = [
"Every app already signed with the certificate you pick will stop launching, on every device — including apps installed by AltStore, SideStore, or a computer. This can't be undone. The install retries straight afterwards.":
"Tutte le app già firmate con il certificato che scegli smetteranno di aprirsi, su qualsiasi dispositivo, comprese quelle installate con AltStore, SideStore o da un computer. L'operazione è irreversibile. L'installazione riparte subito dopo.",
" (expired)": " (scaduto)",
" (signed SideInstaller)": " (ha firmato SideInstaller)",
"Revoking the certificate SideInstaller itself is signed with stops it from opening too, until it's installed again.":
"Revocare il certificato con cui è firmato SideInstaller stesso impedisce anche a SideInstaller di aprirsi, finché non viene reinstallato.",

"Couldn't register this device": "Impossibile registrare questo dispositivo",
"Your Apple ID has hit its limit of registered devices. Free accounts can only register a handful of devices per year and can't remove old ones until the year resets.":
Expand Down
4 changes: 4 additions & 0 deletions ios-app/JapaneseStrings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ let japaneseStrings: [String: String] = [
"SideInstaller can export only the certificate it signs with, and none of these is it: a certificate's private key stays on the device that asked Apple for it.":
"SideInstaller が書き出せるのは署名に使っている証明書だけですが、この中にはありません。証明書の秘密鍵は、それを Apple に要求したデバイスにしかありません。",
"SideInstaller signs with this one": "SideInstaller はこの証明書で署名します",
"SideInstaller itself is signed with this one": "SideInstaller 自体がこの証明書で署名されています",

// MARK: - SideStore's certificate (sidestore://certificate)

Expand Down Expand Up @@ -915,6 +916,9 @@ let japaneseStrings: [String: String] = [
"Every app already signed with the certificate you pick will stop launching, on every device — including apps installed by AltStore, SideStore, or a computer. This can't be undone. The install retries straight afterwards.":
"選択した証明書で署名済みのすべてのアプリが、AltStore、SideStore、パソコンでインストールしたものも含め、すべてのデバイスで起動できなくなります。この操作は取り消せません。失効後、インストールは自動的に再試行されます。",
" (expired)": "(期限切れ)",
" (signed SideInstaller)": "(SideInstaller の署名に使用)",
"Revoking the certificate SideInstaller itself is signed with stops it from opening too, until it's installed again.":
"SideInstaller 自体の署名に使われている証明書を失効させると、再インストールするまで SideInstaller も開けなくなります。",

"Couldn't register this device": "このデバイスを登録できませんでした",
"Your Apple ID has hit its limit of registered devices. Free accounts can only register a handful of devices per year and can't remove old ones until the year resets.":
Expand Down
4 changes: 4 additions & 0 deletions ios-app/KoreanStrings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ let koreanStrings: [String: String] = [
"SideInstaller can export only the certificate it signs with, and none of these is it: a certificate's private key stays on the device that asked Apple for it.":
"SideInstaller는 서명에 사용하는 인증서만 내보낼 수 있는데, 이 목록에는 해당하는 인증서가 없습니다. 인증서의 개인 키는 Apple에 인증서를 요청한 기기에만 남아 있기 때문입니다.",
"SideInstaller signs with this one": "SideInstaller가 이 인증서로 서명합니다",
"SideInstaller itself is signed with this one": "SideInstaller 자체가 이 인증서로 서명되었습니다",

// MARK: - SideStore's certificate (sidestore://certificate)

Expand Down Expand Up @@ -916,6 +917,9 @@ let koreanStrings: [String: String] = [
"Every app already signed with the certificate you pick will stop launching, on every device — including apps installed by AltStore, SideStore, or a computer. This can't be undone. The install retries straight afterwards.":
"선택한 인증서로 서명된 모든 앱이 모든 기기에서 실행되지 않게 됩니다. AltStore, SideStore 또는 컴퓨터로 설치한 앱도 포함됩니다. 되돌릴 수 없습니다. 설치는 곧바로 다시 시도됩니다.",
" (expired)": " (만료됨)",
" (signed SideInstaller)": " (SideInstaller 서명에 사용됨)",
"Revoking the certificate SideInstaller itself is signed with stops it from opening too, until it's installed again.":
"SideInstaller 자체가 서명된 인증서를 폐기하면 다시 설치할 때까지 SideInstaller도 열리지 않습니다.",

"Couldn't register this device": "이 기기를 등록하지 못했습니다",
"Your Apple ID has hit its limit of registered devices. Free accounts can only register a handful of devices per year and can't remove old ones until the year resets.":
Expand Down
47 changes: 38 additions & 9 deletions ios-app/LocationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,53 @@ enum DeveloperDiskImage {
}
guard !missing.isEmpty else { progress(1); return }

let baseURL = "https://github.com/doronz88/DeveloperDiskImage/raw/refs/heads/main/PersonalizedImages/\(variant.folder)"
for (index, name) in missing.enumerated() {
progress(Double(index) / Double(missing.count))
guard let url = URL(string: "\(baseURL)/\(name)") else {
throw EngineError.message(L("Couldn't build the download URL for %@.", name))
}
let (tmp, response) = try await URLSession.shared.download(from: url)
guard let http = response as? HTTPURLResponse, (200..<300).contains(http.statusCode) else {
let code = (response as? HTTPURLResponse)?.statusCode ?? 0
throw EngineError.message(L("Downloading %@ failed (HTTP %d).", name, code))
}
let tmp = try await download(name, from: sources(of: name, in: variant))
let destination = directory.appendingPathComponent(name)
try? FileManager.default.removeItem(at: destination)
try FileManager.default.moveItem(at: tmp, to: destination)
Engine.shared.log("DDI: downloaded \(name) (\(variant.logName)).")
}
progress(1)
}

/// Where a file of the mirror is fetched from, in order. github.com hands
/// each file on to raw.githubusercontent.com, so that is tried on its own
/// next; jsDelivr serves the same repository from its CDN (each file is
/// under its 20 MB limit) when GitHub doesn't answer, as with the HTTP 504
/// in #179.
static func sources(of name: String, in variant: Variant) -> [URL] {
let path = "PersonalizedImages/\(variant.folder)/\(name)"
return [
"https://github.com/doronz88/DeveloperDiskImage/raw/refs/heads/main/\(path)",
"https://raw.githubusercontent.com/doronz88/DeveloperDiskImage/refs/heads/main/\(path)",
"https://cdn.jsdelivr.net/gh/doronz88/DeveloperDiskImage@main/\(path)",
].compactMap(URL.init(string:))
}

/// Downloads `name` from the first of `urls` that hands it over, to a
/// temporary file the caller moves. When none does, the error is the
/// first one's.
private static func download(_ name: String, from urls: [URL]) async throws -> URL {
var firstError: Error?
for url in urls {
do {
let (tmp, response) = try await URLSession.shared.download(from: url)
guard let http = response as? HTTPURLResponse, (200..<300).contains(http.statusCode) else {
try? FileManager.default.removeItem(at: tmp)
let code = (response as? HTTPURLResponse)?.statusCode ?? 0
throw EngineError.message(L("Downloading %@ failed (HTTP %d).", name, code))
}
return tmp
} catch {
if Task.isCancelled { throw CancellationError() }
Engine.shared.log("DDI: \(name) from \(url.host ?? "?") failed: \(error.localizedDescription)")
if firstError == nil { firstError = error }
}
}
throw firstError ?? EngineError.message(L("Couldn't build the download URL for %@.", name))
}
}

// MARK: - Saved places
Expand Down
Loading
Loading