PROBLEM: setelah konek SSH, prompt tidak keluar & keyboard tidak muncul.
FIX (input):
- TerminalView: implementasi InputConnection (BaseInputConnection) jadi soft
keyboard bisa muncul; onCheckIsTextEditor=true; commitText/key events
diteruskan ke SSH session (onKeyInput). Handle hardware keyboard: Ctrl+letter
-> ascii control, Enter/panah/PgUp/PgDn/Home/End/Esc/Tab/Del.
- TerminalController.attach(): hubungkan view.onKeyInput -> engine.write()
- TerminalActivity: requestFocus() + showKeyboard() saat 'Terhubung'.
FIX (render — bug ditemukan via unit test baru):
- TerminalModel.write('\n') kini reset cursorCol=0 (LF berperilaku seperti
LF+CR). Sebelumnya LF tidak reset kolom sehingga baris lanjutan ditulis di
posisi salah & scroll ganda terjadi.
- TerminalModel.scrollUp() tidak lagi mengubah cursorRow (pemanggil yang atur).
- Tambah 8+ unit test (TerminalParserTest): prompt shell, CRLF, truecolor SGR,
erase, scroll, multiline. Semua 10 lulus.
verified: gradle :app:testDebugUnitTest BUILD SUCCESSFUL (10 tests, 0 fail);
gradle :app:assembleDebug BUILD SUCCESSFUL.
71 lines
2.1 KiB
Kotlin
71 lines
2.1 KiB
Kotlin
// app/build.gradle.kts
|
|
plugins {
|
|
id("com.android.application")
|
|
id("org.jetbrains.kotlin.android")
|
|
id("org.jetbrains.kotlin.plugin.serialization")
|
|
}
|
|
|
|
android {
|
|
namespace = "com.kosbarokah.sshclient"
|
|
compileSdk = 34
|
|
|
|
defaultConfig {
|
|
applicationId = "com.kosbarokah.sshclient"
|
|
minSdk = 26
|
|
targetSdk = 34
|
|
versionCode = 1
|
|
versionName = "1.0.0"
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = true
|
|
isShrinkResources = true
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro"
|
|
)
|
|
}
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
kotlinOptions { jvmTarget = "17" }
|
|
packaging {
|
|
resources {
|
|
excludes += "META-INF/{AL2.0,LGPL2.1}"
|
|
excludes += "META-INF/versions/9/OSGI-INF/MANIFEST.MF"
|
|
}
|
|
}
|
|
lint { abortOnError = false }
|
|
buildFeatures { viewBinding = true }
|
|
}
|
|
|
|
dependencies {
|
|
// AndroidX core
|
|
implementation("androidx.core:core-ktx:1.13.1")
|
|
implementation("androidx.appcompat:appcompat:1.6.1")
|
|
implementation("com.google.android.material:material:1.11.0")
|
|
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
|
implementation("androidx.recyclerview:recyclerview:1.3.2")
|
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
|
|
|
|
// SSH
|
|
implementation("com.hierynomus:sshj:0.38.0")
|
|
implementation("org.bouncycastle:bcprov-jdk18on:1.78.1")
|
|
implementation("org.bouncycastle:bcpkix-jdk18on:1.78.1")
|
|
|
|
// Secure credential storage (EncryptedSharedPreferences via Tink)
|
|
implementation("androidx.security:security-crypto:1.1.0-alpha06")
|
|
|
|
// Serialization for profiles
|
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
|
|
|
|
// Coroutines
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1")
|
|
|
|
// Unit tests (JVM) — TerminalModel & TerminalParser are pure Kotlin (no Android)
|
|
testImplementation("junit:junit:4.13.2")
|
|
}
|