Skip to content

Commit 622f36b

Browse files
committed
Add .NET 9 to target frameworks
1 parent efe1443 commit 622f36b

File tree

15 files changed

+170
-156
lines changed

15 files changed

+170
-156
lines changed

.github/workflows/build_nupkg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup .NET
1717
uses: actions/setup-dotnet@v4
1818
with:
19-
dotnet-version: 8.0.x
19+
dotnet-version: 9.0.x
2020

2121
- name: Restore dependencies
2222
run: dotnet restore

.github/workflows/build_programs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
matrix:
1313
project: [ExtractionTool, ProtectionScan]
1414
runtime: [win-x86, win-x64, win-arm64, linux-x64, linux-arm64, osx-x64]
15-
framework: [net8.0] #[net20, net35, net40, net452, net472, net48, netcoreapp3.1, net5.0, net6.0, net7.0, net8.0]
15+
framework: [net9.0] #[net20, net35, net40, net452, net472, net48, netcoreapp3.1, net5.0, net6.0, net7.0, net8.0, net9.0]
1616
conf: [Debug] #[Release, Debug]
1717

1818
steps:
@@ -23,13 +23,13 @@ jobs:
2323
- name: Setup .NET
2424
uses: actions/setup-dotnet@v4
2525
with:
26-
dotnet-version: 8.0.x
26+
dotnet-version: 9.0.x
2727

2828
- name: Restore dependencies
2929
run: dotnet restore
3030

3131
- name: Build
32-
run: dotnet publish ${{ matrix.project }}/${{ matrix.project }}.csproj -f ${{ matrix.framework }} -r ${{ matrix.runtime }} -c ${{ matrix.conf == 'Release' && 'Release -p:DebugType=None -p:DebugSymbols=false' || 'Debug'}} --self-contained true --version-suffix ${{ github.sha }} ${{ (startsWith(matrix.framework, 'net5') || startsWith(matrix.framework, 'net6') || startsWith(matrix.framework, 'net7') || startsWith(matrix.framework, 'net8')) && '-p:PublishSingleFile=true' || ''}}
32+
run: dotnet publish ${{ matrix.project }}/${{ matrix.project }}.csproj -f ${{ matrix.framework }} -r ${{ matrix.runtime }} -c ${{ matrix.conf == 'Release' && 'Release -p:DebugType=None -p:DebugSymbols=false' || 'Debug'}} --self-contained true --version-suffix ${{ github.sha }} ${{ (startsWith(matrix.framework, 'net5') || startsWith(matrix.framework, 'net6') || startsWith(matrix.framework, 'net7') || startsWith(matrix.framework, 'net8') || startsWith(matrix.framework, 'net9')) && '-p:PublishSingleFile=true' || ''}}
3333

3434
- name: Archive build
3535
run: |

.github/workflows/check_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: Setup .NET
1212
uses: actions/setup-dotnet@v4
1313
with:
14-
dotnet-version: 8.0.x
14+
dotnet-version: 9.0.x
1515

1616
- name: Build
1717
run: dotnet build

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"request": "launch",
1111
"preLaunchTask": "build",
1212
// If you have changed target frameworks, make sure to update the program path.
13-
"program": "${workspaceFolder}/ProtectionScan/bin/Debug/net8.0/ProtectionScan.dll",
13+
"program": "${workspaceFolder}/ProtectionScan/bin/Debug/net9.0/ProtectionScan.dll",
1414
"args": [],
1515
"cwd": "${workspaceFolder}/ProtectionScan",
1616
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
@@ -23,7 +23,7 @@
2323
"request": "launch",
2424
"preLaunchTask": "build",
2525
// If you have changed target frameworks, make sure to update the program path.
26-
"program": "${workspaceFolder}/ExtractionTool/bin/Debug/net8.0/ExtractionTool.dll",
26+
"program": "${workspaceFolder}/ExtractionTool/bin/Debug/net9.0/ExtractionTool.dll",
2727
"args": [],
2828
"cwd": "${workspaceFolder}/ExtractionTool",
2929
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
Lines changed: 101 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,111 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<!-- Assembly Properties -->
5-
<TargetFrameworks>net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
6-
<RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64</RuntimeIdentifiers>
7-
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
8-
<CheckEolTargetFramework>false</CheckEolTargetFramework>
9-
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
10-
<LangVersion>latest</LangVersion>
11-
<Nullable>enable</Nullable>
12-
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
13-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
14-
<Version>3.1.16</Version>
15-
<!-- Mostly added due to external libraries -->
16-
<WarningsNotAsErrors>CS0162;CS0612;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8618;CS8625;CS8634;CS8765;IL3000;NU5100</WarningsNotAsErrors>
17-
18-
<!-- Package Properties -->
19-
<Authors>Matt Nadareski</Authors>
20-
<Description>Protection scanning library</Description>
21-
<Copyright>Copyright (c)2018-2024 Matt Nadareski</Copyright>
22-
<PackageProjectUrl>https://github.com/SabreTools/</PackageProjectUrl>
23-
<RepositoryUrl>https://github.com/SabreTools/BinaryObjectScanner</RepositoryUrl>
24-
<RepositoryType>git</RepositoryType>
25-
<PackageTags>protection copy-protection scanning packer</PackageTags>
26-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
27-
</PropertyGroup>
3+
<PropertyGroup>
4+
<!-- Assembly Properties -->
5+
<TargetFrameworks>net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
6+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
7+
<CheckEolTargetFramework>false</CheckEolTargetFramework>
8+
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
9+
<LangVersion>latest</LangVersion>
10+
<Nullable>enable</Nullable>
11+
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
12+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
13+
<Version>3.1.16</Version>
14+
<!-- Mostly added due to external libraries -->
15+
<WarningsNotAsErrors>CS0162;CS0612;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8618;CS8625;CS8634;CS8765;IL3000;NU5100</WarningsNotAsErrors>
2816

