mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
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.
This commit is contained in:
@@ -52,6 +52,7 @@ public extension UserDefaults
|
||||
@NSManaged var trustedSourceIDs: [String]?
|
||||
@NSManaged var trustedServerURL: String?
|
||||
|
||||
@nonobjc
|
||||
var activeAppsLimit: Int? {
|
||||
get {
|
||||
return self._activeAppsLimit?.intValue
|
||||
@@ -69,6 +70,8 @@ public extension UserDefaults
|
||||
}
|
||||
@NSManaged @objc(activeAppsLimit) private var _activeAppsLimit: NSNumber?
|
||||
|
||||
@NSManaged var ignoreActiveAppsLimit: Bool
|
||||
|
||||
class func registerDefaults()
|
||||
{
|
||||
let ios13_5 = OperatingSystemVersion(majorVersion: 13, minorVersion: 5, patchVersion: 0)
|
||||
@@ -88,7 +91,8 @@ public extension UserDefaults
|
||||
#keyPath(UserDefaults.localServerSupportsRefreshing): localServerSupportsRefreshing,
|
||||
#keyPath(UserDefaults.requiresAppGroupMigration): true,
|
||||
#keyPath(UserDefaults.menuAnisetteList): "https://servers.sidestore.io/servers.json",
|
||||
#keyPath(UserDefaults.menuAnisetteURL): "https://ani.sidestore.io"
|
||||
#keyPath(UserDefaults.menuAnisetteURL): "https://ani.sidestore.io",
|
||||
#keyPath(UserDefaults.ignoreActiveAppsLimit): false
|
||||
] as [String : Any]
|
||||
|
||||
UserDefaults.standard.register(defaults: defaults)
|
||||
|
||||
@@ -12,8 +12,22 @@ import CoreData
|
||||
import AltSign
|
||||
import SemanticVersion
|
||||
|
||||
// Free developer accounts are limited to only 3 active sideloaded apps at a time as of iOS 13.3.1.
|
||||
public let ALTActiveAppsLimit = 3
|
||||
extension InstalledApp
|
||||
{
|
||||
public static var freeAccountActiveAppsLimit: Int {
|
||||
if UserDefaults.standard.ignoreActiveAppsLimit
|
||||
{
|
||||
// MacDirtyCow exploit allows users to remove 3-app limit, so return 10 to match App ID limit per-week.
|
||||
// Don't return nil because that implies there is no limit, which isn't quite true due to App ID limit.
|
||||
return 10
|
||||
}
|
||||
else
|
||||
{
|
||||
// Free developer accounts are limited to only 3 active sideloaded apps at a time as of iOS 13.3.1.
|
||||
return 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public protocol InstalledAppProtocol: Fetchable
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ class InstalledAppToInstalledAppMigrationPolicy: NSEntityMigrationPolicy
|
||||
|
||||
// We can assume there is an active app limit,
|
||||
// but will confirm next time user authenticates.
|
||||
UserDefaults.standard.activeAppsLimit = ALTActiveAppsLimit
|
||||
UserDefaults.standard.activeAppsLimit = InstalledApp.freeAccountActiveAppsLimit
|
||||
}
|
||||
|
||||
return NSNumber(value: isActive)
|
||||
|
||||
Reference in New Issue
Block a user