Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
xjbeta committed Dec 20, 2023
2 parents 4fb7a32 + 72b6527 commit a6bceea
Show file tree
Hide file tree
Showing 11 changed files with 374 additions and 356 deletions.
21 changes: 15 additions & 6 deletions Aria2D.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -540,8 +540,9 @@
0147EDB51D21FAD800FB4324 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 0810;
LastUpgradeCheck = 1220;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = xjbeta;
TargetAttributes = {
0147EDBC1D21FAD800FB4324 = {
Expand Down Expand Up @@ -788,6 +789,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
Expand Down Expand Up @@ -817,6 +819,7 @@
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = H7NSMSBU6A;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -850,6 +853,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
Expand Down Expand Up @@ -879,6 +883,7 @@
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = H7NSMSBU6A;
ENABLE_NS_ASSERTIONS = NO;
Expand Down Expand Up @@ -912,19 +917,21 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_PREFIX_HEADER = "";
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "$(SRCROOT)/Aria2D/Resources/Info.plist";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
LIBRARY_SEARCH_PATHS = "$(inherited)";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 1.3.8;
MARKETING_VERSION = 1.3.9;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "";
Expand All @@ -950,20 +957,22 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_PREFIX_HEADER = "";
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "$(SRCROOT)/Aria2D/Resources/Info.plist";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
LIBRARY_SEARCH_PATHS = "$(inherited)";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 1.3.8;
MARKETING_VERSION = 1.3.9;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "";
OTHER_SWIFT_FLAGS = "";
Expand Down Expand Up @@ -1020,15 +1029,15 @@
repositoryURL = "https://github.com/mxcl/PromiseKit";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 6.0.0;
minimumVersion = 8.0.0;
};
};
01F87CBD289B670200B0ED8F /* XCRemoteSwiftPackageReference "Foundation" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/PromiseKit/Foundation";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 3.0.0;
minimumVersion = 4.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,35 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/PromiseKit/Foundation",
"state" : {
"revision" : "985f17fa69ee0e5b7eb3ff9be87ffc4e05fc0927",
"version" : "3.4.0"
"revision" : "d967438f58183e02f091f4c17ac7f04f70947e0a",
"version" : "4.0.0"
}
},
{
"identity" : "promisekit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mxcl/PromiseKit",
"state" : {
"revision" : "8a98e31a47854d3180882c8068cc4d9381bf382d",
"version" : "6.22.1"
"revision" : "cb70b070cde06837cd10a1febdf6105c1a3bb348",
"version" : "8.1.1"
}
},
{
"identity" : "sparkle",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sparkle-project/Sparkle",
"state" : {
"revision" : "87e4fcbac39912f9cdb9a9acf205cad60e1ca3bc",
"version" : "2.4.2"
"revision" : "1f07f4096e52f19b5e7abaa697b7fc592b7ff57c",
"version" : "2.5.1"
}
},
{
"identity" : "starscream",
"kind" : "remoteSourceControl",
"location" : "https://github.com/daltoniam/Starscream",
"state" : {
"revision" : "df8d82047f6654d8e4b655d1b1525c64e1059d21",
"version" : "4.0.4"
"revision" : "ac6c0fc9da221873e01bd1a0d4818498a71eef33",
"version" : "4.0.6"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1220"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
65 changes: 33 additions & 32 deletions Aria2D/Aria2/Aria2Websocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -218,38 +218,39 @@ enum webSocketResult: Error {
}

extension Aria2Websocket: WebSocketDelegate {

func didReceive(event: WebSocketEvent, client: WebSocket) {
switch event {
case .connected(let headers):
isConnected = true
Log("websocket is connected: \(headers)")
webSocketDidOpen()
case .disconnected(let reason, let code):
isConnected = false
Log("websocket is disconnected: \(reason) with code: \(code)")
webSocket(didCloseWithCode: Int(code), reason: reason)
case .text(let string):
webSocket(didReceiveMessageWith: string)
case .binary(let data):
Log("Received data: \(data.count)")
case .ping(_):
Log("websocket ping")
case .pong(_):
Log("websocket pong")
case .viabilityChanged(_):
Log("websocket viablityChanged")
case .reconnectSuggested(_):
Log("websocket reconnectSuggested")
case .cancelled:
isConnected = false
Log("websocket cancelled")
case .error(let error):
isConnected = false
Log("websocket error \(String(describing: error))")
}
}

func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocketClient) {
switch event {
case .connected(let headers):
isConnected = true
Log("websocket is connected: \(headers)")
webSocketDidOpen()
case .disconnected(let reason, let code):
isConnected = false
Log("websocket is disconnected: \(reason) with code: \(code)")
webSocket(didCloseWithCode: Int(code), reason: reason)
case .text(let string):
webSocket(didReceiveMessageWith: string)
case .binary(let data):
Log("Received data: \(data.count)")
case .ping(_):
Log("websocket ping")
case .pong(_):
Log("websocket pong")
case .viabilityChanged(_):
Log("websocket viablityChanged")
case .reconnectSuggested(_):
Log("websocket reconnectSuggested")
case .cancelled:
isConnected = false
Log("websocket cancelled")
case .error(let error):
isConnected = false
Log("websocket error \(String(describing: error))")
case .peerClosed:
isConnected = false
Log("websocket peerClosed")
}
}


func webSocketDidOpen() {
Expand Down
28 changes: 17 additions & 11 deletions Aria2D/Aria2/Aria2c.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ class Aria2c: NSObject {
let task = Process()
let pipe = Pipe()
task.standardOutput = pipe
task.launchPath = "/bin/bash"
task.arguments = ["-l", "-c", "which aria2c"]
task.launchPath = "/usr/bin/which"
task.arguments = ["aria2c"]

task.launch()
task.waitUntilExit()
Expand Down Expand Up @@ -184,15 +184,21 @@ class Aria2c: NSObject {
var args = aria2cArgs
let aria2cPath = Preferences.shared.aria2cOptions.path(for: .aria2c)
args.insert(aria2cPath, at: 0)
args.append("-D")

task.arguments = ["-c", "exec -a \(aria2cProcessName) \(args.joined(separator: " "))"]

task.launch(.promise).done { out, err in
resolver.fulfill(())
}.catch {
resolver.reject($0)
}
// args.append("-D")
task.arguments = ["-c", "exec -a \(aria2cProcessName) \(args.joined(separator: " "))"]

/*
task.launch(.promise).done { out, err in
resolver.fulfill(())
}.catch {
resolver.reject($0)
}
*/

