Compare commits

..

15 Commits

Author SHA1 Message Date
Caten
b3428555c6 box and wine initial support 2023-11-30 15:57:56 +08:00
Caten
2a19c5eb78 Audio fix, more install scripts 2023-11-25 08:20:12 +08:00
Caten
54a941da63 update readme 2023-11-11 21:28:48 +08:00
Caten
87beedef68 adjust readme 2023-11-11 18:05:11 +08:00
Caten
c6afc4d468 virgl support 2023-11-11 11:23:16 +08:00
Caten
6dbe710fdc getifaddrs fix 2023-11-10 21:29:07 +08:00
Caten
cf8ce47662 Organize the code 2023-11-09 12:48:55 +08:00
Caten
86ce2315d4 Add signal 9 info, adjust readme 2023-11-07 17:29:49 +08:00
Caten
6e51e5b2d2 fix tab key eaten 2023-10-19 23:45:33 +08:00
Caten
0971059111 backup 2023-10-10 18:16:56 +08:00
Caten
2cf19179f9 Fix keyboard plug in, streaming don't close 2023-10-09 06:47:57 +08:00
Caten
b6d4d2f11b Adjust ads watch settings, add saf documents provider, camera stream, more permission 2023-10-08 16:40:51 +08:00
Caten
5a6f04d094 Update help message 2023-10-03 21:50:59 +08:00
Caten
195a2f50a3 Fix boot options 2023-10-03 20:51:29 +08:00
Caten
16a14c8a3e Adjust help message 2023-10-03 13:15:11 +08:00
23 changed files with 2343 additions and 625 deletions

View File

