mirror of
https://git.um-react.app/um/cli.git
synced 2025-11-28 19:53:01 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2190e0ff5 | ||
|
|
c104a0bc6e | ||
|
|
a163d40fb2 | ||
|
|
40f93b4dd2 | ||
|
|
8c1f40bfe1 | ||
|
|
aea3bd5714 | ||
|
|
e4bfefd0a6 | ||
|
|
b1aa3bacdf | ||
|
|
6ec434f6b1 | ||
|
|
a46428e07c | ||
|
|
57dd4b80b3 | ||
|
|
e06a21123f |
75
CHANGELOG.md
Normal file
75
CHANGELOG.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [v0.2.18] - 2025-11-16
|
||||
|
||||
### Changed
|
||||
- QMC2: Fix `musicex\0` tag parsing.
|
||||
- MMKV: Improved tolerance for corrupted MMKV file parsing.
|
||||
- Updated project dependencies.
|
||||
|
||||
## [v0.2.17] - 2025-09-09 ⚠️ **(Broken Release)**
|
||||
|
||||
### Changed
|
||||
- Update RegEx used to extract UDID in plist.
|
||||
|
||||
## [v0.2.16] - 2025-09-09 ⚠️ **(Broken Release)**
|
||||
|
||||
### Changed
|
||||
- Update RegEx used to extract UDID in plist.
|
||||
|
||||
## [v0.2.15] - 2025-09-09 ⚠️ **(Broken Release)**
|
||||
|
||||
### Added
|
||||
- Support MMKV dump in QQMusic Mac 10.x (AppStore version).
|
||||
|
||||
## [v0.2.14] - 2025-09-08 ⚠️ **(Broken Release)**
|
||||
|
||||
### Added
|
||||
- Support MMKV dump in QQMusic Mac 10.x.
|
||||
|
||||
## [v0.2.13] - 2025-09-06 ⚠️ **(Broken Release)**
|
||||
|
||||
### Changed
|
||||
- Updated project namespace and repository URLs to new url
|
||||
- Upgraded Go version requirement to 1.25
|
||||
- Restricted KGG database support to Windows platform only
|
||||
- Enhanced MMKV key extraction logic with improved reliability
|
||||
|
||||
### Fixed
|
||||
- Fixed NCM metadata parsing to properly handle mixed-type artist arrays
|
||||
- Drop i386 targets in CI build
|
||||
|
||||
## [v0.2.12] - 2025-05-07
|
||||
|
||||
### Added
|
||||
- KGG (KGMv5) file format support
|
||||
- Support for `.mflacm` file extension
|
||||
|
||||
### Changed
|
||||
- Updated default version identifier to "custom" for development builds
|
||||
- Upgraded GoLang version
|
||||
|
||||
## [v0.2.11] - 2024-11-05
|
||||
|
||||
### Fixed
|
||||
- Resolved relative path resolution issues on Windows platforms (#108)
|
||||
- Improved cross-platform compatibility for file path handling
|
||||
|
||||
---
|
||||
|
||||
## Historical Versions
|
||||
|
||||
**Note**: This changelog was created starting from v0.2.11. For changes in earlier versions (v0.2.10 and below), please refer to the project's git commit history:
|
||||
|
||||
```bash
|
||||
git log --oneline --before="2024-11-05"
|
||||
```
|
||||
|
||||
Or view the complete commit history on the project repository for detailed information about features, fixes, and improvements in previous releases.
|
||||
@@ -1,22 +1,20 @@
|
||||
package qmc
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"git.um-react.app/um/cli/algo/common"
|
||||
"git.um-react.app/um/cli/algo/qmc/qmmac"
|
||||
"git.um-react.app/um/cli/internal/mmkv"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func LoadMMKVOrDefault(path string, key string, logger *zap.Logger) (result common.QMCKeys, err error) {
|
||||
key1, err := loadMacKeysV8(logger)
|
||||
key1, err := qmmac.LoadMacKeysV8(logger)
|
||||
if err != nil {
|
||||
key1 = nil
|
||||
logger.Warn("LoadMMKVOrDefault: could not read QQMusic v8.8.0 keys", zap.Error(err))
|
||||
}
|
||||
|
||||
key2, err := loadMacKeysV10(logger)
|
||||
key2, err := qmmac.LoadMacKeysV10(logger)
|
||||
if err != nil {
|
||||
key2 = nil
|
||||
logger.Warn("LoadMMKVOrDefault: could not read QQMusic v10.x keys", zap.Error(err))
|
||||
@@ -25,41 +23,16 @@ func LoadMMKVOrDefault(path string, key string, logger *zap.Logger) (result comm
|
||||
userKeys := make(common.QMCKeys)
|
||||
if path != "" {
|
||||
logger.Info("Using user mmkv")
|
||||
userKeys, err = LoadMMKV(path, key, logger)
|
||||
userKeys, err = mmkv.LoadFromPath(path, key, logger)
|
||||
if err != nil {
|
||||
userKeys = nil
|
||||
logger.Warn("LoadMMKVOrDefault: could not read user keys", zap.Error(err))
|
||||
}
|
||||
}
|
||||
|
||||
allKeys := mergeMMKVKeys(key1, key2, userKeys)
|
||||
allKeys := mmkv.Merge(key1, key2, userKeys)
|
||||
|
||||
logger.Debug("Keys loaded", zap.Any("keys", allKeys), zap.Int("len", len(allKeys)))
|
||||
|
||||
return allKeys, nil
|
||||
}
|
||||
|
||||
func loadMacKeysV8(logger *zap.Logger) (keys common.QMCKeys, err error) {
|
||||
homeDir, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
logger.Warn("Failed to get home dir")
|
||||
return nil, fmt.Errorf("loadMacKeysV8: failed to get home: %w", err)
|
||||
}
|
||||
p := filepath.Join(
|
||||
homeDir,
|
||||
"Library/Containers/com.tencent.QQMusicMac/Data",
|
||||
"Library/Application Support/QQMusicMac/mmkv",
|
||||
"MMKVStreamEncryptId",
|
||||
)
|
||||
if f, err := os.Stat(p); err == nil && !f.IsDir() {
|
||||
logger.Info("Using QQMusic 8.x mmkv", zap.String("mmkv", p))
|
||||
return LoadMMKV(p, "", logger)
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func loadMacKeysV10(logger *zap.Logger) (common.QMCKeys, error) {
|
||||
// TODO: stub only
|
||||
var _ = logger
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -137,11 +137,11 @@ func (d *Decoder) searchKey() (err error) {
|
||||
d.decodedKey, err = deriveKey([]byte(key))
|
||||
if err == nil {
|
||||
d.audioLen = fileSize
|
||||
return nil
|
||||
}
|
||||
} else {
|
||||
d.decodedKey = nil
|
||||
d.logger.Warn("could not derive key, skip", zap.Error(err))
|
||||
}
|
||||
}
|
||||
|
||||
suffixBuf := make([]byte, 4)
|
||||
if _, err := io.ReadFull(d.raw, suffixBuf); err != nil {
|
||||
@@ -153,7 +153,7 @@ func (d *Decoder) searchKey() (err error) {
|
||||
return d.readRawMetaQTag()
|
||||
case "STag":
|
||||
return errors.New("qmc: file with 'STag' suffix doesn't contains media key")
|
||||
// MusicEx\0
|
||||
// speculative guess for "musicex\0"
|
||||
case "cex\x00":
|
||||
footer, err := NewMusicExTag(d.raw)
|
||||
if err != nil {
|
||||
@@ -161,17 +161,26 @@ func (d *Decoder) searchKey() (err error) {
|
||||
}
|
||||
d.audioLen = fileSize - int(footer.TagSize)
|
||||
if key, ok := d.params.CryptoParams.QmcKeys.Get(footer.MediaFileName); ok {
|
||||
d.logger.Debug("searchKey: using key from MediaFileName", zap.String("MediaFileName", footer.MediaFileName), zap.String("key", key))
|
||||
d.decodedKey, err = deriveKey([]byte(key))
|
||||
} else if d.decodedKey == nil {
|
||||
return errors.New("searchKey: no key found for musicex tag")
|
||||
}
|
||||
return err
|
||||
default:
|
||||
size := binary.LittleEndian.Uint32(suffixBuf)
|
||||
// if we already have a key from legacy mmkv, use it
|
||||
if d.decodedKey != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
// try to use suffix as key length
|
||||
size := binary.LittleEndian.Uint32(suffixBuf)
|
||||
if size <= 0xFFFF && size != 0 { // assume size is key len
|
||||
return d.readRawKey(int64(size))
|
||||
}
|
||||
|
||||
// try to use default static cipher
|
||||
// try to use default static cipher,
|
||||
// or the key read from the legacy mmkv
|
||||
d.audioLen = fileSize
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -42,24 +42,25 @@ func NewMusicExTag(f io.ReadSeeker) (*MusicExTagV1, error) {
|
||||
tag := &MusicExTagV1{
|
||||
TagSize: binary.LittleEndian.Uint32(buffer[0x00:0x04]),
|
||||
TagVersion: binary.LittleEndian.Uint32(buffer[0x04:0x08]),
|
||||
TagMagic: buffer[0x04:0x0C],
|
||||
TagMagic: buffer[0x08:],
|
||||
}
|
||||
|
||||
if !bytes.Equal(tag.TagMagic, []byte("musicex\x00")) {
|
||||
return nil, errors.New("MusicEx magic mismatch")
|
||||
}
|
||||
if tag.TagVersion != 1 {
|
||||
return nil, errors.New(fmt.Sprintf("unsupported musicex tag version. expecting 1, got %d", tag.TagVersion))
|
||||
return nil, fmt.Errorf("unsupported musicex tag version. expecting 1, got %d", tag.TagVersion)
|
||||
}
|
||||
|
||||
if tag.TagSize < 0xC0 {
|
||||
return nil, errors.New(fmt.Sprintf("unsupported musicex tag size. expecting at least 0xC0, got 0x%02x", tag.TagSize))
|
||||
return nil, fmt.Errorf("unsupported musicex tag size. expecting at least 0xC0, got 0x%02x", tag.TagSize)
|
||||
}
|
||||
|
||||
buffer = make([]byte, tag.TagSize)
|
||||
f.Seek(-int64(tag.TagSize), io.SeekEnd)
|
||||
bytesRead, err = f.Read(buffer)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("MusicExV1: Read error %w", err)
|
||||
}
|
||||
if uint32(bytesRead) != tag.TagSize {
|
||||
return nil, fmt.Errorf("MusicExV1: read %d bytes (expected %d)", bytesRead, tag.TagSize)
|
||||
|
||||
@@ -61,7 +61,7 @@ func (d *Decoder) getMetaBySongID(ctx context.Context) error {
|
||||
|
||||
func (d *Decoder) searchMetaOnline(ctx context.Context, original common.AudioMeta) error {
|
||||
c := client.NewQQMusicClient() // todo: use global client
|
||||
keyword := lo.WithoutEmpty(append(
|
||||
keyword := lo.Compact(append(
|
||||
[]string{original.GetTitle(), original.GetAlbum()},
|
||||
original.GetArtists()...),
|
||||
)
|
||||
|
||||
163
algo/qmc/qmmac/v10_darwin.go
Normal file
163
algo/qmc/qmmac/v10_darwin.go
Normal file
@@ -0,0 +1,163 @@
|
||||
package qmmac
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"git.um-react.app/um/cli/algo/common"
|
||||
"git.um-react.app/um/cli/internal/mmkv"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
var _RE_UDID_V10 = regexp.MustCompile(`_\x10\(([0-9a-f]{40})`)
|
||||
|
||||
type QQMusicMacV10 struct {
|
||||
logger *zap.Logger
|
||||
mmkv_dir string
|
||||
}
|
||||
|
||||
func (q *QQMusicMacV10) extractUdids(data []byte) ([]string, error) {
|
||||
var result []string
|
||||
for _, match := range _RE_UDID_V10.FindAllSubmatch(data, -1) {
|
||||
udid := string(match[1])
|
||||
q.logger.Debug("extractUdids: found udid", zap.String("udid", udid))
|
||||
result = append(result, udid)
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (q *QQMusicMacV10) caesar(text string, shift int) string {
|
||||
var result strings.Builder
|
||||
|
||||
for _, char := range []byte(text) {
|
||||
var transformed byte
|
||||
if 'A' <= char && char <= 'Z' {
|
||||
transformed = (char-'A'+byte(shift))%26 + 'A'
|
||||
} else if 'a' <= char && char <= 'z' {
|
||||
transformed = (char-'a'+byte(shift))%26 + 'a'
|
||||
} else if '0' <= char && char <= '9' {
|
||||
transformed = (char-'0'+byte(shift))%10 + '0'
|
||||
} else {
|
||||
transformed = char
|
||||
}
|
||||
result.WriteByte(transformed)
|
||||
}
|
||||
|
||||
return result.String()
|
||||
}
|
||||
|
||||
func (q *QQMusicMacV10) mmkv(udid string, id int) (path string, key string, err error) {
|
||||
str1 := q.caesar(udid, id+3)
|
||||
int1, err := strconv.ParseInt(udid[5:7], 16, 32)
|
||||
if err != nil {
|
||||
return "", "", fmt.Errorf("getMmkv: could not parse udid: %w", err)
|
||||
}
|
||||
int2 := 5 + (int(int1)+id)%4
|
||||
name := str1[:int2]
|
||||
path = filepath.Join(q.mmkv_dir, name)
|
||||
|
||||
int3 := id + 0xa546
|
||||
str3 := fmt.Sprintf("%s%04x", udid, int3)
|
||||
hash := md5.Sum([]byte(str3))
|
||||
key = fmt.Sprintf("%x", hash)[:16]
|
||||
|
||||
return path, key, nil
|
||||
}
|
||||
|
||||
func (q *QQMusicMacV10) loadByPList(plist_path string) ([]common.QMCKeys, error) {
|
||||
logger := q.logger.With(zap.String("plist", plist_path))
|
||||
logger.Debug("loadMacKeysV10: load key from plist")
|
||||
if f, err := os.Stat(plist_path); err != nil || f.IsDir() {
|
||||
logger.Debug("loadMacKeysV10: plist not found")
|
||||
return nil, nil
|
||||
}
|
||||
plist_data, err := os.ReadFile(plist_path)
|
||||
if err != nil {
|
||||
logger.Warn("loadMacKeysV10: could not read plist", zap.Error(err))
|
||||
return nil, fmt.Errorf("loadMacKeysV10: could not read plist: %w", err)
|
||||
}
|
||||
udids, err := q.extractUdids(plist_data)
|
||||
if err != nil {
|
||||
logger.Warn("loadMacKeysV10: could not extract udid", zap.Error(err))
|
||||
return nil, fmt.Errorf("loadMacKeysV10: could not extract udid: %w", err)
|
||||
}
|
||||
logger.Debug("loadMacKeysV10: read udid", zap.Strings("udids", udids))
|
||||
|
||||
var keysList []common.QMCKeys
|
||||
for _, udid := range udids {
|
||||
keys, err := q.loadByUDID(udid, logger)
|
||||
if err != nil {
|
||||
logger.Warn("loadMacKeysV10: could not load by udid", zap.String("udid", udid), zap.Error(err))
|
||||
continue
|
||||
}
|
||||
keysList = append(keysList, keys)
|
||||
}
|
||||
return keysList, nil
|
||||
}
|
||||
func (q *QQMusicMacV10) loadByUDID(udid string, logger *zap.Logger) (common.QMCKeys, error) {
|
||||
mmkv_path, mmkv_key, err := q.mmkv(udid, 1)
|
||||
if err != nil {
|
||||
logger.Warn("loadMacKeysV10: could not get mmkv name/key", zap.Error(err))
|
||||
return nil, fmt.Errorf("loadMacKeysV10: could not get mmkv name/key: %w", err)
|
||||
}
|
||||
logger.Info("Using QQMusic 10.x mmkv", zap.String("mmkv", mmkv_path))
|
||||
keys, err := mmkv.LoadFromPath(mmkv_path, mmkv_key, logger)
|
||||
if err != nil {
|
||||
logger.Warn("loadMacKeysV10: could not load mmkv", zap.String("mmkv", mmkv_path), zap.Error(err))
|
||||
return nil, fmt.Errorf("loadMacKeysV10: could not load mmkv: %w", err)
|
||||
}
|
||||
return keys, nil
|
||||
}
|
||||
|
||||
func LoadMacKeysV10(logger *zap.Logger) (common.QMCKeys, error) {
|
||||
homeDir, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
logger.Warn("Failed to get home dir")
|
||||
return nil, fmt.Errorf("loadMacKeysV10: failed to get home: %w", err)
|
||||
}
|
||||
|
||||
// MMKV dir is always inside the sandbox container
|
||||
mmkv_dir := filepath.Join(
|
||||
homeDir,
|
||||
"Library/Containers/com.tencent.QQMusicMac/Data/",
|
||||
"Library/Application Support/QQMusicMac/iData",
|
||||
)
|
||||
if f, err := os.Stat(mmkv_dir); err != nil || !f.IsDir() {
|
||||
logger.Debug("loadMacKeysV10: mmkv dir not found", zap.String("mmkv_dir", mmkv_dir))
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// without sandbox
|
||||
plist_without_sandbox := filepath.Join(
|
||||
homeDir,
|
||||
"Library/Preferences/com.tencent.QQMusicMac.plist",
|
||||
)
|
||||
|
||||
// with sandbox (e.g. from App Store)
|
||||
plist_sandboxed := filepath.Join(
|
||||
homeDir,
|
||||
"Library/Containers/com.tencent.QQMusicMac/Data/",
|
||||
"Library/Preferences/com.tencent.QQMusicMac.plist",
|
||||
)
|
||||
|
||||
q := QQMusicMacV10{
|
||||
logger: logger,
|
||||
mmkv_dir: mmkv_dir,
|
||||
}
|
||||
|
||||
keys1, err := q.loadByPList(plist_without_sandbox)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
keys2, err := q.loadByPList(plist_sandboxed)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return mmkv.Merge(append(keys1, keys2...)...), nil
|
||||
}
|
||||
30
algo/qmc/qmmac/v8_darwin.go
Normal file
30
algo/qmc/qmmac/v8_darwin.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package qmmac
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"git.um-react.app/um/cli/algo/common"
|
||||
"git.um-react.app/um/cli/internal/mmkv"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func LoadMacKeysV8(logger *zap.Logger) (keys common.QMCKeys, err error) {
|
||||
homeDir, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
logger.Warn("Failed to get home dir")
|
||||
return nil, fmt.Errorf("loadMacKeysV8: failed to get home: %w", err)
|
||||
}
|
||||
p := filepath.Join(
|
||||
homeDir,
|
||||
"Library/Containers/com.tencent.QQMusicMac/Data",
|
||||
"Library/Application Support/QQMusicMac/mmkv",
|
||||
"MMKVStreamEncryptId",
|
||||
)
|
||||
if f, err := os.Stat(p); err == nil && !f.IsDir() {
|
||||
logger.Info("Using QQMusic 8.x mmkv", zap.String("mmkv", p))
|
||||
return mmkv.LoadFromPath(p, "", logger)
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
28
go.mod
28
go.mod
@@ -3,32 +3,32 @@ module git.um-react.app/um/cli
|
||||
go 1.25.1
|
||||
|
||||
require (
|
||||
github.com/fsnotify/fsnotify v1.8.0
|
||||
github.com/fsnotify/fsnotify v1.9.0
|
||||
github.com/go-flac/flacpicture v0.3.0
|
||||
github.com/go-flac/flacvorbis v0.2.0
|
||||
github.com/go-flac/go-flac v1.0.0
|
||||
github.com/samber/lo v1.47.0
|
||||
github.com/unlock-music/go-mmkv v0.1.1
|
||||
github.com/urfave/cli/v2 v2.27.5
|
||||
github.com/samber/lo v1.52.0
|
||||
github.com/unlock-music/go-mmkv v0.1.3
|
||||
github.com/urfave/cli/v2 v2.27.7
|
||||
go.uber.org/zap v1.27.0
|
||||
golang.org/x/crypto v0.29.0
|
||||
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394
|
||||
golang.org/x/text v0.20.0
|
||||
modernc.org/sqlite v1.37.0
|
||||
golang.org/x/crypto v0.44.0
|
||||
golang.org/x/text v0.31.0
|
||||
modernc.org/sqlite v1.40.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/ncruces/go-strftime v0.1.9 // indirect
|
||||
github.com/ncruces/go-strftime v1.0.0 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
|
||||
github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
golang.org/x/sys v0.31.0 // indirect
|
||||
modernc.org/libc v1.62.1 // indirect
|
||||
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
|
||||
golang.org/x/sys v0.38.0 // indirect
|
||||
modernc.org/libc v1.66.10 // indirect
|
||||
modernc.org/mathutil v1.7.1 // indirect
|
||||
modernc.org/memory v1.9.1 // indirect
|
||||
modernc.org/memory v1.11.0 // indirect
|
||||
)
|
||||
|
||||
82
go.sum
82
go.sum
@@ -1,11 +1,11 @@
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
|
||||
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
||||
github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
|
||||
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
|
||||
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
|
||||
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
|
||||
github.com/go-flac/flacpicture v0.3.0 h1:LkmTxzFLIynwfhHiZsX0s8xcr3/u33MzvV89u+zOT8I=
|
||||
github.com/go-flac/flacpicture v0.3.0/go.mod h1:DPbrzVYQ3fJcvSgLFp9HXIrEQEdfdk/+m0nQCzwodZI=
|
||||
github.com/go-flac/flacvorbis v0.2.0 h1:KH0xjpkNTXFER4cszH4zeJxYcrHbUobz/RticWGOESs=
|
||||
@@ -18,67 +18,69 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4=
|
||||
github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
|
||||
github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
|
||||
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
||||
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/samber/lo v1.47.0 h1:z7RynLwP5nbyRscyvcD043DWYoOcYRv3mV8lBeqOCLc=
|
||||
github.com/samber/lo v1.47.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU=
|
||||
github.com/samber/lo v1.52.0 h1:Rvi+3BFHES3A8meP33VPAxiBZX/Aws5RxrschYGjomw=
|
||||
github.com/samber/lo v1.52.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/unlock-music/go-mmkv v0.1.1 h1:1w3shjaBMp58jRrRkxPghnMpvyUoP4ZkA++W9ueFpE8=
|
||||
github.com/unlock-music/go-mmkv v0.1.1/go.mod h1:E1h/HBpWPOKnCQw6LSQZkMpzxQojGDe+T5f/DRDXBsc=
|
||||
github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w=
|
||||
github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
|
||||
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
|
||||
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
|
||||
github.com/unlock-music/go-mmkv v0.1.3 h1:BtO77wjmypCeaX3n8VRDX5ZWHlYdJ9xEfKGui9s4PM0=
|
||||
github.com/unlock-music/go-mmkv v0.1.3/go.mod h1:u1fYHzYOO7et1E55Q86lTvjXf6p14CIELszAHI8T9zQ=
|
||||
github.com/urfave/cli/v2 v2.27.7 h1:bH59vdhbjLv3LAvIu6gd0usJHgoTTPhCFib8qqOwXYU=
|
||||
github.com/urfave/cli/v2 v2.27.7/go.mod h1:CyNAG/xg+iAOg0N4MPGZqVmv2rCoP267496AOXUZjA4=
|
||||
github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 h1:FnBeRrxr7OU4VvAzt5X7s6266i6cSVkkFPS0TuXWbIg=
|
||||
github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
|
||||
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
||||
golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
|
||||
golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
|
||||
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw=
|
||||
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394/go.mod h1:sIifuuw/Yco/y6yb6+bDNfyeQ/MdPUy/hKEMYQV17cM=
|
||||
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
|
||||
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
|
||||
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
|
||||
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/crypto v0.44.0 h1:A97SsFvM3AIwEEmTBiaxPPTYpDC47w720rdiiUvgoAU=
|
||||
golang.org/x/crypto v0.44.0/go.mod h1:013i+Nw79BMiQiMsOPcVCB5ZIJbYkerPrGnOa00tvmc=
|
||||
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o=
|
||||
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8=
|
||||
golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
|
||||
golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
|
||||
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
|
||||
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
|
||||
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
|
||||
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
|
||||
golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU=
|
||||
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=
|
||||
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
|
||||
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
|
||||
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
|
||||
golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
|
||||
golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
modernc.org/cc/v4 v4.25.2 h1:T2oH7sZdGvTaie0BRNFbIYsabzCxUQg8nLqCdQ2i0ic=
|
||||
modernc.org/cc/v4 v4.25.2/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0=
|
||||
modernc.org/ccgo/v4 v4.25.1 h1:TFSzPrAGmDsdnhT9X2UrcPMI3N/mJ9/X9ykKXwLhDsU=
|
||||
modernc.org/ccgo/v4 v4.25.1/go.mod h1:njjuAYiPflywOOrm3B7kCB444ONP5pAVr8PIEoE0uDw=
|
||||
modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE=
|
||||
modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ=
|
||||
modernc.org/cc/v4 v4.26.5 h1:xM3bX7Mve6G8K8b+T11ReenJOT+BmVqQj0FY5T4+5Y4=
|
||||
modernc.org/cc/v4 v4.26.5/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0=
|
||||
modernc.org/ccgo/v4 v4.28.1 h1:wPKYn5EC/mYTqBO373jKjvX2n+3+aK7+sICCv4Fjy1A=
|
||||
modernc.org/ccgo/v4 v4.28.1/go.mod h1:uD+4RnfrVgE6ec9NGguUNdhqzNIeeomeXf6CL0GTE5Q=
|
||||
modernc.org/fileutil v1.3.40 h1:ZGMswMNc9JOCrcrakF1HrvmergNLAmxOPjizirpfqBA=
|
||||
modernc.org/fileutil v1.3.40/go.mod h1:HxmghZSZVAz/LXcMNwZPA/DRrQZEVP9VX0V4LQGQFOc=
|
||||
modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI=
|
||||
modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito=
|
||||
modernc.org/libc v1.62.1 h1:s0+fv5E3FymN8eJVmnk0llBe6rOxCu/DEU+XygRbS8s=
|
||||
modernc.org/libc v1.62.1/go.mod h1:iXhATfJQLjG3NWy56a6WVU73lWOcdYVxsvwCgoPljuo=
|
||||
modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks=
|
||||
modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI=
|
||||
modernc.org/libc v1.66.10 h1:yZkb3YeLx4oynyR+iUsXsybsX4Ubx7MQlSYEw4yj59A=
|
||||
modernc.org/libc v1.66.10/go.mod h1:8vGSEwvoUoltr4dlywvHqjtAqHBaw0j1jI7iFBTAr2I=
|
||||
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
|
||||
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
|
||||
modernc.org/memory v1.9.1 h1:V/Z1solwAVmMW1yttq3nDdZPJqV1rM05Ccq6KMSZ34g=
|
||||
modernc.org/memory v1.9.1/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
|
||||
modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
|
||||
modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
|
||||
modernc.org/opt v0.1.4 h1:2kNGMRiUjrp4LcaPuLY2PzUfqM/w9N23quVwhKt5Qm8=
|
||||
modernc.org/opt v0.1.4/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
|
||||
modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=
|
||||
modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE=
|
||||
modernc.org/sqlite v1.37.0 h1:s1TMe7T3Q3ovQiK2Ouz4Jwh7dw4ZDqbebSDTlSJdfjI=
|
||||
modernc.org/sqlite v1.37.0/go.mod h1:5YiWv+YviqGMuGw4V+PNplcyaJ5v+vQd7TQOgkACoJM=
|
||||
modernc.org/sqlite v1.40.0 h1:bNWEDlYhNPAUdUdBzjAvn8icAs/2gaKlj4vM+tQ6KdQ=
|
||||
modernc.org/sqlite v1.40.0/go.mod h1:9fjQZ0mB1LLP0GYrp39oOJXx/I2sxEnZtzCmEQIKvGE=
|
||||
modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0=
|
||||
modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A=
|
||||
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
|
||||
|
||||
@@ -2,14 +2,15 @@ package ffmpeg
|
||||
|
||||
import (
|
||||
"context"
|
||||
"go.uber.org/zap"
|
||||
"mime"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/go-flac/flacpicture"
|
||||
"github.com/go-flac/flacvorbis"
|
||||
"github.com/go-flac/go-flac"
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
||||
func updateMetaFlac(_ context.Context, outPath string, m *UpdateMetadataParams, logger *zap.Logger) error {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package qmc
|
||||
package mmkv
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"git.um-react.app/um/cli/algo/common"
|
||||
"git.um-react.app/um/cli/internal/utils"
|
||||
@@ -11,7 +10,7 @@ import (
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func mergeMMKVKeys(keys ...common.QMCKeys) common.QMCKeys {
|
||||
func Merge(keys ...common.QMCKeys) common.QMCKeys {
|
||||
result := make(common.QMCKeys)
|
||||
for _, k := range keys {
|
||||
for key, value := range k {
|
||||
@@ -21,7 +20,7 @@ func mergeMMKVKeys(keys ...common.QMCKeys) common.QMCKeys {
|
||||
return result
|
||||
}
|
||||
|
||||
func LoadMMKV(path string, key string, logger *zap.Logger) (result common.QMCKeys, err error) {
|
||||
func LoadFromPath(path string, key string, logger *zap.Logger) (result common.QMCKeys, err error) {
|
||||
mmkv_path := path
|
||||
mmkv_crc := path + ".crc"
|
||||
|
||||
@@ -33,9 +32,11 @@ func LoadMMKV(path string, key string, logger *zap.Logger) (result common.QMCKey
|
||||
defer mr.Close()
|
||||
|
||||
cr, err := os.Open(mmkv_crc)
|
||||
if err == nil {
|
||||
if err != nil {
|
||||
// crc is optional
|
||||
cr = nil
|
||||
logger.Warn("LoadMMKV: Failed to open crc file, assuming no encryption", zap.Error(err))
|
||||
key = ""
|
||||
} else {
|
||||
defer cr.Close()
|
||||
}
|
||||
|
||||
@@ -68,41 +69,3 @@ func LoadMMKV(path string, key string, logger *zap.Logger) (result common.QMCKey
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// getRelativeMMKVDir get mmkv dir relative to file (legacy QQMusic for macOS behaviour)
|
||||
func getRelativeMMKVDir(file string) (string, error) {
|
||||
mmkvDir := filepath.Join(filepath.Dir(file), "../mmkv")
|
||||
if _, err := os.Stat(mmkvDir); err != nil {
|
||||
return "", fmt.Errorf("stat default mmkv dir: %w", err)
|
||||
}
|
||||
|
||||
keyFile := filepath.Join(mmkvDir, "MMKVStreamEncryptId")
|
||||
if _, err := os.Stat(keyFile); err != nil {
|
||||
return "", fmt.Errorf("stat default mmkv file: %w", err)
|
||||
}
|
||||
|
||||
return mmkvDir, nil
|
||||
}
|
||||
|
||||
func getDefaultMMKVDir() (string, error) {
|
||||
homeDir, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("get user home dir: %w", err)
|
||||
}
|
||||
|
||||
mmkvDir := filepath.Join(
|
||||
homeDir,
|
||||
"Library/Containers/com.tencent.QQMusicMac/Data",
|
||||
"Library/Application Support/QQMusicMac/mmkv",
|
||||
)
|
||||
if _, err := os.Stat(mmkvDir); err != nil {
|
||||
return "", fmt.Errorf("stat default mmkv dir: %w", err)
|
||||
}
|
||||
|
||||
keyFile := filepath.Join(mmkvDir, "MMKVStreamEncryptId")
|
||||
if _, err := os.Stat(keyFile); err != nil {
|
||||
return "", fmt.Errorf("stat default mmkv file: %w", err)
|
||||
}
|
||||
|
||||
return mmkvDir, nil
|
||||
}
|
||||
@@ -3,8 +3,7 @@ package sniff
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
|
||||
"golang.org/x/exp/slices"
|
||||
"slices"
|
||||
)
|
||||
|
||||
type Sniffer interface {
|
||||
|
||||
Reference in New Issue
Block a user