mirror of
https://git.um-react.app/um/cli.git
synced 2025-11-28 19:53:01 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61fba401c7 | ||
|
|
a968be6063 | ||
|
|
000ef4ac13 | ||
|
|
05e5783336 | ||
|
|
006bad8c48 | ||
|
|
380ed78b6b | ||
|
|
208aceb1b5 | ||
|
|
28ca8cef60 | ||
|
|
2b0bd2985e | ||
|
|
72ace9fc62 | ||
|
|
074e4f874f | ||
|
|
2bfb5ffddf | ||
|
|
2c9de7c56c |
@@ -33,7 +33,7 @@ local StepGoBuild(GOOS, GOARCH) = {
|
|||||||
],
|
],
|
||||||
|
|
||||||
name: 'go build %s/%s' % [GOOS, GOARCH],
|
name: 'go build %s/%s' % [GOOS, GOARCH],
|
||||||
image: 'golang:1.22',
|
image: 'golang:1.23',
|
||||||
environment: {
|
environment: {
|
||||||
GOOS: GOOS,
|
GOOS: GOOS,
|
||||||
GOARCH: GOARCH,
|
GOARCH: GOARCH,
|
||||||
@@ -54,7 +54,7 @@ local StepUploadArtifact(GOOS, GOARCH) = {
|
|||||||
local pkgname = '${DRONE_REPO_NAME}-build',
|
local pkgname = '${DRONE_REPO_NAME}-build',
|
||||||
|
|
||||||
name: 'upload artifact',
|
name: 'upload artifact',
|
||||||
image: 'golang:1.22', // reuse golang:1.19 for curl
|
image: 'golang:1.23', // reuse golang:1.19 for curl
|
||||||
environment: {
|
environment: {
|
||||||
DRONE_GITEA_SERVER: 'https://git.unlock-music.dev',
|
DRONE_GITEA_SERVER: 'https://git.unlock-music.dev',
|
||||||
GITEA_API_KEY: { from_secret: 'GITEA_API_KEY' },
|
GITEA_API_KEY: { from_secret: 'GITEA_API_KEY' },
|
||||||
@@ -83,7 +83,7 @@ local PipelineBuild(GOOS, GOARCH, RUN_TEST) = {
|
|||||||
(
|
(
|
||||||
if RUN_TEST then [{
|
if RUN_TEST then [{
|
||||||
name: 'go test',
|
name: 'go test',
|
||||||
image: 'golang:1.22',
|
image: 'golang:1.23',
|
||||||
environment: {
|
environment: {
|
||||||
GOPROXY: 'https://goproxy.io,direct',
|
GOPROXY: 'https://goproxy.io,direct',
|
||||||
},
|
},
|
||||||
@@ -112,7 +112,7 @@ local PipelineRelease() = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'go test',
|
name: 'go test',
|
||||||
image: 'golang:1.22',
|
image: 'golang:1.23',
|
||||||
environment: {
|
environment: {
|
||||||
GOPROXY: 'https://goproxy.io,direct',
|
GOPROXY: 'https://goproxy.io,direct',
|
||||||
},
|
},
|
||||||
@@ -128,7 +128,7 @@ local PipelineRelease() = {
|
|||||||
StepGoBuild('darwin', 'arm64'),
|
StepGoBuild('darwin', 'arm64'),
|
||||||
{
|
{
|
||||||
name: 'prepare root',
|
name: 'prepare root',
|
||||||
image: 'golang:1.22',
|
image: 'golang:1.23',
|
||||||
commands: [
|
commands: [
|
||||||
'mv dist/*.tar.gz dist/*.zip ./',
|
'mv dist/*.tar.gz dist/*.zip ./',
|
||||||
],
|
],
|
||||||
|
|||||||
34
.drone.yml
34
.drone.yml
@@ -10,7 +10,7 @@ steps:
|
|||||||
- go test -v ./...
|
- go test -v ./...
|
||||||
environment:
|
environment:
|
||||||
GOPROXY: https://goproxy.io,direct
|
GOPROXY: https://goproxy.io,direct
|
||||||
image: golang:1.22
|
image: golang:1.23
|
||||||
name: go test
|
name: go test
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
@@ -23,7 +23,7 @@ steps:
|
|||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
GOOS: linux
|
GOOS: linux
|
||||||
GOPROXY: https://goproxy.io,direct
|
GOPROXY: https://goproxy.io,direct
|
||||||
image: golang:1.22
|
image: golang:1.23
|
||||||
name: go build linux/amd64
|
name: go build linux/amd64
|
||||||
- commands:
|
- commands:
|
||||||
- curl --fail --include --user "um-release-bot:$GITEA_API_KEY" --upload-file "dist/um-linux-amd64-$(git
|
- curl --fail --include --user "um-release-bot:$GITEA_API_KEY" --upload-file "dist/um-linux-amd64-$(git
|
||||||
@@ -35,7 +35,7 @@ steps:
|
|||||||
DRONE_GITEA_SERVER: https://git.unlock-music.dev
|
DRONE_GITEA_SERVER: https://git.unlock-music.dev
|
||||||
GITEA_API_KEY:
|
GITEA_API_KEY:
|
||||||
from_secret: GITEA_API_KEY
|
from_secret: GITEA_API_KEY
|
||||||
image: golang:1.22
|
image: golang:1.23
|
||||||
name: upload artifact
|
name: upload artifact
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
@@ -61,7 +61,7 @@ steps:
|
|||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
GOOS: windows
|
GOOS: windows
|
||||||
GOPROXY: https://goproxy.io,direct
|
GOPROXY: https://goproxy.io,direct
|
||||||
image: golang:1.22
|
image: golang:1.23
|
||||||
name: go build windows/amd64
|
name: go build windows/amd64
|
||||||
- commands:
|
- commands:
|
||||||
- curl --fail --include --user "um-release-bot:$GITEA_API_KEY" --upload-file "dist/um-windows-amd64-$(git
|
- curl --fail --include --user "um-release-bot:$GITEA_API_KEY" --upload-file "dist/um-windows-amd64-$(git
|
||||||
@@ -73,7 +73,7 @@ steps:
|
|||||||
DRONE_GITEA_SERVER: https://git.unlock-music.dev
|
DRONE_GITEA_SERVER: https://git.unlock-music.dev
|
||||||
GITEA_API_KEY:
|
GITEA_API_KEY:
|
||||||
from_secret: GITEA_API_KEY
|
from_secret: GITEA_API_KEY
|
||||||
image: golang:1.22
|
image: golang:1.23
|
||||||
name: upload artifact
|
name: upload artifact
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
@@ -99,7 +99,7 @@ steps:
|
|||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
GOOS: darwin
|
GOOS: darwin
|
||||||
GOPROXY: https://goproxy.io,direct
|
GOPROXY: https://goproxy.io,direct
|
||||||
image: golang:1.22
|
image: golang:1.23
|
||||||
name: go build darwin/amd64
|
name: go build darwin/amd64
|
||||||
- commands:
|
- commands:
|
||||||
- curl --fail --include --user "um-release-bot:$GITEA_API_KEY" --upload-file "dist/um-darwin-amd64-$(git
|
- curl --fail --include --user "um-release-bot:$GITEA_API_KEY" --upload-file "dist/um-darwin-amd64-$(git
|
||||||
@@ -111,7 +111,7 @@ steps:
|
|||||||
DRONE_GITEA_SERVER: https://git.unlock-music.dev
|
DRONE_GITEA_SERVER: https://git.unlock-music.dev
|
||||||
GITEA_API_KEY:
|
GITEA_API_KEY:
|
||||||
from_secret: GITEA_API_KEY
|
from_secret: GITEA_API_KEY
|
||||||
image: golang:1.22
|
image: golang:1.23
|
||||||
name: upload artifact
|
name: upload artifact
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
@@ -130,7 +130,7 @@ steps:
|
|||||||
- go test -v ./...
|
- go test -v ./...
|
||||||
environment:
|
environment:
|
||||||
GOPROXY: https://goproxy.io,direct
|
GOPROXY: https://goproxy.io,direct
|
||||||
image: golang:1.22
|
image: golang:1.23
|
||||||
name: go test
|
name: go test
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
@@ -143,7 +143,7 @@ steps:
|
|||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
GOOS: linux
|
GOOS: linux
|
||||||
GOPROXY: https://goproxy.io,direct
|
GOPROXY: https://goproxy.io,direct
|
||||||
image: golang:1.22
|
image: golang:1.23
|
||||||
name: go build linux/amd64
|
name: go build linux/amd64
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
@@ -156,7 +156,7 @@ steps:
|
|||||||
GOARCH: arm64
|
GOARCH: arm64
|
||||||
GOOS: linux
|
GOOS: linux
|
||||||
GOPROXY: https://goproxy.io,direct
|
GOPROXY: https://goproxy.io,direct
|
||||||
image: golang:1.22
|
image: golang:1.23
|
||||||
name: go build linux/arm64
|
name: go build linux/arm64
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
@@ -168,7 +168,7 @@ steps:
|
|||||||
GOARCH: "386"
|
GOARCH: "386"
|
||||||
GOOS: linux
|
GOOS: linux
|
||||||
GOPROXY: https://goproxy.io,direct
|
GOPROXY: https://goproxy.io,direct
|
||||||
image: golang:1.22
|
image: golang:1.23
|
||||||
name: go build linux/386
|
name: go build linux/386
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
@@ -181,7 +181,7 @@ steps:
|
|||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
GOOS: windows
|
GOOS: windows
|
||||||
GOPROXY: https://goproxy.io,direct
|
GOPROXY: https://goproxy.io,direct
|
||||||
image: golang:1.22
|
image: golang:1.23
|
||||||
name: go build windows/amd64
|
name: go build windows/amd64
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
@@ -194,7 +194,7 @@ steps:
|
|||||||
GOARCH: arm64
|
GOARCH: arm64
|
||||||
GOOS: windows
|
GOOS: windows
|
||||||
GOPROXY: https://goproxy.io,direct
|
GOPROXY: https://goproxy.io,direct
|
||||||
image: golang:1.22
|
image: golang:1.23
|
||||||
name: go build windows/arm64
|
name: go build windows/arm64
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
@@ -207,7 +207,7 @@ steps:
|
|||||||
GOARCH: "386"
|
GOARCH: "386"
|
||||||
GOOS: windows
|
GOOS: windows
|
||||||
GOPROXY: https://goproxy.io,direct
|
GOPROXY: https://goproxy.io,direct
|
||||||
image: golang:1.22
|
image: golang:1.23
|
||||||
name: go build windows/386
|
name: go build windows/386
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
@@ -220,7 +220,7 @@ steps:
|
|||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
GOOS: darwin
|
GOOS: darwin
|
||||||
GOPROXY: https://goproxy.io,direct
|
GOPROXY: https://goproxy.io,direct
|
||||||
image: golang:1.22
|
image: golang:1.23
|
||||||
name: go build darwin/amd64
|
name: go build darwin/amd64
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
@@ -233,11 +233,11 @@ steps:
|
|||||||
GOARCH: arm64
|
GOARCH: arm64
|
||||||
GOOS: darwin
|
GOOS: darwin
|
||||||
GOPROXY: https://goproxy.io,direct
|
GOPROXY: https://goproxy.io,direct
|
||||||
image: golang:1.22
|
image: golang:1.23
|
||||||
name: go build darwin/arm64
|
name: go build darwin/arm64
|
||||||
- commands:
|
- commands:
|
||||||
- mv dist/*.tar.gz dist/*.zip ./
|
- mv dist/*.tar.gz dist/*.zip ./
|
||||||
image: golang:1.22
|
image: golang:1.23
|
||||||
name: prepare root
|
name: prepare root
|
||||||
- image: plugins/gitea-release
|
- image: plugins/gitea-release
|
||||||
name: create release
|
name: create release
|
||||||
|
|||||||
108
.gitea/workflows/build.yml
Normal file
108
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
name: Build
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- "**/*.go"
|
||||||
|
- "go.mod"
|
||||||
|
- "go.sum"
|
||||||
|
- ".gitea/workflows/*.yml"
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
types: [ opened, synchronize, reopened ]
|
||||||
|
paths:
|
||||||
|
- "**/*.go"
|
||||||
|
- "go.mod"
|
||||||
|
- "go.sum"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
GOOS:
|
||||||
|
- linux
|
||||||
|
- windows
|
||||||
|
- darwin
|
||||||
|
GOARCH:
|
||||||
|
- "amd64"
|
||||||
|
- "386"
|
||||||
|
- "arm64"
|
||||||
|
|
||||||
|
exclude:
|
||||||
|
- GOOS: darwin
|
||||||
|
GOARCH: "386"
|
||||||
|
|
||||||
|
include:
|
||||||
|
- GOOS: windows
|
||||||
|
BIN_SUFFIX: ".exe"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout codebase
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Go 1.23
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: ^1.23
|
||||||
|
|
||||||
|
- name: Setup vars
|
||||||
|
id: vars
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
|
||||||
|
echo "::set-output name=git_tag::$(git describe --tags --always)"
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: go test -v ./...
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
env:
|
||||||
|
GOOS: ${{ matrix.GOOS }}
|
||||||
|
GOARCH: ${{ matrix.GOARCH }}
|
||||||
|
CGO_ENABLED: 0
|
||||||
|
run: go build -v -trimpath -ldflags="-w -s -X main.AppVersion=${{ steps.vars.outputs.git_tag }}" -o um-${{ matrix.GOOS }}-${{ matrix.GOARCH }}${{ matrix.BIN_SUFFIX }} ./cmd/um
|
||||||
|
|
||||||
|
- name: Publish artifact
|
||||||
|
uses: christopherhx/gitea-upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: um-${{ matrix.GOOS }}-${{ matrix.GOARCH }}
|
||||||
|
path: ./um-${{ matrix.GOOS }}-${{ matrix.GOARCH }}${{ matrix.BIN_SUFFIX }}
|
||||||
|
|
||||||
|
archive:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- name: prepare archive
|
||||||
|
run: |
|
||||||
|
mkdir -p dist prepare
|
||||||
|
- name: Download artifacts
|
||||||
|
uses: christopherhx/gitea-download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: prepare
|
||||||
|
pattern: um-*
|
||||||
|
- name: prepare archive
|
||||||
|
run: |
|
||||||
|
for exe in prepare/*/um-*.exe; do
|
||||||
|
zip -9 -j "dist/$(basename "$exe" .exe).zip" "$exe"
|
||||||
|
rm -f "$exe"
|
||||||
|
done
|
||||||
|
for exe in prepare/*/um-*; do
|
||||||
|
tar \
|
||||||
|
--sort=name --format=posix \
|
||||||
|
--pax-option=exthdr.name=%d/PaxHeaders/%f \
|
||||||
|
--pax-option=delete=atime,delete=ctime \
|
||||||
|
--clamp-mtime --mtime='1970-01-01T00:00:00Z' \
|
||||||
|
--numeric-owner --owner=0 --group=0 \
|
||||||
|
--mode=0755 \
|
||||||
|
-cv \
|
||||||
|
-C "$(dirname "$exe")" \
|
||||||
|
"$(basename "$exe")" \
|
||||||
|
| gzip -9 > "dist/$(basename "$exe").tar.gz"
|
||||||
|
rm -f "$exe"
|
||||||
|
done
|
||||||
|
- name: Publish all-in-one archive
|
||||||
|
uses: christopherhx/gitea-upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: dist-all
|
||||||
|
path: dist
|
||||||
67
.github/workflows/build.yml
vendored
67
.github/workflows/build.yml
vendored
@@ -1,67 +0,0 @@
|
|||||||
name: Build
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- "**/*.go"
|
|
||||||
- "go.mod"
|
|
||||||
- "go.sum"
|
|
||||||
- ".github/workflows/*.yml"
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
types: [ opened, synchronize, reopened ]
|
|
||||||
paths:
|
|
||||||
- "**/*.go"
|
|
||||||
- "go.mod"
|
|
||||||
- "go.sum"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- target: "linux/amd64"
|
|
||||||
GOOS: "linux"
|
|
||||||
GOARCH: "amd64"
|
|
||||||
BIN_SUFFIX: ""
|
|
||||||
- target: "windows/amd64"
|
|
||||||
GOOS: "windows"
|
|
||||||
GOARCH: "amd64"
|
|
||||||
BIN_SUFFIX: ".exe"
|
|
||||||
- target: "darwin/amd64"
|
|
||||||
GOOS: "darwin"
|
|
||||||
GOARCH: "amd64"
|
|
||||||
BIN_SUFFIX: ""
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout codebase
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up Go 1.x
|
|
||||||
uses: actions/setup-go@v2
|
|
||||||
with:
|
|
||||||
go-version: ^1.17
|
|
||||||
|
|
||||||
- name: Setup vars
|
|
||||||
id: vars
|
|
||||||
run: |
|
|
||||||
echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
|
|
||||||
echo "::set-output name=git_tag::$(git describe --tags --always)"
|
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: go test -v ./...
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
env:
|
|
||||||
GOOS: ${{ matrix.GOOS }}
|
|
||||||
GOARCH: ${{ matrix.GOARCH }}
|
|
||||||
CGO_ENABLED: 0
|
|
||||||
run: go build -v -trimpath -ldflags="-w -s -X main.AppVersion=${{ steps.vars.outputs.git_tag }}" -o um-${{ matrix.GOOS }}-${{ matrix.GOARCH }}${{ matrix.BIN_SUFFIX }} ./cmd/um
|
|
||||||
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: um-${{ matrix.GOOS }}-${{ matrix.GOARCH }}
|
|
||||||
path: ./um-${{ matrix.GOOS }}-${{ matrix.GOARCH }}${{ matrix.BIN_SUFFIX }}
|
|
||||||
84
.github/workflows/release.yml
vendored
84
.github/workflows/release.yml
vendored
@@ -1,84 +0,0 @@
|
|||||||
name: Create Release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "v*"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
create_release:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Get current time
|
|
||||||
id: date
|
|
||||||
run: echo "::set-output name=date::$(date +'%Y/%m/%d')"
|
|
||||||
|
|
||||||
- name: Create release
|
|
||||||
id: release
|
|
||||||
uses: actions/create-release@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
tag_name: ${{ github.ref }}
|
|
||||||
release_name: "Build ${{ steps.date.outputs.date }}"
|
|
||||||
draft: true
|
|
||||||
outputs:
|
|
||||||
upload_url: "${{ steps.release.outputs.upload_url }}"
|
|
||||||
build:
|
|
||||||
needs:
|
|
||||||
- create_release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- target: "linux/amd64"
|
|
||||||
GOOS: "linux"
|
|
||||||
GOARCH: "amd64"
|
|
||||||
BIN_SUFFIX: ""
|
|
||||||
- target: "windows/amd64"
|
|
||||||
GOOS: "windows"
|
|
||||||
GOARCH: "amd64"
|
|
||||||
BIN_SUFFIX: ".exe"
|
|
||||||
- target: "windows/386"
|
|
||||||
GOOS: "windows"
|
|
||||||
GOARCH: "386"
|
|
||||||
BIN_SUFFIX: ".exe"
|
|
||||||
- target: "darwin/amd64"
|
|
||||||
GOOS: "darwin"
|
|
||||||
GOARCH: "amd64"
|
|
||||||
BIN_SUFFIX: ""
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout codebase
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup vars
|
|
||||||
id: vars
|
|
||||||
run: |
|
|
||||||
echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
|
|
||||||
echo "::set-output name=git_tag::$(git describe --tags --always)"
|
|
||||||
|
|
||||||
- name: Set up Go 1.x
|
|
||||||
uses: actions/setup-go@v2
|
|
||||||
with:
|
|
||||||
go-version: ^1.17
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
env:
|
|
||||||
GOOS: ${{ matrix.GOOS }}
|
|
||||||
GOARCH: ${{ matrix.GOARCH }}
|
|
||||||
CGO_ENABLED: 0
|
|
||||||
run: go build -trimpath -v -ldflags="-w -s -X main.AppVersion=${{ steps.vars.outputs.git_tag }}" -o um ./cmd/um
|
|
||||||
|
|
||||||
- name: Upload release assets
|
|
||||||
uses: actions/upload-release-asset@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
|
||||||
asset_path: um
|
|
||||||
asset_name: um-${{ matrix.GOOS }}-${{ matrix.GOARCH }}${{ matrix.BIN_SUFFIX }}
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,5 +3,7 @@
|
|||||||
/dist
|
/dist
|
||||||
*.exe
|
*.exe
|
||||||
|
|
||||||
|
/um
|
||||||
/um-*.tar.gz
|
/um-*.tar.gz
|
||||||
/um-*.zip
|
/um-*.zip
|
||||||
|
/.vscode
|
||||||
|
|||||||
15
README.md
15
README.md
@@ -14,12 +14,23 @@ Original: Web Edition https://git.unlock-music.dev/um/web
|
|||||||
- [x] All Algorithm Supported By `unlock-music/web`
|
- [x] All Algorithm Supported By `unlock-music/web`
|
||||||
- [x] Complete Metadata & Cover Image
|
- [x] Complete Metadata & Cover Image
|
||||||
|
|
||||||
## Hou to Build
|
## Release
|
||||||
|
|
||||||
- Requirements: **Golang 1.19**
|
[Latest release](https://git.unlock-music.dev/um/cli/releases/latest).
|
||||||
|
|
||||||
|
## Install from source
|
||||||
|
|
||||||
|
- Requirements: **Golang 1.23.3**
|
||||||
|
|
||||||
1. run `go install unlock-music.dev/cli/cmd/um@master`
|
1. run `go install unlock-music.dev/cli/cmd/um@master`
|
||||||
|
|
||||||
|
### Build from repo source
|
||||||
|
|
||||||
|
1. Pull repo source.
|
||||||
|
2. Build with `go build ./cmd/um`.
|
||||||
|
|
||||||
|
It will produce `um` or `um.exe` (Windows).
|
||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
|
||||||
- Drag the encrypted file to `um.exe` (Tested on Windows)
|
- Drag the encrypted file to `um.exe` (Tested on Windows)
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ type DecoderParams struct {
|
|||||||
FilePath string // optional, source file path
|
FilePath string // optional, source file path
|
||||||
|
|
||||||
Logger *zap.Logger // required
|
Logger *zap.Logger // required
|
||||||
|
|
||||||
|
// KuGou
|
||||||
|
KggDatabasePath string
|
||||||
}
|
}
|
||||||
type NewDecoderFunc func(p *DecoderParams) Decoder
|
type NewDecoderFunc func(p *DecoderParams) Decoder
|
||||||
|
|
||||||
|
|||||||
@@ -14,10 +14,12 @@ type Decoder struct {
|
|||||||
offset int
|
offset int
|
||||||
|
|
||||||
header header
|
header header
|
||||||
|
|
||||||
|
KggDatabasePath string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDecoder(p *common.DecoderParams) common.Decoder {
|
func NewDecoder(p *common.DecoderParams) common.Decoder {
|
||||||
return &Decoder{rd: p.Reader}
|
return &Decoder{rd: p.Reader, KggDatabasePath: p.KggDatabasePath}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate checks if the file is a valid Kugou (.kgm, .vpr, .kgma) file.
|
// Validate checks if the file is a valid Kugou (.kgm, .vpr, .kgma) file.
|
||||||
@@ -34,6 +36,11 @@ func (d *Decoder) Validate() (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("kgm init crypto v3: %w", err)
|
return fmt.Errorf("kgm init crypto v3: %w", err)
|
||||||
}
|
}
|
||||||
|
case 5:
|
||||||
|
d.cipher, err = newKgmCryptoV5(&d.header, d.KggDatabasePath)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("kgm init crypto v5: %w", err)
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("kgm: unsupported crypto version %d", d.header.CryptoVersion)
|
return fmt.Errorf("kgm: unsupported crypto version %d", d.header.CryptoVersion)
|
||||||
}
|
}
|
||||||
@@ -57,6 +64,7 @@ func (d *Decoder) Read(buf []byte) (int, error) {
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// Kugou
|
// Kugou
|
||||||
|
common.RegisterDecoder("kgg", false, NewDecoder)
|
||||||
common.RegisterDecoder("kgm", false, NewDecoder)
|
common.RegisterDecoder("kgm", false, NewDecoder)
|
||||||
common.RegisterDecoder("kgma", false, NewDecoder)
|
common.RegisterDecoder("kgma", false, NewDecoder)
|
||||||
// Viper
|
// Viper
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ type header struct {
|
|||||||
CryptoSlot uint32 // 0x18-0x1b: crypto key slot
|
CryptoSlot uint32 // 0x18-0x1b: crypto key slot
|
||||||
CryptoTestData []byte // 0x1c-0x2b: crypto test data
|
CryptoTestData []byte // 0x1c-0x2b: crypto test data
|
||||||
CryptoKey []byte // 0x2c-0x3b: crypto key
|
CryptoKey []byte // 0x2c-0x3b: crypto key
|
||||||
|
|
||||||
|
AudioHash string // v5: audio hash
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *header) FromFile(rd io.ReadSeeker) error {
|
func (h *header) FromFile(rd io.ReadSeeker) error {
|
||||||
@@ -36,29 +38,56 @@ func (h *header) FromFile(rd io.ReadSeeker) error {
|
|||||||
return fmt.Errorf("kgm seek start: %w", err)
|
return fmt.Errorf("kgm seek start: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
buf := make([]byte, 0x3c)
|
return h.FromBytes(rd)
|
||||||
if _, err := io.ReadFull(rd, buf); err != nil {
|
|
||||||
return fmt.Errorf("kgm read header: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return h.FromBytes(buf)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *header) FromBytes(buf []byte) error {
|
func (h *header) FromBytes(r io.ReadSeeker) error {
|
||||||
if len(buf) < 0x3c {
|
h.MagicHeader = make([]byte, 16)
|
||||||
return errors.New("invalid kgm header length")
|
_, err := r.Read(h.MagicHeader)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
h.MagicHeader = buf[:0x10]
|
|
||||||
if !bytes.Equal(kgmHeader, h.MagicHeader) && !bytes.Equal(vprHeader, h.MagicHeader) {
|
if !bytes.Equal(kgmHeader, h.MagicHeader) && !bytes.Equal(vprHeader, h.MagicHeader) {
|
||||||
return ErrKgmMagicHeader
|
return ErrKgmMagicHeader
|
||||||
}
|
}
|
||||||
|
|
||||||
h.AudioOffset = binary.LittleEndian.Uint32(buf[0x10:0x14])
|
err = binary.Read(r, binary.LittleEndian, &h.AudioOffset)
|
||||||
h.CryptoVersion = binary.LittleEndian.Uint32(buf[0x14:0x18])
|
if err != nil {
|
||||||
h.CryptoSlot = binary.LittleEndian.Uint32(buf[0x18:0x1c])
|
return err
|
||||||
h.CryptoTestData = buf[0x1c:0x2c]
|
}
|
||||||
h.CryptoKey = buf[0x2c:0x3c]
|
err = binary.Read(r, binary.LittleEndian, &h.CryptoVersion)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
err = binary.Read(r, binary.LittleEndian, &h.CryptoSlot)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
h.CryptoTestData = make([]byte, 0x10)
|
||||||
|
_, err = r.Read(h.CryptoTestData)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
h.CryptoKey = make([]byte, 0x10)
|
||||||
|
_, err = r.Read(h.CryptoKey)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if h.CryptoVersion == 5 {
|
||||||
|
r.Seek(0x08, io.SeekCurrent)
|
||||||
|
var audioHashLen uint32 = 0
|
||||||
|
err = binary.Read(r, binary.LittleEndian, &audioHashLen)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
audioHashBuffer := make([]byte, audioHashLen)
|
||||||
|
_, err = r.Read(audioHashBuffer)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
h.AudioHash = string(audioHashBuffer)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
30
algo/kgm/kgm_v5.go
Normal file
30
algo/kgm/kgm_v5.go
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
package kgm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"unlock-music.dev/cli/algo/common"
|
||||||
|
"unlock-music.dev/cli/algo/kgm/pc_kugou_db"
|
||||||
|
"unlock-music.dev/cli/algo/qmc"
|
||||||
|
)
|
||||||
|
|
||||||
|
func newKgmCryptoV5(header *header, kggDatabasePath string) (common.StreamDecoder, error) {
|
||||||
|
if header.AudioHash == "" {
|
||||||
|
return nil, fmt.Errorf("kgm v5: missing audio hash")
|
||||||
|
}
|
||||||
|
|
||||||
|
if kggDatabasePath == "" {
|
||||||
|
return nil, fmt.Errorf("kgm v5: missing kgg database path")
|
||||||
|
}
|
||||||
|
|
||||||
|
m, err := pc_kugou_db.CachedDumpEKey(kggDatabasePath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("kgm v5: decrypt kgg database: %w", err)
|
||||||
|
}
|
||||||
|
ekey, ok := m[header.AudioHash]
|
||||||
|
if !ok || ekey == "" {
|
||||||
|
return nil, fmt.Errorf("kgm v5: ekey missing from db (audio_hash=%s)", header.AudioHash)
|
||||||
|
}
|
||||||
|
|
||||||
|
return qmc.NewQmcCipherDecoderFromEKey([]byte(ekey))
|
||||||
|
}
|
||||||
238
algo/kgm/pc_kugou_db/cipher.go
Normal file
238
algo/kgm/pc_kugou_db/cipher.go
Normal file
@@ -0,0 +1,238 @@
|
|||||||
|
package pc_kugou_db
|
||||||
|
|
||||||
|
// ported from lib_um_crypto_rust:
|
||||||
|
// https://git.unlock-music.dev/um/lib_um_crypto_rust/src/tag/v0.1.10/um_crypto/kgm/src/pc_db_decrypt
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"context"
|
||||||
|
"crypto/aes"
|
||||||
|
"crypto/cipher"
|
||||||
|
"crypto/md5"
|
||||||
|
"database/sql"
|
||||||
|
"encoding/binary"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"sync"
|
||||||
|
|
||||||
|
_ "modernc.org/sqlite"
|
||||||
|
)
|
||||||
|
|
||||||
|
const PAGE_SIZE = 0x400
|
||||||
|
|
||||||
|
var SQLITE_HEADER = []byte("SQLite format 3\x00")
|
||||||
|
var DEFAULT_MASTER_KEY = []byte{
|
||||||
|
// master key (0x10 bytes)
|
||||||
|
0x1D, 0x61, 0x31, 0x45, 0xB2, 0x47, 0xBF, 0x7F, 0x3D, 0x18, 0x96, 0x72, 0x14, 0x4F, 0xE4, 0xBF,
|
||||||
|
0x00, 0x00, 0x00, 0x00, // page number (le)
|
||||||
|
0x73, 0x41, 0x6C, 0x54, // fixed value
|
||||||
|
}
|
||||||
|
|
||||||
|
func next_page_iv(seed uint32) uint32 {
|
||||||
|
var left uint32 = seed * 0x9EF4
|
||||||
|
var right uint32 = seed / 0xce26 * 0x7FFFFF07
|
||||||
|
var value uint32 = left - right
|
||||||
|
if value&0x8000_0000 == 0 {
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
return value + 0x7FFF_FF07
|
||||||
|
}
|
||||||
|
|
||||||
|
func derive_page_aes_key(seed uint32) []byte {
|
||||||
|
master_key := make([]byte, len(DEFAULT_MASTER_KEY))
|
||||||
|
copy(master_key, DEFAULT_MASTER_KEY)
|
||||||
|
binary.LittleEndian.PutUint32(master_key[0x10:0x14], seed)
|
||||||
|
digest := md5.Sum(master_key)
|
||||||
|
return digest[:]
|
||||||
|
}
|
||||||
|
|
||||||
|
func derive_page_aes_iv(seed uint32) []byte {
|
||||||
|
iv := make([]byte, 0x10)
|
||||||
|
seed = seed + 1
|
||||||
|
for i := 0; i < 0x10; i += 4 {
|
||||||
|
seed = next_page_iv(seed)
|
||||||
|
binary.LittleEndian.PutUint32(iv[i:i+4], seed)
|
||||||
|
}
|
||||||
|
digest := md5.Sum(iv)
|
||||||
|
return digest[:]
|
||||||
|
}
|
||||||
|
|
||||||
|
func aes128cbcDecryptNoPadding(buffer, key, iv []byte) error {
|
||||||
|
if len(key) != 16 {
|
||||||
|
return fmt.Errorf("invalid key size: %d (must be 16 bytes for AES-128)", len(key))
|
||||||
|
}
|
||||||
|
if len(iv) != aes.BlockSize {
|
||||||
|
return fmt.Errorf("invalid IV size: %d (must be %d bytes)", len(iv), aes.BlockSize)
|
||||||
|
}
|
||||||
|
if len(buffer)%aes.BlockSize != 0 {
|
||||||
|
return fmt.Errorf("ciphertext length must be a multiple of %d bytes", aes.BlockSize)
|
||||||
|
}
|
||||||
|
|
||||||
|
block, err := aes.NewCipher(key)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mode := cipher.NewCBCDecrypter(block, iv)
|
||||||
|
mode.CryptBlocks(buffer, buffer)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func decrypt_db_page(buffer []byte, page_number uint32) error {
|
||||||
|
key := derive_page_aes_key(page_number)
|
||||||
|
iv := derive_page_aes_iv(page_number)
|
||||||
|
|
||||||
|
return aes128cbcDecryptNoPadding(buffer, key, iv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func decrypt_page_1(page []byte) error {
|
||||||
|
if err := validate_page_1_header(page); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Backup expected hdr value
|
||||||
|
|
||||||
|
expected_hdr_value := make([]byte, 8)
|
||||||
|
copy(expected_hdr_value, page[0x10:0x18])
|
||||||
|
|
||||||
|
// Copy encrypted hdr over
|
||||||
|
hdr := page[:0x10]
|
||||||
|
copy(page[0x10:0x18], hdr[0x08:0x10])
|
||||||
|
|
||||||
|
if err := decrypt_db_page(page[0x10:], 1); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate header
|
||||||
|
if !bytes.Equal(page[0x10:0x18], expected_hdr_value[:8]) {
|
||||||
|
return fmt.Errorf("decrypt page 1 failed")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply SQLite header
|
||||||
|
copy(hdr, SQLITE_HEADER)
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func validate_page_1_header(header []byte) error {
|
||||||
|
o10 := binary.LittleEndian.Uint32(header[0x10:0x14])
|
||||||
|
o14 := binary.LittleEndian.Uint32(header[0x14:0x18])
|
||||||
|
|
||||||
|
v6 := ((o10 & 0xff) << 8) | ((o10 & 0xff00) << 16)
|
||||||
|
ok := o14 == 0x20204000 && (v6-0x200) <= 0xFE00 && ((v6-1)&v6) == 0
|
||||||
|
if !ok {
|
||||||
|
return fmt.Errorf("invalid page 1 header")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func decryptPcDatabase(buffer []byte) error {
|
||||||
|
db_size := len(buffer)
|
||||||
|
|
||||||
|
// not encrypted
|
||||||
|
if bytes.Equal(buffer[:len(SQLITE_HEADER)], SQLITE_HEADER) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if db_size%PAGE_SIZE != 0 || db_size == 0 {
|
||||||
|
return fmt.Errorf("invalid database size: %d", db_size)
|
||||||
|
}
|
||||||
|
|
||||||
|
last_page := db_size / PAGE_SIZE
|
||||||
|
|
||||||
|
// page 1 is the header
|
||||||
|
if err := decrypt_page_1(buffer[:PAGE_SIZE]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
offset := PAGE_SIZE
|
||||||
|
for page_no := 2; page_no <= last_page; page_no++ {
|
||||||
|
if err := decrypt_db_page(buffer[offset:offset+PAGE_SIZE], uint32(page_no)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
offset += PAGE_SIZE
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func extractKeyMapping(buffer []byte) (map[string]string, error) {
|
||||||
|
// Create an in-memory SQLite database
|
||||||
|
db, err := sql.Open("sqlite", "file::memory:?mode=memory&cache=shared")
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer db.Close()
|
||||||
|
|
||||||
|
conn, err := db.Conn(context.Background())
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = func() error {
|
||||||
|
defer conn.Close()
|
||||||
|
return conn.Raw(func(driverConn any) error {
|
||||||
|
type serializer interface {
|
||||||
|
Serialize() ([]byte, error)
|
||||||
|
Deserialize([]byte) error
|
||||||
|
}
|
||||||
|
return driverConn.(serializer).Deserialize(buffer)
|
||||||
|
})
|
||||||
|
}()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to import db: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
conn, err = db.Conn(context.Background())
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
rows, err := conn.QueryContext(context.Background(), `
|
||||||
|
select EncryptionKeyId, EncryptionKey from ShareFileItems
|
||||||
|
where EncryptionKey != '' and EncryptionKey is not null
|
||||||
|
`)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer rows.Close()
|
||||||
|
m := make(map[string]string)
|
||||||
|
for rows.Next() {
|
||||||
|
var keyId, key string
|
||||||
|
if err := rows.Scan(&keyId, &key); err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
m[keyId] = key
|
||||||
|
}
|
||||||
|
|
||||||
|
return m, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var kugouPcDatabaseDumpLock = &sync.Mutex{}
|
||||||
|
var kugouPcDatabaseDump = make(map[string]map[string]string)
|
||||||
|
|
||||||
|
func CachedDumpEKey(dbPath string) (map[string]string, error) {
|
||||||
|
dump, exist := kugouPcDatabaseDump[dbPath]
|
||||||
|
if !exist {
|
||||||
|
kugouPcDatabaseDumpLock.Lock()
|
||||||
|
defer kugouPcDatabaseDumpLock.Unlock()
|
||||||
|
|
||||||
|
if dump, exist = kugouPcDatabaseDump[dbPath]; !exist {
|
||||||
|
buffer, err := os.ReadFile(dbPath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if err = decryptPcDatabase(buffer); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
dump, err = extractKeyMapping(buffer)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
kugouPcDatabaseDump[dbPath] = dump
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return dump, nil
|
||||||
|
}
|
||||||
22
algo/kgm/pc_kugou_db/cipher_test.go
Normal file
22
algo/kgm/pc_kugou_db/cipher_test.go
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
package pc_kugou_db
|
||||||
|
|
||||||
|
import (
|
||||||
|
"reflect"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestDerivePageAESKey_Page0(t *testing.T) {
|
||||||
|
expectedKey := []byte{0x19, 0x62, 0xc0, 0x5f, 0xa2, 0xeb, 0xbe, 0x24, 0x28, 0xff, 0x52, 0x2b, 0x9e, 0x03, 0xea, 0xd4}
|
||||||
|
pageKey := derive_page_aes_key(0)
|
||||||
|
if !reflect.DeepEqual(expectedKey, pageKey) {
|
||||||
|
t.Errorf("Derived AES key for page 0 does not match expected value: got %v, want %v", pageKey, expectedKey)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestDerivePageAESIv_Page0(t *testing.T) {
|
||||||
|
expectedIv := []byte{0x05, 0x5a, 0x67, 0x35, 0x93, 0x89, 0x2d, 0xdf, 0x3a, 0xb3, 0xb3, 0xc6, 0x21, 0xc3, 0x48, 0x02}
|
||||||
|
pageKey := derive_page_aes_iv(0)
|
||||||
|
if !reflect.DeepEqual(expectedIv, pageKey) {
|
||||||
|
t.Errorf("Derived AES iv for page 0 does not match expected value: got %v, want %v", pageKey, expectedIv)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,12 +5,13 @@ import (
|
|||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go.uber.org/zap"
|
|
||||||
"io"
|
"io"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"go.uber.org/zap"
|
||||||
|
|
||||||
"unlock-music.dev/cli/algo/common"
|
"unlock-music.dev/cli/algo/common"
|
||||||
"unlock-music.dev/cli/internal/sniff"
|
"unlock-music.dev/cli/internal/sniff"
|
||||||
)
|
)
|
||||||
@@ -59,6 +60,23 @@ func NewDecoder(p *common.DecoderParams) common.Decoder {
|
|||||||
return &Decoder{raw: p.Reader, params: p, logger: p.Logger}
|
return &Decoder{raw: p.Reader, params: p, logger: p.Logger}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewQmcCipherDecoder(key []byte) (common.StreamDecoder, error) {
|
||||||
|
if len(key) > 300 {
|
||||||
|
return newRC4Cipher(key)
|
||||||
|
} else if len(key) != 0 {
|
||||||
|
return newMapCipher(key)
|
||||||
|
}
|
||||||
|
return newStaticCipher(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewQmcCipherDecoderFromEKey(ekey []byte) (common.StreamDecoder, error) {
|
||||||
|
key, err := deriveKey(ekey)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return NewQmcCipherDecoder(key)
|
||||||
|
}
|
||||||
|
|
||||||
func (d *Decoder) Validate() error {
|
func (d *Decoder) Validate() error {
|
||||||
// search & derive key
|
// search & derive key
|
||||||
err := d.searchKey()
|
err := d.searchKey()
|
||||||
@@ -67,18 +85,9 @@ func (d *Decoder) Validate() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check cipher type and init decode cipher
|
// check cipher type and init decode cipher
|
||||||
if len(d.decodedKey) > 300 {
|
d.cipher, err = NewQmcCipherDecoder(d.decodedKey)
|
||||||
d.cipher, err = newRC4Cipher(d.decodedKey)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("qmc init cipher: %w", err)
|
||||||
}
|
|
||||||
} else if len(d.decodedKey) != 0 {
|
|
||||||
d.cipher, err = newMapCipher(d.decodedKey)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
d.cipher = newStaticCipher()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// test with first 16 bytes
|
// test with first 16 bytes
|
||||||
@@ -185,11 +194,7 @@ func (d *Decoder) readRawKey(rawKeyLen int64) error {
|
|||||||
rawKeyData = bytes.TrimRight(rawKeyData, "\x00")
|
rawKeyData = bytes.TrimRight(rawKeyData, "\x00")
|
||||||
|
|
||||||
d.decodedKey, err = deriveKey(rawKeyData)
|
d.decodedKey, err = deriveKey(rawKeyData)
|
||||||
if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Decoder) readRawMetaQTag() error {
|
func (d *Decoder) readRawMetaQTag() error {
|
||||||
@@ -263,7 +268,7 @@ func init() {
|
|||||||
// New ogg/flac:
|
// New ogg/flac:
|
||||||
extraExtsCanHaveSuffix := []string{"mgg", "mflac"}
|
extraExtsCanHaveSuffix := []string{"mgg", "mflac"}
|
||||||
// Mac also adds some extra suffix to ext:
|
// Mac also adds some extra suffix to ext:
|
||||||
extraExtSuffix := []string{"0", "1", "a", "h", "l"}
|
extraExtSuffix := []string{"0", "1", "a", "h", "l", "m"}
|
||||||
for _, ext := range extraExtsCanHaveSuffix {
|
for _, ext := range extraExtsCanHaveSuffix {
|
||||||
common.RegisterDecoder(ext, false, NewDecoder)
|
common.RegisterDecoder(ext, false, NewDecoder)
|
||||||
for _, suffix := range extraExtSuffix {
|
for _, suffix := range extraExtSuffix {
|
||||||
|
|||||||
@@ -5,20 +5,20 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/fsnotify/fsnotify"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
"go.uber.org/zap"
|
|
||||||
"go.uber.org/zap/zapcore"
|
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"path"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/fsnotify/fsnotify"
|
||||||
|
"github.com/urfave/cli/v2"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"go.uber.org/zap/zapcore"
|
||||||
"unlock-music.dev/cli/algo/common"
|
"unlock-music.dev/cli/algo/common"
|
||||||
_ "unlock-music.dev/cli/algo/kgm"
|
_ "unlock-music.dev/cli/algo/kgm"
|
||||||
_ "unlock-music.dev/cli/algo/kwm"
|
_ "unlock-music.dev/cli/algo/kwm"
|
||||||
@@ -32,7 +32,7 @@ import (
|
|||||||
"unlock-music.dev/cli/internal/utils"
|
"unlock-music.dev/cli/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var AppVersion = "v0.2.9"
|
var AppVersion = "custom"
|
||||||
|
|
||||||
var logger = setupLogger(false) // TODO: inject logger to application, instead of using global logger
|
var logger = setupLogger(false) // TODO: inject logger to application, instead of using global logger
|
||||||
|
|
||||||
@@ -51,6 +51,7 @@ func main() {
|
|||||||
&cli.StringFlag{Name: "output", Aliases: []string{"o"}, Usage: "path to output dir", Required: false},
|
&cli.StringFlag{Name: "output", Aliases: []string{"o"}, Usage: "path to output dir", Required: false},
|
||||||
&cli.StringFlag{Name: "qmc-mmkv", Aliases: []string{"db"}, Usage: "path to qmc mmkv (.crc file also required)", Required: false},
|
&cli.StringFlag{Name: "qmc-mmkv", Aliases: []string{"db"}, Usage: "path to qmc mmkv (.crc file also required)", Required: false},
|
||||||
&cli.StringFlag{Name: "qmc-mmkv-key", Aliases: []string{"key"}, Usage: "mmkv password (16 ascii chars)", Required: false},
|
&cli.StringFlag{Name: "qmc-mmkv-key", Aliases: []string{"key"}, Usage: "mmkv password (16 ascii chars)", Required: false},
|
||||||
|
&cli.StringFlag{Name: "kgg-db", Usage: "path to kgg db (win32 kugou v11)", Required: false},
|
||||||
&cli.BoolFlag{Name: "remove-source", Aliases: []string{"rs"}, Usage: "remove source file", Required: false, Value: false},
|
&cli.BoolFlag{Name: "remove-source", Aliases: []string{"rs"}, Usage: "remove source file", Required: false, Value: false},
|
||||||
&cli.BoolFlag{Name: "skip-noop", Aliases: []string{"n"}, Usage: "skip noop decoder", Required: false, Value: true},
|
&cli.BoolFlag{Name: "skip-noop", Aliases: []string{"n"}, Usage: "skip noop decoder", Required: false, Value: true},
|
||||||
&cli.BoolFlag{Name: "verbose", Aliases: []string{"V"}, Usage: "verbose logging", Required: false, Value: false},
|
&cli.BoolFlag{Name: "verbose", Aliases: []string{"V"}, Usage: "verbose logging", Required: false, Value: false},
|
||||||
@@ -135,6 +136,11 @@ func appMain(c *cli.Context) (err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input, absErr := filepath.Abs(input)
|
||||||
|
if absErr != nil {
|
||||||
|
return fmt.Errorf("get abs path failed: %w", absErr)
|
||||||
|
}
|
||||||
|
|
||||||
output := c.String("output")
|
output := c.String("output")
|
||||||
inputStat, err := os.Stat(input)
|
inputStat, err := os.Stat(input)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -145,13 +151,18 @@ func appMain(c *cli.Context) (err error) {
|
|||||||
if inputStat.IsDir() {
|
if inputStat.IsDir() {
|
||||||
inputDir = input
|
inputDir = input
|
||||||
} else {
|
} else {
|
||||||
inputDir = path.Dir(input)
|
inputDir = filepath.Dir(input)
|
||||||
|
}
|
||||||
|
inputDir, absErr = filepath.Abs(inputDir)
|
||||||
|
if absErr != nil {
|
||||||
|
return fmt.Errorf("get abs path (inputDir) failed: %w", absErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if output == "" {
|
if output == "" {
|
||||||
// Default to where the input dir is
|
// Default to where the input dir is
|
||||||
output = inputDir
|
output = inputDir
|
||||||
}
|
}
|
||||||
|
logger.Debug("resolve input/output path", zap.String("inputDir", inputDir), zap.String("input", input), zap.String("output", output))
|
||||||
|
|
||||||
outputStat, err := os.Stat(output)
|
outputStat, err := os.Stat(output)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -174,10 +185,16 @@ func appMain(c *cli.Context) (err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
kggDbPath := c.String("kgg-db")
|
||||||
|
if kggDbPath == "" {
|
||||||
|
kggDbPath = filepath.Join(os.Getenv("APPDATA"), "Kugou8", "KGMusicV3.db")
|
||||||
|
}
|
||||||
|
|
||||||
proc := &processor{
|
proc := &processor{
|
||||||
logger: logger,
|
logger: logger,
|
||||||
inputDir: inputDir,
|
inputDir: inputDir,
|
||||||
outputDir: output,
|
outputDir: output,
|
||||||
|
kggDbPath: kggDbPath,
|
||||||
skipNoopDecoder: c.Bool("skip-noop"),
|
skipNoopDecoder: c.Bool("skip-noop"),
|
||||||
removeSource: c.Bool("remove-source"),
|
removeSource: c.Bool("remove-source"),
|
||||||
updateMetadata: c.Bool("update-metadata"),
|
updateMetadata: c.Bool("update-metadata"),
|
||||||
@@ -202,6 +219,8 @@ type processor struct {
|
|||||||
inputDir string
|
inputDir string
|
||||||
outputDir string
|
outputDir string
|
||||||
|
|
||||||
|
kggDbPath string
|
||||||
|
|
||||||
skipNoopDecoder bool
|
skipNoopDecoder bool
|
||||||
removeSource bool
|
removeSource bool
|
||||||
updateMetadata bool
|
updateMetadata bool
|
||||||
@@ -290,6 +309,8 @@ func (p *processor) processDir(inputDir string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *processor) processFile(filePath string) error {
|
func (p *processor) processFile(filePath string) error {
|
||||||
|
p.logger.Debug("processFile", zap.String("file", filePath), zap.String("inputDir", p.inputDir))
|
||||||
|
|
||||||
allDec := common.GetDecoder(filePath, p.skipNoopDecoder)
|
allDec := common.GetDecoder(filePath, p.skipNoopDecoder)
|
||||||
if len(allDec) == 0 {
|
if len(allDec) == 0 {
|
||||||
return errors.New("skipping while no suitable decoder")
|
return errors.New("skipping while no suitable decoder")
|
||||||
@@ -335,6 +356,7 @@ func (p *processor) process(inputFile string, allDec []common.DecoderFactory) er
|
|||||||
Extension: filepath.Ext(inputFile),
|
Extension: filepath.Ext(inputFile),
|
||||||
FilePath: inputFile,
|
FilePath: inputFile,
|
||||||
Logger: logger,
|
Logger: logger,
|
||||||
|
KggDatabasePath: p.kggDbPath,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
33
go.mod
33
go.mod
@@ -1,26 +1,35 @@
|
|||||||
module unlock-music.dev/cli
|
module unlock-music.dev/cli
|
||||||
|
|
||||||
go 1.19
|
go 1.23.3
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/fsnotify/fsnotify v1.7.0
|
github.com/fsnotify/fsnotify v1.8.0
|
||||||
github.com/go-flac/flacpicture v0.3.0
|
github.com/go-flac/flacpicture v0.3.0
|
||||||
github.com/go-flac/flacvorbis v0.2.0
|
github.com/go-flac/flacvorbis v0.2.0
|
||||||
github.com/go-flac/go-flac v1.0.0
|
github.com/go-flac/go-flac v1.0.0
|
||||||
github.com/samber/lo v1.39.0
|
github.com/samber/lo v1.47.0
|
||||||
github.com/urfave/cli/v2 v2.27.1
|
github.com/urfave/cli/v2 v2.27.5
|
||||||
go.uber.org/zap v1.27.0
|
go.uber.org/zap v1.27.0
|
||||||
golang.org/x/crypto v0.26.0
|
golang.org/x/crypto v0.29.0
|
||||||
golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f
|
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394
|
||||||
golang.org/x/text v0.17.0
|
golang.org/x/text v0.20.0
|
||||||
unlock-music.dev/mmkv v0.0.0-20240424090133-31549c6a948b
|
unlock-music.dev/mmkv v0.1.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
|
github.com/cpuguy83/go-md2man/v2 v2.0.5 // 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/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||||
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
|
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
|
||||||
go.uber.org/multierr v1.11.0 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
golang.org/x/sys v0.23.0 // indirect
|
golang.org/x/sys v0.31.0 // indirect
|
||||||
google.golang.org/protobuf v1.33.0 // indirect
|
google.golang.org/protobuf v1.35.2 // indirect
|
||||||
|
modernc.org/libc v1.62.1 // indirect
|
||||||
|
modernc.org/mathutil v1.7.1 // indirect
|
||||||
|
modernc.org/memory v1.9.1 // indirect
|
||||||
|
modernc.org/sqlite v1.37.0 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
64
go.sum
64
go.sum
@@ -1,47 +1,83 @@
|
|||||||
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
|
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||||
|
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/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
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.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||||
|
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/go-flac/flacpicture v0.3.0 h1:LkmTxzFLIynwfhHiZsX0s8xcr3/u33MzvV89u+zOT8I=
|
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/flacpicture v0.3.0/go.mod h1:DPbrzVYQ3fJcvSgLFp9HXIrEQEdfdk/+m0nQCzwodZI=
|
||||||
github.com/go-flac/flacvorbis v0.2.0 h1:KH0xjpkNTXFER4cszH4zeJxYcrHbUobz/RticWGOESs=
|
github.com/go-flac/flacvorbis v0.2.0 h1:KH0xjpkNTXFER4cszH4zeJxYcrHbUobz/RticWGOESs=
|
||||||
github.com/go-flac/flacvorbis v0.2.0/go.mod h1:uIysHOtuU7OLGoCRG92bvnkg7QEqHx19qKRV6K1pBrI=
|
github.com/go-flac/flacvorbis v0.2.0/go.mod h1:uIysHOtuU7OLGoCRG92bvnkg7QEqHx19qKRV6K1pBrI=
|
||||||
github.com/go-flac/go-flac v1.0.0 h1:6qI9XOVLcO50xpzm3nXvO31BgDgHhnr/p/rER/K/doY=
|
github.com/go-flac/go-flac v1.0.0 h1:6qI9XOVLcO50xpzm3nXvO31BgDgHhnr/p/rER/K/doY=
|
||||||
github.com/go-flac/go-flac v1.0.0/go.mod h1:WnZhcpmq4u1UdZMNn9LYSoASpWOCMOoxXxcWEHSzkW8=
|
github.com/go-flac/go-flac v1.0.0/go.mod h1:WnZhcpmq4u1UdZMNn9LYSoASpWOCMOoxXxcWEHSzkW8=
|
||||||
|
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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
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 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
||||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
github.com/samber/lo v1.39.0 h1:4gTz1wUhNYLhFSKl6O+8peW0v2F4BCY034GRpU9WnuA=
|
github.com/samber/lo v1.39.0 h1:4gTz1wUhNYLhFSKl6O+8peW0v2F4BCY034GRpU9WnuA=
|
||||||
github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
|
github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
|
||||||
|
github.com/samber/lo v1.47.0 h1:z7RynLwP5nbyRscyvcD043DWYoOcYRv3mV8lBeqOCLc=
|
||||||
|
github.com/samber/lo v1.47.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU=
|
||||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
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/urfave/cli/v2 v2.27.1 h1:8xSQ6szndafKVRmfyeUMxkNUJQMjL1F2zmsZ+qHpfho=
|
github.com/urfave/cli/v2 v2.27.1 h1:8xSQ6szndafKVRmfyeUMxkNUJQMjL1F2zmsZ+qHpfho=
|
||||||
github.com/urfave/cli/v2 v2.27.1/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
|
github.com/urfave/cli/v2 v2.27.1/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
|
||||||
|
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-20240312152122-5f08fbb34913 h1:+qGGcbkzsfDQNPPe9UDgpxAWQrhbbBXOYJFQDq/dtJw=
|
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 h1:+qGGcbkzsfDQNPPe9UDgpxAWQrhbbBXOYJFQDq/dtJw=
|
||||||
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913/go.mod h1:4aEEwZQutDLsQv2Deui4iYQ6DWTxR14g6m8Wv88+Xqk=
|
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913/go.mod h1:4aEEwZQutDLsQv2Deui4iYQ6DWTxR14g6m8Wv88+Xqk=
|
||||||
|
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=
|
||||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
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 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
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 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
|
||||||
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
||||||
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
|
|
||||||
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
|
|
||||||
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
|
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
|
||||||
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
|
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
|
||||||
golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f h1:99ci1mjWVBWwJiEKYY6jWa4d2nTQVIEhZIptnrVb1XY=
|
golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
|
||||||
golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI=
|
golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
|
||||||
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
|
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo=
|
||||||
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak=
|
||||||
|
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/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
|
golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
|
||||||
golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
|
||||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
|
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.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
|
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
|
||||||
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||||
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
|
||||||
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
|
||||||
|
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
|
||||||
|
google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
unlock-music.dev/mmkv v0.0.0-20240424090133-0953e6901f3a h1:UW0sxgwsfGGC/SrKvvAbZ4HZyOQ3fqs8qr3lBxG6Fzo=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
unlock-music.dev/mmkv v0.0.0-20240424090133-0953e6901f3a/go.mod h1:qr34SM3x8xRxyUfGzefH/rSi+DUXkQZcSfXY/yfuTeo=
|
modernc.org/libc v1.62.1 h1:s0+fv5E3FymN8eJVmnk0llBe6rOxCu/DEU+XygRbS8s=
|
||||||
unlock-music.dev/mmkv v0.0.0-20240424090133-31549c6a948b h1:VIJ0mDqj0OgX1ZvL9gbAH8kkqyrDlpVt5yUeGYSJ1/s=
|
modernc.org/libc v1.62.1/go.mod h1:iXhATfJQLjG3NWy56a6WVU73lWOcdYVxsvwCgoPljuo=
|
||||||
unlock-music.dev/mmkv v0.0.0-20240424090133-31549c6a948b/go.mod h1:qr34SM3x8xRxyUfGzefH/rSi+DUXkQZcSfXY/yfuTeo=
|
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/sqlite v1.37.0 h1:s1TMe7T3Q3ovQiK2Ouz4Jwh7dw4ZDqbebSDTlSJdfjI=
|
||||||
|
modernc.org/sqlite v1.37.0/go.mod h1:5YiWv+YviqGMuGw4V+PNplcyaJ5v+vQd7TQOgkACoJM=
|
||||||
|
unlock-music.dev/mmkv v0.1.0 h1:hgUHo0gJVoiKZ6bOcFOw2LHFqNiefIe+jb5o0OyL720=
|
||||||
|
unlock-music.dev/mmkv v0.1.0/go.mod h1:qr34SM3x8xRxyUfGzefH/rSi+DUXkQZcSfXY/yfuTeo=
|
||||||
|
|||||||
Reference in New Issue
Block a user