This commit is contained in:
niko
2026-04-11 22:19:20 +02:00
parent 45b857ff11
commit 8fc35183db
17034 changed files with 2863552 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: 0x02001FBE RID: 8126
[Token(Token = "0x2001FBE")]
public sealed class Cookie : IComparable<Cookie>, IEquatable<Cookie>
{
// Token: 0x170020C4 RID: 8388
// (get) Token: 0x0600CDFF RID: 52735 RVA: 0x002F6504 File Offset: 0x002F4704
// (set) Token: 0x0600CE00 RID: 52736 RVA: 0x002F6518 File Offset: 0x002F4718
[Token(Token = "0x170020C4")]
public string Name
{
[Token(Token = "0x600CDFF")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20")]
get;
[Token(Token = "0x600CE00")]
[Address(RVA = "0x3F7200", Offset = "0x3F6000", VA = "0x1803F7200")]
private set;
}
// Token: 0x170020C5 RID: 8389
// (get) Token: 0x0600CE01 RID: 52737 RVA: 0x002F652C File Offset: 0x002F472C
// (set) Token: 0x0600CE02 RID: 52738 RVA: 0x002F6540 File Offset: 0x002F4740
[Token(Token = "0x170020C5")]
public string Value
{
[Token(Token = "0x600CE01")]
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40")]
get;
[Token(Token = "0x600CE02")]
[Address(RVA = "0x3F7210", Offset = "0x3F6010", VA = "0x1803F7210")]
private set;
}
// Token: 0x170020C6 RID: 8390
// (get) Token: 0x0600CE03 RID: 52739 RVA: 0x002F6554 File Offset: 0x002F4754
// (set) Token: 0x0600CE04 RID: 52740 RVA: 0x002F6568 File Offset: 0x002F4768
[Token(Token = "0x170020C6")]
public DateTime Date
{
[Token(Token = "0x600CE03")]
[Address(RVA = "0x3F6400", Offset = "0x3F5200", VA = "0x1803F6400")]
get;
[Token(Token = "0x600CE04")]
[Address(RVA = "0x460F90", Offset = "0x45FD90", VA = "0x180460F90")]
internal set;
}
// Token: 0x170020C7 RID: 8391
// (get) Token: 0x0600CE05 RID: 52741 RVA: 0x002F657C File Offset: 0x002F477C
// (set) Token: 0x0600CE06 RID: 52742 RVA: 0x002F6590 File Offset: 0x002F4790
[Token(Token = "0x170020C7")]
public DateTime LastAccess
{
[Token(Token = "0x600CE05")]
[Address(RVA = "0x3F63E0", Offset = "0x3F51E0", VA = "0x1803F63E0")]
get;
[Token(Token = "0x600CE06")]
[Address(RVA = "0x409C60", Offset = "0x408A60", VA = "0x180409C60")]
set;
}
// Token: 0x170020C8 RID: 8392
// (get) Token: 0x0600CE07 RID: 52743 RVA: 0x002F65A4 File Offset: 0x002F47A4
// (set) Token: 0x0600CE08 RID: 52744 RVA: 0x002F65B8 File Offset: 0x002F47B8
[Token(Token = "0x170020C8")]
public DateTime Expires
{
[Token(Token = "0x600CE07")]
[Address(RVA = "0x3FA180", Offset = "0x3F8F80", VA = "0x1803FA180")]
get;
[Token(Token = "0x600CE08")]
[Address(RVA = "0x4437E0", Offset = "0x4425E0", VA = "0x1804437E0")]
private set;
}
// Token: 0x170020C9 RID: 8393
// (get) Token: 0x0600CE09 RID: 52745 RVA: 0x002F65CC File Offset: 0x002F47CC
// (set) Token: 0x0600CE0A RID: 52746 RVA: 0x002F65E0 File Offset: 0x002F47E0
[Token(Token = "0x170020C9")]
public long MaxAge
{
[Token(Token = "0x600CE09")]
[Address(RVA = "0x3F63D0", Offset = "0x3F51D0", VA = "0x1803F63D0")]
get;
[Token(Token = "0x600CE0A")]
[Address(RVA = "0x5329E0", Offset = "0x5317E0", VA = "0x1805329E0")]
private set;
}
// Token: 0x170020CA RID: 8394
// (get) Token: 0x0600CE0B RID: 52747 RVA: 0x002F65F4 File Offset: 0x002F47F4
// (set) Token: 0x0600CE0C RID: 52748 RVA: 0x002F6608 File Offset: 0x002F4808
[Token(Token = "0x170020CA")]
public bool IsSession
{
[Token(Token = "0x600CE0B")]
[Address(RVA = "0x4363F0", Offset = "0x4351F0", VA = "0x1804363F0")]
get;
[Token(Token = "0x600CE0C")]
[Address(RVA = "0x4366B0", Offset = "0x4354B0", VA = "0x1804366B0")]
private set;
}
// Token: 0x170020CB RID: 8395
// (get) Token: 0x0600CE0D RID: 52749 RVA: 0x002F661C File Offset: 0x002F481C
// (set) Token: 0x0600CE0E RID: 52750 RVA: 0x002F6630 File Offset: 0x002F4830
[Token(Token = "0x170020CB")]
public string Domain
{
[Token(Token = "0x600CE0D")]
[Address(RVA = "0x3FA170", Offset = "0x3F8F70", VA = "0x1803FA170")]
get;
[Token(Token = "0x600CE0E")]
[Address(RVA = "0x46AA50", Offset = "0x469850", VA = "0x18046AA50")]
private set;
}
// Token: 0x170020CC RID: 8396
// (get) Token: 0x0600CE0F RID: 52751 RVA: 0x002F6644 File Offset: 0x002F4844
// (set) Token: 0x0600CE10 RID: 52752 RVA: 0x002F6658 File Offset: 0x002F4858
[Token(Token = "0x170020CC")]
public string Path
{
[Token(Token = "0x600CE0F")]
[Address(RVA = "0x415290", Offset = "0x414090", VA = "0x180415290")]
get;
[Token(Token = "0x600CE10")]
[Address(RVA = "0x46AB00", Offset = "0x469900", VA = "0x18046AB00")]
private set;
}
// Token: 0x170020CD RID: 8397
// (get) Token: 0x0600CE11 RID: 52753 RVA: 0x002F666C File Offset: 0x002F486C
// (set) Token: 0x0600CE12 RID: 52754 RVA: 0x002F6680 File Offset: 0x002F4880
[Token(Token = "0x170020CD")]
public bool IsSecure
{
[Token(Token = "0x600CE11")]
[Address(RVA = "0x40FFA0", Offset = "0x40EDA0", VA = "0x18040FFA0")]
get;
[Token(Token = "0x600CE12")]
[Address(RVA = "0x410010", Offset = "0x40EE10", VA = "0x180410010")]
private set;
}
// Token: 0x170020CE RID: 8398
// (get) Token: 0x0600CE13 RID: 52755 RVA: 0x002F6694 File Offset: 0x002F4894
// (set) Token: 0x0600CE14 RID: 52756 RVA: 0x002F66A8 File Offset: 0x002F48A8
[Token(Token = "0x170020CE")]
public bool IsHttpOnly
{
[Token(Token = "0x600CE13")]
[Address(RVA = "0x46A7B0", Offset = "0x4695B0", VA = "0x18046A7B0")]
get;
[Token(Token = "0x600CE14")]
[Address(RVA = "0xD53F10", Offset = "0xD52D10", VA = "0x180D53F10")]
private set;
}
// Token: 0x0600CE15 RID: 52757 RVA: 0x002F66BC File Offset: 0x002F48BC
[Token(Token = "0x600CE15")]
[Address(RVA = "0x1965C50", Offset = "0x1964A50", VA = "0x181965C50")]
public Cookie(string name, string value)
{
string empty = string.Empty;
}
// Token: 0x0600CE16 RID: 52758 RVA: 0x002F66D0 File Offset: 0x002F48D0
[Token(Token = "0x600CE16")]
[Address(RVA = "0x1965F40", Offset = "0x1964D40", VA = "0x181965F40")]
public Cookie(string name, string value, string path)
{
string empty = string.Empty;
}
// Token: 0x0600CE17 RID: 52759 RVA: 0x002F66E4 File Offset: 0x002F48E4
[Token(Token = "0x600CE17")]
[Address(RVA = "0x1965E90", Offset = "0x1964C90", VA = "0x181965E90")]
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: 0x0600CE18 RID: 52760 RVA: 0x002F6738 File Offset: 0x002F4938
[Token(Token = "0x600CE18")]
[Address(RVA = "0x1965CD0", Offset = "0x1964AD0", VA = "0x181965CD0")]
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: 0x0600CE19 RID: 52761 RVA: 0x002F6778 File Offset: 0x002F4978
[Token(Token = "0x600CE19")]
[Address(RVA = "0x1965DB0", Offset = "0x1964BB0", VA = "0x181965DB0")]
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: 0x0600CE1A RID: 52762 RVA: 0x002F67B8 File Offset: 0x002F49B8
[Token(Token = "0x600CE1A")]
[Address(RVA = "0x1965FC0", Offset = "0x1964DC0", VA = "0x181965FC0")]
internal Cookie()
{
this.IsSession = true;
this.MaxAge = (long)((ulong)(-1L));
DateTime utcNow = DateTime.UtcNow;
this.LastAccess = utcNow;
}
// Token: 0x0600CE1B RID: 52763 RVA: 0x002F67EC File Offset: 0x002F49EC
[Token(Token = "0x600CE1B")]
[Address(RVA = "0x1965B40", Offset = "0x1964940", VA = "0x181965B40")]
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: 0x0600CE1C RID: 52764 RVA: 0x002F684C File Offset: 0x002F4A4C
[Token(Token = "0x600CE1C")]
[Address(RVA = "0x1964D00", Offset = "0x1963B00", VA = "0x181964D00")]
public uint GuessSize()
{
/*
An exception occurred when decompiling this method (0600CE1C)
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 1660
*/;
}
// Token: 0x0600CE1D RID: 52765 RVA: 0x002F68E0 File Offset: 0x002F4AE0
[Token(Token = "0x600CE1D")]
[Address(RVA = "0x19650F0", Offset = "0x1963EF0", VA = "0x1819650F0")]
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: 0x0600CE1E RID: 52766 RVA: 0x002F6B90 File Offset: 0x002F4D90
[Token(Token = "0x600CE1E")]
[Address(RVA = "0x1965900", Offset = "0x1964700", VA = "0x181965900")]
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: 0x0600CE1F RID: 52767 RVA: 0x002F6C54 File Offset: 0x002F4E54
[Token(Token = "0x600CE1F")]
[Address(RVA = "0x1964D60", Offset = "0x1963B60", VA = "0x181964D60")]
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: 0x0600CE20 RID: 52768 RVA: 0x002F6D28 File Offset: 0x002F4F28
[Token(Token = "0x600CE20")]
[Address(RVA = "0x1965B00", Offset = "0x1964900", VA = "0x181965B00", Slot = "3")]
public override string ToString()
{
string text = this.<Value>k__BackingField;
return this.<Name>k__BackingField + "=" + text;
}
// Token: 0x0600CE21 RID: 52769 RVA: 0x002F6D50 File Offset: 0x002F4F50
[Token(Token = "0x600CE21")]
[Address(RVA = "0x1964C50", Offset = "0x1963A50", VA = "0x181964C50", Slot = "0")]
public override bool Equals(object obj)
{
if (obj != 0)
{
bool flag;
return flag;
}
}
// Token: 0x0600CE22 RID: 52770 RVA: 0x002F6D64 File Offset: 0x002F4F64
[Token(Token = "0x600CE22")]
[Address(RVA = "0x1964B90", Offset = "0x1963990", VA = "0x181964B90", 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: 0x0600CE23 RID: 52771 RVA: 0x002F6DF0 File Offset: 0x002F4FF0
[Token(Token = "0x600CE23")]
[Address(RVA = "0x1964CC0", Offset = "0x1963AC0", VA = "0x181964CC0", Slot = "2")]
public override int GetHashCode()
{
OVRMesh.JAAHPDGFADH jaahpdgfadh = ((OVRMesh.PJPHJNNOBBH)this.GetHashCode()).POCDCJMHEGL();
throw new NullReferenceException();
}
// Token: 0x0600CE24 RID: 52772 RVA: 0x002F6E10 File Offset: 0x002F5010
[Token(Token = "0x600CE24")]
[Address(RVA = "0x1965870", Offset = "0x1964670", VA = "0x181965870")]
private static string ReadValue(string str, ref int pos)
{
string empty = string.Empty;
if (str != 0)
{
}
return empty;
}
// Token: 0x0600CE25 RID: 52773 RVA: 0x002F6E28 File Offset: 0x002F5028
[Token(Token = "0x600CE25")]
[Address(RVA = "0x1964F00", Offset = "0x1963D00", VA = "0x181964F00")]
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: 0x0600CE26 RID: 52774 RVA: 0x002F6EB0 File Offset: 0x002F50B0
[Token(Token = "0x600CE26")]
[Address(RVA = "0x1964B60", Offset = "0x1963960", VA = "0x181964B60", Slot = "4")]
public int CompareTo(Cookie other)
{
DateTime dateTime = this.<LastAccess>k__BackingField;
DateTime dateTime2 = other.<LastAccess>k__BackingField;
int num;
return num;
}
// Token: 0x040083DA RID: 33754
[Token(Token = "0x40083DA")]
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: 0x02001FC0 RID: 8128
[Token(Token = "0x2001FC0")]
public static class CookieJar
{
// Token: 0x170020CF RID: 8399
// (get) Token: 0x0600CE2A RID: 52778 RVA: 0x002F6F10 File Offset: 0x002F5110
[Token(Token = "0x170020CF")]
public static bool IsSavingSupported
{
[Token(Token = "0x600CE2A")]
[Address(RVA = "0x1964750", Offset = "0x1963550", VA = "0x181964750")]
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: 0x170020D0 RID: 8400
// (get) Token: 0x0600CE2B RID: 52779 RVA: 0x002F6F54 File Offset: 0x002F5154
// (set) Token: 0x0600CE2C RID: 52780 RVA: 0x002F6F68 File Offset: 0x002F5168
[Token(Token = "0x170020D0")]
private static string CookieFolder
{
[Token(Token = "0x600CE2B")]
[Address(RVA = "0x1964690", Offset = "0x1963490", VA = "0x181964690")]
get;
[Token(Token = "0x600CE2C")]
[Address(RVA = "0x1964AA0", Offset = "0x19638A0", VA = "0x181964AA0")]
set;
}
// Token: 0x170020D1 RID: 8401
// (get) Token: 0x0600CE2D RID: 52781 RVA: 0x002F6F7C File Offset: 0x002F517C
// (set) Token: 0x0600CE2E RID: 52782 RVA: 0x002F6F90 File Offset: 0x002F5190
[Token(Token = "0x170020D1")]
private static string LibraryPath
{
[Token(Token = "0x600CE2D")]
[Address(RVA = "0x19649E0", Offset = "0x19637E0", VA = "0x1819649E0")]
get;
[Token(Token = "0x600CE2E")]
[Address(RVA = "0x1964B00", Offset = "0x1963900", VA = "0x181964B00")]
set;
}
// Token: 0x0600CE2F RID: 52783 RVA: 0x002F6FA4 File Offset: 0x002F51A4
[Token(Token = "0x600CE2F")]
[Address(RVA = "0x1964320", Offset = "0x1963120", VA = "0x181964320")]
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: 0x0600CE30 RID: 52784 RVA: 0x002F6FF8 File Offset: 0x002F51F8
[Token(Token = "0x600CE30")]
[Address(RVA = "0x1963EB0", Offset = "0x1962CB0", VA = "0x181963EB0")]
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: 0x0600CE31 RID: 52785 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600CE31")]
[Address(RVA = "0x1962E90", Offset = "0x1961C90", VA = "0x181962E90")]
internal static void Maintain()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600CE32 RID: 52786 RVA: 0x002F7108 File Offset: 0x002F5308
[Token(Token = "0x600CE32")]
[Address(RVA = "0x1963360", Offset = "0x1962160", VA = "0x181963360")]
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: 0x0600CE33 RID: 52787 RVA: 0x002F7210 File Offset: 0x002F5410
[Token(Token = "0x600CE33")]
[Address(RVA = "0x19627E0", Offset = "0x19615E0", VA = "0x1819627E0")]
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: 0x0600CE34 RID: 52788 RVA: 0x002F7328 File Offset: 0x002F5528
[Token(Token = "0x600CE34")]
[Address(RVA = "0x1962560", Offset = "0x1961360", VA = "0x181962560")]
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: 0x0600CE35 RID: 52789 RVA: 0x002F73C0 File Offset: 0x002F55C0
[Token(Token = "0x600CE35")]
[Address(RVA = "0x1963C90", Offset = "0x1962A90", VA = "0x181963C90")]
public static void Set(Uri uri, Cookie cookie)
{
CookieJar.Set(cookie);
}
// Token: 0x0600CE36 RID: 52790 RVA: 0x002F73D4 File Offset: 0x002F55D4
[Token(Token = "0x600CE36")]
[Address(RVA = "0x1963CF0", Offset = "0x1962AF0", VA = "0x181963CF0")]
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: 0x0600CE37 RID: 52791 RVA: 0x002F7418 File Offset: 0x002F5618
[Token(Token = "0x600CE37")]
[Address(RVA = "0x1962450", Offset = "0x1961250", VA = "0x181962450")]
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: 0x0600CE38 RID: 52792 RVA: 0x002F7448 File Offset: 0x002F5648
[Token(Token = "0x600CE38")]
[Address(RVA = "0x1961D70", Offset = "0x1960B70", VA = "0x181961D70")]
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: 0x0600CE39 RID: 52793 RVA: 0x002F7480 File Offset: 0x002F5680
[Token(Token = "0x600CE39")]
[Address(RVA = "0x1961E90", Offset = "0x1960C90", VA = "0x181961E90")]
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: 0x0600CE3A RID: 52794 RVA: 0x002F74FC File Offset: 0x002F56FC
[Token(Token = "0x600CE3A")]
[Address(RVA = "0x1962100", Offset = "0x1960F00", VA = "0x181962100")]
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: 0x0600CE3B RID: 52795 RVA: 0x002F7568 File Offset: 0x002F5768
[Token(Token = "0x600CE3B")]
[Address(RVA = "0x1963A10", Offset = "0x1962810", VA = "0x181963A10")]
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: 0x0600CE3C RID: 52796 RVA: 0x002F75F8 File Offset: 0x002F57F8
[Token(Token = "0x600CE3C")]
[Address(RVA = "0x1962340", Offset = "0x1961140", VA = "0x181962340")]
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: 0x0600CE3D RID: 52797 RVA: 0x002F7630 File Offset: 0x002F5830
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600CE3D")]
[Address(RVA = "0x19645D0", Offset = "0x19633D0", VA = "0x1819645D0")]
static CookieJar()
{
TimeSpan timeSpan;
CookieJar.AccessThreshold = timeSpan;
CookieJar.Cookies = new List();
CookieJar.Locker = new object();
}
// Token: 0x040083E8 RID: 33768
[Token(Token = "0x40083E8")]
private const int Version = 1;
// Token: 0x040083E9 RID: 33769
[Token(Token = "0x40083E9")]
public static TimeSpan AccessThreshold;
// Token: 0x040083EA RID: 33770
[Token(Token = "0x40083EA")]
private static List<Cookie> Cookies;
// Token: 0x040083ED RID: 33773
[Token(Token = "0x40083ED")]
private static object Locker;
// Token: 0x040083EE RID: 33774
[Token(Token = "0x40083EE")]
private static bool _isSavingSupported;
// Token: 0x040083EF RID: 33775
[Token(Token = "0x40083EF")]
private static bool IsSupportCheckDone;
// Token: 0x040083F0 RID: 33776
[Token(Token = "0x40083F0")]
private static bool Loaded;
}
}