[+] 完成核心代码的编写

This commit is contained in:
huiyadanli
2019-09-19 02:46:57 +08:00
parent 92594da959
commit 4ec0fb4f85
13 changed files with 447 additions and 115 deletions
+2 -2
View File
@@ -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; }
}
}
-24
View File
@@ -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; }
}
}
+9 -1
View File
@@ -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;
}
}
}
+40
View File
@@ -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;
}
}
}
+26
View File
@@ -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;
}
}
}
+1 -1
View File
@@ -10,6 +10,6 @@ namespace RevokeMsgPatcher.Model
{
public string AppVersion { get; set; }
public List<BinaryFile> Files { get; set; }
public List<ModifyInfo> Files { get; set; }
}
}