finish integration basic ssr function

finish integration basic ssr function
This commit is contained in:
qinyuhang
2016-08-11 11:23:09 +08:00
parent 8bd4f25e7b
commit 8569bc590c
4 changed files with 21 additions and 6 deletions
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
</dependencies>
@@ -73,11 +73,11 @@
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="3sC-hI-IvB">
<rect key="frame" x="-7" y="-14" width="0.0" height="15"/>
<rect key="frame" x="1" y="-15" width="0.0" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="6OR-N8-MXx">
<rect key="frame" x="-14" y="-7" width="15" height="0.0"/>
<rect key="frame" x="-15" y="1" width="16" height="0.0"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
@@ -173,6 +173,14 @@ class PreferencesWindowController: NSWindowController
remarkTextField.bind("value", toObject: editingProfile, withKeyPath: "remark"
, options: [NSContinuouslyUpdatesValueBindingOption: true])
ProtocolTextField.bind("value", toObject: editingProfile, withKeyPath: "ssrProtocol", options: [NSContinuouslyUpdatesValueBindingOption: true])
ProtocolParamTextField.bind("value", toObject: editingProfile, withKeyPath: "ssrProtocolParam", options: [NSContinuouslyUpdatesValueBindingOption: true])
ObfsTextField.bind("value", toObject: editingProfile, withKeyPath: "ssrObfs", options: [NSContinuouslyUpdatesValueBindingOption: true])
ObfsParamTextField.bind("value", toObject: editingProfile, withKeyPath: "ssrObfsParam", options: [NSContinuouslyUpdatesValueBindingOption: true])
otaCheckBoxBtn.bind("value", toObject: editingProfile, withKeyPath: "ota"
, options: [NSContinuouslyUpdatesValueBindingOption: true])
} else {
@@ -183,6 +191,11 @@ class PreferencesWindowController: NSWindowController
methodTextField.unbind("value")
passwordTextField.unbind("value")
ProtocolTextField.unbind("value")
ProtocolParamTextField.unbind("value")
ObfsTextField.unbind("value")
ObfsParamTextField.unbind("value")
remarkTextField.unbind("value")
otaCheckBoxBtn.unbind("value")
+2 -2
View File
@@ -19,9 +19,9 @@ class ServerProfile: NSObject {
var password:String = ""
var remark:String = ""
var ota: Bool = false // onetime authentication
var ssrProtocol:String = ""
var ssrProtocol:String = "origin"
var ssrProtocolParam:String = ""
var ssrObfs:String = ""
var ssrObfs:String = "plain"
var ssrObfsParam:String = ""
override init() {
+3 -1
View File
@@ -57,6 +57,8 @@ void ScanQRCodeOnScreen() {
if ( [feature.messageString hasPrefix:@"ss://"] )
{
[foundSSUrls addObject:[NSURL URLWithString:feature.messageString]];
}else if ( [feature.messageString hasPrefix:@"ssr://"] ){
[foundSSUrls addObject:[NSURL URLWithString:feature.messageString]];
}
}
}
@@ -135,7 +137,7 @@ NSDictionary<NSString *, id>* ParseSSURL(NSURL* url) {
}
}else if ([[NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:NULL ] hasPrefix:@"ssr://"]){
NSLog(@"Have One ssr QR coming");
}
return nil;
}