Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af76458da0
|
||
|
|
81f57566a7
|
||
|
|
adffc1efeb
|
||
|
|
4c7adcb58a
|
||
|
|
1fec94cda8
|
||
|
|
c3a42b935e
|
||
|
|
3f7604d4c8
|
||
|
|
2c48d247b8
|
||
|
|
fea6ec56fc
|
||
|
|
9755e18087 | ||
|
|
f6688ce573 |
@@ -0,0 +1,123 @@
|
|||||||
|
name: Publish NuGet packages
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
env:
|
||||||
|
NUGET_AUTH_TOKEN: ${{ secrets.SHRINKSDK_PACKAGE_TOKEN }}
|
||||||
|
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: '1'
|
||||||
|
DOTNET_CLI_TELEMETRY_OPTOUT: '1'
|
||||||
|
LD_LIBRARY_PATH: /opt/dotnet-libs/usr/lib/x86_64-linux-gnu
|
||||||
|
SSL_CERT_FILE: /opt/ca-certificates.crt
|
||||||
|
steps:
|
||||||
|
- name: Fetch exact tagged source
|
||||||
|
env:
|
||||||
|
GITEA_REF: ${{ gitea.ref }}
|
||||||
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
tag="${GITEA_REF#refs/tags/}"
|
||||||
|
case "$tag" in
|
||||||
|
v[0-9]*) ;;
|
||||||
|
*) echo "Expected a version tag ref, got: $GITEA_REF" >&2; exit 1 ;;
|
||||||
|
esac
|
||||||
|
export SHRINKSDK_ARCHIVE_URL="https://git.crash.work/${GITEA_REPOSITORY}/archive/${tag}.tar.gz"
|
||||||
|
node --input-type=module <<'NODE'
|
||||||
|
import { writeFile } from 'node:fs/promises';
|
||||||
|
|
||||||
|
const response = await fetch(process.env.SHRINKSDK_ARCHIVE_URL);
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`Release archive download failed: ${response.status} ${response.statusText}`);
|
||||||
|
}
|
||||||
|
await writeFile('release.tar.gz', new Uint8Array(await response.arrayBuffer()));
|
||||||
|
NODE
|
||||||
|
mkdir release
|
||||||
|
tar -xzf release.tar.gz --strip-components=1 -C release
|
||||||
|
rm -f release.tar.gz
|
||||||
|
printf '%s' "$tag" > release/.shrink-sdk-release-tag
|
||||||
|
|
||||||
|
- name: Install .NET 8 SDK
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
node --input-type=module <<'NODE'
|
||||||
|
import { writeFile } from 'node:fs/promises';
|
||||||
|
import { rootCertificates } from 'node:tls';
|
||||||
|
|
||||||
|
await writeFile('/opt/ca-certificates.crt', rootCertificates.join('\n'));
|
||||||
|
|
||||||
|
const metadataResponse = await fetch('https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/8.0/releases.json');
|
||||||
|
if (!metadataResponse.ok) throw new Error(`Release metadata download failed: ${metadataResponse.status}`);
|
||||||
|
const metadata = await metadataResponse.json();
|
||||||
|
const sdkVersion = metadata['latest-sdk'];
|
||||||
|
const release = metadata.releases.find(item => item.sdk?.version === sdkVersion);
|
||||||
|
const file = release?.sdk?.files?.find(item => item.rid === 'linux-x64' && item.name.endsWith('.tar.gz'));
|
||||||
|
if (!file) throw new Error(`Linux x64 SDK archive not found for ${sdkVersion}`);
|
||||||
|
const archiveResponse = await fetch(file.url);
|
||||||
|
if (!archiveResponse.ok) throw new Error(`SDK download failed: ${archiveResponse.status}`);
|
||||||
|
await writeFile('/tmp/dotnet-sdk.tar.gz', new Uint8Array(await archiveResponse.arrayBuffer()));
|
||||||
|
|
||||||
|
const poolUrl = 'https://deb.debian.org/debian-security/pool/updates/main/o/openssl/';
|
||||||
|
const poolResponse = await fetch(poolUrl);
|
||||||
|
if (!poolResponse.ok) throw new Error(`OpenSSL package index download failed: ${poolResponse.status}`);
|
||||||
|
const poolIndex = await poolResponse.text();
|
||||||
|
const packages = [...poolIndex.matchAll(/href="(libssl3_[^"]+_amd64\.deb)"/g)].map(match => match[1]).sort();
|
||||||
|
const packageName = packages.at(-1);
|
||||||
|
if (!packageName) throw new Error('Debian libssl3 package was not found');
|
||||||
|
const packageResponse = await fetch(poolUrl + packageName);
|
||||||
|
if (!packageResponse.ok) throw new Error(`OpenSSL package download failed: ${packageResponse.status}`);
|
||||||
|
await writeFile('/tmp/libssl3.deb', new Uint8Array(await packageResponse.arrayBuffer()));
|
||||||
|
NODE
|
||||||
|
mkdir -p /opt/dotnet
|
||||||
|
tar -xzf /tmp/dotnet-sdk.tar.gz -C /opt/dotnet
|
||||||
|
mkdir -p /opt/dotnet-libs
|
||||||
|
dpkg-deb -x /tmp/libssl3.deb /opt/dotnet-libs
|
||||||
|
rm -f /tmp/dotnet-sdk.tar.gz
|
||||||
|
rm -f /tmp/libssl3.deb
|
||||||
|
/opt/dotnet/dotnet --info
|
||||||
|
|
||||||
|
- name: Validate, pack and publish
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
: "${NUGET_AUTH_TOKEN:?SHRINKSDK_PACKAGE_TOKEN is required}"
|
||||||
|
export PATH="/opt/dotnet:$PATH"
|
||||||
|
cd release
|
||||||
|
tag="$(cat .shrink-sdk-release-tag)"
|
||||||
|
projects=()
|
||||||
|
if [[ -d DotNet~ ]]; then
|
||||||
|
while IFS= read -r -d '' project; do projects+=("$project"); done < <(find DotNet~ -type f -name '*.csproj' -print0)
|
||||||
|
fi
|
||||||
|
if [[ -d Godot~ ]]; then
|
||||||
|
while IFS= read -r -d '' project; do projects+=("$project"); done < <(find Godot~ -type f -name '*.csproj' -print0)
|
||||||
|
fi
|
||||||
|
if [[ "${#projects[@]}" -eq 0 ]]; then
|
||||||
|
while IFS= read -r -d '' project; do projects+=("$project"); done < <(find . -maxdepth 1 -type f -name '*.csproj' -print0)
|
||||||
|
fi
|
||||||
|
test "${#projects[@]}" -gt 0
|
||||||
|
if [[ -f package.json ]]; then
|
||||||
|
version="$(node -p "require('./package.json').version")"
|
||||||
|
else
|
||||||
|
version="$(dotnet msbuild "${projects[0]}" -getProperty:Version -nologo)"
|
||||||
|
fi
|
||||||
|
test "$tag" = "v$version"
|
||||||
|
mkdir -p packages
|
||||||
|
for project in "${projects[@]}"; do
|
||||||
|
dotnet restore "$project" --configfile NuGet.Config
|
||||||
|
dotnet pack "$project" --configuration Release --no-restore --output "$PWD/packages" --include-symbols --include-source
|
||||||
|
done
|
||||||
|
find packages -maxdepth 1 -name '*.nupkg' -type f | grep -q .
|
||||||
|
dotnet nuget push 'packages/*.nupkg' --api-key "$NUGET_AUTH_TOKEN" --source https://git.crash.work/api/packages/ShrinkSDK/nuget/index.json --skip-duplicate
|
||||||
|
if compgen -G 'packages/*.snupkg' > /dev/null; then
|
||||||
|
dotnet nuget push 'packages/*.snupkg' --api-key "$NUGET_AUTH_TOKEN" --source https://git.crash.work/api/packages/ShrinkSDK/nuget/index.json --skip-duplicate
|
||||||
|
fi
|
||||||
@@ -8,3 +8,11 @@
|
|||||||
/Tools~/**/[Oo]bj/
|
/Tools~/**/[Oo]bj/
|
||||||
*.user
|
*.user
|
||||||
*.DotSettings.user
|
*.DotSettings.user
|
||||||
|
/DotNet~/**/[Bb]in/
|
||||||
|
/DotNet~/**/[Oo]bj/
|
||||||
|
/Godot~/**/[Bb]in/
|
||||||
|
/Godot~/**/[Oo]bj/
|
||||||
|
/artifacts/
|
||||||
|
/packages/
|
||||||
|
!DotNet~/**/*.csproj
|
||||||
|
!Godot~/**/*.csproj
|
||||||
|
|||||||
@@ -6,3 +6,9 @@ Tools~/
|
|||||||
*.sln
|
*.sln
|
||||||
*.user
|
*.user
|
||||||
*.DotSettings.user
|
*.DotSettings.user
|
||||||
|
DotNet~/
|
||||||
|
Godot~/
|
||||||
|
NuGet.Config
|
||||||
|
Directory.Build.props
|
||||||
|
NuGet.Config.meta
|
||||||
|
Directory.Build.props.meta
|
||||||
|
|||||||
@@ -2,6 +2,29 @@
|
|||||||
|
|
||||||
本文件记录 `ShrinkModFramework` 在当前工作区中的包内变更。
|
本文件记录 `ShrinkModFramework` 在当前工作区中的包内变更。
|
||||||
|
|
||||||
|
## [0.2.4] - 2026-08-28
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- 精确依赖 `ShrinkEventBus 2.0.1`。
|
||||||
|
|
||||||
|
## [0.2.3] - 2026-08-28
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 新增 `ShrinkModLoader.LoadAuthorized(settings, authorizedDllPaths)`,只从调用方提交的精确 DLL 白名单加载外部模组。
|
||||||
|
- 恢复公共入口 `ShrinkModRuntimeBootstrap.InitializeDriver(...)`,供安全启动链显式初始化运行时驱动。
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- ContextHost 与旧加载路径不再递归扫描外部模组目录;revision 刷新只复用已授权路径。
|
||||||
|
- `autoLoadOnStartup`、`enableExternalDllMods`、`watchExternalModsDirectory` 默认关闭。
|
||||||
|
- `ShrinkModFrameworkSettings` 优先从标准 ShrinkSDK 资源目录加载,创建菜单同步写入该目录。
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- 授权 DLL 替换失败时继续恢复此前已提交的 SHA-256 revision 与模组组合。
|
||||||
|
|
||||||
## [0.2.1] - 2026-08-26
|
## [0.2.1] - 2026-08-26
|
||||||
|
|
||||||
- 将 EventBus 生成器源码和 fixture builder 收敛到各自 UPM 包的 `Tools~`,并为独立包导出提供随包分析器回退。
|
- 将 EventBus 生成器源码和 fixture builder 收敛到各自 UPM 包的 `Tools~`,并为独立包导出提供随包分析器回退。
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
||||||
|
<Authors>ShrinkSDK</Authors>
|
||||||
|
<Company>ShrinkSDK</Company>
|
||||||
|
<RepositoryUrl>https://git.crash.work/ShrinkSDK</RepositoryUrl>
|
||||||
|
<IncludeSymbols>true</IncludeSymbols>
|
||||||
|
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5d818c0b172f0114a85be0e1886f5b04
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
#nullable enable
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace ShrinkModFramework;
|
||||||
|
|
||||||
|
public sealed class ShrinkModContext
|
||||||
|
{
|
||||||
|
private readonly Dictionary<Type, object> _services = new();
|
||||||
|
public ShrinkModContext(string modDirectory) => ModDirectory = modDirectory ?? throw new ArgumentNullException(nameof(modDirectory));
|
||||||
|
public string ModDirectory { get; }
|
||||||
|
public void RegisterService<T>(T service) where T : class => _services[typeof(T)] = service ?? throw new ArgumentNullException(nameof(service));
|
||||||
|
public bool TryGetService<T>(out T? service) where T : class
|
||||||
|
{
|
||||||
|
service = _services.TryGetValue(typeof(T), out var value) ? value as T : null;
|
||||||
|
return service != null;
|
||||||
|
}
|
||||||
|
public T GetRequiredService<T>() where T : class => TryGetService<T>(out var value) ? value! : throw new InvalidOperationException($"Service is not registered: {typeof(T).FullName}");
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IShrinkModUnload
|
||||||
|
{
|
||||||
|
void OnUnload(ShrinkModContext context);
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netstandard2.1</TargetFramework>
|
||||||
|
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
||||||
|
<AssemblyName>ShrinkModFramework.Runtime</AssemblyName>
|
||||||
|
<RootNamespace>ShrinkModFramework</RootNamespace>
|
||||||
|
<PackageId>ShrinkSDK.ModFramework</PackageId>
|
||||||
|
<Version>0.3.0</Version>
|
||||||
|
<Description>Engine-neutral ShrinkSDK mod contracts and lifecycle.</Description>
|
||||||
|
<Nullable>disable</Nullable>
|
||||||
|
<ShrinkCodeGenEnabled>false</ShrinkCodeGenEnabled>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Runtime\ShrinkModContext.cs" />
|
||||||
|
<Compile Include="..\Runtime\Core\IShrinkMod.cs" />
|
||||||
|
<Compile Include="..\Runtime\Core\ShrinkModBase.cs" />
|
||||||
|
<Compile Include="..\Runtime\Core\ShrinkModHandle.cs" />
|
||||||
|
<Compile Include="..\Runtime\Metadata\*.cs" />
|
||||||
|
<PackageReference Include="ShrinkSDK.Runtime.Abstractions" Version="0.1.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace ShrinkModFramework.Editor
|
||||||
|
{
|
||||||
|
public static class ShrinkModFrameworkSettingsMenu
|
||||||
|
{
|
||||||
|
private const string SettingsDirectory =
|
||||||
|
"Assets/Resources/GameAssets/Runtime/Data/ShrinkSDK";
|
||||||
|
private const string SettingsAssetPath =
|
||||||
|
SettingsDirectory + "/ShrinkModFrameworkSettings.asset";
|
||||||
|
|
||||||
|
[MenuItem("ShrinkSDK/模组/创建设置")]
|
||||||
|
public static void CreateSettingsAsset()
|
||||||
|
{
|
||||||
|
EnsureFolder(SettingsDirectory);
|
||||||
|
|
||||||
|
var existing = AssetDatabase.LoadAssetAtPath<ShrinkModFrameworkSettings>(SettingsAssetPath);
|
||||||
|
if (existing != null)
|
||||||
|
{
|
||||||
|
Selection.activeObject = existing;
|
||||||
|
EditorGUIUtility.PingObject(existing);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var asset = ScriptableObject.CreateInstance<ShrinkModFrameworkSettings>();
|
||||||
|
AssetDatabase.CreateAsset(asset, SettingsAssetPath);
|
||||||
|
AssetDatabase.SaveAssets();
|
||||||
|
Selection.activeObject = asset;
|
||||||
|
EditorGUIUtility.PingObject(asset);
|
||||||
|
Debug.Log("[ShrinkModFramework] 已创建 ShrinkModFrameworkSettings.asset");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void EnsureFolder(string path)
|
||||||
|
{
|
||||||
|
var segments = path.Split('/');
|
||||||
|
var current = segments[0];
|
||||||
|
for (var i = 1; i < segments.Length; i++)
|
||||||
|
{
|
||||||
|
var next = current + "/" + segments[i];
|
||||||
|
if (!AssetDatabase.IsValidFolder(next))
|
||||||
|
AssetDatabase.CreateFolder(current, segments[i]);
|
||||||
|
current = next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 400ef5e3613144f9b9f248d259b84a22
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
#nullable enable
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.Loader;
|
||||||
|
|
||||||
|
namespace ShrinkModFramework.Godot;
|
||||||
|
|
||||||
|
public sealed class ShrinkGodotModLoader : IDisposable
|
||||||
|
{
|
||||||
|
private sealed record LoadedMod(AssemblyLoadContext LoadContext, WeakReference UnloadReference,
|
||||||
|
ShrinkModContext Context, IReadOnlyList<IShrinkMod> Instances);
|
||||||
|
private readonly Dictionary<string, LoadedMod> _loaded = new(StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
public IReadOnlyCollection<string> LoadedAssemblyPaths => _loaded.Keys;
|
||||||
|
|
||||||
|
public IReadOnlyList<IShrinkMod> Load(string assemblyPath)
|
||||||
|
{
|
||||||
|
assemblyPath = Path.GetFullPath(assemblyPath);
|
||||||
|
if (_loaded.ContainsKey(assemblyPath)) throw new InvalidOperationException($"Mod assembly is already loaded: {assemblyPath}");
|
||||||
|
var loadContext = new AssemblyLoadContext($"ShrinkMod:{Path.GetFileNameWithoutExtension(assemblyPath)}", true);
|
||||||
|
loadContext.Resolving += (_, name) => ResolveDependency(loadContext, Path.GetDirectoryName(assemblyPath)!, name);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var assembly = loadContext.LoadFromAssemblyPath(assemblyPath);
|
||||||
|
var entries = assembly.GetTypes().Where(type => !type.IsAbstract && typeof(IShrinkMod).IsAssignableFrom(type) &&
|
||||||
|
type.GetCustomAttribute<ShrinkModAttribute>() != null).OrderBy(type => type.GetCustomAttribute<ShrinkModAttribute>()!.LoadOrder).ToArray();
|
||||||
|
var context = new ShrinkModContext(Path.GetDirectoryName(assemblyPath)!);
|
||||||
|
var instances = entries.Select(type => (IShrinkMod)(Activator.CreateInstance(type) ??
|
||||||
|
throw new InvalidOperationException($"Failed to create mod entry: {type.FullName}"))).ToArray();
|
||||||
|
foreach (var mod in instances) mod.OnConstruct(context);
|
||||||
|
foreach (var mod in instances) mod.OnRegisterContent(context);
|
||||||
|
foreach (var mod in instances) mod.OnInitialize(context);
|
||||||
|
foreach (var mod in instances) mod.OnReady(context);
|
||||||
|
_loaded[assemblyPath] = new LoadedMod(loadContext, new WeakReference(loadContext), context, instances);
|
||||||
|
return instances;
|
||||||
|
}
|
||||||
|
catch { loadContext.Unload(); throw; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Unload(string assemblyPath)
|
||||||
|
{
|
||||||
|
assemblyPath = Path.GetFullPath(assemblyPath);
|
||||||
|
if (!_loaded.Remove(assemblyPath, out var loaded)) return false;
|
||||||
|
for (var index = loaded.Instances.Count - 1; index >= 0; index--)
|
||||||
|
if (loaded.Instances[index] is IShrinkModUnload unload) unload.OnUnload(loaded.Context);
|
||||||
|
loaded.LoadContext.Unload();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
foreach (var path in _loaded.Keys.ToArray()) Unload(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Assembly? ResolveDependency(AssemblyLoadContext context, string directory, AssemblyName name)
|
||||||
|
{
|
||||||
|
var shared = AssemblyLoadContext.Default.Assemblies.FirstOrDefault(assembly => assembly.GetName().Name == name.Name);
|
||||||
|
if (shared != null) return shared;
|
||||||
|
var path = Path.Combine(directory, name.Name + ".dll");
|
||||||
|
return File.Exists(path) ? context.LoadFromAssemblyPath(path) : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<AssemblyName>ShrinkModFramework.Godot</AssemblyName>
|
||||||
|
<RootNamespace>ShrinkModFramework.Godot</RootNamespace>
|
||||||
|
<PackageId>ShrinkSDK.ModFramework.Godot</PackageId>
|
||||||
|
<Version>0.1.0</Version>
|
||||||
|
<Description>Collectible AssemblyLoadContext host for ShrinkSDK mods in Godot.</Description>
|
||||||
|
<ShrinkCodeGenEnabled>false</ShrinkCodeGenEnabled>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\DotNet~\ShrinkSDK.ModFramework.csproj" />
|
||||||
|
<PackageReference Include="ShrinkSDK.Godot" Version="0.1.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<packageSources>
|
||||||
|
<clear />
|
||||||
|
<add key="ShrinkSDK" value="https://git.crash.work/api/packages/ShrinkSDK/nuget/index.json" />
|
||||||
|
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
||||||
|
</packageSources>
|
||||||
|
</configuration>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d2250189e7eded943a13c62da92db2d3
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
- first:
|
||||||
|
Windows Store Apps: WindowsStoreApps
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -1,13 +1,15 @@
|
|||||||
# ShrinkModFramework
|
# ShrinkModFramework
|
||||||
|
|
||||||
一个面向 Unity 的轻量模组框架,目标是给 `Shrink` 系列提供接近 Forge 的核心能力:
|
一个面向 Unity 与 Godot C# 的轻量模组框架,目标是给 `Shrink` 系列提供接近 Forge 的核心能力:
|
||||||
|
|
||||||
|
共享模组合同和加载规则位于 `DotNet~`,Godot `AssemblyLoadContext` 适配与打包工程位于 `Godot~`。Godot 项目安装 `ShrinkSDK.ModFramework.Godot`,会同时取得共享核心包。
|
||||||
|
|
||||||
- 模组声明
|
- 模组声明
|
||||||
- 模组发现
|
- 模组发现
|
||||||
- 依赖解析
|
- 依赖解析
|
||||||
- 生命周期阶段
|
- 生命周期阶段
|
||||||
- 内容注册表
|
- 内容注册表
|
||||||
- 自动启动
|
- 可选显式启动
|
||||||
- 外部 DLL 模组热加载
|
- 外部 DLL 模组热加载
|
||||||
- Harmony 热补丁接入
|
- Harmony 热补丁接入
|
||||||
- 网络同步通道
|
- 网络同步通道
|
||||||
@@ -31,17 +33,19 @@
|
|||||||
- 内置的资源包系统、命令系统、配方编辑器
|
- 内置的资源包系统、命令系统、配方编辑器
|
||||||
- 内置的具体联网实现
|
- 内置的具体联网实现
|
||||||
|
|
||||||
## 自动启动
|
## 启动
|
||||||
|
|
||||||
现在默认**不需要**把 `ShrinkModBootstrap` 挂到场景里。
|
安全默认值不会自动启动或扫描外部 DLL。需要装载工程内模组时,可以显式调用
|
||||||
|
`ShrinkModLoader.LoadAll(settings)`;需要外部代码模组时,调用方必须先完成自己的清单、
|
||||||
框架会通过:
|
启用状态和哈希校验,再提交精确白名单:
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)]
|
ShrinkModRuntimeBootstrap.InitializeDriver(settings);
|
||||||
|
ShrinkModLoader.LoadAuthorized(settings, authorizedDllPaths);
|
||||||
```
|
```
|
||||||
|
|
||||||
自动读取 `ShrinkModFrameworkSettings` 并调用装载流程。
|
只有显式打开 `autoLoadOnStartup` 时,`AfterAssembliesLoaded` 入口才会装载工程内模组;
|
||||||
|
该自动入口仍不加载任何未授权外部 DLL。
|
||||||
|
|
||||||
相关入口:
|
相关入口:
|
||||||
|
|
||||||
@@ -52,12 +56,14 @@
|
|||||||
|
|
||||||
## 配置文件
|
## 配置文件
|
||||||
|
|
||||||
创建 `ShrinkModFrameworkSettings` 资产后,框架会自动查找它。
|
菜单 `ShrinkSDK/模组/创建设置` 会在
|
||||||
|
`Assets/Resources/GameAssets/Runtime/Data/ShrinkSDK/ShrinkModFrameworkSettings.asset`
|
||||||
|
创建配置。运行时优先加载该路径,并保留旧根路径回退。
|
||||||
|
|
||||||
关键配置包括:
|
关键配置包括:
|
||||||
|
|
||||||
- `autoLoadOnStartup`
|
- `autoLoadOnStartup`
|
||||||
- 是否在启动时自动装载模组
|
- 是否在启动时自动装载工程内模组,默认关闭
|
||||||
- `useContextHost`
|
- `useContextHost`
|
||||||
- 默认开启:把模组四阶段放进 `ShrinkModContextHost`,替换失败恢复旧组件源;关闭后回退旧 Loader
|
- 默认开启:把模组四阶段放进 `ShrinkModContextHost`,替换失败恢复旧组件源;关闭后回退旧 Loader
|
||||||
- `verboseLogging`
|
- `verboseLogging`
|
||||||
@@ -65,11 +71,11 @@
|
|||||||
- `assemblyNamePrefixes`
|
- `assemblyNamePrefixes`
|
||||||
- 只扫描指定前缀的程序集
|
- 只扫描指定前缀的程序集
|
||||||
- `enableExternalDllMods`
|
- `enableExternalDllMods`
|
||||||
- 是否启用外部 DLL 模组
|
- 是否允许显式白名单中的外部 DLL 模组,默认关闭
|
||||||
- `externalModsFolderName`
|
- `externalModsFolderName`
|
||||||
- 外部模组目录名,默认 `Mods`
|
- 外部模组目录名,默认 `Mods`
|
||||||
- `watchExternalModsDirectory`
|
- `watchExternalModsDirectory`
|
||||||
- 是否自动监听目录变化并协调外部 DLL revision 变化
|
- 是否监听文件变化并重新提交既有白名单,默认关闭;监听不会扩大授权范围
|
||||||
- `externalModsReloadDelaySeconds`
|
- `externalModsReloadDelaySeconds`
|
||||||
- 文件变更后延迟多少秒再尝试热加载
|
- 文件变更后延迟多少秒再尝试热加载
|
||||||
- `externalAssemblyRevisionSoftLimit`
|
- `externalAssemblyRevisionSoftLimit`
|
||||||
@@ -182,13 +188,8 @@ public class DemoSafeMod : ShrinkModBase
|
|||||||
|
|
||||||
## 外部 DLL 模组热加载
|
## 外部 DLL 模组热加载
|
||||||
|
|
||||||
框架会扫描:
|
框架不会递归扫描模组目录。调用方必须把每个允许进入 AppDomain 的入口 DLL 绝对路径
|
||||||
|
作为白名单提交给 `LoadAuthorized`;目录中未列出的 DLL 不会被读取或加载。
|
||||||
`Application.persistentDataPath/<externalModsFolderName>`
|
|
||||||
|
|
||||||
默认就是:
|
|
||||||
|
|
||||||
`Application.persistentDataPath/Mods`
|
|
||||||
|
|
||||||
ContextLoader 装载规则:
|
ContextLoader 装载规则:
|
||||||
|
|
||||||
@@ -199,16 +200,19 @@ ContextLoader 装载规则:
|
|||||||
- 不支持 IL2CPP Player 动态程序集加载
|
- 不支持 IL2CPP Player 动态程序集加载
|
||||||
- 支持同目录依赖程序集解析
|
- 支持同目录依赖程序集解析
|
||||||
|
|
||||||
你可以在运行时调用:
|
首次安全加载:
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
ShrinkModLoader.LoadNewExternalMods();
|
ShrinkModRuntimeBootstrap.InitializeDriver(settings);
|
||||||
|
ShrinkModLoader.LoadAuthorized(settings, authorizedDllPaths);
|
||||||
```
|
```
|
||||||
|
|
||||||
默认会扫描当前 DLL revision,并把新增、替换、删除映射为一个完整期望组合;
|
后续可调用 `ShrinkModLoader.LoadNewExternalMods(settings)` 重新读取同一白名单的 revision,
|
||||||
变更事务失败时保留旧模组组合。设置 `useContextHost = false` 才回退为仅新增 DLL 的旧路径。
|
把新增、替换、删除映射为完整期望组合;变更事务失败时保留旧模组组合。设置
|
||||||
|
`useContextHost = false` 时,旧路径同样只读取显式白名单,但仍保持只增不减的兼容语义。
|
||||||
|
|
||||||
如果 `watchExternalModsDirectory = true`,框架还会监听新增、修改、删除、重命名事件,经过主线程 debouncer 后提交一次完整组合;同一 burst 内的中间坏文件不会覆盖当前有效 revision。
|
如果 `watchExternalModsDirectory = true`,框架会监听目录变化并在主线程 debouncer 后重新提交
|
||||||
|
既有白名单;未授权文件即使触发通知也不会被加载。同一 burst 内的中间坏文件不会覆盖当前有效 revision。
|
||||||
|
|
||||||
### 常驻 revision 诊断
|
### 常驻 revision 诊断
|
||||||
|
|
||||||
@@ -697,8 +701,8 @@ public sealed partial class DemoFullMod : ShrinkModBase
|
|||||||
|
|
||||||
现在这套框架已经从“只能在工程内静态发现模组”的骨架,升级成了:
|
现在这套框架已经从“只能在工程内静态发现模组”的骨架,升级成了:
|
||||||
|
|
||||||
- 自动启动
|
- 可显式托管启动
|
||||||
- 可增量接入外部 DLL
|
- 可按精确白名单增量接入外部 DLL
|
||||||
- 可选 Harmony 补丁
|
- 可选 Harmony 补丁
|
||||||
- 可扩展的网络同步框架
|
- 可扩展的网络同步框架
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace ShrinkModFramework
|
|||||||
[SerializeField] private ShrinkModFrameworkSettings settingsOverride;
|
[SerializeField] private ShrinkModFrameworkSettings settingsOverride;
|
||||||
|
|
||||||
[Header("Bootstrap")]
|
[Header("Bootstrap")]
|
||||||
[SerializeField] private bool autoLoadOnAwake = true;
|
[SerializeField] private bool autoLoadOnAwake;
|
||||||
|
|
||||||
private static bool _bootstrapped;
|
private static bool _bootstrapped;
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ namespace ShrinkModFramework
|
|||||||
[CreateAssetMenu(fileName = "ShrinkModFrameworkSettings", menuName = "ShrinkSDK/模组/模组设置")]
|
[CreateAssetMenu(fileName = "ShrinkModFrameworkSettings", menuName = "ShrinkSDK/模组/模组设置")]
|
||||||
public class ShrinkModFrameworkSettings : ScriptableObject
|
public class ShrinkModFrameworkSettings : ScriptableObject
|
||||||
{
|
{
|
||||||
|
public const string PreferredResourcesPath =
|
||||||
|
"GameAssets/Runtime/Data/ShrinkSDK/ShrinkModFrameworkSettings";
|
||||||
|
public const string LegacyResourcesPath = "ShrinkModFrameworkSettings";
|
||||||
|
|
||||||
private static ShrinkModFrameworkSettings _instance;
|
private static ShrinkModFrameworkSettings _instance;
|
||||||
|
|
||||||
public static ShrinkModFrameworkSettings Instance
|
public static ShrinkModFrameworkSettings Instance
|
||||||
@@ -13,7 +17,9 @@ namespace ShrinkModFramework
|
|||||||
{
|
{
|
||||||
if (_instance) return _instance;
|
if (_instance) return _instance;
|
||||||
|
|
||||||
_instance = Resources.Load<ShrinkModFrameworkSettings>("ShrinkModFrameworkSettings");
|
_instance = Resources.Load<ShrinkModFrameworkSettings>(PreferredResourcesPath);
|
||||||
|
if (!_instance)
|
||||||
|
_instance = Resources.Load<ShrinkModFrameworkSettings>(LegacyResourcesPath);
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (!_instance)
|
if (!_instance)
|
||||||
@@ -39,8 +45,13 @@ namespace ShrinkModFramework
|
|||||||
internal set => _instance = value;
|
internal set => _instance = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static void ResetCachedInstance()
|
||||||
|
{
|
||||||
|
_instance = null;
|
||||||
|
}
|
||||||
|
|
||||||
[Header("Bootstrap")]
|
[Header("Bootstrap")]
|
||||||
public bool autoLoadOnStartup = true;
|
public bool autoLoadOnStartup;
|
||||||
[Tooltip("使用 ShrinkContextHost 协调模组组件;关闭时回退到旧的只增不减 ShrinkModLoader。")]
|
[Tooltip("使用 ShrinkContextHost 协调模组组件;关闭时回退到旧的只增不减 ShrinkModLoader。")]
|
||||||
public bool useContextHost = true;
|
public bool useContextHost = true;
|
||||||
|
|
||||||
@@ -51,10 +62,10 @@ namespace ShrinkModFramework
|
|||||||
public string[] assemblyNamePrefixes = new string[0];
|
public string[] assemblyNamePrefixes = new string[0];
|
||||||
|
|
||||||
[Header("External Mods")]
|
[Header("External Mods")]
|
||||||
public bool enableExternalDllMods = true;
|
public bool enableExternalDllMods;
|
||||||
public bool autoCreateExternalModsDirectory = true;
|
public bool autoCreateExternalModsDirectory = true;
|
||||||
public string externalModsFolderName = "Mods";
|
public string externalModsFolderName = "Mods";
|
||||||
public bool watchExternalModsDirectory = true;
|
public bool watchExternalModsDirectory;
|
||||||
public float externalModsReloadDelaySeconds = 0.5f;
|
public float externalModsReloadDelaySeconds = 0.5f;
|
||||||
[Min(1)]
|
[Min(1)]
|
||||||
[Tooltip("Mono 下外部程序集 revision 会常驻;历史数量达到该软阈值后提示 Domain Reload/重启。")]
|
[Tooltip("Mono 下外部程序集 revision 会常驻;历史数量达到该软阈值后提示 Domain Reload/重启。")]
|
||||||
|
|||||||
@@ -4,6 +4,15 @@ namespace ShrinkModFramework
|
|||||||
{
|
{
|
||||||
public static class ShrinkModRuntimeBootstrap
|
public static class ShrinkModRuntimeBootstrap
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 显式创建或更新模组运行时驱动。安全启动链可先调用此入口,再调用
|
||||||
|
/// ShrinkModLoader.LoadAuthorized 提交已校验的 DLL 白名单。
|
||||||
|
/// </summary>
|
||||||
|
public static void InitializeDriver(ShrinkModFrameworkSettings settings = null)
|
||||||
|
{
|
||||||
|
ShrinkModRuntimeDriver.EnsureCreated(settings ?? ShrinkModFrameworkSettings.Instance);
|
||||||
|
}
|
||||||
|
|
||||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
|
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
|
||||||
private static void ResetStaticStateForPlayMode()
|
private static void ResetStaticStateForPlayMode()
|
||||||
{
|
{
|
||||||
@@ -15,11 +24,11 @@ namespace ShrinkModFramework
|
|||||||
private static void AutoLoad()
|
private static void AutoLoad()
|
||||||
{
|
{
|
||||||
var settings = ShrinkModFrameworkSettings.Instance;
|
var settings = ShrinkModFrameworkSettings.Instance;
|
||||||
ShrinkModRuntimeDriver.EnsureCreated(settings);
|
|
||||||
|
|
||||||
if (settings && !settings.autoLoadOnStartup)
|
if (settings && !settings.autoLoadOnStartup)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
InitializeDriver(settings);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ShrinkModLoader.LoadAll(settings);
|
ShrinkModLoader.LoadAll(settings);
|
||||||
|
|||||||
@@ -12,10 +12,13 @@ namespace ShrinkModFramework
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
internal static class ShrinkModComponentDiscovery
|
internal static class ShrinkModComponentDiscovery
|
||||||
{
|
{
|
||||||
public static IReadOnlyList<ShrinkModComponentSource> Discover(ShrinkModFrameworkSettings settings,
|
public static IReadOnlyList<ShrinkModComponentSource> Discover(
|
||||||
bool verboseLogging)
|
ShrinkModFrameworkSettings settings,
|
||||||
|
bool verboseLogging,
|
||||||
|
IEnumerable<string> authorizedDllPaths)
|
||||||
{
|
{
|
||||||
ShrinkExternalModAssemblyLoader.ScanExternalAssemblyRevisions(settings, verboseLogging);
|
ShrinkExternalModAssemblyLoader.ScanExternalAssemblyRevisions(
|
||||||
|
settings, verboseLogging, authorizedDllPaths);
|
||||||
var results = new List<ShrinkModComponentSource>();
|
var results = new List<ShrinkModComponentSource>();
|
||||||
var prefixes = settings?.assemblyNamePrefixes;
|
var prefixes = settings?.assemblyNamePrefixes;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using Cysharp.Threading.Tasks;
|
using Cysharp.Threading.Tasks;
|
||||||
|
|
||||||
namespace ShrinkModFramework
|
namespace ShrinkModFramework
|
||||||
@@ -19,7 +20,8 @@ namespace ShrinkModFramework
|
|||||||
new Dictionary<string, ShrinkModHandle>();
|
new Dictionary<string, ShrinkModHandle>();
|
||||||
|
|
||||||
public static async UniTask<IReadOnlyDictionary<string, ShrinkModHandle>> ApplyDiscoveredAsync(
|
public static async UniTask<IReadOnlyDictionary<string, ShrinkModHandle>> ApplyDiscoveredAsync(
|
||||||
ShrinkModFrameworkSettings settings = null)
|
ShrinkModFrameworkSettings settings = null,
|
||||||
|
IEnumerable<string> authorizedDllPaths = null)
|
||||||
{
|
{
|
||||||
settings ??= ShrinkModFrameworkSettings.Instance;
|
settings ??= ShrinkModFrameworkSettings.Instance;
|
||||||
var verboseLogging = settings == null || settings.verboseLogging;
|
var verboseLogging = settings == null || settings.verboseLogging;
|
||||||
@@ -34,7 +36,9 @@ namespace ShrinkModFramework
|
|||||||
ShrinkModNetworkManager.Configure(settings == null || settings.enableNetworkSync, verboseLogging);
|
ShrinkModNetworkManager.Configure(settings == null || settings.enableNetworkSync, verboseLogging);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var sources = ShrinkModComponentDiscovery.Discover(settings, verboseLogging);
|
var authorizedPaths = authorizedDllPaths?.ToArray() ?? Array.Empty<string>();
|
||||||
|
var sources = ShrinkModComponentDiscovery.Discover(
|
||||||
|
settings, verboseLogging, authorizedPaths);
|
||||||
await _host.ApplyAsync(sources);
|
await _host.ApplyAsync(sources);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|||||||
@@ -34,17 +34,22 @@ namespace ShrinkModFramework
|
|||||||
private static bool _resolveRegistered;
|
private static bool _resolveRegistered;
|
||||||
private static int _lastWarnedResidentCount;
|
private static int _lastWarnedResidentCount;
|
||||||
|
|
||||||
public static IReadOnlyList<Assembly> LoadExternalAssemblies(ShrinkModFrameworkSettings settings, bool verboseLogging)
|
public static IReadOnlyList<Assembly> LoadExternalAssemblies(
|
||||||
|
ShrinkModFrameworkSettings settings,
|
||||||
|
bool verboseLogging,
|
||||||
|
IEnumerable<string> authorizedDllPaths = null)
|
||||||
{
|
{
|
||||||
return ScanExternalAssemblyRevisions(settings, verboseLogging)
|
return ScanExternalAssemblyRevisions(settings, verboseLogging, authorizedDllPaths)
|
||||||
.Select(revision => revision.Assembly)
|
.Select(revision => revision.Assembly)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static IReadOnlyList<ExternalAssemblyRevision> ScanExternalAssemblyRevisions(
|
internal static IReadOnlyList<ExternalAssemblyRevision> ScanExternalAssemblyRevisions(
|
||||||
ShrinkModFrameworkSettings settings, bool verboseLogging)
|
ShrinkModFrameworkSettings settings,
|
||||||
|
bool verboseLogging,
|
||||||
|
IEnumerable<string> authorizedDllPaths = null)
|
||||||
{
|
{
|
||||||
if (settings != null && !settings.enableExternalDllMods)
|
if (settings == null || !settings.enableExternalDllMods)
|
||||||
{
|
{
|
||||||
CurrentAssemblyRevisions.Clear();
|
CurrentAssemblyRevisions.Clear();
|
||||||
KnownAssemblyFiles.Clear();
|
KnownAssemblyFiles.Clear();
|
||||||
@@ -52,27 +57,23 @@ namespace ShrinkModFramework
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_IL2CPP && !UNITY_EDITOR
|
#if ENABLE_IL2CPP && !UNITY_EDITOR
|
||||||
Debug.LogWarning("[ShrinkModFramework] IL2CPP 运行时不支持外部 DLL 热加载,已跳过外部模组扫描。");
|
Debug.LogWarning("[ShrinkModFramework] IL2CPP 运行时不支持外部 DLL 加载,已跳过授权模组。");
|
||||||
return Array.Empty<ExternalAssemblyRevision>();
|
return Array.Empty<ExternalAssemblyRevision>();
|
||||||
#else
|
#else
|
||||||
var modsDirectory = GetExternalModsDirectory(settings);
|
|
||||||
if (settings == null || settings.autoCreateExternalModsDirectory)
|
|
||||||
Directory.CreateDirectory(modsDirectory);
|
|
||||||
|
|
||||||
RegisterAssemblyResolve();
|
RegisterAssemblyResolve();
|
||||||
|
|
||||||
var dllPaths = Directory.GetFiles(modsDirectory, "*.dll", SearchOption.AllDirectories)
|
var dllPaths = NormalizeAuthorizedPaths(authorizedDllPaths);
|
||||||
.Select(Path.GetFullPath)
|
var presentPaths = new HashSet<string>(
|
||||||
.OrderBy(path => path, StringComparer.OrdinalIgnoreCase)
|
dllPaths.Where(File.Exists),
|
||||||
.ToArray();
|
StringComparer.OrdinalIgnoreCase);
|
||||||
var presentPaths = new HashSet<string>(dllPaths, StringComparer.OrdinalIgnoreCase);
|
|
||||||
|
|
||||||
foreach (var dllPath in dllPaths
|
KnownAssemblyFiles.Clear();
|
||||||
|
foreach (var dllPath in presentPaths)
|
||||||
|
KnownAssemblyFiles[Path.GetFileNameWithoutExtension(dllPath)] = dllPath;
|
||||||
|
|
||||||
|
foreach (var dllPath in presentPaths
|
||||||
.OrderBy(path => path, StringComparer.OrdinalIgnoreCase))
|
.OrderBy(path => path, StringComparer.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var assemblyName = Path.GetFileNameWithoutExtension(dllPath);
|
|
||||||
KnownAssemblyFiles[assemblyName] = dllPath;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var bytes = File.ReadAllBytes(dllPath);
|
var bytes = File.ReadAllBytes(dllPath);
|
||||||
@@ -131,6 +132,41 @@ namespace ShrinkModFramework
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string[] NormalizeAuthorizedPaths(IEnumerable<string> authorizedDllPaths)
|
||||||
|
{
|
||||||
|
if (authorizedDllPaths == null)
|
||||||
|
return Array.Empty<string>();
|
||||||
|
|
||||||
|
var normalized = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
foreach (var rawPath in authorizedDllPaths)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(rawPath))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
string fullPath;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
fullPath = Path.GetFullPath(rawPath.Trim());
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
throw new ArgumentException($"授权 DLL 路径无效:{rawPath}",
|
||||||
|
nameof(authorizedDllPaths), exception);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.Equals(Path.GetExtension(fullPath), ".dll",
|
||||||
|
StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
throw new ArgumentException($"授权路径不是 DLL:{fullPath}",
|
||||||
|
nameof(authorizedDllPaths));
|
||||||
|
}
|
||||||
|
|
||||||
|
normalized.Add(fullPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
return normalized.OrderBy(path => path, StringComparer.OrdinalIgnoreCase).ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
internal static bool IsExternalAssembly(Assembly assembly) =>
|
internal static bool IsExternalAssembly(Assembly assembly) =>
|
||||||
assembly != null && ExternalAssemblyHistory.ContainsKey(assembly);
|
assembly != null && ExternalAssemblyHistory.ContainsKey(assembly);
|
||||||
|
|
||||||
@@ -268,13 +304,38 @@ namespace ShrinkModFramework
|
|||||||
if (!KnownAssemblyFiles.TryGetValue(requestedName, out var path) || !File.Exists(path))
|
if (!KnownAssemblyFiles.TryGetValue(requestedName, out var path) || !File.Exists(path))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
try
|
lock (ResolveLock)
|
||||||
{
|
{
|
||||||
return Assembly.Load(File.ReadAllBytes(path));
|
try
|
||||||
}
|
{
|
||||||
catch
|
var bytes = File.ReadAllBytes(path);
|
||||||
{
|
var revision = ComputeSha256(bytes);
|
||||||
return null;
|
if (CurrentAssemblyRevisions.TryGetValue(path, out var current) &&
|
||||||
|
string.Equals(current.Revision, revision, StringComparison.Ordinal))
|
||||||
|
{
|
||||||
|
return current.Assembly;
|
||||||
|
}
|
||||||
|
|
||||||
|
var pdbPath = Path.ChangeExtension(path, ".pdb");
|
||||||
|
var pdbBytes = File.Exists(pdbPath) ? File.ReadAllBytes(pdbPath) : null;
|
||||||
|
var assembly = pdbBytes != null
|
||||||
|
? Assembly.Load(bytes, pdbBytes)
|
||||||
|
: Assembly.Load(bytes);
|
||||||
|
var loadedRevision = new ExternalAssemblyRevision
|
||||||
|
{
|
||||||
|
Path = path,
|
||||||
|
Revision = revision,
|
||||||
|
Assembly = assembly,
|
||||||
|
LoadedBytes = bytes.LongLength + (pdbBytes?.LongLength ?? 0L)
|
||||||
|
};
|
||||||
|
CurrentAssemblyRevisions[path] = loadedRevision;
|
||||||
|
ExternalAssemblyHistory[assembly] = loadedRevision;
|
||||||
|
return assembly;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ namespace ShrinkModFramework
|
|||||||
private static readonly Dictionary<string, ShrinkModHandle> LoadedMods = new(StringComparer.Ordinal);
|
private static readonly Dictionary<string, ShrinkModHandle> LoadedMods = new(StringComparer.Ordinal);
|
||||||
private static readonly List<ShrinkModHandle> LoadSequence = new();
|
private static readonly List<ShrinkModHandle> LoadSequence = new();
|
||||||
private static readonly ShrinkModRegistryManager RegistryManager = new();
|
private static readonly ShrinkModRegistryManager RegistryManager = new();
|
||||||
|
private static string[] _authorizedDllPaths = Array.Empty<string>();
|
||||||
|
|
||||||
public static bool IsLoaded { get; private set; }
|
public static bool IsLoaded { get; private set; }
|
||||||
public static IReadOnlyDictionary<string, ShrinkModHandle> Mods =>
|
public static IReadOnlyDictionary<string, ShrinkModHandle> Mods =>
|
||||||
@@ -27,8 +28,35 @@ namespace ShrinkModFramework
|
|||||||
public static event Action<IReadOnlyDictionary<string, ShrinkModHandle>> OnAllModsReady;
|
public static event Action<IReadOnlyDictionary<string, ShrinkModHandle>> OnAllModsReady;
|
||||||
|
|
||||||
public static IReadOnlyDictionary<string, ShrinkModHandle> LoadAll(ShrinkModFrameworkSettings settings = null)
|
public static IReadOnlyDictionary<string, ShrinkModHandle> LoadAll(ShrinkModFrameworkSettings settings = null)
|
||||||
|
=> LoadInternal(settings, Array.Empty<string>());
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 加载工程内模组,并且只加载调用方显式授权的外部 DLL 路径。
|
||||||
|
/// 路径集合是完整白名单,不会递归扫描模组目录;后续 revision 刷新也只复用该白名单。
|
||||||
|
/// </summary>
|
||||||
|
public static IReadOnlyDictionary<string, ShrinkModHandle> LoadAuthorized(
|
||||||
|
ShrinkModFrameworkSettings settings,
|
||||||
|
IEnumerable<string> authorizedDllPaths)
|
||||||
|
{
|
||||||
|
if (authorizedDllPaths == null)
|
||||||
|
throw new ArgumentNullException(nameof(authorizedDllPaths));
|
||||||
|
|
||||||
|
return LoadInternal(settings, authorizedDllPaths);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static IReadOnlyDictionary<string, ShrinkModHandle> LoadInternal(
|
||||||
|
ShrinkModFrameworkSettings settings,
|
||||||
|
IEnumerable<string> authorizedDllPaths)
|
||||||
{
|
{
|
||||||
settings ??= ShrinkModFrameworkSettings.Instance;
|
settings ??= ShrinkModFrameworkSettings.Instance;
|
||||||
|
_authorizedDllPaths = authorizedDllPaths
|
||||||
|
.Where(path => !string.IsNullOrWhiteSpace(path))
|
||||||
|
.Select(path => path.Trim())
|
||||||
|
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
|
if (settings == null || settings.useContextHost)
|
||||||
|
return ApplyContextComposition(settings, _authorizedDllPaths);
|
||||||
|
|
||||||
if (IsLoaded)
|
if (IsLoaded)
|
||||||
{
|
{
|
||||||
@@ -36,15 +64,13 @@ namespace ShrinkModFramework
|
|||||||
return Mods;
|
return Mods;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings == null || settings.useContextHost)
|
|
||||||
return ApplyContextComposition(settings);
|
|
||||||
|
|
||||||
var verboseLogging = settings == null || settings.verboseLogging;
|
var verboseLogging = settings == null || settings.verboseLogging;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ShrinkModNetworkManager.Configure(settings == null || settings.enableNetworkSync, verboseLogging);
|
ShrinkModNetworkManager.Configure(settings == null || settings.enableNetworkSync, verboseLogging);
|
||||||
ShrinkExternalModAssemblyLoader.LoadExternalAssemblies(settings, verboseLogging);
|
ShrinkExternalModAssemblyLoader.LoadExternalAssemblies(
|
||||||
|
settings, verboseLogging, _authorizedDllPaths);
|
||||||
|
|
||||||
var discovered = DiscoverMods(settings);
|
var discovered = DiscoverMods(settings);
|
||||||
var ordered = ResolveLoadOrder(discovered, allowExistingLoadedDependencies: true);
|
var ordered = ResolveLoadOrder(discovered, allowExistingLoadedDependencies: true);
|
||||||
@@ -73,12 +99,13 @@ namespace ShrinkModFramework
|
|||||||
{
|
{
|
||||||
settings ??= ShrinkModFrameworkSettings.Instance;
|
settings ??= ShrinkModFrameworkSettings.Instance;
|
||||||
if (settings == null || settings.useContextHost)
|
if (settings == null || settings.useContextHost)
|
||||||
return ApplyContextComposition(settings);
|
return ApplyContextComposition(settings, _authorizedDllPaths);
|
||||||
if (!IsLoaded)
|
if (!IsLoaded)
|
||||||
return LoadAll(settings);
|
return LoadInternal(settings, _authorizedDllPaths);
|
||||||
|
|
||||||
var verboseLogging = settings == null || settings.verboseLogging;
|
var verboseLogging = settings == null || settings.verboseLogging;
|
||||||
ShrinkExternalModAssemblyLoader.LoadExternalAssemblies(settings, verboseLogging);
|
ShrinkExternalModAssemblyLoader.LoadExternalAssemblies(
|
||||||
|
settings, verboseLogging, _authorizedDllPaths);
|
||||||
|
|
||||||
var discovered = DiscoverMods(settings)
|
var discovered = DiscoverMods(settings)
|
||||||
.Where(mod => !LoadedMods.ContainsKey(mod.Info.ModId))
|
.Where(mod => !LoadedMods.ContainsKey(mod.Info.ModId))
|
||||||
@@ -145,6 +172,7 @@ namespace ShrinkModFramework
|
|||||||
ShrinkModNetworkManager.ResetForDomainReload();
|
ShrinkModNetworkManager.ResetForDomainReload();
|
||||||
ShrinkExternalModAssemblyLoader.ResetForTesting();
|
ShrinkExternalModAssemblyLoader.ResetForTesting();
|
||||||
ShrinkHarmonyPatchService.ResetForTesting();
|
ShrinkHarmonyPatchService.ResetForTesting();
|
||||||
|
_authorizedDllPaths = Array.Empty<string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void ResetForDomainReload()
|
internal static void ResetForDomainReload()
|
||||||
@@ -160,17 +188,22 @@ namespace ShrinkModFramework
|
|||||||
ShrinkModNetworkManager.ResetForDomainReload();
|
ShrinkModNetworkManager.ResetForDomainReload();
|
||||||
ShrinkExternalModAssemblyLoader.ResetForDomainReload();
|
ShrinkExternalModAssemblyLoader.ResetForDomainReload();
|
||||||
ShrinkHarmonyPatchService.ResetForTesting();
|
ShrinkHarmonyPatchService.ResetForTesting();
|
||||||
|
_authorizedDllPaths = Array.Empty<string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IReadOnlyDictionary<string, ShrinkModHandle> ApplyContextComposition(
|
private static IReadOnlyDictionary<string, ShrinkModHandle> ApplyContextComposition(
|
||||||
ShrinkModFrameworkSettings settings)
|
ShrinkModFrameworkSettings settings,
|
||||||
|
IEnumerable<string> authorizedDllPaths)
|
||||||
{
|
{
|
||||||
var previousGenerations = Mods.ToDictionary(
|
var previousGenerations = Mods.ToDictionary(
|
||||||
pair => pair.Key,
|
pair => pair.Key,
|
||||||
pair => pair.Value.Generation,
|
pair => pair.Value.Generation,
|
||||||
StringComparer.Ordinal);
|
StringComparer.Ordinal);
|
||||||
|
|
||||||
var result = ShrinkModCordisRuntime.ApplyDiscoveredAsync(settings).GetAwaiter().GetResult();
|
var result = ShrinkModCordisRuntime
|
||||||
|
.ApplyDiscoveredAsync(settings, authorizedDllPaths)
|
||||||
|
.GetAwaiter()
|
||||||
|
.GetResult();
|
||||||
IsLoaded = true;
|
IsLoaded = true;
|
||||||
foreach (var pair in result.OrderBy(pair => pair.Key, StringComparer.Ordinal))
|
foreach (var pair in result.OrderBy(pair => pair.Key, StringComparer.Ordinal))
|
||||||
{
|
{
|
||||||
@@ -206,6 +239,11 @@ namespace ShrinkModFramework
|
|||||||
|
|
||||||
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
|
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
|
||||||
{
|
{
|
||||||
|
if (ShrinkExternalModAssemblyLoader.IsExternalAssembly(assembly) &&
|
||||||
|
!ShrinkExternalModAssemblyLoader.TryGetCurrentRevision(assembly, out _))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!ShouldScanAssembly(assembly, prefixes))
|
if (!ShouldScanAssembly(assembly, prefixes))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
@@ -286,7 +286,23 @@ namespace ShrinkModFramework.Tests
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void ExternalDllRevision_FailedReplacementRestoresPreviousAndBrokenBytesDoNotReplaceIt()
|
public void Settings_Defaults_DoNotAutoLoadOrWatchExternalDlls()
|
||||||
|
{
|
||||||
|
var settings = ScriptableObject.CreateInstance<ShrinkModFrameworkSettings>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Assert.IsFalse(settings.autoLoadOnStartup);
|
||||||
|
Assert.IsFalse(settings.enableExternalDllMods);
|
||||||
|
Assert.IsFalse(settings.watchExternalModsDirectory);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Object.DestroyImmediate(settings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ExternalDll_IsIgnoredUntilItsExactPathIsAuthorized()
|
||||||
{
|
{
|
||||||
ResetExternalRuntime();
|
ResetExternalRuntime();
|
||||||
var settings = CreateExternalSettings();
|
var settings = CreateExternalSettings();
|
||||||
@@ -299,6 +315,62 @@ namespace ShrinkModFramework.Tests
|
|||||||
CopyFixture("ExternalFixture.Mod.V1.dll.bytes", target);
|
CopyFixture("ExternalFixture.Mod.V1.dll.bytes", target);
|
||||||
|
|
||||||
ShrinkModLoader.LoadAll(settings);
|
ShrinkModLoader.LoadAll(settings);
|
||||||
|
|
||||||
|
Assert.IsEmpty(ShrinkModLoader.Mods);
|
||||||
|
Assert.AreEqual(0,
|
||||||
|
ShrinkModDiagnostics.CaptureExternalAssemblies(settings).CurrentRevisionCount);
|
||||||
|
|
||||||
|
ShrinkModLoader.LoadAuthorized(settings, new[] { target });
|
||||||
|
AssertExternalFixture("1.0.0", "v1");
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
CleanupExternalRuntime(settings, directory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void LegacyLoader_OnlyLoadsExplicitlyAuthorizedDllPaths()
|
||||||
|
{
|
||||||
|
ResetExternalRuntime();
|
||||||
|
var settings = CreateExternalSettings();
|
||||||
|
settings.useContextHost = false;
|
||||||
|
var directory = ShrinkExternalModAssemblyLoader.GetExternalModsDirectory(settings);
|
||||||
|
var authorized = Path.Combine(directory, "Authorized.Mod.dll");
|
||||||
|
var unauthorized = Path.Combine(directory, "Unauthorized.Mod.dll");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(directory);
|
||||||
|
CopyFixture("ExternalFixture.Mod.V1.dll.bytes", authorized);
|
||||||
|
CopyFixture("ExternalFixture.Mod.V3.dll.bytes", unauthorized);
|
||||||
|
|
||||||
|
ShrinkModLoader.LoadAuthorized(settings, new[] { authorized });
|
||||||
|
|
||||||
|
AssertExternalFixture("1.0.0", "v1");
|
||||||
|
Assert.AreEqual(1,
|
||||||
|
ShrinkModDiagnostics.CaptureExternalAssemblies(settings).CurrentRevisionCount);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
CleanupExternalRuntime(settings, directory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ExternalDllRevision_FailedReplacementRestoresPreviousAndBrokenBytesDoNotReplaceIt()
|
||||||
|
{
|
||||||
|
ResetExternalRuntime();
|
||||||
|
var settings = CreateExternalSettings();
|
||||||
|
var directory = ShrinkExternalModAssemblyLoader.GetExternalModsDirectory(settings);
|
||||||
|
var target = Path.Combine(directory, "ExternalFixture.Mod.dll");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(directory);
|
||||||
|
CopyFixture("ExternalFixture.Mod.V1.dll.bytes", target);
|
||||||
|
|
||||||
|
ShrinkModLoader.LoadAuthorized(settings, new[] { target });
|
||||||
AssertExternalFixture("1.0.0", "v1");
|
AssertExternalFixture("1.0.0", "v1");
|
||||||
var restoredGeneration = ShrinkModLoader.Mods["external.fixture"].Generation;
|
var restoredGeneration = ShrinkModLoader.Mods["external.fixture"].Generation;
|
||||||
|
|
||||||
@@ -358,7 +430,7 @@ namespace ShrinkModFramework.Tests
|
|||||||
Assert.IsTrue(ShrinkModRuntimeDriver.InstanceForTesting!.HasWatcherForTesting);
|
Assert.IsTrue(ShrinkModRuntimeDriver.InstanceForTesting!.HasWatcherForTesting);
|
||||||
|
|
||||||
CopyFixture("ExternalFixture.Mod.V1.dll.bytes", target);
|
CopyFixture("ExternalFixture.Mod.V1.dll.bytes", target);
|
||||||
ShrinkModLoader.LoadAll(settings);
|
ShrinkModLoader.LoadAuthorized(settings, new[] { target });
|
||||||
AssertExternalFixture("1.0.0", "v1");
|
AssertExternalFixture("1.0.0", "v1");
|
||||||
|
|
||||||
// Two writes arrive as one debounce window; only the final valid revision should commit.
|
// Two writes arrive as one debounce window; only the final valid revision should commit.
|
||||||
@@ -395,7 +467,7 @@ namespace ShrinkModFramework.Tests
|
|||||||
CopyFixture("ExternalFixture.Provider.dll.bytes", providerPath);
|
CopyFixture("ExternalFixture.Provider.dll.bytes", providerPath);
|
||||||
CopyFixture("ExternalFixture.Consumer.dll.bytes", consumerPath);
|
CopyFixture("ExternalFixture.Consumer.dll.bytes", consumerPath);
|
||||||
|
|
||||||
ShrinkModLoader.LoadAll(settings);
|
ShrinkModLoader.LoadAuthorized(settings, new[] { providerPath, consumerPath });
|
||||||
Assert.AreEqual(2, ShrinkModLoader.Mods.Count);
|
Assert.AreEqual(2, ShrinkModLoader.Mods.Count);
|
||||||
Assert.AreEqual(ShrinkModState.Ready, ShrinkModLoader.Mods["external.provider"].State);
|
Assert.AreEqual(ShrinkModState.Ready, ShrinkModLoader.Mods["external.provider"].State);
|
||||||
Assert.AreEqual(ShrinkModState.Ready, ShrinkModLoader.Mods["external.consumer"].State);
|
Assert.AreEqual(ShrinkModState.Ready, ShrinkModLoader.Mods["external.consumer"].State);
|
||||||
@@ -475,6 +547,7 @@ namespace ShrinkModFramework.Tests
|
|||||||
settings.useContextHost = true;
|
settings.useContextHost = true;
|
||||||
settings.enableExternalDllMods = true;
|
settings.enableExternalDllMods = true;
|
||||||
settings.autoCreateExternalModsDirectory = false;
|
settings.autoCreateExternalModsDirectory = false;
|
||||||
|
settings.watchExternalModsDirectory = true;
|
||||||
settings.externalModsFolderName = "ShrinkModFrameworkTests_" + Guid.NewGuid().ToString("N");
|
settings.externalModsFolderName = "ShrinkModFrameworkTests_" + Guid.NewGuid().ToString("N");
|
||||||
settings.assemblyNamePrefixes = new[] { "ExternalFixture." };
|
settings.assemblyNamePrefixes = new[] { "ExternalFixture." };
|
||||||
settings.enableHarmonyPatching = false;
|
settings.enableHarmonyPatching = false;
|
||||||
|
|||||||
+3
-3
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "com.cneicy.shrink-mod-framework",
|
"name": "com.cneicy.shrink-mod-framework",
|
||||||
"version": "0.2.2",
|
"version": "0.3.0",
|
||||||
"displayName": "ShrinkModFramework",
|
"displayName": "ShrinkModFramework",
|
||||||
"description": "Unity 模组框架,提供发现、依赖、可逆生命周期、命名空间内容注册与优先级覆盖。",
|
"description": "Unity 模组框架,提供发现、依赖、可逆生命周期、命名空间内容注册与优先级覆盖。",
|
||||||
"unity": "2022.3",
|
"unity": "2022.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.nuget.newtonsoft-json": "3.2.2",
|
"com.unity.nuget.newtonsoft-json": "3.2.2",
|
||||||
"com.cneicy.shrink-context-core": "0.1.0",
|
"com.cneicy.shrink-context-core": "0.2.0",
|
||||||
"com.cneicy.shrink-eventbus": "2.0.0",
|
"com.cneicy.shrink-eventbus": "2.1.0",
|
||||||
"com.cysharp.unitask": "2.5.10"
|
"com.cysharp.unitask": "2.5.10"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
Reference in New Issue
Block a user