Build native Flutter Linux manager and deb release 0.2.5
This commit is contained in:
1 parent
3c6c4a0e90
commit
03e729a60b
35 files changed
+757
-69
No files matched your search
@@ -7,6 +7,7 @@ import 'package:path/path.dart' as p;
|
||||
import 'windows_usb.dart';
|
||||
import 'usb_recovery.dart';
|
||||
import 'tool_paths.dart';
|
||||
import 'app_paths.dart';
|
||||
|
||||
class Settings {
|
||||
String server = 'wss://ttstd.com/ads';
|
||||
@@ -100,13 +101,7 @@ class ManagerRepository {
|
||||
ManagerRepository(this.log, {this.paths});
|
||||
|
||||
Future<void> init() async {
|
||||
storage = Directory(
|
||||
p.join(
|
||||
Platform.environment['LOCALAPPDATA'] ?? Directory.systemTemp.path,
|
||||
'TTSTD',
|
||||
'ADS-Flutter',
|
||||
),
|
||||
);
|
||||
storage = Directory(AppPaths.configuration());
|
||||
await storage.create(recursive: true);
|
||||
for (final start in [
|
||||
Directory.current.path,
|
||||
@@ -140,6 +135,7 @@ class ManagerRepository {
|
||||
jsonDecode(await saved.readAsString()) as Map<String, dynamic>,
|
||||
);
|
||||
}
|
||||
if (!Platform.isWindows) settings.usbMode = false;
|
||||
await repairToolPaths();
|
||||
token = Platform.environment['ADS_CLIENT_TOKEN'] ?? '';
|
||||
if (token.isEmpty && await File(settings.credential).exists()) {
|
||||
@@ -354,6 +350,9 @@ class ManagerRepository {
|
||||
configured: settings.adb,
|
||||
required: true,
|
||||
);
|
||||
if (settings.usbMode && !Platform.isWindows) {
|
||||
throw UnsupportedError("Linux 桌面端请使用网络 ADB;USB 模拟可使用 ads-usb CLI。");
|
||||
}
|
||||
final usbMode = settings.usbMode;
|
||||
final usbip = settings.usbip;
|
||||
if (usbMode) {
|
||||
@@ -626,6 +625,7 @@ class ManagerRepository {
|
||||
}
|
||||
|
||||
Future<void> screen(Session s, {bool embedded = false}) async {
|
||||
embedded = embedded && Platform.isWindows;
|
||||
if (s.stopping) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user