Skip to content

Commit

Permalink
Upgrade to 1.5.4, fix some bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mengyanshou committed Jan 31, 2024
1 parent ef46742 commit 8ee56e4
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 145 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 1.5.4
- 优化多个UI界面对夜间模式的适配:历史记录、终端界面
- 修复桌面端切换主题灰屏的问题

## 1.5.3
- 修复启动卡死、崩溃等问题
Expand Down
4 changes: 4 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<uses-feature
android:name="android.hardware.usb.host"
android:required="true" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />

<application
android:name="${applicationName}"
android:extractNativeLibs="true"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package com.nightmare.adbtools;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.WindowManager;

import androidx.annotation.NonNull;

import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugin.common.MethodChannel;
Expand Down Expand Up @@ -44,6 +47,12 @@ protected void onCreate(Bundle savedInstanceState) {
lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
getWindow().setAttributes(lp);
}
Intent serviceIntent = new Intent();
serviceIntent.setComponent(new ComponentName("com.nightmare.sharespace", "com.nightmare.sharespace.YourService"));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
startForegroundService(serviceIntent);
else
startService(serviceIntent);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion lib/adbkit_entrypoint.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ADBToolEntryPoint extends StatefulWidget {

class _ADBToolEntryPointState extends State<ADBToolEntryPoint> with WindowListener {
ConfigController configController = Get.put(ConfigController());
TabController controller = Get.put(TabController());
TabController controller = Get.put(TabController(), permanent: true);
@override
void onWindowFocus() {
// Make sure to call once.
Expand Down
5 changes: 3 additions & 2 deletions lib/app/modules/developer_tool/dialog/install_apk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import 'package:path/path.dart' as p;
class InstallApkDialog extends StatefulWidget {
const InstallApkDialog({
Key? key,
this.paths, required this.entity,
this.paths,
required this.entity,
}) : super(key: key);

/// 路径列表
Expand Down Expand Up @@ -53,7 +54,7 @@ class _InstallApkDialogState extends State<InstallApkDialog> {
currentFile = name;
setState(() {});
try {
await execCmd('$adb -s ${widget.entity.serial} install -t $path');
await execCmd('$adb -s ${widget.entity.serial} install -t "$path"');
} on Exception catch (e) {
stringBuffer.write('$name: $e\n');
}
Expand Down
2 changes: 1 addition & 1 deletion lib/app/routes/ripple_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class RippleRoute extends PageRouteBuilder<void> {
// easeInBack
// easeInOutCubicEmphasized配合长时间的Duration
Animation curve = CurvedAnimation(curve: Curves.easeInBack, parent: animation);
print('curve.value:${curve.value}');
// print('curve.value:${curve.value}');
return Stack(
alignment: Alignment.center,
children: <Widget>[
Expand Down
14 changes: 14 additions & 0 deletions lib/global/instance/global.dart
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,12 @@ class Global {
Log.i('当前系统主题 ${window.platformBrightness}');
Log.i('当前布局风格 ${controller.screenType}');
Log.i('当前App内部主题 ${controller.theme!.brightness}');
Log.i('physicalSize:${window.physicalSize}');
Log.i('devicePixelRatio:${window.devicePixelRatio}');
Log.i('Android DPI:${window.devicePixelRatio * 160}');
// Log.i('当前设备Root状态 ${await YanProcess().isRoot()}');
Log.i('是否自动连接局域网设备 ${controller.autoConnect}');
WidgetsBinding.instance!.addObserver(Listener());
isInit = true;
if (controller.autoConnect) {
try {
Expand Down Expand Up @@ -349,3 +353,13 @@ String twoDigits(int n) {
if (n >= 10) return "$n";
return "0$n";
}

class Listener with WidgetsBindingObserver {
@override
void didChangeMetrics() {
Log.v('didChangeMetrics invokded');
Log.i('physicalSize:${window.physicalSize}');
Log.i('devicePixelRatio:${window.devicePixelRatio}');
Log.i('Android DPI:${window.devicePixelRatio * 160}');
}
}
2 changes: 1 addition & 1 deletion macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7

COCOAPODS: 1.13.0
COCOAPODS: 1.12.0
Loading

0 comments on commit 8ee56e4

Please sign in to comment.