Skip to content

Commit

Permalink
Fix slow send
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcelocation committed Nov 26, 2022
1 parent a794dc0 commit 94e39e3
Show file tree
Hide file tree
Showing 10 changed files with 312 additions and 28 deletions.
34 changes: 32 additions & 2 deletions AirTroller.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
CE327927293049DE007B2098 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE32791D293049DE007B2098 /* ContentView.swift */; };
CE327928293049DE007B2098 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CE32791E293049DE007B2098 /* Assets.xcassets */; };
CE327929293049DE007B2098 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE32791F293049DE007B2098 /* Extensions.swift */; };
CE9B7554293297AC00D7EC02 /* TSUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9B754D293297AC00D7EC02 /* TSUtil.m */; };
CE9B755A2932987500D7EC02 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE9B75592932987500D7EC02 /* CoreServices.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -40,13 +42,19 @@
CE32791E293049DE007B2098 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
CE32791F293049DE007B2098 /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
CE32792A29304A0C007B2098 /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = "<group>"; };
CE9B754D293297AC00D7EC02 /* TSUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSUtil.m; sourceTree = "<group>"; };
CE9B7551293297AC00D7EC02 /* TSUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSUtil.h; sourceTree = "<group>"; };
CE9B7552293297AC00D7EC02 /* CoreServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreServices.h; sourceTree = "<group>"; };
CE9B75572932986D00D7EC02 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
CE9B75592932987500D7EC02 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
CE3278F4293049BF007B2098 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
CE9B755A2932987500D7EC02 /* CoreServices.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -64,6 +72,7 @@
CE32790A293049D6007B2098 /* Trollface.png */,
CE3278F9293049BF007B2098 /* AirTroller */,
CE3278F8293049BF007B2098 /* Products */,
CE9B75562932986D00D7EC02 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -110,6 +119,7 @@
CE32792C293155F0007B2098 /* Misc */ = {
isa = PBXGroup;
children = (
CE9B754B293297AC00D7EC02 /* TS */,
CE327914293049DE007B2098 /* ImagePickerView.swift */,
CE327916293049DE007B2098 /* Alert.swift */,
CE32791F293049DE007B2098 /* Extensions.swift */,
Expand All @@ -118,6 +128,25 @@
path = Misc;
sourceTree = "<group>";
};
CE9B754B293297AC00D7EC02 /* TS */ = {
isa = PBXGroup;
children = (
CE9B754D293297AC00D7EC02 /* TSUtil.m */,
CE9B7551293297AC00D7EC02 /* TSUtil.h */,
CE9B7552293297AC00D7EC02 /* CoreServices.h */,
);
path = TS;
sourceTree = "<group>";
};
CE9B75562932986D00D7EC02 /* Frameworks */ = {
isa = PBXGroup;
children = (
CE9B75592932987500D7EC02 /* CoreServices.framework */,
CE9B75572932986D00D7EC02 /* MobileCoreServices.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -190,6 +219,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CE9B7554293297AC00D7EC02 /* TSUtil.m in Sources */,
CE327922293049DE007B2098 /* Alert.swift in Sources */,
CE327920293049DE007B2098 /* ImagePickerView.swift in Sources */,
CE327927293049DE007B2098 /* ContentView.swift in Sources */,
Expand Down Expand Up @@ -342,7 +372,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1;
MARKETING_VERSION = 1.1.1;
PRODUCT_BUNDLE_IDENTIFIER = net.sourceloc.AirTroller;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down Expand Up @@ -377,7 +407,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1;
MARKETING_VERSION = 1.1.1;
PRODUCT_BUNDLE_IDENTIFIER = net.sourceloc.AirTroller;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions AirTroller/AirTroller-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
//

#import "RemoteLog.h"
#import "TSUtil.h"
Binary file added AirTroller/Assets.xcassets/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion AirTroller/Assets.xcassets/github.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"images" : [
{
"filename" : "GitHub-Mark-64px.png",
"idiom" : "universal",
"scale" : "1x"
},
Expand All @@ -10,6 +9,7 @@
"scale" : "2x"
},
{
"filename" : "GitHub-Mark-64px.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
32 changes: 17 additions & 15 deletions AirTroller/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,21 @@ struct ContentView: View {
}
.navigationTitle("AirTroller")
.toolbar {
ToolbarItemGroup(placement: .navigationBarLeading) {
Button(action: {
trollController.stopBrowser()
trollController.isRunning = false

selectedPeople = [:]
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
trollController.startBrowser()
}
}) {
Image(systemName: "arrow.clockwise")
}
}
// MARK: Breaks stuff, don't use
// ToolbarItemGroup(placement: .navigationBarLeading) {
// Button(action: {
// trollController.isRunning = false
// selectedPeople = [:]
// trollController.stopBrowser()
//
// killall("sharingd", false)
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
// trollController.startBrowser()
// }
// }) {
// Image(systemName: "arrow.clockwise")
// }
// }
ToolbarItemGroup(placement: .navigationBarTrailing) {
Button(action: {
UIImpactFeedbackGenerator(style: .light).impactOccurred() // mmm
Expand All @@ -111,7 +113,7 @@ struct ContentView: View {
Image("github")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: 24)
.frame(width: 24, height: 24)
}
Button(action: {
UIImpactFeedbackGenerator(style: .light).impactOccurred() // mmm
Expand All @@ -120,7 +122,7 @@ struct ContentView: View {
Image(systemName: "heart.fill")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: 20)
.frame(width: 20, height: 20)
}
}
}
Expand Down
64 changes: 64 additions & 0 deletions AirTroller/Misc/TS/CoreServices.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
extern NSString *LSInstallTypeKey;

@interface LSBundleProxy
@property (nonatomic,readonly) NSString * bundleIdentifier;
@property (nonatomic) NSURL* dataContainerURL;
@property (nonatomic,readonly) NSURL* bundleContainerURL;
-(NSString*)localizedName;
@end

@interface LSApplicationProxy : LSBundleProxy
+ (instancetype)applicationProxyForIdentifier:(NSString*)identifier;
+ (instancetype)applicationProxyForBundleURL:(NSURL*)bundleURL;
@property NSURL* bundleURL;
@property NSString* bundleType;
@property NSString* canonicalExecutablePath;
@property (nonatomic,readonly) NSDictionary* groupContainerURLs;
@property (nonatomic,readonly) NSArray* plugInKitPlugins;
@property (getter=isInstalled,nonatomic,readonly) BOOL installed;
@property (getter=isPlaceholder,nonatomic,readonly) BOOL placeholder;
@property (getter=isRestricted,nonatomic,readonly) BOOL restricted;
@property (nonatomic,readonly) NSSet* claimedURLSchemes;
@property (nonatomic,readonly) NSString* applicationType;
@end

@interface LSApplicationWorkspace : NSObject
+ (instancetype)defaultWorkspace;
- (BOOL)registerApplicationDictionary:(NSDictionary*)dict;
- (BOOL)unregisterApplication:(id)arg1;
- (BOOL)_LSPrivateRebuildApplicationDatabasesForSystemApps:(BOOL)arg1 internal:(BOOL)arg2 user:(BOOL)arg3;
- (BOOL)openApplicationWithBundleID:(NSString *)arg1 ;
- (void)enumerateApplicationsOfType:(NSUInteger)type block:(void (^)(LSApplicationProxy*))block;
- (BOOL)installApplication:(NSURL*)appPackageURL withOptions:(NSDictionary*)options error:(NSError**)error;
- (BOOL)uninstallApplication:(NSString*)appId withOptions:(NSDictionary*)options;
@end

@interface LSEnumerator : NSEnumerator
@property (nonatomic,copy) NSPredicate * predicate;
+ (instancetype)enumeratorForApplicationProxiesWithOptions:(NSUInteger)options;
@end

@interface LSPlugInKitProxy : LSBundleProxy
@property (nonatomic,readonly) NSString* pluginIdentifier;
@property (nonatomic,readonly) NSDictionary * pluginKitDictionary;
+ (instancetype)pluginKitProxyForIdentifier:(NSString*)arg1;
@end

@interface MCMContainer : NSObject
+ (id)containerWithIdentifier:(id)arg1 createIfNecessary:(BOOL)arg2 existed:(BOOL*)arg3 error:(id*)arg4;
@property (nonatomic,readonly) NSURL * url;
@end

@interface MCMDataContainer : MCMContainer

@end

@interface MCMAppDataContainer : MCMDataContainer

@end

@interface MCMAppContainer : MCMContainer
@end

@interface MCMPluginKitPluginDataContainer : MCMDataContainer
@end
8 changes: 8 additions & 0 deletions AirTroller/Misc/TS/TSUtil.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@import Foundation;
#import "CoreServices.h"

extern NSString* getNSStringFromFile(int fd);
extern void printMultilineNSString(NSString* stringToPrint);
extern int spawnRoot(NSString* path, NSArray* args, NSString** stdOut, NSString** stdErr);
extern void killall(NSString* processName, BOOL softly);
extern void respring(void);
Loading

0 comments on commit 94e39e3

Please sign in to comment.