forked from LIJI32/SameBoy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow packaging both as an IPA and as a DEB package for jailbreak
- Loading branch information
Showing
7 changed files
with
137 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Package: com.github.liji32.sameboy.ios | ||
Name: SameBoy | ||
Depends: firmware (>= 11.0) | ||
Architecture: iphoneos-arm | ||
Description: A Game Boy emulator for iOS | ||
Maintainer: Lior Halphon | ||
Author: Lior Halphon | ||
Section: Games | ||
Icon: file:///Applications/SameBoy-iOS.app/[email protected] | ||
Version: @VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
ldid -S/Applications/SameBoy-iOS.app/reregister.entitlements /Applications/SameBoy-iOS.app/reregister | ||
/Applications/SameBoy-iOS.app/reregister |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?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>com.apple.private.security.container-required</key> | ||
<true/> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?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>com.apple.private.mobileinstall.allowedSPI</key> | ||
<array> | ||
<string>InstallForLaunchServices</string> | ||
<string>UninstallForLaunchServices</string> | ||
</array> | ||
<key>com.apple.lsapplicationworkspace.rebuildappdatabases</key> | ||
<true/> | ||
<key>com.apple.private.MobileContainerManager.allowed</key> | ||
<true/> | ||
<key>com.apple.frontboard.launchapplications</key> | ||
<true/> | ||
<key>platform-application</key> | ||
<true/> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#import <Foundation/Foundation.h> | ||
#import <dlfcn.h> | ||
#import <objc/runtime.h> | ||
|
||
@interface LSApplicationProxy : NSObject | ||
@property (nonatomic, readonly, getter=isContainerized) bool containerized; | ||
@property (nonatomic, readonly) NSString *bundleIdentifier; | ||
@end | ||
|
||
@interface LSApplicationWorkspace : NSObject | ||
+ (instancetype)defaultWorkspace; | ||
- (NSArray <LSApplicationProxy *> *)allInstalledApplications; | ||
- (bool)unregisterApplication:(NSURL *)url; | ||
- (bool)registerApplicationDictionary:(NSDictionary *)dict; | ||
@end | ||
|
||
@interface MCMAppDataContainer : NSObject | ||
+ (MCMAppDataContainer *)containerWithIdentifier:(NSString *)identifier | ||
createIfNecessary:(bool)create | ||
existed:(bool *)existed | ||
error:(NSError **)error; | ||
@property(readonly, nonatomic) NSURL *url; | ||
@end | ||
|
||
|
||
int main(void) | ||
{ | ||
// Make sure MobileContainerManager is loaded | ||
if (!dlopen("/System/Library/PrivateFrameworks/MobileContainerManager.framework/MobileContainerManager", RTLD_NOW)) return 1; | ||
for (LSApplicationProxy *app in [[LSApplicationWorkspace defaultWorkspace] allInstalledApplications]) { | ||
if (![app.bundleIdentifier isEqualToString:[NSBundle mainBundle].bundleIdentifier]) continue; | ||
if (app.containerized) return 0; // Everything's fine, no need to reregister | ||
// We're registered but not containerized, unregister ourselves first | ||
if (![[LSApplicationWorkspace defaultWorkspace] unregisterApplication:[NSBundle mainBundle].bundleURL]) return 1; | ||
|
||
break; | ||
} | ||
|
||
NSString *container = [objc_getClass("MCMAppDataContainer") containerWithIdentifier:[NSBundle mainBundle].bundleIdentifier | ||
createIfNecessary:true | ||
existed:nil | ||
error:nil].url.path; | ||
|
||
return ![[LSApplicationWorkspace defaultWorkspace] registerApplicationDictionary:@{ | ||
@"ApplicationType": @"System", | ||
@"CFBundleIdentifier": [NSBundle mainBundle].bundleIdentifier, | ||
@"CompatibilityState": @NO, | ||
@"Container": container, | ||
@"IsDeletable": @NO, | ||
@"Path": [NSBundle mainBundle].bundlePath, | ||
@"_LSBundlePlugins": @{}, | ||
@"IsContainerized": @YES, | ||
}]; | ||
} |