Commit Graph

96 Commits

Author SHA1 Message Date
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
48105f068b Changes ALTAppPermission.isKnown to check localizedName == nil, not localizedDescription
Privacy permissions always have nil localizedDescriptions, even if they’re known.
2023-05-30 12:53:26 -05:00
Riley Testut
74468761bf [Permissions] Fixes incorrect entitlement keys and revises names + descriptions 2023-05-29 20:06:42 -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
c3721ba209 [AltStoreCore] Migrates Core Data model from v12 to v13 2023-05-29 16:50:17 -05:00
Riley Testut
c1e2a28c67 [AltStoreCore] Adds Permissions.plist with definitions for most known permissions
Simpler to update over time as a separate plist rather than in source code.
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
5bc8e609e8 Disables permission verification for DEBUG builds 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
a3813ace54 Revises Entitlements UI on app detail page 2023-05-29 16:48:43 -05:00
Riley Testut
04582c72e8 Redesigns store page permissions UI to show all entitlements and privacy permissions 2023-05-29 16:47:30 -05:00
Riley Testut
4766c14b6c [AltStoreCore] Adds some common ALTPrivacyPermissions
* Apple Music
* Bluetooth
* Calendars
* Camera
* Face ID
* Local Network
* Microphone
* Photos
2023-05-29 16:46:35 -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
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
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
6053a075f4 [AltStoreCore] Backports iOS 15+ NSManagedObjectContext.performAndWait<T>()
Simplifies returning values and throwing errors from managed object contexts.
2023-05-16 15:15:43 -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
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
aa138b9461 [AltStoreCore] Flattens optional values when @Managed/@AsyncManaged.wrappedValue is also optional 2023-05-11 18:56:10 -05:00
Riley Testut
731d382af8 [AltStoreCore] Adds Managed.perform() to match AsyncManaged 2023-05-11 15:05:22 -05:00
Riley Testut
499b44206e [AltStoreCore] Renames AsyncManaged.get() to perform()
Implies it can be used as alternative to managedObject.managedObjectContext.perform() and not just for retrieving values.
2023-05-11 15:05:22 -05:00
Riley Testut
bd5c942c43 [AltStoreCore] Migrates Core Data model from v11 to v12 2023-04-04 17:59:52 -05:00
Riley Testut
1a1d301642 [AltStoreCore] Replaces remaining Bundle.appGroups.first with Bundle.altstoreAppGroup
Ensures we can still find the correct AltStore app group even if it isn’t the first one listed in the Info.plist.
2023-04-04 17:50:48 -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
b2ff0065a3 [AltStoreCore] Adds async wrappers for presenting UIAlertControllers 2023-04-04 16:49:12 -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
6be78cd77f [AltStoreCore] Adds @AsyncManaged property wrapper
Same as @Managed, except it supports using Swift Concurrency to fetch values from its managedObject’s managedObjectContext.
2023-04-04 14:21:12 -05:00
Riley Testut
86d2db189f [AltStoreCore] Adds NSManagedObjectContext.performAsync() to wrap iOS 15+ async perform()
Allows us to use Swift Concurrency with Core Data pre-iOS 15.
2023-04-04 14:21:00 -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
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
515ba0f4e1 Fixes UIApplication.keyWindow deprecation warning 2023-03-02 15:00:54 -06:00
Riley Testut
e1f7e05042 Fixes Scanner.scanHexInt32 deprecation warning 2023-03-02 14:49:02 -06: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
e93457de2f Fixes triggering false positives with some malware detectors
Renames UserDefaults.isMacDirtyCowSupported to .isCowExploitSupported
2023-02-14 14:07:48 -08:00
Riley Testut
c6476b6b4a Hides MacDirtyCow settings on iOS 15.7.2
MacDirtyCow supports iOS 14.0 - 15.7.1 and 16.0 - 16.1.2, but not 15.7.2
2023-02-08 13:47:54 -06:00
Riley Testut
053cc9feda Force-enables “Enforce 3-App Limit” if iOS version does not support MacDirtyCow exploit
Prevents “Enforce 3-App Limit” remaining enabled after updating iOS version without a way to disable it.
2023-02-07 16:36:11 -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
ca9c0596f8 Moves @Managed to AltStoreCore
# Conflicts:
#	AltStore.xcodeproj/project.pbxproj
2023-01-24 15:04:53 -06:00