Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
137df9c4c2 | ||
![]() |
b17bb37c38 | ||
![]() |
9607580e8b | ||
![]() |
5956412d7e | ||
![]() |
22312959f3 | ||
![]() |
549983a928 | ||
![]() |
ce2642ad1f | ||
![]() |
c6ea98333e | ||
![]() |
042b1ca0dd | ||
![]() |
e089fe1268 | ||
![]() |
67966d4b54 | ||
![]() |
ca462f94fa | ||
![]() |
297c7c9252 | ||
![]() |
8acc1ade81 | ||
![]() |
e543024641 | ||
![]() |
cf48554424 | ||
![]() |
2e0cd04255 | ||
![]() |
adbcdfd083 | ||
![]() |
e1505148c8 | ||
![]() |
b65e47514f | ||
![]() |
31215772e3 | ||
![]() |
070c642dbf |
65
.drone.yml
65
.drone.yml
@@ -1,65 +0,0 @@
|
|||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: default
|
|
||||||
|
|
||||||
clone:
|
|
||||||
depth: 1
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: installDependencies
|
|
||||||
image: node:lts
|
|
||||||
commands:
|
|
||||||
- npm ci --registry=https://registry.npm.taobao.org
|
|
||||||
|
|
||||||
- name: build
|
|
||||||
image: node:lts
|
|
||||||
commands:
|
|
||||||
- npm run fix-compatibility
|
|
||||||
- npm run build
|
|
||||||
- tar -czf legacy.tar.gz -C ./dist .
|
|
||||||
- npm run build -- --modern
|
|
||||||
- tar -czf modern.tar.gz -C ./dist .
|
|
||||||
|
|
||||||
|
|
||||||
- name: release
|
|
||||||
image: plugins/gitea-release
|
|
||||||
settings:
|
|
||||||
base_url: https://git.ixarea.com
|
|
||||||
files:
|
|
||||||
- modern.tar.gz
|
|
||||||
- legacy.tar.gz
|
|
||||||
api_key:
|
|
||||||
from_secret: gitea_token
|
|
||||||
checksum:
|
|
||||||
- sha256
|
|
||||||
when:
|
|
||||||
event: [tag]
|
|
||||||
|
|
||||||
- name: deploy
|
|
||||||
image: plugins/s3
|
|
||||||
settings:
|
|
||||||
bucket: unlock-music
|
|
||||||
access_key:
|
|
||||||
from_secret: aws_access_key_id
|
|
||||||
secret_key:
|
|
||||||
from_secret: aws_secret_access_key
|
|
||||||
source: dist/**/*
|
|
||||||
strip_prefix: dist/
|
|
||||||
target: /public
|
|
||||||
path_style: true
|
|
||||||
endpoint: https://fs.sz2.ixarea.com
|
|
||||||
|
|
||||||
|
|
||||||
- name: upload
|
|
||||||
image: plugins/s3
|
|
||||||
settings:
|
|
||||||
bucket: unlock-music
|
|
||||||
access_key:
|
|
||||||
from_secret: aws_access_key_id
|
|
||||||
secret_key:
|
|
||||||
from_secret: aws_secret_access_key
|
|
||||||
source: ./*.tar.gz
|
|
||||||
target: /build/${DRONE_BUILD_NUMBER}
|
|
||||||
path_style: true
|
|
||||||
endpoint: https://fs.sz2.ixarea.com
|
|
5
.github/ISSUE_TEMPLATE/bug-report.md
vendored
5
.github/ISSUE_TEMPLATE/bug-report.md
vendored
@@ -7,9 +7,10 @@ assignees: ''
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
- 请按照此模板填写,否则可能立即被关闭
|
* 请按照此模板填写,否则可能立即被关闭
|
||||||
|
|
||||||
- [x] 我确认已经搜索过Issue不存并确认相同的Issue
|
- [x] 我确认已经搜索过Issue不存并确认相同的Issue
|
||||||
- [x] 我认为这是程序导致的问题(如不确认,请先通过Telegram或者Email进行咨询)
|
- [x] 我有证据表明这是程序导致的问题(如不确认,可以在[Discussions](https://github.com/ix64/unlock-music/discussions)内提出)
|
||||||
|
|
||||||
|
|
||||||
**Bug描述**
|
**Bug描述**
|
||||||
|
2
.github/ISSUE_TEMPLATE/new-feature.md
vendored
2
.github/ISSUE_TEMPLATE/new-feature.md
vendored
@@ -17,7 +17,7 @@ assignees: ''
|
|||||||
**实现途径**
|
**实现途径**
|
||||||
|
|
||||||
- 如果没有设计方案,请简要描述实现思路
|
- 如果没有设计方案,请简要描述实现思路
|
||||||
- 如果你没有任何的实现思路,请通过Telegram进行讨论
|
- 如果你没有任何的实现思路,请通过[Discussions](https://github.com/ix64/unlock-music/discussions)或者Telegram进行讨论
|
||||||
|
|
||||||
|
|
||||||
**附加信息**
|
**附加信息**
|
||||||
|
20
.github/workflows/build.yml
vendored
20
.github/workflows/build.yml
vendored
@@ -1,7 +1,6 @@
|
|||||||
name: Build
|
name: Build
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
|
||||||
paths:
|
paths:
|
||||||
- "**/*.js"
|
- "**/*.js"
|
||||||
- "**/*.vue"
|
- "**/*.vue"
|
||||||
@@ -28,9 +27,11 @@ jobs:
|
|||||||
build: [ legacy, modern ]
|
build: [ legacy, modern ]
|
||||||
include:
|
include:
|
||||||
- build: legacy
|
- build: legacy
|
||||||
BUILD_ARGS:
|
BUILD_ARGS: ""
|
||||||
|
BUILD_EXTENSION: true
|
||||||
- build: modern
|
- build: modern
|
||||||
BUILD_ARGS: "-- --modern"
|
BUILD_ARGS: "-- --modern"
|
||||||
|
BUILD_EXTENSION: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
@@ -60,8 +61,23 @@ jobs:
|
|||||||
npm run build ${{ matrix.BUILD_ARGS }}
|
npm run build ${{ matrix.BUILD_ARGS }}
|
||||||
tar -czvf dist.tar.gz -C ./dist .
|
tar -czvf dist.tar.gz -C ./dist .
|
||||||
|
|
||||||
|
- name: Build Extension
|
||||||
|
if: ${{ matrix.BUILD_EXTENSION }}
|
||||||
|
run: |
|
||||||
|
npm run make-extension
|
||||||
|
cd dist
|
||||||
|
zip -rJ9 ../extension.zip *
|
||||||
|
cd ..
|
||||||
|
|
||||||
- name: Publish artifact
|
- name: Publish artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: unlock-music-${{ matrix.build }}.tar.gz
|
name: unlock-music-${{ matrix.build }}.tar.gz
|
||||||
path: ./dist.tar.gz
|
path: ./dist.tar.gz
|
||||||
|
|
||||||
|
- name: Publish artifact - Extension
|
||||||
|
if: ${{ matrix.BUILD_EXTENSION }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: extension.zip
|
||||||
|
path: ./extension.zip
|
||||||
|
22
.github/workflows/release.yml
vendored
22
.github/workflows/release.yml
vendored
@@ -36,7 +36,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
npm run build
|
npm run build
|
||||||
tar -czf legacy.tar.gz -C ./dist .
|
tar -czf legacy.tar.gz -C ./dist .
|
||||||
zip -rJ9 legacy.zip ./dist
|
cd dist
|
||||||
|
zip -rJ9 ../legacy.zip *
|
||||||
|
cd ..
|
||||||
|
npm run make-extension
|
||||||
|
cd dist
|
||||||
|
zip -rJ9 ../extension.zip *
|
||||||
|
cd ..
|
||||||
|
|
||||||
- name: Build Modern
|
- name: Build Modern
|
||||||
env:
|
env:
|
||||||
@@ -44,7 +50,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
npm run build -- --modern
|
npm run build -- --modern
|
||||||
tar -czf modern.tar.gz -C ./dist .
|
tar -czf modern.tar.gz -C ./dist .
|
||||||
zip -rJ9 modern.zip ./dist
|
cd dist
|
||||||
|
zip -rJ9 ../modern.zip *
|
||||||
|
cd ..
|
||||||
|
|
||||||
- name: Checksum
|
- name: Checksum
|
||||||
run: sha256sum *.tar.gz *.zip > sha256sum.txt
|
run: sha256sum *.tar.gz *.zip > sha256sum.txt
|
||||||
@@ -109,6 +117,16 @@ jobs:
|
|||||||
asset_name: modern.zip
|
asset_name: modern.zip
|
||||||
asset_content_type: application/zip
|
asset_content_type: application/zip
|
||||||
|
|
||||||
|
- name: Upload Release Assets - extension.zip
|
||||||
|
uses: actions/upload-release-asset@v1.0.2
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./extension.zip
|
||||||
|
asset_name: extension.zip
|
||||||
|
asset_content_type: application/zip
|
||||||
|
|
||||||
- name: Upload Release Assets - sha256sum.txt
|
- name: Upload Release Assets - sha256sum.txt
|
||||||
uses: actions/upload-release-asset@v1.0.2
|
uses: actions/upload-release-asset@v1.0.2
|
||||||
env:
|
env:
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
- unlock-music项目是以学习和技术研究的初衷创建的,修改、再分发时请遵循[License](https://github.com/ix64/unlock-music/blob/master/LICENSE)
|
- unlock-music项目是以学习和技术研究的初衷创建的,修改、再分发时请遵循[License](https://github.com/ix64/unlock-music/blob/master/LICENSE)
|
||||||
- Unlock Music的CLI版本正在开发中。
|
- Unlock Music的CLI版本正在开发中。
|
||||||
- 我们新建了Telegram群组,欢迎加入
|
- 我们新建了Telegram群组,欢迎加入
|
||||||
- [其他测试版工具](https://github.com/ix64/unlock-music/wiki/%E5%85%B6%E4%BB%96%E9%9F%B3%E4%B9%90%E6%A0%BC%E5%BC%8F%E5%B7%A5%E5%85%B7)
|
- [CLI版本 Alpha](https://github.com/unlock-music/cli) 大批量转换建议使用CLI版本
|
||||||
- [相关的其他项目](https://github.com/ix64/unlock-music/wiki/%E5%92%8CUnlockMusic%E7%9B%B8%E5%85%B3%E7%9A%84%E9%A1%B9%E7%9B%AE)
|
- [相关的其他项目](https://github.com/ix64/unlock-music/wiki/%E5%92%8CUnlockMusic%E7%9B%B8%E5%85%B3%E7%9A%84%E9%A1%B9%E7%9B%AE)
|
||||||
- 
|
- 
|
||||||
|
|
||||||
|
16
extension-manifest.json
Normal file
16
extension-manifest.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"manifest_version": 2,
|
||||||
|
"name": "音乐解锁",
|
||||||
|
"short_name": "音乐解锁",
|
||||||
|
"icons": {
|
||||||
|
"128": "./img/icons/msapplication-icon-144x144.png"
|
||||||
|
},
|
||||||
|
"description": "在任何设备上解锁已购的加密音乐!",
|
||||||
|
"offline_enabled": true,
|
||||||
|
"options_page": "./index.html",
|
||||||
|
"homepage_url": "https://github.com/ix64/unlock-music",
|
||||||
|
"browser_action": {
|
||||||
|
"default_popup": "./popup.html"
|
||||||
|
},
|
||||||
|
"content_security_policy": "script-src 'self' https://stats.ixarea.com; object-src 'self'"
|
||||||
|
}
|
20
make-extension.js
Normal file
20
make-extension.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
|
const src = "./src/extension/"
|
||||||
|
const dst = "./dist"
|
||||||
|
fs.readdirSync(src).forEach(file => {
|
||||||
|
let srcPath = path.join(src, file)
|
||||||
|
let dstPath = path.join(dst, file)
|
||||||
|
fs.copyFileSync(srcPath, dstPath)
|
||||||
|
console.log(`Copy: ${srcPath} => ${dstPath}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
const manifestRaw = fs.readFileSync("./extension-manifest.json", "utf-8")
|
||||||
|
const manifest = JSON.parse(manifestRaw)
|
||||||
|
|
||||||
|
const pkgRaw = fs.readFileSync("./package.json", "utf-8")
|
||||||
|
const pkg = JSON.parse(pkgRaw)
|
||||||
|
|
||||||
|
manifest["version"] = pkg["version"]
|
||||||
|
fs.writeFileSync("./dist/manifest.json", JSON.stringify(manifest), "utf-8")
|
||||||
|
console.log("Write: manifest.json")
|
6024
package-lock.json
generated
6024
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
31
package.json
31
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "unlock-music",
|
"name": "unlock-music",
|
||||||
"version": "1.7.1",
|
"version": "1.8.0",
|
||||||
"updateInfo": "适配深色模式;修复.ncm解锁的一些问题",
|
"updateInfo": "支持构建为浏览器扩展(Chrome & Firefox)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"description": "Unlock encrypted music file in browser.",
|
"description": "Unlock encrypted music file in browser.",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -12,30 +12,31 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
"build": "vue-cli-service build",
|
"build": "vue-cli-service build",
|
||||||
"fix-compatibility": "node ./src/fix-compatibility.js"
|
"fix-compatibility": "node ./src/fix-compatibility.js",
|
||||||
|
"make-extension": "node ./make-extension.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"base64-js": "^1.5.1",
|
"base64-js": "^1.5.1",
|
||||||
"browser-id3-writer": "^4.4.0",
|
"browser-id3-writer": "^4.4.0",
|
||||||
"core-js": "^3.8.0",
|
"core-js": "^3.8.3",
|
||||||
"crypto-js": "^4.0.0",
|
"crypto-js": "^4.0.0",
|
||||||
"element-ui": "^2.14.1",
|
"element-ui": "^2.15.0",
|
||||||
"iconv-lite": "^0.5.1",
|
"iconv-lite": "^0.6.2",
|
||||||
"jimp": "^0.14.0",
|
"jimp": "^0.16.1",
|
||||||
"metaflac-js": "^1.0.5",
|
"metaflac-js": "^1.0.5",
|
||||||
"music-metadata-browser": "^2.1.6",
|
"music-metadata-browser": "^2.2.4",
|
||||||
"node-sass": "^4.14.1",
|
"register-service-worker": "^1.7.2",
|
||||||
"register-service-worker": "^1.7.1",
|
|
||||||
"sass-loader": "^10.0.2",
|
|
||||||
"vue": "^2.6.12"
|
"vue": "^2.6.12"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vue/cli-plugin-babel": "^4.5.9",
|
"@vue/cli-plugin-babel": "^4.5.11",
|
||||||
"@vue/cli-plugin-pwa": "^4.5.9",
|
"@vue/cli-plugin-pwa": "^4.5.11",
|
||||||
"@vue/cli-service": "^4.5.9",
|
"@vue/cli-service": "^4.5.11",
|
||||||
"babel-plugin-component": "^1.1.1",
|
"babel-plugin-component": "^1.1.1",
|
||||||
"vue-cli-plugin-element": "^1.0.1",
|
"vue-cli-plugin-element": "^1.0.1",
|
||||||
"vue-template-compiler": "^2.6.12",
|
"vue-template-compiler": "^2.6.12",
|
||||||
"workerize-loader": "^1.3.0"
|
"workerize-loader": "^1.3.0",
|
||||||
|
"sass-loader": "^10.1.1",
|
||||||
|
"node-sass": "^5.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -5,13 +5,10 @@
|
|||||||
<meta content="webkit" name="renderer">
|
<meta content="webkit" name="renderer">
|
||||||
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
|
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
|
||||||
<meta content="width=device-width,initial-scale=1.0" name="viewport">
|
<meta content="width=device-width,initial-scale=1.0" name="viewport">
|
||||||
<!--@formatter:off-->
|
<title>音乐解锁</title>
|
||||||
<script>var _paq=window._paq||[];_paq.push(["setRequestMethod","POST"],["trackPageView"],["enableLinkTracking"],["setSiteId","2"],["setTrackerUrl","https://stats.ixarea.com/ixarea-stats/report"]);</script>
|
|
||||||
<!--@formatter:on-->
|
|
||||||
<script async src="https://stats.ixarea.com/ixarea-stats.js"></script>
|
|
||||||
<title>音乐解锁 - By IXarea</title>
|
|
||||||
<meta content="音乐,解锁,ncm,qmc,mgg,mflac,qq音乐,网易云音乐,加密" name="keywords"/>
|
<meta content="音乐,解锁,ncm,qmc,mgg,mflac,qq音乐,网易云音乐,加密" name="keywords"/>
|
||||||
<meta content="音乐解锁 - 在任何设备上解锁已购的加密音乐!" name="description"/>
|
<meta content="音乐解锁 - 在任何设备上解锁已购的加密音乐!" name="description"/>
|
||||||
|
<script src="./ixarea-stats.js"></script>
|
||||||
<!--@formatter:off-->
|
<!--@formatter:off-->
|
||||||
<style>#loader{position:absolute;left:50%;top:50%;z-index:1010;margin:-75px 0 0 -75px;border:16px solid #f3f3f3;border-radius:50%;border-top:16px solid #1db1ff;width:120px;height:120px;animation:spin 2s linear infinite}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}#loader-mask{text-align:center;position:absolute;width:100%;height:100%;bottom:0;left:0;right:0;top:0;z-index:1009;background-color:rgba(242,246,252,.88)}@media (prefers-color-scheme:dark){#loader-mask{color:#fff;background-color:rgba(0,0,0,.85)}#loader-mask a{color:#ddd}#loader-mask a:hover{color:#1db1ff}}#loader-source{font-size:1.5rem}#loader-tips-timeout{font-size:1.2rem}</style>
|
<style>#loader{position:absolute;left:50%;top:50%;z-index:1010;margin:-75px 0 0 -75px;border:16px solid #f3f3f3;border-radius:50%;border-top:16px solid #1db1ff;width:120px;height:120px;animation:spin 2s linear infinite}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}#loader-mask{text-align:center;position:absolute;width:100%;height:100%;bottom:0;left:0;right:0;top:0;z-index:1009;background-color:rgba(242,246,252,.88)}@media (prefers-color-scheme:dark){#loader-mask{color:#fff;background-color:rgba(0,0,0,.85)}#loader-mask a{color:#ddd}#loader-mask a:hover{color:#1db1ff}}#loader-source{font-size:1.5rem}#loader-tips-timeout{font-size:1.2rem}</style>
|
||||||
<!--@formatter:on-->
|
<!--@formatter:on-->
|
||||||
@@ -27,12 +24,12 @@
|
|||||||
style="border:0"/>
|
style="border:0"/>
|
||||||
</noscript>
|
</noscript>
|
||||||
<h3 id="loader-source"> 请勿直接运行源代码! </h3>
|
<h3 id="loader-source"> 请勿直接运行源代码! </h3>
|
||||||
<div hidden id="loader-tips-outdated">
|
<div id="loader-tips-outdated" hidden>
|
||||||
<h2>您可能在使用不受支持的<span style="color:#f00;">过时</span>浏览器,这可能导致此应用无法正常工作。</h2>
|
<h2>您可能在使用不受支持的<span style="color:#f00;">过时</span>浏览器,这可能导致此应用无法正常工作。</h2>
|
||||||
<h3>如果您使用双核浏览器,您可以尝试切换到 <span style="color:#f00;">“极速模式”</span> 解决此问题。</h3>
|
<h3>如果您使用双核浏览器,您可以尝试切换到 <span style="color:#f00;">“极速模式”</span> 解决此问题。</h3>
|
||||||
<h3>或者,您可以尝试更换下方的几个浏览器之一。</h3>
|
<h3>或者,您可以尝试更换下方的几个浏览器之一。</h3>
|
||||||
</div>
|
</div>
|
||||||
<h3 hidden id="loader-tips-timeout">
|
<h3 id="loader-tips-timeout" hidden>
|
||||||
音乐解锁采用了一些新特性!建议使用
|
音乐解锁采用了一些新特性!建议使用
|
||||||
<a href="https://www.microsoft.com/zh-cn/edge" target="_blank">Microsoft Edge Chromium</a>
|
<a href="https://www.microsoft.com/zh-cn/edge" target="_blank">Microsoft Edge Chromium</a>
|
||||||
<a href="https://www.google.cn/chrome/" target="_blank">Google Chrome</a>
|
<a href="https://www.google.cn/chrome/" target="_blank">Google Chrome</a>
|
||||||
@@ -41,32 +38,6 @@
|
|||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<script>
|
<script src="./loader.js"></script>
|
||||||
(function () {
|
|
||||||
setTimeout(function () {
|
|
||||||
var ele = document.getElementById("loader-tips-timeout");
|
|
||||||
if (ele != null) {
|
|
||||||
ele.hidden = false;
|
|
||||||
}
|
|
||||||
}, 2000);
|
|
||||||
|
|
||||||
var ua = navigator && navigator.userAgent;
|
|
||||||
var detected = (function () {
|
|
||||||
var m;
|
|
||||||
if (!ua) return true;
|
|
||||||
if (/MSIE |Trident\//.exec(ua)) return true; // no IE
|
|
||||||
m = /Edge\/([\d.]+)/.exec(ua); // Edge >= 17
|
|
||||||
if (m && Number(m[1]) < 17) return true;
|
|
||||||
m = /Chrome\/([\d.]+)/.exec(ua); // Chrome >= 58
|
|
||||||
if (m && Number(m[1]) < 58) return true;
|
|
||||||
m = /Firefox\/([\d.]+)/.exec(ua); // Firefox >= 45
|
|
||||||
return m && Number(m[1]) < 45;
|
|
||||||
})();
|
|
||||||
if (detected) {
|
|
||||||
document.getElementById('loader-tips-outdated').hidden = false;
|
|
||||||
document.getElementById("loader-tips-timeout").hidden = false;
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
10
public/ixarea-stats.js
Normal file
10
public/ixarea-stats.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
var _paq = window._paq || [];
|
||||||
|
_paq.push(["setRequestMethod", "POST"], ["trackPageView"], ["enableLinkTracking"],
|
||||||
|
["setSiteId", "2"], ["setTrackerUrl", "https://stats.ixarea.com/ixarea-stats/report"]);
|
||||||
|
|
||||||
|
var tag = document.createElement('script');
|
||||||
|
tag.type = 'text/javascript';
|
||||||
|
tag.async = true;
|
||||||
|
tag.src = 'https://stats.ixarea.com/ixarea-stats.js';
|
||||||
|
var s = document.getElementsByTagName('script')[0];
|
||||||
|
s.parentNode.insertBefore(tag, s);
|
25
public/loader.js
Normal file
25
public/loader.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
(function () {
|
||||||
|
setTimeout(function () {
|
||||||
|
var ele = document.getElementById("loader-tips-timeout");
|
||||||
|
if (ele != null) {
|
||||||
|
ele.hidden = false;
|
||||||
|
}
|
||||||
|
}, 2000);
|
||||||
|
|
||||||
|
var ua = navigator && navigator.userAgent;
|
||||||
|
var detected = (function () {
|
||||||
|
var m;
|
||||||
|
if (!ua) return true;
|
||||||
|
if (/MSIE |Trident\//.exec(ua)) return true; // no IE
|
||||||
|
m = /Edge\/([\d.]+)/.exec(ua); // Edge >= 17
|
||||||
|
if (m && Number(m[1]) < 17) return true;
|
||||||
|
m = /Chrome\/([\d.]+)/.exec(ua); // Chrome >= 58
|
||||||
|
if (m && Number(m[1]) < 58) return true;
|
||||||
|
m = /Firefox\/([\d.]+)/.exec(ua); // Firefox >= 45
|
||||||
|
return m && Number(m[1]) < 45;
|
||||||
|
})();
|
||||||
|
if (detected) {
|
||||||
|
document.getElementById('loader-tips-outdated').hidden = false;
|
||||||
|
document.getElementById("loader-tips-timeout").hidden = false;
|
||||||
|
}
|
||||||
|
})();
|
@@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "音乐解锁 - By IXarea",
|
|
||||||
"short_name": "音乐解锁",
|
|
||||||
"description": "在任何设备上解锁已购的加密音乐!支持QQ音乐与网易云音乐!",
|
|
||||||
"icons": [
|
|
||||||
{
|
|
||||||
"src": "./img/icons/android-chrome-192x192.png",
|
|
||||||
"sizes": "192x192",
|
|
||||||
"type": "image/png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "./img/icons/android-chrome-512x512.png",
|
|
||||||
"sizes": "512x512",
|
|
||||||
"type": "image/png"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"start_url": "./index.html",
|
|
||||||
"display": "standalone",
|
|
||||||
"background_color": "#000000",
|
|
||||||
"theme_color": "#4DBA87"
|
|
||||||
}
|
|
@@ -5,7 +5,8 @@ import {
|
|||||||
GetFileInfo,
|
GetFileInfo,
|
||||||
GetMetaCoverURL,
|
GetMetaCoverURL,
|
||||||
GetWebImage,
|
GetWebImage,
|
||||||
IXAREA_API_ENDPOINT
|
IXAREA_API_ENDPOINT,
|
||||||
|
WriteMp3Meta
|
||||||
} from "./util";
|
} from "./util";
|
||||||
import {QmcMaskCreate58, QmcMaskDetectMflac, QmcMaskDetectMgg, QmcMaskGetDefault} from "./qmcMask";
|
import {QmcMaskCreate58, QmcMaskDetectMflac, QmcMaskDetectMgg, QmcMaskGetDefault} from "./qmcMask";
|
||||||
import {fromByteArray as Base64Encode, toByteArray as Base64Decode} from 'base64-js'
|
import {fromByteArray as Base64Encode, toByteArray as Base64Decode} from 'base64-js'
|
||||||
@@ -85,20 +86,17 @@ export async function Decrypt(file, raw_filename, raw_ext) {
|
|||||||
imgUrl = imageInfo.url
|
imgUrl = imageInfo.url
|
||||||
try {
|
try {
|
||||||
if (ext === "mp3") {
|
if (ext === "mp3") {
|
||||||
let writer = new ID3Writer(musicDecoded)
|
musicDecoded = await WriteMp3Meta(musicDecoded,
|
||||||
writer.setFrame('APIC', {
|
info.artist.split(" _ "), info.title, "",
|
||||||
type: 3,
|
imageInfo.buffer, "Cover", musicMeta)
|
||||||
data: imageInfo.buffer,
|
|
||||||
description: "Cover",
|
|
||||||
})
|
|
||||||
writer.addTag();
|
|
||||||
musicDecoded = writer.arrayBuffer
|
|
||||||
musicBlob = new Blob([musicDecoded], {type: mime});
|
musicBlob = new Blob([musicDecoded], {type: mime});
|
||||||
} else if (ext === 'flac') {
|
} else if (ext === 'flac') {
|
||||||
const writer = new MetaFlac(Buffer.from(musicDecoded))
|
const writer = new MetaFlac(Buffer.from(musicDecoded))
|
||||||
writer.importPictureFromBuffer(Buffer.from(imageInfo.buffer))
|
writer.importPictureFromBuffer(Buffer.from(imageInfo.buffer))
|
||||||
musicDecoded = writer.save()
|
musicDecoded = writer.save()
|
||||||
musicBlob = new Blob([musicDecoded], {type: mime});
|
musicBlob = new Blob([musicDecoded], {type: mime});
|
||||||
|
} else {
|
||||||
|
console.info("writing metadata for " + ext + " is not being supported for now")
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn("Error while appending cover image to file " + e)
|
console.warn("Error while appending cover image to file " + e)
|
||||||
|
13
src/extension/popup.html
Normal file
13
src/extension/popup.html
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script src="./popup.js"></script>
|
||||||
|
<a href="./index.html" target="_blank">
|
||||||
|
<button>立即使用</button>
|
||||||
|
</a>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
5
src/extension/popup.js
Normal file
5
src/extension/popup.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
const bs = chrome || browser
|
||||||
|
bs.tabs.create({
|
||||||
|
url: bs.runtime.getURL('./index.html')
|
||||||
|
}, tab => console.log(tab))
|
||||||
|
|
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
import {register} from 'register-service-worker'
|
import {register} from 'register-service-worker'
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production' && window.location.protocol === "https:") {
|
||||||
|
|
||||||
register(`${process.env.BASE_URL}service-worker.js`, {
|
register(`${process.env.BASE_URL}service-worker.js`, {
|
||||||
ready() {
|
ready() {
|
||||||
console.log('App is being served from cache by a service worker.')
|
console.log('App is being served from cache by a service worker.')
|
||||||
|
@@ -2,6 +2,36 @@ module.exports = {
|
|||||||
publicPath: '',
|
publicPath: '',
|
||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
pwa: {
|
pwa: {
|
||||||
|
manifestPath: "web-manifest.json",
|
||||||
|
name: "音乐解锁",
|
||||||
|
themeColor: "#4DBA87",
|
||||||
|
msTileColor: "#000000",
|
||||||
|
manifestOptions: {
|
||||||
|
start_url: "./index.html",
|
||||||
|
description: "在任何设备上解锁已购的加密音乐!",
|
||||||
|
icons: [
|
||||||
|
{
|
||||||
|
'src': './img/icons/android-chrome-192x192.png',
|
||||||
|
'sizes': '192x192',
|
||||||
|
'type': 'image/png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'src': './img/icons/android-chrome-512x512.png',
|
||||||
|
'sizes': '512x512',
|
||||||
|
'type': 'image/png'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
appleMobileWebAppCapable: 'yes',
|
||||||
|
iconPaths: {
|
||||||
|
faviconSVG: './img/icons/safari-pinned-tab.svg',
|
||||||
|
favicon32: './img/icons/favicon-32x32.png',
|
||||||
|
favicon16: './img/icons/favicon-16x16.png',
|
||||||
|
appleTouchIcon: './img/icons/apple-touch-icon-152x152.png',
|
||||||
|
maskIcon: './img/icons/safari-pinned-tab.svg',
|
||||||
|
msTileImage: './img/icons/msapplication-icon-144x144.png'
|
||||||
|
},
|
||||||
|
workboxPluginMode: "GenerateSW",
|
||||||
workboxOptions: {
|
workboxOptions: {
|
||||||
skipWaiting: true
|
skipWaiting: true
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user