Commit Graph

167 Commits

Author SHA1 Message Date
Riley Testut
7f148b1ce0 Converts legacy RefreshAllIntent into App Shortcut (iOS 17+) 2023-08-18 18:16:05 -05:00
Riley Testut
c97a11bbdf Fixes race condition causing duplicate background refresh notifications (or none) 2023-08-18 18:01:57 -05:00
Riley Testut
0db5e3caab Adds “Disable Response Caching” debug setting
When enabled, AltStore will ignore cached responses for certain requests and will always make a new request to the server. This is useful for development when repeatedly testing changes to remote files.

Limited to UpdateKnownSourcesOperation for now, but will eventually affect fetching sources as well.
2023-05-29 16:50:17 -05:00
Riley Testut
89a4f8369b Refactors app version comparison logic to always include buildVersion
Before, whether or not the source included the buildVersion affected the comparison. If present, the buildVersion was used in comparison, if not, only the version itself was used for comparsion.

This meant it was impossible to update from a version with a buildVersion to the same version without one (e.g. going from betas to final releases). Now we _always_ consider the buildVersion in the comparsion, so an earlier entry in versions array without buildVersion can be considered “newer” even if versions match.
2023-05-29 16:50:17 -05:00
Riley Testut
b2b0fd4c6f Fixes incorrectly handling misc. CancellationErrors 2023-05-29 16:50:17 -05:00
Riley Testut
4ed40cd544 Removes support for “background mode” permissions 2023-05-29 16:50:17 -05:00
Riley Testut
b662b90ea7 Temporarily disables verifying added permissions
We’ll re-enable once we finish the “Review Permissions” screen.
2023-05-29 16:48:43 -05:00
Riley Testut
260246a94d Includes more detailed info in VerificationError.addedPermission error messages
* New version
* Previous version
* Added permissions
2023-05-29 16:48:43 -05:00
Riley Testut
77bed04d68 Supports bypassing “Undeclared Permissions” error while sources are in beta
Presents error alert that can be explicitly bypassed by user when sideloading apps with undeclared permissions, and also allows user to view all undeclared permissions.
2023-05-22 15:02:26 -05:00
Riley Testut
9c2336832a Verifies downloaded app’s build version matches source (if provided) 2023-05-18 15:55:26 -05:00
Riley Testut
e97e48ba13 Supports app versions with explicit build versions
AltStore will now consider an update available if either:

* The source’s marketing version doesn’t match installed app’s version
* The source declares a build version AND it doesn’t match the install app’s build version

The installed app matches an app version if both maketing versions match, and the build versions match (if provided by the source).
2023-05-18 15:48:17 -05:00
Riley Testut
fe412a07b6 Updates SourceError.blocked recovery suggestion to list installed/blocked apps
If source is already added, the error message will list all installed apps from the source.

If adding source for first time, the error message will mention exactly which apps have been blocked from the source (if provided).
2023-05-16 15:44:30 -05:00
Riley Testut
5ba5bf995e Removes unused verificationHandler property from VerifyAppOperation 2023-05-15 18:40:47 -05:00
Riley Testut
bfb4fac42a Supports blocking third-party sources
Blocked sources cannot be added by new users, or updated for existing users.
2023-05-15 16:27:30 -05:00
Riley Testut
0255bd7b1c Moves SourceError to its own source file 2023-05-15 15:38:54 -05:00
Riley Testut
631109b54b Verifies all privacy + background mode permissions have usage descriptions 2023-05-15 15:29:51 -05:00
Riley Testut
af405d9e85 Verifies app updates have same permissions as previously installed versions 2023-05-15 15:14:13 -05:00
Riley Testut
45ed24bfb5 Verifies downloaded app’s permissions match source
Renames source JSON permissions key to “appPermissions” in order to preserve backwards compatibility, since we’ve changed the schema for permissions.
2023-05-12 18:26:24 -05:00
Riley Testut
729eb89433 Verifies source’s identifier doesn’t match existing sources when adding 2023-05-12 16:23:28 -05:00
Riley Testut
465be339fd Verifies source’s identifier doesn’t change after refreshing 2023-05-11 18:57:54 -05:00
Riley Testut
244a1de2ca Verifies downloaded app’s version matches source 2023-05-11 18:57:54 -05:00
Riley Testut
10ac6507ec Replaces OperationError.cancelled with CancellationError
Keeps `OperationError.cancelled` around for source-compatibility, but now returns CancellationError() instead of OperationError.
2023-05-11 18:57:54 -05:00
Riley Testut
ad41024bcb Verifies downloaded app’s SHA-256 checksum (if specified) 2023-05-11 18:57:53 -05:00
Riley Testut
e1b7c9b64e Moves VerificationError to its own source file 2023-05-11 18:57:15 -05:00
Riley Testut
ab4bc76ec9 Removes Psychic Paper support from VerifyAppOperation 2023-05-11 18:56:10 -05:00
Riley Testut
63868a2ff0 Fixes updating apps with manually-removed app extensions (e.g. uYou+) 2023-05-11 13:55:49 -05:00
Riley Testut
27a69036ae Merge branch 'source_detail' into develop 2023-04-04 18:15:59 -05:00
Riley Testut
428f08f3de Defines explicit error codes for OperationError.Code cases 2023-04-04 17:50:49 -05:00
Riley Testut
bd026b95b6 Supports adding/removing source from SourceDetailViewController 2023-04-04 16:55:55 -05:00
Riley Testut
15af909a3e Fixes error fetching Friend Zone patrons due to unexpected nil name 2023-03-28 14:37:47 -05:00
Riley Testut
7970258d50 Fixes “no provisioning profile with the requested identifier…” error
As of March 20, 2023, deleting an app’s auto-generated free provisioning profile is no longer supported. However, fetching the provisioning profile now re-generates is every time, so there’s no need to delete it first.

