Skip to content

Commit

Permalink
Commit some code
Browse files Browse the repository at this point in the history
  • Loading branch information
mengyanshou committed Aug 7, 2023
1 parent 56689d5 commit bf9d612
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 84 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.5.3
- 修复启动卡死、崩溃等问题
- 修复关于页面资源图片加载失败,官网跳转失败的问题
- 修复部分设备布局适配到平板的问题

## 1.5.2
- 修复屏幕适配问题
- 修复终端下方按钮无反应的问题
Expand All @@ -23,7 +28,7 @@
- 增加进程管理(目前只可浏览)
- 修复终端模拟器页面无法正常重启服务的问题(没有替换adb为libadb.so)(nxdsupport反馈)
- 修复文件选择平铺模式无法选择的问题(nxdsupport反馈)
- 同步各种依赖库到最新
- 同步各种依赖库到最新
- 局域网设备搜索初版开发完成
- 修复设备无法断开连接的问题(Android)

Expand Down
5 changes: 4 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ android {
output.versionCodeOverride = flutterVersionCode.toInteger()
}
}
ndkVersion "21.1.6352462"


ndkVersion "21.4.7075529"
// ndkVersion "21.1.6352462"
}

flutter {
Expand Down
103 changes: 49 additions & 54 deletions lib/adbkit_entrypoint.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class _ADBToolEntryPointState extends State<ADBToolEntryPoint> with WindowListen
return;
}
// 等待1s
// await Future<void>.delayed(const Duration(milliseconds: 1000));
await Future<void>.delayed(const Duration(milliseconds: 1000));
if (widget.primary != null) {
seed = widget.primary;
}
Expand Down Expand Up @@ -81,61 +81,56 @@ class _ADBToolEntryPointState extends State<ADBToolEntryPoint> with WindowListen

@override
Widget build(BuildContext context) {
return GetBuilder<TabController>(
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<ConfigController>(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<ConfigController>(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<ConfigController>(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<ConfigController>(builder: (config) {
return Theme(
data: config.theme!,
child: const AdbTool(),
);
}),
],
);
}
},
),
),
);
return GetBuilder<TabController>(
init: controller,
builder: (controller) {
return Scaffold(
backgroundColor: const Color(0xfff3f4f9),
Expand Down
12 changes: 6 additions & 6 deletions lib/app/modules/install/adb_install_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ class _DownloadFileState extends State<_DownloadFile> {
Response<String>? response;
final String? filesPath = RuntimeEnvir.binPath;
List<String> 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<String> macAdbFiles = [
'http://nightmare.fun/File/MToolkit/mac/adb.zip',
'http://nightmare.press/File/MToolkit/mac/adb.zip',
];
List<String> 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 = '';
Expand Down
2 changes: 1 addition & 1 deletion lib/global/drawer/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions lib/global/instance/global.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<List<int>>().transform(const Utf8Decoder()).listen(
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Future<void> 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);
},
),
Expand Down
10 changes: 2 additions & 8 deletions lib/material_entrypoint.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ class _MaterialAppWrapperState extends State<MaterialAppWrapper> 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 {
Expand All @@ -141,8 +135,8 @@ class _MaterialAppWrapperState extends State<MaterialAppWrapper> 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: [
Expand Down
9 changes: 4 additions & 5 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 6 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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"

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions scripts/properties.sh
Original file line number Diff line number Diff line change
@@ -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'
APP_NAME_CN='ADBKIT'

0 comments on commit bf9d612

Please sign in to comment.