Commit Graph

78 Commits

Author SHA1 Message Date
Riley Testut
dd761daed6 [AltServer] Supports enabling JIT on devices running iOS 17
AltServer embeds the AltJIT CLI tool in its app bundle and runs it as an admin subprocess.
2023-09-08 14:15:55 -05:00
Riley Testut
e6cbd21d12 [AltServer] Uses correct app name and iOS version in ALTServerErrorUnsupportediOSVersion alert 2023-01-24 15:06:59 -06:00
Riley Testut
223495cdb9 [AltServer] Throws coder CocoaErrors if source JSON is invalid
Uses same error code with different debug descriptions. These errors should never be thrown in production so no need for unique codes, but if they do get thrown then they include enough technical information to debug.

Replaces OperationError.appNotFound
2023-01-24 15:06:12 -06:00
Riley Testut
4278e7db2b [AltServer] Fixes installation alerts not using device name
As of iOS 16, iOS apps can no longer read the device name. This means devices registered with AltStore (not AltServer) have generic names, so we should prefer using the name of provided ALTDevice rather than the name of device returned from server to ensure it’s correct.
2023-01-24 15:03:09 -06:00
Riley Testut
d5f4f4c625 [AltServer] Removes explicit AltStore download URL 2023-01-24 15:03:09 -06:00
Riley Testut
579885acd6 [AltServer] Downloads latest supported AltStore version for device OS version
Asks user to install latest compatible version instead if latest AltStore version does not support their device’s OS version.
2023-01-24 15:03:09 -06:00
Riley Testut
3b38d725d7 [Shared] Refactors error handling based on ALTLocalizedError protocol (#1115)
* [Shared] Revises ALTLocalizedError protocol

* Refactors errors to conform to revised ALTLocalizedError protocol

* [Missing Commit] Remaining changes for ALTLocalizedError

* [AltServer] Refactors errors to conform to revised ALTLocalizedError protocol

* [Missing Commit] Declares ALTLocalizedTitleErrorKey + ALTLocalizedDescriptionKey

* Updates Objective-C errors to match revised ALTLocalizedError

* [Missing Commit] Unnecessary ALTLocalizedDescription logic

* [Shared] Refactors NSError.withLocalizedFailure to properly support ALTLocalizedError

* [Shared] Supports adding localized titles to errors via NSError.withLocalizedTitle()

* Revises ErrorResponse logic to support arbitrary errors and user info values

* [Missed Commit] Renames CodableServerError to CodableError

* Merges ConnectionError into OperationError

* [Missed Commit] Doesn’t check ALTWrappedError’s userInfo for localizedDescription

* [Missed] Fixes incorrect errorDomain for ALTErrorEnums

* [Missed] Removes nonexistent ALTWrappedError.h

* Includes source file and line number in OperationError.unknown failureReason

* Adds localizedTitle to AppManager operation errors

* Fixes adding localizedTitle + localizedFailure to ALTWrappedError

* Updates ToastView to use error’s localizedTitle as title

* [Shared] Adds NSError.formattedDetailedDescription(with:)

Returns formatted NSAttributedString containing all user info values intended for displaying to the user.

* [Shared] Updates Error.localizedErrorCode to say “code” instead of “error”

* Conforms ALTLocalizedError to CustomStringConvertible

* Adds “View More Details” option to Error Log context menu to view detailed error description

* [Shared] Fixes NSError.formattedDetailedDescription appearing black in dark mode

* [AltServer] Updates error alert to match revised error logic

Uses error’s localizedTitle as alert title.

* [AltServer] Adds “View More Details” button to error alert to view detailed error info

* [AltServer] Renames InstallError to OperationError and conforms to ALTErrorEnum

* [Shared] Removes CodableError support for Date user info values

Not currently used, and we don’t want to accidentally parse a non-Date as a Date in the meantime.

* [Shared] Includes dynamic UserInfoValueProvider values in NSError.formattedDetailedDescription()

* [Shared] Includes source file + line in NSError.formattedDetailedDescription()

Automatically captures source file + line when throwing ALTErrorEnums.

* [Shared] Captures source file + line for unknown errors

* Removes sourceFunction from OperationError

* Adds localizedTitle to AuthenticationViewController errors

* [Shared] Moves nested ALTWrappedError logic to ALTWrappedError initializer

* [AltServer] Removes now-redundant localized failure from JIT errors

All JIT errors now have a localizedTitle which effectively says the same thing.

* Makes OperationError.Code start at 1000

“Connection errors” subsection starts at 1200.

* [Shared] Updates Error domains to revised [Source].[ErrorType] format

* Updates ALTWrappedError.localizedDescription to prioritize using wrapped NSLocalizedDescription as failure reason

* Makes ALTAppleAPIError codes start at 3000

* [AltServer] Adds relevant localizedFailures to ALTDeviceManager.installApplication() errors

* Revises OperationError failureReasons and recovery suggestions

All failure reasons now read correctly when preceded by a failure reason and “because”.

* Revises ALTServerError error messages
All failure reasons now read correctly when preceded by a failure reason and “because”.

* Most failure reasons now read correctly when preceded by a failure reason and “because”.
* ALTServerErrorUnderlyingError forwards all user info provider calls to underlying error.

* Revises error messages for ALTAppleAPIErrorIncorrectCredentials

* [Missed] Removes NSError+AltStore.swift from AltStore target

* [Shared] Updates AltServerErrorDomain to revised [Source].[ErrorType] format

* [Shared] Removes “code” from Error.localizedErrorCode

* [Shared] Makes ALTServerError codes (appear to) start at 2000

We can’t change the actual error codes without breaking backwards compatibility, so instead we just add 2000 whenever we display ALTServerError codes to the user.

* Moves VerificationError.errorFailure to VerifyAppOperation

* Supports custom failure reason for OperationError.unknown

* [Shared] Changes AltServerErrorDomain to “AltServer.ServerError”

* [Shared] Converts ALTWrappedError to Objective-C class

NSError subclasses must be written in ObjC for Swift.Error <-> NSError bridging to work correctly.

# Conflicts:
#	AltStore.xcodeproj/project.pbxproj

* Fixes decoding CodableError nested user info values
2023-01-24 13:56:41 -06:00
Riley Testut
a413c24b45 [AltServer] Fixes incorrect “Developer Disk incompatible with [OS version]” error
Previously we assumed that if there was an error installing the developer disk, it was incompatible with the device’s iOS version. Howevever, sometimes an iOS device needs to be rebooted before it can successfully mount a developer disk.

We now explicitly check for the latter scenario, and present a different error message asking the user to reboot their device if that’s the case.
2022-05-25 15:57:17 -07:00
Riley Testut
a04a27c1e3 Disables app group feature if app has no app groups
We can’t remove all app groups from an App ID once one has been assigned, but we _can_ disable app groups completely for effectively the same result.

This fixes some apps having permanant access to AltStore’s own app group after being (de-)activated.
2022-03-31 12:50:50 -07:00
Riley Testut
7a547c70e3 [AltServer] Fixes “App Group does not exist” error 2022-03-29 19:51:54 -07:00
Riley Testut
b0abf0e7a5 [AltServer] Replaces lock with semaphore when updating app groups
Locks can’t be unlocked from a separate thread than they were locked on…whoops.
2022-03-29 19:51:17 -07:00
Riley Testut
48c49c6ec7 [AltServer] Embeds ALTServerID in Info.plist if app uses AltKit 2022-03-29 19:34:47 -07:00
Riley Testut
ebb236e47c [AltServer] Improves ALTServerErrorIncompatibleDeveloperDisk error message
Uses NSError’s debug description, if available, to populate error alerts.
2022-03-01 16:07:20 -08:00
Riley Testut
37b00d670b [AltServer] Ignores incompatible cached developer disks
Fixes issue where AltServer would always use cached developer disk, even if it isn’t compatible with the device’s operating system version.
2022-03-01 16:03:03 -08:00
Riley Testut
5231ea1c1e [AltServer] Prefers revoking existing AltStore certificate (if it exists) 2021-10-04 15:51:16 -07:00
Riley Testut
35ae81c76c [AltServer] Fixes duplicate "Revoke Development Certificate" alerts 2021-10-04 15:43:31 -07:00
Riley Testut
a4d7d94301 [AltServer] Fixes not ignoring InstallationError.cancelled when installing app
Allows InstallationError to be bridged back from NSError, which lets us match InstallationError against NSError's via pattern matching.
2021-10-04 15:36:16 -07:00
Riley Testut
c6b8f69ef2 Improves ALTServerError.maximumFreeAppLimitReached error message
AltServer once again displays the list of installed sideloaded apps in error alert.
2021-10-04 15:21:57 -07:00
Cameron Bates
0570f2cd5b [AltServer] Include ALTDeviceID on install of apps (#822)
* Add ALTDeviceID to plist file on install
* Only add if deviceid key is present

Co-authored-by: Cameron Bates <cameronbates@camerons-mbp-2.lan>
2021-09-13 14:11:53 -07:00
Riley Testut
d4b957db23 [AltServer] Fixes isDeveloperDiskImageMountedForDevice()
Previously, we returned YES when there was no error. Instead, we should return YES only when there’s no error _and_ the developer disk image is installed.
2021-06-24 12:56:44 -07:00
Riley Testut
558a3fc865 [AltServer] Improves error messages 2021-06-04 14:57:32 -07:00
Riley Testut
d07bd33e06 [AltServer] Adds method to fetch installed apps on devices 2021-06-04 14:57:32 -07:00
Riley Testut
52fe74fbea [AltServer] Adds ALTDebugConnection to “debug” sideloaded apps
Allows AltServer to programmatically enable JIT execution in sideloaded apps.
2021-06-04 14:56:27 -07:00
Riley Testut
8857ccbf86 [AltServer] Installs Developer disk image before installing AltStore
Allows AltServer to programmatically initiate a debug session with AltStore, which can be used to start a background refresh or enable JIT on demand.

[AltServer] Renames ALTDevice variable name
2021-06-04 14:56:27 -07:00
Riley Testut
279a290b60 [AltServer] Reads devices’ OS version during discovery 2021-06-04 14:55:50 -07:00
Riley Testut
128a3fe2f2 [AltServer] Adds methods to detect + install Developer disk images on devices 2021-06-04 14:55:50 -07:00
Riley Testut
bc2dae1b21 [AltServer] Updates libimobiledevice dependency 2021-06-04 14:55:06 -07:00
Riley Testut
95eeafa06b [AltServer] Fixes missing embedded certificate when using cached certificate 2020-12-17 14:45:03 -06:00
Riley Testut
915eed3a69 [AltServer] Prefers paid developer teams over free teams 2020-12-03 16:06:04 -06:00
Riley Testut
f7a2c9f9f0 [AltServer] Supports multiple devices with same Apple ID
AltServer now caches certificates for each Apple ID used to install AltStore, and will re-use them for future installations rather than revoke + create new ones each time (if possible).
2020-12-03 16:06:04 -06:00
Riley Testut
f8f26bfb40 [AltServer] Fixes “RSTPlaceholderView.nib couldn’t be saved” error 2020-12-03 16:06:04 -06:00
Riley Testut
1ce9731465 [AltServer] Supports sideloading apps to Apple TV 2020-12-03 16:06:04 -06:00
Riley Testut
bb3b039672 [AltServer] Supports sideloading .ipa files directly to iOS devices 2020-11-11 17:40:28 -08:00
Riley Testut
fb3946aad5 [AltServer] Supports installing apps with app extensions 2020-10-15 11:37:58 -07:00
Riley Testut
de925e7fea Replaces AltSign cocoapod with Swift package 2020-09-03 16:02:28 -07:00
Riley Testut
e75d184194 [AltKit] Replaces dedicated AltKit module with shared files across targets
Treating AltKit as a full module resulted in more complexity than necessary, when we really just wanted to share some files between different targets. Now we can share individual files across modules as-needed without AltKit overhead.
2020-09-03 15:35:29 -07:00
Riley Testut
7262a6a1a0 [AltServer] Uses actual app bundle ID when installing app 2020-07-24 12:21:42 -07:00
Riley Testut
f564fc5190 [AltServer] Supports app groups when installing AltStore
Necessary for (de-)activation to work as expected in AltStore 1.3.4.
2020-05-19 18:30:53 -07:00
Riley Testut
1b8b043290 Supports resigning apps with multiple app groups 2020-05-17 23:47:24 -07:00
Riley Testut
ea6861b1eb [AltServer] Uses empty strings in place of nil error messages 2020-05-15 14:54:46 -07:00
Riley Testut
f5fc64be44 [AltServer] Supports “remove app” requests
Improves support for removing apps
2020-05-14 16:31:23 -07:00
Riley Testut
664c31aba8 [AltServer] Removes duplicate profiles even if they’re excluded 2020-04-01 12:19:25 -07:00
Riley Testut
197c3b3338 [AltServer] Fixes installing outdated profile after app installation 2020-03-30 15:06:16 -07:00
Riley Testut
0d65fc9974 [AltServer] Fixes installing more than 3 apps on 13.3 and below 2020-03-17 12:24:11 -07:00
Riley Testut
06fed802b1 [AltServer] Manages active/inactive profiles when installing apps 2020-03-11 13:51:39 -07:00
Riley Testut
5e25593c3d [Both] Improves error messages 2020-03-11 13:51:17 -07:00
Riley Testut
27bce4e456 [AltServer] Supports Install/Remove provisioning profiles requests
Stuff I shoulda committed
2020-03-06 17:14:29 -08:00
Riley Testut
345862c770 [AltServer] Fixes session expiring when downloading apps on slow connection 2020-01-16 16:00:35 -08:00
Riley Testut
e5061b52c2 [AltServer] Fixes memory leaks when installing apps 2020-01-14 12:19:38 -08:00
Riley Testut
ae98105772 [Both] Adds support for installing apps over USB 2020-01-13 10:17:30 -08:00