Commit Graph

37 Commits

Author SHA1 Message Date
Riley Testut
f0a022c9ec Replaces StoreApp.setVersions() preconditionFailure with runtime error
It’s more common than expected for apps to not have any app versions, so better to fail gracefully than crash.
2023-01-24 15:05:02 -06:00
Riley Testut
16a7dea55b Fixes missing app icon for update errors in Error Log 2023-01-24 15:03:09 -06:00
Riley Testut
bc6b0cb722 Fixes potentially incorrect versions order when merging StoreApp 2023-01-24 15:03:09 -06:00
Riley Testut
1cfd83bbb7 Hides app updates that don’t support device’s OS version 2023-01-24 15:03:09 -06:00
Riley Testut
3574ed2ed9 Removes unnecessary StoreApp convenience properties 2023-01-24 15:03:09 -06:00
Riley Testut
701065b073 Parses AppVersion.minOSVersion/maxOSVersion from source JSON
Uses them to implement AppVersion.isSupported.
2023-01-24 15:01:56 -06:00
Riley Testut
7ea1ad5af0 Replaces StoreApp.latestVersion with latestSupportedVersion + latestAvailableVersion
We now store the latest supported version as a relationship on StoreApp, rather than the latest available version. This allows us to reference the latest supported version in predicates and sort descriptors.

However, we kept the underlying Core Data property name the same to avoid extra migration.
2023-01-24 15:00:31 -06:00
Riley Testut
266ac1ee50 Limits quitting other AltStore processes to database migrations only
Previously, AltStore would quit all other processes when first accessing the database no matter what. However, this unintentionally caused the widget extension to quit the main app after refreshing apps.

Now, we only quit other AltStore processes if a database migration is required. This still prevents multiple AltStores with different database schemas from accessing database concurrently, but also allows extensions to access database without quitting main app.
2023-01-24 14:23:42 -06:00
Riley Testut
7d48f5a7f3 Fixes logging non-ALTServerErrors errors as ALTServerError.underlyingError 2023-01-24 14:23:42 -06:00
Riley Testut
17f28439fe Includes “Enable JIT” errors in Error Log 2023-01-24 14:07:30 -06:00
Riley Testut
e2df5a46e6 Changes LoggedError.error from Swift.Error to NSError
LoggedError.error is always an NSError anyways, so we can now avoid redundant casting.
2023-01-24 13:39:44 -06:00
Riley Testut
6cfbe1e0e4 Prevents simultaneous database access from multiple AltStores
AltStore now sends a “WillAccessDatabase” notification before loading the persistent store, which causes other AltStore instances in memory to exit (either immediately, or upon returning to foreground).

This prevents multiple AltStore instances from simultaneously accessing the same database, which could result in corrupted data (especially if they used different database model versions).
2022-09-22 14:16:01 -05:00
Riley Testut
074d4295f3 Fixes “error migrating persistent store” issue
We now set AppVersion.sourceID during migration, which fixes AppVersion entries conflicting across different Sources if multiple contain the same app + version.
2022-09-20 13:12:47 -05:00
Riley Testut
b90000ecf3 Resolves AppVersion context-level conflict after migrating from Core Data model v10 2022-09-13 15:31:14 -07:00
Riley Testut
bcea3359ef Migrates Core Data model from v10 to v11 2022-09-13 14:46:03 -07:00
Riley Testut
46cd2be37d Supports new “versions” key in source JSON
Allows sources to list multiple versions of an app.

Preserves backwards compatibility by assigning legacy version values when assigning AppVersions.
2022-09-12 17:07:15 -07:00
Riley Testut
33674397b1 Adds AppVersion Core Data entity
Preserves redundant fields on StoreApp in database model for backwards compatibility.
2022-09-12 15:42:33 -07: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
00439fe292 Adds LoggedError Core Data entity
Allows us to save certain errors to disk so that they can be viewed again later from an error log.
2022-09-08 16:15:16 -05:00
Riley Testut
6b6f016189 Migrates Core Data model from v9 to v10 2022-04-18 16:01:48 -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
Riley Testut
aa8dd80e54 Adds (Managed)Patron Core Data entity
Will be used to cache Friend Zone patrons separately than the existing PatreonAccount entity.
2022-04-18 15:25:27 -07:00
Riley Testut
07daff261a Caches Friend Zone patrons to offset slow loading time
The Patreon API doesn’t have a way to fetch just the patrons belonging to our Friend Zone tier. Instead, we need to fetch ALL patrons (including inactive ones) and filter out those not in the tier. This is very inefficient, and takes over a minute to complete as of April 14, 2022, due to the number of patrons we have.

We can’t do much to change this, but AltStore will now at least cache the fetched patrons with Core Data. Additionally, AltStore will only perform this long fetch whenever the Friend Zone list actually changes, rather than every time the Patreon screen appears.
2022-04-14 17:56:36 -07:00
Riley Testut
8ddeb7f9fb Uses Keychain.patreonAccountID to fetch current user’s PatreonAccount
Allows us to distinguish between the current user and other cached patrons in the future.
2022-04-14 16:37:29 -07:00
Riley Testut
1f7c089c70 Supports adding trusted sources from SourcesViewController
Previously, only the beta version of AltStore could add sources. Now, the public version supports adding explicitly “trusted” sources, while the beta version can continue to add any source.
2022-04-14 16:33:49 -07:00
Riley Testut
3b45ab7f62 Updates AltSign dependency 2020-12-03 16:06:03 -06:00
Riley Testut
1f8e16dce8 Limits adding sources to allowed identifiers in non-BETA builds 2020-10-05 14:48:48 -07:00
Riley Testut
8b01a8d67c Migrates from Core Data model v8 to v9 2020-10-01 14:14:17 -07:00
Riley Testut
546db3fa23 Adds ability to change sideloaded app icons 2020-10-01 14:09:45 -07:00
Riley Testut
12f33c355a Adds InstalledApp.needsResign
When true, app will be resigned + reinstalled next refresh rather than just refreshing provisioning profiles.
2020-10-01 11:52:26 -07:00
Riley Testut
50a5d56856 Migrates database + cached apps from app sandbox to app group 2020-09-16 12:09:12 -07:00
Riley Testut
5abf7a5a11 [AltWidget] Initial version 2020-09-15 14:27:22 -07:00
Riley Testut
b0c36adedb Moves database + cached apps to app group so they can be accessed by extensions 2020-09-14 14:31:46 -07:00
Riley Testut
fb9b1a5c7d Adds new Core Data model v8
No need for explicit migration/mapping model (yet) because we only added a transient property.
2020-09-08 13:28:59 -07:00
Riley Testut
e70c51e36c Updates UI when refreshing apps with Siri 2020-09-08 13:12:40 -07:00
Riley Testut
3d9417c071 Switches to UIScene-based lifecycle 2020-09-03 16:58:56 -07:00
Riley Testut
f1a39e1a1f [AltStoreCore] Refactors core AltStore logic into AltStoreCore framework
AltStoreCore will contain all shared AltStore code between AltStore and any app extensions. Initially, it includes all AltStore model logic.
2020-09-03 16:39:08 -07:00