var outPipe = Pipe()
task.standardOutput = outPipe
try? task.run()
resolver.fulfill(())
}
}

Expand Down
22 changes: 11 additions & 11 deletions Aria2D/Views/Base.lproj/About.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="Upm-iJ-kZp">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="Upm-iJ-kZp">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15702"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -11,28 +11,28 @@
<objects>
<viewController showSeguePresentationStyle="single" id="2MO-T1-TY9" customClass="AboutAria2D" customModule="Aria2D" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" id="Naw-GD-rDn">
<rect key="frame" x="0.0" y="0.0" width="376" height="260"/>
<rect key="frame" x="0.0" y="0.0" width="376" height="261"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="VqN-Te-2Nk">
<rect key="frame" x="0.0" y="0.0" width="376" height="260"/>
<rect key="frame" x="0.0" y="0.0" width="376" height="261"/>
<view key="contentView" id="dpP-FD-dzI">
<rect key="frame" x="0.0" y="0.0" width="376" height="260"/>
<rect key="frame" x="0.0" y="0.0" width="376" height="261"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView distribution="fill" orientation="vertical" alignment="centerX" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5gR-93-jtR">
<rect key="frame" x="127" y="35" width="123" height="175"/>
<rect key="frame" x="127" y="35" width="123" height="176"/>
<subviews>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="wC5-VR-Gy7">
<rect key="frame" x="19" y="90" width="85" height="85"/>
<rect key="frame" x="19" y="91" width="85" height="85"/>
<constraints>
<constraint firstAttribute="width" constant="85" id="3UR-Qm-Lzk"/>
<constraint firstAttribute="width" secondItem="wC5-VR-Gy7" secondAttribute="height" multiplier="1:1" id="hk4-j3-3ES"/>
</constraints>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="AppIcon" id="Gir-Dj-yfR"/>
</imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Tv6-Li-3Jr">
<rect key="frame" x="26" y="61" width="71" height="24"/>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Tv6-Li-3Jr">
<rect key="frame" x="26" y="61" width="71" height="25"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Aria2D" usesSingleLineMode="YES" id="XX3-0Z-XT8">
<font key="font" metaFont="system" size="21"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
Expand All @@ -42,7 +42,7 @@
<binding destination="2MO-T1-TY9" name="value" keyPath="self.appName" id="XvE-Xh-ljU"/>
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="veI-KD-rvt">
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="veI-KD-rvt">
<rect key="frame" x="34" y="40" width="54" height="16"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Version" usesSingleLineMode="YES" id="H8M-jL-hXN">
<font key="font" size="14" name="HelveticaNeue"/>
Expand All @@ -64,7 +64,7 @@
<action selector="actions:" target="2MO-T1-TY9" id="8jk-de-mPe"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="NT6-LG-82P">
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="NT6-LG-82P">
<rect key="frame" x="19" y="0.0" width="84" height="14"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="80" id="Xcm-Ug-O2c"/>
Expand Down
Loading

0 comments on commit a6bceea

Please sign in to comment.