This commit is contained in:
niko
2026-04-12 16:51:38 +02:00
parent 1b6f6d81d0
commit c12fbe3fc6
17828 changed files with 2994770 additions and 0 deletions
+573
View File
@@ -0,0 +1,573 @@
using System;
using System.Collections.Generic;
using System.IO;
using BestHTTP.Extensions;
using BestHTTP.Logger;
using Cpp2IlInjected;
namespace BestHTTP.Cookies
{
// Token: 0x0200209E RID: 8350
[Token(Token = "0x200209E")]
public sealed class Cookie : IComparable<Cookie>, IEquatable<Cookie>
{
// Token: 0x17002161 RID: 8545
// (get) Token: 0x0600D1CD RID: 53709 RVA: 0x002FEA30 File Offset: 0x002FCC30
// (set) Token: 0x0600D1CE RID: 53710 RVA: 0x002FEA44 File Offset: 0x002FCC44
[Token(Token = "0x17002161")]
public string Name
{
[Token(Token = "0x600D1CD")]
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530")]
get;
[Token(Token = "0x600D1CE")]
[Address(RVA = "0x415800", Offset = "0x414800", VA = "0x180415800")]
private set;
}
// Token: 0x17002162 RID: 8546
// (get) Token: 0x0600D1CF RID: 53711 RVA: 0x002FEA58 File Offset: 0x002FCC58
// (set) Token: 0x0600D1D0 RID: 53712 RVA: 0x002FEA6C File Offset: 0x002FCC6C
[Token(Token = "0x17002162")]
public string Value
{
[Token(Token = "0x600D1CF")]
[Address(RVA = "0x4157B0", Offset = "0x4147B0", VA = "0x1804157B0")]
get;
[Token(Token = "0x600D1D0")]
[Address(RVA = "0x4157F0", Offset = "0x4147F0", VA = "0x1804157F0")]
private set;
}
// Token: 0x17002163 RID: 8547
// (get) Token: 0x0600D1D1 RID: 53713 RVA: 0x002FEA80 File Offset: 0x002FCC80
// (set) Token: 0x0600D1D2 RID: 53714 RVA: 0x002FEA94 File Offset: 0x002FCC94
[Token(Token = "0x17002163")]
public DateTime Date
{
[Token(Token = "0x600D1D1")]
[Address(RVA = "0x4157C0", Offset = "0x4147C0", VA = "0x1804157C0")]
get;
[Token(Token = "0x600D1D2")]
[Address(RVA = "0x415810", Offset = "0x414810", VA = "0x180415810")]
internal set;
}
// Token: 0x17002164 RID: 8548
// (get) Token: 0x0600D1D3 RID: 53715 RVA: 0x002FEAA8 File Offset: 0x002FCCA8
// (set) Token: 0x0600D1D4 RID: 53716 RVA: 0x002FEABC File Offset: 0x002FCCBC
[Token(Token = "0x17002164")]
public DateTime LastAccess
{
[Token(Token = "0x600D1D3")]
[Address(RVA = "0x4157D0", Offset = "0x4147D0", VA = "0x1804157D0")]
get;
[Token(Token = "0x600D1D4")]
[Address(RVA = "0x415820", Offset = "0x414820", VA = "0x180415820")]
set;
}
// Token: 0x17002165 RID: 8549
// (get) Token: 0x0600D1D5 RID: 53717 RVA: 0x002FEAD0 File Offset: 0x002FCCD0
// (set) Token: 0x0600D1D6 RID: 53718 RVA: 0x002FEAE4 File Offset: 0x002FCCE4
[Token(Token = "0x17002165")]
public DateTime Expires
{
[Token(Token = "0x600D1D5")]
[Address(RVA = "0x4157E0", Offset = "0x4147E0", VA = "0x1804157E0")]
get;
[Token(Token = "0x600D1D6")]
[Address(RVA = "0x415830", Offset = "0x414830", VA = "0x180415830")]
private set;
}
// Token: 0x17002166 RID: 8550
// (get) Token: 0x0600D1D7 RID: 53719 RVA: 0x002FEAF8 File Offset: 0x002FCCF8
// (set) Token: 0x0600D1D8 RID: 53720 RVA: 0x002FEB0C File Offset: 0x002FCD0C
[Token(Token = "0x17002166")]
public long MaxAge
{
[Token(Token = "0x600D1D7")]
[Address(RVA = "0x41CEF0", Offset = "0x41BEF0", VA = "0x18041CEF0")]
get;
[Token(Token = "0x600D1D8")]
[Address(RVA = "0x41CFF0", Offset = "0x41BFF0", VA = "0x18041CFF0")]
private set;
}
// Token: 0x17002167 RID: 8551
// (get) Token: 0x0600D1D9 RID: 53721 RVA: 0x002FEB20 File Offset: 0x002FCD20
// (set) Token: 0x0600D1DA RID: 53722 RVA: 0x002FEB34 File Offset: 0x002FCD34
[Token(Token = "0x17002167")]
public bool IsSession
{
[Token(Token = "0x600D1D9")]
[Address(RVA = "0x41CF00", Offset = "0x41BF00", VA = "0x18041CF00")]
get;
[Token(Token = "0x600D1DA")]
[Address(RVA = "0x41D000", Offset = "0x41C000", VA = "0x18041D000")]
private set;
}
// Token: 0x17002168 RID: 8552
// (get) Token: 0x0600D1DB RID: 53723 RVA: 0x002FEB48 File Offset: 0x002FCD48
// (set) Token: 0x0600D1DC RID: 53724 RVA: 0x002FEB5C File Offset: 0x002FCD5C
[Token(Token = "0x17002168")]
public string Domain
{
[Token(Token = "0x600D1DB")]
[Address(RVA = "0x4975A0", Offset = "0x4965A0", VA = "0x1804975A0")]
get;
[Token(Token = "0x600D1DC")]
[Address(RVA = "0x55BCF0", Offset = "0x55ACF0", VA = "0x18055BCF0")]
private set;
}
// Token: 0x17002169 RID: 8553
// (get) Token: 0x0600D1DD RID: 53725 RVA: 0x002FEB70 File Offset: 0x002FCD70
// (set) Token: 0x0600D1DE RID: 53726 RVA: 0x002FEB84 File Offset: 0x002FCD84
[Token(Token = "0x17002169")]
public string Path
{
[Token(Token = "0x600D1DD")]
[Address(RVA = "0x4936E0", Offset = "0x4926E0", VA = "0x1804936E0")]
get;
[Token(Token = "0x600D1DE")]
[Address(RVA = "0x55BCE0", Offset = "0x55ACE0", VA = "0x18055BCE0")]
private set;
}
// Token: 0x1700216A RID: 8554
// (get) Token: 0x0600D1DF RID: 53727 RVA: 0x002FEB98 File Offset: 0x002FCD98
// (set) Token: 0x0600D1E0 RID: 53728 RVA: 0x002FEBAC File Offset: 0x002FCDAC
[Token(Token = "0x1700216A")]
public bool IsSecure
{
[Token(Token = "0x600D1DF")]
[Address(RVA = "0x51F220", Offset = "0x51E220", VA = "0x18051F220")]
get;
[Token(Token = "0x600D1E0")]
[Address(RVA = "0x51DB50", Offset = "0x51CB50", VA = "0x18051DB50")]
private set;
}
// Token: 0x1700216B RID: 8555
// (get) Token: 0x0600D1E1 RID: 53729 RVA: 0x002FEBC0 File Offset: 0x002FCDC0
// (set) Token: 0x0600D1E2 RID: 53730 RVA: 0x002FEBD4 File Offset: 0x002FCDD4
[Token(Token = "0x1700216B")]
public bool IsHttpOnly
{
[Token(Token = "0x600D1E1")]
[Address(RVA = "0x538C50", Offset = "0x537C50", VA = "0x180538C50")]
get;
[Token(Token = "0x600D1E2")]
[Address(RVA = "0x6A46A0", Offset = "0x6A36A0", VA = "0x1806A46A0")]
private set;
}
// Token: 0x0600D1E3 RID: 53731 RVA: 0x002FEBE8 File Offset: 0x002FCDE8
[Token(Token = "0x600D1E3")]
[Address(RVA = "0x2409B10", Offset = "0x2408B10", VA = "0x182409B10")]
public Cookie(string name, string value)
{
string empty = string.Empty;
}
// Token: 0x0600D1E4 RID: 53732 RVA: 0x002FEBFC File Offset: 0x002FCDFC
[Token(Token = "0x600D1E4")]
[Address(RVA = "0x2409E00", Offset = "0x2408E00", VA = "0x182409E00")]
public Cookie(string name, string value, string path)
{
string empty = string.Empty;
}
// Token: 0x0600D1E5 RID: 53733 RVA: 0x002FEC10 File Offset: 0x002FCE10
[Token(Token = "0x600D1E5")]
[Address(RVA = "0x2409D50", Offset = "0x2408D50", VA = "0x182409D50")]
public Cookie(string name, string value, string path, string domain)
{
int num = 0;
base.FieldGetter(num, value, path);
this.IsSession = true;
this.MaxAge = (long)((ulong)(-1L));
DateTime utcNow = DateTime.UtcNow;
this.LastAccess = utcNow;
this.Name = name;
this.Value = value;
this.Domain = 0;
this.Path = path;
}
// Token: 0x0600D1E6 RID: 53734 RVA: 0x002FEC64 File Offset: 0x002FCE64
[Token(Token = "0x600D1E6")]
[Address(RVA = "0x2409B90", Offset = "0x2408B90", VA = "0x182409B90")]
public Cookie(Uri uri, string name, string value, DateTime expires, bool isSession = true)
{
string absolutePath = uri.AbsolutePath;
string host = uri.Host;
this.Expires = 0;
this.IsSession = false;
DateTime utcNow = DateTime.UtcNow;
this.Date = utcNow;
}
// Token: 0x0600D1E7 RID: 53735 RVA: 0x002FECA4 File Offset: 0x002FCEA4
[Token(Token = "0x600D1E7")]
[Address(RVA = "0x2409C70", Offset = "0x2408C70", VA = "0x182409C70")]
public Cookie(Uri uri, string name, string value, long maxAge = -1L, bool isSession = true)
{
string absolutePath = uri.AbsolutePath;
string host = uri.Host;
this.MaxAge = 0L;
this.IsSession = false;
DateTime utcNow = DateTime.UtcNow;
this.Date = utcNow;
}
// Token: 0x0600D1E8 RID: 53736 RVA: 0x002FECE4 File Offset: 0x002FCEE4
[Token(Token = "0x600D1E8")]
[Address(RVA = "0x2409E80", Offset = "0x2408E80", VA = "0x182409E80")]
internal Cookie()
{
this.IsSession = true;
this.MaxAge = (long)((ulong)(-1L));
DateTime utcNow = DateTime.UtcNow;
this.LastAccess = utcNow;
}
// Token: 0x0600D1E9 RID: 53737 RVA: 0x002FED18 File Offset: 0x002FCF18
[Token(Token = "0x600D1E9")]
[Address(RVA = "0x2409A00", Offset = "0x2408A00", VA = "0x182409A00")]
public bool WillExpireInTheFuture()
{
if (!this.<IsSession>k__BackingField)
{
DateTime utcNow = DateTime.UtcNow;
DateTime dateTime = this.<Date>k__BackingField;
TimeSpan timeSpan = utcNow - dateTime;
int num = 0;
return Math.Max(0L, (long)num) < this.<MaxAge>k__BackingField;
}
return true;
}
// Token: 0x0600D1EA RID: 53738 RVA: 0x002FED78 File Offset: 0x002FCF78
[Token(Token = "0x600D1EA")]
[Address(RVA = "0x2408BC0", Offset = "0x2407BC0", VA = "0x182408BC0")]
public uint GuessSize()
{
/*
An exception occurred when decompiling this method (0600D1EA)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.UInt32 BestHTTP.Cookies.Cookie::GuessSize()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_6C:
stloc:int32(var_8, add:int32(ldloc:int32(var_8), ldc.i4:int32(35)))
stloc:int32(var_8, add:int32(ldloc:int32(var_8), ldloc:int32(var_1_08)))
stloc:int32(var_8, add:int32(ldloc:int32(var_8), ldloc:int32(var_1_08)))
stloc:int32(var_8, add:int32(ldloc:int32(var_8), ldloc:int32(var_1_08)))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600D1EB RID: 53739 RVA: 0x002FEE0C File Offset: 0x002FD00C
[Token(Token = "0x600D1EB")]
[Address(RVA = "0x2408FB0", Offset = "0x2407FB0", VA = "0x182408FB0")]
public static Cookie Parse(string header, Uri defaultDomain)
{
int num = 0;
Cookie cookie = new Cookie();
cookie.<IsSession>k__BackingField = true;
cookie.<MaxAge>k__BackingField = (long)((ulong)(-1L));
DateTime utcNow = DateTime.UtcNow;
cookie.<LastAccess>k__BackingField = utcNow;
List<HeaderValue> list = Cookie.ParseCookieHeader(header);
bool flag;
if (flag)
{
int stringLength = header.m_stringLength;
string text;
if (string.Equals(text, "path"))
{
if (!string.IsNullOrEmpty(text))
{
bool flag2 = text.StartsWith("/");
if (flag2)
{
cookie.<Path>k__BackingField = flag2;
}
}
cookie.<Path>k__BackingField = "/";
}
if (string.Equals(text, "domain") && !string.IsNullOrEmpty(text))
{
string text2;
if (text.StartsWith("."))
{
text2 = text.Substring(1);
}
cookie.<Domain>k__BackingField = text2;
}
if (string.Equals(text, "expires"))
{
DateTime dateTime = DateTime.FromBinary(0L);
DateTime dateTime2 = text.ToDateTime(dateTime);
cookie.<Expires>k__BackingField = dateTime2;
cookie.<IsSession>k__BackingField = false;
}
if (string.Equals(text, "max-age"))
{
long num2;
cookie.<MaxAge>k__BackingField = num2;
cookie.<IsSession>k__BackingField = false;
}
if (string.Equals(text, "secure"))
{
cookie.<IsSecure>k__BackingField = true;
}
bool flag3 = string.Equals(text, "httponly");
if (flag3)
{
cookie.<IsHttpOnly>k__BackingField = true;
}
cookie.<Name>k__BackingField = flag3;
cookie.<Value>k__BackingField = flag3;
}
if (num == 0)
{
if (num != -1)
{
}
cookie.<IsSession>k__BackingField = true;
string text3 = cookie.<Domain>k__BackingField;
string host = defaultDomain.Host;
cookie.<Domain>k__BackingField = host;
string text4 = cookie.<Path>k__BackingField;
if (host != 0)
{
string absolutePath = defaultDomain.AbsolutePath;
cookie.<Path>k__BackingField = absolutePath;
}
DateTime utcNow2 = DateTime.UtcNow;
cookie.<LastAccess>k__BackingField = utcNow2;
cookie.<Date>k__BackingField = utcNow2;
ILogger logger = HTTPManager.Logger;
string[] array = new string[6];
throw new ArrayTypeMismatchException();
}
throw new NullReferenceException();
}
// Token: 0x0600D1EC RID: 53740 RVA: 0x002FF0BC File Offset: 0x002FD2BC
[Token(Token = "0x600D1EC")]
[Address(RVA = "0x24097C0", Offset = "0x24087C0", VA = "0x1824097C0")]
internal void SaveTo(BinaryWriter stream)
{
stream.Write(1);
string text = this.<Name>k__BackingField;
if (text == 0)
{
}
stream.Write(text);
string empty;
if (this.<Value>k__BackingField == 0)
{
empty = string.Empty;
}
stream.Write(empty);
DateTime dateTime = this.<Date>k__BackingField;
long num;
stream.Write((uint)num);
DateTime dateTime2 = this.<LastAccess>k__BackingField;
long num2;
stream.Write((uint)num2);
DateTime dateTime3 = this.<Expires>k__BackingField;
long num3;
stream.Write((uint)num3);
long num4 = this.<MaxAge>k__BackingField;
stream.Write((uint)num4);
stream.Flush();
string empty2;
if (this.<Domain>k__BackingField == 0)
{
empty2 = string.Empty;
}
stream.Write(empty2);
string empty3;
if (this.<Path>k__BackingField == 0)
{
empty3 = string.Empty;
}
stream.Write(empty3);
stream.Flush();
stream.Flush();
}
// Token: 0x0600D1ED RID: 53741 RVA: 0x002FF180 File Offset: 0x002FD380
[Token(Token = "0x600D1ED")]
[Address(RVA = "0x2408C20", Offset = "0x2407C20", VA = "0x182408C20")]
internal void LoadFrom(BinaryReader stream)
{
ushort num = stream.ReadUInt16();
decimal num2 = stream.ReadDecimal();
this.<Name>k__BackingField = num2;
decimal num3 = stream.ReadDecimal();
this.<Value>k__BackingField = num3;
DateTime dateTime = DateTime.FromBinary((long)stream.ReadUInt32());
this.<Date>k__BackingField = dateTime;
DateTime dateTime2 = DateTime.FromBinary((long)stream.ReadUInt32());
this.<LastAccess>k__BackingField = dateTime2;
DateTime dateTime3 = DateTime.FromBinary((long)stream.ReadUInt32());
this.<Expires>k__BackingField = dateTime3;
uint num4 = stream.ReadUInt32();
this.<MaxAge>k__BackingField = (long)num4;
int num5 = stream.Read();
this.<IsSession>k__BackingField = num5 != 0;
decimal num6 = stream.ReadDecimal();
this.<Domain>k__BackingField = num6;
decimal num7 = stream.ReadDecimal();
this.<Path>k__BackingField = num7;
int num8 = stream.Read();
this.<IsSecure>k__BackingField = num8 != 0;
int num9 = stream.Read();
this.<IsHttpOnly>k__BackingField = num9 != 0;
}
// Token: 0x0600D1EE RID: 53742 RVA: 0x002FF254 File Offset: 0x002FD454
[Token(Token = "0x600D1EE")]
[Address(RVA = "0x24099C0", Offset = "0x24089C0", VA = "0x1824099C0", Slot = "3")]
public override string ToString()
{
string text = this.<Value>k__BackingField;
return this.<Name>k__BackingField + "=" + text;
}
// Token: 0x0600D1EF RID: 53743 RVA: 0x002FF27C File Offset: 0x002FD47C
[Token(Token = "0x600D1EF")]
[Address(RVA = "0x2408B50", Offset = "0x2407B50", VA = "0x182408B50", Slot = "0")]
public override bool Equals(object obj)
{
if (obj != 0)
{
bool flag;
return flag;
}
}
// Token: 0x0600D1F0 RID: 53744 RVA: 0x002FF290 File Offset: 0x002FD490
[Token(Token = "0x600D1F0")]
[Address(RVA = "0x2408A90", Offset = "0x2407A90", VA = "0x182408A90", Slot = "5")]
public bool Equals(Cookie cookie)
{
if (cookie != 0)
{
if (this != cookie)
{
string text = this.<Name>k__BackingField;
string text2 = cookie.<Name>k__BackingField;
if (!text.Equals(text2, StringComparison.Ordinal))
{
goto IL_76;
}
string text3 = this.<Domain>k__BackingField;
if (text3 != 0 || cookie.<Domain>k__BackingField != text3)
{
string text4 = cookie.<Domain>k__BackingField;
if (!text3.Equals(text4, StringComparison.Ordinal))
{
goto IL_76;
}
}
string text5 = this.<Path>k__BackingField;
if (text5 != 0 || cookie.<Path>k__BackingField != text5)
{
string text6 = cookie.<Path>k__BackingField;
return text5.Equals(text6, StringComparison.Ordinal);
}
}
return true;
}
IL_76:
throw new NullReferenceException();
}
// Token: 0x0600D1F1 RID: 53745 RVA: 0x002FF31C File Offset: 0x002FD51C
[Token(Token = "0x600D1F1")]
[Address(RVA = "0x8A4D10", Offset = "0x8A3D10", VA = "0x1808A4D10", Slot = "2")]
public override int GetHashCode()
{
TypeCode typeCode = ((IConvertible)this.GetHashCode()).GetTypeCode();
throw new NullReferenceException();
}
// Token: 0x0600D1F2 RID: 53746 RVA: 0x002FF33C File Offset: 0x002FD53C
[Token(Token = "0x600D1F2")]
[Address(RVA = "0x2409730", Offset = "0x2408730", VA = "0x182409730")]
private static string ReadValue(string str, ref int pos)
{
string empty = string.Empty;
if (str != 0)
{
}
return empty;
}
// Token: 0x0600D1F3 RID: 53747 RVA: 0x002FF354 File Offset: 0x002FD554
[Token(Token = "0x600D1F3")]
[Address(RVA = "0x2408DC0", Offset = "0x2407DC0", VA = "0x182408DC0")]
private static List<HeaderValue> ParseCookieHeader(string str)
{
List<HeaderValue> list = new List();
if (str != 0)
{
int num = 0;
if (num < str.m_stringLength)
{
Func<char, bool> <>9__61_ = Cookie.<>c.<>9__61_0;
if (<>9__61_ == 0)
{
Cookie.<>c.<>9__61_0 = delegate(char ch)
{
bool flag;
return flag;
};
}
HeaderValue headerValue = new HeaderValue(Extensions.Read(str, num, <>9__61_, true).Trim());
if (num < str.m_stringLength)
{
char c = str[num];
string text = Cookie.ReadValue(str, num);
headerValue.<Value>k__BackingField = text;
}
list.Add(headerValue);
}
}
return list;
}
// Token: 0x0600D1F4 RID: 53748 RVA: 0x002FF3DC File Offset: 0x002FD5DC
[Token(Token = "0x600D1F4")]
[Address(RVA = "0x2408A60", Offset = "0x2407A60", VA = "0x182408A60", Slot = "4")]
public int CompareTo(Cookie other)
{
DateTime dateTime = this.<LastAccess>k__BackingField;
DateTime dateTime2 = other.<LastAccess>k__BackingField;
int num;
return num;
}
// Token: 0x04008593 RID: 34195
[Token(Token = "0x4008593")]
private const int Version = 1;
}
}
@@ -0,0 +1,549 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using BestHTTP.Logger;
using BestHTTP.PlatformSupport.FileSystem;
using Cpp2IlInjected;
namespace BestHTTP.Cookies
{
// Token: 0x020020A0 RID: 8352
[Token(Token = "0x20020A0")]
public static class CookieJar
{
// Token: 0x1700216C RID: 8556
// (get) Token: 0x0600D1F8 RID: 53752 RVA: 0x002FF43C File Offset: 0x002FD63C
[Token(Token = "0x1700216C")]
public static bool IsSavingSupported
{
[Token(Token = "0x600D1F8")]
[Address(RVA = "0x2408650", Offset = "0x2407650", VA = "0x182408650")]
get
{
int num;
do
{
num = 0;
IIOService ioservice = HTTPManager.IOService;
string rootCacheFolder = HTTPManager.GetRootCacheFolder();
ILogger logger = HTTPManager.Logger;
}
while (num != 0);
return CookieJar._isSavingSupported;
}
}
// Token: 0x1700216D RID: 8557
// (get) Token: 0x0600D1F9 RID: 53753 RVA: 0x002FF480 File Offset: 0x002FD680
// (set) Token: 0x0600D1FA RID: 53754 RVA: 0x002FF494 File Offset: 0x002FD694
[Token(Token = "0x1700216D")]
private static string CookieFolder
{
[Token(Token = "0x600D1F9")]
[Address(RVA = "0x2408590", Offset = "0x2407590", VA = "0x182408590")]
get;
[Token(Token = "0x600D1FA")]
[Address(RVA = "0x24089A0", Offset = "0x24079A0", VA = "0x1824089A0")]
set;
}
// Token: 0x1700216E RID: 8558
// (get) Token: 0x0600D1FB RID: 53755 RVA: 0x002FF4A8 File Offset: 0x002FD6A8
// (set) Token: 0x0600D1FC RID: 53756 RVA: 0x002FF4BC File Offset: 0x002FD6BC
[Token(Token = "0x1700216E")]
private static string LibraryPath
{
[Token(Token = "0x600D1FB")]
[Address(RVA = "0x24088E0", Offset = "0x24078E0", VA = "0x1824088E0")]
get;
[Token(Token = "0x600D1FC")]
[Address(RVA = "0x2408A00", Offset = "0x2407A00", VA = "0x182408A00")]
set;
}
// Token: 0x0600D1FD RID: 53757 RVA: 0x002FF4D0 File Offset: 0x002FD6D0
[Token(Token = "0x600D1FD")]
[Address(RVA = "0x2408220", Offset = "0x2407220", VA = "0x182408220")]
internal static void SetupFolder()
{
if (CookieJar.IsSavingSupported)
{
bool flag = string.IsNullOrEmpty(CookieJar.<CookieFolder>k__BackingField);
if (flag || flag)
{
CookieJar.<CookieFolder>k__BackingField = Path.Combine(HTTPManager.GetRootCacheFolder(), "Cookies");
CookieJar.<LibraryPath>k__BackingField = Path.Combine(CookieJar.<CookieFolder>k__BackingField, "Library");
}
}
}
// Token: 0x0600D1FE RID: 53758 RVA: 0x002FF524 File Offset: 0x002FD724
[Token(Token = "0x600D1FE")]
[Address(RVA = "0x2407DB0", Offset = "0x2406DB0", VA = "0x182407DB0")]
internal static void Set(HTTPResponse response)
{
while (response != 0)
{
object locker = CookieJar.Locker;
CookieJar.Maintain();
List<Cookie> list = new List();
List<string> headerValues = response.GetHeaderValues("set-cookie");
if (headerValues != 0)
{
bool flag;
if (flag)
{
Uri currentUri = response.baseRequest.CurrentUri;
Cookie cookie;
if (cookie == 0)
{
goto IL_90;
}
if (!string.IsNullOrEmpty(cookie.<Value>k__BackingField))
{
int num = 0;
if (cookie.WillExpireInTheFuture())
{
Cookie cookie2;
if (cookie2 != 0)
{
DateTime <Date>k__BackingField = cookie2.<Date>k__BackingField;
cookie.<Date>k__BackingField = <Date>k__BackingField;
CookieJar.Cookies[num] = cookie;
list.Add(cookie);
goto IL_90;
}
goto IL_90;
}
}
IL_9C:
while (cookie == (ulong)(-1L))
{
}
List<Cookie> cookies = CookieJar.Cookies;
goto IL_AA;
IL_90:
CookieJar.Cookies.Add(cookie);
goto IL_9C;
}
IL_AA:
int num2 = 0;
if (response != 0)
{
throw new NullReferenceException();
}
if (num2 != -1)
{
}
response.<Cookies>k__BackingField = list;
num2++;
}
Monitor.Exit(headerValues);
if (headerValues == 0)
{
break;
}
}
}
// Token: 0x0600D1FF RID: 53759 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600D1FF")]
[Address(RVA = "0x2406D90", Offset = "0x2405D90", VA = "0x182406D90")]
internal static void Maintain()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600D200 RID: 53760 RVA: 0x002FF634 File Offset: 0x002FD834
[Token(Token = "0x600D200")]
[Address(RVA = "0x2407260", Offset = "0x2406260", VA = "0x182407260")]
internal static void Persist()
{
int num;
do
{
num = 0;
if (!CookieJar.IsSavingSupported)
{
break;
}
object locker = CookieJar.Locker;
CookieJar.Maintain();
IIOService ioservice = HTTPManager.IOService;
IIOService ioservice2 = HTTPManager.IOService;
IIOService ioservice3 = HTTPManager.IOService;
BinaryWriter binaryWriter;
binaryWriter.Write(1);
int num2 = 0;
List<Cookie> cookies = CookieJar.Cookies;
bool flag;
if (flag)
{
num2++;
}
int num3 = 0;
if (num != 0)
{
goto IL_D0;
}
if (num3 != -1)
{
}
binaryWriter.Write((ushort)num2);
List<Cookie> cookies2 = CookieJar.Cookies;
bool flag2;
if (flag2)
{
}
num3++;
if (num != 0)
{
goto IL_D6;
}
if (num3 != -1)
{
}
num3++;
if (binaryWriter != 0)
{
}
if (num != 0)
{
goto IL_EE;
}
if (num3 != -1)
{
}
num3++;
if (num2 != 0)
{
}
if (num != 0)
{
goto IL_EE;
}
if (num3 != -1)
{
}
num3++;
num3++;
Monitor.Exit(num3);
}
while (num != 0);
return;
IL_D0:
throw new NullReferenceException();
IL_D6:
throw new NullReferenceException();
IL_EE:
throw new NullReferenceException();
}
// Token: 0x0600D201 RID: 53761 RVA: 0x002FF73C File Offset: 0x002FD93C
[Token(Token = "0x600D201")]
[Address(RVA = "0x24066E0", Offset = "0x24056E0", VA = "0x1824066E0")]
internal static void Load()
{
for (;;)
{
int num = 0;
if (!CookieJar.IsSavingSupported)
{
break;
}
object locker = CookieJar.Locker;
CookieJar.SetupFolder();
CookieJar.Cookies.Clear();
IIOService ioservice = HTTPManager.IOService;
IIOService ioservice2 = HTTPManager.IOService;
IIOService ioservice3 = HTTPManager.IOService;
IIOService ioservice4 = HTTPManager.IOService;
BinaryReader binaryReader;
ushort num2 = binaryReader.ReadUInt16();
ushort num3 = binaryReader.ReadUInt16();
int num4 = 0;
if (num4 < (int)num3)
{
Cookie cookie = new Cookie();
cookie.LoadFrom(binaryReader);
if (cookie.WillExpireInTheFuture())
{
CookieJar.Cookies.Add(cookie);
}
num4++;
}
int num5 = 0;
if (binaryReader != 0)
{
}
if (num != 0)
{
goto IL_EE;
}
if (num5 != -1)
{
}
num5++;
if (num != 0)
{
goto IL_EE;
}
if (num5 != -1)
{
}
num5++;
int num6 = 0;
CookieJar.Cookies.Clear();
num6++;
if (num == 0)
{
if (num6 != -1)
{
}
if (num == 0)
{
break;
}
}
}
return;
IL_EE:
throw new NullReferenceException();
}
// Token: 0x0600D202 RID: 53762 RVA: 0x002FF854 File Offset: 0x002FDA54
[Token(Token = "0x600D202")]
[Address(RVA = "0x2406460", Offset = "0x2405460", VA = "0x182406460")]
public static List<Cookie> Get(Uri uri)
{
int num;
do
{
num = 0;
object locker = CookieJar.Locker;
CookieJar.Load();
List<Cookie> cookies = CookieJar.Cookies;
List<Cookie> cookies2 = CookieJar.Cookies;
bool flag;
if (flag)
{
int num2 = 0;
if (uri.Host.IndexOf(num2) != -1)
{
int num3 = 0;
if (uri.AbsolutePath.StartsWith(num3) && num == 0)
{
List<Cookie> list = new List();
}
}
}
num++;
Monitor.Exit(locker);
}
while (num != 0);
throw new NullReferenceException();
}
// Token: 0x0600D203 RID: 53763 RVA: 0x002FF8EC File Offset: 0x002FDAEC
[Token(Token = "0x600D203")]
[Address(RVA = "0x2407B90", Offset = "0x2406B90", VA = "0x182407B90")]
public static void Set(Uri uri, Cookie cookie)
{
CookieJar.Set(cookie);
}
// Token: 0x0600D204 RID: 53764 RVA: 0x002FF900 File Offset: 0x002FDB00
[Token(Token = "0x600D204")]
[Address(RVA = "0x2407BF0", Offset = "0x2406BF0", VA = "0x182407BF0")]
public static void Set(Cookie cookie)
{
int num;
do
{
num = 0;
object locker = CookieJar.Locker;
CookieJar.Load();
CookieJar.Cookies.Add(cookie);
List<Cookie> cookies = CookieJar.Cookies;
Monitor.Exit(locker);
}
while (num != 0);
}
// Token: 0x0600D205 RID: 53765 RVA: 0x002FF944 File Offset: 0x002FDB44
[Token(Token = "0x600D205")]
[Address(RVA = "0x2406350", Offset = "0x2405350", VA = "0x182406350")]
public static List<Cookie> GetAll()
{
int num;
List<Cookie> cookies;
do
{
num = 0;
object locker = CookieJar.Locker;
CookieJar.Load();
cookies = CookieJar.Cookies;
Monitor.Exit(locker);
}
while (num != 0);
return cookies;
}
// Token: 0x0600D206 RID: 53766 RVA: 0x002FF974 File Offset: 0x002FDB74
[Token(Token = "0x600D206")]
[Address(RVA = "0x2405C70", Offset = "0x2404C70", VA = "0x182405C70")]
public static void Clear()
{
int num;
do
{
num = 0;
object locker = CookieJar.Locker;
CookieJar.Load();
CookieJar.Cookies.Clear();
Monitor.Exit(locker);
}
while (num != 0);
}
// Token: 0x0600D207 RID: 53767 RVA: 0x002FF9AC File Offset: 0x002FDBAC
[Token(Token = "0x600D207")]
[Address(RVA = "0x2405D90", Offset = "0x2404D90", VA = "0x182405D90")]
public static void Clear(TimeSpan olderThan)
{
int num;
do
{
num = 0;
object locker = CookieJar.Locker;
CookieJar.Load();
List<Cookie> cookies = CookieJar.Cookies;
List<Cookie> cookies2 = CookieJar.Cookies;
bool flag;
if (flag)
{
object locker2 = CookieJar.Locker;
DateTime utcNow = DateTime.UtcNow;
DateTime dateTime;
if (!(dateTime < utcNow))
{
num++;
}
}
CookieJar.Cookies.RemoveAt(num);
Monitor.Exit(locker);
}
while (num != 0);
}
// Token: 0x0600D208 RID: 53768 RVA: 0x002FFA28 File Offset: 0x002FDC28
[Token(Token = "0x600D208")]
[Address(RVA = "0x2406000", Offset = "0x2405000", VA = "0x182406000")]
public static void Clear(string domain)
{
int num;
do
{
num = 0;
object locker = CookieJar.Locker;
CookieJar.Load();
List<Cookie> cookies = CookieJar.Cookies;
List<Cookie> cookies2 = CookieJar.Cookies;
bool flag;
int num2;
if (flag && num2 == -1)
{
num++;
}
CookieJar.Cookies.RemoveAt(num);
Monitor.Exit(locker);
}
while (num != 0);
}
// Token: 0x0600D209 RID: 53769 RVA: 0x002FFA94 File Offset: 0x002FDC94
[Token(Token = "0x600D209")]
[Address(RVA = "0x2407910", Offset = "0x2406910", VA = "0x182407910")]
public static void Remove(Uri uri, string name)
{
int num;
do
{
num = 0;
object locker = CookieJar.Locker;
CookieJar.Load();
List<Cookie> cookies = CookieJar.Cookies;
List<Cookie> cookies2 = CookieJar.Cookies;
if (CookieJar.<CookieFolder>k__BackingField.Equals(name, StringComparison.OrdinalIgnoreCase))
{
int num2 = 0;
if (uri.Host.IndexOf(num2) != -1)
{
CookieJar.Cookies.RemoveAt(num);
}
}
num++;
Monitor.Exit(locker);
}
while (num != 0);
}
// Token: 0x0600D20A RID: 53770 RVA: 0x002FFB24 File Offset: 0x002FDD24
[Token(Token = "0x600D20A")]
[Address(RVA = "0x2406240", Offset = "0x2405240", VA = "0x182406240")]
private static Cookie Find(Cookie cookie, out int idx)
{
int num = 0;
List<Cookie> cookies = CookieJar.Cookies;
List<Cookie> cookies2 = CookieJar.Cookies;
bool flag;
if (!flag)
{
num++;
}
idx.m_value = num;
return typeof(CookieJar).TypeHandle;
}
// Token: 0x0600D20B RID: 53771 RVA: 0x002FFB5C File Offset: 0x002FDD5C
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600D20B")]
[Address(RVA = "0x24084D0", Offset = "0x24074D0", VA = "0x1824084D0")]
static CookieJar()
{
TimeSpan timeSpan;
CookieJar.AccessThreshold = timeSpan;
CookieJar.Cookies = new List();
CookieJar.Locker = new object();
}
// Token: 0x040085A1 RID: 34209
[Token(Token = "0x40085A1")]
private const int Version = 1;
// Token: 0x040085A2 RID: 34210
[Token(Token = "0x40085A2")]
public static TimeSpan AccessThreshold;
// Token: 0x040085A3 RID: 34211
[Token(Token = "0x40085A3")]
private static List<Cookie> Cookies;
// Token: 0x040085A6 RID: 34214
[Token(Token = "0x40085A6")]
private static object Locker;
// Token: 0x040085A7 RID: 34215
[Token(Token = "0x40085A7")]
private static bool _isSavingSupported;
// Token: 0x040085A8 RID: 34216
[Token(Token = "0x40085A8")]
private static bool IsSupportCheckDone;
// Token: 0x040085A9 RID: 34217
[Token(Token = "0x40085A9")]
private static bool Loaded;
}
}