mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-15 09:43:34 +01:00
Improves error message when registering app + app extension after App ID limit is reached
This commit is contained in:
29
AltStore/Extensions/ALTApplication+AppExtensions.swift
Normal file
29
AltStore/Extensions/ALTApplication+AppExtensions.swift
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// ALTApplication+AppExtensions.swift
|
||||
// AltStore
|
||||
//
|
||||
// Created by Riley Testut on 2/10/20.
|
||||
// Copyright © 2020 Riley Testut. All rights reserved.
|
||||
//
|
||||
|
||||
import AltSign
|
||||
|
||||
extension ALTApplication
|
||||
{
|
||||
var appExtensions: Set<ALTApplication> {
|
||||
guard let bundle = Bundle(url: self.fileURL) else { return [] }
|
||||
|
||||
var appExtensions: Set<ALTApplication> = []
|
||||
|
||||
if let directory = bundle.builtInPlugInsURL, let enumerator = FileManager.default.enumerator(at: directory, includingPropertiesForKeys: nil, options: [.skipsSubdirectoryDescendants])
|
||||
{
|
||||
for case let fileURL as URL in enumerator where fileURL.pathExtension.lowercased() == "appex"
|
||||
{
|
||||
guard let appExtension = ALTApplication(fileURL: fileURL) else { continue }
|
||||
appExtensions.insert(appExtension)
|
||||
}
|
||||
}
|
||||
|
||||
return appExtensions
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user