Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit a1ef567

Browse files
committed
support customized config file
1 parent e171cab commit a1ef567

File tree

8 files changed

+408
-129
lines changed

8 files changed

+408
-129
lines changed

V2RayX.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
9577E1BE1C6B065E00093BD3 /* GCDWebServerStreamedResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 9577E1B11C6B065E00093BD3 /* GCDWebServerStreamedResponse.m */; };
3535
95A143CC1C87FCDC008756B9 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95A143CA1C87FC6E008756B9 /* Cocoa.framework */; };
3636
95E524CB1C674CC80008BB12 /* simple.pac in Resources */ = {isa = PBXBuildFile; fileRef = 95E524CA1C674CC80008BB12 /* simple.pac */; };
37+
9D3CEE6F209E070F0077CCFE /* customizedConfigWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9D3CEE6E209E070F0077CCFE /* customizedConfigWindow.xib */; };
3738
9D5EAC151FDCD70300C14B46 /* geoip.dat in Resources */ = {isa = PBXBuildFile; fileRef = 9D5EAC101FDCD54700C14B46 /* geoip.dat */; };
3839
9D5EAC161FDCD70300C14B46 /* geosite.dat in Resources */ = {isa = PBXBuildFile; fileRef = 9D5EAC0F1FDCD54600C14B46 /* geosite.dat */; };
3940
9D5EAC171FDCD70300C14B46 /* v2ctl in Resources */ = {isa = PBXBuildFile; fileRef = 9D5EAC0E1FDCD54600C14B46 /* v2ctl */; };
@@ -125,6 +126,7 @@
125126
95862BD41DB2862E00F4A9CA /* compilefromsource.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = compilefromsource.sh; sourceTree = "<group>"; };
126127
95A143CA1C87FC6E008756B9 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
127128
95E524CA1C674CC80008BB12 /* simple.pac */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = simple.pac; sourceTree = "<group>"; };
129+
9D3CEE6E209E070F0077CCFE /* customizedConfigWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = customizedConfigWindow.xib; sourceTree = "<group>"; };
128130
9D5EAC0E1FDCD54600C14B46 /* v2ctl */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = v2ctl; path = "v2ray-core-bin/v2ctl"; sourceTree = SOURCE_ROOT; };
129131
9D5EAC0F1FDCD54600C14B46 /* geosite.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = geosite.dat; path = "v2ray-core-bin/geosite.dat"; sourceTree = SOURCE_ROOT; };
130132
9D5EAC101FDCD54700C14B46 /* geoip.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = geoip.dat; path = "v2ray-core-bin/geoip.dat"; sourceTree = SOURCE_ROOT; };
@@ -192,6 +194,7 @@
192194
9504C0811C662C3000352520 /* Assets.xcassets */,
193195
9504C0831C662C3000352520 /* MainMenu.xib */,
194196
9504C08C1C662C9100352520 /* ConfigWindow.xib */,
197+
9D3CEE6E209E070F0077CCFE /* customizedConfigWindow.xib */,
195198
9565E28A1DB25C010082658C /* transportWindow.xib */,
196199
9504C08E1C662CBF00352520 /* ConfigWindowController.h */,
197200
9504C08F1C662CBF00352520 /* ConfigWindowController.m */,
@@ -419,6 +422,7 @@
419422
files = (
420423
9D5EAC151FDCD70300C14B46 /* geoip.dat in Resources */,
421424
9D5EAC161FDCD70300C14B46 /* geosite.dat in Resources */,
425+
9D3CEE6F209E070F0077CCFE /* customizedConfigWindow.xib in Resources */,
422426
9D5EAC171FDCD70300C14B46 /* v2ctl in Resources */,
423427
9D5EAC181FDCD70300C14B46 /* v2ray in Resources */,
424428
9DB4FE951F205BEB00CCEE5F /* config-sample.plist in Resources */,

V2RayX/AppDelegate.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
// Copyright © 2016年 Cenmrev. All rights reserved.
66
//
77

8+
89
#import <Cocoa/Cocoa.h>
910

11+
1012
#define kV2RayXHelper @"/Library/Application Support/V2RayX/v2rayx_sysconf"
1113
#define kSysconfVersion @"v2rayx_sysconf 1.1.0"
1214
#define kV2RayXSettingVersion 3
@@ -20,16 +22,21 @@ typedef enum ProxyMode : NSInteger{
2022
} ProxyMode;
2123

2224

25+
int runCommandLine(NSString* launchPath, NSArray* arguments);
26+
2327
@interface AppDelegate : NSObject <NSApplicationDelegate> {
2428
BOOL proxyState;
2529
ProxyMode proxyMode;
2630
NSInteger localPort;
2731
NSInteger httpPort;
2832
BOOL udpSupport;
2933
BOOL shareOverLan;
34+
BOOL useCusProfile;
3035
NSInteger selectedServerIndex;
36+
NSInteger selectedCusServerIndex;
3137
NSString* dnsString;
3238
NSMutableArray *profiles;
39+
NSMutableArray *cusProfiles;
3340
NSString* logLevel;
3441

3542

@@ -46,9 +53,12 @@ typedef enum ProxyMode : NSInteger{
4653
@property NSInteger httpPort;
4754
@property BOOL udpSupport;
4855
@property BOOL shareOverLan;
56+
@property BOOL useCusProfile;
4957
@property NSInteger selectedServerIndex;
58+
@property NSInteger selectedCusServerIndex;
5059
@property NSString* dnsString;
5160
@property NSMutableArray *profiles;
61+
@property NSMutableArray *cusProfiles;
5262
@property NSString* logLevel;
5363

5464

0 commit comments

Comments
 (0)