diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000..5e5a1f39
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,64 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+Originally, NeoTerm was designed as the front end of [Termux](https://github.com/termux/termux-app) to provide some
+functions that Termux didn't have, but we found it very convenient. In continuous development, we discovered our goal:
+to be the best terminal for Android. In the interest of fostering an open and welcoming environment, we as contributors
+and maintainers pledge to making participation in our project and our community a harassment-free experience for
+everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience,
+nationality, personal appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+* Free for forever
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take
+appropriate and fair corrective action in response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
+issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any
+contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the
+project or its community. Examples of representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed representative at an online or offline
+event. Representation of a project may be further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at
+kiva515@foxmail.com. The project team will review and investigate all complaints, and will respond in a way that it
+deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the
+reporter of an incident. Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent
+repercussions as determined by other members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available
+at [http://contributor-covenant.org/version/1/4][version]
+
+[homepage]: http://contributor-covenant.org
+
+[version]: http://contributor-covenant.org/version/1/4/
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index b7626729..98b26e0b 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,5 +2,5 @@
# How to
-This is a free software, so any contributions and any contribution types are welcomed!
+NeoTerm is a free software, so any contributions and any contribution types are welcomed!
diff --git a/NeoLang/build.gradle b/NeoLang/build.gradle
index 1b426599..88555ae8 100644
--- a/NeoLang/build.gradle
+++ b/NeoLang/build.gradle
@@ -1,15 +1,22 @@
apply plugin: 'java-library'
apply plugin: 'kotlin'
-repositories {
- mavenCentral()
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation rootProject.ext.deps["kotlin-stdlib"]
}
-java {
- sourceCompatibility = 1.8
- targetCompatibility = 1.8
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+ dependencies {
+ classpath rootProject.ext.deps["kotlin-gradle-plugin"]
+ }
+}
+repositories {
+ mavenCentral()
}
-
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
@@ -20,9 +27,6 @@ compileTestKotlin {
jvmTarget = "1.8"
}
}
-
dependencies {
- implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation rootProject.ext.deps["kotlin-stdlib"]
testImplementation rootProject.ext.deps["junit"]
}
diff --git a/NeoTermBridge/build.gradle b/NeoTermBridge/build.gradle
index 903106ae..b9f814d9 100644
--- a/NeoTermBridge/build.gradle
+++ b/NeoTermBridge/build.gradle
@@ -4,15 +4,12 @@ def libraryVersionCode = 1
def libraryVersionName = "1.0"
android {
- namespace "io.neoterm.bridge"
compileSdkVersion rootProject.ext.android.COMPILE_SDK_VERSION
defaultConfig {
minSdkVersion rootProject.ext.android.MIN_SDK_VERSION
targetSdkVersion rootProject.ext.android.TARGET_SDK_VERSION
- versionCode libraryVersionCode
- versionName libraryVersionName
- testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
+ testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
@@ -20,11 +17,17 @@ android {
minifyEnabled false
}
}
+ namespace 'io.neoterm.bridge'
+ buildFeatures {
+ aidl true
+ }
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation 'androidx.appcompat:appcompat:1.7.1'
- androidTestImplementation('androidx.test.espresso:espresso-core:3.7.0')
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
+ exclude group: 'com.android.support', module: 'support-annotations'
+ })
testImplementation rootProject.ext.deps["junit"]
}
diff --git a/NeoTermBridge/src/main/AndroidManifest.xml b/NeoTermBridge/src/main/AndroidManifest.xml
index 77cf7d76..cc947c56 100644
--- a/NeoTermBridge/src/main/AndroidManifest.xml
+++ b/NeoTermBridge/src/main/AndroidManifest.xml
@@ -1,2 +1 @@
-
+
diff --git a/Xorg/build.gradle b/Xorg/build.gradle
index 9ed67189..a9b4c193 100644
--- a/Xorg/build.gradle
+++ b/Xorg/build.gradle
@@ -1,15 +1,12 @@
apply plugin: 'com.android.library'
android {
- namespace "io.neoterm.xorg"
compileSdkVersion rootProject.ext.android.COMPILE_SDK_VERSION
defaultConfig {
minSdkVersion rootProject.ext.android.MIN_SDK_VERSION
targetSdkVersion rootProject.ext.android.TARGET_SDK_VERSION
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
+ testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
@@ -23,16 +20,16 @@ android {
jniLibs.srcDirs = ['src/main/jniLibs']
}
}
- lintOptions {
- disable 'MissingPermission', 'MissingSuperCall', 'UnsafeDynamicallyLoadedCode'
- }
+ namespace 'io.neoterm.xorg'
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation 'androidx.appcompat:appcompat:1.7.1'
+ implementation rootProject.ext.deps["appcompat-v7"]
testImplementation rootProject.ext.deps["junit"]
- androidTestImplementation('androidx.test.espresso:espresso-core:3.7.0')
+ androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
+ exclude group: 'com.android.support', module: 'support-annotations'
+ })
}
diff --git a/Xorg/src/main/AndroidManifest.xml b/Xorg/src/main/AndroidManifest.xml
index 99238e78..cc947c56 100644
--- a/Xorg/src/main/AndroidManifest.xml
+++ b/Xorg/src/main/AndroidManifest.xml
@@ -1,2 +1 @@
-
+
diff --git a/app/build.gradle b/app/build.gradle
index a28122b5..2522d6a0 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -2,34 +2,29 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
- namespace "io.neoterm"
- compileSdkVersion rootProject.ext.android.COMPILE_SDK_VERSION
+ compileSdk rootProject.ext.android.COMPILE_SDK_VERSION
+ ndkVersion "21.4.7075529"
defaultConfig {
applicationId "io.neoterm"
- minSdkVersion rootProject.ext.android.MIN_SDK_VERSION
- targetSdkVersion rootProject.ext.android.TARGET_SDK_VERSION
+ minSdk rootProject.ext.android.MIN_SDK_VERSION
+ targetSdk rootProject.ext.android.TARGET_SDK_VERSION
versionCode 38
versionName "2.0.5"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
- resConfigs "zh-rCN", "zh-rTW"
+ resourceConfigurations += ['zh-rCN', 'zh-rTW']
externalNativeBuild {
cmake {
cppFlags "-std=c++11"
- abiFilters 'arm64-v8a'
- }
- }
- sourceSets {
- main {
- jniLibs.srcDirs = ['src/main/jniLibs']
+ abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
}
}
}
buildTypes {
release {
minifyEnabled true
- zipAlignEnabled true
shrinkResources true
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
@@ -37,31 +32,45 @@ android {
path "CMakeLists.txt"
}
}
- lintOptions {
- abortOnError false
- checkReleaseBuilds false
- }
compileOptions {
- targetCompatibility 1.8
- sourceCompatibility 1.8
+ targetCompatibility JavaVersion.VERSION_1_8
+ sourceCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
+ jvmTarget = "1.8"
freeCompilerArgs = ["-Xallow-result-return-type"]
}
+ namespace 'io.neoterm'
+ lint {
+ abortOnError false
+ checkReleaseBuilds false
+ }
+ packagingOptions {
+ jniLibs {
+ useLegacyPackaging true
+ }
+ }
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation rootProject.ext.deps["junit"]
+ androidTestImplementation project(path: ':NeoLang')
implementation rootProject.ext.deps["kotlin-stdlib"]
implementation 'org.greenrobot:eventbus:3.3.1'
+
+ implementation 'androidx.recyclerview:recyclerview:1.3.2'
+ implementation 'androidx.recyclerview:recyclerview-selection:1.1.0'
+
implementation 'com.simplecityapps:recyclerview-fastscroll:2.0.1'
implementation 'de.psdev.licensesdialog:licensesdialog:2.2.0'
- implementation 'androidx.annotation:annotation:1.2.0'
+ implementation 'com.github.GrenderG:Color-O-Matic:1.1.5'
+ implementation 'androidx.annotation:annotation:1.7.1'
implementation 'androidx.cardview:cardview:1.0.0'
- implementation 'androidx.appcompat:appcompat:1.7.1'
+ implementation 'androidx.appcompat:appcompat:1.6.1'
+ implementation 'androidx.appcompat:appcompat-resources:1.6.1'
implementation project(':chrome-tabs')
implementation project(':NeoLang')
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 095cf337..207265f0 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,6 +1,5 @@
-
+
+
+
+
+
+
@@ -138,7 +144,7 @@
+ android:foregroundServiceType="specialUse" />
(NeoTermPat
fun getCurrentColorSchemeName(): String {
var currentColorName =
- NeoPreference.loadString(R.string.key_customization_color_scheme, DefaultColorScheme.colorName)
+ NeoPreference.loadString(R.string.key_customization_color_scheme, DefaultColorScheme.colorName) ?: DefaultColorScheme.colorName
if (!colors.containsKey(currentColorName)) {
currentColorName = DefaultColorScheme.colorName
NeoPreference.store(R.string.key_customization_color_scheme, DefaultColorScheme.colorName)
diff --git a/app/src/main/java/io/neoterm/component/config/comp.kt b/app/src/main/java/io/neoterm/component/config/comp.kt
index af7c1d38..45fee5cb 100644
--- a/app/src/main/java/io/neoterm/component/config/comp.kt
+++ b/app/src/main/java/io/neoterm/component/config/comp.kt
@@ -114,7 +114,7 @@ object NeoPreference {
return loadInt(App.get().getString(key), defaultValue)
}
- fun loadString(key: Int, defaultValue: String?): String {
+ fun loadString(key: Int, defaultValue: String?): String? {
return loadString(App.get().getString(key), defaultValue)
}
@@ -126,7 +126,7 @@ object NeoPreference {
return preference!!.getInt(key, defaultValue)
}
- fun loadString(key: String?, defaultValue: String?): String {
+ fun loadString(key: String?, defaultValue: String?): String? {
return preference!!.getString(key, defaultValue)
}
@@ -161,7 +161,7 @@ object NeoPreference {
}
fun getLoginShellName(): String {
- return loadString(R.string.key_general_shell, DefaultValues.loginShell)
+ return loadString(R.string.key_general_shell, DefaultValues.loginShell) ?: DefaultValues.loginShell
}
fun getLoginShellPath(): String {
@@ -216,7 +216,7 @@ object NeoPreference {
return loadString(
R.string.key_general_initial_command,
DefaultValues.initialCommand
- )
+ ) ?: DefaultValues.initialCommand
}
fun isBellEnabled(): Boolean {
diff --git a/app/src/main/java/io/neoterm/component/font/comp.kt b/app/src/main/java/io/neoterm/component/font/comp.kt
index c22cf9c3..72051074 100644
--- a/app/src/main/java/io/neoterm/component/font/comp.kt
+++ b/app/src/main/java/io/neoterm/component/font/comp.kt
@@ -31,7 +31,7 @@ class FontComponent : NeoComponent {
fun getCurrentFontName(): String {
val defaultFont = DefaultValues.defaultFont
- var currentFontName = NeoPreference.loadString(R.string.key_customization_font, defaultFont)
+ var currentFontName = NeoPreference.loadString(R.string.key_customization_font, defaultFont) ?: defaultFont
if (!fonts.containsKey(currentFontName)) {
currentFontName = defaultFont
NeoPreference.store(R.string.key_customization_font, defaultFont)
diff --git a/app/src/main/java/io/neoterm/frontend/session/terminal/term-standard.kt b/app/src/main/java/io/neoterm/frontend/session/terminal/term-standard.kt
index 9fa7859b..0afaac34 100644
--- a/app/src/main/java/io/neoterm/frontend/session/terminal/term-standard.kt
+++ b/app/src/main/java/io/neoterm/frontend/session/terminal/term-standard.kt
@@ -305,7 +305,7 @@ class TermSessionCallback : TerminalSession.SessionChangedCallback {
val termView = termSessionData?.termView
if (termView != null) {
val clipboard = termView.context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
- clipboard.primaryClip = ClipData.newPlainText("", text)
+ clipboard.setPrimaryClip(ClipData.newPlainText("", text))
}
}
diff --git a/app/src/main/java/io/neoterm/frontend/session/view/GestureAndScaleRecognizer.kt b/app/src/main/java/io/neoterm/frontend/session/view/GestureAndScaleRecognizer.kt
index 0e8167d6..9c76361e 100644
--- a/app/src/main/java/io/neoterm/frontend/session/view/GestureAndScaleRecognizer.kt
+++ b/app/src/main/java/io/neoterm/frontend/session/view/GestureAndScaleRecognizer.kt
@@ -38,11 +38,11 @@ internal class GestureAndScaleRecognizer(context: Context, val mListener: Listen
init {
mGestureDetector = GestureDetector(context, object : GestureDetector.SimpleOnGestureListener() {
- override fun onScroll(e1: MotionEvent, e2: MotionEvent, dx: Float, dy: Float): Boolean {
+ override fun onScroll(e1: MotionEvent?, e2: MotionEvent, dx: Float, dy: Float): Boolean {
return mListener.onScroll(e2, dx, dy)
}
- override fun onFling(e1: MotionEvent, e2: MotionEvent, velocityX: Float, velocityY: Float): Boolean {
+ override fun onFling(e1: MotionEvent?, e2: MotionEvent, velocityX: Float, velocityY: Float): Boolean {
return mListener.onFling(e2, velocityX, velocityY)
}
diff --git a/app/src/main/java/io/neoterm/services/NeoTermService.kt b/app/src/main/java/io/neoterm/services/NeoTermService.kt
index 76ef9e6c..312624eb 100644
--- a/app/src/main/java/io/neoterm/services/NeoTermService.kt
+++ b/app/src/main/java/io/neoterm/services/NeoTermService.kt
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import android.app.*
import android.content.Context
import android.content.Intent
+import android.content.pm.ServiceInfo
import android.net.wifi.WifiManager
import android.os.Binder
import android.os.Build
@@ -40,7 +41,13 @@ class NeoTermService : Service() {
override fun onCreate() {
super.onCreate()
createNotificationChannel()
- startForeground(NOTIFICATION_ID, createNotification())
+
+ val notification = createNotification()
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
+ startForeground(NOTIFICATION_ID, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE)
+ } else {
+ startForeground(NOTIFICATION_ID, notification)
+ }
}
override fun onBind(intent: Intent): IBinder? {
@@ -65,7 +72,12 @@ class NeoTermService : Service() {
}
override fun onDestroy() {
- stopForeground(true)
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
+ stopForeground(STOP_FOREGROUND_REMOVE)
+ } else {
+ @Suppress("DEPRECATION")
+ stopForeground(true)
+ }
for (i in mTerminalSessions.indices)
mTerminalSessions[i].finishIfRunning()
@@ -135,7 +147,12 @@ class NeoTermService : Service() {
private fun createNotification(): Notification {
val notifyIntent = Intent(this, NeoTermActivity::class.java)
notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
- val pendingIntent = PendingIntent.getActivity(this, 0, notifyIntent, 0)
+ val flags = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
+ PendingIntent.FLAG_IMMUTABLE
+ } else {
+ 0
+ }
+ val pendingIntent = PendingIntent.getActivity(this, 0, notifyIntent, flags)
val sessionCount = mTerminalSessions.size
val xSessionCount = mXSessions.size
@@ -159,7 +176,7 @@ class NeoTermService : Service() {
builder.addAction(
android.R.drawable.ic_delete,
getString(R.string.exit),
- PendingIntent.getService(this, 0, exitIntent, 0)
+ PendingIntent.getService(this, 0, exitIntent, flags)
)
val newWakeAction = if (lockAcquired) ACTION_RELEASE_LOCK else ACTION_ACQUIRE_LOCK
@@ -171,7 +188,7 @@ class NeoTermService : Service() {
R.string.service_acquire_lock
)
val actionIcon = if (lockAcquired) android.R.drawable.ic_lock_idle_lock else android.R.drawable.ic_lock_lock
- builder.addAction(actionIcon, actionTitle, PendingIntent.getService(this, 0, toggleWakeLockIntent, 0))
+ builder.addAction(actionIcon, actionTitle, PendingIntent.getService(this, 0, toggleWakeLockIntent, flags))
return builder.build()
}
diff --git a/app/src/main/java/io/neoterm/setup/connections.kt b/app/src/main/java/io/neoterm/setup/connections.kt
index 8ba120a3..82f58d05 100644
--- a/app/src/main/java/io/neoterm/setup/connections.kt
+++ b/app/src/main/java/io/neoterm/setup/connections.kt
@@ -65,7 +65,7 @@ abstract class OfflineConnection : SourceConnection {
private var inputStream: InputStream? = null
@Throws(IOException::class)
- protected abstract fun openInputStream(): InputStream
+ protected abstract fun openInputStream(): InputStream?
@Throws(IOException::class)
override fun getInputStream(): InputStream {
@@ -107,7 +107,7 @@ abstract class OfflineConnection : SourceConnection {
open class OfflineUriConnection(private val context: Context, private val uri: Uri) : OfflineConnection() {
@Throws(IOException::class)
- override fun openInputStream(): InputStream {
+ override fun openInputStream(): InputStream? {
return context.contentResolver.openInputStream(uri)
}
}
diff --git a/app/src/main/java/io/neoterm/ui/customize/BaseCustomizeActivity.kt b/app/src/main/java/io/neoterm/ui/customize/BaseCustomizeActivity.kt
index ef60883f..d1ee91c5 100644
--- a/app/src/main/java/io/neoterm/ui/customize/BaseCustomizeActivity.kt
+++ b/app/src/main/java/io/neoterm/ui/customize/BaseCustomizeActivity.kt
@@ -50,8 +50,8 @@ open class BaseCustomizeActivity : AppCompatActivity() {
terminalView.attachSession(session)
}
- override fun onOptionsItemSelected(item: MenuItem?): Boolean {
- when (item?.itemId) {
+ override fun onOptionsItemSelected(item: MenuItem): Boolean {
+ when (item.itemId) {
android.R.id.home -> finish()
}
return super.onOptionsItemSelected(item)
diff --git a/app/src/main/java/io/neoterm/ui/customize/ColorSchemeActivity.kt b/app/src/main/java/io/neoterm/ui/customize/ColorSchemeActivity.kt
index f21c9891..dfb95fe9 100644
--- a/app/src/main/java/io/neoterm/ui/customize/ColorSchemeActivity.kt
+++ b/app/src/main/java/io/neoterm/ui/customize/ColorSchemeActivity.kt
@@ -12,7 +12,6 @@ import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import androidx.recyclerview.widget.LinearLayoutManager
-import com.github.wrdlbrnft.sortedlistadapter.SortedListAdapter
import es.dmoral.coloromatic.ColorOMaticDialog
import es.dmoral.coloromatic.IndicatorMode
import es.dmoral.coloromatic.colormode.ColorMode
@@ -29,12 +28,6 @@ import io.neoterm.utils.Terminals
* @author kiva
*/
class ColorSchemeActivity : BaseCustomizeActivity() {
- private val COMPARATOR = SortedListAdapter.ComparatorBuilder()
- .setOrderForModel(ColorItem::class.java) { a, b ->
- a.colorType.compareTo(b.colorType)
- }
- .build()
-
var changed = false
private lateinit var editingColorScheme: NeoColorScheme
lateinit var adapter: ColorItemAdapter
@@ -51,7 +44,7 @@ class ColorSchemeActivity : BaseCustomizeActivity() {
val terminalView = findViewById(R.id.terminal_view)
Terminals.setupTerminalView(terminalView, null)
- adapter = ColorItemAdapter(this, editingColorScheme, COMPARATOR, object : ColorItemAdapter.Listener {
+ adapter = ColorItemAdapter(this, editingColorScheme, object : ColorItemAdapter.Listener {
override fun onModelClicked(model: ColorItem) {
showItemEditor(model)
}
@@ -67,8 +60,8 @@ class ColorSchemeActivity : BaseCustomizeActivity() {
return true
}
- override fun onOptionsItemSelected(item: MenuItem?): Boolean {
- when (item?.itemId) {
+ override fun onOptionsItemSelected(item: MenuItem): Boolean {
+ when (item.itemId) {
android.R.id.home -> finish()
R.id.action_done -> applyColorScheme(editingColorScheme)
}
diff --git a/app/src/main/java/io/neoterm/ui/customize/CustomizeActivity.kt b/app/src/main/java/io/neoterm/ui/customize/CustomizeActivity.kt
index 3733bd8e..468c8962 100644
--- a/app/src/main/java/io/neoterm/ui/customize/CustomizeActivity.kt
+++ b/app/src/main/java/io/neoterm/ui/customize/CustomizeActivity.kt
@@ -144,8 +144,8 @@ class CustomizeActivity : BaseCustomizeActivity() {
}
}
- override fun onOptionsItemSelected(item: MenuItem?): Boolean {
- when (item?.itemId) {
+ override fun onOptionsItemSelected(item: MenuItem): Boolean {
+ when (item.itemId) {
android.R.id.home -> finish()
}
return super.onOptionsItemSelected(item)
diff --git a/app/src/main/java/io/neoterm/ui/customize/model.kt b/app/src/main/java/io/neoterm/ui/customize/model.kt
index f94e1754..0dbd39e5 100644
--- a/app/src/main/java/io/neoterm/ui/customize/model.kt
+++ b/app/src/main/java/io/neoterm/ui/customize/model.kt
@@ -5,7 +5,9 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
-import com.github.wrdlbrnft.sortedlistadapter.SortedListAdapter
+import androidx.recyclerview.widget.DiffUtil
+import androidx.recyclerview.widget.ListAdapter
+import androidx.recyclerview.widget.RecyclerView
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
import io.neoterm.App
import io.neoterm.R
@@ -15,20 +17,7 @@ import io.neoterm.component.colorscheme.NeoColorScheme
/**
* @author kiva
*/
-class ColorItem(var colorType: Int, var colorValue: String) : SortedListAdapter.ViewModel {
- override fun isSameModelAs(t: T): Boolean {
- if (t is ColorItem) {
- return t.colorName == colorName
- && t.colorValue == colorValue
- && t.colorType == colorType
- }
- return false
- }
-
- override fun isContentTheSameAs(t: T): Boolean {
- return isSameModelAs(t)
- }
-
+class ColorItem(var colorType: Int, var colorValue: String) {
var colorName = App.get().resources
.getStringArray(R.array.color_item_names)[colorType - NeoColorScheme.COLOR_TYPE_BEGIN]
}
@@ -39,18 +28,31 @@ class ColorItem(var colorType: Int, var colorValue: String) : SortedListAdapter.
class ColorItemAdapter(
context: Context,
initColorScheme: NeoColorScheme,
- comparator: Comparator,
private val listener: ColorItemAdapter.Listener
-) : SortedListAdapter(context, ColorItem::class.java, comparator), FastScrollRecyclerView.SectionedAdapter {
+) : ListAdapter(DIFF_CALLBACK),
+ FastScrollRecyclerView.SectionedAdapter {
val colorList = mutableListOf()
+ companion object {
+ private val DIFF_CALLBACK = object : DiffUtil.ItemCallback() {
+ override fun areItemsTheSame(oldItem: ColorItem, newItem: ColorItem): Boolean {
+ return oldItem.colorType == newItem.colorType
+ }
+
+ override fun areContentsTheSame(oldItem: ColorItem, newItem: ColorItem): Boolean {
+ return oldItem.colorType == newItem.colorType &&
+ oldItem.colorValue == newItem.colorValue
+ }
+ }
+ }
+
init {
(NeoColorScheme.COLOR_TYPE_BEGIN..NeoColorScheme.COLOR_TYPE_END)
.forEach {
colorList.add(ColorItem(it, initColorScheme.getColor(it) ?: ""))
}
- edit().add(colorList).commit()
+ submitList(colorList.toList())
}
interface Listener {
@@ -58,33 +60,36 @@ class ColorItemAdapter(
}
override fun getSectionName(position: Int): String {
- return colorList[position].colorName[0].toString()
+ return getItem(position).colorName[0].toString()
}
- override fun onCreateViewHolder(
- inflater: LayoutInflater,
- parent: ViewGroup,
- viewType: Int
- ): ViewHolder {
- val rootView = inflater.inflate(R.layout.item_color, parent, false)
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ColorItemViewHolder {
+ val rootView = LayoutInflater.from(parent.context)
+ .inflate(R.layout.item_color, parent, false)
return ColorItemViewHolder(rootView, listener)
}
-}
-class ColorItemViewHolder(private val rootView: View, private val listener: ColorItemAdapter.Listener) :
- SortedListAdapter.ViewHolder(rootView) {
- private val colorItemName: TextView = rootView.findViewById(R.id.color_item_name)
- private val colorItemDesc: TextView = rootView.findViewById(R.id.color_item_description)
- private val colorView: View = rootView.findViewById(R.id.color_item_view)
+ override fun onBindViewHolder(holder: ColorItemViewHolder, position: Int) {
+ holder.bind(getItem(position))
+ }
+
+ class ColorItemViewHolder(
+ private val rootView: View,
+ private val listener: Listener
+ ) : RecyclerView.ViewHolder(rootView) {
+ private val colorItemName: TextView = rootView.findViewById(R.id.color_item_name)
+ private val colorItemDesc: TextView = rootView.findViewById(R.id.color_item_description)
+ private val colorView: View = rootView.findViewById(R.id.color_item_view)
- override fun performBind(item: ColorItem) {
- rootView.setOnClickListener { listener.onModelClicked(item) }
- colorItemName.text = item.colorName
- colorItemDesc.text = item.colorValue
- if (item.colorValue.isNotEmpty()) {
- val color = TerminalColors.parse(item.colorValue)
- colorView.setBackgroundColor(color)
- colorItemDesc.setTextColor(color)
+ fun bind(item: ColorItem) {
+ rootView.setOnClickListener { listener.onModelClicked(item) }
+ colorItemName.text = item.colorName
+ colorItemDesc.text = item.colorValue
+ if (item.colorValue.isNotEmpty()) {
+ val color = TerminalColors.parse(item.colorValue)
+ colorView.setBackgroundColor(color)
+ colorItemDesc.setTextColor(color)
+ }
}
}
}
diff --git a/app/src/main/java/io/neoterm/ui/other/AboutActivity.kt b/app/src/main/java/io/neoterm/ui/other/AboutActivity.kt
index fd6db939..f414ec35 100644
--- a/app/src/main/java/io/neoterm/ui/other/AboutActivity.kt
+++ b/app/src/main/java/io/neoterm/ui/other/AboutActivity.kt
@@ -77,14 +77,6 @@ class AboutActivity : AppCompatActivity() {
ApacheSoftwareLicense20()
)
)
- notices.addNotice(
- Notice(
- "ModularAdapter",
- "https://wrdlbrnft.github.io/ModularAdapter",
- "Copyright (c) 2017 Wrdlbrnft",
- MITLicense()
- )
- )
notices.addNotice(
Notice(
"RecyclerTabLayout",
@@ -101,14 +93,6 @@ class AboutActivity : AppCompatActivity() {
ApacheSoftwareLicense20()
)
)
- notices.addNotice(
- Notice(
- "SortedListAdapter",
- "https://wrdlbrnft.github.io/SortedListAdapter/",
- "Copyright (c) 2017 Wrdlbrnft",
- MITLicense()
- )
- )
notices.addNotice(
Notice(
"Termux",
@@ -153,8 +137,8 @@ class AboutActivity : AppCompatActivity() {
startActivity(intent)
}
- override fun onOptionsItemSelected(item: MenuItem?): Boolean {
- when (item?.itemId) {
+ override fun onOptionsItemSelected(item: MenuItem): Boolean {
+ when (item.itemId) {
android.R.id.home ->
finish()
}
diff --git a/app/src/main/java/io/neoterm/ui/other/SetupActivity.kt b/app/src/main/java/io/neoterm/ui/other/SetupActivity.kt
index 8e032346..7981aa00 100644
--- a/app/src/main/java/io/neoterm/ui/other/SetupActivity.kt
+++ b/app/src/main/java/io/neoterm/ui/other/SetupActivity.kt
@@ -228,8 +228,8 @@ class SetupActivity : AppCompatActivity(), View.OnClickListener, ResultListener
}
}
- private fun executeAptUpdate() = runApt("update", "-y") {
- it.onSuccess { finish() }
+ private fun executeAptUpdate() = runApt("update") {
+ it.onSuccess { executeAptUpgrade() }
}
private fun executeAptUpgrade() = runApt("upgrade", "-y") {
diff --git a/app/src/main/java/io/neoterm/ui/pm/PackageManagerActivity.kt b/app/src/main/java/io/neoterm/ui/pm/PackageManagerActivity.kt
index 87546add..f8ed0c1c 100644
--- a/app/src/main/java/io/neoterm/ui/pm/PackageManagerActivity.kt
+++ b/app/src/main/java/io/neoterm/ui/pm/PackageManagerActivity.kt
@@ -14,7 +14,6 @@ import androidx.appcompat.widget.SearchView
import androidx.appcompat.widget.Toolbar
import androidx.core.view.MenuItemCompat
import androidx.recyclerview.widget.LinearLayoutManager
-import com.github.wrdlbrnft.sortedlistadapter.SortedListAdapter
import io.neoterm.R
import io.neoterm.component.ComponentManager
import io.neoterm.component.config.NeoPreference
@@ -27,13 +26,7 @@ import java.util.*
* @author kiva
*/
-class PackageManagerActivity : AppCompatActivity(), SearchView.OnQueryTextListener, SortedListAdapter.Callback {
- private val comparator = SortedListAdapter.ComparatorBuilder()
- .setOrderForModel(PackageModel::class.java) { a, b ->
- a.packageInfo.packageName!!.compareTo(b.packageInfo.packageName!!)
- }
- .build()
-
+class PackageManagerActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
lateinit var recyclerView: androidx.recyclerview.widget.RecyclerView
lateinit var adapter: PackageAdapter
var models = listOf()
@@ -47,7 +40,7 @@ class PackageManagerActivity : AppCompatActivity(), SearchView.OnQueryTextListen
recyclerView = findViewById(R.id.pm_package_list)
recyclerView.setHasFixedSize(true)
- adapter = PackageAdapter(this, comparator, object : PackageAdapter.Listener {
+ adapter = PackageAdapter(this, object : PackageAdapter.Listener {
override fun onModelClicked(model: PackageModel) {
AlertDialog.Builder(this@PackageManagerActivity)
.setTitle(model.packageInfo.packageName)
@@ -59,7 +52,6 @@ class PackageManagerActivity : AppCompatActivity(), SearchView.OnQueryTextListen
.show()
}
})
- adapter.addCallback(this)
recyclerView.layoutManager = LinearLayoutManager(this)
recyclerView.adapter = adapter
@@ -80,8 +72,8 @@ class PackageManagerActivity : AppCompatActivity(), SearchView.OnQueryTextListen
return true
}
- override fun onOptionsItemSelected(item: MenuItem?): Boolean {
- when (item?.itemId) {
+ override fun onOptionsItemSelected(item: MenuItem): Boolean {
+ when (item.itemId) {
android.R.id.home -> finish()
R.id.action_source -> changeSource()
R.id.action_update_and_refresh -> executeAptUpdate()
@@ -156,13 +148,13 @@ class PackageManagerActivity : AppCompatActivity(), SearchView.OnQueryTextListen
executeAptUpdate()
}
- private fun executeAptUpdate() = runApt("update -y", ) {
+ private fun executeAptUpdate() = runApt("update") {
it.onSuccess { refreshPackageList() }
}
- private fun executeAptUpgrade() = runApt("update -y") { update ->
+ private fun executeAptUpgrade() = runApt("update") { update ->
update.onSuccess {
- runApt("upgrade -y", "-y") {
+ runApt("upgrade", "-y") {
it.onSuccess { Toast.makeText(this, R.string.apt_upgrade_ok, Toast.LENGTH_SHORT).show() }
}
}
@@ -174,10 +166,12 @@ class PackageManagerActivity : AppCompatActivity(), SearchView.OnQueryTextListen
pm.clearPackages()
sourceFiles.forEach { pm.reloadPackages(it, false) }
- models = pm.packages.values.map { PackageModel(it) }.toList()
+ models = pm.packages.values.map { PackageModel(it) }
+ .sortedBy { it.packageInfo.packageName }
+ .toList()
this@PackageManagerActivity.runOnUiThread {
- adapter.edit().replaceAll(models).commit()
+ adapter.submitList(models)
if (models.isEmpty()) {
Toast.makeText(this@PackageManagerActivity, R.string.package_list_empty, Toast.LENGTH_SHORT).show()
}
@@ -205,22 +199,14 @@ class PackageManagerActivity : AppCompatActivity(), SearchView.OnQueryTextListen
return sortDistance(prepared, query) { it.packageName!! }
.plus(sortDistance(prepared, query) { it.description!! })
.map { it.first }
+ .distinctBy { it.packageInfo.packageName }
.toList()
}
override fun onQueryTextSubmit(text: String?) = false
override fun onQueryTextChange(text: String?): Boolean {
- text?.let { adapter.edit().replaceAll(filter(models, it)).commit() }
+ text?.let { adapter.submitList(filter(models, it)) }
return true
}
-
- override fun onEditStarted() {
- recyclerView.animate().alpha(0.5f)
- }
-
- override fun onEditFinished() {
- recyclerView.scrollToPosition(0)
- recyclerView.animate().alpha(1.0f)
- }
}
diff --git a/app/src/main/java/io/neoterm/ui/pm/model.kt b/app/src/main/java/io/neoterm/ui/pm/model.kt
index bc0b8328..faf082d0 100644
--- a/app/src/main/java/io/neoterm/ui/pm/model.kt
+++ b/app/src/main/java/io/neoterm/ui/pm/model.kt
@@ -5,19 +5,33 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
-import com.github.wrdlbrnft.sortedlistadapter.SortedListAdapter
+import androidx.recyclerview.widget.DiffUtil
+import androidx.recyclerview.widget.ListAdapter
+import androidx.recyclerview.widget.RecyclerView
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
import io.neoterm.R
import io.neoterm.component.pm.NeoPackageInfo
import io.neoterm.utils.formatSizeInKB
class PackageAdapter(
- context: Context,
- comparator: Comparator,
+ private val context: Context,
private val listener: PackageAdapter.Listener
-) : SortedListAdapter(context, PackageModel::class.java, comparator),
+) : ListAdapter(DIFF_CALLBACK),
FastScrollRecyclerView.SectionedAdapter {
+ companion object {
+ private val DIFF_CALLBACK = object : DiffUtil.ItemCallback() {
+ override fun areItemsTheSame(oldItem: PackageModel, newItem: PackageModel): Boolean {
+ return oldItem.packageInfo.packageName == newItem.packageInfo.packageName
+ }
+
+ override fun areContentsTheSame(oldItem: PackageModel, newItem: PackageModel): Boolean {
+ return oldItem.packageInfo.packageName == newItem.packageInfo.packageName &&
+ oldItem.packageInfo.version == newItem.packageInfo.version
+ }
+ }
+ }
+
override fun getSectionName(position: Int): String {
return getItem(position).packageInfo.packageName?.substring(0, 1) ?: "#"
}
@@ -26,25 +40,28 @@ class PackageAdapter(
fun onModelClicked(model: PackageModel)
}
- override fun onCreateViewHolder(
- inflater: LayoutInflater,
- parent: ViewGroup,
- viewType: Int
- ): ViewHolder {
- val rootView = inflater.inflate(R.layout.item_package, parent, false)
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PackageViewHolder {
+ val rootView = LayoutInflater.from(parent.context)
+ .inflate(R.layout.item_package, parent, false)
return PackageViewHolder(rootView, listener)
}
-}
-class PackageViewHolder(private val rootView: View, private val listener: PackageAdapter.Listener) :
- SortedListAdapter.ViewHolder(rootView) {
- private val packageNameView: TextView = rootView.findViewById(R.id.package_item_name)
- private val packageDescView: TextView = rootView.findViewById(R.id.package_item_desc)
+ override fun onBindViewHolder(holder: PackageViewHolder, position: Int) {
+ holder.bind(getItem(position))
+ }
+
+ class PackageViewHolder(
+ private val rootView: View,
+ private val listener: Listener
+ ) : RecyclerView.ViewHolder(rootView) {
+ private val packageNameView: TextView = rootView.findViewById(R.id.package_item_name)
+ private val packageDescView: TextView = rootView.findViewById(R.id.package_item_desc)
- override fun performBind(item: PackageModel) {
- rootView.setOnClickListener { listener.onModelClicked(item) }
- packageNameView.text = item.packageInfo.packageName
- packageDescView.text = item.packageInfo.description
+ fun bind(item: PackageModel) {
+ rootView.setOnClickListener { listener.onModelClicked(item) }
+ packageNameView.text = item.packageInfo.packageName
+ packageDescView.text = item.packageInfo.description
+ }
}
}
@@ -52,18 +69,7 @@ class PackageViewHolder(private val rootView: View, private val listener: Packag
* @author kiva
*/
-class PackageModel(val packageInfo: NeoPackageInfo) : SortedListAdapter.ViewModel {
- override fun isSameModelAs(t: T): Boolean {
- if (t is PackageModel) {
- return t.packageInfo.packageName == packageInfo.packageName
- }
- return false
- }
-
- override fun isContentTheSameAs(t: T): Boolean {
- return isSameModelAs(t)
- }
-
+class PackageModel(val packageInfo: NeoPackageInfo) {
fun getPackageDetails(context: Context): String {
return context.getString(
R.string.package_details,
diff --git a/app/src/main/java/io/neoterm/ui/settings/GeneralSettingsActivity.kt b/app/src/main/java/io/neoterm/ui/settings/GeneralSettingsActivity.kt
index 0a2156db..2aa27fa1 100644
--- a/app/src/main/java/io/neoterm/ui/settings/GeneralSettingsActivity.kt
+++ b/app/src/main/java/io/neoterm/ui/settings/GeneralSettingsActivity.kt
@@ -50,8 +50,8 @@ class GeneralSettingsActivity : BasePreferenceActivity() {
override fun onBuildHeaders(target: MutableList?) {
}
- override fun onOptionsItemSelected(item: MenuItem?): Boolean {
- when (item?.itemId) {
+ override fun onOptionsItemSelected(item: MenuItem): Boolean {
+ when (item.itemId) {
android.R.id.home -> finish()
}
return super.onOptionsItemSelected(item)
diff --git a/app/src/main/java/io/neoterm/ui/settings/SettingActivity.kt b/app/src/main/java/io/neoterm/ui/settings/SettingActivity.kt
index 889052e1..7c2cc637 100644
--- a/app/src/main/java/io/neoterm/ui/settings/SettingActivity.kt
+++ b/app/src/main/java/io/neoterm/ui/settings/SettingActivity.kt
@@ -19,8 +19,8 @@ class SettingActivity : BasePreferenceActivity() {
override fun onBuildHeaders(target: MutableList?) {
}
- override fun onOptionsItemSelected(item: MenuItem?): Boolean {
- when (item?.itemId) {
+ override fun onOptionsItemSelected(item: MenuItem): Boolean {
+ when (item.itemId) {
android.R.id.home ->
finish()
}
diff --git a/app/src/main/java/io/neoterm/ui/settings/UISettingsActivity.kt b/app/src/main/java/io/neoterm/ui/settings/UISettingsActivity.kt
index d0d2c81c..a8e8e908 100644
--- a/app/src/main/java/io/neoterm/ui/settings/UISettingsActivity.kt
+++ b/app/src/main/java/io/neoterm/ui/settings/UISettingsActivity.kt
@@ -19,8 +19,8 @@ class UISettingsActivity : BasePreferenceActivity() {
override fun onBuildHeaders(target: MutableList?) {
}
- override fun onOptionsItemSelected(item: MenuItem?): Boolean {
- when (item?.itemId) {
+ override fun onOptionsItemSelected(item: MenuItem): Boolean {
+ when (item.itemId) {
android.R.id.home ->
finish()
}
diff --git a/app/src/main/java/io/neoterm/ui/term/NeoTermActivity.kt b/app/src/main/java/io/neoterm/ui/term/NeoTermActivity.kt
index acdc9cc0..6c355b19 100644
--- a/app/src/main/java/io/neoterm/ui/term/NeoTermActivity.kt
+++ b/app/src/main/java/io/neoterm/ui/term/NeoTermActivity.kt
@@ -4,6 +4,7 @@ import android.Manifest
import android.content.*
import android.content.pm.PackageManager
import android.content.res.Configuration
+import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.os.IBinder
@@ -70,18 +71,9 @@ class NeoTermActivity : AppCompatActivity(), ServiceConnection, SharedPreference
)
}
- val SDCARD_PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE = 1
- if (ContextCompat.checkSelfPermission(
- this,
- Manifest.permission.WRITE_EXTERNAL_STORAGE
- ) != PackageManager.PERMISSION_GRANTED
- ) {
- ActivityCompat.requestPermissions(
- this,
- arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE),
- SDCARD_PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE
- )
- }
+ // Storage permissions are handled in NeoPermission.initAppPermission
+ // for older Android versions. On Android 13+, shared storage requires
+ // different permissions or All Files Access which we don't force here.
setContentView(R.layout.ui_main)
@@ -153,8 +145,8 @@ class NeoTermActivity : AppCompatActivity(), ServiceConnection, SharedPreference
return true
}
- override fun onOptionsItemSelected(item: MenuItem?): Boolean {
- return when (item?.itemId) {
+ override fun onOptionsItemSelected(item: MenuItem): Boolean {
+ return when (item.itemId) {
R.id.menu_item_settings -> {
startActivity(Intent(this, SettingActivity::class.java))
true
@@ -296,15 +288,7 @@ class NeoTermActivity : AppCompatActivity(), ServiceConnection, SharedPreference
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray) {
when (requestCode) {
NeoPermission.REQUEST_APP_PERMISSION -> {
- if (grantResults.isEmpty()
- || grantResults[0] != PackageManager.PERMISSION_GRANTED
- ) {
- AlertDialog.Builder(this).setMessage(R.string.permission_denied)
- .setPositiveButton(android.R.string.ok, { _: DialogInterface, _: Int ->
- finish()
- })
- .show()
- }
+ // We no longer exit the app if optional permissions like notifications are denied.
return
}
}
diff --git a/app/src/main/java/io/neoterm/utils/NeoPermission.kt b/app/src/main/java/io/neoterm/utils/NeoPermission.kt
index b89ccfe8..69dcbedb 100644
--- a/app/src/main/java/io/neoterm/utils/NeoPermission.kt
+++ b/app/src/main/java/io/neoterm/utils/NeoPermission.kt
@@ -4,6 +4,7 @@ import android.Manifest
import android.content.ActivityNotFoundException
import android.content.DialogInterface
import android.content.pm.PackageManager
+import android.os.Build
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
@@ -16,37 +17,30 @@ object NeoPermission {
const val REQUEST_APP_PERMISSION = 10086
fun initAppPermission(context: AppCompatActivity, requestCode: Int) {
- if (ContextCompat.checkSelfPermission(
- context,
- Manifest.permission.READ_EXTERNAL_STORAGE
- )
- != PackageManager.PERMISSION_GRANTED
- ) {
+ val permissions = ArrayList()
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
+ if (ContextCompat.checkSelfPermission(context, Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) {
+ permissions.add(Manifest.permission.POST_NOTIFICATIONS)
+ }
+ }
- if (ActivityCompat.shouldShowRequestPermissionRationale(
- context,
- Manifest.permission.READ_EXTERNAL_STORAGE
- )
- ) {
- AlertDialog.Builder(context).setMessage("需要存储权限来访问存储设备上的文件")
- .setPositiveButton(android.R.string.ok, { _: DialogInterface, _: Int ->
- doRequestPermission(context, requestCode)
- })
- .show()
+ // On Android 13+ (API 33), READ_EXTERNAL_STORAGE is deprecated and always denied.
+ // We only request it for older versions.
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
+ if (ContextCompat.checkSelfPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
+ permissions.add(Manifest.permission.READ_EXTERNAL_STORAGE)
+ }
+ }
- } else {
- doRequestPermission(context, requestCode)
- }
+ if (permissions.isNotEmpty()) {
+ doRequestPermission(context, permissions.toTypedArray(), requestCode)
}
}
- private fun doRequestPermission(context: AppCompatActivity, requestCode: Int) {
+ private fun doRequestPermission(context: AppCompatActivity, permissions: Array, requestCode: Int) {
try {
- ActivityCompat.requestPermissions(
- context,
- arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE),
- requestCode
- )
+ ActivityCompat.requestPermissions(context, permissions, requestCode)
} catch (ignore: ActivityNotFoundException) {
// for MIUI, we ignore it.
}
diff --git a/app/src/main/res/bak/drawable-hdpi/ic_add_box_white_24dp.png b/app/src/main/res/bak/drawable-hdpi/ic_add_box_white_24dp.png
new file mode 100755
index 00000000..50814b49
Binary files /dev/null and b/app/src/main/res/bak/drawable-hdpi/ic_add_box_white_24dp.png differ
diff --git a/app/src/main/res/bak/drawable-hdpi/ic_apps_white_36dp.png b/app/src/main/res/bak/drawable-hdpi/ic_apps_white_36dp.png
new file mode 100644
index 00000000..5098d29f
Binary files /dev/null and b/app/src/main/res/bak/drawable-hdpi/ic_apps_white_36dp.png differ
diff --git a/app/src/main/res/bak/drawable-hdpi/ic_backup_restore_white_36dp.png b/app/src/main/res/bak/drawable-hdpi/ic_backup_restore_white_36dp.png
new file mode 100644
index 00000000..94a9bd60
Binary files /dev/null and b/app/src/main/res/bak/drawable-hdpi/ic_backup_restore_white_36dp.png differ
diff --git a/app/src/main/res/bak/drawable-hdpi/ic_customization_white_36dp.png b/app/src/main/res/bak/drawable-hdpi/ic_customization_white_36dp.png
new file mode 100644
index 00000000..cf8ce668
Binary files /dev/null and b/app/src/main/res/bak/drawable-hdpi/ic_customization_white_36dp.png differ
diff --git a/app/src/main/res/bak/drawable-hdpi/ic_done.png b/app/src/main/res/bak/drawable-hdpi/ic_done.png
new file mode 100644
index 00000000..c6ce47d9
Binary files /dev/null and b/app/src/main/res/bak/drawable-hdpi/ic_done.png differ
diff --git a/app/src/main/res/bak/drawable-hdpi/ic_general_white_36dp.png b/app/src/main/res/bak/drawable-hdpi/ic_general_white_36dp.png
new file mode 100644
index 00000000..3a617247
Binary files /dev/null and b/app/src/main/res/bak/drawable-hdpi/ic_general_white_36dp.png differ
diff --git a/app/src/main/res/bak/drawable-hdpi/ic_guide_white_36dp.png b/app/src/main/res/bak/drawable-hdpi/ic_guide_white_36dp.png
new file mode 100644
index 00000000..d8e156be
Binary files /dev/null and b/app/src/main/res/bak/drawable-hdpi/ic_guide_white_36dp.png differ
diff --git a/app/src/main/res/bak/drawable-hdpi/ic_info_white_36dp.png b/app/src/main/res/bak/drawable-hdpi/ic_info_white_36dp.png
new file mode 100644
index 00000000..00f53edc
Binary files /dev/null and b/app/src/main/res/bak/drawable-hdpi/ic_info_white_36dp.png differ
diff --git a/app/src/main/res/bak/drawable-hdpi/ic_install_white_36.png b/app/src/main/res/bak/drawable-hdpi/ic_install_white_36.png
new file mode 100644
index 00000000..0c7011ba
Binary files /dev/null and b/app/src/main/res/bak/drawable-hdpi/ic_install_white_36.png differ
diff --git a/app/src/main/res/bak/drawable-hdpi/ic_search.png b/app/src/main/res/bak/drawable-hdpi/ic_search.png
new file mode 100644
index 00000000..407fb1be
Binary files /dev/null and b/app/src/main/res/bak/drawable-hdpi/ic_search.png differ
diff --git a/app/src/main/res/bak/drawable-hdpi/ic_ui_white_36dp.png b/app/src/main/res/bak/drawable-hdpi/ic_ui_white_36dp.png
new file mode 100644
index 00000000..7a3362a4
Binary files /dev/null and b/app/src/main/res/bak/drawable-hdpi/ic_ui_white_36dp.png differ
diff --git a/app/src/main/res/bak/drawable-mdpi/ic_add_box_white_24dp.png b/app/src/main/res/bak/drawable-mdpi/ic_add_box_white_24dp.png
new file mode 100755
index 00000000..de65263c
Binary files /dev/null and b/app/src/main/res/bak/drawable-mdpi/ic_add_box_white_24dp.png differ
diff --git a/app/src/main/res/bak/drawable-mdpi/ic_search.png b/app/src/main/res/bak/drawable-mdpi/ic_search.png
new file mode 100644
index 00000000..55c36f9c
Binary files /dev/null and b/app/src/main/res/bak/drawable-mdpi/ic_search.png differ
diff --git a/app/src/main/res/bak/drawable-xhdpi/ic_add_box_white_24dp.png b/app/src/main/res/bak/drawable-xhdpi/ic_add_box_white_24dp.png
new file mode 100755
index 00000000..97c73d81
Binary files /dev/null and b/app/src/main/res/bak/drawable-xhdpi/ic_add_box_white_24dp.png differ
diff --git a/app/src/main/res/bak/drawable-xhdpi/ic_search.png b/app/src/main/res/bak/drawable-xhdpi/ic_search.png
new file mode 100644
index 00000000..2d270ff6
Binary files /dev/null and b/app/src/main/res/bak/drawable-xhdpi/ic_search.png differ
diff --git a/app/src/main/res/bak/drawable-xxhdpi/ic_add_box_white_24dp.png b/app/src/main/res/bak/drawable-xxhdpi/ic_add_box_white_24dp.png
new file mode 100755
index 00000000..4d054c94
Binary files /dev/null and b/app/src/main/res/bak/drawable-xxhdpi/ic_add_box_white_24dp.png differ
diff --git a/app/src/main/res/bak/drawable-xxhdpi/ic_search.png b/app/src/main/res/bak/drawable-xxhdpi/ic_search.png
new file mode 100644
index 00000000..d0d4d59e
Binary files /dev/null and b/app/src/main/res/bak/drawable-xxhdpi/ic_search.png differ
diff --git a/app/src/main/res/bak/drawable-xxhdpi/text_select_handle_left_mtrl_alpha.png b/app/src/main/res/bak/drawable-xxhdpi/text_select_handle_left_mtrl_alpha.png
new file mode 100755
index 00000000..39818db8
Binary files /dev/null and b/app/src/main/res/bak/drawable-xxhdpi/text_select_handle_left_mtrl_alpha.png differ
diff --git a/app/src/main/res/bak/drawable-xxhdpi/text_select_handle_right_mtrl_alpha.png b/app/src/main/res/bak/drawable-xxhdpi/text_select_handle_right_mtrl_alpha.png
new file mode 100755
index 00000000..260e090b
Binary files /dev/null and b/app/src/main/res/bak/drawable-xxhdpi/text_select_handle_right_mtrl_alpha.png differ
diff --git a/app/src/main/res/bak/drawable-xxxhdpi/ic_add_box_white_24dp.png b/app/src/main/res/bak/drawable-xxxhdpi/ic_add_box_white_24dp.png
new file mode 100755
index 00000000..1f300d61
Binary files /dev/null and b/app/src/main/res/bak/drawable-xxxhdpi/ic_add_box_white_24dp.png differ
diff --git a/app/src/main/res/bak/drawable/banner.png b/app/src/main/res/bak/drawable/banner.png
new file mode 100644
index 00000000..43f24118
Binary files /dev/null and b/app/src/main/res/bak/drawable/banner.png differ
diff --git a/app/src/main/res/bak/drawable/ic_description.xml b/app/src/main/res/bak/drawable/ic_description.xml
new file mode 100644
index 00000000..420b0f44
--- /dev/null
+++ b/app/src/main/res/bak/drawable/ic_description.xml
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/drawable/ic_donate.xml b/app/src/main/res/bak/drawable/ic_donate.xml
new file mode 100644
index 00000000..26d0c344
--- /dev/null
+++ b/app/src/main/res/bak/drawable/ic_donate.xml
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/drawable/ic_github.xml b/app/src/main/res/bak/drawable/ic_github.xml
new file mode 100644
index 00000000..c53efbb9
--- /dev/null
+++ b/app/src/main/res/bak/drawable/ic_github.xml
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/drawable/ic_info.xml b/app/src/main/res/bak/drawable/ic_info.xml
new file mode 100644
index 00000000..3a075bdc
--- /dev/null
+++ b/app/src/main/res/bak/drawable/ic_info.xml
@@ -0,0 +1,10 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/drawable/ic_neoterm.xml b/app/src/main/res/bak/drawable/ic_neoterm.xml
new file mode 100644
index 00000000..9f2bc7e1
--- /dev/null
+++ b/app/src/main/res/bak/drawable/ic_neoterm.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/drawable/ic_new_session.xml b/app/src/main/res/bak/drawable/ic_new_session.xml
new file mode 100644
index 00000000..3f640423
--- /dev/null
+++ b/app/src/main/res/bak/drawable/ic_new_session.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/drawable/ic_person.xml b/app/src/main/res/bak/drawable/ic_person.xml
new file mode 100644
index 00000000..a3b0459d
--- /dev/null
+++ b/app/src/main/res/bak/drawable/ic_person.xml
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/drawable/ic_tab_icon.png b/app/src/main/res/bak/drawable/ic_tab_icon.png
new file mode 100644
index 00000000..fb16a443
Binary files /dev/null and b/app/src/main/res/bak/drawable/ic_tab_icon.png differ
diff --git a/app/src/main/res/bak/drawable/ic_terminal_running.xml b/app/src/main/res/bak/drawable/ic_terminal_running.xml
new file mode 100755
index 00000000..4e28fd19
--- /dev/null
+++ b/app/src/main/res/bak/drawable/ic_terminal_running.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
diff --git a/app/src/main/res/bak/drawable/plat_logo.png b/app/src/main/res/bak/drawable/plat_logo.png
new file mode 100644
index 00000000..6b8efe28
Binary files /dev/null and b/app/src/main/res/bak/drawable/plat_logo.png differ
diff --git a/app/src/main/res/bak/drawable/text_select_handle_left_material.xml b/app/src/main/res/bak/drawable/text_select_handle_left_material.xml
new file mode 100755
index 00000000..7e447c22
--- /dev/null
+++ b/app/src/main/res/bak/drawable/text_select_handle_left_material.xml
@@ -0,0 +1,4 @@
+
+
diff --git a/app/src/main/res/bak/drawable/text_select_handle_right_material.xml b/app/src/main/res/bak/drawable/text_select_handle_right_material.xml
new file mode 100755
index 00000000..1d1e65b0
--- /dev/null
+++ b/app/src/main/res/bak/drawable/text_select_handle_right_material.xml
@@ -0,0 +1,4 @@
+
+
diff --git a/app/src/main/res/bak/layout/dialog_edit_text.xml b/app/src/main/res/bak/layout/dialog_edit_text.xml
new file mode 100644
index 00000000..4fa8d000
--- /dev/null
+++ b/app/src/main/res/bak/layout/dialog_edit_text.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/layout/dialog_edit_two_text.xml b/app/src/main/res/bak/layout/dialog_edit_two_text.xml
new file mode 100644
index 00000000..714ab12a
--- /dev/null
+++ b/app/src/main/res/bak/layout/dialog_edit_two_text.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/layout/item_color.xml b/app/src/main/res/bak/layout/item_color.xml
new file mode 100644
index 00000000..4a65ffee
--- /dev/null
+++ b/app/src/main/res/bak/layout/item_color.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/layout/item_complete_candidate.xml b/app/src/main/res/bak/layout/item_complete_candidate.xml
new file mode 100644
index 00000000..5419fab9
--- /dev/null
+++ b/app/src/main/res/bak/layout/item_complete_candidate.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/layout/item_package.xml b/app/src/main/res/bak/layout/item_package.xml
new file mode 100644
index 00000000..b5fa57eb
--- /dev/null
+++ b/app/src/main/res/bak/layout/item_package.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/layout/layout_pm_package_list.xml b/app/src/main/res/bak/layout/layout_pm_package_list.xml
new file mode 100644
index 00000000..e9a0fadb
--- /dev/null
+++ b/app/src/main/res/bak/layout/layout_pm_package_list.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/layout/popup_auto_complete.xml b/app/src/main/res/bak/layout/popup_auto_complete.xml
new file mode 100644
index 00000000..0d0e5947
--- /dev/null
+++ b/app/src/main/res/bak/layout/popup_auto_complete.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
diff --git a/app/src/main/res/bak/layout/ui_about.xml b/app/src/main/res/bak/layout/ui_about.xml
new file mode 100644
index 00000000..b9c69d6c
--- /dev/null
+++ b/app/src/main/res/bak/layout/ui_about.xml
@@ -0,0 +1,265 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/bak/layout/ui_color_scheme.xml b/app/src/main/res/bak/layout/ui_color_scheme.xml
new file mode 100644
index 00000000..bb2c600d
--- /dev/null
+++ b/app/src/main/res/bak/layout/ui_color_scheme.xml
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/bak/layout/ui_command_shortcut.xml b/app/src/main/res/bak/layout/ui_command_shortcut.xml
new file mode 100644
index 00000000..43c76782
--- /dev/null
+++ b/app/src/main/res/bak/layout/ui_command_shortcut.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/layout/ui_crash.xml b/app/src/main/res/bak/layout/ui_crash.xml
new file mode 100644
index 00000000..2c4950f1
--- /dev/null
+++ b/app/src/main/res/bak/layout/ui_crash.xml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/layout/ui_customize.xml b/app/src/main/res/bak/layout/ui_customize.xml
new file mode 100644
index 00000000..dfd275bd
--- /dev/null
+++ b/app/src/main/res/bak/layout/ui_customize.xml
@@ -0,0 +1,122 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/bak/layout/ui_faq.xml b/app/src/main/res/bak/layout/ui_faq.xml
new file mode 100644
index 00000000..c4fd8408
--- /dev/null
+++ b/app/src/main/res/bak/layout/ui_faq.xml
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/bak/layout/ui_main.xml b/app/src/main/res/bak/layout/ui_main.xml
new file mode 100644
index 00000000..61f5ea5f
--- /dev/null
+++ b/app/src/main/res/bak/layout/ui_main.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/layout/ui_pm.xml b/app/src/main/res/bak/layout/ui_pm.xml
new file mode 100644
index 00000000..a9b83b7e
--- /dev/null
+++ b/app/src/main/res/bak/layout/ui_pm.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/bak/layout/ui_pm_single_tab.xml b/app/src/main/res/bak/layout/ui_pm_single_tab.xml
new file mode 100644
index 00000000..ceca52d3
--- /dev/null
+++ b/app/src/main/res/bak/layout/ui_pm_single_tab.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/bak/layout/ui_setup.xml b/app/src/main/res/bak/layout/ui_setup.xml
new file mode 100644
index 00000000..ec2de0fd
--- /dev/null
+++ b/app/src/main/res/bak/layout/ui_setup.xml
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/bak/layout/ui_term.xml b/app/src/main/res/bak/layout/ui_term.xml
new file mode 100644
index 00000000..2d561e15
--- /dev/null
+++ b/app/src/main/res/bak/layout/ui_term.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/bak/layout/ui_term_dialog.xml b/app/src/main/res/bak/layout/ui_term_dialog.xml
new file mode 100644
index 00000000..9c8b3c9f
--- /dev/null
+++ b/app/src/main/res/bak/layout/ui_term_dialog.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
diff --git a/app/src/main/res/bak/layout/ui_term_embedded.xml b/app/src/main/res/bak/layout/ui_term_embedded.xml
new file mode 100644
index 00000000..c74f7756
--- /dev/null
+++ b/app/src/main/res/bak/layout/ui_term_embedded.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
diff --git a/app/src/main/res/bak/layout/ui_user_script_list.xml b/app/src/main/res/bak/layout/ui_user_script_list.xml
new file mode 100644
index 00000000..1b6a9e16
--- /dev/null
+++ b/app/src/main/res/bak/layout/ui_user_script_list.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/layout/ui_xorg.xml b/app/src/main/res/bak/layout/ui_xorg.xml
new file mode 100644
index 00000000..2da34c6e
--- /dev/null
+++ b/app/src/main/res/bak/layout/ui_xorg.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/app/src/main/res/bak/menu/menu_color_editor.xml b/app/src/main/res/bak/menu/menu_color_editor.xml
new file mode 100644
index 00000000..97318bac
--- /dev/null
+++ b/app/src/main/res/bak/menu/menu_color_editor.xml
@@ -0,0 +1,9 @@
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/menu/menu_main.xml b/app/src/main/res/bak/menu/menu_main.xml
new file mode 100755
index 00000000..d173e3c0
--- /dev/null
+++ b/app/src/main/res/bak/menu/menu_main.xml
@@ -0,0 +1,48 @@
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/menu/menu_pm.xml b/app/src/main/res/bak/menu/menu_pm.xml
new file mode 100644
index 00000000..61269732
--- /dev/null
+++ b/app/src/main/res/bak/menu/menu_pm.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/mipmap-hdpi/about_logo.png b/app/src/main/res/bak/mipmap-hdpi/about_logo.png
new file mode 100644
index 00000000..63f78323
Binary files /dev/null and b/app/src/main/res/bak/mipmap-hdpi/about_logo.png differ
diff --git a/app/src/main/res/bak/mipmap-hdpi/ic_danger.png b/app/src/main/res/bak/mipmap-hdpi/ic_danger.png
new file mode 100644
index 00000000..feb77cc9
Binary files /dev/null and b/app/src/main/res/bak/mipmap-hdpi/ic_danger.png differ
diff --git a/app/src/main/res/bak/mipmap-xhdpi/about_logo.png b/app/src/main/res/bak/mipmap-xhdpi/about_logo.png
new file mode 100644
index 00000000..c76ab807
Binary files /dev/null and b/app/src/main/res/bak/mipmap-xhdpi/about_logo.png differ
diff --git a/app/src/main/res/bak/mipmap-xhdpi/ic_danger.png b/app/src/main/res/bak/mipmap-xhdpi/ic_danger.png
new file mode 100644
index 00000000..c003563a
Binary files /dev/null and b/app/src/main/res/bak/mipmap-xhdpi/ic_danger.png differ
diff --git a/app/src/main/res/bak/mipmap-xxhdpi/about_logo.png b/app/src/main/res/bak/mipmap-xxhdpi/about_logo.png
new file mode 100644
index 00000000..a5153fda
Binary files /dev/null and b/app/src/main/res/bak/mipmap-xxhdpi/about_logo.png differ
diff --git a/app/src/main/res/bak/mipmap-xxhdpi/ic_danger.png b/app/src/main/res/bak/mipmap-xxhdpi/ic_danger.png
new file mode 100644
index 00000000..6f4021d3
Binary files /dev/null and b/app/src/main/res/bak/mipmap-xxhdpi/ic_danger.png differ
diff --git a/app/src/main/res/bak/mipmap-xxxhdpi/about_logo.png b/app/src/main/res/bak/mipmap-xxxhdpi/about_logo.png
new file mode 100644
index 00000000..cff2a50e
Binary files /dev/null and b/app/src/main/res/bak/mipmap-xxxhdpi/about_logo.png differ
diff --git a/app/src/main/res/bak/mipmap-xxxhdpi/ic_danger.png b/app/src/main/res/bak/mipmap-xxxhdpi/ic_danger.png
new file mode 100644
index 00000000..a3cd14d9
Binary files /dev/null and b/app/src/main/res/bak/mipmap-xxxhdpi/ic_danger.png differ
diff --git a/app/src/main/res/bak/mipmap-xxxhdpi/ic_launcher_neoterm_round.png b/app/src/main/res/bak/mipmap-xxxhdpi/ic_launcher_neoterm_round.png
new file mode 100644
index 00000000..efe95a59
Binary files /dev/null and b/app/src/main/res/bak/mipmap-xxxhdpi/ic_launcher_neoterm_round.png differ
diff --git a/app/src/main/res/bak/raw/bell.ogg b/app/src/main/res/bak/raw/bell.ogg
new file mode 100755
index 00000000..674f25d0
Binary files /dev/null and b/app/src/main/res/bak/raw/bell.ogg differ
diff --git a/app/src/main/res/bak/values-zh-rCN/strings.xml b/app/src/main/res/bak/values-zh-rCN/strings.xml
new file mode 100644
index 00000000..d2623d7b
--- /dev/null
+++ b/app/src/main/res/bak/values-zh-rCN/strings.xml
@@ -0,0 +1,208 @@
+
+
+ Ergo Node
+ 关于
+ 复制
+ 通用设置
+ 新建会话
+ 新建会话…
+ 新建系统会话
+ 软件包
+ 粘贴
+ 高级粘贴
+ 返回键发送ESC
+ 当返回键按下时,发送ESC而不是关闭窗口
+ 响铃
+ 收到 \'\\a\' 时响铃
+ 登录程序
+ 登录时使用指定的程序
+ 振动
+ 收到 \'\\a\' 时振动
+ 初始命令
+ 在新的会话创建时执行命令
+ 将音量键作为特殊键
+ 音量下为 Ctrl\n音量上为 FN
+ 使用自定义的 execve()
+ 接管 execve() 来兼容 linux 风格的 shebang
+ 启用基于单词的输入法
+ 输入单位为单词而不是字母(谷歌输入法无法输入中文可以勾选此选项)
+ 软件源
+ 向下切换窗口
+ 关闭当前窗口时切换到下一个窗口而不是上一个
+ 字体,主题
+ 个性化
+ 全屏
+ 隐藏标题栏
+ 键盘显示时隐藏标题栏
+ 为快捷键盘强制设置权重
+ 如果快捷键盘显示不正确,请勾选本项
+ 显示拓展键
+ 屏幕下方出现一行有方向键,esc 键之类的按键
+ 配色方案
+ 字体
+ 设置
+ 更多
+ 切换键盘
+ 切换窗口
+ 界面设置
+ 登录程序 %s 未找到
+ 你想要安装它吗?
+ 准备中
+ 将要安装 oh-my-zsh 并将您的登录程序切换到 zsh
+ 全屏模式已改变,请重启 NeoTerm
+ Ergo Node 无法取得必需的权限,正在退出
+ 还有这种操作?
+ 使用系统会话
+ 重试
+ APT 源已更改,你可能需要执行 apt update 来更新
+ 软件包: %s\n版本: %s\n依赖: %s\n占用空间: %s\n描述: %s\n主页: %s
+ 软件包列表为空,请检查你的软件源
+ 刷新
+ 更新并刷新
+ 浮动窗口
+
+ 完成
+ 正在准备
+
+ 拓展键盘
+ 响铃,振动,Shell,初始命令
+ 全屏,标题栏,切换动画
+ 软件源,更新,升级
+ 安装字体
+ 安装配色方案
+
+ Ergo Node
+ 启动节点
+ 选择你的安装方式
+ 从软件源安装
+ 从本地 Zip 文件安装
+ 从备份中恢复
+ 配置参数
+ 输入配置参数
+ 含有启动文件的软件源地址
+ 启动文件(*.zip)路径
+ 备份文件(*.neobackup) 路径
+ 文件不存在
+ 非法的 URL
+ 无网络连接
+ 无法连接到服务器
+ 配置参数为空
+ 准备中…
+ 欢迎使用 Ergo Node Android 版!
+ Ergo Node 需要约 25GB 的空闲存储空间... 继续吗?
+ 重置确认
+ 这个操作会清空你的所有数据,是否继续?
+
+ 设备: %s
+ 应用: %s
+ 堆栈信息
+ %d 个会话, %d 个图形会话
+ (永不休眠)
+ 取得休眠锁
+ 释放休眠锁
+ 退出
+ 在此处打开终端
+ 用户脚本
+ 没有找到可用的用户脚本 (是否忘记设置可执行权限?)
+ 没有文件被选择\n\n(原始 Intent: %s)
+ 不支持在此处打开终端\n\n(原始 Intent: %s)
+ 处理的文件
+ 可用的用户脚本
+ 从操作列表中移除文件?
+ 移除?
+ 命令快捷方式
+ 标题
+ 命令
+ 没有找到需要执行的命令,是否忘记了传递参数?
+ 展示标题不可为空
+ 自动补全(实验性)
+ 输入命令或者路径时提供补全。该功能还在开发中,有许多bug需要解决
+ 升级
+ 软件包列表成功更新
+ 软件包已成功升级
+ 安装已开始,请注意屏幕上出现的提示
+ 会话已关闭
+ 取消
+ 查看帮助
+ 无法连接到服务
+ 版本
+
+ 第三方库
+ 源码
+ 重置 App
+ 清除除用户家目录以外的所有文件
+
+
+
+
+
+ 新建配色方案
+ 常见问题
+ 新建
+ 进程已结束
+ 状态 %d
+ 信号 %d
+ 按回车关闭
+ 按返回关闭
+ 输入新的配色方案名
+ 新配色方案
+ 保存配色方案
+ 丢弃所有改动?
+ 保存
+ 选择
+ 输入新颜色
+ 切换拓展键
+ 新建图形会话
+ 新建 Profile 会话
+ 没有可用的个性化配置
+ 没有文件选择器
+ 输入 URL
+ 输入仓库名
+ URL 不能为空
+ 仓库 不能为空
+ 本功能仍在开发中,所以只能在 DEBUG 构建版本下使用。\n若想尝鲜,请尝试联系开发者来成为测试者。
+ 危险区域
+ 执行此操作后,下次启动时将要重新配置 Ergo Node,继续?
+
+
+ - 背景色
+ - 前景色
+ - 光标颜色
+ - 黑色
+ - 红色
+ - 绿色
+ - 黄色
+ - 蓝色
+ - 洋红色
+ - 青色
+ - 白色
+ - 亮黑色
+ - 亮红色
+ - 亮绿色
+ - 亮黄色
+ - 亮蓝色
+ - 亮洋红色
+ - 亮青色
+ - 亮白色
+
+
+
+ - 你好 NeoTerm\\n
+ - "\\e[30m 黑色 \\e[0m\\n"
+ - "\\e[31m 红色 \\e[0m\\n"
+ - "\\e[32m 绿色 \\e[0m\\n"
+ - "\\e[33m 黄色 \\e[0m\\n"
+ - "\\e[34m 蓝色 \\e[0m\\n"
+ - "\\e[35m 洋红色 \\e[0m\\n"
+ - "\\e[36m 青色 \\e[0m\\n"
+ - "\\e[37m 白色 \\e[0m\\n"
+ - "\\e[1;30m 亮黑色 \\e[0m\\n"
+ - "\\e[1;31m 亮红色 \\e[0m\\n"
+ - "\\e[1;32m 亮绿色 \\e[0m\\n"
+ - "\\e[1;33m 亮黄色 \\e[0m\\n"
+ - "\\e[1;34m 亮蓝色 \\e[0m\\n"
+ - "\\e[1;35m 亮洋红色\\e[0m\\n"
+ - "\\e[1;36m 亮青色 \\e[0m\\n"
+ - "\\e[1;37m 亮白色 \\e[0m\\n"
+
+
diff --git a/app/src/main/res/bak/values-zh-rTW/strings.xml b/app/src/main/res/bak/values-zh-rTW/strings.xml
new file mode 100644
index 00000000..bfc956b2
--- /dev/null
+++ b/app/src/main/res/bak/values-zh-rTW/strings.xml
@@ -0,0 +1,108 @@
+
+
+ NeoTerm
+ 關於
+ 複製
+ 一般設定
+ 新增會話
+ 新增會話…
+ 新增系統會話
+ 軟件包
+ 貼上
+ 返回鍵發送ESC
+ 按下返回鍵時,發送ESC而不關閉
+ 響鈴
+ 收到 \'\\a\' 時響鈴
+ 登入程式
+ 登入時使用指定的程式
+ 震動
+ 收到 \'\\a\' 時震動
+ 初始化指令
+ 在新的創建新的會話時執行指令
+ 將音量鍵作為特殊鍵
+ 音量下為 Ctrl\n音量上為 FN
+ 軟體源
+ 向下切換窗口
+ 關閉目前視窗時切換到下一個而不是上一個
+ 字體,主題
+ 個人化
+ 全螢幕
+ 隱藏標題欄
+ 在鍵盤顯示時隱藏標題欄
+ 為快捷鍵盤強制設定權重
+ 如果快捷鍵盤顯示錯誤,請勾選此項目
+ 色彩主題
+ 字體
+ 設定
+ 更多
+ 切換鍵盤
+ 切換視窗
+ 介面設定
+ 找不到 Shell %s, 請先安裝.
+ 正在安装
+ 將要安装 oh-my-zsh 並將登入程式切換到 zsh
+ 全螢幕模式已改變,請重新開啟 NeoTerm
+ NeoTerm 無法取得必需的權限,正在退出
+ 還有這種操作?
+ 使用系统Shell
+ 重試
+ APT 源已改變,可能需要執行 apt update 來更新
+ 軟體包: %s\n版本: %s\n依賴: %s\n使用空間: %s\n描述: %s\n首頁: %s
+ 軟體包列表為空,請檢查你的軟體源
+ 重新整理
+ 更新並重新整理
+ 懸浮視窗
+
+ 完成
+ 安裝
+
+ 擴充鍵盤
+ 響鈴,震動,Shell,初始化指令
+ 全螢幕,標題欄,切換動畫
+ 軟體源,更新,升級
+ 安裝字體
+ 安裝色彩主題
+ 你好,NeoTerm
+ GO
+ 裝置: %s
+ 程式: %s
+ 錯誤訊息
+ %d 個會話, %d 個图形會話
+ (永不休眠)
+ 開啟休眠鎖
+ 關閉休眠鎖
+ 離開
+ 在此處打開終端
+ 使用者腳本
+ 没有找到可用的使用者腳本
+ 沒有檔案被選擇\n\n(Intent: %s)
+ 不支持在此处打开终端\n\n(Intent: %s)
+ 處理的檔案
+ 可用的使用者腳本
+ 從操作列表中中移除檔案?
+ 移除?
+ 命令快捷方式
+ 沒有找到需要執行的命令,是否忘記了傳遞參數?
+ 展示標題不可為空
+ "標題 "
+ 命令
+ 自動補全(實驗性)
+ "輸入命令或者路徑時提供補全。該功能還在開發中,有許多bug需要解决 "
+ 陞級
+ 套裝軟體清單成功更新
+ 套裝軟體已成功陞級
+ 安裝已開始,請注意荧幕上出現的提示
+ 會話已關閉
+ 取消
+ 查看幫助
+ 無法連接到服務
+ 版本
+ 開發者 & 贡献者
+ 協力廠商庫
+ 源碼
+ 捐贈
+ 如果你喜歡這個app,你可以考慮請作者喝杯咖啡
+ Kiva 維護\nCrixec 圖標設計\n酷安用戶 @NimaQu 贊助服務器\nQQ用戶 @My 提供免費網絡
+ 這個app是我在課餘時間製作的,一個人不僅要維護app,還要維護各種套裝軟體和服務器,如果能得到你的支持,我將更有動力繼續完善下去
+ 支付寶
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/values/attrs.xml b/app/src/main/res/bak/values/attrs.xml
new file mode 100644
index 00000000..78c49a5b
--- /dev/null
+++ b/app/src/main/res/bak/values/attrs.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/bak/values/colors.xml b/app/src/main/res/bak/values/colors.xml
new file mode 100644
index 00000000..29773928
--- /dev/null
+++ b/app/src/main/res/bak/values/colors.xml
@@ -0,0 +1,13 @@
+
+
+ #607D8B
+ #455A64
+ #42a5f5
+ #ff14181c
+ #fefefe
+ #ced7db
+
+ #7f000000
+ #efefef
+ #363636
+
diff --git a/app/src/main/res/bak/values/dimens.xml b/app/src/main/res/bak/values/dimens.xml
new file mode 100644
index 00000000..71226978
--- /dev/null
+++ b/app/src/main/res/bak/values/dimens.xml
@@ -0,0 +1,23 @@
+
+ 180dp
+ 16dp
+ 16dp
+ 8dp
+ 32dp
+ 32dp
+ 32dp
+ 32dp
+ 72dp
+ 36dp
+ 256dp
+ 48dp
+ 36dp
+ 36dp
+ 24dp
+ 4dp
+ 48dp
+ 48dp
+
+ 16dp
+ 4dp
+
diff --git a/app/src/main/res/bak/values/preference_keys.xml b/app/src/main/res/bak/values/preference_keys.xml
new file mode 100644
index 00000000..e600cf7c
--- /dev/null
+++ b/app/src/main/res/bak/values/preference_keys.xml
@@ -0,0 +1,23 @@
+
+
+ neoterm_general_bell
+ neoterm_general_vibrate
+ neoterm_general_backspace_map_to_esc
+ neoterm_general_shell
+ neoterm_general_initial_command
+ neoterm_general_auto_completion
+ neoterm_general_volume_as_control
+ neoterm_general_use_execve_wrapper
+ neoterm_general_enable_word_based_ime
+
+ neoterm_ui_fullscreen
+ neoterm_ui_hide_toolbar
+ neoterm_ui_next_tab_anim
+ neoterm_ui_eks_weight_explicit
+ neoterm_ui_eks_enabled
+
+ neoterm_package_source
+
+ neoterm_ui_font
+ neoterm_ui_color_scheme
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/values/shortcut_configs.xml b/app/src/main/res/bak/values/shortcut_configs.xml
new file mode 100644
index 00000000..7acd1f18
--- /dev/null
+++ b/app/src/main/res/bak/values/shortcut_configs.xml
@@ -0,0 +1,4 @@
+
+
+ id_create_new_session
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/values/strings.xml b/app/src/main/res/bak/values/strings.xml
new file mode 100644
index 00000000..69b1f9e6
--- /dev/null
+++ b/app/src/main/res/bak/values/strings.xml
@@ -0,0 +1,237 @@
+
+ Ergo Node
+ Copy
+ Paste
+ Super Paste
+ More
+
+ Toggle Tabs
+ New Session
+ New Session…
+ New System Shell
+ %d session(s), %d X session(s)
+ (Wake Locked)
+ Acquire Lock
+ Release Lock
+
+ Ergo Node
+ start the node
+ Select your installation method
+ Online Setup
+ Local Zip File Setup
+ Restore from Backup
+ Source Parameter
+ Input source parameter…
+ …
+ URL of mirror that contains setup zip files
+ File path to showConfirmDialog zip files
+ File path to backup file(*.neobackup)
+ File not found
+ Invalid URL
+ No Internet connection
+ Failed to connect to server
+ Setup parameter is null
+ Preparing…
+ Welcome to Ergo Node for Android!
+ Ergo Node requires ~25GB of free storage... Continue?
+ Reset Confirm
+ This operation will clear all your data! Continue?
+
+ About
+ Settings
+ General Settings
+ Bell, Vibrate, Shell, Initial Command
+ UI Settings
+ FullScreen, Title Bar, Animation
+ Package Settings
+ Source, Updates, Upgrades
+ Font, ColorScheme
+ Customization
+
+ Toggle Keyboard
+ Float Up
+ Shell %s not found
+ Would you like you install it?
+ FullScreen mode changed, please restart NeoTerm.
+ Ergo Node cannot get essential permissions, exiting.
+ Oops!
+ System Shell
+ Retry
+ APT source changed, you may get it updated by executing: apt update
+ Done
+ Getting Ready
+ Package: %s\nVersion: %s\nDepends: %s\nInstalled Size: %s\nDescription: %s\nHome
+ Page: %s
+
+ Package list is empty, please check your source.
+ Refresh
+ Update and Refresh
+ Install Font
+ Install Color Scheme
+
+ Model: %s
+ App: %s
+ Stack Trace
+
+ Getting ready
+ We will install oh-my-zsh and switch your login program to zsh
+
+
+ Bell
+ Bell when receiving \'\\a\'
+ Vibrate
+ Vibrate when receiving \'\\a\'
+ BackSpace Mapped to Esc
+ Send esc when backspace is pressed
+ Login Program
+ Which program should we use as shell when login
+ Initial Command
+ Execute commands when a session is being created
+ Auto Completion(Experimental)
+ Enable complete things when typing commands or path. This is still
+ work in progress with lots of bugs to deal with
+
+ Use volume up and down as special keys
+ Volume Down as Ctrl\nVolume Up as FN
+ Use execve() wrapper
+ Hook execve() to avoid incorrect shebang
+ Enable word based IME
+ Word based or char based IME
+ Full Screen
+ Hide Toolbar
+ Hide toolbar when keyboard is showing
+ Next tab animation
+ Switch to the next tab instead of the previous tab when closing
+ tab
+
+ Use explicit weight for ExtraKeysView
+ If ExtraKeysView shows incorrectly, please enable this
+ Show extra keys
+ Some useful keys like arrow, esc, tab, etc.
+ Font
+ Color Scheme
+ Extra Keys
+ Source
+
+ Exit
+ Term Here
+ User Script
+ Command Shortcut
+ No user script found (Did you forget to set executable permissions?)
+ No files selected\n\n(raw Intent: %s)
+ Unsupported term here\n\n(raw Intent: %s)
+ Files to Handle
+ Available User Scripts
+ Remove file from list?
+ Remove?
+ Title
+ Command
+ No command provided, did you put extras?
+ Display title cannot be null
+ Upgrade
+ Package list successfully updated
+ Package successfully upgraded
+ Installation started. Please pay attention to the prompt that appears on the
+ screen
+
+ Session was closed
+ Cancel
+ Show Help
+ Failed to connect to service
+ Version
+
+ Libraries
+ Source Code
+ Reset App
+ Clear all files except user home directory
+
+
+
+
+
+ New Color Scheme
+ FAQ
+ New
+ Process completed
+ code %d
+ signal %d
+ press Enter
+ Press Back
+ Enter new color scheme name
+ NewColorScheme
+ Save color scheme
+ Discard all changes?
+ Save
+ Select
+ Enter new color
+ Toggle extra keys
+ New X Session
+ New Session With Profile
+ No profile available
+ No file picker found
+ Enter new URL
+ Enter new Repo
+ URL cannot be empty
+ Repo cannot be empty
+ This feature is still under development so it is only available on DEBUG
+ builds.\n
+
+ Dangerous Zone
+ You will have to re-setup later, confirm?
+
+ https://raw.githubusercontent.com/NeoTerm/NeoTerm-repo/main/
+
+
+ - sh
+ - zsh
+ - bash
+ - fish
+
+
+
+ - @string/default_source_url
+
+
+
+ - Background color
+ - Foreground color
+ - Cursor color
+ - Dim black
+ - Dim red
+ - Dim green
+ - Dim yellow
+ - Dim blue
+ - Dim magenta
+ - Dim cyan
+ - Dim white
+ - Bright black
+ - Bright red
+ - Bright green
+ - Bright yellow
+ - Bright blue
+ - Bright magenta
+ - Bright cyan
+ - Bright white
+
+
+
+ - Hello NeoTerm\\n
+ - "\\e[30m Dim black \\e[0m\\n"
+ - "\\e[31m Dim red \\e[0m\\n"
+ - "\\e[32m Dim green \\e[0m\\n"
+ - "\\e[33m Dim yellow \\e[0m\\n"
+ - "\\e[34m Dim blue \\e[0m\\n"
+ - "\\e[35m Dim magenta \\e[0m\\n"
+ - "\\e[36m Dim cyan \\e[0m\\n"
+ - "\\e[37m Dim white \\e[0m\\n"
+ - "\\e[1;30m Bright black \\e[0m\\n"
+ - "\\e[1;31m Bright red \\e[0m\\n"
+ - "\\e[1;32m Bright green \\e[0m\\n"
+ - "\\e[1;33m Bright yellow \\e[0m\\n"
+ - "\\e[1;34m Bright blue \\e[0m\\n"
+ - "\\e[1;35m Bright magenta\\e[0m\\n"
+ - "\\e[1;36m Bright cyan \\e[0m\\n"
+ - "\\e[1;37m Bright white \\e[0m\\n"
+
+
+
diff --git a/app/src/main/res/bak/values/styles.xml b/app/src/main/res/bak/values/styles.xml
new file mode 100644
index 00000000..7dab1899
--- /dev/null
+++ b/app/src/main/res/bak/values/styles.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/bak/xml/app_shortcuts.xml b/app/src/main/res/bak/xml/app_shortcuts.xml
new file mode 100644
index 00000000..370488db
--- /dev/null
+++ b/app/src/main/res/bak/xml/app_shortcuts.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
diff --git a/app/src/main/res/bak/xml/backup_config.xml b/app/src/main/res/bak/xml/backup_config.xml
new file mode 100644
index 00000000..26b46785
--- /dev/null
+++ b/app/src/main/res/bak/xml/backup_config.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/xml/setting_general.xml b/app/src/main/res/bak/xml/setting_general.xml
new file mode 100644
index 00000000..69722e23
--- /dev/null
+++ b/app/src/main/res/bak/xml/setting_general.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/bak/xml/settings_main.xml b/app/src/main/res/bak/xml/settings_main.xml
new file mode 100644
index 00000000..514f2870
--- /dev/null
+++ b/app/src/main/res/bak/xml/settings_main.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/bak/xml/settings_ui.xml b/app/src/main/res/bak/xml/settings_ui.xml
new file mode 100644
index 00000000..d68de786
--- /dev/null
+++ b/app/src/main/res/bak/xml/settings_ui.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 69b1f9e6..5dcf112d 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -33,7 +33,7 @@
Setup parameter is null
Preparing…
Welcome to Ergo Node for Android!
- Ergo Node requires ~25GB of free storage... Continue?
+ Ergo NiPoPoW Node requires ~5GB of free storage... Continue?
Reset Confirm
This operation will clear all your data! Continue?
diff --git a/artwork/about_logo.png b/artwork/about_logo.png
deleted file mode 100755
index f0b9db6c..00000000
Binary files a/artwork/about_logo.png and /dev/null differ
diff --git a/artwork/ic_launcher_round.png b/artwork/ic_launcher_round.png
deleted file mode 100755
index 9c2a399a..00000000
Binary files a/artwork/ic_launcher_round.png and /dev/null differ
diff --git a/artwork/ic_tab_icon.png b/artwork/ic_tab_icon.png
deleted file mode 100644
index d0a6cb9a..00000000
Binary files a/artwork/ic_tab_icon.png and /dev/null differ
diff --git a/build.gradle b/build.gradle
index 4c4587cc..95df2eef 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,33 +1,31 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
- ext.kotlin_version = '2.3.0'
+ ext.kotlin_version = '1.9.24'
ext.android = [
- KOTLIN_VERSION : '2.3.0',
- MIN_SDK_VERSION : 26,
- COMPILE_SDK_VERSION: 34,
- TARGET_SDK_VERSION : 34,
- JUNIT_VERSION : "4.12"
+ KOTLIN_VERSION : '1.9.24',
+ MIN_SDK_VERSION : 24,
+ COMPILE_SDK_VERSION: 36,
+ TARGET_SDK_VERSION : 36,
+ JUNIT_VERSION : "4.13.2"
]
ext.deps = [
- "annotations" : "androidx.annotation:annotation:1.0.0",
- "appcompat-v7" : "androidx.appcompat:appcompat:1.2.0",
+ "annotations" : "androidx.annotation:annotation:1.7.1",
+ "appcompat-v7" : "androidx.appcompat:appcompat:1.6.1",
"kotlin-stdlib" : "org.jetbrains.kotlin:kotlin-stdlib:${ext.android.KOTLIN_VERSION}",
"kotlin-gradle-plugin": "org.jetbrains.kotlin:kotlin-gradle-plugin:${ext.android.KOTLIN_VERSION}",
"junit" : "junit:junit:${ext.android.JUNIT_VERSION}"
]
repositories {
- maven { url 'https://dl.google.com/dl/android/maven2/' }
- mavenCentral()
google()
+ mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.13.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- classpath rootProject.ext.deps["kotlin-gradle-plugin"]
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -36,10 +34,14 @@ buildscript {
allprojects {
repositories {
+ google()
mavenCentral()
- maven { url 'https://dl.google.com/dl/android/maven2/' }
maven { url "https://jitpack.io" }
- google()
+ }
+
+ tasks.withType(JavaCompile) {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
}
}
diff --git a/chrome-tabs/build.gradle b/chrome-tabs/build.gradle
index 65733048..3b65ce29 100755
--- a/chrome-tabs/build.gradle
+++ b/chrome-tabs/build.gradle
@@ -1,20 +1,23 @@
apply plugin: 'com.android.library'
android {
- namespace "de.mrapp.android.tabswitcher"
compileSdkVersion rootProject.ext.android.COMPILE_SDK_VERSION
defaultConfig {
minSdkVersion rootProject.ext.android.MIN_SDK_VERSION
targetSdkVersion rootProject.ext.android.TARGET_SDK_VERSION
- versionCode 1
- versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
}
}
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+ namespace 'de.mrapp.android.tabswitcher'
}
dependencies {
@@ -22,5 +25,6 @@ dependencies {
implementation rootProject.ext.deps["annotations"]
testImplementation rootProject.ext.deps["junit"]
- implementation 'androidx.appcompat:appcompat:1.6.1'
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'androidx.appcompat:appcompat-resources:1.2.0'
}
diff --git a/chrome-tabs/src/main/AndroidManifest.xml b/chrome-tabs/src/main/AndroidManifest.xml
index b458ce84..71629f3e 100755
--- a/chrome-tabs/src/main/AndroidManifest.xml
+++ b/chrome-tabs/src/main/AndroidManifest.xml
@@ -13,4 +13,4 @@ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, e
implied. See the License for the specific language governing permissions and limitations under the
License.
-->
-
\ No newline at end of file
+
diff --git a/gradle.properties b/gradle.properties
index 8de50581..a8c57008 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -6,7 +6,10 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
+android.defaults.buildfeatures.buildconfig=true
android.enableJetifier=true
+android.nonFinalResIds=false
+android.nonTransitiveRClass=false
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
diff --git a/nipopow-node-setup.sh b/nipopow-node-setup.sh
deleted file mode 100644
index d5909775..00000000
--- a/nipopow-node-setup.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/bash
-
-# If run-alpine.sh exists, run it and exit
-if [ -f "./run-alpine.sh" ]; then
- ./run-alpine.sh
- exit
-fi
-
-echo "Checking system memory to determine node type..."
-
-# Check total and available system memory in MB
-TOTAL_MEM=$(free -m | awk '/^Mem:/{print $2}')
-AVAILABLE_MEM=$(free -m | awk '/^Mem:/{print $7}')
-
-# Convert thresholds to MB
-TOTAL_THRESHOLD=5120 # 5GB
-AVAILABLE_THRESHOLD=1843 # 1.8GB
-
-# Determine which script to run
-if [ "$TOTAL_MEM" -gt "$TOTAL_THRESHOLD" ]; then
- NODE_SCRIPT="https://raw.githubusercontent.com/rustinmyeye/ErgoNodeAndroid/master/nipopow-ergo-node.sh"
- NODE_TYPE="NiPoPoW Ergo Node"
-elif [ "$AVAILABLE_MEM" -lt "$AVAILABLE_THRESHOLD" ]; then
- NODE_SCRIPT="https://raw.githubusercontent.com/rustinmyeye/ErgoNodeAndroid/refs/heads/master/stateless-ergo-node.sh"
- NODE_TYPE="Stateless Ergo Node"
-else
- NODE_SCRIPT="https://raw.githubusercontent.com/rustinmyeye/ErgoNodeAndroid/master/nipopow-ergo-node.sh"
- NODE_TYPE="NiPoPoW Ergo Node"
-fi
-
-# Display memory info and selected node type
-echo "----------------------------------------"
-echo "Total Memory: ${TOTAL_MEM}MB"
-echo "Available Memory: ${AVAILABLE_MEM}MB"
-echo "Selected Node Type: $NODE_TYPE"
-echo "----------------------------------------"
-sleep 3 # Pause for 3 seconds so the user can see the info
-
-# Download and set up Alpine scripts
-curl -s https://raw.githubusercontent.com/rustinmyeye/ErgoNodeAndroid/refs/heads/master/init-alpine.sh -o init-alpine.sh
-chmod +x init-alpine.sh
-curl -s https://raw.githubusercontent.com/rustinmyeye/ErgoNodeAndroid/refs/heads/master/run-alpine.sh -o run-alpine.sh
-chmod +x run-alpine.sh
-
-# Initialize Alpine
-./init-alpine.sh
-clear
-
-# Append the selected script to .profile
-echo "
-apk add bash curl
-sh <(curl -s $NODE_SCRIPT)
-" >> .alpinelinux_container/root/.profile
-
-# Run Alpine
-./run-alpine.sh
diff --git a/oldsh/1 b/oldsh/1
deleted file mode 100644
index 8b137891..00000000
--- a/oldsh/1
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/oldsh/alpine-ergo-node.sh b/oldsh/alpine-ergo-node.sh
deleted file mode 100644
index 72da27e6..00000000
--- a/oldsh/alpine-ergo-node.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-#download things
-echo "Downloading stuff... please wait :)"
-#apk --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ add android-tools --quiet
-apk add openjdk11 python3 wget tmux curl --quiet
-
-#create startup script
-cd ..
-cd etc
-cd profile.d
-#curl https://raw.githubusercontent.com/rustinmyeye/ErgoNodeAndroid/master/ergo-startup.sh >> ergo.sh
-curl https://raw.githubusercontent.com/rustinmyeye/ErgoNodeAndroid/master/alpine-node-install.sh >> ergo.sh
-chmod +x ergo.sh
-clear
-./ergo.sh
diff --git a/oldsh/alpine-ergo.sh b/oldsh/alpine-ergo.sh
deleted file mode 100644
index 985afd44..00000000
--- a/oldsh/alpine-ergo.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-DISTRO_NAME="alpine-ergo"
-
-DISTRO_COMMENT="Alpine Linux setup for Ergo Node"
-
-get_download_url() {
- local rootfs
- local sha256
-
- case "$DISTRO_ARCH" in
- aarch64)
- rootfs="https://github.com/termux/proot-distro/releases/download/v3.18.1/alpine-aarch64-pd-v3.18.1-r2.tar.xz"
- sha256="0e8258cc599a86be428228dd5ea9217959f2c77873790bec645c05899f252c5e"
- ;;
- armv7l|armv8l)
- rootfs="https://github.com/termux/proot-distro/releases/download/v1.2-alpine-rootfs/alpine-minirootfs-3.13.1-armv7.tar.gz"
- sha256="71bedb0810b656377192f4a239126f452a016d7a33e28f8ad8f46e9b0e7d8028"
- ;;
- i686)
- rootfs="https://github.com/termux/proot-distro/releases/download/v1.2-alpine-rootfs/alpine-minirootfs-3.13.1-x86.tar.gz"
- sha256="6884df8f8e44d462a9723e412f0b76124019683d98afe448a8767dc5f5f3a7e0"
- ;;
- x86_64)
- rootfs="https://github.com/termux/proot-distro/releases/download/v1.2-alpine-rootfs/alpine-minirootfs-3.13.1-x86_64.tar.gz"
- sha256="1ab0a7c05107c4504018be170d937c07e35283b7a3f153886c8c93162dfbf4af"
- ;;
- esac
-
- echo "${sha256}|${rootfs}"
-}
diff --git a/oldsh/ergo-startup.sh b/oldsh/ergo-startup.sh
deleted file mode 100644
index 945d6a1b..00000000
--- a/oldsh/ergo-startup.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-## Minimal Config
-echo "
- ergo {
- node {
- mining = false
- }
-
- }" > ergo.conf
-
-## Node start command
-echo "
-#!/bin/sh
-while true
-do
-java -jar -Xmx1G ergo.jar --mainnet -c ergo.conf > server.log 2>&1 &
- sleep 100
-done" > start.sh
-
-chmod +x start.sh
-
-## Download .jar
-echo "- Retrieving latest node release.."
-LATEST_ERGO_RELEASE=$(curl -s "https://api.github.com/repos/ergoplatform/ergo/releases/latest" | awk -F '"' '/tag_name/{print $4}')
-LATEST_ERGO_RELEASE_NUMBERS=$(echo ${LATEST_ERGO_RELEASE} | cut -c 2-)
-ERGO_DOWNLOAD_URL=https://github.com/ergoplatform/ergo/releases/download/${LATEST_ERGO_RELEASE}/ergo-${LATEST_ERGO_RELEASE_NUMBERS}.jar
-echo "- Downloading Latest known Ergo release: ${LATEST_ERGO_RELEASE}."
-curl --silent -L ${ERGO_DOWNLOAD_URL} --output ergo.jar
-
-##Start node
-echo "Starting the node..."
-
-tmux new-session -d -s my_session 'sh start.sh && sleep 5'
-echo "
-
-"
-echo "Please visit https://127.0.0.0.9053/panel to view sync progress."