mirror of
https://github.com/huiyadanli/RevokeMsgPatcher.git
synced 2026-07-29 05:37:13 +08:00
[+] 完成核心代码的编写
This commit is contained in:
@@ -10,8 +10,8 @@ namespace RevokeMsgPatcher.Model
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public string[] ModifyFilePaths { get; set; }
|
||||
public Dictionary<string, TargetInfo> FileTargetInfos { get; set; }
|
||||
|
||||
public List<BinaryFile> ModifyFileInfos { get; set; }
|
||||
public Dictionary<string, List<ModifyInfo>> FileModifyInfos { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RevokeMsgPatcher.Model
|
||||
{
|
||||
public class BinaryFile
|
||||
{
|
||||
//public string Name { get {return Path.GetFileName(RelativePath); } }
|
||||
|
||||
public string RelativePath { get; set; }
|
||||
|
||||
public string Version { get; set; }
|
||||
|
||||
public string SHA1Before { get; set; }
|
||||
|
||||
public string SHA1After { get; set; }
|
||||
|
||||
public List<Change> Changes { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,14 @@ namespace RevokeMsgPatcher.Model
|
||||
{
|
||||
public long Position { get; set; }
|
||||
|
||||
public byte Content { get; set; }
|
||||
public byte[] Content { get; set; }
|
||||
|
||||
public Change Clone()
|
||||
{
|
||||
Change o = new Change();
|
||||
o.Position = Position;
|
||||
o.Content = Content;
|
||||
return o;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RevokeMsgPatcher.Model
|
||||
{
|
||||
public class ModifyInfo
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
//public string RelativePath { get; set; }
|
||||
|
||||
public string Version { get; set; }
|
||||
|
||||
public string SHA1Before { get; set; }
|
||||
|
||||
public string SHA1After { get; set; }
|
||||
|
||||
public List<Change> Changes { get; set; }
|
||||
|
||||
public ModifyInfo Clone()
|
||||
{
|
||||
ModifyInfo o = new ModifyInfo();
|
||||
o.Name = Name;
|
||||
o.Version = Version;
|
||||
o.SHA1Before = SHA1Before;
|
||||
o.SHA1After = SHA1After;
|
||||
List<Change> cs = new List<Change>();
|
||||
foreach(Change c in Changes)
|
||||
{
|
||||
cs.Add(c.Clone());
|
||||
}
|
||||
o.Changes = cs;
|
||||
return o;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RevokeMsgPatcher.Model
|
||||
{
|
||||
public class TargetInfo
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public string RelativePath { get; set; }
|
||||
|
||||
public string Memo { get; set; }
|
||||
|
||||
public TargetInfo Clone()
|
||||
{
|
||||
TargetInfo o = new TargetInfo();
|
||||
o.Name = Name;
|
||||
o.RelativePath = RelativePath;
|
||||
o.Memo = Memo;
|
||||
return o;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,6 @@ namespace RevokeMsgPatcher.Model
|
||||
{
|
||||
public string AppVersion { get; set; }
|
||||
|
||||
public List<BinaryFile> Files { get; set; }
|
||||
public List<ModifyInfo> Files { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user