Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Right now, everything mostly works as intended. I have yet to handle
errors that present themselves in a UIAlertController within the
Extender application, need to add support for revoking the current
certificate if required, and need to ensure the alerting system I use
shows up in-app.
  • Loading branch information
Matchstic committed Apr 26, 2017
0 parents commit 87bf5c7
Show file tree
Hide file tree
Showing 172 changed files with 29,521 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
LatestBuild/
*.deb
Working/
1,044 changes: 1,044 additions & 0 deletions Extender Installer.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C98D468F1EA0DF320052812C"
BuildableName = "ExtenderExtensions.dylib"
BlueprintName = "Extender-Extensions"
ReferencedContainer = "container:Extender Installer.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C98D468F1EA0DF320052812C"
BuildableName = "ExtenderExtensions.dylib"
BlueprintName = "Extender-Extensions"
ReferencedContainer = "container:Extender Installer.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C98D468F1EA0DF320052812C"
BuildableName = "ExtenderExtensions.dylib"
BlueprintName = "Extender-Extensions"
ReferencedContainer = "container:Extender Installer.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C9BDFC5D1E9F8F610093CA81"
BuildableName = "installdPatch.dylib"
BlueprintName = "Extender-Installer"
ReferencedContainer = "container:Extender Installer.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C9BDFC5D1E9F8F610093CA81"
BuildableName = "installdPatch.dylib"
BlueprintName = "Extender-Installer"
ReferencedContainer = "container:Extender Installer.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C9BDFC5D1E9F8F610093CA81"
BuildableName = "installdPatch.dylib"
BlueprintName = "Extender-Installer"
ReferencedContainer = "container:Extender Installer.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Extender-Extensions.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>Extender-Installer.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>C936D75A1E9F5FA900F23D85</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>C936D7751E9F5FBD00F23D85</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>C98D466D1EA0CC900052812C</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>C98D468F1EA0DF320052812C</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>C9BDFC5D1E9F8F610093CA81</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
30 changes: 30 additions & 0 deletions Extender-Extensions/EEPackage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// EEPackage.h
// Extender Installer
//
// Created by Matt Clarke on 14/04/2017.
//
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@class LSApplicationProxy;

@interface EEPackage : NSObject {
NSURL *_url;
UIImage *_icon;
NSDate *_installDate;
LSApplicationProxy *_proxy;
}

-(instancetype)initWithURL:(NSURL*)fileURL andBundleIdentifier:(NSString*)bundleIdentifier;

- (NSString*)bundleIdentifier;
- (NSString*)applicationName;
- (UIImage*)applicationIcon;
- (NSDate*)applicationExpireDate;

- (NSURL*)packageURL;

@end
74 changes: 74 additions & 0 deletions Extender-Extensions/EEPackage.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//
// EEPackage.m
// Extender Installer
//
// Created by Matt Clarke on 14/04/2017.
//
//

#import "EEPackage.h"
#import "EEResources.h"
#import "PartialZip/PartialZip/PZFileBrowser.h"
#import "SSZipArchive.h"
#import "EEPackageDatabase.h"

@interface Extender : UIApplication
- (void)sendLocalNotification:(NSString*)title andBody:(NSString*)body;
@end

@interface LSApplicationProxy : NSObject
@property (nonatomic, readonly) NSString *applicationIdentifier;
@property (nonatomic, readonly) NSURL *bundleURL;
- (id)localizedName;
+ (instancetype)applicationProxyForIdentifier:(NSString*)arg1;
- (id)primaryIconDataForVariant:(int)arg1;
@end

@implementation EEPackage

-(instancetype)initWithURL:(NSURL*)fileURL andBundleIdentifier:(NSString*)bundleIdentifier {
self = [super init];

if (self) {
// Load Info.plist from the zip at this URL.
_url = fileURL;

_proxy = [LSApplicationProxy applicationProxyForIdentifier:bundleIdentifier];
}

return self;
}

- (NSString*)bundleIdentifier {
return [_proxy applicationIdentifier];
}

- (NSString*)applicationName {
return [_proxy localizedName];
}

- (UIImage*)applicationIcon {
if (!_icon) {
_icon = [UIImage imageWithData:[_proxy primaryIconDataForVariant:1]];
}

return _icon;
}

- (NSDate*)applicationExpireDate {
// We find the application on-disk via MobileCoreServices, then read out it's provisioning profile.
// Key is ExpirationDate

LSApplicationProxy *proxy = [LSApplicationProxy applicationProxyForIdentifier:[self bundleIdentifier]];
NSString *provisionPath = [[proxy.bundleURL path] stringByAppendingString:@"/embedded.mobileprovision"];

NSDictionary *provision = [EEResources provisioningProfileAtPath:provisionPath];

return [provision objectForKey:@"ExpirationDate"];
}

- (NSURL*)packageURL {
return _url;
}

@end
35 changes: 35 additions & 0 deletions Extender-Extensions/EEPackageDatabase.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// EEPackageDatabase.h
// Extender Installer
//
// Created by Matt Clarke on 20/04/2017.
//
// Manages the on-disk unsigned IPAs for local provisioned applications.

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#define EXTENDER_DOCUMENTS @"/var/mobile/Documents/Extender"

@class EEPackage;

@interface EEPackageDatabase : NSObject {
NSDictionary *_packages;
dispatch_queue_t _queue;
NSMutableArray *_installQueue;
NSArray *_teamIDApplications;
UIBackgroundTaskIdentifier _currentBgTask;
}

+ (instancetype)sharedInstance;

- (NSArray *)retrieveAllTeamIDApplications;
- (void)rebuildDatabase;
- (EEPackage*)packageForIdentifier:(NSString*)bundleIdentifier;
- (NSArray*)allPackages;

- (void)resignApplicationsIfNecessaryWithTaskID:(UIBackgroundTaskIdentifier)bgTask;
- (void)installPackageAtURL:(NSURL*)url withManifest:(NSDictionary*)manifest;


@end
Loading

0 comments on commit 87bf5c7

Please sign in to comment.