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

Commit

Permalink
add option allowPassive
Browse files Browse the repository at this point in the history
  • Loading branch information
Cenmrev committed Sep 11, 2016
1 parent 6495219 commit d3283db
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 51 deletions.
2 changes: 1 addition & 1 deletion V2RayX/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- (IBAction)chooseGlobalMode:(id)sender;
- (IBAction)showConfigWindow:(id)sender;
- (IBAction)editPac:(id)sender;
- (NSArray*)readDefaultsAsArray;
//- (NSArray*)readDefaultsAsArray;
- (NSDictionary*)readDefaultsAsDictionary;
@property (strong, nonatomic) NSStatusItem *statusBarItem;
@property (strong, nonatomic) IBOutlet NSMenu *statusBarMenu;
Expand Down
9 changes: 7 additions & 2 deletions V2RayX/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ - (void)switchServer:(id)sender {
[self reloadV2ray];
[self updateServerMenuList];
}

/*
- (NSArray*)readDefaultsAsArray {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSNumber *dProxyState = [defaults objectForKey:@"proxyIsOn"];
Expand All @@ -201,6 +201,10 @@ - (NSArray*)readDefaultsAsArray {
if (dUdpSupport == nil) {
dUdpSupport = [NSNumber numberWithBool:NO];// do not support udp as default
}
NSNumber* dAllowPassive = [defaults objectForKey:@"allowPassive"];
if (dAllowPassive == nil) {
dAllowPassive = [NSNumber numberWithBool:YES]; // allow passive as default
}
NSMutableArray *dProfilesInPlist = [defaults objectForKey:@"profiles"];
NSMutableArray *dProfiles = [[NSMutableArray alloc] init];
NSNumber *dServerIndex;
Expand All @@ -223,7 +227,7 @@ - (NSArray*)readDefaultsAsArray {
dServerIndex = [NSNumber numberWithInteger:-1];
}
return @[dProxyState,dMode,dLocalPort,dUdpSupport,dProfiles,dServerIndex];
}
}*/

- (void)readDefaults {
/*
Expand Down Expand Up @@ -287,6 +291,7 @@ - (NSDictionary*)readDefaultsAsDictionary {
[newProfile setUserId:aProfile[@"userId"]];
[newProfile setAlterId:[aProfile[@"alterId"] integerValue]];
[newProfile setRemark:aProfile[@"remark"]];
[newProfile setAllowPassive:aProfile[@"allowPassive"]];
[dProfiles addObject:newProfile];
}
dServerIndex = [defaults objectForKey:@"selectedServerIndex"];
Expand Down
Loading

0 comments on commit d3283db

Please sign in to comment.