File tree Expand file tree Collapse file tree 7 files changed +51
-8
lines changed
Expand file tree Collapse file tree 7 files changed +51
-8
lines changed Original file line number Diff line number Diff line change 11import 'dart:io' ;
22import 'package:adb_tool/app/routes/app_pages.dart' ;
3+ import 'package:adb_tool/main.dart' ;
34import 'package:adb_tool/themes/app_colors.dart' ;
45import 'package:flutter/foundation.dart' ;
56import 'package:flutter/material.dart' ;
67import 'package:global_repository/global_repository.dart' ;
8+ import 'package:nativeshell/nativeshell.dart' ;
79import 'package:url_launcher/url_launcher.dart' ;
810
911class TabletDrawer extends StatefulWidget {
@@ -144,7 +146,14 @@ class _TabletDrawerState extends State<TabletDrawer> {
144146 groupValue: widget.groupValue,
145147 title: '日志' ,
146148 iconData: Icons .pending_outlined,
147- onTap: (value) {
149+ onTap: (value) async {
150+ // final window =
151+ // await Window.create(OtherWindowState.toInitData());
152+ // // you can use the window object to communicate with newly created
153+ // // window or register handlers for window events
154+ // window.closeEvent.addListener(() {
155+ // print('Window closed');
156+ // });
148157 widget.onChanged.call (value);
149158 },
150159 ),
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ class Global {
143143 'libbrotlicommon.so' ,
144144 ];
145145 List <String > globalFiles = [
146- 'server.jar ' ,
146+ 'app_server ' ,
147147 ];
148148
149149 /// 复制一堆执行文件
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ library adb_tool;
22
33import 'dart:io' ;
44import 'dart:ui' ;
5+ import 'package:adb_tool/app/modules/log_page.dart' ;
56import 'package:app_manager/app_manager.dart' ;
67import 'package:flutter/foundation.dart' ;
78import 'package:flutter/material.dart' ;
@@ -174,6 +175,9 @@ class NativeShellWrapper extends StatelessWidget {
174175 child: WindowWidget (
175176 onCreateState: (initData) {
176177 WindowState state;
178+
179+ state ?? = OtherWindowState .fromInitData (initData);
180+ // possibly no init data, this is main window
177181 state ?? = MainWindowState ();
178182 return state;
179183 },
@@ -199,3 +203,32 @@ class MainWindowState extends WindowState {
199203 );
200204 }
201205}
206+
207+ class OtherWindowState extends WindowState {
208+ @override
209+ Widget build (BuildContext context) {
210+ return MaterialApp (
211+ home: Responsive (
212+ builder: (_, __) {
213+ return LogPage ();
214+ },
215+ ),
216+ );
217+ }
218+
219+ // This can be anything that fromInitData recognizes
220+ static dynamic toInitData () => {
221+ 'class' : 'OtherWindow' ,
222+ };
223+
224+ static OtherWindowState fromInitData (dynamic initData) {
225+ if (initData is Map && initData['class' ] == 'OtherWindow' ) {
226+ return OtherWindowState ();
227+ }
228+ return null ;
229+ }
230+
231+ @override
232+ WindowSizingMode get windowSizingMode =>
233+ WindowSizingMode .atLeastIntrinsicSize;
234+ }
Original file line number Diff line number Diff line change @@ -7,8 +7,7 @@ import 'package:pseudo_terminal_utils/pseudo_terminal_utils.dart';
77import 'package:termare_pty/termare_pty.dart' ;
88
99///
10- /// 仓库本身不使用这个类,对外提供
11- /// 无界投屏和 ADB工具箱
10+ /// 无界投屏也会直接依赖这个
1211///
1312class DexServer {
1413 DexServer ._();
@@ -23,11 +22,11 @@ class DexServer {
2322 // 上传server文件
2423 await AdbUtil .pushFile (
2524 devicesId,
26- '${RuntimeEnvir .binPath }/server.jar ' ,
25+ '${RuntimeEnvir .binPath }/app_server ' ,
2726 targetPath,
2827 );
2928 final List <String > processArg =
30- '-s $devicesId shell CLASSPATH=$targetPath app_process /data/local/tmp/ com.nightmare.apputils .AppChannel'
29+ '-s $devicesId shell CLASSPATH=$targetPath app_process /data/local/tmp/ com.nightmare.applib .AppChannel'
3130 .split (' ' );
3231 // CLASSPATH=/data/local/tmp/test app_process /data/local/tmp/ com.nightmare.applib.AppChannel
3332 final PseudoTerminal pty = TerminalUtil .getShellTerminal (
Original file line number Diff line number Diff line change 1- sed -i ' ' ' 20s/false/true/' ./lib/main.dart
1+ # 计算出定义 bool 的代码行数
2+ line=` cat ./lib/main.dart | grep -n " bool useNativeShell" | awk -F " :" ' {print \$1}' `
3+ sed -i ' ' $line ' s/false/true/' ./lib/main.dart
24cargo build --release
35rm -rf " target/ADB TOOL.app"
46cargo bundle-tool -v macos-bundle " target/release/ADB TOOL.app" target/
57./scripts/native_shell/patch_executable.sh
6- sed -i ' ' ' 20s /true/false/' ./lib/main.dart
8+ sed -i ' ' $line ' s /true/false/' ./lib/main.dart
You can’t perform that action at this time.
0 commit comments