Skip to content

Commit 1203dcf

Browse files
committed
Update avnc, remove the embedded termux:x11 and import it as a flutter plugin, fix app name
1 parent d9c4c24 commit 1203dcf

File tree

134 files changed

+63
-19251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+63
-19251
lines changed

.gitmodules

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +0,0 @@
1-
[submodule "android/app/src/main/cpp/libtirpc"]
2-
path = android/app/src/main/cpp/libtirpc
3-
url = https://github.com/alisw/libtirpc
4-
ignore = dirty
5-
[submodule "android/app/src/main/cpp/pixman"]
6-
path = android/app/src/main/cpp/pixman
7-
url = https://gitlab.freedesktop.org/pixman/pixman
8-
ignore = dirty
9-
[submodule "android/app/src/main/cpp/libfontenc"]
10-
path = android/app/src/main/cpp/libfontenc
11-
url = https://gitlab.freedesktop.org/xorg/lib/libfontenc
12-
ignore = dirty
13-
[submodule "android/app/src/main/cpp/libxau"]
14-
path = android/app/src/main/cpp/libxau
15-
url = https://gitlab.freedesktop.org/xorg/lib/libxau
16-
ignore = dirty
17-
[submodule "android/app/src/main/cpp/libxdmcp"]
18-
path = android/app/src/main/cpp/libxdmcp
19-
url = https://gitlab.freedesktop.org/xorg/lib/libxdmcp
20-
ignore = dirty
21-
[submodule "android/app/src/main/cpp/libxfont"]
22-
path = android/app/src/main/cpp/libxfont
23-
url = https://gitlab.freedesktop.org/xorg/lib/libxfont
24-
ignore = dirty
25-
[submodule "android/app/src/main/cpp/libxkbfile"]
26-
path = android/app/src/main/cpp/libxkbfile
27-
url = https://gitlab.freedesktop.org/xorg/lib/libxkbfile
28-
ignore = dirty
29-
[submodule "android/app/src/main/cpp/libxshmfence"]
30-
path = android/app/src/main/cpp/libxshmfence
31-
url = https://gitlab.freedesktop.org/xorg/lib/libxshmfence
32-
ignore = dirty
33-
[submodule "android/app/src/main/cpp/libxtrans"]
34-
path = android/app/src/main/cpp/libxtrans
35-
url = https://gitlab.freedesktop.org/xorg/lib/libxtrans
36-
ignore = dirty
37-
[submodule "android/app/src/main/cpp/libepoxy"]
38-
path = android/app/src/main/cpp/libepoxy
39-
url = https://github.com/anholt/libepoxy
40-
ignore = dirty
41-
[submodule "android/app/src/main/cpp/libxcvt"]
42-
path = android/app/src/main/cpp/libxcvt
43-
url = https://gitlab.freedesktop.org/xorg/lib/libxcvt
44-
ignore = dirty
45-
[submodule "android/app/src/main/cpp/libx11"]
46-
path = android/app/src/main/cpp/libx11
47-
url = https://gitlab.freedesktop.org/xorg/lib/libx11
48-
ignore = dirty
49-
[submodule "android/app/src/main/cpp/xorgproto"]
50-
path = android/app/src/main/cpp/xorgproto
51-
url = https://gitlab.freedesktop.org/xorg/proto/xorgproto
52-
ignore = dirty
53-
[submodule "android/app/src/main/cpp/xkbcomp"]
54-
path = android/app/src/main/cpp/xkbcomp
55-
url = https://gitlab.freedesktop.org/xorg/app/xkbcomp
56-
ignore = dirty
57-
[submodule "android/app/src/main/cpp/xserver"]
58-
path = android/app/src/main/cpp/xserver
59-
url = https://gitlab.freedesktop.org/xorg/xserver
60-
ignore = dirty
61-
[submodule "android/app/src/main/cpp/bzip2"]
62-
path = android/app/src/main/cpp/bzip2
63-
url = https://gitlab.com/bzip2/bzip2
64-
ignore = dirty
65-
[submodule "android/app/src/main/cpp/OpenXR-SDK"]
66-
path = android/app/src/main/cpp/OpenXR-SDK
67-
url = https://github.com/KhronosGroup/OpenXR-SDK.git
68-
ignore = dirty

.metadata

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: "efbf63d9c66b9f6ec30e9ad4611189aa80003d31"
7+
revision: "edada7c56edf4a183c1735310e123c7f923584f1"
88
channel: "stable"
99

