feat: new ui (#1455)
No files matched your search
@@ -5,9 +5,12 @@
|
||||
*.swp
|
||||
.DS_Store
|
||||
.atom/
|
||||
.build/
|
||||
.buildlog/
|
||||
.history
|
||||
.svn/
|
||||
.swiftpm/
|
||||
migrate_working_dir/
|
||||
|
||||
# IntelliJ related
|
||||
*.iml
|
||||
@@ -29,10 +32,18 @@
|
||||
.packages
|
||||
.pub-cache/
|
||||
.pub/
|
||||
build/
|
||||
/build/
|
||||
/coverage/
|
||||
.fvm/
|
||||
|
||||
# Web related
|
||||
# Generated by `flutter gen-l10n` from lib/l10n/*.arb.
|
||||
/lib/l10n/app_localizations*.dart
|
||||
|
||||
# Native helpers are produced for the target architecture during packaging.
|
||||
assets/exec/host
|
||||
assets/exec/host.exe
|
||||
assets/exec/updater
|
||||
assets/exec/updater.exe
|
||||
|
||||
# Symbolication related
|
||||
app.*.symbols
|
||||
@@ -40,10 +51,12 @@ app.*.symbols
|
||||
# Obfuscation related
|
||||
app.*.map.json
|
||||
|
||||
# Exceptions to above rules.
|
||||
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
|
||||
# Android Studio will place build artifacts here
|
||||
/android/app/debug
|
||||
/android/app/profile
|
||||
/android/app/release
|
||||
|
||||
# Libgopeed
|
||||
# Libgopeed build outputs
|
||||
windows/libgopeed.h
|
||||
windows/libgopeed.dll
|
||||
macos/Frameworks/libgopeed.h
|
||||
@@ -53,8 +66,10 @@ linux/bundle/lib/libgopeed.dylib
|
||||
android/app/libs/libgopeed.aar
|
||||
android/app/libs/libgopeed-sources.jar
|
||||
|
||||
# Local packaging outputs
|
||||
debian/packages
|
||||
|
||||
# Flutter generated plugin registrants
|
||||
linux/flutter/generated_plugin_registrant.cc
|
||||
linux/flutter/generated_plugin_registrant.h
|
||||
linux/flutter/generated_plugins.cmake
|
||||
@@ -63,13 +78,7 @@ windows/flutter/generated_plugin_registrant.cc
|
||||
windows/flutter/generated_plugin_registrant.h
|
||||
windows/flutter/generated_plugins.cmake
|
||||
|
||||
# Runtime data
|
||||
/extensions
|
||||
|
||||
# Hive database files
|
||||
database.hive
|
||||
database.lock
|
||||
|
||||
assets/exec/host
|
||||
assets/exec/host.exe
|
||||
assets/exec/updater
|
||||
assets/exec/updater.exe
|
||||
@@ -1,11 +1,11 @@
|
||||
# This file tracks properties of this Flutter project.
|
||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||
#
|
||||
# This file should be version controlled.
|
||||
# This file should be version controlled and should not be manually edited.
|
||||
|
||||
version:
|
||||
revision: 7048ed95a5ad3e43d697e0c397464193991fc230
|
||||
channel: stable
|
||||
revision: "db50e20168db8fee486b9abf32fc912de3bc5b6a"
|
||||
channel: "stable"
|
||||
|
||||
project_type: app
|
||||
|
||||
@@ -13,11 +13,26 @@ project_type: app
|
||||
migration:
|
||||
platforms:
|
||||
- platform: root
|
||||
create_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
|
||||
base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
|
||||
create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
|
||||
base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
|
||||
- platform: android
|
||||
create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
|
||||
base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
|
||||
- platform: ios
|
||||
create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
|
||||
base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
|
||||
- platform: linux
|
||||
create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
|
||||
base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
|
||||
- platform: macos
|
||||
create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
|
||||
base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
|
||||
- platform: web
|
||||
create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
|
||||
base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
|
||||
- platform: windows
|
||||
create_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
|
||||
base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
|
||||
create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
|
||||
base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
|
||||
|
||||
# User provided section
|
||||
|
||||
|
||||
@@ -0,0 +1,272 @@
|
||||
# AGENTS.md
|
||||
|
||||
This document defines the implementation standards for this Flutter project.
|
||||
|
||||
## 1) Product Scope
|
||||
|
||||
- This is a cross-platform app that must support both desktop and mobile.
|
||||
- Every page must use responsive layouts and behave correctly across:
|
||||
- Mobile phone sizes
|
||||
- Tablet sizes
|
||||
- Desktop window sizes, including resizable windows
|
||||
- Desktop is currently the primary design target, but the architecture must remain ready for future mobile-specific variants.
|
||||
|
||||
## 2) Required Project Structure
|
||||
|
||||
Use the following structure as the baseline and do not introduce alternative top-level patterns:
|
||||
|
||||
```text
|
||||
lib/
|
||||
├── main.dart
|
||||
├── app/
|
||||
│ ├── app.dart
|
||||
│ ├── router/
|
||||
│ │ ├── app_router.dart
|
||||
│ │ └── shells/
|
||||
│ │ └── main_shell.dart
|
||||
│ └── application/
|
||||
│ └── locale_controller.dart
|
||||
├── core/
|
||||
│ ├── network/
|
||||
│ ├── error/
|
||||
│ └── utils/
|
||||
├── shared/
|
||||
│ └── widgets/
|
||||
├── features/
|
||||
│ ├── auth/
|
||||
│ ├── tasks/
|
||||
│ ├── extensions/
|
||||
│ └── settings/
|
||||
└── l10n/
|
||||
├── app_en.arb
|
||||
├── app_zh.arb
|
||||
└── app_zh_TW.arb
|
||||
```
|
||||
|
||||
## 2.1) Core Tech Stack
|
||||
|
||||
Use the following as the baseline stack for this project:
|
||||
|
||||
- `flutter_riverpod`
|
||||
- `go_router`
|
||||
- `flutter_localizations`
|
||||
- `dio`
|
||||
- `window_manager`
|
||||
- `tray_manager`
|
||||
- `desktop_multi_window`
|
||||
- `shadcn_flutter`
|
||||
|
||||
Guidelines:
|
||||
|
||||
- Do not introduce alternative frameworks for the same responsibility unless explicitly approved.
|
||||
- Keep app-level state aligned with Riverpod patterns when new shared state is introduced.
|
||||
- Keep navigation centralized in `lib/app/router/`.
|
||||
- Keep network access built on top of Dio abstractions in `lib/core/network/`.
|
||||
- Keep desktop window, tray, and multi-window logic encapsulated and platform-guarded.
|
||||
- `shadcn_flutter` is the default product UI system for app surfaces and controls.
|
||||
|
||||
## 3) UI Design Rules
|
||||
|
||||
- Maintain a consistent visual language across desktop and mobile.
|
||||
- Define and reuse design tokens for color, spacing, radius, typography, elevation, and motion.
|
||||
- Avoid hard-coded one-off styles in page files; prefer centralized tokens and shared primitives.
|
||||
- Preserve accessibility and usable contrast in both light and dark themes.
|
||||
- Respect platform ergonomics:
|
||||
- Mobile: larger tap areas, reduced density, simpler layouts
|
||||
- Desktop: hover states, richer density, resize-aware layouts, window-aware composition
|
||||
|
||||
## 3.1) Theme Extension Rules
|
||||
|
||||
- Custom app colors must be exposed through Flutter `ThemeExtension`, not scattered as widget-local hard-coded values.
|
||||
- Keep the app's semantic color tokens centralized in the shared theme layer under `lib/shared/theme/`.
|
||||
- Widgets should read custom colors via shared theme accessors such as `AppPalette.of(context)` or `Theme.of(context).extension<...>()`, not by repeating raw hex values.
|
||||
- Raw `Color(0x...)` values are allowed only inside the shared theme definition layer, platform interop code, or when a plugin API requires a direct color constant.
|
||||
- When a new component needs a design-specific color, first promote it to a semantic theme token such as `taskCardHover`, `headerDivider`, or `captionButtonHover` instead of adding another local constant.
|
||||
- If both `shadcn_flutter` theme data and Flutter `ThemeData` are used, keep them mapped from the same source-of-truth tokens so light and dark mode stay aligned.
|
||||
|
||||
## 3.2) Design Source of Truth
|
||||
|
||||
- When a screen or component exists under `design/`, Flutter must match its layout, spacing, hierarchy, and motion behavior before introducing local reinterpretation.
|
||||
- Preserve the app's existing light and dark palette values as the canonical color source of truth even if the H5 prototype uses different colors.
|
||||
- Do not copy H5 colors blindly. Rebuild structure and interaction fidelity using the Flutter theme tokens.
|
||||
|
||||
## 3.3) shadcn_flutter Rules
|
||||
|
||||
- Use `shadcn_flutter` as the default UI component library for product-facing surfaces.
|
||||
- Use the `shadcn_flutter` documentation reference at:
|
||||
- [llms-full.txt](https://sunarya-thito.github.io/shadcn_flutter/llms-full.txt)
|
||||
- Prefer `import 'package:shadcn_flutter/shadcn_flutter.dart';` as the primary UI import form.
|
||||
- `shadcn_flutter` should have the highest import priority in product UI files. Keep it unaliased by default, and only add aliases to secondary packages when needed to avoid symbol conflicts or to clarify source ownership.
|
||||
- Prefer `ShadcnApp` / `ShadcnApp.router` at the app shell level.
|
||||
- Prefer `shadcn_flutter` controls such as buttons, inputs, tabs, dividers, and overlays over Material-style product UI widgets.
|
||||
- Material may remain only where required for platform/plugin interop or Flutter internals, not as the default product design system.
|
||||
- Product-facing interactive widgets must not use Flutter Material components such as `TextField`, `SnackBar`, `AlertDialog`, `showDialog`, `TextButton`, `ElevatedButton`, `OutlinedButton`, `IconButton`, `Drawer`, or similar Material UI controls when an equivalent `shadcn_flutter` primitive exists.
|
||||
- A `material.dart` import is acceptable only for low-level primitives such as `Icons`, `Colors`, `ChangeNotifier`, geometry, painting, focus, text editing, or platform/plugin interop. It must not be used as a shortcut to build product UI controls.
|
||||
- Tooltips are a documented exception to the Material-component restriction: always use the shared `AppTooltip` from `lib/shared/widgets/app_tooltip.dart`. It intentionally wraps Flutter's Material `Tooltip` because `shadcn_flutter`'s tooltip does not inherit the app's mixed Shadcn/Material theme consistently, which can produce a transparent-looking background and oversized text.
|
||||
- Never instantiate either Flutter's `Tooltip` or `shadcn_flutter`'s `Tooltip` directly in feature/page code. Keep tooltip messages localized and route all product tooltip styling and behavior through `AppTooltip`.
|
||||
- When auditing UI code, distinguish between:
|
||||
- acceptable Material foundation usage
|
||||
- forbidden Material product-component usage
|
||||
- If a screen already uses `shadcn_flutter`, do not mix in Material product widgets for convenience. Replace them with `shadcn_flutter` equivalents or shared wrappers built on top of `shadcn_flutter`.
|
||||
|
||||
## 3.4) Desktop Design Metrics
|
||||
|
||||
Use the following desktop reference metrics unless a specific screen requires a documented exception:
|
||||
|
||||
- Reference window: `1024 x 768`
|
||||
- Primary rail width: `64px`
|
||||
- Secondary filter sidebar width: `256px`
|
||||
- Main content header height: `80px`
|
||||
- Window drag header height on Windows: `30px`
|
||||
- Task row height: `72px`
|
||||
- Standard control radius: `4px`
|
||||
- Window / overlay radius: `12px`
|
||||
- Spacing rhythm: `4 / 8 / 12 / 16 / 24 / 32`
|
||||
|
||||
## 3.5) Motion Rules
|
||||
|
||||
- Motion is part of the spec, not decoration.
|
||||
- Recreate the design interactions when present in `design/`, including:
|
||||
- Progress shimmer / specular sweep
|
||||
- Indeterminate progress motion
|
||||
- Animated speed gauges / meters
|
||||
- Drawer slide-in transitions
|
||||
- Hover and selection transitions
|
||||
- Batch-mode reveal transitions
|
||||
- Centralize durations, curves, and motion constants whenever motion becomes shared across multiple widgets.
|
||||
|
||||
## 4) Responsive Layout Rules
|
||||
|
||||
- All screens must be responsive by default.
|
||||
- Never build a page for a single fixed size only.
|
||||
- Use adaptive patterns such as:
|
||||
- `LayoutBuilder`
|
||||
- breakpoints
|
||||
- `Flexible` / `Expanded`
|
||||
- desktop and mobile variants when needed
|
||||
- Verify every major page on at least:
|
||||
- small mobile width
|
||||
- medium / tablet width
|
||||
- desktop width
|
||||
|
||||
## 5) Component Decomposition Rules
|
||||
|
||||
### 5.1) Split aggressively into small files
|
||||
|
||||
- If a child widget is reusable or has an independent UI responsibility, move it to a separate file.
|
||||
- Do not keep large page files with many inline private widgets if those sections can be extracted cleanly.
|
||||
- Keep widgets focused and single-purpose.
|
||||
|
||||
### 5.2) Two levels of component abstraction
|
||||
|
||||
1. App-shared, non-business components
|
||||
- Place in `lib/shared/widgets/`
|
||||
- Examples: buttons, headers, chips, cards, window chrome, reusable form controls
|
||||
- Must stay business-agnostic and design-system aligned
|
||||
|
||||
2. Feature or page-specific components
|
||||
- Place close to usage inside the feature module
|
||||
- Recommended paths:
|
||||
- `lib/features/<feature>/presentation/pages/`
|
||||
- `lib/features/<feature>/presentation/widgets/`
|
||||
|
||||
### 5.3) Separation guidance
|
||||
|
||||
- Shared first when the component is used by multiple features or is purely design-system UI.
|
||||
- Feature-local when the component is tightly coupled to one feature's state or interaction model.
|
||||
- Promote from feature-local to shared only when reuse is real, not hypothetical.
|
||||
|
||||
### 5.4) Dual-platform component pattern
|
||||
|
||||
When mobile and desktop variants differ significantly, do not keep both branches inside one large widget file.
|
||||
|
||||
Required pattern:
|
||||
|
||||
```text
|
||||
lib/features/<feature>/presentation/widgets/<component>/
|
||||
├── <component>.dart
|
||||
├── <component>_mobile.dart
|
||||
└── <component>_desktop.dart
|
||||
```
|
||||
|
||||
Rules:
|
||||
|
||||
- Only import the facade file from pages or sibling widgets.
|
||||
- Keep business logic outside the mobile and desktop view files when possible.
|
||||
- If a shared component also needs this split, apply the same pattern under `lib/shared/widgets/<component>/`.
|
||||
|
||||
## 6) Desktop Window and Chrome Rules
|
||||
|
||||
- Do not simulate OS switching inside the app UI.
|
||||
- Adapt window chrome to the actual running platform:
|
||||
- macOS: prefer native system chrome behavior
|
||||
- Windows: use custom frameless chrome
|
||||
- Linux: prefer native behavior unless custom frameless support is explicitly verified as stable
|
||||
- The desktop window header / chrome must be implemented as a reusable shared component so it can be reused by:
|
||||
- the main window
|
||||
- the create-task child window
|
||||
- future child windows
|
||||
- Keep desktop window infrastructure in `lib/core/window/`.
|
||||
- Keep reusable visual window header components under `lib/shared/widgets/window/` or an equivalent shared path.
|
||||
|
||||
## 6.1) Cross-Window Capability Rules
|
||||
|
||||
- Follow the mandatory architecture in [`docs/window-capability-rpc.md`](docs/window-capability-rpc.md) for all communication between the main window and desktop child windows.
|
||||
- The main window is the sole owner of the Gopeed runtime, Gopeed API connection, and Hive database.
|
||||
- Child windows must use `AppCapabilities`; they must not initialize Gopeed, open Hive, import `lib/api/api.dart`, or access `Database.instance`.
|
||||
- Add new cross-window operations through shared `RpcMethod` descriptors and the central codec/registry. Do not add feature-specific MethodChannels or duplicate host/client serialization wrappers.
|
||||
- Main-to-child state updates must use centrally declared events with complete state snapshots.
|
||||
|
||||
## 7) Page Implementation Standard
|
||||
|
||||
For each page:
|
||||
|
||||
- Keep the page entry widget in a page file.
|
||||
- Move each meaningful sub-section into dedicated widget files.
|
||||
- Keep business state and side effects outside pure presentational widgets where practical.
|
||||
- Keep responsive logic explicit and readable.
|
||||
- Reuse shared tokens and shared window/header primitives instead of rebuilding them locally.
|
||||
- Desktop pages and desktop child windows must reserve `AppDesignTokens.windowHeaderHeight` at the top of their root content surface before the first visible content starts. This padding is owned by the page/window body itself, including create-task child windows, rather than being injected by a global shell.
|
||||
|
||||
## 8) Naming and Organization
|
||||
|
||||
- Use clear, intention-revealing names.
|
||||
- Favor suffixes:
|
||||
- `...Page`
|
||||
- `...Section`
|
||||
- `...Card`
|
||||
- `...Tile`
|
||||
- `...Button`
|
||||
- `...Header`
|
||||
- Avoid placeholder names such as `Widget1`, `TempView`, or `CommonBox`.
|
||||
|
||||
## 9) Localization and Text
|
||||
|
||||
- All user-facing natural-language strings must be localizable. This includes widget copy, validation and error messages, empty states, dialogs, tooltips, accessibility labels, tray menus, desktop notifications, Android foreground-service notifications, and child-window copy.
|
||||
- `lib/l10n/app_en.arb` is the source template. Add each new message to every `lib/l10n/app_<locale>.arb` catalog, keeping the same key set in every locale. Prefer a base locale such as `app_zh.arb`; add a region-qualified catalog such as `app_zh_TW.arb` only when it has a distinct selectable translation.
|
||||
- In widgets, read messages through `context.l10n`. In non-widget or background code, resolve the configured/system locale through the shared helpers in `lib/l10n/l10n.dart`; do not introduce a separate translation lookup mechanism.
|
||||
- Translate message values only, and never rename variables such as `{count}` or `{name}`. In a message like `{count, plural, =1{1 file} other{{count} files}}`, translate the user-visible branch text while keeping `count`, `plural`, branch selectors such as `=1`/`other`, and the braces valid. Preserve the corresponding ARB placeholder metadata, and do not translate metadata keys prefixed with `@`.
|
||||
- Prefer parameterized messages over string concatenation when word order can vary by language. Give placeholders explicit metadata and Dart types in the English ARB when appropriate.
|
||||
- Do not edit generated `app_localizations*.dart` files. Regenerate them from ARB sources with `flutter gen-l10n`.
|
||||
- Language names in the locale selector should remain native autonyms. Protocol names, product names, URLs, version strings, and dynamic data do not need translation unless they form part of natural-language copy.
|
||||
- Design for longer translations and right-to-left locales: avoid fixed text widths, use flexible/wrapping layouts where needed, and do not encode direction with left/right-only assumptions.
|
||||
- Do not hard-code production UI copy directly in widgets. Prototype-only text must be localized before the feature is considered complete.
|
||||
- Before completing localization work, run from `ui/flutter`:
|
||||
|
||||
```sh
|
||||
dart run ../../.github/workflows/scripts/check_l10n.dart
|
||||
flutter gen-l10n
|
||||
flutter analyze
|
||||
flutter test
|
||||
```
|
||||
|
||||
## 10) Quality Gate
|
||||
|
||||
Before merging major UI work:
|
||||
|
||||
- Verify desktop and mobile responsive behavior.
|
||||
- Verify alignment and spacing consistency with shared tokens.
|
||||
- Verify widget decomposition follows shared versus feature-local rules.
|
||||
- Verify no obvious style duplication remains in page files where shared components are appropriate.
|
||||
- Verify desktop window chrome behavior is correct for the target platform.
|
||||
- Verify screens that exist in `design/` still match the intended layout and motion behavior.
|
||||
@@ -0,0 +1,17 @@
|
||||
# Gopeed
|
||||
|
||||
A new Flutter project.
|
||||
|
||||
## Getting Started
|
||||
|
||||
This project is a starting point for a Flutter application.
|
||||
|
||||
A few resources to get you started if this is your first Flutter project:
|
||||
|
||||
- [Learn Flutter](https://docs.flutter.dev/get-started/learn-flutter)
|
||||
- [Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
|
||||
- [Flutter learning resources](https://docs.flutter.dev/reference/learning-resources)
|
||||
|
||||
For help getting started with Flutter development, view the
|
||||
[online documentation](https://docs.flutter.dev/), which offers tutorials,
|
||||
samples, guidance on mobile development, and a full API reference.
|
||||
@@ -13,8 +13,7 @@ linter:
|
||||
# The lint rules applied to this project can be customized in the
|
||||
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
|
||||
# included above or to enable additional rules. A list of all available lints
|
||||
# and their documentation is published at
|
||||
# https://dart-lang.github.io/linter/lints/index.html.
|
||||
# and their documentation is published at https://dart.dev/lints.
|
||||
#
|
||||
# Instead of disabling a lint rule for the entire project in the
|
||||
# section below, it can also be suppressed for a single line of code
|
||||
@@ -27,3 +26,6 @@ linter:
|
||||
|
||||
# Additional information about this file can be found at
|
||||
# https://dart.dev/guides/language/analysis-options
|
||||
|
||||
formatter:
|
||||
page_width: 120
|
||||
@@ -5,9 +5,11 @@ gradle-wrapper.jar
|
||||
/gradlew.bat
|
||||
/local.properties
|
||||
GeneratedPluginRegistrant.java
|
||||
.cxx/
|
||||
|
||||
# Remember to never publicly share your keystore.
|
||||
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
|
||||
# See https://flutter.dev/to/reference-keystore
|
||||
key.properties
|
||||
**/*.keystore
|
||||
**/*.jks
|
||||
/app/libs/libgopeed.aar
|
||||
@@ -1,88 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'kotlin-android'
|
||||
id 'dev.flutter.flutter-gradle-plugin'
|
||||
}
|
||||
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.gopeed.gopeed'
|
||||
compileSdk 36
|
||||
ndkVersion flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
coreLibraryDesugaringEnabled true
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = '17'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId 'com.gopeed.gopeed'
|
||||
// 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.
|
||||
minSdk flutter.minSdkVersion
|
||||
targetSdk 35
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
keyAlias 'upload'
|
||||
keyPassword System.getenv('APK_KEY_PASSWORD')
|
||||
storeFile file('upload-keystore.jks')
|
||||
storePassword System.getenv('APK_STORE_PASSWORD')
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
if (signingConfigs.release.keyPassword != null) {
|
||||
signingConfig signingConfigs.release
|
||||
} else {
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
flatDir {
|
||||
dirs 'libs'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(name: 'libgopeed', ext: 'aar')
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4'
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
import groovy.json.JsonOutput
|
||||
import groovy.json.JsonSlurper
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
val apkKeyPassword = System.getenv("APK_KEY_PASSWORD")
|
||||
val apkStorePassword = System.getenv("APK_STORE_PASSWORD")
|
||||
|
||||
android {
|
||||
namespace = "com.gopeed.gopeed"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
isCoreLibraryDesugaringEnabled = true
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_17.toString()
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId = "com.gopeed.gopeed"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||
minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
keyAlias = "upload"
|
||||
keyPassword = apkKeyPassword
|
||||
storeFile = file("upload-keystore.jks")
|
||||
storePassword = apkStorePassword
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig =
|
||||
if (!apkKeyPassword.isNullOrEmpty() && !apkStorePassword.isNullOrEmpty()) {
|
||||
signingConfigs.getByName("release")
|
||||
} else {
|
||||
signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
packaging {
|
||||
jniLibs {
|
||||
// Go and Flutter native libraries are large and compress well. Gopeed is
|
||||
// primarily distributed as APKs, so preserve the smaller legacy layout.
|
||||
useLegacyPackaging = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Generated by gomobile from bind/mobile before an Android build.
|
||||
implementation(files("libs/libgopeed.aar"))
|
||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
|
||||
}
|
||||
|
||||
// shadcn_flutter 0.0.53 unconditionally declares every Geist font and all
|
||||
// country_flags assets. Android uses platform fonts below and Gopeed does not use
|
||||
// PhoneInput/CountryFlag, so keep those transitive assets out of release APKs.
|
||||
val pruneReleaseFlutterAssets =
|
||||
tasks.register("pruneReleaseFlutterAssets") {
|
||||
dependsOn("compileFlutterBuildRelease")
|
||||
|
||||
val generatedFlutterAssets =
|
||||
layout.buildDirectory.dir("intermediates/flutter/release/flutter_assets")
|
||||
|
||||
doLast {
|
||||
val flutterAssets = generatedFlutterAssets.get().asFile
|
||||
if (!flutterAssets.isDirectory) {
|
||||
throw GradleException("Generated Flutter assets not found: $flutterAssets")
|
||||
}
|
||||
|
||||
val dartSources = fileTree(file("../../lib")) { include("**/*.dart") }
|
||||
val unsupportedUsage = Regex("\\b(CountryFlag|PhoneInput)\\b|Geist(?:Sans|Mono)")
|
||||
val appTheme = file("../../lib/shared/theme/app_theme.dart").canonicalFile
|
||||
val allowedWindowsFontReference =
|
||||
"fontFamily: 'packages/shadcn_flutter/GeistSans',"
|
||||
val usageFile =
|
||||
dartSources.files.firstOrNull { sourceFile ->
|
||||
val source = sourceFile.readText()
|
||||
val guardedSource =
|
||||
if (sourceFile.canonicalFile == appTheme) {
|
||||
source.replaceFirst(allowedWindowsFontReference, "")
|
||||
} else {
|
||||
source
|
||||
}
|
||||
unsupportedUsage.containsMatchIn(guardedSource)
|
||||
}
|
||||
if (usageFile != null) {
|
||||
throw GradleException(
|
||||
"Android release asset pruning is incompatible with ${usageFile.relativeTo(projectDir)}",
|
||||
)
|
||||
}
|
||||
|
||||
listOf(
|
||||
flutterAssets.resolve("packages/country_flags/res/si"),
|
||||
flutterAssets.resolve("packages/shadcn_flutter/lib/fonts"),
|
||||
).forEach { assetDirectory ->
|
||||
if (assetDirectory.exists() && !assetDirectory.deleteRecursively()) {
|
||||
throw GradleException("Unable to prune Flutter assets: $assetDirectory")
|
||||
}
|
||||
}
|
||||
|
||||
val fontManifest = flutterAssets.resolve("FontManifest.json")
|
||||
if (!fontManifest.isFile) {
|
||||
throw GradleException("Flutter font manifest not found: $fontManifest")
|
||||
}
|
||||
val fonts = JsonSlurper().parse(fontManifest) as List<*>
|
||||
val optimizedFonts =
|
||||
fonts.filterNot { entry ->
|
||||
val family = (entry as? Map<*, *>)?.get("family")
|
||||
family == "packages/shadcn_flutter/GeistSans" ||
|
||||
family == "packages/shadcn_flutter/GeistMono"
|
||||
}
|
||||
fontManifest.writeText(JsonOutput.toJson(optimizedFonts))
|
||||
}
|
||||
}
|
||||
|
||||
tasks.matching { it.name == "copyFlutterAssetsRelease" }.configureEach {
|
||||
dependsOn(pruneReleaseFlutterAssets)
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
</manifest>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
||||
@@ -1,100 +1,77 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
||||
<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.WRITE_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.FOREGROUND_SERVICE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
|
||||
<application
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="Gopeed"
|
||||
android:extractNativeLibs="true">
|
||||
android:name="${applicationName}"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:extractNativeLibs="true"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleInstance"
|
||||
android:taskAffinity=""
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
|
||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||
the Android process has started. This theme is visible to the user
|
||||
while the Flutter UI initializes. After that, this theme continues
|
||||
to determine the Window background behind the Flutter UI. -->
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme" />
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme"
|
||||
/>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".CreateDialogActivity"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:excludeFromRecents="true"
|
||||
android:exported="true"
|
||||
android:finishOnTaskLaunch="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/DialogLaunchTheme"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data
|
||||
android:scheme="file"
|
||||
android:host="*"
|
||||
android:pathPattern=".*torrent" />
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data
|
||||
android:scheme="file"
|
||||
android:host="*"
|
||||
android:mimeType="application/x-bittorrent" />
|
||||
<data android:scheme="gopeed" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data
|
||||
android:scheme="content"
|
||||
android:host="*"
|
||||
android:pathPattern=".*torrent" />
|
||||
<data android:scheme="magnet" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data
|
||||
android:scheme="content"
|
||||
android:host="*"
|
||||
android:mimeType="application/x-bittorrent" />
|
||||
<data android:scheme="file" android:host="*" android:pathPattern=".*torrent" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data
|
||||
android:scheme="magnet" />
|
||||
<data android:scheme="file" android:host="*" android:mimeType="application/x-bittorrent" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="content" android:host="*" android:pathPattern=".*torrent" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="content" android:host="*" android:mimeType="application/x-bittorrent" />
|
||||
</intent-filter>
|
||||
<!-- Handle http/https URLs with common downloadable mimeTypes -->
|
||||
<intent-filter android:label="Gopeed">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
@@ -110,26 +87,29 @@
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="*/*" />
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/DialogNormalTheme" />
|
||||
</activity>
|
||||
|
||||
<!-- Add android:stopWithTask option only when necessary. -->
|
||||
<service
|
||||
android:name="com.pravera.flutter_foreground_task.service.ForegroundService"
|
||||
android:foregroundServiceType="dataSync"
|
||||
android:exported="false" />
|
||||
|
||||
android:exported="false"
|
||||
android:foregroundServiceType="dataSync" />
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
<meta-data
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
</application>
|
||||
<!-- Required to query activities that can process text, see:
|
||||
https://developer.android.com/training/package-visibility and
|
||||
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
|
||||
|
||||
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.PROCESS_TEXT"/>
|
||||
<data android:mimeType="text/plain"/>
|
||||
</intent>
|
||||
</queries>
|
||||
</manifest>
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.gopeed.gopeed
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.WindowManager
|
||||
import io.flutter.embedding.android.FlutterActivityLaunchConfigs
|
||||
|
||||
class CreateDialogActivity : MainActivity() {
|
||||
override fun isDialogMode(): Boolean = true
|
||||
|
||||
override fun getBackgroundMode(): FlutterActivityLaunchConfigs.BackgroundMode {
|
||||
return FlutterActivityLaunchConfigs.BackgroundMode.transparent
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
val metrics = resources.displayMetrics
|
||||
val width = (metrics.widthPixels * 0.92f).toInt()
|
||||
val maxHeight = (metrics.heightPixels * 0.62f).toInt()
|
||||
val preferredHeight = (420 * metrics.density).toInt()
|
||||
|
||||
window.setGravity(Gravity.CENTER)
|
||||
window.setDimAmount(0.28f)
|
||||
window.setLayout(width, minOf(maxHeight, preferredHeight))
|
||||
|
||||
val attrs = window.attributes
|
||||
attrs.flags = attrs.flags or WindowManager.LayoutParams.FLAG_DIM_BEHIND
|
||||
window.attributes = attrs
|
||||
}
|
||||
}
|
||||
@@ -1,49 +1,41 @@
|
||||
package com.gopeed.gopeed
|
||||
|
||||
import androidx.annotation.NonNull
|
||||
import com.gopeed.libgopeed.Libgopeed
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
import io.flutter.embedding.engine.FlutterEngine
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
import io.flutter.plugin.common.StandardMethodCodec
|
||||
|
||||
open class MainActivity : FlutterActivity() {
|
||||
private val CHANNEL = "gopeed.com/libgopeed"
|
||||
|
||||
protected open fun isDialogMode(): Boolean = false
|
||||
|
||||
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
|
||||
class MainActivity : FlutterActivity() {
|
||||
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
|
||||
super.configureFlutterEngine(flutterEngine)
|
||||
|
||||
val taskQueue =
|
||||
flutterEngine.dartExecutor.binaryMessenger.makeBackgroundTaskQueue()
|
||||
MethodChannel(
|
||||
flutterEngine.dartExecutor.binaryMessenger,
|
||||
CHANNEL,
|
||||
LIBGOPEED_CHANNEL,
|
||||
StandardMethodCodec.INSTANCE,
|
||||
taskQueue
|
||||
taskQueue,
|
||||
).setMethodCallHandler { call, result ->
|
||||
when (call.method) {
|
||||
"start" -> {
|
||||
val cfg = call.argument<String>("cfg")
|
||||
try {
|
||||
val port = Libgopeed.start(cfg)
|
||||
result.success(port)
|
||||
} catch (e: Exception) {
|
||||
result.error("ERROR", e.message, null)
|
||||
result.success(Libgopeed.start(call.argument<String>("cfg")))
|
||||
} catch (error: Exception) {
|
||||
result.error("ERROR", error.message, null)
|
||||
}
|
||||
}
|
||||
"stop" -> {
|
||||
Libgopeed.stop()
|
||||
result.success(null)
|
||||
}
|
||||
"isDialogMode" -> {
|
||||
result.success(isDialogMode())
|
||||
}
|
||||
else -> {
|
||||
result.notImplemented()
|
||||
}
|
||||
else -> result.notImplemented()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val LIBGOPEED_CHANNEL = "gopeed.com/libgopeed"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.7 KiB |
@@ -15,18 +15,4 @@
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
<style name="DialogLaunchTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
</style>
|
||||
<style name="DialogNormalTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -15,18 +15,4 @@
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
<style name="DialogLaunchTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
</style>
|
||||
<style name="DialogNormalTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -3,5 +3,5 @@
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
</manifest>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
||||
@@ -1,36 +0,0 @@
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = '../build'
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
subprojects { subproject ->
|
||||
subproject.plugins.withId('com.android.library') {
|
||||
subproject.android {
|
||||
if (namespace == null || namespace.isEmpty()) {
|
||||
def manifest = file("${subproject.projectDir}/src/main/AndroidManifest.xml")
|
||||
if (manifest.exists()) {
|
||||
def manifestContent = manifest.getText()
|
||||
def packagePattern = /package\s*=\s*["']([^"']+)["']/
|
||||
def matcher = (manifestContent =~ packagePattern)
|
||||
if (matcher.find()) {
|
||||
namespace = matcher.group(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('clean', Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
val newBuildDir: Directory =
|
||||
rootProject.layout.buildDirectory
|
||||
.dir("../../build")
|
||||
.get()
|
||||
rootProject.layout.buildDirectory.value(newBuildDir)
|
||||
|
||||
subprojects {
|
||||
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
||||
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(":app")
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
||||
@@ -1,6 +1,2 @@
|
||||
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
|
||||
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
android.nonTransitiveRClass=true
|
||||
android.nonFinalResIds=true
|
||||
android.defaults.buildfeatures.buildconfig=true
|
||||
@@ -1,6 +1,5 @@
|
||||
#Fri Jun 23 08:50:38 CEST 2017
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
|
||||
@@ -1,25 +0,0 @@
|
||||
pluginManagement {
|
||||
def flutterSdkPath = {
|
||||
def properties = new Properties()
|
||||
file('local.properties').withInputStream { properties.load(it) }
|
||||
def flutterSdkPath = properties.getProperty('flutter.sdk')
|
||||
assert flutterSdkPath != null, 'flutter.sdk not set in local.properties'
|
||||
return flutterSdkPath
|
||||
}()
|
||||
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'dev.flutter.flutter-plugin-loader' version '1.0.0'
|
||||
id 'com.android.application' version '8.7.3' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '2.1.0' apply false
|
||||
}
|
||||
|
||||
include ':app'
|
||||
@@ -0,0 +1,26 @@
|
||||
pluginManagement {
|
||||
val flutterSdkPath =
|
||||
run {
|
||||
val properties = java.util.Properties()
|
||||
file("local.properties").inputStream().use { properties.load(it) }
|
||||
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
||||
flutterSdkPath
|
||||
}
|
||||
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||
id("com.android.application") version "8.11.1" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
|
||||
}
|
||||
|
||||
include(":app")
|
||||
@@ -16,4 +16,4 @@ targets:
|
||||
field_rename: none
|
||||
generic_argument_factories: false
|
||||
ignore_unannotated: false
|
||||
include_if_null: false
|
||||
include_if_null: false
|
||||
@@ -1 +1 @@
|
||||
output: dist/
|
||||
output: dist/
|
||||
@@ -0,0 +1,130 @@
|
||||
# Window Capability RPC Architecture
|
||||
|
||||
This document defines the internal communication contract between the main window and desktop child windows.
|
||||
|
||||
## 1. Ownership
|
||||
|
||||
- The main window is the only owner of the Gopeed runtime, Gopeed API connection, and Hive database.
|
||||
- Child windows must never initialize `libgopeed`, initialize the Gopeed HTTP client, or open a Hive box.
|
||||
- Child windows access application capabilities through `AppCapabilities` only.
|
||||
- Immutable window launch input, such as the window type and an initial create-task request, may use `AppWindowPayload`.
|
||||
- API addresses, API tokens, appearance state, locale, and persisted data must not be placed in launch payloads.
|
||||
|
||||
## 2. Layers
|
||||
|
||||
```text
|
||||
Presentation / Riverpod controllers
|
||||
|
|
||||
AppCapabilities
|
||||
/ \
|
||||
GopeedService AppStorageService
|
||||
\ /
|
||||
CapabilityInvoker
|
||||
/ \
|
||||
LocalCapability WindowCapability
|
||||
Invoker Invoker
|
||||
| |
|
||||
CapabilityRegistry WindowMethodChannel
|
||||
| |
|
||||
Gopeed HTTP/FFI + Hive in the main window
|
||||
```
|
||||
|
||||
The presentation layer must not branch on whether it is running in a main or child window. The root `ProviderScope` selects the local or remote capability implementation.
|
||||
|
||||
## 3. RPC Contract
|
||||
|
||||
Every operation is declared once as a typed `RpcMethod<P, R>`:
|
||||
|
||||
```dart
|
||||
static const resolve = RpcMethod<ResolveTask, ResolveResult>('gopeed.resolve');
|
||||
```
|
||||
|
||||
Rules:
|
||||
|
||||
- Operation names are stable protocol identifiers and must be declared in a capability method catalog.
|
||||
- Do not duplicate operation strings in pages, controllers, host handlers, or clients.
|
||||
- Do not create one MethodChannel per operation.
|
||||
- Do not expose Gopeed HTTP paths through the internal capability API.
|
||||
- Multi-argument operations should use a JSON map or a dedicated request DTO.
|
||||
- Prefer a dedicated request DTO when parameters have domain meaning or are likely to evolve.
|
||||
|
||||
`RpcCodecRegistry` owns serialization. Encoding is generic for JSON primitives, collections, enums, and models with `toJson()`. Each non-primitive response or request model registers its `fromJson` decoder once. Individual operations must not repeat request and response codec closures.
|
||||
|
||||
The local invoker calls the typed handler directly and does not perform a JSON round trip. Serialization occurs only at a window boundary.
|
||||
|
||||
## 4. Transport
|
||||
|
||||
Child-to-main requests use one unidirectional `WindowMethodChannel`:
|
||||
|
||||
```text
|
||||
gopeed.app.capabilities.v1
|
||||
```
|
||||
|
||||
The transport uses one method, `capability.call`, with an operation name and JSON payload. Results use a common success/error envelope. MethodChannel provides request-response correlation, so the protocol does not add request IDs for ordinary calls.
|
||||
|
||||
The existing HTTP `HostRpcService` is an external browser-extension integration and is not the internal window capability transport. Its `/forward` endpoint must not be reused by child windows.
|
||||
|
||||
## 5. Events And State Synchronization
|
||||
|
||||
Main-to-child events use each child's `WindowController` channel. A child registers its method handler before subscribing.
|
||||
|
||||
Initialization order:
|
||||
|
||||
1. The child registers its window event handler.
|
||||
2. The child requests the current appearance snapshot.
|
||||
3. The child applies the snapshot.
|
||||
4. The child subscribes with its window ID.
|
||||
5. The main window stores the controller and immediately sends the current snapshot again.
|
||||
6. Later state changes are broadcast to every subscribed child.
|
||||
|
||||
Events contain complete state snapshots, not patches. No revision field is required. Event names are declared centrally in `AppWindowRpcProtocol`.
|
||||
|
||||
Appearance synchronization uses `appearance.changed` and currently contains:
|
||||
|
||||
- Theme mode
|
||||
- Theme color
|
||||
- Locale
|
||||
|
||||
State broadcasting must observe the owning Riverpod state centrally. Do not broadcast directly from a settings button callback, because updates can originate from configuration loading, system changes, or future entry points.
|
||||
|
||||
## 6. Storage
|
||||
|
||||
- `Database` remains the low-level Hive implementation and is main-window infrastructure.
|
||||
- Product code used by child windows depends on `AppStorageService`.
|
||||
- Storage RPC methods expose business capabilities such as create-history operations, not raw `box.get` or `box.put` access.
|
||||
- Prefer batch mutations across the window boundary. For example, save all parsed URLs in one `saveCreateHistory(List<String>)` call.
|
||||
- New child-window storage requirements must be added to `StorageMethods` and bound in the main registry.
|
||||
|
||||
## 7. Gopeed Backend Migration
|
||||
|
||||
All structured task, configuration, extension, and webhook operations are exposed through `GopeedService`. The local registry currently binds them to `lib/api/api.dart`.
|
||||
|
||||
When the backend moves to FFI:
|
||||
|
||||
- Replace the main-window local bindings or their underlying implementation.
|
||||
- Keep `GopeedMethods`, `GopeedService`, child-window transport, pages, and controllers unchanged.
|
||||
- Keep raw HTTP proxy functionality separate unless an explicit capability contract is introduced for it.
|
||||
|
||||
## 8. Adding A Capability
|
||||
|
||||
1. Add one typed `RpcMethod` to the appropriate method catalog.
|
||||
2. Register a model decoder once if a new non-primitive type crosses the boundary.
|
||||
3. Add the strongly typed facade method to the capability service.
|
||||
4. Bind the method to the main-window implementation in `LocalAppCapabilities`.
|
||||
5. Use the facade from a Riverpod controller or page.
|
||||
6. Add tests for local typed dispatch and serialized dispatch.
|
||||
7. For events, add one centralized event name and broadcast a complete snapshot.
|
||||
|
||||
## 9. Prohibited Patterns
|
||||
|
||||
Child-window code must not:
|
||||
|
||||
- Import `lib/api/api.dart`.
|
||||
- Call `api.init` or access the Gopeed socket/address/token.
|
||||
- Import or access `Database.instance`.
|
||||
- Open Hive boxes.
|
||||
- Receive API configuration or persisted data through `AppWindowPayload`.
|
||||
- Add feature-specific MethodChannels.
|
||||
- Parse RPC JSON directly inside a page or widget.
|
||||
|
||||
These constraints keep all backend and persistence ownership in the main window and allow multiple child windows to operate concurrently without database locks or duplicated Gopeed runtimes.
|
||||
@@ -20,7 +20,5 @@
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>11.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,5 +1,4 @@
|
||||
# Uncomment this line to define a global platform for your project
|
||||
# platform :ios, '11.0'
|
||||
platform :ios, '13.0'
|
||||
|
||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||
@@ -33,12 +32,19 @@ target 'Runner' do
|
||||
|
||||
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
|
||||
|
||||
# share_handler addition start
|
||||
# The iOS share extension and the Flutter plugin exchange the incoming share
|
||||
# payload through the models pod supplied by share_handler_ios.
|
||||
target 'ShareExtension' do
|
||||
# Keep the inherited CocoaPods platform here. The Xcode extension target is
|
||||
# iOS 14; setting a second platform here makes CocoaPods emit two model
|
||||
# frameworks with the same product path during archive builds.
|
||||
inherit! :search_paths
|
||||
pod 'share_handler_ios_models', :path => '.symlinks/plugins/share_handler_ios/ios/Models'
|
||||
end
|
||||
|
||||
target 'RunnerTests' do
|
||||
inherit! :search_paths
|
||||
pod "share_handler_ios_models", :path => ".symlinks/plugins/share_handler_ios/ios/Models"
|
||||
end
|
||||
# share_handler addition end
|
||||
end
|
||||
|
||||
post_install do |installer|
|
||||
|
||||
@@ -1,52 +1,160 @@
|
||||
PODS:
|
||||
- file_selector_ios (0.0.1):
|
||||
- app_links (6.4.1):
|
||||
- Flutter
|
||||
- device_info_plus (0.0.1):
|
||||
- Flutter
|
||||
- DKImagePickerController/Core (4.3.9):
|
||||
- DKImagePickerController/ImageDataManager
|
||||
- DKImagePickerController/Resource
|
||||
- DKImagePickerController/ImageDataManager (4.3.9)
|
||||
- DKImagePickerController/PhotoGallery (4.3.9):
|
||||
- DKImagePickerController/Core
|
||||
- DKPhotoGallery
|
||||
- DKImagePickerController/Resource (4.3.9)
|
||||
- DKPhotoGallery (0.0.19):
|
||||
- DKPhotoGallery/Core (= 0.0.19)
|
||||
- DKPhotoGallery/Model (= 0.0.19)
|
||||
- DKPhotoGallery/Preview (= 0.0.19)
|
||||
- DKPhotoGallery/Resource (= 0.0.19)
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- DKPhotoGallery/Core (0.0.19):
|
||||
- DKPhotoGallery/Model
|
||||
- DKPhotoGallery/Preview
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- DKPhotoGallery/Model (0.0.19):
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- DKPhotoGallery/Preview (0.0.19):
|
||||
- DKPhotoGallery/Model
|
||||
- DKPhotoGallery/Resource
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- DKPhotoGallery/Resource (0.0.19):
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- file_picker (0.0.1):
|
||||
- DKImagePickerController/PhotoGallery
|
||||
- Flutter
|
||||
- Flutter (1.0.0)
|
||||
- flutter_foreground_task (0.0.1):
|
||||
- Flutter
|
||||
- flutter_inappwebview_ios (0.0.1):
|
||||
- Flutter
|
||||
- flutter_inappwebview_ios/Core (= 0.0.1)
|
||||
- OrderedSet (~> 6.0.3)
|
||||
- flutter_inappwebview_ios/Core (0.0.1):
|
||||
- Flutter
|
||||
- OrderedSet (~> 6.0.3)
|
||||
- flutter_local_notifications (0.0.1):
|
||||
- Flutter
|
||||
- install_plugin (2.0.0):
|
||||
- Flutter
|
||||
- open_filex (0.0.2):
|
||||
- Flutter
|
||||
- OrderedSet (6.0.3)
|
||||
- package_info_plus (0.4.5):
|
||||
- Flutter
|
||||
- path_provider_ios (0.0.1):
|
||||
- SDWebImage (5.21.7):
|
||||
- SDWebImage/Core (= 5.21.7)
|
||||
- SDWebImage/Core (5.21.7)
|
||||
- share_handler_ios (0.0.14):
|
||||
- Flutter
|
||||
- permission_handler_apple (9.0.4):
|
||||
- share_handler_ios/share_handler_ios_models (= 0.0.14)
|
||||
- share_handler_ios_models
|
||||
- share_handler_ios/share_handler_ios_models (0.0.14):
|
||||
- Flutter
|
||||
- shared_preferences_ios (0.0.1):
|
||||
- share_handler_ios_models
|
||||
- share_handler_ios_models (0.0.9)
|
||||
- share_plus (0.0.1):
|
||||
- Flutter
|
||||
- shared_preferences_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- SwiftyGif (5.4.5)
|
||||
- url_launcher_ios (0.0.1):
|
||||
- Flutter
|
||||
|
||||
DEPENDENCIES:
|
||||
- file_selector_ios (from `.symlinks/plugins/file_selector_ios/ios`)
|
||||
- app_links (from `.symlinks/plugins/app_links/ios`)
|
||||
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
||||
- file_picker (from `.symlinks/plugins/file_picker/ios`)
|
||||
- Flutter (from `Flutter`)
|
||||
- flutter_foreground_task (from `.symlinks/plugins/flutter_foreground_task/ios`)
|
||||
- flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
|
||||
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
|
||||
- install_plugin (from `.symlinks/plugins/install_plugin/ios`)
|
||||
- open_filex (from `.symlinks/plugins/open_filex/ios`)
|
||||
- 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`)
|
||||
- share_handler_ios (from `.symlinks/plugins/share_handler_ios/ios`)
|
||||
- share_handler_ios_models (from `.symlinks/plugins/share_handler_ios/ios/Models`)
|
||||
- share_plus (from `.symlinks/plugins/share_plus/ios`)
|
||||
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
|
||||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- DKImagePickerController
|
||||
- DKPhotoGallery
|
||||
- OrderedSet
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
file_selector_ios:
|
||||
:path: ".symlinks/plugins/file_selector_ios/ios"
|
||||
app_links:
|
||||
:path: ".symlinks/plugins/app_links/ios"
|
||||
device_info_plus:
|
||||
:path: ".symlinks/plugins/device_info_plus/ios"
|
||||
file_picker:
|
||||
:path: ".symlinks/plugins/file_picker/ios"
|
||||
Flutter:
|
||||
:path: Flutter
|
||||
flutter_foreground_task:
|
||||
:path: ".symlinks/plugins/flutter_foreground_task/ios"
|
||||
flutter_inappwebview_ios:
|
||||
:path: ".symlinks/plugins/flutter_inappwebview_ios/ios"
|
||||
flutter_local_notifications:
|
||||
:path: ".symlinks/plugins/flutter_local_notifications/ios"
|
||||
install_plugin:
|
||||
:path: ".symlinks/plugins/install_plugin/ios"
|
||||
open_filex:
|
||||
:path: ".symlinks/plugins/open_filex/ios"
|
||||
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"
|
||||
share_handler_ios:
|
||||
:path: ".symlinks/plugins/share_handler_ios/ios"
|
||||
share_handler_ios_models:
|
||||
:path: ".symlinks/plugins/share_handler_ios/ios/Models"
|
||||
share_plus:
|
||||
:path: ".symlinks/plugins/share_plus/ios"
|
||||
shared_preferences_foundation:
|
||||
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
|
||||
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
|
||||
app_links: 585674be3c6661708e6cd794ab4f39fb9d8356f9
|
||||
device_info_plus: bf2e3232933866d73fe290f2942f2156cdd10342
|
||||
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
|
||||
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
|
||||
file_picker: b159e0c068aef54932bb15dc9fd1571818edaf49
|
||||
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
|
||||
flutter_foreground_task: 21ef182ab0a29a3005cc72cd70e5f45cb7f7f817
|
||||
flutter_inappwebview_ios: 6f63631e2c62a7c350263b13fa5427aedefe81d4
|
||||
flutter_local_notifications: ff50f8405aaa0ccdc7dcfb9022ca192e8ad9688f
|
||||
install_plugin: b52f81470a1f37b006607bdf7ffc6031df43fe76
|
||||
open_filex: 6e26e659846ec990262224a12ef1c528bb4edbe4
|
||||
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
|
||||
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
|
||||
SDWebImage: e9fc87c1aab89a8ab1bbd74eba378c6f53be8abf
|
||||
share_handler_ios: 6dd3a4ac5ca0d955274aec712ba0ecdcaf583e7c
|
||||
share_handler_ios_models: fc638c9b4330dc7f082586c92aee9dfa0b87b871
|
||||
share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f
|
||||
shared_preferences_foundation: 5086985c1d43c5ba4d5e69a4e8083a389e2909e6
|
||||
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
|
||||
url_launcher_ios: bb13df5870e8c4234ca12609d04010a21be43dfa
|
||||
|
||||
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
|
||||
PODFILE CHECKSUM: 7051f989596e02a313dd9d53c0e20afa508c2ef3
|
||||
|
||||
COCOAPODS: 1.11.3
|
||||
COCOAPODS: 1.15.2
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1430"
|
||||
LastUpgradeVersion = "1510"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -26,6 +26,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
@@ -37,17 +38,30 @@
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO"
|
||||
parallelizable = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "331C8080294A63A400263BE5"
|
||||
BuildableName = "RunnerTests.xctest"
|
||||
BlueprintName = "RunnerTests"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
enableGPUValidationMode = "1"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
|
||||
@@ -1,75 +1,70 @@
|
||||
import UIKit
|
||||
import Flutter
|
||||
import Libgopeed
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
@objc class AppDelegate: FlutterAppDelegate {
|
||||
override func application(
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
) -> Bool {
|
||||
let controller : FlutterViewController = window?.rootViewController as! FlutterViewController
|
||||
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)
|
||||
}
|
||||
})
|
||||
|
||||
let locationChannel = FlutterMethodChannel(
|
||||
name: "gopeed/location_keep_alive",
|
||||
binaryMessenger: controller.binaryMessenger
|
||||
)
|
||||
@main
|
||||
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
|
||||
override func application(
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
) -> Bool {
|
||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||
}
|
||||
|
||||
locationChannel.setMethodCallHandler {
|
||||
(call: FlutterMethodCall, result: @escaping FlutterResult) in
|
||||
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
|
||||
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
|
||||
let messenger = engineBridge.applicationRegistrar.messenger()
|
||||
|
||||
switch call.method {
|
||||
|
||||
case "requestPermission":
|
||||
LocationKeepAliveManager.shared.requestPermission { authorized in
|
||||
result(authorized)
|
||||
}
|
||||
|
||||
case "start":
|
||||
LocationKeepAliveManager.shared.start()
|
||||
result(nil)
|
||||
|
||||
case "stop":
|
||||
LocationKeepAliveManager.shared.stop()
|
||||
result(nil)
|
||||
|
||||
default:
|
||||
result(FlutterMethodNotImplemented)
|
||||
}
|
||||
}
|
||||
|
||||
GeneratedPluginRegistrant.register(with: self)
|
||||
|
||||
SwiftFlutterForegroundTaskPlugin.setPluginRegistrantCallback(registerPlugins)
|
||||
if #available(iOS 10.0, *) {
|
||||
UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
|
||||
let libgopeedChannel = FlutterMethodChannel(
|
||||
name: "gopeed.com/libgopeed",
|
||||
binaryMessenger: messenger
|
||||
)
|
||||
libgopeedChannel.setMethodCallHandler { call, result in
|
||||
switch call.method {
|
||||
case "start":
|
||||
let arguments = call.arguments as? [String: Any]
|
||||
let config = arguments?["cfg"] as? String
|
||||
let port = UnsafeMutablePointer<Int>.allocate(capacity: 1)
|
||||
defer { port.deallocate() }
|
||||
var error: NSError?
|
||||
if LibgopeedStart(config, port, &error) {
|
||||
result(port.pointee)
|
||||
} else {
|
||||
result(
|
||||
FlutterError(
|
||||
code: "ERROR",
|
||||
message: error?.localizedDescription ?? "Failed to start Libgopeed",
|
||||
details: nil
|
||||
)
|
||||
)
|
||||
}
|
||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||
case "stop":
|
||||
LibgopeedStop()
|
||||
result(nil)
|
||||
default:
|
||||
result(FlutterMethodNotImplemented)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func registerPlugins(registry: FlutterPluginRegistry) {
|
||||
GeneratedPluginRegistrant.register(with: registry)
|
||||
let locationChannel = FlutterMethodChannel(
|
||||
name: "gopeed/location_keep_alive",
|
||||
binaryMessenger: messenger
|
||||
)
|
||||
locationChannel.setMethodCallHandler { call, result in
|
||||
switch call.method {
|
||||
case "requestPermission":
|
||||
LocationKeepAliveManager.shared.requestPermission { authorized in
|
||||
result(authorized)
|
||||
}
|
||||
case "start":
|
||||
LocationKeepAliveManager.shared.start()
|
||||
result(nil)
|
||||
case "stop":
|
||||
LocationKeepAliveManager.shared.stop()
|
||||
result(nil)
|
||||
default:
|
||||
result(FlutterMethodNotImplemented)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,122 +1 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "[email protected]",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
{"images":[{"size":"20x20","idiom":"iphone","filename":"[email protected]","scale":"2x"},{"size":"20x20","idiom":"iphone","filename":"[email protected]","scale":"3x"},{"size":"29x29","idiom":"iphone","filename":"[email protected]","scale":"1x"},{"size":"29x29","idiom":"iphone","filename":"[email protected]","scale":"2x"},{"size":"29x29","idiom":"iphone","filename":"[email protected]","scale":"3x"},{"size":"40x40","idiom":"iphone","filename":"[email protected]","scale":"2x"},{"size":"40x40","idiom":"iphone","filename":"[email protected]","scale":"3x"},{"size":"57x57","idiom":"iphone","filename":"[email protected]","scale":"1x"},{"size":"57x57","idiom":"iphone","filename":"[email protected]","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"[email protected]","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"[email protected]","scale":"3x"},{"size":"20x20","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"20x20","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"29x29","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"29x29","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"40x40","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"40x40","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"50x50","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"50x50","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"72x72","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"72x72","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"76x76","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"76x76","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"83.5x83.5","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"1024x1024","idiom":"ios-marketing","filename":"[email protected]","scale":"1x"}],"info":{"version":1,"author":"xcode"}}
|
||||
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 890 B After Width: | Height: | Size: 752 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.0 KiB |