@@ -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
117def localProperties = new Properties ()
@@ -29,7 +25,7 @@ if (flutterVersionName == null) {
2925android {
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
11696dependencies {
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- }
0 commit comments