mirror of
https://github.com/Cateners/tiny_computer.git
synced 2026-05-21 00:45:49 +08:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0971059111 | ||
|
|
2cf19179f9 | ||
|
|
b6d4d2f11b | ||
|
|
5a6f04d094 | ||
|
|
195a2f50a3 | ||
|
|
16a14c8a3e | ||
|
|
f15899be95 | ||
|
|
27a5073551 | ||
|
|
b4ca9ae4f7 | ||
|
|
2ef590beb7 | ||
|
|
e6555b2166 | ||
|
|
bba56cc0ca | ||
|
|
f9d5818b91 |
39
README.md
39
README.md
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
<img decoding="async" src="readme/cover0.png" width="50%">
|
<img decoding="async" src="readme/cover0.png" width="50%">
|
||||||
|
|
||||||
即开即用的类PC环境,内置WPS、火狐浏览器、VS Code等常用软件
|
即开即用的类PC环境,内置火狐浏览器和fcitx输入法等常用软件
|
||||||
|
|
||||||
Click-to-run ubuntu jammy xfce on android for Chinese users, with fcitx pinyin input method and wps office preinstalled. No termux required.
|
Click-to-run debian bookworm xfce on android for Chinese users, with fcitx pinyin input method preinstalled. No termux required.
|
||||||
|
|
||||||
## 原理
|
## 原理
|
||||||
|
|
||||||
使用proot运行ubuntu环境
|
使用proot运行debian环境
|
||||||
|
|
||||||
内置[noVNC](https://github.com/novnc/noVNC)显示图形界面
|
内置[noVNC](https://github.com/novnc/noVNC)显示图形界面
|
||||||
|
|
||||||
@@ -21,42 +21,39 @@ Click-to-run ubuntu jammy xfce on android for Chinese users, with fcitx pinyin i
|
|||||||
|
|
||||||
assets的文件来源如下:
|
assets的文件来源如下:
|
||||||
|
|
||||||
- [proot](https://github.com/termux/proot/), 使用[build-proot-android](https://github.com/green-green-avk/build-proot-android)脚本编译
|
- [proot](https://github.com/Cateners/proot), 使用[build-proot-android](https://github.com/green-green-avk/build-proot-android)脚本编译
|
||||||
- [busybox](https://github.com/meefik/busybox)
|
- [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)
|
- [Xserver XSDL, pulseaudio相关文件](https://github.com/pelya/commandergenius/tree/sdl_android/project/jni/application/xserver)
|
||||||
- [proot-distro, ubuntu包来源](https://github.com/termux/proot-distro)
|
- [Tmoe Linux, debian包来源](https://github.com/2moe/tmoe)
|
||||||
|
|
||||||
其中busybox和pulseaudio相关文件都是直接用了二进制文件。
|
其中tar、busybox和pulseaudio相关文件都是直接用了二进制文件。
|
||||||
|
|
||||||
(pulseaudio我真的编译不来,如果你会的话请教教我吧)
|
对debian容器进行了如下修改:
|
||||||
|
- 使用tmoe安装了xfce环境和全套VNC;
|
||||||
对ubuntu容器进行了如下修改:
|
|
||||||
- 安装了xfce环境、tigerVNC、noVNC;
|
|
||||||
- 使用kali-undercover提供的Win10主题美化xfce;
|
- 使用kali-undercover提供的Win10主题美化xfce;
|
||||||
- 安装了wps office, 对wps office进行了如下修改:
|
- (使用tmoe)安装了fcitx输入法和云拼音组件。按<Ctrl+空格>切换输入法。
|
||||||
- 界面改成了多组件,避免无法打开wps;
|
|
||||||
- 补上了缺失的字体;
|
|
||||||
- 安装了VS Code和中文插件;
|
|
||||||
- 安装了fcitx输入法和云拼音组件。按<Ctrl+空格>切换输入法。
|
|
||||||
- 强烈建议**不要**使用安卓中文输入法直接输入中文,而是使用英文键盘通过容器的输入法输入中文,避免丢字错字。
|
- 强烈建议**不要**使用安卓中文输入法直接输入中文,而是使用英文键盘通过容器的输入法输入中文,避免丢字错字。
|
||||||
- 对noVNC进行[修改](https://github.com/Cateners/noVNC) (scale_factor分支),添加了scale factor滑块控制缩放
|
- 对noVNC进行[修改](https://github.com/Cateners/noVNC),添加了scale factor滑块控制缩放(scale_factor分支),添加了上下左右shift等按键(arrow_key分支),添加了强制显示原系统光标的功能(force_cursor分支),添加了中文翻译(translation_zh_cn分支);
|
||||||
- 在主目录下提供storage文件夹,通过此文件夹可以方便地访问手机存储(如果提供了存储权限的话)
|
- 在主目录下可以方便地访问手机存储(如果提供了存储权限的话);
|
||||||
- 启动时会尝试挂载手机的一些字体目录(AppFiles/Fonts、Fonts和/system/fonts), 如果这些目录下有字体文件的话会一并加载到系统中,无需额外安装
|
- 启动时会尝试挂载手机的一些字体目录(AppFiles/Fonts、Fonts和/system/fonts), 如果这些目录下有字体文件的话会一并加载到系统中,无需额外安装;
|
||||||
- 最后采用tar.xz压缩,用split命令分成了xa*等多个文件
|
- 最后采用tar.xz压缩,用split命令分成了xa*等多个文件(低内存设备一次性拷贝大文件会导致软件闪退)。
|
||||||
|
|
||||||
数据包不再在assets中更新,而是随releases提供,主要是为了避免git越来越大
|
数据包不再在assets中更新,而是随releases提供,主要是为了避免git越来越大
|
||||||
|
|
||||||
lib目录:
|
lib目录:
|
||||||
|
|
||||||
- main.dart文件,页面布局,老实说已经有点乱了
|
- main.dart文件,页面布局,老实说已经有点乱了
|
||||||
- workflow.dart文件,逻辑部分,目前也还算简单
|
- workflow.dart文件,逻辑部分,目前也还可以理解
|
||||||
- Util 工具类
|
- Util 工具类
|
||||||
|
- TermPty 一个终端
|
||||||
- G 全局变量类
|
- G 全局变量类
|
||||||
- Workflow 从软件点开到容器启动的所有步骤
|
- Workflow 从软件点开到容器启动的所有步骤
|
||||||
|
|
||||||
## 目前已知bug
|
## 目前已知bug
|
||||||
|
|
||||||
多用户/分身情形无法使用apt, 其它见issue
|
多用户/分身情形无法sudo, 其它见issue
|
||||||
|
|
||||||
## 一些链接
|
## 一些链接
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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.
Binary file not shown.
|
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 163 KiB |
1008
lib/main.dart
1008
lib/main.dart
File diff suppressed because it is too large
Load Diff
@@ -28,6 +28,7 @@ import 'package:retry/retry.dart';
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import 'package:webview_flutter/webview_flutter.dart';
|
import 'package:webview_flutter/webview_flutter.dart';
|
||||||
|
|
||||||
import 'package:xterm/xterm.dart';
|
import 'package:xterm/xterm.dart';
|
||||||
@@ -40,6 +41,8 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||||||
|
|
||||||
import 'package:unity_ads_plugin/unity_ads_plugin.dart';
|
import 'package:unity_ads_plugin/unity_ads_plugin.dart';
|
||||||
|
|
||||||
|
import 'package:clipboard/clipboard.dart';
|
||||||
|
|
||||||
class Util {
|
class Util {
|
||||||
|
|
||||||
static Future<void> copyAsset(String src, String dst) async {
|
static Future<void> copyAsset(String src, String dst) async {
|
||||||
@@ -65,16 +68,65 @@ class Util {
|
|||||||
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 默认推流命令
|
||||||
|
//? 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}
|
||||||
|
//String[] customMounts: 自定义挂载地址(json)
|
||||||
|
//{name: "xxx", path: "xxx", isEnabled: true}
|
||||||
|
//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 "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 -i 0:0 -vf scale=iw/2:-1 -rtsp_transport udp -f rtsp rtsp://127.0.0.1:8554/stream");
|
||||||
|
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>());
|
||||||
|
case "customMounts" : 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))]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -98,19 +150,96 @@ class Util {
|
|||||||
//由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"]}}""");
|
||||||
}
|
}
|
||||||
await G.prefs.setStringList("adsBonus", ret);
|
await G.prefs.setStringList("adsBonus", ret);
|
||||||
print(G.prefs.getStringList("adsBonus")!);
|
}
|
||||||
|
|
||||||
|
//根据已看广告量判断是否应该继续看广告
|
||||||
|
static bool shouldWatchAds(int expectNum) {
|
||||||
|
return ((Util.getGlobal("adsWatchedTotal") as int) < expectNum) && ((Util.getGlobal("vip") as int) < 1) && ((Util.getGlobal("adsWatchedToday") as int) < G.adsRequired["unlockToday"]!) && (G.adsWatchedThisTime < G.adsRequired["unlockOnce"]!);
|
||||||
|
}
|
||||||
|
|
||||||
|
//限定字符串在min和max之间, 给文本框的validator
|
||||||
|
static String? validateBetween(String? value, int min, int max, Function opr) {
|
||||||
|
if (value == null || value.isEmpty) {
|
||||||
|
return "请输入数字";
|
||||||
|
}
|
||||||
|
int? parsedValue = int.tryParse(value);
|
||||||
|
if (parsedValue == null) {
|
||||||
|
return "请输入有效的数字";
|
||||||
|
}
|
||||||
|
if (parsedValue < min || parsedValue > max) {
|
||||||
|
return "请输入$min到$max之间的数字";
|
||||||
|
}
|
||||||
|
opr();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//来自xterms关于操作ctrl, shift, alt键的示例
|
||||||
|
//这个类应该只能有一个实例G.keyboard
|
||||||
|
class VirtualKeyboard extends TerminalInputHandler with ChangeNotifier {
|
||||||
|
final TerminalInputHandler _inputHandler;
|
||||||
|
|
||||||
|
VirtualKeyboard(this._inputHandler);
|
||||||
|
|
||||||
|
bool _ctrl = false;
|
||||||
|
|
||||||
|
bool get ctrl => _ctrl;
|
||||||
|
|
||||||
|
set ctrl(bool value) {
|
||||||
|
if (_ctrl != value) {
|
||||||
|
_ctrl = value;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool _shift = false;
|
||||||
|
|
||||||
|
bool get shift => _shift;
|
||||||
|
|
||||||
|
set shift(bool value) {
|
||||||
|
if (_shift != value) {
|
||||||
|
_shift = value;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool _alt = false;
|
||||||
|
|
||||||
|
bool get alt => _alt;
|
||||||
|
|
||||||
|
set alt(bool value) {
|
||||||
|
if (_alt != value) {
|
||||||
|
_alt = value;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String? call(TerminalKeyboardEvent event) {
|
||||||
|
final ret = _inputHandler.call(event.copyWith(
|
||||||
|
ctrl: event.ctrl || _ctrl,
|
||||||
|
shift: event.shift || _shift,
|
||||||
|
alt: event.alt || _alt,
|
||||||
|
));
|
||||||
|
G.maybeCtrlJ = event.key.name == "keyJ";
|
||||||
|
if (!(Util.getGlobal("isStickyKey") as bool)) {
|
||||||
|
G.keyboard.ctrl = false;
|
||||||
|
G.keyboard.shift = false;
|
||||||
|
G.keyboard.alt = false;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +249,7 @@ class TermPty {
|
|||||||
late final Pty pty;
|
late final Pty pty;
|
||||||
|
|
||||||
TermPty() {
|
TermPty() {
|
||||||
terminal = Terminal();
|
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,
|
||||||
@@ -136,19 +265,30 @@ class TermPty {
|
|||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
SystemChannels.platform.invokeMethod("SystemNavigator.pop");
|
SystemChannels.platform.invokeMethod("SystemNavigator.pop");
|
||||||
}
|
}
|
||||||
//TODO: Singal 9 hint, 改成对话框
|
//TODO: Signal 9 hint, 改成对话框?
|
||||||
if (code == -9) {
|
if (code == -9) {
|
||||||
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);
|
||||||
return const Scaffold(backgroundColor: Colors.deepPurple,
|
const String helperLink = "https://www.vmos.cn/zhushou.htm";
|
||||||
|
return Scaffold(backgroundColor: Colors.deepPurple,
|
||||||
body: Center(
|
body: Center(
|
||||||
child: Scrollbar(child:
|
child: Scrollbar(child:
|
||||||
SingleChildScrollView(
|
SingleChildScrollView(
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
Text("发生了什么?", textScaleFactor: 2, style: ts, textAlign: TextAlign.center,),
|
const Text(":(\n发生了什么?", textScaleFactor: 2, style: ts, textAlign: TextAlign.center,),
|
||||||
Text("终端异常退出, 返回错误码9\n此错误通常是高版本安卓系统(12+)限制进程造成的, \n可以使用以下工具修复:", style: ts, textAlign: TextAlign.center),
|
const Text("终端异常退出, 返回错误码9\n此错误通常是高版本安卓系统(12+)限制进程造成的, \n可以使用以下工具修复:", style: ts, textAlign: TextAlign.center),
|
||||||
SelectableText("https://www.vmos.cn/zhushou.htm", style: ts, textAlign: TextAlign.center),
|
const SelectableText(helperLink, style: ts, textAlign: TextAlign.center),
|
||||||
Text("(复制链接到浏览器查看)", style: ts, textAlign: TextAlign.center),
|
const Text("(复制链接到浏览器查看)", style: ts, textAlign: TextAlign.center),
|
||||||
|
OutlinedButton(onPressed: () {
|
||||||
|
FlutterClipboard.copy(helperLink).then(( value ) {
|
||||||
|
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(content: const Text("已复制"), action: SnackBarAction(label: "跳转", onPressed: () {
|
||||||
|
launchUrl(Uri.parse(helperLink), mode: LaunchMode.externalApplication);
|
||||||
|
},))
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}, child: const Text("复制", style: ts, textAlign: TextAlign.center))
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -157,9 +297,18 @@ class TermPty {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
terminal.onOutput = (data) {
|
terminal.onOutput = (data) {
|
||||||
if (G.prefs.getBool("isTerminalWriteEnabled")!) {
|
if (!(Util.getGlobal("isTerminalWriteEnabled") as bool)) {
|
||||||
pty.write(const Utf8Encoder().convert(data));
|
return;
|
||||||
}
|
}
|
||||||
|
//由于对回车的处理似乎存在问题,所以拿出来单独处理
|
||||||
|
data.split("").forEach((element) {
|
||||||
|
if (element == "\n" && !G.maybeCtrlJ) {
|
||||||
|
terminal.keyInput(TerminalKey.enter);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
G.maybeCtrlJ = false;
|
||||||
|
pty.write(const Utf8Encoder().convert(element));
|
||||||
|
});
|
||||||
};
|
};
|
||||||
terminal.onResize = (w, h, pw, ph) {
|
terminal.onResize = (w, h, pw, ph) {
|
||||||
pty.resize(h, w);
|
pty.resize(h, w);
|
||||||
@@ -168,6 +317,34 @@ class TermPty {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//default values
|
||||||
|
class D {
|
||||||
|
//默认快捷指令
|
||||||
|
static const commands = [{"name":"检查更新并升级", "command":"sudo apt update && sudo apt upgrade -y"},
|
||||||
|
{"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":"安装QQ", "command":"wget https://dldir1.qq.com/qqfile/qq/QQNT/b69de82d/linuxqq_3.2.1-17153_arm64.deb -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":"修复无法编译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"}];
|
||||||
|
}
|
||||||
|
|
||||||
// Global variables
|
// Global variables
|
||||||
class G {
|
class G {
|
||||||
static late final String dataPath;
|
static late final String dataPath;
|
||||||
@@ -176,7 +353,16 @@ class G {
|
|||||||
static late BuildContext homePageStateContext;
|
static late BuildContext homePageStateContext;
|
||||||
static late int currentContainer; //目前运行第几个容器
|
static late int currentContainer; //目前运行第几个容器
|
||||||
static late Map<int, TermPty> termPtys; //为容器<int>存放TermPty数据
|
static late Map<int, TermPty> termPtys; //为容器<int>存放TermPty数据
|
||||||
static late AdManager ads;//广告实例
|
static late AdManager ads; //广告实例
|
||||||
|
static late VirtualKeyboard keyboard; //存储ctrl, shift, alt状态
|
||||||
|
static bool maybeCtrlJ = false; //为了区分按下的ctrl+J和enter而准备的变量
|
||||||
|
static double termFontScale = 1; //终端字体大小,存储为G.prefs的termFontScale
|
||||||
|
static int adsWatchedThisTime = 0; //本次启动应用看的广告数
|
||||||
|
static bool isStreamServerStarted = false;
|
||||||
|
static bool isStreaming = false;
|
||||||
|
static int? streamingId;
|
||||||
|
static String streamingOutput = "";
|
||||||
|
static late Pty streamServerPty;
|
||||||
|
|
||||||
|
|
||||||
//看广告可以获得的奖励。
|
//看广告可以获得的奖励。
|
||||||
@@ -192,24 +378,20 @@ 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 = {
|
||||||
//String defaultAudioPort = 4713: 默认pulseaudio端口(为了避免和其它软件冲突改成4718了) !!!注意!这个值是String类型
|
"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
|
|
||||||
//bool bannerAdsCanBeClosed = false 看一次视频广告永久开启,历史遗留
|
"unlockOnce" : 1, //临时解锁需要看的广告数
|
||||||
//bool isTerminalWriteEnabled = false
|
"unlockToday" : 2, //当日解锁需要看的广告数
|
||||||
//bool terminalWriteCanBeEnabled = false 看一次视频广告永久开启,历史遗留
|
|
||||||
//? 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;
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
static late SharedPreferences prefs;
|
||||||
}
|
}
|
||||||
|
|
||||||
class AdManager {
|
class AdManager {
|
||||||
@@ -229,16 +411,16 @@ class AdManager {
|
|||||||
UnityAds.load(
|
UnityAds.load(
|
||||||
placementId: placementId,
|
placementId: placementId,
|
||||||
onComplete: (placementId) {
|
onComplete: (placementId) {
|
||||||
print('Load Complete $placementId');
|
debugPrint('Load Complete $placementId');
|
||||||
placements[placementId] = true;
|
placements[placementId] = true;
|
||||||
},
|
},
|
||||||
onFailed: (placementId, error, message) => print('Load Failed $placementId: $error $message'),
|
onFailed: (placementId, error, message) => debugPrint('Load Failed $placementId: $error $message'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
@@ -247,20 +429,21 @@ class AdManager {
|
|||||||
UnityAds.showVideoAd(
|
UnityAds.showVideoAd(
|
||||||
placementId: placementId,
|
placementId: placementId,
|
||||||
onComplete: (placementId) async {
|
onComplete: (placementId) async {
|
||||||
print('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) {
|
||||||
print('Video Ad $placementId failed: $error $message');
|
debugPrint('Video Ad $placementId failed: $error $message');
|
||||||
loadAd(placementId);
|
loadAd(placementId);
|
||||||
},
|
},
|
||||||
onStart: (placementId) => print('Video Ad $placementId started'),
|
onStart: (placementId) => debugPrint('Video Ad $placementId started'),
|
||||||
onClick: (placementId) => print('Video Ad $placementId click'),
|
onClick: (placementId) => debugPrint('Video Ad $placementId click'),
|
||||||
onSkipped: (placementId) {
|
onSkipped: (placementId) {
|
||||||
print('Video Ad $placementId skipped');
|
debugPrint('Video Ad $placementId skipped');
|
||||||
loadAd(placementId);
|
loadAd(placementId);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -287,7 +470,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 {
|
||||||
@@ -298,7 +481,7 @@ class Workflow {
|
|||||||
//给proot的tmp文件夹,虽然我不知道为什么proot要这个
|
//给proot的tmp文件夹,虽然我不知道为什么proot要这个
|
||||||
Util.createDirFromString("${G.dataPath}/proot_tmp");
|
Util.createDirFromString("${G.dataPath}/proot_tmp");
|
||||||
//解压后得到bin文件夹和libexec文件夹
|
//解压后得到bin文件夹和libexec文件夹
|
||||||
//bin存放了proot和pulseaudio
|
//bin存放了proot, pulseaudio, tar等
|
||||||
//libexec存放了proot loader
|
//libexec存放了proot loader
|
||||||
await Util.copyAsset(
|
await Util.copyAsset(
|
||||||
"assets/assets.zip",
|
"assets/assets.zip",
|
||||||
@@ -332,8 +515,8 @@ ln -s \$DATA_DIR/busybox \$DATA_DIR/bin/xz
|
|||||||
//这个是容器rootfs,被split命令分成了xa*
|
//这个是容器rootfs,被split命令分成了xa*
|
||||||
//首次启动,就用这个,别让用户另选了
|
//首次启动,就用这个,别让用户另选了
|
||||||
//TODO: 这个字符串列表太丑陋了
|
//TODO: 这个字符串列表太丑陋了
|
||||||
//for (String name in ["xaa", "xab", "xac", "xad", "xae", "xaf", "xag", "xah", "xai", "xaj", "xak", "xal", "xam", "xan"]) {
|
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", "xak", "xal", "xam"]) {
|
//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
|
||||||
@@ -346,8 +529,8 @@ 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 -H 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"
|
||||||
echo "aid_\$(id -un):x:\$(id -u):\$(id -g):Termux:/:/sbin/nologin" >> "\$CONTAINER_DIR/etc/passwd"
|
echo "aid_\$(id -un):x:\$(id -u):\$(id -g):Termux:/:/sbin/nologin" >> "\$CONTAINER_DIR/etc/passwd"
|
||||||
@@ -366,35 +549,25 @@ done
|
|||||||
""");
|
""");
|
||||||
//一些数据初始化
|
//一些数据初始化
|
||||||
//$DATA_DIR是数据文件夹, $CONTAINER_DIR是容器根目录
|
//$DATA_DIR是数据文件夹, $CONTAINER_DIR是容器根目录
|
||||||
//容器根目录会有一个fake-proc文件夹存放一些假的proc文件供挂载
|
|
||||||
//"boot":"\$DATA_DIR/bin/proot --link2symlink -H --kill-on-exit --tcsetsf2tcsetsw --root-id --pwd=/root --rootfs=\$CONTAINER_DIR -L --kernel-release=6.2.1-PRoot-Distro --bind=\$DATA_DIR/tmp:/dev/shm --bind=/sys --bind=/proc/self/fd/2:/dev/stderr --bind=/proc/self/fd/1:/dev/stdout --bind=/proc/self/fd/0:/dev/stdin --bind=/proc/self/fd:/dev/fd --bind=/proc --bind=/dev/urandom:/dev/random --bind=/dev --bind=\$CONTAINER_DIR/fake-proc/.loadavg:/proc/loadavg --bind=\$CONTAINER_DIR/fake-proc/.stat:/proc/stat --bind=\$CONTAINER_DIR/fake-proc/.uptime:/proc/uptime --bind=\$CONTAINER_DIR/fake-proc/.version:/proc/version --bind=\$CONTAINER_DIR/fake-proc/.vmstat:/proc/vmstat --bind=\$CONTAINER_DIR/fake-proc/.sysctl_entry_cap_last_cap:/proc/sys/kernel/cap_last_cap /usr/bin/env -i HOME=/root USER=root TERM=xterm-256color SDL_IM_MODULE=fcitx XMODIFIERS=\\\\@im=fcitx QT_IM_MODULE=fcitx GTK_IM_MODULE=fcitx TMPDIR=/tmp 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",
|
|
||||||
await G.prefs.setStringList("containersInfo", ["""{
|
await G.prefs.setStringList("containersInfo", ["""{
|
||||||
"name":"Ubuntu Jammy",
|
"name":"Debian Bookworm",
|
||||||
"boot":"\$DATA_DIR/bin/proot --link2symlink --ashmem-memfd --sysvipc -H --kill-on-exit --root-id --pwd=/root --rootfs=\$CONTAINER_DIR -L --kernel-release=6.2.1-PRoot-Distro --mount=\$DATA_DIR/share:/media/share --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:/media/storage/shared --mount=/storage/self/primary/Pictures:/media/storage/Pictures --mount=/storage/self/primary/Music:/media/storage/Music --mount=/storage/self/primary/Movies:/media/storage/Movies --mount=/storage/self/primary/Download:/media/storage/Download --mount=/storage/self/primary/DCIM:/media/storage/DCIM --mount=/storage/self/primary/Documents:/media/storage/Documents --bind=\$DATA_DIR/tmp:/dev/shm --bind=/sys --bind=/proc/self/fd/2:/dev/stderr --bind=/proc/self/fd/1:/dev/stdout --bind=/proc/self/fd/0:/dev/stdin --bind=/proc/self/fd:/dev/fd --bind=/proc --bind=/dev/urandom:/dev/random --bind=/dev --bind=\$CONTAINER_DIR/fake-proc/.loadavg:/proc/loadavg --bind=\$CONTAINER_DIR/fake-proc/.stat:/proc/stat --bind=\$CONTAINER_DIR/fake-proc/.uptime:/proc/uptime --bind=\$CONTAINER_DIR/fake-proc/.version:/proc/version --bind=\$CONTAINER_DIR/fake-proc/.vmstat:/proc/vmstat --bind=\$CONTAINER_DIR/fake-proc/.sysctl_entry_cap_last_cap:/proc/sys/kernel/cap_last_cap /usr/bin/env -i HOME=/root USER=root TERM=xterm-256color SDL_IM_MODULE=fcitx XMODIFIERS=\\\\@im=fcitx QT_IM_MODULE=fcitx GTK_IM_MODULE=fcitx TMPDIR=/tmp 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":"\$DATA_DIR/bin/proot -H --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-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 /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",
|
||||||
"vnc":"tigervncserver :4 -SecurityTypes none && .local/share/noVNC/utils/novnc_proxy --vnc localhost:5904 --listen localhost:36082 &",
|
"vnc":"startnovnc &",
|
||||||
"vncUrl":"http://localhost:36082/vnc.html?host=localhost&port=36082&autoconnect=true&resize=remote",
|
"vncUrl":"http://localhost:36082/vnc.html?host=localhost&port=36082&autoconnect=true&resize=remote&password=12345678",
|
||||||
"commands":[{"name":"检查更新并升级", "command":"apt update && apt upgrade -y"},
|
"commands":${jsonEncode(D.commands)}
|
||||||
{"name":"查看系统信息", "command":"uname -a"},
|
|
||||||
{"name":"清屏", "command":"clear"},
|
|
||||||
{"name":"安装图形处理软件Krita", "command":"apt update && apt install -y krita krita-l10n"},
|
|
||||||
{"name":"卸载图形处理软件Krita", "command":"apt autoremove --purge -y krita krita-l10n"},
|
|
||||||
{"name":"安装视频剪辑软件Kdenlive", "command":"apt update && apt install -y kdenlive"},
|
|
||||||
{"name":"卸载视频剪辑软件Kdenlive", "command":"apt autoremove --purge -y kdenlive"},
|
|
||||||
{"name":"安装科学计算软件Octave", "command":"apt update && apt install -y octave"},
|
|
||||||
{"name":"卸载科学计算软件Octave", "command":"apt autoremove --purge -y octave"},
|
|
||||||
{"name":"???", "command":"timeout 8 /root/.local/bin/cmatrix"}]
|
|
||||||
}"""]);
|
}"""]);
|
||||||
await G.prefs.setStringList("adsBonus", []);
|
// await G.prefs.setStringList("adsBonus", []);
|
||||||
await G.prefs.setInt("adsWatchedTotal", 0);
|
// await G.prefs.setInt("adsWatchedTotal", 0);
|
||||||
//await G.prefs.setBool("terminalWriteCanBeEnabled", false);
|
// await G.prefs.setBool("isTerminalCommandsEnabled", false);
|
||||||
//G.prefs.setBool("isTerminalWriteEnabled", false);
|
// await G.prefs.setBool("isTerminalWriteEnabled", false);
|
||||||
await G.prefs.setBool("isTerminalWriteEnabled", false);
|
// await G.prefs.setBool("isBannerAdsClosed", false);
|
||||||
//await G.prefs.setBool("bannerAdsCanBeClosed", false);
|
// await G.prefs.setBool("autoLaunchVnc", true);
|
||||||
await G.prefs.setBool("isBannerAdsClosed", false);
|
// await G.prefs.setInt("defaultAudioPort", 4718);
|
||||||
//G.prefs.setBool("autoLaunchVnc", true);
|
// await G.prefs.setInt("defaultContainer", 0);
|
||||||
await G.prefs.setBool("autoLaunchVnc", true);
|
// await G.prefs.setInt("termMaxLines", 4095);
|
||||||
await G.prefs.setString("defaultAudioPort", "4718");
|
// await G.prefs.setDouble("termFontScale", 1);
|
||||||
await G.prefs.setInt("defaultContainer", 0);
|
// await G.prefs.setInt("vip", 0);
|
||||||
|
// await G.prefs.setBool("isStickyKey", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<void> initData() async {
|
static Future<void> initData() async {
|
||||||
@@ -402,12 +575,14 @@ done
|
|||||||
G.dataPath = (await getApplicationSupportDirectory()).path;
|
G.dataPath = (await getApplicationSupportDirectory()).path;
|
||||||
|
|
||||||
G.termPtys = {};
|
G.termPtys = {};
|
||||||
|
|
||||||
|
G.keyboard = VirtualKeyboard(defaultInputHandler);
|
||||||
|
|
||||||
G.prefs = await SharedPreferences.getInstance();
|
G.prefs = await SharedPreferences.getInstance();
|
||||||
|
|
||||||
//限制一天内观看视频广告不超过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);
|
||||||
}
|
}
|
||||||
@@ -416,10 +591,29 @@ 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 = Util.getGlobal("termFontScale") as double;
|
||||||
|
|
||||||
G.controller = WebViewController()..setJavaScriptMode(JavaScriptMode.unrestricted);
|
G.controller = WebViewController()..setJavaScriptMode(JavaScriptMode.unrestricted);
|
||||||
|
|
||||||
|
//恢复临时开启的功能
|
||||||
|
if (Util.shouldWatchAds(G.adsRequired["changeFFmpegCommand"]!)) {
|
||||||
|
await G.prefs.remove("defaultFFmpegCommand");
|
||||||
|
}
|
||||||
|
if (Util.shouldWatchAds(G.adsRequired["changeTermMaxLines"]!)) {
|
||||||
|
await G.prefs.setInt("termMaxLines", 4095);
|
||||||
|
}
|
||||||
|
if (Util.shouldWatchAds(G.adsRequired["closeBannerAds"]!)) {
|
||||||
|
await G.prefs.setBool("isBannerAdsClosed", false);
|
||||||
|
}
|
||||||
|
if (Util.shouldWatchAds(G.adsRequired["enableTerminalWrite"]!)) {
|
||||||
|
await G.prefs.setBool("isTerminalWriteEnabled", false);
|
||||||
|
}
|
||||||
|
if (Util.shouldWatchAds(G.adsRequired["enableTerminalCommands"]!)) {
|
||||||
|
await G.prefs.setBool("isTerminalCommandsEnabled", false);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<void> initTerminalForCurrent() async {
|
static Future<void> initTerminalForCurrent() async {
|
||||||
@@ -431,12 +625,12 @@ done
|
|||||||
static Future<void> initAds() async {
|
static Future<void> initAds() async {
|
||||||
UnityAds.init(
|
UnityAds.init(
|
||||||
gameId: AdManager.gameId,
|
gameId: AdManager.gameId,
|
||||||
testMode: true,
|
testMode: false,
|
||||||
onComplete: () {
|
onComplete: () {
|
||||||
print('Initialization Complete');
|
debugPrint('Initialization Complete');
|
||||||
AdManager.loadAds();
|
AdManager.loadAds();
|
||||||
},
|
},
|
||||||
onFailed: (error, message) => print('Initialization Failed: $error $message'),
|
onFailed: (error, message) => debugPrint('Initialization Failed: $error $message'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -454,7 +648,7 @@ export TMPDIR=\$PWD/cache
|
|||||||
cd \$DATA_DIR
|
cd \$DATA_DIR
|
||||||
export HOME=\$DATA_DIR/share
|
export HOME=\$DATA_DIR/share
|
||||||
export LD_LIBRARY_PATH=\$DATA_DIR/bin
|
export LD_LIBRARY_PATH=\$DATA_DIR/bin
|
||||||
\$DATA_DIR/busybox sed "s/4713/${G.prefs.getString("defaultAudioPort")!}/g" \$DATA_DIR/bin/pulseaudio.conf > \$DATA_DIR/bin/pulseaudio.conf.tmp
|
\$DATA_DIR/busybox sed "s/4713/${Util.getGlobal("defaultAudioPort") as int}/g" \$DATA_DIR/bin/pulseaudio.conf > \$DATA_DIR/bin/pulseaudio.conf.tmp
|
||||||
\$DATA_DIR/bin/pulseaudio -F \$DATA_DIR/bin/pulseaudio.conf.tmp
|
\$DATA_DIR/bin/pulseaudio -F \$DATA_DIR/bin/pulseaudio.conf.tmp
|
||||||
exit
|
exit
|
||||||
"""));
|
"""));
|
||||||
@@ -466,13 +660,13 @@ exit
|
|||||||
"""
|
"""
|
||||||
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 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""");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -523,7 +717,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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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"))
|
||||||
|
|||||||
139
pubspec.lock
139
pubspec.lock
@@ -25,6 +25,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.3.0"
|
||||||
|
clipboard:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: clipboard
|
||||||
|
sha256: "2ec38f0e59878008ceca0ab122e4bfde98847f88ef0f83331362ba4521f565a9"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.1.3"
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -73,6 +81,22 @@ 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:
|
||||||
@@ -90,10 +114,10 @@ packages:
|
|||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: flutter_lints
|
name: flutter_lints
|
||||||
sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4"
|
sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.2"
|
version: "2.0.3"
|
||||||
flutter_pty:
|
flutter_pty:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -180,66 +204,66 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: path_provider
|
name: path_provider
|
||||||
sha256: "909b84830485dbcd0308edf6f7368bc8fd76afa26a270420f34cabea2a6467a0"
|
sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.1"
|
||||||
path_provider_android:
|
path_provider_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_android
|
name: path_provider_android
|
||||||
sha256: "5d44fc3314d969b84816b569070d7ace0f1dea04bd94a83f74c4829615d22ad8"
|
sha256: "6b8b19bd80da4f11ce91b2d1fb931f3006911477cec227cce23d3253d80df3f1"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.2.0"
|
||||||
path_provider_foundation:
|
path_provider_foundation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_foundation
|
name: path_provider_foundation
|
||||||
sha256: "1b744d3d774e5a879bb76d6cd1ecee2ba2c6960c03b1020cd35212f6aa267ac5"
|
sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.0"
|
version: "2.3.1"
|
||||||
path_provider_linux:
|
path_provider_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_linux
|
name: path_provider_linux
|
||||||
sha256: ba2b77f0c52a33db09fc8caf85b12df691bf28d983e84cf87ff6d693cfa007b3
|
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.0"
|
version: "2.2.1"
|
||||||
path_provider_platform_interface:
|
path_provider_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_platform_interface
|
name: path_provider_platform_interface
|
||||||
sha256: bced5679c7df11190e1ddc35f3222c858f328fff85c3942e46e7f5589bf9eb84
|
sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.1"
|
||||||
path_provider_windows:
|
path_provider_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_windows
|
name: path_provider_windows
|
||||||
sha256: ee0e0d164516b90ae1f970bdf29f726f1aa730d7cfc449ecc74c495378b705da
|
sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.0"
|
version: "2.2.1"
|
||||||
permission_handler:
|
permission_handler:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: permission_handler
|
name: permission_handler
|
||||||
sha256: "63e5216aae014a72fe9579ccd027323395ce7a98271d9defa9d57320d001af81"
|
sha256: bc56bfe9d3f44c3c612d8d393bd9b174eb796d706759f9b495ac254e4294baa5
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.4.3"
|
version: "10.4.5"
|
||||||
permission_handler_android:
|
permission_handler_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: permission_handler_android
|
name: permission_handler_android
|
||||||
sha256: "2ffaf52a21f64ac9b35fe7369bb9533edbd4f698e5604db8645b1064ff4cf221"
|
sha256: "59c6322171c29df93a22d150ad95f3aa19ed86542eaec409ab2691b8f35f9a47"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.3.3"
|
version: "10.3.6"
|
||||||
permission_handler_apple:
|
permission_handler_apple:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -252,10 +276,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: permission_handler_platform_interface
|
name: permission_handler_platform_interface
|
||||||
sha256: "7c6b1500385dd1d2ca61bb89e2488ca178e274a69144d26bbd65e33eae7c02a9"
|
sha256: f2343e9fa9c22ae4fd92d4732755bfe452214e7189afcc097380950cf567b4b2
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.11.3"
|
version: "3.11.5"
|
||||||
permission_handler_windows:
|
permission_handler_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -268,10 +292,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: platform
|
name: platform
|
||||||
sha256: "57c07bf82207aee366dfaa3867b3164e4f03a238a461a11b0e8a3a510d51203d"
|
sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.1"
|
version: "3.1.2"
|
||||||
platform_info:
|
platform_info:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -284,10 +308,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: plugin_platform_interface
|
name: plugin_platform_interface
|
||||||
sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd"
|
sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.5"
|
version: "2.1.6"
|
||||||
quiver:
|
quiver:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -304,6 +328,15 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.2"
|
version: "3.1.2"
|
||||||
|
saf:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
path: "."
|
||||||
|
ref: HEAD
|
||||||
|
resolved-ref: e3aa3fcbd031f2645688e97ebd5a4f14a014bd42
|
||||||
|
url: "https://github.com/Cateners/saf"
|
||||||
|
source: git
|
||||||
|
version: "1.0.3+3"
|
||||||
shared_preferences:
|
shared_preferences:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -433,66 +466,66 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: url_launcher
|
name: url_launcher
|
||||||
sha256: "781bd58a1eb16069412365c98597726cd8810ae27435f04b3b4d3a470bacd61e"
|
sha256: "47e208a6711459d813ba18af120d9663c20bdf6985d6ad39fe165d2538378d27"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.12"
|
version: "6.1.14"
|
||||||
url_launcher_android:
|
url_launcher_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_android
|
name: url_launcher_android
|
||||||
sha256: "3dd2388cc0c42912eee04434531a26a82512b9cb1827e0214430c9bcbddfe025"
|
sha256: b04af59516ab45762b2ca6da40fa830d72d0f6045cd97744450b73493fa76330
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.38"
|
version: "6.1.0"
|
||||||
url_launcher_ios:
|
url_launcher_ios:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_ios
|
name: url_launcher_ios
|
||||||
sha256: "9af7ea73259886b92199f9e42c116072f05ff9bea2dcb339ab935dfc957392c2"
|
sha256: "7c65021d5dee51813d652357bc65b8dd4a6177082a9966bc8ba6ee477baa795f"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.4"
|
version: "6.1.5"
|
||||||
url_launcher_linux:
|
url_launcher_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_linux
|
name: url_launcher_linux
|
||||||
sha256: "207f4ddda99b95b4d4868320a352d374b0b7e05eefad95a4a26f57da413443f5"
|
sha256: b651aad005e0cb06a01dbd84b428a301916dc75f0e7ea6165f80057fee2d8e8e
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.5"
|
version: "3.0.6"
|
||||||
url_launcher_macos:
|
url_launcher_macos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_macos
|
name: url_launcher_macos
|
||||||
sha256: "1c4fdc0bfea61a70792ce97157e5cc17260f61abbe4f39354513f39ec6fd73b1"
|
sha256: b55486791f666e62e0e8ff825e58a023fd6b1f71c49926483f1128d3bbd8fe88
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.6"
|
version: "3.0.7"
|
||||||
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: bfdfa402f1f3298637d71ca8ecfe840b4696698213d5346e9d12d4ab647ee2ea
|
sha256: "95465b39f83bfe95fcb9d174829d6476216f2d548b79c38ab2506e0458787618"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.3"
|
version: "2.1.5"
|
||||||
url_launcher_web:
|
url_launcher_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_web
|
name: url_launcher_web
|
||||||
sha256: cc26720eefe98c1b71d85f9dc7ef0cada5132617046369d9dc296b3ecaa5cbb4
|
sha256: "2942294a500b4fa0b918685aff406773ba0a4cd34b7f42198742a94083020ce5"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.18"
|
version: "2.0.20"
|
||||||
url_launcher_windows:
|
url_launcher_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_windows
|
name: url_launcher_windows
|
||||||
sha256: "7967065dd2b5fccc18c653b97958fdf839c5478c28e767c61ee879f4e7882422"
|
sha256: "95fef3129dc7cfaba2bc3d5ba2e16063bb561fc6d78e63eee16162bc70029069"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.7"
|
version: "3.0.8"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -513,50 +546,50 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: webview_flutter
|
name: webview_flutter
|
||||||
sha256: "04a0782fb058b7c71f2048935583488f4d32e9147ca403abc4e58f1de9964629"
|
sha256: c1ab9b81090705c6069197d9fdc1625e587b52b8d70cdde2339d177ad0dbb98e
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.2.3"
|
version: "4.4.1"
|
||||||
webview_flutter_android:
|
webview_flutter_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: webview_flutter_android
|
name: webview_flutter_android
|
||||||
sha256: bca797abba472868655b5f1a6029c1132385685ee9db4713cb0e7f33076210c6
|
sha256: b0cd33dd7d3dd8e5f664e11a19e17ba12c352647269921a3b568406b001f1dff
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.9.3"
|
version: "3.12.0"
|
||||||
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: "0ca3cfcc6781a7de701d580917af4a9efc4e3e129f8ead95a80587f0a749480a"
|
sha256: "6d9213c65f1060116757a7c473247c60f3f7f332cac33dc417c9e362a9a13e4f"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.5.0"
|
version: "2.6.0"
|
||||||
webview_flutter_wkwebview:
|
webview_flutter_wkwebview:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: webview_flutter_wkwebview
|
name: webview_flutter_wkwebview
|
||||||
sha256: ed749f94ac9e814d04a258a9255cf69cfa4cc6006ff59542aea7fb4590144972
|
sha256: "30b9af6bdd457b44c08748b9190d23208b5165357cc2eb57914fee1366c42974"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.7.3"
|
version: "3.9.1"
|
||||||
win32:
|
win32:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: win32
|
name: win32
|
||||||
sha256: "9e82a402b7f3d518fb9c02d0e9ae45952df31b9bf34d77baf19da2de03fc2aaa"
|
sha256: "350a11abd2d1d97e0cc7a28a81b781c08002aa2864d9e3f192ca0ffa18b06ed3"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.7"
|
version: "5.0.9"
|
||||||
xdg_directories:
|
xdg_directories:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: xdg_directories
|
name: xdg_directories
|
||||||
sha256: f0c26453a2d47aa4c2570c6a033246a3fc62da2fe23c7ffdd0a7495086dc0247
|
sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.2"
|
version: "1.0.3"
|
||||||
xterm:
|
xterm:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -567,4 +600,4 @@ packages:
|
|||||||
version: "3.5.0"
|
version: "3.5.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.1.0 <4.0.0"
|
dart: ">=3.1.0 <4.0.0"
|
||||||
flutter: ">=3.10.0"
|
flutter: ">=3.13.0"
|
||||||
|
|||||||
@@ -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.4+1
|
version: 1.0.10+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.1.0 <4.0.0'
|
sdk: '>=3.1.0 <4.0.0'
|
||||||
@@ -39,8 +39,12 @@ dependencies:
|
|||||||
retry: ^3.1.2
|
retry: ^3.1.2
|
||||||
url_launcher: ^6.1.12
|
url_launcher: ^6.1.12
|
||||||
shared_preferences: ^2.2.1
|
shared_preferences: ^2.2.1
|
||||||
intl: ^0.18.1
|
intl: ^0.18.1 #日期字符串转换
|
||||||
unity_ads_plugin: ^0.3.8
|
unity_ads_plugin: ^0.3.8
|
||||||
|
clipboard: ^0.1.3
|
||||||
|
ffmpeg_kit_flutter_full_gpl: ^6.0.3
|
||||||
|
saf:
|
||||||
|
git: https://github.com/Cateners/saf
|
||||||
|
|
||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
|
|||||||
Reference in New Issue
Block a user