Commit Graph

66 Commits

Author SHA1 Message Date
Riley Testut
1b56ac708f Refactors SourceViewController into dedicated tab
* Updates UI to use source icons + tint colors
* Adds Edit button + swipe actions
2023-10-17 14:49:13 -05:00
Riley Testut
ff46fb38b9 [AltStoreCore] Adds Source.isRecommended
Also replaces legacy “Trusted Sources” references with “Recommended Sources”
2023-10-16 18:26:59 -05:00
Riley Testut
24334f88ce [AltStoreCore] Updates DatabaseManager to support #Preview macro
Synchronously loads database via startForPreview(), and also erases database for DEBUG builds.

# Conflicts:
#	AltStore.xcodeproj/project.pbxproj
2023-10-16 16:56:51 -05:00
Riley Testut
1a42aaeae8 [AltStoreCore] Fixes “any ALTAppPermission cannot conform to 'Hashable’” Xcode 15 compiler error 2023-09-05 13:38:49 -05:00
Riley Testut
21c2f8d5ce [AltWidget] Adds interactive Active Apps widget to view + refresh all active apps (iOS 17+) 2023-09-05 13:11:21 -05:00
Riley Testut
7e29258d40 [AltStoreCore] Updates AltStore12ToAltStore13 mapping model for latest model changes
* Non-optional AppPermission.usageDescription
* Non-optional AppPermission.appBundleID
* Added AppPermission.sourceID
2023-05-30 15:37:10 -05:00
Riley Testut
d7bbf78b6b [AltStoreCore] Fixes incorrectly merging permissions for same app from different sources 2023-05-30 15:28:49 -05:00
Riley Testut
3efee63d41 [AltStoreCore] Makes AppPermission.usageDescription non-optional for backwards compatibility
Necessary to support switching between AltStore beta and public version.

Wraps private non-optional _usageDescription value in public accessor with optional return type to still treat it as “optional” value.
2023-05-30 14:24:35 -05:00
Riley Testut
13248c05e7 Revises appPermissions format in source JSON
Before, appPermissions was one array containing all permissions of different types.

Now, we split entitlement and privacy permissions into separate “entitlements” and “privacy” child arrays.
2023-05-30 12:57:45 -05:00
Riley Testut
c3721ba209 [AltStoreCore] Migrates Core Data model from v12 to v13 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
4ed40cd544 Removes support for “background mode” permissions 2023-05-29 16:50:17 -05:00
Riley Testut
930b098cbf Fixes erroneously showing “Unsupported Updates Available” message 2023-05-29 16:48:43 -05:00
Riley Testut
ced82ef4e3 [AltStoreCore] Renames StoreApp.latestVersionString to _version 2023-05-18 15:54:13 -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
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
ad41024bcb Verifies downloaded app’s SHA-256 checksum (if specified) 2023-05-11 18:57:53 -05:00
Riley Testut
bd5c942c43 [AltStoreCore] Migrates Core Data model from v11 to v12 2023-04-04 17:59:52 -05:00
Riley Testut
9a5ed50d25 [AltStoreCore] Fixes migration error on launch if AltStore app group does not exist.
Allows falling back to using regular app sandbox instead of app group.
2023-04-04 17:50:32 -05:00
Riley Testut
3e3d9a45ed [AltStoreCore] Fixes incorrectly merging app versions for same app from different sources 2023-04-04 17:50:06 -05:00
Riley Testut
5c419aa333 Shows detailed source “About” page when adding 3rd-party sources
Allows users to preview sources before adding them to their AltStore.
2023-04-04 15:44:46 -05:00
Riley Testut
8700694fb8 [AltStoreCore] Adds Source.isAdded
Convenience property to determine whether a source has been added to the user’s AltStore.
2023-04-04 14:21:13 -05:00
Riley Testut
1a8096300f [AltStoreCore] Fixes incorrect Source.featuredApps relationship post-merging 2023-04-04 14:20:24 -05:00
Riley Testut
6edd92da78 [AltStoreCore] Supports additional source JSON values for detailed “About” page 2023-04-04 14:19:49 -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
f94fe63b60 [AltStoreCore] Fixes Core Data “Using nil or insecure value transformer” warnings 2023-03-01 16:38:49 -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
ec54468783 Caches MergeErrors when refreshing sources to view later in SourcesViewController 2023-01-24 15:51:59 -06:00
Riley Testut
b6bdd13167 Fixes incorrect StoreApp.versions order post-merge 2023-01-24 15:51:59 -06:00
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