Skip to content

Commit d673a51

Browse files
committed
Initial commit
0 parents  commit d673a51

40 files changed

+2605
-0
lines changed

.gitignore

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Xcode
2+
#
3+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4+
.DS_Store
5+
## Build generated
6+
build/
7+
DerivedData/
8+
9+
## Various settings
10+
*.pbxuser
11+
!default.pbxuser
12+
*.mode1v3
13+
!default.mode1v3
14+
*.mode2v3
15+
!default.mode2v3
16+
*.perspectivev3
17+
!default.perspectivev3
18+
xcuserdata/
19+
20+
## Other
21+
*.moved-aside
22+
*.xccheckout
23+
*.xcscmblueprint
24+
25+
## Obj-C/Swift specific
26+
*.hmap
27+
*.ipa
28+
*.dSYM.zip
29+
*.dSYM
30+
31+
# CocoaPods
32+
#
33+
# We recommend against adding the Pods directory to your .gitignore. However
34+
# you should judge for yourself, the pros and cons are mentioned at:
35+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
36+
#
37+
# Pods/
38+
39+
# Carthage
40+
#
41+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
42+
# Carthage/Checkouts
43+
44+
Carthage/Build
45+
46+
# fastlane
47+
#
48+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
49+
# screenshots whenever they are needed.
50+
# For more information about the recommended setup visit:
51+
# https://docs.fastlane.tools/best-practices/source-control/#source-control
52+
53+
fastlane/report.xml
54+
fastlane/Preview.html
55+
fastlane/screenshots
56+
fastlane/test_output
57+
58+
# Code Injection
59+
#
60+
# After new code Injection tools there's a generated folder /iOSInjectionProject
61+
# https://github.com/johnno1962/injectionforxcode
62+
63+
iOSInjectionProject/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//
2+
// Copyright (c) 2017 Anchorfree Inc. All rights reserved.
3+
//
4+
5+
#import <Foundation/Foundation.h>
6+
7+
typedef NS_ENUM(NSInteger, AFAuthMethodType) {
8+
AFAuthMethodTypeAnonymous,
9+
AFAuthMethodTypeOAuth,
10+
AFAuthMethodTypeFacebook,
11+
AFAuthMethodTypeGoogle,
12+
AFAuthMethodTypeTwitter,
13+
AFAuthMethodTypeGithub,
14+
AFAuthMethodTypeFirebase,
15+
AFAuthMethodTypeCustom
16+
};
17+
18+
@interface AFAuthMethod : NSObject
19+
20+
@property (nonatomic) AFAuthMethodType type;
21+
@property (nonatomic) NSString *accessToken;
22+
23+
+ (instancetype)anonymous;
24+
25+
+ (instancetype)OAuth:(NSString *)accessToken;
26+
27+
+ (instancetype)facebook:(NSString *)accessToken;
28+
29+
+ (instancetype)google:(NSString *)accessToken;
30+
31+
+ (instancetype)twitter:(NSString *)accessToken;
32+
33+
+ (instancetype)github:(NSString *)accessToken;
34+
35+
+ (instancetype)firebase:(NSString *)accessToken;
36+
37+
+ (instancetype)custom:(NSString *)methodName token:(NSString *)accessToken;
38+
39+
- (NSString *)authMethodString;
40+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//
2+
// Copyright (c) 2016 Anchorfree Inc. All rights reserved.
3+
//
4+
5+
#import <Foundation/Foundation.h>
6+
#import "AFConfigBuilder.h"
7+
8+
@class AFCredentials;
9+
@class AFConfigBuilder;
10+
@class AFConfig;
11+
@class AFProvidedCredentials;
12+
@class AFOnDemandRules;
13+
14+
NS_ASSUME_NONNULL_BEGIN
15+
typedef void (^AFConfigBlock)(AFConfigBuilder *);
16+
typedef void (^AFConfigUpdateBlock)(AFConfig *, AFConfigBuilder *);
17+
18+
@interface AFConfig : NSObject
19+
@property (nonatomic) BOOL debugLogging;
20+
@property (nonatomic) BOOL onDemand;
21+
@property (nonatomic) BOOL advancedOnDemand;
22+
@property (nullable, nonatomic) AFOnDemandRules *onDemandRules;
23+
@property (strong, nonatomic, nonnull) NSString *baseUrl;
24+
@property (strong, nonatomic, nonnull) NSString *carrierId;
25+
@property (strong, nonatomic, nonnull) NSString *networkExtensionBundleId;
26+
@property (strong, nonatomic, nonnull) NSString *groupId;
27+
@property (strong, nonatomic, nullable) NSString *blacklistPath;
28+
@property (strong, nonatomic, nullable) NSString *whitelistPath;
29+
@property (strong, nonatomic, nullable) NSArray <NSString *> *bypassDomains;
30+
@property (strong, nonatomic, nullable) NSString *dnsAddr;
31+
@property (nonatomic) BOOL bypass;
32+
33+
- (instancetype)initWithBuilder:(AFConfigBuilder *)builder;
34+
35+
- (void)updateWithCredentials:(AFProvidedCredentials *)credentials;
36+
37+
- (NSString *)shareFile:(NSString *)fullPath;
38+
39+
+ (instancetype)configWithBlock:(AFConfigBlock)block;
40+
@end
41+
NS_ASSUME_NONNULL_END
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//
2+
// Copyright (c) 2016 Anchorfree Inc. All rights reserved.
3+
//
4+
5+
#import <Foundation/Foundation.h>
6+
#import <NetworkExtension/NetworkExtension.h>
7+
#import "AFConfig.h"
8+
9+
NS_ASSUME_NONNULL_BEGIN
10+
@class AFConfig;
11+
@class AFOnDemandRules;
12+
13+
@interface AFConfigBuilder : NSObject
14+
@property (nonatomic) BOOL debugLogging;
15+
@property (nonatomic) BOOL onDemand;
16+
@property (nonatomic) BOOL advancedOnDemand; // Only can be enabled if onDemand is `true`
17+
@property (strong, nonatomic, nullable) AFOnDemandRules *onDemandRules;
18+
@property (strong, nonatomic) NSString *baseUrl;
19+
@property (strong, nonatomic) NSString *carrierId;
20+
@property (strong, nonatomic, nullable) NSString *blacklistPath;
21+
@property (strong, nonatomic, nullable) NSString *whitelistPath;
22+
@property (strong, nonatomic, nullable) NSString *interfaceName;
23+
@property (strong, nonatomic, nullable) NSString *dnsAddr;
24+
@property (strong, nonatomic, nullable) NSString *serverAddr;
25+
@property (strong, nonatomic, nullable) NSArray <NSString *> *bypassDomains;
26+
@property (strong, nonatomic, nullable) NSDictionary *options;
27+
@property (strong, nonatomic) NSString *groupId;
28+
@property (strong, nonatomic) NSString *networkExtensionBundleId;
29+
@property (strong, nonatomic, nullable) NSArray<NEIPv4Route *> *excludeRoute; // NEIPv4Route *
30+
@property (nonatomic) BOOL bypass;
31+
32+
- (AFConfig *)build;
33+
@end
34+
NS_ASSUME_NONNULL_END
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// Copyright (c) 2017 Anchorfree Inc. All rights reserved.
3+
//
4+
5+
#import <Foundation/Foundation.h>
6+
7+
8+
@interface AFCountry : NSObject <NSCoding>
9+
@property (strong, nonatomic) NSString *countryCode; // country
10+
@property (strong, nonatomic) NSNumber *serversCount;
11+
12+
@property (nonatomic, assign, readonly, getter=isOptimal) BOOL optimal;
13+
14+
+ (instancetype)optimal;
15+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// Copyright (c) 2017 Anchorfree Inc. All rights reserved.
3+
//
4+
5+
#import <Foundation/Foundation.h>
6+
7+
8+
@interface AFCredentials : NSObject
9+
@property (strong, nonatomic) NSString *serverHash;
10+
@property (strong, nonatomic) NSString *serverUsername;
11+
@property (strong, nonatomic) NSString *serverAddress;
12+
@property (strong, nonatomic) NSString *resolvedServerAddress;
13+
@property (strong, nonatomic) NSString *serverName;
14+
@property (strong, nonatomic) NSNumber *expireTime;
15+
@property (strong, nonatomic) NSString *country;
16+
@property (strong, nonatomic) NSString *ip;
17+
@property (strong, nonatomic) NSString *userIP;
18+
19+
- (void)save;
20+
21+
- (NSString *)description;
22+
23+
+ (AFCredentials *)wakeup;
24+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// Copyright (c) 2017 Anchorfree Inc. All rights reserved.
3+
//
4+
5+
#import <Foundation/Foundation.h>
6+
7+
8+
@interface AFDeviceInfo : NSObject
9+
+ (NSString *)UUID;
10+
11+
+ (void)resetDeviceId;
12+
- (void)collect:(NSMutableDictionary *)dict;
13+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//
2+
// Copyright (c) 2017 northghost. All rights reserved.
3+
//
4+
5+
#import <Foundation/Foundation.h>
6+
#import "AFHydra.h"
7+
8+
@interface AFHydra (AFHash)
9+
- (void)login:(AFAuthMethod *)method afHash:(NSString *)afHash completion:(AFHydraLoginCompletion)completion;
10+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// Copyright (c) 2017 northghost. All rights reserved.
3+
//
4+
5+
#import <Foundation/Foundation.h>
6+
#import "AFHydra.h"
7+
8+
@class AFProvidedCredentials;
9+
10+
@interface AFHydra (Credentials)
11+
@property (strong, nonatomic) AFProvidedCredentials *credentials;
12+
@end

0 commit comments

Comments
 (0)