Skip to content

Commit

Permalink
兼容不需要解包的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuweiyou committed Jul 28, 2023
1 parent 2bf7f73 commit 875ee31
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@ func main() {
from := strings.ReplaceAll(os.Args[1], "\\", "/")
fromParts := strings.Split(from, "/")
wxid := fromParts[len(fromParts)-3]
fmt.Println("wxid", wxid)

err := Decrypt(from, wxid)
if err != nil {
fmt.Println(err)
return
needDecrypt := strings.HasPrefix(wxid, "wx")
if needDecrypt {
fmt.Println("wxid", wxid)
err := Decrypt(from, wxid)
if err != nil {
fmt.Println(err)
return
}
from += DecryptTo
}

err = Unpack(from + DecryptTo)
err := Unpack(from)
if err != nil {
fmt.Println(err)
return
Expand Down

0 comments on commit 875ee31

Please sign in to comment.