Skip to content

Commit

Permalink
support V2rayUTool and fix archive
Browse files Browse the repository at this point in the history
  • Loading branch information
yanue committed Dec 20, 2018
1 parent 659ee17 commit d333664
Show file tree
Hide file tree
Showing 9 changed files with 177 additions and 299 deletions.
9 changes: 5 additions & 4 deletions Build/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ function build() {
xcodebuild -archivePath ${V2rayU_ARCHIVE} -exportArchive -exportPath ${V2rayU_RELEASE} -exportOptionsPlist ./build.plist

echo "Cleaning up archive..."
# rm -rf ${V2rayU_ARCHIVE}
rm -rf ${V2rayU_ARCHIVE}

chmod -R 777 "${V2rayU_RELEASE}/${APP_NAME}.app/Contents/Resources/v2ray-core"
chmod -R 777 "${V2rayU_RELEASE}/${APP_NAME}.app/Contents/Resources/unzip.sh"
sudo chown root:admin "${V2rayU_RELEASE}/${APP_NAME}.app/Contents/Resources/V2rayUCmd"
sudo chmod 777 "${V2rayU_RELEASE}/${APP_NAME}.app/Contents/Resources/V2rayUCmd"
sudo chown root:admin "${V2rayU_RELEASE}/${APP_NAME}.app/Contents/Resources/V2rayUTool"
sudo chmod a+rx "${V2rayU_RELEASE}/${APP_NAME}.app/Contents/Resources/V2rayUTool"
sudo chmod +s "${V2rayU_RELEASE}/${APP_NAME}.app/Contents/Resources/V2rayUTool"
}

function createDmg() {
Expand Down Expand Up @@ -199,4 +200,4 @@ pushRelease ${release_note}
generateAppcast ${release_note}
commit
rm -rf "${DMG_TMP}" "${APP_PATH}" "${V2rayU_RELEASE}"
echo "Done"
echo "Done"
232 changes: 123 additions & 109 deletions V2rayU.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>Launcher.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>15</integer>
<integer>17</integer>
</dict>
<key>V2rayU.xcscheme</key>
<dict>
Expand All @@ -22,17 +22,17 @@
<key>V2rayUHelper.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>16</integer>
<integer>18</integer>
</dict>
<key>V2rayULauncher.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>19</integer>
<integer>21</integer>
</dict>
<key>V2rayULauncher.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>13</integer>
<integer>12</integer>
</dict>
<key>V2rayUTests.test.xcscheme</key>
<dict>
Expand All @@ -42,53 +42,58 @@
<key>V2rayUTests.testDecodeUrl.xcscheme</key>
<dict>
<key>isShown</key>
<false />
<false/>
<key>orderHint</key>
<integer>4</integer>
</dict>
<key>V2rayUTests.testDecodeVmess.xcscheme</key>
<dict>
<key>isShown</key>
<false />
<false/>
<key>orderHint</key>
<integer>7</integer>
<integer>5</integer>
</dict>
<key>V2rayUTests.testInbound.xcscheme</key>
<dict>
<key>isShown</key>
<false />
<false/>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>V2rayUTests.testOutbound.xcscheme</key>
<dict>
<key>isShown</key>
<false />
<false/>
<key>orderHint</key>
<integer>14</integer>
<integer>16</integer>
</dict>
<key>V2rayUTool.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>13</integer>
</dict>
<key>V2rayuHelper.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>17</integer>
<integer>19</integer>
</dict>
<key>proxyHelper.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>18</integer>
<integer>20</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>66F4119A21CA33D1007AAC10</key>
<dict>
<key>primary</key>
<true />
<true/>
</dict>
<key>66F411A521CA472A007AAC10</key>
<dict>
<key>primary</key>
<true />
<true/>
</dict>
</dict>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<key>isShown</key>
<false />
<key>orderHint</key>
<integer>11</integer>
<integer>13</integer>
</dict>
</dict>
</dict>
Expand Down
4 changes: 1 addition & 3 deletions V2rayU/MainMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,7 @@ class MenuController: NSObject, NSMenuDelegate {
}

@IBAction func editUserRulesForPAC(_ sender: NSMenuItem) {
if editUserRulesWinCtrl != nil {
editUserRulesWinCtrl.close()
}
editUserRulesWinCtrl.close()
let ctrl = UserRulesWindowController()
editUserRulesWinCtrl = ctrl

Expand Down
13 changes: 6 additions & 7 deletions V2rayU/V2rayLaunch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class V2rayLaunch: NSObject {
return
}

let res = shell(launchPath: "/bin/bash", arguments: ["-c", "cd " + AppResourcesPath + " && ls -la ./V2rayUCmd | awk '{print $3,$4}'"])
let res = shell(launchPath: "/bin/bash", arguments: ["-c", "cd " + AppResourcesPath + " && ls -la ./V2rayUTool | awk '{print $3,$4}'"])
NSLog("Permission is " + (res ?? ""))
if res == "root admin" {
NSLog("Permission is ok")
Expand All @@ -146,19 +146,18 @@ class V2rayLaunch: NSObject {

var error: NSDictionary?
if let scriptObject = NSAppleScript(source: cmdAppleScript) {
if let output: NSAppleEventDescriptor = scriptObject.executeAndReturnError(
&error) {
print(output.stringValue)
} else if (error != nil) {
print("error: \(error)")
let output: NSAppleEventDescriptor = scriptObject.executeAndReturnError(&error)
print(output.stringValue ?? "")
if (error != nil) {
print("error: \(String(describing: error))")
}
} else {
print("error scriptObject")
}
}

static func setSystemProxy(mode: RunMode, httpPort: String = "", sockPort: String = "") {
let task = Process.launchedProcess(launchPath: AppResourcesPath + "/V2rayUCmd", arguments: ["-mode", mode.rawValue, "-pac-url", PACUrl, "-http-port", httpPort, "-sock-port", sockPort])
let task = Process.launchedProcess(launchPath: AppResourcesPath + "/V2rayUTool", arguments: ["-mode", mode.rawValue, "-pac-url", PACUrl, "-http-port", httpPort, "-sock-port", sockPort])
task.waitUntilExit()
if task.terminationStatus == 0 {
NSLog("setSystemProxy succeeded.")
Expand Down
2 changes: 1 addition & 1 deletion V2rayU/cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

cd `dirname "${BASH_SOURCE[0]}"`

cmd="./V2rayUCmd"
cmd="./V2rayUTool"

sudo chown root:admin ${cmd}
sudo chmod a+rx ${cmd}
Expand Down
125 changes: 0 additions & 125 deletions V2rayUCmd/Auth.swift

This file was deleted.

Loading

0 comments on commit d333664

Please sign in to comment.