Skip to content

Commit a5b1b4c

Browse files
committed
updated to v3.4.3
1 parent 07fd1e4 commit a5b1b4c

130 files changed

Lines changed: 4400 additions & 1712 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Assets/OxGFrame/AssetLoader/Scripts/Editor/Bundle/EditorWindow/BundleConfigGeneratorWindow.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -868,12 +868,12 @@ private void _CopyCurrentToBundlePlan()
868868

869869
private void _ExportBundlePlans()
870870
{
871-
string savePath = EditorStorage.GetData(keySaver, $"bundlePlanFIlePath", Application.dataPath);
871+
string savePath = EditorStorage.GetData(keySaver, $"bundlePlanFilePath", Application.dataPath);
872872
var filePath = EditorUtility.SaveFilePanel("Save Bundle Plan Json File", savePath, "BundlePlan", "json");
873873

874874
if (!string.IsNullOrEmpty(filePath))
875875
{
876-
EditorStorage.SaveData(keySaver, $"bundlePlanFIlePath", Path.GetDirectoryName(filePath));
876+
EditorStorage.SaveData(keySaver, $"bundlePlanFilePath", Path.GetDirectoryName(filePath));
877877
string json = JsonConvert.SerializeObject(this.bundlePlans, Formatting.Indented);
878878
BundleHelper.WriteTxt(json, filePath);
879879
AssetDatabase.Refresh();
@@ -882,12 +882,12 @@ private void _ExportBundlePlans()
882882

883883
private void _ImportBundlePlans()
884884
{
885-
string loadPath = EditorStorage.GetData(keySaver, $"bundlePlanFIlePath", Application.dataPath);
885+
string loadPath = EditorStorage.GetData(keySaver, $"bundlePlanFilePath", Application.dataPath);
886886
string filePath = EditorUtility.OpenFilePanel("Select Bundle Plan Json File", !string.IsNullOrEmpty(loadPath) ? loadPath : Application.dataPath, "json");
887887

888888
if (!string.IsNullOrEmpty(filePath))
889889
{
890-
EditorStorage.SaveData(keySaver, $"bundlePlanFIlePath", Path.GetDirectoryName(filePath));
890+
EditorStorage.SaveData(keySaver, $"bundlePlanFilePath", Path.GetDirectoryName(filePath));
891891
string json = File.ReadAllText(filePath);
892892
this.bundlePlans = JsonConvert.DeserializeObject<List<BundlePlan>>(json);
893893

Assets/OxGFrame/AssetLoader/Scripts/Editor/Bundle/EditorWindow/BundleCryptogramUtilityWindow.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using OxGFrame.AssetLoader.Utility;
1+
using OxGFrame.AssetLoader.Bundle;
2+
using OxGFrame.AssetLoader.Utility;
23
using System;
34
using System.IO;
45
using System.Linq;

Assets/OxGFrame/AssetLoader/Scripts/Editor/Bundle/EditorWindow/BundleUrlConfigGeneratorWindow.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,12 +352,12 @@ private void _CopyCurrentToBundleUrlPlan()
352352

353353
private void _ExportBundleUrlPlans()
354354
{
355-
string savePath = EditorStorage.GetData(keySaver, $"bundleUrlPlanFIlePath", Application.dataPath);
355+
string savePath = EditorStorage.GetData(keySaver, $"bundleUrlPlanFilePath", Application.dataPath);
356356
var filePath = EditorUtility.SaveFilePanel("Save Bundle Url Plan Json File", savePath, "BundleUrlPlan", "json");
357357

358358
if (!string.IsNullOrEmpty(filePath))
359359
{
360-
EditorStorage.SaveData(keySaver, $"bundleUrlPlanFIlePath", Path.GetDirectoryName(filePath));
360+
EditorStorage.SaveData(keySaver, $"bundleUrlPlanFilePath", Path.GetDirectoryName(filePath));
361361
string json = JsonConvert.SerializeObject(this.bundleUrlPlans, Formatting.Indented);
362362
BundleHelper.WriteTxt(json, filePath);
363363
AssetDatabase.Refresh();
@@ -366,12 +366,12 @@ private void _ExportBundleUrlPlans()
366366

367367
private void _ImportBundleUrlPlans()
368368
{
369-
string loadPath = EditorStorage.GetData(keySaver, $"bundleUrlPlanFIlePath", Application.dataPath);
369+
string loadPath = EditorStorage.GetData(keySaver, $"bundleUrlPlanFilePath", Application.dataPath);
370370
string filePath = EditorUtility.OpenFilePanel("Select Bundle Url Plan Json File", !string.IsNullOrEmpty(loadPath) ? loadPath : Application.dataPath, "json");
371371

372372
if (!string.IsNullOrEmpty(filePath))
373373
{
374-
EditorStorage.SaveData(keySaver, $"bundleUrlPlanFIlePath", Path.GetDirectoryName(filePath));
374+
EditorStorage.SaveData(keySaver, $"bundleUrlPlanFilePath", Path.GetDirectoryName(filePath));
375375
string json = File.ReadAllText(filePath);
376376
this.bundleUrlPlans = JsonConvert.DeserializeObject<List<BundleUrlPlan>>(json);
377377

Assets/OxGFrame/AssetLoader/Scripts/Editor/Bundle/EditorWindow/CryptogramSettingWindow.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
using OxGFrame.AssetLoader.Bundle;
2+
using System;
23
using System.Linq;
34
using UnityEditor;
45
using UnityEngine;
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
using OxGFrame.AssetLoader.Bundle;
2+
13
namespace OxGFrame.AssetLoader.Editor
24
{
35
public static class CryptogramSettingSetup
46
{
5-
public static CryptogramSetting cryptogramSetting;
7+
private static CryptogramSetting _cryptogramSetting;
68

79
public static CryptogramSetting GetCryptogramSetting()
810
{
9-
if (cryptogramSetting == null)
10-
cryptogramSetting = EditorTool.LoadSettingData<CryptogramSetting>();
11-
return cryptogramSetting;
11+
if (_cryptogramSetting == null)
12+
_cryptogramSetting = EditorTool.LoadSettingData<CryptogramSetting>();
13+
return _cryptogramSetting;
1214
}
1315
}
1416
}

Assets/OxGFrame/AssetLoader/Scripts/Editor/Bundle/YooAssets/ManifestEncryptionServices.cs

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace OxGFrame.AssetLoader.Editor
66
{
7-
public class ManifestOffsetEncryption : IManifestServices
7+
public class ManifestOffsetEncryption : IManifestProcessServices
88
{
99
private int? _dummySize = null;
1010

@@ -43,7 +43,7 @@ public byte[] RestoreManifest(byte[] fileData)
4343
}
4444
}
4545

46-
public class ManifestXorEncryption : IManifestServices
46+
public class ManifestXorEncryption : IManifestProcessServices
4747
{
4848
private byte? _xorKey = null;
4949

@@ -82,7 +82,7 @@ public byte[] RestoreManifest(byte[] fileData)
8282
}
8383
}
8484

85-
public class ManifestHT2XorEncryption : IManifestServices
85+
public class ManifestHT2XorEncryption : IManifestProcessServices
8686
{
8787
private byte? _hXorKey = null;
8888
private byte? _tXorKey = null;
@@ -129,7 +129,7 @@ public byte[] RestoreManifest(byte[] fileData)
129129
}
130130
}
131131

132-
public class ManifestHT2XorPlusEncryption : IManifestServices
132+
public class ManifestHT2XorPlusEncryption : IManifestProcessServices
133133
{
134134
private byte? _hXorKey = null;
135135
private byte? _tXorKey = null;
@@ -180,7 +180,7 @@ public byte[] RestoreManifest(byte[] fileData)
180180
}
181181
}
182182

183-
public class ManifestAesEncryption : IManifestServices
183+
public class ManifestAesEncryption : IManifestProcessServices
184184
{
185185
private string _aesKey = null;
186186
private string _aesIv = null;
@@ -223,7 +223,7 @@ public byte[] RestoreManifest(byte[] fileData)
223223
}
224224
}
225225

226-
public class ManifestChaCha20Encryption : IManifestServices
226+
public class ManifestChaCha20Encryption : IManifestProcessServices
227227
{
228228
private string _chacha20Key = null;
229229
private string _chacha20Nonce = null;
@@ -246,18 +246,30 @@ public byte[] ProcessManifest(byte[] fileData)
246246
string nonce = string.IsNullOrEmpty(this._chacha20Nonce) ? cryptogramSettings.chacha20Nonce : this._chacha20Nonce;
247247
uint counter = this._chacha20Counter == null ? (uint)cryptogramSettings.chacha20Counter : (uint)this._chacha20Counter;
248248

249-
if (FileCryptogram.ChaCha20.DecryptBytes(ref fileData, key, nonce, counter))
249+
if (FileCryptogram.ChaCha20.EncryptBytes(ref fileData, key, nonce, counter))
250+
{
251+
Debug.Log($"Manifest ChaCha20 Cryptogram => key: {key}, nonce: {nonce}, counter: {counter}");
252+
250253
return fileData;
254+
}
251255
return null;
252256
}
253257

254258
public byte[] RestoreManifest(byte[] fileData)
255259
{
260+
var cryptogramSettings = CryptogramSettingSetup.GetCryptogramSetting();
261+
262+
string key = string.IsNullOrEmpty(this._chacha20Key) ? cryptogramSettings.chacha20Key : this._chacha20Key;
263+
string nonce = string.IsNullOrEmpty(this._chacha20Nonce) ? cryptogramSettings.chacha20Nonce : this._chacha20Nonce;
264+
uint counter = this._chacha20Counter == null ? (uint)cryptogramSettings.chacha20Counter : (uint)this._chacha20Counter;
265+
266+
if (FileCryptogram.ChaCha20.DecryptBytes(ref fileData, key, nonce, counter))
267+
return fileData;
256268
return null;
257269
}
258270
}
259271

260-
public class ManifestXXTEAEncryption : IManifestServices
272+
public class ManifestXXTEAEncryption : IManifestProcessServices
261273
{
262274
private string _xxteaKey = null;
263275

@@ -296,7 +308,7 @@ public byte[] RestoreManifest(byte[] fileData)
296308
}
297309
}
298310

299-
public class ManifestOffsetXorEncryption : IManifestServices
311+
public class ManifestOffsetXorEncryption : IManifestProcessServices
300312
{
301313
private byte? _offsetXorKey = null;
302314
private int? _offsetXorDummySize = null;

Assets/OxGFrame/AssetLoader/Scripts/Editor/Bundle/CryptogramSetting.cs renamed to Assets/OxGFrame/AssetLoader/Scripts/Runtime/Bundle/CryptogramSetting.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using MyBox;
22
using UnityEngine;
33

4-
namespace OxGFrame.AssetLoader.Editor
4+
namespace OxGFrame.AssetLoader.Bundle
55
{
66
[CreateAssetMenu(fileName = nameof(CryptogramSetting), menuName = "OxGFrame/Create Settings/Create Cryptogram Setting")]
77
public class CryptogramSetting : ScriptableObject

Assets/OxGFrame/AssetLoader/Scripts/Editor/Bundle/CryptogramSetting.cs.meta renamed to Assets/OxGFrame/AssetLoader/Scripts/Runtime/Bundle/CryptogramSetting.cs.meta

File renamed without changes.

Assets/OxGFrame/AssetLoader/Scripts/Runtime/Bundle/PackageManager.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,28 +58,28 @@ public async static UniTask InitSetup()
5858
case BundleConfig.CryptogramType.NONE:
5959
break;
6060
case BundleConfig.CryptogramType.OFFSET:
61-
_bundleDecryptionServices = new OffsetDecryption(FileProcessCategory.Bundle);
61+
_bundleDecryptionServices = new OffsetDecryption(FileOperationType.Bundle);
6262
break;
6363
case BundleConfig.CryptogramType.XOR:
64-
_bundleDecryptionServices = new XorDecryption(FileProcessCategory.Bundle);
64+
_bundleDecryptionServices = new XorDecryption(FileOperationType.Bundle);
6565
break;
6666
case BundleConfig.CryptogramType.HT2XOR:
67-
_bundleDecryptionServices = new HT2XorDecryption(FileProcessCategory.Bundle);
67+
_bundleDecryptionServices = new HT2XorDecryption(FileOperationType.Bundle);
6868
break;
6969
case BundleConfig.CryptogramType.HT2XORPLUS:
70-
_bundleDecryptionServices = new HT2XorPlusDecryption(FileProcessCategory.Bundle);
70+
_bundleDecryptionServices = new HT2XorPlusDecryption(FileOperationType.Bundle);
7171
break;
7272
case BundleConfig.CryptogramType.AES:
73-
_bundleDecryptionServices = new AesDecryption(FileProcessCategory.Bundle);
73+
_bundleDecryptionServices = new AesDecryption(FileOperationType.Bundle);
7474
break;
7575
case BundleConfig.CryptogramType.CHACHA20:
76-
_bundleDecryptionServices = new ChaCha20Decryption(FileProcessCategory.Bundle);
76+
_bundleDecryptionServices = new ChaCha20Decryption(FileOperationType.Bundle);
7777
break;
7878
case BundleConfig.CryptogramType.XXTEA:
79-
_bundleDecryptionServices = new XXTEADecryption(FileProcessCategory.Bundle);
79+
_bundleDecryptionServices = new XXTEADecryption(FileOperationType.Bundle);
8080
break;
8181
case BundleConfig.CryptogramType.OFFSETXOR:
82-
_bundleDecryptionServices = new OffsetXorDecryption(FileProcessCategory.Bundle);
82+
_bundleDecryptionServices = new OffsetXorDecryption(FileOperationType.Bundle);
8383
break;
8484
}
8585
Logging.Print<Logger>($"<color=#ffe45a>Init Bundle Decryption: {decryptType}</color>");
@@ -90,28 +90,28 @@ public async static UniTask InitSetup()
9090
case BundleConfig.CryptogramType.NONE:
9191
break;
9292
case BundleConfig.CryptogramType.OFFSET:
93-
_manifestDecryptionServices = new OffsetDecryption(FileProcessCategory.Manifest);
93+
_manifestDecryptionServices = new OffsetDecryption(FileOperationType.Manifest);
9494
break;
9595
case BundleConfig.CryptogramType.XOR:
96-
_manifestDecryptionServices = new XorDecryption(FileProcessCategory.Manifest);
96+
_manifestDecryptionServices = new XorDecryption(FileOperationType.Manifest);
9797
break;
9898
case BundleConfig.CryptogramType.HT2XOR:
99-
_manifestDecryptionServices = new HT2XorDecryption(FileProcessCategory.Manifest);
99+
_manifestDecryptionServices = new HT2XorDecryption(FileOperationType.Manifest);
100100
break;
101101
case BundleConfig.CryptogramType.HT2XORPLUS:
102-
_manifestDecryptionServices = new HT2XorPlusDecryption(FileProcessCategory.Manifest);
102+
_manifestDecryptionServices = new HT2XorPlusDecryption(FileOperationType.Manifest);
103103
break;
104104
case BundleConfig.CryptogramType.AES:
105-
_manifestDecryptionServices = new AesDecryption(FileProcessCategory.Manifest);
105+
_manifestDecryptionServices = new AesDecryption(FileOperationType.Manifest);
106106
break;
107107
case BundleConfig.CryptogramType.CHACHA20:
108-
_manifestDecryptionServices = new ChaCha20Decryption(FileProcessCategory.Manifest);
108+
_manifestDecryptionServices = new ChaCha20Decryption(FileOperationType.Manifest);
109109
break;
110110
case BundleConfig.CryptogramType.XXTEA:
111-
_manifestDecryptionServices = new XXTEADecryption(FileProcessCategory.Manifest);
111+
_manifestDecryptionServices = new XXTEADecryption(FileOperationType.Manifest);
112112
break;
113113
case BundleConfig.CryptogramType.OFFSETXOR:
114-
_manifestDecryptionServices = new OffsetXorDecryption(FileProcessCategory.Manifest);
114+
_manifestDecryptionServices = new OffsetXorDecryption(FileOperationType.Manifest);
115115
break;
116116
}
117117
Logging.Print<Logger>($"<color=#ffe45a>Init Manifest Decryption: {decryptType}</color>");

0 commit comments

Comments
 (0)