diff --git a/android/app/build.gradle b/android/app/build.gradle index ccd426b..8e61f9e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -6,7 +6,7 @@ plugins { } android { - namespace = "com.example.xstream" + namespace = "com.example.xstream_app" compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion @@ -21,7 +21,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId = "com.example.xstream" + applicationId = "com.example.xstream_app" // 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 diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 87adad7..d7e98d1 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index e55e44d..00d0dc8 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -368,7 +368,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.xstream; + PRODUCT_BUNDLE_IDENTIFIER = com.example.xstreamApp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -384,7 +384,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.xstream.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.xstreamApp.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -401,7 +401,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.xstream.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.xstreamApp.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -416,7 +416,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.xstream.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.xstreamApp.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -547,7 +547,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.xstream; + PRODUCT_BUNDLE_IDENTIFIER = com.example.xstreamApp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -569,7 +569,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.xstream; + PRODUCT_BUNDLE_IDENTIFIER = com.example.xstreamApp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 670c6bc..812c87c 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - Xstream + Xstream App CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -13,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - xstream + xstream_app CFBundlePackageType APPL CFBundleShortVersionString diff --git a/lib/main.dart b/lib/main.dart index e9ca488..b8ae66d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,22 +1,68 @@ import 'package:flutter/material.dart'; import 'screens/home_screen.dart'; +import 'screens/subscription_screen.dart'; +import 'screens/settings_screen.dart'; +import 'utils/app_theme.dart'; void main() { - runApp(const XStreamApp()); + runApp(MyApp()); } -class XStreamApp extends StatelessWidget { - const XStreamApp({super.key}); - +class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'XStream', - theme: ThemeData( - primarySwatch: Colors.blue, - visualDensity: VisualDensity.adaptivePlatformDensity, + theme: AppTheme.lightTheme, + darkTheme: AppTheme.darkTheme, + home: MainPage(), + ); + } +} + +class MainPage extends StatefulWidget { + @override + _MainPageState createState() => _MainPageState(); +} + +class _MainPageState extends State { + int _currentIndex = 0; + + final List _pages = [ + HomeScreen(), + SubscriptionScreen(), + SettingsScreen(), + ]; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('XStream'), + ), + body: _pages[_currentIndex], + bottomNavigationBar: BottomNavigationBar( + currentIndex: _currentIndex, + onTap: (index) { + setState(() { + _currentIndex = index; + }); + }, + items: const [ + BottomNavigationBarItem( + icon: Icon(Icons.home), + label: 'Home', + ), + BottomNavigationBarItem( + icon: Icon(Icons.link), + label: 'Subscriptions', + ), + BottomNavigationBarItem( + icon: Icon(Icons.settings), + label: 'Settings', + ), + ], ), - home: const HomeScreen(), ); } } diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart index 7701403..ea2d1b4 100644 --- a/lib/screens/home_screen.dart +++ b/lib/screens/home_screen.dart @@ -1,38 +1,135 @@ import 'package:flutter/material.dart'; -import '../widgets/connection_form.dart'; -import '../widgets/device_list.dart'; -import '../widgets/service_status.dart'; class HomeScreen extends StatelessWidget { - const HomeScreen({super.key}); + @override + Widget build(BuildContext context) { + return LayoutBuilder( + builder: (context, constraints) { + // 检测屏幕宽度和平台 + bool isLargeScreen = constraints.maxWidth > 600; + bool isDesktop = Theme.of(context).platform == TargetPlatform.macOS || + Theme.of(context).platform == TargetPlatform.linux || + Theme.of(context).platform == TargetPlatform.windows || + Theme.of(context).platform == TargetPlatform.fuchsia; + + return isLargeScreen && isDesktop + ? Row( + children: [ + // 左侧的状态信息和启动按钮 + Expanded( + flex: 1, + child: Container( + color: Colors.grey[200], + padding: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '服务状态', + style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), + ), + SizedBox(height: 8), + Text('服务地址: http:// 或 Socks5://127.0.0.1:1080'), + SizedBox(height: 8), + Text('网络延迟: '), + SizedBox(height: 8), + Text('网络丢包: '), + Spacer(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '服务未运行', + style: TextStyle(color: Colors.red), + ), + ElevatedButton( + onPressed: () { + // 启动服务的逻辑 + }, + child: Text('启动服务'), + ), + ], + ), + ], + ), + ), + ), + // 右侧的配置列表 + Expanded( + flex: 2, + child: ListView( + children: [ + CustomListTile(title: 'VLESS', subtitle: 'tcp | none'), + CustomListTile(title: 'VMess', subtitle: 'tcp | none'), + CustomListTile(title: 'Shadowsocks', subtitle: 'tcp | none'), + CustomListTile(title: 'Trojan', subtitle: 'tcp | tls'), + CustomListTile(title: 'Socks', subtitle: 'tcp | none'), + ], + ), + ), + ], + ) + : ListView( + children: [ + // 仅显示配置项目,在每行的按钮上显示状态信息 + CustomListTile( + title: 'VLESS', + subtitle: 'tcp | none', + status: '服务未运行', // 可根据具体状态动态显示 + ), + CustomListTile( + title: 'VMess', + subtitle: 'tcp | none', + status: '服务未运行', + ), + CustomListTile( + title: 'Shadowsocks', + subtitle: 'tcp | none', + status: '服务未运行', + ), + CustomListTile( + title: 'Trojan', + subtitle: 'tcp | tls', + status: '服务未运行', + ), + CustomListTile( + title: 'Socks', + subtitle: 'tcp | none', + status: '服务未运行', + ), + ], + ); + }, + ); + } +} + +class CustomListTile extends StatelessWidget { + final String title; + final String subtitle; + final String? status; + + const CustomListTile({ + Key? key, + required this.title, + required this.subtitle, + this.status, + }) : super(key: key); @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('XStream - 连接 XTLS 服务器'), - ), - body: Row( - children: [ - Expanded( - flex: 1, - child: Container( - padding: const EdgeInsets.all(16.0), - color: Colors.grey.shade200, - child: const ServiceStatus(), - ), - ), - Expanded( - flex: 2, - child: Column( - children: [ - const ConnectionForm(), // 这里可以使用 const - Expanded(child: const DeviceList()), - ], - ), - ), - ], - ), + return ListTile( + title: Text(title), + subtitle: Text(subtitle), + trailing: status != null + ? Text( + status!, + style: TextStyle(color: status == '服务运行' ? Colors.green : Colors.red), + ) + : null, + onTap: () { + // 点击事件逻辑,例如显示详细信息或启动服务 + }, ); } } diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart new file mode 100644 index 0000000..432204c --- /dev/null +++ b/lib/screens/settings_screen.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class SettingsScreen extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Center( + child: Text('Settings Page'), + ); + } +} diff --git a/lib/screens/subscription_screen.dart b/lib/screens/subscription_screen.dart new file mode 100644 index 0000000..560739c --- /dev/null +++ b/lib/screens/subscription_screen.dart @@ -0,0 +1,99 @@ +import 'dart:convert'; +import 'dart:io'; +import 'package:flutter/material.dart'; + +class SubscriptionScreen extends StatefulWidget { + @override + _SubscriptionScreenState createState() => _SubscriptionScreenState(); +} + +class _SubscriptionScreenState extends State { + final _domainController = TextEditingController(); + final _uuidController = TextEditingController(); + String _message = ''; + + Future _generateConfig() async { + final domain = _domainController.text; + final uuid = _uuidController.text; + + // JSON 数据结构 + final Map configData = { + "outbounds": [ + { + "protocol": "vless", + "settings": { + "vnext": [ + { + "address": domain, + "port": 443, + "users": [ + { + "id": uuid, + "alterId": 0, + "security": "none", + } + ] + } + ] + } + } + ], + // 其他配置项可以在此添加 + }; + + // 将 JSON 数据写入文件 + try { + final file = File('/opt/homebrew/etc/xray-vpn.json'); + await file.writeAsString(json.encode(configData)); + setState(() { + _message = '配置文件生成成功: ${file.path}'; + }); + } catch (e) { + setState(() { + _message = '生成配置文件失败: $e'; + }); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Subscription Config'), + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + TextField( + controller: _domainController, + decoration: InputDecoration( + labelText: 'XTLS Server 域名', + border: OutlineInputBorder(), + ), + ), + SizedBox(height: 16), + TextField( + controller: _uuidController, + decoration: InputDecoration( + labelText: 'UUID', + border: OutlineInputBorder(), + ), + ), + SizedBox(height: 16), + ElevatedButton( + onPressed: _generateConfig, + child: Text('生成配置文件'), + ), + SizedBox(height: 16), + Text( + _message, + style: TextStyle(color: Colors.red), + ), + ], + ), + ), + ); + } +} diff --git a/lib/utils/app_theme.dart b/lib/utils/app_theme.dart new file mode 100644 index 0000000..c5de96d --- /dev/null +++ b/lib/utils/app_theme.dart @@ -0,0 +1,13 @@ +import 'package:flutter/material.dart'; + +class AppTheme { + static final ThemeData lightTheme = ThemeData( + primarySwatch: Colors.blue, + brightness: Brightness.light, + ); + + static final ThemeData darkTheme = ThemeData( + primarySwatch: Colors.blue, + brightness: Brightness.dark, + ); +} diff --git a/lib/widgets/connection_form.dart b/lib/widgets/connection_form.dart deleted file mode 100644 index b4ef493..0000000 --- a/lib/widgets/connection_form.dart +++ /dev/null @@ -1,100 +0,0 @@ -import 'package:flutter/material.dart'; -import 'dart:convert'; -import 'dart:io'; -import 'package:flutter/services.dart' show rootBundle; - -class ConnectionForm extends StatefulWidget { - const ConnectionForm({Key? key}) : super(key: key); - - @override - _ConnectionFormState createState() => _ConnectionFormState(); -} - -class _ConnectionFormState extends State { - final _formKey = GlobalKey(); - final TextEditingController _serverController = TextEditingController(); - final TextEditingController _uuidController = TextEditingController(); - - Future _generateConfigFile() async { - // 获取用户输入 - String serverDomain = _serverController.text.trim(); - String uuid = _uuidController.text.trim(); - - if (serverDomain.isEmpty || uuid.isEmpty) { - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar(content: Text('请输入有效的 XTLS Server 域名和 UUID')), - ); - return; - } - - try { - // 读取 assets/xray-template.json 文件 - String templateContent = await rootBundle.loadString('assets/xray-template.json'); - - // 替换模板中的占位符 - String updatedContent = templateContent - .replaceAll('', serverDomain) - .replaceAll('', uuid); - - // 定义最终的文件路径 - String outputPath = '/opt/homebrew/etc/xray-vpn.json'; - - // 写入最终的配置文件 - final file = File(outputPath); - await file.writeAsString(updatedContent); - - ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text('配置文件已成功生成: $outputPath')), - ); - } catch (e) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text('生成配置文件时出错: $e')), - ); - } - } - - @override - Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.all(16.0), - child: Form( - key: _formKey, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - TextFormField( - controller: _serverController, - decoration: const InputDecoration( - labelText: 'XTLS Server 域名', - ), - validator: (value) { - if (value == null || value.isEmpty) { - return '请输入有效的 XTLS Server 域名'; - } - return null; - }, - ), - const SizedBox(height: 16.0), - TextFormField( - controller: _uuidController, - decoration: const InputDecoration( - labelText: 'XTLS UUID', - ), - validator: (value) { - if (value == null || value.isEmpty) { - return '请输入有效的 XTLS UUID'; - } - return null; - }, - ), - const SizedBox(height: 32.0), - ElevatedButton( - onPressed: _generateConfigFile, - child: const Text('生成配置文件'), - ), - ], - ), - ), - ); - } -} diff --git a/lib/widgets/custom_list_tile.dart b/lib/widgets/custom_list_tile.dart new file mode 100644 index 0000000..a99b9e9 --- /dev/null +++ b/lib/widgets/custom_list_tile.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; + +class CustomListTile extends StatelessWidget { + final String title; + final String subtitle; + + CustomListTile({required this.title, required this.subtitle}); + + @override + Widget build(BuildContext context) { + return ListTile( + leading: Icon(Icons.network_check), + title: Text(title), + subtitle: Text(subtitle), + trailing: IconButton( + icon: Icon(Icons.play_arrow), + onPressed: () { + // Connection logic + }, + ), + ); + } +} diff --git a/lib/widgets/custom_text_field.dart b/lib/widgets/custom_text_field.dart new file mode 100644 index 0000000..c92024d --- /dev/null +++ b/lib/widgets/custom_text_field.dart @@ -0,0 +1,17 @@ +import 'package:flutter/material.dart'; + +class CustomTextField extends StatelessWidget { + final String label; + + CustomTextField({required this.label}); + + @override + Widget build(BuildContext context) { + return TextField( + decoration: InputDecoration( + labelText: label, + border: OutlineInputBorder(), + ), + ); + } +} diff --git a/lib/widgets/device_list.dart b/lib/widgets/device_list.dart deleted file mode 100644 index a8717eb..0000000 --- a/lib/widgets/device_list.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:flutter/material.dart'; - -class DeviceList extends StatelessWidget { - const DeviceList({super.key}); - - @override - Widget build(BuildContext context) { - return ListView( - padding: const EdgeInsets.all(8.0), - children: [ - _buildDeviceTile('341 958 790', 'macbookairmimashimima@macbookdemacbook-air.local', Icons.laptop_mac), - _buildDeviceTile('37 678 284', 'eric@erics-macbook-pro-2.local', Icons.computer), - _buildDeviceTile('1 413 347 755', 'android@HUAWEI-ADY-AL00', Icons.android), - ], - ); - } - - ListTile _buildDeviceTile(String id, String description, IconData icon) { - return ListTile( - leading: Icon(icon, color: Colors.orange), - title: Text(id), - subtitle: Text(description), - trailing: Icon(Icons.more_vert), - ); - } -} diff --git a/lib/widgets/service_status.dart b/lib/widgets/service_status.dart deleted file mode 100644 index 49fa096..0000000 --- a/lib/widgets/service_status.dart +++ /dev/null @@ -1,35 +0,0 @@ -import 'package:flutter/material.dart'; - -class ServiceStatus extends StatelessWidget { - const ServiceStatus({super.key}); - - @override - Widget build(BuildContext context) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const Text('服务状态', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)), - const SizedBox(height: 10), - const Text('服务地址: http:// Or Socks5://127.0.0.1:1080', style: TextStyle(fontSize: 16)), - const SizedBox(height: 20), - const Text('网络延迟:', style: TextStyle(fontSize: 16)), - const SizedBox(height: 10), - const Text('网络丢包:', style: TextStyle(fontSize: 16)), - const SizedBox(height: 20), - const Spacer(), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const Text('服务未运行', style: TextStyle(color: Colors.red)), - TextButton( - onPressed: () { - // 点击启动服务的逻辑 - }, - child: const Text('启动服务'), - ), - ], - ), - ], - ); - } -} diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index f87064e..578e59a 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -4,10 +4,10 @@ project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. -set(BINARY_NAME "xstream") +set(BINARY_NAME "xstream_app") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "com.example.xstream") +set(APPLICATION_ID "com.example.xstream_app") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/linux/my_application.cc b/linux/my_application.cc index d8cd0a2..351c70b 100644 --- a/linux/my_application.cc +++ b/linux/my_application.cc @@ -40,11 +40,11 @@ static void my_application_activate(GApplication* application) { if (use_header_bar) { GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, "xstream"); + gtk_header_bar_set_title(header_bar, "xstream_app"); gtk_header_bar_set_show_close_button(header_bar, TRUE); gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); } else { - gtk_window_set_title(window, "xstream"); + gtk_window_set_title(window, "xstream_app"); } gtk_window_set_default_size(window, 1280, 720); diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 978004c..c99e779 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -64,7 +64,7 @@ 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* xstream.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "xstream.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* xstream_app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "xstream_app.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -131,7 +131,7 @@ 33CC10EE2044A3C60003C045 /* Products */ = { isa = PBXGroup; children = ( - 33CC10ED2044A3C60003C045 /* xstream.app */, + 33CC10ED2044A3C60003C045 /* xstream_app.app */, 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, ); name = Products; @@ -217,7 +217,7 @@ ); name = Runner; productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* xstream.app */; + productReference = 33CC10ED2044A3C60003C045 /* xstream_app.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -385,10 +385,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.xstream.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.xstreamApp.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/xstream.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/xstream"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/xstream_app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/xstream_app"; }; name = Debug; }; @@ -399,10 +399,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.xstream.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.xstreamApp.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/xstream.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/xstream"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/xstream_app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/xstream_app"; }; name = Release; }; @@ -413,10 +413,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.xstream.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.xstreamApp.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/xstream.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/xstream"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/xstream_app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/xstream_app"; }; name = Profile; }; diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 96b6b2b..85cd16e 100644 --- a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -15,7 +15,7 @@ @@ -31,7 +31,7 @@ @@ -65,7 +65,7 @@ @@ -82,7 +82,7 @@ diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/macos/Runner/Configs/AppInfo.xcconfig index 408530f..5361656 100644 --- a/macos/Runner/Configs/AppInfo.xcconfig +++ b/macos/Runner/Configs/AppInfo.xcconfig @@ -5,10 +5,10 @@ // 'flutter create' template. // The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = xstream +PRODUCT_NAME = xstream_app // The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = com.example.xstream +PRODUCT_BUNDLE_IDENTIFIER = com.example.xstreamApp // The copyright displayed in application information PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved. diff --git a/pubspec.yaml b/pubspec.yaml index 8746506..6ff0452 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,6 @@ name: xstream -description: A Cutting-Edge Network Accelerator Powered by XTLS VLESS. +description: A cross-platform network accelerator powered by XTLS VLESS. +version: 1.0.0+1 environment: sdk: ">=2.17.0 <3.0.0" @@ -8,8 +9,6 @@ dependencies: flutter: sdk: flutter cupertino_icons: ^1.0.2 - http: ^0.13.4 - process_run: ^0.12.0 # 添加 process_run 依赖 dev_dependencies: flutter_test: diff --git a/test/widget_test.dart b/test/widget_test.dart index 1933608..10360f4 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:xstream/main.dart'; +import 'package:xstream_app/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { diff --git a/web/index.html b/web/index.html index 5e60024..b89361b 100644 --- a/web/index.html +++ b/web/index.html @@ -23,13 +23,13 @@ - + - xstream + xstream_app diff --git a/web/manifest.json b/web/manifest.json index 7b79b58..bc4b2a0 100644 --- a/web/manifest.json +++ b/web/manifest.json @@ -1,6 +1,6 @@ { - "name": "xstream", - "short_name": "xstream", + "name": "xstream_app", + "short_name": "xstream_app", "start_url": ".", "display": "standalone", "background_color": "#0175C2", diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index f4cda9d..70feaa0 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -1,10 +1,10 @@ # Project-level configuration. cmake_minimum_required(VERSION 3.14) -project(xstream LANGUAGES CXX) +project(xstream_app LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. -set(BINARY_NAME "xstream") +set(BINARY_NAME "xstream_app") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/windows/runner/Runner.rc b/windows/runner/Runner.rc index adea9d4..a8f9a25 100644 --- a/windows/runner/Runner.rc +++ b/windows/runner/Runner.rc @@ -90,12 +90,12 @@ BEGIN BLOCK "040904e4" BEGIN VALUE "CompanyName", "com.example" "\0" - VALUE "FileDescription", "xstream" "\0" + VALUE "FileDescription", "xstream_app" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" - VALUE "InternalName", "xstream" "\0" + VALUE "InternalName", "xstream_app" "\0" VALUE "LegalCopyright", "Copyright (C) 2024 com.example. All rights reserved." "\0" - VALUE "OriginalFilename", "xstream.exe" "\0" - VALUE "ProductName", "xstream" "\0" + VALUE "OriginalFilename", "xstream_app.exe" "\0" + VALUE "ProductName", "xstream_app" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" END END diff --git a/windows/runner/main.cpp b/windows/runner/main.cpp index 3ede7c1..66e75f9 100644 --- a/windows/runner/main.cpp +++ b/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.Create(L"xstream", origin, size)) { + if (!window.Create(L"xstream_app", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); diff --git a/xstream_app.iml b/xstream_app.iml new file mode 100644 index 0000000..f66303d --- /dev/null +++ b/xstream_app.iml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + +