Skip to content

Commit

Permalink
1. 支持转账、通话、链接消息的显示
Browse files Browse the repository at this point in the history
2. 支持名片、视频号、QQ音乐、小程序、定位等消息的显示
3. 支持直播、游戏消息、语音通话、视频通话等消息的显示
4. 解密前判断对数据库是否有读权限
5. system消息html格式转文本
  • Loading branch information
git-jiadong committed Jan 13, 2025
1 parent f1a32a3 commit c13e680
Show file tree
Hide file tree
Showing 18 changed files with 835 additions and 563 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ wails build
- [x] 支持链接消息
- [x] 支持语音消息
- [x] 支持文件消息
- [x] 支持名片消息
- [x] 支持定位消息
- [x] 支持视频/语音通话消息
- [x] 支持QQ音乐消息
- [x] 支持第三方视频软件分享消息
- [x] 支持分享表情集消息
- [x] 支持小程序消息
- [x] 支持视频号/直播消息
- [x] 支持转账消息
- [x] 支持腾讯游戏分享消息
- [x] 支持原始表情显示
- [x] 支持按类型检索
- [x] 支持日期检索
Expand Down
2 changes: 1 addition & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (
configDefaultUserKey = "userConfig.defaultUser"
configUsersKey = "userConfig.users"
configExportPathKey = "exportPath"
appVersion = "v1.0.6"
appVersion = "v1.1.0"
)

type FileLoader struct {
Expand Down
12 changes: 12 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## v1.1.0
1. 支持转账、通话、链接消息的显示
2. 支持名片、视频号、QQ音乐、小程序、定位等消息的显示
3. 支持直播、游戏消息、语音通话、视频通话等消息的显示
4. 解密前判断对数据库是否有读权限
5. system消息html格式转文本

## v1.0.7
1. 修复出现空数据库时不显示,聊天显示不全的问题
2. 解决安卓平板扫码登陆的情况下解密失败的问题
3. 移除lame和silk代码,改用mod的方式引入

## v1.0.6
1. 图片/视频查看重新实现,保持与微信一致
2. 增加软件信息页面
Expand Down
Binary file added frontend/dist/assets/applet.ce6471b1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/dist/assets/channels.33204285.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/dist/assets/channels_error.1d149df5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
533 changes: 533 additions & 0 deletions frontend/dist/assets/index.04e85ebe.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frontend/dist/assets/index.3ddb0aa4.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion frontend/dist/assets/index.a11c4643.css

This file was deleted.

533 changes: 0 additions & 533 deletions frontend/dist/assets/index.d5e97187.js

This file was deleted.

Binary file added frontend/dist/assets/map.b91d2cda.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/dist/assets/music_note.02e237d9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/dist/assets/qq_music.b548e6a1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions frontend/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="UTF-8"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>wechatDataBackup</title>
<script type="module" crossorigin src="/assets/index.d5e97187.js"></script>
<link rel="stylesheet" href="/assets/index.a11c4643.css">
<script type="module" crossorigin src="/assets/index.04e85ebe.js"></script>
<link rel="stylesheet" href="/assets/index.3ddb0aa4.css">
</head>
<body >
<div id="root"></div>
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ require (
github.com/shirou/gopsutil/v3 v3.24.2
github.com/spf13/viper v1.18.2
github.com/wailsapp/wails/v2 v2.9.1
golang.org/x/net v0.25.0
golang.org/x/sys v0.20.0
google.golang.org/protobuf v1.31.0
gopkg.in/natefinch/lumberjack.v2 v2.2.1
Expand Down Expand Up @@ -62,7 +63,6 @@ require (
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/text v0.15.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
80 changes: 80 additions & 0 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
package utils

import (
"crypto/md5"
"encoding/hex"
"errors"
"fmt"
"io"
"log"
"os"
"os/exec"
"path/filepath"
"regexp"
"strings"

"github.com/pkg/browser"
"github.com/shirou/gopsutil/v3/disk"
"golang.org/x/net/html"
"golang.org/x/sys/windows/registry"
)

Expand Down Expand Up @@ -150,3 +154,79 @@ func CopyFile(src, dst string) (int64, error) {

return bytesWritten, nil
}

func extractTextFromHTML(htmlStr string) string {
doc, err := html.Parse(strings.NewReader(htmlStr))
if err != nil {
fmt.Println("Error parsing HTML:", err)
return ""
}

var extractText func(*html.Node) string
extractText = func(n *html.Node) string {
if n.Type == html.TextNode {
return n.Data
}

var text string
for c := n.FirstChild; c != nil; c = c.NextSibling {
text += extractText(c)
}
return text
}

return extractText(doc)
}

func removeCustomTags(input string) string {

re := regexp.MustCompile(`<(_wc_custom_link_)[^>]*?>`)
return re.ReplaceAllString(input, `$2`)
}

func Html2Text(htmlStr string) string {
if htmlStr[0] != '<' {
return htmlStr
}

text := extractTextFromHTML(htmlStr)
if strings.Contains(text, `<_wc_custom_link_`) {
text = "\U0001F9E7" + removeCustomTags(text)
}

return text
}

func HtmlMsgGetAttr(htmlStr, tag string) map[string]string {

doc, err := html.Parse(strings.NewReader(htmlStr))
if err != nil {
fmt.Println("Error parsing HTML:", err)
return nil
}

var attributes map[string]string
var findAttributes func(*html.Node)
findAttributes = func(n *html.Node) {
if n.Type == html.ElementNode && n.Data == tag {
attributes = make(map[string]string)
for _, attr := range n.Attr {
attributes[attr.Key] = attr.Val
}
}
for c := n.FirstChild; c != nil; c = c.NextSibling {
findAttributes(c)
}
}

findAttributes(doc)
return attributes
}

func Hash256Sum(data []byte) string {
hash := md5.New()
hash.Write([]byte(data))
hashSum := hash.Sum(nil)

return hex.EncodeToString(hashSum)
}
6 changes: 6 additions & 0 deletions pkg/wechat/wechat.go
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,12 @@ func Is64BitProcess(pid uint32) (bool, error) {
}

func GetWeChatKey(info *WeChatInfo) string {
mediaDB := info.FilePath + "\\Msg\\Media.db"
if _, err := os.Stat(mediaDB); err != nil {
log.Printf("open db %s error: %v", mediaDB, err)
return ""
}

handle, err := windows.OpenProcess(windows.PROCESS_QUERY_INFORMATION|windows.PROCESS_VM_READ, false, uint32(info.ProcessID))
if err != nil {
log.Println("Error opening process:", err)
Expand Down
Loading

0 comments on commit c13e680

Please sign in to comment.