Skip to content

Commit 49c2377

Browse files
committed
some fix, dri3, wps, readme, ...
1 parent a117050 commit 49c2377

File tree

14 files changed

+347
-160
lines changed

14 files changed

+347
-160
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ app.*.symbols
3939
app.*.map.json
4040

4141
# Android Studio will place build artifacts here
42+
/android/app/build
4243
/android/app/debug
4344
/android/app/profile
4445
/android/app/release

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
给所有安卓arm64设备的“PC应用引擎”平替
66

7-
Click-to-run debian bookworm xfce on android for Chinese users, with fcitx pinyin input method preinstalled. No termux required.
7+
Click-to-run Debian Bookworm XFCE on Android for Chinese users, with the Fcitx Pinyin input method preinstalled. No Termux is required. If you want to change the language in the container, run "tmoe", since this root filesystem is made using [tmoe](https://github.com/2moe/tmoe).
88

99
## 特点
1010

@@ -33,7 +33,7 @@ Click-to-run debian bookworm xfce on android for Chinese users, with fcitx pinyi
3333

3434
使用proot运行debian环境
3535

36-
内置[noVNC](https://github.com/novnc/noVNC)显示图形界面
36+
内置[noVNC](https://github.com/novnc/noVNC)/[AVNC](https://github.com/gujjwal00/avnc)/[Termux:X11](https://github.com/termux/termux-x11)显示图形界面
3737

3838
## 项目结构
3939

@@ -54,16 +54,22 @@ lib目录:
5454

5555
## 编译
5656

57-
你需要配置好flutter和安卓sdk,然后克隆此项目。
57+
你需要配置好flutter和安卓sdk,还需安装python3、bison、patch、gcc,然后克隆此项目。
5858

5959
在编译之前,需要在release中下载系统rootfs(或者[自行制作](extra/build-tiny-rootfs.md)),之后使用split命令分割,拷贝到assets。一般我将其分为98MB。
6060

6161
`split -b 98M debian.tar.xz`
6262

63+
还需要对flutter的一些默认配置作修改,因为其与项目中build.gradle的一些设置冲突。
64+
- 删除`flutter\packages\flutter_tools\gradle\src\main\flutter.groovy`路径下与`ShrinkResources`相关的`if`代码块。
65+
6366
接下来就可以编译了。我使用的命令如下:
6467

6568
`flutter build apk --target-platform android-arm64 --split-per-abi --obfuscate --split-debug-info=tiny_computer/sdi`
6669

70+
有一些C代码可能报错。比如KeyBind.c等文件,报错一些符号未定义。但其实包含那些符号的函数并没有被使用,所以可以把它们删掉再编译。
71+
应该有编译选项可以避免这种情况,但我对cmake不熟,就先这样了:P
72+
6773
## 目前已知bug
6874

6975
多用户/分身情形无法sudo, 其它见issue

android/app/build/generated/java/com/termux/x11/Prefs.java

Lines changed: 0 additions & 108 deletions
This file was deleted.

android/app/src/main/java/com/termux/x11/CmdEntryPoint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
@Keep @SuppressLint({"StaticFieldLeak", "UnsafeDynamicallyLoadedCode"})
3838
public class CmdEntryPoint extends ICmdEntryInterface.Stub {
3939
public static final String ACTION_START = "com.termux.x11.CmdEntryPoint.ACTION_START";
40-
public static final int PORT = 7892;
40+
public static final int PORT = 7897;
4141
public static final byte[] MAGIC = "0xDEADBEEF".getBytes();
4242
private static final Handler handler;
4343
public static Context ctx;

android/app/src/main/java/com/termux/x11/LoriePreferences.java

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -736,9 +736,28 @@ public String[] getValues() {
736736
return getArrayItems(values, ctx.getResources());
737737
}
738738

739+
// private String[] getArrayItems(int resourceId, Resources resources) {
740+
// ArrayList<String> itemList = new ArrayList<>();
741+
// try(TypedArray typedArray = resources.obtainTypedArray(resourceId)) {
742+
// for (int i = 0; i < typedArray.length(); i++) {
743+
// int type = typedArray.getType(i);
744+
// if (type == TypedValue.TYPE_STRING) {
745+
// itemList.add(typedArray.getString(i));
746+
// } else if (type == TypedValue.TYPE_REFERENCE) {
747+
// int resIdOfArray = typedArray.getResourceId(i, 0);
748+
// itemList.addAll(Arrays.asList(resources.getStringArray(resIdOfArray)));
749+
// }
750+
// }
751+
// }
752+
753+
// Object[] objectArray = itemList.toArray();
754+
// return Arrays.copyOf(objectArray, objectArray.length, String[].class);
755+
// }
756+
739757
private String[] getArrayItems(int resourceId, Resources resources) {
740758
ArrayList<String> itemList = new ArrayList<>();
741-
try(TypedArray typedArray = resources.obtainTypedArray(resourceId)) {
759+
TypedArray typedArray = resources.obtainTypedArray(resourceId);
760+
try {
742761
for (int i = 0; i < typedArray.length(); i++) {
743762
int type = typedArray.getType(i);
744763
if (type == TypedValue.TYPE_STRING) {
@@ -748,11 +767,12 @@ private String[] getArrayItems(int resourceId, Resources resources) {
748767
itemList.addAll(Arrays.asList(resources.getStringArray(resIdOfArray)));
749768
}
750769
}
770+
} finally {
771+
typedArray.recycle();
751772
}
752-
753-
Object[] objectArray = itemList.toArray();
754-
return Arrays.copyOf(objectArray, objectArray.length, String[].class);
773+
return itemList.toArray(new String[0]);
755774
}
775+
756776

757777
}
758778

android/app/src/main/java/com/termux/x11/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public class MainActivity extends AppCompatActivity implements View.OnApplyWindo
8585
protected ICmdEntryInterface service = null;
8686
public TermuxX11ExtraKeys mExtraKeys;
8787
private Notification mNotification;
88-
private final int mNotificationId = 7892;
88+
private final int mNotificationId = 7897;
8989
NotificationManager mNotificationManager;
9090
static InputMethodManager inputMethodManager;
9191
private static boolean showIMEWhileExternalConnected = true;

android/app/src/main/res/xml/preferences.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<PreferenceScreen app:key="kbd">
3939
<SwitchPreferenceCompat app:key="showAdditionalKbd" app:defaultValue="true" />
4040
<!-- this preference should be a part of `Prefs` but should not appear in PreferenceScreen -->
41-
<SwitchPreferenceCompat app:key="additionalKbdVisible" app:defaultValue="true" app:isPreferenceVisible="false" />
41+
<SwitchPreferenceCompat app:key="additionalKbdVisible" app:defaultValue="false" app:isPreferenceVisible="false" />
4242
<SwitchPreferenceCompat app:key="showIMEWhileExternalConnected" app:defaultValue="true" />
4343
<SwitchPreferenceCompat app:key="preferScancodes" app:defaultValue="false" />
4444
<SwitchPreferenceCompat app:key="hardwareKbdScancodesWorkaround" app:defaultValue="true" />

0 commit comments

Comments
 (0)