29-
<!-- Set a build flag for Windows specifically -->
30-
<PropertyGroup Condition="'$(RuntimeIdentifier)'=='win-x86'">
31-
<DefineConstants>$(DefineConstants);WIN</DefineConstants>
32-
</PropertyGroup>
17+
<!-- Package Properties -->
18+
<Authors>Matt Nadareski</Authors>
19+
<Description>Protection scanning library</Description>
20+
<Copyright>Copyright (c)2018-2024 Matt Nadareski</Copyright>
21+
<PackageProjectUrl>https://github.com/SabreTools/</PackageProjectUrl>
22+
<RepositoryUrl>https://github.com/SabreTools/BinaryObjectScanner</RepositoryUrl>
23+
<RepositoryType>git</RepositoryType>
24+
<PackageTags>protection copy-protection scanning packer</PackageTags>
25+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
26+
</PropertyGroup>
3327

34-
<!-- Exclude certain parts of external modules for by default -->
35-
<PropertyGroup>
36-
<DefaultItemExcludes>
37-
$(DefaultItemExcludes);
38-
**\AssemblyInfo.cs;
39-
_EXTERNAL\LessIO\src\LessIO.Tests\**;
40-
_EXTERNAL\libmspack4n\lib\**;
41-
_EXTERNAL\libmspack4n\libmspack4ntest\**;
42-
_EXTERNAL\stormlibsharp\lib\**;
43-
_EXTERNAL\stormlibsharp\src\TestConsole\**
44-
</DefaultItemExcludes>
45-
</PropertyGroup>
28+
<!-- Support All Frameworks -->
29+
<PropertyGroup Condition="$(TargetFramework.StartsWith(`net2`)) OR $(TargetFramework.StartsWith(`net3`)) OR $(TargetFramework.StartsWith(`net4`))">
30+
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
31+
</PropertyGroup>
32+
<PropertyGroup Condition="$(TargetFramework.StartsWith(`netcoreapp`)) OR $(TargetFramework.StartsWith(`net5`))">
33+
<RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64</RuntimeIdentifiers>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="$(TargetFramework.StartsWith(`net6`)) OR $(TargetFramework.StartsWith(`net7`)) OR $(TargetFramework.StartsWith(`net8`)) OR $(TargetFramework.StartsWith(`net9`))">
36+
<RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
37+
</PropertyGroup>
38+
<PropertyGroup Condition="$(RuntimeIdentifier.StartsWith(`osx-arm`))">
39+
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
40+
</PropertyGroup>
4641

47-
<!-- Exclude all StormLibSharp for .NET Framework 4.0 -->
48-
<PropertyGroup Condition="$(TargetFramework.StartsWith(`net40`))">
49-
<DefaultItemExcludes>
50-
$(DefaultItemExcludes);
51-
_EXTERNAL\stormlibsharp\src\**
52-
</DefaultItemExcludes>
53-
</PropertyGroup>
42+
<!-- Set a build flag for Windows specifically -->
43+
<PropertyGroup Condition="'$(RuntimeIdentifier)'=='win-x86'">
44+
<DefineConstants>$(DefineConstants);WIN</DefineConstants>
45+
</PropertyGroup>
5446

