1 |
efrain |
1 |
/*
|
|
|
2 |
* Copyright 2020 Google LLC
|
|
|
3 |
*
|
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
|
6 |
* You may obtain a copy of the License at
|
|
|
7 |
*
|
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
9 |
*
|
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
13 |
* See the License for the specific language governing permissions and
|
|
|
14 |
* limitations under the License.
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCOREndpoints.h"
|
|
|
18 |
|
|
|
19 |
static NSString *const kINTServerURL =
|
|
|
20 |
@"https://dummyapiverylong-dummy.dummy.com/dummy/api/very/long";
|
|
|
21 |
|
|
|
22 |
@implementation GDTCOREndpoints
|
|
|
23 |
|
|
|
24 |
+ (NSDictionary<NSNumber *, NSURL *> *)uploadURLs {
|
|
|
25 |
// These strings should be interleaved to construct the real URL. This is just to (hopefully)
|
|
|
26 |
// fool github URL scanning bots.
|
|
|
27 |
static NSURL *CCTServerURL;
|
|
|
28 |
static dispatch_once_t CCTOnceToken;
|
|
|
29 |
dispatch_once(&CCTOnceToken, ^{
|
|
|
30 |
const char *p1 = "hts/frbslgiggolai.o/0clgbth";
|
|
|
31 |
const char *p2 = "tp:/ieaeogn.ogepscmvc/o/ac";
|
|
|
32 |
const char URL[54] = {p1[0], p2[0], p1[1], p2[1], p1[2], p2[2], p1[3], p2[3], p1[4],
|
|
|
33 |
p2[4], p1[5], p2[5], p1[6], p2[6], p1[7], p2[7], p1[8], p2[8],
|
|
|
34 |
p1[9], p2[9], p1[10], p2[10], p1[11], p2[11], p1[12], p2[12], p1[13],
|
|
|
35 |
p2[13], p1[14], p2[14], p1[15], p2[15], p1[16], p2[16], p1[17], p2[17],
|
|
|
36 |
p1[18], p2[18], p1[19], p2[19], p1[20], p2[20], p1[21], p2[21], p1[22],
|
|
|
37 |
p2[22], p1[23], p2[23], p1[24], p2[24], p1[25], p2[25], p1[26], '\0'};
|
|
|
38 |
CCTServerURL = [NSURL URLWithString:[NSString stringWithUTF8String:URL]];
|
|
|
39 |
});
|
|
|
40 |
|
|
|
41 |
static NSURL *FLLServerURL;
|
|
|
42 |
static dispatch_once_t FLLOnceToken;
|
|
|
43 |
dispatch_once(&FLLOnceToken, ^{
|
|
|
44 |
const char *p1 = "hts/frbslgigp.ogepscmv/ieo/eaybtho";
|
|
|
45 |
const char *p2 = "tp:/ieaeogn-agolai.o/1frlglgc/aclg";
|
|
|
46 |
const char URL[69] = {p1[0], p2[0], p1[1], p2[1], p1[2], p2[2], p1[3], p2[3], p1[4],
|
|
|
47 |
p2[4], p1[5], p2[5], p1[6], p2[6], p1[7], p2[7], p1[8], p2[8],
|
|
|
48 |
p1[9], p2[9], p1[10], p2[10], p1[11], p2[11], p1[12], p2[12], p1[13],
|
|
|
49 |
p2[13], p1[14], p2[14], p1[15], p2[15], p1[16], p2[16], p1[17], p2[17],
|
|
|
50 |
p1[18], p2[18], p1[19], p2[19], p1[20], p2[20], p1[21], p2[21], p1[22],
|
|
|
51 |
p2[22], p1[23], p2[23], p1[24], p2[24], p1[25], p2[25], p1[26], p2[26],
|
|
|
52 |
p1[27], p2[27], p1[28], p2[28], p1[29], p2[29], p1[30], p2[30], p1[31],
|
|
|
53 |
p2[31], p1[32], p2[32], p1[33], p2[33], '\0'};
|
|
|
54 |
FLLServerURL = [NSURL URLWithString:[NSString stringWithUTF8String:URL]];
|
|
|
55 |
});
|
|
|
56 |
|
|
|
57 |
static NSURL *CSHServerURL;
|
|
|
58 |
static dispatch_once_t CSHOnceToken;
|
|
|
59 |
dispatch_once(&CSHOnceToken, ^{
|
|
|
60 |
// These strings should be interleaved to construct the real URL. This is just to (hopefully)
|
|
|
61 |
// fool github URL scanning bots.
|
|
|
62 |
const char *p1 = "hts/cahyiseot-agolai.o/1frlglgc/aclg";
|
|
|
63 |
const char *p2 = "tp:/rsltcrprsp.ogepscmv/ieo/eaybtho";
|
|
|
64 |
const char URL[72] = {p1[0], p2[0], p1[1], p2[1], p1[2], p2[2], p1[3], p2[3], p1[4],
|
|
|
65 |
p2[4], p1[5], p2[5], p1[6], p2[6], p1[7], p2[7], p1[8], p2[8],
|
|
|
66 |
p1[9], p2[9], p1[10], p2[10], p1[11], p2[11], p1[12], p2[12], p1[13],
|
|
|
67 |
p2[13], p1[14], p2[14], p1[15], p2[15], p1[16], p2[16], p1[17], p2[17],
|
|
|
68 |
p1[18], p2[18], p1[19], p2[19], p1[20], p2[20], p1[21], p2[21], p1[22],
|
|
|
69 |
p2[22], p1[23], p2[23], p1[24], p2[24], p1[25], p2[25], p1[26], p2[26],
|
|
|
70 |
p1[27], p2[27], p1[28], p2[28], p1[29], p2[29], p1[30], p2[30], p1[31],
|
|
|
71 |
p2[31], p1[32], p2[32], p1[33], p2[33], p1[34], p2[34], p1[35], '\0'};
|
|
|
72 |
CSHServerURL = [NSURL URLWithString:[NSString stringWithUTF8String:URL]];
|
|
|
73 |
});
|
|
|
74 |
static NSDictionary<NSNumber *, NSURL *> *uploadURLs;
|
|
|
75 |
static dispatch_once_t URLOnceToken;
|
|
|
76 |
dispatch_once(&URLOnceToken, ^{
|
|
|
77 |
uploadURLs = @{
|
|
|
78 |
@(kGDTCORTargetCCT) : CCTServerURL,
|
|
|
79 |
@(kGDTCORTargetFLL) : FLLServerURL,
|
|
|
80 |
@(kGDTCORTargetCSH) : CSHServerURL,
|
|
|
81 |
@(kGDTCORTargetINT) : [NSURL URLWithString:kINTServerURL]
|
|
|
82 |
};
|
|
|
83 |
});
|
|
|
84 |
return uploadURLs;
|
|
|
85 |
}
|
|
|
86 |
|
|
|
87 |
+ (nullable NSURL *)uploadURLForTarget:(GDTCORTarget)target {
|
|
|
88 |
NSDictionary<NSNumber *, NSURL *> *URLs = [self uploadURLs];
|
|
|
89 |
return [URLs objectForKey:@(target)];
|
|
|
90 |
}
|
|
|
91 |
|
|
|
92 |
@end
|