mirror of
https://github.com/Cateners/tiny_computer.git
synced 2026-05-20 08:35:46 +08:00
Fix keyboard plug in, streaming don't close
This commit is contained in:
@@ -23,6 +23,7 @@ assets的文件来源如下:
|
||||
|
||||
- [proot](https://github.com/Cateners/proot), 使用[build-proot-android](https://github.com/green-green-avk/build-proot-android)脚本编译
|
||||
- [busybox](https://github.com/meefik/busybox)
|
||||
- [mediamtx相关](https://github.com/bluenviron/mediamtx)
|
||||
- [tar](https://github.com/Rprop/tar-android-static)
|
||||
- [Xserver XSDL, pulseaudio相关文件](https://github.com/pelya/commandergenius/tree/sdl_android/project/jni/application/xserver)
|
||||
- [Tmoe Linux, debian包来源](https://github.com/2moe/tmoe)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:configChanges="navigation|orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||
|
||||
@@ -25,6 +25,7 @@ import 'dart:math';
|
||||
|
||||
import 'package:clipboard/clipboard.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_pty/flutter_pty.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
//import 'package:flutter/services.dart';
|
||||
@@ -677,6 +678,7 @@ SOFTWARE.
|
||||
启用小键盘: 观看3个广告
|
||||
关闭横幅广告: 观看5个广告
|
||||
终端最大行数修改: 观看6个广告
|
||||
推流参数修改: 观看8个广告
|
||||
|
||||
我设置了每天最多可以看5个广告。
|
||||
只要看满1个广告, 就可以在本次使用期间临时解锁全部功能。
|
||||
@@ -1179,7 +1181,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
switch (value) {
|
||||
case true: {
|
||||
G.streamServerPty = Pty.start("/system/bin/sh");
|
||||
G.streamServerPty.write(const Utf8Encoder().convert("${G.dataPath}/bin/mediamtx ${G.dataPath}/bin/mediamtx.yml &\n"));
|
||||
G.streamServerPty.write(const Utf8Encoder().convert("${G.dataPath}/bin/mediamtx ${G.dataPath}/bin/mediamtx.yml & pid=\$(echo \$!)\n"));
|
||||
G.streamServerPty.exitCode.then((value) {
|
||||
G.isStreamServerStarted = false;
|
||||
setState(() {});
|
||||
@@ -1187,12 +1189,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
}
|
||||
break;
|
||||
case false: {
|
||||
G.streamServerPty.write(const Utf8Encoder().convert("""
|
||||
pids=${G.dataPath}/busybox pgrep '${G.dataPath}/bin/mediamtx';
|
||||
for pid in \$pids; do
|
||||
kill \$pid
|
||||
done
|
||||
exit\n"""));
|
||||
G.streamServerPty.write(const Utf8Encoder().convert("kill \$pid\nexit\n"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -587,6 +587,9 @@ done
|
||||
G.controller = WebViewController()..setJavaScriptMode(JavaScriptMode.unrestricted);
|
||||
|
||||
//恢复临时开启的功能
|
||||
if (Util.shouldWatchAds(G.adsRequired["changeFFmpegCommand"]!)) {
|
||||
await G.prefs.remove("defaultFFmpegCommand");
|
||||
}
|
||||
if (Util.shouldWatchAds(G.adsRequired["changeTermMaxLines"]!)) {
|
||||
await G.prefs.setInt("termMaxLines", 4095);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user