Skip to content

Commit f7a25e3

Browse files
committed
LiveContainer Support
1 parent 84c5bf4 commit f7a25e3

15 files changed

Lines changed: 269 additions & 17 deletions

File tree

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Nightly SideStore Build
22

33
on:
44
push:
5-
branches: [develop]
5+
branches: [develop, LiveContainerSupport2]
66
schedule:
77
- cron: "0 0 * * *"
88
workflow_dispatch:

AltStore.xcodeproj/project.pbxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2954,6 +2954,7 @@
29542954
/* End PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */
29552955

29562956
/* Begin PBXFileSystemSynchronizedRootGroup section */
2957+
177EB19D2F4D48B9008CAAE1 /* LiveContainerSupport */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = LiveContainerSupport; sourceTree = "<group>"; };
29572958
A8A5AC9D2F4C338F00572B4A /* Roxas */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Roxas; sourceTree = "<group>"; };
29582959
A8A5ACE42F4C339400572B4A /* MarkdownAttributedString */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (177EF33D2F4D8B8E008CAAE1 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = MarkdownAttributedString; sourceTree = "<group>"; };
29592960
A8A5AE1B2F4C33A300572B4A /* libplist */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (A8A5AFC02F4C33A300572B4A /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = libplist; sourceTree = "<group>"; };
@@ -4732,6 +4733,7 @@
47324733
BFD247612284B9A500981D42 = {
47334734
isa = PBXGroup;
47344735
children = (
4736+
177EB19D2F4D48B9008CAAE1 /* LiveContainerSupport */,
47354737
A8EEC3D92F4B0FC800F2436D /* AltBackup */,
47364738
A8EEC8412F4B146A00F2436D /* AltStore */,
47374739
A8EEC0502F4AF7FB00F2436D /* AltStoreCore */,
@@ -4939,6 +4941,7 @@
49394941
A85A51592F4B48DE002E2E11 /* PBXTargetDependency */,
49404942
);
49414943
fileSystemSynchronizedGroups = (
4944+
177EB19D2F4D48B9008CAAE1 /* LiveContainerSupport */,
49424945
A8A5AFC32F4C33D800572B4A /* libcurl */,
49434946
A8EEC8412F4B146A00F2436D /* AltStore */,
49444947
);

AltStore/AltStore-Bridging-Header.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
#import "ALTAppPatcher.h"
77

88
#include "fragmentzip.h"
9+
#include "../LiveContainerSupport/XPCServer.h"

AltStore/AppDelegate.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
116116

117117
self.prepareForBackgroundFetch()
118118

119+
SideStoreClient.shared.notifyFinishedLaunching()
120+
119121
return true
120122
}
121123

AltStore/Base.lproj/Main.storyboard

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -724,11 +724,18 @@
724724
</connections>
725725
</collectionView>
726726
<navigationItem key="navigationItem" title="My Apps" id="zLJ-Cg-ijh">
727-
<barButtonItem key="leftBarButtonItem" systemItem="add" id="4MN-JN-Knh">
728-
<connections>
729-
<action selector="sideloadApp:" destination="hv7-Ar-voT" id="Tjv-oi-2H0"/>
730-
</connections>
731-
</barButtonItem>
727+
<leftBarButtonItems>
728+
<barButtonItem systemItem="add" id="4MN-JN-Knh">
729+
<connections>
730+
<action selector="sideloadApp:" destination="hv7-Ar-voT" id="Tjv-oi-2H0"/>
731+
</connections>
732+
</barButtonItem>
733+
<barButtonItem title="Item" image="escape" catalog="system" id="XLE-l0-Jf0" userLabel="OpenLC">
734+
<connections>
735+
<action selector="openLC:" destination="hv7-Ar-voT" id="urR-gL-glB"/>
736+
</connections>
737+
</barButtonItem>
738+
</leftBarButtonItems>
732739
</navigationItem>
733740
<connections>
734741
<segue destination="0V6-N4-hTO" kind="show" identifier="showUpdate" id="dzt-2e-VM9"/>
@@ -947,6 +954,7 @@
947954
<image name="MyApps" width="20" height="20"/>
948955
<image name="News" width="19" height="20"/>
949956
<image name="Settings" width="20" height="20"/>
957+
<image name="escape" catalog="system" width="128" height="123"/>
950958
<namedColor name="Background">
951959
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
952960
</namedColor>

