Initial import: Music_Server, MusicFree, catalog-sync

This commit is contained in:
2026-05-23 16:51:14 +08:00
commit 069af30dba
847 changed files with 179878 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
.codex/
**/.codex/
**/.codex-temp/
**/.codex-tasks/
**/.git/
**/node_modules/
**/.venv/
**/venv/
**/__pycache__/
**/.pytest_cache/
**/.mypy_cache/
**/build/
**/dist/
**/.gradle/
*.pyc
*.pyo
*.log
*.apk
*.aab
*.zip
*.tar
+2
View File
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
+20
View File
@@ -0,0 +1,20 @@
{
"extends": ["@commitlint/config-conventional"],
"rules": {
"type-enum": [
2,
"always",
[
"ci",
"chore",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style"
]
]
}
}
+1
View File
@@ -0,0 +1 @@
src/lib/*
+22
View File
@@ -0,0 +1,22 @@
module.exports = {
root: true,
extends: ['@react-native', 'prettier'],
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
'@typescript-eslint/no-shadow': 'warn',
'no-shadow': 'off',
'no-undef': 'off',
'react-hooks/exhaustive-deps': 'warn',
'@typescript-eslint/object-curly-spacing': ['error', 'always'],
"quotes": ["warn", "double"],
"object-curly-spacing": ["error", "always"],
"indent": ["error", 4],
"semi": ["error", "always"],
"comma-dangle": ["error", "always-multiline"],
"brace-style": ["error", "1tbs"],
},
},
],
};
+62
View File
@@ -0,0 +1,62 @@
---
name: 反馈问题
description: 问题反馈模板
labels: ["bug"]
body:
- type: markdown
attributes:
value: "## 不要在此仓库提和具体插件有关的问题!!!"
- type: checkboxes
attributes:
label: 提问题之前,请先确认
description: "请勾选以下确认项"
options:
- label: "已经阅读过Q&A (https://musicfree.catcat.work/qa/mobile.html)"
required: true
- label: "要提出的问题与插件功能无关(类似某个插件搜索结果不全、ip被封禁等请找对应插件作者,在此仓库下提具体插件的问题将会被直接关闭)"
required: true
- label: "不与其他已有issue重复"
required: true
- type: textarea
id: system_info
attributes:
label: 系统信息
description: "请填写以下系统信息"
placeholder: |
软件版本:
系统版本:
设备型号:
validations:
required: true
- type: textarea
id: problem_description
attributes:
label: 问题描述
description: "请详细描述问题现象及预期正确行为"
placeholder: "例如:当执行XX操作时,出现XX现象,预期应该XX..."
validations:
required: true
- type: textarea
id: reproduction_steps
attributes:
label: 复现步骤
description: "请按顺序描述复现步骤"
placeholder: |
1. 打开应用
2. 点击XX按钮
3. ...
validations:
required: true
- type: textarea
id: screenshots_logs
attributes:
label: 截图 & 日志
description: "请粘贴截图链接或错误日志(可拖放文件直接上传截图)"
placeholder: "错误日志示例:\n[2023-01-01 12:00] ERROR: xxxx"
validations:
required: false
+5
View File
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 讨论区
url: https://github.com/maotoumao/MusicFree/discussions
about: 在这里讨论或寻求帮助
@@ -0,0 +1,40 @@
---
name: 提交新需求
description: 新功能需求模板
labels: ["feature"]
body:
- type: checkboxes
attributes:
label: 提需求之前,请先确认
description: "请检查以下确认项"
options:
- label: "已经阅读过Q&A (https://musicfree.catcat.work/qa/mobile.html)"
required: true
- label: "新需求不是仅仅满足个人口味的需求"
required: true
- label: "新需求不与其他已有issue重复"
required: true
- label: "我可以在代码、测试上提供帮助"
required: false
- type: textarea
id: feature_description
attributes:
label: 需求描述
description: "请详细说明需求背景、使用场景和预期效果"
placeholder: |
例如:
- 当前存在的痛点是什么?
- 希望如何解决这个问题?
- 预期的使用体验是怎样的?
validations:
required: true
- type: textarea
id: attachments
attributes:
label: 附件信息(可选)
description: "可拖放上传示意图/设计稿"
placeholder: "设计稿说明或云文档链接..."
validations:
required: false
+119
View File
@@ -0,0 +1,119 @@
name: Beta 构建
on:
push:
branches: [dev]
paths: ['package.json']
workflow_dispatch:
inputs:
force_build:
description: '强制构建 Beta 版本'
required: false
default: 'false'
type: boolean
jobs:
check-version:
if: github.actor == 'maotoumao' || github.event_name == 'push'
runs-on: ubuntu-latest
outputs:
should_build: ${{ steps.version_check.outputs.should_build }}
version: ${{ steps.version_check.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check version format
id: version_check
run: |
VERSION=$(node -p "require('./package.json').version")
echo "Current version: $VERSION"
# 检查版本是否符合 -beta.xx 格式
if [[ $VERSION =~ -beta\.[0-9]{1,2}$ ]]; then
echo "✅ Version matches beta format: $VERSION"
echo "should_build=true" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
elif [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ inputs.force_build }}" == "true" ]]; then
echo "🔧 Force build triggered by workflow_dispatch"
echo "should_build=true" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
else
echo "❌ Version does not match beta format or not forced: $VERSION"
echo "should_build=false" >> $GITHUB_OUTPUT
fi
build-beta:
needs: check-version
if: needs.check-version.outputs.should_build == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Cache React Native dependencies
uses: actions/cache@v4
with:
path: |
node_modules
~/.gradle/caches
~/.gradle/wrapper
android/.gradle
key: ${{ runner.os }}-rn-${{ hashFiles('package-lock.json', 'android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-rn-
- name: Install Dependencies
run: npm ci --prefer-offline --no-audit
- name: Setup Keystore (if secrets available)
if: ${{ secrets.RELEASE_KEYSTORE_BASE64 != '' }}
run: |
echo "${{ secrets.RELEASE_KEYSTORE_BASE64 }}" | base64 -d > android/app/release.keystore
cat > android/keystore.properties << 'EOF'
RELEASE_STORE_FILE=release.keystore
RELEASE_STORE_PASSWORD=${{ secrets.RELEASE_STORE_PASSWORD }}
RELEASE_KEY_ALIAS=${{ secrets.RELEASE_KEY_ALIAS }}
RELEASE_KEY_PASSWORD=${{ secrets.RELEASE_KEY_PASSWORD }}
EOF
chmod 600 android/keystore.properties android/app/release.keystore
- name: Make gradlew executable
run: chmod +x android/gradlew
- name: Build Beta APK
run: |
cd android
./gradlew assembleRelease --parallel --build-cache --configure-on-demand
- name: List generated APKs
run: |
echo "📱 Generated APK files:"
find android/app/build/outputs/apk/release -name "*.apk" -exec ls -lh {} \;
- name: Upload Beta APKs
uses: actions/upload-artifact@v4
with:
name: beta-apks-${{ needs.check-version.outputs.version }}
path: android/app/build/outputs/apk/release/*.apk
retention-days: 30
- name: Build Summary
run: |
echo "🎉 Beta build completed successfully!"
echo "📦 Version: ${{ needs.check-version.outputs.version }}"
echo "🚀 Triggered by: ${{ github.event_name }}"
echo "👤 Actor: ${{ github.actor }}"
+88
View File
@@ -0,0 +1,88 @@
# OSX
#
.DS_Store
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
**/.xcode.env.local
# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
*.hprof
.cxx/
*.keystore
!debug.keystore
# node.js
#
node_modules/
npm-debug.log
yarn-error.log
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/
**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output
# Bundle artifact
*.jsbundle
# Ruby / CocoaPods
**/Pods/
/vendor/bundle/
# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
# testing
/coverage
# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
keystore.properties
.VSCodeCounter/
.vscode/
tmp/
scripts/
*.log
# Expo
.expo
dist/
web-build/
+1
View File
@@ -0,0 +1 @@
npm run commit-lint
+1
View File
@@ -0,0 +1 @@
npm run lint-staged
+10
View File
@@ -0,0 +1,10 @@
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
singleQuote: true,
trailingComma: 'all',
tabWidth: 4,
useTabs: false,
endOfLine: "auto"
};
+1
View File
@@ -0,0 +1 @@
{}
+9
View File
@@ -0,0 +1,9 @@
source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
+661
View File
@@ -0,0 +1,661 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.
+191
View File
@@ -0,0 +1,191 @@
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
import com.android.build.OutputFile
import groovy.json.JsonSlurper
/**
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
*/
react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '../..'
// root = file("../../")
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
// reactNativeDir = file("../../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
// codegenDir = file("../../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
// cliFile = file("../../node_modules/react-native/cli.js")
/* Variants */
// The list of variants to that are debuggable. For those we're going to
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
// debuggableVariants = ["liteDebug", "prodDebug"]
/* Bundling */
// A list containing the node command and its flags. Default is just 'node'.
// nodeExecutableAndArgs = ["node"]
//
// The command to run when bundling. By default is 'bundle'
// bundleCommand = "ram-bundle"
//
// The path to the CLI configuration file. Default is empty.
// bundleConfig = file(../rn-cli.config.js)
//
// The name of the generated asset file containing your JS bundle
// bundleAssetName = "MyApplication.android.bundle"
//
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
// entryFile = file("../js/MyApplication.android.js")
//
// A list of extra flags to pass to the 'bundle' commands.
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
// extraPackagerArgs = []
/* Hermes Commands */
// The hermes compiler command to run. By default it is 'hermesc'
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]
/* Autolinking */
autolinkLibrariesWithApp()
//
// Added by install-expo-modules
entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", rootDir.getAbsoluteFile().getParentFile().getAbsolutePath(), "android", "absolute"].execute(null, rootDir).text.trim())
cliFile = new File(["node", "--print", "require.resolve('@expo/cli')"].execute(null, rootDir).text.trim())
bundleCommand = "export:embed"
//
// Added by install-expo-modules
entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", rootDir.getAbsoluteFile().getParentFile().getAbsolutePath(), "android", "absolute"].execute(null, rootDir).text.trim())
cliFile = new File(["node", "--print", "require.resolve('@expo/cli')"].execute(null, rootDir).text.trim())
bundleCommand = "export:embed"
}
/**
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
*/
def enableProguardInReleaseBuilds = false
/**
* The preferred build flavor of JavaScriptCore (JSC)
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
// !! Add lines
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('keystore.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
static def getVersion() {
def inputFile = new File("../package.json")
def packageJson = new JsonSlurper().parseText(inputFile.text)
return packageJson["version"]
}
// static def versionStringToCode(String version) {
// def parts = version.split('\\.')
// def versionCode = 0
// def multiplier = 1000000
//
// parts.each { part ->
// versionCode += part.toInteger() * multiplier
// multiplier /= 1000
// }
//
// return versionCode.intValue()
// }
def appVersion = getVersion()
def appVersionCode = 400012
android {
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion
namespace "fun.upup.musicfree"
defaultConfig {
applicationId "fun.upup.musicfree"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode appVersionCode
versionName appVersion
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
// !! Add lines
release {
storeFile file(keystoreProperties['RELEASE_STORE_FILE'])
storePassword keystoreProperties['RELEASE_STORE_PASSWORD']
keyAlias keystoreProperties['RELEASE_KEY_ALIAS']
keyPassword keystoreProperties['RELEASE_KEY_PASSWORD']
}
}
splits {
abi {
reset()
enable true
universalApk true
include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.release
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
}
dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
// !! Add lines
implementation project(':react-native-fs')
implementation 'com.facebook.fresco:animated-gif:2.5.0'
// https://mvnrepository.com/artifact/net.jthink/jaudiotagger
implementation 'net.jthink:jaudiotagger:2.2.5'
implementation 'androidx.core:core-splashscreen:1.0.0'
}
+10
View File
@@ -0,0 +1,10 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
@@ -0,0 +1,31 @@
package `fun`.upup.musicfree
import expo.modules.ReactActivityDelegateWrapper
import expo.modules.splashscreen.SplashScreenManager
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate
import android.os.Bundle
class MainActivity : ReactActivity() {
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
override fun getMainComponentName(): String = "MusicFree"
/**
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
*/
override fun createReactActivityDelegate(): ReactActivityDelegate =
ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled))
// https://reactnavigation.org/docs/getting-started/#installing-dependencies-into-a-bare-react-native-project
override fun onCreate(savedInstanceState: Bundle?) {
SplashScreenManager.registerOnActivity(this)
super.onCreate(null);
}
}
@@ -0,0 +1,59 @@
package `fun`.upup.musicfree
import android.content.res.Configuration
import expo.modules.ApplicationLifecycleDispatcher
import expo.modules.ReactNativeHostWrapper
import android.app.Application
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.soloader.SoLoader
import `fun`.upup.musicfree.lyricUtil.LyricUtilPackage
import `fun`.upup.musicfree.mp3Util.Mp3UtilPackage
import `fun`.upup.musicfree.utils.UtilsPackage
class MainApplication : Application(), ReactApplication {
override val reactNativeHost: ReactNativeHost =
ReactNativeHostWrapper(this, object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
// add(MyReactNativePackage())
add(UtilsPackage())
add(Mp3UtilPackage())
add(LyricUtilPackage())
}
override fun getJSMainModuleName(): String = "index"
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
})
override val reactHost: ReactHost
get() = ReactNativeHostWrapper.createReactHost(applicationContext, reactNativeHost)
override fun onCreate() {
super.onCreate()
SoLoader.init(this, OpenSourceMergedSoMapping)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
}
ApplicationLifecycleDispatcher.onApplicationCreate(this)
}
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)
}
}
@@ -0,0 +1,182 @@
package `fun`.upup.musicfree.lyricUtil
import android.app.Activity
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.provider.Settings
import android.util.Log
import androidx.annotation.RequiresApi
import com.facebook.react.bridge.*
import java.util.*
class LyricUtilModule(private val reactContext: ReactApplicationContext): ReactContextBaseJavaModule(reactContext) {
override fun getName() = "LyricUtil"
private var lyricView: LyricView? = null
@ReactMethod
fun checkSystemAlertPermission(promise: Promise) {
try {
promise.resolve(Settings.canDrawOverlays(reactContext))
} catch (e: Exception) {
promise.reject("Error", e.message)
}
}
@ReactMethod
fun requestSystemAlertPermission(promise: Promise) {
try {
val intent = Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION).apply {
data = Uri.parse("package:" + reactContext.packageName)
}
currentActivity?.startActivity(intent)
promise.resolve(true)
} catch (e: Exception) {
promise.reject("Error", e.message)
}
}
@ReactMethod
fun showStatusBarLyric(initLyric: String?, options: ReadableMap?, promise: Promise) {
try {
UiThreadUtil.runOnUiThread {
if (lyricView == null) {
lyricView = LyricView(reactContext)
}
val mapOptions = mutableMapOf<String, Any>().apply {
if (options == null) {
return@apply
}
if (options.hasKey("topPercent")) {
put("topPercent", options.getDouble("topPercent"))
}
if (options.hasKey("leftPercent")) {
put("leftPercent", options.getDouble("leftPercent"))
}
if (options.hasKey("align")) {
put("align", options.getInt("align"))
}
if (options.hasKey("color")) {
options.getString("color")?.let { put("color", it) }
}
if (options.hasKey("backgroundColor")) {
options.getString("backgroundColor")?.let { put("backgroundColor", it) }
}
if (options.hasKey("widthPercent")) {
put("widthPercent", options.getDouble("widthPercent"))
}
if (options.hasKey("fontSize")) {
put("fontSize", options.getDouble("fontSize"))
}
}
try {
lyricView?.showLyricWindow(initLyric, mapOptions)
promise.resolve(true)
} catch (e: Exception) {
promise.reject("Exception", e.message)
}
}
} catch (e: Exception) {
promise.reject("Exception", e.message)
}
}
@ReactMethod
fun hideStatusBarLyric(promise: Promise) {
try {
UiThreadUtil.runOnUiThread {
lyricView?.hideLyricWindow()
}
promise.resolve(true)
} catch (e: Exception) {
promise.reject("Exception", e.message)
}
}
@ReactMethod
fun setStatusBarLyricText(lyric: String, promise: Promise) {
try {
UiThreadUtil.runOnUiThread {
lyricView?.setText(lyric)
}
promise.resolve(true)
} catch (e: Exception) {
promise.reject("Exception", e.message)
}
}
@ReactMethod
fun setStatusBarLyricAlign(alignment: Int, promise: Promise) {
try {
UiThreadUtil.runOnUiThread {
lyricView?.setAlign(alignment)
}
promise.resolve(true)
} catch (e: Exception) {
promise.reject("Exception", e.message)
}
}
@ReactMethod
fun setStatusBarLyricTop(pct: Double, promise: Promise) {
try {
UiThreadUtil.runOnUiThread {
lyricView?.setTopPercent(pct)
}
promise.resolve(true)
} catch (e: Exception) {
promise.reject("Exception", e.message)
}
}
@ReactMethod
fun setStatusBarLyricLeft(pct: Double, promise: Promise) {
try {
UiThreadUtil.runOnUiThread {
lyricView?.setLeftPercent(pct)
}
promise.resolve(true)
} catch (e: Exception) {
promise.reject("Exception", e.message)
}
}
@ReactMethod
fun setStatusBarLyricWidth(pct: Double, promise: Promise) {
try {
UiThreadUtil.runOnUiThread {
lyricView?.setWidth(pct)
}
promise.resolve(true)
} catch (e: Exception) {
promise.reject("Exception", e.message)
}
}
@ReactMethod
fun setStatusBarLyricFontSize(fontSize: Float, promise: Promise) {
try {
UiThreadUtil.runOnUiThread {
lyricView?.setFontSize(fontSize)
}
promise.resolve(true)
} catch (e: Exception) {
promise.reject("Exception", e.message)
}
}
@ReactMethod
fun setStatusBarColors(textColor: String?, backgroundColor: String?, promise: Promise) {
try {
UiThreadUtil.runOnUiThread {
lyricView?.setColors(textColor, backgroundColor)
}
promise.resolve(true)
} catch (e: Exception) {
promise.reject("Exception", e.message)
}
}
}
@@ -0,0 +1,19 @@
package `fun`.upup.musicfree.lyricUtil
import android.view.View
import com.facebook.react.ReactPackage
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ReactShadowNode
import com.facebook.react.uimanager.ViewManager
class LyricUtilPackage : ReactPackage {
override fun createViewManagers(
reactContext: ReactApplicationContext
): MutableList<ViewManager<View, ReactShadowNode<*>>> = mutableListOf()
override fun createNativeModules(
reactContext: ReactApplicationContext
): MutableList<NativeModule> = listOf(LyricUtilModule(reactContext)).toMutableList()
}
@@ -0,0 +1,222 @@
package `fun`.upup.musicfree.lyricUtil
import android.app.Activity
import android.content.Context
import android.graphics.Color
import android.graphics.PixelFormat
import android.graphics.drawable.ColorDrawable
import android.hardware.SensorManager
import android.os.Build
import android.util.DisplayMetrics
import android.util.Log
import android.view.Gravity
import android.view.MotionEvent
import android.view.OrientationEventListener
import android.view.View
import android.view.WindowManager
import android.widget.TextView
import com.facebook.react.bridge.ReactContext
class LyricView(private val reactContext: ReactContext) : Activity(), View.OnTouchListener {
private var windowManager: WindowManager? = null
private var orientationEventListener: OrientationEventListener? = null
private var layoutParams: WindowManager.LayoutParams? = null
private var tv: TextView? = null
// 窗口信息
private var windowWidth = 0.0
private var windowHeight = 0.0
private var widthPercent = 0.0
private var leftPercent = 0.0
private var topPercent = 0.0
override fun onTouch(view: View, motionEvent: MotionEvent): Boolean {
Log.d("touch", "Desktop Touch")
return false
}
// 展示歌词窗口
fun showLyricWindow(initText: String?, options: Map<String, Any>) {
try {
if (windowManager == null) {
windowManager = reactContext.getSystemService(WINDOW_SERVICE) as WindowManager
layoutParams = WindowManager.LayoutParams()
val outMetrics = DisplayMetrics()
windowManager?.defaultDisplay?.getMetrics(outMetrics)
windowWidth = outMetrics.widthPixels.toDouble()
windowHeight = outMetrics.heightPixels.toDouble()
layoutParams?.type = if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
WindowManager.LayoutParams.TYPE_SYSTEM_ALERT
else
WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY
/*
* topPercent: number;
* leftPercent: number;
* align: number;
* color: string;
* backgroundColor: string;
* widthPercent: number;
* fontSize: number;
*/
val topPercent = options["topPercent"]
val leftPercent = options["leftPercent"]
val align = options["align"]
val color = options["color"]
val backgroundColor = options["backgroundColor"]
val widthPercent = options["widthPercent"]
val fontSize = options["fontSize"]
this.widthPercent = widthPercent?.toString()?.toDouble() ?: 0.5
layoutParams?.width = (this.widthPercent * windowWidth).toInt()
layoutParams?.height = WindowManager.LayoutParams.WRAP_CONTENT
layoutParams?.gravity = Gravity.TOP or Gravity.START
this.leftPercent = leftPercent?.toString()?.toDouble() ?: 0.5
layoutParams?.x = (this.leftPercent * (windowWidth - layoutParams!!.width)).toInt()
layoutParams?.y = 0
layoutParams?.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL or
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN or
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS or
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
layoutParams?.format = PixelFormat.TRANSPARENT
tv = TextView(reactContext).apply {
text = initText ?: ""
textSize = fontSize?.toString()?.toFloat() ?: 14f
setBackgroundColor(Color.parseColor(rgba2argb(backgroundColor?.toString() ?: "#84888153")))
setTextColor(Color.parseColor(rgba2argb(color?.toString() ?: "#FFE9D2")))
setPadding(12, 6, 12, 6)
gravity = align?.toString()?.toInt() ?: Gravity.CENTER
}
windowManager?.addView(tv, layoutParams)
topPercent?.toString()?.toDouble()?.let { setTopPercent(it) }
listenOrientationChange()
}
} catch (e: Exception) {
hideLyricWindow()
throw e
}
}
private fun listenOrientationChange() {
if (windowManager == null) return
if (orientationEventListener == null) {
orientationEventListener = object : OrientationEventListener(reactContext, SensorManager.SENSOR_DELAY_NORMAL) {
override fun onOrientationChanged(orientation: Int) {
if (windowManager != null) {
val outMetrics = DisplayMetrics()
windowManager?.defaultDisplay?.getMetrics(outMetrics)
windowWidth = outMetrics.widthPixels.toDouble()
windowHeight = outMetrics.heightPixels.toDouble()
layoutParams?.width = (widthPercent * windowWidth).toInt()
layoutParams?.x = (leftPercent * (windowWidth - layoutParams!!.width)).toInt()
layoutParams?.y = (topPercent * (windowHeight - tv!!.height)).toInt()
windowManager?.updateViewLayout(tv, layoutParams)
}
}
}
}
if (orientationEventListener?.canDetectOrientation() == true) {
orientationEventListener?.enable()
}
}
private fun unlistenOrientationChange() {
orientationEventListener?.disable()
}
private fun rgba2argb(color: String): String {
return if (color.length == 9) {
color[0] + color.substring(7, 9) + color.substring(1, 7)
} else {
color
}
}
// 隐藏歌词窗口
fun hideLyricWindow() {
if (windowManager != null) {
tv?.let {
try {
windowManager?.removeView(it)
} catch (e: Exception) {
// Handle exception
}
tv = null
}
windowManager = null
layoutParams = null
unlistenOrientationChange()
}
}
// 设置歌词内容
fun setText(text: String) {
tv?.text = text
}
fun setAlign(gravity: Int) {
tv?.gravity = gravity
}
fun setTopPercent(pct: Double) {
var percent = pct.coerceIn(0.0, 1.0)
tv?.let {
layoutParams?.y = (percent * (windowHeight - it.height)).toInt()
windowManager?.updateViewLayout(it, layoutParams)
}
this.topPercent = percent
}
fun setLeftPercent(pct: Double) {
var percent = pct.coerceIn(0.0, 1.0)
tv?.let {
layoutParams?.x = (percent * (windowWidth - layoutParams!!.width)).toInt()
windowManager?.updateViewLayout(it, layoutParams)
}
this.leftPercent = percent
}
fun setColors(textColor: String?, backgroundColor: String?) {
tv?.let {
textColor?.let { color -> it.setTextColor(Color.parseColor(rgba2argb(color))) }
backgroundColor?.let { color ->
it.background = ColorDrawable(Color.parseColor(rgba2argb(color)))
}
}
}
fun setWidth(pct: Double) {
var percent = pct.coerceIn(0.3, 1.0)
tv?.let {
val width = (percent * windowWidth).toInt()
val originalWidth = layoutParams?.width ?: 0
layoutParams?.x = if (width <= originalWidth) {
layoutParams!!.x + (originalWidth - width) / 2
} else {
layoutParams!!.x - (width - originalWidth) / 2
}.coerceAtLeast(0).coerceAtMost((windowWidth - width).toInt())
layoutParams?.width = width
windowManager?.updateViewLayout(it, layoutParams)
}
this.widthPercent = percent
}
fun setFontSize(fontSize: Float) {
tv?.textSize = fontSize
}
}
@@ -0,0 +1,190 @@
package `fun`.upup.musicfree.mp3Util
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.media.MediaMetadataRetriever
import android.net.Uri
import com.facebook.react.bridge.*
import org.jaudiotagger.audio.AudioFileIO
import org.jaudiotagger.tag.FieldKey
import java.io.File
import java.io.FileOutputStream
import java.io.IOException
class Mp3UtilModule(private val reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
override fun getName() = "Mp3Util"
private fun isContentUri(uri: Uri?): Boolean {
return uri?.scheme?.equals("content", ignoreCase = true) == true
}
@ReactMethod
fun getBasicMeta(filePath: String, promise: Promise) {
try {
val uri = Uri.parse(filePath)
val mmr = MediaMetadataRetriever()
if (isContentUri(uri)) {
mmr.setDataSource(reactApplicationContext, uri)
} else {
mmr.setDataSource(filePath)
}
val properties = Arguments.createMap().apply {
putString("duration", mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION))
putString("bitrate", mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_BITRATE))
putString("artist", mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ARTIST))
putString("author", mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_AUTHOR))
putString("album", mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ALBUM))
putString("title", mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_TITLE))
putString("date", mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DATE))
putString("year", mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_YEAR))
}
promise.resolve(properties)
} catch (e: Exception) {
promise.reject("Exception", e.message)
}
}
@ReactMethod
fun getMediaMeta(filePaths: ReadableArray, promise: Promise) {
val metas = Arguments.createArray()
val mmr = MediaMetadataRetriever()
for (i in 0 until filePaths.size()) {
try {
val filePath = filePaths.getString(i)
val uri = Uri.parse(filePath)
if (isContentUri(uri)) {
mmr.setDataSource(reactApplicationContext, uri)
} else {
mmr.setDataSource(filePath)
}
val properties = Arguments.createMap().apply {
putString("duration", mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION))
putString("bitrate", mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_BITRATE))
putString("artist", mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ARTIST))
putString("author", mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_AUTHOR))
putString("album", mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ALBUM))
putString("title", mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_TITLE))
putString("date", mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DATE))
putString("year", mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_YEAR))
}
metas.pushMap(properties)
} catch (e: Exception) {
metas.pushNull()
}
}
try {
mmr.release()
} catch (ignored: Exception) {
}
promise.resolve(metas)
}
@ReactMethod
fun getMediaCoverImg(filePath: String, promise: Promise) {
try {
val file = File(filePath)
if (!file.exists()) {
promise.reject("File not exist", "File not exist")
return
}
val pathHashCode = file.hashCode()
if (pathHashCode == 0) {
promise.resolve(null)
return
}
val cacheDir = reactContext.cacheDir
val coverFile = File(cacheDir, "image_manager_disk_cache/$pathHashCode.jpg")
if (coverFile.exists()) {
promise.resolve(coverFile.toURI().toString())
return
}
val mmr = MediaMetadataRetriever()
mmr.setDataSource(filePath)
val coverImg = mmr.embeddedPicture
if (coverImg != null) {
val bitmap = BitmapFactory.decodeByteArray(coverImg, 0, coverImg.size)
FileOutputStream(coverFile).use { outputStream ->
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream)
outputStream.flush()
}
promise.resolve(coverFile.toURI().toString())
} else {
promise.resolve(null)
}
mmr.release()
} catch (ignored: Exception) {
promise.reject("Error", "Got error")
}
}
@ReactMethod
fun getLyric(filePath: String, promise: Promise) {
try {
val file = File(filePath)
if (file.exists()) {
val audioFile = AudioFileIO.read(file)
val tag = audioFile.tag
val lrc = tag.getFirst(FieldKey.LYRICS)
promise.resolve(lrc)
} else {
throw IOException("File not found")
}
} catch (e: Exception) {
promise.reject("Error", e.message)
}
}
@ReactMethod
fun setMediaTag(filePath: String, meta: ReadableMap, promise: Promise) {
try {
val file = File(filePath)
if (file.exists()) {
val audioFile = AudioFileIO.read(file)
val tag = audioFile.tag
meta.getString("title")?.let { tag.setField(FieldKey.TITLE, it) }
meta.getString("artist")?.let { tag.setField(FieldKey.ARTIST, it) }
meta.getString("album")?.let { tag.setField(FieldKey.ALBUM, it) }
meta.getString("lyric")?.let { tag.setField(FieldKey.LYRICS, it) }
meta.getString("comment")?.let { tag.setField(FieldKey.COMMENT, it) }
audioFile.commit()
promise.resolve(true)
} else {
promise.reject("Error", "File Not Exist")
}
} catch (e: Exception) {
promise.reject("Error", e.message)
}
}
@ReactMethod
fun getMediaTag(filePath: String, promise: Promise) {
try {
val file = File(filePath)
if (file.exists()) {
val audioFile = AudioFileIO.read(file)
val tag = audioFile.tag
val properties = Arguments.createMap().apply {
putString("title", tag.getFirst(FieldKey.TITLE))
putString("artist", tag.getFirst(FieldKey.ARTIST))
putString("album", tag.getFirst(FieldKey.ALBUM))
putString("lyric", tag.getFirst(FieldKey.LYRICS))
putString("comment", tag.getFirst(FieldKey.COMMENT))
}
promise.resolve(properties)
} else {
promise.reject("Error", "File Not Found")
}
} catch (e: Exception) {
promise.reject("Error", e.message)
}
}
}
@@ -0,0 +1,19 @@
package `fun`.upup.musicfree.mp3Util
import android.view.View
import com.facebook.react.ReactPackage
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ReactShadowNode
import com.facebook.react.uimanager.ViewManager
class Mp3UtilPackage : ReactPackage {
override fun createViewManagers(
reactContext: ReactApplicationContext
): MutableList<ViewManager<View, ReactShadowNode<*>>> = mutableListOf()
override fun createNativeModules(
reactContext: ReactApplicationContext
): MutableList<NativeModule> = listOf(Mp3UtilModule(reactContext)).toMutableList()
}
@@ -0,0 +1,164 @@
package `fun`.upup.musicfree.utils; // replace your-apps-package-name with your apps package name
import android.Manifest
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.net.Uri
import android.os.Build
import android.os.Environment
import android.os.PowerManager
import android.provider.Settings
import android.util.DisplayMetrics
import android.view.WindowInsets
import android.view.WindowManager
import androidx.core.content.ContextCompat
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod
import com.facebook.react.bridge.WritableMap
import kotlin.system.exitProcess
class UtilsModule(context: ReactApplicationContext) : ReactContextBaseJavaModule(context) {
private val reactContext: ReactApplicationContext = context;
override fun getName() = "NativeUtils"
@ReactMethod
fun exitApp() {
val activity = reactContext.currentActivity
activity?.finishAndRemoveTask()
android.os.Process.killProcess(android.os.Process.myPid())
exitProcess(0)
}
@ReactMethod
fun checkStoragePermission(promise: Promise) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
promise.resolve(Environment.isExternalStorageManager())
} else {
val readPermission = ContextCompat.checkSelfPermission(reactContext, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED
val writePermission = ContextCompat.checkSelfPermission(reactContext, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED
promise.resolve(readPermission && writePermission)
}
}
@ReactMethod
fun requestStoragePermission() {
val intent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION).apply {
data = Uri.parse("package:${reactContext.packageName}")
}
} else {
Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
data = Uri.parse("package:${reactContext.packageName}")
}
}
reactContext.currentActivity?.startActivity(intent)
}
@ReactMethod
fun isIgnoringBatteryOptimizations(promise: Promise) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
val packageName = reactContext.packageName
val pm = reactContext.getSystemService(Context.POWER_SERVICE) as PowerManager
promise.resolve(pm.isIgnoringBatteryOptimizations(packageName))
} else {
promise.resolve(true)
}
}
@ReactMethod
fun requestIgnoreBatteryOptimizations(promise: Promise) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
try {
val packageName = reactContext.packageName
val pm = reactContext.getSystemService(Context.POWER_SERVICE) as PowerManager
if (!pm.isIgnoringBatteryOptimizations(packageName)) {
val intent = Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS)
intent.data = Uri.parse("package:$packageName")
if (reactContext.currentActivity != null) {
reactContext.currentActivity?.startActivity(intent)
} else {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
reactContext.startActivity(intent)
}
}
promise.resolve(true)
} catch (e: Exception) {
promise.reject(e)
}
} else {
promise.resolve(true)
}
}
@ReactMethod(isBlockingSynchronousMethod = true)
fun getWindowDimensions(): WritableMap {
val windowManager = reactApplicationContext.getSystemService(Context.WINDOW_SERVICE) as WindowManager
val displayMetrics: DisplayMetrics = reactApplicationContext.resources.displayMetrics
val density = displayMetrics.density
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
// Android 11 (API 30) 及以上使用新 API
val windowMetrics = windowManager.currentWindowMetrics
val insets = windowMetrics.windowInsets.getInsetsIgnoringVisibility(WindowInsets.Type.systemBars())
val bounds = windowMetrics.bounds
val totalWidthPx = bounds.width()
val totalHeightPx = bounds.height()
val leftInsetPx = insets.left
val rightInsetPx = insets.right
val topInsetPx = insets.top
val bottomInsetPx = insets.bottom
val usableWidthPx = totalWidthPx - leftInsetPx - rightInsetPx
val usableHeightPx = totalHeightPx - topInsetPx - bottomInsetPx
val usableWidthDp = usableWidthPx / density
val usableHeightDp = usableHeightPx / density
Arguments.createMap().apply {
putDouble("width", usableWidthDp.toDouble())
putDouble("height", usableHeightDp.toDouble())
}
} else {
// Android 10 及以下使用旧 API
val display = windowManager.defaultDisplay
val realSize = android.graphics.Point()
display.getRealSize(realSize)
// 获取状态栏和导航栏高度
val resources = reactApplicationContext.resources
var statusBarHeight = 0
var navigationBarHeight = 0
// 状态栏高度
val statusBarResourceId = resources.getIdentifier("status_bar_height", "dimen", "android")
if (statusBarResourceId > 0) {
statusBarHeight = resources.getDimensionPixelSize(statusBarResourceId)
}
// 导航栏高度
val navigationBarResourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android")
if (navigationBarResourceId > 0) {
navigationBarHeight = resources.getDimensionPixelSize(navigationBarResourceId)
}
val usableWidthPx = realSize.x
val usableHeightPx = realSize.y - statusBarHeight - navigationBarHeight
val usableWidthDp = usableWidthPx / density
val usableHeightDp = usableHeightPx / density
Arguments.createMap().apply {
putDouble("width", usableWidthDp.toDouble())
putDouble("height", usableHeightDp.toDouble())
}
}
}
}
@@ -0,0 +1,19 @@
package `fun`.upup.musicfree.utils
import android.view.View
import com.facebook.react.ReactPackage
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ReactShadowNode
import com.facebook.react.uimanager.ViewManager
class UtilsPackage : ReactPackage {
override fun createViewManagers(
reactContext: ReactApplicationContext
): MutableList<ViewManager<View, ReactShadowNode<*>>> = mutableListOf()
override fun createNativeModules(
reactContext: ReactApplicationContext
): MutableList<NativeModule> = listOf(UtilsModule(reactContext)).toMutableList()
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

+24
View File
@@ -0,0 +1,24 @@
buildscript {
ext {
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 30
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.24"
}
repositories {
maven { url 'https://maven.aliyun.com/repository/central'}
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
}
}
apply plugin: "com.facebook.react.rootproject"
+39
View File
@@ -0,0 +1,39 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# Use this property to enable support to the new architecture.
# This will allow you to use TurboModules and the Fabric render in
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true
Binary file not shown.
@@ -0,0 +1,8 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
# distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.10.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+252
View File
@@ -0,0 +1,252 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
+94
View File
@@ -0,0 +1,94 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
+21
View File
@@ -0,0 +1,21 @@
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex ->
def command = [
'node',
'--no-warnings',
'--eval',
'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))',
'react-native-config',
'--json',
'--platform',
'android'
].toList()
ex.autolinkLibrariesFromCommand(command)
}
rootProject.name = 'MusicFree'
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")
useExpoModules()
+4
View File
@@ -0,0 +1,4 @@
{
"name": "MusicFree",
"displayName": "MusicFree"
}
+21
View File
@@ -0,0 +1,21 @@
module.exports = {
presets: ['babel-preset-expo'],
plugins: [
[
'module-resolver',
{
root: ['./'],
alias: {
'^@/(.+)': './src/\\1',
'webdav': "webdav/dist/react-native"
},
},
],
'react-native-reanimated/plugin',
],
env: {
production: {
plugins: ['transform-remove-console'],
},
},
};
+305
View File
@@ -0,0 +1,305 @@
`2025.10.9 v0.6.2`
1. 【优化】优化了软件启动速度
`2025.8.3 v0.6.1`
1. 修复进入软件时播放进度丢失的问题
2. 修复某些情况下无法添加到歌单的问题
`2025.7.24 v0.6.0`
一大波优化和问题修复~
1. 【功能】优化了倒计时功能,支持倒计时结束后,歌曲播放完成后再退出应用
2. 【功能】支持多语言
3. 【功能】新增音源重定向功能
4. 【功能】自定义主题中,选择颜色弹窗支持直接输入颜色代码
5. 【功能】新增配置,音频被暂时打断时可调节降低音量的幅度(感谢@eastcukt
6. 【功能】本地歌单中,高亮正在播放的歌曲
7. 【功能】本地歌单中,新增定位按钮,点击定位按钮可跳转到正在播放的音乐
8. 【优化】略微调大了歌词页的播放按钮
9. 【优化】首页-推荐歌单支持左右滑动
10. 【优化】优化播放器的稳定性,减少出现闪退/播放自动暂停的情况
11. 【修复】修复了一批样式bug
12. 【修复】修复了点击更新订阅插件后,插件页始终展示加载中的问题
13. 【修复】修复部分情况下歌词页高亮混乱的问题
14. 【插件】插件获取评论支持分页(需要插件配合)
15. 【插件】修复移动端axios库中读取的cookie和桌面版不一致的问题
16. 【插件】插件新增description字段,可嵌入markdown格式的插件说明
17. 【其他】重构了核心部分代码逻辑,后续维护起来成本会小一些
`2025.4.4 v0.5.1`
1. 【修复】修复插件开关点击无效的问题
2. 【修复】修复开屏图片消失的问题
3. 【优化】增加新建歌单名称的长度限制
4. 【优化】优化插件安装失败的提示样式
`2025.2.9 v0.5.0`
1. 【升级】升级ReactNative到0.76.5(注意:升级后只支持安卓7.0及以上设备,低于此版本的设备请不要升级)
2. 【修复】修复了运行应用一段时间后容易闪退的问题
3. 【修复】修复了插件网络请求无法传递cookie的问题
4. 【修复】新增了设置本地歌单封面的功能(在0.4版本暂时下线了)
5. 【修复】修复了部分情况下,播放本地音乐提示 “当前非Wifi环境” 的问题
6. 【优化】优化了一些代码逻辑
`2024.11.10 v0.4.4`
【修复】修复了部分系统上弹窗、浮层等无法出现,或动画表现异常的问题
`2024.10.27 v0.4.3`
【修复】修复了部分系统上文字显示不全的问题
`2024.9.18 v0.4.2`
1. 【修复】修复本地音乐无法播放的问题
`2024.9.8 v0.4.1`
安装包上传到了飞书云文档,浏览器打开链接后有个下载说明,可以根据这个指引安装apk
1. 【修复】修复桌面歌词无法开启的问题
2. 【修复】修复了修改桌面歌词颜色会导致闪退的问题
3. 【修复】回滚了本地音乐部分读取文件的逻辑
4. 【修复】修复了点击【编辑歌单信息】按钮无效的问题
`2024.9.1 v0.4.0`
本次更新修改了歌单的存储机制,建议谨慎更新
安装包上传到了飞书云文档,浏览器打开链接后有个下载说明,可以根据这个指引安装apk
1. 【升级】ReactNative升级到0.74.4
2. 【功能】换了个logo和开屏页
3. 【功能】播放列表的歌曲限制从1500首调整到10000首
4. 【功能】重写了歌曲排序机制
5. 【功能】插件新增评论区功能(需要插件实现getMusicComments方法)
6. 【优化】调整部分样式,优化删除歌曲时的性能
7. 【修复】修复歌词翻译错位的问题
8. 【修复】修复部分情况下无法复制作者/专辑的问题
9. 【修复】修复在歌单详情页删除歌单会导致白屏的问题
10. 【修复】修复搜索框在部分情况下自动触发搜索的问题
11. 【修复】修复右上角菜单位置跳变的问题
12. 【修复】修复在预览专辑封面时触发返回不会关闭预览弹窗的问题
13. 【修复】下载文件时转移文件中的保留字符(感谢@GuGuMur
14. 【其他】分架构打包,更新开源协议为 AGPL 3.0
`2024.3.31 v0.3.0`
本次更新优化了存储方式,更新到此版本后,歌单会自动转化为新的存储方式;安装新版本后再回退到老版本会导致歌单清空,虽然测试下来没啥问题,但是请谨慎升级Orz
备用链接:https://pan.baidu.com/s/1HmbHlh3vTcSyVXcOs-7kTA?pwd=saku 提取码: saku
1. 【功能】历史播放记录支持批量编辑
2. 【功能】歌单内支持按照加入时间排序
3. 【功能】新增设置“本地歌单添加歌曲顺序”,在歌单内添加歌曲时可以加到歌单开头
4. 【功能】首页新建歌单旁边新增“导入歌单”按钮,点击时会自动寻找具有导入歌单功能的插件,并拉起导入浮层
5. 【功能】设置项中新增“自动换源”功能,当插件失效/无法获取播放链接时,会自动尝试更换其他源的同名歌曲
6. 【优化】尝试优化了软件启动时间,应该有点作用
7. 【优化】更新了存储方式,现在单个歌单可以存储大于10000首歌曲;
8. 【优化】调整未开启“允许使用移动网络播放”开关时的样式表现
9. 【优化】优化了设置页的样式
10. 【优化】微调歌词详情页的布局
11. 【修复】修复打开弹窗时,点击返回按钮不关闭弹窗的问题
12. 【修复】修复启动软件时播放模式错误的问题
13. 【修复】修复搜索结果页特定情况下白屏的问题
`2024.1.21 v0.2.0`
1. 【功能】支持 Webdav 备份 & 播放
2. 【功能】插件支持显示作者
3. 【功能】插件榜单详情支持分页
4. 【功能】首页&歌词页样式改版:新增歌词进度调整、歌词大小调整、歌词翻译、自动搜索歌词
5. 【功能】新增收藏歌单功能
6. 【功能】侧边栏新增“权限管理”设置
7. 【功能】音乐播放栏支持左右滑动切歌(可能会闪一下,后续修掉)
8. 【功能】新增 “通知栏显示关闭按钮” 设置
9. 【优化】重构播放、数据存储逻辑
10. 【优化】统一浮层、toast样式
11. 【优化】去除插件URL必须以.js结尾的限制
12. 【修复】修改无限列表到底不触发onEndReached的问题 (感谢 @282931)
13. 【修复】修复标题栏背景色透明度不生效的问题
14. 【修复】修复播放记录退出后被清空的问题
15. 【修复】修复部分情况下深色模式异常的问题
16. 【其他】这次安装包备用链接发到百度网盘了:https://pan.baidu.com/s/1H360C0MqejKXS67XwMqgPw?pwd=6666 提取码6666
`2023.11.24 v0.1.2-alpha.0`
1. 【功能】新增桌面歌词功能,可在设置页开启(开启之前需要去手机设置授予悬浮窗权限)
2. 【功能】可以使用 MusicFree 打开本地 .js 或 .mp3 文件;其中 .js 文件会被当作插件安装; .mp3 文件会直接播放
3. 【功能】新增插件设置:打开软件时自动更新插件、安装插件时不校验版本
4. 【功能】新增播放设置:打开软件时自动播放歌曲
5. 【功能】插件页新增开关,可以控制是否在榜单、热门歌单、搜索结果中展示对应插件的结果
6. 【功能】插件协议新增 “用户变量” ,可以在插件中获取 APP 输入的配置(可以由此实现自建音乐源的插件/webdav源插件,但是还没写)
7. 【优化】下载单曲支持选择音质
8. 【优化】新增“关联歌词方式”设置,如果设置为“输入歌曲ID”,则会恢复老版本关联歌词,即输入ID关联歌词
9. 【优化】侧边栏新增“返回桌面”按钮
10. 【修复】修复榜单、推荐歌单、搜索歌词页白屏闪退的问题 (感谢 @282931)
11. 【修复】修复自定义背景模糊度和透明度无法设置为 0 的问题 (感谢 @282931)
12. 【修复】修复浅色主题状态栏表现错误的问题
13. 【修复】修复歌单批量编辑无法删除的问题
14. 【修复】修复无法恢复桌面版导出的歌单的问题
`2023.10.15 v0.1.1-alpha.0`
1. 【功能】音源支持m3u8 (桌面版下个版本支持m3u8)
2. 【功能】增加歌曲详情页屏幕常亮的设置
3. 【功能】重构主题相关功能,增加「跟随系统深色设置」选项;调整大部分样式,移除第三方UI库
4. 【功能】插件页增加「插件批量更新」的功能
5. 【功能】取消原「歌词关联」的逻辑,修改为拉起「歌词搜索」浮层
6. 【优化】增加了一些无障碍属性
7. 【修复】修复部分场景下无法保存歌单的问题
8. 【修复】修复部分场景下重启之后无法播放歌曲的问题
9. 【插件】部分插件更新,侧边栏更新插件即可
`2023.8.13 v0.1.0-alpha.10`
1. 【功能】当前音乐无歌词时可以在歌词页搜索歌词
2. 【优化】调整右上角弹出气泡的位置
3. 【优化】增加打开歌曲详情页时的默认表现设置
4. 【优化】修复进入歌词页时候显示跳变的问题
5. 【插件】插件协议更新,更新后可以配置某插件不出现在特定的搜索结果页下
6. 【插件】部分插件更新,侧边栏更新插件即可
`2023.6.26 v0.1.0-alpha.9`
1. 【功能】新增搜索歌单功能
2. 【功能】新增播放记录功能
3. 【优化】加了一些无障碍适配
4. 【插件】部分插件更新,侧边栏更新插件即可
`2023.6.4 v0.1.0-alpha.8`
1. 【功能】新增“推荐歌单”功能,需要配合支持该功能的插件使用
2. 【功能】导入本地文件时增加“全选”按钮
3. 【优化】修改“保存专辑封面”时的提示文案
4. 【修复】修复当目标歌曲在播放列表内时,添加到下一首播放无效的问题
5. 【插件】部分插件更新,侧边栏更新插件即可
`2023.5.21 v0.1.0-alpha.7`
1. 【功能】歌单页新增“播放全部”按钮
2. 【功能】歌曲播放页中,长按专辑封面可保存到本地
3. 【功能】歌单页新增“歌单排序”功能
4. 【插件】b站插件作者页API变动,侧边栏更新插件即可
`2023.5.3 v0.1.0-alpha.6`
小小拖更一下~
1. 【功能】歌单内搜索时支持英文大小写模糊搜索
2. 【修复】修复首次进入时歌曲可能无法正常播放的问题
`2023.3.26 v0.1.0-alpha.5`
1. 【功能】更新弹窗新增“跳过此版本”的复选框
2. 【功能】侧边栏-基本设置-开发选项中新增“查看错误日志”的选项,点击会弹出错误日志的弹窗
3. 【修复】修复输入框被软键盘遮挡的问题
4. 【优化】优化了定时关闭的样式
5. 【文档】文档中更新了插件的制作教程。文档地址:http://musicfree.upup.fun
`2023.3.19 v0.1.0-alpha.4`
1. 【功能】适配横屏设备
2. 【功能】新建歌单时添加默认歌单名;从专辑/榜单批量添加到新歌单时,默认以专辑名/榜单名为新歌单名
3. 【修复】修复设备有虚拟按键时,浮层会被遮挡的问题
4. 【修复】修复拖拽歌词时部分情况下时间异常的问题
5. 【修复】调整下载失败时的提示文案
6. 【插件】部分插件有更新,可以从侧边栏更新
`2023.2.26 v0.1.0-alpha.3`
1. 【功能】专辑列表支持分页,需要配合插件更新;
2. 【优化】去掉了全面屏手机界面下方的小白条;
3. 【优化】调整拖拽歌词时标识线的对齐范围;调整歌词拖到最底端时的逻辑;
4. 【优化】调整下载歌曲时的文件名;
5. 【优化】导入歌曲时的提示文案增加滚动;
6. 【修复】修复特殊情况下歌曲中断后可能恢复到错误状态的问题(未验证);
7. 【插件】个别插件有更新,可以去侧边栏更新订阅。
`2023.2.13 v0.1.0-alpha.2`
1. 【功能】备份&恢复:可以把本地的歌单和插件备份到一个json文件中,也可以从本地文件或网络上恢复插件和歌单。
2. 【修复】修复部分情况下后台播放切换歌曲时暂停的问题
3. 【修复】修复部分场景无法下载的问题
4. 【修复】修复部分场景无法删除本地文件的问题
5. 【优化】简单优化了下歌单列表
6. 【调试】调试面板现在可以打印出插件中的console语句
`2023.1.27 v0.1.0-alpha.1`
1. !!!【功能】插件更新,升级到新版本之后原有插件完全不兼容;更新后卸载原有插件,然后更新订阅即可(具体看公众号示例)
2. 【功能】新增功能“倍速播放”
3. 【功能】重写了插件订阅的逻辑,现在应该会更合理一点点
4. 【功能】删除本地文件之前增加二次确认提醒
5. 【功能】增加了一些无关紧要的分享
6. 【样式】换了个logo,丑的更直白一些
7. 【样式】调整了一些样式(如播放页的模糊和透明度、歌词样式等)
8. 【样式】专辑描述文字默认6行,点击可以展开或折叠
9. 【修复】修复部分情况下无法下载的问题
10. 【插件】大量插件有更新,更新到此版本后更新订阅即可
`2023.1.8 v0.0.1-alpha.13`
1. 【功能】主页入口增加“榜单”
2. 【功能】歌单页新增“编辑歌单信息”,可以修改歌单名称和歌单封面
3. 【修复】修复了一个会导致播放音乐时拖拽排序卡顿的问题,做了一些其他优化
4. 【插件】部分插件有更新,可以在侧边栏更新
`2022.12.25 v0.0.1-alpha.12`
1. 【功能】增加“单击搜索结果中单曲tab”时的行为配置
2. 【功能】增加调试配置及调试面板,可用于查看插件的错误信息
3. 【修复】修复部分情况下本地音乐中断时无法继续播放的问题
4. 【修复】尝试修复扫描本地音乐,音乐文件太多时可能卡死的问题
`2022.12.11 v0.0.1-alpha.11`
1. 【功能】完善音质功能
2. 【功能】更新下载功能,支持根据音质下载文件;修复一些小问题
3. 【功能】新增播放时被打断的设置,可设置为暂停或者暂时降低音量
4. 【优化】调整侧边栏样式,侧边栏新增“定时关闭”功能
5. 【优化】本地音乐读取歌词时,会自动读取同目录下的同名lrc文件作为歌词
6. 【修复】修复安装插件时误弹安装失败提示的问题
7. 【修复】修复部分情况下本地文件删除失败的问题
8. 【修复】修复本地音乐在通知栏不显示音乐标题的问题
9. 【插件】示例插件仓库中migu有更新(支持音质),需要可自行更新
`2022.12.4 v0.0.1-alpha.10`
1. 【功能】支持自定义下载路径
2. 【功能】支持插件排序(也就是搜索结果的排序)
3. 【功能】增加音质相关的配置
4. 【优化】弹窗、浮层的性能优化,页面嵌套较深时卡顿的情况应该会好一点
5. 【优化】拖拽排序,比上个版本手感应该会好一点
6. 【修复】修复在歌词页清空播放列表时白屏的问题
`2022.11.20 v0.0.1-alpha.9`
1. 【功能】本地音乐读取内嵌歌词
2. 【功能】批量编辑页新增了凑合能用的拖拽排序
3. 【功能】歌曲详情浮层新增凑合能用的定时关闭
4. 【功能】添加到歌单时可以新建歌单
5. 【功能】本地音乐扫描支持外置sd卡;支持导入aac格式
6. 【优化】优化播放列表浮层拉起时的锚定
7. 【修复】修复更新弹窗无法滚动的问题
8. 【修复】修复安卓12状态栏概率不沉浸的问题
9. 【修复】修复安卓12、13播一首就停的问题
10. 【插件】示例插件有更新,可以删掉原有插件重新导入
`2022.11.13 v0.0.1-alpha.8`
1. 【功能】侧边栏插件设置新增“订阅插件”功能,订阅之后直接点击“更新插件”即可更新,不需要清空重装了
2. 【功能】本地音乐读取内置封面
3. 【功能】本地音乐歌单支持批量删除(不删除源文件)
4. 【优化】重写导入本地音乐的逻辑,支持多选文件夹;修复部分机型重启应用时本地音乐消失的问题(可能需要删除后重新导入);支持导入flac,wav,wav,m4a,ogg等格式
5. 【优化】重写播放列表浮层,拉起时会锚定到当前正在播放的歌曲
6. 【优化】调整部分逻辑,可能会减少音频卡顿时卡死的情况
7. 【修复】修复歌曲详情页进度条不连续的问题
8. 【修复】修复某些情况下无法关联歌词的问题
9. 【修复】修复正在播放的歌曲无歌词时,进入歌词页白屏的问题
10. 【插件】示例插件有更新,可以删掉原有插件重新导入
`2022.10.30 v0.0.1-alpha.7`
1. 新增功能:历史记录一键清空
2. 新增功能:歌手页、本地歌单页支持批量编辑
3. 修复移动网络下无法播放本地音乐的问题
4. 样式优化&修复:toast提示显示异常、侧边栏样式优化、歌单内序号显示不全、【关于】页无法滑动
5. 之前使用的拖拽排序组件在列表较大时有很严重的性能问题,会导致卡顿甚至白屏,因此批量编辑页暂时去掉了拖拽排序,后续会重新加上
`2022.10.22 v0.0.1-alpha.6`
1. 重要!! v0.0.1-alpha.5以前的版本无法通过app正常更新,请在gitee/github发布页下载最新版本(v0.0.1-alpha.6),或QQ群自取;
2. 导入本地音乐时,如果未识别本地音乐文件,则会使用文件名作为音乐名;
3. 自建歌单、专辑详情页增加批量选择功能,可点击右上角查看(歌曲较多时可能有点卡,后续优化);使用方式:选中歌曲可进行下一首播放/加入歌单/下载/删除,长按拖动进行排序;删除/排序后点击保存按钮方可生效
4. 调整歌单内歌曲编号字体大小;
`2022.10.16 v0.0.1-alpha.5`
1. 新增功能:导入本地音乐文件
2. 从网络源安装的插件可在插件页直接更新
3. 调整下载逻辑
`2022.10.06 v0.0.1-alpha.4`
1. 修复专辑详情页没有loading的问题
2. 为插件新增Cookie管理器
3. 优化播放页的显示
4. 新增一键卸载全部插件的功能
`2022.10.04 v0.0.1-alpha.3`
1. 修复设置页无法滚动的问题
2. 修复播放结束时可能暂停的问题
`2022.10.03 v0.0.1-alpha.2`
1. 插件协议更新,需要重新安装插件
2. 支持批量导入插件
3. 新增清空播放列表功能
4. 优化搜索结果面板和播放专辑逻辑
`2022.10.02`
测试版本出现啦!撒花
@@ -0,0 +1,89 @@
# Ignore Battery Optimization Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 补齐 Android 忽略电池优化权限链路,减少锁屏后一段时间被系统回收导致的停播问题。
**Architecture:** 复用现有 `NativeUtils` 原生模块承接 Android 电池优化查询与申请能力,在权限页增加对应入口和状态展示。JS 层先补回归测试,再用最小改动补 Manifest、原生模块、类型声明与文案。
**Tech Stack:** React Native, Kotlin Android module, Jest, react-test-renderer
---
### Task 1: Permissions Page Regression Test
**Files:**
- Create: `src/pages/permissions/index.test.tsx`
- Modify: `src/pages/permissions/index.tsx`
- [ ] **Step 1: Write the failing test**
```tsx
it("renders ignore battery optimization entry and calls native request handler", async () => {
// mock NativeUtils.isIgnoringBatteryOptimizations -> true
// render Permissions
// assert translated entry exists
// trigger onPress
// expect NativeUtils.requestIgnoreBatteryOptimizations toHaveBeenCalled()
});
```
- [ ] **Step 2: Run test to verify it fails**
Run: `npx jest src/pages/permissions/index.test.tsx --runInBand`
Expected: FAIL because the current page does not render or call battery optimization APIs.
- [ ] **Step 3: Write minimal implementation**
```tsx
type IPermissionTypes = "floatingWindow" | "fileStorage" | "batteryOptimization";
updates.batteryOptimization = await NativeUtils.isIgnoringBatteryOptimizations();
onPress={() => NativeUtils.requestIgnoreBatteryOptimizations()}
```
- [ ] **Step 4: Run test to verify it passes**
Run: `npx jest src/pages/permissions/index.test.tsx --runInBand`
Expected: PASS
### Task 2: Android Native Bridge
**Files:**
- Modify: `android/app/src/main/AndroidManifest.xml`
- Modify: `android/app/src/main/java/fun/upup/musicfree/utils/UtilsModule.kt`
- Modify: `src/native/utils/index.ts`
- Modify: `src/types/core/i18n/index.d.ts`
- Modify: `src/core/i18n/languages/zh-cn.json`
- Modify: `src/core/i18n/languages/en-us.json`
- Modify: `src/core/i18n/languages/zh-tw.json`
- [ ] **Step 1: Add Android permission declaration**
```xml
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
```
- [ ] **Step 2: Add native query and request methods**
```kotlin
@ReactMethod
fun isIgnoringBatteryOptimizations(promise: Promise) { ... }
@ReactMethod
fun requestIgnoreBatteryOptimizations(promise: Promise) { ... }
```
- [ ] **Step 3: Expose methods to JS and add i18n keys**
```ts
isIgnoringBatteryOptimizations: () => Promise<boolean>;
requestIgnoreBatteryOptimizations: () => Promise<boolean>;
```
- [ ] **Step 4: Run targeted verification**
Run: `npx jest src/pages/permissions/index.test.tsx --runInBand`
Expected: PASS
Run: `npx eslint src/pages/permissions/index.tsx src/pages/permissions/index.test.tsx src/native/utils/index.ts`
Expected: exit code `0`
@@ -0,0 +1,130 @@
# TopList Platform Filter Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Add an in-page platform filter to the MusicFree toplist screen so `Music_Server` toplists can be narrowed to `全部 / QQ音乐 / 网易云 / 酷我` without changing plugin or server APIs.
**Architecture:** Keep the existing plugin-level `TabView` unchanged and implement the new behavior entirely inside the current toplist scene. A small pure helper will derive filter tags and filtered sections from the existing `IMusicSheetGroupItem[]` response, and the board panel UI will render a horizontal tag row only when more than one platform group exists.
**Tech Stack:** React Native, TypeScript, Jotai state already present in toplist page, Jest for pure logic tests.
---
### Task 1: Add Pure Toplist Filter Logic
**Files:**
- Create: `D:\source\MusicFree\src\pages\topList\hooks\topListPlatformFilter.ts`
- Create: `D:\source\MusicFree\src\pages\topList\hooks\topListPlatformFilter.test.ts`
- [ ] **Step 1: Write the failing test**
```ts
import {
buildTopListPlatformTags,
filterTopListSections,
} from "./topListPlatformFilter";
describe("topListPlatformFilter", () => {
const sections = [
{ title: "QQ音乐", data: [{ id: "qq-1" }] },
{ title: "网易云", data: [{ id: "wy-1" }] },
{ title: "酷我", data: [{ id: "kw-1" }] },
];
it("prepends 全部 when there are multiple platform groups", () => {
expect(buildTopListPlatformTags(sections)).toEqual([
{ id: "", title: "全部" },
{ id: "QQ音乐", title: "QQ音乐" },
{ id: "网易云", title: "网易云" },
{ id: "酷我", title: "酷我" },
]);
});
it("returns all sections for 全部", () => {
expect(filterTopListSections(sections, "")).toEqual(sections);
});
it("returns only the matching platform section", () => {
expect(filterTopListSections(sections, "网易云")).toEqual([
{ title: "网易云", data: [{ id: "wy-1" }] },
]);
});
it("returns an empty list when the platform is missing", () => {
expect(filterTopListSections(sections, "咪咕")).toEqual([]);
});
});
```
- [ ] **Step 2: Run test to verify it fails**
Run: `npm test -- --runInBand src/pages/topList/hooks/topListPlatformFilter.test.ts`
Expected: FAIL because `topListPlatformFilter.ts` does not exist yet.
- [ ] **Step 3: Write minimal implementation**
```ts
const ALL_ID = "";
export function buildTopListPlatformTags(sections: IMusic.IMusicSheetGroupItem[]) {
if (!Array.isArray(sections) || sections.length <= 1) {
return [];
}
return [
{ id: ALL_ID, title: "全部" },
...sections.map(section => ({
id: section.title ?? "",
title: section.title ?? "",
})),
].filter(tag => tag.id || tag.title === "全部");
}
export function filterTopListSections(
sections: IMusic.IMusicSheetGroupItem[],
platformId: string,
) {
if (!platformId) {
return sections ?? [];
}
return (sections ?? []).filter(section => section.title === platformId);
}
```
- [ ] **Step 4: Run test to verify it passes**
Run: `npm test -- --runInBand src/pages/topList/hooks/topListPlatformFilter.test.ts`
Expected: PASS.
### Task 2: Wire the Filter into TopList UI
**Files:**
- Modify: `D:\source\MusicFree\src\pages\topList\components\boardPanel.tsx`
- Reuse: `D:\source\MusicFree\src\components\base\typeTag.tsx`
- [ ] **Step 1: Add local selected-platform state and render tags**
Add a horizontal `ScrollView` above the `SectionList` that renders `TypeTag` entries built from `buildTopListPlatformTags(topListData?.data || [])`. Default selected tag id is `""`.
- [ ] **Step 2: Filter sections before passing them to SectionList**
Call `filterTopListSections(topListData?.data || [], selectedPlatformId)` and use the result as the `sections` prop.
- [ ] **Step 3: Keep existing loading and empty-state behavior**
Do not change:
- loading gate based on `RequestStateCode.FINISHED`
- `TopListItem` rendering
- section header rendering
- toplist detail navigation
- [ ] **Step 4: Run the new logic test again**
Run: `npm test -- --runInBand src/pages/topList/hooks/topListPlatformFilter.test.ts`
Expected: PASS.
- [ ] **Step 5: Smoke-check the touched file compiles cleanly**
Run: `npx tsc --noEmit --pretty false`
Expected: exit code `0` if the repository typechecks cleanly. If unrelated repo-wide issues block this, note the blocker and at least ensure the edited file imports resolve correctly.
@@ -0,0 +1,121 @@
# MusicFree 榜单页平台筛选设计
日期:2026-04-21
## 背景
当前榜单页已经有一层顶部分页,用来在不同插件之间切换。但对 `Music_Server` 这类会在单个插件页内返回多组榜单的平台,页面会一次性展开 `QQ音乐 / 网易云 / 酷我` 等全部分组,导致列表过长,用户需要反复滚动才能定位目标平台。
推荐歌单页的体验更接近用户预期:先进入一个插件页,再按当前页面语义查看更小范围的数据。本次要把类似的“平台筛选”体验补到榜单页,但保持现有服务端和插件协议不变。
## 备选方案
### 方案 A:页内二级筛选
- 保留现有顶部插件分页。
- 在榜单列表上方增加一排本地筛选标签:`全部 / QQ音乐 / 网易云 / 酷我`
- 点击后只显示对应分组,未选中的分组不渲染。
优点:
- 改动最小,完全复用现有 `getTopLists()` 返回的分组结构。
- 不改插件、不改服务端、不改榜单详情链路。
- 用户理解成本最低,仍然是“先选插件,再选平台”。
缺点:
- 只解决页内分组过长,不会减少服务端返回的数据量。
### 方案 B:把页内平台分组再抬升成新的横向分页
- 保留顶部插件分页。
- 进入插件页后,再做第二层横向 `TabBar` 切换 `全部 / QQ音乐 / 网易云 / 酷我`
优点:
- 视觉上和推荐歌单页更像。
缺点:
- UI 层级更重,榜单页顶部会出现两层横向切换。
- 对移动端窄屏更拥挤,维护成本高于方案 A。
### 方案 C:改插件,按当前选中平台只返回一组榜单
- 在插件或服务端增加平台过滤参数。
- 榜单页每次切换平台都重新请求。
优点:
- 数据语义更强,可减少单次渲染数据量。
缺点:
- 需要改插件协议,可能联动 `Music_Server` 接口。
- 明显超出“仅优化榜单页交互”的范围。
## 选型
采用方案 A。
原因:
- 能直接解决“列表太长”的问题。
- 风险最小,最符合这次“只做榜单页筛选,不碰插件协议”的目标。
- 后续如果还想升级成方案 B,也可以在同一份本地筛选数据上演进。
## 交互设计
`MusicFree -> 榜单 -> 当前插件页` 内新增一排页内筛选标签。
规则如下:
- 默认选中 `全部`
- `全部` 时沿用现有表现,显示所有分组。
- 选中某个平台时,只展示该平台对应 section。
- 如果只有一个平台分组,则不显示筛选条。
- 进入榜单详情、返回榜单页时,保留当前插件页的筛选状态即可;切换到别的插件页时,各自维护自己的筛选状态。
## 代码范围
主要修改:
- `src/pages/topList/components/boardPanelWrapper.tsx`
- 负责把当前插件的榜单分组数据取出并交给展示层。
- `src/pages/topList/components/boardPanel.tsx`
- 新增筛选条 UI,并根据当前筛选结果渲染 section 列表。
可选新增:
- `src/pages/topList/hooks/`
- 若筛选逻辑稍有复杂,拆一个轻量纯函数或 hook,避免把过滤逻辑塞进组件 JSX。
明确不改:
- `keep-alive-master/Music_Free/music_server.js`
- `Music_Server` 服务端接口
- `catalog-sync`
## 数据流
1. 插件 `getTopLists()` 继续返回 `IMusicSheetGroupItem[]`,例如:
- `[{ title: "QQ音乐", data: [...] }, { title: "网易云", data: [...] }]`
2. 榜单页拿到完整分组数据后,在客户端本地构造筛选标签。
3. 当前选中的平台标签决定 `SectionList``sections` 输入。
4. 榜单详情页仍使用原有 `TopListItem -> getTopListDetail()` 流程,不做改动。
## 测试与验收
至少补一条纯逻辑测试,覆盖:
- `全部` 返回全部 section。
- 指定平台仅返回匹配 section。
- 未命中平台时返回空列表。
人工验收标准:
- `Music_Server` 插件榜单页默认显示全部榜单。
- 点击 `网易云` 后只剩网易云榜单。
- 点击 `QQ音乐` / `酷我` 同理。
- 返回 `全部` 后恢复完整列表。
- 其它插件榜单页不受影响。
+66
View File
@@ -0,0 +1,66 @@
import fs from 'fs/promises';
import path from 'path';
import * as url from "node:url";
function toCamelCase(str) {
// 将下划线和中划线统一替换为空格
let camelCaseStr = str.replace(/[-_]/g, ' ');
// 将每个单词的首字母大写,其余字母小写
camelCaseStr = camelCaseStr.split(' ').map(word => {
return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
}).join('');
return camelCaseStr;
}
// 读取所有的icon
const basePath = path.resolve(url.fileURLToPath(import.meta.url), '../../src/assets/icons')
// 读取所有的svg
const icons = await fs.readdir(basePath)
const assets = icons.map(it => ({
componentName: toCamelCase(it.slice(0, -path.extname(it).length)) + "Icon",
filePath: `@/assets/icons/${it}`,
name: it.slice(0, -path.extname(it).length)
}))
let scriptTemplate = `// This file is generated by generate-assets.mjs. DO NOT MODIFY.
import {SvgProps} from 'react-native-svg';
${assets.map(asset => `import ${asset.componentName} from '${asset.filePath}';`).join('\n')}
export type IIconName = ${assets.map(asset => `'${asset.name}'`).join(' | ')};
interface IProps extends SvgProps {
/** 图标名称 */
name: IIconName;
/** 图标大小 */
size?: number;
}
const iconMap = {
${assets.map(asset => ` '${asset.name}': ${asset.componentName}`).join(',\n')}
} as const;
export default function Icon(props: IProps) {
const {name, size} = props;
const newProps = {
...props,
width: props.width ?? size,
height: props.width ?? size
} as SvgProps;
const Component = iconMap[name];
return <Component {...newProps}></Component>;
}
`
const targetPath = path.resolve(url.fileURLToPath(import.meta.url), '../../src/components/base/icon.tsx');
await fs.writeFile(targetPath, scriptTemplate, 'utf8');
console.log(`Generate Succeed. ${assets.length} assets.`)
+11
View File
@@ -0,0 +1,11 @@
/**
* @format
*/
import {AppRegistry} from 'react-native';
import {name as appName} from './app.json';
import TrackPlayer from 'react-native-track-player';
import Pages from '@/entry';
AppRegistry.registerComponent(appName, () => Pages);
TrackPlayer.registerPlaybackService(() => require('./src/service/index'));
+11
View File
@@ -0,0 +1,11 @@
# This `.xcode.env` file is versioned and is used to source the environment
# used when running script phases inside Xcode.
# To customize your local environment, you can create an `.xcode.env.local`
# file that is not versioned.
# NODE_BINARY variable contains the PATH to the node executable.
#
# Customize the NODE_BINARY variable here.
# For example, to use nvm with brew, add the following line
# . "$(brew --prefix nvm)/nvm.sh" --no-use
export NODE_BINARY=$(command -v node)
@@ -0,0 +1,694 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
00E356F31AD99517003FC87E /* MusicFreeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* MusicFreeTests.m */; };
0C80B921A6F3F58F76C31292 /* libPods-MusicFree.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-MusicFree.a */; };
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
7699B88040F8A987B510C191 /* libPods-MusicFree-MusicFreeTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-MusicFree-MusicFreeTests.a */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 83CBB9F71A601CBA00E9B192;
proxyType = 1;
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
remoteInfo = MusicFree;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
00E356EE1AD99517003FC87E /* MusicFreeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MusicFreeTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* MusicFreeTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MusicFreeTests.m; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* MusicFree.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MusicFree.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = MusicFree/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = MusicFree/AppDelegate.mm; sourceTree = "<group>"; };
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = MusicFree/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = MusicFree/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = MusicFree/main.m; sourceTree = "<group>"; };
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = MusicFree/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
19F6CBCC0A4E27FBF8BF4A61 /* libPods-MusicFree-MusicFreeTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-MusicFree-MusicFreeTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3B4392A12AC88292D35C810B /* Pods-MusicFree.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MusicFree.debug.xcconfig"; path = "Target Support Files/Pods-MusicFree/Pods-MusicFree.debug.xcconfig"; sourceTree = "<group>"; };
5709B34CF0A7D63546082F79 /* Pods-MusicFree.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MusicFree.release.xcconfig"; path = "Target Support Files/Pods-MusicFree/Pods-MusicFree.release.xcconfig"; sourceTree = "<group>"; };
5B7EB9410499542E8C5724F5 /* Pods-MusicFree-MusicFreeTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MusicFree-MusicFreeTests.debug.xcconfig"; path = "Target Support Files/Pods-MusicFree-MusicFreeTests/Pods-MusicFree-MusicFreeTests.debug.xcconfig"; sourceTree = "<group>"; };
5DCACB8F33CDC322A6C60F78 /* libPods-MusicFree.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-MusicFree.a"; sourceTree = BUILT_PRODUCTS_DIR; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = MusicFree/LaunchScreen.storyboard; sourceTree = "<group>"; };
89C6BE57DB24E9ADA2F236DE /* Pods-MusicFree-MusicFreeTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MusicFree-MusicFreeTests.release.xcconfig"; path = "Target Support Files/Pods-MusicFree-MusicFreeTests/Pods-MusicFree-MusicFreeTests.release.xcconfig"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
00E356EB1AD99517003FC87E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7699B88040F8A987B510C191 /* libPods-MusicFree-MusicFreeTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0C80B921A6F3F58F76C31292 /* libPods-MusicFree.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
00E356EF1AD99517003FC87E /* MusicFreeTests */ = {
isa = PBXGroup;
children = (
00E356F21AD99517003FC87E /* MusicFreeTests.m */,
00E356F01AD99517003FC87E /* Supporting Files */,
);
path = MusicFreeTests;
sourceTree = "<group>";
};
00E356F01AD99517003FC87E /* Supporting Files */ = {
isa = PBXGroup;
children = (
00E356F11AD99517003FC87E /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
13B07FAE1A68108700A75B9A /* MusicFree */ = {
isa = PBXGroup;
children = (
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
13B07FB01A68108700A75B9A /* AppDelegate.mm */,
13B07FB51A68108700A75B9A /* Images.xcassets */,
13B07FB61A68108700A75B9A /* Info.plist */,
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
13B07FB71A68108700A75B9A /* main.m */,
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */,
);
name = MusicFree;
sourceTree = "<group>";
};
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
isa = PBXGroup;
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
5DCACB8F33CDC322A6C60F78 /* libPods-MusicFree.a */,
19F6CBCC0A4E27FBF8BF4A61 /* libPods-MusicFree-MusicFreeTests.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
);
name = Libraries;
sourceTree = "<group>";
};
83CBB9F61A601CBA00E9B192 /* PBXGroup */ = {
isa = PBXGroup;
children = (
13B07FAE1A68108700A75B9A /* MusicFree */,
832341AE1AAA6A7D00B99B32 /* Libraries */,
00E356EF1AD99517003FC87E /* MusicFreeTests */,
83CBBA001A601CBA00E9B192 /* Products */,
2D16E6871FA4F8E400B85C8A /* Frameworks */,
BBD78D7AC51CEA395F1C20DB /* Pods */,
);
indentWidth = 2;
sourceTree = "<group>";
tabWidth = 2;
usesTabs = 0;
};
83CBBA001A601CBA00E9B192 /* Products */ = {
isa = PBXGroup;
children = (
13B07F961A680F5B00A75B9A /* MusicFree.app */,
00E356EE1AD99517003FC87E /* MusicFreeTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
BBD78D7AC51CEA395F1C20DB /* Pods */ = {
isa = PBXGroup;
children = (
3B4392A12AC88292D35C810B /* Pods-MusicFree.debug.xcconfig */,
5709B34CF0A7D63546082F79 /* Pods-MusicFree.release.xcconfig */,
5B7EB9410499542E8C5724F5 /* Pods-MusicFree-MusicFreeTests.debug.xcconfig */,
89C6BE57DB24E9ADA2F236DE /* Pods-MusicFree-MusicFreeTests.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
00E356ED1AD99517003FC87E /* MusicFreeTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "MusicFreeTests" */;
buildPhases = (
A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */,
00E356EA1AD99517003FC87E /* Sources */,
00E356EB1AD99517003FC87E /* Frameworks */,
00E356EC1AD99517003FC87E /* Resources */,
C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */,
F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
00E356F51AD99517003FC87E /* PBXTargetDependency */,
);
name = MusicFreeTests;
productName = MusicFreeTests;
productReference = 00E356EE1AD99517003FC87E /* MusicFreeTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
13B07F861A680F5B00A75B9A /* MusicFree */ = {
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "MusicFree" */;
buildPhases = (
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */,
E235C05ADACE081382539298 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
name = MusicFree;
productName = MusicFree;
productReference = 13B07F961A680F5B00A75B9A /* MusicFree.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
83CBB9F71A601CBA00E9B192 = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1210;
TargetAttributes = {
00E356ED1AD99517003FC87E = {
CreatedOnToolsVersion = 6.2;
TestTargetID = 13B07F861A680F5B00A75B9A /* MusicFree */;
};
13B07F861A680F5B00A75B9A = {
LastSwiftMigration = 1120;
};
};
};
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "MusicFree" */;
compatibilityVersion = "Xcode 12.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 83CBB9F61A601CBA00E9B192 /* PBXGroup */;
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
13B07F861A680F5B00A75B9A /* MusicFree */,
00E356ED1AD99517003FC87E /* MusicFreeTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
00E356EC1AD99517003FC87E /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
13B07F8E1A680F5B00A75B9A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"$(SRCROOT)/.xcode.env.local",
"$(SRCROOT)/.xcode.env",
);
name = "Bundle React Native code and images";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\n source \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\n# The project root by default is one level up from the ios directory\nexport PROJECT_ROOT=\"$PROJECT_DIR\"/..\n\nif [[ \"$CONFIGURATION\" = *Debug* ]]; then\n export SKIP_BUNDLING=1\nfi\nif [[ -z \"$ENTRY_FILE\" ]]; then\n # Set the entry JS file using the bundler's entry resolution.\n export ENTRY_FILE=\"$(\"$NODE_BINARY\" -e \"require('expo/scripts/resolveAppEntry')\" \"$PROJECT_ROOT\" ios absolute | tail -n 1)\"\nfi\n\nif [[ -z \"$CLI_PATH\" ]]; then\n # Use Expo CLI\n export CLI_PATH=\"$(\"$NODE_BINARY\" --print \"require.resolve('@expo/cli')\")\"\nfi\nif [[ -z \"$BUNDLE_COMMAND\" ]]; then\n # Default Expo CLI command for bundling\n export BUNDLE_COMMAND=\"export:embed\"\nfi\n\n`\"$NODE_BINARY\" --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\"`\n";
};
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-MusicFree/Pods-MusicFree-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-MusicFree/Pods-MusicFree-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MusicFree/Pods-MusicFree-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-MusicFree-MusicFreeTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-MusicFree-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-MusicFree-MusicFreeTests/Pods-MusicFree-MusicFreeTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-MusicFree-MusicFreeTests/Pods-MusicFree-MusicFreeTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MusicFree-MusicFreeTests/Pods-MusicFree-MusicFreeTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-MusicFree/Pods-MusicFree-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-MusicFree/Pods-MusicFree-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MusicFree/Pods-MusicFree-resources.sh\"\n";
showEnvVarsInLog = 0;
};
F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-MusicFree-MusicFreeTests/Pods-MusicFree-MusicFreeTests-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-MusicFree-MusicFreeTests/Pods-MusicFree-MusicFreeTests-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MusicFree-MusicFreeTests/Pods-MusicFree-MusicFreeTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
00E356EA1AD99517003FC87E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
00E356F31AD99517003FC87E /* MusicFreeTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
13B07F871A680F5B00A75B9A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */,
13B07FC11A68108700A75B9A /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 13B07F861A680F5B00A75B9A /* MusicFree */;
targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
00E356F61AD99517003FC87E /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-MusicFree-MusicFreeTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = MusicFreeTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
"$(inherited)",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MusicFree.app/MusicFree";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
00E356F71AD99517003FC87E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-MusicFree-MusicFreeTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = MusicFreeTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
"$(inherited)",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MusicFree.app/MusicFree";
SWIFT_VERSION = 5.0;
};
name = Release;
};
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-MusicFree.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = MusicFree/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = MusicFree;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-MusicFree.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
INFOPLIST_FILE = MusicFree/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = MusicFree;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
83CBBA201A601CBA00E9B192 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
);
LIBRARY_SEARCH_PATHS = (
"\"$(SDKROOT)/usr/lib/swift\"",
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
"\"$(inherited)\"",
);
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DFOLLY_NO_CONFIG",
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
SDKROOT = iphoneos;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
83CBBA211A601CBA00E9B192 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
);
LIBRARY_SEARCH_PATHS = (
"\"$(SDKROOT)/usr/lib/swift\"",
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
"\"$(inherited)\"",
);
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DFOLLY_NO_CONFIG",
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
SWIFT_VERSION = 5.0;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "MusicFreeTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
00E356F61AD99517003FC87E /* Debug */,
00E356F71AD99517003FC87E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "MusicFree" */ = {
isa = XCConfigurationList;
buildConfigurations = (
13B07F941A680F5B00A75B9A /* Debug */,
13B07F951A680F5B00A75B9A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "MusicFree" */ = {
isa = XCConfigurationList;
buildConfigurations = (
83CBBA201A601CBA00E9B192 /* Debug */,
83CBBA211A601CBA00E9B192 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 83CBB9F71A601CBA00E9B192;
}
@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1210"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "MusicFree.app"
BlueprintName = "MusicFree"
ReferencedContainer = "container:MusicFree.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "MusicFreeTests.xctest"
BlueprintName = "MusicFreeTests"
ReferencedContainer = "container:MusicFree.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "MusicFree.app"
BlueprintName = "MusicFree"
ReferencedContainer = "container:MusicFree.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "MusicFree.app"
BlueprintName = "MusicFree"
ReferencedContainer = "container:MusicFree.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
+7
View File
@@ -0,0 +1,7 @@
#import <RCTAppDelegate.h>
#import <Expo/Expo.h>
#import <UIKit/UIKit.h>
@interface AppDelegate : EXAppDelegateWrapper
@end
+31
View File
@@ -0,0 +1,31 @@
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.moduleName = @"MusicFree";
// You can add your custom initial props in the dictionary below.
// They will be passed down to the ViewController used by React Native.
self.initialProps = @{};
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
return [self bundleURL];
}
- (NSURL *)bundleURL
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@".expo/.virtual-metro-entry"];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
@end
@@ -0,0 +1,53 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
+52
View File
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>MusicFree</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<!-- Do not change NSAllowsArbitraryLoads to true, or you will risk app rejection! -->
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="MusicFree" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
<rect key="frame" x="0.0" y="202" width="375" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="MN2-I3-ftu">
<rect key="frame" x="0.0" y="626" width="375" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="Bcu-3y-fUS" firstAttribute="bottom" secondItem="MN2-I3-ftu" secondAttribute="bottom" constant="20" id="OZV-Vh-mqD"/>
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
<constraint firstItem="MN2-I3-ftu" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="akx-eg-2ui"/>
<constraint firstItem="MN2-I3-ftu" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" id="i1E-0Y-4RG"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="x7j-FC-K8j"/>
</constraints>
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="52.173913043478265" y="375"/>
</scene>
</scenes>
</document>
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>35F9.1</string>
</array>
</dict>
</array>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>
+10
View File
@@ -0,0 +1,10 @@
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
+24
View File
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
@@ -0,0 +1,66 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import <React/RCTLog.h>
#import <React/RCTRootView.h>
#define TIMEOUT_SECONDS 600
#define TEXT_TO_LOOK_FOR @"Welcome to React"
@interface MusicFreeTests : XCTestCase
@end
@implementation MusicFreeTests
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test
{
if (test(view)) {
return YES;
}
for (UIView *subview in [view subviews]) {
if ([self findSubviewInView:subview matching:test]) {
return YES;
}
}
return NO;
}
- (void)testRendersWelcomeScreen
{
UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
BOOL foundElement = NO;
__block NSString *redboxError = nil;
#ifdef DEBUG
RCTSetLogFunction(
^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
if (level >= RCTLogLevelError) {
redboxError = message;
}
});
#endif
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
foundElement = [self findSubviewInView:vc.view
matching:^BOOL(UIView *view) {
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
return YES;
}
return NO;
}];
}
#ifdef DEBUG
RCTSetLogFunction(RCTDefaultLogFunction);
#endif
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
}
@end
+64
View File
@@ -0,0 +1,64 @@
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
platform :ios, min_ios_version_supported
prepare_react_native_project!
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
target 'MusicFree' do
use_expo_modules!
post_integrate do |installer|
begin
expo_patch_react_imports!(installer)
rescue => e
Pod::UI.warn e
end
end
if ENV['EXPO_USE_COMMUNITY_AUTOLINKING'] == '1'
config_command = ['node', '-e', "process.argv=['', '', 'config'];require('@react-native-community/cli').run()"];
else
config_command = [
'node',
'--no-warnings',
'--eval',
'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))',
'react-native-config',
'--json',
'--platform',
'ios'
]
end
config = use_native_modules!(config_command)
use_react_native!(
:path => config[:reactNativePath],
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'MusicFreeTests' do
inherit! :complete
# Pods for testing
end
post_install do |installer|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false,
# :ccache_enabled => true
)
end
end
+3
View File
@@ -0,0 +1,3 @@
module.exports = {
preset: 'react-native',
};
+41
View File
@@ -0,0 +1,41 @@
name: keep-alive
# 触发条件
on:
workflow_dispatch:
schedule:
- cron: '0 0 */3 * *'
env:
TZ: Asia/Shanghai
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: 迁出代码
uses: actions/checkout@v2
- name: 安装Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: 加载缓存
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/run_in_Actions/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: 设置时区
run: sudo timedatectl set-timezone 'Asia/Shanghai'
- name: 安装依赖
run: |
pip install -r ./requirements.txt
- name: 执行任务
env:
render_url: ${{secrets.render_url}}
render_key: ${{secrets.render_key}}
header_key: ${{secrets.header_key}}
run: |
python ./main.py
@@ -0,0 +1 @@
{"plugins":[{"name":"小秋音乐","url":"https://mirror.ghproxy.com/https://raw.githubusercontent.com/Huibq/keep-alive/master/Music_Free/xiaoqiu.js","version":"0.3.0"},{"name":"小蜗音乐","url":"https://mirror.ghproxy.com/https://raw.githubusercontent.com/Huibq/keep-alive/master/Music_Free/xiaowo.js","version":"0.3.0"},{"name":"小芸音乐","url":"https://mirror.ghproxy.com/https://raw.githubusercontent.com/Huibq/keep-alive/master/Music_Free/xiaoyun.js","version":"0.3.0"},{"name":"小枸音乐","url":"https://mirror.ghproxy.com/https://raw.githubusercontent.com/Huibq/keep-alive/master/Music_Free/xiaogou.js","version":"0.3.0"},{"name":"小蜜音乐","url":"https://mirror.ghproxy.com/https://raw.githubusercontent.com/Huibq/keep-alive/master/Music_Free/xiaomi.js","version":"0.3.0"},{"name":"Audiomack","url":"https://gitee.com/maotoumao/MusicFreePlugins/raw/v0.1/dist/audiomack/index.js","version":"0.0.2"},{"name":"bilibili","url":"https://gitee.com/maotoumao/MusicFreePlugins/raw/v0.1/dist/bilibili/index.js","version":"0.1.15"},{"name":"歌词网","url":"https://gitee.com/maotoumao/MusicFreePlugins/raw/v0.1/dist/geciwang/index.js","version":"0.0.0"},{"name":"歌词千寻","url":"https://gitee.com/maotoumao/MusicFreePlugins/raw/v0.1/dist/geciqianxun/index.js","version":"0.0.0"},{"name":"快手","url":"https://gitee.com/maotoumao/MusicFreePlugins/raw/v0.1/dist/kuaishou/index.js","version":"0.0.1"},{"name":"猫耳FM","url":"https://gitee.com/maotoumao/MusicFreePlugins/raw/v0.1/dist/maoerfm/index.js","version":"0.1.4"},{"name":"Navidrome","url":"https://gitee.com/maotoumao/MusicFreePlugins/raw/v0.1/dist/navidrome/index.js","version":"0.0.0"},{"name":"音悦台","url":"https://gitee.com/maotoumao/MusicFreePlugins/raw/v0.1/dist/yinyuetai/index.js","version":"0.0.1"},{"name":"WebDAV","url":"https://gitee.com/maotoumao/MusicFreePlugins/raw/v0.1/dist/webdav/index.js","version":"0.0.2"},{"name":"Youtube","url":"https://gitee.com/maotoumao/MusicFreePlugins/raw/v0.1/dist/youtube/index.js","version":"0.0.1"}]}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,178 @@
"use strict";
const test = require("node:test");
const assert = require("node:assert/strict");
function loadPluginFresh() {
const modulePath = require.resolve("./music_server_lan");
delete require.cache[modulePath];
return require("./music_server_lan");
}
function clearRuntimeEnv() {
delete globalThis.env;
}
test.afterEach(() => {
clearRuntimeEnv();
});
test("plugin.userVariables exposes public and lan base urls", () => {
const plugin = loadPluginFresh();
const keys = plugin.userVariables.map((item) => item.key);
assert.deepEqual(keys, ["baseUrl", "lanBaseUrl", "accessToken"]);
});
test("recommend requests use lan base url when lan health probe succeeds", async () => {
const plugin = loadPluginFresh();
plugin.__clearTestState();
plugin.__setConfigForTests({
baseUrl: "http://64.83.43.123:18081",
lanBaseUrl: "http://192.168.5.43:18081",
accessToken: "",
});
const originalFetch = globalThis.fetch;
const fetchCalls = [];
globalThis.fetch = async (url, options) => {
fetchCalls.push({ url, options });
if (url === "http://192.168.5.43:18081/healthz") {
return {
ok: true,
status: 200,
text: async () => JSON.stringify({ status: "ok" }),
};
}
if (url === "http://192.168.5.43:18081/mf/v1/recommend/tags") {
return {
ok: true,
status: 200,
text: async () =>
JSON.stringify({
pinned: [{ id: "all", title: "all" }],
data: [],
}),
};
}
throw new Error(`Unexpected request: ${url}`);
};
try {
const result = await plugin.getRecommendSheetTags();
assert.equal(result.pinned[0].id, "all");
} finally {
globalThis.fetch = originalFetch;
}
assert.deepEqual(
fetchCalls.map((entry) => entry.url),
[
"http://192.168.5.43:18081/healthz",
"http://192.168.5.43:18081/mf/v1/recommend/tags",
],
);
});
test("recommend requests fall back to public base url when lan health probe fails", async () => {
const plugin = loadPluginFresh();
plugin.__clearTestState();
plugin.__setConfigForTests({
baseUrl: "http://64.83.43.123:18081",
lanBaseUrl: "http://192.168.5.43:18081",
accessToken: "",
});
const originalFetch = globalThis.fetch;
const fetchCalls = [];
globalThis.fetch = async (url, options) => {
fetchCalls.push({ url, options });
if (url === "http://192.168.5.43:18081/healthz") {
throw new Error("connect failed");
}
if (url === "http://64.83.43.123:18081/mf/v1/recommend/tags") {
return {
ok: true,
status: 200,
text: async () =>
JSON.stringify({
pinned: [{ id: "all", title: "all" }],
data: [],
}),
};
}
throw new Error(`Unexpected request: ${url}`);
};
try {
const result = await plugin.getRecommendSheetTags();
assert.equal(result.pinned[0].id, "all");
} finally {
globalThis.fetch = originalFetch;
}
assert.deepEqual(
fetchCalls.map((entry) => entry.url),
[
"http://192.168.5.43:18081/healthz",
"http://64.83.43.123:18081/mf/v1/recommend/tags",
],
);
});
test("getMediaSource joins relative stream url against lan base url after successful probe", async () => {
const plugin = loadPluginFresh();
plugin.__clearTestState();
plugin.__setConfigForTests({
baseUrl: "http://64.83.43.123:18081",
lanBaseUrl: "http://192.168.5.43:18081",
accessToken: "",
});
const originalFetch = globalThis.fetch;
const fetchCalls = [];
globalThis.fetch = async (url, options) => {
fetchCalls.push({ url, options });
if (url === "http://192.168.5.43:18081/healthz") {
return {
ok: true,
status: 200,
text: async () => JSON.stringify({ status: "ok" }),
};
}
if (url === "http://192.168.5.43:18081/mf/v1/media/resolve") {
return {
ok: true,
status: 200,
text: async () =>
JSON.stringify({
stream: {
url: "/mf/v1/media/stream/token-1",
},
selected_source: {
quality: "super",
},
}),
};
}
throw new Error(`Unexpected request: ${url}`);
};
try {
const result = await plugin.getMediaSource({ id: "song-1" }, "high");
assert.deepEqual(result, {
url: "http://192.168.5.43:18081/mf/v1/media/stream/token-1",
headers: {},
quality: "super",
});
} finally {
globalThis.fetch = originalFetch;
}
assert.deepEqual(
fetchCalls.map((entry) => entry.url),
[
"http://192.168.5.43:18081/healthz",
"http://192.168.5.43:18081/mf/v1/media/resolve",
],
);
});
@@ -0,0 +1 @@
{"plugins":[{"name":"小秋音乐","url":"https://fastly.jsdelivr.net/gh/Huibq/keep-alive/Music_Free/xiaoqiu.js","version":"0.3.0"},{"name":"小蜗音乐","url":"https://fastly.jsdelivr.net/gh/Huibq/keep-alive/Music_Free/xiaowo.js","version":"0.3.0"},{"name":"小芸音乐","url":"https://fastly.jsdelivr.net/gh/Huibq/keep-alive/Music_Free/xiaoyun.js","version":"0.3.0"},{"name":"小枸音乐","url":"https://fastly.jsdelivr.net/gh/Huibq/keep-alive/Music_Free/xiaogou.js","version":"0.3.0"},{"name":"小蜜音乐","url":"https://fastly.jsdelivr.net/gh/Huibq/keep-alive/Music_Free/xiaomi.js","version":"0.3.0"}]}
@@ -0,0 +1,3 @@
"use strict";
module.exports = require("./music_server");
@@ -0,0 +1,361 @@
"use strict";
const mockGet = jest.fn();
const mockPost = jest.fn();
jest.mock("axios", () => ({
create: jest.fn(() => ({
get: mockGet,
post: mockPost,
})),
}));
const plugin = require("./netease_17000");
function makeSongUrlResponse(id, url) {
return {
data: {
data: [
{
id,
url,
time: 0,
},
],
},
};
}
describe("netease_17000 getMediaSource fallback", () => {
beforeEach(() => {
mockGet.mockReset();
mockPost.mockReset();
});
test("falls back to noCopyrightRcmd.songId when original id has no source", async () => {
const originalId = "5268162";
const fallbackId = "2035171101";
const fallbackUrl = "http://example.com/fallback.mp3";
mockPost.mockResolvedValueOnce({
data: {
primary: null,
alternates: [],
},
});
mockGet.mockImplementation((url, config) => {
const params = (config && config.params) || {};
if (url.includes("/song/url/v1") && String(params.id) === originalId) {
return Promise.resolve(makeSongUrlResponse(Number(originalId), null));
}
if (url.includes("/song/detail") && String(params.ids) === originalId) {
return Promise.resolve({
data: {
songs: [
{
id: Number(originalId),
name: "origin",
ar: [{ name: "artist" }],
al: { name: "album" },
dt: 260000,
noCopyrightRcmd: {
songId: fallbackId,
},
},
],
},
});
}
if (url.includes("/song/url/v1") && String(params.id) === fallbackId) {
return Promise.resolve(makeSongUrlResponse(Number(fallbackId), fallbackUrl));
}
throw new Error(`Unexpected request: ${url} ${JSON.stringify(params)}`);
});
const result = await plugin.getMediaSource(
{
id: originalId,
title: "origin",
artist: "artist",
album: "album",
duration: 260,
},
"standard",
);
expect(result).toEqual({ url: fallbackUrl });
const requestedIds = mockGet.mock.calls
.filter((call) => call[0].includes("/song/url/v1"))
.map((call) => String((call[1] && call[1].params && call[1].params.id) || ""));
expect(requestedIds).toContain(originalId);
expect(requestedIds).toContain(fallbackId);
});
test("upgrades 126 netease media url to https during fallback", async () => {
const originalId = "5268162";
const fallbackId = "2035171101";
const fallbackUrl =
"http://m701.music.126.net/test-path/audio.mp3?vuutv=a+b/c";
mockPost.mockResolvedValueOnce({
data: {
primary: null,
alternates: [],
},
});
mockGet.mockImplementation((url, config) => {
const params = (config && config.params) || {};
if (url.includes("/song/url/v1") && String(params.id) === originalId) {
return Promise.resolve(makeSongUrlResponse(Number(originalId), null));
}
if (url.includes("/song/detail") && String(params.ids) === originalId) {
return Promise.resolve({
data: {
songs: [
{
id: Number(originalId),
name: "origin",
ar: [{ name: "artist" }],
al: { name: "album" },
dt: 260000,
noCopyrightRcmd: {
songId: fallbackId,
},
},
],
},
});
}
if (url.includes("/song/url/v1") && String(params.id) === fallbackId) {
return Promise.resolve(makeSongUrlResponse(Number(fallbackId), fallbackUrl));
}
throw new Error(`Unexpected request: ${url} ${JSON.stringify(params)}`);
});
const result = await plugin.getMediaSource(
{
id: originalId,
title: "origin",
artist: "artist",
album: "album",
duration: 260,
},
"standard",
);
expect(result).toEqual({
url: "https://m701.music.126.net/test-path/audio.mp3?vuutv=a+b/c",
});
});
test("prefers relay source for fallback song id when relay can resolve it", async () => {
const originalId = "5268162";
const fallbackId = "2035171101";
const relayUrl = "http://111.228.62.29:17000/api/unblock/stream/fallback-token";
const officialFallbackUrl = "http://m701.music.126.net/from-official.mp3";
mockPost
.mockResolvedValueOnce({
data: {
primary: null,
alternates: [],
},
})
.mockResolvedValueOnce({
data: {
primary: {
streamUrl: relayUrl,
},
alternates: [],
},
});
mockGet.mockImplementation((url, config) => {
const params = (config && config.params) || {};
const id = String(params.id || params.ids || "");
if (url.includes("/song/url/v1") && id === originalId) {
return Promise.resolve(makeSongUrlResponse(Number(originalId), null));
}
if (url.includes("/song/detail") && String(params.ids) === originalId) {
return Promise.resolve({
data: {
songs: [
{
id: Number(originalId),
name: "origin",
ar: [{ name: "artist" }],
al: { name: "album" },
dt: 260000,
noCopyrightRcmd: {
songId: fallbackId,
},
},
],
},
});
}
if (url.includes("/song/detail") && String(params.ids) === fallbackId) {
return Promise.resolve({
data: {
songs: [
{
id: Number(fallbackId),
name: "fallback-name",
ar: [{ name: "fallback-artist" }],
al: { name: "fallback-album" },
dt: 260000,
},
],
},
});
}
if (url.includes("/song/url/v1") && id === fallbackId) {
return Promise.resolve(makeSongUrlResponse(Number(fallbackId), officialFallbackUrl));
}
throw new Error(`Unexpected request: ${url} ${JSON.stringify(params)}`);
});
const result = await plugin.getMediaSource(
{
id: originalId,
title: "origin",
artist: "artist",
album: "album",
duration: 260,
},
"standard",
);
expect(result).toEqual({ url: relayUrl });
const fallbackOfficialCalls = mockGet.mock.calls.filter(
(call) =>
call[0].includes("/song/url/v1") &&
String((call[1] && call[1].params && call[1].params.id) || "") === fallbackId,
);
expect(fallbackOfficialCalls).toHaveLength(0);
});
});
describe("netease_17000 recommend sheets", () => {
beforeEach(() => {
mockGet.mockReset();
mockPost.mockReset();
});
test("builds recommend tag groups from playlist catlist", async () => {
mockGet.mockImplementation((url) => {
if (url.includes("/playlist/catlist")) {
return Promise.resolve({
data: {
categories: {
0: "语种",
1: "风格",
},
sub: [
{ category: 0, name: "华语", hot: true },
{ category: 0, name: "欧美", hot: false },
{ category: 1, name: "流行", hot: true },
],
},
});
}
throw new Error(`Unexpected request: ${url}`);
});
const result = await plugin.getRecommendSheetTags();
expect(result).toEqual({
pinned: [
{ id: "华语", title: "华语" },
{ id: "流行", title: "流行" },
],
data: [
{
title: "语种",
data: [
{ id: "华语", title: "华语" },
{ id: "欧美", title: "欧美" },
],
},
{
title: "风格",
data: [
{ id: "流行", title: "流行" },
],
},
],
});
});
test("loads recommend sheets by tag through top playlist endpoint", async () => {
mockGet.mockImplementation((url, config) => {
const params = (config && config.params) || {};
if (url.includes("/top/playlist")) {
return Promise.resolve({
data: {
playlists: [
{
id: 101,
name: "歌单A",
creator: { nickname: "作者A" },
description: "descA",
coverImgUrl: "coverA",
trackCount: 50,
playCount: 1000,
},
],
total: 21,
more: true,
},
});
}
throw new Error(`Unexpected request: ${url} ${JSON.stringify(params)}`);
});
const result = await plugin.getRecommendSheetsByTag({ id: "华语" }, 1);
expect(result).toEqual({
isEnd: false,
data: [
{
id: "101",
title: "歌单A",
artist: "作者A",
description: "descA",
coverImg: "coverA",
worksNum: 50,
playCount: 1000,
},
],
});
const topPlaylistCall = mockGet.mock.calls.find((call) =>
call[0].includes("/top/playlist"),
);
expect(topPlaylistCall).toBeTruthy();
expect(topPlaylistCall[1].params).toMatchObject({
cat: "华语",
limit: 20,
offset: 0,
order: "hot",
});
});
});
@@ -0,0 +1,425 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const axios_1 = require("axios");
const cheerio_1 = require("cheerio");
const CryptoJs = require("crypto-js");
const he = require("he");
const pageSize = 20;
function formatMusicItem(_) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
return {
id: (_d = _.FileHash) !== null && _d !== void 0 ? _d : _.Grp[0].FileHash,
title: (_a = _.SongName) !== null && _a !== void 0 ? _a : _.OriSongName,
artist: (_b = _.SingerName) !== null && _b !== void 0 ? _b : _.Singers[0].name,
album: (_c = _.AlbumName) !== null && _c !== void 0 ? _c : _.Grp[0].AlbumName,
album_id: (_e = _.AlbumID) !== null && _e !== void 0 ? _e : _.Grp[0].AlbumID,
album_audio_id: 0,
duration: _.Duration,
artwork: ((_f = _.Image) !== null && _f !== void 0 ? _f : _.Grp[0].Image).replace("{size}", "1080"),
"320hash": (_i = _.HQFileHash) !== null && _i !== void 0 ? _i : undefined,
sqhash: (_g = _.SQFileHash) !== null && _g !== void 0 ? _g : undefined,
ResFileHash: (_h = _.ResFileHash) !== null && _h !== void 0 ? _h : undefined,
};
}
function formatMusicItem2(_) {
var _a, _b, _c, _d, _e, _f, _g;
return {
id: _.hash,
title: _.songname,
artist: (_a = _.singername) !== null && _a !== void 0 ? _a : (((_c = (_b = _.authors) === null || _b === void 0 ? void 0 : _b.map((_) => { var _a; return (_a = _ === null || _ === void 0 ? void 0 : _.author_name) !== null && _a !== void 0 ? _a : ""; })) === null || _c === void 0 ? void 0 : _c.join(", ")) ||
((_f = (_e = (_d = _.filename) === null || _d === void 0 ? void 0 : _d.split("-")) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.trim())),
album: (_g = _.album_name) !== null && _g !== void 0 ? _g : _.remark,
album_id: _.album_id,
album_audio_id: _.album_audio_id,
artwork: _.album_sizable_cover
? _.album_sizable_cover.replace("{size}", "400")
: undefined,
duration: _.duration,
"320hash": _["320hash"],
sqhash: _.sqhash,
origin_hash: _.origin_hash,
};
}
function formatImportMusicItem(_) {
var _a, _b, _c, _d, _e, _f, _g;
let title = _.name;
const singerName = _.singername;
if (singerName && title) {
const index = title.indexOf(singerName);
if (index !== -1) {
title = (_a = title.substring(index + singerName.length + 2)) === null || _a === void 0 ? void 0 : _a.trim();
}
if (!title) {
title = singerName;
}
}
const qualites = _.relate_goods;
return {
id: _.hash,
title,
artist: singerName,
album: (_b = _.albumname) !== null && _b !== void 0 ? _b : "",
album_id: _.album_id,
album_audio_id: _.album_audio_id,
artwork: (_d = (_c = _ === null || _ === void 0 ? void 0 : _.info) === null || _c === void 0 ? void 0 : _c.image) === null || _d === void 0 ? void 0 : _d.replace("{size}", "400"),
"320hash": (_e = qualites === null || qualites === void 0 ? void 0 : qualites[1]) === null || _e === void 0 ? void 0 : _e.hash,
sqhash: (_f = qualites === null || qualites === void 0 ? void 0 : qualites[2]) === null || _f === void 0 ? void 0 : _f.hash,
origin_hash: (_g = qualites === null || qualites === void 0 ? void 0 : qualites[3]) === null || _g === void 0 ? void 0 : _g.hash,
};
}
const headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36",
Accept: "*/*",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "zh-CN,zh;q=0.9",
};
async function searchMusic(query, page) {
const res = (await axios_1.default.get("https://songsearch.kugou.com/song_search_v2", {
headers,
params: {
keyword: query,
page,
pagesize: pageSize,
userid: 0,
clientver: "",
platform: "WebFilter",
filter: 2,
iscorrection: 1,
privilege_filter: 0,
area_code: 1,
},
})).data;
const songs = res.data.lists.map(formatMusicItem);
return {
isEnd: page * pageSize >= res.data.total,
data: songs,
};
}
async function searchAlbum(query, page) {
const res = (await axios_1.default.get("http://msearch.kugou.com/api/v3/search/album", {
headers,
params: {
version: 9108,
iscorrection: 1,
highlight: "em",
plat: 0,
keyword: query,
pagesize: 20,
page,
sver: 2,
with_res_tag: 0,
},
})).data;
const albums = res.data.info.map((_) => {
var _a, _b;
return ({
id: _.albumid,
artwork: (_a = _.imgurl) === null || _a === void 0 ? void 0 : _a.replace("{size}", "400"),
artist: _.singername,
title: (0, cheerio_1.load)(_.albumname).text(),
description: _.intro,
date: (_b = _.publishtime) === null || _b === void 0 ? void 0 : _b.slice(0, 10),
});
});
return {
isEnd: page * 20 >= res.data.total,
data: albums,
};
}
async function searchMusicSheet(query, page) {
const res = (await axios_1.default.get("http://mobilecdn.kugou.com/api/v3/search/special", {
headers,
params: {
format: "json",
keyword: query,
page,
pagesize: pageSize,
showtype: 1,
},
})).data;
const sheets = res.data.info.map(item => ({
title: item.specialname,
createAt: item.publishtime,
description: item.intro,
artist: item.nickname,
coverImg: item.imgurl,
gid: item.gid,
playCount: item.playcount,
id: item.specialid,
worksNum: item.songcount
}));
return {
isEnd: page * pageSize >= res.data.total,
data: sheets,
};
}
const qualityLevels = {
low: "128k",
standard: "320k",
high: "flac",
super: "wav",
};
async function getMediaSource(musicItem, quality) {
const targetQualities = [
qualityLevels[quality] || "320k",
"320k",
"128k",
].filter((item, index, arr) => !!item && arr.indexOf(item) === index);
for (const targetQuality of targetQualities) {
const res = (
await axios_1.default.get(`https://lxmusicapi.onrender.com/url/kg/${musicItem.id}/${targetQuality}`, {
headers: {
"X-Request-Key": "share-v3"
},
})
).data;
if (res === null || res === void 0 ? void 0 : res.url) {
return {
url: res.url,
};
}
}
return null;
}
async function getTopLists() {
const lists = (await axios_1.default.get("http://mobilecdnbj.kugou.com/api/v3/rank/list?version=9108&plat=0&showtype=2&parentid=0&apiver=6&area_code=1&withsong=0&with_res_tag=0", {
headers: headers,
})).data.data.info;
const res = [
{
title: "热门榜单",
data: [],
},
{
title: "特色音乐榜",
data: [],
},
{
title: "全球榜",
data: [],
},
];
const extra = {
title: "其他",
data: [],
};
lists.forEach((item) => {
var _a, _b, _c, _d;
if (item.classify === 1 || item.classify === 2) {
res[0].data.push({
id: item.rankid,
description: item.intro,
coverImg: (_a = item.imgurl) === null || _a === void 0 ? void 0 : _a.replace("{size}", "400"),
title: item.rankname,
});
}
else if (item.classify === 3 || item.classify === 5) {
res[1].data.push({
id: item.rankid,
description: item.intro,
coverImg: (_b = item.imgurl) === null || _b === void 0 ? void 0 : _b.replace("{size}", "400"),
title: item.rankname,
});
}
else if (item.classify === 4) {
res[2].data.push({
id: item.rankid,
description: item.intro,
coverImg: (_c = item.imgurl) === null || _c === void 0 ? void 0 : _c.replace("{size}", "400"),
title: item.rankname,
});
}
else {
extra.data.push({
id: item.rankid,
description: item.intro,
coverImg: (_d = item.imgurl) === null || _d === void 0 ? void 0 : _d.replace("{size}", "400"),
title: item.rankname,
});
}
});
if (extra.data.length !== 0) {
res.push(extra);
}
return res;
}
async function getTopListDetail(topListItem) {
const res = await axios_1.default.get(`http://mobilecdnbj.kugou.com/api/v3/rank/song?version=9108&ranktype=0&plat=0&pagesize=100&area_code=1&page=1&volid=35050&rankid=${topListItem.id}&with_res_tag=0`, {
headers,
});
return Object.assign(Object.assign({}, topListItem), { musicList: res.data.data.info.map(formatMusicItem2) });
}
async function getLyricDownload(lyrdata) {
const result = (await (0, axios_1.default)({
// url: `http://lyrics.kugou.com/download?ver=1&client=pc&id=${lyrdata.id}&accesskey=${lyrdata.accessKey}&fmt=krc&charset=utf8`,
url: `http://lyrics.kugou.com/download?ver=1&client=pc&id=${lyrdata.id}&accesskey=${lyrdata.accessKey}&fmt=lrc&charset=utf8`,
headers: {
'KG-RC': 1,
'KG-THash': 'expand_search_manager.cpp:852736169:451',
'User-Agent': 'KuGou2012-9020-ExpandSearchManager',
},
method: "get",
xsrfCookieName: "XSRF-TOKEN",
withCredentials: true,
})).data;
return {
rawLrc: he.decode(CryptoJs.enc.Base64.parse(result.content).toString(CryptoJs.enc.Utf8)),
};
}
// copy from lxmusic https://github.com/lyswhut/lx-music-desktop/blob/master/src/renderer/utils/musicSdk/kg/lyric.js#L114
async function getLyric(musicItem) {
const result = (await (0, axios_1.default)({
url: `http://lyrics.kugou.com/search?ver=1&man=yes&client=pc&keyword=${musicItem.title}&hash=${musicItem.id}&timelength=${musicItem.duration}`,
headers: {
'KG-RC': 1,
'KG-THash': 'expand_search_manager.cpp:852736169:451',
'User-Agent': 'KuGou2012-9020-ExpandSearchManager',
},
method: "get",
xsrfCookieName: "XSRF-TOKEN",
withCredentials: true,
})).data;
const info = result.candidates[0];
return await getLyricDownload({ id: info.id, accessKey: info.accesskey })
}
async function getAlbumInfo(albumItem, page = 1) {
const res = (await axios_1.default.get("http://mobilecdn.kugou.com/api/v3/album/song", {
params: {
version: 9108,
albumid: albumItem.id,
plat: 0,
pagesize: 100,
area_code: 1,
page,
with_res_tag: 0,
},
})).data;
return {
isEnd: page * 100 >= res.data.total,
albumItem: {
worksNum: res.data.total,
},
musicList: res.data.info.map((_) => {
var _a;
const [artist, songname] = _.filename.split("-");
return {
id: _.hash,
title: songname.trim(),
artist: artist.trim(),
album: (_a = _.album_name) !== null && _a !== void 0 ? _a : _.remark,
album_id: _.album_id,
album_audio_id: _.album_audio_id,
artwork: albumItem.artwork,
"320hash": _.HQFileHash,
sqhash: _.SQFileHash,
origin_hash: _.id,
};
}),
};
}
async function importMusicSheet(urlLike) {
var _a;
let id = (_a = urlLike.match(/^(?:.*?)(\d+)(?:.*?)$/)) === null || _a === void 0 ? void 0 : _a[1];
let musicList = [];
if (!id) {
return;
}
let res = await axios_1.default.post(`http://t.kugou.com/command/`, {
appid: 1001,
clientver: 9020,
mid: "21511157a05844bd085308bc76ef3343",
clienttime: 640612895,
key: "36164c4015e704673c588ee202b9ecb8",
data: id,
});
if (res.status === 200 && res.data.status === 1) {
let data = res.data.data;
let response = await axios_1.default.post(`http://www2.kugou.kugou.com/apps/kucodeAndShare/app/`, {
appid: 1001,
clientver: 10112,
mid: "70a02aad1ce4648e7dca77f2afa7b182",
clienttime: 722219501,
key: "381d7062030e8a5a94cfbe50bfe65433",
data: {
id: data.info.id,
type: 3,
userid: data.info.userid,
collect_type: data.info.collect_type,
page: 1,
pagesize: data.info.count,
},
});
if (response.status === 200 && response.data.status === 1) {
let resource = [];
response.data.data.forEach((song) => {
resource.push({
album_audio_id: 0,
album_id: "0",
hash: song.hash,
id: 0,
name: song.filename.replace(".mp3", ""),
page_id: 0,
type: "audio",
});
});
let postData = {
appid: 1001,
area_code: "1",
behavior: "play",
clientver: "10112",
dfid: "2O3jKa20Gdks0LWojP3ly7ck",
mid: "70a02aad1ce4648e7dca77f2afa7b182",
need_hash_offset: 1,
relate: 1,
resource,
token: "",
userid: "0",
vip: 0,
};
var result = await axios_1.default.post(`https://gateway.kugou.com/v2/get_res_privilege/lite?appid=1001&clienttime=1668883879&clientver=10112&dfid=2O3jKa20Gdks0LWojP3ly7ck&mid=70a02aad1ce4648e7dca77f2afa7b182&userid=390523108&uuid=92691C6246F86F28B149BAA1FD370DF1`, postData, {
headers: {
"x-router": "media.store.kugou.com",
},
});
if (response.status === 200 && response.data.status === 1) {
musicList = result.data.data
.map(formatImportMusicItem);
}
}
}
return musicList;
}
module.exports = {
platform: "小枸音乐",
version: "0.3.0",
author: 'Huibq',
appVersion: ">0.1.0-alpha.0",
srcUrl: "https://fastly.jsdelivr.net/gh/Huibq/keep-alive/Music_Free/xiaogou.js",
cacheControl: "no-cache",
description: "",
primaryKey: ["id", "album_id", "album_audio_id"],
hints: {
importMusicSheet: [
"仅支持酷狗APP通过酷狗码导入,输入纯数字酷狗码即可。",
"导入时间和歌单大小有关,请耐心等待",
],
},
supportedSearchType: ["music", "album", "sheet"],
async search(query, page, type) {
if (type === "music") {
return await searchMusic(query, page);
}
else if (type === "album") {
return await searchAlbum(query, page);
}
else if (type === "sheet") {
return await searchMusicSheet(query, page);
}
},
getMediaSource,
getTopLists,
getLyric,
getTopListDetail,
getAlbumInfo,
importMusicSheet,
};
@@ -0,0 +1,665 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const axios_1 = require("axios");
const cheerio_1 = require("cheerio");
const CryptoJS = require("crypto-js");
const searchRows = 20;
async function searchBase(query, page, type) {
const headers = {
Accept: "application/json, text/javascript, */*; q=0.01",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
Connection: "keep-alive",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
Host: "m.music.migu.cn",
Referer: `https://m.music.migu.cn/v3/search?keyword=${encodeURIComponent(query)}`,
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "same-origin",
"User-Agent": "Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Mobile Safari/537.36 Edg/89.0.774.68",
"X-Requested-With": "XMLHttpRequest",
};
const params = {
keyword: query,
type,
pgc: page,
rows: searchRows,
};
const data = await axios_1.default.get("https://m.music.migu.cn/migu/remoting/scr_search_tag", { headers, params });
return data.data;
}
// function musicCanPlayFilter(_) {
// return _.lisSQ || _.lisHQ || _.lisBq || _.lisCr || _.lisQq || _.listenUrl || _.mp3;
// }
function musicCanPlayFilter(_) {
return _.mp3 || _.listenUrl || _.lisQq || _.lisCr;
}
async function searchMusic(query, page) {
const data = await searchBase(query, page, 2);
const musics = data.musics.map((_) => ({
id: _.id,
artwork: _.cover,
title: _.songName,
artist: _.artist,
album: _.albumName,
url: musicCanPlayFilter(_),
copyrightId: _.copyrightId,
singerId: _.singerId,
}));
return {
isEnd: +data.pageNo * searchRows >= data.pgt,
data: musics,
};
}
async function searchAlbum(query, page) {
const data = await searchBase(query, page, 4);
const albums = data.albums.map((_) => ({
id: _.id,
artwork: _.albumPicL,
title: _.title,
date: _.publishDate,
artist: (_.singer || []).map((s) => s.name).join(","),
singer: _.singer,
fullSongTotal: _.fullSongTotal,
}));
return {
isEnd: +data.pageNo * searchRows >= data.pgt,
data: albums,
};
}
async function searchArtist(query, page) {
const data = await searchBase(query, page, 1);
const artists = data.artists.map((result) => ({
name: result.title,
id: result.id,
avatar: result.artistPicL,
worksNum: result.songNum,
}));
return {
isEnd: +data.pageNo * searchRows >= data.pgt,
data: artists,
};
}
async function searchMusicSheet(query, page) {
const data = await searchBase(query, page, 6);
const musicsheet = data.songLists.map((result) => ({
title: result.name,
id: result.id,
artist: result.userName,
artwork: result.img,
description: result.intro,
worksNum: result.musicNum,
playCount: result.playNum,
}));
return {
isEnd: +data.pageNo * searchRows >= data.pgt,
data: musicsheet,
};
}
async function searchLyric(query, page) {
const data = await searchBase(query, page, 7);
const lyrics = data.songs.map((result) => ({
title: result.title,
id: result.id,
artist: result.artist,
artwork: result.cover,
lrc: result.lyrics,
album: result.albumName,
copyrightId: result.copyrightId,
}));
return {
isEnd: +data.pageNo * searchRows >= data.pgt,
data: lyrics,
};
}
async function getArtistAlbumWorks(artistItem, page) {
const headers = {
accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"accept-encoding": "gzip, deflate, br",
"accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
connection: "keep-alive",
host: "music.migu.cn",
referer: "http://music.migu.cn",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36",
"Cache-Control": "max-age=0",
};
const html = (await axios_1.default.get(`https://music.migu.cn/v3/music/artist/${artistItem.id}/album?page=${page}`, {
headers,
})).data;
const $ = (0, cheerio_1.load)(html);
const rawAlbums = $("div.artist-album-list").find("li");
const albums = [];
for (let i = 0; i < rawAlbums.length; ++i) {
const al = $(rawAlbums[i]);
const artwork = al.find(".thumb-img").attr("data-original");
albums.push({
id: al.find(".album-play").attr("data-id"),
title: al.find(".album-name").text(),
artwork: artwork.startsWith("//") ? `https:${artwork}` : artwork,
date: "",
artist: artistItem.name,
});
}
return {
isEnd: $(".pagination-next").hasClass("disabled"),
data: albums,
};
}
async function getArtistWorks(artistItem, page, type) {
if (type === "music") {
const headers = {
Accept: "application/json, text/javascript, */*; q=0.01",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
Connection: "keep-alive",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
Host: "m.music.migu.cn",
Referer: `https://m.music.migu.cn/migu/l/?s=149&p=163&c=5123&j=l&id=${artistItem.id}`,
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "same-origin",
"User-Agent": "Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Mobile Safari/537.36 Edg/89.0.774.68",
"X-Requested-With": "XMLHttpRequest",
};
const musicList = (await axios_1.default.get("https://m.music.migu.cn/migu/remoting/cms_artist_song_list_tag", {
headers,
params: {
artistId: artistItem.id,
pageSize: 20,
pageNo: page - 1,
},
})).data || {};
return {
data: musicList.result.results.map((_) => ({
id: _.songId,
artwork: _.picL,
title: _.songName,
artist: (_.singerName || []).join(", "),
album: _.albumName,
url: musicCanPlayFilter(_),
rawLrc: _.lyricLrc,
copyrightId: _.copyrightId,
singerId: _.singerId,
})),
};
}
else if (type === "album") {
return getArtistAlbumWorks(artistItem, page);
}
}
async function getLyric(musicItem) {
const headers = {
Accept: "application/json, text/javascript, */*; q=0.01",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
Connection: "keep-alive",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
Host: "m.music.migu.cn",
Referer: `https://m.music.migu.cn/migu/l/?s=149&p=163&c=5200&j=l&id=${musicItem.copyrightId}`,
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "same-origin",
"User-Agent": "Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Mobile Safari/537.36 Edg/89.0.774.68",
"X-Requested-With": "XMLHttpRequest",
};
const result = (await axios_1.default.get("https://m.music.migu.cn/migu/remoting/cms_detail_tag", {
headers,
params: {
cpid: musicItem.copyrightId,
},
})).data;
return {
rawLrc: result.data.lyricLrc,
};
}
async function getMusicSheetInfo(sheet, page) {
const res = (await axios_1.default.get("https://m.music.migu.cn/migumusic/h5/playlist/songsInfo", {
params: {
palylistId: sheet.id,
pageNo: page,
pageSize: 30,
},
headers: {
Host: "m.music.migu.cn",
referer: "https://m.music.migu.cn/v4/music/playlist/",
By: "7242bd16f68cd9b39c54a8e61537009f",
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/113.0.0.0",
},
})).data.data;
if (!res) {
return {
isEnd: true,
musicList: [],
};
}
const isEnd = res.total < 30;
return {
isEnd,
musicList: res.items
.filter((item) => { var _a; return ((_a = item === null || item === void 0 ? void 0 : item.fullSong) === null || _a === void 0 ? void 0 : _a.vipFlag) === 0; })
.map((_) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
return ({
id: _.id,
artwork: ((_a = _.mediumPic) === null || _a === void 0 ? void 0 : _a.startsWith("//"))
? `http:${_.mediumPic}`
: _.mediumPic,
title: _.name,
artist: (_f = (_e = (_d = (_c = (_b = _.singers) === null || _b === void 0 ? void 0 : _b.map) === null || _c === void 0 ? void 0 : _c.call(_b, (_) => _.name)) === null || _d === void 0 ? void 0 : _d.join) === null || _e === void 0 ? void 0 : _e.call(_d, ",")) !== null && _f !== void 0 ? _f : "",
album: (_h = (_g = _.album) === null || _g === void 0 ? void 0 : _g.albumName) !== null && _h !== void 0 ? _h : "",
copyrightId: _.copyrightId,
singerId: (_k = (_j = _.singers) === null || _j === void 0 ? void 0 : _j[0]) === null || _k === void 0 ? void 0 : _k.id,
});
}),
};
}
async function importMusicSheet(urlLike) {
var _a, _b, _c, _d;
let id;
if (!id) {
id = (urlLike.match(/https?:\/\/music\.migu\.cn\/v3\/(?:my|music)\/playlist\/([0-9]+)/) || [])[1];
}
if (!id) {
id = (urlLike.match(/https?:\/\/h5\.nf\.migu\.cn\/app\/v4\/p\/share\/playlist\/index.html\?.*id=([0-9]+)/) || [])[1];
}
if (!id) {
id = (_a = urlLike.match(/^\s*(\d+)\s*$/)) === null || _a === void 0 ? void 0 : _a[1];
}
if (!id) {
const tempUrl = (_b = urlLike.match(/(https?:\/\/c\.migu\.cn\/[\S]+)\?/)) === null || _b === void 0 ? void 0 : _b[1];
if (tempUrl) {
const request = (await axios_1.default.get(tempUrl, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 Edg/109.0.1518.61",
Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
host: "c.migu.cn",
},
validateStatus(status) {
return (status >= 200 && status < 300) || status === 403;
},
})).request;
const realpath = (_c = request === null || request === void 0 ? void 0 : request.path) !== null && _c !== void 0 ? _c : request === null || request === void 0 ? void 0 : request.responseURL;
if (realpath) {
id = (_d = realpath.match(/id=(\d+)/)) === null || _d === void 0 ? void 0 : _d[1];
}
}
}
if (!id) {
return;
}
const headers = {
host: "m.music.migu.cn",
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "same-origin",
"User-Agent": "Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Mobile Safari/537.36 Edg/89.0.774.68",
"X-Requested-With": "XMLHttpRequest",
Referer: "https://m.music.migu.cn",
};
const res = (await axios_1.default.get(`https://m.music.migu.cn/migu/remoting/query_playlist_by_id_tag?onLine=1&queryChannel=0&createUserId=migu&contentCountMin=5&playListId=${id}`, {
headers,
})).data;
const contentCount = parseInt(res.rsp.playList[0].contentCount);
const cids = [];
let pageNo = 1;
while ((pageNo - 1) * 20 < contentCount) {
const listPage = (await axios_1.default.get(`https://music.migu.cn/v3/music/playlist/${id}?page=${pageNo}`)).data;
const $ = (0, cheerio_1.load)(listPage);
$(".row.J_CopySong").each((i, v) => {
cids.push($(v).attr("data-cid"));
});
pageNo += 1;
}
if (cids.length === 0) {
return;
}
const songs = (await (0, axios_1.default)({
url: `https://music.migu.cn/v3/api/music/audioPlayer/songs?type=1&copyrightId=${cids.join(",")}`,
headers: {
referer: "http://m.music.migu.cn/v3",
},
xsrfCookieName: "XSRF-TOKEN",
withCredentials: true,
})).data;
return songs.items
.filter((_) => _.vipFlag === 0)
.map((_) => {
var _a, _b, _c, _d, _e, _f;
return ({
id: _.songId,
artwork: _.cover,
title: _.songName,
artist: (_b = (_a = _.singers) === null || _a === void 0 ? void 0 : _a.map((_) => _.artistName)) === null || _b === void 0 ? void 0 : _b.join(", "),
album: (_d = (_c = _.albums) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.albumName,
copyrightId: _.copyrightId,
singerId: (_f = (_e = _.singers) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.artistId,
});
});
}
async function getTopLists() {
const jianjiao = {
title: "咪咕尖叫榜",
data: [
{
id: "jianjiao_newsong",
title: "尖叫新歌榜",
coverImg: "https://cdnmusic.migu.cn/tycms_picture/20/02/36/20020512065402_360x360_2997.png",
},
{
id: "jianjiao_hotsong",
title: "尖叫热歌榜",
coverImg: "https://cdnmusic.migu.cn/tycms_picture/20/04/99/200408163640868_360x360_6587.png",
},
{
id: "jianjiao_original",
title: "尖叫原创榜",
coverImg: "https://cdnmusic.migu.cn/tycms_picture/20/04/99/200408163702795_360x360_1614.png",
},
],
};
const tese = {
title: "咪咕特色榜",
data: [
{
id: "movies",
title: "影视榜",
coverImg: "https://cdnmusic.migu.cn/tycms_picture/20/05/136/200515161848938_360x360_673.png",
},
{
id: "mainland",
title: "内地榜",
coverImg: "https://cdnmusic.migu.cn/tycms_picture/20/08/231/200818095104122_327x327_4971.png",
},
{
id: "hktw",
title: "港台榜",
coverImg: "https://cdnmusic.migu.cn/tycms_picture/20/08/231/200818095125191_327x327_2382.png",
},
{
id: "eur_usa",
title: "欧美榜",
coverImg: "https://cdnmusic.migu.cn/tycms_picture/20/08/231/200818095229556_327x327_1383.png",
},
{
id: "jpn_kor",
title: "日韩榜",
coverImg: "https://cdnmusic.migu.cn/tycms_picture/20/08/231/200818095259569_327x327_4628.png",
},
{
id: "coloring",
title: "彩铃榜",
coverImg: "https://cdnmusic.migu.cn/tycms_picture/20/08/231/200818095356693_327x327_7955.png",
},
{
id: "ktv",
title: "KTV榜",
coverImg: "https://cdnmusic.migu.cn/tycms_picture/20/08/231/200818095414420_327x327_4992.png",
},
{
id: "network",
title: "网络榜",
coverImg: "https://cdnmusic.migu.cn/tycms_picture/20/08/231/200818095442606_327x327_1298.png",
},
],
};
return [jianjiao, tese];
}
const UA = "Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Mobile Safari/537.36 Edg/89.0.774.68";
const By = CryptoJS.MD5(UA).toString();
async function getTopListDetail(topListItem) {
const res = await axios_1.default.get(`https://m.music.migu.cn/migumusic/h5/billboard/home`, {
params: {
pathName: topListItem.id,
pageNum: 1,
pageSize: 100,
},
headers: {
Accept: "*/*",
"Accept-Encoding": "gzip, deflate, br",
Connection: "keep-alive",
Host: "m.music.migu.cn",
referer: `https://m.music.migu.cn/v4/music/top/${topListItem.id}`,
"User-Agent": UA,
By,
},
});
return Object.assign(Object.assign({}, topListItem), {
musicList: res.data.data.songs.items
.map((_) => {
var _a, _b, _c, _d, _e, _f;
return ({
id: _.id,
artwork: ((_a = _.mediumPic) === null || _a === void 0 ? void 0 : _a.startsWith("//"))
? `https:${_.mediumPic}`
: _.mediumPic,
title: _.name,
artist: (_c = (_b = _.singers) === null || _b === void 0 ? void 0 : _b.map((_) => _.name)) === null || _c === void 0 ? void 0 : _c.join(", "),
album: (_d = _.album) === null || _d === void 0 ? void 0 : _d.albumName,
copyrightId: _.copyrightId,
singerId: (_f = (_e = _.singers) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.id,
});
})
});
}
async function getRecommendSheetTags() {
const allTags = (await axios_1.default.get("https://m.music.migu.cn/migumusic/h5/playlist/allTag", {
headers: {
host: "m.music.migu.cn",
referer: "https://m.music.migu.cn/v4/music/playlist",
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/113.0.0.0",
By: "7242bd16f68cd9b39c54a8e61537009f",
},
})).data.data.tags;
const data = allTags.map((_) => {
return {
title: _.tagName,
data: _.tags.map((_) => ({
id: _.tagId,
title: _.tagName,
})),
};
});
return {
pinned: [
{
title: "小清新",
id: "1000587673",
},
{
title: "电视剧",
id: "1001076078",
},
{
title: "民谣",
id: "1000001775",
},
{
title: "旅行",
id: "1000001749",
},
{
title: "思念",
id: "1000001703",
},
],
data,
};
}
async function getRecommendSheetsByTag(sheetItem, page) {
const pageSize = 20;
const res = (await axios_1.default.get("https://m.music.migu.cn/migumusic/h5/playlist/list", {
params: {
columnId: 15127272,
tagId: sheetItem.id,
pageNum: page,
pageSize,
},
headers: {
"user-agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/113.0.0.0",
host: "m.music.migu.cn",
By: "7242bd16f68cd9b39c54a8e61537009f",
Referer: "https://m.music.migu.cn/v4/music/playlist",
},
})).data.data;
const isEnd = page * pageSize > res.total;
const data = res.items.map((_) => ({
id: _.playListId,
artist: _.createUserName,
title: _.playListName,
artwork: _.image.startsWith("//") ? `http:${_.image}` : _.image,
playCount: _.playCount,
createUserId: _.createUserId,
}));
return {
isEnd,
data,
};
}
async function getMediaSourceByMTM(musicItem, quality) {
if (quality === "standard" && musicItem.url) {
return {
url: musicItem.url,
};
}
else if (quality === "standard") {
const headers = {
Accept: "application/json, text/javascript, */*; q=0.01",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
Connection: "keep-alive",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
Host: "m.music.migu.cn",
Referer: `https://m.music.migu.cn/migu/l/?s=149&p=163&c=5200&j=l&id=${musicItem.copyrightId}`,
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "same-origin",
"User-Agent": "Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Mobile Safari/537.36 Edg/89.0.774.68",
"X-Requested-With": "XMLHttpRequest",
};
const result = (await axios_1.default.get("https://m.music.migu.cn/migu/remoting/cms_detail_tag", {
headers,
params: {
cpid: musicItem.copyrightId,
},
})).data.data;
return {
artwork: musicItem.artwork || result.picL,
url: result.listenUrl || result.listenQq || result.lisCr,
};
}
}
const qualityLevels = {
low: "128k",
standard: "320k",
high: "flac",
super: "wav",
};
async function getMediaSource(musicItem, quality) {
const targetQualities = [
qualityLevels[quality] || "320k",
"320k",
"128k",
].filter((item, index, arr) => !!item && arr.indexOf(item) === index);
for (const targetQuality of targetQualities) {
const res = (
await axios_1.default.get(`https://lxmusicapi.onrender.com/url/mg/${musicItem.id}/${targetQuality}`, {
headers: {
"X-Request-Key": "share-v3"
},
})
).data;
if (res === null || res === void 0 ? void 0 : res.url) {
return {
url: res.url,
};
}
}
return null;
}
module.exports = {
platform: "小蜜音乐",
author: "Huibq",
version: "0.3.0",
appVersion: ">0.1.0-alpha.0",
hints: {
importMusicSheet: [
"咪咕APP:自建歌单-分享-复制链接,直接粘贴即可",
"H5/PC端:复制URL并粘贴,或者直接输入纯数字歌单ID即可",
"导入时间和歌单大小有关,请耐心等待",
],
},
primaryKey: ["id", "copyrightId"],
cacheControl: "cache",
srcUrl: "https://fastly.jsdelivr.net/gh/Huibq/keep-alive/Music_Free/xiaomi.js",
supportedSearchType: ["music", "album", "sheet", "artist", "lyric"],
getMediaSource,
async search(query, page, type) {
if (type === "music") {
return await searchMusic(query, page);
}
if (type === "album") {
return await searchAlbum(query, page);
}
if (type === "artist") {
return await searchArtist(query, page);
}
if (type === "sheet") {
return await searchMusicSheet(query, page);
}
if (type === "lyric") {
return await searchLyric(query, page);
}
},
async getAlbumInfo(albumItem) {
const headers = {
Accept: "application/json, text/javascript, */*; q=0.01",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
Connection: "keep-alive",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
Host: "m.music.migu.cn",
Referer: `https://m.music.migu.cn/migu/l/?record=record&id=${albumItem.id}`,
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "same-origin",
"User-Agent": "Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Mobile Safari/537.36 Edg/89.0.774.68",
"X-Requested-With": "XMLHttpRequest",
};
const musicList = (await axios_1.default.get("https://m.music.migu.cn/migu/remoting/cms_album_song_list_tag", {
headers,
params: {
albumId: albumItem.id,
pageSize: 30,
},
})).data || {};
const albumDesc = (await axios_1.default.get("https://m.music.migu.cn/migu/remoting/cms_album_detail_tag", {
headers,
params: {
albumId: albumItem.id,
},
})).data || {};
return {
albumItem: { description: albumDesc.albumIntro },
musicList: musicList.result.results
.map((_) => ({
id: _.songId,
artwork: _.picL,
title: _.songName,
artist: (_.singerName || []).join(", "),
album: albumItem.title,
url: musicCanPlayFilter(_),
rawLrc: _.lyricLrc,
copyrightId: _.copyrightId,
singerId: _.singerId,
})),
};
},
getArtistWorks: getArtistWorks,
getLyric: getLyric,
importMusicSheet,
getTopLists,
getTopListDetail,
getRecommendSheetTags,
getRecommendSheetsByTag,
getMusicSheetInfo,
};
@@ -0,0 +1,507 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const axios_1 = require("axios");
const CryptoJs = require("crypto-js");
const he = require("he");
const pageSize = 20;
function formatMusicItem(_) {
var _a, _b, _c;
const albumid = _.albumid || ((_a = _.album) === null || _a === void 0 ? void 0 : _a.id);
const albummid = _.albummid || ((_b = _.album) === null || _b === void 0 ? void 0 : _b.mid);
const albumname = _.albumname || ((_c = _.album) === null || _c === void 0 ? void 0 : _c.title);
return {
id: _.id || _.songid,
songmid: _.mid || _.songmid,
title: _.title || _.songname,
artist: _.singer.map((s) => s.name).join(", "),
artwork: albummid
? `https://y.gtimg.cn/music/photo_new/T002R800x800M000${albummid}.jpg`
: undefined,
album: albumname,
lrc: _.lyric || undefined,
albumid: albumid,
albummid: albummid,
};
}
function formatAlbumItem(_) {
return {
id: _.albumID || _.albumid,
albumMID: _.albumMID || _.album_mid,
title: _.albumName || _.album_name,
artwork: _.albumPic ||
`https://y.gtimg.cn/music/photo_new/T002R800x800M000${_.albumMID || _.album_mid}.jpg`,
date: _.publicTime || _.pub_time,
singerID: _.singerID || _.singer_id,
artist: _.singerName || _.singer_name,
singerMID: _.singerMID || _.singer_mid,
description: _.desc,
};
}
function formatArtistItem(_) {
return {
name: _.singerName,
id: _.singerID,
singerMID: _.singerMID,
avatar: _.singerPic,
worksNum: _.songNum,
};
}
const searchTypeMap = {
0: "song",
2: "album",
1: "singer",
3: "songlist",
7: "song",
12: "mv",
};
const headers = {
referer: "https://y.qq.com",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36",
Cookie: "uin=",
};
async function searchBase(query, page, type) {
const res = (await (0, axios_1.default)({
url: "https://u.y.qq.com/cgi-bin/musicu.fcg",
method: "POST",
data: {
req_1: {
method: "DoSearchForQQMusicDesktop",
module: "music.search.SearchCgiService",
param: {
num_per_page: pageSize,
page_num: page,
query: query,
search_type: type,
},
},
},
headers: headers,
xsrfCookieName: "XSRF-TOKEN",
withCredentials: true,
})).data;
return {
isEnd: res.req_1.data.meta.sum <= page * pageSize,
data: res.req_1.data.body[searchTypeMap[type]].list,
};
}
async function searchMusic(query, page) {
const songs = await searchBase(query, page, 0);
return {
isEnd: songs.isEnd,
data: songs.data.map(formatMusicItem),
};
}
async function searchAlbum(query, page) {
const albums = await searchBase(query, page, 2);
return {
isEnd: albums.isEnd,
data: albums.data.map(formatAlbumItem),
};
}
async function searchArtist(query, page) {
const artists = await searchBase(query, page, 1);
return {
isEnd: artists.isEnd,
data: artists.data.map(formatArtistItem),
};
}
async function searchMusicSheet(query, page) {
const musicSheet = await searchBase(query, page, 3);
return {
isEnd: musicSheet.isEnd,
data: musicSheet.data.map((item) => ({
title: item.dissname,
createAt: item.createtime,
description: item.introduction,
playCount: item.listennum,
worksNums: item.song_count,
artwork: item.imgurl,
id: item.dissid,
artist: item.creator.name,
})),
};
}
async function searchLyric(query, page) {
const songs = await searchBase(query, page, 7);
return {
isEnd: songs.isEnd,
data: songs.data.map((it) => (Object.assign(Object.assign({}, formatMusicItem(it)), { rawLrcTxt: it.content }))),
};
}
function getQueryFromUrl(key, search) {
try {
const sArr = search.split("?");
let s = "";
if (sArr.length > 1) {
s = sArr[1];
}
else {
return key ? undefined : {};
}
const querys = s.split("&");
const result = {};
querys.forEach((item) => {
const temp = item.split("=");
result[temp[0]] = decodeURIComponent(temp[1]);
});
return key ? result[key] : result;
}
catch (err) {
return key ? "" : {};
}
}
function changeUrlQuery(obj, baseUrl) {
const query = getQueryFromUrl(null, baseUrl);
let url = baseUrl.split("?")[0];
const newQuery = Object.assign(Object.assign({}, query), obj);
let queryArr = [];
Object.keys(newQuery).forEach((key) => {
if (newQuery[key] !== undefined && newQuery[key] !== "") {
queryArr.push(`${key}=${encodeURIComponent(newQuery[key])}`);
}
});
return `${url}?${queryArr.join("&")}`.replace(/\?$/, "");
}
const typeMap = {
m4a: {
s: "C400",
e: ".m4a",
},
128: {
s: "M500",
e: ".mp3",
},
320: {
s: "M800",
e: ".mp3",
},
ape: {
s: "A000",
e: ".ape",
},
flac: {
s: "F000",
e: ".flac",
},
};
async function getAlbumInfo(albumItem) {
const url = changeUrlQuery({
data: JSON.stringify({
comm: {
ct: 24,
cv: 10000,
},
albumSonglist: {
method: "GetAlbumSongList",
param: {
albumMid: albumItem.albumMID,
albumID: 0,
begin: 0,
num: 999,
order: 2,
},
module: "music.musichallAlbum.AlbumSongList",
},
}),
}, "https://u.y.qq.com/cgi-bin/musicu.fcg?g_tk=5381&format=json&inCharset=utf8&outCharset=utf-8");
const res = (await (0, axios_1.default)({
url: url,
headers: headers,
xsrfCookieName: "XSRF-TOKEN",
withCredentials: true,
})).data;
return {
musicList: res.albumSonglist.data.songList
.map((item) => {
const _ = item.songInfo;
return formatMusicItem(_);
}),
};
}
async function getArtistSongs(artistItem, page) {
const url = changeUrlQuery({
data: JSON.stringify({
comm: {
ct: 24,
cv: 0,
},
singer: {
method: "get_singer_detail_info",
param: {
sort: 5,
singermid: artistItem.singerMID,
sin: (page - 1) * pageSize,
num: pageSize,
},
module: "music.web_singer_info_svr",
},
}),
}, "http://u.y.qq.com/cgi-bin/musicu.fcg");
const res = (await (0, axios_1.default)({
url: url,
method: "get",
headers: headers,
xsrfCookieName: "XSRF-TOKEN",
withCredentials: true,
})).data;
return {
isEnd: res.singer.data.total_song <= page * pageSize,
data: res.singer.data.songlist.map(formatMusicItem),
};
}
async function getArtistAlbums(artistItem, page) {
const url = changeUrlQuery({
data: JSON.stringify({
comm: {
ct: 24,
cv: 0,
},
singerAlbum: {
method: "get_singer_album",
param: {
singermid: artistItem.singerMID,
order: "time",
begin: (page - 1) * pageSize,
num: pageSize / 1,
exstatus: 1,
},
module: "music.web_singer_info_svr",
},
}),
}, "http://u.y.qq.com/cgi-bin/musicu.fcg");
const res = (await (0, axios_1.default)({
url,
method: "get",
headers: headers,
xsrfCookieName: "XSRF-TOKEN",
withCredentials: true,
})).data;
return {
isEnd: res.singerAlbum.data.total <= page * pageSize,
data: res.singerAlbum.data.list.map(formatAlbumItem),
};
}
async function getArtistWorks(artistItem, page, type) {
if (type === "music") {
return getArtistSongs(artistItem, page);
}
if (type === "album") {
return getArtistAlbums(artistItem, page);
}
}
async function getLyric(musicItem) {
const result = (await (0, axios_1.default)({
url: `http://c.y.qq.com/lyric/fcgi-bin/fcg_query_lyric_new.fcg?songmid=${musicItem.songmid}&pcachetime=${new Date().getTime()}&g_tk=5381&loginUin=0&hostUin=0&inCharset=utf8&outCharset=utf-8&notice=0&platform=yqq&needNewCode=0`,
headers: { Referer: "https://y.qq.com", Cookie: "uin=" },
method: "get",
xsrfCookieName: "XSRF-TOKEN",
withCredentials: true,
})).data;
const res = JSON.parse(result.replace(/callback\(|MusicJsonCallback\(|jsonCallback\(|\)$/g, ""));
let translation;
if (res.trans) {
translation = he.decode(CryptoJs.enc.Base64.parse(res.trans).toString(CryptoJs.enc.Utf8));
}
return {
rawLrc: he.decode(CryptoJs.enc.Base64.parse(res.lyric).toString(CryptoJs.enc.Utf8)),
translation,
};
}
async function importMusicSheet(urlLike) {
let id;
if (!id) {
id = (urlLike.match(/https?:\/\/i\.y\.qq\.com\/n2\/m\/share\/details\/taoge\.html\?.*id=([0-9]+)/) || [])[1];
}
if (!id) {
id = (urlLike.match(/https?:\/\/y\.qq\.com\/n\/ryqq\/playlist\/([0-9]+)/) ||
[])[1];
}
if (!id) {
id = (urlLike.match(/^(\d+)$/) || [])[1];
}
if (!id) {
return;
}
const result = (await (0, axios_1.default)({
url: `http://i.y.qq.com/qzone/fcg-bin/fcg_ucc_getcdinfo_byids_cp.fcg?type=1&utf8=1&disstid=${id}&loginUin=0`,
headers: { Referer: "https://y.qq.com/n/yqq/playlist", Cookie: "uin=" },
method: "get",
xsrfCookieName: "XSRF-TOKEN",
withCredentials: true,
})).data;
const res = JSON.parse(result.replace(/callback\(|MusicJsonCallback\(|jsonCallback\(|\)$/g, ""));
return res.cdlist[0].songlist.map(formatMusicItem);
}
async function getTopLists() {
const list = await (0, axios_1.default)({
url: "https://u.y.qq.com/cgi-bin/musicu.fcg?_=1577086820633&data=%7B%22comm%22%3A%7B%22g_tk%22%3A5381%2C%22uin%22%3A123456%2C%22format%22%3A%22json%22%2C%22inCharset%22%3A%22utf-8%22%2C%22outCharset%22%3A%22utf-8%22%2C%22notice%22%3A0%2C%22platform%22%3A%22h5%22%2C%22needNewCode%22%3A1%2C%22ct%22%3A23%2C%22cv%22%3A0%7D%2C%22topList%22%3A%7B%22module%22%3A%22musicToplist.ToplistInfoServer%22%2C%22method%22%3A%22GetAll%22%2C%22param%22%3A%7B%7D%7D%7D",
method: "get",
headers: {
Cookie: "uin=",
},
xsrfCookieName: "XSRF-TOKEN",
withCredentials: true,
});
return list.data.topList.data.group.map((e) => ({
title: e.groupName,
data: e.toplist.map((_) => ({
id: _.topId,
description: _.intro,
title: _.title,
period: _.period,
coverImg: _.headPicUrl || _.frontPicUrl,
})),
}));
}
async function getTopListDetail(topListItem) {
var _a;
const res = await (0, axios_1.default)({
url: `https://u.y.qq.com/cgi-bin/musicu.fcg?g_tk=5381&data=%7B%22detail%22%3A%7B%22module%22%3A%22musicToplist.ToplistInfoServer%22%2C%22method%22%3A%22GetDetail%22%2C%22param%22%3A%7B%22topId%22%3A${topListItem.id}%2C%22offset%22%3A0%2C%22num%22%3A100%2C%22period%22%3A%22${(_a = topListItem.period) !== null && _a !== void 0 ? _a : ""}%22%7D%7D%2C%22comm%22%3A%7B%22ct%22%3A24%2C%22cv%22%3A0%7D%7D`,
method: "get",
headers: {
Cookie: "uin=",
},
xsrfCookieName: "XSRF-TOKEN",
withCredentials: true,
});
return Object.assign(Object.assign({}, topListItem), {
musicList: res.data.detail.data.songInfoList
.map(formatMusicItem)
});
}
async function getRecommendSheetTags() {
const res = (await axios_1.default.get("https://c.y.qq.com/splcloud/fcgi-bin/fcg_get_diss_tag_conf.fcg?format=json&inCharset=utf8&outCharset=utf-8", {
headers: {
referer: "https://y.qq.com/",
},
})).data.data.categories;
const data = res.slice(1).map((_) => ({
title: _.categoryGroupName,
data: _.items.map((tag) => ({
id: tag.categoryId,
title: tag.categoryName,
})),
}));
const pinned = [];
for (let d of data) {
if (d.data.length) {
pinned.push(d.data[0]);
}
}
return {
pinned,
data,
};
}
async function getRecommendSheetsByTag(tag, page) {
const pageSize = 20;
const rawRes = (await axios_1.default.get("https://c.y.qq.com/splcloud/fcgi-bin/fcg_get_diss_by_tag.fcg", {
headers: {
referer: "https://y.qq.com/",
},
params: {
inCharset: "utf8",
outCharset: "utf-8",
sortId: 5,
categoryId: (tag === null || tag === void 0 ? void 0 : tag.id) || "10000000",
sin: pageSize * (page - 1),
ein: page * pageSize - 1,
},
})).data;
const res = JSON.parse(rawRes.replace(/callback\(|MusicJsonCallback\(|jsonCallback\(|\)$/g, "")).data;
const isEnd = res.sum <= page * pageSize;
const data = res.list.map((item) => {
var _a, _b;
return ({
id: item.dissid,
createTime: item.createTime,
title: item.dissname,
artwork: item.imgurl,
description: item.introduction,
playCount: item.listennum,
artist: (_b = (_a = item.creator) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : "",
});
});
return {
isEnd,
data,
};
}
async function getMusicSheetInfo(sheet, page) {
const data = await importMusicSheet(sheet.id);
return {
isEnd: true,
musicList: data,
};
}
const qualityLevels = {
low: "128k",
standard: "320k",
high: "flac",
super: "wav",
};
async function getMediaSource(musicItem, quality) {
const targetQualities = [
qualityLevels[quality] || "320k",
"320k",
"128k",
].filter((item, index, arr) => !!item && arr.indexOf(item) === index);
for (const targetQuality of targetQualities) {
const res = (
await axios_1.default.get(`https://lxmusicapi.onrender.com/url/tx/${musicItem.songmid}/${targetQuality}`, {
headers: {
"X-Request-Key": "share-v3"
},
})
).data;
if (res === null || res === void 0 ? void 0 : res.url) {
return {
url: res.url,
};
}
}
return null;
}
module.exports = {
platform: "小秋音乐",
author: "Huibq",
version: "0.3.0",
srcUrl: "https://fastly.jsdelivr.net/gh/Huibq/keep-alive/Music_Free/xiaoqiu.js",
cacheControl: "no-cache",
hints: {
importMusicSheet: [
"QQ音乐APP:自建歌单-分享-分享到微信好友/QQ好友;然后点开并复制链接,直接粘贴即可",
"H5:复制URL并粘贴,或者直接输入纯数字歌单ID即可",
"导入时间和歌单大小有关,请耐心等待",
],
},
primaryKey: ["id", "songmid"],
supportedSearchType: ["music", "album", "sheet", "artist", "lyric"],
async search(query, page, type) {
if (type === "music") {
return await searchMusic(query, page);
}
if (type === "album") {
return await searchAlbum(query, page);
}
if (type === "artist") {
return await searchArtist(query, page);
}
if (type === "sheet") {
return await searchMusicSheet(query, page);
}
if (type === "lyric") {
return await searchLyric(query, page);
}
},
getMediaSource,
getLyric,
getAlbumInfo,
getArtistWorks,
importMusicSheet,
getTopLists,
getTopListDetail,
getRecommendSheetTags,
getRecommendSheetsByTag,
getMusicSheetInfo,
};
@@ -0,0 +1,555 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const axios_1 = require("axios");
const he = require("he");
const pageSize = 30;
function artworkShort2Long(albumpicShort) {
var _a;
const firstSlashOfAlbum = (_a = albumpicShort === null || albumpicShort === void 0 ? void 0 : albumpicShort.indexOf("/")) !== null && _a !== void 0 ? _a : -1;
return firstSlashOfAlbum !== -1
? `https://img4.kuwo.cn/star/albumcover/1080${albumpicShort.slice(firstSlashOfAlbum)}`
: undefined;
}
function formatMusicItem(_) {
return {
id: _.MUSICRID.replace("MUSIC_", ""),
artwork: artworkShort2Long(_.web_albumpic_short),
title: he.decode(_.NAME || ""),
artist: he.decode(_.ARTIST || ""),
album: he.decode(_.ALBUM || ""),
albumId: _.ALBUMID,
artistId: _.ARTISTID,
formats: _.FORMATS,
};
}
function formatAlbumItem(_) {
var _a;
return {
id: _.albumid,
artist: he.decode(_.artist || ""),
title: he.decode(_.name || ""),
artwork: (_a = _.img) !== null && _a !== void 0 ? _a : artworkShort2Long(_.pic),
description: he.decode(_.info || ""),
date: _.pub,
artistId: _.artistid,
};
}
function formatArtistItem(_) {
return {
id: _.ARTISTID,
avatar: _.hts_PICPATH,
name: he.decode(_.ARTIST || ""),
artistId: _.ARTISTID,
description: he.decode(_.desc || ""),
worksNum: _.SONGNUM
};
}
function formatMusicSheet(_) {
return {
id: _.playlistid,
title: he.decode(_.name || ""),
artist: he.decode(_.nickname || ""),
artwork: _.pic,
playCount: _.playcnt,
description: he.decode(_.intro || ""),
worksNum: _.songnum,
};
}
async function searchMusic(query, page) {
const res = (await (0, axios_1.default)({
method: "get",
url: `http://search.kuwo.cn/r.s`,
params: {
client: "kt",
all: query,
pn: page - 1,
rn: pageSize,
uid: 2574109560,
ver: "kwplayer_ar_8.5.4.2",
vipver: 1,
ft: "music",
cluster: 0,
strategy: 2012,
encoding: "utf8",
rformat: "json",
vermerge: 1,
mobi: 1,
},
})).data;
const songs = res.abslist.map(formatMusicItem);
return {
isEnd: (+res.PN + 1) * +res.RN >= +res.TOTAL,
data: songs,
};
}
async function searchAlbum(query, page) {
const res = (await (0, axios_1.default)({
method: "get",
url: `http://search.kuwo.cn/r.s`,
params: {
all: query,
ft: "album",
itemset: "web_2013",
client: "kt",
pn: page - 1,
rn: pageSize,
rformat: "json",
encoding: "utf8",
pcjson: 1,
},
})).data;
const albums = res.albumlist.map(formatAlbumItem);
return {
isEnd: (+res.PN + 1) * +res.RN >= +res.TOTAL,
data: albums,
};
}
async function searchArtist(query, page) {
const res = (await (0, axios_1.default)({
method: "get",
url: `http://search.kuwo.cn/r.s`,
params: {
all: query,
ft: "artist",
itemset: "web_2013",
client: "kt",
pn: page - 1,
rn: pageSize,
rformat: "json",
encoding: "utf8",
pcjson: 1,
},
})).data;
const artists = res.abslist.map(formatArtistItem);
return {
isEnd: (+res.PN + 1) * +res.RN >= +res.TOTAL,
data: artists,
};
}
async function searchMusicSheet(query, page) {
const res = (await (0, axios_1.default)({
method: "get",
url: `http://search.kuwo.cn/r.s`,
params: {
all: query,
ft: "playlist",
itemset: "web_2013",
client: "kt",
pn: page - 1,
rn: pageSize,
rformat: "json",
encoding: "utf8",
pcjson: 1,
},
})).data;
const musicSheets = res.abslist.map(formatMusicSheet);
return {
isEnd: (+res.PN + 1) * +res.RN >= +res.TOTAL,
data: musicSheets,
};
}
async function getArtistMusicWorks(artistItem, page) {
const res = (await (0, axios_1.default)({
method: "get",
url: `http://search.kuwo.cn/r.s`,
params: {
pn: page - 1,
rn: pageSize,
artistid: artistItem.id,
stype: "artist2music",
sortby: 0,
alflac: 1,
show_copyright_off: 1,
pcmp4: 1,
encoding: "utf8",
plat: "pc",
thost: "search.kuwo.cn",
vipver: "MUSIC_9.1.1.2_BCS2",
devid: "38668888",
newver: 1,
pcjson: 1,
},
})).data;
const songs = res.musiclist.map((_) => {
return {
id: _.musicrid,
artwork: artworkShort2Long(_.web_albumpic_short),
title: he.decode(_.name || ""),
artist: he.decode(_.artist || ""),
album: he.decode(_.album || ""),
albumId: _.albumid,
artistId: _.artistid,
formats: _.formats,
};
});
return {
isEnd: (+res.pn + 1) * pageSize >= +res.total,
data: songs,
};
}
async function getArtistAlbumWorks(artistItem, page) {
const res = (await (0, axios_1.default)({
method: "get",
url: `http://search.kuwo.cn/r.s`,
params: {
pn: page - 1,
rn: pageSize,
artistid: artistItem.id,
stype: "albumlist",
sortby: 1,
alflac: 1,
show_copyright_off: 1,
pcmp4: 1,
encoding: "utf8",
plat: "pc",
thost: "search.kuwo.cn",
vipver: "MUSIC_9.1.1.2_BCS2",
devid: "38668888",
newver: 1,
pcjson: 1,
},
})).data;
const albums = res.albumlist.map(formatAlbumItem);
return {
isEnd: (+res.pn + 1) * pageSize >= +res.total,
data: albums,
};
}
async function getArtistWorks(artistItem, page, type) {
if (type === "music") {
return getArtistMusicWorks(artistItem, page);
}
else if (type === "album") {
return getArtistAlbumWorks(artistItem, page);
}
}
async function getLyric(musicItem) {
const res = (await axios_1.default.get("http://m.kuwo.cn/newh5/singles/songinfoandlrc", {
params: {
musicId: musicItem.id,
httpStatus: 1,
},
})).data;
const list = res.data.lrclist;
return {
rawLrc: list.map((_) => `[${_.time}]${_.lineLyric}`).join("\n"),
};
}
async function getAlbumInfo(albumItem) {
const res = (await (0, axios_1.default)({
method: "get",
url: `http://search.kuwo.cn/r.s`,
params: {
pn: 0,
rn: 100,
albumid: albumItem.id,
stype: "albuminfo",
sortby: 0,
alflac: 1,
show_copyright_off: 1,
pcmp4: 1,
encoding: "utf8",
plat: "pc",
thost: "search.kuwo.cn",
vipver: "MUSIC_9.1.1.2_BCS2",
devid: "38668888",
newver: 1,
pcjson: 1,
},
})).data;
const songs = res.musiclist.map((_) => {
var _a;
return {
id: _.id,
artwork: (_a = albumItem.artwork) !== null && _a !== void 0 ? _a : res.img,
title: he.decode(_.name || ""),
artist: he.decode(_.artist || ""),
album: he.decode(_.album || ""),
albumId: albumItem.id,
artistId: _.artistid,
formats: _.formats,
};
});
return {
musicList: songs,
};
}
async function getTopLists() {
const result = (await axios_1.default.get("http://wapi.kuwo.cn/api/pc/bang/list")).data
.child;
return result.map((e) => ({
title: e.disname,
data: e.child.map((_) => {
var _a, _b;
return ({
id: _.sourceid,
coverImg: (_b = (_a = _.pic5) !== null && _a !== void 0 ? _a : _.pic2) !== null && _b !== void 0 ? _b : _.pic,
title: _.name,
description: _.intro,
});
}),
}));
}
async function getTopListDetail(topListItem) {
const res = await axios_1.default.get(`http://kbangserver.kuwo.cn/ksong.s`, {
params: {
from: "pc",
fmt: "json",
pn: 0,
rn: 80,
type: "bang",
data: "content",
id: topListItem.id,
show_copyright_off: 0,
pcmp4: 1,
isbang: 1,
userid: 0,
httpStatus: 1,
},
});
return Object.assign(Object.assign({}, topListItem), {
musicList: res.data.musiclist.map((_) => {
return {
id: _.id,
title: he.decode(_.name || ""),
artist: he.decode(_.artist || ""),
album: he.decode(_.album || ""),
albumId: _.albumid,
artistId: _.artistid,
formats: _.formats,
};
})
});
}
async function getMusicSheetResponseById(id, page, pagesize = 50) {
return (await axios_1.default.get(`http://nplserver.kuwo.cn/pl.svc`, {
params: {
op: "getlistinfo",
pid: id,
pn: page - 1,
rn: pagesize,
encode: "utf8",
keyset: "pl2012",
vipver: "MUSIC_9.1.1.2_BCS2",
newver: 1,
},
})).data;
}
async function importMusicSheet(urlLike) {
var _a, _b;
let id;
if (!id) {
id = (_a = urlLike.match(/https?:\/\/www\/kuwo\.cn\/playlist_detail\/(\d+)/)) === null || _a === void 0 ? void 0 : _a[1];
}
if (!id) {
id = (_b = urlLike.match(/https?:\/\/m\.kuwo\.cn\/h5app\/playlist\/(\d+)/)) === null || _b === void 0 ? void 0 : _b[1];
}
if (!id) {
id = urlLike.match(/^\s*(\d+)\s*$/);
}
if (!id) {
return;
}
let page = 1;
let totalPage = 30;
let musicList = [];
while (page < totalPage) {
try {
const data = await getMusicSheetResponseById(id, page, 80);
totalPage = Math.ceil(data.total / 80);
if (isNaN(totalPage)) {
totalPage = 1;
}
musicList = musicList.concat(data.musicList.map((_) => ({
id: _.id,
title: he.decode(_.name || ""),
artist: he.decode(_.artist || ""),
album: he.decode(_.album || ""),
albumId: _.albumid,
artistId: _.artistid,
formats: _.formats,
})));
}
catch (_c) { }
await new Promise((resolve) => {
setTimeout(() => {
resolve();
}, 200 + Math.random() * 100);
});
++page;
}
return musicList;
}
async function getRecommendSheetTags() {
const res = (await axios_1.default.get(`http://wapi.kuwo.cn/api/pc/classify/playlist/getTagList?cmd=rcm_keyword_playlist&user=0&prod=kwplayer_pc_9.0.5.0&vipver=9.0.5.0&source=kwplayer_pc_9.0.5.0&loginUid=0&loginSid=0&appUid=76039576`)).data.data;
const data = res
.map((group) => ({
title: group.name,
data: group.data.map((_) => ({
id: _.id,
digest: _.digest,
title: _.name,
})),
}))
.filter((item) => item.data.length);
const pinned = [
{
id: "1848",
title: "翻唱",
digest: "10000",
},
{
id: "621",
title: "网络",
digest: "10000",
},
{
title: "伤感",
digest: "10000",
id: "146",
},
{
title: "欧美",
digest: "10000",
id: "35",
},
];
return {
data,
pinned,
};
}
async function getRecommendSheetsByTag(tag, page) {
const pageSize = 20;
let res;
if (tag.id) {
if (tag.digest === "10000") {
res = (await axios_1.default.get(`http://wapi.kuwo.cn/api/pc/classify/playlist/getTagPlayList?loginUid=0&loginSid=0&appUid=76039576&pn=${page - 1}&id=${tag.id}&rn=${pageSize}`)).data.data;
}
else {
let digest43Result = (await axios_1.default.get(`http://mobileinterfaces.kuwo.cn/er.s?type=get_pc_qz_data&f=web&id=${tag.id}&prod=pc`)).data;
res = {
total: 0,
data: digest43Result.reduce((prev, curr) => [...prev, ...curr.list]),
};
}
}
else {
res = (await axios_1.default.get(`https://wapi.kuwo.cn/api/pc/classify/playlist/getRcmPlayList?loginUid=0&loginSid=0&appUid=76039576&&pn=${page - 1}&rn=${pageSize}&order=hot`)).data.data;
}
const isEnd = page * pageSize >= res.total;
return {
isEnd,
data: res.data.map((_) => ({
title: _.name,
artist: _.uname,
id: _.id,
artwork: _.img,
playCount: _.listencnt,
createUserId: _.uid,
})),
};
}
async function getMusicSheetInfo(sheet, page) {
const res = await getMusicSheetResponseById(sheet.id, page, pageSize);
return {
isEnd: page * pageSize >= res.total,
musicList: res.musiclist.map((_) => ({
id: _.id,
title: he.decode(_.name || ""),
artist: he.decode(_.artist || ""),
album: he.decode(_.album || ""),
albumId: _.albumid,
artistId: _.artistid,
formats: _.formats,
})),
};
}
const qualityLevels = {
low: "128k",
standard: "320k",
high: "flac",
super: "wav",
};
async function getMediaSource(musicItem, quality) {
const targetQualities = [
qualityLevels[quality] || "320k",
"320k",
"128k",
].filter((item, index, arr) => !!item && arr.indexOf(item) === index);
for (const targetQuality of targetQualities) {
const res = (
await axios_1.default.get(`https://lxmusicapi.onrender.com/url/kw/${musicItem.id}/${targetQuality}`, {
headers: {
"X-Request-Key": "share-v3"
},
})
).data;
if (res === null || res === void 0 ? void 0 : res.url) {
return {
url: res.url,
};
}
}
return null;
}
async function getMusicInfo(musicItem) {
const res = (await axios_1.default.get("http://m.kuwo.cn/newh5/singles/songinfoandlrc", {
params: {
musicId: musicItem.id,
httpStatus: 1,
},
})).data;
const originalUrl = res.data.songinfo.pic;
let picUrl;
if (originalUrl.includes("starheads/")) {
picUrl = originalUrl.replace(/starheads\/\d+/, "starheads/800");
}
else if (originalUrl.includes("albumcover/")) {
picUrl = originalUrl.replace(/albumcover\/\d+/, "albumcover/800");
}
return {
artwork: picUrl,
};
}
module.exports = {
platform: "小蜗音乐",
author: 'Huibq',
version: "0.3.0",
appVersion: ">0.1.0-alpha.0",
srcUrl: "https://fastly.jsdelivr.net/gh/Huibq/keep-alive/Music_Free/xiaowo.js",
cacheControl: "no-cache",
hints: {
importMusicSheet: [
"酷我APP:自建歌单-分享-复制试听链接,直接粘贴即可",
"H5:复制URL并粘贴,或者直接输入纯数字歌单ID即可",
"导入时间和歌单大小有关,请耐心等待",
],
},
supportedSearchType: ["music", "album", "sheet", 'artist'],
async search(query, page, type) {
if (type === "music") {
return await searchMusic(query, page);
}
if (type === "album") {
return await searchAlbum(query, page);
}
if (type === "artist") {
return await searchArtist(query, page);
}
if (type === "sheet") {
return await searchMusicSheet(query, page);
}
},
getMediaSource,
getMusicInfo,
getAlbumInfo,
getLyric,
getArtistWorks,
getTopLists,
getTopListDetail,
importMusicSheet,
getRecommendSheetTags,
getRecommendSheetsByTag,
getMusicSheetInfo,
};
@@ -0,0 +1,566 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const axios_1 = require("axios");
const CryptoJs = require("crypto-js");
const qs = require("qs");
const bigInt = require("big-integer");
const dayjs = require("dayjs");
const cheerio = require("cheerio");
function create_key() {
var d, e, b = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", c = "";
for (d = 0; d < 16; d += 1)
(e = Math.random() * b.length), (e = Math.floor(e)), (c += b.charAt(e));
return c;
}
function AES(a, b) {
var c = CryptoJs.enc.Utf8.parse(b), d = CryptoJs.enc.Utf8.parse("0102030405060708"), e = CryptoJs.enc.Utf8.parse(a), f = CryptoJs.AES.encrypt(e, c, {
iv: d,
mode: CryptoJs.mode.CBC,
});
return f.toString();
}
function Rsa(text) {
text = text.split("").reverse().join("");
const d = "010001";
const e = "00e0b509f6259df8642dbc35662901477df22677ec152b5ff68ace615bb7b725152b3ab17a876aea8a5aa76d2e417629ec4ee341f56135fccf695280104e0312ecbda92557c93870114af6c9d05c4f7f0c3685b7a46bee255932575cce10b424d813cfe4875d3e82047b97ddef52741d546b8e289dc6935b3ece0462db0a22b8e7";
const hexText = text
.split("")
.map((_) => _.charCodeAt(0).toString(16))
.join("");
const res = bigInt(hexText, 16)
.modPow(bigInt(d, 16), bigInt(e, 16))
.toString(16);
return Array(256 - res.length)
.fill("0")
.join("")
.concat(res);
}
function getParamsAndEnc(text) {
const first = AES(text, "0CoJUm6Qyw8W8jud");
const rand = create_key();
const params = AES(first, rand);
const encSecKey = Rsa(rand);
return {
params,
encSecKey,
};
}
function formatMusicItem(_) {
var _a, _b, _c, _d;
const album = _.al || _.album;
return {
id: _.id,
artwork: album === null || album === void 0 ? void 0 : album.picUrl,
title: _.name,
artist: (_.ar || _.artists)[0].name,
album: album === null || album === void 0 ? void 0 : album.name,
url: `https://share.duanx.cn/url/wy/${_.id}/128k`,
qualities: {
low: {
size: (_a = (_.l || {})) === null || _a === void 0 ? void 0 : _a.size,
},
standard: {
size: (_b = (_.m || {})) === null || _b === void 0 ? void 0 : _b.size,
},
high: {
size: (_c = (_.h || {})) === null || _c === void 0 ? void 0 : _c.size,
},
super: {
size: (_d = (_.sq || {})) === null || _d === void 0 ? void 0 : _d.size,
},
},
copyrightId: _ === null || _ === void 0 ? void 0 : _.copyrightId
};
}
function formatAlbumItem(_) {
return {
id: _.id,
artist: _.artist.name,
title: _.name,
artwork: _.picUrl,
description: "",
date: dayjs.unix(_.publishTime / 1000).format("YYYY-MM-DD"),
};
}
const pageSize = 30;
async function searchBase(query, page, type) {
const data = {
s: query,
limit: pageSize,
type: type,
offset: (page - 1) * pageSize,
csrf_token: "",
};
const pae = getParamsAndEnc(JSON.stringify(data));
const paeData = qs.stringify(pae);
const headers = {
authority: "music.163.com",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36",
"content-type": "application/x-www-form-urlencoded",
accept: "*/*",
origin: "https://music.163.com",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
referer: "https://music.163.com/search/",
"accept-language": "zh-CN,zh;q=0.9",
};
const res = (await (0, axios_1.default)({
method: "post",
url: "https://music.163.com/weapi/search/get",
headers,
data: paeData,
})).data;
return res;
}
async function searchMusic(query, page) {
const res = await searchBase(query, page, 1);
const songs = res.result.songs
.map(formatMusicItem);
return {
isEnd: res.result.songCount <= page * pageSize,
data: songs,
};
}
async function searchAlbum(query, page) {
const res = await searchBase(query, page, 10);
const albums = res.result.albums.map(formatAlbumItem);
return {
isEnd: res.result.albumCount <= page * pageSize,
data: albums,
};
}
async function searchArtist(query, page) {
const res = await searchBase(query, page, 100);
const artists = res.result.artists.map((_) => ({
name: _.name,
id: _.id,
avatar: _.img1v1Url,
worksNum: _.albumSize,
}));
return {
isEnd: res.result.artistCount <= page * pageSize,
data: artists,
};
}
async function searchMusicSheet(query, page) {
const res = await searchBase(query, page, 1000);
const playlists = res.result.playlists.map((_) => {
var _a;
return ({
title: _.name,
id: _.id,
coverImg: _.coverImgUrl,
artist: (_a = _.creator) === null || _a === void 0 ? void 0 : _a.nickname,
playCount: _.playCount,
worksNum: _.trackCount,
});
});
return {
isEnd: res.result.playlistCount <= page * pageSize,
data: playlists,
};
}
async function searchLyric(query, page) {
var _a, _b;
const res = await searchBase(query, page, 1006);
const lyrics = (_b = (_a = res.result.songs) === null || _a === void 0 ? void 0 : _a.map((it) => {
var _a, _b, _c, _d;
return ({
title: it.name,
artist: (_a = it.ar) === null || _a === void 0 ? void 0 : _a.map((_) => _.name).join(", "),
id: it.id,
artwork: (_b = it.al) === null || _b === void 0 ? void 0 : _b.picUrl,
album: (_c = it.al) === null || _c === void 0 ? void 0 : _c.name,
rawLrcTxt: (_d = it.lyrics) === null || _d === void 0 ? void 0 : _d.join("\n"),
});
})) !== null && _b !== void 0 ? _b : [];
return {
isEnd: res.result.songCount <= page * pageSize,
data: lyrics,
};
}
async function getArtistWorks(artistItem, page, type) {
const data = {
csrf_token: "",
};
const pae = getParamsAndEnc(JSON.stringify(data));
const paeData = qs.stringify(pae);
const headers = {
authority: "music.163.com",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36",
"content-type": "application/x-www-form-urlencoded",
accept: "*/*",
origin: "https://music.163.com",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
referer: "https://music.163.com/search/",
"accept-language": "zh-CN,zh;q=0.9",
};
if (type === "music") {
const res = (await (0, axios_1.default)({
method: "post",
url: `https://music.163.com/weapi/v1/artist/${artistItem.id}?csrf_token=`,
headers,
data: paeData,
})).data;
return {
isEnd: true,
data: res.hotSongs.map(formatMusicItem),
};
}
else if (type === "album") {
const res = (await (0, axios_1.default)({
method: "post",
url: `https://music.163.com/weapi/artist/albums/${artistItem.id}?csrf_token=`,
headers,
data: paeData,
})).data;
return {
isEnd: true,
data: res.hotAlbums.map(formatAlbumItem),
};
}
}
async function getTopListDetail(topListItem) {
const musicList = await getSheetMusicById(topListItem.id);
return Object.assign(Object.assign({}, topListItem), { musicList });
}
async function getLyric(musicItem) {
const headers = {
Referer: "https://y.music.163.com/",
Origin: "https://y.music.163.com/",
authority: "music.163.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36",
"Content-Type": "application/x-www-form-urlencoded",
};
const data = { id: musicItem.id, lv: -1, tv: -1, csrf_token: "" };
const pae = getParamsAndEnc(JSON.stringify(data));
const paeData = qs.stringify(pae);
const result = (await (0, axios_1.default)({
method: "post",
url: `https://interface.music.163.com/weapi/song/lyric?csrf_token=`,
headers,
data: paeData,
})).data;
return {
rawLrc: result.lrc.lyric,
};
}
async function getMusicInfo(musicItem) {
const headers = {
Referer: "https://y.music.163.com/",
Origin: "https://y.music.163.com/",
authority: "music.163.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36",
"Content-Type": "application/x-www-form-urlencoded",
};
const data = { id: musicItem.id, ids: `[${musicItem.id}]` };
const result = (await axios_1.get('http://music.163.com/api/song/detail',
{
headers,
params: data
})).data;
return {
artwork: result.songs[0].album.picUrl,
};
}
async function getAlbumInfo(albumItem) {
const headers = {
Referer: "https://y.music.163.com/",
Origin: "https://y.music.163.com/",
authority: "music.163.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36",
"Content-Type": "application/x-www-form-urlencoded",
};
const data = {
resourceType: 3,
resourceId: albumItem.id,
limit: 15,
csrf_token: "",
};
const pae = getParamsAndEnc(JSON.stringify(data));
const paeData = qs.stringify(pae);
const res = (await (0, axios_1.default)({
method: "post",
url: `https://interface.music.163.com/weapi/v1/album/${albumItem.id}?csrf_token=`,
headers,
data: paeData,
})).data;
return {
albumItem: { description: res.album.description },
musicList: (res.songs || [])
.map(formatMusicItem),
};
}
async function getValidMusicItems(trackIds) {
const headers = {
Referer: "https://y.music.163.com/",
Origin: "https://y.music.163.com/",
authority: "music.163.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36",
"Content-Type": "application/x-www-form-urlencoded",
};
try {
// 获取歌曲详情数据
const res = (await axios_1.default.get(`https://music.163.com/api/song/detail/?ids=[${trackIds.join(",")}]`, { headers })).data;
// 直接格式化歌曲项,不检查 URL
const validMusicItems = res.songs.map(formatMusicItem);
return validMusicItems;
}
catch (e) {
console.error(e);
return [];
}
}
async function getSheetMusicById(id) {
const headers = {
Referer: "https://y.music.163.com/",
Origin: "https://y.music.163.com/",
authority: "music.163.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36",
};
const sheetDetail = (await axios_1.default.get(`https://music.163.com/api/v3/playlist/detail?id=${id}&n=5000`, {
headers,
})).data;
const trackIds = sheetDetail.playlist.trackIds.map((_) => _.id);
let result = [];
let idx = 0;
while (idx * 200 < trackIds.length) {
const res = await getValidMusicItems(trackIds.slice(idx * 200, (idx + 1) * 200));
result = result.concat(res);
++idx;
}
return result;
}
async function importMusicSheet(urlLike) {
const matchResult = urlLike.match(/(?:https:\/\/y\.music\.163.com\/m\/playlist\?id=([0-9]+))|(?:https?:\/\/music\.163\.com\/playlist\/([0-9]+)\/.*)|(?:https?:\/\/music.163.com(?:\/#)?\/playlist\?id=(\d+))|(?:^\s*(\d+)\s*$)/);
const id = matchResult[1] || matchResult[2] || matchResult[3] || matchResult[4];
return getSheetMusicById(id);
}
async function getTopLists() {
const res = await axios_1.default.get("https://music.163.com/discover/toplist", {
headers: {
referer: "https://music.163.com/",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.54",
},
});
const $ = cheerio.load(res.data);
const children = $(".n-minelst").children();
const groups = [];
let currentGroup = {};
for (let c of children) {
if (c.tagName == "h2") {
if (currentGroup.title) {
groups.push(currentGroup);
}
currentGroup = {};
currentGroup.title = $(c).text();
currentGroup.data = [];
}
else if (c.tagName === "ul") {
let sections = $(c).children();
currentGroup.data = sections
.map((index, element) => {
const ele = $(element);
const id = ele.attr("data-res-id");
const coverImg = ele.find("img").attr("src").replace(/(\.jpg\?).*/, ".jpg?param=800y800");
const title = ele.find("p.name").text();
const description = ele.find("p.s-fc4").text();
return {
id,
coverImg,
title,
description,
};
})
.toArray();
}
}
if (currentGroup.title) {
groups.push(currentGroup);
}
return groups;
}
const qualityLevels = {
low: "128k",
standard: "320k",
high: "flac",
super: "wav",
};
async function getMediaSource(musicItem, quality) {
const targetQualities = [
qualityLevels[quality] || "320k",
"320k",
"128k",
].filter((item, index, arr) => !!item && arr.indexOf(item) === index);
for (const targetQuality of targetQualities) {
const res = (
await axios_1.default.get(`https://lxmusicapi.onrender.com/url/wy/${musicItem.id}/${targetQuality}`, {
headers: {
"X-Request-Key": "share-v3"
},
})
).data;
if (res === null || res === void 0 ? void 0 : res.url) {
return {
url: res.url,
};
}
}
return null;
}
const headers = {
authority: "music.163.com",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36",
"content-type": "application/x-www-form-urlencoded",
accept: "*/*",
origin: "https://music.163.com",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
referer: "https://music.163.com/",
"accept-language": "zh-CN,zh;q=0.9",
};
async function getRecommendSheetTags() {
const data = {
csrf_token: "",
};
const pae = getParamsAndEnc(JSON.stringify(data));
const paeData = qs.stringify(pae);
const res = (await (0, axios_1.default)({
method: "post",
url: "https://music.163.com/weapi/playlist/catalogue",
headers,
data: paeData,
})).data;
const cats = res.categories;
const map = {};
const catData = Object.entries(cats).map((_) => {
const tagData = {
title: _[1],
data: [],
};
map[_[0]] = tagData;
return tagData;
});
const pinned = [];
res.sub.forEach((tag) => {
const _tag = {
id: tag.name,
title: tag.name,
};
if (tag.hot) {
pinned.push(_tag);
}
map[tag.category].data.push(_tag);
});
return {
pinned,
data: catData,
};
}
async function getRecommendSheetsByTag(tag, page) {
const pageSize = 20;
const data = {
cat: tag.id || "全部",
order: "hot",
limit: pageSize,
offset: (page - 1) * pageSize,
total: true,
csrf_token: "",
};
const pae = getParamsAndEnc(JSON.stringify(data));
const paeData = qs.stringify(pae);
const res = (await (0, axios_1.default)({
method: "post",
url: "https://music.163.com/weapi/playlist/list",
headers,
data: paeData,
})).data;
const playLists = res.playlists.map((_) => ({
id: _.id,
artist: _.creator.nickname,
title: _.name,
artwork: _.coverImgUrl,
playCount: _.playCount,
createUserId: _.userId,
createTime: _.createTime,
description: _.description,
}));
return {
isEnd: !(res.more === true),
data: playLists,
};
}
async function getMusicSheetInfo(sheet, page) {
let trackIds = sheet._trackIds;
if (!trackIds) {
const id = sheet.id;
const headers = {
Referer: "https://y.music.163.com/",
Origin: "https://y.music.163.com/",
authority: "music.163.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36",
};
const sheetDetail = (await axios_1.default.get(`https://music.163.com/api/v3/playlist/detail?id=${id}&n=5000`, {
headers,
})).data;
trackIds = sheetDetail.playlist.trackIds.map((_) => _.id);
}
const pageSize = 40;
const currentPageIds = trackIds.slice((page - 1) * pageSize, page * pageSize);
const res = await getValidMusicItems(currentPageIds);
let extra = {};
if (page <= 1) {
extra = {
_trackIds: trackIds,
};
}
return Object.assign({ isEnd: trackIds.length <= page * pageSize, musicList: res }, extra);
}
module.exports = {
platform: "小芸音乐",
author: 'Huibq',
version: "0.3.0",
appVersion: ">0.1.0-alpha.0",
srcUrl: "https://fastly.jsdelivr.net/gh/Huibq/keep-alive/Music_Free/xiaoyun.js",
cacheControl: "no-store",
hints: {
importMusicSheet: [
"网易云:APP点击分享,然后复制链接",
"默认歌单无法导入,先新建一个空白歌单复制过去再导入新歌单即可"
],
},
supportedSearchType: ["music", "album", "sheet", "artist", "lyric"],
async search(query, page, type) {
if (type === "music") {
return await searchMusic(query, page);
}
if (type === "album") {
return await searchAlbum(query, page);
}
if (type === "artist") {
return await searchArtist(query, page);
}
if (type === "sheet") {
return await searchMusicSheet(query, page);
}
if (type === "lyric") {
return await searchLyric(query, page);
}
},
getMediaSource,
getMusicInfo,
getAlbumInfo,
getLyric,
getArtistWorks,
importMusicSheet,
getTopLists,
getTopListDetail,
getRecommendSheetTags,
getMusicSheetInfo,
getRecommendSheetsByTag,
};
+59
View File
@@ -0,0 +1,59 @@
# <p align="center">注意事项&使用教程</p>
## 一. 注意
### 1.1 关于音源
> 音质最高支持320k。
>
> 不支持数字专辑,反复请求可能会导致`封禁IP`!
>
> 仅供在线试听,禁止批量下载,批量下载会被`封禁IP`,请规范使用!
>
> 尽量避免频繁切换歌曲,否则将导致`封禁IP`
### 1.2 关于使用
- `MusicFree`请在设置里选择:`播放失败时暂停`
> 否则在某些情况下会被封禁IP
![img_3.png](source/注意1.png)
### 1.3 关于解封
> 由于邮件太多,来不及看,如果被封,数据流量情况下开启飞行模式切换IP。
## 二. 洛雪音乐
> 软件请转跳下载: [安卓 -> 洛雪音乐](https://github.com/lyswhut/lx-music-mobile/releases)
>
> 软件请转跳下载: [Windows&MacOS -> 洛雪音乐](https://github.com/lyswhut/lx-music-desktop/releases)
- 洛雪音乐音源链接:
```any
https://fastly.jsdelivr.net/gh/Huibq/keep-alive/render_api.js
```
- 教程请看png!
![img_1.png](source/LxMusic.png)
## 三. MusicFree
> 软件请转跳下载: [安卓-> MusicFree](https://github.com/maotoumao/MusicFree/releases)
>
> 软件请转跳下载: [Windows&MacOS -> MusicFree](https://github.com/maotoumao/MusicFreeDesktop/releases)
- MusicFree音源链接:
```any
https://fastly.jsdelivr.net/gh/Huibq/keep-alive/Music_Free/myPlugins.json
```
- 教程请看png!
![img_2.png](source/MusicFree.png)
## Star History
[![Star History](https://starchart.cc/Huibq/keep-alive.svg?variant=adaptive)](https://starchart.cc/Huibq/keep-alive)
+19
View File
@@ -0,0 +1,19 @@
import os
import traceback
import requests
render_url = os.environ['render_url']
render_key = os.environ['render_key']
header_key = os.environ['header_key']
headers = {
'User-Agent': "Reqable/9.9.9",
'X-Request-Key': render_key,
'X-Forwarded-For': header_key
}
try:
req = requests.get(render_url, headers=headers, timeout=10)
print(req.text)
except:
traceback.print_exc()
+89
View File
@@ -0,0 +1,89 @@
/*!
* @name Huibq_lxmusic源
* @description Github搜索“洛雪音乐音源”,禁止批量下载!
* @version v1.2.0
* @author Huibq
*/
const DEV_ENABLE = false
const API_URL = 'https://lxmusicapi.onrender.com'
const API_KEY = 'share-v3'
const MUSIC_QUALITY = {
kw: ['128k', '320k', 'flac', 'wav'],
kg: ['128k', '320k', 'flac', 'wav'],
tx: ['128k', '320k', 'flac', 'wav'],
wy: ['128k', '320k', 'flac', 'wav'],
mg: ['128k', '320k', 'flac', 'wav'],
}
const MUSIC_SOURCE = Object.keys(MUSIC_QUALITY)
const { EVENT_NAMES, request, on, send, utils, env, version } = globalThis.lx
const httpFetch = (url, options = { method: 'GET' }) => {
return new Promise((resolve, reject) => {
request(url, options, (err, resp) => {
if (err) return reject(err)
resolve(resp)
})
})
}
const handleGetMusicUrl = async (source, musicInfo, quality) => {
const songId = musicInfo.hash ?? musicInfo.songmid
const request = await httpFetch(`${API_URL}/url/${source}/${songId}/${quality}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'User-Agent': `${env ? `lx-music-${env}/${version}` : `lx-usic-request/${version}`}`,
'X-Request-Key': API_KEY,
},
})
const { body } = request
if (!body || isNaN(Number(body.code))) throw new Error('unknow error')
switch (body.code) {
case 0:
return body.url
case 1:
throw new Error('block ip')
case 2:
throw new Error('get music url failed')
case 4:
throw new Error('internal server error')
case 5:
throw new Error('too many requests')
case 6:
throw new Error('param error')
default:
throw new Error(body.msg ?? 'unknow error')
}
}
const musicSources = {}
MUSIC_SOURCE.forEach(item => {
musicSources[item] = {
name: item,
type: 'music',
actions: ['musicUrl'],
qualitys: MUSIC_QUALITY[item],
}
})
on(EVENT_NAMES.request, ({ action, source, info }) => {
switch (action) {
case 'musicUrl':
if (env != 'mobile') {
console.group(`Handle Action(musicUrl)`)
console.log('source', source)
console.log('quality', info.type)
console.log('musicInfo', info.musicInfo)
console.groupEnd()
} else {
console.log(`Handle Action(musicUrl)`)
console.log('source', source)
console.log('quality', info.type)
console.log('musicInfo', info.musicInfo)
}
return handleGetMusicUrl(source, info.musicInfo, info.type)
.then(data => Promise.resolve(data))
.catch(err => Promise.reject(err))
default:
console.error(`action(${action}) not support`)
return Promise.reject('action not support')
}
})
send(EVENT_NAMES.inited, { status: true, openDevTools: DEV_ENABLE, sources: musicSources })
+25
View File
@@ -0,0 +1,25 @@
const {getDefaultConfig} = require('expo/metro-config');
const {mergeConfig} = require('@react-native/metro-config');
/**
* Reference: https://github.com/software-mansion/react-native-svg/blob/main/USAGE.md
*/
const defaultConfig = getDefaultConfig(__dirname);
const {assetExts, sourceExts} = defaultConfig.resolver;
/**
* Metro configuration
* https://reactnative.dev/docs/metro
*
* @type {import('metro-config').MetroConfig}
*/
const config = {
transformer: {
babelTransformerPath: require.resolve('react-native-svg-transformer'),
},
resolver: {
assetExts: assetExts.filter(ext => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg'],
},
};
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
+22311
View File
File diff suppressed because it is too large Load Diff
+135
View File
@@ -0,0 +1,135 @@
{
"name": "MusicFree",
"version": "0.6.3",
"private": true,
"license": "AGPL",
"author": {
"name": "猫头猫",
"email": "lhx_xjtu@163.com"
},
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx src --fix",
"start": "react-native start",
"clean": "cd ./android && ./gradlew clean",
"test": "jest",
"commit-lint": "commitlint --edit",
"lint-staged": "lint-staged",
"connect-mumu": "adb kill-server & adb connect localhost:7555",
"build-android": "cd .\\android\\ && .\\gradlew assembleRelease",
"generate-assets": "node ./generator/generate-assets.mjs",
"prepare": "husky"
},
"dependencies": {
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-clipboard/clipboard": "^1.15.0",
"@react-native-community/netinfo": "11.4.1",
"@react-native-community/slider": "~4.5.6",
"@react-native-masked-view/masked-view": "0.3.2",
"@react-navigation/drawer": "^6.7.2",
"@react-navigation/native": "^6.1.18",
"@react-navigation/native-stack": "^6.11.0",
"@shopify/flash-list": "1.7.1",
"axios": "1.7.4",
"big-integer": "^1.6.52",
"cheerio": "^1.0.0-rc.12",
"color": "^4.2.3",
"compare-versions": "^6.1.1",
"crypto-js": "^4.2.0",
"dayjs": "^1.11.12",
"deepmerge": "^4.3.1",
"eventemitter3": "^5.0.1",
"expo": "^52.0.0",
"expo-document-picker": "~13.0.1",
"expo-file-system": "~18.0.6",
"expo-keep-awake": "~14.0.1",
"expo-splash-screen": "~0.29.18",
"he": "^1.2.0",
"immer": "^10.1.1",
"jotai": "^2.9.1",
"lodash.shuffle": "^4.2.0",
"marked": "^15.0.12",
"nanoid": "5.0.8",
"object-path": "^0.11.8",
"p-queue": "^8.0.1",
"path-browserify": "^1.0.1",
"qs": "^6.13.0",
"react": "18.3.1",
"react-native": "0.76.5",
"react-native-background-timer": "^2.4.1",
"react-native-circular-progress-indicator": "^4.4.2",
"react-native-device-info": "^14.0.4",
"react-native-fast-image": "^8.6.3",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "~2.25.0",
"react-native-get-random-values": "^1.11.0",
"react-native-image-colors": "^2.4.0",
"react-native-image-picker": "^7.1.2",
"react-native-linear-gradient": "^2.8.3",
"react-native-logs": "^5.1.0",
"react-native-mmkv": "^2.12.2",
"react-native-pager-view": "6.5.1",
"react-native-permissions": "^4.1.5",
"react-native-reanimated": "^3.17.5",
"react-native-safe-area-context": "~5.4.0",
"react-native-screens": "~4.4.0",
"react-native-share": "^10.2.1",
"react-native-svg": "^15.11.2",
"react-native-tab-view": "^3.5.2",
"react-native-track-player": "^4.1.1",
"react-native-url-polyfill": "^2.0.0",
"react-native-webview": "^13.13.5",
"recyclerlistview": "^4.2.1",
"webdav": "^5.7.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@react-native-community/cli": "15.0.1",
"@react-native-community/cli-platform-android": "15.0.1",
"@react-native-community/cli-platform-ios": "15.0.1",
"@react-native/babel-preset": "0.76.5",
"@react-native/eslint-config": "0.76.5",
"@react-native/metro-config": "0.76.5",
"@react-native/typescript-config": "0.76.5",
"@types/color": "^3.0.6",
"@types/crypto-js": "^4.2.2",
"@types/he": "^1.2.3",
"@types/lodash.shuffle": "^4.2.9",
"@types/object-path": "^0.11.4",
"@types/path-browserify": "^1.0.2",
"@types/qs": "^6.9.15",
"@types/react": "~18.3.12",
"@types/react-native-background-timer": "^2.0.2",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"babel-plugin-module-resolver": "^5.0.2",
"babel-plugin-transform-remove-console": "^6.9.4",
"eslint": "^8.19.0",
"eslint-config-prettier": "^9.1.0",
"husky": "^9.1.4",
"jest": "^29.6.3",
"lint-staged": "^15.2.7",
"prettier": "2.8.8",
"react-native-svg-transformer": "^1.5.0",
"react-test-renderer": "18.3.1",
"typescript": "^5.3.3"
},
"engines": {
"node": ">=18"
},
"lint-staged": {
"src/**/*.{ts,tsx}": [
"npm run lint",
"git add ."
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/maotoumao/MusicFree.git"
}
}
+210
View File
@@ -0,0 +1,210 @@
# MusicFree
[中文](./readme.md) | **English**
![GitHub Repo stars](https://img.shields.io/github/stars/maotoumao/MusicFree)
![GitHub forks](https://img.shields.io/github/forks/maotoumao/MusicFree)
![star](https://gitcode.com/maotoumao/MusicFree/star/badge.svg)
![GitHub License](https://img.shields.io/github/license/maotoumao/MusicFree)
![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/maotoumao/MusicFree/total)
![GitHub Issues or Pull Requests](https://img.shields.io/github/issues/maotoumao/MusicFree)
![GitHub package.json version](https://img.shields.io/github/package-json/v/maotoumao/MusicFree)
<a href="https://trendshift.io/repositories/1028" target="_blank"><img src="https://trendshift.io/api/badge/repositories/1028" alt="maotoumao%2FMusicFree | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
---
## Introduction
A plugin-based, customizable, ad-free music player that currently supports Android and Harmony OS only.
> **Desktop version is here: <https://github.com/maotoumao/MusicFreeDesktop>**
If you need to stay updated on future developments, you can follow the WeChat official account below; if you have questions, you can leave feedback directly in the issue section or the official account.
![WeChat Official Account](./src/assets/imgs/wechat_channel.jpg)
For software download methods, plugin usage instructions, and plugin development documentation, please visit <https://musicfree.catcat.work>.
> [!NOTE]
> - If you see paid/ad-free/cracked versions on other platforms, they are all fake. This is an open source project to begin with. **Please report paid versions directly when encountered**;
> - The software is primarily for personal use, shared to hopefully help those in need; it's a hobby project that will be maintained as much as possible, but daily development time is limited (about half an hour), and it's expected to remain in unstable testing versions for a long time with irregular update frequency. Please use with caution;
> - Third-party plugins and the data they generate are not related to this software. Please use legally and compliantly, and delete any copyright data that may be generated in a timely manner.
> - **Please do not promote with VIP/cracked version as a gimmick**. The example repository is based on public internet API wrappers and **filters out all VIP, preview, and paid songs**. The example repository will **not provide plugins with cracking functionality** in the future;
> - Information about this software **will only be actively published in Git repositories and the WeChat official account "一只猫头猫"**. If you wish to write articles introducing this software, feel free to do so, but please **describe truthfully, and please blur the plugin sources when involving the example repository**. Don't add unreal features to the software (although I wish it had them); in case of conflicting descriptions, this repository shall prevail.
## Project Usage Agreement:
This project is open sourced under the AGPL 3.0 license. Please comply with the open source license when using this project.
In addition, please ensure you understand the following additional notes when using the code:
1. For packaging and redistribution, **please retain the code source**: https://github.com/maotoumao/MusicFree
2. Please do not use for commercial purposes; use the code legally and compliantly;
3. If the open source license changes, it will be updated in this GitHub repository without separate notice.
> [!CAUTION]
> ### 👎 Hall of Shame
> 👎 MusicFree apps on <ins>Xiaomi/Huawei/Vivo app stores</ins> are not related to this software. **They are adware that misappropriates this software's name and logo**. Please be cautious to avoid being deceived.
>
> 👎 速悦音乐 is based on secondary development of this software, with changes only including built-in plugins, UI modifications, and traffic diversion. **It has not complied with this project's open source license and refuses to communicate**.
## Features
- **Plugin-based**: This software is just a player and **does not integrate** any music sources from any platform. All search, playback, playlist import and other functions are entirely based on **plugins**. This means that **as long as music sources can be searched on the internet, as long as there are corresponding plugins, you can use this software for search, playback and other functions**. For detailed plugin information, please see the Plugin section.
- **Plugin-supported features**: Search (music, albums, artists), playback, view albums, view artist details, import singles, import playlists, get lyrics, etc.
- **Customizable and ad-free**: This software provides light and dark modes; supports custom backgrounds; this software is open sourced under the AGPL license and ~~one star for a deal~~ will remain free.
- **Privacy**: All data is stored locally, this software will not collect any of your personal information.
- **Lyrics association**: You can associate the lyrics of two songs, for example, associate song A's lyrics to song B. After association, both songs A and B will display song B's lyrics. You can also associate multiple songs' lyrics, like A->B->C, so that songs A, B, and C will all display C's lyrics.
## Plugins
### Plugin Introduction
A plugin is essentially a CommonJS module that satisfies the plugin protocol. The plugin defines basic functions such as search (music, albums, artists), playback, view albums, artist details, import playlists, get lyrics, etc. Plugin developers only need to focus on input and output logic, while pagination, caching, etc. are all handled by MusicFree. This software completes all player functions through plugins. This decoupled design also allows this software to focus on being a feature-complete player. I must say, small and beautiful.
Plugin development documentation can be found [here](https://musicfree.catcat.work/plugin/introduction.html)
Please note:
- If you are using third-party downloaded plugins, please identify the security of the plugins yourself (basically check that there are no strange network requests; self-written ones are the safest, *don't install things from unknown sources*) to prevent malicious code damage. This software is not responsible for possible losses caused by third-party malicious plugins.
- Plugins may generate certain copyright data unrelated to this software during use. Plugins and any data generated by plugins are not related to this software. Please consider carefully and delete data in a timely manner. This software does not advocate nor will it provide any cracking behavior. You can build your own offline music repository for use.
### Plugin Usage
After downloading the app, you just need to install plugins in the sidebar Settings - Plugin Settings. Supports installing local plugins and installing plugins from the network (supports parsing .js files and .json description files; several example plugins have been written: [link to this repository](https://github.com/maotoumao/MusicFreePlugins), though functionality may not be very complete);
You can directly click "Install plugin from network", then enter <https://gitee.com/maotoumao/MusicFreePlugins/raw/master/plugins.json> and click confirm to install.
For detailed usage instructions with images, please refer to the WeChat official account: [MusicFree Plugin Usage Guide](https://mp.weixin.qq.com/s?__biz=MzkxOTM5MDI4MA==&mid=2247483875&idx=1&sn=aedf8bb909540634d927de7fd2b4b8b1&chksm=c1a390c4f6d419d233908bb781d418c6b9fd2ca82e9e93291e7c93b8ead3c50ca5ae39668212#rd), or the website: https://musicfree.catcat.work/usage/mobile/install-plugin.html
## Download
Please go to the release page: [Link](https://github.com/maotoumao/MusicFree/releases) (if you can't open it, you can replace github with gitee). You can also reply "Musicfree" on the WeChat official account.
## Q&A
For common issues encountered during use, see here: [MusicFree Usage Q&A](https://musicfree.catcat.work/qa/common.html)
For technical exchange/building interesting things together/technical chats, welcome to join the QQ group: [683467814](https://jq.qq.com/?_wv=1027&k=upVpi2k3)~ (Not a Q&A group)
For casual chat, you can go to [QQ Channel](https://pd.qq.com/s/cyxnf0jj1)~
## WIP
If you have new requirements that need discussion, you can leave a message on the WeChat official account backend/submit an issue/or start a topic in discussions.
## Support This Project
If you like this project, or hope I can continue maintaining it, you can support me through any of the following ways ;)
1. Star this project and share it with people around you;
2. Follow the WeChat official account 👇 or Bilibili [不想睡觉猫头猫](https://space.bilibili.com/12866223) for the latest information;
3. Follow maotoumao's [XiaoHongShu](https://www.xiaohongshu.com/user/profile/5ce6085200000000050213a6?xhsshare=CopyLink&appuid=5ce6085200000000050213a6&apptime=1714394544) or [X](https://twitter.com/upupfun). Although I might not update software-related information there, it's still support~
![WeChat Official Account](./src/assets/imgs/wechat_channel.jpg)
Thanks to the following friends for their recommendations, very surprising and delightful ~~~
Recommendation from **果核剥壳**~ <https://mp.weixin.qq.com/s/F6hMbLv_a-Ty0fPA_0P0Rg>
Recommendation from **小棉袄**~ <https://mp.weixin.qq.com/s/Fqe3o7vcTw0KDKoB-gsQfg>
## ChangeLog
[Click here](./changelog.md)
---
This project is for learning and reference only, open sourced under the AGPL3.0 license; please use this project reasonably in compliance with laws and regulations, prohibited for commercial use.
## App Screenshots
**The following screenshots are UI examples only. The software does not provide any music sources internally and does not represent actual performance as shown below.**
#### Main Interface
<img src="./.imgs/main-v0.6.jpg" width="320px" alt="Main Interface">
#### Sidebar
- Sidebar
<img src="./.imgs/sidebar-v0.6.jpg" width="320px" alt="Sidebar">
- Basic Settings
<img src="./.imgs/basic-setting-v0.6.jpg" width="320px" alt="Basic Settings">
- Theme Settings
<img src="./.imgs/theme-setting-v0.6.jpg" width="320px" alt="Theme Settings">
#### Music Related
- Playlist Page
<img src="./.imgs/song-sheet-v0.6.jpg" width="320px" alt="Playlist Page">
- Search in Playlist
<img src="./.imgs/search-in-sheet-v0.6.jpg" width="320px" alt="Search in Playlist">
- Player Page
<img src="./.imgs/song-cover-v0.6.jpg" width="320px" alt="Player Page">
- Lyrics Page
<img src="./.imgs/song-lrc-v0.6.jpg" width="320px" alt="Lyrics Page">
#### Search Related
- Artist Information
<img src="./.imgs/artist-detail-v0.6.jpg" width="320px" alt="Artist Information">
<details>
<summary>The following are UI from early versions of the software</summary>
#### Main Interface
<img src="./.imgs/main.jpg" width="320px" alt="Main Interface">
#### Sidebar
- Basic Settings
<img src="./.imgs/basic-setting.jpg" width="320px" alt="Basic Settings">
- Theme Settings
<img src="./.imgs/theme-setting.jpg" width="320px" alt="Theme Settings">
#### Music Related
- Playlist Page
<img src="./.imgs/song-sheet.jpg" width="320px" alt="Playlist Page">
- Search in Playlist
<img src="./.imgs/search-in-sheet.jpg" width="320px" alt="Search in Playlist">
- Player Page
<img src="./.imgs/song-cover.jpg" width="320px" alt="Player Page">
- Lyrics Page
<img src="./.imgs/song-lrc.jpg" width="320px" alt="Lyrics Page">
#### Search Related
- Artist Information
<img src="./.imgs/artist-detail.jpg" width="320px" alt="Artist Information">
</details>
+214
View File
@@ -0,0 +1,214 @@
# MusicFree
**中文** | [English](./readme-en.md)
![GitHub Repo stars](https://img.shields.io/github/stars/maotoumao/MusicFree)
![GitHub forks](https://img.shields.io/github/forks/maotoumao/MusicFree)
![star](https://gitcode.com/maotoumao/MusicFree/star/badge.svg)
![GitHub License](https://img.shields.io/github/license/maotoumao/MusicFree)
![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/maotoumao/MusicFree/total)
![GitHub Issues or Pull Requests](https://img.shields.io/github/issues/maotoumao/MusicFree)
![GitHub package.json version](https://img.shields.io/github/package-json/v/maotoumao/MusicFree)
<a href="https://trendshift.io/repositories/1028" target="_blank"><img src="https://trendshift.io/api/badge/repositories/1028" alt="maotoumao%2FMusicFree | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
## 简介
一个插件化、定制化、无广告的免费音乐播放器,目前只支持 Android 和 Harmony OS。
> **桌面版来啦:<https://github.com/maotoumao/MusicFreeDesktop>**
如果需要了解后续进展可以关注公众号↓;如果有问题可以在 issue 区或者公众号直接留言反馈。
![微信公众号](./src/assets/imgs/wechat_channel.jpg)
软件下载方式、插件使用说明、插件开发文档可去站点 [https://musicfree.catcat.work](https://musicfree.catcat.work) 查看。
> [!NOTE]
> - 如果你在其他的平台看到收费版/无广告版/破解版,都是假的,本来就是开源项目,**遇到收费版请直接举报**;
> - 软件首先是自用,顺带分享出来希望可以帮助到有需要的人;是业余作品,会尽量保持维护,不过每天能写的时间有限(半小时左右),目测会有很长一段时间处于不稳定测试版本,且更新频率不定,请谨慎使用;
> - 软件的第三方插件、及其所产生的数据与本软件无关,请合理合法使用,可能产生的版权数据请及时删除。
> - **请不要以 VIP/破解版为噱头进行宣传**,示例仓库基于互联网公开接口封装,并**过滤掉所有 VIP、试听、付费歌曲**,且示例仓库以后也**不会提供具备破解功能的插件**;
> - 本软件的相关信息**只会主动投放在 Git 仓库以及公众号“一只猫头猫”中**,如果希望写文章介绍本软件请自便,但还烦请**如实陈述,涉及到示例仓库请给插件源打个码**,不要给软件增加一些不实的功能(尽管我也想有);描述冲突的地方以本仓库为准。
## 项目使用约定:
本项目基于 AGPL 3.0 协议开源,使用此项目时请遵守开源协议。
除此外,希望你在使用代码时已经了解以下额外说明:
1. 打包、二次分发 **请保留代码出处**https://github.com/maotoumao/MusicFree
2. 请不要用于商业用途,合法合规使用代码;
3. 如果开源协议变更,将在此 Github 仓库更新,不另行通知。
> [!CAUTION]
> ### 👎 Hall of Shame
> 👎 小米/华为/vivo等<ins>应用市场的 MusicFree </ins>和本软件无关,**是套用本软件名称和 Logo 的广告软件**。
>
> 👎 速悦音乐基于本软件二次开发,改动点仅仅是内置插件、修改一些 UI 以及引流,**并未遵守本项目的开源协议,且拒绝沟通**。
---
## 特性
- 插件化:本软件仅仅是一个播放器,本身**并不集成**任何平台的任何音源,所有的搜索、播放、歌单导入等功能全部基于**插件**。这也就意味着,**只要可以在互联网上搜索到的音源,只要有对应的插件,你都可以使用本软件进行搜索、播放等功能**。关于插件的详细说明请看插件一节。
- 插件支持的功能:搜索(音乐、专辑、作者)、播放、查看专辑、查看作者详细信息、导入单曲、导入歌单、获取歌词等。
- 定制化、无广告:本软件提供了浅色、深色模式;支持自定义背景;本软件基于 AGPL 协议开源,~~一个 star 做交易~~ 将会保持免费。
- 隐私:所有的数据都存储在本地,本软件不会收集你的任何个人信息。
- 歌词关联:你可以把两首歌的歌词关联起来,比如将歌曲 A 的歌词关联到歌曲 B,关联后 A、B 两首歌都将显示歌曲 B 的歌词。你也可以关联多首歌的歌词,如 A->B->C,这样 A、B、C 三首歌都将显示 C 的歌词。
## 插件
### 插件简介
插件本质上是一个满足插件协议的 commonjs 模块。插件中定义了搜索(音乐、专辑、作者)、播放、查看专辑、作者详细信息、导入歌单、获取歌词等基本函数,插件的开发者只需要关心输入输出逻辑,至于分页、缓存等全都交给 MusicFree 控制即可。本软件通过插件来完成播放器的所有功能,这样解耦的设计也可以使得本软件可以专注于做一个功能完善的播放器,我直呼小而美。
插件开发文档可以参考 [这里](https://musicfree.catcat.work/plugin/introduction.html)
需要注意的是:
- 如果你是使用第三方下载的插件,那么请自行鉴别插件的安全性(基本上看下没有奇怪的网络请求什么的就好了;自己写的最安全,*不要安装来路不明的东西*),防止恶意代码破坏。因为第三方恶意插件导致的可能的损失与本软件无关。
- 插件使用过程中可能会产生某些和本软件无关的版权数据,插件、以及插件产生的任何数据与本软件无关,请使用者自行斟酌,及时删除数据,本软件不提倡也不会提供任何破解行为,你可以搭建自己的离线音乐仓库使用。
### 插件使用
下载 app 之后,只需要在侧边栏设置-插件设置中安装插件即可。支持安装本地插件和从网络安装插件(支持解析.js 文件和.json 描述文件;已经写了几个示意的插件:[指路这个仓库](https://github.com/maotoumao/MusicFreePlugins),不过可能功能不是很完善);
你可以直接点击从网络安装插件,然后输入<https://raw.gitcode.com/maotoumao/MusicFreePlugins/raw/master/plugins.json> ,点击确认即可安装。
图文版详细使用说明可以参考公众号:[MusicFree 插件使用指南](https://mp.weixin.qq.com/s?__biz=MzkxOTM5MDI4MA==&mid=2247483875&idx=1&sn=aedf8bb909540634d927de7fd2b4b8b1&chksm=c1a390c4f6d419d233908bb781d418c6b9fd2ca82e9e93291e7c93b8ead3c50ca5ae39668212#rd),或者站点: https://musicfree.catcat.work/usage/mobile/install-plugin.html
## 下载地址
请转到发布页查看:[指路](https://github.com/maotoumao/MusicFree/releases) (如果打不开可以把 github 换成 gitcode),公众号回复 Musicfree 也可以。
## Q&A
使用时遇到的常见问题可以看这里:[MusicFree 使用 Q&A](https://musicfree.catcat.work/qa/common.html)
技术交流/一起写点有意思的东西/技术向的闲聊欢迎加群:[683467814](https://jq.qq.com/?_wv=1027&k=upVpi2k3)~ (不是答疑群)
闲聊可以到 [QQ 频道](https://pd.qq.com/s/cyxnf0jj1)~
## WIP
如果有需要讨论的新需求,可以在公众号后台留言/提issue/或者去discussion开个话题。
## 支持这个项目
如果你喜欢这个项目,或者希望我可以持续维护下去,你可以通过以下任何一种方式支持我;)
1. Star 这个项目,分享给你身边的人;
2. 关注公众号👇或 b 站 [不想睡觉猫头猫](https://space.bilibili.com/12866223) 获取最新信息;
3. 关注猫头猫的 [小红书](https://www.xiaohongshu.com/user/profile/5ce6085200000000050213a6?xhsshare=CopyLink&appuid=5ce6085200000000050213a6&apptime=1714394544),虽然可能不会在这里更新软件相关的信息,但也算支持啦~
![微信公众号](./src/assets/imgs/wechat_channel.jpg)
感谢以下小伙伴的推荐,很意外也很惊喜 ~~~
来自**果核剥壳**的安利~ <https://mp.weixin.qq.com/s/F6hMbLv_a-Ty0fPA_0P0Rg>
来自**小棉袄**的安利~ <https://mp.weixin.qq.com/s/Fqe3o7vcTw0KDKoB-gsQfg>
## ChangeLog
[点击这里](./changelog.md)
---
本项目仅供学习参考使用,基于 AGPL3.0 协议开源;请在符合法律法规的情况下合理使用本项目,禁止用于商业目的使用。
## 应用截图
**以下截图仅为 UI 样例,软件内部不提供任何音源,不代表实际使用时表现如下图。**
#### 主界面
<img src="./.imgs/main-v0.6.jpg" width="320px" alt="主界面">
#### 侧边栏
- 侧边栏
<img src="./.imgs/sidebar-v0.6.jpg" width="320px" alt="侧边栏">
- 基础设置
<img src="./.imgs/basic-setting-v0.6.jpg" width="320px" alt="基础设置">
- 主题设置
<img src="./.imgs/theme-setting-v0.6.jpg" width="320px" alt="主题设置">
#### 音乐相关
- 歌单页
<img src="./.imgs/song-sheet-v0.6.jpg" width="320px" alt="歌单页">
- 歌单内检索
<img src="./.imgs/search-in-sheet-v0.6.jpg" width="320px" alt="歌单内检索">
- 播放页
<img src="./.imgs/song-cover-v0.6.jpg" width="320px" alt="播放页">
- 歌词页
<img src="./.imgs/song-lrc-v0.6.jpg" width="320px" alt="歌词页">
#### 搜索相关
- 作者信息
<img src="./.imgs/artist-detail-v0.6.jpg" width="320px" alt="作者信息">
<details>
<summary>以下是软件早期版本的 UI</summary>
#### 主界面
<img src="./.imgs/main.jpg" width="320px" alt="主界面">
#### 侧边栏
- 基础设置
<img src="./.imgs/basic-setting.jpg" width="320px" alt="基础设置">
- 主题设置
<img src="./.imgs/theme-setting.jpg" width="320px" alt="主题设置">
#### 音乐相关
- 歌单页
<img src="./.imgs/song-sheet.jpg" width="320px" alt="歌单页">
- 歌单内检索
<img src="./.imgs/search-in-sheet.jpg" width="320px" alt="歌单内检索">
- 播放页
<img src="./.imgs/song-cover.jpg" width="320px" alt="播放页">
- 歌词页
<img src="./.imgs/song-lrc.jpg" width="320px" alt="歌词页">
#### 搜索相关
- 作者信息
<img src="./.imgs/artist-detail.jpg" width="320px" alt="作者信息">
</details>
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12.0001 22.0001C7.02956 22.0001 3.00012 17.9707 3.00012 13.0001C3.00012 8.02956 7.02956 4.00012 12.0001 4.00012C16.9707 4.00012 21.0001 8.02956 21.0001 13.0001C21.0001 17.9707 16.9707 22.0001 12.0001 22.0001ZM12.0001 20.0001C15.8661 20.0001 19.0001 16.8661 19.0001 13.0001C19.0001 9.13412 15.8661 6.00012 12.0001 6.00012C8.13412 6.00012 5.00012 9.13412 5.00012 13.0001C5.00012 16.8661 8.13412 20.0001 12.0001 20.0001ZM13.0001 13.0001H16.0001V15.0001H11.0001V8.00012H13.0001V13.0001ZM1.74707 6.2826L5.2826 2.74707L6.69682 4.16128L3.16128 7.69682L1.74707 6.2826ZM18.7176 2.74707L22.2532 6.2826L20.839 7.69682L17.3034 4.16128L18.7176 2.74707Z"></path></svg>

After

Width:  |  Height:  |  Size: 744 B

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 14C13.1046 14 14 13.1046 14 12C14 10.8954 13.1046 10 12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14ZM12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12C16 14.2091 14.2091 16 12 16Z"></path></svg>

After

Width:  |  Height:  |  Size: 562 B

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m6 4.125 2.25 2.25m0 0 2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z" />
</svg>

After

Width:  |  Height:  |  Size: 516 B

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3" />
</svg>

After

Width:  |  Height:  |  Size: 307 B

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18" />
</svg>

After

Width:  |  Height:  |  Size: 234 B

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 15.75 3 12m0 0 3.75-3.75M3 12h18" />
</svg>

After

Width:  |  Height:  |  Size: 237 B

Some files were not shown because too many files have changed in this diff Show More