55-
<!-- Exclude all external modules for .NET Framework 2.0, .NET Framework 3.5, or non-Windows builds -->
56-
<PropertyGroup Condition="$(TargetFramework.StartsWith(`net2`)) OR $(TargetFramework.StartsWith(`net3`)) OR !$(RuntimeIdentifier.StartsWith(`win-x86`))">
57-
<DefaultItemExcludes>
58-
$(DefaultItemExcludes);
59-
_EXTERNAL\**
60-
</DefaultItemExcludes>
61-
</PropertyGroup>
47+
<!-- Exclude certain parts of external modules for by default -->
48+
<PropertyGroup>
49+
<DefaultItemExcludes>
50+
$(DefaultItemExcludes);
51+
**\AssemblyInfo.cs;
52+
_EXTERNAL\LessIO\src\LessIO.Tests\**;
53+
_EXTERNAL\libmspack4n\lib\**;
54+
_EXTERNAL\libmspack4n\libmspack4ntest\**;
55+
_EXTERNAL\stormlibsharp\lib\**;
56+
_EXTERNAL\stormlibsharp\src\TestConsole\**
57+
</DefaultItemExcludes>
58+
</PropertyGroup>
6259

63-
<!-- These are needed for dealing with native Windows DLLs -->
64-
<ItemGroup Condition="!$(TargetFramework.StartsWith(`net2`)) AND !$(TargetFramework.StartsWith(`net3`)) AND $(RuntimeIdentifier.StartsWith(`win-x86`))">
65-
<Content Include="*.dll">
66-
<Pack>true</Pack>
67-
<PackagePath>contentFiles;content</PackagePath>
68-
<IncludeInPackage>true</IncludeInPackage>
69-
<CopyToOutput>true</CopyToOutput>
70-
<BuildAction>Content</BuildAction>
71-
<copyToOutput>true</copyToOutput>
72-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
73-
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
74-
</Content>
75-
</ItemGroup>
60+
<!-- Exclude all StormLibSharp for .NET Framework 4.0 -->
61+
<PropertyGroup Condition="$(TargetFramework.StartsWith(`net40`))">
62+
<DefaultItemExcludes>
63+
$(DefaultItemExcludes);
64+
_EXTERNAL\stormlibsharp\src\**
65+
</DefaultItemExcludes>
66+
</PropertyGroup>
7667

77-
<!-- Support for old .NET versions -->
78-
<ItemGroup Condition="!$(TargetFramework.StartsWith(`net2`)) AND !$(TargetFramework.StartsWith(`net3`))">
79-
<PackageReference Include="OpenMcdf" Version="2.3.1" />
80-
</ItemGroup>
81-
<ItemGroup Condition="!$(TargetFramework.StartsWith(`net2`)) AND !$(TargetFramework.StartsWith(`net3`)) AND !$(TargetFramework.StartsWith(`net40`)) AND !$(TargetFramework.StartsWith(`net452`))">
82-
<PackageReference Include="SharpCompress" Version="0.38.0" />
83-
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
84-
</ItemGroup>
68+
<!-- Exclude all external modules for .NET Framework 2.0, .NET Framework 3.5, or non-Windows
69+
builds -->
70+
<PropertyGroup Condition="$(TargetFramework.StartsWith(`net2`)) OR $(TargetFramework.StartsWith(`net3`)) OR !$(RuntimeIdentifier.StartsWith(`win-x86`))">
71+
<DefaultItemExcludes>
72+
$(DefaultItemExcludes);
73+
_EXTERNAL\**
74+
</DefaultItemExcludes>
75+
</PropertyGroup>
8576

