using System.Reflection; using System.Text; using HarmonyLib; using Il2CppInterop.Runtime.InteropTypes.Arrays; using undead_universal_patch_il2cpp.Core; using undead_universal_patch_il2cpp.Core.Config; namespace undead_universal_patch_il2cpp.Patches.Internals; [HarmonyPatch] public class DeviceIdBuilder { static PatchTypesResult typesResult = Util.ConfigPreparePatchTypes( PatchConfig.ProtonDeviceIdFix, "Proton quickfix for device ID errors", "RecRoom.Utils.DeviceIdBuilder", "CalculateOtherDeviceId" ); static MethodBase TargetMethod() => typesResult.Method; static bool Prepare() => typesResult.Success; static bool Prefix(ref Il2CppStructArray __result) { Util.ConditionalDebug("Device ID patched"); __result = new Il2CppStructArray(Encoding.UTF8.GetBytes("Wine/Proton")); return false; } }