Skip to content

Commit 350f4e9

Browse files
committed
Update discussion link, hint for compile/fast command/file access, fix x11, using release keystore, update code to v1.0.99
1 parent ee22cbc commit 350f4e9

File tree

13 files changed

+109
-51
lines changed

13 files changed

+109
-51
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,11 @@ android/app/src/main/jniLibs/*
5555
devtools_options.yaml
5656

5757
lib/l10n/app_localizations*
58+
59+
# Keystore files
60+
*.jks
61+
*.keystore
62+
63+
# Configuration files
64+
android/keystore.properties
65+
android/local.properties

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,22 @@ lib 目录:
7979

8080
## 编译
8181

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

8484
在编译之前,需要在 release 中下载 jniLibs.zip ,将里面的库文件解压后放到 android/app/src/main/jniLibs/arm64-v8a;下载 patch.tar.gz 拷贝到 assets。以及下载系统 rootfs(或者[自行制作](https://github.com/Cateners/tiny_computer/blob/master/extra/build-tiny-rootfs.md)),之后使用 split 命令分割,拷贝到 assets。一般我将其分为 98MB。
8585

8686
```bash
8787
split -b 98M debian.tar.xz
8888
```
8989

90-
接下来就可以编译了。我使用的命令如下:
90+
接下来就可以编译了。如果要编译release版本,需要设置发布密钥,可以参考android/keystore.properties.example文件。
91+
92+
我使用的编译命令如下:
9193

9294
```bash
93-
flutter build apk --target-platform android-arm64 --split-per-abi --obfuscate --split-debug-info=tiny_computer/sdi
95+
flutter build apk --target-platform android-arm64 --split-per-abi --obfuscate --split-debug-info=tiny_computer/sdi
9496
```
9597

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

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

android/app/build.gradle

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ if (flutterVersionName == null) {
2222
flutterVersionName = '1.0'
2323
}
2424

25+
def keystoreProperties = new Properties()
26+
def keystorePropertiesFile = rootProject.file('keystore.properties')
27+
if (keystorePropertiesFile.exists()) {
28+
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
29+
}
30+
2531
android {
2632
namespace "com.example.tiny_computer"
2733
compileSdkVersion flutter.compileSdkVersion
@@ -54,10 +60,18 @@ android {
5460
buildConfigField "String", "COMMIT", "\"" + ("git rev-parse HEAD\n".execute().getText().trim() ?: (System.getenv('CURRENT_COMMIT') ?: "NO_COMMIT")) + "\""
5561

5662
}
63+
signingConfigs {
64+
release {
65+
keyAlias keystoreProperties['keyAlias']
66+
keyPassword keystoreProperties['keyPassword']
67+
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
68+
storePassword keystoreProperties['storePassword']
69+
}
70+
}
5771

5872
buildTypes {
5973
release {
60-
signingConfig signingConfigs.debug
74+
signingConfig signingConfigs.release
6175
minifyEnabled true
6276
shrinkResources true
6377
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
@@ -77,6 +91,11 @@ android {
7791
buildConfig true
7892
}
7993

94+
95+
lint {
96+
disable "NullSafeMutableLiveData"
97+
}
98+
8099
lintOptions {
81100
//checkReleaseBuilds false
82101
abortOnError false

android/app/proguard-rules.pro

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@
88
-dontwarn android.content.IIntentSender
99
-dontwarn android.content.pm.IPackageManager
1010
-dontwarn com.google.errorprone.annotations.CanIgnoreReturnValue
11-
-dontwarn com.google.errorprone.annotations.Immutable
11+
-dontwarn com.google.errorprone.annotations.Immutable
12+
# 保持 Termux X11 所有内容
13+
-keep class com.termux.x11.** { *; }
14+
-keepclassmembers class com.termux.x11.** { *; }
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
storePassword=your_store_password_here
2+
keyPassword=your_key_password_here
3+
keyAlias=upload
4+
storeFile=../upload-keystore.jks

extra/build-tiny-rootfs.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ tmoe还会安装gnome-keyring,由于之前我做xfce包时会造成VSCode反
181181

182182
### 额外步骤
183183

184+
- 将桌面壁纸的配置从monitorBuiltinDisplay改为monitorbuiltin(xfce,v1.0.99),疑似Termux:X11显示器名称改变导致壁纸失效
184185
- 修复用vscode打开文件时只打开了vscode本身(v1.0.25):去掉/usr/share/applications/code-no-sandbox.desktop的Exec的--unity-launch
185186
- 修复选择文本时会把文本发送到剪切板(v1.0.25):在/usr/local/bin/startvnc文件的start_tmoe_xvnc()的start_win10_tigervnc行前面加入`vncconfig -set SendPrimary=0 SetPrimary=0`
186187
- 修复系统更新时变英文(v1.0.19):把/etc/locale.gen文件里包含zh_CN.UTF-8的那行代码解除注释
@@ -207,7 +208,7 @@ tmoe还会安装gnome-keyring,由于之前我做xfce包时会造成VSCode反
207208
- .ICEauthority
208209
- .Xauthority
209210
- 等等
210-
- 切换到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.*" /`
211+
- 切换到root用户,切换到根目录,`/busybox tar -Jcpvf /debian.tar.xz --exclude=".l2s.*" bin boot etc home lib media mnt opt root run sbin sd srv tmp usr var`
211212

212213

213214
## 制作步骤(GXDE OS)

lib/l10n/intl_en.arb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"hidpiEnvVar": "HiDPI Environment Variables",
5353
"hidpiSupport": "HiDPI Support",
5454
"fileAccess": "File Access",
55+
"fileAccessGuide": "File Access Guide",
5556
"fileAccessHint": "Request additional file permissions to access special directories.",
5657
"requestStoragePermission": "Request Storage Permission",
5758
"requestAllFilesAccess": "Request All Files Access",
@@ -90,6 +91,7 @@
9091
"resetCommand": "Reset Command",
9192
"confirmResetAllCommands": "Reset all shortcut commands?",
9293
"addShortcutCommand": "Add Shortcut Command",
94+
"more": "More",
9395
"terminal": "Terminal",
9496
"control": "Control",
9597
"enterGUI": "Enter GUI",
@@ -103,5 +105,7 @@
103105
"issueUrl": "Issue Report",
104106
"faqUrl": "FAQ",
105107
"solutionUrl": "Usage Guide",
106-
"firstLoadInstructions": "The first load may take about 5 to 10 minutes...\n\nNormally, the software will automatically redirect to the graphical interface after loading.\n\nIn the graphical interface:\n- Tap for left-click\n- Long press for right-click\n- Two-finger tap to open the keyboard\n- Two-finger swipe for mouse wheel\n\nPlease do not exit the software during installation.\n\nWhile waiting, you can click the button below to request permissions.\n\nMany folders in Tiny Computer (e.g., Downloads, Documents, Pictures) are bound to the corresponding device folders. Without these permissions, access to these folders will be denied.\n\nIf you don't need to access these folders, you can skip granting file permissions (but this may cause Firefox to fail when downloading files due to denied access to the Downloads folder)."
108+
"discussionUrl": "Discussion",
109+
"firstLoadInstructions": "The first load may take about 5 to 10 minutes...\n\nNormally, the software will automatically redirect to the graphical interface after loading.\n\nIn the graphical interface:\n- Tap for left-click\n- Long press for right-click\n- Two-finger tap to open the keyboard\n- Two-finger swipe for mouse wheel\n\nPlease do not exit the software during installation.\n\nWhile waiting, you can click the button below to request permissions.\n\nMany folders in Tiny Computer (e.g., Downloads, Documents, Pictures) are bound to the corresponding device folders. Without these permissions, access to these folders will be denied.\n\nIf you don't need to access these folders, you can skip granting file permissions (but this may cause Firefox to fail when downloading files due to denied access to the Downloads folder).",
110+
"updateRequest": "Please try to use the latest version. Visit the project address to check for the latest version."
107111
}

lib/l10n/intl_zh.arb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
"hidpiEnvVar": "HiDPI环境变量",
5353
"hidpiSupport": "高分辨率支持",
5454
"fileAccess": "文件访问",
55-
"fileAccessHint": "通过这里获取更多文件权限,以实现对特殊目录的访问。",
55+
"fileAccessGuide": "文件访问指南",
56+
"fileAccessHint": "在这里获取更多文件权限,以实现对设备文件的访问。",
5657
"requestStoragePermission": "申请存储权限",
5758
"requestAllFilesAccess": "申请所有文件访问权限",
5859
"ignoreBatteryOptimization": "忽略电池优化",
@@ -90,6 +91,7 @@
9091
"resetCommand": "重置指令",
9192
"confirmResetAllCommands": "是否重置所有快捷指令?",
9293
"addShortcutCommand": "添加快捷指令",
94+
"more": "更多",
9395
"terminal": "终端",
9496
"control": "控制",
9597
"enterGUI": "进入图形界面",
@@ -103,5 +105,7 @@
103105
"issueUrl": "问题反馈",
104106
"faqUrl": "常见问题",
105107
"solutionUrl": "典型场景使用指南",
106-
"firstLoadInstructions": "第一次加载大概需要5到10分钟...\n\n正常情况下,加载完成后软件会自动跳转到图形界面。\n\n在图形界面时:\n- 点击为鼠标左键\n- 长按为鼠标右键\n- 双指点击可弹出键盘\n- 双指划动为鼠标滚轮\n\n请不要在安装时退出软件。\n\n在等待时,可以点击下面的按钮申请一下权限。\n\n小小电脑的许多文件夹,比如下载、文档、图片等等都和设备的对应文件夹绑定,如果不授予这些权限会导致这些文件夹无权访问。\n\n但如果你不需要访问这些文件夹,也可以不授予文件权限(可能导致火狐浏览器下载文件失败,因为无权访问下载文件夹)。"
108+
"discussionUrl": "论坛与讨论",
109+
"firstLoadInstructions": "第一次加载大概需要5到10分钟...\n\n正常情况下,加载完成后软件会自动跳转到图形界面。\n\n在图形界面时:\n- 点击为鼠标左键\n- 长按为鼠标右键\n- 双指点击可弹出键盘\n- 双指划动为鼠标滚轮\n\n请不要在安装时退出软件。\n\n在等待时,可以点击下面的按钮申请一下权限。\n\n小小电脑的许多文件夹,比如下载、文档、图片等等都和设备的对应文件夹绑定,如果不授予这些权限会导致这些文件夹无权访问。\n\n但如果你不需要访问这些文件夹,也可以不授予文件权限(可能导致火狐浏览器下载文件失败,因为无权访问下载文件夹)。",
110+
"updateRequest": "请尽量使用最新版本。前往项目地址可查看最新版本。"
107111
}

lib/l10n/intl_zh_Hant.arb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"hidpiEnvVar": "HiDPI 環境變數",
5353
"hidpiSupport": "高解析度支援",
5454
"fileAccess": "檔案存取",
55+
"fileAccessGuide": "檔案存取指南",
5556
"fileAccessHint": "在此處取得更多檔案權限,以便存取特殊目錄。",
5657
"requestStoragePermission": "申請儲存權限",
5758
"requestAllFilesAccess": "申請所有檔案存取權限",
@@ -90,6 +91,7 @@
9091
"resetCommand": "重設指令",
9192
"confirmResetAllCommands": "是否重設所有快捷指令?",
9293
"addShortcutCommand": "新增快捷指令",
94+
"more": "更多",
9395
"terminal": "終端",
9496
"control": "控制",
9597
"enterGUI": "進入圖形介面",
@@ -102,6 +104,8 @@
102104
"reinstallingBootPackage": "正在重新安裝啟動套件",
103105
"issueUrl": "問題回報",
104106
"faqUrl": "常見問題",
105-
"solutionUrl": "使用指南",
106-
"firstLoadInstructions": "第一次載入大概需要5到10分鐘...\n\n正常情況下,載入完成後軟體會自動跳轉到圖形介面。\n\n在圖形介面時:\n- 點擊為滑鼠左鍵\n- 長按為滑鼠右鍵\n- 雙指點擊可彈出鍵盤\n- 雙指滑動為滑鼠滾輪\n\n請不要在安裝時退出軟體。\n\n在等待時,可以點擊下面的按鈕申請權限。\n\n小小電腦的許多資料夾,比如下載、文件、圖片等等都和裝置的這些資料夾綁定,如果不授予這些權限會導致這些資料夾無權存取。\n\n但如果你不需要存取這些資料夾,也可以不授予檔案權限(可能導致火狐瀏覽器下載檔案失敗,因為無權存取下載資料夾)。"
107+
"solutionUrl": "操作指南",
108+
"discussionUrl": "討論",
109+
"firstLoadInstructions": "第一次載入大概需要5到10分鐘...\n\n正常情況下,載入完成後軟體會自動跳轉到圖形介面。\n\n在圖形介面時:\n- 點擊為滑鼠左鍵\n- 長按為滑鼠右鍵\n- 雙指點擊可彈出鍵盤\n- 雙指滑動為滑鼠滾輪\n\n請不要在安裝時退出軟體。\n\n在等待時,可以點擊下面的按鈕申請權限。\n\n小小電腦的許多資料夾,比如下載、文件、圖片等等都和裝置的這些資料夾綁定,如果不授予這些權限會導致這些資料夾無權存取。\n\n但如果你不需要存取這些資料夾,也可以不授予檔案權限(可能導致火狐瀏覽器下載檔案失敗,因為無權存取下載資料夾)。",
110+
"updateRequest": "請盡量使用最新版本。前往專案網址查看最新版本。"
107111
}

lib/main.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,9 @@ sed -i -E "s@^(VNC_RESOLUTION)=.*@\\1=${w}x${h}@" \$(command -v startvnc)""");
444444
OutlinedButton(style: D.commandButtonStyle, child: Text(AppLocalizations.of(context)!.requestAllFilesAccess), onPressed: () {
445445
Permission.manageExternalStorage.request();
446446
}),
447+
OutlinedButton(style: D.commandButtonStyle, child: Text(AppLocalizations.of(context)!.fileAccessGuide), onPressed: () {
448+
launchUrl(Uri.parse("https://gitee.com/caten/tc-hints/blob/master/pool/fileaccess.md"), mode: LaunchMode.externalApplication);
449+
}),
447450
]),
448451
const SizedBox.square(dimension: 16),
449452
],))),
@@ -607,6 +610,8 @@ class _InfoPageState extends State<InfoPage> {
607610
}),
608611
]),
609612
const SizedBox.square(dimension: 16),
613+
Text(AppLocalizations.of(context)!.updateRequest),
614+
const SizedBox.square(dimension: 16),
610615
Wrap(alignment: WrapAlignment.center, spacing: 4.0, runSpacing: 4.0, children: D.links
611616
.asMap().entries.map<Widget>((e) {
612617
return OutlinedButton(style: D.commandButtonStyle, child: Text(Util.getl10nText(e.value["name"]!, context)), onPressed: () {
@@ -1193,6 +1198,9 @@ class _FastCommandsState extends State<FastCommands> {
11931198
command = value;
11941199
}),
11951200
])), actions: [
1201+
TextButton(onPressed:() {
1202+
launchUrl(Uri.parse("https://gitee.com/caten/tc-hints/blob/master/pool/extracommand.md"), mode: LaunchMode.externalApplication);
1203+
}, child: Text(AppLocalizations.of(context)!.more)),
11961204
TextButton(onPressed:() {
11971205
Navigator.of(context).pop();
11981206
}, child: Text(AppLocalizations.of(context)!.cancel)),

0 commit comments

Comments
 (0)