As a workaround, we now simply use the first profile we fetched if we receive an error when deleting it. This approach should continue to work even if Apple later reverses this change.
2023-03-21 09:00:44 -05:00
Riley Testut
961bc5aa66 Removes unnecessary @available annotations 2023-03-02 17:02:11 -06:00
Riley Testut
468e912e47 Removes unnecessary #available checks 2023-03-02 16:53:36 -06:00
Riley Testut
71cb3f3185 Fixes “variable mutated after capture by sendable closure” warning 2023-03-02 15:23:23 -06:00
Riley Testut
3adfc9db6d Adds “Clear Cache” button to remove temporary files and uninstalled app backups 2023-02-07 16:11:39 -06:00
Riley Testut
eeea64f780 Supports sideloading more than 3 apps via MacDirtyCow exploit
The MacDirtyCow exploit allows users to remove the 3 active apps limit on iOS 16.1.2 and earlier. To support this, we’ve added a new (hidden) “Enforce 3-App Limit” setting that can be disabled to allow sideloading more than 3 apps.
2023-02-06 17:37:54 -06:00
Riley Testut
957a53ecd6 Fixes non-readable error toast view when an authentication error occurs 2023-01-24 15:51:59 -06:00
Riley Testut
2f7bb83560 Fixes “missing provisioning profile” error when refreshing DEBUG builds
Removes embedded XCTest (+ dSYM) bundles before resigning for DEBUG builds.
2023-01-24 15:47:34 -06:00
Riley Testut
12f521321f Updates VerificationError.errorDescription to match ALTLocalizedError default implementation 2023-01-24 15:38:43 -06:00
Riley Testut
444e50eae8 Verifies Sources don’t contain duplicate app versions 2023-01-24 15:05:07 -06:00
Riley Testut
96dec5329d Verifies Sources don’t contain duplicate bundle IDs
AltStore assumes all apps have unique bundle IDs per source. Weird bugs can occur when this is not the case (such as merging multiple store listings into one), so we now verify upfront whether source contains duplicate bundle IDs before saving.
2023-01-24 15:03:09 -06:00
Riley Testut
40af2fe313 Fixes delay updating UI after cancelling installing app 2023-01-24 15:03:09 -06:00
Riley Testut
a03a5ac76c Improves error message when file does not exist at AppVersion.downloadURL 2023-01-24 15:03:09 -06:00
Riley Testut
5b20ce13bc Verifies min/max OS version before downloading app + asks user to download older app version if necessary 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
0c4fe98370 Adds ResultOperation.localizedFailure
Allows ResultOperations to provide default localized failures for errors that don’t have their own localized failure.
2023-01-24 13:42:55 -06:00
Riley Testut
6ec47bbe0c Adds Error Log screen
Allows users to view a history of all errors that occured when performing app operations.
2022-09-09 17:44:15 -05:00
Riley Testut
c232ef5044 Makes AppProtocol.url optional
Allows us to create AnyApp values without a valid file URL.
2022-09-08 15:59:24 -05:00
Riley Testut
9c1fe4d63b Fixes authenticating with old email address after changing Apple ID’s primary email 2022-05-25 16:45:27 -07:00
Riley Testut
dfd49de8d1 Replaces PatreonAccount.isFriendZone with ManagedPatron
Rather than store both the current user’s Patreon account and all cached Friend Zone patrons in the same table, we now store Friend Zone patrons in the new ManagedPatron table. This avoids the need to distinguish between the two at runtime.
2022-04-18 15:46:35 -07:00