4 Commits

Author SHA1 Message Date
  Meivyn a81bad951f
Bump version 3 months ago
  Meivyn 8ca34ff788
Move remaining shipped libraries into Libs 3 months ago
  Meivyn 35990a7828
Remove some shipped libs for now 3 months ago
  Meivyn c283d4a440
Fix early game version parsing 3 months ago
10 changed files with 39 additions and 41 deletions
Unified View
  1. +35
    -9
      IPA.Injector/GameVersionEarly.cs
  2. +0
    -25
      IPA.Injector/IPA.Injector.csproj
  3. +1
    -1
      IPA.Loader/Config/SelfConfig.cs
  4. +1
    -4
      IPA.Loader/Loader/LibLoader.cs
  5. +1
    -1
      IPA.Loader/Loader/manifest.json
  6. +1
    -1
      IPA/Program.cs
  7. BIN
      Libs/I18N.Net4.dll
  8. BIN
      Libs/I18N.West.net4.dll
  9. BIN
      Libs/System.Runtime.Serialization.net4.dll
  10. BIN
      Libs/netstandard.dll

+ 35
- 9
IPA.Injector/GameVersionEarly.cs View File

@ -31,27 +31,53 @@ namespace IPA.Injector
{ {
const string key = "public.app-category.games"; const string key = "public.app-category.games";
int pos = 0; int pos = 0;
var streamLength = stream.Length;
while (stream.Position < stream.Length && pos < key.Length)
while (stream.Position < streamLength && pos < key.Length)
{ {
if (reader.ReadByte() == key[pos]) pos++; if (reader.ReadByte() == key[pos]) pos++;
else pos = 0; else pos = 0;
} }
if (stream.Position == stream.Length) // we went through the entire stream without finding the key
if (stream.Position == streamLength) // we went through the entire stream without finding the key
throw new KeyNotFoundException("Could not find key '" + key + "' in " + mgr); throw new KeyNotFoundException("Could not find key '" + key + "' in " + mgr);
while (stream.Position < stream.Length)
var startIndex = 0L;
var endIndex = 0L;
while (stream.Position < streamLength && endIndex == 0L)
{ {
var current = (char)reader.ReadByte(); var current = (char)reader.ReadByte();
if (char.IsDigit(current)) if (char.IsDigit(current))
break;
}
{
startIndex = stream.Position - 1;
var dotCount = 0;
var rewind = -sizeof(int) - sizeof(byte);
_ = stream.Seek(rewind, SeekOrigin.Current); // rewind to the string length
while (stream.Position < streamLength)
{
current = (char)reader.ReadByte();
if (char.IsDigit(current))
{
if (dotCount == 2 && stream.Position < streamLength && !char.IsDigit((char)reader.PeekChar()))
{
endIndex = stream.Position;
break;
}
}
else if (current == '.')
{
dotCount++;
}
else
{
break;
}
}
}
}
var strlen = reader.ReadInt32();
var strlen = (int)(endIndex - startIndex);
_ = stream.Seek(-strlen, SeekOrigin.Current);
var strbytes = reader.ReadBytes(strlen); var strbytes = reader.ReadBytes(strlen);
return Encoding.UTF8.GetString(strbytes); return Encoding.UTF8.GetString(strbytes);
@ -60,7 +86,7 @@ namespace IPA.Injector
internal static AlmostVersion SafeParseVersion() => new(GetGameVersion()); internal static AlmostVersion SafeParseVersion() => new(GetGameVersion());
private static void _Load()
private static void _Load()
{ {
UnityGame.SetEarlyGameVersion(SafeParseVersion()); UnityGame.SetEarlyGameVersion(SafeParseVersion());
UnityGame.CheckGameVersionBoundary(); UnityGame.CheckGameVersionBoundary();


+ 0
- 25
IPA.Injector/IPA.Injector.csproj View File

@ -39,33 +39,10 @@
</ItemGroup> </ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' "> <ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<Content Include="..\Libs\I18N.Net4.dll">
<Link>Libraries\Mono\I18N.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="..\Libs\I18N.West.Net4.dll">
<Link>Libraries\Mono\I18N.West.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="..\Libs\Microsoft.CSharp.dll"> <Content Include="..\Libs\Microsoft.CSharp.dll">
<Link>Libraries\Mono\Microsoft.CSharp.dll</Link> <Link>Libraries\Mono\Microsoft.CSharp.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="..\Libs\System.Runtime.Serialization.Net4.dll">
<Link>Libraries\Mono\System.Runtime.Serialization.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="..\Libs\netstandard.dll">
<Link>Libraries\Mono\netstandard.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="..\Libs\thirdparty\*">
<Link>Libraries\Thirdparty\%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup> </ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' "> <ItemGroup Condition=" '$(TargetFramework)' == 'net35' ">
@ -105,11 +82,9 @@
<SystemFiles Include="$(OutputPath)System.*" /> <SystemFiles Include="$(OutputPath)System.*" />
<SystemFiles Include="$(OutputPath)Portable.System.*" /> <SystemFiles Include="$(OutputPath)Portable.System.*" />
<SystemFiles Include="$(OutputPath)Net3-Proxy.*" /> <SystemFiles Include="$(OutputPath)Net3-Proxy.*" />
<SystemFiles Include="$(OutputPath)Libraries\Mono\**\*" />
<OldLibFiles Include="$(OutputPath)Libs\**\*" /> <OldLibFiles Include="$(OutputPath)Libs\**\*" />
</ItemGroup> </ItemGroup>
<Move SourceFiles="@(SystemFiles)" DestinationFolder="$(OutputPath)Data\Managed" /> <Move SourceFiles="@(SystemFiles)" DestinationFolder="$(OutputPath)Data\Managed" />
<RemoveDir Directories="$(OutputPath)Libraries\Mono" />
<Delete Files="@(OldLibFiles)" /> <Delete Files="@(OldLibFiles)" />
<RemoveDir Directories="$(OutputPath)Libs" /> <RemoveDir Directories="$(OutputPath)Libs" />


+ 1
- 1
IPA.Loader/Config/SelfConfig.cs View File

@ -87,7 +87,7 @@ namespace IPA.Config
} }
internal const string IPAName = "Beat Saber IPA"; internal const string IPAName = "Beat Saber IPA";
internal const string IPAVersion = "4.3.4.0";
internal const string IPAVersion = "4.3.5.0";
// uses Updates.AutoUpdate, Updates.AutoCheckUpdates, YeetMods, Debug.ShowCallSource, Debug.ShowDebug, // uses Updates.AutoUpdate, Updates.AutoCheckUpdates, YeetMods, Debug.ShowCallSource, Debug.ShowDebug,
// Debug.CondenseModLogs // Debug.CondenseModLogs


+ 1
- 4
IPA.Loader/Loader/LibLoader.cs View File

@ -90,9 +90,6 @@ namespace IPA.Loader
//var unityData = Directory.EnumerateDirectories(Environment.CurrentDirectory, "*_Data").First(); //var unityData = Directory.EnumerateDirectories(Environment.CurrentDirectory, "*_Data").First();
//AddDir(Path.Combine(unityData, "Plugins")); //AddDir(Path.Combine(unityData, "Plugins"));
// TODO: find a way to either safely remove Newtonsoft, or switch to a different JSON lib
_ = LoadLibrary(new AssemblyName("Newtonsoft.Json, Version=12.0.0.0, Culture=neutral"));
} }
} }
@ -215,7 +212,7 @@ namespace IPA.Loader
{ continue; } { continue; }
catch (DirectoryNotFoundException) catch (DirectoryNotFoundException)
{ continue; } { continue; }
foreach (string str in subDirs) foreach (string str in subDirs)
if (dirValidator(str)) dirs.Push(str); if (dirValidator(str)) dirs.Push(str);


+ 1
- 1
IPA.Loader/Loader/manifest.json View File

@ -7,7 +7,7 @@
], ],
"id": "BSIPA", "id": "BSIPA",
"name": "Beat Saber IPA", "name": "Beat Saber IPA",
"version": "4.3.4",
"version": "4.3.5",
"icon": "IPA.icon_white.png", "icon": "IPA.icon_white.png",
"features": { "features": {
"IPA.DefineFeature": [ "IPA.DefineFeature": [


+ 1
- 1
IPA/Program.cs View File

@ -21,7 +21,7 @@ namespace IPA
Unknown Unknown
} }
public const string FileVersion = "4.3.4.0";
public const string FileVersion = "4.3.5.0";
public static Version Version => Assembly.GetEntryAssembly()!.GetName().Version!; public static Version Version => Assembly.GetEntryAssembly()!.GetName().Version!;


BIN
Libs/I18N.Net4.dll View File


BIN
Libs/I18N.West.net4.dll View File


BIN
Libs/System.Runtime.Serialization.net4.dll View File


BIN
Libs/netstandard.dll View File


Loading…
Cancel
Save