Skip to content

Commit 3d6d890

Browse files
committed
1. 实现最后浏览位置记录和书签功能
2. 实现会话导出分享功能 3. 增加语音消息和通话消息的筛选 4. 实现单聊会话对话人位置调换功能 5. 添加繁体和英语表情的解析 6. 修复相近时间的消息可能会出现顺序不对的问题
1 parent a8addf1 commit 3d6d890

File tree

14 files changed

+1499
-551
lines changed

14 files changed

+1499
-551
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,7 @@ A: Win7电脑需要安装WebView2运行时才能正常使用。github release版
102102
- 微信数据库解密和数据库的使用 [PyWxDump](https://github.com/xaoyaoo/PyWxDump/tree/master)
103103
- silk语音消息解码 [silk-v3-decoder](https://github.com/kn007/silk-v3-decoder)
104104
- PCM转MP3 [lame](https://github.com/viert/lame.git)
105-
- Dat图片解码 [wechatDatDecode](https://github.com/liuggchen/wechatDatDecode)
105+
- Dat图片解码 [wechatDatDecode](https://github.com/liuggchen/wechatDatDecode)
106+
107+
## 交流/讨论
108+
![](./res/wechatQR.png)

app.go

Lines changed: 161 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const (
2323
configDefaultUserKey = "userConfig.defaultUser"
2424
configUsersKey = "userConfig.users"
2525
configExportPathKey = "exportPath"
26-
appVersion = "v1.1.0"
26+
appVersion = "v1.2.0"
2727
)
2828

2929
type FileLoader struct {
@@ -183,14 +183,15 @@ func (a *App) startup(ctx context.Context) {
183183
}
184184

185185
func (a *App) beforeClose(ctx context.Context) (prevent bool) {
186+
return false
187+
}
186188

189+
func (a *App) shutdown(ctx context.Context) {
187190
if a.provider != nil {
188191
a.provider.WechatWechatDataProviderClose()
189192
a.provider = nil
190193
}
191-
192-
return false
193-
194+
log.Printf("App Version %s exit!", appVersion)
194195
}
195196

196197
func (a *App) GetWeChatAllInfo() string {
@@ -713,3 +714,159 @@ func (a *App) SaveFileDialog(file string, alisa string) string {
713714

714715
return ""
715716
}
717+
718+
func (a *App) GetSessionLastTime(userName string) string {
719+
if a.provider == nil || userName == "" {
720+
lastTime := &wechat.WeChatLastTime{}
721+
lastTimeString, _ := json.Marshal(lastTime)
722+
return string(lastTimeString)
723+
}
724+
725+
lastTime := a.provider.WeChatGetSessionLastTime(userName)
726+
727+
lastTimeString, _ := json.Marshal(lastTime)
728+
729+
return string(lastTimeString)
730+
}
731+
732+
func (a *App) SetSessionLastTime(userName string, stamp int64, messageId string) string {
733+
if a.provider == nil {
734+
return ""
735+
}
736+
737+
lastTime := &wechat.WeChatLastTime{
738+
UserName: userName,
739+
Timestamp: stamp,
740+
MessageId: messageId,
741+
}
742+
err := a.provider.WeChatSetSessionLastTime(lastTime)
743+
if err != nil {
744+
log.Println("WeChatSetSessionLastTime failed:", err.Error())
745+
return err.Error()
746+
}
747+
748+
return ""
749+
}
750+
751+
func (a *App) SetSessionBookMask(userName, tag, info string) string {
752+
if a.provider == nil || userName == "" {
753+
return "invaild params"
754+
}
755+
err := a.provider.WeChatSetSessionBookMask(userName, tag, info)
756+
if err != nil {
757+
log.Println("WeChatSetSessionBookMask failed:", err.Error())
758+
return err.Error()
759+
}
760+
761+
return ""
762+
}
763+
764+
func (a *App) DelSessionBookMask(markId string) string {
765+
if a.provider == nil || markId == "" {
766+
return "invaild params"
767+
}
768+
769+
err := a.provider.WeChatDelSessionBookMask(markId)
770+
if err != nil {
771+
log.Println("WeChatDelSessionBookMask failed:", err.Error())
772+
return err.Error()
773+
}
774+
775+
return ""
776+
}
777+
778+
func (a *App) GetSessionBookMaskList(userName string) string {
779+
if a.provider == nil || userName == "" {
780+
return "invaild params"
781+
}
782+
markLIst, err := a.provider.WeChatGetSessionBookMaskList(userName)
783+
if err != nil {
784+
log.Println("WeChatGetSessionBookMaskList failed:", err.Error())
785+
_list := &wechat.WeChatBookMarkList{}
786+
_listString, _ := json.Marshal(_list)
787+
return string(_listString)
788+
}
789+
790+
markLIstString, _ := json.Marshal(markLIst)
791+
return string(markLIstString)
792+
}
793+
794+
func (a *App) SelectedDirDialog(title string) string {
795+
dialogOptions := runtime.OpenDialogOptions{
796+
Title: title,
797+
}
798+
selectedDir, err := runtime.OpenDirectoryDialog(a.ctx, dialogOptions)
799+
if err != nil {
800+
log.Println("OpenDirectoryDialog:", err)
801+
return ""
802+
}
803+
804+
if selectedDir == "" {
805+
return ""
806+
}
807+
808+
return selectedDir
809+
}
810+
811+
func (a *App) ExportWeChatDataByUserName(userName, path string) string {
812+
if a.provider == nil || userName == "" || path == "" {
813+
return "invaild params" + userName
814+
}
815+
816+
if !utils.PathIsCanWriteFile(path) {
817+
log.Println("PathIsCanWriteFile: " + path)
818+
return "PathIsCanWriteFile: " + path
819+
}
820+
821+
exPath := path + "\\" + "wechatDataBackup_" + userName
822+
if _, err := os.Stat(exPath); err != nil {
823+
os.MkdirAll(exPath, os.ModePerm)
824+
} else {
825+
return "path exist:" + exPath
826+
}
827+
828+
log.Println("ExportWeChatDataByUserName:", userName, exPath)
829+
err := a.provider.WeChatExportDataByUserName(userName, exPath)
830+
if err != nil {
831+
log.Println("WeChatExportDataByUserName failed:", err)
832+
return "WeChatExportDataByUserName failed:" + err.Error()
833+
}
834+
835+
exeSrcPath := a.FLoader.FilePrefix + "\\" + "wechatDataBackup.exe"
836+
exeDstPath := exPath + "\\" + "wechatDataBackup.exe"
837+
_, err = utils.CopyFile(exeSrcPath, exeDstPath)
838+
if err != nil {
839+
log.Println("CopyFile:", err)
840+
return "CopyFile:" + err.Error()
841+
}
842+
843+
config := map[string]interface{}{
844+
"exportpath": ".\\",
845+
"userconfig": map[string]interface{}{
846+
"defaultuser": a.defaultUser,
847+
"users": []string{a.defaultUser},
848+
},
849+
}
850+
851+
configJson, err := json.MarshalIndent(config, "", " ")
852+
if err != nil {
853+
log.Println("MarshalIndent:", err)
854+
return "MarshalIndent:" + err.Error()
855+
}
856+
857+
configPath := exPath + "\\" + "config.json"
858+
err = os.WriteFile(configPath, configJson, os.ModePerm)
859+
if err != nil {
860+
log.Println("WriteFile:", err)
861+
return "WriteFile:" + err.Error()
862+
}
863+
864+
return ""
865+
}
866+
867+
func (a *App) GetAppIsShareData() bool {
868+
if a.provider != nil {
869+
return a.provider.IsShareData
870+
}
871+
return false
872+
}

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## v1.2.0
2+
1. 实现最后浏览位置记录和书签功能
3+
2. 实现会话导出分享功能
4+
3. 增加语音消息和通话消息的筛选
5+
4. 实现单聊会话对话人位置调换功能
6+
5. 添加繁体和英语表情的解析
7+
6. 修复相近时间的消息可能会出现顺序不对的问题
8+
19
## v1.1.0
210
1. 支持转账、通话、链接消息的显示
311
2. 支持名片、视频号、QQ音乐、小程序、定位等消息的显示
4.7 KB
Loading

frontend/dist/assets/index.0393a903.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/dist/assets/index.04e85ebe.js

Lines changed: 0 additions & 533 deletions
This file was deleted.

frontend/dist/assets/index.3ddb0aa4.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

frontend/dist/assets/index.e4a8c0f4.js

Lines changed: 533 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
4.13 KB
Loading

frontend/dist/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<meta charset="UTF-8"/>
55
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
66
<title>wechatDataBackup</title>
7-
<script type="module" crossorigin src="/assets/index.04e85ebe.js"></script>
8-
<link rel="stylesheet" href="/assets/index.3ddb0aa4.css">
7+
<script type="module" crossorigin src="/assets/index.e4a8c0f4.js"></script>
8+
<link rel="stylesheet" href="/assets/index.0393a903.css">
99
</head>
1010
<body >
1111
<div id="root"></div>

0 commit comments

Comments
 (0)