1010
project_type: app
@@ -13,26 +13,11 @@ project_type: app
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
17-
base_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
16+
create_revision: edada7c56edf4a183c1735310e123c7f923584f1
17+
base_revision: edada7c56edf4a183c1735310e123c7f923584f1
1818
- platform: android
19-
create_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
20-
base_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
21-
- platform: ios
22-
create_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
23-
base_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
24-
- platform: linux
25-
create_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
26-
base_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
27-
- platform: macos
28-
create_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
29-
base_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
30-
- platform: web
31-
create_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
32-
base_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
33-
- platform: windows
34-
create_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
35-
base_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
19+
create_revision: edada7c56edf4a183c1735310e123c7f923584f1
20+
base_revision: edada7c56edf4a183c1735310e123c7f923584f1
3621

3722
# User provided section
3823

android/app/build.gradle

Lines changed: 13 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ plugins {
22
id "com.android.application"
33
id "kotlin-android"
44
id "dev.flutter.flutter-gradle-plugin"
5-
6-
id "org.jetbrains.kotlin.kapt"
7-
id "org.jetbrains.kotlin.plugin.serialization" version "1.9.10"
8-
id "org.jetbrains.kotlin.plugin.parcelize"
95
}
106

117
def localProperties = new Properties()
@@ -29,7 +25,7 @@ if (flutterVersionName == null) {
2925
android {
3026
namespace "com.example.tiny_computer"
3127
compileSdkVersion flutter.compileSdkVersion
32-
ndkVersion flutter.ndkVersion
28+
ndkVersion "27.0.12077973" // flutter.ndkVersion
3329

3430
compileOptions {
3531
sourceCompatibility JavaVersion.VERSION_17
@@ -50,8 +46,8 @@ android {
5046
applicationId "com.fct.tiny"
5147
// You can update the following values to match your application needs.
5248
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
53-
minSdkVersion 28 // glob() version //proot version //ffmpeg_kit; flutter.minSdkVersion
54-
targetSdkVersion 28 //https://github.com/termux/termux-app/issues/1072; native; linker; flutter.targetSdkVersion
49+
minSdk 28 // glob() version //proot version //ffmpeg_kit; flutter.minSdkVersion
50+
targetSdk 28 //https://github.com/termux/termux-app/issues/1072; native; linker; flutter.targetSdkVersion
5551
versionCode flutterVersionCode.toInteger()
5652
versionName flutterVersionName
5753

@@ -61,25 +57,16 @@ android {
6157

6258
buildTypes {
6359
release {
64-
// TODO: Add your own signing config for the release build.
65-
// Signing with the debug keys for now, so `flutter run --release` works.
6660
signingConfig signingConfigs.debug
67-
// remove flutter's default ShrinkResources settings at flutter\packages\flutter_tools\gradle\src\main\groovy\flutter.groovy
68-
postprocessing {
69-
removeUnusedCode true
70-
removeUnusedResources true
71-
obfuscate false
72-
optimizeCode true
73-
}
61+
minifyEnabled true
62+
shrinkResources true
63+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
7464
}
7565
debug {
7666
signingConfig signingConfigs.debug
77-
postprocessing {
78-
removeUnusedCode true
79-
removeUnusedResources true
80-
obfuscate false
81-
optimizeCode true
82-
}
67+
minifyEnabled true
68+
shrinkResources false
69+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
8370
}
8471
}
8572

@@ -88,13 +75,6 @@ android {
8875
dataBinding true
8976
buildConfig true
9077
}
91-
92-
externalNativeBuild {
93-
cmake {
94-
version '3.22.1'
95-
path file('src/main/cpp/CMakeLists.txt')
96-
}
97-
}
9878

9979
lintOptions {
10080
//checkReleaseBuilds false
@@ -114,80 +94,8 @@ flutter {
11494
}
11595

11696
dependencies {
117-
implementation "androidx.core:core-ktx:1.12.0"
118-
implementation "androidx.activity:activity-ktx:1.8.2"
119-
implementation "androidx.fragment:fragment-ktx:1.6.2"
120-
implementation "androidx.appcompat:appcompat:1.6.1"
121-
implementation "androidx.preference:preference-ktx:1.2.1"
122-
implementation "androidx.preference:preference:1.2.1"
123-
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2"
124-
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.6.2"
125-
implementation "androidx.dynamicanimation:dynamicanimation:1.0.0"
126-
implementation "androidx.biometric:biometric-ktx:1.2.0-alpha05"
127-
implementation "androidx.recyclerview:recyclerview:1.2.1"
128-
129-
implementation "com.google.android.material:material:1.11.0"
130-
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0"
131-
implementation "org.connectbot:sshlib:2.2.23"
132-
implementation 'com.github.tiann:FreeReflection:3.1.0'
133-
134-
compileOnly project(':shell-loader:stub')
97+
implementation "androidx.core:core-ktx:1.15.0"
98+
implementation "androidx.appcompat:appcompat:1.7.0"
99+
implementation "com.google.android.material:material:1.7.0"
100+
implementation 'com.github.tiann:FreeReflection:3.2.2'
135101
}
136-
137-
afterEvaluate {
138-
tasks.register("generatePrefs") {
139-
//noinspection UnnecessaryQualifiedReference
140-
def xml = groovy.xml.DOMBuilder.parse((new StringReader(file('src/main/res/xml/preferences.xml').text)))
141-
def preferenceNodes = xml.documentElement.getElementsByTagName("*")
142-
def preferences = []
143-
144-
for (int i = 0; i < preferenceNodes.length; i++) {
145-
def node = preferenceNodes.item(i)
146-
if (node.nodeName == 'EditTextPreference' && node.getAttribute("app:key") != "extra_keys_config")
147-
preferences << [ type: 'String', key: node.getAttribute("app:key"), default: node.getAttribute("app:defaultValue") ]
148-
else if (node.nodeName == 'SeekBarPreference')
149-
preferences << [ type: 'Int', key: node.getAttribute("app:key"), default: node.getAttribute("app:defaultValue") ]
150-
else if (node.nodeName == 'ListPreference') {
151-
def entries = node.getAttribute("app:entries")
152-
def values = node.getAttribute("app:entryValues")
153-
preferences << [type: 'List', key: node.getAttribute("app:key"), default: node.getAttribute("app:defaultValue"),
154-
entries: entries.substring(7, entries.length()), values: values.substring(7, values.length())]
155-
}
156-
else if (node.nodeName == 'SwitchPreferenceCompat')
157-
preferences << [ type: 'Boolean', key: node.getAttribute("app:key"), default: node.getAttribute("app:defaultValue") ]
158-
}
159-
160-
def out = file('build/generated/java/com/termux/x11/Prefs.java')
161-
out.getParentFile().exists() || out.getParentFile().mkdirs()
162-
out.delete()
163-
out.createNewFile()
164-
165-
out << 'package com.termux.x11;\n'
166-
out << 'import java.util.HashMap;\n'
167-
out << 'import android.content.Context;\n'
168-
out << 'import com.termux.x11.utils.TermuxX11ExtraKeys;\n'
169-
out << 'import com.example.tiny_computer.R;\n'
170-
out << '\n'
171-
out << 'public class Prefs extends LoriePreferences.PrefsProto {\n'
172-
preferences.each {
173-
if (it.type == 'Int' || it.type == 'Boolean')
174-
out << " public final ${it.type}Preference ${it.key} = new ${it.type}Preference(\"${it.key}\", ${it.default});\n"
175-
else if (it.type == 'String')
176-
out << " public final StringPreference ${it.key} = new StringPreference(\"${it.key}\", \"${it.default}\");\n"
177-
else if (it.type == 'List')
178-
out << " public final ${it.type}Preference ${it.key} = new ${it.type}Preference(\"${it.key}\", \"${it.default}\", R.array.${it.entries}, R.array.${it.values});\n"
179-
}
180-
out << ' public final StringPreference extra_keys_config = new StringPreference("extra_keys_config", TermuxX11ExtraKeys.DEFAULT_IVALUE_EXTRA_KEYS);\n'
181-
out << ' public final HashMap<String, Preference> keys = new HashMap<String, Preference>() {{\n'
182-
preferences.each { out << ' put("' + it.key + '", ' + it.key + ');\n' }
183-
out << ' put("extra_keys_config", extra_keys_config);\n'
184-
out << ' }};\n'
185-
out << '\n'
186-
out << ' public Prefs(Context ctx) {\n'
187-
out << ' super(ctx);\n'
188-
out << ' }\n'
189-
out << '}\n'
190-
}
191-
android.sourceSets.main.java.srcDirs += 'build/generated/java'
192-
preBuild.dependsOn generatePrefs
193-
}

android/app/proguard-rules.pro

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Please add these rules to your existing keep rules in order to suppress warnings.
2+
# This is generated automatically by the Android Gradle plugin.
3+
-dontwarn android.app.ActivityThread
4+
-dontwarn android.app.ContextImpl
5+
-dontwarn android.app.IActivityManager
6+
-dontwarn android.content.IIntentReceiver$Stub
7+
-dontwarn android.content.IIntentReceiver
8+
-dontwarn android.content.IIntentSender
9+
-dontwarn android.content.pm.IPackageManager
10+
-dontwarn com.google.errorprone.annotations.CanIgnoreReturnValue
11+
-dontwarn com.google.errorprone.annotations.Immutable

android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,11 @@
44
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
55
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
66
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
7-
<uses-permission android:name="android.permission.CAMERA" />
8-
<uses-permission android:name="android.permission.RECORD_AUDIO" />
97

108
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
11-
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
12-
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
13-
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
14-
15-
<uses-feature android:name="android.hardware.vr.headtracking" android:required="false" />
16-
<uses-feature android:name="com.oculus.feature.PASSTHROUGH" android:required="false" />
17-
<uses-feature android:name="oculus.software.handtracking" android:required="false" />
18-
<uses-feature android:name="oculus.software.overlay_keyboard" android:required="false" />
199

2010
<application
21-
android:label="小小电脑"
11+
android:label="@string/tc_app_name"
2212
android:name=".MainApplication"
2313
android:icon="@mipmap/ic_launcher"
2414
android:usesCleartextTraffic="true"
@@ -47,61 +37,6 @@
4737
</intent-filter>
4838
</activity>
4939
<activity android:name="com.example.tiny_computer.Signal9Activity" />
50-
<activity
51-
android:name="com.termux.x11.MainActivity"
52-
android:supportsPictureInPicture="true"
53-
android:configChanges="fontScale|orientation|screenSize|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|screenLayout|touchscreen|uiMode|smallestScreenSize|density"
54-
android:resizeableActivity="true"
55-
android:windowSoftInputMode="stateHidden"
56-
android:process=":x11">
57-
<!-- android:taskAffinity="com.termux.x11.MainActivity" -->
58-
<!-- android:launchMode="singleInstance" -->
59-
</activity>
60-
<activity
61-
android:name="com.termux.x11.XrActivity"
62-
android:configChanges="density|orientation|screenSize|keyboard|keyboardHidden|uiMode"
63-
android:exported="true"
64-
android:resizeableActivity="false"
65-
android:screenOrientation="landscape"
66-
android:process=":vr_process">
67-
<intent-filter>
68-
<action android:name="android.intent.action.VIEW" />
69-
<category android:name="com.oculus.intent.category.VR" />
70-
<category android:name="android.intent.category.LAUNCHER" />
71-
</intent-filter>
72-
<!-- android:launchMode="singleTask" -->
73-
</activity>
74-
<activity
75-
android:theme="@style/Theme.AppCompat.DayNight"
76-
android:name="com.termux.x11.LoriePreferences"
77-
android:supportsPictureInPicture="false"
78-
android:resizeableActivity="true"
79-
android:process=":x11"
80-
android:exported="false">
81-
<intent-filter>
82-
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
83-
<action android:name="android.intent.action.MAIN" />
84-
</intent-filter>
85-
<!-- android:excludeFromRecents="true" -->
86-
<!-- android:taskAffinity="com.termux.x11.LoriePreferences" -->
87-
</activity>
88-
<meta-data android:name="com.samsung.android.multidisplay.keep_process_alive" android:value="false"/>
89-
<meta-data android:name="android.allow_multiple_resumed_activities" android:value="true" />
90-
91-
<service android:name="com.termux.x11.utils.KeyInterceptor"
92-
android:exported="true"
93-
android:label="Termux:X11 KeyInterceptor"
94-
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"
95-
android:process=":x11">
96-
<intent-filter>
97-
<action android:name="android.accessibilityservice.AccessibilityService" />
98-
</intent-filter>
99-
100-
<meta-data
101-
android:name="android.accessibilityservice"
102-
android:resource="@xml/accessibility_service_config" />
103-
</service>
104-
10540
<provider
10641
android:name="com.example.tiny_computer.filepicker.TinyDocumentsProvider"
10742
android:authorities="com.example.tiny_computer.documents"

android/app/src/main/aidl/com/termux/x11/ICmdEntryInterface.aidl

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

0 commit comments

Comments
 (0)