routing rule

This commit is contained in:
yanue 2020-02-08 19:59:18 +08:00
parent 5cc7ab542c
commit 0cc110b09f
10 changed files with 383 additions and 74 deletions

View File

@ -20,6 +20,8 @@
6618372923E9BF1A000F7410 /* ToastWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6618372823E9BF1A000F7410 /* ToastWindow.swift */; };
6618372E23E9BF74000F7410 /* ToastWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6618372C23E9BF73000F7410 /* ToastWindow.xib */; };
66193A7C23EC5F1500289B6A /* Shortcut.m in Sources */ = {isa = PBXBuildFile; fileRef = 66193A7B23EC5F1400289B6A /* Shortcut.m */; };
66193A8623EE45B200289B6A /* PreferenceRouting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66193A8523EE45B200289B6A /* PreferenceRouting.swift */; };
66193A8923EE46BC00289B6A /* PreferenceRouting.xib in Resources */ = {isa = PBXBuildFile; fileRef = 66193A8723EE46BC00289B6A /* PreferenceRouting.xib */; };
66406AF42183320000B56041 /* Sample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66406AF32183320000B56041 /* Sample.swift */; };
664EB375216C9A5E00B6AE0D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 664EB374216C9A5E00B6AE0D /* AppDelegate.swift */; };
664EB377216C9A5F00B6AE0D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 664EB376216C9A5F00B6AE0D /* Assets.xcassets */; };
@ -134,6 +136,8 @@
6618373D23EB03EC000F7410 /* V2rayU-Bridging-header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "V2rayU-Bridging-header.h"; sourceTree = "<group>"; };
66193A7A23EC5EFA00289B6A /* Shortcut.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Shortcut.h; sourceTree = "<group>"; };
66193A7B23EC5F1400289B6A /* Shortcut.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Shortcut.m; sourceTree = "<group>"; };
66193A8523EE45B200289B6A /* PreferenceRouting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferenceRouting.swift; sourceTree = "<group>"; };
66193A8823EE46BC00289B6A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = V2rayU/Base.lproj/PreferenceRouting.xib; sourceTree = SOURCE_ROOT; };
66406AF32183320000B56041 /* Sample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sample.swift; sourceTree = "<group>"; };
6646669221CBC0860094F0B7 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
664666A021CBD6C60094F0B7 /* libPods-V2rayUTool.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libPods-V2rayUTool.a"; sourceTree = BUILT_PRODUCTS_DIR; };
@ -363,11 +367,13 @@
6D6DF5345E4582EE0EBD468D /* PreferenceSubscribe.swift */,
6D6DFFB29020127E034AD168 /* PreferenceGeneral.swift */,
6D6DF701C75D8D416096D717 /* PreferenceAdvance.swift */,
66193A8523EE45B200289B6A /* PreferenceRouting.swift */,
6D6DF5D99F2FBB7B53564B3B /* PreferenceAbout.strings */,
6D6DF586D59F646DD1C552F1 /* PreferenceAdvance.strings */,
6D6DF76CE2762F4A33DB32BD /* PreferenceGeneral.strings */,
6D6DFE89E1A7BFE2AC1D8871 /* PreferencePac.strings */,
6D6DF0CCE47F1253DECD5855 /* PreferenceSubscribe.strings */,
66193A8723EE46BC00289B6A /* PreferenceRouting.xib */,
);
path = preference;
sourceTree = "<group>";
@ -571,6 +577,7 @@
6D6DF95B4749491F1D600B05 /* PreferenceAdvance.strings in Resources */,
6D6DFC1618D163A9DFE3B628 /* PreferenceGeneral.strings in Resources */,
6D6DFFD18860EBE148F6DF1F /* PreferencePac.strings in Resources */,
66193A8923EE46BC00289B6A /* PreferenceRouting.xib in Resources */,
6D6DF51271B1AF55EACC79F2 /* PreferenceSubscribe.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -655,6 +662,7 @@
66F07CF9236D79540088A4AE /* ping.swift in Sources */,
664EB392216CA9E800B6AE0D /* ConfigWindow.swift in Sources */,
66784B0021704E1300AD307F /* V2rayCore.swift in Sources */,
66193A8623EE45B200289B6A /* PreferenceRouting.swift in Sources */,
6D6DF8BFC33F97E9AFCA5A4B /* V2rayConfig.swift in Sources */,
6D6DF6F065067CD879201FF9 /* Scanner.swift in Sources */,
6D6DF2CF13D9FD3C7C6492A4 /* QrcodeWindow.swift in Sources */,
@ -704,6 +712,14 @@
name = ToastWindow.xib;
sourceTree = "<group>";
};
66193A8723EE46BC00289B6A /* PreferenceRouting.xib */ = {
isa = PBXVariantGroup;
children = (
66193A8823EE46BC00289B6A /* Base */,
);
name = PreferenceRouting.xib;
sourceTree = "<group>";
};
664EB378216C9A5F00B6AE0D /* MainMenu.xib */ = {
isa = PBXVariantGroup;
children = (

View File

@ -102,7 +102,7 @@
<tableColumns>
<tableColumn identifier="remark" width="128" minWidth="40" maxWidth="1000" id="2RG-jZ-YZ5">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
<font key="font" metaFont="controlContent" size="11"/>
<font key="font" metaFont="menu" size="11"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
@ -1531,7 +1531,7 @@ Gw
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="yEL-bm-ZNR">
<rect key="frame" x="60" y="64" width="61" height="19"/>
<rect key="frame" x="60" y="35" width="61" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="roundRect" title="clear log" bezelStyle="roundedRect" alignment="center" borderStyle="border" inset="2" id="ePD-L5-rbO">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@ -1542,7 +1542,7 @@ Gw
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="76o-eU-kIf">
<rect key="frame" x="60" y="96" width="62" height="17"/>
<rect key="frame" x="60" y="67" width="62" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="inline" title="show log" bezelStyle="inline" alignment="center" borderStyle="border" inset="2" id="OQK-lm-eg7">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@ -1565,6 +1565,17 @@ Gw
<action selector="goSubscribeSetting:" target="-2" id="yqH-W0-TBP"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1km-sW-rvx">
<rect key="frame" x="17" y="97" width="150" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="routing rule" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="tnn-Re-xYl">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="goRoutingRuleSetting:" target="-2" id="BZm-45-olN"/>
</connections>
</button>
</subviews>
</view>
<accessibility identifier="ConfigWindow"/>

View File

@ -40,6 +40,18 @@
<action selector="start:" target="hcZ-V7-Dui" id="XIR-lL-vV2"/>
</connections>
</menuItem>
<menuItem title="View config.json" id="b3o-tG-rp3">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="viewConfig:" target="hcZ-V7-Dui" id="wgb-Uh-Z1z"/>
</connections>
</menuItem>
<menuItem title="View Log" id="52m-v5-TzY">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="openLogs:" target="hcZ-V7-Dui" id="ebe-fD-cCz"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="q2e-iz-ozm"/>
<menuItem title="Pac Mode" state="on" id="NrZ-oB-7yd">
<modifierMask key="keyEquivalentModifierMask"/>
@ -88,8 +100,7 @@
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="4r0-fk-xMy"/>
<menuItem title="Import Server From Pasteboard" toolTip="ss:// or vmess://" id="Kct-KD-qPN">
<modifierMask key="keyEquivalentModifierMask"/>
<menuItem title="Import Server From Pasteboard" keyEquivalent="p" toolTip="ss:// or vmess://" id="Kct-KD-qPN">
<connections>
<action selector="ImportFromPasteboard:" target="hcZ-V7-Dui" id="aP0-Ao-OTD"/>
</connections>
@ -105,10 +116,8 @@
<action selector="generateQrcode:" target="hcZ-V7-Dui" id="cUu-eO-w0Z"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="gWJ-yg-BaW"/>
<menuItem isSeparatorItem="YES" id="mA5-79-fdw"/>
<menuItem title="Copy HTTP Proxy Shell Export Line" id="tBG-YP-XJr">
<modifierMask key="keyEquivalentModifierMask"/>
<menuItem title="Copy HTTP Proxy Shell Export Line" keyEquivalent="e" id="tBG-YP-XJr">
<connections>
<action selector="copyExportCommand:" target="hcZ-V7-Dui" id="RET-i4-2bl"/>
</connections>
@ -125,12 +134,6 @@
<action selector="checkForUpdate:" target="hcZ-V7-Dui" id="D9u-jO-ZhW"/>
</connections>
</menuItem>
<menuItem title="Show Logs..." id="52m-v5-TzY">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="openLogs:" target="hcZ-V7-Dui" id="ebe-fD-cCz"/>
</connections>
</menuItem>
<menuItem title="Help" id="hWR-vJ-0Au">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>

View File

@ -16,11 +16,11 @@
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<view wantsLayer="YES" id="bXz-rK-jao">
<rect key="frame" x="0.0" y="0.0" width="460" height="280"/>
<rect key="frame" x="0.0" y="0.0" width="460" height="360"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="87d-wY-Ocw">
<rect key="frame" x="64" y="225" width="163" height="18"/>
<rect key="frame" x="64" y="305" width="163" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Launch V2rayU at login" bezelStyle="regularSquare" imagePosition="left" inset="2" id="NZE-cI-j04">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@ -31,7 +31,7 @@
</buttonCell>
</button>
<stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" fixedFrame="YES" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="UJB-Wh-dgF">
<rect key="frame" x="66" y="199" width="214" height="14"/>
<rect key="frame" x="66" y="279" width="214" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<button horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tgw-Vy-D08" userLabel="Check for Updates automutically">
@ -53,7 +53,7 @@
</customSpacing>
</stackView>
<stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" fixedFrame="YES" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="WJk-22-Sun">
<rect key="frame" x="66" y="156" width="257" height="30"/>
<rect key="frame" x="66" y="236" width="257" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<button horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="59o-dL-xSh" userLabel="Check for Updates automutically">
@ -76,8 +76,40 @@
<real value="3.4028234663852886e+38"/>
</customSpacing>
</stackView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Elj-N8-4IK" customClass="MASShortcutView">
<rect key="frame" x="247" y="183" width="139" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="associatedUserDefaultsKey" value="SwitchProxyMode"/>
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ti4-xg-ncf" customClass="MASShortcutView">
<rect key="frame" x="247" y="210" width="139" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="associatedUserDefaultsKey" value="ToggleRunning"/>
</userDefinedRuntimeAttributes>
</customView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="UhI-5l-Ytp">
<rect key="frame" x="64" y="184" width="174" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="Switch Proxy Mode:" id="Eu4-bo-oYs">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vtN-0c-sip">
<rect key="frame" x="64" y="211" width="174" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="Toggle V2ray On/Off:" id="0rn-re-Wn3">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button horizontalHuggingPriority="500" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="cPC-Na-pRr">
<rect key="frame" x="60" y="31" width="182" height="32"/>
<rect key="frame" x="60" y="21" width="182" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Check for Updates..." bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="2p9-GL-XZ9">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@ -87,40 +119,8 @@
<action selector="checkVersion:" target="-2" id="4u0-Zb-Xfz"/>
</connections>
</button>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Elj-N8-4IK" customClass="MASShortcutView">
<rect key="frame" x="247" y="89" width="139" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="associatedUserDefaultsKey" value="SwitchProxyMode"/>
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ti4-xg-ncf" customClass="MASShortcutView">
<rect key="frame" x="247" y="116" width="139" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="associatedUserDefaultsKey" value="ToggleRunning"/>
</userDefinedRuntimeAttributes>
</customView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="UhI-5l-Ytp">
<rect key="frame" x="64" y="90" width="174" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="Switch Proxy Mode:" id="Eu4-bo-oYs">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vtN-0c-sip">
<rect key="frame" x="64" y="117" width="174" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="Toggle V2ray On/Off:" id="0rn-re-Wn3">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button horizontalHuggingPriority="500" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="liJ-Uu-8HQ">
<rect key="frame" x="265" y="31" width="127" height="32"/>
<rect key="frame" x="265" y="21" width="127" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Feedback..." bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="QjX-NH-23u">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>

View File

@ -0,0 +1,242 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="PreferenceRoutingViewController" customModule="V2rayU" customModuleProvider="target">
<connections>
<outlet property="blockTextView" destination="UmH-oj-OeF" id="F4L-ai-VLz"/>
<outlet property="directTextView" destination="vYm-hy-3PV" id="duZ-Ja-Hlh"/>
<outlet property="domainStrategy" destination="xjS-y0-GA2" id="R83-kT-QA0"/>
<outlet property="proxyTextView" destination="yaM-kZ-d1d" id="7bQ-0C-yFh"/>
<outlet property="routingRule" destination="y7v-vA-AiE" id="OTD-E9-5mu"/>
<outlet property="view" destination="bXz-rK-jao" id="sLH-5Q-KUz"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<userDefaultsController representsSharedInstance="YES" id="HAt-Ds-MVV"/>
<view wantsLayer="YES" id="bXz-rK-jao">
<rect key="frame" x="0.0" y="0.0" width="460" height="360"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="jcb-hK-ckn">
<rect key="frame" x="18" y="323" width="109" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Domain Strategy:" id="22k-l7-G7a">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="oz6-O3-feh">
<rect key="frame" x="42" y="293" width="85" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Routing Rule:" id="4rB-9k-291">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xjS-y0-GA2" userLabel="domainStrategy">
<rect key="frame" x="146" y="316" width="173" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" title="AsIs" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="LX1-ye-51i" id="Z6S-ke-Pf5" userLabel="domainStrategy">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<menu key="menu" id="bA6-aC-f9X">
<items>
<menuItem title="AsIs" state="on" id="LX1-ye-51i">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="IPIfNonMatch" id="92h-JU-wqn">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="IPOnDemand" id="Js7-cb-bWa">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
</items>
</menu>
</popUpButtonCell>
</popUpButton>
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="y7v-vA-AiE" userLabel="routingRule">
<rect key="frame" x="146" y="285" width="173" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" title="Global" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="zLf-pT-xlm" id="1JH-TF-90a" userLabel="routingRule">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<menu key="menu" id="s7q-On-wcL">
<items>
<menuItem title="Global" state="on" id="zLf-pT-xlm" userLabel="Global"/>
<menuItem title="Bypassing the LAN Address" id="CoE-cp-7fn"/>
<menuItem title="Bypassing mainland address" id="EaD-tR-ldB"/>
<menuItem title="Bypassing LAN and mainland address" id="3qq-dt-TS9"/>
</items>
</menu>
</popUpButtonCell>
</popUpButton>
<tabView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Xt6-4C-beT">
<rect key="frame" x="13" y="42" width="434" height="236"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<font key="font" metaFont="system"/>
<tabViewItems>
<tabViewItem label="Proxy" identifier="" id="pnL-Z8-fIK">
<view key="view" ambiguous="YES" id="OH4-JV-ZAt">
<rect key="frame" x="10" y="33" width="414" height="190"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView fixedFrame="YES" borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fKu-4w-nfA">
<rect key="frame" x="12" y="12" width="389" height="171"/>
<autoresizingMask key="autoresizingMask"/>
<clipView key="contentView" ambiguous="YES" drawsBackground="NO" copiesOnScroll="NO" id="52j-ry-0qA">
<rect key="frame" x="0.0" y="0.0" width="389" height="171"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView ambiguous="YES" importsGraphics="NO" richText="NO" verticallyResizable="YES" spellingCorrection="YES" smartInsertDelete="YES" id="yaM-kZ-d1d">
<rect key="frame" x="0.0" y="0.0" width="389" height="171"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<size key="minSize" width="389" height="171"/>
<size key="maxSize" width="394" height="10000000"/>
<color key="insertionPointColor" name="textColor" catalog="System" colorSpace="catalog"/>
</textView>
</subviews>
<color key="backgroundColor" name="windowBackgroundColor" catalog="System" colorSpace="catalog"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="lEt-YZ-dkb">
<rect key="frame" x="-100" y="-100" width="240" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="pbO-5s-0Pk">
<rect key="frame" x="373" y="0.0" width="16" height="171"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
</subviews>
</view>
</tabViewItem>
<tabViewItem label="Direct" identifier="" id="yc0-Po-cG1">
<view key="view" id="mlE-HX-BcJ">
<rect key="frame" x="10" y="33" width="414" height="190"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView fixedFrame="YES" borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kkR-uc-Qja">
<rect key="frame" x="12" y="12" width="389" height="171"/>
<autoresizingMask key="autoresizingMask"/>
<clipView key="contentView" ambiguous="YES" drawsBackground="NO" copiesOnScroll="NO" id="oot-vM-Y6a">
<rect key="frame" x="0.0" y="0.0" width="389" height="171"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView ambiguous="YES" importsGraphics="NO" richText="NO" verticallyResizable="YES" spellingCorrection="YES" smartInsertDelete="YES" id="vYm-hy-3PV">
<rect key="frame" x="0.0" y="0.0" width="389" height="171"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<size key="minSize" width="389" height="171"/>
<size key="maxSize" width="394" height="10000000"/>
<color key="insertionPointColor" name="textColor" catalog="System" colorSpace="catalog"/>
</textView>
</subviews>
<color key="backgroundColor" name="windowBackgroundColor" catalog="System" colorSpace="catalog"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="J9m-5q-Nwm">
<rect key="frame" x="-100" y="-100" width="240" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="9vp-fC-VPR">
<rect key="frame" x="373" y="0.0" width="16" height="171"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
</subviews>
</view>
</tabViewItem>
<tabViewItem label="Block" identifier="" id="nsT-BW-R2Z">
<view key="view" id="OgP-Jb-qTh">
<rect key="frame" x="10" y="33" width="414" height="190"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView fixedFrame="YES" borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GOX-0f-UYf">
<rect key="frame" x="12" y="12" width="389" height="171"/>
<autoresizingMask key="autoresizingMask"/>
<clipView key="contentView" ambiguous="YES" drawsBackground="NO" copiesOnScroll="NO" id="lep-5k-Lk2">
<rect key="frame" x="0.0" y="0.0" width="389" height="171"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView ambiguous="YES" importsGraphics="NO" richText="NO" verticallyResizable="YES" spellingCorrection="YES" smartInsertDelete="YES" id="UmH-oj-OeF">
<rect key="frame" x="0.0" y="0.0" width="389" height="171"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<size key="minSize" width="389" height="171"/>
<size key="maxSize" width="394" height="10000000"/>
<color key="insertionPointColor" name="textColor" catalog="System" colorSpace="catalog"/>
</textView>
</subviews>
<color key="backgroundColor" name="windowBackgroundColor" catalog="System" colorSpace="catalog"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="KHQ-uv-0yY">
<rect key="frame" x="-100" y="-100" width="240" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="c7l-Gi-Vwn">
<rect key="frame" x="373" y="0.0" width="16" height="171"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
</subviews>
</view>
</tabViewItem>
</tabViewItems>
</tabView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="abB-zF-WFz">
<rect key="frame" x="18" y="20" width="245" height="17"/>
<autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="* Set the rules, separated by commas(,)" id="ccq-gn-C6Z">
<font key="font" metaFont="system"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="RRU-nZ-itS">
<rect key="frame" x="326" y="11" width="120" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="save" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="8g2-Nj-m07">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="saveRouting:" target="-2" id="q5Z-CO-QXQ"/>
</connections>
</button>
<button horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Hdf-GC-RW1">
<rect key="frame" x="330" y="315" width="25" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="help" bezelStyle="helpButton" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="4Ml-by-67E">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="goHelp:" target="-2" id="wWf-8M-Cj5"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="aEa-sE-el1">
<rect key="frame" x="326" y="280" width="120" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="load default" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="RSN-g5-vmP">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="saveRouting:" target="-2" id="wgs-Iq-RgT"/>
</connections>
</button>
</subviews>
<point key="canvasLocation" x="-130" y="-187"/>
</view>
</objects>
</document>

View File

@ -97,12 +97,12 @@
<tableColumns>
<tableColumn identifier="remarkCell" editable="NO" width="99.5" minWidth="40" maxWidth="1000" id="PPw-B0-d3E">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Remark">
<font key="font" metaFont="controlContent" size="11"/>
<font key="font" metaFont="menu" size="11"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
<textFieldCell key="dataCell" controlSize="small" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="hEv-CH-Vqi">
<font key="font" metaFont="controlContent" size="11"/>
<font key="font" metaFont="menu" size="11"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -130,12 +130,12 @@
</tableColumn>
<tableColumn identifier="urlCell" editable="NO" width="312.5" minWidth="40" maxWidth="1000" id="kc4-bL-WBd" userLabel="Subscribe Url">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Subscription Url ">
<font key="font" metaFont="controlContent" size="11"/>
<font key="font" metaFont="menu" size="11"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
<textFieldCell key="dataCell" controlSize="small" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="1zb-8D-Kha">
<font key="font" metaFont="controlContent" size="11"/>
<font key="font" metaFont="menu" size="11"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>

View File

@ -713,6 +713,10 @@ class ConfigWindowController: NSWindowController, NSWindowDelegate, NSTabViewDel
@IBAction func goSubscribeSetting(_ sender: Any) {
preferencesWindowController.show(preferencePane: .subscribeTab)
}
@IBAction func goRoutingRuleSetting(_ sender: Any) {
preferencesWindowController.show(preferencePane: .routingTab)
}
}
// NSv2rayItemListSource

View File

@ -19,6 +19,7 @@ extension PreferencePane.Identifier {
static let advanceTab = Identifier("advanceTab")
static let subscribeTab = Identifier("subscribeTab")
static let pacTab = Identifier("pacTab")
static let routingTab = Identifier("routingTab")
static let aboutTab = Identifier("aboutTab")
}
@ -28,6 +29,7 @@ let preferencesWindowController = PreferencesWindowController(
PreferenceAdvanceViewController(),
PreferenceSubscribeViewController(),
PreferencePacViewController(),
PreferenceRoutingViewController(),
PreferenceAboutViewController(),
]
)
@ -563,6 +565,15 @@ class MenuController: NSObject, NSMenuDelegate {
}
}
@IBAction func viewConfig(_ sender: Any) {
let confUrl = PACUrl.replacingOccurrences(of: "pac/proxy.js", with: "config.json")
print("view config json ", PACUrl)
guard let url = URL(string: confUrl) else {
return
}
NSWorkspace.shared.open(url)
}
func pingAtLaunch() {
let itemList = V2rayServer.list()
if itemList.count == 0 {
@ -634,15 +645,6 @@ class MenuController: NSObject, NSMenuDelegate {
}
func noticeTip(title: String = "", subtitle: String = "", informativeText: String = "") {
// NSUserNotification
// let userNotification = NSUserNotification()
// userNotification.title = title
// userNotification.subtitle = subtitle
// userNotification.informativeText = informativeText
// // 使NSUserNotificationCenterNSUserNotification
// let userNotificationCenter = NSUserNotificationCenter.default
// userNotificationCenter.scheduleNotification(userNotification)
makeToast(message: title + (subtitle.count > 0 ? " - " + subtitle : "") + " : " + informativeText)
}
}

View File

@ -1,9 +0,0 @@
//
// Created by yanue on 2018/12/13.
// Copyright (c) 2018 yanue. All rights reserved.
// copy from ShadowsocksX-NG PACUtils.swift
//
import Cocoa
import Alamofire

View File

@ -0,0 +1,40 @@
//
// Preferences.swift
// V2rayU
//
// Created by yanue on 2018/10/19.
// Copyright © 2018 yanue. All rights reserved.
//
import Cocoa
import Preferences
final class PreferenceRoutingViewController: NSViewController, PreferencePane {
let preferencePaneIdentifier = PreferencePane.Identifier.routingTab
let preferencePaneTitle = "Routing"
let toolbarItemIcon = NSImage(named: NSImage.networkName)!
@IBOutlet weak var domainStrategy: NSPopUpButton!
@IBOutlet weak var routingRule: NSPopUpButton!
@IBOutlet var proxyTextView: NSTextView!
@IBOutlet var directTextView: NSTextView!
@IBOutlet var blockTextView: NSTextView!
override var nibName: NSNib.Name? {
return "PreferenceRouting"
}
override func viewDidLoad() {
super.viewDidLoad()
// fix: https://github.com/sindresorhus/Preferences/issues/31
self.preferredContentSize = NSMakeSize(self.view.frame.size.width, self.view.frame.size.height);
}
@IBAction func goHelp(_ sender: Any) {
}
@IBAction func saveRouting(_ sender: Any) {
}
}