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

@@ -1,9 +1,7 @@
using System;
using BepInEx;
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Il2CppSystem.Reflection;
namespace undead_universal_patch_il2cpp;
@@ -50,6 +48,15 @@ public class Plugin : BasePlugin
"\nDo not enable if you either don't know what this does.");
GalvanicConfig.RegenerateKeypair = Config.Bind("GalvanicCorrosion", "RegenerateKeypair", GalvanicConfigDefaults.RegenerateKeypair,
"Regenerate the keypair upon startup. DO NOT ENABLE IF YOU WANT TO KEEP YOUR ACCOUNT.");
GalvanicConfig.Export = Config.Bind("GalvanicCorrosion", "Export", GalvanicConfigDefaults.Export,
"Export the keypair to a plaintext file in the game directory. Set to 'IWantToExportMyKeys' to enable." +
"\n**DO NOT ENABLE IF YOU DO NOT KNOW WHAT THIS DOES.**" +
"\n**DO NOT ENABLE THIS IF SOMEONE UNTRUSTWORTHY TOLD YOU TO.**" +
"\n**THESE KEYS CONTAIN THE CREDENTIALS THAT GRANT ACCESS TO YOUR ACCOUNTS.**");
GalvanicConfig.Import = Config.Bind("GalvanicCorrosion", "Import", GalvanicConfigDefaults.Import,
"Import the Galvanic Authentication keys from a file." +
"\nBe sure to not enable this at the same time as `Export`, as that will cause the keys to" +
"\nbe unnecessarily written and read to and from the disk.");
_hi.PatchAll();
if (GalvanicConfig.RegenerateKeypair.Value)
@@ -57,6 +64,8 @@ public class Plugin : BasePlugin
Log.LogInfo("Regenerating keypair");
GalvanicAuth.PrepareKeys();
}
if (GalvanicConfig.Export.Value == "IWantToExportMyKeys") GalvanicAuth.Export();
if (GalvanicConfig.Import.Value) GalvanicAuth.Import();
if (GalvanicConfig.Enabled.Value) GalvanicWebAuth.GetToken();
}
}