mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-11 02:50:27 +00:00
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab371d21f9 | ||
|
|
4fc67a676e | ||
|
|
864e6b0477 | ||
|
|
0b1d6ca1f6 | ||
|
|
c2049806a5 | ||
|
|
a58738f910 | ||
|
|
606f93e885 | ||
|
|
509e5c9f5e | ||
|
|
fb38253045 | ||
|
|
782205ef27 |
No files matched your search
+60
-98
@@ -38,116 +38,78 @@ version-resolver:
|
|||||||
default: patch
|
default: patch
|
||||||
template: |
|
template: |
|
||||||
<table>
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="2">Windows</th>
|
||||||
|
<th>MacOS</th>
|
||||||
|
<th colspan="4">Linux</th>
|
||||||
|
<th>Android</th>
|
||||||
|
<th>iOS</th>
|
||||||
|
<th>Docker</th>
|
||||||
|
<th colspan="2">Qnap</th>
|
||||||
|
<th colspan="8">Web</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>EXE</code></td>
|
||||||
|
<td><code>Portable</code></td>
|
||||||
|
<td><code>DMG</code></td>
|
||||||
|
<td><code>Flathub</code></td>
|
||||||
|
<td><code>SNAP</code></td>
|
||||||
|
<td><code>DEB</code></td>
|
||||||
|
<td><code>AppImage</code></td>
|
||||||
|
<td><code>APK</code></td>
|
||||||
|
<td><code>IPA</code></td>
|
||||||
|
<td>-</td>
|
||||||
|
<td colspan="2"><code>QPKG</code></td>
|
||||||
|
<td colspan="3"><code>Windows</code></td>
|
||||||
|
<td colspan="2"><code>MacOS</code></td>
|
||||||
|
<td colspan="3"><code>Linux</code></td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td rowspan="2">🪟 Windows</td>
|
|
||||||
<td><code>EXE</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/Gopeed-v$NEXT_PATCH_VERSION-windows-amd64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>Portable</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/Gopeed-v$NEXT_PATCH_VERSION-windows-amd64-portable.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🍎 MacOS</td>
|
|
||||||
<td><code>DMG</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/Gopeed-v$NEXT_PATCH_VERSION-macos.dmg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="6">🐧 Linux</td>
|
|
||||||
<td><code>Flathub</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://flathub.org/apps/com.gopeed.Gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>SNAP</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://snapcraft.io/gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>DEB</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/Gopeed-v$NEXT_PATCH_VERSION-linux-amd64.deb">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/Gopeed-v$NEXT_PATCH_VERSION-linux-arm64.deb">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>AppImage</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/Gopeed-v$NEXT_PATCH_VERSION-linux-amd64.AppImage">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/Gopeed-v$NEXT_PATCH_VERSION-linux-arm64.AppImage">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🤖 Android</td>
|
|
||||||
<td><code>APK</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/Gopeed-v$NEXT_PATCH_VERSION-android.apk">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>📱 iOS</td>
|
|
||||||
<td><code>IPA</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/Gopeed-v$NEXT_PATCH_VERSION-ios.ipa">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🐳 Docker</td>
|
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://hub.docker.com/r/liwei2633/gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2">💾 Qnap</td>
|
|
||||||
<td rowspan="2"><code>QPKG</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/gopeed-v$NEXT_PATCH_VERSION-qnap-amd64.qpkg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/gopeed-v$NEXT_PATCH_VERSION-qnap-arm64.qpkg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="8">🌐 Web</td>
|
|
||||||
<td rowspan="3"><code>Windows</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/gopeed-web-v$NEXT_PATCH_VERSION-windows-amd64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>amd64</td>
|
||||||
<td>arm64</td>
|
<td>arm64</td>
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/gopeed-web-v$NEXT_PATCH_VERSION-windows-arm64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
|
||||||
<td>386</td>
|
<td>386</td>
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/gopeed-web-v$NEXT_PATCH_VERSION-windows-386.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>MacOS</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/gopeed-web-v$NEXT_PATCH_VERSION-macos-amd64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/gopeed-web-v$NEXT_PATCH_VERSION-macos-arm64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="3"><code>Linux</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/gopeed-web-v$NEXT_PATCH_VERSION-linux-amd64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/gopeed-web-v$NEXT_PATCH_VERSION-linux-arm64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>386</td>
|
<td>386</td>
|
||||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/download/v$NEXT_PATCH_VERSION/gopeed-web-v$NEXT_PATCH_VERSION-linux-386.zip">📥</a></td>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64-portable.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-macos.dmg">Link</a></td>
|
||||||
|
<td><a href="https://flathub.org/apps/com.gopeed.Gopeed">Link</a></td>
|
||||||
|
<td><a href="https://snapcraft.io/gopeed">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.deb">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-x86_64.AppImage">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-android.apk">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-ios.ipa">Link</a></td>
|
||||||
|
<td><a href="https://hub.docker.com/r/liwei2633/gopeed">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-amd64.qpkg">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-arm64.qpkg">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-amd64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-arm64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-386.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-amd64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-arm64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-amd64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-arm64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-386.zip">Link</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
+19
-68
@@ -52,11 +52,10 @@ jobs:
|
|||||||
mv ChineseSimplified.isl "C:\Program Files (x86)\Inno Setup 6\Languages\"
|
mv ChineseSimplified.isl "C:\Program Files (x86)\Inno Setup 6\Languages\"
|
||||||
|
|
||||||
go build -tags nosqlite -ldflags="-w -s -X github.com/GopeedLab/gopeed/pkg/base.Version=$env:VERSION" -buildmode=c-shared -o ui/flutter/windows/libgopeed.dll github.com/GopeedLab/gopeed/bind/desktop
|
go build -tags nosqlite -ldflags="-w -s -X github.com/GopeedLab/gopeed/pkg/base.Version=$env:VERSION" -buildmode=c-shared -o ui/flutter/windows/libgopeed.dll github.com/GopeedLab/gopeed/bind/desktop
|
||||||
go build -ldflags="-w -s" -o ui/flutter/assets/exec/host.exe github.com/GopeedLab/gopeed/cmd/host
|
go build -ldflags="-w -s" -o ui/flutter/assets/host/host.exe github.com/GopeedLab/gopeed/cmd/host
|
||||||
go build -ldflags="-w -s" -o ui/flutter/assets/exec/updater.exe github.com/GopeedLab/gopeed/cmd/updater
|
|
||||||
cd ui/flutter
|
cd ui/flutter
|
||||||
$TAG = "v$env:VERSION"
|
$TAG = "v$env:VERSION"
|
||||||
flutter build windows --dart-define="UPDATE_CHANNEL=windowsPortable"
|
flutter build windows
|
||||||
$mingw = "C:\Program Files\Git\mingw64\bin"
|
$mingw = "C:\Program Files\Git\mingw64\bin"
|
||||||
$system = "C:\Windows\System32"
|
$system = "C:\Windows\System32"
|
||||||
$release = "build\windows\x64\runner\Release\"
|
$release = "build\windows\x64\runner\Release\"
|
||||||
@@ -70,7 +69,6 @@ jobs:
|
|||||||
New-Item -Path build\windows\Output -ItemType Directory
|
New-Item -Path build\windows\Output -ItemType Directory
|
||||||
Compress-Archive -Path "$release*" -DestinationPath "build\windows\Output\Gopeed-$TAG-windows-amd64-portable.zip"
|
Compress-Archive -Path "$release*" -DestinationPath "build\windows\Output\Gopeed-$TAG-windows-amd64-portable.zip"
|
||||||
|
|
||||||
flutter build windows --dart-define="UPDATE_CHANNEL=windowsInstaller"
|
|
||||||
cd build/windows
|
cd build/windows
|
||||||
echo @"
|
echo @"
|
||||||
; Script generated by the Inno Setup Script Wizard.
|
; Script generated by the Inno Setup Script Wizard.
|
||||||
@@ -154,14 +152,12 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
go build -tags nosqlite -ldflags="-w -s -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION" -buildmode=c-shared -o libgopeed.dylib github.com/GopeedLab/gopeed/bind/desktop
|
go build -tags nosqlite -ldflags="-w -s -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION" -buildmode=c-shared -o libgopeed.dylib github.com/GopeedLab/gopeed/bind/desktop
|
||||||
go build -ldflags="-w -s" github.com/GopeedLab/gopeed/cmd/host
|
go build -ldflags="-w -s" github.com/GopeedLab/gopeed/cmd/host
|
||||||
go build -ldflags="-w -s" github.com/GopeedLab/gopeed/cmd/updater
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: macos-arm64-lib
|
name: macos-arm64-lib
|
||||||
path: |
|
path: |
|
||||||
libgopeed.dylib
|
libgopeed.dylib
|
||||||
host
|
host
|
||||||
updater
|
|
||||||
build-macos:
|
build-macos:
|
||||||
if: ${{ github.event.inputs.platform == 'all' || github.event.inputs.platform == 'macos' }}
|
if: ${{ github.event.inputs.platform == 'all' || github.event.inputs.platform == 'macos' }}
|
||||||
runs-on: macos-13
|
runs-on: macos-13
|
||||||
@@ -181,7 +177,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python3 -m pip install setuptools --break-system-packages
|
python3 -m pip install setuptools --break-system-packages
|
||||||
npm install -g appdmg
|
npm install -g appdmg
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: macos-arm64-lib
|
name: macos-arm64-lib
|
||||||
path: ui/flutter/lib-arm64
|
path: ui/flutter/lib-arm64
|
||||||
@@ -194,24 +190,20 @@ jobs:
|
|||||||
# amd64 lib
|
# amd64 lib
|
||||||
go build -tags nosqlite -ldflags="-w -s -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION" -buildmode=c-shared -o ui/flutter/lib-amd64/libgopeed.dylib github.com/GopeedLab/gopeed/bind/desktop
|
go build -tags nosqlite -ldflags="-w -s -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION" -buildmode=c-shared -o ui/flutter/lib-amd64/libgopeed.dylib github.com/GopeedLab/gopeed/bind/desktop
|
||||||
go build -ldflags="-w -s" -o ui/flutter/lib-amd64/host github.com/GopeedLab/gopeed/cmd/host
|
go build -ldflags="-w -s" -o ui/flutter/lib-amd64/host github.com/GopeedLab/gopeed/cmd/host
|
||||||
go build -ldflags="-w -s" -o ui/flutter/lib-amd64/updater github.com/GopeedLab/gopeed/cmd/updater
|
|
||||||
# universal binary
|
# universal binary
|
||||||
mkdir -p ui/flutter/macos/Frameworks
|
mkdir -p ui/flutter/macos/Frameworks
|
||||||
cp ui/flutter/lib-amd64/libgopeed.dylib ui/flutter/macos/Frameworks/amd64-lib
|
cp ui/flutter/lib-amd64/libgopeed.dylib ui/flutter/macos/Frameworks/amd64-lib
|
||||||
cp ui/flutter/lib-arm64/libgopeed.dylib ui/flutter/macos/Frameworks/arm64-lib
|
cp ui/flutter/lib-arm64/libgopeed.dylib ui/flutter/macos/Frameworks/arm64-lib
|
||||||
cp ui/flutter/lib-amd64/host ui/flutter/macos/Frameworks/amd64-host
|
cp ui/flutter/lib-amd64/host ui/flutter/macos/Frameworks/amd64-host
|
||||||
cp ui/flutter/lib-arm64/host ui/flutter/macos/Frameworks/arm64-host
|
cp ui/flutter/lib-arm64/host ui/flutter/macos/Frameworks/arm64-host
|
||||||
cp ui/flutter/lib-amd64/updater ui/flutter/macos/Frameworks/amd64-updater
|
|
||||||
cp ui/flutter/lib-arm64/updater ui/flutter/macos/Frameworks/arm64-updater
|
|
||||||
cd ui/flutter/macos/Frameworks
|
cd ui/flutter/macos/Frameworks
|
||||||
lipo -create -output libgopeed.dylib amd64-lib arm64-lib
|
lipo -create -output libgopeed.dylib amd64-lib arm64-lib
|
||||||
lipo -create -output host amd64-host arm64-host
|
lipo -create -output host amd64-host arm64-host
|
||||||
lipo -create -output updater amd64-updater arm64-updater
|
rm -rf amd64-lib arm64-lib amd64-host arm64-host
|
||||||
rm -rf amd64-lib arm64-lib amd64-host arm64-host amd64-updater arm64-updater
|
mv host ../../assets/host/host
|
||||||
mv host ../../assets/exec/host
|
|
||||||
|
|
||||||
cd $PROJECT_DIR/ui/flutter
|
cd $PROJECT_DIR/ui/flutter
|
||||||
flutter build macos --dart-define="UPDATE_CHANNEL=macosDmg"
|
flutter build macos
|
||||||
cd build/macos/Build/Products/Release
|
cd build/macos/Build/Products/Release
|
||||||
cat>appdmg.json<<EOF
|
cat>appdmg.json<<EOF
|
||||||
{
|
{
|
||||||
@@ -233,34 +225,23 @@ jobs:
|
|||||||
overwrite: true
|
overwrite: true
|
||||||
build-linux:
|
build-linux:
|
||||||
if: ${{ github.event.inputs.platform == 'all' || github.event.inputs.platform == 'linux' }}
|
if: ${{ github.event.inputs.platform == 'all' || github.event.inputs.platform == 'linux' }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ ubuntu-22.04, ubuntu-22.04-arm ]
|
|
||||||
needs: [get-release]
|
needs: [get-release]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v4
|
- uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: ${{ env.GO_VERSION }}
|
go-version: ${{ env.GO_VERSION }}
|
||||||
- if: matrix.os == 'ubuntu-22.04'
|
- uses: subosito/flutter-action@v2
|
||||||
uses: subosito/flutter-action@v2
|
|
||||||
with:
|
with:
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||||
- if: matrix.os == 'ubuntu-22.04-arm'
|
|
||||||
uses: subosito/flutter-action@v2
|
|
||||||
with:
|
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
|
||||||
channel: master
|
|
||||||
- run: |
|
- run: |
|
||||||
sudo apt update -y
|
sudo apt update -y
|
||||||
# flutter build dependencies
|
# flutter build dependencies
|
||||||
sudo apt install -y ninja-build libgtk-3-dev libayatana-appindicator3-1 libayatana-appindicator3-dev
|
sudo apt install -y ninja-build libgtk-3-dev libayatana-appindicator3-1 libayatana-appindicator3-dev
|
||||||
# appimage build dependencies
|
# appimage build dependencies
|
||||||
sudo apt install -y libfuse2 locate
|
sudo apt install -y libfuse2 locate
|
||||||
arch=$(uname -m)
|
wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
|
||||||
wget -O appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${arch}.AppImage"
|
|
||||||
wget -O appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${arch}.AppImage"
|
|
||||||
chmod +x appimagetool
|
chmod +x appimagetool
|
||||||
sudo mv appimagetool /usr/local/bin/
|
sudo mv appimagetool /usr/local/bin/
|
||||||
- name: Build
|
- name: Build
|
||||||
@@ -268,42 +249,13 @@ jobs:
|
|||||||
VERSION: ${{ needs.get-release.outputs.version }}
|
VERSION: ${{ needs.get-release.outputs.version }}
|
||||||
run: |
|
run: |
|
||||||
go build -tags nosqlite -ldflags="-w -s -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION" -buildmode=c-shared -o ui/flutter/linux/bundle/lib/libgopeed.so github.com/GopeedLab/gopeed/bind/desktop
|
go build -tags nosqlite -ldflags="-w -s -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION" -buildmode=c-shared -o ui/flutter/linux/bundle/lib/libgopeed.so github.com/GopeedLab/gopeed/bind/desktop
|
||||||
go build -ldflags="-w -s" -o ui/flutter/assets/exec/host github.com/GopeedLab/gopeed/cmd/host
|
go build -ldflags="-w -s" -o ui/flutter/assets/host/host github.com/GopeedLab/gopeed/cmd/host
|
||||||
go build -ldflags="-w -s" -o ui/flutter/assets/exec/updater github.com/GopeedLab/gopeed/cmd/updater
|
|
||||||
|
|
||||||
cd ui/flutter
|
cd ui/flutter
|
||||||
cat << EOF > distribute_options.yaml
|
|
||||||
output: dist/
|
|
||||||
releases:
|
|
||||||
- name: linux
|
|
||||||
jobs:
|
|
||||||
- name: appimage
|
|
||||||
package:
|
|
||||||
platform: linux
|
|
||||||
target: appimage
|
|
||||||
build_args:
|
|
||||||
dart-define:
|
|
||||||
UPDATE_CHANNEL: linuxAppImage
|
|
||||||
- name: deb
|
|
||||||
package:
|
|
||||||
platform: linux
|
|
||||||
target: deb
|
|
||||||
build_args:
|
|
||||||
dart-define:
|
|
||||||
UPDATE_CHANNEL: linuxDeb
|
|
||||||
EOF
|
|
||||||
dart pub global activate -sgit https://github.com/GopeedLab/flutter_distributor.git --git-path packages/flutter_distributor
|
dart pub global activate -sgit https://github.com/GopeedLab/flutter_distributor.git --git-path packages/flutter_distributor
|
||||||
flutter_distributor release --name linux
|
flutter_distributor package --platform linux --targets appimage,deb
|
||||||
cd dist/*
|
cd dist/*
|
||||||
|
mv gopeed-*-linux.AppImage Gopeed-v${VERSION}-linux-x86_64.AppImage
|
||||||
# Get current running architecture, x86_64 -> amd64 and aarch64 -> arm64
|
mv gopeed-*-linux.deb Gopeed-v${VERSION}-linux-amd64.deb
|
||||||
ARCH="amd64"
|
|
||||||
if [[ "${{ matrix.os }}" == *-arm ]]; then
|
|
||||||
ARCH="arm64"
|
|
||||||
fi
|
|
||||||
|
|
||||||
mv gopeed-*-linux.AppImage Gopeed-v${VERSION}-linux-${ARCH}.AppImage
|
|
||||||
mv gopeed-*-linux.deb Gopeed-v${VERSION}-linux-${ARCH}.deb
|
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: shogo82148/actions-upload-release-asset@v1
|
uses: shogo82148/actions-upload-release-asset@v1
|
||||||
with:
|
with:
|
||||||
@@ -328,8 +280,7 @@ jobs:
|
|||||||
VERSION: ${{ needs.get-release.outputs.version }}
|
VERSION: ${{ needs.get-release.outputs.version }}
|
||||||
run: |
|
run: |
|
||||||
go build -tags nosqlite -ldflags="-w -s -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION" -buildmode=c-shared -o ui/flutter/linux/bundle/lib/libgopeed.so github.com/GopeedLab/gopeed/bind/desktop
|
go build -tags nosqlite -ldflags="-w -s -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION" -buildmode=c-shared -o ui/flutter/linux/bundle/lib/libgopeed.so github.com/GopeedLab/gopeed/bind/desktop
|
||||||
go build -ldflags="-w -s" -o ui/flutter/assets/exec/host github.com/GopeedLab/gopeed/cmd/host
|
go build -ldflags="-w -s" -o ui/flutter/assets/host/host github.com/GopeedLab/gopeed/cmd/host
|
||||||
go build -ldflags="-w -s" -o ui/flutter/assets/exec/updater github.com/GopeedLab/gopeed/cmd/updater
|
|
||||||
cd ui/flutter
|
cd ui/flutter
|
||||||
|
|
||||||
sudo snap install snapcraft --classic
|
sudo snap install snapcraft --classic
|
||||||
@@ -406,7 +357,7 @@ jobs:
|
|||||||
set +e
|
set +e
|
||||||
dart pub get
|
dart pub get
|
||||||
set -eux
|
set -eux
|
||||||
flutter build linux --dart-define="UPDATE_CHANNEL=linuxSnap"
|
flutter build linux --release -v
|
||||||
mkdir -p \$CRAFT_PART_INSTALL/bin/
|
mkdir -p \$CRAFT_PART_INSTALL/bin/
|
||||||
cp -r build/linux/*/release/bundle/* \$CRAFT_PART_INSTALL/bin/
|
cp -r build/linux/*/release/bundle/* \$CRAFT_PART_INSTALL/bin/
|
||||||
gpu-2404:
|
gpu-2404:
|
||||||
@@ -471,7 +422,7 @@ jobs:
|
|||||||
gomobile bind -tags nosqlite -ldflags="-w -s -checklinkname=0 -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION" -o ui/flutter/android/app/libs/libgopeed.aar -target=android -androidapi 21 -javapkg=com.gopeed github.com/GopeedLab/gopeed/bind/mobile
|
gomobile bind -tags nosqlite -ldflags="-w -s -checklinkname=0 -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION" -o ui/flutter/android/app/libs/libgopeed.aar -target=android -androidapi 21 -javapkg=com.gopeed github.com/GopeedLab/gopeed/bind/mobile
|
||||||
cd ui/flutter
|
cd ui/flutter
|
||||||
echo $APK_KEYSTORE | base64 -di > android/app/upload-keystore.jks
|
echo $APK_KEYSTORE | base64 -di > android/app/upload-keystore.jks
|
||||||
flutter build apk --dart-define="UPDATE_CHANNEL=androidApk"
|
flutter build apk
|
||||||
mkdir dist
|
mkdir dist
|
||||||
cp build/app/outputs/flutter-apk/app-release.apk dist/Gopeed-v$VERSION-android.apk
|
cp build/app/outputs/flutter-apk/app-release.apk dist/Gopeed-v$VERSION-android.apk
|
||||||
- name: Upload
|
- name: Upload
|
||||||
@@ -501,7 +452,7 @@ jobs:
|
|||||||
gomobile init
|
gomobile init
|
||||||
gomobile bind -tags nosqlite -ldflags="-w -s -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION" -o ui/flutter/ios/Frameworks/Libgopeed.xcframework -target=ios github.com/GopeedLab/gopeed/bind/mobile
|
gomobile bind -tags nosqlite -ldflags="-w -s -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION" -o ui/flutter/ios/Frameworks/Libgopeed.xcframework -target=ios github.com/GopeedLab/gopeed/bind/mobile
|
||||||
cd ui/flutter
|
cd ui/flutter
|
||||||
flutter build ios --no-codesign --dart-define="UPDATE_CHANNEL=iosIpa"
|
flutter build ios --no-codesign
|
||||||
mkdir Payload
|
mkdir Payload
|
||||||
cp -r build/ios/iphoneos/Runner.app Payload
|
cp -r build/ios/iphoneos/Runner.app Payload
|
||||||
zip -r -y Payload.zip Payload/Runner.app
|
zip -r -y Payload.zip Payload/Runner.app
|
||||||
@@ -575,7 +526,7 @@ jobs:
|
|||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: "3.8.18"
|
python-version: "3.8.18"
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: web-dist
|
name: web-dist
|
||||||
path: dist/zip/
|
path: dist/zip/
|
||||||
@@ -647,7 +598,7 @@ jobs:
|
|||||||
- name: Build flutter web
|
- name: Build flutter web
|
||||||
run: |
|
run: |
|
||||||
cd ui/flutter
|
cd ui/flutter
|
||||||
flutter build web --no-web-resources-cdn --dart-define="UPDATE_CHANNEL=docker"
|
flutter build web --no-web-resources-cdn
|
||||||
cd ../../
|
cd ../../
|
||||||
rm -rf cmd/web/dist
|
rm -rf cmd/web/dist
|
||||||
cp -r ui/flutter/build/web cmd/web/dist
|
cp -r ui/flutter/build/web cmd/web/dist
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ windows-latest, macos-latest, ubuntu-22.04, ubuntu-22.04-arm ]
|
os: [ windows-latest, macos-latest, ubuntu-22.04 ]
|
||||||
needs: [ test ]
|
needs: [ test ]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@@ -73,7 +73,6 @@ jobs:
|
|||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||||
channel: master
|
|
||||||
- if: runner.os == 'Windows'
|
- if: runner.os == 'Windows'
|
||||||
run: |
|
run: |
|
||||||
go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/windows/libgopeed.dll github.com/GopeedLab/gopeed/bind/desktop
|
go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/windows/libgopeed.dll github.com/GopeedLab/gopeed/bind/desktop
|
||||||
@@ -165,4 +164,4 @@ jobs:
|
|||||||
cd ../../
|
cd ../../
|
||||||
rm -rf cmd/web/dist
|
rm -rf cmd/web/dist
|
||||||
cp -r ui/flutter/build/web cmd/web/dist
|
cp -r ui/flutter/build/web cmd/web/dist
|
||||||
docker build -t gopeed .
|
docker build -t gopeed .
|
||||||
@@ -13,132 +13,94 @@
|
|||||||
|
|
||||||
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md) | [Tiếng Việt](/README_vi-VN.md)
|
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md) | [Tiếng Việt](/README_vi-VN.md)
|
||||||
|
|
||||||
## 🚀 Introduction
|
## Introduction
|
||||||
|
|
||||||
Gopeed (full name Go Speed), a high-speed downloader developed by `Golang` + `Flutter`, supports (HTTP, BitTorrent, Magnet) protocol, and supports all platforms. In addition to basic download functions, Gopeed is also a highly customizable downloader that supports implementing more features through integration with [APIs](https://docs.gopeed.com/dev-api.html) or installation and development of [extensions](https://docs.gopeed.com/dev-extension.html).
|
Gopeed (full name Go Speed), a high-speed downloader developed by `Golang` + `Flutter`, supports (HTTP, BitTorrent, Magnet) protocol, and supports all platforms. In addition to basic download functions, Gopeed is also a highly customizable downloader that supports implementing more features through integration with [APIs](https://docs.gopeed.com/dev-api.html) or installation and development of [extensions](https://docs.gopeed.com/dev-extension.html).
|
||||||
|
|
||||||
Visit ✈ [Official Website](https://gopeed.com) | 📖 [Official Docs](https://docs.gopeed.com)
|
Visit ✈ [Official Website](https://gopeed.com) | 📖 [Official Docs](https://docs.gopeed.com)
|
||||||
|
|
||||||
## ⬇️ Download
|
## Download
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="2">Windows</th>
|
||||||
|
<th>MacOS</th>
|
||||||
|
<th colspan="4">Linux</th>
|
||||||
|
<th>Android</th>
|
||||||
|
<th>iOS</th>
|
||||||
|
<th>Docker</th>
|
||||||
|
<th colspan="2">Qnap</th>
|
||||||
|
<th colspan="8">Web</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>EXE</code></td>
|
||||||
|
<td><code>Portable</code></td>
|
||||||
|
<td><code>DMG</code></td>
|
||||||
|
<td><code>Flathub</code></td>
|
||||||
|
<td><code>SNAP</code></td>
|
||||||
|
<td><code>DEB</code></td>
|
||||||
|
<td><code>AppImage</code></td>
|
||||||
|
<td><code>APK</code></td>
|
||||||
|
<td><code>IPA</code></td>
|
||||||
|
<td>-</td>
|
||||||
|
<td colspan="2"><code>QPKG</code></td>
|
||||||
|
<td colspan="3"><code>Windows</code></td>
|
||||||
|
<td colspan="2"><code>MacOS</code></td>
|
||||||
|
<td colspan="3"><code>Linux</code></td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td rowspan="2">🪟 Windows</td>
|
|
||||||
<td><code>EXE</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>Portable</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64-portable.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🍎 MacOS</td>
|
|
||||||
<td><code>DMG</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-macos.dmg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="6">🐧 Linux</td>
|
|
||||||
<td><code>Flathub</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://flathub.org/apps/com.gopeed.Gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>SNAP</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://snapcraft.io/gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>DEB</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.deb">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-arm64.deb">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>AppImage</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.AppImage">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-arm64.AppImage">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🤖 Android</td>
|
|
||||||
<td><code>APK</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-android.apk">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>📱 iOS</td>
|
|
||||||
<td><code>IPA</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-ios.ipa">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🐳 Docker</td>
|
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://hub.docker.com/r/liwei2633/gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2">💾 Qnap</td>
|
|
||||||
<td rowspan="2"><code>QPKG</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-amd64.qpkg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-arm64.qpkg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="8">🌐 Web</td>
|
|
||||||
<td rowspan="3"><code>Windows</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-amd64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>amd64</td>
|
||||||
<td>arm64</td>
|
<td>arm64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-arm64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
|
||||||
<td>386</td>
|
<td>386</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-386.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>MacOS</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-amd64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-arm64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="3"><code>Linux</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-amd64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-arm64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>386</td>
|
<td>386</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-386.zip">📥</a></td>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64-portable.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-macos.dmg">Link</a></td>
|
||||||
|
<td><a href="https://flathub.org/apps/com.gopeed.Gopeed">Link</a></td>
|
||||||
|
<td><a href="https://snapcraft.io/gopeed">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.deb">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-x86_64.AppImage">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-android.apk">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-ios.ipa">Link</a></td>
|
||||||
|
<td><a href="https://hub.docker.com/r/liwei2633/gopeed">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-amd64.qpkg">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-arm64.qpkg">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-amd64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-arm64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-386.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-amd64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-arm64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-amd64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-arm64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-386.zip">Link</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
More about installation, please refer to [Installation](https://docs.gopeed.com/install.html)
|
More about installation, please refer to [Installation](https://docs.gopeed.com/install.html)
|
||||||
|
|
||||||
### 🛠️ Command tool
|
### Command tool
|
||||||
|
|
||||||
use `go install`:
|
use `go install`:
|
||||||
|
|
||||||
@@ -146,40 +108,40 @@ use `go install`:
|
|||||||
go install github.com/GopeedLab/gopeed/cmd/gopeed@latest
|
go install github.com/GopeedLab/gopeed/cmd/gopeed@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
## 🔌 Browser Extension
|
## Browser Extension
|
||||||
|
|
||||||
Gopeed also provides a browser extension to take over browser downloads, supporting browsers such as Chrome, Edge, Firefox, etc., please refer to: [https://github.com/GopeedLab/browser-extension](https://github.com/GopeedLab/browser-extension)
|
Gopeed also provides a browser extension to take over browser downloads, supporting browsers such as Chrome, Edge, Firefox, etc., please refer to: [https://github.com/GopeedLab/browser-extension](https://github.com/GopeedLab/browser-extension)
|
||||||
|
|
||||||
## 💝 Donate
|
## Donate
|
||||||
|
|
||||||
If you like this project, please consider [donating](https://docs.gopeed.com/donate.html) to support the development of this project, thank you!
|
If you like this project, please consider [donating](https://docs.gopeed.com/donate.html) to support the development of this project, thank you!
|
||||||
|
|
||||||
## 🖼️ Showcase
|
## Showcase
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 👨💻 Development
|
## Development
|
||||||
|
|
||||||
This project is divided into two parts, the front end uses `flutter`, the back end uses `Golang`, and the two sides communicate through the `http` protocol. On the unix system, `unix socket` is used, and on the windows system, `tcp` protocol is used.
|
This project is divided into two parts, the front end uses `flutter`, the back end uses `Golang`, and the two sides communicate through the `http` protocol. On the unix system, `unix socket` is used, and on the windows system, `tcp` protocol is used.
|
||||||
|
|
||||||
> The front code is located in the `ui/flutter` directory.
|
> The front code is located in the `ui/flutter` directory.
|
||||||
|
|
||||||
### 🌍 Environment
|
### Environment
|
||||||
|
|
||||||
1. Golang 1.23+
|
1. Golang 1.23+
|
||||||
2. Flutter 3.24+
|
2. Flutter 3.24+
|
||||||
|
|
||||||
### 📋 Clone
|
### Clone
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone [email protected]:GopeedLab/gopeed.git
|
git clone [email protected]:GopeedLab/gopeed.git
|
||||||
```
|
```
|
||||||
|
|
||||||
### 🤝 Contributing
|
### Contributing
|
||||||
|
|
||||||
Please refer to [CONTRIBUTING.md](/CONTRIBUTING.md)
|
Please refer to [CONTRIBUTING.md](/CONTRIBUTING.md)
|
||||||
|
|
||||||
### 🏗️ Build
|
### Build
|
||||||
|
|
||||||
#### Desktop
|
#### Desktop
|
||||||
|
|
||||||
@@ -252,18 +214,18 @@ cp -r ui/flutter/build/web cmd/web/dist
|
|||||||
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web
|
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web
|
||||||
```
|
```
|
||||||
|
|
||||||
## ❤️ Credits
|
## Credits
|
||||||
|
|
||||||
### 👥 Contributors
|
### Contributors
|
||||||
|
|
||||||
<a href="https://github.com/GopeedLab/gopeed/graphs/contributors">
|
<a href="https://github.com/GopeedLab/gopeed/graphs/contributors">
|
||||||
<img src="https://contrib.rocks/image?repo=GopeedLab/gopeed" />
|
<img src="https://contrib.rocks/image?repo=GopeedLab/gopeed" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
### 🏢 JetBrains
|
### JetBrains
|
||||||
|
|
||||||
[](https://www.jetbrains.com/?from=gopeed)
|
[](https://www.jetbrains.com/?from=gopeed)
|
||||||
|
|
||||||
## 📄 License
|
## License
|
||||||
|
|
||||||
[GPLv3](LICENSE)
|
[GPLv3](LICENSE)
|
||||||
+70
-110
@@ -13,163 +13,123 @@
|
|||||||
|
|
||||||
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md) | [Tiếng Việt](/README_vi-VN.md)
|
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md) | [Tiếng Việt](/README_vi-VN.md)
|
||||||
|
|
||||||
## 🚀 はじめに
|
## はじめに
|
||||||
|
|
||||||
Gopeed (正式名 Go Speed) は `Golang` + `Flutter` によって開発された高速ダウンローダーで、(HTTP、BitTorrent、Magnet) プロトコルをサポートし、すべてのプラットフォームをサポートします。基本的なダウンロード機能に加え、[APIs](https://docs.gopeed.com/dev-api.html)との連動や[拡張機能](https://docs.gopeed.com/dev-extension.html)のインストール・開発による追加機能にも対応した、カスタマイズ性の高いダウンローダーです。
|
Gopeed (正式名 Go Speed) は `Golang` + `Flutter` によって開発された高速ダウンローダーで、(HTTP、BitTorrent、Magnet) プロトコルをサポートし、すべてのプラットフォームをサポートします。基本的なダウンロード機能に加え、[APIs](https://docs.gopeed.com/dev-api.html)との連動や[拡張機能](https://docs.gopeed.com/dev-extension.html)のインストール・開発による追加機能にも対応した、カスタマイズ性の高いダウンローダーです。
|
||||||
|
|
||||||
見て下さい ✈ [公式ウェブサイト](https://gopeed.com) | 📖 [開発ドキュメント](https://docs.gopeed.com)
|
見て下さい ✈ [公式ウェブサイト](https://gopeed.com) | 📖 [開発ドキュメント](https://docs.gopeed.com)
|
||||||
|
|
||||||
## ⬇️ インストール
|
## インストール
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="2">Windows</th>
|
||||||
|
<th>MacOS</th>
|
||||||
|
<th colspan="4">Linux</th>
|
||||||
|
<th>Android</th>
|
||||||
|
<th>iOS</th>
|
||||||
|
<th>Docker</th>
|
||||||
|
<th colspan="2">Qnap</th>
|
||||||
|
<th colspan="8">Web</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>EXE</code></td>
|
||||||
|
<td><code>Portable</code></td>
|
||||||
|
<td><code>DMG</code></td>
|
||||||
|
<td><code>Flathub</code></td>
|
||||||
|
<td><code>SNAP</code></td>
|
||||||
|
<td><code>DEB</code></td>
|
||||||
|
<td><code>AppImage</code></td>
|
||||||
|
<td><code>APK</code></td>
|
||||||
|
<td><code>IPA</code></td>
|
||||||
|
<td>-</td>
|
||||||
|
<td colspan="2"><code>QPKG</code></td>
|
||||||
|
<td colspan="3"><code>Windows</code></td>
|
||||||
|
<td colspan="2"><code>MacOS</code></td>
|
||||||
|
<td colspan="3"><code>Linux</code></td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td rowspan="2">🪟 Windows</td>
|
|
||||||
<td><code>EXE</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>Portable</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64-portable.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🍎 MacOS</td>
|
|
||||||
<td><code>DMG</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-macos.dmg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="6">🐧 Linux</td>
|
|
||||||
<td><code>Flathub</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://flathub.org/apps/com.gopeed.Gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>SNAP</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://snapcraft.io/gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>DEB</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.deb">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-arm64.deb">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>AppImage</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.AppImage">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-arm64.AppImage">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🤖 Android</td>
|
|
||||||
<td><code>APK</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-android.apk">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>📱 iOS</td>
|
|
||||||
<td><code>IPA</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-ios.ipa">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🐳 Docker</td>
|
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://hub.docker.com/r/liwei2633/gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2">💾 Qnap</td>
|
|
||||||
<td rowspan="2"><code>QPKG</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-amd64.qpkg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-arm64.qpkg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="8">🌐 Web</td>
|
|
||||||
<td rowspan="3"><code>Windows</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-amd64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>amd64</td>
|
||||||
<td>arm64</td>
|
<td>arm64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-arm64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
|
||||||
<td>386</td>
|
<td>386</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-386.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>MacOS</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-amd64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-arm64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="3"><code>Linux</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-amd64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-arm64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>386</td>
|
<td>386</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-386.zip">📥</a></td>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64-portable.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-macos.dmg">Link</a></td>
|
||||||
|
<td><a href="https://flathub.org/apps/com.gopeed.Gopeed">Link</a></td>
|
||||||
|
<td><a href="https://snapcraft.io/gopeed">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.deb">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-x86_64.AppImage">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-android.apk">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-ios.ipa">Link</a></td>
|
||||||
|
<td><a href="https://hub.docker.com/r/liwei2633/gopeed">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-amd64.qpkg">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-arm64.qpkg">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-amd64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-arm64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-386.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-amd64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-arm64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-amd64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-arm64.zip">Link</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-386.zip">Link</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
インストールについての詳細は、[インストール](https://docs.gopeed.com/install.html)を参照してください。
|
インストールについての詳細は、[インストール](https://docs.gopeed.com/install.html)を参照してください。
|
||||||
|
|
||||||
### 🛠️ コマンドツール
|
## 寄付
|
||||||
|
|
||||||
## 💝 寄付
|
|
||||||
|
|
||||||
もしこのプロジェクトがお気に召しましたら、このプロジェクトの発展を支援するために[寄付](https://docs.gopeed.com/donate.html)をご検討ください!
|
もしこのプロジェクトがお気に召しましたら、このプロジェクトの発展を支援するために[寄付](https://docs.gopeed.com/donate.html)をご検討ください!
|
||||||
|
|
||||||
## 🖼️ ショーケース
|
## ショーケース
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 👨💻 開発
|
## 開発
|
||||||
|
|
||||||
このプロジェクトは二つの部分に分かれており、フロントエンドでは `flutter` を、バックエンドでは `Golang` を使用し、両者は `http` プロトコルで通信する。ユニックスシステムでは `unix socket` を、ウィンドウズシステムでは `tcp` プロトコルを使用します。
|
このプロジェクトは二つの部分に分かれており、フロントエンドでは `flutter` を、バックエンドでは `Golang` を使用し、両者は `http` プロトコルで通信する。ユニックスシステムでは `unix socket` を、ウィンドウズシステムでは `tcp` プロトコルを使用します。
|
||||||
|
|
||||||
> フロントコードは `ui/flutter` ディレクトリにあります。
|
> フロントコードは `ui/flutter` ディレクトリにあります。
|
||||||
|
|
||||||
### 🌍 環境
|
### 環境
|
||||||
|
|
||||||
1. Go 言語 1.23+
|
1. Go 言語 1.23+
|
||||||
2. Flutter 3.24+
|
2. Flutter 3.24+
|
||||||
|
|
||||||
### 📋 クローン
|
### クローン
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone [email protected]:GopeedLab/gopeed.git
|
git clone [email protected]:GopeedLab/gopeed.git
|
||||||
```
|
```
|
||||||
|
|
||||||
### 🤝 コントリビュート
|
### コントリビュート
|
||||||
|
|
||||||
[CONTRIBUTING.md](/CONTRIBUTING_ja-JP.md) をご参照ください
|
[CONTRIBUTING.md](/CONTRIBUTING_ja-JP.md) をご参照ください
|
||||||
|
|
||||||
### 🏗️ ビルド
|
### ビルド
|
||||||
|
|
||||||
#### デスクトップ
|
#### デスクトップ
|
||||||
|
|
||||||
@@ -242,7 +202,7 @@ cp -r ui/flutter/build/web cmd/web/dist
|
|||||||
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web
|
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web
|
||||||
```
|
```
|
||||||
|
|
||||||
## ❤️ 感謝
|
## 感謝
|
||||||
|
|
||||||
### コントリビューター
|
### コントリビューター
|
||||||
|
|
||||||
|
|||||||
+71
-109
@@ -13,132 +13,94 @@
|
|||||||
|
|
||||||
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md) | [Tiếng Việt](/README_vi-VN.md)
|
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md) | [Tiếng Việt](/README_vi-VN.md)
|
||||||
|
|
||||||
## 🚀 Giới thiệu
|
## Giới thiệu
|
||||||
|
|
||||||
Gopeed (tên đầy đủ Go Speed), một công cụ tải xuống tốc độ cao được phát triển bởi `Golang` + `Flutter`, hỗ trợ giao thức (HTTP, BitTorrent, Magnet) và hỗ trợ tất cả các nền tảng. Ngoài các chức năng tải xuống cơ bản, Gopeed còn là một công cụ tải xuống có thể tùy chỉnh cao cho phép triển khai thêm tính năng thông qua việc tích hợp với [APIs](https://docs.gopeed.com/dev-api.html) hoặc cài đặt và phát triển các [tiện ích mở rộng](https://docs.gopeed.com/dev-extension.html).
|
Gopeed (tên đầy đủ Go Speed), một công cụ tải xuống tốc độ cao được phát triển bởi `Golang` + `Flutter`, hỗ trợ giao thức (HTTP, BitTorrent, Magnet) và hỗ trợ tất cả các nền tảng. Ngoài các chức năng tải xuống cơ bản, Gopeed còn là một công cụ tải xuống có thể tùy chỉnh cao cho phép triển khai thêm tính năng thông qua việc tích hợp với [APIs](https://docs.gopeed.com/dev-api.html) hoặc cài đặt và phát triển các [tiện ích mở rộng](https://docs.gopeed.com/dev-extension.html).
|
||||||
|
|
||||||
Truy cập ✈ [Trang web chính thức](https://gopeed.com) | 📖 [Tài liệu chính thức](https://docs.gopeed.com)
|
Truy cập ✈ [Trang web chính thức](https://gopeed.com) | 📖 [Tài liệu chính thức](https://docs.gopeed.com)
|
||||||
|
|
||||||
## ⬇️ Tải về
|
## Tải về
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="2">Windows</th>
|
||||||
|
<th>MacOS</th>
|
||||||
|
<th colspan="4">Linux</th>
|
||||||
|
<th>Android</th>
|
||||||
|
<th>iOS</th>
|
||||||
|
<th>Docker</th>
|
||||||
|
<th colspan="2">Qnap</th>
|
||||||
|
<th colspan="8">Web</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>EXE</code></td>
|
||||||
|
<td><code>Portable</code></td>
|
||||||
|
<td><code>DMG</code></td>
|
||||||
|
<td><code>Flathub</code></td>
|
||||||
|
<td><code>SNAP</code></td>
|
||||||
|
<td><code>DEB</code></td>
|
||||||
|
<td><code>AppImage</code></td>
|
||||||
|
<td><code>APK</code></td>
|
||||||
|
<td><code>IPA</code></td>
|
||||||
|
<td>-</td>
|
||||||
|
<td colspan="2"><code>QPKG</code></td>
|
||||||
|
<td colspan="3"><code>Windows</code></td>
|
||||||
|
<td colspan="2"><code>MacOS</code></td>
|
||||||
|
<td colspan="3"><code>Linux</code></td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td rowspan="2">🪟 Windows</td>
|
|
||||||
<td><code>EXE</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>Portable</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64-portable.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🍎 MacOS</td>
|
|
||||||
<td><code>DMG</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-macos.dmg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="6">🐧 Linux</td>
|
|
||||||
<td><code>Flathub</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://flathub.org/apps/com.gopeed.Gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>SNAP</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://snapcraft.io/gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>DEB</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.deb">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-arm64.deb">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>AppImage</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.AppImage">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-arm64.AppImage">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🤖 Android</td>
|
|
||||||
<td><code>APK</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-android.apk">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>📱 iOS</td>
|
|
||||||
<td><code>IPA</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-ios.ipa">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🐳 Docker</td>
|
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://hub.docker.com/r/liwei2633/gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2">💾 Qnap</td>
|
|
||||||
<td rowspan="2"><code>QPKG</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-amd64.qpkg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-arm64.qpkg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="8">🌐 Web</td>
|
|
||||||
<td rowspan="3"><code>Windows</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-amd64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>amd64</td>
|
||||||
<td>arm64</td>
|
<td>arm64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-arm64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
|
||||||
<td>386</td>
|
<td>386</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-386.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>MacOS</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-amd64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-arm64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="3"><code>Linux</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-amd64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-arm64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>386</td>
|
<td>386</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-386.zip">📥</a></td>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64.zip">Liên kết</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64-portable.zip">Liên kết</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-macos.dmg">Liên kết</a></td>
|
||||||
|
<td><a href="https://flathub.org/apps/com.gopeed.Gopeed">Liên kết</a></td>
|
||||||
|
<td><a href="https://snapcraft.io/gopeed">Liên kết</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.deb">Liên kết</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-x86_64.AppImage">Liên kết</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-android.apk">Liên kết</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-ios.ipa">Liên kết</a></td>
|
||||||
|
<td><a href="https://hub.docker.com/r/liwei2633/gopeed">Liên kết</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-amd64.qpkg">Liên kết</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-arm64.qpkg">Liên kết</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-amd64.zip">Liên kết</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-arm64.zip">Liên kết</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-386.zip">Liên kết</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-amd64.zip">Liên kết</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-arm64.zip">Liên kết</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-amd64.zip">Liên kết</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-arm64.zip">Liên kết</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-386.zip">Liên kết</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
Thêm thông tin về cài đặt, vui lòng tham khảo [Cài đặt](https://docs.gopeed.com/install.html)
|
Thêm thông tin về cài đặt, vui lòng tham khảo [Cài đặt](https://docs.gopeed.com/install.html)
|
||||||
|
|
||||||
### 🛠️ Công cụ lệnh
|
### Command tool
|
||||||
|
|
||||||
Sử dụng `go install`:
|
Sử dụng `go install`:
|
||||||
|
|
||||||
@@ -146,36 +108,36 @@ Sử dụng `go install`:
|
|||||||
go install github.com/GopeedLab/gopeed/cmd/gopeed@latest
|
go install github.com/GopeedLab/gopeed/cmd/gopeed@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
## 💝 Quyên góp
|
## Quyên góp
|
||||||
|
|
||||||
Nếu bạn thích dự án này, xin vui lòng xem xét [quyên góp](https://docs.gopeed.com/donate.html) để hỗ trợ phát triển dự án này, cảm ơn bạn!
|
Nếu bạn thích dự án này, xin vui lòng xem xét [quyên góp](https://docs.gopeed.com/donate.html) để hỗ trợ phát triển dự án này, cảm ơn bạn!
|
||||||
|
|
||||||
## 🖼️ Trưng bày
|
## Trưng bày
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 👨💻 Development
|
## Development
|
||||||
|
|
||||||
Dự án này được chia thành hai phần, phần giao diện sử dụng `flutter`, phần backend sử dụng `Golang`, và hai phía giao tiếp thông qua giao thức `http`. Trên hệ thống unix, sử dụng `unix socket`, và trên hệ thống windows, sử dụng giao thức `tcp`.
|
Dự án này được chia thành hai phần, phần giao diện sử dụng `flutter`, phần backend sử dụng `Golang`, và hai phía giao tiếp thông qua giao thức `http`. Trên hệ thống unix, sử dụng `unix socket`, và trên hệ thống windows, sử dụng giao thức `tcp`.
|
||||||
|
|
||||||
> Mã giao diện nằm trong thư mục `ui/flutter`.
|
> Mã giao diện nằm trong thư mục `ui/flutter`.
|
||||||
|
|
||||||
### 🌍 Environment
|
### Environment
|
||||||
|
|
||||||
1. Golang 1.23+
|
1. Golang 1.23+
|
||||||
2. Flutter 3.24+
|
2. Flutter 3.24+
|
||||||
|
|
||||||
### 📋 Clone
|
### Clone
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone [email protected]:GopeedLab/gopeed.git
|
git clone [email protected]:GopeedLab/gopeed.git
|
||||||
```
|
```
|
||||||
|
|
||||||
### 🤝 Đóng góp
|
### Đóng góp
|
||||||
|
|
||||||
Vui lòng tham khảo [CONTRIBUTING_vi-VN.md](/CONTRIBUTING_vi-VN.md)
|
Vui lòng tham khảo [CONTRIBUTING_vi-VN.md](/CONTRIBUTING_vi-VN.md)
|
||||||
|
|
||||||
### 🏗️ Xây dựng
|
### Xây dựng
|
||||||
|
|
||||||
#### Desktop
|
#### Desktop
|
||||||
|
|
||||||
@@ -248,7 +210,7 @@ cp -r ui/flutter/build/web cmd/web/dist
|
|||||||
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web
|
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web
|
||||||
```
|
```
|
||||||
|
|
||||||
## ❤️ Tín dụng
|
## Tín dụng
|
||||||
|
|
||||||
### Người đóng góp
|
### Người đóng góp
|
||||||
|
|
||||||
|
|||||||
+72
-110
@@ -13,132 +13,94 @@
|
|||||||
|
|
||||||
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md) | [Tiếng Việt](/README_vi-VN.md)
|
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md) | [Tiếng Việt](/README_vi-VN.md)
|
||||||
|
|
||||||
## 🚀 介绍
|
## 介绍
|
||||||
|
|
||||||
Gopeed(全称 Go Speed),直译过来中文名叫做`够快下载器`(不是狗屁下载器!),是一款由`Golang`+`Flutter`开发的高速下载器,支持(HTTP、BitTorrent、Magnet)协议下载,并且支持全平台使用。除了基本的下载功能外,Gopeed 还是一款高度可定制化的下载器,支持通过对接[APIs](https://docs.gopeed.com/zh/dev-api.html)或者安装和开发[扩展](https://docs.gopeed.com/zh/dev-extension.html)来实现更多的功能。
|
Gopeed(全称 Go Speed),直译过来中文名叫做`够快下载器`(不是狗屁下载器!),是一款由`Golang`+`Flutter`开发的高速下载器,支持(HTTP、BitTorrent、Magnet)协议下载,并且支持全平台使用。除了基本的下载功能外,Gopeed 还是一款高度可定制化的下载器,支持通过对接[APIs](https://docs.gopeed.com/zh/dev-api.html)或者安装和开发[扩展](https://docs.gopeed.com/zh/dev-extension.html)来实现更多的功能。
|
||||||
|
|
||||||
访问 ✈ [官方网站](https://gopeed.com/zh-CN) | 📖 [官方文档](https://docs.gopeed.com/zh/)
|
访问 ✈ [官方网站](https://gopeed.com/zh-CN) | 📖 [官方文档](https://docs.gopeed.com/zh/)
|
||||||
|
|
||||||
## ⬇️ 下载
|
## 下载
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="2">Windows</th>
|
||||||
|
<th>MacOS</th>
|
||||||
|
<th colspan="4">Linux</th>
|
||||||
|
<th>Android</th>
|
||||||
|
<th>iOS</th>
|
||||||
|
<th>Docker</th>
|
||||||
|
<th colspan="2">Qnap</th>
|
||||||
|
<th colspan="8">Web</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>EXE</code></td>
|
||||||
|
<td><code>Portable</code></td>
|
||||||
|
<td><code>DMG</code></td>
|
||||||
|
<td><code>Flathub</code></td>
|
||||||
|
<td><code>SNAP</code></td>
|
||||||
|
<td><code>DEB</code></td>
|
||||||
|
<td><code>AppImage</code></td>
|
||||||
|
<td><code>APK</code></td>
|
||||||
|
<td><code>IPA</code></td>
|
||||||
|
<td>-</td>
|
||||||
|
<td colspan="2"><code>QPKG</code></td>
|
||||||
|
<td colspan="3"><code>Windows</code></td>
|
||||||
|
<td colspan="2"><code>MacOS</code></td>
|
||||||
|
<td colspan="3"><code>Linux</code></td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td rowspan="2">🪟 Windows</td>
|
|
||||||
<td><code>EXE</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>Portable</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64-portable.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🍎 MacOS</td>
|
|
||||||
<td><code>DMG</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-macos.dmg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="6">🐧 Linux</td>
|
|
||||||
<td><code>Flathub</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://flathub.org/apps/com.gopeed.Gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>SNAP</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://snapcraft.io/gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>DEB</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.deb">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-arm64.deb">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>AppImage</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.AppImage">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-arm64.AppImage">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🤖 Android</td>
|
|
||||||
<td><code>APK</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-android.apk">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>📱 iOS</td>
|
|
||||||
<td><code>IPA</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-ios.ipa">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🐳 Docker</td>
|
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://hub.docker.com/r/liwei2633/gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2">💾 Qnap</td>
|
|
||||||
<td rowspan="2"><code>QPKG</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-amd64.qpkg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-arm64.qpkg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="8">🌐 Web</td>
|
|
||||||
<td rowspan="3"><code>Windows</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-amd64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>amd64</td>
|
||||||
<td>arm64</td>
|
<td>arm64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-arm64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
|
||||||
<td>386</td>
|
<td>386</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-386.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>MacOS</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-amd64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-arm64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="3"><code>Linux</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-amd64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-arm64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>386</td>
|
<td>386</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-386.zip">📥</a></td>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64-portable.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-macos.dmg">前往</a></td>
|
||||||
|
<td><a href="https://flathub.org/apps/com.gopeed.Gopeed">前往</a></td>
|
||||||
|
<td><a href="https://snapcraft.io/gopeed">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.deb">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-x86_64.AppImage">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-android.apk">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-ios.ipa">前往</a></td>
|
||||||
|
<td><a href="https://hub.docker.com/r/liwei2633/gopeed">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-amd64.qpkg">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-arm64.qpkg">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-amd64.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-arm64.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-386.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-amd64.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-arm64.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-amd64.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-arm64.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-386.zip">前往</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
更多关于安装的内容请参考[安装文档](https://docs.gopeed.com/zh/install.html)
|
更多关于安装的内容请参考[安装文档](https://docs.gopeed.com/zh/install.html)
|
||||||
|
|
||||||
### 🛠️ 命令行工具
|
### 命令行工具
|
||||||
|
|
||||||
使用`go install`安装:
|
使用`go install`安装:
|
||||||
|
|
||||||
@@ -146,40 +108,40 @@ Gopeed(全称 Go Speed),直译过来中文名叫做`够快下载器`(不
|
|||||||
go install github.com/GopeedLab/gopeed/cmd/gopeed@latest
|
go install github.com/GopeedLab/gopeed/cmd/gopeed@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
## 🔌 浏览器扩展
|
## 浏览器扩展
|
||||||
|
|
||||||
Gopeed 还提供了浏览器扩展用于接管浏览器下载,支持 Chrome、Edge、Firefox 等浏览器,具体请参考:[https://github.com/GopeedLab/browser-extension](https://github.com/GopeedLab/browser-extension)
|
Gopeed 还提供了浏览器扩展用于接管浏览器下载,支持 Chrome、Edge、Firefox 等浏览器,具体请参考:[https://github.com/GopeedLab/browser-extension](https://github.com/GopeedLab/browser-extension)
|
||||||
|
|
||||||
## 💝 赞助
|
## 赞助
|
||||||
|
|
||||||
如果觉得项目对你有帮助,请考虑[赞助](https://docs.gopeed.com/zh/donate)以支持这个项目的发展,非常感谢!
|
如果觉得项目对你有帮助,请考虑[赞助](https://docs.gopeed.com/zh/donate)以支持这个项目的发展,非常感谢!
|
||||||
|
|
||||||
## 🖼️ 界面展示
|
## 界面展示
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 👨💻 开发
|
## 开发
|
||||||
|
|
||||||
本项目分为前端和后端两个部分,前端使用`flutter`,后端使用`Golang`,两边通过`http`协议进行通讯,在 unix 系统下,使用的是`unix socket`,在 windows 系统下,使用的是`tcp`协议。
|
本项目分为前端和后端两个部分,前端使用`flutter`,后端使用`Golang`,两边通过`http`协议进行通讯,在 unix 系统下,使用的是`unix socket`,在 windows 系统下,使用的是`tcp`协议。
|
||||||
|
|
||||||
> 前端代码位于`ui/flutter`目录下。
|
> 前端代码位于`ui/flutter`目录下。
|
||||||
|
|
||||||
### 🌍 环境要求
|
### 环境要求
|
||||||
|
|
||||||
1. Golang 1.23+
|
1. Golang 1.23+
|
||||||
2. Flutter 3.24+
|
2. Flutter 3.24+
|
||||||
|
|
||||||
### 📋 克隆项目
|
### 克隆项目
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone [email protected]:GopeedLab/gopeed.git
|
git clone [email protected]:GopeedLab/gopeed.git
|
||||||
```
|
```
|
||||||
|
|
||||||
### 🤝 贡献代码
|
### 贡献代码
|
||||||
|
|
||||||
请参考[贡献指南](CONTRIBUTING_zh-CN.md)
|
请参考[贡献指南](CONTRIBUTING_zh-CN.md)
|
||||||
|
|
||||||
### 🏗️ 编译
|
### 编译
|
||||||
|
|
||||||
#### 桌面端
|
#### 桌面端
|
||||||
|
|
||||||
@@ -252,7 +214,7 @@ cp -r ui/flutter/build/web cmd/web/dist
|
|||||||
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web
|
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web
|
||||||
```
|
```
|
||||||
|
|
||||||
## ❤️ 感谢
|
## 感谢
|
||||||
|
|
||||||
### 贡献者
|
### 贡献者
|
||||||
|
|
||||||
|
|||||||
+71
-109
@@ -13,132 +13,94 @@
|
|||||||
|
|
||||||
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md) | [Tiếng Việt](/README_vi-VN.md)
|
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md) | [Tiếng Việt](/README_vi-VN.md)
|
||||||
|
|
||||||
## 🚀 簡介
|
## 簡介
|
||||||
|
|
||||||
Gopeed(全稱 Go Speed),是一款使用`Golang`+`Flutter`編寫的高速下載軟體,支援(HTTP、BitTorrent、Magnet)協定,同時支援所有的平台。
|
Gopeed(全稱 Go Speed),是一款使用`Golang`+`Flutter`編寫的高速下載軟體,支援(HTTP、BitTorrent、Magnet)協定,同時支援所有的平台。
|
||||||
|
|
||||||
前往 ✈ [主頁](https://gopeed.com/zh-CN) | 📖 [文檔](https://docs.gopeed.com/zh/)
|
前往 ✈ [主頁](https://gopeed.com/zh-CN) | 📖 [文檔](https://docs.gopeed.com/zh/)
|
||||||
|
|
||||||
## ⬇️ 下載
|
## 下載
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="2">Windows</th>
|
||||||
|
<th>MacOS</th>
|
||||||
|
<th colspan="4">Linux</th>
|
||||||
|
<th>Android</th>
|
||||||
|
<th>iOS</th>
|
||||||
|
<th>Docker</th>
|
||||||
|
<th colspan="2">Qnap</th>
|
||||||
|
<th colspan="8">Web</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>EXE</code></td>
|
||||||
|
<td><code>Portable</code></td>
|
||||||
|
<td><code>DMG</code></td>
|
||||||
|
<td><code>Flathub</code></td>
|
||||||
|
<td><code>SNAP</code></td>
|
||||||
|
<td><code>DEB</code></td>
|
||||||
|
<td><code>AppImage</code></td>
|
||||||
|
<td><code>APK</code></td>
|
||||||
|
<td><code>IPA</code></td>
|
||||||
|
<td>-</td>
|
||||||
|
<td colspan="2"><code>QPKG</code></td>
|
||||||
|
<td colspan="3"><code>Windows</code></td>
|
||||||
|
<td colspan="2"><code>MacOS</code></td>
|
||||||
|
<td colspan="3"><code>Linux</code></td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td rowspan="2">🪟 Windows</td>
|
|
||||||
<td><code>EXE</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>Portable</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64-portable.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🍎 MacOS</td>
|
|
||||||
<td><code>DMG</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-macos.dmg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="6">🐧 Linux</td>
|
|
||||||
<td><code>Flathub</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://flathub.org/apps/com.gopeed.Gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>SNAP</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://snapcraft.io/gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>DEB</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.deb">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-arm64.deb">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>AppImage</code></td>
|
|
||||||
<td>amd64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.AppImage">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-arm64.AppImage">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🤖 Android</td>
|
|
||||||
<td><code>APK</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-android.apk">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>📱 iOS</td>
|
|
||||||
<td><code>IPA</code></td>
|
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-ios.ipa">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>🐳 Docker</td>
|
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
<td>universal</td>
|
|
||||||
<td><a href="https://hub.docker.com/r/liwei2633/gopeed">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2">💾 Qnap</td>
|
|
||||||
<td rowspan="2"><code>QPKG</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-amd64.qpkg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-arm64.qpkg">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="8">🌐 Web</td>
|
|
||||||
<td rowspan="3"><code>Windows</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-amd64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>amd64</td>
|
||||||
<td>arm64</td>
|
<td>arm64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-arm64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
|
||||||
<td>386</td>
|
<td>386</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-386.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2"><code>MacOS</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-amd64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-arm64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="3"><code>Linux</code></td>
|
|
||||||
<td>amd64</td>
|
<td>amd64</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-amd64.zip">📥</a></td>
|
<td>amd64</td>
|
||||||
</tr>
|
<td>amd64</td>
|
||||||
<tr>
|
|
||||||
<td>arm64</td>
|
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-arm64.zip">📥</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>386</td>
|
<td>386</td>
|
||||||
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-386.zip">📥</a></td>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64-portable.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-macos.dmg">前往</a></td>
|
||||||
|
<td><a href="https://flathub.org/apps/com.gopeed.Gopeed">前往</a></td>
|
||||||
|
<td><a href="https://snapcraft.io/gopeed">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.deb">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-x86_64.AppImage">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-android.apk">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-ios.ipa">前往</a></td>
|
||||||
|
<td><a href="https://hub.docker.com/r/liwei2633/gopeed">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-amd64.qpkg">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-$version-qnap-arm64.qpkg">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-amd64.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-arm64.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-windows-386.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-amd64.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-macos-arm64.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-amd64.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-arm64.zip">前往</a></td>
|
||||||
|
<td><a href="https://gopeed.com/api/download?tpl=gopeed-web-$version-linux-386.zip">前往</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
更多關於安裝的內容請參考[安裝文檔](https://docs.gopeed.com/zh/install.html)
|
更多關於安裝的內容請參考[安裝文檔](https://docs.gopeed.com/zh/install.html)
|
||||||
|
|
||||||
### 🛠️ 使用 CLI 安裝
|
### 使用 CLI 安裝
|
||||||
|
|
||||||
使用`go install`安裝:
|
使用`go install`安裝:
|
||||||
|
|
||||||
@@ -146,36 +108,36 @@ Gopeed(全稱 Go Speed),是一款使用`Golang`+`Flutter`編寫的高速
|
|||||||
go install github.com/GopeedLab/gopeed/cmd/gopeed@latest
|
go install github.com/GopeedLab/gopeed/cmd/gopeed@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
## 💝 贊助
|
## 贊助
|
||||||
|
|
||||||
如果你認為該項目對你有所幫助,請考慮[贊助](https://docs.gopeed.com/zh/donate)以支持該項目的持續發展,謝謝!
|
如果你認為該項目對你有所幫助,請考慮[贊助](https://docs.gopeed.com/zh/donate)以支持該項目的持續發展,謝謝!
|
||||||
|
|
||||||
## 🖼️ 軟體介面
|
## 軟體介面
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 👨💻 開發
|
## 開發
|
||||||
|
|
||||||
該項目分為前端與後端,前端使用`flutter`編寫,後端使用`Golang`編寫,兩邊通過`http`協定進行通訊,在 unix 系統下,則使用`unix socket`,在 windows 系統下,則使用`tcp`協定。
|
該項目分為前端與後端,前端使用`flutter`編寫,後端使用`Golang`編寫,兩邊通過`http`協定進行通訊,在 unix 系統下,則使用`unix socket`,在 windows 系統下,則使用`tcp`協定。
|
||||||
|
|
||||||
> 前端代碼位於`ui/flutter`目錄內。
|
> 前端代碼位於`ui/flutter`目錄內。
|
||||||
|
|
||||||
### 🌍 開發環境
|
### 開發環境
|
||||||
|
|
||||||
1. Golang 1.23+
|
1. Golang 1.23+
|
||||||
2. Flutter 3.24+
|
2. Flutter 3.24+
|
||||||
|
|
||||||
### 📋 克隆項目
|
### 克隆項目
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone [email protected]:GopeedLab/gopeed.git
|
git clone [email protected]:GopeedLab/gopeed.git
|
||||||
```
|
```
|
||||||
|
|
||||||
### 🤝 協助開發
|
### 協助開發
|
||||||
|
|
||||||
請參考[協助指南](CONTRIBUTING_zh-TW.md)
|
請參考[協助指南](CONTRIBUTING_zh-TW.md)
|
||||||
|
|
||||||
### 🏗️ 編譯
|
### 編譯
|
||||||
|
|
||||||
#### 桌面端
|
#### 桌面端
|
||||||
|
|
||||||
@@ -248,7 +210,7 @@ cp -r ui/flutter/build/web cmd/web/dist
|
|||||||
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web
|
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web
|
||||||
```
|
```
|
||||||
|
|
||||||
## ❤️ 感謝
|
## 感謝
|
||||||
|
|
||||||
### 貢獻者
|
### 貢獻者
|
||||||
|
|
||||||
|
|||||||
@@ -55,8 +55,6 @@ var apiMap = map[string]func(params json.RawMessage) (data any, err error){
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// go build -ldflags="-s -w" -o ui/flutter/assets/exec/ github.com/GopeedLab/gopeed/cmd/host
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
for {
|
for {
|
||||||
// Read message length (first 4 bytes)
|
// Read message length (first 4 bytes)
|
||||||
|
|||||||
@@ -1,116 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"flag"
|
|
||||||
"fmt"
|
|
||||||
"log"
|
|
||||||
"os"
|
|
||||||
"path/filepath"
|
|
||||||
"syscall"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/pkg/browser"
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
)
|
|
||||||
|
|
||||||
// go build -ldflags="-s -w" -o ui/flutter/assets/exec/ github.com/GopeedLab/gopeed/cmd/updater
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
pid := flag.Int("pid", 0, "PID of the process to update")
|
|
||||||
updateChannel := flag.String("channel", "", "Update channel")
|
|
||||||
packagePath := flag.String("asset", "", "Path to the package asset")
|
|
||||||
logPath := flag.String("log", "", "Log file path")
|
|
||||||
flag.Parse()
|
|
||||||
|
|
||||||
if *pid == 0 {
|
|
||||||
log.Println("Invalid PID")
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
if *updateChannel == "" {
|
|
||||||
log.Println("Invalid update channel")
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
if *logPath != "" {
|
|
||||||
logFile, err := os.OpenFile(*logPath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0666)
|
|
||||||
if err == nil {
|
|
||||||
defer logFile.Close()
|
|
||||||
log.SetOutput(logFile)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
restart bool
|
|
||||||
err error
|
|
||||||
)
|
|
||||||
if restart, err = update(*pid, *updateChannel, *packagePath); err != nil {
|
|
||||||
log.Printf("Update failed: %v\n", err)
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Restart the application
|
|
||||||
if restart {
|
|
||||||
browser.OpenURL("gopeed:///")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete package asset
|
|
||||||
if *packagePath != "" {
|
|
||||||
os.Remove(*packagePath)
|
|
||||||
}
|
|
||||||
|
|
||||||
os.Exit(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
func update(pid int, updateChannel, packagePath string) (restart bool, err error) {
|
|
||||||
killSignalChan := make(chan any, 1)
|
|
||||||
|
|
||||||
go func() {
|
|
||||||
<-killSignalChan
|
|
||||||
|
|
||||||
if err = killProcess(pid); err != nil {
|
|
||||||
log.Printf("Failed to kill process: %v\n", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err = waitForProcessExit(pid); err != nil {
|
|
||||||
log.Printf("Failed to wait for process exit: %v\n", err)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
appDir := filepath.Dir(os.Args[0])
|
|
||||||
log.Printf("Updating process updateChannel=%s packagePath=%s appDir=%s\n", updateChannel, packagePath, appDir)
|
|
||||||
if restart, err = install(killSignalChan, updateChannel, packagePath, appDir); err != nil {
|
|
||||||
return false, errors.Wrap(err, "failed to install package")
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func waitForProcessExit(pid int) error {
|
|
||||||
deadline := time.Now().Add(10 * time.Second)
|
|
||||||
for time.Now().Before(deadline) {
|
|
||||||
process, err := os.FindProcess(pid)
|
|
||||||
if err != nil {
|
|
||||||
// On some systems, error is returned if process doesn't exist
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send null signal to test if process exists
|
|
||||||
err = process.Signal(syscall.Signal(0))
|
|
||||||
if err != nil {
|
|
||||||
// If error occurs, the process no longer exists
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
time.Sleep(100 * time.Millisecond)
|
|
||||||
}
|
|
||||||
return fmt.Errorf("process %d still running after timeout", pid)
|
|
||||||
}
|
|
||||||
|
|
||||||
func killProcess(pid int) error {
|
|
||||||
process, err := os.FindProcess(pid)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return process.Kill()
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
//go:build darwin
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"os/exec"
|
|
||||||
"path/filepath"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
func install(killSignalChan chan<- any, updateChannel, packagePath, destDir string) (bool, error) {
|
|
||||||
return true, installByDmg(killSignalChan, packagePath, destDir)
|
|
||||||
}
|
|
||||||
|
|
||||||
// installByDmg handles macOS dmg package installation
|
|
||||||
func installByDmg(killSignalChan chan<- any, packagePath, destDir string) error {
|
|
||||||
// /Applications/Gopeed.app/Contents/MacOS -> /Applications
|
|
||||||
appPath := getParentDir(getParentDir(getParentDir(destDir)))
|
|
||||||
output, err := exec.Command("hdiutil", "attach", packagePath, "-nobrowse").Output()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
mountPoint := ""
|
|
||||||
for _, line := range strings.Split(string(output), "\n") {
|
|
||||||
if strings.Contains(line, "/Volumes/") {
|
|
||||||
fields := strings.Fields(line)
|
|
||||||
if len(fields) > 2 {
|
|
||||||
mountPoint = fields[len(fields)-1]
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if mountPoint == "" {
|
|
||||||
return fmt.Errorf("failed to get mount point")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Detach the mounted DMG
|
|
||||||
defer exec.Command("hdiutil", "detach", mountPoint, "-quiet").Run()
|
|
||||||
|
|
||||||
matches, err := filepath.Glob(filepath.Join(mountPoint, "*.app"))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if len(matches) == 0 {
|
|
||||||
return fmt.Errorf("no .app found in dmg")
|
|
||||||
}
|
|
||||||
|
|
||||||
killSignalChan <- nil
|
|
||||||
|
|
||||||
// Copy the new app to the destination
|
|
||||||
// cp -Rf /Volumes/GoPeed/GoPeed.app /Applications
|
|
||||||
if err := exec.Command("cp", "-Rf", matches[0], appPath).Run(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get parent directory safely, handling trailing separators
|
|
||||||
func getParentDir(path string) string {
|
|
||||||
// Remove trailing separators if they exist
|
|
||||||
path = strings.TrimRight(path, string(filepath.Separator))
|
|
||||||
// Now get the parent directory
|
|
||||||
return filepath.Dir(path)
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
//go:build linux
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"os/exec"
|
|
||||||
)
|
|
||||||
|
|
||||||
func install(killSignalChan chan<- any, updateChannel, packagePath, destDir string) (bool, error) {
|
|
||||||
killSignalChan <- nil
|
|
||||||
switch updateChannel {
|
|
||||||
case "linuxDeb":
|
|
||||||
return true, installByDeb(packagePath)
|
|
||||||
case "linuxFlathub":
|
|
||||||
return true, installByFlathub()
|
|
||||||
case "linuxSnap":
|
|
||||||
return true, installBySnap()
|
|
||||||
default:
|
|
||||||
return false, fmt.Errorf("unsupported update channel for Linux: %s", updateChannel)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// executeInTerminal tries to execute a command in one of several common terminal emulators
|
|
||||||
func executeInTerminal(command string) error {
|
|
||||||
terminals := []string{
|
|
||||||
"gnome-terminal", // GNOME
|
|
||||||
"konsole", // KDE
|
|
||||||
"xfce4-terminal", // XFCE
|
|
||||||
"xterm", // X11
|
|
||||||
}
|
|
||||||
|
|
||||||
command = fmt.Sprintf(`echo "Starting update..." && echo "[CMD] %s" && %s`, command, command)
|
|
||||||
|
|
||||||
for _, term := range terminals {
|
|
||||||
if _, err := exec.LookPath(term); err == nil {
|
|
||||||
var cmd *exec.Cmd
|
|
||||||
switch term {
|
|
||||||
case "gnome-terminal", "xfce4-terminal":
|
|
||||||
cmd = exec.Command(term, "--", "bash", "-c", command)
|
|
||||||
case "konsole":
|
|
||||||
cmd = exec.Command(term, "-e", "bash", "-c", command)
|
|
||||||
case "xterm":
|
|
||||||
cmd = exec.Command(term, "-e", command)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := cmd.Start(); err == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return fmt.Errorf("no suitable terminal emulator found. Please install gnome-terminal, konsole, xfce4-terminal or xterm")
|
|
||||||
}
|
|
||||||
|
|
||||||
// installByDeb installs the .deb package
|
|
||||||
func installByDeb(packagePath string) error {
|
|
||||||
command := fmt.Sprintf(`sudo dpkg -i "%s"`, packagePath)
|
|
||||||
return executeInTerminal(command)
|
|
||||||
}
|
|
||||||
|
|
||||||
// installByFlathub updates the application via Flathub
|
|
||||||
func installByFlathub() error {
|
|
||||||
command := "flatpak update com.gopeed.Gopeed -y"
|
|
||||||
return executeInTerminal(command)
|
|
||||||
}
|
|
||||||
|
|
||||||
// installBySnap updates the application via Snap
|
|
||||||
func installBySnap() error {
|
|
||||||
command := "sudo snap refresh gopeed"
|
|
||||||
return executeInTerminal(command)
|
|
||||||
}
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
//go:build windows
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"archive/zip"
|
|
||||||
"fmt"
|
|
||||||
"io"
|
|
||||||
"os"
|
|
||||||
"os/exec"
|
|
||||||
"path/filepath"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
func install(killSignalChan chan<- any, updateChannel, packagePath, destDir string) (bool, error) {
|
|
||||||
switch updateChannel {
|
|
||||||
case "windowsInstaller":
|
|
||||||
return false, installByInstaller(killSignalChan, packagePath, destDir)
|
|
||||||
default:
|
|
||||||
return true, installByPortable(killSignalChan, packagePath, destDir)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// installByInstaller extracts the installer from the zip file and runs it
|
|
||||||
func installByInstaller(killSignalChan chan<- any, packagePath, destDir string) error {
|
|
||||||
// Create a temp directory for extraction
|
|
||||||
tempDir, err := os.MkdirTemp("", "gopeed_update")
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer os.RemoveAll(tempDir)
|
|
||||||
|
|
||||||
// Extract the zip file
|
|
||||||
reader, err := zip.OpenReader(packagePath)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer reader.Close()
|
|
||||||
|
|
||||||
// Find the installer file
|
|
||||||
var installerPath string
|
|
||||||
for _, file := range reader.File {
|
|
||||||
if file.FileInfo().IsDir() {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// Extract file
|
|
||||||
path := filepath.Join(tempDir, file.Name)
|
|
||||||
|
|
||||||
if err := os.MkdirAll(filepath.Dir(path), os.ModePerm); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
dstFile, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, file.Mode())
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
srcFile, err := file.Open()
|
|
||||||
if err != nil {
|
|
||||||
dstFile.Close()
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err = io.Copy(dstFile, srcFile)
|
|
||||||
srcFile.Close()
|
|
||||||
dstFile.Close()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// If this is likely an installer (.exe, .msi), save its path
|
|
||||||
ext := strings.ToLower(filepath.Ext(file.Name))
|
|
||||||
if ext == ".exe" || ext == ".msi" {
|
|
||||||
installerPath = path
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if installerPath == "" {
|
|
||||||
return fmt.Errorf("no installer found in the update package")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Run the installer
|
|
||||||
cmd := exec.Command(installerPath)
|
|
||||||
if err := cmd.Start(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
killSignalChan <- nil
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// installByPortable extracts the portable version to the destination directory
|
|
||||||
func installByPortable(killSignalChan chan<- any, packagePath, destDir string) error {
|
|
||||||
killSignalChan <- nil
|
|
||||||
|
|
||||||
reader, err := zip.OpenReader(packagePath)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer reader.Close()
|
|
||||||
|
|
||||||
for _, file := range reader.File {
|
|
||||||
path := filepath.Join(destDir, file.Name)
|
|
||||||
|
|
||||||
if file.FileInfo().IsDir() {
|
|
||||||
os.MkdirAll(path, file.Mode())
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := os.MkdirAll(filepath.Dir(path), os.ModePerm); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
dstFile, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, file.Mode())
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
srcFile, err := file.Open()
|
|
||||||
if err != nil {
|
|
||||||
dstFile.Close()
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err = io.Copy(dstFile, srcFile)
|
|
||||||
srcFile.Close()
|
|
||||||
dstFile.Close()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
@@ -47,7 +47,6 @@ type chunk struct {
|
|||||||
End int64
|
End int64
|
||||||
Downloaded int64
|
Downloaded int64
|
||||||
|
|
||||||
failed bool
|
|
||||||
retryTimes int
|
retryTimes int
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,23 +147,12 @@ func (f *Fetcher) Resolve(req *base.Request) error {
|
|||||||
_, params, _ := mime.ParseMediaType(contentDisposition)
|
_, params, _ := mime.ParseMediaType(contentDisposition)
|
||||||
filename := params["filename"]
|
filename := params["filename"]
|
||||||
if filename != "" {
|
if filename != "" {
|
||||||
// Check if the filename is MIME encoded-word
|
file.Name = filename
|
||||||
if strings.HasPrefix(filename, "=?") {
|
|
||||||
decoder := new(mime.WordDecoder)
|
|
||||||
filename = strings.Replace(filename, "UTF8", "UTF-8", 1)
|
|
||||||
file.Name, _ = decoder.Decode(filename)
|
|
||||||
} else {
|
|
||||||
file.Name = filename
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// get file filePath by URL
|
// get file filePath by URL
|
||||||
if file.Name == "" {
|
if file.Name == "" {
|
||||||
file.Name = path.Base(httpReq.URL.Path)
|
file.Name = path.Base(httpReq.URL.Path)
|
||||||
// Url decode
|
|
||||||
if file.Name != "" {
|
|
||||||
file.Name, _ = url.QueryUnescape(file.Name)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// unknown file filePath
|
// unknown file filePath
|
||||||
if file.Name == "" || file.Name == "/" || file.Name == "." {
|
if file.Name == "" || file.Name == "/" || file.Name == "." {
|
||||||
@@ -266,6 +254,10 @@ func (f *Fetcher) Wait() (err error) {
|
|||||||
return <-f.doneCh
|
return <-f.doneCh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type fetchResult struct {
|
||||||
|
err error
|
||||||
|
}
|
||||||
|
|
||||||
func (f *Fetcher) fetch() {
|
func (f *Fetcher) fetch() {
|
||||||
var ctx context.Context
|
var ctx context.Context
|
||||||
ctx, f.cancel = context.WithCancel(context.Background())
|
ctx, f.cancel = context.WithCancel(context.Background())
|
||||||
@@ -309,12 +301,12 @@ func (f *Fetcher) fetch() {
|
|||||||
|
|
||||||
func (f *Fetcher) fetchChunk(index int, ctx context.Context) (err error) {
|
func (f *Fetcher) fetchChunk(index int, ctx context.Context) (err error) {
|
||||||
chunk := f.chunks[index]
|
chunk := f.chunks[index]
|
||||||
chunk.failed = false
|
|
||||||
chunk.retryTimes = 0
|
chunk.retryTimes = 0
|
||||||
|
|
||||||
var (
|
var (
|
||||||
client = f.buildClient()
|
client = f.buildClient()
|
||||||
buf = make([]byte, 8192)
|
buf = make([]byte, 8192)
|
||||||
|
maxRetries = 3
|
||||||
)
|
)
|
||||||
// retry until all remain chunks failed
|
// retry until all remain chunks failed
|
||||||
for {
|
for {
|
||||||
@@ -322,22 +314,9 @@ func (f *Fetcher) fetchChunk(index int, ctx context.Context) (err error) {
|
|||||||
if f.meta.Res.Range && chunk.Downloaded >= chunk.End-chunk.Begin+1 {
|
if f.meta.Res.Range && chunk.Downloaded >= chunk.End-chunk.Begin+1 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// if all chunks failed, return
|
|
||||||
if chunk.failed {
|
if chunk.retryTimes >= maxRetries {
|
||||||
allFailed := true
|
return
|
||||||
for _, c := range f.chunks {
|
|
||||||
if !c.failed {
|
|
||||||
allFailed = false
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if allFailed {
|
|
||||||
if chunk.retryTimes >= 3 {
|
|
||||||
return
|
|
||||||
} else {
|
|
||||||
chunk.retryTimes++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -388,10 +367,18 @@ func (f *Fetcher) fetchChunk(index int, ctx context.Context) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// retry request after 1 second
|
// retry request after 1 second
|
||||||
chunk.failed = true
|
chunk.retryTimes = chunk.retryTimes + 1
|
||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// if chunk is completed, reset other not complete chunks retry times
|
||||||
|
if err == nil {
|
||||||
|
for _, c := range f.chunks {
|
||||||
|
if c != chunk && c.retryTimes > 0 {
|
||||||
|
c.retryTimes = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -37,26 +37,6 @@ func TestFetcher_Resolve(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}, t)
|
}, t)
|
||||||
testResolve(test.StartTestCustomServer, "encoded-word", &base.Resource{
|
|
||||||
Size: test.BuildSize,
|
|
||||||
Range: false,
|
|
||||||
Files: []*base.FileInfo{
|
|
||||||
{
|
|
||||||
Name: "测试.zip",
|
|
||||||
Size: test.BuildSize,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}, t)
|
|
||||||
testResolve(test.StartTestCustomServer, "%E6%B5%8B%E8%AF%95.zip", &base.Resource{
|
|
||||||
Size: 0,
|
|
||||||
Range: false,
|
|
||||||
Files: []*base.FileInfo{
|
|
||||||
{
|
|
||||||
Name: "测试.zip",
|
|
||||||
Size: 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}, t)
|
|
||||||
testResolve(test.StartTestCustomServer, test.BuildName, &base.Resource{
|
testResolve(test.StartTestCustomServer, test.BuildName, &base.Resource{
|
||||||
Size: 0,
|
Size: 0,
|
||||||
Range: false,
|
Range: false,
|
||||||
|
|||||||
@@ -83,25 +83,6 @@ func StartTestCustomServer() net.Listener {
|
|||||||
defer file.Close()
|
defer file.Close()
|
||||||
io.Copy(writer, file)
|
io.Copy(writer, file)
|
||||||
})
|
})
|
||||||
mux.HandleFunc("/encoded-word", func(writer http.ResponseWriter, request *http.Request) {
|
|
||||||
writer.Header().Set("Content-Disposition", "attachment; filename=\"=?UTF8?B?5rWL6K+VLnppcA==?=\"")
|
|
||||||
writer.Header().Set("Content-Type", "application/octet-stream")
|
|
||||||
writer.Header().Set("Content-Length", fmt.Sprintf("%d", BuildSize))
|
|
||||||
file, err := os.Open(BuildFile)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
defer file.Close()
|
|
||||||
io.Copy(writer, file)
|
|
||||||
})
|
|
||||||
mux.HandleFunc("/%E6%B5%8B%E8%AF%95.zip", func(writer http.ResponseWriter, request *http.Request) {
|
|
||||||
file, err := os.Open(BuildFile)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
defer file.Close()
|
|
||||||
io.Copy(writer, file)
|
|
||||||
})
|
|
||||||
return mux
|
return mux
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,5 @@ windows/flutter/generated_plugins.cmake
|
|||||||
database.hive
|
database.hive
|
||||||
database.lock
|
database.lock
|
||||||
|
|
||||||
assets/exec/host
|
assets/host/host
|
||||||
assets/exec/host.exe
|
assets/host/host.exe
|
||||||
assets/exec/updater
|
|
||||||
assets/exec/updater.exe
|
|
||||||
@@ -48,7 +48,7 @@ android {
|
|||||||
// You can update the following values to match your application needs.
|
// You can update the following values to match your application needs.
|
||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 34
|
targetSdkVersion 29
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
|
|
||||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
@@ -93,8 +91,7 @@
|
|||||||
<!-- Add android:stopWithTask option only when necessary. -->
|
<!-- Add android:stopWithTask option only when necessary. -->
|
||||||
<service
|
<service
|
||||||
android:name="com.pravera.flutter_foreground_task.service.ForegroundService"
|
android:name="com.pravera.flutter_foreground_task.service.ForegroundService"
|
||||||
android:foregroundServiceType="dataSync"
|
android:stopWithTask="true" />
|
||||||
android:exported="false" />
|
|
||||||
|
|
||||||
<!-- Don't delete the meta-data below.
|
<!-- Don't delete the meta-data below.
|
||||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||||
|
|||||||
File renamed without changes.
@@ -24,11 +24,9 @@ import '../../../../database/database.dart';
|
|||||||
import '../../../../database/entity.dart';
|
import '../../../../database/entity.dart';
|
||||||
import '../../../../i18n/message.dart';
|
import '../../../../i18n/message.dart';
|
||||||
import '../../../../main.dart';
|
import '../../../../main.dart';
|
||||||
import '../../../../util/github_mirror.dart';
|
|
||||||
import '../../../../util/locale_manager.dart';
|
import '../../../../util/locale_manager.dart';
|
||||||
import '../../../../util/log_util.dart';
|
import '../../../../util/log_util.dart';
|
||||||
import '../../../../util/package_info.dart';
|
import '../../../../util/package_info.dart';
|
||||||
import '../../../../util/updater.dart';
|
|
||||||
import '../../../../util/util.dart';
|
import '../../../../util/util.dart';
|
||||||
import '../../../routes/app_pages.dart';
|
import '../../../routes/app_pages.dart';
|
||||||
import '../../create/dto/create_router_params.dart';
|
import '../../create/dto/create_router_params.dart';
|
||||||
@@ -37,22 +35,47 @@ import '../../redirect/views/redirect_view.dart';
|
|||||||
const unixSocketPath = 'gopeed.sock';
|
const unixSocketPath = 'gopeed.sock';
|
||||||
|
|
||||||
const allTrackerSubscribeUrls = [
|
const allTrackerSubscribeUrls = [
|
||||||
'https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt',
|
'https://github.com/ngosang/trackerslist/raw/master/trackers_all.txt',
|
||||||
'https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all_http.txt',
|
'https://github.com/ngosang/trackerslist/raw/master/trackers_all_http.txt',
|
||||||
'https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all_https.txt',
|
'https://github.com/ngosang/trackerslist/raw/master/trackers_all_https.txt',
|
||||||
'https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all_ip.txt',
|
'https://github.com/ngosang/trackerslist/raw/master/trackers_all_ip.txt',
|
||||||
'https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all_udp.txt',
|
'https://github.com/ngosang/trackerslist/raw/master/trackers_all_udp.txt',
|
||||||
'https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all_ws.txt',
|
'https://github.com/ngosang/trackerslist/raw/master/trackers_all_ws.txt',
|
||||||
'https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt',
|
'https://github.com/ngosang/trackerslist/raw/master/trackers_best.txt',
|
||||||
'https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best_ip.txt',
|
'https://github.com/ngosang/trackerslist/raw/master/trackers_best_ip.txt',
|
||||||
'https://raw.githubusercontent.com/XIU2/TrackersListCollection/master/all.txt',
|
'https://github.com/XIU2/TrackersListCollection/raw/master/all.txt',
|
||||||
'https://raw.githubusercontent.com/XIU2/TrackersListCollection/master/best.txt',
|
'https://github.com/XIU2/TrackersListCollection/raw/master/best.txt',
|
||||||
'https://raw.githubusercontent.com/XIU2/TrackersListCollection/master/http.txt',
|
'https://github.com/XIU2/TrackersListCollection/raw/master/http.txt',
|
||||||
];
|
];
|
||||||
final allTrackerSubscribeUrlCdns = {
|
const allTrackerCdns = [
|
||||||
for (var v in allTrackerSubscribeUrls)
|
// jsdelivr: https://fastly.jsdelivr.net/gh/ngosang/trackerslist/trackers_all.txt
|
||||||
v: githubMirrorUrls(v, MirrorType.githubSource)
|
["https://fastly.jsdelivr.net/gh", r".*github.com(/.*)/raw/master(/.*)"],
|
||||||
};
|
// ghproxy: https://ghproxy.com/https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt
|
||||||
|
[
|
||||||
|
"https://ghproxy.com/https://raw.githubusercontent.com",
|
||||||
|
r".*github.com(/.*)/raw(/.*)"
|
||||||
|
],
|
||||||
|
// mirror.ghproxy.com: https://mirror.ghproxy.com/https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt
|
||||||
|
[
|
||||||
|
"https://mirror.ghproxy.com/https://raw.githubusercontent.com",
|
||||||
|
r".*github.com(/.*)/raw(/.*)"
|
||||||
|
],
|
||||||
|
];
|
||||||
|
final allTrackerSubscribeUrlCdns = Map.fromIterable(allTrackerSubscribeUrls,
|
||||||
|
key: (v) => v as String,
|
||||||
|
value: (v) {
|
||||||
|
final ret = [v as String];
|
||||||
|
for (final cdn in allTrackerCdns) {
|
||||||
|
final reg = RegExp(cdn[1]);
|
||||||
|
final match = reg.firstMatch(v.toString());
|
||||||
|
var matchStr = "";
|
||||||
|
for (var i = 1; i <= match!.groupCount; i++) {
|
||||||
|
matchStr += match.group(i)!;
|
||||||
|
}
|
||||||
|
ret.add("${cdn[0]}$matchStr");
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
});
|
||||||
|
|
||||||
class AppController extends GetxController with WindowListener, TrayListener {
|
class AppController extends GetxController with WindowListener, TrayListener {
|
||||||
static StartConfig? _defaultStartConfig;
|
static StartConfig? _defaultStartConfig;
|
||||||
@@ -86,9 +109,6 @@ class AppController extends GetxController with WindowListener, TrayListener {
|
|||||||
|
|
||||||
_initLaunchAtStartup().onError((error, stackTrace) =>
|
_initLaunchAtStartup().onError((error, stackTrace) =>
|
||||||
logger.w("initLaunchAtStartup error", error, stackTrace));
|
logger.w("initLaunchAtStartup error", error, stackTrace));
|
||||||
|
|
||||||
_initCheckUpdate().onError((error, stackTrace) =>
|
|
||||||
logger.w("initCheckUpdate error", error, stackTrace));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -317,9 +337,8 @@ class AppController extends GetxController with WindowListener, TrayListener {
|
|||||||
if (uri.path == "/create") {
|
if (uri.path == "/create") {
|
||||||
final params = uri.queryParameters["params"];
|
final params = uri.queryParameters["params"];
|
||||||
if (params?.isNotEmpty == true) {
|
if (params?.isNotEmpty == true) {
|
||||||
final safeParams = params!.replaceAll(" ", "+");
|
|
||||||
final paramsJson =
|
final paramsJson =
|
||||||
String.fromCharCodes(base64Decode(base64.normalize(safeParams)));
|
String.fromCharCodes(base64Decode(base64.normalize(params!)));
|
||||||
Get.rootDelegate.offAndToNamed(Routes.REDIRECT,
|
Get.rootDelegate.offAndToNamed(Routes.REDIRECT,
|
||||||
arguments: RedirectArgs(Routes.CREATE,
|
arguments: RedirectArgs(Routes.CREATE,
|
||||||
arguments:
|
arguments:
|
||||||
@@ -339,8 +358,7 @@ class AppController extends GetxController with WindowListener, TrayListener {
|
|||||||
uri.scheme == "https") {
|
uri.scheme == "https") {
|
||||||
path = uri.toString();
|
path = uri.toString();
|
||||||
} else if (uri.scheme == "file") {
|
} else if (uri.scheme == "file") {
|
||||||
path =
|
path = Util.isWindows() ? uri.path.substring(1) : uri.path;
|
||||||
Util.isWindows() ? Uri.decodeFull(uri.path.substring(1)) : uri.path;
|
|
||||||
} else {
|
} else {
|
||||||
path = (await toFile(uri.toString())).path;
|
path = (await toFile(uri.toString())).path;
|
||||||
}
|
}
|
||||||
@@ -505,13 +523,6 @@ class AppController extends GetxController with WindowListener, TrayListener {
|
|||||||
autoStartup.value = await launchAtStartup.isEnabled();
|
autoStartup.value = await launchAtStartup.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initCheckUpdate() async {
|
|
||||||
final versionInfo = await checkUpdate();
|
|
||||||
if (versionInfo != null) {
|
|
||||||
await showUpdateDialog(Get.context!, versionInfo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> saveConfig() async {
|
Future<void> saveConfig() async {
|
||||||
Database.instance.saveStartConfig(StartConfigEntity(
|
Database.instance.saveStartConfig(StartConfigEntity(
|
||||||
network: startConfig.value.network,
|
network: startConfig.value.network,
|
||||||
|
|||||||
@@ -2,12 +2,10 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
|
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:window_manager/window_manager.dart'; // Import the required packages
|
|
||||||
|
|
||||||
import '../../../../i18n/message.dart';
|
import '../../../../i18n/message.dart';
|
||||||
import '../../../../theme/theme.dart';
|
import '../../../../theme/theme.dart';
|
||||||
import '../../../../util/locale_manager.dart';
|
import '../../../../util/locale_manager.dart';
|
||||||
import '../../../../util/util.dart'; // Import the required packages
|
|
||||||
import '../../../routes/app_pages.dart';
|
import '../../../routes/app_pages.dart';
|
||||||
import '../controllers/app_controller.dart';
|
import '../controllers/app_controller.dart';
|
||||||
|
|
||||||
@@ -34,19 +32,6 @@ class AppView extends GetView<AppController> {
|
|||||||
],
|
],
|
||||||
supportedLocales: messages.keys.keys.map((e) => toLocale(e)).toList(),
|
supportedLocales: messages.keys.keys.map((e) => toLocale(e)).toList(),
|
||||||
getPages: AppPages.routes,
|
getPages: AppPages.routes,
|
||||||
|
|
||||||
// Add listening to theme changes, set the title bar color according to the current system theme.
|
|
||||||
builder: (context, child) {
|
|
||||||
// if platform is desktop
|
|
||||||
if (Util.isDesktop()){
|
|
||||||
// actual brightness of the UI
|
|
||||||
Brightness brightness = Theme.of(context).brightness;
|
|
||||||
// Set the title bar to use the actual brightness of the UI
|
|
||||||
windowManager.setBrightness(brightness);
|
|
||||||
}
|
|
||||||
return child!;
|
|
||||||
},
|
|
||||||
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,16 @@ class CreateView extends GetView<CreateController> {
|
|||||||
_urlController.text = url;
|
_urlController.text = url;
|
||||||
_urlController.selection = TextSelection.fromPosition(
|
_urlController.selection = TextSelection.fromPosition(
|
||||||
TextPosition(offset: _urlController.text.length));
|
TextPosition(offset: _urlController.text.length));
|
||||||
final protocol = parseProtocol(url);
|
final uppercaseUrl = url.toUpperCase();
|
||||||
|
Protocol? protocol;
|
||||||
|
if (uppercaseUrl.startsWith("HTTP:") ||
|
||||||
|
uppercaseUrl.startsWith("HTTPS:")) {
|
||||||
|
protocol = Protocol.http;
|
||||||
|
}
|
||||||
|
if (uppercaseUrl.startsWith("MAGNET:") ||
|
||||||
|
uppercaseUrl.endsWith(".TORRENT")) {
|
||||||
|
protocol = Protocol.bt;
|
||||||
|
}
|
||||||
if (protocol != null) {
|
if (protocol != null) {
|
||||||
final extraHandlers = {
|
final extraHandlers = {
|
||||||
Protocol.http: () {
|
Protocol.http: () {
|
||||||
@@ -663,20 +672,6 @@ class CreateView extends GetView<CreateController> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse protocol from url
|
|
||||||
parseProtocol(String url) {
|
|
||||||
final uppercaseUrl = url.toUpperCase();
|
|
||||||
Protocol? protocol;
|
|
||||||
if (uppercaseUrl.startsWith("HTTP:") || uppercaseUrl.startsWith("HTTPS:")) {
|
|
||||||
protocol = Protocol.http;
|
|
||||||
}
|
|
||||||
if (uppercaseUrl.startsWith("MAGNET:") ||
|
|
||||||
uppercaseUrl.endsWith(".TORRENT")) {
|
|
||||||
protocol = Protocol.bt;
|
|
||||||
}
|
|
||||||
return protocol;
|
|
||||||
}
|
|
||||||
|
|
||||||
// recognize magnet uri, if length == 40, auto add magnet prefix
|
// recognize magnet uri, if length == 40, auto add magnet prefix
|
||||||
recognizeMagnetUri(String text) {
|
recognizeMagnetUri(String text) {
|
||||||
if (text.length != 40) {
|
if (text.length != 40) {
|
||||||
@@ -769,23 +764,24 @@ class CreateView extends GetView<CreateController> {
|
|||||||
|
|
||||||
Object? parseReqExtra(String url) {
|
Object? parseReqExtra(String url) {
|
||||||
Object? reqExtra;
|
Object? reqExtra;
|
||||||
final protocol = parseProtocol(url);
|
if (controller.showAdvanced.value) {
|
||||||
switch (protocol) {
|
switch (controller.advancedTabController.index) {
|
||||||
case Protocol.http:
|
case 0:
|
||||||
final header = Map<String, String>.fromEntries(_httpHeaderControllers
|
final header = Map<String, String>.fromEntries(_httpHeaderControllers
|
||||||
.map((e) => MapEntry(e.name.text, e.value.text)));
|
.map((e) => MapEntry(e.name.text, e.value.text)));
|
||||||
header.removeWhere(
|
header.removeWhere(
|
||||||
(key, value) => key.trim().isEmpty || value.trim().isEmpty);
|
(key, value) => key.trim().isEmpty || value.trim().isEmpty);
|
||||||
if (header.isNotEmpty) {
|
if (header.isNotEmpty) {
|
||||||
reqExtra = ReqExtraHttp()..header = header;
|
reqExtra = ReqExtraHttp()..header = header;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Protocol.bt:
|
case 1:
|
||||||
if (_btTrackerController.text.trim().isNotEmpty) {
|
if (_btTrackerController.text.trim().isNotEmpty) {
|
||||||
reqExtra = ReqExtraBt()
|
reqExtra = ReqExtraBt()
|
||||||
..trackers = Util.textToLines(_btTrackerController.text);
|
..trackers = Util.textToLines(_btTrackerController.text);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return reqExtra;
|
return reqExtra;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import '../../../../api/model/extension.dart';
|
|||||||
import '../../../../api/model/install_extension.dart';
|
import '../../../../api/model/install_extension.dart';
|
||||||
import '../../../../api/model/switch_extension.dart';
|
import '../../../../api/model/switch_extension.dart';
|
||||||
import '../../../../api/model/update_extension_settings.dart';
|
import '../../../../api/model/update_extension_settings.dart';
|
||||||
import '../../../../util/mac_bookmarks.dart';
|
|
||||||
import '../../../../util/message.dart';
|
import '../../../../util/message.dart';
|
||||||
import '../../../../util/util.dart';
|
import '../../../../util/util.dart';
|
||||||
import '../../../views/icon_button_loading.dart';
|
import '../../../views/icon_button_loading.dart';
|
||||||
@@ -96,7 +95,6 @@ class ExtensionView extends GetView<ExtensionController> {
|
|||||||
var dir =
|
var dir =
|
||||||
await FilePicker.platform.getDirectoryPath();
|
await FilePicker.platform.getDirectoryPath();
|
||||||
if (dir != null) {
|
if (dir != null) {
|
||||||
MacBookmarks.saveBookmark(dir);
|
|
||||||
try {
|
try {
|
||||||
await installExtension(
|
await installExtension(
|
||||||
InstallExtension(devMode: true, url: dir));
|
InstallExtension(devMode: true, url: dir));
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import 'package:get/get.dart';
|
import 'dart:convert';
|
||||||
|
|
||||||
import '../../../../util/updater.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:gopeed/api/api.dart';
|
||||||
|
|
||||||
class SettingController extends GetxController {
|
class SettingController extends GetxController {
|
||||||
final tapStatues = <String, bool>{}.obs;
|
final tapStatues = <String, bool>{}.obs;
|
||||||
final latestVersion = Rxn<VersionInfo>();
|
final latestVersion = "".obs;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
@@ -25,6 +26,23 @@ class SettingController extends GetxController {
|
|||||||
|
|
||||||
// fetch latest version
|
// fetch latest version
|
||||||
void fetchLatestVersion() async {
|
void fetchLatestVersion() async {
|
||||||
latestVersion.value = await checkUpdate();
|
String? releaseDataStr;
|
||||||
|
try {
|
||||||
|
releaseDataStr = (await proxyRequest(
|
||||||
|
"https://api.github.com/repos/GopeedLab/gopeed/releases/latest"))
|
||||||
|
.data;
|
||||||
|
} catch (e) {
|
||||||
|
releaseDataStr =
|
||||||
|
(await proxyRequest("https://gopeed.com/api/release")).data;
|
||||||
|
}
|
||||||
|
if (releaseDataStr == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final releaseData = jsonDecode(releaseDataStr);
|
||||||
|
final tagName = releaseData["tag_name"];
|
||||||
|
if (tagName == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
latestVersion.value = releaseData["tag_name"].substring(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,6 @@ import '../../../../util/log_util.dart';
|
|||||||
import '../../../../util/message.dart';
|
import '../../../../util/message.dart';
|
||||||
import '../../../../util/package_info.dart';
|
import '../../../../util/package_info.dart';
|
||||||
import '../../../../util/scheme_register/scheme_register.dart';
|
import '../../../../util/scheme_register/scheme_register.dart';
|
||||||
import '../../../../util/updater.dart';
|
|
||||||
import '../../../../util/util.dart';
|
import '../../../../util/util.dart';
|
||||||
import '../../../views/check_list_view.dart';
|
import '../../../views/check_list_view.dart';
|
||||||
import '../../../views/directory_selector.dart';
|
import '../../../views/directory_selector.dart';
|
||||||
@@ -515,7 +514,29 @@ class SettingView extends GetView<SettingController> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buildVersion() {
|
buildVersion() {
|
||||||
var hasNewVersion = controller.latestVersion.value != null;
|
bool isNewVersion(String current, String latest) {
|
||||||
|
if (latest == "") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
final v1Parts = current.split('.');
|
||||||
|
final v2Parts = latest.split('.');
|
||||||
|
|
||||||
|
for (var i = 0; i < 3; i++) {
|
||||||
|
final v1Part = int.parse(v1Parts[i]);
|
||||||
|
final v2Part = int.parse(v2Parts[i]);
|
||||||
|
|
||||||
|
if (v1Part < v2Part) {
|
||||||
|
return true;
|
||||||
|
} else if (v1Part > v2Part) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var hasNewVersion =
|
||||||
|
isNewVersion(packageInfo.version, controller.latestVersion.value);
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: hasNewVersion
|
title: hasNewVersion
|
||||||
? badges.Badge(
|
? badges.Badge(
|
||||||
@@ -525,7 +546,27 @@ class SettingView extends GetView<SettingController> {
|
|||||||
subtitle: Text(packageInfo.version),
|
subtitle: Text(packageInfo.version),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (hasNewVersion) {
|
if (hasNewVersion) {
|
||||||
showUpdateDialog(context, controller.latestVersion.value!);
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => AlertDialog(
|
||||||
|
content: Text('newVersionTitle'.trParams(
|
||||||
|
{'version': controller.latestVersion.value})),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
child: Text('newVersionLater'.tr),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
launchUrl(Uri.parse('https://gopeed.com'),
|
||||||
|
mode: LaunchMode.externalApplication);
|
||||||
|
},
|
||||||
|
child: Text('newVersionUpdate'.tr),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -721,7 +762,7 @@ class SettingView extends GetView<SettingController> {
|
|||||||
width: 80,
|
width: 80,
|
||||||
child: DropdownButtonFormField<String>(
|
child: DropdownButtonFormField<String>(
|
||||||
value: startCfg.value.network,
|
value: startCfg.value.network,
|
||||||
onChanged: Util.isDesktop() || Util.isAndroid()
|
onChanged: Util.isDesktop()
|
||||||
? (value) async {
|
? (value) async {
|
||||||
startCfg.update((val) {
|
startCfg.update((val) {
|
||||||
val!.network = value!;
|
val!.network = value!;
|
||||||
@@ -745,8 +786,7 @@ class SettingView extends GetView<SettingController> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
if ((Util.isDesktop() || Util.isAndroid()) &&
|
if (Util.isDesktop() && startCfg.value.network == 'tcp') {
|
||||||
startCfg.value.network == 'tcp') {
|
|
||||||
final arr = startCfg.value.address.split(':');
|
final arr = startCfg.value.address.split(':');
|
||||||
var ip = '127.0.0.1';
|
var ip = '127.0.0.1';
|
||||||
var port = '0';
|
var port = '0';
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import 'package:path_provider/path_provider.dart';
|
|||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
import 'package:toggle_switch/toggle_switch.dart';
|
import 'package:toggle_switch/toggle_switch.dart';
|
||||||
|
|
||||||
import '../../util/mac_bookmarks.dart';
|
|
||||||
import '../../util/message.dart';
|
import '../../util/message.dart';
|
||||||
import '../../util/util.dart';
|
import '../../util/util.dart';
|
||||||
|
|
||||||
@@ -42,7 +41,6 @@ class _DirectorySelectorState extends State<DirectorySelector> {
|
|||||||
var dir = await FilePicker.platform.getDirectoryPath();
|
var dir = await FilePicker.platform.getDirectoryPath();
|
||||||
if (dir != null) {
|
if (dir != null) {
|
||||||
widget.controller.text = dir;
|
widget.controller.text = dir;
|
||||||
MacBookmarks.saveBookmark(dir);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:hive/hive.dart';
|
|||||||
import 'entity.dart';
|
import 'entity.dart';
|
||||||
|
|
||||||
const String _startConfig = 'startConfig';
|
const String _startConfig = 'startConfig';
|
||||||
|
const String _lastRunningConfig = 'lastRunningConfig';
|
||||||
const String _windowState = 'windowState';
|
const String _windowState = 'windowState';
|
||||||
const String _bookmark = 'bookmark';
|
const String _bookmark = 'bookmark';
|
||||||
const String _createHistory = 'createHistory';
|
const String _createHistory = 'createHistory';
|
||||||
|
|||||||
@@ -1,122 +0,0 @@
|
|||||||
const huHU = {
|
|
||||||
'hu_HU': {
|
|
||||||
'label': 'Magyar',
|
|
||||||
'error': 'Hiba',
|
|
||||||
'tip': 'Tipp',
|
|
||||||
'confirm': 'Megerősít',
|
|
||||||
'cancel': 'Mégsem',
|
|
||||||
'on': 'Bekapcsolva',
|
|
||||||
'off': 'Kikapcsolva',
|
|
||||||
'selectAll': 'Összes kiválasztása',
|
|
||||||
'select': 'Kiválaszt',
|
|
||||||
'task': 'Feladatok',
|
|
||||||
'downloading': 'letöltés alatt',
|
|
||||||
'downloaded': 'letöltve',
|
|
||||||
'setting': 'Beállítások',
|
|
||||||
'donate': 'Támogatás',
|
|
||||||
'exit': 'Kilépés',
|
|
||||||
'create': 'Feladat létrehozása',
|
|
||||||
'directDownload': 'Közvetlen letöltés',
|
|
||||||
'advancedOptions': 'Haladó beállítások',
|
|
||||||
'followSettings': 'Beállítások követése',
|
|
||||||
'downloadLink': 'Letöltési hivatkozás',
|
|
||||||
'downloadLinkValid': 'Kérjük, adja meg a letöltési hivatkozást',
|
|
||||||
'downloadLinkHit': 'Kérjük, adja meg a letöltési hivatkozást, soronként egyet@append',
|
|
||||||
'downloadLinkHitDesktop': ', vagy húzza ide a torrent fájlt közvetlenül',
|
|
||||||
'download': 'Letöltés',
|
|
||||||
'noFileSelected': 'Kérjük, válasszon ki legalább egy fájlt a folytatáshoz.',
|
|
||||||
'noStoragePermission': 'Tárolási engedély szükséges',
|
|
||||||
'selectFile': 'Fájl kiválasztása',
|
|
||||||
'rename': 'Átnevezés',
|
|
||||||
'basic': 'Alap',
|
|
||||||
'advanced': 'Haladó',
|
|
||||||
'general': 'Általános',
|
|
||||||
'downloadDir': 'Letöltési könyvtár',
|
|
||||||
'downloadDirValid': 'Kérjük, válassza ki a letöltési könyvtárat',
|
|
||||||
'connections': 'Kapcsolatok',
|
|
||||||
'useServerCtime': 'Használja a szerveridőt a fájl létrehozásához',
|
|
||||||
'maxRunning': 'Maximális futó feladatok',
|
|
||||||
'defaultDirectDownload': 'Alapértelmezettként ellenőrizze a közvetlen letöltést',
|
|
||||||
'items': '@count elem',
|
|
||||||
'subscribeTracker': 'Nyomkövető előfizetése',
|
|
||||||
'subscribeFail':
|
|
||||||
'Az előfizetés nem sikerült, kérjük, ellenőrizze a hálózatot, vagy próbálja újra később',
|
|
||||||
'update': 'Frissítés',
|
|
||||||
'updateDaily': 'Napi frissítés',
|
|
||||||
'lastUpdate': 'Utolsó frissítés: @time',
|
|
||||||
'addTracker': 'Nyomkövető hozzáadása',
|
|
||||||
'addTrackerHit': 'Kérjük, adja meg a nyomkövető szerver URL-jét, soronként egyet',
|
|
||||||
'ui': 'Felhasználói felület',
|
|
||||||
'theme': 'Téma',
|
|
||||||
'themeSystem': 'Rendszer',
|
|
||||||
'themeLight': 'Világos',
|
|
||||||
'themeDark': 'Sötét',
|
|
||||||
'locale': 'Nyelv',
|
|
||||||
'about': 'Névjegy',
|
|
||||||
'homepage': 'Főoldal',
|
|
||||||
'version': 'Verzió',
|
|
||||||
'protocol': 'Protokoll',
|
|
||||||
'port': 'Port',
|
|
||||||
'apiToken': 'API token',
|
|
||||||
'notSet': 'NS',
|
|
||||||
'set': 'BEÁLLÍT',
|
|
||||||
'portInUse': 'A [@port] port használatban van, kérjük, változtassa meg a portot',
|
|
||||||
'effectAfterRestart': 'Kihatás indítás után',
|
|
||||||
'developer': 'Fejlesztő',
|
|
||||||
'logDirectory': 'Napló könyvtár',
|
|
||||||
'show': 'Megjelenítés',
|
|
||||||
'continue': 'Folyatás',
|
|
||||||
'pause': 'Szünet',
|
|
||||||
'startAll': 'Összes indítása',
|
|
||||||
'pauseAll': 'Összes szüneteltetése',
|
|
||||||
'deleteTask': '@count feladat törlése',
|
|
||||||
'deleteTaskTip': 'Letöltött fájlok megőrzése',
|
|
||||||
'delete': 'Törlés',
|
|
||||||
'newVersionTitle': 'Új verzió felfedezése @version',
|
|
||||||
'newVersionUpdate': 'Frissítés most',
|
|
||||||
'newVersionLater': 'Később',
|
|
||||||
'extensions': 'Bővítmények',
|
|
||||||
'extensionInstallUrl': 'Telepítési URL',
|
|
||||||
'extensionInstallSuccess': 'Sikeresen telepítve',
|
|
||||||
'extensionUpdateSuccess': 'Sikeresen frissítve',
|
|
||||||
'extensionDelete': 'Bővítmény törlése',
|
|
||||||
'extensionAlreadyLatest': 'Ez már a legfrissebb verzió',
|
|
||||||
'extensionFind': 'Bővítmények keresése',
|
|
||||||
'extensionDevelop': 'Bővítmények fejlesztése',
|
|
||||||
'history': 'Előzmények',
|
|
||||||
'clearHistory': 'Előzmények törlése',
|
|
||||||
'noHistoryFound': 'Nincs előzménye',
|
|
||||||
'serviceTitle': 'Letöltési szolgáltatás',
|
|
||||||
'serviceText': 'Futtatás',
|
|
||||||
'network': 'Hálózat',
|
|
||||||
'proxy': 'Proxy',
|
|
||||||
'noProxy': 'Nincs proxy',
|
|
||||||
'systemProxy': 'Rendszer proxy',
|
|
||||||
'customProxy': 'Egyéni proxy',
|
|
||||||
'server': 'Szerver',
|
|
||||||
'username': 'Felhasználónév',
|
|
||||||
'password': 'Jelszó',
|
|
||||||
'thanks': 'Köszönet',
|
|
||||||
'thanksDesc':
|
|
||||||
'Köszönet minden hozzájárulónak, aki segített a Gopeed közösség építésében és fejlesztésében!',
|
|
||||||
'browserExtension': 'Böngésző bővítmény',
|
|
||||||
'launchAtStartup': 'Indítás indításkor',
|
|
||||||
'seedConfig': 'Seed beállítás',
|
|
||||||
'seedKeep': 'Tartsa a seedet amíg manuálisan le nem állítják',
|
|
||||||
'seedRatio': 'Seed arány',
|
|
||||||
'seedTime': 'Seed idő (perc)',
|
|
||||||
'setAsDefaultBtClient': 'Alapértelmezett BT klienseként beállít',
|
|
||||||
'taskDetail': 'Feladat részlete',
|
|
||||||
'taskName': 'Feladat neve',
|
|
||||||
'taskUrl': 'Feladat URL',
|
|
||||||
'downloadPath': 'Letöltési útvonal',
|
|
||||||
'skipVerifyCert': 'Tanúsítvány ellenőrzés átugrása',
|
|
||||||
'name': 'Név',
|
|
||||||
'size': 'Méret',
|
|
||||||
'unknown': 'Ismeretlen',
|
|
||||||
'fileSelectedCount': 'Fájlok: ',
|
|
||||||
'fileSelectedSize': 'Méret: ',
|
|
||||||
'httpHeaderName': 'Fejléc neve',
|
|
||||||
'httpHeaderValue': 'Fejléc értéke',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -7,44 +7,43 @@ const trTR = {
|
|||||||
'cancel': 'İptal',
|
'cancel': 'İptal',
|
||||||
'on': 'Açık',
|
'on': 'Açık',
|
||||||
'off': 'Kapalı',
|
'off': 'Kapalı',
|
||||||
'selectAll': 'Tümünü Seç',
|
'selectAll': 'Hepsini seç',
|
||||||
'select': 'Seç',
|
|
||||||
'task': 'Görevler',
|
'task': 'Görevler',
|
||||||
'downloading': 'İndiriliyor',
|
'downloading': 'indiriliyor',
|
||||||
'downloaded': 'İndirildi',
|
'downloaded': 'indirildi',
|
||||||
'setting': 'Ayarlar',
|
'setting': 'Ayarlar',
|
||||||
'donate': 'Bağış Yap',
|
'donate': 'Bağış',
|
||||||
'exit': 'Çıkış',
|
'exit': 'Çık',
|
||||||
'create': 'Görev Oluştur',
|
'create': 'Görev oluştur',
|
||||||
'directDownload': 'Doğrudan İndirme',
|
'directDownload': 'Doğrudan indir',
|
||||||
'advancedOptions': 'Gelişmiş Seçenekler',
|
'advancedOptions': 'Gelişmiş ayarlar',
|
||||||
'followSettings': 'Ayarları Takip Et',
|
'followSettings': 'Ayarları takip et',
|
||||||
'downloadLink': 'İndirme Bağlantısı',
|
'downloadLink': 'İndirme bağlantısı',
|
||||||
'downloadLinkValid': 'Lütfen indirme bağlantısını girin',
|
'downloadLinkValid': 'Lütfen indirme bağlantısını girin',
|
||||||
'downloadLinkHit': 'Lütfen her satıra bir indirme bağlantısı girin@append',
|
'downloadLinkHit': 'Lütfen indirme bağlantısını girin, HTTP/HTTPS/MAGNET desteklenir@append',
|
||||||
'downloadLinkHitDesktop': ', veya doğrudan torrent dosyasını buraya sürükleyin',
|
'downloadLinkHitDesktop': ', veya torrent dosyasını doğrudan buraya sürükleyin',
|
||||||
'download': 'İndir',
|
'download': 'İndir',
|
||||||
'noFileSelected': 'Devam etmek için en az bir dosya seçin.',
|
'noFileSelected': 'Devam etmek için lütfen en az bir dosya seçin.',
|
||||||
'noStoragePermission': 'Depolama izni gerekli',
|
'noStoragePermission': 'Depolama izni gerekli',
|
||||||
'selectFile': 'Dosya Seç',
|
'selectFile': 'Dosya seç',
|
||||||
'rename': 'Yeniden Adlandır',
|
'rename': 'Yeniden adlandır',
|
||||||
'basic': 'Temel',
|
'basic': 'Temel',
|
||||||
'advanced': 'Gelişmiş',
|
'advanced': 'Gelişmiş',
|
||||||
'general': 'Genel',
|
'general': 'Genel',
|
||||||
'downloadDir': 'İndirme Dizini',
|
'downloadDir': 'İndirme dizini',
|
||||||
'downloadDirValid': 'Lütfen bir indirme dizini seçin',
|
'downloadDirValid': 'Lütfen indirme dizinini seçin',
|
||||||
'connections': 'Bağlantılar',
|
'connections': 'Bağlantılar',
|
||||||
'useServerCtime': 'Dosya oluşturma için sunucu zamanını kullan',
|
'useServerCtime': 'Dosya oluşturma için sunucu saatini kullan',
|
||||||
'maxRunning': 'Maksimum Çalışan Görev',
|
'maxRunning': 'Maksimum çalışan görev sayısı',
|
||||||
'defaultDirectDownload': 'Varsayılan olarak doğrudan indirmeyi seç',
|
'defaultDirectDownload': 'Doğrudan indir seçili olsun',
|
||||||
'items': '@count öğe',
|
'items': '@count tane',
|
||||||
'subscribeTracker': 'Tracker Aboneliği',
|
'subscribeTracker': 'İzleyiciye abone ol',
|
||||||
'subscribeFail': 'Abonelik başarısız oldu, lütfen ağı kontrol edin veya daha sonra tekrar deneyin',
|
'subscribeFail': 'Abone olunamadı, lütfen ağı kontrol edin veya daha sonra tekrar deneyin',
|
||||||
'update': 'Güncelle',
|
'update': 'Güncelle',
|
||||||
'updateDaily': 'Günlük güncelle',
|
'updateDaily': 'Günlük olarak güncelle',
|
||||||
'lastUpdate': 'Son güncelleme: @time',
|
'lastUpdate': 'Son güncellenme tarihi: @time',
|
||||||
'addTracker': 'Tracker Ekle',
|
'addTracker': 'İzleyici ekle',
|
||||||
'addTrackerHit': 'Lütfen tracker sunucu URL’sini girin, her satıra bir tane',
|
'addTrackerHit': 'Lütfen her satıra bir tane olmak üzere izleyici sunucusu bağlantısını girin',
|
||||||
'ui': 'Arayüz',
|
'ui': 'Arayüz',
|
||||||
'theme': 'Tema',
|
'theme': 'Tema',
|
||||||
'themeSystem': 'Sistem',
|
'themeSystem': 'Sistem',
|
||||||
@@ -52,70 +51,59 @@ const trTR = {
|
|||||||
'themeDark': 'Koyu',
|
'themeDark': 'Koyu',
|
||||||
'locale': 'Dil',
|
'locale': 'Dil',
|
||||||
'about': 'Hakkında',
|
'about': 'Hakkında',
|
||||||
'homepage': 'Ana Sayfa',
|
'homepage': 'Anasayfa',
|
||||||
'version': 'Sürüm',
|
'version': 'Sürüm',
|
||||||
'protocol': 'Protokol',
|
'protocol': 'Protokol',
|
||||||
'port': 'Bağlantı Noktası',
|
'port': 'Bağlantı noktası',
|
||||||
'apiToken': 'API Anahtarı',
|
'apiToken': 'API anahtarı',
|
||||||
'notSet': 'AYARLANMADI',
|
'notSet': 'AYARLI DEĞİL',
|
||||||
'set': 'AYARLA',
|
'set': 'AYARLI',
|
||||||
'portInUse': 'Bağlantı noktası [@port] kullanımda, lütfen değiştirin',
|
'portInUse': 'Bağlantı noktası [@port] kullanımda, lütfen bağlantı noktasını değiştirin',
|
||||||
'effectAfterRestart': 'Yeniden başlatmadan sonra etkili olacak',
|
'effectAfterRestart': 'Yeniden başlatma sonrası etki edecektir',
|
||||||
'developer': 'Geliştirici',
|
'developer': 'Geliştirici',
|
||||||
'logDirectory': 'Günlük Dizini',
|
'logDirectory': 'Kayıt dizini',
|
||||||
'show': 'Göster',
|
'show': 'Göster',
|
||||||
'continue': 'Devam Et',
|
'startAll': 'Hepsini başlat',
|
||||||
'pause': 'Duraklat',
|
'pauseAll': 'Hepsini durdur',
|
||||||
'startAll': 'Tümünü Başlat',
|
|
||||||
'pauseAll': 'Tümünü Duraklat',
|
|
||||||
'deleteTask': '@count görevi sil',
|
'deleteTask': '@count görevi sil',
|
||||||
'deleteTaskTip': 'İndirilen dosyaları sakla',
|
'deleteTaskTip': 'İndirilen dosyaları sakla',
|
||||||
'delete': 'Sil',
|
'delete': 'Sil',
|
||||||
'newVersionTitle': 'Yeni sürüm bulundu @version',
|
'newVersionTitle': 'Yeni sürümü keşfet @version',
|
||||||
'newVersionUpdate': 'Şimdi Güncelle',
|
'newVersionUpdate': 'Şimdi güncelle',
|
||||||
'newVersionLater': 'Daha Sonra',
|
'newVersionLater': 'Sonra',
|
||||||
'extensions': 'Eklentiler',
|
'extensions': 'Uzantılar',
|
||||||
'extensionInstallUrl': 'Kurulum URL’si',
|
'extensionInstallUrl': 'İndirme bağlantısı',
|
||||||
'extensionInstallSuccess': 'Başarıyla yüklendi',
|
'extensionInstallSuccess': 'Başarıyla indirildi',
|
||||||
'extensionUpdateSuccess': 'Başarıyla güncellendi',
|
'extensionUpdateSuccess': 'Başarıyla güncellendi',
|
||||||
'extensionDelete': 'Eklentiyi Sil',
|
'extensionDelete': 'Uzantıyı sil',
|
||||||
'extensionAlreadyLatest': 'Zaten en son sürüm',
|
'extensionAlreadyLatest': 'Bu zaten en son sürüm',
|
||||||
'extensionFind': 'Eklentileri Bul',
|
'extensionFind': 'Uzantı ara',
|
||||||
'extensionDevelop': 'Eklenti Geliştir',
|
'extensionDevelop': 'Uzantı geliştir',
|
||||||
'history': 'Geçmiş',
|
'history': 'Geçmiş',
|
||||||
'clearHistory': 'Geçmişi Temizle',
|
'clearHistory': 'Geçmişi temizle',
|
||||||
'noHistoryFound': 'Geçmiş Bulunamadı',
|
'noHistoryFound': 'Geçmiş bulunamadı',
|
||||||
'serviceTitle': 'İndirme Servisi',
|
'serviceTitle': 'Hizmet indir',
|
||||||
'serviceText': 'Çalışıyor',
|
'serviceText': 'Çalışıyor',
|
||||||
'network': 'Ağ',
|
'network': 'Ağ',
|
||||||
'proxy': 'Vekil Sunucu',
|
'proxy': 'Vekil',
|
||||||
'noProxy': 'Vekil Sunucu Yok',
|
'noProxy': 'Vekil yok',
|
||||||
'systemProxy': 'Sistem Vekil Sunucusu',
|
'systemProxy': 'Sistem vekili',
|
||||||
'customProxy': 'Özel Vekil Sunucu',
|
'customProxy': 'Özel vekil',
|
||||||
'server': 'Sunucu',
|
'server': 'Sunucu',
|
||||||
'username': 'Kullanıcı Adı',
|
'username': 'Kullanıcı adı',
|
||||||
'password': 'Şifre',
|
'password': 'Şifre',
|
||||||
'thanks': 'Teşekkürler',
|
'thanks': 'Teşekkürler',
|
||||||
'thanksDesc':
|
'thanksDesc': 'Gopeed topluluğunun oluşmasına ve gelişmesine yardımcı olan tüm katılımcılara teşekkürler!',
|
||||||
'Gopeed topluluğunun inşasında ve geliştirilmesinde katkıda bulunan herkese teşekkürler!',
|
'browserExtension': 'Tarayıcı uzantısı',
|
||||||
'browserExtension': 'Tarayıcı Eklentisi',
|
'launchAtStartup': 'Başlangıçta başlat',
|
||||||
'launchAtStartup': 'Başlangıçta Çalıştır',
|
'seedConfig': 'Seed ayarları',
|
||||||
'seedConfig': 'Seed Ayarları',
|
'seedKeep': 'Manuel durdurulana kadar seed etmeye devam et',
|
||||||
'seedKeep': 'Manuel olarak durdurulana kadar seed etmeye devam et',
|
|
||||||
'seedRatio': 'Seed oranı',
|
'seedRatio': 'Seed oranı',
|
||||||
'seedTime': 'Seed süresi (dakika)',
|
'seedTime': 'Seed süresi (dakika)',
|
||||||
'setAsDefaultBtClient': 'Varsayılan BT istemcisi olarak ayarla',
|
'taskDetail': 'Görev detayı',
|
||||||
'taskDetail': 'Görev Detayı',
|
'taskName': 'Görev adı',
|
||||||
'taskName': 'Görev Adı',
|
'taskUrl': 'Görev URL',
|
||||||
'taskUrl': 'Görev URL’si',
|
'downloadPath': 'İndirme yolu',
|
||||||
'downloadPath': 'İndirme Yolu',
|
'skipVerifyCert': 'Sertifika doğrulamasını atla',
|
||||||
'skipVerifyCert': 'Sertifika Doğrulamayı Atla',
|
|
||||||
'name': 'Ad',
|
|
||||||
'size': 'Boyut',
|
|
||||||
'unknown': 'Bilinmeyen',
|
|
||||||
'fileSelectedCount': 'Dosya: ',
|
|
||||||
'fileSelectedSize': 'Boyut: ',
|
|
||||||
'httpHeaderName': 'Başlık Adı',
|
|
||||||
'httpHeaderValue': 'Başlık Değeri',
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
const ukUA = {
|
|
||||||
'uk_UA': {
|
|
||||||
'label': 'Мова',
|
|
||||||
'error': 'Помилка',
|
|
||||||
'tip': 'Підказка',
|
|
||||||
'confirm': 'Підтвердити',
|
|
||||||
'cancel': 'Скасувати',
|
|
||||||
'on': 'Увімк.',
|
|
||||||
'off': 'Вимк.',
|
|
||||||
'selectAll': 'Вибрати все',
|
|
||||||
'select': 'Вибрати',
|
|
||||||
'task': 'Завдання',
|
|
||||||
'downloading': 'завантажується',
|
|
||||||
'downloaded': 'завантажено',
|
|
||||||
'setting': 'Налаштування',
|
|
||||||
'donate': 'Підтримати',
|
|
||||||
'exit': 'Вихід',
|
|
||||||
'create': 'Створити завдання',
|
|
||||||
'directDownload': 'Пряме завантаження',
|
|
||||||
'advancedOptions': 'Додаткові параметри',
|
|
||||||
'followSettings': 'За замовчуванням',
|
|
||||||
'downloadLink': 'Посилання на завантаження',
|
|
||||||
'downloadLinkValid': 'Будь ласка, введіть посилання на завантаження',
|
|
||||||
'downloadLinkHit':
|
|
||||||
'Будь ласка, введіть посилання на завантаження, одне на рядок@Append',
|
|
||||||
'downloadLinkHitDesktop': ', або перетягніть сюди файл торенту',
|
|
||||||
'download': 'Завантажити',
|
|
||||||
'noFileSelected': 'Будь ласка, виберіть хоча б один файл для продовження.',
|
|
||||||
'noStoragePermission': 'Потрібен дозвіл на зберігання',
|
|
||||||
'selectFile': 'Вибрати файл',
|
|
||||||
'rename': 'Перейменувати',
|
|
||||||
'basic': 'Основні',
|
|
||||||
'advanced': 'Розширені',
|
|
||||||
'general': 'Загальні',
|
|
||||||
'downloadDir': 'Каталог завантажень',
|
|
||||||
'downloadDirValid': 'Будь ласка, виберіть каталог завантажень',
|
|
||||||
'connections': 'З’єднання',
|
|
||||||
'useServerCtime': 'Використовувати час сервера для створення файлу',
|
|
||||||
'maxRunning': 'Макс. завдань у черзі',
|
|
||||||
'defaultDirectDownload': 'Пряме завантаження за замовчуванням',
|
|
||||||
'items': '@count елементів',
|
|
||||||
'subscribeTracker': 'Підписатися на трекер',
|
|
||||||
'subscribeFail':
|
|
||||||
'Не вдалося підписатися, перевірте мережу або спробуйте пізніше',
|
|
||||||
'update': 'Оновити',
|
|
||||||
'updateDaily': 'Оновлювати щодня',
|
|
||||||
'lastUpdate': 'Останнє оновлення: @time',
|
|
||||||
'addTracker': 'Додати трекер',
|
|
||||||
'addTrackerHit': 'Будь ласка, введіть URL-адресу трекера, одну на рядок',
|
|
||||||
'ui': 'Інтерфейс',
|
|
||||||
'theme': 'Тема',
|
|
||||||
'themeSystem': 'Системна',
|
|
||||||
'themeLight': 'Світла',
|
|
||||||
'themeDark': 'Темна',
|
|
||||||
'locale': 'Мова',
|
|
||||||
'about': 'Про програму',
|
|
||||||
'homepage': 'Домашня сторінка',
|
|
||||||
'version': 'Версія',
|
|
||||||
'protocol': 'Протокол',
|
|
||||||
'port': 'Порт',
|
|
||||||
'apiToken': 'API Токен',
|
|
||||||
'notSet': 'Не задано',
|
|
||||||
'set': 'Задати',
|
|
||||||
'portInUse': 'Порт [@PORT] вже використовується, будь ласка, змініть порт',
|
|
||||||
'effectAfterRestart': 'Ефект після перезапуску',
|
|
||||||
'developer': 'Розробник',
|
|
||||||
'logDirectory': 'Каталог журналів',
|
|
||||||
'show': 'Показати',
|
|
||||||
'continue': 'Продовжити',
|
|
||||||
'pause': 'Пауза',
|
|
||||||
'startAll': 'Запустити все',
|
|
||||||
'pauseAll': 'Зупинити все',
|
|
||||||
'deleteTask': 'Видалити @count завдань',
|
|
||||||
'deleteTaskTip': 'Зберегти завантажені файли',
|
|
||||||
'delete': 'Видалити',
|
|
||||||
'newVersionTitle': 'Доступна нова версія @Version',
|
|
||||||
'newVersionUpdate': 'Оновити зараз',
|
|
||||||
'newVersionLater': 'Пізніше',
|
|
||||||
'extensions': 'Розширення',
|
|
||||||
'extensionInstallUrl': 'URL для встановлення',
|
|
||||||
'extensionInstallSuccess': 'Встановлено успішно',
|
|
||||||
'extensionUpdateSuccess': 'Оновлено успішно',
|
|
||||||
'extensionDelete': 'Видалити розширення',
|
|
||||||
'extensionAlreadyLatest': 'Вже остання версія',
|
|
||||||
'extensionFind': 'Знайти розширення',
|
|
||||||
'extensionDevelop': 'Розробка розширень',
|
|
||||||
'history': 'Історія',
|
|
||||||
'clearHistory': 'Очистити історію',
|
|
||||||
'noHistoryFound': 'Історію не знайдено',
|
|
||||||
'serviceTitle': 'Служба завантаження',
|
|
||||||
'serviceText': 'Працює',
|
|
||||||
'network': 'Мережа',
|
|
||||||
'proxy': 'Проксі',
|
|
||||||
'noProxy': 'Без проксі',
|
|
||||||
'systemProxy': 'Системний проксі',
|
|
||||||
'customProxy': 'Користувацький проксі',
|
|
||||||
'server': 'Сервер',
|
|
||||||
'username': 'Ім’я користувача',
|
|
||||||
'password': 'Пароль',
|
|
||||||
'thanks': 'Подяки',
|
|
||||||
'thanksDesc':
|
|
||||||
'Дякуємо всім учасникам, які допомогли створити та розвивати спільноту Gopeed!',
|
|
||||||
'browserExtension': 'Розширення для браузера',
|
|
||||||
'launchAtStartup': 'Запускати під час завантаження системи',
|
|
||||||
'seedConfig': 'Налаштування роздачі',
|
|
||||||
'seedKeep': 'Роздавати доки не зупиню вручну',
|
|
||||||
'seedRatio': 'Коефіцієнт роздачі',
|
|
||||||
'seedTime': 'Час роздачі (хвилини)',
|
|
||||||
'setAsDefaultBtClient': 'Встановити як клієнт BT за замовчуванням',
|
|
||||||
'taskDetail': 'Деталі завдання',
|
|
||||||
'taskName': 'Назва завдання',
|
|
||||||
'taskUrl': 'URL завдання',
|
|
||||||
'downloadPath': 'Шлях завантаження',
|
|
||||||
'skipVerifyCert': 'Пропустити перевірку сертифіката',
|
|
||||||
'name': 'Назва',
|
|
||||||
'size': 'Розмір',
|
|
||||||
'unknown': 'Невідомо',
|
|
||||||
'fileSelectedCount': 'Файлів: ',
|
|
||||||
'fileSelectedSize': 'Розмір: ',
|
|
||||||
'httpHeaderName': 'Назва заголовка HTTP',
|
|
||||||
'httpHeaderValue': 'Значення заголовка HTTP',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -14,8 +14,6 @@ import 'langs/vi_vn.dart';
|
|||||||
import 'langs/zh_cn.dart';
|
import 'langs/zh_cn.dart';
|
||||||
import 'langs/zh_tw.dart';
|
import 'langs/zh_tw.dart';
|
||||||
import 'langs/es_es.dart';
|
import 'langs/es_es.dart';
|
||||||
import 'langs/uk_ua.dart';
|
|
||||||
import 'langs/hu_hu.dart';
|
|
||||||
|
|
||||||
final messages = _Messages();
|
final messages = _Messages();
|
||||||
|
|
||||||
@@ -37,7 +35,5 @@ class _Messages extends Translations {
|
|||||||
...idID,
|
...idID,
|
||||||
...frFR,
|
...frFR,
|
||||||
...esES,
|
...esES,
|
||||||
...ukUA,
|
|
||||||
...huHU,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
+16
-31
@@ -1,7 +1,6 @@
|
|||||||
import 'package:args/args.dart';
|
import 'package:args/args.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:window_manager/window_manager.dart';
|
import 'package:window_manager/window_manager.dart';
|
||||||
|
|
||||||
@@ -14,10 +13,8 @@ import 'i18n/message.dart';
|
|||||||
import 'util/browser_extension_host/browser_extension_host.dart';
|
import 'util/browser_extension_host/browser_extension_host.dart';
|
||||||
import 'util/locale_manager.dart';
|
import 'util/locale_manager.dart';
|
||||||
import 'util/log_util.dart';
|
import 'util/log_util.dart';
|
||||||
import 'util/mac_bookmarks.dart';
|
|
||||||
import 'util/package_info.dart';
|
import 'util/package_info.dart';
|
||||||
import 'util/scheme_register/scheme_register.dart';
|
import 'util/scheme_register/scheme_register.dart';
|
||||||
import 'util/updater.dart';
|
|
||||||
import 'util/util.dart';
|
import 'util/util.dart';
|
||||||
|
|
||||||
class Args {
|
class Args {
|
||||||
@@ -43,9 +40,6 @@ void main(List<String> arguments) async {
|
|||||||
|
|
||||||
Future<void> init(Args args) async {
|
Future<void> init(Args args) async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
if (Util.isMobile()) {
|
|
||||||
FlutterForegroundTask.initCommunicationPort();
|
|
||||||
}
|
|
||||||
await Util.initStorageDir();
|
await Util.initStorageDir();
|
||||||
await Database.instance.init();
|
await Database.instance.init();
|
||||||
if (Util.isDesktop()) {
|
if (Util.isDesktop()) {
|
||||||
@@ -90,40 +84,31 @@ Future<void> init(Args args) async {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await controller.loadDownloaderConfig();
|
await controller.loadDownloaderConfig();
|
||||||
MacBookmarks.loadBookmark();
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.e("load config fail", e);
|
logger.e("load config fail", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
() async {
|
() async {
|
||||||
if (Util.isDesktop()) {
|
try {
|
||||||
try {
|
registerUrlScheme("gopeed");
|
||||||
registerUrlScheme("gopeed");
|
if (controller.downloaderConfig.value.extra.defaultBtClient) {
|
||||||
if (controller.downloaderConfig.value.extra.defaultBtClient) {
|
registerDefaultTorrentClient();
|
||||||
registerDefaultTorrentClient();
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
logger.e("register scheme fail", e);
|
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
logger.e("register scheme fail", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await installHost();
|
||||||
|
} catch (e) {
|
||||||
|
logger.e("browser extension host binary install fail", e);
|
||||||
|
}
|
||||||
|
for (final browser in Browser.values) {
|
||||||
try {
|
try {
|
||||||
await installHost();
|
await installManifest(browser);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.e("browser extension host binary install fail", e);
|
logger.e(
|
||||||
}
|
"browser [${browser.name}] extension host integration fail", e);
|
||||||
for (final browser in Browser.values) {
|
|
||||||
try {
|
|
||||||
await installManifest(browser);
|
|
||||||
} catch (e) {
|
|
||||||
logger.e(
|
|
||||||
"browser [${browser.name}] extension host integration fail", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
await installUpdater();
|
|
||||||
} catch (e) {
|
|
||||||
logger.e("updater install fail", e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}();
|
}();
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
import 'arch_stub.dart'
|
|
||||||
if (dart.library.io) 'entry/arch_native.dart'
|
|
||||||
if (dart.library.html) 'entry/arch_web.dart';
|
|
||||||
|
|
||||||
// Copy from pkg/sky_engine/lib/ffi/abi.dart
|
|
||||||
enum Architecture {
|
|
||||||
arm,
|
|
||||||
arm64,
|
|
||||||
ia32,
|
|
||||||
x64,
|
|
||||||
riscv32,
|
|
||||||
riscv64,
|
|
||||||
}
|
|
||||||
|
|
||||||
Architecture getArch() => doGetArch();
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
import 'arch.dart';
|
|
||||||
|
|
||||||
Architecture doGetArch() => throw UnimplementedError();
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
// ignore: avoid_web_libraries_in_flutter
|
|
||||||
import 'dart:ffi';
|
|
||||||
|
|
||||||
import '../arch.dart';
|
|
||||||
|
|
||||||
Architecture doGetArch() {
|
|
||||||
final currentAbi = Abi.current().toString();
|
|
||||||
final archName = currentAbi.split("_")[1];
|
|
||||||
final arch = Architecture.values.firstWhere(
|
|
||||||
(element) => element.name == archName,
|
|
||||||
orElse: () => Architecture.x64);
|
|
||||||
return arch;
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import '../arch.dart';
|
|
||||||
|
|
||||||
Architecture doGetArch() {
|
|
||||||
return Architecture.x64;
|
|
||||||
}
|
|
||||||
+51
-35
@@ -1,10 +1,11 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:win32_registry/win32_registry.dart';
|
import 'package:win32_registry/win32_registry.dart';
|
||||||
|
|
||||||
import '../../util.dart';
|
|
||||||
import '../../win32.dart';
|
import '../../win32.dart';
|
||||||
import '../browser_extension_host.dart';
|
import '../browser_extension_host.dart';
|
||||||
|
|
||||||
@@ -26,9 +27,33 @@ const _firefoxNativeHostsKey = r'Software\Mozilla\NativeMessagingHosts';
|
|||||||
|
|
||||||
/// Install host binary for browser extension
|
/// Install host binary for browser extension
|
||||||
Future<void> doInstallHost() async {
|
Future<void> doInstallHost() async {
|
||||||
final hostPath = Util.homePathJoin(_hostExecName);
|
final hostPath =
|
||||||
await Util.installAsset('assets/exec/$_hostExecName', hostPath,
|
path.join((await getApplicationSupportDirectory()).path, _hostExecName);
|
||||||
executable: true);
|
|
||||||
|
Future<List<int>> getHostAssetData() async {
|
||||||
|
final hostAsset = await rootBundle.load('assets/host/$_hostExecName');
|
||||||
|
return hostAsset.buffer
|
||||||
|
.asUint8List(hostAsset.offsetInBytes, hostAsset.lengthInBytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if host binary is not installed
|
||||||
|
if (!await File(hostPath).exists()) {
|
||||||
|
final hostData = await getHostAssetData();
|
||||||
|
final file = File(hostPath);
|
||||||
|
await file.writeAsBytes(hostData);
|
||||||
|
// Add execute permission
|
||||||
|
if (!Platform.isWindows) {
|
||||||
|
await Process.run('chmod', ['+x', hostPath]);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Check if host binary is outdated
|
||||||
|
final hostAssetData = await getHostAssetData();
|
||||||
|
final hostFileData = await File(hostPath).readAsBytes();
|
||||||
|
if (hostAssetData.length != hostFileData.length) {
|
||||||
|
await File(hostPath).writeAsBytes(hostAssetData);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check if specified browser is installed
|
/// Check if specified browser is installed
|
||||||
@@ -77,7 +102,7 @@ Future<bool> doCheckManifestInstalled(Browser browser) async {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final existingContent = await File(manifestPath).readAsString();
|
final existingContent = await File(manifestPath).readAsString();
|
||||||
final expectedContent = await _getManifestContent(browser);
|
final expectedContent = await _getManifestContent();
|
||||||
return existingContent == expectedContent;
|
return existingContent == expectedContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,7 +112,7 @@ Future<void> doInstallManifest(Browser browser) async {
|
|||||||
if (await checkManifestInstalled(browser)) return;
|
if (await checkManifestInstalled(browser)) return;
|
||||||
|
|
||||||
final manifestPath = _getManifestPath(browser)!;
|
final manifestPath = _getManifestPath(browser)!;
|
||||||
final manifestContent = await _getManifestContent(browser);
|
final manifestContent = await _getManifestContent();
|
||||||
final manifestDir = path.dirname(manifestPath);
|
final manifestDir = path.dirname(manifestPath);
|
||||||
await Directory(manifestDir).create(recursive: true);
|
await Directory(manifestDir).create(recursive: true);
|
||||||
await File(manifestPath).writeAsString(manifestContent);
|
await File(manifestPath).writeAsString(manifestContent);
|
||||||
@@ -210,48 +235,39 @@ List<String> _getUnixExecutablePaths(Browser browser) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String? _getManifestPath(Browser browser) {
|
String? _getManifestPath(Browser browser) {
|
||||||
final manifestName =
|
|
||||||
browser == Browser.firefox ? '$_hostName.moz.json' : '$_hostName.json';
|
|
||||||
if (Platform.isWindows) {
|
if (Platform.isWindows) {
|
||||||
return Util.homePathJoin(manifestName);
|
final execPath = Platform.resolvedExecutable;
|
||||||
|
final execDir = path.dirname(execPath);
|
||||||
|
return path.join(execDir, '$_hostName.json');
|
||||||
}
|
}
|
||||||
|
|
||||||
String? home;
|
final home =
|
||||||
if (Platform.isMacOS) {
|
Platform.environment['HOME'] ?? Platform.environment['USERPROFILE'];
|
||||||
try {
|
|
||||||
final user = Process.runSync("id", ["-un"]).stdout.trim();
|
|
||||||
home = '/Users/$user';
|
|
||||||
} catch (e) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
home ??= Platform.environment['HOME'] ?? Platform.environment['USERPROFILE'];
|
|
||||||
|
|
||||||
if (home == null) return null;
|
if (home == null) return null;
|
||||||
|
|
||||||
if (Platform.isMacOS) {
|
if (Platform.isMacOS) {
|
||||||
switch (browser) {
|
switch (browser) {
|
||||||
case Browser.chrome:
|
case Browser.chrome:
|
||||||
return path.join(home, 'Library', 'Application Support', 'Google',
|
return path.join(home, 'Library', 'Application Support', 'Google',
|
||||||
'Chrome', 'NativeMessagingHosts', manifestName);
|
'Chrome', 'NativeMessagingHosts', '$_hostName.json');
|
||||||
case Browser.edge:
|
case Browser.edge:
|
||||||
return path.join(home, 'Library', 'Application Support',
|
return path.join(home, 'Library', 'Application Support',
|
||||||
'Microsoft Edge', 'NativeMessagingHosts', manifestName);
|
'Microsoft Edge', 'NativeMessagingHosts', '$_hostName.json');
|
||||||
case Browser.firefox:
|
case Browser.firefox:
|
||||||
return path.join(home, 'Library', 'Application Support', 'Mozilla',
|
return path.join(home, 'Library', 'Application Support', 'Mozilla',
|
||||||
'NativeMessagingHosts', manifestName);
|
'NativeMessagingHosts', '$_hostName.json');
|
||||||
}
|
}
|
||||||
} else if (Platform.isLinux) {
|
} else if (Platform.isLinux) {
|
||||||
switch (browser) {
|
switch (browser) {
|
||||||
case Browser.chrome:
|
case Browser.chrome:
|
||||||
return path.join(home, '.config', 'google-chrome',
|
return path.join(home, '.config', 'google-chrome',
|
||||||
'NativeMessagingHosts', manifestName);
|
'NativeMessagingHosts', '$_hostName.json');
|
||||||
case Browser.edge:
|
case Browser.edge:
|
||||||
return path.join(home, '.config', 'microsoft-edge',
|
return path.join(home, '.config', 'microsoft-edge',
|
||||||
'NativeMessagingHosts', manifestName);
|
'NativeMessagingHosts', '$_hostName.json');
|
||||||
case Browser.firefox:
|
case Browser.firefox:
|
||||||
return path.join(
|
return path.join(
|
||||||
home, '.mozilla', 'native-messaging-hosts', manifestName);
|
home, '.mozilla', 'native-messaging-hosts', '$_hostName.json');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -267,20 +283,20 @@ Future<bool> _checkWindowsRegistry(String keyPath) async {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String> _getManifestContent(Browser browser) async {
|
Future<String> _getManifestContent() async {
|
||||||
final hostPath = Util.homePathJoin(_hostExecName);
|
final hostPath =
|
||||||
|
path.join((await getApplicationSupportDirectory()).path, _hostExecName);
|
||||||
final manifest = {
|
final manifest = {
|
||||||
'name': _hostName,
|
'name': _hostName,
|
||||||
'description': 'Gopeed browser extension host',
|
'description': 'Gopeed browser extension host',
|
||||||
'path': hostPath,
|
'path': hostPath,
|
||||||
'type': 'stdio',
|
'type': 'stdio',
|
||||||
if (browser != Browser.firefox)
|
'allowed_origins': [
|
||||||
'allowed_origins': [
|
'chrome-extension://$_chromeExtensionId/',
|
||||||
'chrome-extension://$_chromeExtensionId/',
|
'chrome-extension://$_edgeExtensionId/',
|
||||||
'chrome-extension://$_edgeExtensionId/',
|
..._debugExtensionIds.map((id) => 'chrome-extension://$id/'),
|
||||||
..._debugExtensionIds.map((id) => 'chrome-extension://$id/'),
|
],
|
||||||
],
|
'allowed_extensions': [_firefoxExtensionId],
|
||||||
if (browser == Browser.firefox) 'allowed_extensions': [_firefoxExtensionId],
|
|
||||||
};
|
};
|
||||||
return const JsonEncoder.withIndent(' ').convert(manifest);
|
return const JsonEncoder.withIndent(' ').convert(manifest);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,79 +0,0 @@
|
|||||||
import 'package:dio/dio.dart';
|
|
||||||
|
|
||||||
// List of mirrors for GitHub
|
|
||||||
const _sourceMirror = [
|
|
||||||
// ghfast.top: https://ghfast.top/https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt
|
|
||||||
["https://ghfast.top/", r"(.*)"],
|
|
||||||
// github.moeyy.xyz: https://github.moeyy.xyz/https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt
|
|
||||||
["https://github.moeyy.xyz/", r"(.*)"],
|
|
||||||
// jsdelivr: https://fastly.jsdelivr.net/gh/ngosang/trackerslist/trackers_all.txt
|
|
||||||
[
|
|
||||||
"https://fastly.jsdelivr.net/gh",
|
|
||||||
r".*raw.githubusercontent.com(/.*)(/.*)/(?:master|main)(/.*)"
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
||||||
// List of mirrors for GitHub release
|
|
||||||
const _assertMirror = [
|
|
||||||
// ghfast.top: https://ghfast.top/https://github.com/GopeedLab/gopeed/releases/download/v1.6.10/Gopeed-v1.6.10-windows-amd64.zip
|
|
||||||
["https://ghfast.top/", r"(.*)"],
|
|
||||||
// github.moeyy.xyz: https://github.moeyy.xyz/https://github.com/GopeedLab/gopeed/releases/download/v1.6.10/Gopeed-v1.6.10-windows-amd64.zip
|
|
||||||
["https://github.moeyy.xyz/", r"(.*)"],
|
|
||||||
];
|
|
||||||
|
|
||||||
enum MirrorType {
|
|
||||||
githubSource,
|
|
||||||
githubRelease,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Auto detect the best mirror for the given [rawUrl] and [type]
|
|
||||||
Future<String> githubAutoMirror(String rawUrl, MirrorType type) async {
|
|
||||||
final mirrorUrls = githubMirrorUrls(rawUrl, type);
|
|
||||||
|
|
||||||
// Ping all mirrors and get the fastest one
|
|
||||||
final pingResult = await Future.wait(mirrorUrls.map((e) async {
|
|
||||||
final client = Dio()
|
|
||||||
..options.sendTimeout = const Duration(seconds: 3)
|
|
||||||
..options.connectTimeout = const Duration(seconds: 3);
|
|
||||||
var time = DateTime.now().millisecondsSinceEpoch;
|
|
||||||
try {
|
|
||||||
final response = await client.head(e);
|
|
||||||
if (response.statusCode == 200) {
|
|
||||||
time = DateTime.now().millisecondsSinceEpoch - time;
|
|
||||||
return (e, time);
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
// ignore
|
|
||||||
} finally {
|
|
||||||
client.close();
|
|
||||||
}
|
|
||||||
return (e, -1);
|
|
||||||
}));
|
|
||||||
|
|
||||||
var list = pingResult.where((e) => e.$2 != -1).toList()
|
|
||||||
..sort((a, b) => a.$2.compareTo(b.$2));
|
|
||||||
if (list.isNotEmpty) {
|
|
||||||
return list.first.$1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rawUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<String> githubMirrorUrls(String rawUrl, MirrorType type) {
|
|
||||||
final mirrors = switch (type) {
|
|
||||||
MirrorType.githubSource => _sourceMirror,
|
|
||||||
MirrorType.githubRelease => _assertMirror,
|
|
||||||
};
|
|
||||||
|
|
||||||
final ret = <String>[];
|
|
||||||
for (final cdn in mirrors) {
|
|
||||||
final reg = RegExp(cdn[1]);
|
|
||||||
final match = reg.firstMatch(rawUrl.toString());
|
|
||||||
var matchStr = "";
|
|
||||||
for (var i = 1; i <= match!.groupCount; i++) {
|
|
||||||
matchStr += match.group(i)!;
|
|
||||||
}
|
|
||||||
ret.add("${cdn[0]}$matchStr");
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:macos_secure_bookmarks/macos_secure_bookmarks.dart';
|
|
||||||
|
|
||||||
import '../database/database.dart';
|
|
||||||
import 'util.dart';
|
|
||||||
|
|
||||||
class MacBookmarks {
|
|
||||||
static Future<void> saveBookmark(String dir) async {
|
|
||||||
if (!Util.isMacos()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final secureBookmarks = SecureBookmarks();
|
|
||||||
final bookmark = await secureBookmarks.bookmark(Directory(dir));
|
|
||||||
Database.instance.saveBookmark(MapEntry(dir, bookmark));
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<void> loadBookmark() async {
|
|
||||||
if (!Util.isMacos()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final secureBookmarks = SecureBookmarks();
|
|
||||||
final bookmark = Database.instance.getBookmark() ?? {};
|
|
||||||
bookmark.forEach((_, v) async {
|
|
||||||
final resolvedFile =
|
|
||||||
await secureBookmarks.resolveBookmark(v, isDirectory: true);
|
|
||||||
await secureBookmarks.startAccessingSecurityScopedResource(resolvedFile);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,432 +0,0 @@
|
|||||||
import 'dart:async';
|
|
||||||
import 'dart:convert';
|
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:dio/dio.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:get/get.dart';
|
|
||||||
import 'package:install_plugin/install_plugin.dart';
|
|
||||||
import 'package:path/path.dart' as path;
|
|
||||||
import 'package:path_provider/path_provider.dart';
|
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
|
||||||
|
|
||||||
import '../api/api.dart';
|
|
||||||
import '../app/views/outlined_button_loading.dart';
|
|
||||||
import 'arch/arch.dart';
|
|
||||||
import 'github_mirror.dart';
|
|
||||||
import 'log_util.dart';
|
|
||||||
import 'message.dart';
|
|
||||||
import 'package_info.dart';
|
|
||||||
import 'util.dart';
|
|
||||||
|
|
||||||
enum Channel {
|
|
||||||
windowsInstaller,
|
|
||||||
windowsPortable,
|
|
||||||
macosDmg,
|
|
||||||
linuxFlathub,
|
|
||||||
linuxSnap,
|
|
||||||
linuxDeb,
|
|
||||||
linuxAppImage,
|
|
||||||
androidApk,
|
|
||||||
iosIpa,
|
|
||||||
docker,
|
|
||||||
}
|
|
||||||
|
|
||||||
const _channelEnv = String.fromEnvironment("UPDATE_CHANNEL");
|
|
||||||
final _channel =
|
|
||||||
Channel.values.where((e) => e.name == _channelEnv).firstOrNull ??
|
|
||||||
() {
|
|
||||||
if (Util.isWindows()) {
|
|
||||||
return Channel.windowsPortable;
|
|
||||||
} else if (Util.isMacos()) {
|
|
||||||
return Channel.macosDmg;
|
|
||||||
} else if (Util.isAndroid()) {
|
|
||||||
return Channel.androidApk;
|
|
||||||
} else if (Util.isIOS()) {
|
|
||||||
return Channel.iosIpa;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
final _updaterBin = "updater${Util.isWindows() ? ".exe" : ""}";
|
|
||||||
|
|
||||||
Future<void> installUpdater() async {
|
|
||||||
await Util.installAsset(
|
|
||||||
'assets/exec/$_updaterBin', Util.homePathJoin(_updaterBin),
|
|
||||||
executable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
class VersionInfo {
|
|
||||||
final String version;
|
|
||||||
final String changeLog;
|
|
||||||
|
|
||||||
VersionInfo(this.version, this.changeLog);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<VersionInfo?> checkUpdate() async {
|
|
||||||
String? releaseDataStr;
|
|
||||||
try {
|
|
||||||
releaseDataStr = (await proxyRequest(
|
|
||||||
"https://api.github.com/repos/GopeedLab/gopeed/releases/latest"))
|
|
||||||
.data;
|
|
||||||
} catch (e) {
|
|
||||||
releaseDataStr =
|
|
||||||
(await proxyRequest("https://gopeed.com/api/release")).data;
|
|
||||||
}
|
|
||||||
if (releaseDataStr == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
final releaseData = jsonDecode(releaseDataStr);
|
|
||||||
final tagName = releaseData["tag_name"];
|
|
||||||
if (tagName == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
final latestVersion = releaseData["tag_name"].substring(1);
|
|
||||||
|
|
||||||
// compare version x.y.z to x.y.z
|
|
||||||
final currentVersion = packageInfo.version;
|
|
||||||
var isNewVersion = false;
|
|
||||||
if (latestVersion != currentVersion) {
|
|
||||||
final currentVersionList = currentVersion.split(".");
|
|
||||||
final latestVersionList = latestVersion.split(".");
|
|
||||||
for (var i = 0; i < currentVersionList.length; i++) {
|
|
||||||
if (int.parse(latestVersionList[i]) > int.parse(currentVersionList[i])) {
|
|
||||||
isNewVersion = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isNewVersion) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return VersionInfo(latestVersion, releaseData["body"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> showUpdateDialog(
|
|
||||||
BuildContext context, VersionInfo versionInfo) async {
|
|
||||||
final fullChangeLog = versionInfo.changeLog;
|
|
||||||
final isZh = Get.locale?.languageCode == "zh";
|
|
||||||
final changeLogRegex = isZh
|
|
||||||
? RegExp(r"(#\s+更新日志.*)", multiLine: true, dotAll: true)
|
|
||||||
: RegExp(r"(# Release notes.*)#\s+更新日志", multiLine: true, dotAll: true);
|
|
||||||
final changeLog = changeLogRegex.firstMatch(fullChangeLog)?.group(1) ?? "";
|
|
||||||
await showDialog(
|
|
||||||
context: Get.context!,
|
|
||||||
barrierDismissible: false,
|
|
||||||
builder: (context) {
|
|
||||||
bool isDownloading = false;
|
|
||||||
double progress = 0;
|
|
||||||
int total = 0;
|
|
||||||
final buttonController = OutlinedButtonLoadingController();
|
|
||||||
return StatefulBuilder(
|
|
||||||
builder: (context, setState) {
|
|
||||||
final screenSize = MediaQuery.of(context).size;
|
|
||||||
final dialogWidth =
|
|
||||||
screenSize.width < 500 ? screenSize.width * 0.9 : 500.0;
|
|
||||||
final dialogHeight =
|
|
||||||
screenSize.height < 600 ? screenSize.height * 0.8 : 400.0;
|
|
||||||
|
|
||||||
return Dialog(
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
),
|
|
||||||
child: SizedBox(
|
|
||||||
width: dialogWidth,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(20),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'newVersionTitle'
|
|
||||||
.trParams({'version': versionInfo.version}),
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
Container(
|
|
||||||
height: dialogHeight * 0.5,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border:
|
|
||||||
Border.all(color: Theme.of(context).dividerColor),
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: ScrollConfiguration(
|
|
||||||
behavior: ScrollConfiguration.of(context).copyWith(
|
|
||||||
scrollbars: true,
|
|
||||||
),
|
|
||||||
child: Builder(
|
|
||||||
builder: (context) {
|
|
||||||
final controller = ScrollController();
|
|
||||||
return Scrollbar(
|
|
||||||
controller: controller,
|
|
||||||
thumbVisibility: true,
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
controller: controller,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(12),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment:
|
|
||||||
CrossAxisAlignment.start,
|
|
||||||
children:
|
|
||||||
_parseMarkdown(changeLog, context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (isDownloading) ...[
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
LinearProgressIndicator(
|
|
||||||
value: progress,
|
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(
|
|
||||||
Theme.of(context).colorScheme.primary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 4),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'${(progress * 100).toStringAsFixed(1)}%',
|
|
||||||
style: const TextStyle(fontSize: 12),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
total == 0
|
|
||||||
? ''
|
|
||||||
: '${Util.fmtByte((total * progress).toInt())} / ${Util.fmtByte(total)}',
|
|
||||||
style: const TextStyle(fontSize: 12),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: isDownloading ? null : () => Get.back(),
|
|
||||||
child: Text(
|
|
||||||
'newVersionLater'.tr,
|
|
||||||
style: TextStyle(
|
|
||||||
color: isDownloading
|
|
||||||
? Theme.of(context).disabledColor
|
|
||||||
: Theme.of(context).colorScheme.error),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 8),
|
|
||||||
OutlinedButtonLoading(
|
|
||||||
controller: buttonController,
|
|
||||||
onPressed: () async {
|
|
||||||
setState(() {
|
|
||||||
isDownloading = true;
|
|
||||||
});
|
|
||||||
buttonController.start();
|
|
||||||
try {
|
|
||||||
await _update(versionInfo.version,
|
|
||||||
(received, fileTotal) {
|
|
||||||
setState(() {
|
|
||||||
total = fileTotal;
|
|
||||||
progress = received / fileTotal;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
showErrorMessage(e);
|
|
||||||
} finally {
|
|
||||||
setState(() {
|
|
||||||
isDownloading = false;
|
|
||||||
});
|
|
||||||
buttonController.stop();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Text('newVersionUpdate'.tr),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Widget> _parseMarkdown(String markdown, BuildContext context) {
|
|
||||||
final List<Widget> widgets = [];
|
|
||||||
final lines = markdown.split('\n');
|
|
||||||
|
|
||||||
for (final line in lines) {
|
|
||||||
if (line.trim().isEmpty) continue;
|
|
||||||
if (line.startsWith('# ')) {
|
|
||||||
// H1 header
|
|
||||||
widgets.add(Text(
|
|
||||||
line.substring(2),
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 18,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
));
|
|
||||||
} else if (line.startsWith('## ')) {
|
|
||||||
// H2 header
|
|
||||||
widgets.add(Text(
|
|
||||||
line.substring(3),
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
));
|
|
||||||
} else if (line.trim().startsWith('- ')) {
|
|
||||||
// List item
|
|
||||||
widgets.add(Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 8),
|
|
||||||
child: Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
const Text('• ', style: TextStyle(fontSize: 14)),
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
line.substring(line.indexOf('-') + 1).trim().replaceFirst(
|
|
||||||
RegExp(r'@[^\s]*\s\(#\d+\)'),
|
|
||||||
''), // Remove contributor and pr number
|
|
||||||
style: const TextStyle(fontSize: 14),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
));
|
|
||||||
} else {
|
|
||||||
// Normal text
|
|
||||||
widgets.add(Text(
|
|
||||||
line,
|
|
||||||
style: const TextStyle(fontSize: 14),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add spacing between elements
|
|
||||||
widgets.add(const SizedBox(height: 8));
|
|
||||||
}
|
|
||||||
|
|
||||||
return widgets;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _update(String version, Function(int, int) onProgress) async {
|
|
||||||
var newVersionAssetPath = "";
|
|
||||||
final newVersionAssetName = _getAssetName(version);
|
|
||||||
|
|
||||||
// Need to download the asset
|
|
||||||
if (newVersionAssetName.isNotEmpty) {
|
|
||||||
final downloadUrl =
|
|
||||||
'https://github.com/GopeedLab/gopeed/releases/download/v$version/$newVersionAssetName';
|
|
||||||
newVersionAssetPath = await _getAssetPath(version);
|
|
||||||
|
|
||||||
if (downloadUrl.isNotEmpty) {
|
|
||||||
final fastDownloadUrl =
|
|
||||||
await githubAutoMirror(downloadUrl, MirrorType.githubRelease);
|
|
||||||
final downloadClient = Dio();
|
|
||||||
await downloadClient.download(fastDownloadUrl, newVersionAssetPath,
|
|
||||||
onReceiveProgress: onProgress);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (_channel) {
|
|
||||||
case Channel.windowsInstaller:
|
|
||||||
case Channel.windowsPortable:
|
|
||||||
case Channel.macosDmg:
|
|
||||||
case Channel.linuxFlathub:
|
|
||||||
case Channel.linuxSnap:
|
|
||||||
case Channel.linuxDeb:
|
|
||||||
final updaterPath = Util.homePathJoin(_updaterBin);
|
|
||||||
// Check the updater binary is exists
|
|
||||||
if (!await File(updaterPath).exists()) {
|
|
||||||
await launchUrl(
|
|
||||||
Uri.parse(
|
|
||||||
'https://github.com/GopeedLab/gopeed/releases/tag/v$version'),
|
|
||||||
mode: LaunchMode.externalApplication);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*Usage of updater command:
|
|
||||||
-pid int
|
|
||||||
PID of the process to update
|
|
||||||
-channel string
|
|
||||||
Update channel
|
|
||||||
-asset string
|
|
||||||
Path to the package asset
|
|
||||||
-log string
|
|
||||||
Log file path
|
|
||||||
*/
|
|
||||||
await Process.run(updaterPath, [
|
|
||||||
"-pid",
|
|
||||||
pid.toString(),
|
|
||||||
"-channel",
|
|
||||||
_channel!.name,
|
|
||||||
"-asset",
|
|
||||||
newVersionAssetPath,
|
|
||||||
"-log",
|
|
||||||
path.join(logsDir(), "updater.log")
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
case Channel.androidApk:
|
|
||||||
await InstallPlugin.installApk(newVersionAssetPath);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
await launchUrl(
|
|
||||||
Uri.parse(
|
|
||||||
'https://github.com/GopeedLab/gopeed/releases/tag/v$version'),
|
|
||||||
mode: LaunchMode.externalApplication);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String _getAssetName(String version) {
|
|
||||||
final arch = getArch();
|
|
||||||
|
|
||||||
String commonArchName() {
|
|
||||||
return switch (arch) {
|
|
||||||
Architecture.ia32 => "386",
|
|
||||||
Architecture.x64 => "amd64",
|
|
||||||
_ => arch.name
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (_channel) {
|
|
||||||
case Channel.windowsInstaller:
|
|
||||||
return 'Gopeed-v$version-windows-${commonArchName()}.zip';
|
|
||||||
case Channel.windowsPortable:
|
|
||||||
return 'Gopeed-v$version-windows-${commonArchName()}-portable.zip';
|
|
||||||
case Channel.macosDmg:
|
|
||||||
return 'Gopeed-v$version-macos.dmg';
|
|
||||||
case Channel.linuxDeb:
|
|
||||||
return 'Gopeed-v$version-linux-${commonArchName()}.deb';
|
|
||||||
case Channel.androidApk:
|
|
||||||
final apkArchName = switch (arch) {
|
|
||||||
Architecture.arm => "armeabi-v7a",
|
|
||||||
Architecture.arm64 => "arm64-v8a",
|
|
||||||
Architecture.x64 => "x86_64",
|
|
||||||
_ => null
|
|
||||||
};
|
|
||||||
var apkNamePrefix = "Gopeed-v$version-android";
|
|
||||||
if (apkArchName != null) {
|
|
||||||
apkNamePrefix += "-$apkArchName";
|
|
||||||
}
|
|
||||||
return "$apkNamePrefix.apk";
|
|
||||||
default:
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<String> _getAssetPath(String version) async {
|
|
||||||
return path.join(
|
|
||||||
(await getTemporaryDirectory()).path, _getAssetName(version));
|
|
||||||
}
|
|
||||||
@@ -2,9 +2,7 @@ import 'dart:async';
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:crypto/crypto.dart';
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
|
|
||||||
@@ -155,45 +153,4 @@ class Util {
|
|||||||
timer = Timer(Duration(milliseconds: ms), fn);
|
timer = Timer(Duration(milliseconds: ms), fn);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static String homePathJoin(String fileName) {
|
|
||||||
final execPath = Platform.resolvedExecutable;
|
|
||||||
final execDir = path.dirname(execPath);
|
|
||||||
return path.join(execDir, fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<void> installAsset(String assetPath, String targetPath,
|
|
||||||
{bool executable = false}) async {
|
|
||||||
Future<List<int>> getAssetData() async {
|
|
||||||
final asset = await rootBundle.load(assetPath);
|
|
||||||
return asset.buffer.asUint8List(asset.offsetInBytes, asset.lengthInBytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if target file is not installed
|
|
||||||
if (!await File(targetPath).exists()) {
|
|
||||||
final assetData = await getAssetData();
|
|
||||||
final file = File(targetPath);
|
|
||||||
await file.writeAsBytes(assetData);
|
|
||||||
// Add execute permission when file first created
|
|
||||||
if (executable && !Platform.isWindows) {
|
|
||||||
await Process.run('chmod', ['+x', targetPath]);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if target file needs to be updated
|
|
||||||
final assetData = await getAssetData();
|
|
||||||
if (_md5(assetData) != await _md5File(File(targetPath))) {
|
|
||||||
await File(targetPath).writeAsBytes(assetData);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static String _md5(List<int> data) {
|
|
||||||
return md5.convert(data).toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<String> _md5File(File file) async {
|
|
||||||
return file.openRead().transform(md5).first.toString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,6 @@ Terminal=false
|
|||||||
Exec=gopeed %U
|
Exec=gopeed %U
|
||||||
Icon=com.gopeed.Gopeed
|
Icon=com.gopeed.Gopeed
|
||||||
Type=Application
|
Type=Application
|
||||||
Categories=Utility;Network;
|
Categories=Utility;Internet
|
||||||
Keywords=Bittorrent;Downloader;
|
Keywords=Bittorrent;Downloader;
|
||||||
MimeType=x-scheme-handler/gopeed;x-scheme-handler/magnet;application/x-bittorrent;
|
MimeType=x-scheme-handler/gopeed;x-scheme-handler/magnet;application/x-bittorrent;
|
||||||
@@ -6,8 +6,6 @@ PODS:
|
|||||||
- device_info_plus (0.0.1):
|
- device_info_plus (0.0.1):
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- FlutterMacOS (1.0.0)
|
- FlutterMacOS (1.0.0)
|
||||||
- macos_secure_bookmarks (0.0.3):
|
|
||||||
- FlutterMacOS
|
|
||||||
- package_info_plus (0.0.1):
|
- package_info_plus (0.0.1):
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- path_provider_foundation (0.0.1):
|
- path_provider_foundation (0.0.1):
|
||||||
@@ -32,7 +30,6 @@ DEPENDENCIES:
|
|||||||
- desktop_drop (from `Flutter/ephemeral/.symlinks/plugins/desktop_drop/macos`)
|
- desktop_drop (from `Flutter/ephemeral/.symlinks/plugins/desktop_drop/macos`)
|
||||||
- device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`)
|
- device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`)
|
||||||
- FlutterMacOS (from `Flutter/ephemeral`)
|
- FlutterMacOS (from `Flutter/ephemeral`)
|
||||||
- macos_secure_bookmarks (from `Flutter/ephemeral/.symlinks/plugins/macos_secure_bookmarks/macos`)
|
|
||||||
- package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)
|
- package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)
|
||||||
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
|
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
|
||||||
- screen_retriever (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos`)
|
- screen_retriever (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos`)
|
||||||
@@ -51,8 +48,6 @@ EXTERNAL SOURCES:
|
|||||||
:path: Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos
|
:path: Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos
|
||||||
FlutterMacOS:
|
FlutterMacOS:
|
||||||
:path: Flutter/ephemeral
|
:path: Flutter/ephemeral
|
||||||
macos_secure_bookmarks:
|
|
||||||
:path: Flutter/ephemeral/.symlinks/plugins/macos_secure_bookmarks/macos
|
|
||||||
package_info_plus:
|
package_info_plus:
|
||||||
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos
|
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos
|
||||||
path_provider_foundation:
|
path_provider_foundation:
|
||||||
@@ -75,7 +70,6 @@ SPEC CHECKSUMS:
|
|||||||
desktop_drop: 69eeff437544aa619c8db7f4481b3a65f7696898
|
desktop_drop: 69eeff437544aa619c8db7f4481b3a65f7696898
|
||||||
device_info_plus: 74e614483d05c89290d30a4c8feae15d555f7427
|
device_info_plus: 74e614483d05c89290d30a4c8feae15d555f7427
|
||||||
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
|
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
|
||||||
macos_secure_bookmarks: cff041c4b377fa00941bb901aaec4d27fac5edf2
|
|
||||||
package_info_plus: f5790acc797bf17c3e959e9d6cf162cc68ff7523
|
package_info_plus: f5790acc797bf17c3e959e9d6cf162cc68ff7523
|
||||||
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
||||||
screen_retriever: 59634572a57080243dd1bf715e55b6c54f241a38
|
screen_retriever: 59634572a57080243dd1bf715e55b6c54f241a38
|
||||||
|
|||||||
@@ -1,39 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>com.apple.security.app-sandbox</key>
|
<key>com.apple.security.cs.allow-jit</key>
|
||||||
<true />
|
<true/>
|
||||||
<key>com.apple.security.cs.allow-jit</key>
|
<key>com.apple.security.files.bookmarks.app-scope</key>
|
||||||
<true />
|
<true/>
|
||||||
<key>com.apple.security.files.bookmarks.app-scope</key>
|
</dict>
|
||||||
<true />
|
</plist>
|
||||||
<key>com.apple.security.files.downloads.read-write</key>
|
|
||||||
<true />
|
|
||||||
<key>com.apple.security.files.user-selected.read-write</key>
|
|
||||||
<true />
|
|
||||||
<key>com.apple.security.network.client</key>
|
|
||||||
<true />
|
|
||||||
<key>com.apple.security.network.server</key>
|
|
||||||
<true />
|
|
||||||
<key>com.apple.security.temporary-exception.files.home-relative-path.read-write</key>
|
|
||||||
<array>
|
|
||||||
<string>/Library/Application Support/Mozilla/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Google/Chrome/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Google/Chrome Beta/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Google/Chrome Dev/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Google/Chrome Canary/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Chromium/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Microsoft Edge/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Microsoft Edge Beta/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Microsoft Edge Dev/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Microsoft Edge Canary/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Vivaldi/NativeMessagingHosts/</string>
|
|
||||||
<string>/code/go/gopeed/ui/flutter/build/macos/Build/Products/Debug/Gopeed.app/Contents/MacOS/</string>
|
|
||||||
</array>
|
|
||||||
<key>com.apple.security.temporary-exception.files.home-relative-path.execute</key>
|
|
||||||
<array>
|
|
||||||
<string>/code/go/gopeed/ui/flutter/build/macos/Build/Products/Debug/Gopeed.app/Contents/MacOS/</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
@@ -1,33 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>com.apple.security.app-sandbox</key>
|
<key>com.apple.security.files.bookmarks.app-scope</key>
|
||||||
<true />
|
<true/>
|
||||||
<key>com.apple.security.files.bookmarks.app-scope</key>
|
</dict>
|
||||||
<true />
|
</plist>
|
||||||
<key>com.apple.security.files.downloads.read-write</key>
|
|
||||||
<true />
|
|
||||||
<key>com.apple.security.files.user-selected.read-write</key>
|
|
||||||
<true />
|
|
||||||
<key>com.apple.security.network.client</key>
|
|
||||||
<true />
|
|
||||||
<key>com.apple.security.network.server</key>
|
|
||||||
<true />
|
|
||||||
<key>com.apple.security.temporary-exception.files.home-relative-path.read-write</key>
|
|
||||||
<array>
|
|
||||||
<string>/Library/Application Support/Mozilla/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Google/Chrome/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Google/Chrome Beta/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Google/Chrome Dev/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Google/Chrome Canary/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Chromium/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Microsoft Edge/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Microsoft Edge Beta/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Microsoft Edge Dev/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Microsoft Edge Canary/NativeMessagingHosts/</string>
|
|
||||||
<string>/Library/Application Support/Vivaldi/NativeMessagingHosts/</string>
|
|
||||||
<string>/code/go/gopeed/ui/flutter/build/macos/Build/Products/Debug/Gopeed.app/Contents/MacOS/</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
+1
-26
@@ -271,7 +271,7 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.4+2"
|
version: "0.3.4+2"
|
||||||
crypto:
|
crypto:
|
||||||
dependency: "direct main"
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: crypto
|
name: crypto
|
||||||
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
|
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
|
||||||
@@ -546,15 +546,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.3.0"
|
version: "4.3.0"
|
||||||
install_plugin:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
path: "."
|
|
||||||
ref: cf08af829f4a4145634f8a047108f505fdbe5eaa
|
|
||||||
resolved-ref: cf08af829f4a4145634f8a047108f505fdbe5eaa
|
|
||||||
url: "https://github.com/hui-z/flutter_install_plugin.git"
|
|
||||||
source: git
|
|
||||||
version: "2.1.0"
|
|
||||||
intl:
|
intl:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -667,22 +658,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.3.0"
|
||||||
logging_appenders:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: logging_appenders
|
|
||||||
sha256: e329e7472f99416d0edaaf6451fe6c02dec91d34535bd252e284a0b94ab23d79
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.3.1"
|
|
||||||
macos_secure_bookmarks:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: macos_secure_bookmarks
|
|
||||||
sha256: c3163875f8fd530a1654a7cf8aa426e6e208d28bf05724a1d4960e4b7d2ca1c6
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.2.1"
|
|
||||||
macros:
|
macros:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
|||||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 1.6.9+1
|
version: 1.6.7+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.0.0 <4.0.0"
|
sdk: ">=3.0.0 <4.0.0"
|
||||||
@@ -71,12 +71,6 @@ dependencies:
|
|||||||
contentsize_tabbarview: ^0.0.2
|
contentsize_tabbarview: ^0.0.2
|
||||||
win32_registry: ^1.1.5
|
win32_registry: ^1.1.5
|
||||||
share_handler: ^0.0.22
|
share_handler: ^0.0.22
|
||||||
crypto: ^3.0.6
|
|
||||||
install_plugin:
|
|
||||||
git:
|
|
||||||
url: https://github.com/hui-z/flutter_install_plugin.git
|
|
||||||
ref: cf08af829f4a4145634f8a047108f505fdbe5eaa
|
|
||||||
macos_secure_bookmarks: ^0.2.1
|
|
||||||
dependency_overrides:
|
dependency_overrides:
|
||||||
permission_handler_windows:
|
permission_handler_windows:
|
||||||
git:
|
git:
|
||||||
@@ -114,7 +108,7 @@ flutter:
|
|||||||
- assets/tray_icon/
|
- assets/tray_icon/
|
||||||
- assets/extension/
|
- assets/extension/
|
||||||
# Browser extension native host binary, see https://github.com/GopeedLab/gopeed/tree/main/cmd/host
|
# Browser extension native host binary, see https://github.com/GopeedLab/gopeed/tree/main/cmd/host
|
||||||
- assets/exec/
|
- assets/host/
|
||||||
|
|
||||||
# An image asset can refer to one or more resolution-specific "variants", see
|
# An image asset can refer to one or more resolution-specific "variants", see
|
||||||
# https://flutter.dev/assets-and-images/#resolution-aware
|
# https://flutter.dev/assets-and-images/#resolution-aware
|
||||||
|
|||||||
Reference in new issue
Block a user