Add token expiry (bump minor)

Temp remove genuine patch for unity product name
Exporting and importing tokens (not tested very well)
Insecure HTTP warning on auth
This commit is contained in:
2025-03-25 21:57:14 -04:00
parent a61549c932
commit bc84ef04ed
7 changed files with 61 additions and 26 deletions

View File

@@ -77,6 +77,10 @@ namespace undead_universal_patch_il2cpp.Patches
{
if (newUri.PathAndQuery.Contains(header))
{
// refresh the token if it expired
// this is somewhat inefficient, but we don't hook into many requests (see below) so it should be fine
GalvanicWebAuth.TokenExpiry();
Type httpRequestType = request.GetType();
MethodInfo addHeaderMethod = httpRequestType.GetMethod("AddHeader");
addHeaderMethod.Invoke(request, ["GalvanicAuth", GalvanicWebAuth.Token]);

View File

@@ -1,21 +0,0 @@
using HarmonyLib;
using System.Reflection;
namespace undead_universal_patch_il2cpp.Patches
{
[HarmonyPatch]
class GenuinePatch
{
static readonly MethodInfo methodType = AccessTools.Method(AccessTools.TypeByName("Application"), "get_productName");
static bool Prepare()
{
if (methodType == null) return false;
else return true;
}
static MethodBase TargetMethod() => methodType;
static void Prefix(ref string __result)
{
__result = string.Format("{0} (Custom Server)", __result);
}
}
}

View File

@@ -1,6 +1,5 @@
using HarmonyLib;
using System;
using System.ComponentModel;
using System.Reflection;
namespace undead_universal_patch_il2cpp.Patches