diff --git a/README.md b/README.md index 07ecc05e60..7f310e4e38 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ You'll need these things to build the project: Open the project in Xcode, open iSH.xcconfig, and change `ROOT_BUNDLE_IDENTIFIER` to something unique. Then click Run. There are scripts that should do everything else automatically. If you run into any problems, open an issue and I'll try to help. +If you want to deploy the project onto your own devices, you'll need a valid developer account. Sign in to your account via Xcode: Xcode -> Preferences -> Accounts. Now go to the project settings and change the value for Signing > Development Team under Build Settings to your development team. To do this a bit more automatically, change the value for one project and then change all occurances of `CK5SXRTBR7` in `iSH.xcodeproj/project.pbxproj` to your development ID for all `DevelopmentTeam` fields. Your ID will be the one not matching `CK5SXRTBR7`. + ## Build command line tool for testing To set up your environment, cd to the project and run `meson build` to create a build directory in `build`. Then cd to the build directory and run `ninja`. diff --git a/app/AppDelegate.m b/app/AppDelegate.m index 1ccec5bdab..cbd9053d4f 100644 --- a/app/AppDelegate.m +++ b/app/AppDelegate.m @@ -19,13 +19,14 @@ #import "Roots.h" #import "TerminalViewController.h" #import "UserPreferences.h" +#import #include "kernel/init.h" #include "kernel/calls.h" #include "fs/dyndev.h" #include "fs/devices.h" #include "fs/path.h" -@interface AppDelegate () +@interface AppDelegate () @property BOOL exiting; @property NSString *unameVersion; @@ -203,6 +204,15 @@ + (int)bootError { } - (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + if(WCSession.isSupported){ + WCSession* session = WCSession.defaultSession; + session.delegate = self; + [session activateSession]; + NSLog(@"Started watch session"); + } else { + NSLog(@"Watch communication not supported"); + } + NSUserDefaults *defaults = NSUserDefaults.standardUserDefaults; if ([defaults boolForKey:@"hail mary"]) { [defaults removeObjectForKey:kPreferenceBootCommandKey]; @@ -289,6 +299,70 @@ - (void)applicationDidEnterBackground:(UIApplication *)application { exit(0); } +- (void)session:(WCSession *)session didReceiveMessage:(NSDictionary *)message replyHandler:(void(^)(NSDictionary *replyMessage))replyHandler +{ + NSLog(@"Received message from watch"); + + if (message) { + NSString* command = [message objectForKey:@"command"]; + + NSLog(@"Got command: %@", command); + + if (currentTerminalViewController == NULL) { + NSLog(@"No terminal view controller available"); + NSDictionary* response = @{@"error" : @"The terminal view is not available"}; + replyHandler(response); + } else { + NSLog(@"Sending command"); + NSData *input = [command dataUsingEncoding:NSUTF8StringEncoding]; + dispatch_async(dispatch_get_main_queue(), ^{ + [currentTerminalViewController.sessionTerminal sendInput:input.bytes length:input.length]; + }); + NSDictionary* response = @{@"message" : @". .."}; + replyHandler(response); + } + } +} + +-(void)sessionWatchStateDidChange:(nonnull WCSession *)session +{ + + if(WCSession.isSupported){ + WCSession* session = WCSession.defaultSession; + session.delegate = self; + [session activateSession]; + + + if(session.reachable){ + NSLog(@"session.reachable"); + } + + if(session.paired){ + NSLog(@"watch is paired"); + if(session.isWatchAppInstalled){ + NSLog(@"watch app is installed"); + if(session.watchDirectoryURL != nil) { + NSLog(@"watch got directory URL %@", session.watchDirectoryURL); + } + } + } + + + } +} + +- (void)session:(nonnull WCSession *)session activationDidCompleteWithState:(WCSessionActivationState)activationState error:(nullable NSError *)error { + NSLog(@"Watch session became active with status: %ld", activationState); +} + +- (void)sessionDidBecomeInactive:(nonnull WCSession *)session { + NSLog(@"Watch session became inactive"); +} + +- (void)sessionDidDeactivate:(nonnull WCSession *)session { + NSLog(@"Watch session became deactivated"); +} + @end NSString *const ProcessExitedNotification = @"ProcessExitedNotification"; diff --git a/app/FileProvider/Info.plist b/app/FileProvider/Info.plist index 18d8905f13..299405ecbf 100644 --- a/app/FileProvider/Info.plist +++ b/app/FileProvider/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.0 CFBundleVersion - 73 + $(PRODUCT_VERSION) NSExtension NSExtensionFileProviderDocumentGroup diff --git a/app/Info.plist b/app/Info.plist index 60a4de452a..07688702f7 100644 --- a/app/Info.plist +++ b/app/Info.plist @@ -17,7 +17,7 @@ CFBundleShortVersionString 1.0 CFBundleVersion - 73 + $(PRODUCT_VERSION) LSRequiresIPhoneOS NSLocationAlwaysAndWhenInUseUsageDescription diff --git a/app/TerminalViewController.h b/app/TerminalViewController.h index ffb8e972ba..36e528704a 100644 --- a/app/TerminalViewController.h +++ b/app/TerminalViewController.h @@ -15,6 +15,7 @@ - (void)startNewSession; - (void)reconnectSessionFromTerminalUUID:(NSUUID *)uuid; @property (readonly) NSUUID *sessionTerminalUUID; // 0 means invalid +@property (nonatomic) Terminal *sessionTerminal; @property UISceneSession *sceneSession API_AVAILABLE(ios(13.0)); @end diff --git a/app/TerminalViewController.m b/app/TerminalViewController.m index 93e16e26cd..b56de1e051 100644 --- a/app/TerminalViewController.m +++ b/app/TerminalViewController.m @@ -42,7 +42,6 @@ @interface TerminalViewController () @property (weak, nonatomic) IBOutlet UIButton *hideKeyboardButton; @property int sessionPid; -@property (nonatomic) Terminal *sessionTerminal; @property int sessionTerminalNumber; @property BOOL ignoreKeyboardMotion; diff --git a/iSH.xcconfig b/iSH.xcconfig index 0cc1b8b856..023c3370c4 100644 --- a/iSH.xcconfig +++ b/iSH.xcconfig @@ -5,3 +5,6 @@ ROOT_BUNDLE_IDENTIFIER = app.ish.iSH ISH_LOG = PRODUCT_APP_GROUP_IDENTIFIER = group.$(ROOT_BUNDLE_IDENTIFIER) + +// Change this to change all versions of the app and watch app +PRODUCT_VERSION = 73 diff --git a/iSH.xcodeproj/project.pbxproj b/iSH.xcodeproj/project.pbxproj index 858f58d9e1..f04d342184 100644 --- a/iSH.xcodeproj/project.pbxproj +++ b/iSH.xcodeproj/project.pbxproj @@ -11,6 +11,17 @@ 650B337422EA235C00B4C03E /* PasteboardDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 650B337322EA235C00B4C03E /* PasteboardDevice.m */; }; 8632A7BF219A59FB00F02325 /* UserPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 8632A7BE219A59FB00F02325 /* UserPreferences.m */; }; 9A28E4EA219A8B670073D200 /* AboutAppearanceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A28E4E9219A8B670073D200 /* AboutAppearanceViewController.m */; }; + B5A7C40924CD7D8C00747DC0 /* Interface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B5A7C40724CD7D8C00747DC0 /* Interface.storyboard */; }; + B5A7C40B24CD7D8C00747DC0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B5A7C40A24CD7D8C00747DC0 /* Assets.xcassets */; }; + B5A7C41224CD7D8C00747DC0 /* watch Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = B5A7C41124CD7D8C00747DC0 /* watch Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + B5A7C41724CD7D8C00747DC0 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5A7C41624CD7D8C00747DC0 /* ContentView.swift */; }; + B5A7C41924CD7D8C00747DC0 /* HostingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5A7C41824CD7D8C00747DC0 /* HostingController.swift */; }; + B5A7C41B24CD7D8C00747DC0 /* ExtensionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5A7C41A24CD7D8C00747DC0 /* ExtensionDelegate.swift */; }; + B5A7C41D24CD7D8C00747DC0 /* NotificationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5A7C41C24CD7D8C00747DC0 /* NotificationController.swift */; }; + B5A7C41F24CD7D8C00747DC0 /* NotificationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5A7C41E24CD7D8C00747DC0 /* NotificationView.swift */; }; + B5A7C42124CD7D8D00747DC0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B5A7C42024CD7D8D00747DC0 /* Assets.xcassets */; }; + B5A7C42424CD7D8D00747DC0 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B5A7C42324CD7D8D00747DC0 /* Preview Assets.xcassets */; }; + B5A7C42924CD7D8D00747DC0 /* watch.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = B5A7C40524CD7D8B00747DC0 /* watch.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; BB0FC5921F980A6C00803272 /* Terminal.m in Sources */ = {isa = PBXBuildFile; fileRef = BB0FC5911F980A6B00803272 /* Terminal.m */; }; BB101B382364CF57000A93BC /* FontPickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BB101B372364CF57000A93BC /* FontPickerViewController.m */; }; BB10E5C3248DBA7B009C7A74 /* fakefsify.c in Sources */ = {isa = PBXBuildFile; fileRef = BB10E5C2248DBA7B009C7A74 /* fakefsify.c */; }; @@ -62,6 +73,20 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + B5A7C41324CD7D8C00747DC0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BB792B461F96D8E000FFB7A4 /* Project object */; + proxyType = 1; + remoteGlobalIDString = B5A7C41024CD7D8C00747DC0; + remoteInfo = "watch Extension"; + }; + B5A7C42724CD7D8D00747DC0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BB792B461F96D8E000FFB7A4 /* Project object */; + proxyType = 1; + remoteGlobalIDString = B5A7C40424CD7D8B00747DC0; + remoteInfo = watch; + }; BB10E5C7248DBAA1009C7A74 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BB10E0C1248DA5B0009C7A74 /* libarchive.xcodeproj */; @@ -107,6 +132,28 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ + B5A7C42A24CD7D8D00747DC0 /* Embed Watch Content */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(CONTENTS_FOLDER_PATH)/Watch"; + dstSubfolderSpec = 16; + files = ( + B5A7C42924CD7D8D00747DC0 /* watch.app in Embed Watch Content */, + ); + name = "Embed Watch Content"; + runOnlyForDeploymentPostprocessing = 0; + }; + B5A7C42D24CD7D8D00747DC0 /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + B5A7C41224CD7D8C00747DC0 /* watch Extension.appex in Embed App Extensions */, + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; BB88F4A32154760800A341FD /* Embed App Extensions */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -139,6 +186,20 @@ 8632A7BE219A59FB00F02325 /* UserPreferences.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UserPreferences.m; sourceTree = ""; }; 9A28E4E8219A8B670073D200 /* AboutAppearanceViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AboutAppearanceViewController.h; sourceTree = ""; }; 9A28E4E9219A8B670073D200 /* AboutAppearanceViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AboutAppearanceViewController.m; sourceTree = ""; }; + B5A7C40524CD7D8B00747DC0 /* watch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = watch.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B5A7C40824CD7D8C00747DC0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Interface.storyboard; sourceTree = ""; }; + B5A7C40A24CD7D8C00747DC0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B5A7C40C24CD7D8C00747DC0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B5A7C41124CD7D8C00747DC0 /* watch Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "watch Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; + B5A7C41624CD7D8C00747DC0 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + B5A7C41824CD7D8C00747DC0 /* HostingController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HostingController.swift; sourceTree = ""; }; + B5A7C41A24CD7D8C00747DC0 /* ExtensionDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionDelegate.swift; sourceTree = ""; }; + B5A7C41C24CD7D8C00747DC0 /* NotificationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationController.swift; sourceTree = ""; }; + B5A7C41E24CD7D8C00747DC0 /* NotificationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationView.swift; sourceTree = ""; }; + B5A7C42024CD7D8D00747DC0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + B5A7C42324CD7D8D00747DC0 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + B5A7C42524CD7D8D00747DC0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B5A7C42624CD7D8D00747DC0 /* PushNotificationPayload.apns */ = {isa = PBXFileReference; lastKnownFileType = text; path = PushNotificationPayload.apns; sourceTree = ""; }; BB0FC5901F980A6B00803272 /* Terminal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Terminal.h; sourceTree = ""; }; BB0FC5911F980A6B00803272 /* Terminal.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Terminal.m; sourceTree = ""; }; BB101B362364CF57000A93BC /* FontPickerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontPickerViewController.h; sourceTree = ""; }; @@ -350,6 +411,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + B5A7C40E24CD7D8C00747DC0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; BB792B4D1F96D90D00FFB7A4 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -385,6 +453,40 @@ path = proc; sourceTree = ""; }; + B5A7C40624CD7D8B00747DC0 /* watch */ = { + isa = PBXGroup; + children = ( + B5A7C40724CD7D8C00747DC0 /* Interface.storyboard */, + B5A7C40A24CD7D8C00747DC0 /* Assets.xcassets */, + B5A7C40C24CD7D8C00747DC0 /* Info.plist */, + ); + path = watch; + sourceTree = ""; + }; + B5A7C41524CD7D8C00747DC0 /* watch Extension */ = { + isa = PBXGroup; + children = ( + B5A7C41624CD7D8C00747DC0 /* ContentView.swift */, + B5A7C41824CD7D8C00747DC0 /* HostingController.swift */, + B5A7C41A24CD7D8C00747DC0 /* ExtensionDelegate.swift */, + B5A7C41C24CD7D8C00747DC0 /* NotificationController.swift */, + B5A7C41E24CD7D8C00747DC0 /* NotificationView.swift */, + B5A7C42024CD7D8D00747DC0 /* Assets.xcassets */, + B5A7C42524CD7D8D00747DC0 /* Info.plist */, + B5A7C42624CD7D8D00747DC0 /* PushNotificationPayload.apns */, + B5A7C42224CD7D8D00747DC0 /* Preview Content */, + ); + path = "watch Extension"; + sourceTree = ""; + }; + B5A7C42224CD7D8D00747DC0 /* Preview Content */ = { + isa = PBXGroup; + children = ( + B5A7C42324CD7D8D00747DC0 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; BB10E5C1248DB961009C7A74 /* Roots */ = { isa = PBXGroup; children = ( @@ -475,6 +577,8 @@ BB4A53931FAA393B00A72ACE /* most of the code */, BB18B27F1F97F2590059FCD8 /* Scripts */, BB9C7B88240A343400F5D4F0 /* iSH.xcconfig */, + B5A7C40624CD7D8B00747DC0 /* watch */, + B5A7C41524CD7D8C00747DC0 /* watch Extension */, BB792B511F96D90D00FFB7A4 /* Products */, BB792B7D1F96E32B00FFB7A4 /* Frameworks */, ); @@ -488,6 +592,8 @@ BBF124901FA7C3100088FB50 /* alpine.tar.gz */, BB13F7DC200AD81D003D1C4D /* libish.a */, BB88F4902154760800A341FD /* iSHFileProvider.appex */, + B5A7C40524CD7D8B00747DC0 /* watch.app */, + B5A7C41124CD7D8C00747DC0 /* watch Extension.appex */, ); name = Products; sourceTree = ""; @@ -827,6 +933,40 @@ /* End PBXLegacyTarget section */ /* Begin PBXNativeTarget section */ + B5A7C40424CD7D8B00747DC0 /* watch */ = { + isa = PBXNativeTarget; + buildConfigurationList = B5A7C43124CD7D8D00747DC0 /* Build configuration list for PBXNativeTarget "watch" */; + buildPhases = ( + B5A7C40324CD7D8B00747DC0 /* Resources */, + B5A7C42D24CD7D8D00747DC0 /* Embed App Extensions */, + ); + buildRules = ( + ); + dependencies = ( + B5A7C41424CD7D8C00747DC0 /* PBXTargetDependency */, + ); + name = watch; + productName = watch; + productReference = B5A7C40524CD7D8B00747DC0 /* watch.app */; + productType = "com.apple.product-type.application.watchapp2"; + }; + B5A7C41024CD7D8C00747DC0 /* watch Extension */ = { + isa = PBXNativeTarget; + buildConfigurationList = B5A7C43024CD7D8D00747DC0 /* Build configuration list for PBXNativeTarget "watch Extension" */; + buildPhases = ( + B5A7C40D24CD7D8C00747DC0 /* Sources */, + B5A7C40E24CD7D8C00747DC0 /* Frameworks */, + B5A7C40F24CD7D8C00747DC0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "watch Extension"; + productName = "watch Extension"; + productReference = B5A7C41124CD7D8C00747DC0 /* watch Extension.appex */; + productType = "com.apple.product-type.watchkit2-extension"; + }; BB13F7DB200AD81D003D1C4D /* libish */ = { isa = PBXNativeTarget; buildConfigurationList = BB13F7E2200AD81E003D1C4D /* Build configuration list for PBXNativeTarget "libish" */; @@ -853,6 +993,7 @@ BB4A53AC1FAA49CA00A72ACE /* Compile JavaScript */, BB792B4E1F96D90D00FFB7A4 /* Resources */, BB88F4A32154760800A341FD /* Embed App Extensions */, + B5A7C42A24CD7D8D00747DC0 /* Embed Watch Content */, ); buildRules = ( ); @@ -860,6 +1001,7 @@ BB10E5CB248DBAB7009C7A74 /* PBXTargetDependency */, BB13F7E7200AD874003D1C4D /* PBXTargetDependency */, BB88F49E2154760800A341FD /* PBXTargetDependency */, + B5A7C42824CD7D8D00747DC0 /* PBXTargetDependency */, ); name = iSH; productName = iSH; @@ -890,8 +1032,19 @@ isa = PBXProject; attributes = { CLASSPREFIX = ""; + LastSwiftUpdateCheck = 1160; LastUpgradeCheck = 1000; TargetAttributes = { + B5A7C40424CD7D8B00747DC0 = { + CreatedOnToolsVersion = 11.6; + DevelopmentTeam = CK5SXRTBR7; + ProvisioningStyle = Automatic; + }; + B5A7C41024CD7D8C00747DC0 = { + CreatedOnToolsVersion = 11.6; + DevelopmentTeam = CK5SXRTBR7; + ProvisioningStyle = Automatic; + }; BB13F7CA200ACC31003D1C4D = { CreatedOnToolsVersion = 9.2; DevelopmentTeam = CK5SXRTBR7; @@ -953,6 +1106,8 @@ BB13F7CA200ACC31003D1C4D /* Meson */, BB13F7D0200ACCA2003D1C4D /* Ninja */, BB13F7DB200AD81D003D1C4D /* libish */, + B5A7C40424CD7D8B00747DC0 /* watch */, + B5A7C41024CD7D8C00747DC0 /* watch Extension */, ); }; /* End PBXProject section */ @@ -968,6 +1123,24 @@ /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ + B5A7C40324CD7D8B00747DC0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B5A7C40B24CD7D8C00747DC0 /* Assets.xcassets in Resources */, + B5A7C40924CD7D8C00747DC0 /* Interface.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B5A7C40F24CD7D8C00747DC0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B5A7C42424CD7D8D00747DC0 /* Preview Assets.xcassets in Resources */, + B5A7C42124CD7D8D00747DC0 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; BB792B4E1F96D90D00FFB7A4 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -1045,6 +1218,20 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + B5A7C40D24CD7D8C00747DC0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B5A7C41924CD7D8C00747DC0 /* HostingController.swift in Sources */, + B5CD9F3A24CD96BE00DE7A15 /* DetailView.swift in Sources */, + B5A7C41724CD7D8C00747DC0 /* ContentView.swift in Sources */, + B5A7C41D24CD7D8C00747DC0 /* NotificationController.swift in Sources */, + B5CD9F3E24CDB50400DE7A15 /* ErrorView.swift in Sources */, + B5A7C41B24CD7D8C00747DC0 /* ExtensionDelegate.swift in Sources */, + B5A7C41F24CD7D8C00747DC0 /* NotificationView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; BB792B4C1F96D90D00FFB7A4 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1094,6 +1281,16 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + B5A7C41424CD7D8C00747DC0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B5A7C41024CD7D8C00747DC0 /* watch Extension */; + targetProxy = B5A7C41324CD7D8C00747DC0 /* PBXContainerItemProxy */; + }; + B5A7C42824CD7D8D00747DC0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B5A7C40424CD7D8B00747DC0 /* watch */; + targetProxy = B5A7C42724CD7D8D00747DC0 /* PBXContainerItemProxy */; + }; BB10E5CB248DBAB7009C7A74 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = libarchive; @@ -1122,6 +1319,14 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ + B5A7C40724CD7D8C00747DC0 /* Interface.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B5A7C40824CD7D8C00747DC0 /* Base */, + ); + name = Interface.storyboard; + sourceTree = ""; + }; BB792B591F96D90D00FFB7A4 /* Terminal.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -1149,6 +1354,186 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + B5A7C42B24CD7D8D00747DC0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = CK5SXRTBR7; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + IBSC_MODULE = watch_Extension; + INFOPLIST_FILE = watch/Info.plist; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER).watchkitapp"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 6.2; + }; + name = Debug; + }; + B5A7C42C24CD7D8D00747DC0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = watch/watchRelease.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = CK5SXRTBR7; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + IBSC_MODULE = watch_Extension; + INFOPLIST_FILE = watch/Info.plist; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER).watchkitapp"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + VALIDATE_PRODUCT = YES; + WATCHOS_DEPLOYMENT_TARGET = 6.2; + }; + name = Release; + }; + B5A7C42E24CD7D8D00747DC0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_ASSET_PATHS = "\"watch Extension/Preview Content\""; + ENABLE_PREVIEWS = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = "watch Extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER).watchkitapp.watchkitextension"; + PRODUCT_NAME = "${TARGET_NAME}"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 6.2; + }; + name = Debug; + }; + B5A7C42F24CD7D8D00747DC0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = "watch Extension/watch ExtensionRelease.entitlements"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_ASSET_PATHS = "\"watch Extension/Preview Content\""; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_PREVIEWS = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = "watch Extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER).watchkitapp.watchkitextension"; + PRODUCT_NAME = "${TARGET_NAME}"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + VALIDATE_PRODUCT = YES; + WATCHOS_DEPLOYMENT_TARGET = 6.2; + }; + name = Release; + }; BB13F7CC200ACC31003D1C4D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1163,6 +1548,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; DEBUGGING_SYMBOLS = YES; @@ -1198,6 +1584,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -1226,6 +1613,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; DEBUGGING_SYMBOLS = YES; @@ -1262,6 +1650,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -1385,7 +1774,7 @@ ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "$(ROOT_BUNDLE_IDENTIFIER)"; SDKROOT = iphoneos; - VALID_ARCHS = arm64; + VALID_ARCHS = "$(ARCHS_STANDARD)"; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -1426,7 +1815,7 @@ MESON_BUILD_DIR = "$(CONFIGURATION_BUILD_DIR)/meson"; PRODUCT_BUNDLE_IDENTIFIER = "$(ROOT_BUNDLE_IDENTIFIER)"; SDKROOT = iphoneos; - VALID_ARCHS = arm64; + VALID_ARCHS = "$(ARCHS_STANDARD)"; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; @@ -1646,6 +2035,24 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + B5A7C43024CD7D8D00747DC0 /* Build configuration list for PBXNativeTarget "watch Extension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B5A7C42E24CD7D8D00747DC0 /* Debug */, + B5A7C42F24CD7D8D00747DC0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B5A7C43124CD7D8D00747DC0 /* Build configuration list for PBXNativeTarget "watch" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B5A7C42B24CD7D8D00747DC0 /* Debug */, + B5A7C42C24CD7D8D00747DC0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; BB13F7CB200ACC31003D1C4D /* Build configuration list for PBXLegacyTarget "Meson" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/iSH.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist b/iSH.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist index 7d7be4d38c..c854a4e2a6 100644 --- a/iSH.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/iSH.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist @@ -22,16 +22,6 @@ - - diff --git a/watch Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json b/watch Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json new file mode 100644 index 0000000000..ed7de25e57 --- /dev/null +++ b/watch Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json @@ -0,0 +1,28 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : "<=145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/watch Extension/Assets.xcassets/Complication.complicationset/Contents.json b/watch Extension/Assets.xcassets/Complication.complicationset/Contents.json new file mode 100644 index 0000000000..df73a6bba4 --- /dev/null +++ b/watch Extension/Assets.xcassets/Complication.complicationset/Contents.json @@ -0,0 +1,48 @@ +{ + "assets" : [ + { + "filename" : "Circular.imageset", + "idiom" : "watch", + "role" : "circular" + }, + { + "filename" : "Extra Large.imageset", + "idiom" : "watch", + "role" : "extra-large" + }, + { + "filename" : "Graphic Bezel.imageset", + "idiom" : "watch", + "role" : "graphic-bezel" + }, + { + "filename" : "Graphic Circular.imageset", + "idiom" : "watch", + "role" : "graphic-circular" + }, + { + "filename" : "Graphic Corner.imageset", + "idiom" : "watch", + "role" : "graphic-corner" + }, + { + "filename" : "Graphic Large Rectangular.imageset", + "idiom" : "watch", + "role" : "graphic-large-rectangular" + }, + { + "filename" : "Modular.imageset", + "idiom" : "watch", + "role" : "modular" + }, + { + "filename" : "Utilitarian.imageset", + "idiom" : "watch", + "role" : "utilitarian" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/watch Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json b/watch Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json new file mode 100644 index 0000000000..ed7de25e57 --- /dev/null +++ b/watch Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json @@ -0,0 +1,28 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : "<=145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/watch Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json b/watch Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json new file mode 100644 index 0000000000..ed7de25e57 --- /dev/null +++ b/watch Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json @@ -0,0 +1,28 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : "<=145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/watch Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json b/watch Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json new file mode 100644 index 0000000000..ed7de25e57 --- /dev/null +++ b/watch Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json @@ -0,0 +1,28 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : "<=145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/watch Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json b/watch Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json new file mode 100644 index 0000000000..ed7de25e57 --- /dev/null +++ b/watch Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json @@ -0,0 +1,28 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : "<=145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/watch Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json b/watch Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json new file mode 100644 index 0000000000..ed7de25e57 --- /dev/null +++ b/watch Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json @@ -0,0 +1,28 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : "<=145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/watch Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json b/watch Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json new file mode 100644 index 0000000000..ed7de25e57 --- /dev/null +++ b/watch Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json @@ -0,0 +1,28 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : "<=145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/watch Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json b/watch Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json new file mode 100644 index 0000000000..ed7de25e57 --- /dev/null +++ b/watch Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json @@ -0,0 +1,28 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : "<=145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/watch Extension/Assets.xcassets/Contents.json b/watch Extension/Assets.xcassets/Contents.json new file mode 100644 index 0000000000..73c00596a7 --- /dev/null +++ b/watch Extension/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/watch Extension/ContentView.swift b/watch Extension/ContentView.swift new file mode 100644 index 0000000000..7643cef143 --- /dev/null +++ b/watch Extension/ContentView.swift @@ -0,0 +1,73 @@ +// +// ContentView.swift +// watch Extension +// +// Created by Alex Gustafsson on 2020-07-26. +// + +import SwiftUI +import WatchConnectivity +import WatchConnectivity + +struct ContentView: View { + @State var showingDetail = false + @ObservedObject var detail = Detail() + + @State var showingError = false + @State var errorMessage: String = "" + @State var error: Error? = nil + + var body: some View { + List { + Button(action: { + self.detail.name = "Google DNS" + self.showingDetail.toggle() + + if WCSession.isSupported() { + if WCSession.default.isReachable { + WCSession.default.sendMessage(["command": "ls -l\n"], replyHandler: { reply -> Void in + print("Got reply: \(reply)") + }, errorHandler: { (error) -> Void in + self.errorMessage = "Sending message failed" + self.error = error + self.showingDetail = false + self.showingError = true + }) + } else { + self.errorMessage = "Unable to communicate with iSH - not reachable" + self.error = nil + self.showingDetail = false + self.showingError = true + } + } else { + self.errorMessage = "WatchConnectivity is not supported" + self.error = nil + self.showingDetail = false + self.showingError = true + } + }) { + Text("Google DNS") + }.sheet(isPresented: $showingDetail) { + DetailView(name: self.$detail.name) + }.sheet(isPresented: $showingError) { + ErrorView(message: self.errorMessage, error: self.error) + } + + Button(action: { + self.detail.name = "Ping servers" + self.showingDetail.toggle() + }) { + Text("Ping servers") + }.sheet(isPresented: $showingDetail) { + DetailView(name: self.$detail.name) + } + } + .navigationBarTitle("iSH") + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/watch Extension/DetailView.swift b/watch Extension/DetailView.swift new file mode 100644 index 0000000000..4f0c592b47 --- /dev/null +++ b/watch Extension/DetailView.swift @@ -0,0 +1,46 @@ +// +// DetailView.swift +// watch Extension +// +// Created by Alex Gustafsson on 2020-07-26. +// + +import SwiftUI + +class Detail: ObservableObject { + @Published var name: String = "" +} + +struct DetailView: View { + @Binding var name: String + + var body: some View { + ScrollView(.vertical) { + VStack { + Text(name) + .multilineTextAlignment(.leading) + .frame(minWidth: 0, maxWidth: .infinity, alignment: .topLeading) + Divider() + VStack { + Text("$ output from iSH displayed here") + .frame(minWidth: 0, maxWidth: .infinity, alignment: .topLeading) + ForEach(0 ..< 100) { number in + Text("line by line") + .padding(.top, 5.0) + .frame(minWidth: 0, maxWidth: .infinity, alignment: .topLeading) + } + } + .background(/*@START_MENU_TOKEN@*/Color.white/*@END_MENU_TOKEN@*/) + .frame(minWidth: 0, maxWidth: .infinity, alignment: .topLeading) + .foregroundColor(Color.black) + .font(Font.body) + } + } + } +} + +struct DetailView_Previews: PreviewProvider { + static var previews: some View { + DetailView(name: .constant("Example action")) + } +} diff --git a/watch Extension/ErrorView.swift b/watch Extension/ErrorView.swift new file mode 100644 index 0000000000..0d0593702b --- /dev/null +++ b/watch Extension/ErrorView.swift @@ -0,0 +1,28 @@ +// +// ErrorView.swift +// watch Extension +// +// Created by Alex Gustafsson on 2020-07-26. +// + +import SwiftUI + +struct ErrorView: View { + var message: String + var error: Error? + + var body: some View { + VStack { + Text(self.message) + if self.error != nil { + Text(self.error!.localizedDescription) + } + } + } +} + +struct ErrorView_Previews: PreviewProvider { + static var previews: some View { + ErrorView(message: "Example error", error: NSError(domain: "Example error", code: 69)) + } +} diff --git a/watch Extension/ExtensionDelegate.swift b/watch Extension/ExtensionDelegate.swift new file mode 100644 index 0000000000..7309b81477 --- /dev/null +++ b/watch Extension/ExtensionDelegate.swift @@ -0,0 +1,55 @@ +// +// ExtensionDelegate.swift +// watch Extension +// +// Created by Alex Gustafsson on 2020-07-26. +// + +import WatchKit + +class ExtensionDelegate: NSObject, WKExtensionDelegate { + + func applicationDidFinishLaunching() { + // Perform any final initialization of your application. + } + + func applicationDidBecomeActive() { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillResignActive() { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, etc. + } + + func handle(_ backgroundTasks: Set) { + // Sent when the system needs to launch the application in the background to process tasks. Tasks arrive in a set, so loop through and process each one. + for task in backgroundTasks { + // Use a switch statement to check the task type + switch task { + case let backgroundTask as WKApplicationRefreshBackgroundTask: + // Be sure to complete the background task once you’re done. + backgroundTask.setTaskCompletedWithSnapshot(false) + case let snapshotTask as WKSnapshotRefreshBackgroundTask: + // Snapshot tasks have a unique completion call, make sure to set your expiration date + snapshotTask.setTaskCompleted(restoredDefaultState: true, estimatedSnapshotExpiration: Date.distantFuture, userInfo: nil) + case let connectivityTask as WKWatchConnectivityRefreshBackgroundTask: + // Be sure to complete the connectivity task once you’re done. + connectivityTask.setTaskCompletedWithSnapshot(false) + case let urlSessionTask as WKURLSessionRefreshBackgroundTask: + // Be sure to complete the URL session task once you’re done. + urlSessionTask.setTaskCompletedWithSnapshot(false) + case let relevantShortcutTask as WKRelevantShortcutRefreshBackgroundTask: + // Be sure to complete the relevant-shortcut task once you're done. + relevantShortcutTask.setTaskCompletedWithSnapshot(false) + case let intentDidRunTask as WKIntentDidRunRefreshBackgroundTask: + // Be sure to complete the intent-did-run task once you're done. + intentDidRunTask.setTaskCompletedWithSnapshot(false) + default: + // make sure to complete unhandled task types + task.setTaskCompletedWithSnapshot(false) + } + } + } + +} diff --git a/watch Extension/HostingController.swift b/watch Extension/HostingController.swift new file mode 100644 index 0000000000..32a9abc1e0 --- /dev/null +++ b/watch Extension/HostingController.swift @@ -0,0 +1,46 @@ +// +// HostingController.swift +// watch Extension +// +// Created by Alex Gustafsson on 2020-07-26. +// + +import WatchKit +import Foundation +import SwiftUI +import WatchConnectivity + +class HostingController: WKHostingController, WCSessionDelegate { + var wcSession : WCSession! + + func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) { + print("activationDidComplete", activationState) + } + + func session(_ session: WCSession, didReceiveMessage message: [String : Any]) { + let text = message["message"] as! String + print("Received message \(text)") + } + + override func willActivate() { + super.willActivate() + + if WCSession.isSupported() { + print("WCSession is supported. Activating watch communication session") + self.wcSession = WCSession.default + self.wcSession.delegate = self + self.wcSession.activate() + print("Watch communication session active") + } else { + print("Watch communication is not supported") + } + } + + func sessionReachabilityDidChange(_ session: WCSession) { + print("Watch companion reachability changed to \(session.isReachable)") + } + + override var body: ContentView { + return ContentView() + } +} diff --git a/watch Extension/Info.plist b/watch Extension/Info.plist new file mode 100644 index 0000000000..c4561ca10c --- /dev/null +++ b/watch Extension/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + watch Extension + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(PRODUCT_VERSION) + NSExtension + + NSExtensionAttributes + + WKAppBundleIdentifier + $(ROOT_BUNDLE_IDENTIFIER).watchkitapp + + NSExtensionPointIdentifier + com.apple.watchkit + + WKExtensionDelegateClassName + $(PRODUCT_MODULE_NAME).ExtensionDelegate + + diff --git a/watch Extension/NotificationController.swift b/watch Extension/NotificationController.swift new file mode 100644 index 0000000000..b8d6b03ba6 --- /dev/null +++ b/watch Extension/NotificationController.swift @@ -0,0 +1,33 @@ +// +// NotificationController.swift +// watch Extension +// +// Created by Alex Gustafsson on 2020-07-26. +// + +import WatchKit +import SwiftUI +import UserNotifications + +class NotificationController: WKUserNotificationHostingController { + + override var body: NotificationView { + return NotificationView() + } + + override func willActivate() { + // This method is called when watch view controller is about to be visible to user + super.willActivate() + } + + override func didDeactivate() { + // This method is called when watch view controller is no longer visible + super.didDeactivate() + } + + override func didReceive(_ notification: UNNotification) { + // This method is called when a notification needs to be presented. + // Implement it if you use a dynamic notification interface. + // Populate your dynamic notification interface as quickly as possible. + } +} diff --git a/watch Extension/NotificationView.swift b/watch Extension/NotificationView.swift new file mode 100644 index 0000000000..39005ce881 --- /dev/null +++ b/watch Extension/NotificationView.swift @@ -0,0 +1,20 @@ +// +// NotificationView.swift +// watch Extension +// +// Created by Alex Gustafsson on 2020-07-26. +// + +import SwiftUI + +struct NotificationView: View { + var body: some View { + Text("Hello, World!") + } +} + +struct NotificationView_Previews: PreviewProvider { + static var previews: some View { + NotificationView() + } +} diff --git a/watch Extension/Preview Content/Preview Assets.xcassets/Contents.json b/watch Extension/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000000..73c00596a7 --- /dev/null +++ b/watch Extension/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/watch Extension/PushNotificationPayload.apns b/watch Extension/PushNotificationPayload.apns new file mode 100644 index 0000000000..c18b00ad94 --- /dev/null +++ b/watch Extension/PushNotificationPayload.apns @@ -0,0 +1,20 @@ +{ + "aps": { + "alert": { + "body": "Test message", + "title": "Optional title", + "subtitle": "Optional subtitle" + }, + "category": "myCategory", + "thread-id": "5280" + }, + + "WatchKit Simulator Actions": [ + { + "title": "First Button", + "identifier": "firstButtonAction" + } + ], + + "customKey": "Use this file to define a testing payload for your notifications. The aps dictionary specifies the category, alert text and title. The WatchKit Simulator Actions array can provide info for one or more action buttons in addition to the standard Dismiss button. Any other top level keys are custom payload. If you have multiple such JSON files in your project, you'll be able to select them when choosing to debug the notification interface of your Watch App." +} diff --git a/watch Extension/watch ExtensionRelease.entitlements b/watch Extension/watch ExtensionRelease.entitlements new file mode 100644 index 0000000000..b3554e4b37 --- /dev/null +++ b/watch Extension/watch ExtensionRelease.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + $(PRODUCT_APP_GROUP_IDENTIFIER) + + + diff --git a/watch/Assets.xcassets/.DS_Store b/watch/Assets.xcassets/.DS_Store new file mode 100644 index 0000000000..02799f8438 Binary files /dev/null and b/watch/Assets.xcassets/.DS_Store differ diff --git a/watch/Assets.xcassets/AppIcon.appiconset/100.png b/watch/Assets.xcassets/AppIcon.appiconset/100.png new file mode 100644 index 0000000000..6746a67423 Binary files /dev/null and b/watch/Assets.xcassets/AppIcon.appiconset/100.png differ diff --git a/watch/Assets.xcassets/AppIcon.appiconset/216.png b/watch/Assets.xcassets/AppIcon.appiconset/216.png new file mode 100644 index 0000000000..188019c4dd Binary files /dev/null and b/watch/Assets.xcassets/AppIcon.appiconset/216.png differ diff --git a/watch/Assets.xcassets/AppIcon.appiconset/58.png b/watch/Assets.xcassets/AppIcon.appiconset/58.png new file mode 100644 index 0000000000..7b398da586 Binary files /dev/null and b/watch/Assets.xcassets/AppIcon.appiconset/58.png differ diff --git a/watch/Assets.xcassets/AppIcon.appiconset/87.png b/watch/Assets.xcassets/AppIcon.appiconset/87.png new file mode 100644 index 0000000000..07eee597fa Binary files /dev/null and b/watch/Assets.xcassets/AppIcon.appiconset/87.png differ diff --git a/watch/Assets.xcassets/AppIcon.appiconset/App Store.png b/watch/Assets.xcassets/AppIcon.appiconset/App Store.png new file mode 100644 index 0000000000..3e43d42068 Binary files /dev/null and b/watch/Assets.xcassets/AppIcon.appiconset/App Store.png differ diff --git a/watch/Assets.xcassets/AppIcon.appiconset/Contents.json b/watch/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..923beba06f --- /dev/null +++ b/watch/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,92 @@ +{ + "images" : [ + { + "filename" : "Icon-48.png", + "idiom" : "watch", + "role" : "notificationCenter", + "scale" : "2x", + "size" : "24x24", + "subtype" : "38mm" + }, + { + "filename" : "Icon-55.png", + "idiom" : "watch", + "role" : "notificationCenter", + "scale" : "2x", + "size" : "27.5x27.5", + "subtype" : "42mm" + }, + { + "filename" : "58.png", + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "87.png", + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "3x", + "size" : "29x29" + }, + { + "filename" : "Icon-80.png", + "idiom" : "watch", + "role" : "appLauncher", + "scale" : "2x", + "size" : "40x40", + "subtype" : "38mm" + }, + { + "filename" : "Icon-88.png", + "idiom" : "watch", + "role" : "appLauncher", + "scale" : "2x", + "size" : "44x44", + "subtype" : "40mm" + }, + { + "filename" : "100.png", + "idiom" : "watch", + "role" : "appLauncher", + "scale" : "2x", + "size" : "50x50", + "subtype" : "44mm" + }, + { + "filename" : "Icon-172.png", + "idiom" : "watch", + "role" : "quickLook", + "scale" : "2x", + "size" : "86x86", + "subtype" : "38mm" + }, + { + "filename" : "Icon-196.png", + "idiom" : "watch", + "role" : "quickLook", + "scale" : "2x", + "size" : "98x98", + "subtype" : "42mm" + }, + { + "filename" : "216.png", + "idiom" : "watch", + "role" : "quickLook", + "scale" : "2x", + "size" : "108x108", + "subtype" : "44mm" + }, + { + "filename" : "App Store.png", + "idiom" : "watch-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/watch/Assets.xcassets/AppIcon.appiconset/Icon-172.png b/watch/Assets.xcassets/AppIcon.appiconset/Icon-172.png new file mode 100644 index 0000000000..ad76a4837c Binary files /dev/null and b/watch/Assets.xcassets/AppIcon.appiconset/Icon-172.png differ diff --git a/watch/Assets.xcassets/AppIcon.appiconset/Icon-196.png b/watch/Assets.xcassets/AppIcon.appiconset/Icon-196.png new file mode 100644 index 0000000000..f4dcd83aa9 Binary files /dev/null and b/watch/Assets.xcassets/AppIcon.appiconset/Icon-196.png differ diff --git a/watch/Assets.xcassets/AppIcon.appiconset/Icon-48.png b/watch/Assets.xcassets/AppIcon.appiconset/Icon-48.png new file mode 100644 index 0000000000..ad10b9315c Binary files /dev/null and b/watch/Assets.xcassets/AppIcon.appiconset/Icon-48.png differ diff --git a/watch/Assets.xcassets/AppIcon.appiconset/Icon-55.png b/watch/Assets.xcassets/AppIcon.appiconset/Icon-55.png new file mode 100644 index 0000000000..4fc7d5816c Binary files /dev/null and b/watch/Assets.xcassets/AppIcon.appiconset/Icon-55.png differ diff --git a/watch/Assets.xcassets/AppIcon.appiconset/Icon-80.png b/watch/Assets.xcassets/AppIcon.appiconset/Icon-80.png new file mode 100644 index 0000000000..697a020e63 Binary files /dev/null and b/watch/Assets.xcassets/AppIcon.appiconset/Icon-80.png differ diff --git a/watch/Assets.xcassets/AppIcon.appiconset/Icon-88.png b/watch/Assets.xcassets/AppIcon.appiconset/Icon-88.png new file mode 100644 index 0000000000..e409067cd3 Binary files /dev/null and b/watch/Assets.xcassets/AppIcon.appiconset/Icon-88.png differ diff --git a/watch/Assets.xcassets/Contents.json b/watch/Assets.xcassets/Contents.json new file mode 100644 index 0000000000..73c00596a7 --- /dev/null +++ b/watch/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/watch/Base.lproj/Interface.storyboard b/watch/Base.lproj/Interface.storyboard new file mode 100644 index 0000000000..aa3bd9c21b --- /dev/null +++ b/watch/Base.lproj/Interface.storyboard @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/watch/Info.plist b/watch/Info.plist new file mode 100644 index 0000000000..4fe9b61530 --- /dev/null +++ b/watch/Info.plist @@ -0,0 +1,33 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + iSH + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(PRODUCT_VERSION) + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + + WKCompanionAppBundleIdentifier + $(ROOT_BUNDLE_IDENTIFIER) + WKWatchKitApp + + + diff --git a/watch/watchRelease.entitlements b/watch/watchRelease.entitlements new file mode 100644 index 0000000000..b3554e4b37 --- /dev/null +++ b/watch/watchRelease.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + $(PRODUCT_APP_GROUP_IDENTIFIER) + + +