From bf9d612a78dc899241d5b49a79e01d26ac2bd7e6 Mon Sep 17 00:00:00 2001 From: nightmare Date: Mon, 7 Aug 2023 10:15:13 +0800 Subject: [PATCH] Commit some code --- CHANGELOG.md | 7 +- android/app/build.gradle | 5 +- lib/adbkit_entrypoint.dart | 103 +++++++++--------- lib/app/modules/install/adb_install_page.dart | 12 +- lib/global/drawer/about.dart | 2 +- lib/global/instance/global.dart | 9 +- lib/main.dart | 2 +- lib/material_entrypoint.dart | 10 +- pubspec.lock | 9 +- pubspec.yaml | 7 +- scripts/properties.sh | 6 +- 11 files changed, 88 insertions(+), 84 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54e645a1..f46e07b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.5.3 +- 修复启动卡死、崩溃等问题 +- 修复关于页面资源图片加载失败,官网跳转失败的问题 +- 修复部分设备布局适配到平板的问题 + ## 1.5.2 - 修复屏幕适配问题 - 修复终端下方按钮无反应的问题 @@ -23,7 +28,7 @@ - 增加进程管理(目前只可浏览) - 修复终端模拟器页面无法正常重启服务的问题(没有替换adb为libadb.so)(nxdsupport反馈) - 修复文件选择平铺模式无法选择的问题(nxdsupport反馈) -- 同步各种依赖库到最新 +- 同步各种依赖库到最新 - 局域网设备搜索初版开发完成 - 修复设备无法断开连接的问题(Android) diff --git a/android/app/build.gradle b/android/app/build.gradle index 2ce70426..fa814d27 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -72,7 +72,10 @@ android { output.versionCodeOverride = flutterVersionCode.toInteger() } } - ndkVersion "21.1.6352462" + + + ndkVersion "21.4.7075529" + // ndkVersion "21.1.6352462" } flutter { diff --git a/lib/adbkit_entrypoint.dart b/lib/adbkit_entrypoint.dart index 9cf3f901..182cd4f9 100644 --- a/lib/adbkit_entrypoint.dart +++ b/lib/adbkit_entrypoint.dart @@ -43,7 +43,7 @@ class _ADBToolEntryPointState extends State with WindowListen return; } // 等待1s - // await Future.delayed(const Duration(milliseconds: 1000)); + await Future.delayed(const Duration(milliseconds: 1000)); if (widget.primary != null) { seed = widget.primary; } @@ -81,61 +81,56 @@ class _ADBToolEntryPointState extends State with WindowListen @override Widget build(BuildContext context) { - return GetBuilder( - init: TabController() - ..setInitPage( - PageEntity( - title: 'ADB KIT', - page: Column( - children: [ - Expanded( - child: FutureBuilder( - future: init(), - builder: (_, snapshot) { - switch (snapshot.connectionState) { - case ConnectionState.none: - return const Text('Input a URL to start'); - case ConnectionState.waiting: - return const Center(child: CircularProgressIndicator()); - case ConnectionState.active: - return const Text(''); - case ConnectionState.done: - return Stack( - children: [ - GetBuilder(builder: (config) { - if (config.backgroundStyle == BackgroundStyle.normal) { - return Container( - color: config.theme!.colorScheme.background, - ); - } - if (config.backgroundStyle == BackgroundStyle.image) { - return SizedBox( - height: double.infinity, - child: Image.asset( - 'assets/b.png', - fit: BoxFit.cover, - ), - ); - } else { - return const SizedBox(); - } - }), - GetBuilder(builder: (config) { - return Theme( - data: config.theme!, - child: const AdbTool(), - ); - }), - ], - ); + TabController controller = TabController(); + controller.setInitPage( + PageEntity( + title: 'ADB KIT', + page: FutureBuilder( + future: init(), + builder: (_, snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.none: + return const Text('Input a URL to start'); + case ConnectionState.waiting: + return const Center(child: CircularProgressIndicator()); + case ConnectionState.active: + return const Text(''); + case ConnectionState.done: + return Stack( + children: [ + GetBuilder(builder: (config) { + if (config.backgroundStyle == BackgroundStyle.normal) { + return Container( + color: config.theme!.colorScheme.background, + ); } - }, - ), - ), - ], - ), - ), + if (config.backgroundStyle == BackgroundStyle.image) { + return SizedBox( + height: double.infinity, + child: Image.asset( + 'assets/b.png', + fit: BoxFit.cover, + ), + ); + } else { + return const SizedBox(); + } + }), + GetBuilder(builder: (config) { + return Theme( + data: config.theme!, + child: const AdbTool(), + ); + }), + ], + ); + } + }, ), + ), + ); + return GetBuilder( + init: controller, builder: (controller) { return Scaffold( backgroundColor: const Color(0xfff3f4f9), diff --git a/lib/app/modules/install/adb_install_page.dart b/lib/app/modules/install/adb_install_page.dart index 3757a12a..86d9bea0 100644 --- a/lib/app/modules/install/adb_install_page.dart +++ b/lib/app/modules/install/adb_install_page.dart @@ -65,16 +65,16 @@ class _DownloadFileState extends State<_DownloadFile> { Response? response; final String? filesPath = RuntimeEnvir.binPath; List androidAdbFiles = [ - 'http://nightmare.fun/YanTool/android/adb', - 'http://nightmare.fun/YanTool/android/adb.bin' + 'http://nightmare.press/YanTool/android/adb', + 'http://nightmare.press/YanTool/android/adb.bin' ]; List macAdbFiles = [ - 'http://nightmare.fun/File/MToolkit/mac/adb.zip', + 'http://nightmare.press/File/MToolkit/mac/adb.zip', ]; List winAdbFiles = [ - 'http://nightmare.fun/File/MToolkit/windows/adb.exe', - 'http://nightmare.fun/File/MToolkit/windows/AdbWinUsbApi.dll', - 'http://nightmare.fun/File/MToolkit/windows/AdbWinApi.dll', + 'http://nightmare.press/File/MToolkit/windows/adb.exe', + 'http://nightmare.press/File/MToolkit/windows/AdbWinUsbApi.dll', + 'http://nightmare.press/File/MToolkit/windows/AdbWinApi.dll', ]; double fileDownratio = 0.0; String downloadName = ''; diff --git a/lib/global/drawer/about.dart b/lib/global/drawer/about.dart index 3373c247..043cf1b5 100644 --- a/lib/global/drawer/about.dart +++ b/lib/global/drawer/about.dart @@ -46,7 +46,7 @@ class About extends ADBPage { ), ), openSourceLink: 'https://github.com/nightmare-space/adb_kit', - otherVersionLink: 'http://nightmare.fun/YanTool/resources/ADBTool/?C=N;O=A', + otherVersionLink: 'http://nightmare.press/YanTool/resources/ADBTool/?C=N;O=A', license: '''BSD 3-Clause License Copyright (c) 2021, Nightmare diff --git a/lib/global/instance/global.dart b/lib/global/instance/global.dart index 13b9efb0..a2d712fe 100644 --- a/lib/global/instance/global.dart +++ b/lib/global/instance/global.dart @@ -82,14 +82,17 @@ class Global { if (GetPlatform.isWindows) { shell = 'cmd'; } - shell = 'bash'; + // ! 直接由 pty start bash,在android上首次启动会crash + // ! 原因未知 pty ??= Pty.start( shell, - arguments: ['-l'], + arguments: [], environment: envir, - // workingDirectory: '/', workingDirectory: RuntimeEnvir.binPath, ); + + // 启动bash + pty?.writeString('bash\n'); pty?.write(Uint8List.fromList(utf8.encode('source ${RuntimeEnvir.binPath}/shell_intergration.sh\n'))); pty!.output.cast>().transform(const Utf8Decoder()).listen( diff --git a/lib/main.dart b/lib/main.dart index eb44ce9c..16be26ae 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -74,7 +74,7 @@ Future runADBClient({Color? primary}) async { }, zoneSpecification: ZoneSpecification( print: (Zone self, ZoneDelegate parent, Zone zone, String line) { - parent.print(zone, 'ZoneSpecification: $line'); + parent.print(zone, line); // Log.d(line); }, ), diff --git a/lib/material_entrypoint.dart b/lib/material_entrypoint.dart index 926e247e..ba5878d2 100644 --- a/lib/material_entrypoint.dart +++ b/lib/material_entrypoint.dart @@ -120,12 +120,6 @@ class _MaterialAppWrapperState extends State with WidgetsBin return ResponsiveBreakpoints.builder( child: Builder( builder: (context) { - print(ResponsiveBreakpoints.of(context).breakpoint); - print(ResponsiveBreakpoints.of(context).screenHeight); - print(ResponsiveBreakpoints.of(context).screenWidth); - print(ResponsiveBreakpoints.of(context).isDesktop); - print(ResponsiveBreakpoints.of(context).isTablet); - print(ResponsiveBreakpoints.of(context).isMobile); if (ResponsiveBreakpoints.of(context).isDesktop || ResponsiveBreakpoints.of(context).isTablet) { ScreenAdapter.init(896); } else { @@ -141,8 +135,8 @@ class _MaterialAppWrapperState extends State with WidgetsBin // ResponsiveTargetPlatform.macOS, // ], breakpoints: const [ - Breakpoint(start: 0, end: 400, name: MOBILE), - Breakpoint(start: 400, end: 800, name: TABLET), + Breakpoint(start: 0, end: 500, name: MOBILE), + Breakpoint(start: 500, end: 800, name: TABLET), Breakpoint(start: 800, end: 2000, name: DESKTOP), ], breakpointsLandscape: [ diff --git a/pubspec.lock b/pubspec.lock index 1e2cd4b0..8128565f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -314,11 +314,10 @@ packages: flutter_pty: dependency: "direct main" description: - name: flutter_pty - sha256: "1f3114f125e4c447866511560818d6ac368471712cc952a25b5a06586aa80b64" - url: "https://pub.dev" - source: hosted - version: "0.3.1" + path: "../flutter_pty" + relative: true + source: path + version: "0.4.0" flutter_spinkit: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index cbbb2fd4..40d93c6f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: adb_kit description: The best ADB client for Android/Windows/Linux/macOS. publish_to: "none" -version: 1.5.2+43 +version: 1.5.3+44 environment: sdk: ">=3.0.0 <4.0.0" @@ -79,6 +79,9 @@ dependencies: screenshot: ^2.1.0 device_info_plus: 8.1.0 + + # 下面两个是非开源库,个人编译需要移除 + # 并手动解决编译报错 termux_api_plugin: path: ../termux_api_plugin adb_kit_extension: @@ -110,6 +113,8 @@ dependency_overrides: android_intent_plus: 4.0.1 global_repository: path: ../global_repository + flutter_pty: + path: ../flutter_pty # app_launcher: # path: ../app_launcher # # multicast: diff --git a/scripts/properties.sh b/scripts/properties.sh index 609d99d6..3a4285c8 100755 --- a/scripts/properties.sh +++ b/scripts/properties.sh @@ -1,5 +1,5 @@ -VERSION='1.5.2' -VERSION_CODE='43' +VERSION='1.5.3' +VERSION_CODE='44' TARGET_PATH=root@$server:/home/nightmare/YanTool/resources/ADBTool APP_NAME='ADBKIT' -APP_NAME_CN='ADBKIT' \ No newline at end of file +APP_NAME_CN='ADBKIT'