@@ -2,54 +2,70 @@
<img decoding="async" src="readme/cover0.png" width="50%"> <img decoding="async" src="readme/cover0.png" width="50%">
即开即用的类PC环境内置火狐浏览器和fcitx输入法等常用软件 给所有安卓arm64设备的“PC应用引擎”平替
Click-to-run debian bookworm xfce on android for Chinese users, with fcitx pinyin input method preinstalled. No termux required. Click-to-run debian bookworm xfce on android for Chinese users, with fcitx pinyin input method preinstalled. No termux required.
## 特点
- 一键安装,即开即用
- 来自kali-undercover的win10主题(仅xfce版本),友好的界面
<img decoding="async" src="readme/img1.png" width="50%">
- 提供常用软件的一键安装指令
<img decoding="async" src="readme/img2.png" width="50%">
- 可方便地改变屏幕缩放,不用担心屏幕过大或过小
<img decoding="async" src="readme/img3.gif" width="50%">
- 便捷访问设备文件或通过设备SAF访问软件文件
<img decoding="async" src="readme/img4.png" width="50%">
- 提供终端和众多可调节参数供高级用户使用
<img decoding="async" src="readme/img5.png" width="50%">
## 原理 ## 原理
使用proot运行debian环境 使用proot运行debian环境
内置[noVNC](https://github.com/novnc/noVNC)显示图形界面 内置[noVNC](https://github.com/novnc/noVNC)显示图形界面
初次启动由于解压的缘故要点时间
以后点开就能用
只支持arm64安卓
## 项目结构 ## 项目结构
assets的文件来源如下: assets的文件来源信息可以在[这里](extra/readme.md)找到。
- [proot](https://github.com/Cateners/proot), 使用[build-proot-android](https://github.com/green-green-avk/build-proot-android)脚本编译 完整的容器制作过程可以在[这里](extra/build-tiny-rootfs.md)看到。
- [busybox](https://github.com/meefik/busybox)
- [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)
其中tar、busybox和pulseaudio相关文件都是直接用了二进制文件。
对debian容器进行了如下修改
- 使用tmoe安装了xfce环境和全套VNC
- 使用kali-undercover提供的Win10主题美化xfce
- (使用tmoe)安装了fcitx输入法和云拼音组件。按<Ctrl+空格>切换输入法。
- 强烈建议**不要**使用安卓中文输入法直接输入中文,而是使用英文键盘通过容器的输入法输入中文,避免丢字错字。
- 对noVNC进行[修改](https://github.com/Cateners/noVNC)添加了scale factor滑块控制缩放(scale_factor分支)添加了上下左右shift等按键(arrow_key分支)
- 在主目录下可以方便地访问手机存储(如果提供了存储权限的话)
- 启动时会尝试挂载手机的一些字体目录(AppFiles/Fonts、Fonts和/system/fonts), 如果这些目录下有字体文件的话会一并加载到系统中,无需额外安装
- 最后采用tar.xz压缩用split命令分成了xa*等多个文件
数据包不再在assets中更新而是随releases提供主要是为了避免git越来越大 数据包不再在assets中更新而是随releases提供主要是为了避免git越来越大
lib目录 lib目录
- main.dart文件页面布局老实说已经有点乱 - main.dart文件页面布局有点乱
- workflow.dart文件逻辑部分目前也还可以理解 - workflow.dart文件逻辑部分目前也还可以理解
- Util 工具类 - Util 工具类
- TermPty 一个终端 - TermPty 一个终端
- G 全局变量类 - G 全局变量类
- Workflow 从软件点开到容器启动的所有步骤 - Workflow 从软件点开到容器启动的所有步骤
## 编译
你需要配置好flutter和安卓sdk然后克隆此项目。
在编译之前需要在release中下载系统rootfs(或者[自行制作](extra/build-tiny-rootfs.md))之后使用split命令分割拷贝到assets。一般我将其分为98MB。
`split -b 98M debian.tar.xz`
然后修改workflow的代码找到复制资源的部分把生成的xa\*名字写进去(我还不知道怎么写代码识别有多少个xa*文件)
接下来就可以编译了。我使用的命令如下:
`flutter build apk --target-platform android-arm64 --split-per-abi --obfuscate --split-debug-info=tiny_computer/sdi`
## 目前已知bug ## 目前已知bug
多用户/分身情形无法sudo, 其它见issue 多用户/分身情形无法sudo, 其它见issue

View File

@@ -38,6 +38,7 @@ android {
sourceSets { sourceSets {
main.java.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/kotlin'
main.java.srcDirs += 'src/main/java'
} }
defaultConfig { defaultConfig {
@@ -45,7 +46,7 @@ android {
applicationId "com.fct.tiny" applicationId "com.fct.tiny"
// You can update the following values to match your application needs. // You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion minSdkVersion 24 //ffmpeg_kit; flutter.minSdkVersion
targetSdkVersion 28 //https://github.com/termux/termux-app/issues/1072; native; linker; flutter.targetSdkVersion targetSdkVersion 28 //https://github.com/termux/termux-app/issues/1072; native; linker; flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName

View File

@@ -2,6 +2,9 @@
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application <application
android:label="小小电脑" android:label="小小电脑"
android:name="${applicationName}" android:name="${applicationName}"
@@ -12,7 +15,7 @@
android:exported="true" android:exported="true"
android:launchMode="singleTop" android:launchMode="singleTop"
android:theme="@style/LaunchTheme" 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:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"> android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as <!-- Specifies an Android theme to apply to this Activity as soon as
@@ -28,6 +31,16 @@
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
</activity> </activity>
<provider
android:name="com.example.tiny_computer.filepicker.TinyDocumentsProvider"
android:authorities="com.example.tiny_computer.documents"
android:exported="true"
android:grantUriPermissions="true"
android:permission="android.permission.MANAGE_DOCUMENTS">
<intent-filter>
<action android:name="android.content.action.DOCUMENTS_PROVIDER" />
</intent-filter>
</provider>
<!-- Don't delete the meta-data below. <!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data <meta-data

View File

@@ -0,0 +1,270 @@
package com.example.tiny_computer.filepicker;
import android.annotation.TargetApi;
import android.content.res.AssetFileDescriptor;
import android.database.Cursor;
import android.database.MatrixCursor;
import android.graphics.Point;
import android.os.Build;
import android.os.CancellationSignal;
import android.os.ParcelFileDescriptor;
import android.provider.DocumentsContract.Document;
import android.provider.DocumentsContract.Root;
import android.provider.DocumentsProvider;
import android.webkit.MimeTypeMap;
import com.example.tiny_computer.R;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Collections;
import java.util.LinkedList;
//This file is mainly copied from Termux :P
/**
* A document provider for the Storage Access Framework which exposes the files in the
* $HOME/ directory to other apps.
* <p/>
* Note that this replaces providing an activity matching the ACTION_GET_CONTENT intent:
* <p/>
* "A document provider and ACTION_GET_CONTENT should be considered mutually exclusive. If you
* support both of them simultaneously, your app will appear twice in the system picker UI,
* offering two different ways of accessing your stored data. This would be confusing for users."
* - http://developer.android.com/guide/topics/providers/document-provider.html#43
*/
public class TinyDocumentsProvider extends DocumentsProvider {
private static final String ALL_MIME_TYPES = "*/*";
// The default columns to return information about a root if no specific
// columns are requested in a query.
private static final String[] DEFAULT_ROOT_PROJECTION = new String[]{
Root.COLUMN_ROOT_ID,
Root.COLUMN_MIME_TYPES,
Root.COLUMN_FLAGS,
Root.COLUMN_ICON,
Root.COLUMN_TITLE,
Root.COLUMN_SUMMARY,
Root.COLUMN_DOCUMENT_ID,
Root.COLUMN_AVAILABLE_BYTES
};
// The default columns to return information about a document if no specific
// columns are requested in a query.
private static final String[] DEFAULT_DOCUMENT_PROJECTION = new String[]{
Document.COLUMN_DOCUMENT_ID,
Document.COLUMN_MIME_TYPE,
Document.COLUMN_DISPLAY_NAME,
Document.COLUMN_LAST_MODIFIED,
Document.COLUMN_FLAGS,
Document.COLUMN_SIZE
};
@Override
public Cursor queryRoots(String[] projection) {
final MatrixCursor result = new MatrixCursor(projection != null ? projection : DEFAULT_ROOT_PROJECTION);
final String applicationName = "小小电脑";
final File BASE_DIR = new File(getContext().getFilesDir(), "containers");
final MatrixCursor.RowBuilder row = result.newRow();
row.add(Root.COLUMN_ROOT_ID, getDocIdForFile(BASE_DIR));
row.add(Root.COLUMN_DOCUMENT_ID, getDocIdForFile(BASE_DIR));
row.add(Root.COLUMN_SUMMARY, null);
row.add(Root.COLUMN_FLAGS, Root.FLAG_SUPPORTS_CREATE | Root.FLAG_SUPPORTS_SEARCH | Root.FLAG_SUPPORTS_IS_CHILD);
row.add(Root.COLUMN_TITLE, applicationName);
row.add(Root.COLUMN_MIME_TYPES, ALL_MIME_TYPES);
row.add(Root.COLUMN_AVAILABLE_BYTES, BASE_DIR.getFreeSpace());
row.add(Root.COLUMN_ICON, R.mipmap.ic_launcher);
return result;
}
@Override
public Cursor queryDocument(String documentId, String[] projection) throws FileNotFoundException {
final MatrixCursor result = new MatrixCursor(projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION);
includeFile(result, documentId, null);
return result;
}
@Override
public Cursor queryChildDocuments(String parentDocumentId, String[] projection, String sortOrder) throws FileNotFoundException {
final MatrixCursor result = new MatrixCursor(projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION);
final File parent = getFileForDocId(parentDocumentId);
for (File file : parent.listFiles()) {
includeFile(result, null, file);
}
return result;
}
@Override
public ParcelFileDescriptor openDocument(final String documentId, String mode, CancellationSignal signal) throws FileNotFoundException {
final File file = getFileForDocId(documentId);
final int accessMode = ParcelFileDescriptor.parseMode(mode);
return ParcelFileDescriptor.open(file, accessMode);
}
@Override
public AssetFileDescriptor openDocumentThumbnail(String documentId, Point sizeHint, CancellationSignal signal) throws FileNotFoundException {
final File file = getFileForDocId(documentId);
final ParcelFileDescriptor pfd = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
return new AssetFileDescriptor(pfd, 0, file.length());
}
@Override
public boolean onCreate() {
return true;
}
@Override
public String createDocument(String parentDocumentId, String mimeType, String displayName) throws FileNotFoundException {
File newFile = new File(parentDocumentId, displayName);
int noConflictId = 2;
while (newFile.exists()) {
newFile = new File(parentDocumentId, displayName + " (" + noConflictId++ + ")");
}
try {
boolean succeeded;
if (Document.MIME_TYPE_DIR.equals(mimeType)) {
succeeded = newFile.mkdir();
} else {
succeeded = newFile.createNewFile();
}
if (!succeeded) {
throw new FileNotFoundException("Failed to create document with id " + newFile.getPath());
}
} catch (IOException e) {
throw new FileNotFoundException("Failed to create document with id " + newFile.getPath());
}
return newFile.getPath();
}
@Override
public void deleteDocument(String documentId) throws FileNotFoundException {
File file = getFileForDocId(documentId);
if (!file.delete()) {
throw new FileNotFoundException("Failed to delete document with id " + documentId);
}
}
@Override
public String getDocumentType(String documentId) throws FileNotFoundException {
File file = getFileForDocId(documentId);
return getMimeType(file);
}
@Override
public Cursor querySearchDocuments(String rootId, String query, String[] projection) throws FileNotFoundException {
final MatrixCursor result = new MatrixCursor(projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION);
final File parent = getFileForDocId(rootId);
// This example implementation searches file names for the query and doesn't rank search
// results, so we can stop as soon as we find a sufficient number of matches. Other
// implementations might rank results and use other data about files, rather than the file
// name, to produce a match.
final LinkedList<File> pending = new LinkedList<>();
pending.add(parent);
final int MAX_SEARCH_RESULTS = 50;
while (!pending.isEmpty() && result.getCount() < MAX_SEARCH_RESULTS) {
final File file = pending.removeFirst();
// Avoid directories outside the $HOME directory linked with symlinks (to avoid e.g. search
// through the whole SD card).
boolean isInsideHome;
try {
isInsideHome = file.getCanonicalPath().startsWith(new File(getContext().getFilesDir(), "containers").getAbsolutePath());
} catch (IOException e) {
isInsideHome = true;
}
if (isInsideHome) {
if (file.isDirectory()) {
Collections.addAll(pending, file.listFiles());
} else {
if (file.getName().toLowerCase().contains(query)) {
includeFile(result, null, file);
}
}
}
}
return result;
}
@Override
public boolean isChildDocument(String parentDocumentId, String documentId) {
return documentId.startsWith(parentDocumentId);
}
/**
* Get the document id given a file. This document id must be consistent across time as other
* applications may save the ID and use it to reference documents later.
* <p/>
* The reverse of @{link #getFileForDocId}.
*/
private static String getDocIdForFile(File file) {
return file.getAbsolutePath();
}
/**
* Get the file given a document id (the reverse of {@link #getDocIdForFile(File)}).
*/
private static File getFileForDocId(String docId) throws FileNotFoundException {
final File f = new File(docId);
if (!f.exists()) throw new FileNotFoundException(f.getAbsolutePath() + " not found");
return f;
}
private static String getMimeType(File file) {
if (file.isDirectory()) {
return Document.MIME_TYPE_DIR;
} else {
final String name = file.getName();
final int lastDot = name.lastIndexOf('.');
if (lastDot >= 0) {
final String extension = name.substring(lastDot + 1).toLowerCase();
final String mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
if (mime != null) return mime;
}
return "application/octet-stream";
}
}
/**
* Add a representation of a file to a cursor.
*
* @param result the cursor to modify
* @param docId the document ID representing the desired file (may be null if given file)
* @param file the File object representing the desired file (may be null if given docID)
*/
private void includeFile(MatrixCursor result, String docId, File file)
throws FileNotFoundException {
if (docId == null) {
docId = getDocIdForFile(file);
} else {
file = getFileForDocId(docId);
}
int flags = 0;
if (file.isDirectory()) {
if (file.canWrite()) flags |= Document.FLAG_DIR_SUPPORTS_CREATE;
} else if (file.canWrite()) {
flags |= Document.FLAG_SUPPORTS_WRITE;
}
if (file.getParentFile().canWrite()) flags |= Document.FLAG_SUPPORTS_DELETE;
final String displayName = file.getName();
final String mimeType = getMimeType(file);
if (mimeType.startsWith("image/")) flags |= Document.FLAG_SUPPORTS_THUMBNAIL;
final MatrixCursor.RowBuilder row = result.newRow();
row.add(Document.COLUMN_DOCUMENT_ID, docId);
row.add(Document.COLUMN_DISPLAY_NAME, displayName);
row.add(Document.COLUMN_SIZE, file.length());
row.add(Document.COLUMN_MIME_TYPE, mimeType);
row.add(Document.COLUMN_LAST_MODIFIED, file.lastModified());
row.add(Document.COLUMN_FLAGS, flags);
row.add(Document.COLUMN_ICON, R.mipmap.ic_launcher);
}
}

Binary file not shown.

BIN
assets/patch.tar.gz Normal file

Binary file not shown.

196
extra/build-tiny-rootfs.md Normal file
View File

@@ -0,0 +1,196 @@
# build-tiny-rootfs
对小小电脑项目rootfs制作的说明
### 为什么不直接制作一个脚本呢?
因为我不会,所以只能用自然语言记录一下制作步骤。
## 制作步骤
### 安装Debian容器
- 安装Termux
- 在Termux内安装tmoe
- 在tmoe内安装Debian Bookworm的proot容器
- 是否新建sudo用户-是-用户名tiny-密码tiny
- 是否设置tiny为默认用户-是
- 是否为root配置zsh-否
- 是否删除zsh.sh等-是
- 是否启动tmoe tools-是
- 其余对话框默认直接按回车
- 来到tmoe tool界面时取消退出
### 安装其他软件
安装xfce部分是根据记忆写的如果有误请指出。
桌面环境只安装一个。
#### 安装桌面环境(lxqt)
- 输入debian-i进入tmoe tools
- 图形界面-rootless-lxqt-core
- 不安装electron apps
- 不安装chromium
- 按需调整
#### 安装桌面环境(xfce)
前面的部分和lxqt一致只是选桌面环境时选了xfce-lite。
下面是额外的美化部分。推荐先安装软件再做这个因为使用kali-undercover时可能有依赖报错但我忘记是哪些依赖了。但后面安装的某个软件会帮我们把依赖补上。
- xfce美化
- 前往kali源下载kali-undercover包并apt install安装
- 修改kali-undercover脚本中检测xfce环境的地方强制允许
- 即注释第一个if里的exit 1
- 执行kali-undercover
- 按需调整
- 注释.bashrc中把bash风格改为windows风格的语句
- 调整状态栏
- ......
#### 安装VNC
安装桌面环境后会自动进行这一步使用tmoe tools全部安装即可。
- 选择tigervnc
- 密码12345678
安装完成后输入debian-i回到tmoe继续修改一些参数主要目的是避免与termux的容器端口一致产生冲突
- 修改显示端口到5904
- 远程桌面-tigervnc-显示端口-4
- 修改novnc端口到36082
- 远程桌面-novnc-端口-36082
- 修改startnovnc启动脚本(避免每次启动novnc时打开浏览器虽然不是windows)
- 注释start_win10_edge_novnc_addr(大概在倒数第五行)
接下来对novnc应用补丁以添加"通过滑块修改分辨率"等功能
- [下载novnc.patch](https://github.com/Cateners/noVNC/releases/tag/1.2)
- 切换目录到/usr/local/etc/tmoe-linux/novnc
- `patch -p1 < novnc.patch`
- ```bash
find . '(' \
-name \*-baseline -o \
-name \*-merge -o \
-name \*-original -o \
-name \*.orig -o \
-name \*.rej \
')' -delete
```
#### 修复tmoe不能下载软件
在我发布的xfce版本中我给每个aria2c调用都添加了--async-dns=false参数。
先切换到tmoe目录`/usr/local/etc/tmoe-linux/git/share`,然后执行脚本`./replace.sh old-version`
```shell
#!/bin/bash
# 用法: ./replace.sh 目录
# 该脚本会递归地在给定目录下的所有文件中替换文本
# 原文本: aria2c --console-log-level
# 新文本: aria2c --async-dns=false --console-log-level
# 检查参数是否正确
if [ $# -ne 1 ]; then
echo "错误: 需要一个目录作为参数"
exit 1
fi
# 检查目录是否存在
if [ ! -d "$1" ]; then
echo "错误: 目录 $1 不存在"
exit 2
fi
# 遍历目录下的所有文件
find "$1" -type f | while read file; do
# 使用sed命令替换文本
sed -i 's/aria2c --console-log-level/aria2c --async-dns=false --console-log-level/g' "$file"
echo
done
```
用完后删除replace.sh
另外现在tmoe官方给出了[解决办法](https://gitee.com/mo2/linux/issues/I8BQG3),不过我测试似乎还是不行,所以就先这样了
#### 修改apt源
按需修改/etc/apt/sources.list另外把non-free改为non-free-firmware
#### 安装火狐浏览器
`sudo apt install firefox-esr firefox-esr-l10n-zh-cn`
#### 安装输入法
- debian-i
- 03秘密花园-10输入法-fcitx4-安装4libpinyin和6云拼音模块
- 在图形界面应用找到fcitx配置-附加组件-云拼音-配置-云拼音来源把Google改为百度确认
- 启动图形界面输入startnovnc会出现一个类似xxx.xxx.xxx.xxx:36082/vnc.html的网址复制到本机的浏览器中输入vnc密码12345678就可以访问了。
#### 安装gdebi
这个软件包能使用户通过图形界面安装deb安装包
安装:`sudo apt install gdebi`
修改启动器:在/usr/share/applications/gdebi.desktop的Exec=后加上sudo
#### 安装VSCode
VSCode使用tmoe安装正好测试一下不能下载软件的问题是否存在
- 2软件-2开发-1VSCode-1Official
tmoe还会安装gnome-keyring由于之前我做xfce包时会造成VSCode反复弹窗更新密钥环所以被我卸载了这个按需决定是否保留吧
#### 安装ffmpeg
这个是为了预览推流用的,按需安装
`sudo apt install ffmpeg`
### 其他修补
#### cmatrix
这个是给快捷指令的彩蛋。下载cmatrix的包并将cmatrix文件提取放到/home/tiny/.local/bin里即可记得添加执行权限
#### WPS
- 软件设置修改
- 从官网下载WPS linux arm64 deb安装包直接在图形界面点开用gdebi安装(正好测试一下gdebi是否能用)
- 打开WPS-右上角设置-其他-切换窗口管理模式-整合模式改为多组件模式(否则一些设备在新建文档等操作时卡死,目前原因不明)
- 使用gdebi(或自行)卸载WPS
- 字体修补
- 在你的Windows电脑里的C:\Windows\Fonts文件夹找到symbol.ttf、webdings.ttf、wingding.ttf、WINGDNG2.TTF、WINGDNG3.TTF、MTEXTRA.TTF字体并放到容器/usr/share/fonts的某个文件夹下(我新建了extra文件夹并把这些字体放到里面)
- libtiff.so.5库修补
- 切换到/lib/aarch64-linux-gnu文件夹创建软链把libtiff.so.6链接到libtiff.so.5
- 或者找libtiff.so.5的包并安装,这样可能更好一些
### 打包
- 首先退出容器在容器挂载选项里取消对sd和termux的挂载之后进入容器删除termux软连接
- 在后面使用tar打包时即使指定了excludetar也会尝试把它们打包进去
- 这个很可能因为我自己没用对参数,如果你非常自信的话就不需要这么做,自行打包即可=v=
- 在[这里](https://github.com/meefik/busybox/releases)下载提取busybox的可执行文件并放到系统根目录
- 我使用busybox的tar来打包而不是容器自带的tar原因是容器自带的tar会把硬链接打包成单独的文件导致打包解包后占用多出1GB
- 这个也很可能是我自己没用对参数,如果你非常自信就不用这么做......
- 尽可能多地删除使用痕迹,包括但不限于
- apt clean
- /tmp下的文件退出容器后删
- tiny和root目录下的
- .cache
- .vnc/vnc.log, .vnc/x.log
- .bash_history
- .ICEauthority
- .Xauthority
- 等等
- 切换到root用户切换到根目录`/busybox tar -Jcpvf /debian.tar.xz --exclude=debian.tar.xz --exclude=dev --exclude=proc --exclude=system --exclude=storage --exclude=apex --exclude=sys --exclude=media/sd --exclude=busybox --exclude=".l2s.*" /`

56
extra/cross/install-box Normal file
View File

@@ -0,0 +1,56 @@
#!/bin/bash
sudo dpkg --add-architecture armhf
sudo apt update
sudo apt upgrade -y
sudo apt install -y cmake gcc-arm-linux-gnueabihf libc6:armhf
sudo apt reinstall -y libc6-dev
mkdir $HOME/.local/share/tiny/cross
rm -rf $HOME/.local/share/tiny/tmp
mkdir $HOME/.local/share/tiny/tmp
cd $HOME/.local/share/tiny/tmp
git clone https://mirror.ghproxy.com/https://github.com/ptitSeb/box86
if [ $? -ne 0 ]; then
git clone https://github.com/ptitSeb/box86
if [ $? -ne 0 ]; then
rm -rf $HOME/.local/share/tiny/tmp
echo '仓库克隆失败...退出安装...'
exit
fi
fi
git clone https://mirror.ghproxy.com/https://github.com/ptitSeb/box64
if [ $? -ne 0 ]; then
git clone https://github.com/ptitSeb/box64
if [ $? -ne 0 ]; then
rm -rf $HOME/.local/share/tiny/tmp
echo '仓库克隆失败...退出安装...'
exit
fi
fi
cd box86
mkdir build
cd build
cmake .. -DARM64=1 -DBAD_SIGNAL=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j
cd ../..
mv box86/build/box86 ../cross
mv box86/x86lib ../cross
cd box64
mkdir build
cd build
cmake .. -DARM64=1 -DBAD_SIGNAL=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j
cd ../..
mv box64/build/box64 ../cross
mv box64/x64lib ../cross
cd ..
rm -rf tmp
echo '安装完成'

79
extra/cross/install-wine Normal file
View File

@@ -0,0 +1,79 @@
#!/bin/bash
sudo apt update
sudo apt upgrade -y
sudo apt install -y nano cabextract libfreetype6 libfreetype6:armhf libfontconfig libfontconfig:armhf libxext6 libxext6:armhf libxinerama-dev libxinerama-dev:armhf libxxf86vm1 libxxf86vm1:armhf libxrender1 libxrender1:armhf libxcomposite1 libxcomposite1:armhf libxrandr2 libxrandr2:armhf libxi6 libxi6:armhf libxcursor1 libxcursor1:armhf libvulkan-dev libvulkan-dev:armhf zenity
rm -rf $HOME/.local/share/tiny/tmp
mkdir $HOME/.local/share/tiny/tmp
cd $HOME/.local/share/tiny/tmp
MIRROR_SITE=https://mirror.ghproxy.com
LATEST_WINE_NAME=$(curl -L https://github.com/Kron4ek/Wine-Builds/releases | grep "amd64\.tar\.xz" | grep "proton" | head -n 1 | awk '{print $NF}')
LATEST_WINE_TAG=$(echo $LATEST_WINE_NAME | cut -d "-" -f 2)
if [ $LATEST_WINE_TAG == proton ]; then
LATEST_WINE_TAG=proton-$(echo $LATEST_WINE_NAME | cut -d "-" -f 3)-$(echo $LATEST_WINE_NAME | cut -d "-" -f 4)
fi
LATEST_WINE_LINK=https://github.com/Kron4ek/Wine-Builds/releases/download/$LATEST_WINE_TAG/$LATEST_WINE_NAME
wget $MIRROR_SITE/$LATEST_WINE_LINK
if [ $? -ne 0 ]; then
wget $LATEST_WINE_LINK
if [ $? -ne 0 ]; then
rm -rf $HOME/.local/share/tiny/tmp
echo '下载失败...退出安装...'
exit
fi
fi
wget $MIRROR_SITE/https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
if [ $? -ne 0 ]; then
wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
if [ $? -ne 0 ]; then
rm -rf $HOME/.local/share/tiny/tmp
echo '下载失败...退出安装...'
exit
fi
fi
tar xvf $LATEST_WINE_NAME
mv wine-$LATEST_WINE_TAG-amd64 ../cross/wine
mv winetricks ../cross/winetricks-executable
chmod +x $HOME/.local/share/tiny/cross/winetricks-executable
cd ..
rm -rf tmp
echo '#!/bin/bash
export WINEPREFIX=~/.wine
box86 '"$HOME/.local/share/tiny/cross/wine/bin/wine "'"$@"' > $HOME/.local/share/tiny/cross/wine-executable
chmod +x $HOME/.local/share/tiny/cross/wine-executable
echo '#!/bin/bash
export WINEPREFIX=~/.wine
box64 '"$HOME/.local/share/tiny/cross/wine/bin/wine64 "'"$@"' > $HOME/.local/share/tiny/cross/wine64-executable
chmod +x $HOME/.local/share/tiny/cross/wine64-executable
echo '#!/bin/bash
export BOX64_NOBANNER=1 WINE=wine64 WINEPREFIX=~/.wine WINESERVER=~/.local/share/tiny/cross/wine/bin/wineserver
wine64 '"$HOME/.local/share/tiny/cross/winetricks-executable "'"$@"' > $HOME/.local/share/tiny/cross/winetricks64-executable
chmod +x $HOME/.local/share/tiny/cross/winetricks64-executable
echo '[Desktop Entry]
Name=Wine64 启动器
Exec=wine64 start /unix %F
Icon=wine
Type=Application' > $HOME/.local/share/tiny/cross/wine64.desktop
chmod +x $HOME/.local/share/tiny/cross/wine64.desktop
echo '[Desktop Entry]
Name=Wine64 winetricks 实用工具
Exec=winetricks64
Icon=wine
Type=Application' > $HOME/.local/share/tiny/cross/winetricks64.desktop
chmod +x $HOME/.local/share/tiny/cross/winetricks64.desktop
echo '安装完成在启用wine后可以点击exe文件选择用wine启动。'
echo '程序的运行可能依赖一些配置或组件。比如一些使用directx的游戏可能需要安装dxvk。'
echo '如果缺失可以尝试使用winetricks安装。请务必保持耐心。'

View File

@@ -0,0 +1,243 @@
// getifaddrs_bridge_client_lib.c -- This file is part of tiny_computer.
// Copyright (C) 2023 Caten Hu
// Tiny Computer is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published
// by the Free Software Foundation, either version 3 of the License,
// or any later version.
// Tiny Computer is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
/* this file is mainly generated by Bing */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <ifaddrs.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <sys/un.h>
#define BUFSIZE 1024 // 定义缓冲区大小
// 定义一个反序列化函数将字节数组转换为ifaddrs结构体
int TINY_deserialize_ifaddrs(char *buf, int size, struct ifaddrs **ifap) {
int len = 0; // 记录已经读取的字节数
struct ifaddrs *head = NULL; // 链表头指针
struct ifaddrs *tail = NULL; // 链表尾指针
while (len < size) {
// 为当前接口分配内存
struct ifaddrs *ifa = (struct ifaddrs *)malloc(sizeof(struct ifaddrs));
if (ifa == NULL) {
// 分配失败,释放已分配的内存
freeifaddrs(head);
return -1; // 返回错误
}
// 读取接口名称
int namelen = strlen(buf + len) + 1; // 包括结束符
if (len + namelen > size) break; // 缓冲区不足
ifa->ifa_name = (char *)malloc(namelen); // 为名称分配内存
if (ifa->ifa_name == NULL) {
// 分配失败,释放已分配的内存
free(ifa);
freeifaddrs(head);
return -1; // 返回错误
}
memcpy(ifa->ifa_name, buf + len, namelen); // 复制名称
len += namelen;
// 读取接口标志
if (len + sizeof(unsigned int) > size) break; // 缓冲区不足
memcpy(&ifa->ifa_flags, buf + len, sizeof(unsigned int)); // 复制标志
len += sizeof(unsigned int);
// 读取接口地址
if (buf[len] != '\0') {
// 如果有地址
int addrlen = sizeof(struct sockaddr); // 地址结构体长度
if (len + addrlen > size) break; // 缓冲区不足
ifa->ifa_addr = (struct sockaddr *)malloc(addrlen); // 为地址分配内存
if (ifa->ifa_addr == NULL) {
// 分配失败,释放已分配的内存
free(ifa->ifa_name);
free(ifa);
freeifaddrs(head);
return -1; // 返回错误
}
memcpy(ifa->ifa_addr, buf + len, addrlen); // 复制地址
len += addrlen;
} else {
// 如果没有地址,跳过一个空字节
ifa->ifa_addr = NULL;
len += 1;
}
// 读取接口掩码
if (buf[len] != '\0') {
// 如果有掩码
int masklen = sizeof(struct sockaddr); // 掩码结构体长度
if (len + masklen > size) break; // 缓冲区不足
ifa->ifa_netmask = (struct sockaddr *)malloc(masklen); // 为掩码分配内存
if (ifa->ifa_netmask == NULL) {
// 分配失败,释放已分配的内存
free(ifa->ifa_addr);
free(ifa->ifa_name);
free(ifa);
freeifaddrs(head);
return -1; // 返回错误
}
memcpy(ifa->ifa_netmask, buf + len, masklen); // 复制
len += masklen;
} else {
// 如果没有掩码,跳过一个空字节
ifa->ifa_netmask = NULL;
len += 1;
}
// 读取接口广播地址或点对点地址
if (ifa->ifa_flags & IFF_BROADCAST) {
// 如果有广播地址
if (buf[len] != '\0') {
// 如果有广播地址
int broadlen = sizeof(struct sockaddr); // 广播地址结构体长度
if (len + broadlen > size) break; // 缓冲区不足
ifa->ifa_broadaddr = (struct sockaddr *)malloc(broadlen); // 为广播地址分配内存
if (ifa->ifa_broadaddr == NULL) {
// 分配失败,释放已分配的内存
free(ifa->ifa_netmask);
free(ifa->ifa_addr);
free(ifa->ifa_name);
free(ifa);
freeifaddrs(head);
return -1; // 返回错误
}
memcpy(ifa->ifa_broadaddr, buf + len, broadlen); // 复制广播地址
len += broadlen;
} else {
// 如果没有广播地址,跳过一个空字节
ifa->ifa_broadaddr = NULL;
len += 1;
}
} else if (ifa->ifa_flags & IFF_POINTOPOINT) {
// 如果有点对点地址
if (buf[len] != '\0') {
// 如果有点对点地址
int dstlen = sizeof(struct sockaddr); // 点对点地址结构体长度
if (len + dstlen > size) break; // 缓冲区不足
ifa->ifa_dstaddr = (struct sockaddr *)malloc(dstlen); // 为点对点地址分配内存
if (ifa->ifa_dstaddr == NULL) {
// 分配失败,释放已分配的内存
free(ifa->ifa_netmask);
free(ifa->ifa_addr);
free(ifa->ifa_name);
free(ifa);
freeifaddrs(head);
return -1; // 返回错误
}
memcpy(ifa->ifa_dstaddr, buf + len, dstlen); // 复制点对点地址
len += dstlen;
} else {
// 如果没有点对点地址,跳过一个空字节
ifa->ifa_dstaddr = NULL;
len += 1;
}
} else {
// 如果没有广播地址或点对点地址,跳过两个空字节
ifa->ifa_broadaddr = NULL;
ifa->ifa_dstaddr = NULL;
len += 2;
}
// 读取接口数据
if (buf[len] != '\0') {
// 如果有数据
// TODO: 根据不同的地址族,读取不同的数据
// 这里暂时省略,只跳过一个空字节
ifa->ifa_data = NULL;
len += 1;
} else {
// 如果没有数据,跳过一个空字节
ifa->ifa_data = NULL;
len += 1;
}
// 将当前接口插入链表
ifa->ifa_next = NULL;
if (head == NULL) {
// 如果是第一个接口,设置头指针
head = ifa;
} else {
// 如果不是第一个接口,设置尾指针的下一个指针
tail->ifa_next = ifa;
}
// 更新尾指针
tail = ifa;
}
*ifap = head; // 返回链表头指针
return len; // 返回读取的总字节数
}
// 定义一个发送信号的函数,向服务器发送一个信号
int TINY_send_signal(int sockfd) {
char sig = 'S'; // 定义信号为一个字符S
int n = write(sockfd, &sig, 1); // 向套接字写入一个字节
if (n < 0) {
perror("write");
return -1; // 返回错误
}
return 0; // 返回成功
}
// 定义一个接收数据的函数,从服务器接收数据并反序列化
int TINY_receive_data(int sockfd, struct ifaddrs **ifap) {
char buf[BUFSIZE]; // 定义缓冲区
int n = read(sockfd, buf, BUFSIZE); // 从套接字读取数据
if (n < 0) {
perror("read");
return -1; // 返回错误
}
int len = TINY_deserialize_ifaddrs(buf, n, ifap); // 反序列化数据
if (len < 0) {
fprintf(stderr, "deserialize_ifaddrs failed\n");
return -1; // 返回错误
}
return 0; // 返回成功
}
// 主函数
int getifaddrs(struct ifaddrs **ifap) {
// 创建一个套接字
int sockfd = socket(PF_UNIX, SOCK_STREAM, 0);
if (sockfd < 0) {
perror("socket");
exit(1);
}
// 定义服务器地址结构体
struct sockaddr_un un;
memset(&un, 0, sizeof(un));
un.sun_family = AF_UNIX;
snprintf(un.sun_path, sizeof(un.sun_path), "%s", "/tmp/.getifaddrs-bridge");
// 连接到服务器
if (connect(sockfd, (struct sockaddr *)&un, sizeof(un)) < 0) {
perror("connect");
exit(1);
}
// 发送信号给服务器
if (TINY_send_signal(sockfd) < 0) {
fprintf(stderr, "send_signal failed\n");
exit(1);
}
// 接收数据并反序列化
if (TINY_receive_data(sockfd, ifap) < 0) {
fprintf(stderr, "receive_data failed\n");
exit(1);
}
// 关闭套接字
close(sockfd);
return 0;
}

View File

@@ -0,0 +1,222 @@
// getifaddrs_bridge_server.c -- This file is part of tiny_computer.
// Copyright (C) 2023 Caten Hu
// Tiny Computer is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published
// by the Free Software Foundation, either version 3 of the License,
// or any later version.
// Tiny Computer is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
/* this file is mainly generated by Bing */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <ifaddrs.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <sys/un.h>
#define BUFSIZE 1024 // 定义缓冲区大小
// 定义一个序列化函数将ifaddrs结构体转换为字节数组
int serialize_ifaddrs(struct ifaddrs *ifa, char *buf, int size) {
int len = 0; // 记录已经写入的字节数
while (ifa != NULL && len < size) {
// 写入接口名称
int namelen = strlen(ifa->ifa_name) + 1; // 包括结束符
if (len + namelen > size) break; // 缓冲区不足
memcpy(buf + len, ifa->ifa_name, namelen);
len += namelen;
// 写入接口标志
if (len + sizeof(unsigned int) > size) break; // 缓冲区不足
memcpy(buf + len, &ifa->ifa_flags, sizeof(unsigned int));
len += sizeof(unsigned int);
// 写入接口地址
if (ifa->ifa_addr != NULL) {
int addrlen = sizeof(struct sockaddr); // 地址结构体长度
if (len + addrlen > size) break; // 缓冲区不足
memcpy(buf + len, ifa->ifa_addr, addrlen);
len += addrlen;
} else {
// 如果没有地址,写入一个空字节
if (len + 1 > size) break; // 缓冲区不足
buf[len] = '\0';
len += 1;
}
// 写入接口掩码
if (ifa->ifa_netmask != NULL) {
int masklen = sizeof(struct sockaddr); // 掩码结构体长度
if (len + masklen > size) break; // 缓冲区不足
memcpy(buf + len, ifa->ifa_netmask, masklen);
len += masklen;
} else {
// 如果没有掩码,写入一个空字节
if (len + 1 > size) break; // 缓冲区不足
buf[len] = '\0';
len += 1;
}
// 写入接口广播地址或点对点地址
if (ifa->ifa_flags & IFF_BROADCAST) {
// 如果有广播地址
if (ifa->ifa_broadaddr != NULL) {
int broadlen = sizeof(struct sockaddr); // 广播地址结构体长度
if (len + broadlen > size) break; // 缓冲区不足
memcpy(buf + len, ifa->ifa_broadaddr, broadlen);
len += broadlen;
} else {
// 如果没有广播地址,写入一个空字节
if (len + 1 > size) break; // 缓冲区不足
buf[len] = '\0';
len += 1;
}
} else if (ifa->ifa_flags & IFF_POINTOPOINT) {
// 如果有点对点地址
if (ifa->ifa_dstaddr != NULL) {
int dstlen = sizeof(struct sockaddr); // 点对点地址结构体长度
if (len + dstlen > size) break; // 缓冲区不足
memcpy(buf + len, ifa->ifa_dstaddr, dstlen);
len += dstlen;
} else {
// 如果没有点对点地址,写入一个空字节
if (len + 1 > size) break; // 缓冲区不足
buf[len] = '\0';
len += 1;
}
} else {
// 如果没有广播地址或点对点地址,写入两个空字节
if (len + 2 > size) break; // 缓冲区不足
buf[len] = '\0';
buf[len + 1] = '\0';
len += 2;
}
// 写入接口数据
if (ifa->ifa_data != NULL) {
// TODO: 根据不同的地址族,写入不同的数据
// 这里暂时省略,只写入一个空字节
if (len + 1 > size) break; // 缓冲区不足
buf[len] = '\0';
len += 1;
} else {
// 如果没有数据,写入一个空字节
if (len + 1 > size) break; // 缓冲区不足
buf[len] = '\0';
len += 1;
}
// 跳到下一个接口
ifa = ifa->ifa_next;
}
return len; // 返回写入的总字节数
}
// 定义一个接收信号的函数,从客户端接收一个信号
int receive_signal(int sockfd) {
char sig; // 定义信号变量
int n = read(sockfd, &sig, 1); // 从套接字读取一个字节
if (n < 0) {
perror("read");
return -1; // 返回错误
}
if (sig == 'S') {
// 如果收到信号S表示客户端需要数据
return 0; // 返回成功
} else {
// 如果收到其他信号,表示无效信号
fprintf(stderr, "invalid signal: %c\n", sig);
return -1; // 返回错误
}
}
// 定义一个发送数据的函数,向客户端发送数据并序列化
int send_data(int sockfd) {
struct ifaddrs *ifap = NULL; // 定义ifaddrs结构体指针
// 调用getifaddrs函数获取本地接口信息
if (getifaddrs(&ifap) < 0) {
perror("getifaddrs");
return -1; // 返回错误
}
char buf[BUFSIZE]; // 定义缓冲区
// 调用序列化函数将ifaddrs结构体转换为字节数组
int len = serialize_ifaddrs(ifap, buf, BUFSIZE);
if (len < 0) {
fprintf(stderr, "serialize_ifaddrs failed\n");
return -1; // 返回错误
}
// 向套接字写入数据
int n = write(sockfd, buf, len);
if (n < 0) {
perror("write");
return -1; // 返回错误
}
// 释放ifaddrs结构体
freeifaddrs(ifap);
return 0; // 返回成功
}
// 主函数
int main(int argc, char *argv[]) {
if (argc != 2) {
printf("usage: %s <socket_path>\n", argv[0]);
return 0;
}
// 创建一个套接字
int sockfd = socket(PF_UNIX, SOCK_STREAM, 0);
if (sockfd < 0) {
perror("socket");
exit(1);
}
// 定义服务器地址结构体
struct sockaddr_un un;
memset(&un, 0, sizeof(un));
un.sun_family = AF_UNIX;
snprintf(un.sun_path, sizeof(un.sun_path), "%s", argv[1]);
unlink(un.sun_path);
// 绑定套接字到服务器地址
if (bind(sockfd, (struct sockaddr *)&un, sizeof(un)) < 0) {
perror("bind");
exit(1);
}
// 监听套接字
if (listen(sockfd, 5) < 0) {
perror("listen");
exit(1);
}
// 循环接受客户端连接
while (1) {
int connfd = accept(sockfd, NULL, NULL);
if (connfd < 0) {
perror("accept");
continue; // 如果接受失败,继续循环
}
// 循环接收和发送数据
while (1) {
// 接收信号
if (receive_signal(connfd) < 0) {
fprintf(stderr, "receive_signal failed\n");
close(connfd); // 如果接收失败,关闭连接套接字
break; // 跳出循环
}
// 发送数据
if (send_data(connfd) < 0) {
fprintf(stderr, "send_data failed\n");
close(connfd); // 如果发送失败,关闭连接套接字
break; // 跳出循环
}
}
}
// 关闭监听套接字
close(sockfd);
return 0;
}

View File

@@ -0,0 +1,19 @@
### 编译
使用NDK编译getifaddrs_bridge_server.c:
`aarch64-linux-android-clang getifaddrs_bridge_server.c -o getifaddrs_bridge_server`
在小小电脑上编译getifaddrs_bridge_client_lib.c:
`gcc getifaddrs_bridge_client_lib.c -o getifaddrs_bridge_client_lib.so -shared`
### 使用
在安卓端:
`getifaddrs_bridge_server /path/to/container/tmp/.getifaddrs-bridge`
在proot容器
`LD_PRELOAD=/path/to/getifaddrs_bridge_client_lib.so <your_program>`

32
extra/readme.md Normal file
View File

@@ -0,0 +1,32 @@
## 这个readme介绍assets文件夹中文件的制作方式。
### assets.zip中的文件
- [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)
- [容器文件xa*](build-tiny-rootfs.md)
其中tar、busybox和pulseaudio相关文件都是直接用了二进制文件。
### patch.tar.gz中的文件
#### extra/getifaddrs_bridge_client_lib.so:
在安卓13以上的系统中proot容器无权使用默认的getifaddrs而这个库包含了一个getifaddrs实现。
linux在需要数据时使用socket通知位于安卓的getifaddrs_bridge_server让getifaddrs_bridge_server执行getifaddrs函数并将结构体数据序列化后发送回linux端这边接收数据并反序列化还原成指针结构体。简单来说就是用安卓的getifaddrs代替linux的getifaddrs。
源码和编译信息在getifaddrs_bridge文件夹查看。
#### caj, edraw
这些分别是cajviewer亿图图示的补丁
- 亿图图示补丁的库文件是在小小电脑上下载了Qt对应版本源码后编译得到的
- 编译进行了两次第一次直接编译可以得到Gui和Widgets两个库。第二次编译带上XcbQpa虽然会编译失败但在这之前就可以得到XcbQpa的库。

File diff suppressed because it is too large Load Diff

View File

@@ -56,28 +56,90 @@ class Util {
Directory.fromRawPath(const Utf8Encoder().convert(dir)).createSync(recursive: true); Directory.fromRawPath(const Utf8Encoder().convert(dir)).createSync(recursive: true);
} }
static Future<void> execute(String str) async { static Future<int> execute(String str) async {
Pty pty = Pty.start( Pty pty = Pty.start(
"/system/bin/sh" "/system/bin/sh"
); );
pty.write(const Utf8Encoder().convert("$str\nexit\n")); pty.write(const Utf8Encoder().convert("$str\nexit \$!\n"));
await pty.exitCode; return await pty.exitCode;
} }
static void termWrite(String str) { static void termWrite(String str) {
G.termPtys[G.currentContainer]!.pty.write(const Utf8Encoder().convert("$str\n")); G.termPtys[G.currentContainer]!.pty.write(const Utf8Encoder().convert("$str\n"));
} }
//所有key
//int defaultContainer = 0: 默认启动第0个容器
//int defaultAudioPort = 4718: 默认pulseaudio端口(为了避免和其它软件冲突改成4718了原默认4713)
//bool autoLaunchVnc = true: 是否自动启动VNC并跳转
//String lastDate: 上次启动软件的日期yyyy-MM-dd
//int adsWatchedToday: 今日视频广告观看数量
//int adsWatchedTotal: 视频广告观看数量
//bool isBannerAdsClosed = false
//bool isTerminalWriteEnabled = false
//bool isTerminalCommandsEnabled = false
//int termMaxLines = 4095 终端最大行数
//double termFontScale = 1 终端字体大小
//int vip = 0 用户等级vip免广告你要改吗(ToT)
//bool isStickyKey = true 终端ctrl, shift, alt键是否粘滞
//String defaultFFmpegCommand 默认推流命令
//String defaultVirglCommand 默认virgl参数
//String defaultVirglOpt 默认virgl环境变量
//bool reinstallBootstrap = false 下次启动是否重装引导包
//bool getifaddrsBridge = false 下次启动是否桥接getifaddrsBridge
//bool uos = false 下次启动是否伪装UOS
//bool isBoxEnabled = false 下次启动是否开启box86/box64
//bool isWineEnabled = false 下次启动是否开启wine
//bool virgl = false 下次启动是否启用virgl
//? int bootstrapVersion: 启动包版本
//String[] containersInfo: 所有容器信息(json)
//{name, boot:"\$DATA_DIR/bin/proot ...", vnc:"startnovnc", vncUrl:"...", commands:[{name:"更新和升级", command:"apt update -y && apt upgrade -y"},
// bind:[{name:"U盘", src:"/storage/xxxx", dst:"/media/meow"}]...]}
//String[] adsBonus: 观看广告获取的奖励(json)
//{name: "xxx", amount: xxx}
//TODO: 这么写还是不对劲,有空改成类试试?
static dynamic getGlobal(String key) {
bool b = G.prefs.containsKey(key);
switch (key) {
case "defaultContainer" : return b ? G.prefs.getInt(key)! : (value){G.prefs.setInt(key, value); return value;}(0);
case "defaultAudioPort" : return b ? G.prefs.getInt(key)! : (value){G.prefs.setInt(key, value); return value;}(4718);
case "autoLaunchVnc" : return b ? G.prefs.getBool(key)! : (value){G.prefs.setBool(key, value); return value;}(true);
case "lastDate" : return b ? G.prefs.getString(key)! : (value){G.prefs.setString(key, value); return value;}("1970-01-01");
case "adsWatchedToday" : return b ? G.prefs.getInt(key)! : (value){G.prefs.setInt(key, value); return value;}(0);
case "adsWatchedTotal" : return b ? G.prefs.getInt(key)! : (value){G.prefs.setInt(key, value); return value;}(0);
case "isBannerAdsClosed" : return b ? G.prefs.getBool(key)! : (value){G.prefs.setBool(key, value); return value;}(false);
case "isTerminalWriteEnabled" : return b ? G.prefs.getBool(key)! : (value){G.prefs.setBool(key, value); return value;}(false);
case "isTerminalCommandsEnabled" : return b ? G.prefs.getBool(key)! : (value){G.prefs.setBool(key, value); return value;}(false);
case "termMaxLines" : return b ? G.prefs.getInt(key)! : (value){G.prefs.setInt(key, value); return value;}(4095);
case "termFontScale" : return b ? G.prefs.getDouble(key)! : (value){G.prefs.setDouble(key, value); return value;}(1.0);
case "vip" : return b ? G.prefs.getInt(key)! : (value){G.prefs.setInt(key, value); return value;}(0);
case "isStickyKey" : return b ? G.prefs.getBool(key)! : (value){G.prefs.setBool(key, value); return value;}(true);
case "reinstallBootstrap" : return b ? G.prefs.getBool(key)! : (value){G.prefs.setBool(key, value); return value;}(false);
case "getifaddrsBridge" : return b ? G.prefs.getBool(key)! : (value){G.prefs.setBool(key, value); return value;}(false);
case "uos" : return b ? G.prefs.getBool(key)! : (value){G.prefs.setBool(key, value); return value;}(false);
case "isBoxEnabled" : return b ? G.prefs.getBool(key)! : (value){G.prefs.setBool(key, value); return value;}(false);
case "isWineEnabled" : return b ? G.prefs.getBool(key)! : (value){G.prefs.setBool(key, value); return value;}(false);
case "virgl" : return b ? G.prefs.getBool(key)! : (value){G.prefs.setBool(key, value); return value;}(false);
case "defaultFFmpegCommand" : return b ? G.prefs.getString(key)! : (value){G.prefs.setString(key, value); return value;}("-hide_banner -an -max_delay 1000000 -r 30 -f android_camera -camera_index 0 -i 0:0 -vf scale=iw/2:-1 -rtsp_transport udp -f rtsp rtsp://127.0.0.1:8554/stream");
case "defaultVirglCommand" : return b ? G.prefs.getString(key)! : (value){G.prefs.setString(key, value); return value;}("--socket-path=\$CONTAINER_DIR/tmp/.virgl_test");
case "defaultVirglOpt" : return b ? G.prefs.getString(key)! : (value){G.prefs.setString(key, value); return value;}("GALLIUM_DRIVER=virpipe MESA_GL_VERSION_OVERRIDE=4.0");
case "containersInfo" : return G.prefs.getStringList(key)!;
case "adsBonus" : return b ? G.prefs.getStringList(key)! : (value){G.prefs.setStringList(key, value); return value;}([].cast<String>());
}
}
static dynamic getCurrentProp(String key) { static dynamic getCurrentProp(String key) {
return jsonDecode(G.prefs.getStringList("containersInfo")![G.currentContainer])[key]; return jsonDecode(Util.getGlobal("containersInfo")[G.currentContainer])[key];
} }
//用来设置name, boot, vnc, vncUrl等 //用来设置name, boot, vnc, vncUrl等
static Future<void> setCurrentProp(String key, dynamic value) async { static Future<void> setCurrentProp(String key, dynamic value) async {
await G.prefs.setStringList("containersInfo", await G.prefs.setStringList("containersInfo",
G.prefs.getStringList("containersInfo")!..setAll(G.currentContainer, Util.getGlobal("containersInfo")..setAll(G.currentContainer,
[jsonEncode((jsonDecode( [jsonEncode((jsonDecode(
G.prefs.getStringList("containersInfo")![G.currentContainer] Util.getGlobal("containersInfo")[G.currentContainer]
))..update(key, (v) => value))] ))..update(key, (v) => value))]
) )
); );
@@ -86,29 +148,29 @@ class Util {
//返回单个G.bonusTable定义的item //返回单个G.bonusTable定义的item
static Map<String, dynamic> getRandomBonus() { static Map<String, dynamic> getRandomBonus() {
final random = Random(); final random = Random();
final totalWeight = G.bonusTable.fold(0.0, (sum, item) => sum + item['weight']); final totalWeight = D.bonusTable.fold(0.0, (sum, item) => sum + item['weight']);
final randomIndex = random.nextDouble() * totalWeight; final randomIndex = random.nextDouble() * totalWeight;
var cumulativeWeight = 0.0; var cumulativeWeight = 0.0;
for (final item in G.bonusTable) { for (final item in D.bonusTable) {
cumulativeWeight += item['weight']; cumulativeWeight += item['weight'];
if (randomIndex <= cumulativeWeight) { if (randomIndex <= cumulativeWeight) {
return item; return item;
} }
} }
return G.bonusTable[0]; return D.bonusTable[0];
} }
//由getRandomBonus返回的数据 //由getRandomBonus返回的数据
static Future<void> applyBonus(Map<String, dynamic> bonus) async { static Future<void> applyBonus(Map<String, dynamic> bonus) async {
bool flag = false; bool flag = false;
List<String> ret = G.prefs.getStringList("adsBonus")!.map((e) { List<String> ret = Util.getGlobal("adsBonus").map((e) {
Map<String, dynamic> item = jsonDecode(e); Map<String, dynamic> item = jsonDecode(e);
return (item["name"] == bonus["name"])? return (item["name"] == bonus["name"])?
jsonEncode(item..update("amount", (v) { jsonEncode(item..update("amount", (v) {
flag = true; flag = true;
return v + bonus["amount"]; return v + bonus["amount"];
})):e; })):e;
}).toList(); }).toList().cast<String>();
if (!flag) { if (!flag) {
ret.add("""{"name": "${bonus["name"]}", "amount": ${bonus["amount"]}}"""); ret.add("""{"name": "${bonus["name"]}", "amount": ${bonus["amount"]}}""");
} }
@@ -117,7 +179,7 @@ class Util {
//根据已看广告量判断是否应该继续看广告 //根据已看广告量判断是否应该继续看广告
static bool shouldWatchAds(int expectNum) { static bool shouldWatchAds(int expectNum) {
return (G.prefs.getInt("adsWatchedTotal")! < expectNum) && (G.prefs.getInt("vip")! < 1) && (G.prefs.getInt("adsWatchedToday")! < 5); return ((Util.getGlobal("adsWatchedTotal") as int) < expectNum) && ((Util.getGlobal("vip") as int) < 1) && ((Util.getGlobal("adsWatchedToday") as int) < D.adsRequired["unlockToday"]!) && (G.adsWatchedThisTime < D.adsRequired["unlockOnce"]!);
} }
//限定字符串在min和max之间, 给文本框的validator //限定字符串在min和max之间, 给文本框的validator
@@ -184,9 +246,8 @@ class VirtualKeyboard extends TerminalInputHandler with ChangeNotifier {
shift: event.shift || _shift, shift: event.shift || _shift,
alt: event.alt || _alt, alt: event.alt || _alt,
)); ));
G.maybeCtrlJ = event.key.name == "keyJ"; G.maybeCtrlJ = event.key.name == "keyJ"; //这个是为了稍后区分按键到底是Enter还是Ctrl+J
print(G.maybeCtrlJ); if (!(Util.getGlobal("isStickyKey") as bool)) {
if (!G.prefs.getBool("isStickyKey")!) {
G.keyboard.ctrl = false; G.keyboard.ctrl = false;
G.keyboard.shift = false; G.keyboard.shift = false;
G.keyboard.alt = false; G.keyboard.alt = false;
@@ -201,7 +262,7 @@ class TermPty {
late final Pty pty; late final Pty pty;
TermPty() { TermPty() {
terminal = Terminal(inputHandler: G.keyboard, maxLines: G.prefs.getInt("termMaxLines")!); terminal = Terminal(inputHandler: G.keyboard, maxLines: Util.getGlobal("termMaxLines") as int);
pty = Pty.start( pty = Pty.start(
"/system/bin/sh", "/system/bin/sh",
workingDirectory: G.dataPath, workingDirectory: G.dataPath,
@@ -222,6 +283,7 @@ class TermPty {
Navigator.push(G.homePageStateContext, MaterialPageRoute(builder: (context) { Navigator.push(G.homePageStateContext, MaterialPageRoute(builder: (context) {
const TextStyle ts = TextStyle(fontSize: 16, color: Colors.white, fontWeight: FontWeight.normal); const TextStyle ts = TextStyle(fontSize: 16, color: Colors.white, fontWeight: FontWeight.normal);
const String helperLink = "https://www.vmos.cn/zhushou.htm"; const String helperLink = "https://www.vmos.cn/zhushou.htm";
const String helperLink2 = "https://b23.tv/WwqOqW6";
return Scaffold(backgroundColor: Colors.deepPurple, return Scaffold(backgroundColor: Colors.deepPurple,
body: Center( body: Center(
child: Scrollbar(child: child: Scrollbar(child:
@@ -240,7 +302,18 @@ class TermPty {
},)) },))
); );
}); });
}, child: const Text("复制", style: ts, textAlign: TextAlign.center)) }, child: const Text("复制", style: ts, textAlign: TextAlign.center)),
const Text("如果不能解决请参考此教程: ", style: ts, textAlign: TextAlign.center),
OutlinedButton(onPressed: () {
FlutterClipboard.copy(helperLink2).then(( value ) {
ScaffoldMessenger.of(context).hideCurrentSnackBar();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: const Text("已复制"), action: SnackBarAction(label: "跳转", onPressed: () {
launchUrl(Uri.parse(helperLink2), mode: LaunchMode.externalApplication);
},))
);
});
}, child: const Text("查看", style: ts, textAlign: TextAlign.center))
]), ]),
) )
) )
@@ -249,7 +322,7 @@ class TermPty {
} }
}); });
terminal.onOutput = (data) { terminal.onOutput = (data) {
if (!G.prefs.getBool("isTerminalWriteEnabled")!) { if (!(Util.getGlobal("isTerminalWriteEnabled") as bool)) {
return; return;
} }
//由于对回车的处理似乎存在问题,所以拿出来单独处理 //由于对回车的处理似乎存在问题,所以拿出来单独处理
@@ -269,19 +342,64 @@ class TermPty {
} }
// Global variables //default values
class G { class D {
static late final String dataPath; //默认快捷指令
static Pty? audioPty; static const commands = [{"name":"检查更新并升级", "command":"sudo apt update && sudo apt upgrade -y"},
static late WebViewController controller; {"name":"查看系统信息", "command":"neofetch -L && neofetch --off"},
static late BuildContext homePageStateContext; {"name":"清屏", "command":"clear"},
static late int currentContainer; //目前运行第几个容器 {"name":"查看IP", "command":"hostname -I | awk '{print \$NF}' # 如果显示无权限(Permission denied)请在全局设置里开启getifaddrs桥接"},
static late Map<int, TermPty> termPtys; //为容器<int>存放TermPty数据 {"name":"安装图形处理软件Krita", "command":"sudo apt update && sudo apt install -y krita krita-l10n"},
static late AdManager ads; //广告实例 {"name":"卸载Krita", "command":"sudo apt autoremove --purge -y krita krita-l10n"},
static late VirtualKeyboard keyboard; //存储ctrl, shift, alt状态 {"name":"安装视频剪辑软件Kdenlive", "command":"sudo apt update && sudo apt install -y kdenlive"},
static bool maybeCtrlJ = false; //为了区分按下的ctrl+J和enter而准备的变量 {"name":"卸载Kdenlive", "command":"sudo apt autoremove --purge -y kdenlive"},
static double termFontScale = 1; //终端字体大小存储为G.prefs的termFontScale {"name":"安装科学计算软件Octave", "command":"sudo apt update && sudo apt install -y octave"},
{"name":"卸载Octave", "command":"sudo apt autoremove --purge -y octave"},
{"name":"安装WPS", "command":"""wget \$(curl -L https://linux.wps.cn/ | grep -oP 'href="\\K[^"]*arm64\\.deb' | head -n 1) -O /tmp/wps.deb && sudo apt update && sudo apt install -y /tmp/wps.deb; rm /tmp/wps.deb"""},
{"name":"卸载WPS", "command":"sudo apt autoremove --purge -y wps-office"},
{"name":"安装CAJViewer", "command":"wget https://download.cnki.net/net.cnki.cajviewer_1.3.20-1_arm64.deb -O /tmp/caj.deb && sudo apt update && sudo apt install -y /tmp/caj.deb && bash /home/tiny/.local/share/tiny/caj/postinst; rm /tmp/caj.deb"},
{"name":"卸载CAJViewer", "command":"sudo apt autoremove --purge -y net.cnki.cajviewer && bash /home/tiny/.local/share/tiny/caj/postrm"},
{"name":"安装亿图图示", "command":"wget https://www.edrawsoft.cn/2download/aarch64/edrawmax_11.5.6-3_arm64.deb -O /tmp/edraw.deb && sudo apt update && sudo apt install -y /tmp/edraw.deb && bash /home/tiny/.local/share/tiny/edraw/postinst; rm /tmp/edraw.deb"},
{"name":"卸载亿图图示", "command":"sudo apt autoremove --purge -y edrawmax libldap-2.4-2"},
{"name":"安装QQ", "command":"""wget \$(curl -L https://cdn-go.cn/qq-web/im.qq.com_new/latest/rainbow/linuxQQDownload.js | grep -oP 'deb":"\\K[^"]*arm64\\.deb' | head -n 1) -O /tmp/qq.deb && sudo apt update && sudo apt install -y /tmp/qq.deb && sed -i 's#Exec=/opt/QQ/qq %U#Exec=/opt/QQ/qq --no-sandbox %U#g' /usr/share/applications/qq.desktop; rm /tmp/qq.deb"""},
{"name":"卸载QQ", "command":"sudo apt autoremove --purge -y linuxqq"},
{"name":"安装UOS微信", "command":"wget https://home-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.weixin/com.tencent.weixin_2.1.9_arm64.deb -O /tmp/wechat.deb && sudo apt update && sudo apt install -y /tmp/wechat.deb /home/tiny/.local/share/tiny/wechat/deepin-elf-verify_all.deb /home/tiny/.local/share/tiny/wechat/libssl1.1_1.1.1n-0+deb10u6_arm64.deb && sed -i 's#/opt/apps/com.tencent.weixin/files/weixin/weixin#/opt/apps/com.tencent.weixin/files/weixin/weixin --no-sandbox#g' /opt/apps/com.tencent.weixin/files/weixin/weixin.sh && echo '该微信为UOS特供版只有账号实名且在UOS系统上运行时可用。在使用前请前往全局设置开启UOS伪装。\n如果你使用微信只是为了传输文件那么可以考虑使用支持SAF的文件管理器质感文件直接访问小小电脑所有文件。'; rm /tmp/wechat.deb"},
{"name":"卸载UOS微信", "command":"sudo apt autoremove --purge -y com.tencent.weixin libssl1.1 deepin-elf-verify"},
{"name":"安装钉钉", "command":"""wget \$(curl -L https://g.alicdn.com/dingding/h5-home-download/0.2.4/js/index.js | grep -oP 'url:"\\K[^"]*arm64\\.deb' | head -n 1) -O /tmp/dingtalk.deb && sudo apt update && sudo apt install -y /tmp/dingtalk.deb && sed -i 's#\\./com.alibabainc.dingtalk#\\./com.alibabainc.dingtalk --no-sandbox#g' /opt/apps/com.alibabainc.dingtalk/files/Elevator.sh; rm /tmp/dingtalk.deb"""},
{"name":"卸载钉钉", "command":"sudo apt autoremove --purge -y com.alibabainc.dingtalk"},
{"name":"修复无法编译C语言程序", "command":"sudo apt update && sudo apt reinstall -y libc6-dev"},
{"name":"修复系统语言到中文", "command":"sudo localedef -c -i zh_CN -f UTF-8 zh_CN.UTF-8"},
{"name":"启用回收站", "command":"sudo apt update && sudo apt install -y gvfs && echo '安装完成, 重启软件即可使用回收站。'"},
{"name":"拉流测试", "command":"ffplay rtsp://127.0.0.1:8554/stream &"},
{"name":"关机", "command":"stopvnc\nexit\nexit"},
{"name":"???", "command":"timeout 8 cmatrix"}];
//默认小键盘
static const termCommands = [
{"name": "Esc", "key": TerminalKey.escape},
{"name": "Tab", "key": TerminalKey.tab},
{"name": "", "key": TerminalKey.arrowUp},
{"name": "", "key": TerminalKey.arrowDown},
{"name": "", "key": TerminalKey.arrowLeft},
{"name": "", "key": TerminalKey.arrowRight},
{"name": "Del", "key": TerminalKey.delete},
{"name": "PgUp", "key": TerminalKey.pageUp},
{"name": "PgDn", "key": TerminalKey.pageDown},
{"name": "Home", "key": TerminalKey.home},
{"name": "End", "key": TerminalKey.end},
{"name": "F1", "key": TerminalKey.f1},
{"name": "F2", "key": TerminalKey.f2},
{"name": "F3", "key": TerminalKey.f3},
{"name": "F4", "key": TerminalKey.f4},
{"name": "F5", "key": TerminalKey.f5},
{"name": "F6", "key": TerminalKey.f6},
{"name": "F7", "key": TerminalKey.f7},
{"name": "F8", "key": TerminalKey.f8},
{"name": "F9", "key": TerminalKey.f9},
{"name": "F10", "key": TerminalKey.f10},
{"name": "F11", "key": TerminalKey.f11},
{"name": "F12", "key": TerminalKey.f12},
];
//看广告可以获得的奖励。 //看广告可以获得的奖励。
//weight抽奖权重singleUse使用一次花费的数量amount抽中可以获得的数量 //weight抽奖权重singleUse使用一次花费的数量amount抽中可以获得的数量
@@ -296,29 +414,70 @@ class G {
{"name": "Bonus Reward", "subtitle": "会有极好的事情发生", "description": "来自记忆空间的传说。\n使用后一天内必有极好的事情...\n就是你想象的那种事情...\n就会发生。\n不过, 大概只是个传说吧。", "weight": 1, "amount": 1, "singleUse": 1}, {"name": "Bonus Reward", "subtitle": "会有极好的事情发生", "description": "来自记忆空间的传说。\n使用后一天内必有极好的事情...\n就是你想象的那种事情...\n就会发生。\n不过, 大概只是个传说吧。", "weight": 1, "amount": 1, "singleUse": 1},
]; ];
//所有key //某项功能开启需要的广告数。
//int defaultContainer = 0: 默认启动第0个容器 static const Map<String, int> adsRequired = {
//int defaultAudioPort = 4718: 默认pulseaudio端口(为了避免和其它软件冲突改成4718了原默认4713) "closeBannerAds" : 5,
//bool autoLaunchVnc = true: 是否自动启动VNC并跳转 "enableTerminalWrite" : 2,
//String lastDate: 上次启动软件的日期yyyy-MM-dd "enableTerminalCommands" : 3,
//int adsWatchedToday: 今日视频广告观看数量 "changeTermMaxLines" : 6,
//int adsWatchedTotal: 视频广告观看数量 "changeFFmpegCommand" : 8,
//bool isBannerAdsClosed = false "enableVirgl" : 10,
//bool bannerAdsCanBeClosed = false 看一次视频广告永久开启,历史遗留
//bool isTerminalWriteEnabled = false
//bool terminalWriteCanBeEnabled = false 看一次视频广告永久开启,历史遗留
//bool isTerminalCommandsEnabled = false
//int termMaxLines = 4095 终端最大行数
//double termFontScale = 1 终端字体大小
//int vip = 0 用户等级vip免广告你要改吗(ToT)
//bool isStickyKey = true 终端ctrl, shift, alt键是否粘滞
//? int bootstrapVersion: 启动包版本
//String[] containersInfo: 所有容器信息(json)
//{name, boot:"\$DATA_DIR/bin/proot ...", vnc:"startnovnc", vncUrl:"...", commands:[{name:"更新和升级", command:"apt update -y && apt upgrade -y"}, ...]}
//String[] adsBonus: 观看广告获取的奖励(json)
//{name: "xxx", amount: xxx}
static late SharedPreferences prefs;
"unlockOnce" : 1, //临时解锁需要看的广告数
"unlockToday" : 2, //当日解锁需要看的广告数
};
static const String boot = "\$DATA_DIR/bin/proot -H --change-id=1000:1000 --pwd=/home/tiny --rootfs=\$CONTAINER_DIR --mount=/system --mount=/apex --mount=/sys --kill-on-exit --mount=/storage:/storage --sysvipc -L --link2symlink --mount=/proc:/proc --mount=/dev:/dev --mount=\$CONTAINER_DIR/tmp:/dev/shm --mount=/dev/urandom:/dev/random --mount=/proc/self/fd:/dev/fd --mount=/proc/self/fd/0:/dev/stdin --mount=/proc/self/fd/1:/dev/stdout --mount=/proc/self/fd/2:/dev/stderr --mount=/dev/null:/dev/tty0 --mount=/dev/null:/proc/sys/kernel/cap_last_cap --mount=/storage/self/primary:/media/sd --mount=\$DATA_DIR/share:/home/tiny/公共 --mount=\$DATA_DIR/tiny:/home/tiny/.local/share/tiny --mount=/storage/self/primary/Fonts:/usr/share/fonts/wpsm --mount=/storage/self/primary/AppFiles/Fonts:/usr/share/fonts/yozom --mount=/system/fonts:/usr/share/fonts/androidm --mount=/storage/self/primary/Pictures:/home/tiny/图片 --mount=/storage/self/primary/Music:/home/tiny/音乐 --mount=/storage/self/primary/Movies:/home/tiny/视频 --mount=/storage/self/primary/Download:/home/tiny/下载 --mount=/storage/self/primary/DCIM:/home/tiny/照片 --mount=/storage/self/primary/Documents:/home/tiny/文档 --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/.tmoe-container.stat:/proc/stat --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/.tmoe-container.version:/proc/version --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/bus:/proc/bus --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/buddyinfo:/proc/buddyinfo --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/cgroups:/proc/cgroups --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/consoles:/proc/consoles --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/crypto:/proc/crypto --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/devices:/proc/devices --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/diskstats:/proc/diskstats --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/execdomains:/proc/execdomains --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/fb:/proc/fb --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/filesystems:/proc/filesystems --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/interrupts:/proc/interrupts --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/iomem:/proc/iomem --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/ioports:/proc/ioports --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/kallsyms:/proc/kallsyms --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/keys:/proc/keys --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/key-users:/proc/key-users --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/kpageflags:/proc/kpageflags --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/loadavg:/proc/loadavg --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/locks:/proc/locks --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/misc:/proc/misc --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/modules:/proc/modules --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/pagetypeinfo:/proc/pagetypeinfo --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/partitions:/proc/partitions --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/sched_debug:/proc/sched_debug --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/softirqs:/proc/softirqs --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/timer_list:/proc/timer_list --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/uptime:/proc/uptime --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/vmallocinfo:/proc/vmallocinfo --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/vmstat:/proc/vmstat --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/zoneinfo:/proc/zoneinfo \$EXTRA_MOUNT /usr/bin/env -i HOSTNAME=TINY HOME=/home/tiny USER=tiny TERM=xterm-256color SDL_IM_MODULE=fcitx XMODIFIERS=@im=fcitx QT_IM_MODULE=fcitx GTK_IM_MODULE=fcitx TMOE_CHROOT=false TMOE_PROOT=true TMPDIR=/tmp MOZ_FAKE_NO_SANDBOX=1 DISPLAY=:4 PULSE_SERVER=tcp:127.0.0.1:4718 LANG=zh_CN.UTF-8 SHELL=/bin/bash PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/games:/usr/local/games \$EXTRA_OPT /bin/bash -l";
static final ButtonStyle commandButtonStyle = OutlinedButton.styleFrom(
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
minimumSize: const Size(0, 0),
padding: const EdgeInsets.fromLTRB(4, 2, 4, 2)
);
static final ButtonStyle controlButtonStyle = OutlinedButton.styleFrom(
textStyle: const TextStyle(fontWeight: FontWeight.w400),
side: const BorderSide(color: Color(0x1F000000)),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
minimumSize: const Size(0, 0),
padding: const EdgeInsets.fromLTRB(8, 4, 8, 4)
);
}
// Global variables
class G {
static late final String dataPath;
static Pty? audioPty;
static late WebViewController controller;
static late BuildContext homePageStateContext;
static late int currentContainer; //目前运行第几个容器
static late Map<int, TermPty> termPtys; //为容器<int>存放TermPty数据
static late AdManager ads; //广告实例
static late VirtualKeyboard keyboard; //存储ctrl, shift, alt状态
static bool maybeCtrlJ = false; //为了区分按下的ctrl+J和enter而准备的变量
static ValueNotifier<double> termFontScale = ValueNotifier(1); //终端字体大小存储为G.prefs的termFontScale
static int adsWatchedThisTime = 0; //本次启动应用看的广告数
static bool isStreamServerStarted = false;
static bool isStreaming = false;
//static int? streamingPid;
static String streamingOutput = "";
static late Pty streamServerPty;
static bool isVirglServerStarted = false;
static late Pty virglServerPty;
//static int? virglPid;
static ValueNotifier<int> pageIndex = ValueNotifier(0); //主界面索引
static ValueNotifier<bool> terminalPageChange = ValueNotifier(true); //更改值,用于刷新小键盘
static ValueNotifier<bool> bannerAdsChange = ValueNotifier(true); //更改值用于刷新banner广告
static ValueNotifier<bool> bootTextChange = ValueNotifier(true); //更改值,用于刷新启动命令
static ValueNotifier<String> updateText = ValueNotifier("小小电脑"); //加载界面的说明文字
static bool wasBoxEnabled = false; //本次启动时是否启用了box86/64
static late SharedPreferences prefs;
} }
class AdManager { class AdManager {
@@ -347,7 +506,7 @@ class AdManager {
static void showAd(String placementId, Function completeExtra, Function full) { static void showAd(String placementId, Function completeExtra, Function full) {
if (G.prefs.getInt("adsWatchedToday")!>=5) { if ((Util.getGlobal("adsWatchedToday") as int) >= 5) {
full(); full();
return; return;
} }
@@ -358,8 +517,9 @@ class AdManager {
onComplete: (placementId) async { onComplete: (placementId) async {
debugPrint('Video Ad $placementId completed'); debugPrint('Video Ad $placementId completed');
loadAd(placementId); loadAd(placementId);
await G.prefs.setInt("adsWatchedTotal", G.prefs.getInt("adsWatchedTotal")!+1); G.adsWatchedThisTime++;
await G.prefs.setInt("adsWatchedToday", G.prefs.getInt("adsWatchedToday")!+1); await G.prefs.setInt("adsWatchedTotal", (Util.getGlobal("adsWatchedTotal") as int)+1);
await G.prefs.setInt("adsWatchedToday", (Util.getGlobal("adsWatchedToday") as int)+1);
completeExtra(); completeExtra();
}, },
onFailed: (placementId, error, message) { onFailed: (placementId, error, message) {
@@ -396,7 +556,7 @@ class Workflow {
static Future<void> grantPermissions() async { static Future<void> grantPermissions() async {
Permission.storage.request(); Permission.storage.request();
Permission.manageExternalStorage.request(); //Permission.manageExternalStorage.request();
} }
static Future<void> setupBootstrap() async { static Future<void> setupBootstrap() async {
@@ -406,6 +566,8 @@ class Workflow {
Util.createDirFromString("${G.dataPath}/tmp"); Util.createDirFromString("${G.dataPath}/tmp");
//给proot的tmp文件夹虽然我不知道为什么proot要这个 //给proot的tmp文件夹虽然我不知道为什么proot要这个
Util.createDirFromString("${G.dataPath}/proot_tmp"); Util.createDirFromString("${G.dataPath}/proot_tmp");
//给pulseaudio的tmp文件夹
Util.createDirFromString("${G.dataPath}/pulseaudio_tmp");
//解压后得到bin文件夹和libexec文件夹 //解压后得到bin文件夹和libexec文件夹
//bin存放了proot, pulseaudio, tar等 //bin存放了proot, pulseaudio, tar等
//libexec存放了proot loader //libexec存放了proot loader
@@ -413,6 +575,12 @@ class Workflow {
"assets/assets.zip", "assets/assets.zip",
"${G.dataPath}/assets.zip", "${G.dataPath}/assets.zip",
); );
//patch.tar.gz存放了tiny文件夹
//里面是一些补丁,会被挂载到~/.local/share/tiny
await Util.copyAsset(
"assets/patch.tar.gz",
"${G.dataPath}/patch.tar.gz",
);
//dddd //dddd
await Util.copyAsset( await Util.copyAsset(
"assets/busybox", "assets/busybox",
@@ -423,39 +591,46 @@ class Workflow {
export DATA_DIR=${G.dataPath} export DATA_DIR=${G.dataPath}
cd \$DATA_DIR cd \$DATA_DIR
chmod +x busybox chmod +x busybox
\$DATA_DIR/busybox unzip assets.zip \$DATA_DIR/busybox unzip -o assets.zip
chmod -R +x bin/* chmod -R +x bin/*
chmod -R +x libexec/proot/* chmod -R +x libexec/proot/*
chmod 1777 tmp chmod 1777 tmp
ln -s \$DATA_DIR/busybox \$DATA_DIR/bin/xz ln -sf \$DATA_DIR/busybox \$DATA_DIR/bin/xz
\$DATA_DIR/busybox rm -rf assets.zip ln -sf \$DATA_DIR/busybox \$DATA_DIR/bin/gzip
\$DATA_DIR/bin/tar zxf patch.tar.gz
\$DATA_DIR/busybox rm -rf assets.zip patch.tar.gz
"""); """);
} }
//初次启动要做的事情 //初次启动要做的事情
static Future<void> initForFirstTime() async { static Future<void> initForFirstTime() async {
//首先设置bootstrap //首先设置bootstrap
G.updateText.value = "正在安装引导包";
await setupBootstrap(); await setupBootstrap();
G.updateText.value = "正在复制容器系统";
//存放容器的文件夹0和存放硬链接的文件夹.l2s //存放容器的文件夹0和存放硬链接的文件夹.l2s
Util.createDirFromString("${G.dataPath}/containers/0/.l2s"); Util.createDirFromString("${G.dataPath}/containers/0/.l2s");
//这个是容器rootfs被split命令分成了xa* //这个是容器rootfs被split命令分成了xa*
//首次启动,就用这个,别让用户另选了 //首次启动,就用这个,别让用户另选了
//TODO: 这个字符串列表太丑陋了 //TODO: 这个字符串列表太丑陋了
for (String name in ["xaa", "xab", "xac", "xad", "xae", "xaf", "xag", "xah", "xai"]) { for (String name in ["xaa", "xab", "xac", "xad", "xae", "xaf", "xag", "xah", "xai", "xaj"]) {
//for (String name in ["xaa", "xab", "xac", "xad", "xae", "xaf", "xag", "xah", "xai", "xaj", "xak", "xal", "xam", "xan", "xao", "xap", "xaq"]) { //for (String name in ["xaa", "xab", "xac", "xad", "xae", "xaf", "xag", "xah", "xai", "xaj", "xak", "xal", "xam", "xan", "xao", "xap", "xaq"]) {
await Util.copyAsset("assets/$name", "${G.dataPath}/$name"); await Util.copyAsset("assets/$name", "${G.dataPath}/$name");
} }
//-J //-J
G.updateText.value = "正在安装容器系统";
await Util.execute( await Util.execute(
""" """
export DATA_DIR=${G.dataPath} export DATA_DIR=${G.dataPath}
export CONTAINER_DIR=\$DATA_DIR/containers/0 export CONTAINER_DIR=\$DATA_DIR/containers/0
export EXTRA_OPT=""
cd \$DATA_DIR cd \$DATA_DIR
export PATH=\$DATA_DIR/bin:\$PATH export PATH=\$DATA_DIR/bin:\$PATH
export PROOT_TMP_DIR=\$DATA_DIR/proot_tmp export PROOT_TMP_DIR=\$DATA_DIR/proot_tmp
export PROOT_LOADER=\$DATA_DIR/libexec/proot/loader export PROOT_LOADER=\$DATA_DIR/libexec/proot/loader
export PROOT_LOADER_32=\$DATA_DIR/libexec/proot/loader32 export PROOT_LOADER_32=\$DATA_DIR/libexec/proot/loader32
export PROOT_L2S_DIR=\$CONTAINER_DIR/.l2s #export PROOT_L2S_DIR=\$CONTAINER_DIR/.l2s
\$DATA_DIR/bin/proot --link2symlink sh -c "cat xa* | \$DATA_DIR/bin/tar x -J --delay-directory-restore --preserve-permissions -v -C containers/0" \$DATA_DIR/bin/proot --link2symlink sh -c "cat xa* | \$DATA_DIR/bin/tar x -J --delay-directory-restore --preserve-permissions -v -C containers/0"
#Script from proot-distro #Script from proot-distro
chmod u+rw "\$CONTAINER_DIR/etc/passwd" "\$CONTAINER_DIR/etc/shadow" "\$CONTAINER_DIR/etc/group" "\$CONTAINER_DIR/etc/gshadow" chmod u+rw "\$CONTAINER_DIR/etc/passwd" "\$CONTAINER_DIR/etc/shadow" "\$CONTAINER_DIR/etc/group" "\$CONTAINER_DIR/etc/gshadow"
@@ -477,40 +652,12 @@ done
//$DATA_DIR是数据文件夹, $CONTAINER_DIR是容器根目录 //$DATA_DIR是数据文件夹, $CONTAINER_DIR是容器根目录
await G.prefs.setStringList("containersInfo", ["""{ await G.prefs.setStringList("containersInfo", ["""{
"name":"Debian Bookworm", "name":"Debian Bookworm",
"boot":"\$DATA_DIR/bin/proot --change-id=1000:1000 --pwd=/home/tiny --rootfs=\$CONTAINER_DIR --mount=/system --mount=/apex --kill-on-exit --mount=/storage:/storage --sysvipc -L --link2symlink --mount=/proc:/proc --mount=/dev:/dev --mount=\$CONTAINER_DIR/tmp:/dev/shm --mount=/dev/urandom:/dev/random --mount=/proc/self/fd:/dev/fd --mount=/proc/self/fd/0:/dev/stdin --mount=/proc/self/fd/1:/dev/stdout --mount=/proc/self/fd/2:/dev/stderr --mount=/dev/null:/dev/tty0 --mount=/dev/null:/proc/sys/kernel/cap_last_cap --mount=/storage/self/primary:/media/sd --mount=\$DATA_DIR/share:/home/tiny/公共 --mount=/storage/self/primary/Fonts:/usr/share/fonts/wpsm --mount=/storage/self/primary/AppFiles/Fonts:/usr/share/fonts/yozom --mount=/system/fonts:/usr/share/fonts/androidm --mount=/storage/self/primary/Pictures:/home/tiny/图片 --mount=/storage/self/primary/Music:/home/tiny/音乐 --mount=/storage/self/primary/Movies:/home/tiny/视频 --mount=/storage/self/primary/Download:/home/tiny/下载 --mount=/storage/self/primary/DCIM:/home/tiny/照片 --mount=/storage/self/primary/Documents:/home/tiny/文档 --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/.tmoe-container.stat:/proc/stat --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/.tmoe-container.version:/proc/version --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/bus:/proc/bus --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/buddyinfo:/proc/buddyinfo --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/cgroups:/proc/cgroups --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/consoles:/proc/consoles --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/crypto:/proc/crypto --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/devices:/proc/devices --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/diskstats:/proc/diskstats --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/execdomains:/proc/execdomains --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/fb:/proc/fb --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/filesystems:/proc/filesystems --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/interrupts:/proc/interrupts --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/iomem:/proc/iomem --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/ioports:/proc/ioports --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/kallsyms:/proc/kallsyms --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/keys:/proc/keys --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/key-users:/proc/key-users --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linuxproot_proc/kpageflags:/proc/kpageflags --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/loadavg:/proc/loadavg --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/locks:/proc/locks --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/misc:/proc/misc --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/modules:/proc/modules --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/pagetypeinfo:/proc/pagetypeinfo --mount=/data/data/com.termux/files/home/.local/share/tmoe-linux/containersproot/debian-bookworm_arm64/usr/local/etc/tmoe-linux/proot_proc/partitions:/proc/partitions --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/sched_debug:/proc/sched_debug --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/softirqs:/proc/softirqs --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/timer_list:/proc/timer_list --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/uptime:/proc/uptime --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/vmallocinfo:/proc/vmallocinfo --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/vmstat:/proc/vmstat --mount=\$CONTAINER_DIR/usr/local/etc/tmoe-linux/proot_proc/zoneinfo:/proc/zoneinfo /usr/bin/env -i HOSTNAME=TINY HOME=/home/tiny USER=tiny TERM=xterm-256color SDL_IM_MODULE=fcitx XMODIFIERS=@im=fcitx QT_IM_MODULE=fcitx GTK_IM_MODULE=fcitx TMOE_CHROOT=false TMOE_PROOT=true TMPDIR=/tmp MOZ_FAKE_NO_SANDBOX=1 DISPLAY=:4 PULSE_SERVER=tcp:127.0.0.1:4718 LANG=zh_CN.UTF-8 SHELL=/bin/bash PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/games:/usr/local/games /bin/bash -l", "boot":"${D.boot}",
"vnc":"startnovnc &", "vnc":"startnovnc &",
"vncUrl":"http://localhost:36082/vnc.html?host=localhost&port=36082&autoconnect=true&resize=remote&password=12345678", "vncUrl":"http://localhost:36082/vnc.html?host=localhost&port=36082&autoconnect=true&resize=remote&password=12345678",
"commands":[{"name":"检查更新并升级", "command":"sudo apt update && sudo apt upgrade -y"}, "commands":${jsonEncode(D.commands)}
{"name":"查看系统信息", "command":"neofetch -L && neofetch --off"},
{"name":"清屏", "command":"clear"},
{"name":"安装图形处理软件Krita", "command":"sudo apt update && sudo apt install -y krita krita-l10n"},
{"name":"卸载图形处理软件Krita", "command":"sudo apt autoremove --purge -y krita krita-l10n"},
{"name":"安装视频剪辑软件Kdenlive", "command":"sudo apt update && sudo apt install -y kdenlive"},
{"name":"卸载视频剪辑软件Kdenlive", "command":"sudo apt autoremove --purge -y kdenlive"},
{"name":"安装科学计算软件Octave", "command":"sudo apt update && sudo apt install -y octave"},
{"name":"卸载科学计算软件Octave", "command":"sudo apt autoremove --purge -y octave"},
{"name":"安装WPS", "command":"wget https://wps-linux-personal.wpscdn.cn/wps/download/ep/Linux2019/11704/wps-office_11.1.0.11704_arm64.deb -O /tmp/wps.deb && sudo apt update && sudo apt install -y /tmp/wps.deb; rm /tmp/wps.deb"},
{"name":"卸载WPS", "command":"sudo apt autoremove --purge -y wps-office"},
{"name":"安装CAJViewer", "command":"wget https://download.cnki.net/net.cnki.cajviewer_1.3.20-1_arm64.deb -O /tmp/caj.deb && sudo apt update && sudo apt install -y /tmp/caj.deb && bash /home/tiny/.local/share/tiny/caj/postinst; rm /tmp/caj.deb"},
{"name":"卸载CAJViewer", "command":"sudo apt autoremove --purge -y net.cnki.cajviewer && bash /home/tiny/.local/share/tiny/caj/postrm"},
{"name":"安装亿图图示", "command":"wget https://www.edrawsoft.cn/2download/aarch64/edrawmax_11.5.6-3_arm64.deb -O /tmp/edraw.deb && sudo apt update && sudo apt install -y /tmp/edraw.deb && bash /home/tiny/.local/share/tiny/edraw/postinst; rm /tmp/edraw.deb"},
{"name":"卸载亿图图示", "command":"sudo apt autoremove --purge -y edrawmax libldap-2.4-2"},
{"name":"修复无法编译C语言程序", "command":"sudo apt update && sudo apt reinstall -y libc6-dev"},
{"name":"启用回收站", "command":"sudo apt update && sudo apt install -y gvfs && echo '安装完成, 重启软件即可使用回收站。'"},
{"name":"???", "command":"timeout 8 cmatrix"}]
}"""]); }"""]);
await G.prefs.setStringList("adsBonus", []); G.updateText.value = "安装完成";
await G.prefs.setInt("adsWatchedTotal", 0);
await G.prefs.setBool("isTerminalCommandsEnabled", false);
await G.prefs.setBool("isTerminalWriteEnabled", false);
await G.prefs.setBool("isBannerAdsClosed", false);
await G.prefs.setBool("autoLaunchVnc", true);
await G.prefs.setInt("defaultAudioPort", 4718);
await G.prefs.setInt("defaultContainer", 0);
await G.prefs.setInt("termMaxLines", 4095);
await G.prefs.setDouble("termFontScale", 1);
await G.prefs.setInt("vip", 0);
await G.prefs.setBool("isStickyKey", true);
} }
static Future<void> initData() async { static Future<void> initData() async {
@@ -525,7 +672,7 @@ done
//限制一天内观看视频广告不超过5次 //限制一天内观看视频广告不超过5次
final String currentDate = DateFormat("yyyy-MM-dd").format(DateTime.now()); final String currentDate = DateFormat("yyyy-MM-dd").format(DateTime.now());
if (currentDate != G.prefs.getString("lastDate")) { if (currentDate != (Util.getGlobal("lastDate") as String)) {
await G.prefs.setString("lastDate", currentDate); await G.prefs.setString("lastDate", currentDate);
await G.prefs.setInt("adsWatchedToday", 0); await G.prefs.setInt("adsWatchedToday", 0);
} }
@@ -534,12 +681,39 @@ done
if (!G.prefs.containsKey("defaultContainer")) { if (!G.prefs.containsKey("defaultContainer")) {
await initForFirstTime(); await initForFirstTime();
} }
G.currentContainer = G.prefs.getInt("defaultContainer")!; G.currentContainer = Util.getGlobal("defaultContainer") as int;
G.termFontScale = G.prefs.getDouble("termFontScale")!; //是否需要重新安装引导包?
if (Util.getGlobal("reinstallBootstrap")) {
G.updateText.value = "正在重新安装引导包";
await setupBootstrap();
G.prefs.setBool("reinstallBootstrap", false);
}
G.termFontScale.value = Util.getGlobal("termFontScale") as double;
G.controller = WebViewController()..setJavaScriptMode(JavaScriptMode.unrestricted); G.controller = WebViewController()..setJavaScriptMode(JavaScriptMode.unrestricted);
//恢复临时开启的功能
if (Util.shouldWatchAds(D.adsRequired["changeFFmpegCommand"]!)) {
await G.prefs.remove("defaultFFmpegCommand");
}
if (Util.shouldWatchAds(D.adsRequired["changeTermMaxLines"]!)) {
await G.prefs.setInt("termMaxLines", 4095);
}
if (Util.shouldWatchAds(D.adsRequired["closeBannerAds"]!)) {
await G.prefs.setBool("isBannerAdsClosed", false);
}
if (Util.shouldWatchAds(D.adsRequired["enableTerminalWrite"]!)) {
await G.prefs.setBool("isTerminalWriteEnabled", false);
}
if (Util.shouldWatchAds(D.adsRequired["enableTerminalCommands"]!)) {
await G.prefs.setBool("isTerminalCommandsEnabled", false);
}
if (Util.shouldWatchAds(D.adsRequired["enableVirgl"]!)) {
await G.prefs.setBool("virgl", false);
}
} }
static Future<void> initTerminalForCurrent() async { static Future<void> initTerminalForCurrent() async {
@@ -565,34 +739,57 @@ done
G.audioPty = Pty.start( G.audioPty = Pty.start(
"/system/bin/sh" "/system/bin/sh"
); );
//pulseaudio也需要一个tmp文件夹这里选择前面的cache没有什么特别的原因不行再换
//pulseaudio还需要一个文件夹放配置这里用share
G.audioPty!.write(const Utf8Encoder().convert(""" G.audioPty!.write(const Utf8Encoder().convert("""
export DATA_DIR=${G.dataPath} export DATA_DIR=${G.dataPath}
cd \$DATA_DIR/.. \$DATA_DIR/busybox sed "s/4713/${Util.getGlobal("defaultAudioPort") as int}/g" \$DATA_DIR/bin/pulseaudio.conf > \$DATA_DIR/bin/pulseaudio.conf.tmp
export TMPDIR=\$PWD/cache rm -rf \$DATA_DIR/pulseaudio_tmp/*
cd \$DATA_DIR TMPDIR=\$DATA_DIR/pulseaudio_tmp HOME=\$DATA_DIR/pulseaudio_tmp XDG_CONFIG_HOME=\$DATA_DIR/pulseaudio_tmp LD_LIBRARY_PATH=\$DATA_DIR/bin \$DATA_DIR/bin/pulseaudio -F \$DATA_DIR/bin/pulseaudio.conf.tmp
export HOME=\$DATA_DIR/share
export LD_LIBRARY_PATH=\$DATA_DIR/bin
\$DATA_DIR/busybox sed "s/4713/${G.prefs.getInt("defaultAudioPort")!}/g" \$DATA_DIR/bin/pulseaudio.conf > \$DATA_DIR/bin/pulseaudio.conf.tmp
\$DATA_DIR/bin/pulseaudio -F \$DATA_DIR/bin/pulseaudio.conf.tmp
exit exit
""")); """));
await G.audioPty?.exitCode; await G.audioPty?.exitCode;
} }
static Future<void> launchCurrentContainer() async { static Future<void> launchCurrentContainer() async {
String extraMount = "";
String extraOpt = "";
if (Util.getGlobal("getifaddrsBridge")) {
Util.execute("${G.dataPath}/bin/getifaddrs_bridge_server ${G.dataPath}/containers/${G.currentContainer}/tmp/.getifaddrs-bridge");
extraOpt += "LD_PRELOAD=/home/tiny/.local/share/tiny/extra/getifaddrs_bridge_client_lib.so ";
}
if (Util.getGlobal("uos")) {
extraMount += "--mount=\$DATA_DIR/tiny/wechat/uos-lsb:/etc/lsb-release --mount=\$DATA_DIR/tiny/wechat/uos-release:/usr/lib/os-release ";
extraMount += "--mount=\$DATA_DIR/tiny/wechat/license/var/uos:/var/uos --mount=\$DATA_DIR/tiny/wechat/license/var/lib/uos-license:/var/lib/uos-license ";
}
if (Util.getGlobal("virgl")) {
Util.execute("""
export DATA_DIR=${G.dataPath}
export CONTAINER_DIR=\$DATA_DIR/containers/${G.currentContainer}
${G.dataPath}/bin/virgl_test_server ${Util.getGlobal("defaultVirglCommand")}""");
extraOpt += "${Util.getGlobal("defaultVirglOpt")} ";
}
if (Util.getGlobal("isBoxEnabled")) {
G.wasBoxEnabled = true;
extraMount += "--mount=\$DATA_DIR/tiny/cross/box86:/home/tiny/.local/bin/box86 --mount=\$DATA_DIR/tiny/cross/box64:/home/tiny/.local/bin/box64 ";
}
if (Util.getGlobal("isWineEnabled")) {
extraOpt += "BOX86_PATH=/home/tiny/.local/share/tiny/cross/wine/bin/ BOX86_LD_LIBRARY_PATH=/home/tiny/.local/share/tiny/cross/wine/lib/wine/i386-unix/:/lib/i386-linux-gnu/:/lib/aarch64-linux-gnu/:/lib/arm-linux-gnueabihf/:/usr/lib/aarch64-linux-gnu/:/usr/lib/arm-linux-gnueabihf/:/usr/lib/i386-linux-gnu/:/home/tiny/.local/share/tiny/cross/x86lib/ ";
extraOpt += "BOX64_PATH=/home/tiny/.local/share/tiny/cross/wine/bin/ BOX64_LD_LIBRARY_PATH=/home/tiny/.local/share/tiny/cross/wine/lib/wine/i386-unix/:/home/tiny/.local/share/tiny/cross/wine/lib/wine/x86_64-unix/:/lib/i386-linux-gnu/:/lib/x86_64-linux-gnu:/lib/aarch64-linux-gnu/:/lib/arm-linux-gnueabihf/:/usr/lib/aarch64-linux-gnu/:/usr/lib/arm-linux-gnueabihf/:/usr/lib/i386-linux-gnu/:/usr/lib/x86_64-linux-gnu/:/home/tiny/.local/share/tiny/cross/x64lib/ ";
extraMount += "--mount=\$DATA_DIR/tiny/cross/wine-executable:/home/tiny/.local/bin/wine --mount=\$DATA_DIR/tiny/cross/wine64-executable:/home/tiny/.local/bin/wine64 --mount=\$DATA_DIR/tiny/cross/wine64.desktop:/usr/share/applications/wine64.desktop ";
extraMount += "--mount=\$DATA_DIR/tiny/cross/winetricks64-executable:/home/tiny/.local/bin/winetricks64 --mount=\$DATA_DIR/tiny/cross/winetricks64.desktop:/usr/share/applications/winetricks64.desktop ";
}
Util.termWrite( Util.termWrite(
""" """
export DATA_DIR=${G.dataPath} export DATA_DIR=${G.dataPath}
export CONTAINER_DIR=\$DATA_DIR/containers/${G.currentContainer} export CONTAINER_DIR=\$DATA_DIR/containers/${G.currentContainer}
export PROOT_L2S_DIR=\$DATA_DIR/containers/0/.l2s export EXTRA_MOUNT="$extraMount"
export EXTRA_OPT="$extraOpt"
#export PROOT_L2S_DIR=\$DATA_DIR/containers/0/.l2s
cd \$DATA_DIR cd \$DATA_DIR
export PROOT_TMP_DIR=\$DATA_DIR/proot_tmp export PROOT_TMP_DIR=\$DATA_DIR/proot_tmp
export PROOT_LOADER=\$DATA_DIR/libexec/proot/loader export PROOT_LOADER=\$DATA_DIR/libexec/proot/loader
export PROOT_LOADER_32=\$DATA_DIR/libexec/proot/loader32 export PROOT_LOADER_32=\$DATA_DIR/libexec/proot/loader32
${Util.getCurrentProp("boot")} ${Util.getCurrentProp("boot")}
${G.prefs.getBool("autoLaunchVnc")!?Util.getCurrentProp("vnc"):""} ${(Util.getGlobal("autoLaunchVnc") as bool)?Util.getCurrentProp("vnc"):""}
clear"""); clear""");
} }
@@ -624,14 +821,16 @@ clear""");
LogicalKeyboardKey.arrowLeft, LogicalKeyboardKey.arrowLeft,
LogicalKeyboardKey.arrowRight, LogicalKeyboardKey.arrowRight,
LogicalKeyboardKey.arrowUp, LogicalKeyboardKey.arrowUp,
LogicalKeyboardKey.arrowDown LogicalKeyboardKey.arrowDown,
LogicalKeyboardKey.tab
}.contains(event.logicalKey)) { }.contains(event.logicalKey)) {
return KeyEventResult.skipRemainingHandlers; return KeyEventResult.skipRemainingHandlers;
} }
} }
return KeyEventResult.ignored; return KeyEventResult.ignored;
}, },
child: WebViewWidget(controller: G.controller), child: GestureDetector(onSecondaryTap: () {
}, child: WebViewWidget(controller: G.controller))
); );
})); }));
} }
@@ -643,7 +842,7 @@ clear""");
await initTerminalForCurrent(); await initTerminalForCurrent();
setupAudio(); setupAudio();
launchCurrentContainer(); launchCurrentContainer();
if (G.prefs.getBool("autoLaunchVnc")!) { if (Util.getGlobal("autoLaunchVnc") as bool) {
waitForConnection().then((value) => launchBrowser()); waitForConnection().then((value) => launchBrowser());
} }
} }

View File

@@ -5,11 +5,13 @@
import FlutterMacOS import FlutterMacOS
import Foundation import Foundation
import ffmpeg_kit_flutter_full_gpl
import path_provider_foundation import path_provider_foundation
import shared_preferences_foundation import shared_preferences_foundation
import url_launcher_macos import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FFmpegKitFlutterPlugin.register(with: registry.registrar(forPlugin: "FFmpegKitFlutterPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))

View File

@@ -45,10 +45,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.17.2" version: "1.18.0"
convert: convert:
dependency: transitive dependency: transitive
description: description:
@@ -81,14 +81,30 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
ffmpeg_kit_flutter_full_gpl:
dependency: "direct main"
description:
name: ffmpeg_kit_flutter_full_gpl
sha256: "4f269bcb636bfcb544e5b4d65c706a3d311839970cb42638e72406410c1b5b7b"
url: "https://pub.dev"
source: hosted
version: "6.0.3"
ffmpeg_kit_flutter_platform_interface:
dependency: transitive
description:
name: ffmpeg_kit_flutter_platform_interface
sha256: addf046ae44e190ad0101b2fde2ad909a3cd08a2a109f6106d2f7048b7abedee
url: "https://pub.dev"
source: hosted
version: "0.2.1"
file: file:
dependency: transitive dependency: transitive
description: description:
name: file name: file
sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.1.4" version: "7.0.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@@ -98,10 +114,10 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: flutter_lints name: flutter_lints
sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.3" version: "3.0.1"
flutter_pty: flutter_pty:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -124,10 +140,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: http name: http
sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" sha256: d4872660c46d929f6b8a9ef4e7a7eff7e49bbf0c4ec3f385ee32df5119175139
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.0" version: "1.1.2"
http_parser: http_parser:
dependency: transitive dependency: transitive
description: description:
@@ -148,10 +164,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: lints name: lints
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.1" version: "3.0.0"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
@@ -172,10 +188,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.9.1" version: "1.10.0"
path: path:
dependency: transitive dependency: transitive
description: description:
@@ -196,10 +212,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: path_provider_android name: path_provider_android
sha256: "6b8b19bd80da4f11ce91b2d1fb931f3006911477cec227cce23d3253d80df3f1" sha256: e595b98692943b4881b219f0a9e3945118d3c16bd7e2813f98ec6e532d905f72
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.0" version: "2.2.1"
path_provider_foundation: path_provider_foundation:
dependency: transitive dependency: transitive
description: description:
@@ -236,50 +252,58 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: permission_handler name: permission_handler
sha256: bc56bfe9d3f44c3c612d8d393bd9b174eb796d706759f9b495ac254e4294baa5 sha256: "860c6b871c94c78e202dc69546d4d8fd84bd59faeb36f8fb9888668a53ff4f78"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "10.4.5" version: "11.1.0"
permission_handler_android: permission_handler_android:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_android name: permission_handler_android
sha256: "59c6322171c29df93a22d150ad95f3aa19ed86542eaec409ab2691b8f35f9a47" sha256: "2f1bec180ee2f5665c22faada971a8f024761f632e93ddc23310487df52dcfa6"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "10.3.6" version: "12.0.1"
permission_handler_apple: permission_handler_apple:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_apple name: permission_handler_apple
sha256: "99e220bce3f8877c78e4ace901082fb29fa1b4ebde529ad0932d8d664b34f3f5" sha256: "1a816084338ada8d574b1cb48390e6e8b19305d5120fe3a37c98825bacc78306"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "9.1.4" version: "9.2.0"
permission_handler_html:
dependency: transitive
description:
name: permission_handler_html
sha256: d96ff56a757b7f04fa825c469d296c5aebc55f743e87bd639fef91a466a24da8
url: "https://pub.dev"
source: hosted
version: "0.1.0+1"
permission_handler_platform_interface: permission_handler_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_platform_interface name: permission_handler_platform_interface
sha256: f2343e9fa9c22ae4fd92d4732755bfe452214e7189afcc097380950cf567b4b2 sha256: d87349312f7eaf6ce0adaf668daf700ac5b06af84338bd8b8574dfbd93ffe1a1
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.11.5" version: "4.0.2"
permission_handler_windows: permission_handler_windows:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_windows name: permission_handler_windows
sha256: cc074aace208760f1eee6aa4fae766b45d947df85bc831cde77009cdb4720098 sha256: "1e8640c1e39121128da6b816d236e714d2cf17fac5a105dd6acdd3403a628004"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.1.3" version: "0.2.0"
platform: platform:
dependency: transitive dependency: transitive
description: description:
name: platform name: platform
sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.1.2" version: "3.1.3"
platform_info: platform_info:
dependency: transitive dependency: transitive
description: description:
@@ -292,10 +316,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: plugin_platform_interface name: plugin_platform_interface
sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.6" version: "2.1.7"
quiver: quiver:
dependency: transitive dependency: transitive
description: description:
@@ -316,10 +340,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: shared_preferences name: shared_preferences
sha256: b7f41bad7e521d205998772545de63ff4e6c97714775902c199353f8bf1511ac sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.1" version: "2.2.2"
shared_preferences_android: shared_preferences_android:
dependency: transitive dependency: transitive
description: description:
@@ -340,10 +364,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_linux name: shared_preferences_linux
sha256: c2eb5bf57a2fe9ad6988121609e47d3e07bb3bdca5b6f8444e4cf302428a128a sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.1" version: "2.3.2"
shared_preferences_platform_interface: shared_preferences_platform_interface:
dependency: transitive dependency: transitive
description: description:
@@ -356,18 +380,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_web name: shared_preferences_web
sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.1" version: "2.2.2"
shared_preferences_windows: shared_preferences_windows:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_windows name: shared_preferences_windows
sha256: f763a101313bd3be87edffe0560037500967de9c394a714cd598d945517f694f sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.1" version: "2.3.2"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@@ -385,18 +409,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.11.0" version: "1.11.1"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.1" version: "2.1.2"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
@@ -417,10 +441,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.6.0" version: "0.6.1"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
@@ -433,74 +457,74 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: unity_ads_plugin name: unity_ads_plugin
sha256: "2b19ff02089e5a0d1a6549a2cd9d2baf5f8733bdda296d947d411a293f0bffda" sha256: "75b0b87697a9601971eacd2cd37458b88cf88f062af6f21c67c9fb28a11699d9"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.3.8" version: "0.3.10"
url_launcher: url_launcher:
dependency: "direct main" dependency: "direct main"
description: description:
name: url_launcher name: url_launcher
sha256: "47e208a6711459d813ba18af120d9663c20bdf6985d6ad39fe165d2538378d27" sha256: b1c9e98774adf8820c96fbc7ae3601231d324a7d5ebd8babe27b6dfac91357ba
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.1.14" version: "6.2.1"
url_launcher_android: url_launcher_android:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_android name: url_launcher_android
sha256: b04af59516ab45762b2ca6da40fa830d72d0f6045cd97744450b73493fa76330 sha256: "31222ffb0063171b526d3e569079cf1f8b294075ba323443fdc690842bfd4def"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.1.0" version: "6.2.0"
url_launcher_ios: url_launcher_ios:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_ios name: url_launcher_ios
sha256: "7c65021d5dee51813d652357bc65b8dd4a6177082a9966bc8ba6ee477baa795f" sha256: bba3373219b7abb6b5e0d071b0fe66dfbe005d07517a68e38d4fc3638f35c6d3
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.1.5" version: "6.2.1"
url_launcher_linux: url_launcher_linux:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_linux name: url_launcher_linux
sha256: b651aad005e0cb06a01dbd84b428a301916dc75f0e7ea6165f80057fee2d8e8e sha256: "9f2d390e096fdbe1e6e6256f97851e51afc2d9c423d3432f1d6a02a8a9a8b9fd"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.6" version: "3.1.0"
url_launcher_macos: url_launcher_macos:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_macos name: url_launcher_macos
sha256: b55486791f666e62e0e8ff825e58a023fd6b1f71c49926483f1128d3bbd8fe88 sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.7" version: "3.1.0"
url_launcher_platform_interface: url_launcher_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_platform_interface name: url_launcher_platform_interface
sha256: "95465b39f83bfe95fcb9d174829d6476216f2d548b79c38ab2506e0458787618" sha256: "980e8d9af422f477be6948bdfb68df8433be71f5743a188968b0c1b887807e50"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.5" version: "2.2.0"
url_launcher_web: url_launcher_web:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_web name: url_launcher_web
sha256: "2942294a500b4fa0b918685aff406773ba0a4cd34b7f42198742a94083020ce5" sha256: "138bd45b3a456dcfafc46d1a146787424f8d2edfbf2809c9324361e58f851cf7"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.20" version: "2.2.1"
url_launcher_windows: url_launcher_windows:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_windows name: url_launcher_windows
sha256: "95fef3129dc7cfaba2bc3d5ba2e16063bb561fc6d78e63eee16162bc70029069" sha256: "7754a1ad30ee896b265f8d14078b0513a4dba28d358eabb9d5f339886f4a1adc"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.8" version: "3.1.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
@@ -513,50 +537,50 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: web name: web
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.1.4-beta" version: "0.3.0"
webview_flutter: webview_flutter:
dependency: "direct main" dependency: "direct main"
description: description:
name: webview_flutter name: webview_flutter
sha256: "82f6787d5df55907aa01e49bd9644f4ed1cc82af7a8257dd9947815959d2e755" sha256: "42393b4492e629aa3a88618530a4a00de8bb46e50e7b3993fedbfdc5352f0dbf"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.2.4" version: "4.4.2"
webview_flutter_android: webview_flutter_android:
dependency: transitive dependency: transitive
description: description:
name: webview_flutter_android name: webview_flutter_android
sha256: ddc167c6676f57c8b367d19fcbee267d6dc6adf81bd6c3cb87981d30746e0a6d sha256: "8326ee235f87605a2bfc444a4abc897f4abc78d83f054ba7d3d1074ce82b4fbf"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.10.1" version: "3.12.1"
webview_flutter_platform_interface: webview_flutter_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: webview_flutter_platform_interface name: webview_flutter_platform_interface
sha256: "6d9213c65f1060116757a7c473247c60f3f7f332cac33dc417c9e362a9a13e4f" sha256: "68e86162aa8fc646ae859e1585995c096c95fc2476881fa0c4a8d10f56013a5a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.6.0" version: "2.8.0"
webview_flutter_wkwebview: webview_flutter_wkwebview:
dependency: transitive dependency: transitive
description: description:
name: webview_flutter_wkwebview name: webview_flutter_wkwebview
sha256: "485af05f2c5f83c7f78c20e236b170ad02df7153b299ae9917345be43871d29f" sha256: accdaaa49a2aca2dc3c3230907988954cdd23fed0a19525d6c9789d380f4dc76
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.8.0" version: "3.9.4"
win32: win32:
dependency: transitive dependency: transitive
description: description:
name: win32 name: win32
sha256: "350a11abd2d1d97e0cc7a28a81b781c08002aa2864d9e3f192ca0ffa18b06ed3" sha256: "7c99c0e1e2fa190b48d25c81ca5e42036d5cac81430ef249027d97b0935c553f"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "5.0.9" version: "5.1.0"
xdg_directories: xdg_directories:
dependency: transitive dependency: transitive
description: description:
@@ -574,5 +598,5 @@ packages:
source: hosted source: hosted
version: "3.5.0" version: "3.5.0"
sdks: sdks:
dart: ">=3.1.0 <4.0.0" dart: ">=3.2.0 <4.0.0"
flutter: ">=3.13.0" flutter: ">=3.16.0"

View File

@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 1.0.8+4 version: 1.0.12+1
environment: environment:
sdk: '>=3.1.0 <4.0.0' sdk: '>=3.1.0 <4.0.0'
@@ -33,8 +33,8 @@ dependencies:
xterm: ^3.5.0 xterm: ^3.5.0
flutter_pty: ^0.4.0 flutter_pty: ^0.4.0
path_provider: ^2.1.0 path_provider: ^2.1.0
webview_flutter: ^4.2.3 webview_flutter: ^4.4.2
permission_handler: ^10.4.3 permission_handler: ^11.0.1
http: ^1.1.0 http: ^1.1.0
retry: ^3.1.2 retry: ^3.1.2
url_launcher: ^6.1.12 url_launcher: ^6.1.12
@@ -42,6 +42,7 @@ dependencies:
intl: ^0.18.1 #日期字符串转换 intl: ^0.18.1 #日期字符串转换
unity_ads_plugin: ^0.3.8 unity_ads_plugin: ^0.3.8
clipboard: ^0.1.3 clipboard: ^0.1.3
ffmpeg_kit_flutter_full_gpl: ^6.0.3
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
@@ -57,7 +58,7 @@ dev_dependencies:
# activated in the `analysis_options.yaml` file located at the root of your # activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint # package. See that file for information about deactivating specific lint
# rules and activating additional ones. # rules and activating additional ones.
flutter_lints: ^2.0.0 flutter_lints: ^3.0.1
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec

BIN
readme/img1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
readme/img2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

BIN
readme/img3.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 MiB

BIN
readme/img4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

BIN
readme/img5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 KiB