SHA256
Add Obfuscar
This commit is contained in:
3 files changed
+80
-5
No files matched your search
+17
-1
@@ -95,7 +95,23 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FFmpeg.AutoGen" Version="8.1.0" />
|
||||
<Content Include="obfuscar.xml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FFmpeg.AutoGen" Version="8.1.0" />
|
||||
<PackageReference Include="Obfuscar" Version="2.2.49">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
<GeneratePathProperty>true</GeneratePathProperty>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="Obfuscate" AfterTargets="AfterBuild" Condition="'$(Configuration)'=='Release'">
|
||||
<Exec Command=""$(Obfuscar)" obfuscar.xml" EnvironmentVariables="ADOFAI_PATH=$(ADOFAI_PATH)" />
|
||||
<Copy SourceFiles="$(TargetDir)obfuscated\$(TargetName).dll" DestinationFolder="$(TargetDir)" OverwriteReadOnlyFiles="true" />
|
||||
<Copy SourceFiles="$(TargetDir)obfuscated\$(TargetName).pdb" DestinationFolder="$(TargetDir)" OverwriteReadOnlyFiles="true" Condition="Exists('$(TargetDir)obfuscated\$(TargetName).pdb')" />
|
||||
<Message Text="Obfuscating project and replacing original binaries..." Importance="high" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
+22
-4
@@ -2,6 +2,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
@@ -25,7 +26,6 @@ namespace ADOFAIRenderer.UI
|
||||
private string DownloadUrl => Application.platform switch
|
||||
{
|
||||
RuntimePlatform.WindowsPlayer => "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl-shared.zip",
|
||||
RuntimePlatform.OSXPlayer => "https://github.com/ColorsWind/FFmpeg-macOS/releases/download/n5.0.1-patch3/FFmpeg-shared-n5.0.1-OSX-universal.zip",
|
||||
_ => "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl-shared.tar.xz"
|
||||
};
|
||||
|
||||
@@ -188,7 +188,20 @@ namespace ADOFAIRenderer.UI
|
||||
descObj.layer = 5;
|
||||
|
||||
var descText = descObj.AddComponent<TextMeshProUGUI>();
|
||||
descText.text = "동영상을 렌더링하려면 FFmpeg 공유 라이브러리가 필요합니다.\n아래 버튼을 눌러 인터넷에서 자동으로 다운로드하여 설치합니다.\n<color=#aaaaaa><size=13>(다운로드 크기: 약 70MB, UserLibs 폴더에 압축 해제됨)</size></color>";
|
||||
var descStrBuilder = new StringBuilder();
|
||||
descStrBuilder.AppendLine("동영상을 렌더링하려면 FFmpeg 공유 라이브러리가 필요합니다.");
|
||||
if (Application.platform == RuntimePlatform.OSXPlayer)
|
||||
{
|
||||
descStrBuilder.AppendLine("OSX 플랫폼의 경우 신뢰 가능한 공개 빌드가 없어 수동으로 FFmpeg를 빌드하여야 합니다.");
|
||||
descStrBuilder.AppendLine("아래 버튼을 눌러 ffmpeg 공식 웹사이트를 열 수 있습니다.");
|
||||
}
|
||||
else
|
||||
{
|
||||
descStrBuilder.AppendLine("아래 버튼을 눌러 인터넷에서 자동으로 다운로드하여 설치합니다.");
|
||||
descStrBuilder.AppendLine("<color=#aaaaaa><size=13>(다운로드 크기: 약 70MB, UserLibs 폴더에 압축 해제됨)</size></color>");
|
||||
}
|
||||
|
||||
descText.text = descStrBuilder.ToString();
|
||||
descText.fontSize = 16;
|
||||
descText.font = font;
|
||||
descText.color = new Color(0.85f, 0.85f, 0.85f, 1f);
|
||||
@@ -225,7 +238,12 @@ namespace ADOFAIRenderer.UI
|
||||
|
||||
var downloadBtn = downloadBtnObj.AddComponent<Button>();
|
||||
SetupButtonStyle(downloadBtn, new Color(0.0f, 0.8f, 1.0f, 1.0f), new Color(0.2f, 0.9f, 1.0f, 1.0f), new Color(0.0f, 0.6f, 0.8f, 1.0f));
|
||||
downloadBtn.onClick.AddListener(StartDownloadProcess);
|
||||
if (Application.platform != RuntimePlatform.OSXPlayer) downloadBtn.onClick.AddListener(StartDownloadProcess);
|
||||
else
|
||||
{
|
||||
downloadBtn.onClick.AddListener(OpenFFmpegWebsite);
|
||||
void OpenFFmpegWebsite() { Application.OpenURL("https://ffmpeg.org"); Destroy(gameObject); }
|
||||
}
|
||||
|
||||
var downloadBtnRect = downloadBtnObj.GetComponent<RectTransform>();
|
||||
downloadBtnRect.anchorMin = new Vector2(0.5f, 0.5f);
|
||||
@@ -239,7 +257,7 @@ namespace ADOFAIRenderer.UI
|
||||
downloadTextObj.layer = 5;
|
||||
|
||||
var downloadText = downloadTextObj.AddComponent<TextMeshProUGUI>();
|
||||
downloadText.text = "다운로드 및 설치";
|
||||
downloadText.text = Application.platform != RuntimePlatform.OSXPlayer ? "다운로드 및 설치" : "사이트 열기";
|
||||
downloadText.fontSize = 15;
|
||||
downloadText.font = font;
|
||||
downloadText.color = Color.white;
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Obfuscator>
|
||||
<Var name="InPath" value="./bin/Release/netstandard2.1" />
|
||||
<Var name="OutPath" value="./bin/Release/netstandard2.1/obfuscated" />
|
||||
|
||||
<Var name="KeepPublicApi" value="false" />
|
||||
<Var name="HidePrivateApi" value="true" />
|
||||
<Var name="RenameProperties" value="true" />
|
||||
<Var name="RenameEvents" value="true" />
|
||||
<Var name="RenameFields" value="true" />
|
||||
<Var name="UseUnicodeNames" value="true" />
|
||||
<Var name="EmbedManifests" value="true" />
|
||||
|
||||
<Var name="Use=rename" value="true" />
|
||||
<Var name="Use=controlflow" value="true" />
|
||||
|
||||
<!-- Environment variable passed from MSBuild -->
|
||||
<Var name="ADOFAI_PATH" value="%ADOFAI_PATH%" />
|
||||
|
||||
<!-- Dependency search paths -->
|
||||
<AssemblySearchPath path="$(ADOFAI_PATH)\A Dance of Fire and Ice_Data\Managed" />
|
||||
<AssemblySearchPath path="$(ADOFAI_PATH)\MelonLoader\net35" />
|
||||
<AssemblySearchPath path="$(InPath)" />
|
||||
|
||||
<Module file="$(InPath)\ADOFAIRenderer.dll">
|
||||
<!-- MelonLoader Entrypoint -->
|
||||
<SkipType name="ADOFAIRenderer.RenderMod" />
|
||||
|
||||
<!-- Harmony 패치 메서드 중 매개변수 주입(__instance, __result 등)을 사용하는 필수 메서드만 보존하고, 매개변수가 없는 나머지 메서드와 클래스명은 난독화 -->
|
||||
<SkipMethod type="ADOFAIRenderer.Patch.*" rx=".*" />
|
||||
|
||||
<!-- Skip Unity MonoBehaviour lifecycle methods -->
|
||||
<SkipMethod type="ADOFAIRenderer.Core.*" rx="^(?:Awake|Start|Update|LateUpdate|OnDestroy)$" />
|
||||
<SkipMethod type="ADOFAIRenderer.UI.*" rx="^(?:Awake|Start|Update|LateUpdate|OnDestroy)$" />
|
||||
<SkipMethod type="ADOFAIRenderer.Util.*" rx="^(?:Awake|Start|Update|LateUpdate|OnDestroy)$" />
|
||||
|
||||
<!-- Skip Enums bound to UI dropdowns -->
|
||||
<SkipType name="ADOFAIRenderer.Util.FFmpeg.Codec" />
|
||||
<SkipType name="ADOFAIRenderer.Util.FFmpeg.RateControlMode" />
|
||||
</Module>
|
||||
</Obfuscator>
|
||||
Reference in new issue
Block a user