-
Notifications
You must be signed in to change notification settings - Fork 13
/
Account.cs
1101 lines (1057 loc) · 42.6 KB
/
Account.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using CsQuery;
using IMLokesh.Extensions;
using IMLokesh.Http;
using IMLokesh.HttpUtility;
using Microsoft.CSharp.RuntimeBinder;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Better_Nike_Bot
{
// Token: 0x02000014 RID: 20
public class Account
{
// Token: 0x060000B6 RID: 182 RVA: 0x00002763 File Offset: 0x00000963
public Account()
{
this.Request = (this.Request ?? new HttpHelper("", true, null, 15, null));
}
// Token: 0x060000B7 RID: 183 RVA: 0x000117EC File Offset: 0x0000F9EC
public Account(Account acc)
{
this.EmailAddress = acc.EmailAddress;
this.Password = acc.Password;
this.Size = acc.Size;
this.Keywords = acc.Keywords;
this.CollectionKeywords = acc.CollectionKeywords;
this.EarlyLinks = acc.EarlyLinks;
this.ProductStyleCodes = acc.ProductStyleCodes;
this.Request = (this.Request ?? new HttpHelper("", true, null, 15, null));
this.NotificationEmail = acc.NotificationEmail;
this.NotificationText = acc.NotificationText;
this.CheckoutInfo = acc.CheckoutInfo;
this.SnkrsExploit = acc.SnkrsExploit;
this.IsGuest = acc.IsGuest;
}
// Token: 0x060000B8 RID: 184 RVA: 0x000118B0 File Offset: 0x0000FAB0
public Account(string emailID, string password, string size, string keywords, string collectionKeywords, string earlyLink, string productStyleCode, string notificationEmail, string notificationCarrier, string notificationNumber, CheckoutInfo cInfo, bool isGuest = false)
{
this.EmailAddress = emailID.ToLower();
this.Password = password;
this.Size = (from s in size.Split(new char[]
{
','
})
select s.Trim().Replace(".0", "").TrimStart(new char[]
{
'0'
})).ToArray<string>();
this.Keywords = (keywords.IsNullOrWhiteSpace() ? new List<string>() : keywords.ToLower().Split(new char[]
{
','
}).TrimAll().ToList<string>());
this.CollectionKeywords = (collectionKeywords.IsNullOrWhiteSpace() ? new List<string>() : collectionKeywords.ToLower().Split(new char[]
{
','
}).TrimAll().ToList<string>());
this.EarlyLinks = (earlyLink.IsNullOrWhiteSpace() ? new List<string>() : earlyLink.Split(new char[]
{
','
}).TrimAll().ToList<string>());
this.ProductStyleCodes = (productStyleCode.IsNullOrWhiteSpace() ? new List<string>() : productStyleCode.Split(new char[]
{
','
}).TrimAll().ToList<string>());
this.Request = (this.Request ?? new HttpHelper("", true, null, 15, null));
this.NotificationEmail = notificationEmail;
this.CheckoutInfo = cInfo;
this.SnkrsExploit = false;
this.IsGuest = isGuest;
if (!notificationCarrier.IsNullOrWhiteSpace() && !notificationNumber.IsNullOrWhiteSpace())
{
if (notificationNumber.Length != 10)
{
throw new Exception("Notification mobile number must be a 10 digit number. {0}".With(new object[]
{
notificationNumber
}));
}
try
{
notificationNumber.ParseToLong();
}
catch (Exception)
{
throw new Exception("Notification mobile number must be a 10 digit number. {0}".With(new object[]
{
notificationNumber
}));
}
NotificationService notificationService = NotificationSettings.AvailableTextNotificationServices.FirstOrDefault((NotificationService n) => n.Carrier.ToLower().StartsWith(notificationCarrier.ToLower()));
if (notificationService.IsNull())
{
throw new Exception("Invalid mobile carrier. {0}".With(new object[]
{
notificationCarrier
}));
}
this.NotificationText = notificationNumber + notificationService.EmailSuffix;
}
if (!this.EmailAddress.Contains("@") && this.EmailAddress != "demo")
{
throw new Exception("An email address must contain '@' symbol.");
}
if (!this.NotificationEmail.IsNullOrWhiteSpace() && !this.NotificationEmail.Contains("@"))
{
throw new Exception("An email address must contain '@' symbol.");
}
if (this.EmailAddress.IsNullOrWhiteSpace() || this.Password.IsNullOrWhiteSpace() || this.Size[0].IsNullOrWhiteSpace())
{
throw new Exception("Email, Password and Size are required fields.");
}
if (!earlyLink.IsNullOrWhiteSpace())
{
if (earlyLink.Split(new char[]
{
','
}).TrimAll().Any((string s) => !s.StartsWith("http")))
{
throw new Exception("Invalid early link found. An early link must start with http://");
}
}
if (!earlyLink.IsNullOrWhiteSpace() && earlyLink.Contains("/t/") && productStyleCode.IsNullOrWhiteSpace())
{
throw new Exception("For new nike links, please enter the style code also. If you are running for snkrs only enter style code. Otherwise enter both link and style code.");
}
if (isGuest && this.IsWebSnkrs)
{
throw new Exception("You cannot use guest account for web snkrs. Please enter a product link.");
}
}
// Token: 0x17000032 RID: 50
// (get) Token: 0x060000B9 RID: 185 RVA: 0x0000278A File Offset: 0x0000098A
// (set) Token: 0x060000BA RID: 186 RVA: 0x00002792 File Offset: 0x00000992
public string EmailAddress { get; set; }
// Token: 0x17000033 RID: 51
// (get) Token: 0x060000BB RID: 187 RVA: 0x0000279B File Offset: 0x0000099B
// (set) Token: 0x060000BC RID: 188 RVA: 0x000027A3 File Offset: 0x000009A3
public string Password { get; set; }
// Token: 0x17000034 RID: 52
// (get) Token: 0x060000BD RID: 189 RVA: 0x000027AC File Offset: 0x000009AC
// (set) Token: 0x060000BE RID: 190 RVA: 0x000027B4 File Offset: 0x000009B4
public string[] Size { get; set; }
// Token: 0x17000035 RID: 53
// (get) Token: 0x060000BF RID: 191 RVA: 0x000027BD File Offset: 0x000009BD
// (set) Token: 0x060000C0 RID: 192 RVA: 0x000027C5 File Offset: 0x000009C5
public bool IsGuest { get; set; }
// Token: 0x17000036 RID: 54
// (get) Token: 0x060000C1 RID: 193 RVA: 0x000027CE File Offset: 0x000009CE
// (set) Token: 0x060000C2 RID: 194 RVA: 0x000027D6 File Offset: 0x000009D6
public List<string> Keywords { get; set; }
// Token: 0x17000037 RID: 55
// (get) Token: 0x060000C3 RID: 195 RVA: 0x000027DF File Offset: 0x000009DF
// (set) Token: 0x060000C4 RID: 196 RVA: 0x000027E7 File Offset: 0x000009E7
public List<string> CollectionKeywords { get; set; }
// Token: 0x17000038 RID: 56
// (get) Token: 0x060000C5 RID: 197 RVA: 0x000027F0 File Offset: 0x000009F0
// (set) Token: 0x060000C6 RID: 198 RVA: 0x000027F8 File Offset: 0x000009F8
public List<string> EarlyLinks { get; set; }
// Token: 0x17000039 RID: 57
// (get) Token: 0x060000C7 RID: 199 RVA: 0x00002801 File Offset: 0x00000A01
// (set) Token: 0x060000C8 RID: 200 RVA: 0x00002809 File Offset: 0x00000A09
public List<string> ProductStyleCodes { get; set; }
// Token: 0x1700003A RID: 58
// (get) Token: 0x060000C9 RID: 201 RVA: 0x00002812 File Offset: 0x00000A12
// (set) Token: 0x060000CA RID: 202 RVA: 0x0000281A File Offset: 0x00000A1A
public string NotificationEmail { get; set; }
// Token: 0x1700003B RID: 59
// (get) Token: 0x060000CB RID: 203 RVA: 0x00002823 File Offset: 0x00000A23
// (set) Token: 0x060000CC RID: 204 RVA: 0x0000282B File Offset: 0x00000A2B
public string NotificationText { get; set; }
// Token: 0x1700003C RID: 60
// (get) Token: 0x060000CD RID: 205 RVA: 0x00002834 File Offset: 0x00000A34
// (set) Token: 0x060000CE RID: 206 RVA: 0x0000283C File Offset: 0x00000A3C
public CheckoutInfo CheckoutInfo { get; set; }
// Token: 0x1700003D RID: 61
// (get) Token: 0x060000CF RID: 207 RVA: 0x00002845 File Offset: 0x00000A45
// (set) Token: 0x060000D0 RID: 208 RVA: 0x0000284D File Offset: 0x00000A4D
public bool SnkrsExploit { get; set; }
// Token: 0x1700003E RID: 62
// (get) Token: 0x060000D1 RID: 209 RVA: 0x00002856 File Offset: 0x00000A56
// (set) Token: 0x060000D2 RID: 210 RVA: 0x0000285E File Offset: 0x00000A5E
[JsonIgnore]
public string ProxyAddress { get; set; }
// Token: 0x1700003F RID: 63
// (get) Token: 0x060000D3 RID: 211 RVA: 0x00011C54 File Offset: 0x0000FE54
[JsonIgnore]
public string Checkout
{
get
{
string result = "Invalid Details";
try
{
if (this.CheckoutInfo.IsNull() || false.EqualsAll(new bool[]
{
this.CheckoutInfo.PayPalCheckout,
this.CheckoutInfo.CcCheckout
}))
{
result = "Checkout Disabled";
return result;
}
result = (this.CheckoutInfo.PayPalCheckout ? "PayPal Checkout - {0}".With(new object[]
{
this.CheckoutInfo.PayPalEmailAddress
}) : "CC Checkout - {0}".With(new object[]
{
this.CheckoutInfo.CcProfile
}));
}
catch (Exception)
{
}
return result;
}
}
// Token: 0x17000040 RID: 64
// (get) Token: 0x060000D4 RID: 212 RVA: 0x00002867 File Offset: 0x00000A67
[JsonIgnore]
public bool IsWebSnkrs
{
get
{
return !this.EarlyLinks.IsAny<string>() && this.ProductStyleCodes.IsAny<string>();
}
}
// Token: 0x17000041 RID: 65
// (get) Token: 0x060000D5 RID: 213 RVA: 0x00002886 File Offset: 0x00000A86
// (set) Token: 0x060000D6 RID: 214 RVA: 0x0000288E File Offset: 0x00000A8E
[JsonIgnore]
public string WebSnkrsToken { get; set; }
// Token: 0x17000042 RID: 66
// (get) Token: 0x060000D7 RID: 215 RVA: 0x00002897 File Offset: 0x00000A97
// (set) Token: 0x060000D8 RID: 216 RVA: 0x0000289F File Offset: 0x00000A9F
public bool Disabled { get; set; }
// Token: 0x060000D9 RID: 217 RVA: 0x00011D18 File Offset: 0x0000FF18
public void UpdateDetails(Account acc)
{
this.EmailAddress = acc.EmailAddress;
this.Password = acc.Password;
this.Size = acc.Size;
this.Keywords = acc.Keywords;
this.CollectionKeywords = acc.CollectionKeywords;
this.EarlyLinks = acc.EarlyLinks;
this.ProductStyleCodes = acc.ProductStyleCodes;
this.Request = (this.Request ?? new HttpHelper("", true, null, 15, null));
this.NotificationEmail = acc.NotificationEmail;
this.NotificationText = acc.NotificationText;
this.CheckoutInfo = acc.CheckoutInfo;
this.SnkrsExploit = acc.SnkrsExploit;
this.IsGuest = acc.IsGuest;
}
// Token: 0x060000DA RID: 218 RVA: 0x00011DD4 File Offset: 0x0000FFD4
public string ExportAccount()
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append(this.EmailAddress);
stringBuilder.Append("\t");
stringBuilder.Append(this.Password);
stringBuilder.Append("\t");
stringBuilder.Append(this.Size.JoinToString(","));
stringBuilder.Append("\t");
stringBuilder.Append(this.Keywords.JoinToString(","));
stringBuilder.Append("\t");
stringBuilder.Append(this.CollectionKeywords.JoinToString("\r\n"));
stringBuilder.Append("\t");
stringBuilder.Append(this.EarlyLinks.JoinToString("\r\n"));
stringBuilder.Append("\t");
stringBuilder.Append(this.ProductStyleCodes.JoinToString("\r\n"));
stringBuilder.Append("\t");
stringBuilder.Append(this.NotificationEmail);
stringBuilder.Append("\t");
if (this.NotificationText.IsNullOrWhiteSpace())
{
stringBuilder.Append("");
stringBuilder.Append("\t");
stringBuilder.Append("");
}
else
{
string[] number = this.NotificationText.Split(new char[]
{
'@'
});
stringBuilder.Append(NotificationSettings.AvailableTextNotificationServices.FirstOrDefault((NotificationService n) => n.EmailSuffix.Contains(number[1])).Carrier);
stringBuilder.Append("\t");
stringBuilder.Append(number[0]);
}
return stringBuilder.ToString();
}
// Token: 0x060000DB RID: 219 RVA: 0x00011F7C File Offset: 0x0001017C
public void LoginForBrowser()
{
if (this.IsGuest)
{
return;
}
try
{
Logger.Log("Logging in to browser... {0}".With(new object[]
{
this.EmailAddress
}), true, true);
this.Request.Cookies.SetCookies(new Uri("http://www.nike.com"), "nike_locale={0}/{1}".With(new object[]
{
NikeUrls.NikeCountrySmallCode,
NikeUrls.NikeLangLocale
}));
this.Request.Cookies.SetCookies(new Uri("http://secure-store.nike.com"), "nike_locale={0}/{1}".With(new object[]
{
NikeUrls.NikeCountrySmallCode,
NikeUrls.NikeLangLocale
}));
this.Request.Cookies.SetCookies(new Uri("http://secure-store.nike.com"), "NIKE_COMMERCE_COUNTRY={0}".With(new object[]
{
NikeUrls.NikeCountryCode
}));
this.Request.Cookies.SetCookies(new Uri("http://secure-store.nike.com"), "NIKE_COMMERCE_LANG_LOCALE={0}".With(new object[]
{
NikeUrls.NikeLangLocale
}));
this.Request.Cookies.SetCookies(new Uri("http://secure-store.nike.com"), "CONSUMERCHOICE={0}/{1}".With(new object[]
{
NikeUrls.NikeCountrySmallCode,
NikeUrls.NikeLangLocale
}));
Dictionary<string, string> postData = new Dictionary<string, string>
{
{
"login",
this.EmailAddress
},
{
"rememberMe",
"true"
},
{
"password",
this.Password
}
};
string url = NikeUrls.NikeLogin;
this.Request.PostRequest(url, postData, NikeUrls.NikeStore, "application/x-www-form-urlencoded", new string[]
{
"X-Requested-With: XMLHttpRequest"
}, true);
url = NikeUrls.NikeCartSummary;
this.Request.GetRequest(url, null, null, true, true);
this.IsLoggedIn = true;
}
catch (Exception)
{
Logger.Log("Error logging in to browser. {0}".With(new object[]
{
this.EmailAddress
}), true, true);
}
}
// Token: 0x060000DC RID: 220 RVA: 0x000121B4 File Offset: 0x000103B4
public void SnkrsLogin(int retryCount = 0, int maxRetries = 0)
{
for (;;)
{
if (maxRetries > 0)
{
goto IL_6E;
}
IL_04:
Logger.Log("{0}: Logging in to Nike+ account".With(new object[]
{
this.EmailAddress
}), true, true);
try
{
WebSnkrs.PerformLogin(this);
goto IL_73;
}
catch (Exception ex)
{
Logger.Log("{0}: Login Error! {1}".With(new object[]
{
this.EmailAddress,
ex.Message
}), true, true);
Thread.Sleep(2000);
retryCount++;
continue;
}
IL_6E:
if (retryCount >= maxRetries)
{
break;
}
goto IL_04;
}
return;
IL_73:
this.IsLoggedIn = true;
}
// Token: 0x060000DD RID: 221 RVA: 0x0001224C File Offset: 0x0001044C
public void Login(int retryCount = 0, int maxRetries = 0)
{
for (;;)
{
if (maxRetries > 0)
{
goto IL_419;
}
IL_07:
if ("demo".EqualsAll(new string[]
{
this.EmailAddress,
this.Password
}) || Form1.ShouldStop)
{
goto IL_421;
}
Logger.Log("{0}: Logging in to Nike.".With(new object[]
{
this.EmailAddress
}), true, true);
this.Request.Cookies.SetCookies(new Uri("http://www.nike.com"), "nike_locale={0}/{1}".With(new object[]
{
NikeUrls.NikeCountrySmallCode,
NikeUrls.NikeLangLocale
}));
this.Request.Cookies.SetCookies(new Uri("http://secure-store.nike.com"), "nike_locale={0}/{1}".With(new object[]
{
NikeUrls.NikeCountrySmallCode,
NikeUrls.NikeLangLocale
}));
this.Request.Cookies.SetCookies(new Uri("http://secure-store.nike.com"), "NIKE_COMMERCE_COUNTRY={0}".With(new object[]
{
NikeUrls.NikeCountryCode
}));
this.Request.Cookies.SetCookies(new Uri("http://secure-store.nike.com"), "NIKE_COMMERCE_LANG_LOCALE={0}".With(new object[]
{
NikeUrls.NikeLangLocale
}));
this.Request.Cookies.SetCookies(new Uri("http://secure-store.nike.com"), "CONSUMERCHOICE={0}/{1}".With(new object[]
{
NikeUrls.NikeCountrySmallCode,
NikeUrls.NikeLangLocale
}));
this.Request.Cookies.SetCookies(new Uri("http://www.nike.com"), "nike_locale={0}/{1}".With(new object[]
{
NikeUrls.NikeCountrySmallCode,
NikeUrls.NikeLangLocale
}));
this.Request.Cookies.SetCookies(new Uri("http://www.nike.com"), "NIKE_COMMERCE_COUNTRY={0}".With(new object[]
{
NikeUrls.NikeCountryCode
}));
this.Request.Cookies.SetCookies(new Uri("http://www.nike.com"), "NIKE_COMMERCE_LANG_LOCALE={0}".With(new object[]
{
NikeUrls.NikeLangLocale
}));
this.Request.Cookies.SetCookies(new Uri("http://www.nike.com"), "CONSUMERCHOICE={0}/{1}".With(new object[]
{
NikeUrls.NikeCountrySmallCode,
NikeUrls.NikeLangLocale
}));
this.Request.Cookies.SetCookies(new Uri("http://secure-store.nike.com"), "guidU=" + Guid.NewGuid().ToString().ToLower());
this.Request.Cookies.SetCookies(new Uri("http://secure-store.nike.com"), "guidS=" + Guid.NewGuid().ToString().ToLower());
Dictionary<string, string> dictionary = new Dictionary<string, string>
{
{
"login",
this.EmailAddress
},
{
"rememberMe",
"true"
},
{
"password",
this.Password
}
};
if (this.IsGuest)
{
dictionary["password"] = "a";
}
try
{
string nikeLogin = NikeUrls.NikeLogin;
this.Request.PostRequest(nikeLogin, dictionary, NikeUrls.NikeStore, "application/x-www-form-urlencoded", new string[]
{
"X-Requested-With: XMLHttpRequest"
}, true);
Logger.Log("{0}: Login Successful!.".With(new object[]
{
this.EmailAddress
}), true, true);
goto IL_421;
}
catch (Exception ex)
{
if (this.IsGuest)
{
Logger.Log("{0}: Login Successful!.".With(new object[]
{
this.EmailAddress
}), true, true);
goto IL_421;
}
Logger.Log("{0}: Login Error! {1}".With(new object[]
{
this.EmailAddress,
ex.Message
}), true, true);
Thread.Sleep(2000);
retryCount++;
continue;
}
IL_419:
if (retryCount >= maxRetries)
{
break;
}
goto IL_07;
}
return;
try
{
IL_421:
string nikeCartSummary = NikeUrls.NikeCartSummary;
if (!Form1.UseSnkrsForNonUS && !this.SnkrsExploit && !this.IsWebSnkrs)
{
this.Request.GetRequest(nikeCartSummary, null, null, true, true);
}
}
catch (Exception)
{
}
this.IsLoggedIn = true;
}
// Token: 0x060000DE RID: 222 RVA: 0x000126D4 File Offset: 0x000108D4
public string CheckCart()
{
Logger.Log("{0}: Checking nike cart.".With(new object[]
{
this.EmailAddress
}), true, true);
string nikeCart = NikeUrls.NikeCart;
string text = string.Empty;
string result;
try
{
text = this.Request.GetRequest(nikeCart, null, null, true, true);
goto IL_7C;
}
catch (Exception ex)
{
Logger.Log("{0}: Error checking nike cart. {1}".With(new object[]
{
this.EmailAddress,
ex.Message
}), true, true);
result = text;
}
return result;
IL_7C:
StringBuilder stringBuilder = new StringBuilder();
CQ cq = text.CQSelect("form#lineitemform div[class$=cartItem]");
if (!cq.IsAny<IDomObject>())
{
stringBuilder.AppendLine("Your nike cart is empty!");
}
else
{
foreach (IDomObject domObject in cq)
{
stringBuilder.AppendLine("Item Name: " + domObject.Cq().Find("[class$=cartItemTitle]").Text().ReplaceNewLine("").HtmlDecode().Trim());
CQ cq2 = domObject.Cq().Find("[class$=cartItemOption]");
foreach (IDomObject domObject2 in cq2)
{
stringBuilder.AppendLine(domObject2.Cq().Text().ReplaceNewLine("").HtmlDecode().Trim());
}
stringBuilder.AppendLine();
stringBuilder.AppendLine();
}
}
cq = text.CQSelect("form#giftlistform div[class$=cartItem]");
if (cq.IsAny<IDomObject>())
{
stringBuilder.AppendLine();
stringBuilder.AppendLine();
stringBuilder.AppendLine("Wishlist/Locker Items:");
stringBuilder.AppendLine();
foreach (IDomObject domObject3 in cq)
{
stringBuilder.AppendLine("Item Name: " + domObject3.Cq().Find("[class$=cartItemTitle]").Text().ReplaceNewLine("").HtmlDecode().Trim());
CQ cq3 = domObject3.Cq().Find("[class$=cartItemOption]");
foreach (IDomObject domObject4 in cq3)
{
stringBuilder.AppendLine(domObject4.Cq().Text().ReplaceNewLine("").HtmlDecode().Trim());
}
stringBuilder.AppendLine();
stringBuilder.AppendLine();
}
}
return stringBuilder.ToString();
}
// Token: 0x060000DF RID: 223 RVA: 0x000129CC File Offset: 0x00010BCC
public void ClearCart()
{
string nikeCart = NikeUrls.NikeCart;
string request = this.Request.GetRequest(nikeCart, null, null, true, true);
string url = NikeUrls.NikeCartDargs;
string text = request.CQSelect("input[name=_dynSessConf]").Val();
string text2 = request.CQSelect("input[name=_dyncharset]").Val();
CQ cq = request.CQSelect("form#lineitemform div[class$=cartItem]");
if (cq.IsAny<IDomObject>())
{
foreach (IDomObject domObject in cq)
{
string text3 = domObject.Cq().Find("[class$=cartItemTitle]").Text().ReplaceNewLine("").HtmlDecode().Trim();
string text4 = domObject.Cq().Find("input[name='remove']").Attr("params").Split(new string[]
{
"||"
}, StringSplitOptions.None)[0];
string postData = "_dyncharset={0}&_dynSessConf={1}&route=html&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.addRemoveUpdateItemSuccessURL=cartPageURL&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.addRemoveUpdateItemSuccessURL=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.addRemoveUpdateItemErrorURL=cartPageURL&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.addRemoveUpdateItemErrorURL=+&commerceid={2}&_D%3Acommerceid=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.quantity=0&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.quantity=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.giftListId=&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.giftListId=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.giftListQuantity=&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.giftListQuantity=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.productId=&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.productId=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.skuId=&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.skuId=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.metrics_id=&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.metrics_id=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.metric_type=&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.metric_type=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.prebuild_pid=&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.prebuild_pid=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.channel=&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.channel=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.action=removeItem&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.action=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.itemReturnUrl=&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.itemReturnUrl=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.addRemoveUpdateItem=true&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.addRemoveUpdateItem=+&_DARGS=%2Fus%2Fcheckout%2Fcommon%2Fincludes%2FlineItem.jsp.lineitemform".With(new object[]
{
text2,
text,
text4
});
this.Request.PostRequest(url, postData, nikeCart, "application/x-www-form-urlencoded", null, true, "POST");
Logger.Log("{0}: Item {1} has been removed from cart.".With(new object[]
{
this.EmailAddress,
text3
}), true, true);
}
}
cq = request.CQSelect("form#giftlistform div[class$=cartItem]");
if (cq.IsAny<IDomObject>())
{
foreach (IDomObject domObject2 in cq)
{
string text5 = domObject2.Cq().Find("[class$=cartItemTitle]").Text().ReplaceNewLine("").HtmlDecode().Trim();
string[] array = domObject2.Cq().Find("input[name='remove']").Attr("params").Split(new string[]
{
"||"
}, StringSplitOptions.None);
string postData2 = "_dyncharset={0}&_dynSessConf={1}&{2}=1&route=html&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.addRemoveUpdateItemSuccessURL=cartPageURL&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.addRemoveUpdateItemSuccessURL=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.addRemoveUpdateItemErrorURL=cartPageURL&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.addRemoveUpdateItemErrorURL=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.skuId=&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.skuId=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.productId=&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.productId=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.giftListId={3}&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.giftListId=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.quantity=&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.quantity=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.catalogId=&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.catalogId=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.siteId=&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.siteId=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.sizeType=&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.sizeType=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.displaySize=&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.displaySize=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.giftListItemId={2}&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.giftListItemId=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.action=removeFromLocker&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.dataMap.action=+&%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.addRemoveUpdateItem=true&_D%3A%2Fatg%2Fcommerce%2Forder%2Fpurchase%2FMiniCartModifierFormHandler.addRemoveUpdateItem=+&_DARGS=%2Fus%2Fcheckout%2Fcommon%2Fincludes%2FmyLocker.jsp.giftlistform".With(new object[]
{
text2,
text,
array[1],
array[0]
});
url = NikeUrls.NikeCartLockerDargs;
this.Request.PostRequest(url, postData2, nikeCart, "application/x-www-form-urlencoded", null, true, "POST");
Logger.Log("{0}: Item {1} has been removed from locker.".With(new object[]
{
this.EmailAddress,
text5
}), true, true);
}
}
Logger.Log("{0}: Cart cleared successfuly".With(new object[]
{
this.EmailAddress
}), true, true);
}
// Token: 0x060000E0 RID: 224 RVA: 0x00012CA4 File Offset: 0x00010EA4
public string GetAllSkusNew(string el)
{
string text = string.Empty;
StringBuilder stringBuilder = new StringBuilder();
string[] segments = new Uri(el).Segments;
string text2 = "";
string displayName = "";
foreach (string text3 in segments)
{
if (text3.Contains("pid-"))
{
text2 = text3.Replace("pid-", "").Replace("/", "");
}
if (text3.Contains("shoe"))
{
displayName = text3.Replace("-", " ").Replace("/", "").ToLower();
}
}
if (text2.IsNullOrWhiteSpace())
{
Logger.Log("{0} invalid pid".With(new object[]
{
el
}), true, true);
return "";
}
JObject jobject = null;
JArray jarray = null;
try
{
text = this.Request.GetRequest(NikeUrls.NikeLoadSkus.With(new object[]
{
text2
}), null, null, true, true);
jobject = JObject.Parse(text);
jarray = jobject["product"].Value<JArray>("childSKUs");
}
catch (Exception)
{
}
if (!jarray.IsAny<JToken>())
{
Logger.Log("No available sizes found!", true, true);
return "";
}
foreach (JToken jtoken in jarray)
{
stringBuilder.AppendLine("Size: {0}\t\tSkuId: {1}".With(new object[]
{
jtoken["sizeDescription"].ToString().ConvertToNativeSize(),
jtoken["id"].ToString()
}));
}
stringBuilder.AppendLine();
stringBuilder.AppendLine();
stringBuilder.AppendLine(NikeUrls.NikeLoadSkus.With(new object[]
{
text2
}));
stringBuilder.AppendLine(text);
stringBuilder.AppendLine();
stringBuilder.AppendLine();
Dictionary<string, string> o = new Dictionary<string, string>
{
{
NikeUrls.NikeLoadSkus.With(new object[]
{
text2
}),
text
}
};
stringBuilder.AppendLine(JObject.FromObject(o).ToString());
try
{
string nikeLoadProduct = NikeUrls.NikeLoadProduct;
text = this.Request.GetRequest(nikeLoadProduct.With(new object[]
{
text2
}), null, null, true, true);
jobject = (JObject)((JObject)JsonConvert.DeserializeObject(text))["product"];
}
catch (Exception)
{
var o2 = new
{
displayName = displayName,
id = text2,
styleNumber = "",
colorNumber = "",
colorDescription = "",
listPrice = ""
};
jobject = JObject.FromObject(o2);
}
return "Product Name: {0}\r\nLink: {7}\r\nProduct ID: {1}\r\nStyle #: {2}\r\nColor Desc: {3}\r\nPrice: {6}\r\nImage: {4}\r\n\r\nSize Details:\r\n{5}".With(new object[]
{
jobject["displayName"],
jobject["id"],
"{0}-{1}".With(new object[]
{
jobject["styleNumber"],
jobject["colorNumber"]
}),
jobject["colorDescription"],
"https://secure-images.nike.com/is/image/DotCom/{0}_{1}".With(new object[]
{
jobject["styleNumber"],
jobject["colorNumber"]
}),
stringBuilder.ToString(),
jobject["listPrice"],
el
});
}
// Token: 0x060000E1 RID: 225 RVA: 0x00013060 File Offset: 0x00011260
public string GetAllSkus(string el)
{
string text = string.Empty;
StringBuilder stringBuilder = new StringBuilder();
string[] segments = new Uri(el).Segments;
string text2 = "";
string displayName = "";
foreach (string text3 in segments)
{
if (text3.Contains("pid-"))
{
text2 = text3.Replace("pid-", "").Replace("/", "");
}
if (text3.Contains("shoe"))
{
displayName = text3.Replace("-", " ").Replace("/", "").ToLower();
}
}
if (text2.IsNullOrWhiteSpace())
{
Logger.Log("{0} invalid pid".With(new object[]
{
el
}), true, true);
return "";
}
JObject jobject = null;
JArray jarray = null;
try
{
text = this.Request.GetRequest(NikeUrls.NikeInventory.With(new object[]
{
text2
}), null, null, true, true);
jobject = JObject.Parse(text);
jarray = jobject["product"].Value<JArray>("childSKUs");
}
catch (Exception)
{
}
if (!jarray.IsAny<JToken>())
{
Logger.Log("No available sizes found!", true, true);
return "";
}
string text4 = NikeUrls.NikeCart;
foreach (object arg in jarray)
{
if (Account.<GetAllSkus>o__SiteContainere.<>p__Sitef == null)
{
Account.<GetAllSkus>o__SiteContainere.<>p__Sitef = CallSite<Action<CallSite, Account, string, object>>.Create(Binder.InvokeMember(CSharpBinderFlags.InvokeSimpleName | CSharpBinderFlags.ResultDiscarded, "AddToLocker", null, typeof(Account), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
Action<CallSite, Account, string, object> target = Account.<GetAllSkus>o__SiteContainere.<>p__Sitef.Target;
CallSite <>p__Sitef = Account.<GetAllSkus>o__SiteContainere.<>p__Sitef;
if (Account.<GetAllSkus>o__SiteContainere.<>p__Site10 == null)
{
Account.<GetAllSkus>o__SiteContainere.<>p__Site10 = CallSite<Func<CallSite, object, object>>.Create(Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(Account), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
Func<CallSite, object, object> target2 = Account.<GetAllSkus>o__SiteContainere.<>p__Site10.Target;
CallSite <>p__Site = Account.<GetAllSkus>o__SiteContainere.<>p__Site10;
if (Account.<GetAllSkus>o__SiteContainere.<>p__Site11 == null)
{
Account.<GetAllSkus>o__SiteContainere.<>p__Site11 = CallSite<Func<CallSite, object, object>>.Create(Binder.GetMember(CSharpBinderFlags.None, "id", typeof(Account), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
target(<>p__Sitef, this, el, target2(<>p__Site, Account.<GetAllSkus>o__SiteContainere.<>p__Site11.Target(Account.<GetAllSkus>o__SiteContainere.<>p__Site11, arg)));
try
{
text = this.Request.GetRequest(text4, null, null, true, true);
}
catch (Exception ex)
{
Logger.Log("{0}: Error checking nike cart. {1}".With(new object[]
{
this.EmailAddress,
ex.Message
}), true, true);
return text;
}
CQ cq = text.CQSelect("form#giftlistform div[class$=cartItem] input[name=addToCart]");
if (cq.IsAny<IDomObject>())
{
foreach (IDomObject domObject in cq)
{
string[] array2 = domObject.GetAttribute("params").Split(new string[]
{
"||"
}, StringSplitOptions.None);
if (array2[1] == text2)
{
stringBuilder.AppendLine("Size: {0}\tSkuId: {1}".With(new object[]
{
array2[7],
array2[2]
}));
}
}
}
this.ClearCart();
}
jobject = null;
try
{
text4 = NikeUrls.NikeLoadProduct;
text = this.Request.GetRequest(text4.With(new object[]
{
text2
}), null, null, true, true);
jobject = (JObject)((JObject)JsonConvert.DeserializeObject(text))["product"];
}
catch (Exception)
{
var o = new
{
displayName = displayName,
id = text2,
styleNumber = "",
colorNumber = "",
colorDescription = "",
listPrice = ""
};
jobject = JObject.FromObject(o);
}
return "Product Name: {0}\r\nLink: {7}\r\nProduct ID: {1}\r\nStyle #: {2}\r\nColor Desc: {3}\r\nPrice: {6}\r\nImage: {4}\r\n\r\nSize Details:\r\n{5}".With(new object[]
{
jobject["displayName"],
jobject["id"],
"{0}-{1}".With(new object[]
{
jobject["styleNumber"],
jobject["colorNumber"]
}),
jobject["colorDescription"],
"https://secure-images.nike.com/is/image/DotCom/{0}_{1}".With(new object[]
{
jobject["styleNumber"],
jobject["colorNumber"]
}),
stringBuilder.ToString(),
jobject["listPrice"],
el
});
}
// Token: 0x060000E2 RID: 226 RVA: 0x000135B8 File Offset: 0x000117B8
public void AddToLocker(string el, string sku = null)
{
string[] segments = new Uri(el).Segments;
string text = "";
foreach (string text2 in segments)
{
if (text2.Contains("pid-"))
{
text = text2.Replace("pid-", "").Replace("/", "");
}
}
if (text.IsNullOrWhiteSpace())
{
Logger.Log("{0} invalid pid".With(new object[]
{
el
}), true, true);
return;
}
AddToCart addToCart = new AddToCart(new AtcItem(this, el, this.Size[0]), null);
addToCart.AtcItem.Details.ProductId = text;
addToCart.Simulate = true;
if (sku == null)
{
addToCart.GetProductDetailsNew();
sku = addToCart.AtcItem.Details.SkuId;
}