mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Fix file providers (#346)
* Make file providers work at all NSExtensionFileProviderDocumentGroup must be a valid app group. This updates it to use the new name of the app group including the team ID. * Update AltStore/Operations/ResignAppOperation.swift
This commit is contained in:
@@ -113,15 +113,24 @@ private extension ResignAppOperation
|
|||||||
|
|
||||||
infoDictionary[kCFBundleIdentifierKey as String] = profile.bundleIdentifier
|
infoDictionary[kCFBundleIdentifierKey as String] = profile.bundleIdentifier
|
||||||
infoDictionary[Bundle.Info.altBundleID] = identifier
|
infoDictionary[Bundle.Info.altBundleID] = identifier
|
||||||
|
|
||||||
for (key, value) in additionalInfoDictionaryValues
|
for (key, value) in additionalInfoDictionaryValues
|
||||||
{
|
{
|
||||||
infoDictionary[key] = value
|
infoDictionary[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
if let appGroups = profile.entitlements[.appGroups] as? [String]
|
if let appGroups = profile.entitlements[.appGroups] as? [String]
|
||||||
{
|
{
|
||||||
infoDictionary[Bundle.Info.appGroups] = appGroups
|
infoDictionary[Bundle.Info.appGroups] = appGroups
|
||||||
|
|
||||||
|
// To keep file providers working, remap the NSExtensionFileProviderDocumentGroup, if there is one.
|
||||||
|
if var extensionInfo = infoDictionary["NSExtension"] as? [String: Any],
|
||||||
|
let appGroup = extensionInfo["NSExtensionFileProviderDocumentGroup"] as? String,
|
||||||
|
let localAppGroup = appGroups.filter({ $0.contains(appGroup) }).min(by: { $0.count < $1.count })
|
||||||
|
{
|
||||||
|
extensionInfo["NSExtensionFileProviderDocumentGroup"] = localAppGroup
|
||||||
|
infoDictionary["NSExtension"] = extensionInfo
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add app-specific exported UTI so we can check later if this app (extension) is installed or not.
|
// Add app-specific exported UTI so we can check later if this app (extension) is installed or not.
|
||||||
|
|||||||
Reference in New Issue
Block a user