Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09aea55b49 | ||
|
|
c0cd2d7255 | ||
|
|
b00f4a1ed0 | ||
|
|
06766eea56 | ||
|
|
0f0c8f27bd |
No files matched your search
@@ -39,7 +39,7 @@ jobs:
|
|||||||
VERSION: ${{ needs.get-release.outputs.tag_name }}
|
VERSION: ${{ needs.get-release.outputs.tag_name }}
|
||||||
run: |
|
run: |
|
||||||
Invoke-WebRequest -Uri "https://github.com/jrsoftware/issrc/raw/main/Files/Languages/Unofficial/ChineseSimplified.isl" -OutFile "ChineseSimplified.isl"
|
Invoke-WebRequest -Uri "https://github.com/jrsoftware/issrc/raw/main/Files/Languages/Unofficial/ChineseSimplified.isl" -OutFile "ChineseSimplified.isl"
|
||||||
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" -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
|
||||||
cd ui/flutter
|
cd ui/flutter
|
||||||
@@ -90,7 +90,7 @@ jobs:
|
|||||||
SolidCompression=yes
|
SolidCompression=yes
|
||||||
WizardStyle=modern
|
WizardStyle=modern
|
||||||
LanguageDetectionMethod=uilanguage
|
LanguageDetectionMethod=uilanguage
|
||||||
ShowLanguageDialog=yes
|
ShowLanguageDialog=yes
|
||||||
|
|
||||||
[Languages]
|
[Languages]
|
||||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
@@ -166,7 +166,7 @@ jobs:
|
|||||||
VERSION: ${{ needs.get-release.outputs.tag_name }}
|
VERSION: ${{ needs.get-release.outputs.tag_name }}
|
||||||
run: |
|
run: |
|
||||||
PROJECT_DIR=$(pwd)
|
PROJECT_DIR=$(pwd)
|
||||||
|
|
||||||
# amd64 lib
|
# amd64 lib
|
||||||
go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/lib-amd64/libgopeed.dylib github.com/GopeedLab/gopeed/bind/desktop
|
go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/lib-amd64/libgopeed.dylib github.com/GopeedLab/gopeed/bind/desktop
|
||||||
# universal binary
|
# universal binary
|
||||||
@@ -221,13 +221,13 @@ jobs:
|
|||||||
mkdir -p debian/gui
|
mkdir -p debian/gui
|
||||||
cp assets/icon/icon_1024.png debian/gui/gopeed.png
|
cp assets/icon/icon_1024.png debian/gui/gopeed.png
|
||||||
cat>debian/debian.yaml<<EOF
|
cat>debian/debian.yaml<<EOF
|
||||||
flutter_app:
|
flutter_app:
|
||||||
command: gopeed
|
command: gopeed
|
||||||
arch: x64
|
arch: x64
|
||||||
parent: /usr/local/lib
|
parent: /usr/local/lib
|
||||||
control:
|
control:
|
||||||
Package: gopeed
|
Package: gopeed
|
||||||
Version: ${VERSION:1}
|
Version: ${VERSION:1}
|
||||||
Architecture: amd64
|
Architecture: amd64
|
||||||
Essential: no
|
Essential: no
|
||||||
Priority: optional
|
Priority: optional
|
||||||
@@ -238,7 +238,7 @@ jobs:
|
|||||||
|
|
||||||
cat>debian/gui/gopeed.desktop<<EOF
|
cat>debian/gui/gopeed.desktop<<EOF
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Version=${VERSION:1}
|
Version=${VERSION:1}
|
||||||
Name=Gopeed
|
Name=Gopeed
|
||||||
GenericName=Gopeed
|
GenericName=Gopeed
|
||||||
Comment=High speed downloader that supports all platforms.
|
Comment=High speed downloader that supports all platforms.
|
||||||
@@ -294,6 +294,38 @@ jobs:
|
|||||||
upload_url: ${{ needs.get-release.outputs.upload_url }}
|
upload_url: ${{ needs.get-release.outputs.upload_url }}
|
||||||
asset_path: ui/flutter/dist/*
|
asset_path: ui/flutter/dist/*
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
build-ios:
|
||||||
|
runs-on: macos-latest
|
||||||
|
needs: [get-release]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-go@v4
|
||||||
|
with:
|
||||||
|
go-version: ${{ env.GO_VERSION }}
|
||||||
|
- uses: subosito/flutter-action@v2
|
||||||
|
with:
|
||||||
|
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||||
|
- name: Build
|
||||||
|
env:
|
||||||
|
VERSION: ${{ needs.get-release.outputs.tag_name }}
|
||||||
|
run: |
|
||||||
|
go install golang.org/x/mobile/cmd/gomobile@latest
|
||||||
|
go get golang.org/x/mobile/bind
|
||||||
|
gomobile init
|
||||||
|
gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/ios/Frameworks/Libgopeed.xcframework -target=ios github.com/GopeedLab/gopeed/bind/mobile
|
||||||
|
cd ui/flutter
|
||||||
|
flutter build ios --no-codesign
|
||||||
|
mkdir Payload
|
||||||
|
cp -r build/ios/iphoneos/Runner.app Payload
|
||||||
|
zip -r -y Payload.zip Payload/Runner.app
|
||||||
|
mkdir dist
|
||||||
|
mv Payload.zip dist/Gopeed-$VERSION-ios.ipa
|
||||||
|
- name: Upload
|
||||||
|
uses: shogo82148/actions-upload-release-asset@v1
|
||||||
|
with:
|
||||||
|
upload_url: ${{ needs.get-release.outputs.upload_url }}
|
||||||
|
asset_path: ui/flutter/dist/*
|
||||||
|
overwrite: true
|
||||||
build-web:
|
build-web:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [get-release]
|
needs: [get-release]
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Visit ✈ [Official Website](https://gopeed.com) | 📖 [Develop Docs](https://d
|
|||||||
- [x] macos
|
- [x] macos
|
||||||
- [x] linux
|
- [x] linux
|
||||||
- [x] android
|
- [x] android
|
||||||
- [ ] ios
|
- [x] ios
|
||||||
- [x] web
|
- [x] web
|
||||||
- [x] docker
|
- [x] docker
|
||||||
|
|
||||||
@@ -138,6 +138,14 @@ cd ui/flutter
|
|||||||
flutter build apk
|
flutter build apk
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- ios
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/ios/Frameworks/Libgopeed.xcframework -target=ios github.com/GopeedLab/gopeed/bind/mobile
|
||||||
|
cd ui/flutter
|
||||||
|
flutter build ios --no-codesign
|
||||||
|
```
|
||||||
|
|
||||||
#### Web
|
#### Web
|
||||||
|
|
||||||
command:
|
command:
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Gopeed (正式名 Go Speed) は `Golang` + `Flutter` によって開発された
|
|||||||
- [x] macos
|
- [x] macos
|
||||||
- [x] linux
|
- [x] linux
|
||||||
- [x] android
|
- [x] android
|
||||||
- [ ] ios
|
- [x] ios
|
||||||
- [x] web
|
- [x] web
|
||||||
- [x] docker
|
- [x] docker
|
||||||
|
|
||||||
@@ -138,6 +138,14 @@ cd ui/flutter
|
|||||||
flutter build apk
|
flutter build apk
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- ios
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/ios/Frameworks/Libgopeed.xcframework -target=ios github.com/GopeedLab/gopeed/bind/mobile
|
||||||
|
cd ui/flutter
|
||||||
|
flutter build ios --no-codesign
|
||||||
|
```
|
||||||
|
|
||||||
#### Web
|
#### Web
|
||||||
|
|
||||||
コマンド:
|
コマンド:
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Gopeed(全称 Go Speed),是一款由`Golang`+`Flutter`开发的高速下
|
|||||||
- [x] macos
|
- [x] macos
|
||||||
- [x] linux
|
- [x] linux
|
||||||
- [x] android
|
- [x] android
|
||||||
- [ ] ios
|
- [x] ios
|
||||||
- [x] web
|
- [x] web
|
||||||
- [x] docker
|
- [x] docker
|
||||||
|
|
||||||
@@ -138,6 +138,14 @@ cd ui/flutter
|
|||||||
flutter build apk
|
flutter build apk
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- ios
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/ios/Frameworks/Libgopeed.xcframework -target=ios github.com/GopeedLab/gopeed/bind/mobile
|
||||||
|
cd ui/flutter
|
||||||
|
flutter build ios --no-codesign
|
||||||
|
```
|
||||||
|
|
||||||
#### Web 端
|
#### Web 端
|
||||||
|
|
||||||
构建命令:
|
构建命令:
|
||||||
|
|||||||
@@ -31,12 +31,8 @@ class MainActivity : FlutterActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
"stop" -> {
|
"stop" -> {
|
||||||
try {
|
Libgopeed.stop()
|
||||||
Libgopeed.stop()
|
result.success(null)
|
||||||
result.success(null)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
result.error("ERROR", e.message, null)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
result.notImplemented()
|
result.notImplemented()
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
"downloadDirValid": "请选择下载目录",
|
"downloadDirValid": "请选择下载目录",
|
||||||
"connections": "连接数",
|
"connections": "连接数",
|
||||||
"maxRunning": "最大下载数",
|
"maxRunning": "最大下载数",
|
||||||
"items": "@count 条",
|
"items": "@count 项",
|
||||||
"subscribeTracker": "订阅 Tracker",
|
"subscribeTracker": "订阅 Tracker",
|
||||||
"subscribeFail": "订阅失败,请检查网络或稍后重试",
|
"subscribeFail": "订阅失败,请检查网络或稍后重试",
|
||||||
"update": "更新",
|
"update": "更新",
|
||||||
|
|||||||
@@ -21,6 +21,6 @@
|
|||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.0</string>
|
<string>1.0</string>
|
||||||
<key>MinimumOSVersion</key>
|
<key>MinimumOSVersion</key>
|
||||||
<string>9.0</string>
|
<string>11.0</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# Uncomment this line to define a global platform for your project
|
# Uncomment this line to define a global platform for your project
|
||||||
# platform :ios, '9.0'
|
# platform :ios, '11.0'
|
||||||
|
|
||||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
PODS:
|
||||||
|
- file_selector_ios (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- Flutter (1.0.0)
|
||||||
|
- package_info_plus (0.4.5):
|
||||||
|
- Flutter
|
||||||
|
- path_provider_ios (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- permission_handler_apple (9.0.4):
|
||||||
|
- Flutter
|
||||||
|
- shared_preferences_ios (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- url_launcher_ios (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
|
||||||
|
DEPENDENCIES:
|
||||||
|
- file_selector_ios (from `.symlinks/plugins/file_selector_ios/ios`)
|
||||||
|
- Flutter (from `Flutter`)
|
||||||
|
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
||||||
|
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
|
||||||
|
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
|
||||||
|
- shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`)
|
||||||
|
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||||
|
|
||||||
|
EXTERNAL SOURCES:
|
||||||
|
file_selector_ios:
|
||||||
|
:path: ".symlinks/plugins/file_selector_ios/ios"
|
||||||
|
Flutter:
|
||||||
|
:path: Flutter
|
||||||
|
package_info_plus:
|
||||||
|
:path: ".symlinks/plugins/package_info_plus/ios"
|
||||||
|
path_provider_ios:
|
||||||
|
:path: ".symlinks/plugins/path_provider_ios/ios"
|
||||||
|
permission_handler_apple:
|
||||||
|
:path: ".symlinks/plugins/permission_handler_apple/ios"
|
||||||
|
shared_preferences_ios:
|
||||||
|
:path: ".symlinks/plugins/shared_preferences_ios/ios"
|
||||||
|
url_launcher_ios:
|
||||||
|
:path: ".symlinks/plugins/url_launcher_ios/ios"
|
||||||
|
|
||||||
|
SPEC CHECKSUMS:
|
||||||
|
file_selector_ios: 6e9b6d7300556c730f224905726f0a2d5d874e51
|
||||||
|
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||||
|
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
|
||||||
|
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
|
||||||
|
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
|
||||||
|
shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad
|
||||||
|
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
|
||||||
|
|
||||||
|
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
|
||||||
|
|
||||||
|
COCOAPODS: 1.11.3
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
archiveVersion = 1;
|
archiveVersion = 1;
|
||||||
classes = {
|
classes = {
|
||||||
};
|
};
|
||||||
objectVersion = 50;
|
objectVersion = 54;
|
||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
@@ -13,28 +13,36 @@
|
|||||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||||
|
D081C25C294826C0006EB10B /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D081C25B294826C0006EB10B /* libc++.tbd */; };
|
||||||
|
D0E623A929482D160001185E /* Libgopeed.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0E623A729482D030001185E /* Libgopeed.xcframework */; };
|
||||||
|
D0E623AA29482D160001185E /* Libgopeed.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D0E623A729482D030001185E /* Libgopeed.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||||
|
DCA5B0FA95A8007ADEDACA1B /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70BC8D37FAC641C7F20125E8 /* Pods_Runner.framework */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXCopyFilesBuildPhase section */
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
|
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
|
||||||
isa = PBXCopyFilesBuildPhase;
|
isa = PBXCopyFilesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 8;
|
||||||
dstPath = "";
|
dstPath = "";
|
||||||
dstSubfolderSpec = 10;
|
dstSubfolderSpec = 10;
|
||||||
files = (
|
files = (
|
||||||
|
D0E623AA29482D160001185E /* Libgopeed.xcframework in Embed Frameworks */,
|
||||||
);
|
);
|
||||||
name = "Embed Frameworks";
|
name = "Embed Frameworks";
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 1;
|
||||||
};
|
};
|
||||||
/* End PBXCopyFilesBuildPhase section */
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||||
|
25B61E78A388C87913468FD6 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||||
|
70BC8D37FAC641C7F20125E8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||||
|
97232923D357E56CAA39281D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||||
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||||
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
@@ -42,6 +50,9 @@
|
|||||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
|
BC90D28B9068C663815415CC /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
D081C25B294826C0006EB10B /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
|
||||||
|
D0E623A729482D030001185E /* Libgopeed.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Libgopeed.xcframework; path = Frameworks/Libgopeed.xcframework; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@@ -49,6 +60,9 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
D0E623A929482D160001185E /* Libgopeed.xcframework in Frameworks */,
|
||||||
|
D081C25C294826C0006EB10B /* libc++.tbd in Frameworks */,
|
||||||
|
DCA5B0FA95A8007ADEDACA1B /* Pods_Runner.framework in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -72,6 +86,8 @@
|
|||||||
9740EEB11CF90186004384FC /* Flutter */,
|
9740EEB11CF90186004384FC /* Flutter */,
|
||||||
97C146F01CF9000F007C117D /* Runner */,
|
97C146F01CF9000F007C117D /* Runner */,
|
||||||
97C146EF1CF9000F007C117D /* Products */,
|
97C146EF1CF9000F007C117D /* Products */,
|
||||||
|
ADF7F433B4BC23D6C18AB78B /* Pods */,
|
||||||
|
B4A1CBAC5AA50208793CFF34 /* Frameworks */,
|
||||||
);
|
);
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
@@ -98,6 +114,26 @@
|
|||||||
path = Runner;
|
path = Runner;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
ADF7F433B4BC23D6C18AB78B /* Pods */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
97232923D357E56CAA39281D /* Pods-Runner.debug.xcconfig */,
|
||||||
|
BC90D28B9068C663815415CC /* Pods-Runner.release.xcconfig */,
|
||||||
|
25B61E78A388C87913468FD6 /* Pods-Runner.profile.xcconfig */,
|
||||||
|
);
|
||||||
|
path = Pods;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
B4A1CBAC5AA50208793CFF34 /* Frameworks */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
D0E623A729482D030001185E /* Libgopeed.xcframework */,
|
||||||
|
D081C25B294826C0006EB10B /* libc++.tbd */,
|
||||||
|
70BC8D37FAC641C7F20125E8 /* Pods_Runner.framework */,
|
||||||
|
);
|
||||||
|
name = Frameworks;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
/* End PBXGroup section */
|
/* End PBXGroup section */
|
||||||
|
|
||||||
/* Begin PBXNativeTarget section */
|
/* Begin PBXNativeTarget section */
|
||||||
@@ -105,12 +141,14 @@
|
|||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
|
F3093A8F123671F8F587626F /* [CP] Check Pods Manifest.lock */,
|
||||||
9740EEB61CF901F6004384FC /* Run Script */,
|
9740EEB61CF901F6004384FC /* Run Script */,
|
||||||
97C146EA1CF9000F007C117D /* Sources */,
|
97C146EA1CF9000F007C117D /* Sources */,
|
||||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||||
97C146EC1CF9000F007C117D /* Resources */,
|
97C146EC1CF9000F007C117D /* Resources */,
|
||||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||||
|
DDA801E9D83E2E88398514D3 /* [CP] Embed Pods Frameworks */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -127,7 +165,7 @@
|
|||||||
97C146E61CF9000F007C117D /* Project object */ = {
|
97C146E61CF9000F007C117D /* Project object */ = {
|
||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
attributes = {
|
attributes = {
|
||||||
LastUpgradeCheck = 1300;
|
LastUpgradeCheck = 1430;
|
||||||
ORGANIZATIONNAME = "";
|
ORGANIZATIONNAME = "";
|
||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
97C146ED1CF9000F007C117D = {
|
97C146ED1CF9000F007C117D = {
|
||||||
@@ -171,10 +209,12 @@
|
|||||||
/* Begin PBXShellScriptBuildPhase section */
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
alwaysOutOfDate = 1;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
);
|
);
|
||||||
inputPaths = (
|
inputPaths = (
|
||||||
|
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
|
||||||
);
|
);
|
||||||
name = "Thin Binary";
|
name = "Thin Binary";
|
||||||
outputPaths = (
|
outputPaths = (
|
||||||
@@ -185,6 +225,7 @@
|
|||||||
};
|
};
|
||||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
alwaysOutOfDate = 1;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
);
|
);
|
||||||
@@ -197,6 +238,45 @@
|
|||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||||
};
|
};
|
||||||
|
DDA801E9D83E2E88398514D3 /* [CP] Embed Pods Frameworks */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
||||||
|
);
|
||||||
|
name = "[CP] Embed Pods Frameworks";
|
||||||
|
outputFileListPaths = (
|
||||||
|
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
|
F3093A8F123671F8F587626F /* [CP] Check Pods Manifest.lock */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||||
|
"${PODS_ROOT}/Manifest.lock",
|
||||||
|
);
|
||||||
|
name = "[CP] Check Pods Manifest.lock";
|
||||||
|
outputFileListPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
@@ -272,7 +352,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
SUPPORTED_PLATFORMS = iphoneos;
|
SUPPORTED_PLATFORMS = iphoneos;
|
||||||
@@ -288,6 +368,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
|
DEVELOPMENT_TEAM = JH48DS925K;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
@@ -349,7 +430,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||||
MTL_ENABLE_DEBUG_INFO = YES;
|
MTL_ENABLE_DEBUG_INFO = YES;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
@@ -398,7 +479,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
SUPPORTED_PLATFORMS = iphoneos;
|
SUPPORTED_PLATFORMS = iphoneos;
|
||||||
@@ -416,6 +497,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
|
DEVELOPMENT_TEAM = JH48DS925K;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
@@ -438,6 +520,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
|
DEVELOPMENT_TEAM = JH48DS925K;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Scheme
|
<Scheme
|
||||||
LastUpgradeVersion = "1300"
|
LastUpgradeVersion = "1430"
|
||||||
version = "1.3">
|
version = "1.3">
|
||||||
<BuildAction
|
<BuildAction
|
||||||
parallelizeBuildables = "YES"
|
parallelizeBuildables = "YES"
|
||||||
|
|||||||
@@ -4,4 +4,7 @@
|
|||||||
<FileRef
|
<FileRef
|
||||||
location = "group:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
|
<FileRef
|
||||||
|
location = "group:Pods/Pods.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
@@ -1,13 +1,38 @@
|
|||||||
import UIKit
|
import UIKit
|
||||||
import Flutter
|
import Flutter
|
||||||
|
import Libgopeed
|
||||||
|
|
||||||
@UIApplicationMain
|
@UIApplicationMain
|
||||||
@objc class AppDelegate: FlutterAppDelegate {
|
@objc class AppDelegate: FlutterAppDelegate {
|
||||||
override func application(
|
override func application(
|
||||||
_ application: UIApplication,
|
_ application: UIApplication,
|
||||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||||
) -> Bool {
|
) -> Bool {
|
||||||
GeneratedPluginRegistrant.register(with: self)
|
let controller : FlutterViewController = window?.rootViewController as! FlutterViewController
|
||||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
let batteryChannel = FlutterMethodChannel(name: "gopeed.com/libgopeed",
|
||||||
}
|
binaryMessenger: controller.binaryMessenger)
|
||||||
|
batteryChannel.setMethodCallHandler({
|
||||||
|
(call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in
|
||||||
|
switch call.method {
|
||||||
|
case "start":
|
||||||
|
let args = call.arguments as? Dictionary<String, Any>
|
||||||
|
let cfg = args?["cfg"] as? String
|
||||||
|
let portPrt = UnsafeMutablePointer<Int>.allocate(capacity: MemoryLayout<Int>.stride)
|
||||||
|
var error: NSError?
|
||||||
|
if LibgopeedStart(cfg, portPrt, &error){
|
||||||
|
result(portPrt.pointee)
|
||||||
|
}else{
|
||||||
|
result(FlutterError(code: "ERROR", message: error.debugDescription, details: nil))
|
||||||
|
}
|
||||||
|
case "stop":
|
||||||
|
LibgopeedStop()
|
||||||
|
result(nil)
|
||||||
|
default:
|
||||||
|
result(FlutterMethodNotImplemented)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
GeneratedPluginRegistrant.register(with: self)
|
||||||
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 564 B After Width: | Height: | Size: 714 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 6.6 KiB |
@@ -2,6 +2,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>CADisableMinimumFrameDurationOnPhone</key>
|
||||||
|
<true/>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||||
<key>CFBundleDisplayName</key>
|
<key>CFBundleDisplayName</key>
|
||||||
@@ -12,8 +14,6 @@
|
|||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>gopeed</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
@@ -24,6 +24,11 @@
|
|||||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>NSAppTransportSecurity</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSAllowsArbitraryLoads</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
<key>UILaunchStoryboardName</key>
|
<key>UILaunchStoryboardName</key>
|
||||||
<string>LaunchScreen</string>
|
<string>LaunchScreen</string>
|
||||||
<key>UIMainStoryboardFile</key>
|
<key>UIMainStoryboardFile</key>
|
||||||
@@ -43,7 +48,7 @@
|
|||||||
</array>
|
</array>
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||||
<true/>
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
@@ -225,7 +225,7 @@ class AppController extends GetxController with WindowListener, TrayListener {
|
|||||||
return _defaultStartConfig!;
|
return _defaultStartConfig!;
|
||||||
}
|
}
|
||||||
_defaultStartConfig = StartConfig();
|
_defaultStartConfig = StartConfig();
|
||||||
if (!Util.isUnix()) {
|
if (!Util.supportUnixSocket()) {
|
||||||
// not support unix socket, use tcp
|
// not support unix socket, use tcp
|
||||||
_defaultStartConfig!.network = "tcp";
|
_defaultStartConfig!.network = "tcp";
|
||||||
_defaultStartConfig!.address = "127.0.0.1:0";
|
_defaultStartConfig!.address = "127.0.0.1:0";
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ class CreateView extends GetView<CreateController> {
|
|||||||
final _httpRefererController = TextEditingController();
|
final _httpRefererController = TextEditingController();
|
||||||
final _btTrackerController = TextEditingController();
|
final _btTrackerController = TextEditingController();
|
||||||
|
|
||||||
|
final _availableSchemes = ["http:", "https:", "magnet:"];
|
||||||
|
|
||||||
CreateView({Key? key}) : super(key: key);
|
CreateView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -37,8 +39,24 @@ class CreateView extends GetView<CreateController> {
|
|||||||
final String? filePath = Get.rootDelegate.arguments();
|
final String? filePath = Get.rootDelegate.arguments();
|
||||||
if (_urlController.text.isEmpty && filePath != null) {
|
if (_urlController.text.isEmpty && filePath != null) {
|
||||||
_urlController.text = filePath;
|
_urlController.text = filePath;
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
_urlController.selection = TextSelection.fromPosition(
|
||||||
await _doResolve();
|
TextPosition(offset: _urlController.text.length));
|
||||||
|
}
|
||||||
|
|
||||||
|
// if no file path, read from clipboard
|
||||||
|
if (filePath?.isEmpty ?? true) {
|
||||||
|
Clipboard.getData('text/plain').then((value) {
|
||||||
|
if (value?.text?.isNotEmpty ?? false) {
|
||||||
|
if (_availableSchemes
|
||||||
|
.where((e) =>
|
||||||
|
value!.text!.startsWith(e) ||
|
||||||
|
value.text!.startsWith(e.toUpperCase()))
|
||||||
|
.isNotEmpty) {
|
||||||
|
_urlController.text = value!.text!;
|
||||||
|
_urlController.selection = TextSelection.fromPosition(
|
||||||
|
TextPosition(offset: _urlController.text.length));
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,154 +78,161 @@ class CreateView extends GetView<CreateController> {
|
|||||||
final bytes = await details.files[0].readAsBytes();
|
final bytes = await details.files[0].readAsBytes();
|
||||||
controller.setFileDataUri(bytes);
|
controller.setFileDataUri(bytes);
|
||||||
},
|
},
|
||||||
child: Padding(
|
child: GestureDetector(
|
||||||
padding:
|
behavior: HitTestBehavior.opaque,
|
||||||
const EdgeInsets.symmetric(vertical: 16.0, horizontal: 24.0),
|
onTap: () {
|
||||||
child: Form(
|
FocusScope.of(context).requestFocus(FocusNode());
|
||||||
key: _resolveFormKey,
|
},
|
||||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
child: Padding(
|
||||||
child: Column(children: [
|
padding:
|
||||||
Row(children: [
|
const EdgeInsets.symmetric(vertical: 16.0, horizontal: 24.0),
|
||||||
Expanded(
|
child: Form(
|
||||||
child: TextFormField(
|
key: _resolveFormKey,
|
||||||
autofocus: true,
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
controller: _urlController,
|
child: Column(children: [
|
||||||
minLines: 1,
|
Row(children: [
|
||||||
maxLines: 5,
|
Expanded(
|
||||||
decoration: InputDecoration(
|
child: TextFormField(
|
||||||
hintText: _hitText(),
|
autofocus: true,
|
||||||
hintStyle: const TextStyle(fontSize: 12),
|
controller: _urlController,
|
||||||
labelText: 'downloadLink'.tr,
|
minLines: 1,
|
||||||
icon: const Icon(Icons.link),
|
maxLines: 5,
|
||||||
suffixIcon: IconButton(
|
decoration: InputDecoration(
|
||||||
onPressed: () {
|
hintText: _hitText(),
|
||||||
_urlController.clear();
|
hintStyle: const TextStyle(fontSize: 12),
|
||||||
controller.clearFileDataUri();
|
labelText: 'downloadLink'.tr,
|
||||||
},
|
icon: const Icon(Icons.link),
|
||||||
icon: const Icon(Icons.clear),
|
suffixIcon: IconButton(
|
||||||
),
|
onPressed: () {
|
||||||
),
|
_urlController.clear();
|
||||||
validator: (v) {
|
controller.clearFileDataUri();
|
||||||
return v!.trim().isNotEmpty
|
},
|
||||||
? null
|
icon: const Icon(Icons.clear),
|
||||||
: 'downloadLinkValid'.tr;
|
|
||||||
},
|
|
||||||
onChanged: (v) async {
|
|
||||||
controller.clearFileDataUri();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
icon: const Icon(Icons.folder_open),
|
|
||||||
onPressed: () async {
|
|
||||||
var pr = await FilePicker.platform.pickFiles(
|
|
||||||
type: FileType.custom,
|
|
||||||
allowedExtensions: ["torrent"]);
|
|
||||||
if (pr != null) {
|
|
||||||
if (!Util.isWeb()) {
|
|
||||||
_urlController.text = pr.files[0].path ?? "";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_urlController.text = pr.files[0].name;
|
|
||||||
controller.setFileDataUri(pr.files[0].bytes!);
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
//.where((e) => e != null).map((e) => e!).toList(),
|
|
||||||
),
|
|
||||||
Obx(() => Visibility(
|
|
||||||
visible: controller.showAdvanced.value,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 40, top: 15),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
TabBar(
|
|
||||||
controller: controller.advancedTabController,
|
|
||||||
tabs: const [
|
|
||||||
Tab(
|
|
||||||
text: 'HTTP',
|
|
||||||
),
|
|
||||||
Tab(
|
|
||||||
text: 'BitTorrent',
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
AutoScaleTabBarView(
|
|
||||||
controller: controller.advancedTabController,
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
TextFormField(
|
|
||||||
controller: _httpUaController,
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
labelText: 'User-Agent',
|
|
||||||
)),
|
|
||||||
TextFormField(
|
|
||||||
controller: _httpCookieController,
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
labelText: 'Cookie',
|
|
||||||
)),
|
|
||||||
TextFormField(
|
|
||||||
controller: _httpRefererController,
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
labelText: 'Referer',
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
TextFormField(
|
|
||||||
controller: _btTrackerController,
|
|
||||||
maxLines: 5,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: 'Trakers',
|
|
||||||
hintText: 'addTrackerHit'.tr,
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
))),
|
|
||||||
Center(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 15),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 10),
|
|
||||||
child: TextButton(
|
|
||||||
onPressed: () {
|
|
||||||
controller.showAdvanced.value =
|
|
||||||
!controller.showAdvanced.value;
|
|
||||||
},
|
|
||||||
child:
|
|
||||||
Row(mainAxisSize: MainAxisSize.min, children: [
|
|
||||||
Obx(() => Checkbox(
|
|
||||||
value: controller.showAdvanced.value,
|
|
||||||
onChanged: (bool? value) {
|
|
||||||
controller.showAdvanced.value =
|
|
||||||
value ?? false;
|
|
||||||
},
|
|
||||||
)),
|
|
||||||
Text('advancedOptions'.tr),
|
|
||||||
]),
|
|
||||||
),
|
),
|
||||||
|
validator: (v) {
|
||||||
|
return v!.trim().isNotEmpty
|
||||||
|
? null
|
||||||
|
: 'downloadLinkValid'.tr;
|
||||||
|
},
|
||||||
|
onChanged: (v) async {
|
||||||
|
controller.clearFileDataUri();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
SizedBox(
|
),
|
||||||
width: 150,
|
IconButton(
|
||||||
child: RoundedLoadingButton(
|
icon: const Icon(Icons.folder_open),
|
||||||
color: Get.theme.colorScheme.secondary,
|
onPressed: () async {
|
||||||
onPressed: _doResolve,
|
var pr = await FilePicker.platform.pickFiles(
|
||||||
controller: _confirmController,
|
type: FileType.custom,
|
||||||
child: Text('confirm'.tr),
|
allowedExtensions: ["torrent"]);
|
||||||
|
if (pr != null) {
|
||||||
|
if (!Util.isWeb()) {
|
||||||
|
_urlController.text = pr.files[0].path ?? "";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_urlController.text = pr.files[0].name;
|
||||||
|
controller.setFileDataUri(pr.files[0].bytes!);
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
]
|
||||||
|
//.where((e) => e != null).map((e) => e!).toList(),
|
||||||
|
),
|
||||||
|
Obx(() => Visibility(
|
||||||
|
visible: controller.showAdvanced.value,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 40, top: 15),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
TabBar(
|
||||||
|
controller: controller.advancedTabController,
|
||||||
|
tabs: const [
|
||||||
|
Tab(
|
||||||
|
text: 'HTTP',
|
||||||
|
),
|
||||||
|
Tab(
|
||||||
|
text: 'BitTorrent',
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
AutoScaleTabBarView(
|
||||||
|
controller: controller.advancedTabController,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
TextFormField(
|
||||||
|
controller: _httpUaController,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
labelText: 'User-Agent',
|
||||||
|
)),
|
||||||
|
TextFormField(
|
||||||
|
controller: _httpCookieController,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
labelText: 'Cookie',
|
||||||
|
)),
|
||||||
|
TextFormField(
|
||||||
|
controller: _httpRefererController,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
labelText: 'Referer',
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
TextFormField(
|
||||||
|
controller: _btTrackerController,
|
||||||
|
maxLines: 5,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: 'Trakers',
|
||||||
|
hintText: 'addTrackerHit'.tr,
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
))),
|
||||||
],
|
Center(
|
||||||
),
|
child: Padding(
|
||||||
)),
|
padding: const EdgeInsets.only(top: 15),
|
||||||
]))),
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 10),
|
||||||
|
child: TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
controller.showAdvanced.value =
|
||||||
|
!controller.showAdvanced.value;
|
||||||
|
},
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Obx(() => Checkbox(
|
||||||
|
value: controller.showAdvanced.value,
|
||||||
|
onChanged: (bool? value) {
|
||||||
|
controller.showAdvanced.value =
|
||||||
|
value ?? false;
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
Text('advancedOptions'.tr),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 150,
|
||||||
|
child: RoundedLoadingButton(
|
||||||
|
color: Get.theme.colorScheme.secondary,
|
||||||
|
onPressed: _doResolve,
|
||||||
|
controller: _confirmController,
|
||||||
|
child: Text('confirm'.tr),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
]))),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -280,7 +305,7 @@ class CreateView extends GetView<CreateController> {
|
|||||||
var width = MediaQuery.of(context).size.width;
|
var width = MediaQuery.of(context).size.width;
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: height * 0.5,
|
height: height * 0.75,
|
||||||
width: width,
|
width: width,
|
||||||
child: Form(
|
child: Form(
|
||||||
key: createFormKey,
|
key: createFormKey,
|
||||||
|
|||||||
@@ -334,21 +334,21 @@ class SettingView extends GetView<SettingController> {
|
|||||||
width: 150,
|
width: 150,
|
||||||
child: DropdownButtonFormField<String>(
|
child: DropdownButtonFormField<String>(
|
||||||
value: startCfg.value.network,
|
value: startCfg.value.network,
|
||||||
onChanged: (value) async {
|
onChanged: Util.isDesktop()
|
||||||
startCfg.update((val) {
|
? (value) async {
|
||||||
val!.network = value!;
|
startCfg.update((val) {
|
||||||
});
|
val!.network = value!;
|
||||||
|
});
|
||||||
|
|
||||||
await debounceSave(needRestart: true);
|
await debounceSave(needRestart: true);
|
||||||
},
|
}
|
||||||
|
: null,
|
||||||
items: [
|
items: [
|
||||||
!Util.isMobile()
|
const DropdownMenuItem<String>(
|
||||||
? const DropdownMenuItem<String>(
|
value: 'tcp',
|
||||||
value: 'tcp',
|
child: Text('TCP'),
|
||||||
child: Text('TCP'),
|
),
|
||||||
)
|
Util.supportUnixSocket()
|
||||||
: null,
|
|
||||||
Util.isUnix()
|
|
||||||
? const DropdownMenuItem<String>(
|
? const DropdownMenuItem<String>(
|
||||||
value: 'unix',
|
value: 'unix',
|
||||||
child: Text('Unix'),
|
child: Text('Unix'),
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../controllers/task_files_controller.dart';
|
||||||
|
|
||||||
|
class TaskFilesBinding extends Bindings {
|
||||||
|
@override
|
||||||
|
void dependencies() {
|
||||||
|
Get.lazyPut<TaskFilesController>(
|
||||||
|
() => TaskFilesController(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import '../../../../api/api.dart';
|
||||||
|
import '../../../../api/model/resource.dart';
|
||||||
|
import '../../../../api/model/task.dart';
|
||||||
|
|
||||||
|
class FileItem {
|
||||||
|
final bool isDirectory;
|
||||||
|
final String path;
|
||||||
|
final String name;
|
||||||
|
final int size;
|
||||||
|
|
||||||
|
FileItem(this.isDirectory, this.path, this.name, this.size);
|
||||||
|
|
||||||
|
String get fullPath => "${path == "/" ? path : "$path/"}$name";
|
||||||
|
}
|
||||||
|
|
||||||
|
class TaskFilesController extends GetxController {
|
||||||
|
final Map<String, List<FileItem>> _dirMap = {};
|
||||||
|
|
||||||
|
final task = Rx<Task?>(null);
|
||||||
|
final fileList = <FileItem>[].obs;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() async {
|
||||||
|
super.onInit();
|
||||||
|
|
||||||
|
final taskId = Get.rootDelegate.parameters['id'];
|
||||||
|
final tasks = await getTasks([]);
|
||||||
|
task.value = tasks.firstWhere((element) => element.id == taskId);
|
||||||
|
parseDirMap(task.value!.meta.res.files);
|
||||||
|
toDir("/");
|
||||||
|
}
|
||||||
|
|
||||||
|
void parseDirMap(List<FileInfo> fileList) {
|
||||||
|
for (final file in fileList) {
|
||||||
|
String dir = file.path;
|
||||||
|
if (!dir.startsWith("/")) {
|
||||||
|
dir = "/$dir";
|
||||||
|
}
|
||||||
|
if (!_dirMap.containsKey(dir)) {
|
||||||
|
_dirMap[dir] = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
_dirMap[dir]!.add(FileItem(false, dir, file.name, file.size));
|
||||||
|
|
||||||
|
void findParent(String dir) {
|
||||||
|
final parentDirIndex = dir.lastIndexOf("/");
|
||||||
|
String parentDir =
|
||||||
|
parentDirIndex == 0 ? "/" : dir.substring(0, parentDirIndex);
|
||||||
|
if (!_dirMap.containsKey(parentDir)) {
|
||||||
|
_dirMap[parentDir] = [];
|
||||||
|
}
|
||||||
|
String dirName = dir.substring(dir.lastIndexOf("/") + 1);
|
||||||
|
if (!_dirMap[parentDir]!.any((element) => element.name == dirName)) {
|
||||||
|
_dirMap[parentDir]!.add(FileItem(true, parentDir, dirName, 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (dir != "/" && dir != "") {
|
||||||
|
findParent(dir);
|
||||||
|
dir = dir.substring(0, dir.lastIndexOf("/"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// sort children, directories first then files, alphabetically
|
||||||
|
_dirMap.forEach((key, value) {
|
||||||
|
value.sort((a, b) {
|
||||||
|
if (a.isDirectory && !b.isDirectory) {
|
||||||
|
return -1;
|
||||||
|
} else if (!a.isDirectory && b.isDirectory) {
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return a.name.compareTo(b.name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void toDir(String dir) {
|
||||||
|
fileList.value = _dirMap[dir]?.toList() ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
|
int dirItemCount(String dir) {
|
||||||
|
return _dirMap[dir]?.length ?? 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:share_plus/share_plus.dart';
|
||||||
|
|
||||||
|
import '../../../../util/file_icon.dart';
|
||||||
|
import '../../../../util/icons.dart';
|
||||||
|
import '../../../../util/util.dart';
|
||||||
|
import '../../../views/breadcrumb_view.dart';
|
||||||
|
import '../controllers/task_files_controller.dart';
|
||||||
|
|
||||||
|
class TaskFilesView extends GetView<TaskFilesController> {
|
||||||
|
const TaskFilesView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
leading: IconButton(
|
||||||
|
icon: const Icon(Icons.arrow_back),
|
||||||
|
onPressed: () => Get.rootDelegate.popRoute()),
|
||||||
|
// actions: [],
|
||||||
|
title: Obx(() => Text(controller.task.value?.meta.res.name ?? "")),
|
||||||
|
),
|
||||||
|
body: Obx(() {
|
||||||
|
final fileList = controller.fileList;
|
||||||
|
final breadcrumbItems = ["/"];
|
||||||
|
if (fileList.isNotEmpty) {
|
||||||
|
final file = fileList.first;
|
||||||
|
final path = file.path.substring(1);
|
||||||
|
if (path.isNotEmpty) {
|
||||||
|
final pathArr = path.split("/");
|
||||||
|
for (int i = 0; i < pathArr.length; i++) {
|
||||||
|
breadcrumbItems.add(pathArr[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Breadcrumb(
|
||||||
|
items: breadcrumbItems,
|
||||||
|
onItemTap: (index) {
|
||||||
|
final targetDirArr = <String>[];
|
||||||
|
for (int i = 0; i <= index; i++) {
|
||||||
|
targetDirArr.add(breadcrumbItems[i]);
|
||||||
|
}
|
||||||
|
controller
|
||||||
|
.toDir(targetDirArr.join("/").replaceFirst('//', '/'));
|
||||||
|
}).paddingOnly(left: 16, top: 16, bottom: 8),
|
||||||
|
Expanded(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final meta = controller.task.value!.meta;
|
||||||
|
final file = fileList[index];
|
||||||
|
return ListTile(
|
||||||
|
leading: file.isDirectory
|
||||||
|
? const Icon(Icons.folder)
|
||||||
|
: Icon(FaIcons.allIcons[findIcon(file.name)]),
|
||||||
|
title: Text(fileList[index].name),
|
||||||
|
subtitle: file.isDirectory
|
||||||
|
? Text('items'.trParams({
|
||||||
|
'count': controller
|
||||||
|
.dirItemCount(file.fullPath)
|
||||||
|
.toString()
|
||||||
|
}))
|
||||||
|
: Text(Util.fmtByte(file.size)),
|
||||||
|
trailing: file.isDirectory
|
||||||
|
? null
|
||||||
|
: IconButton(
|
||||||
|
icon: const Icon(Icons.share),
|
||||||
|
onPressed: () {
|
||||||
|
final xfile = XFile(Util.safePathJoin([
|
||||||
|
meta.opts.path,
|
||||||
|
meta.res.rootDir,
|
||||||
|
file.fullPath
|
||||||
|
]));
|
||||||
|
Share.shareXFiles([xfile]);
|
||||||
|
}),
|
||||||
|
onTap: () {
|
||||||
|
if (file.isDirectory) {
|
||||||
|
controller.toDir(file.fullPath);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: controller.fileList.length,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:gopeed/app/modules/task/views/task_files_view.dart';
|
||||||
import 'package:gopeed/app/modules/task/views/task_view.dart';
|
import 'package:gopeed/app/modules/task/views/task_view.dart';
|
||||||
|
|
||||||
import '../modules/create/bindings/create_binding.dart';
|
import '../modules/create/bindings/create_binding.dart';
|
||||||
@@ -10,6 +11,7 @@ import '../modules/root/views/root_view.dart';
|
|||||||
import '../modules/setting/bindings/setting_binding.dart';
|
import '../modules/setting/bindings/setting_binding.dart';
|
||||||
import '../modules/setting/views/setting_view.dart';
|
import '../modules/setting/views/setting_view.dart';
|
||||||
import '../modules/task/bindings/task_binding.dart';
|
import '../modules/task/bindings/task_binding.dart';
|
||||||
|
import '../modules/task/bindings/task_files_binding.dart';
|
||||||
|
|
||||||
part 'app_routes.dart';
|
part 'app_routes.dart';
|
||||||
|
|
||||||
@@ -37,7 +39,14 @@ class AppPages {
|
|||||||
name: _Paths.TASK,
|
name: _Paths.TASK,
|
||||||
page: () => const TaskView(),
|
page: () => const TaskView(),
|
||||||
transition: Transition.noTransition,
|
transition: Transition.noTransition,
|
||||||
binding: TaskBinding()),
|
binding: TaskBinding(),
|
||||||
|
children: [
|
||||||
|
GetPage(
|
||||||
|
name: _Paths.TASK_FILES,
|
||||||
|
page: () => const TaskFilesView(),
|
||||||
|
transition: Transition.noTransition,
|
||||||
|
binding: TaskFilesBinding()),
|
||||||
|
]),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: _Paths.SETTING,
|
name: _Paths.SETTING,
|
||||||
page: () => const SettingView(),
|
page: () => const SettingView(),
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ abstract class Routes {
|
|||||||
static const HOME = _Paths.HOME;
|
static const HOME = _Paths.HOME;
|
||||||
static const CREATE = _Paths.CREATE;
|
static const CREATE = _Paths.CREATE;
|
||||||
static const TASK = _Paths.HOME + _Paths.TASK;
|
static const TASK = _Paths.HOME + _Paths.TASK;
|
||||||
|
static const TASK_FILES = TASK + _Paths.TASK_FILES;
|
||||||
static const SETTING = _Paths.HOME + _Paths.SETTING;
|
static const SETTING = _Paths.HOME + _Paths.SETTING;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,5 +17,6 @@ abstract class _Paths {
|
|||||||
static const HOME = '/home';
|
static const HOME = '/home';
|
||||||
static const CREATE = '/create';
|
static const CREATE = '/create';
|
||||||
static const TASK = '/task';
|
static const TASK = '/task';
|
||||||
|
static const TASK_FILES = '/files';
|
||||||
static const SETTING = '/setting';
|
static const SETTING = '/setting';
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class Breadcrumb extends StatelessWidget {
|
||||||
|
final List<String> items;
|
||||||
|
final Function(int)? onItemTap;
|
||||||
|
final TextStyle textStyle;
|
||||||
|
final TextStyle activeTextStyle;
|
||||||
|
|
||||||
|
const Breadcrumb({
|
||||||
|
super.key,
|
||||||
|
required this.items,
|
||||||
|
this.onItemTap,
|
||||||
|
this.textStyle = const TextStyle(fontSize: 16),
|
||||||
|
this.activeTextStyle =
|
||||||
|
const TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
List<Widget> children = [];
|
||||||
|
for (int i = 0; i < items.length; i++) {
|
||||||
|
children.add(
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
if (onItemTap != null) {
|
||||||
|
onItemTap!(i);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
items[i],
|
||||||
|
style: i == items.length - 1 ? activeTextStyle : textStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
if (i != items.length - 1) {
|
||||||
|
children.add(const Text(" > "));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
...(children.length == 1
|
||||||
|
? children.sublist(0, 1)
|
||||||
|
: children.sublist(0, 2)),
|
||||||
|
children.length > 2
|
||||||
|
? Expanded(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
reverse: true,
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: Row(
|
||||||
|
children: children.sublist(2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
].where((e) => e != null).map((e) => e!).toList(),
|
||||||
|
).paddingOnly(right: 12);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:gopeed/api/model/meta.dart';
|
import 'package:gopeed/api/model/meta.dart';
|
||||||
import 'package:gopeed/api/model/resource.dart';
|
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
|
|
||||||
import '../../api/api.dart';
|
import '../../api/api.dart';
|
||||||
@@ -109,11 +108,16 @@ class BuildTaskListView extends GetView {
|
|||||||
List<Widget> buildActions() {
|
List<Widget> buildActions() {
|
||||||
final list = <Widget>[];
|
final list = <Widget>[];
|
||||||
if (isDone()) {
|
if (isDone()) {
|
||||||
if (Util.isDesktop()) {
|
if (Util.isDesktop() || Util.isMobile()) {
|
||||||
list.add(IconButton(
|
list.add(IconButton(
|
||||||
icon: const Icon(Icons.folder_open),
|
icon: const Icon(Icons.folder_open),
|
||||||
onPressed: () async {
|
onPressed: () {
|
||||||
await FileExplorer.openAndSelectFile(buildExplorerUrl(task));
|
if (Util.isDesktop()) {
|
||||||
|
FileExplorer.openAndSelectFile(buildExplorerUrl(task));
|
||||||
|
} else {
|
||||||
|
Get.rootDelegate
|
||||||
|
.toNamed(Routes.TASK_FILES, parameters: {'id': task.id});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class _DirectorySelectorState extends State<DirectorySelector> {
|
|||||||
return v!.trim().isNotEmpty ? null : 'downloadDirValid'.tr;
|
return v!.trim().isNotEmpty ? null : 'downloadDirValid'.tr;
|
||||||
},
|
},
|
||||||
)),
|
)),
|
||||||
Util.isDesktop() || Util.isAndroid()
|
!Util.isWeb() && !Util.isIOS()
|
||||||
? IconButton(
|
? IconButton(
|
||||||
icon: const Icon(Icons.folder_open),
|
icon: const Icon(Icons.folder_open),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ class Locales {
|
|||||||
'downloadDirValid': '请选择下载目录',
|
'downloadDirValid': '请选择下载目录',
|
||||||
'connections': '连接数',
|
'connections': '连接数',
|
||||||
'maxRunning': '最大下载数',
|
'maxRunning': '最大下载数',
|
||||||
'items': '@count 条',
|
'items': '@count 项',
|
||||||
'subscribeTracker': '订阅 Tracker',
|
'subscribeTracker': '订阅 Tracker',
|
||||||
'subscribeFail': '订阅失败,请检查网络或稍后重试',
|
'subscribeFail': '订阅失败,请检查网络或稍后重试',
|
||||||
'update': '更新',
|
'update': '更新',
|
||||||
|
|||||||
@@ -12,6 +12,13 @@ class Util {
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static String safePathJoin(List<String> paths) {
|
||||||
|
return paths
|
||||||
|
.map((e) => safeDir(e))
|
||||||
|
.join("/")
|
||||||
|
.replaceAll(RegExp(r'//'), "/");
|
||||||
|
}
|
||||||
|
|
||||||
static String fmtByte(int byte) {
|
static String fmtByte(int byte) {
|
||||||
if (byte < 0) {
|
if (byte < 0) {
|
||||||
return "0 B";
|
return "0 B";
|
||||||
@@ -53,15 +60,15 @@ class Util {
|
|||||||
return !kIsWeb && Platform.isMacOS;
|
return !kIsWeb && Platform.isMacOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static isUnix() {
|
static isWeb() {
|
||||||
|
return kIsWeb;
|
||||||
|
}
|
||||||
|
|
||||||
|
static supportUnixSocket() {
|
||||||
if (kIsWeb) {
|
if (kIsWeb) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return !Platform.isWindows;
|
return Platform.isLinux || Platform.isMacOS || Platform.isAndroid;
|
||||||
}
|
|
||||||
|
|
||||||
static isWeb() {
|
|
||||||
return kIsWeb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<String> textToLines(String text) {
|
static List<String> textToLines(String text) {
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 672 B After Width: | Height: | Size: 709 B |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -245,10 +245,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: desktop_drop
|
name: desktop_drop
|
||||||
sha256: "4ca4d960f4b11c032e9adfd2a0a8ac615bc3fddb4cbe73dcf840dd8077582186"
|
sha256: ebba9c9cb0b54385998a977d741cc06fd8324878c08d5a36e9da61cd56b04cc6
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.1"
|
version: "0.4.3"
|
||||||
dio:
|
dio:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -757,6 +757,22 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.0"
|
version: "0.4.0"
|
||||||
|
share_plus:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: share_plus
|
||||||
|
sha256: "6cec740fa0943a826951223e76218df002804adb588235a8910dc3d6b0654e11"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "7.1.0"
|
||||||
|
share_plus_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: share_plus_platform_interface
|
||||||
|
sha256: "357412af4178d8e11d14f41723f80f12caea54cf0d5cd29af9dcdab85d58aea7"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "3.3.0"
|
||||||
shared_preferences:
|
shared_preferences:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -1018,6 +1034,14 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.7"
|
version: "3.0.7"
|
||||||
|
uuid:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: uuid
|
||||||
|
sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.7"
|
||||||
vector_math:
|
vector_math:
|
||||||
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.3.10+1
|
version: 1.3.11+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.0.0 <4.0.0'
|
sdk: '>=3.0.0 <4.0.0'
|
||||||
@@ -58,6 +58,7 @@ dependencies:
|
|||||||
window_manager: ^0.3.4
|
window_manager: ^0.3.4
|
||||||
tray_manager: ^0.2.0
|
tray_manager: ^0.2.0
|
||||||
autoscale_tabbarview: ^1.0.2
|
autoscale_tabbarview: ^1.0.2
|
||||||
|
share_plus: ^7.1.0
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
@@ -114,8 +115,10 @@ flutter:
|
|||||||
|
|
||||||
# flutter pub run flutter_launcher_icons:main
|
# flutter pub run flutter_launcher_icons:main
|
||||||
flutter_icons:
|
flutter_icons:
|
||||||
image_path_android: "assets/icon/icon_1024.png"
|
image_path: "assets/icon/icon_1024.png"
|
||||||
android: true # can specify file name here e.g. "ic_launcher"
|
android: true # can specify file name here e.g. "ic_launcher"
|
||||||
|
ios: true
|
||||||
|
remove_alpha_ios: true
|
||||||
web:
|
web:
|
||||||
generate: true
|
generate: true
|
||||||
image_path: "assets/icon/icon_1024.png"
|
image_path: "assets/icon/icon_1024.png"
|
||||||
|
|||||||