AltStore/My Apps/MyAppsViewController.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,11 @@ private extension MyAppsViewController
10071007
self.operationQueue.addOperations(operations, waitUntilFinished: false)
10081008
}
10091009

1010+
@IBAction func openLC(_ sender: UIBarButtonItem)
1011+
{
1012+
SideStoreClient.shared.relaunchLC()
1013+
}
1014+
10101015
@IBAction func activateApp(_ sender: UIButton)
10111016
{
10121017
let point = self.collectionView.convert(sender.center, from: sender.superview)

AltStore/Operations/AuthenticationOperation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ private extension AuthenticationOperation
768768

769769
func showRefreshScreenIfNecessary(signer: ALTSigner, session: ALTAppleAPISession, completionHandler: @escaping (Bool) -> Void)
770770
{
771-
guard let application = ALTApplication(fileURL: Bundle.main.bundleURL), let provisioningProfile = application.provisioningProfile else { return completionHandler(false) }
771+
guard let application = ALTApplication(fileURL: Bundle.realMainBundle.bundleURL), let provisioningProfile = application.provisioningProfile else { return completionHandler(false) }
772772

773773
// If we're not using the same certificate used to install AltStore, warn user that they need to refresh.
774774
guard !provisioningProfile.certificates.contains(signer.certificate) else { return completionHandler(false) }

AltStore/Operations/InstallAppOperation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ final class InstallAppOperation: ResultOperation<InstalledApp>
177177
}
178178

179179
var installing = true
180-
if installedApp.storeApp?.bundleIdentifier.range(of: Bundle.Info.appbundleIdentifier) != nil {
180+
if installedApp.bundleIdentifier.range(of: Bundle.Info.appbundleIdentifier) != nil {
181181
do {
182182
// we need to flush changes to the disk now in case the changes are lost when iOS kills current process
183183
try installedApp.managedObjectContext?.save()

AltStore/Sources/SourceDetailViewController.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ class SourceDetailViewController: HeaderContentViewController<SourceHeaderView,
178178

179179
let title: String
180180

181+
// temporarily fix crash on source view
182+
self.viewModel.isSourceAdded = nil
183+
181184
switch self.viewModel.isSourceAdded
182185
{
183186
case true?:

AltStoreCore/Model/DatabaseManager/DatabaseManager.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ private extension DatabaseManager
358358

359359
let context = self.persistentContainer.newBackgroundContext()
360360
context.performAndWait {
361-
guard let localApp = ALTApplication(fileURL: Bundle.main.bundleURL) else { return }
361+
guard let localApp = ALTApplication(fileURL: Bundle.realMainBundle.bundleURL) else { return }
362362

363363
let altStoreSource: Source
364364

@@ -403,7 +403,7 @@ private extension DatabaseManager
403403
// figure out if the current AltStoreApp is signed with "Use Main Profie" option
404404
// by checking if the first extension's entitlement's application-identifier matches current one
405405
repeat {
406-
guard let pluginURL = Bundle.main.builtInPlugInsURL else {
406+
guard let pluginURL = Bundle.realMainBundle.builtInPlugInsURL else {
407407
installedApp.useMainProfile = true
408408
break
409409
}
@@ -424,7 +424,7 @@ private extension DatabaseManager
424424
break
425425
}
426426

427-
if appId.hasSuffix(Bundle.main.bundleIdentifier!) {
427+
if appId.hasSuffix(Bundle.realMainBundle.bundleIdentifier!) {
428428
installedApp.useMainProfile = true
429429
} else {
430430
installedApp.useMainProfile = false
@@ -485,7 +485,7 @@ private extension DatabaseManager
485485
FileManager.default.prepareTemporaryURL() { (temporaryFileURL) in
486486
do
487487
{
488-
try FileManager.default.copyItem(at: Bundle.main.bundleURL, to: temporaryFileURL)
488+
try FileManager.default.copyItem(at: Bundle.realMainBundle.bundleURL, to: temporaryFileURL)
489489

490490
guard let appBundle = Bundle(url: temporaryFileURL) else { throw ALTError(.invalidApp) }
491491
try update(appBundle, bundleID: StoreApp.altstoreAppID)

0 commit comments

Comments
 (0)