Commit Graph

250 Commits

Author SHA1 Message Date
Riley Testut
d53e36633d [AltStoreCore] Adds Source.isRecommended
Also replaces legacy “Trusted Sources” references with “Recommended Sources”
2024-12-26 21:15:29 +05:30
Riley Testut
2ccf01cf9c Logs misc. events with OSLog
* Discovering AltServers
* Clearing app cache
* Updating Friend Zone Patrons
2024-12-26 21:15:29 +05:30
Riley Testut
27ca2f285b Logs Fugu14-related events with OSLog 2024-12-26 21:15:29 +05:30
Riley Testut
93b6da4855 Logs sideloading-related events with OSLog 2024-12-26 21:15:29 +05:30
Riley Testut
a1865b6725 Fixes not showing “AltServer Not Found” error when refreshing via widget 2024-12-26 21:15:29 +05:30
Riley Testut
7747994c80 Converts legacy RefreshAllIntent into App Shortcut (iOS 17+) 2024-12-26 21:15:29 +05:30
Riley Testut
9b885085c9 Fixes race condition causing duplicate background refresh notifications (or none) 2024-12-26 21:15:29 +05:30
Riley Testut
86ae06e0c8 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.
2024-12-26 21:15:29 +05:30
Riley Testut
7f9ee81150 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.
2024-12-26 21:15:29 +05:30
Riley Testut
4f6eaf1aac Fixes incorrectly handling misc. CancellationErrors 2024-12-26 21:15:29 +05:30
Riley Testut
99db3dc086 Removes support for “background mode” permissions 2024-12-26 21:15:29 +05:30
Riley Testut
038efd9f9e Temporarily disables verifying added permissions
We’ll re-enable once we finish the “Review Permissions” screen.
2024-12-26 21:15:29 +05:30
Riley Testut
8c85290c74 Includes more detailed info in VerificationError.addedPermission error messages
* New version
* Previous version
* Added permissions
2024-12-26 21:15:29 +05:30
Riley Testut
2afaf73fc5 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.
2024-12-26 21:15:29 +05:30
Riley Testut
07bc34ae7a Verifies downloaded app’s build version matches source (if provided) 2024-12-26 21:15:29 +05:30
Riley Testut
f7640e35d1 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).
2024-12-26 21:15:29 +05:30
Riley Testut
5a2f32704c 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).
2024-12-26 21:15:29 +05:30
Riley Testut
bec6ca9eec Removes unused verificationHandler property from VerifyAppOperation 2024-12-26 21:15:29 +05:30
Riley Testut
254a9773ec Supports blocking third-party sources
Blocked sources cannot be added by new users, or updated for existing users.
2024-12-26 21:15:29 +05:30
Riley Testut
b9dd6432a1 Moves SourceError to its own source file 2024-12-26 21:15:29 +05:30
Riley Testut
d89c0f3e36 Verifies all privacy + background mode permissions have usage descriptions 2024-12-26 21:15:29 +05:30
Riley Testut
fd89f35246 Verifies app updates have same permissions as previously installed versions 2024-12-26 21:15:29 +05:30
Riley Testut
ee410605e8 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.
2024-12-26 21:15:29 +05:30
Riley Testut
f884d72a8b Verifies source’s identifier doesn’t match existing sources when adding 2024-12-26 21:15:29 +05:30
Riley Testut
bd3beb5983 Verifies source’s identifier doesn’t change after refreshing 2024-12-26 21:15:29 +05:30
Riley Testut
44e08b2d66 Verifies downloaded app’s version matches source 2024-12-26 21:15:29 +05:30
Riley Testut
d560e14423 Replaces OperationError.cancelled with CancellationError
Keeps `OperationError.cancelled` around for source-compatibility, but now returns CancellationError() instead of OperationError.
2024-12-26 21:15:29 +05:30
Riley Testut
7dfbba9b00 Verifies downloaded app’s SHA-256 checksum (if specified) 2024-12-26 21:15:29 +05:30
Riley Testut
7ad8db7bdc Moves VerificationError to its own source file 2024-12-26 21:15:29 +05:30
Riley Testut
64a9281e6e Removes Psychic Paper support from VerifyAppOperation 2024-12-26 21:15:29 +05:30
Riley Testut
23b6623020 Defines explicit error codes for OperationError.Code cases 2024-12-26 21:15:29 +05:30
Riley Testut
82cacb1b51 Supports adding/removing source from SourceDetailViewController 2024-12-26 21:15:29 +05:30
Riley Testut
404bd1450b Fixes error fetching Friend Zone patrons due to unexpected nil name 2024-12-26 21:15:29 +05:30
Riley Testut
06d28ca663 Removes unnecessary @available annotations 2024-12-26 21:15:29 +05:30
Riley Testut
ed1365281f Removes unnecessary #available checks 2024-12-26 21:15:29 +05:30
Riley Testut
2cfc307359 Adds “Clear Cache” button to remove temporary files and uninstalled app backups 2024-12-26 21:15:29 +05:30
Riley Testut
5da3974795 Fixes non-readable error toast view when an authentication error occurs 2024-12-26 21:15:29 +05:30
Riley Testut
8fcc5622e1 Fixes “missing provisioning profile” error when refreshing DEBUG builds
Removes embedded XCTest (+ dSYM) bundles before resigning for DEBUG builds.
2024-12-26 21:15:29 +05:30
Riley Testut
6c7223b991 Updates VerificationError.errorDescription to match ALTLocalizedError default implementation 2024-12-26 21:15:29 +05:30
Riley Testut
881091595c Verifies Sources don’t contain duplicate app versions 2024-12-26 21:15:29 +05:30
Riley Testut
2017584da4 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.
2024-12-26 21:15:29 +05:30
Riley Testut
35561336c6 Fixes delay updating UI after cancelling installing app 2024-12-26 21:15:29 +05:30
Riley Testut
f82743af98 Improves error message when file does not exist at AppVersion.downloadURL 2024-12-26 21:15:29 +05:30
Riley Testut
76f8fc6d9a Verifies min/max OS version before downloading app + asks user to download older app version if necessary 2024-12-26 21:15:29 +05:30
Riley Testut
b458e75098 [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.

* Fixes decoding CodableError nested user info values
2024-12-26 21:15:29 +05:30
June
3e941cfb0d attempt to fix long standing bug in bundle ids 2024-12-24 22:37:04 +09:00
June
8498f3df94 update again 2024-12-24 17:56:40 +09:00
June
faa1555294 update altsign again 2024-12-24 17:56:40 +09:00
Magesh K
db633c90be - Show Toast regarding server switch due to fallback if UI context is available 2024-11-28 22:01:47 +05:30
Magesh K
6c8e9b886d - Fix: Anisette-server-fallback: Try currently selected server first 2024-11-28 18:46:08 +05:30