mirror of
https://git.um-react.app/um/um-react.git
synced 2025-11-28 03:23:02 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f09aa84984 | ||
|
|
1d2296a02a | ||
|
|
f6703160e7 | ||
|
|
bea2f4b7d4 | ||
|
|
0a3dac9d3d | ||
|
|
602d6865f5 | ||
|
|
8d4194772e | ||
|
|
1ef1db30ab | ||
|
|
80fc595833 | ||
|
|
be9a1b6724 | ||
|
|
6cccb722ce |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -27,3 +27,6 @@ dist-ssr
|
||||
# Files created when running "drone exec" locally
|
||||
/.pnpm-store/
|
||||
/*.zip
|
||||
|
||||
/um-react-wry-*
|
||||
/um-react*.exe
|
||||
|
||||
15
README.MD
15
README.MD
@@ -73,12 +73,25 @@
|
||||
|
||||
满足上述条件后发起 Pull Request,仓库管理员审阅后将合并到主分支。
|
||||
|
||||
## 相关项目
|
||||
|
||||
- [Unlock Music (Web)](https://git.unlock-music.dev/um/web) - 原始项目
|
||||
- [Unlock Music (Cli)](https://git.unlock-music.dev/um/cli) - 命令行批量处理版
|
||||
- [um-react (Electron 前端)](https://github.com/CarlGao4/um-react-electron) - 使用 Electron 框架封装的本地可执行文件。
|
||||
- [GitHub 下载](https://github.com/CarlGao4/um-react-electron/releases/latest) | [仓库镜像](https://git.unlock-music.dev/CarlGao4/um-react-electron)
|
||||
- [um-react-wry](https://git.unlock-music.dev/um/um-react-wry) - 使用 WRY 框架封装的 Win64 单文件 (需要[安装 Edge WebView2 运行时][webview2_redist],Win10+ 操作系统自带)
|
||||
- [本地下载](https://git.unlock-music.dev/um/um-react/releases/latest) | 寻找文件名为 `um-react-win64-` 开头的附件
|
||||
|
||||
[webview2_redist]: https://go.microsoft.com/fwlink/p/?LinkId=2124703
|
||||
|
||||
有新的项目提交?欢迎[提交 issue][project-issues],请带上项目名称和链接。
|
||||
|
||||
## TODO
|
||||
|
||||
- 待定
|
||||
- [ ] 各类算法 [追踪 `crypto` 标签](https://git.unlock-music.dev/um/um-react/issues?labels=67)
|
||||
- [ ] #7 简易元数据编辑器
|
||||
- 完成
|
||||
- [x] #7 ~~简易元数据编辑器~~ 放弃
|
||||
- [x] #8 ~~添加单元测试~~ 框架加上了,以后慢慢添加更多测试即可。
|
||||
- [x] #2 解密内容探测 (解密过程)
|
||||
- [x] #6 文件拖放 (利用 `react-dropzone`?)
|
||||
|
||||
@@ -63,6 +63,8 @@
|
||||
|
||||
如果希望不破坏系统完整性,你可以考虑使用模拟器。
|
||||
|
||||
※ **注意**:根据应用厂商的风控策略,使用模拟器登录的账号**有可能会被封锁**;使用前请自行评估风险。
|
||||
|
||||
目前常见的带有 root 特权支持的的安卓模拟器方案,分别是雷电模拟器(※ 官方版有内置广告)和微软在 Windows 11 开始支援的适用于 Android™ 的 Windows 子系统 (WSA)。
|
||||
|
||||
- WSA 可以参考 [MagiskOnWSALocal](https://github.com/LSPosed/MagiskOnWSALocal) 的说明操作。
|
||||
|
||||
@@ -33,3 +33,31 @@ pnpm build
|
||||
如果需要预览构建版本,运行 `pnpm preview` 然后打开[项目预览页面][vite-preview-url]即可。
|
||||
|
||||
[vite-preview-url]: http://localhost:4173/
|
||||
|
||||
## 打包 `.zip`
|
||||
|
||||
建议在 Linux 环境下执行,可参考 `.drone.yml` CI 文件。
|
||||
|
||||
1. 确保上述的构建步骤已完成。
|
||||
2. 确保 `python3` 已安装。
|
||||
3. 执行下述代码
|
||||
```sh
|
||||
python3 -m zipfile -c um-react.zip dist/.
|
||||
```
|
||||
|
||||
## 打包 win64 单文件
|
||||
|
||||
利用 Windows 系统自带的 [Edge WebView2 组件](https://learn.microsoft.com/zh-cn/microsoft-edge/webview2/)
|
||||
和 [wry](https://github.com/tauri-apps/wry) 进行一个单文件的打包。
|
||||
|
||||
大部分 Windows 10 或以上版本的操作系统已经集成了 WebView2 运行时。若无法正常启动,请[下载并安装 Edge WebView2 运行时](https://go.microsoft.com/fwlink/p/?LinkId=2124703)。
|
||||
|
||||
其它系统兼容性未知。
|
||||
|
||||
1. 确保你现在在 `linux-amd64` 环境下。
|
||||
2. 确保上述的 `um-react.zip` 构建已完成。
|
||||
3. 执行下述代码
|
||||
```sh
|
||||
./scripts/make-win64.sh
|
||||
```
|
||||
4. 等待提示 `[Build OK]` 即可。
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "um-react",
|
||||
"private": true,
|
||||
"version": "0.2.5",
|
||||
"version": "0.2.7",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"start": "vite",
|
||||
"build": "tsc -p tsconfig.prod.json && vite build",
|
||||
"build": "tsc -p tsconfig.prod.json && vite build && node scripts/write-version.mjs",
|
||||
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"format": "prettier -w .",
|
||||
"test": "vitest run",
|
||||
|
||||
28
scripts/make-win64.sh
Executable file
28
scripts/make-win64.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
pushd "$(dirname "${BASH_SOURCE[0]}")/../"
|
||||
|
||||
dl_file() {
|
||||
local FILE="$1"
|
||||
if [[ ! -f "$FILE" ]]; then
|
||||
curl -fsL "https://um-react.app/files/${FILE}.gz" | gzip -d >"${FILE}"
|
||||
fi
|
||||
}
|
||||
|
||||
dl_file "um-react-wry-builder-0.1.0-linux-amd64"
|
||||
dl_file "um-react-wry-stub-0.1.0-win64.exe"
|
||||
chmod a+x um-react-wry-builder-0.1.0-linux-amd64
|
||||
|
||||
APP_VERSION="$(jq -r '.version' <package.json)"
|
||||
EXE_NAME="um-react-win64-${APP_VERSION}.exe"
|
||||
ZIP_NAME="um-react-win64-${APP_VERSION}.zip"
|
||||
./um-react-wry-builder-0.1.0-linux-amd64 \
|
||||
-t um-react-wry-stub-0.1.0-win64.exe \
|
||||
-r um-react.zip \
|
||||
-o "${EXE_NAME}"
|
||||
|
||||
touch -d 1970-01-01T00:00:00Z "${EXE_NAME}"
|
||||
zip -9oX "${ZIP_NAME}" -- "${EXE_NAME}"
|
||||
echo "[Build OK] '${ZIP_NAME}'."
|
||||
|
||||
popd
|
||||
14
scripts/write-version.mjs
Normal file
14
scripts/write-version.mjs
Normal file
@@ -0,0 +1,14 @@
|
||||
/* eslint-env node */
|
||||
import { readFileSync, writeFileSync } from 'node:fs';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { dirname } from 'node:path';
|
||||
import { execSync } from 'node:child_process';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
const commitHash = execSync('git rev-parse --short HEAD').toString('utf-8').trim();
|
||||
|
||||
const pkgJson = JSON.parse(readFileSync(__dirname + '/../package.json', 'utf-8'));
|
||||
const pkgVer = `${pkgJson.version ?? 'unknown'}-${commitHash ?? 'unknown'}` + '\n';
|
||||
writeFileSync(__dirname + '/../dist/version.txt', pkgVer, 'utf-8');
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Img, ListItem, Text, UnorderedList } from '@chakra-ui/react';
|
||||
import { Alert, AlertIcon, Code, Container, Flex, Img, ListItem, Text, UnorderedList } from '@chakra-ui/react';
|
||||
import { ExtLink } from '~/components/ExtLink';
|
||||
import { Header4 } from '~/components/HelpText/Header4';
|
||||
import { VQuote } from '~/components/HelpText/VQuote';
|
||||
@@ -57,6 +57,19 @@ export function OtherFAQ() {
|
||||
</ExtLink>
|
||||
。
|
||||
</Text>
|
||||
|
||||
<Container p={2}>
|
||||
<Alert status="warning" borderRadius={5}>
|
||||
<AlertIcon />
|
||||
<Flex flexDir="column">
|
||||
<Text>
|
||||
<strong>注意</strong>:根据应用厂商的风控策略,使用模拟器登录的账号<strong>有可能会被封锁</strong>
|
||||
{';使用前请自行评估风险。'}
|
||||
</Text>
|
||||
</Flex>
|
||||
</Alert>
|
||||
</Container>
|
||||
|
||||
<UnorderedList>
|
||||
<ListItem>
|
||||
<Text>
|
||||
@@ -73,6 +86,48 @@ export function OtherFAQ() {
|
||||
</ListItem>
|
||||
</UnorderedList>
|
||||
|
||||
<Header4>相关项目</Header4>
|
||||
<UnorderedList>
|
||||
<ListItem>
|
||||
<Text>
|
||||
<ExtLink href="https://github.com/CarlGao4/um-react-electron">
|
||||
<strong>
|
||||
<Code>um-react-electron</Code>
|
||||
</strong>
|
||||
</ExtLink>
|
||||
:利用 Electron 框架打包的本地版,提供适用于 Windows、Linux 和 Mac 平台的可执行文件。
|
||||
</Text>
|
||||
<UnorderedList>
|
||||
<ListItem>
|
||||
<Text>
|
||||
<ExtLink href="https://github.com/CarlGao4/um-react-electron/releases/latest">GitHub 下载</ExtLink>
|
||||
</Text>
|
||||
</ListItem>
|
||||
</UnorderedList>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<Text>
|
||||
<ExtLink href="https://git.unlock-music.dev/um/um-react-wry">
|
||||
<strong>
|
||||
<Code>um-react-wry</Code>
|
||||
</strong>
|
||||
</ExtLink>
|
||||
: 使用 WRY 框架封装的 Win64 单文件(需要
|
||||
<ExtLink href="https://go.microsoft.com/fwlink/p/?LinkId=2124703">安装 Edge WebView2 运行时</ExtLink>
|
||||
{',Win10+ 操作系统自带)'}
|
||||
</Text>
|
||||
<UnorderedList>
|
||||
<ListItem>
|
||||
<Text>
|
||||
<ExtLink href="https://git.unlock-music.dev/um/um-react/releases/latest">仓库下载</ExtLink>
|
||||
{' | 寻找文件名为 '}
|
||||
<Code>um-react-win64-</Code> 开头的附件
|
||||
</Text>
|
||||
</ListItem>
|
||||
</UnorderedList>
|
||||
</ListItem>
|
||||
</UnorderedList>
|
||||
|
||||
<Header4>有更多问题?</Header4>
|
||||
<Text>
|
||||
{'欢迎进入 '}
|
||||
|
||||
Reference in New Issue
Block a user