-
Notifications
You must be signed in to change notification settings - Fork 281
/
WXUserReader.cs
752 lines (684 loc) · 27.6 KB
/
WXUserReader.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
using K4os.Compression.LZ4.Encoders;
using K4os.Compression.LZ4;
using SQLite;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Net.Mime;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Interop;
using System.Windows.Media.Imaging;
using System.Xml;
using System.Xml.Linq;
using WechatBakTool.Helpers;
using WechatBakTool.Model;
using System.Windows;
using System.Net.Http;
using System.Reflection.Metadata;
using System.Threading;
using Newtonsoft.Json;
using WechatBakTool.ViewModel;
namespace WechatBakTool
{
public class WXUserReader
{
private Dictionary<string, SQLiteConnection> DBInfo = new Dictionary<string, SQLiteConnection>();
private UserBakConfig? UserBakConfig = null;
private Hashtable HeadImgCache = new Hashtable();
private Hashtable UserNameCache = new Hashtable();
private Hashtable EmojiCache = new Hashtable();
private HttpClient httpClient = new HttpClient();
public WXUserReader(UserBakConfig userBakConfig) {
string path = Path.Combine(userBakConfig.UserWorkspacePath, "DecDB");
UserBakConfig = userBakConfig;
LoadDB(path);
InitCache();
EmojiCacheInit();
}
public void LoadDB(string path)
{
string[] dbFileList = Directory.GetFiles(path);
foreach (var item in dbFileList)
{
FileInfo fileInfo = new FileInfo(item);
if (fileInfo.Extension != ".db")
continue;
SQLiteConnection con = new SQLiteConnection(item);
string dbName = fileInfo.Name.Split('.')[0];
if (DBInfo.ContainsKey(dbName))
{
continue;
}
DBInfo.Add(dbName, con);
}
}
private SQLiteConnection? getCon(string name)
{
if (DBInfo.ContainsKey(name))
{
return DBInfo[name];
}
else
{
return null;
}
}
public void InitCache()
{
SQLiteConnection? con = getCon("Misc");
if (con == null)
return;
string query = @"SELECT * FROM ContactHeadImg1";
List<ContactHeadImg> imgs = con.Query<ContactHeadImg>(query);
foreach(ContactHeadImg item in imgs)
{
if (!HeadImgCache.ContainsKey(item.usrName))
{
HeadImgCache.Add(item.usrName, item);
}
}
List<WXContact> contacts = GetWXContacts(null, true).ToList();
foreach(WXContact contact in contacts)
{
if (!UserNameCache.ContainsKey(contact.UserName))
UserNameCache.Add(contact.UserName, contact);
}
}
public void EmojiCacheInit()
{
string emoji_path = Path.Combine(UserBakConfig!.UserWorkspacePath, "Emoji");
if (Directory.Exists(emoji_path))
{
string[] files = Directory.GetFiles(emoji_path);
foreach (string file in files)
{
FileInfo fileInfo = new FileInfo(file);
string[] names = fileInfo.Name.Split(".");
if (!EmojiCache.ContainsKey(names[0]))
{
EmojiCache.Add(names[0], 1);
}
}
}
}
public void PreDownloadEmoji(string username = "")
{
if (UserBakConfig == null)
return;
HttpClientHandler handler = new HttpClientHandler() { AutomaticDecompression = System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate };
HttpClient httpClient = new HttpClient(handler);
List<WXMsg> msgs = GetTypeMsg("47", username);
int i = 0;
// 下载前的Emoji Cache不用做了,在Init的时候已经做了
foreach (var msg in msgs)
{
i++;
if (i % 5 == 0)
{
// 每5次让下载线程休息1秒
Thread.Sleep(1000);
}
try
{
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(msg.StrContent);
XmlNode? node = xmlDocument.SelectSingleNode("/msg/emoji");
if (node != null)
{
if (node.Attributes != null)
{
string type = "";
string md5 = "";
string url = "";
XmlNode? item = node.Attributes.GetNamedItem("type");
type = item != null ? item.InnerText : "";
item = node.Attributes.GetNamedItem("md5");
md5 = item != null ? item.InnerText : "";
item = node.Attributes.GetNamedItem("cdnurl");
url = item != null ? item.InnerText : "";
if (EmojiCache.ContainsKey(md5))
{
i--;
continue;
}
if (url == "")
{
i--;
continue;
}
else
{
string path = Path.Combine(UserBakConfig.UserWorkspacePath, msg.StrTalker, "Emoji", md5 + ".gif");
try
{
HttpResponseMessage res = httpClient.GetAsync(url).Result;
if (res.IsSuccessStatusCode)
{
using (FileStream fs = File.Create(path))
{
res.Content.ReadAsStream().CopyTo(fs);
}
}
}
catch (Exception ex)
{
}
}
}
}
}
catch (Exception ex)
{
}
}
// 下载完成后可能变化,检查一下
EmojiCacheInit();
}
public byte[]? GetHeadImgCahce(string username)
{
if (HeadImgCache.ContainsKey(username))
{
ContactHeadImg? img = HeadImgCache[username] as ContactHeadImg;
if (img == null)
return null;
else
return img.smallHeadBuf;
}
return null;
}
public int[] GetWXCount()
{
SQLiteConnection? con = getCon("MicroMsg");
if (con == null)
return new int[] { 0, 0 };
string query = @"select count(*) as count from contact where type != 4";
int userCount = con.Query<WXCount>(query)[0].Count;
int msgCount = 0;
for (int i = 0; i <= 99; i++)
{
con = getCon("MSG" + i.ToString());
if (con == null)
return new int[] { userCount, msgCount };
query = "select count(*) as count from MSG";
msgCount += con.Query<WXCount>(query)[0].Count;
}
return new int[] { userCount, msgCount };
}
public ObservableCollection<WXContact> GetWXContacts(string? name = null,bool all = false)
{
SQLiteConnection? con = getCon("MicroMsg");
if (con == null)
return new ObservableCollection<WXContact>();
string query = @"select contact.*,session.strContent,contactHeadImgUrl.smallHeadImgUrl,contactHeadImgUrl.bigHeadImgUrl from contact
left join session on session.strUsrName = contact.username
left join contactHeadImgUrl on contactHeadImgUrl.usrName = contact.username
where type != 4 {searchName}
order by nOrder desc";
if (all)
{
query = query.Replace("where type != 4 ", "");
}
List<WXContact>? contacts = null;
if (name != null)
{
query = query.Replace("{searchName}", " and (username like ? or alias like ? or nickname like ? or remark like ?)");
contacts = con.Query<WXContact>(query, $"%{name}%", $"%{name}%", $"%{name}%", $"%{name}%");
}
else
{
query = query.Replace("{searchName}", "");
contacts = con.Query<WXContact>(query);
}
foreach (WXContact contact in contacts)
{
if(contact.Remark != "")
contact.NickName = contact.Remark;
byte[]? imgBytes = GetHeadImgCahce(contact.UserName);
if (imgBytes != null)
{
try
{
MemoryStream stream = new MemoryStream(imgBytes);
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.BeginInit();
bitmapImage.CreateOptions = BitmapCreateOptions.IgnoreColorProfile;
bitmapImage.StreamSource = stream;
bitmapImage.EndInit();
bitmapImage.Freeze();
contact.Avatar = bitmapImage;
}
catch
{
#if DEBUG
File.AppendAllText("debug.log", string.Format("[D]{0} {1}:{2}\n", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "BitmapConvert Err=>Length", imgBytes.Length));
#endif
}
}
else
continue;
}
return new ObservableCollection<WXContact>(contacts);
}
public List<WXUserImg>? GetUserImgs()
{
SQLiteConnection? con = getCon("MicroMsg");
if (con == null)
return null;
string query = "select * from contactHeadImgUrl";
return con.Query<WXUserImg>(query);
}
public List<WXChatRoom>? GetWXChatRooms()
{
SQLiteConnection? con = getCon("MicroMsg");
if (con == null)
return null;
string query = "select * from ChatRoom";
return con.Query<WXChatRoom>(query);
}
public List<WXMsg> GetTypeMsg(string type,string username)
{
List<WXMsg> tmp = new List<WXMsg>();
for (int i = 0; i <= 99; i++)
{
SQLiteConnection? con = getCon("MSG" + i.ToString());
if (con == null)
return tmp;
List<WXMsg> wXMsgs;
if (username == "")
{
string query = "select * from MSG where Type=?";
wXMsgs = con.Query<WXMsg>(query, type);
}
else
{
string query = "select * from MSG where Type=? and StrTalker = ?";
wXMsgs = con.Query<WXMsg>(query, type, username);
}
tmp.AddRange(wXMsgs);
}
return tmp;
}
public List<WXMsg>? GetWXMsgs(string uid,int time,int page)
{
List<WXMsg> tmp = new List<WXMsg>();
for (int i = 0; i <= 99; i++)
{
SQLiteConnection? con = getCon("MSG" + i.ToString());
if (con == null)
return tmp;
List<WXMsg>? wXMsgs = null;
string query = "select * from MSG where StrTalker=? and CreateTime>? Limit ?";
wXMsgs = con.Query<WXMsg>(query, uid, time, page);
if (wXMsgs.Count != 0) {
return ProcessMsg(wXMsgs, uid);
}
}
return tmp;
}
public List<WXMsg>? GetWXMsgs(string uid,string msg = "")
{
List<WXMsg> tmp = new List<WXMsg>();
for (int i = 0; i <= 99; i++)
{
SQLiteConnection? con = getCon("MSG" + i.ToString());
if (con == null)
return tmp;
List<WXMsg>? wXMsgs = null;
if (msg == "")
{
string query = "select * from MSG where StrTalker=?";
wXMsgs = con.Query<WXMsg>(query, uid);
}
else if (uid == "")
{
string query = "select * from MSG where StrContent like ?";
wXMsgs = con.Query<WXMsg>(query, string.Format("%{0}%", msg));
}
else
{
string query = "select * from MSG where StrTalker=? and StrContent like ?";
wXMsgs = con.Query<WXMsg>(query, uid, string.Format("%{0}%", msg));
}
tmp.AddRange(ProcessMsg(wXMsgs, uid));
}
return tmp;
}
public List<WXMsg>? GetWXMsgs(string uid, DatetimePickerViewModel dateModel)
{
List<WXMsg> tmp = new List<WXMsg>();
for (int i = 0; i <= 99; i++)
{
SQLiteConnection? con = getCon("MSG" + i.ToString());
if (con == null)
return tmp;
List<WXMsg>? wXMsgs = null;
string query = "";
if (dateModel.DateType == 2 || dateModel.DateType == 3)
{
query = "select * from MSG where StrTalker=? and date(createtime,'unixepoch') = ?";
wXMsgs = con.Query<WXMsg>(query, uid, dateModel.PickDate.ToString("yyyy-MM-dd"));
}
else if(dateModel.DateType == 4 )
{
query = "select * from MSG where StrTalker=? and date(createtime,'unixepoch') >= ? and date(createtime,'unixepoch') <= ?";
wXMsgs = con.Query<WXMsg>(query, uid, dateModel.StartDate.ToString("yyyy-MM-dd"), dateModel.EndDate.ToString("yyyy-MM-dd"));
}
else
{
query = "select * from MSG where StrTalker=?";
wXMsgs = con.Query<WXMsg>(query, uid);
}
tmp.AddRange(ProcessMsg(wXMsgs, uid));
}
return tmp;
}
private List<WXMsg> ProcessMsg(List<WXMsg> msgs,string uid)
{
foreach (WXMsg w in msgs)
{
if (UserNameCache.ContainsKey(w.StrTalker))
{
WXContact? contact = UserNameCache[w.StrTalker] as WXContact;
if (contact != null)
{
if (contact.Remark != "")
w.NickName = contact.Remark;
else
w.NickName = contact.NickName;
w.StrTalker = contact.UserName;
}
}
else
{
w.NickName = uid;
}
// 群聊处理
if (uid.Contains("@chatroom"))
{
string userId = "";
if (w.BytesExtra == null)
continue;
string sl = BitConverter.ToString(w.BytesExtra).Replace("-", "");
ProtoMsg protoMsg;
using (MemoryStream stream = new MemoryStream(w.BytesExtra))
{
protoMsg = ProtoBuf.Serializer.Deserialize<ProtoMsg>(stream);
}
if (protoMsg.TVMsg != null)
{
foreach (TVType _tmp in protoMsg.TVMsg)
{
if (_tmp.Type == 1)
userId = _tmp.TypeValue;
}
}
if (!w.IsSender)
{
if (UserNameCache.ContainsKey(userId))
{
WXContact? contact = UserNameCache[userId] as WXContact;
if (contact != null)
w.NickName = contact.Remark == "" ? contact.NickName : contact.Remark;
}
else
{
w.NickName = userId;
}
}
}
// 发送人名字处理
if (w.IsSender)
w.NickName = "我";
w.DisplayContent = w.StrContent;
// 额外格式处理
if (w.Type != 1)
{
if (w.Type == 10000)
{
w.Type = 1;
w.NickName = "系统消息";
w.DisplayContent = w.StrContent.Replace("<revokemsg>", "").Replace("</revokemsg>", "");
}
else if (w.Type == 49 && (w.SubType == 6 || w.SubType == 19 || w.SubType == 40))
{
WXSessionAttachInfo? attachInfos = GetWXMsgAtc(w);
if (attachInfos == null)
{
w.DisplayContent = "附件不存在";
}
else
{
w.DisplayContent = Path.Combine(UserBakConfig!.UserResPath, attachInfos.attachPath);
}
}
else
{
w.DisplayContent = "[界面未支持格式]Type=" + w.Type;
}
}
}
return msgs;
}
public List<WXSessionAttachInfo>? GetWXMsgAtc()
{
SQLiteConnection? con = getCon("MultiSearchChatMsg");
if (con == null)
return null;
string query = "select * from SessionAttachInfo";
List<WXSessionAttachInfo> list = con.Query<WXSessionAttachInfo>(query);
if (list.Count != 0)
{
return list;
}
else
return null;
}
public WXSessionAttachInfo? GetWXMsgAtc(WXMsg msg)
{
SQLiteConnection? con = getCon("MultiSearchChatMsg");
if (con == null)
return null;
string query = "select * from SessionAttachInfo where msgId = ? order by attachsize desc";
List<WXSessionAttachInfo> list = con.Query<WXSessionAttachInfo>(query, msg.MsgSvrID);
if (list.Count != 0)
{
//部分附件可能有md5校验,这里移除校验,给的是正确路径
WXSessionAttachInfo acc = list[0];
int index = acc.attachPath.IndexOf(".dat");
int index2 = acc.attachPath.IndexOf(".dat");
if (acc.attachPath.Length - index > 10 && index != -1)
{
acc.attachPath = acc.attachPath.Substring(0, acc.attachPath.Length - 32);
}
if (acc.attachPath.Length - index2 > 10 && index2 != -1)
{
acc.attachPath = acc.attachPath.Substring(0, acc.attachPath.Length - 32);
}
return acc;
}
else
return null;
}
public WXMediaMsg? GetVoiceMsg(WXMsg msg)
{
for (int i = 0; i <= 99; i++)
{
SQLiteConnection? con = getCon("MediaMSG" + i.ToString());
if (con == null)
continue;
string query = "select * from Media where Reserved0=?";
List<WXMediaMsg> wXMsgs = con.Query<WXMediaMsg>(query, msg.MsgSvrID);
if (wXMsgs.Count != 0)
return wXMsgs[0];
}
return null;
}
public string? GetAttachment(WXMsgType type, WXMsg msg)
{
if (UserBakConfig == null)
return null;
string? tmpPath = Path.Combine(UserBakConfig.UserWorkspacePath, msg.StrTalker, "Temp");
if (!Directory.Exists(tmpPath))
Directory.CreateDirectory(tmpPath);
// 这部分是查找
// 如果是图片和视频,从附件库中搜索
string? path = null;
if (type == WXMsgType.Image || type == WXMsgType.Video || type == WXMsgType.File)
{
WXSessionAttachInfo? atcInfo = GetWXMsgAtc(msg);
if (atcInfo == null)
return null;
path = atcInfo.attachPath;
}
// 如果是从语音,从媒体库查找
else if (type == WXMsgType.Audio)
{
WXMediaMsg? voiceMsg = GetVoiceMsg(msg);
if (voiceMsg == null)
return null;
if (voiceMsg.Buf == null)
return null;
// 从DB取音频文件到临时目录
string tmp_file_path = Path.Combine(tmpPath, voiceMsg.Key + ".arm");
using (FileStream stream = new FileStream(tmp_file_path, FileMode.OpenOrCreate))
{
stream.Write(voiceMsg.Buf, 0, voiceMsg.Buf.Length);
}
path = tmp_file_path;
}
else if (type == WXMsgType.Emoji)
{
try
{
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(msg.StrContent);
XmlNode? node = xmlDocument.SelectSingleNode("/msg/emoji");
if (node != null)
{
if (node.Attributes != null)
{
XmlNode? item = node.Attributes.GetNamedItem("md5");
string md5 = item != null ? item.InnerText : "";
if (EmojiCache.ContainsKey(md5))
{
path = string.Format("Emoji\\{0}.gif", md5);
}
}
}
}
catch
{
return null;
}
}
if (path == null)
return null;
// 这部分是解密
// 获取到原路径后,开始进行解密转移,只有图片和语音需要解密,解密后是直接归档目录
if (type == WXMsgType.Image || type == WXMsgType.Audio)
{
path = DecryptAttachment(type, path, msg.StrTalker);
}
else if (type == WXMsgType.Video || type == WXMsgType.File)
{
string to_dir;
if (type == WXMsgType.Video)
to_dir = Path.Combine(UserBakConfig.UserWorkspacePath, msg.StrTalker, "Video");
else
to_dir = Path.Combine(UserBakConfig.UserWorkspacePath, msg.StrTalker, "File");
if (!Directory.Exists(to_dir))
Directory.CreateDirectory(to_dir);
FileInfo fileInfo = new FileInfo(path);
// 目标视频路径
string to_file_path = Path.Combine(to_dir, fileInfo.Name);
// 视频的路径是相对路径,需要加上资源目录
path = Path.Combine(UserBakConfig.UserResPath, path);
// 原文件存在,目标不存在
if (!File.Exists(to_file_path) && File.Exists(path))
{
// 复制
File.Copy(path, to_file_path);
path = to_file_path;
}
else if (File.Exists(to_file_path))
{
path = to_file_path;
}
else
return null;
}
if (path == null)
return null;
// 改相对路径
path = path.Replace(UserBakConfig.UserWorkspacePath + "\\", "");
return path;
}
public string? DecryptAttachment(WXMsgType type, string path,string username)
{
if (UserBakConfig == null)
return null;
string? file_path = null;
switch (type)
{
case WXMsgType.Image:
string img_dir = Path.Combine(UserBakConfig.UserWorkspacePath, username, "Image");
if (!Directory.Exists(img_dir))
Directory.CreateDirectory(img_dir);
// 图片的路径是相对路径,需要加上资源目录
path = Path.Combine(UserBakConfig.UserResPath, path);
if (!File.Exists(path))
return null;
byte[] decFileByte = DecryptionHelper.DecImage(path);
if (decFileByte.Length < 2)
new Exception("解密失败,可能是未支持的格式");
string decFiletype = DecryptionHelper.CheckFileType(decFileByte);
file_path = DecryptionHelper.SaveDecImage(decFileByte, path, img_dir, decFiletype);
break;
case WXMsgType.Audio:
string audio_dir = Path.Combine(UserBakConfig.UserWorkspacePath, username, "Audio");
if (!Directory.Exists(audio_dir))
Directory.CreateDirectory(audio_dir);
FileInfo fileInfo = new FileInfo(path);
string audio_file_dir = Path.Combine(audio_dir, fileInfo.Name + ".mp3");
ToolsHelper.DecodeVoice(path, path + ".pcm", audio_file_dir);
file_path = audio_file_dir;
break;
}
return file_path;
}
public List<WXMsgGroup> GetWXMsgGroup()
{
List<WXMsgGroup> g = new List<WXMsgGroup>();
for (int i = 0; i <= 99; i++)
{
SQLiteConnection? con = getCon("MSG" + i.ToString());
if (con == null)
return g;
string query = "select StrTalker,Count(localId) as MsgCount from MSG GROUP BY StrTalker";
List<WXMsgGroup> wXMsgs = con.Query<WXMsgGroup>(query);
foreach (WXMsgGroup w in wXMsgs)
{
WXMsgGroup? tmp = g.Find(x => x.UserName == w.UserName);
if (tmp == null)
g.Add(w);
else
tmp.MsgCount += g.Count;
}
}
return g;
}
}
public enum WXMsgType
{
Image = 0,
Video = 1,
Audio = 2,
File = 3,
Emoji = 4,
}
}