From 3900add5752c9dcf15e65070955abd5a1a267016 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Fri, 9 Jan 2026 01:42:56 -0600 Subject: [PATCH 01/13] =?UTF-8?q?Remove=20file=20checker=20restrictions,?= =?UTF-8?q?=20what's=20the=20point=20now=20=C2=AF\=5F(=E3=83=84)=5F/=C2=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BAUPlugin.cs | 1 - src/Modules/FileChecker.cs | 159 ---------------------------- src/Patches/Client/ClientPatch.cs | 7 -- src/Patches/Client/MainMenuPatch.cs | 28 ----- 4 files changed, 195 deletions(-) delete mode 100644 src/Modules/FileChecker.cs diff --git a/src/BAUPlugin.cs b/src/BAUPlugin.cs index d3320df..88b05a4 100644 --- a/src/BAUPlugin.cs +++ b/src/BAUPlugin.cs @@ -96,7 +96,6 @@ internal class BAUPlugin : BasePlugin Translator.Init(); Harmony.PatchAll(); GameSettingMenuPatch.SetupSettings(true); - FileChecker.Initialize(); InstanceAttribute.RegisterAll(); OutfitData.Init(); diff --git a/src/Modules/FileChecker.cs b/src/Modules/FileChecker.cs deleted file mode 100644 index 9227e5c..0000000 --- a/src/Modules/FileChecker.cs +++ /dev/null @@ -1,159 +0,0 @@ -using BetterAmongUs.Helpers; -using System.Collections.ObjectModel; -using System.Reflection; - -namespace BetterAmongUs.Modules; - -internal static class FileChecker -{ - private static bool enabled = false; - private static FileSystemWatcher? fileWatcher; - private static bool hasUnauthorizedFileOrMod = false; - internal static string WarningMsg { get; private set; } = string.Empty; - internal static bool HasShownWarning { get; set; } = false; - internal static bool HasUnauthorizedFileOrMod => hasUnauthorizedFileOrMod; - - private static readonly ReadOnlyCollection TrustedNamespaces = new(new List - { - "System", "Unity", "Harmony", "BepInEx", "Microsoft", "Il2Cpp", "Hazel", "AppleAuth", "QRCoder", - "MonoMod", "netstandard", "mscorlib", "AssetRipper", "Cpp2IL", "AsmResolver", "Iced", "CsvHelper", - "SemanticVersioning", "Mono.Cecil", "Assembly-CSharp", "StableNameDotNet", "AmongUsCaching", - "Disarm", "Gee.External.Capstone", "Rewired_Core", "AddressablesPlayAssetDelivery", "Newtonsoft.Json", "Purchasing.Common", - "Assembly-CSharp-firstpass", "Sentry", "Rewired_Windows", "__Generated", "XGamingRuntime", - "BetterAmongUs", "MCI", "CrowdedMod", "Mini.RegionInstall", "Unlock", "Skin" - }); - - private static readonly ReadOnlyCollection UntrustedNamespaces = new(new List - { - "Sicko", "AmongUsMenu", "Malum", "GoatNetClient", "SM", "AUM", "GNC", "MM", "Cheat", "Menu", "Hack", "Exploit", "Bypass", "Crack", "Spoof" - }); - - private static readonly string[] TrustedPaths = - { - Environment.CurrentDirectory, - Path.Combine(Environment.CurrentDirectory, "BepInEx"), - }; - - private static readonly string[] UnauthorizedFiles = [ - "version.dll", - "sicko-settings.json", - "sicko-log.txt", - "sicko-prev-log.txt", - "sicko-config", - "settings.json", - "aum-log.txt", - "aum-prev-log.txt" - ]; - - internal static void Initialize() - { - if (enabled) return; - enabled = true; - - AppDomain.CurrentDomain.AssemblyLoad += (sender, args) => - { - CheckUnauthorizedAssemblies(); - CheckUnauthorizedFiles(); - }; - - fileWatcher = new FileSystemWatcher(Environment.CurrentDirectory) - { - NotifyFilter = NotifyFilters.FileName | NotifyFilters.LastWrite | NotifyFilters.DirectoryName, - IncludeSubdirectories = true - }; - - fileWatcher.Created += (sender, args) => CheckUnauthorizedFiles(); - fileWatcher.Deleted += (sender, args) => CheckUnauthorizedFiles(); - - fileWatcher.EnableRaisingEvents = true; - - CheckUnauthorizedFiles(); - CheckUnauthorizedAssemblies(); - } - - private static void CheckUnauthorizedFiles() - { - if (hasUnauthorizedFileOrMod) return; - - foreach (var fileName in UnauthorizedFiles) - { - if (File.Exists(Path.Combine(Environment.CurrentDirectory, fileName))) - { - WarningMsg = "<#D20200>Unauthorized File Detected\n<#9D9D9D>Look in logs for further information!"; - Logger_.Warning($"Unauthorized File: {Path.Combine(Environment.CurrentDirectory, fileName)}"); - if (GameState.IsInGame) - { - SceneChanger.ChangeScene("MainMenu"); - } - hasUnauthorizedFileOrMod = true; - return; - } - } - } - - private static readonly HashSet _processedAssemblies = []; - - private static void CheckUnauthorizedAssemblies() - { - foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) - { - if (_processedAssemblies.Contains(assembly) || assembly.IsDynamic) - { - continue; - } - _processedAssemblies.Add(assembly); - - if (UntrustedNamespaces.Any(ns => assembly.FullName.Contains(ns, StringComparison.OrdinalIgnoreCase))) - { - if (TrustedNamespaces.Any(ns => assembly.FullName.Contains(ns, StringComparison.OrdinalIgnoreCase))) - { - continue; - } - - WarningMsg = "<#D20200>Untrusted Assembly Detected\n<#9D9D9D>Look in logs for further information!"; - Logger_.Warning($"Unauthorized Assembly: {assembly.FullName} (Untrusted Namespace)"); - hasUnauthorizedFileOrMod = true; - continue; - } - - if (!TrustedNamespaces.Any(ns => assembly.FullName.Contains(ns, StringComparison.OrdinalIgnoreCase))) - { - WarningMsg = "<#D20200>Unregistered Assembly Detected\n<#9D9D9D>Look in logs for further information!"; - Logger_.Warning($"Unauthorized Assembly: {assembly.FullName} (Unregistered Namespace)"); - hasUnauthorizedFileOrMod = true; - continue; - } - - if (!IsSafeLocation(assembly)) - { - WarningMsg = "<#D20200>Unregistered Assembly Location Detected\n<#9D9D9D>Look in logs for further information!"; - Logger_.Warning($"Unauthorized Assembly: {assembly.FullName} (Unregistered Location: {assembly.Location})"); - hasUnauthorizedFileOrMod = true; - continue; - } - } - } - - internal static void SetHasUnauthorizedFileOrMod() - { - hasUnauthorizedFileOrMod = true; - } - - internal static void SetWarningMsg(string msg) - { - if (string.IsNullOrEmpty(WarningMsg)) - { - WarningMsg = msg; - } - } - - private static bool IsSafeLocation(Assembly assembly) - { - if (string.IsNullOrEmpty(assembly.Location)) - { - return true; - } - - return TrustedPaths.Any(path => assembly.Location.StartsWith(path, StringComparison.OrdinalIgnoreCase)); - } -} diff --git a/src/Patches/Client/ClientPatch.cs b/src/Patches/Client/ClientPatch.cs index aa175b0..e07931e 100644 --- a/src/Patches/Client/ClientPatch.cs +++ b/src/Patches/Client/ClientPatch.cs @@ -35,13 +35,6 @@ internal static class ClientPatch [HarmonyPrefix] private static bool SetOnline_Prefix(SignInStatusComponent __instance) { - var lines = "----------------------------------------------------------------------------------------------"; - if (!FileChecker.HasShownWarning && FileChecker.HasUnauthorizedFileOrMod) - { - Utils.ShowPopUp($"{lines}\n<#0DFF00>{Translator.GetString("BetterAmongUs")}\n{FileChecker.WarningMsg}\n{lines}"); - FileChecker.HasShownWarning = true; - } - var varSupportedVersions = BAUPlugin.SupportedAmongUsVersions; Version currentVersion = new(BAUPlugin.AppVersion); Version firstSupportedVersion = new(varSupportedVersions.First()); diff --git a/src/Patches/Client/MainMenuPatch.cs b/src/Patches/Client/MainMenuPatch.cs index 4a39b02..66ad91a 100644 --- a/src/Patches/Client/MainMenuPatch.cs +++ b/src/Patches/Client/MainMenuPatch.cs @@ -1,9 +1,7 @@ using BetterAmongUs.Helpers; using BetterAmongUs.Managers; -using BetterAmongUs.Modules; using HarmonyLib; using UnityEngine; -using UnityEngine.SceneManagement; namespace BetterAmongUs.Patches.Client; @@ -17,32 +15,6 @@ internal static class MainMenuPatch [HarmonyPostfix] private static void LateUpdate_Postfix(MainMenuManager __instance) { - if (FileChecker.HasUnauthorizedFileOrMod) - { - __instance.playButton.enabled = false; - sprite ??= __instance.playButton.transform.Find("Inactive").GetComponent(); - if (sprite != null) - { - sprite.color = new Color(0.7f, 0.7f, 0.7f); - ObjectHelper.AddColor(sprite); - } - - SceneManager.s_AllowLoadScene = false; - } - else - { - __instance.playButton.enabled = true; - sprite ??= __instance.playButton.transform.Find("Inactive").GetComponent(); - if (sprite != null) - { - sprite.color = Color.white; - ObjectHelper.AddColor(sprite); - } - - SceneManager.s_AllowLoadScene = true; - } - - List buttons = [__instance.playButton, __instance.inventoryButton, __instance.shopButton, __instance.playLocalButton, __instance.PlayOnlineButton, __instance.backButtonOnline, __instance.newsButton, __instance.myAccountButton, __instance.settingsButton, __instance.howToPlayButton, __instance.freePlayButton, __instance.accountCTAButton, __instance.accountStatsButton]; foreach (var button in buttons) From b2cae7378aa1e22271b36f01a3382d52a1b94ed2 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Fri, 9 Jan 2026 01:49:43 -0600 Subject: [PATCH 02/13] No longer trust host BAU users --- src/Modules/AntiCheat/BetterAntiCheat.cs | 4 ++-- src/Modules/GameState.cs | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Modules/AntiCheat/BetterAntiCheat.cs b/src/Modules/AntiCheat/BetterAntiCheat.cs index 25e7371..1bd4ddd 100644 --- a/src/Modules/AntiCheat/BetterAntiCheat.cs +++ b/src/Modules/AntiCheat/BetterAntiCheat.cs @@ -124,7 +124,7 @@ internal static class BetterAntiCheat internal static void CheckRPC(PlayerControl player, byte callId, MessageReader oldReader) { if (player == null || player?.Data == null) return; - if (!IsEnabled || !BAUPlugin.AntiCheat.Value || (GameState.IsBetterHostLobby && !GameState.IsHost) || !BetterGameSettings.DetectInvalidRPCs.GetBool()) return; + if (!IsEnabled || !BAUPlugin.AntiCheat.Value || !BetterGameSettings.DetectInvalidRPCs.GetBool()) return; if (player.IsLocalPlayer() && player.IsHost()) return; MessageReader reader = MessageReader.Get(oldReader); @@ -138,7 +138,7 @@ internal static class BetterAntiCheat try { if (player == null || player?.Data == null) return true; - if (!IsEnabled || !BAUPlugin.AntiCheat.Value || (GameState.IsBetterHostLobby && !GameState.IsHost) || !BetterGameSettings.DetectInvalidRPCs.GetBool()) return true; + if (!IsEnabled || !BAUPlugin.AntiCheat.Value || !BetterGameSettings.DetectInvalidRPCs.GetBool()) return true; if (player.IsLocalPlayer() && player.IsHost()) return true; MessageReader reader = MessageReader.Get(oldReader); diff --git a/src/Modules/GameState.cs b/src/Modules/GameState.cs index f2cd60a..3558e40 100644 --- a/src/Modules/GameState.cs +++ b/src/Modules/GameState.cs @@ -1,6 +1,4 @@ using AmongUs.GameOptions; -using BetterAmongUs.Helpers; -using BetterAmongUs.Mono; namespace BetterAmongUs.Modules; @@ -105,7 +103,6 @@ internal static class GameState internal static bool IsShip => ShipStatus.Instance != null; internal static bool IsHost => AmongUsClient.Instance != null && AmongUsClient.Instance.AmHost; internal static bool IsPrivateOnlyLobby => (BAUPlugin.PrivateOnlyLobby.Value || AmongUsClient.Instance.AmLocalHost) && IsHost; - internal static bool IsBetterHostLobby => PlayerControl.LocalPlayer?.IsHost() == true || BAUPlugin.AllPlayerControls.Any(pc => pc?.BetterData() != null && pc.IsHost() && pc.BetterData().IsBetterUser && pc.BetterData().IsVerifiedBetterUser); internal static bool IsCanMove => PlayerControl.LocalPlayer?.CanMove is true; internal static bool IsDead => PlayerControl.LocalPlayer?.Data?.IsDead is true; } From 8001d2aecbcede1b6031216eb74c8638bc787536 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Fri, 9 Jan 2026 02:04:38 -0600 Subject: [PATCH 03/13] fix copy --- src/BetterAmongUs.csproj | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/src/BetterAmongUs.csproj b/src/BetterAmongUs.csproj index 2c42e6e..2c409a1 100644 --- a/src/BetterAmongUs.csproj +++ b/src/BetterAmongUs.csproj @@ -5,11 +5,26 @@ enable Library preview + false + false - - - + + + build\mod_folder_path + $([System.IO.File]::ReadAllText('$(ModPathFile)').Trim()) + $(GamePath) + + + + + + + + + + + @@ -24,21 +39,4 @@ - - - - build\mod_folder_path - $([System.IO.File]::ReadAllText('$(ModPathFile)').Trim()) - $(GamePath)\Mods - - - - - - - - - - - \ No newline at end of file From 6d9190948de560f52106246bfca3fa88e9e78a43 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Fri, 9 Jan 2026 02:05:27 -0600 Subject: [PATCH 04/13] remove --- src/BetterAmongUs.csproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/BetterAmongUs.csproj b/src/BetterAmongUs.csproj index 2c409a1..cdc8c23 100644 --- a/src/BetterAmongUs.csproj +++ b/src/BetterAmongUs.csproj @@ -5,8 +5,6 @@ enable Library preview - false - false From a53ff5e59f95c2bce811613c614e40cd01f85d4a Mon Sep 17 00:00:00 2001 From: D1GQ <83262852+D1GQ@users.noreply.github.com> Date: Fri, 9 Jan 2026 02:09:21 -0600 Subject: [PATCH 05/13] Add workflows --- workflows/build.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 workflows/build.yml diff --git a/workflows/build.yml b/workflows/build.yml new file mode 100644 index 0000000..6f2a17a --- /dev/null +++ b/workflows/build.yml @@ -0,0 +1,29 @@ +name: Build + +on: + push: + branches: [ main, dev ] + pull_request: + branches: [ main ] + +jobs: + build-mod: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup .NET 6 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '6.0.x' + + - name: Build + run: dotnet build --configuration Release + + - name: Archive build + uses: actions/upload-artifact@v4 + with: + name: mod-build + path: bin/Release/net6.0/ \ No newline at end of file From 0f18875af3b9d19f91f3ee03b83f6d0617902b93 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Fri, 9 Jan 2026 02:13:47 -0600 Subject: [PATCH 06/13] update date --- src/ModInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ModInfo.cs b/src/ModInfo.cs index 8c2886f..042ddb6 100644 --- a/src/ModInfo.cs +++ b/src/ModInfo.cs @@ -9,7 +9,7 @@ internal static class ModInfo internal const string PluginName = "BetterAmongUs"; internal const string PluginGuid = "com.d1gq.betteramongus"; internal const string PluginVersion = "1.3.1"; - internal const string ReleaseDate = "01.08.2026"; // mm/dd/yyyy + internal const string ReleaseDate = "01.09.2026"; // mm/dd/yyyy internal const string Github = "https://github.com/D1GQ/BetterAmongUs-Public"; internal const string Discord = "https://discord.gg/vjYrXpzNAn"; } \ No newline at end of file From 6e234838e7afead964fd3f0d9e6052936f2e2d0b Mon Sep 17 00:00:00 2001 From: D1GQ Date: Fri, 9 Jan 2026 02:17:19 -0600 Subject: [PATCH 07/13] Move workflows --- {workflows => .github/workflows}/build.yml | 56 +++++++++++----------- 1 file changed, 28 insertions(+), 28 deletions(-) rename {workflows => .github/workflows}/build.yml (95%) diff --git a/workflows/build.yml b/.github/workflows/build.yml similarity index 95% rename from workflows/build.yml rename to .github/workflows/build.yml index 6f2a17a..5821505 100644 --- a/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,29 +1,29 @@ -name: Build - -on: - push: - branches: [ main, dev ] - pull_request: - branches: [ main ] - -jobs: - build-mod: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup .NET 6 - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '6.0.x' - - - name: Build - run: dotnet build --configuration Release - - - name: Archive build - uses: actions/upload-artifact@v4 - with: - name: mod-build +name: Build + +on: + push: + branches: [ main, dev ] + pull_request: + branches: [ main ] + +jobs: + build-mod: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup .NET 6 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '6.0.x' + + - name: Build + run: dotnet build --configuration Release + + - name: Archive build + uses: actions/upload-artifact@v4 + with: + name: mod-build path: bin/Release/net6.0/ \ No newline at end of file From cf4dac822828de3a9a77fdab8747e54352006d02 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Fri, 9 Jan 2026 02:21:05 -0600 Subject: [PATCH 08/13] Fix path in build action --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5821505..0cdc499 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,10 +20,10 @@ jobs: dotnet-version: '6.0.x' - name: Build - run: dotnet build --configuration Release + run: dotnet build src/*.csproj --configuration Release - name: Archive build uses: actions/upload-artifact@v4 with: name: mod-build - path: bin/Release/net6.0/ \ No newline at end of file + path: src/bin/Release/net6.0/ \ No newline at end of file From 7dded9cf9dfe9013cbd3a328eebe0ed83de347c2 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Fri, 9 Jan 2026 02:23:14 -0600 Subject: [PATCH 09/13] Skip path copy in action --- src/BetterAmongUs.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BetterAmongUs.csproj b/src/BetterAmongUs.csproj index cdc8c23..b09f4bd 100644 --- a/src/BetterAmongUs.csproj +++ b/src/BetterAmongUs.csproj @@ -10,16 +10,16 @@ build\mod_folder_path - $([System.IO.File]::ReadAllText('$(ModPathFile)').Trim()) + $([System.IO.File]::ReadAllText('$(ModPathFile)').Trim()) $(GamePath) - + - + From 3270881a7d0ce010deffe76f1c5c710c116017e0 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Fri, 9 Jan 2026 02:24:47 -0600 Subject: [PATCH 10/13] Really fix copy --- src/BetterAmongUs.csproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/BetterAmongUs.csproj b/src/BetterAmongUs.csproj index b09f4bd..907b93a 100644 --- a/src/BetterAmongUs.csproj +++ b/src/BetterAmongUs.csproj @@ -10,17 +10,17 @@ build\mod_folder_path - $([System.IO.File]::ReadAllText('$(ModPathFile)').Trim()) + $([System.IO.File]::ReadAllText('$(ModPathFile)').Trim()) $(GamePath) - - - + + + - - + + From 7f26f2c6a40baa6cf18c7c3b05dfffdc0c271f33 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Fri, 9 Jan 2026 02:27:46 -0600 Subject: [PATCH 11/13] Check CI --- src/BetterAmongUs.csproj | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/BetterAmongUs.csproj b/src/BetterAmongUs.csproj index 907b93a..634c239 100644 --- a/src/BetterAmongUs.csproj +++ b/src/BetterAmongUs.csproj @@ -9,17 +9,21 @@ + true + false build\mod_folder_path - $([System.IO.File]::ReadAllText('$(ModPathFile)').Trim()) + $([System.IO.File]::ReadAllText('$(ModPathFile)').Trim()) $(GamePath) - + - + From 5fc6d2b54478276cdb672f8f734ca14282bf097c Mon Sep 17 00:00:00 2001 From: D1GQ Date: Fri, 9 Jan 2026 02:31:18 -0600 Subject: [PATCH 12/13] Add BepInEx NuGet source --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0cdc499..5ed47a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,6 +18,11 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: '6.0.x' + + - name: Add BepInEx NuGet source + run: | + # Add the BepInEx NuGet feed + dotnet nuget add source --name bepinex "https://nuget.bepinex.dev/v3/index.json" - name: Build run: dotnet build src/*.csproj --configuration Release From b857b2d79ab6b6ce818e56867d14d13dd3cf6f3c Mon Sep 17 00:00:00 2001 From: D1GQ Date: Fri, 9 Jan 2026 02:34:48 -0600 Subject: [PATCH 13/13] artifact dll --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ed47a6..bee9423 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,8 +27,8 @@ jobs: - name: Build run: dotnet build src/*.csproj --configuration Release - - name: Archive build + - name: Archive DLL file uses: actions/upload-artifact@v4 with: - name: mod-build - path: src/bin/Release/net6.0/ \ No newline at end of file + name: BetterAmongUs.dll + path: src/bin/Release/net6.0/BetterAmongUs.dll \ No newline at end of file