86-
<ItemGroup>
87-
<PackageReference Include="SabreTools.Compression" Version="0.5.2" />
88-
<PackageReference Include="SabreTools.Hashing" Version="1.2.2" />
89-
<PackageReference Include="SabreTools.IO" Version="1.4.13" />
90-
<PackageReference Include="SabreTools.Matching" Version="1.3.3" />
91-
<PackageReference Include="SabreTools.Models" Version="1.4.11" />
92-
<PackageReference Include="SabreTools.Serialization" Version="1.6.9" />
93-
<PackageReference Include="UnshieldSharp" Version="1.8.5" />
94-
<PackageReference Include="WiseUnpacker" Version="1.4.4" />
95-
</ItemGroup>
77+
<!-- These are needed for dealing with native Windows DLLs -->
78+
<ItemGroup Condition="!$(TargetFramework.StartsWith(`net2`)) AND !$(TargetFramework.StartsWith(`net3`)) AND $(RuntimeIdentifier.StartsWith(`win-x86`))">
79+
<Content Include="*.dll">
80+
<Pack>true</Pack>
81+
<PackagePath>contentFiles;content</PackagePath>
82+
<IncludeInPackage>true</IncludeInPackage>
83+
<CopyToOutput>true</CopyToOutput>
84+
<BuildAction>Content</BuildAction>
85+
<copyToOutput>true</copyToOutput>
86+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
87+
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
88+
</Content>
89+
</ItemGroup>
9690

97-
</Project>
91+
<!-- Support for old .NET versions -->
92+
<ItemGroup Condition="!$(TargetFramework.StartsWith(`net2`)) AND !$(TargetFramework.StartsWith(`net3`))">
93+
<PackageReference Include="OpenMcdf" Version="2.3.1" />
94+
</ItemGroup>
95+
<ItemGroup Condition="!$(TargetFramework.StartsWith(`net2`)) AND !$(TargetFramework.StartsWith(`net3`)) AND !$(TargetFramework.StartsWith(`net40`)) AND !$(TargetFramework.StartsWith(`net452`))">
96+
<PackageReference Include="SharpCompress" Version="0.38.0" />
97+
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
98+
</ItemGroup>
99+
100+
<ItemGroup>
101+
<PackageReference Include="SabreTools.Compression" Version="0.6.0" />
102+
<PackageReference Include="SabreTools.Hashing" Version="1.4.0" />
103+
<PackageReference Include="SabreTools.IO" Version="1.5.0" />
104+
<PackageReference Include="SabreTools.Matching" Version="1.4.0" />
105+
<PackageReference Include="SabreTools.Models" Version="1.5.0" />
106+
<PackageReference Include="SabreTools.Serialization" Version="1.7.0" />
107+
<PackageReference Include="UnshieldSharp" Version="1.9.0" />
108+
<PackageReference Include="WiseUnpacker" Version="1.5.0" />
109+
</ItemGroup>
110+
111+
</Project>

BinaryObjectScanner/FileType/LDSCRYPT.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class LDSCRYPT : IDetectable
2626
try
2727
{
2828
byte[] magic = new byte[16];
29-
stream.Read(magic, 0, 16);
29+
int read = stream.Read(magic, 0, 16);
3030

3131
if (magic.StartsWith(new byte?[] { 0x4C, 0x44, 0x53, 0x43, 0x52, 0x59, 0x50, 0x54 }))
3232
return "Link Data Security encrypted file";

BinaryObjectScanner/FileType/PLJ.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class PLJ : IDetectable
2626
try
2727
{
2828
byte[] magic = new byte[16];
29-
stream.Read(magic, 0, 16);
29+
int read = stream.Read(magic, 0, 16);
3030

3131
if (magic.StartsWith(new byte?[] { 0xFF, 0x9D, 0x53, 0x4B }))
3232
return "PlayJ Audio File";

BinaryObjectScanner/FileType/RealArcadeInstaller.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class RealArcadeInstaller : IDetectable
2828
try
2929
{
3030
byte[] magic = new byte[16];
31-
stream.Read(magic, 0, 16);
31+
int read = stream.Read(magic, 0, 16);
3232

3333
// RASGI2.0
3434
// Found in the ".rgs" files in IA item "Nova_RealArcadeCD_USA".

BinaryObjectScanner/FileType/RealArcadeMezzanine.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class RealArcadeMezzanine : IDetectable
2828
try
2929
{
3030
byte[] magic = new byte[16];
31-
stream.Read(magic, 0, 16);
31+
int read = stream.Read(magic, 0, 16);
3232

3333
// XZip2.0
3434
// Found in the ".mez" files in IA item "Nova_RealArcadeCD_USA".

BinaryObjectScanner/FileType/SFFS.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class SFFS : IExtractable, IDetectable
2727
try
2828
{
2929
byte[] magic = new byte[16];
30-
stream.Read(magic, 0, 16);
30+
int read = stream.Read(magic, 0, 16);
3131

3232
if (magic.StartsWith(new byte?[] { 0x53, 0x46, 0x46, 0x53 }))
3333
return "StarForce Filesystem Container";

0 commit comments

Comments
 (0)