1 Commits

Author SHA1 Message Date
0a44f56c2f Re-optima apk
All checks were successful
Build / build (push) Successful in 6m3s
2025-10-18 09:13:43 +07:00
9 changed files with 71 additions and 56 deletions

1
.idea/gradle.xml generated
View File

@@ -15,5 +15,6 @@
</option> </option>
</GradleProjectSettings> </GradleProjectSettings>
</option> </option>
<option name="parallelModelFetch" value="true" />
</component> </component>
</project> </project>

View File

@@ -22,6 +22,8 @@ android {
versionName = "1.0" versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
} }
buildTypes { buildTypes {
@@ -32,6 +34,9 @@ android {
getDefaultProguardFile("proguard-android-optimize.txt"), getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro" "proguard-rules.pro"
) )
ndk {
abiFilters.addAll(listOf("arm64-v8a"))
}
} }
} }
@@ -89,6 +94,6 @@ dependencies {
// Local AAR library // Local AAR library
implementation(files("libs/firefly-go.aar")) implementation(files("libs/firefly-go.aar"))
implementation("org.slf4j:slf4j-android:1.7.36") implementation(libs.slf4j.android)
} }

Binary file not shown.

View File

@@ -66,6 +66,7 @@ import androidx.compose.ui.window.DialogProperties
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import org.json.JSONObject import org.json.JSONObject
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontFamily
data class AppVersion( data class AppVersion(
val latestVersion: String, val latestVersion: String,
@@ -421,64 +422,60 @@ fun parseGoLogLine(line: String): String? {
return if (content.isNullOrBlank()) null else content return if (content.isNullOrBlank()) null else content
} }
fun parseAnsi(text: String): AnnotatedString {
fun parseAnsi(text: String, defaultColor: Color): AnnotatedString {
val regex = Regex("\u001B\\[(\\d+)(;\\d+)*m") val regex = Regex("\u001B\\[(\\d+)(;\\d+)*m")
val builder = buildAnnotatedString { val builder = buildAnnotatedString {
var lastIndex = 0 var lastIndex = 0
var currentColor = Color.Black var currentColor = defaultColor
for (match in regex.findAll(text)) { for (match in regex.findAll(text)) {
val start = match.range.first val start = match.range.first
// 1. Thêm phần text TRƯỚC mã ANSI với màu HIỆN TẠI
val before = text.substring(lastIndex, start) val before = text.substring(lastIndex, start)
if (before.isNotEmpty()) {
withStyle(SpanStyle(color = currentColor)) { withStyle(SpanStyle(color = currentColor)) {
append(before) append(before)
} }
}
// 2. Lấy mã code (ví dụ 31, 36, hoặc 0)
val code = try {
match.groupValues[1].toInt()
} catch (e: NumberFormatException) {
0
}
val code = match.groupValues[1].toInt()
currentColor = when (code) { currentColor = when (code) {
30 -> { 0 -> defaultColor
Color.Black 30 -> Color.Black
} 31 -> Color.Red
31 -> { 32 -> Color(0xFF00C853) // Green
Color.Red 33 -> Color(0xFFFFD600) // Yellow
} 34 -> Color(0xFF2962FF) // Blue
32 -> { 35 -> Color(0xFFD500F9) // Magenta
Color(0xFF00C853) 36 -> Color(0xFF00B8D4) // Cyan
} 37 -> Color.White
33 -> { else -> currentColor
Color(0xFFFFD600)
}
34 -> {
Color(0xFF2962FF)
}
35 -> {
Color(0xFFD500F9)
}
36 -> {
Color(0xFF00B8D4)
}
37 -> {
Color.White
}
else -> {
Color.Black
}
} }
lastIndex = match.range.last + 1 lastIndex = match.range.last + 1
} }
if (lastIndex < text.length) {
val remain = text.substring(lastIndex) val remain = text.substring(lastIndex)
if (remain.isNotEmpty()) {
withStyle(SpanStyle(color = currentColor)) { withStyle(SpanStyle(color = currentColor)) {
append(remain) append(remain)
} }
} }
}
}
return builder return builder
} }
@Composable @Composable
fun LogPopup( fun LogPopup(
onDismiss: () -> Unit onDismiss: () -> Unit
@@ -512,6 +509,8 @@ fun LogPopup(
} }
} }
val defaultTextColor = LocalContentColor.current
Dialog(onDismissRequest = { onDismiss() }) { Dialog(onDismissRequest = { onDismiss() }) {
Surface( Surface(
shape = RoundedCornerShape(12.dp), shape = RoundedCornerShape(12.dp),
@@ -531,8 +530,15 @@ fun LogPopup(
LazyColumn(state = listState, modifier = Modifier.weight(1f)) { LazyColumn(state = listState, modifier = Modifier.weight(1f)) {
items(logs.size) { index -> items(logs.size) { index ->
Text( Text(
text = parseAnsi(logs[index]), text = parseAnsi(logs[index], defaultTextColor),
fontSize = 12.sp, fontSize = 12.sp,
// 2. DÙNG FONT MONOSPACE
fontFamily = FontFamily.Monospace,
// 3. (Tuỳ chọn) Giảm chiều cao dòng để logo liền mạch
lineHeight = 14.sp,
modifier = Modifier.padding(vertical = 2.dp) modifier = Modifier.padding(vertical = 2.dp)
) )
} }

View File

@@ -1,5 +1,5 @@
{ {
"latest_version": "3.6.4-02", "latest_version": "3.6.4-03",
"changelog": "UPDATE: Update to 3.6.54", "changelog": "UPDATE: Re-optima",
"apk_url": "https://git.kain.io.vn/Firefly-Shelter/FireflyGo_Android/releases/download/3.6.4-02/firefly_go_android.apk" "apk_url": "https://git.kain.io.vn/Firefly-Shelter/FireflyGo_Android/releases/download/3.6.4-03/firefly_go_android.apk"
} }

View File

@@ -23,3 +23,4 @@ kotlin.code.style=official
# thereby reducing the size of the R class for that library # thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true android.nonTransitiveRClass=true
#org.gradle.configuration-cache=false #org.gradle.configuration-cache=false
android.r8.optimizedResourceShrinking=true

View File

@@ -2,23 +2,24 @@
activityComposeVersion = "1.11.0" activityComposeVersion = "1.11.0"
agp = "8.13.0" agp = "8.13.0"
androidxJunit = "1.3.0" androidxJunit = "1.3.0"
animationCore = "1.9.2" animationCore = "1.9.3"
autoupdater = "1.0.1" autoupdater = "1.0.1"
espressoCoreVersion = "3.7.0" espressoCoreVersion = "3.7.0"
foundation = "1.9.2" foundation = "1.9.3"
kotlin = "2.2.20" kotlin = "2.2.20"
coreKtx = "1.17.0" coreKtx = "1.17.0"
junit = "4.13.2" junit = "4.13.2"
lifecycleRuntimeKtxVersion = "2.9.4" lifecycleRuntimeKtxVersion = "2.9.4"
material = "1.9.2" material = "1.9.3"
material3WindowSizeClass = "1.4.0" material3WindowSizeClass = "1.4.0"
materialIconsExtended = "1.7.8" materialIconsExtended = "1.7.8"
ui = "1.9.2" slf4jAndroidVersion = "1.7.36"
uiGraphics = "1.9.2" ui = "1.9.3"
uiTestJunit4 = "1.9.2" uiGraphics = "1.9.3"
uiTestManifest = "1.9.2" uiTestJunit4 = "1.9.3"
uiTooling = "1.9.2" uiTestManifest = "1.9.3"
uiToolingPreview = "1.9.2" uiTooling = "1.9.3"
uiToolingPreview = "1.9.3"
[libraries] [libraries]
androidx-activity-compose-v1101 = { module = "androidx.activity:activity-compose", version.ref = "activityComposeVersion" } androidx-activity-compose-v1101 = { module = "androidx.activity:activity-compose", version.ref = "activityComposeVersion" }
@@ -35,6 +36,7 @@ androidx-material3-window-size-class1 = { module = "androidx.compose.material3:m
autoupdater = { module = "com.github.CSAbhiOnline:AutoUpdater", version.ref = "autoupdater" } autoupdater = { module = "com.github.CSAbhiOnline:AutoUpdater", version.ref = "autoupdater" }
junit = { group = "junit", name = "junit", version.ref = "junit" } junit = { group = "junit", name = "junit", version.ref = "junit" }
material3 = { module = "androidx.compose.material3:material3", version.ref = "material3WindowSizeClass" } material3 = { module = "androidx.compose.material3:material3", version.ref = "material3WindowSizeClass" }
slf4j-android = { module = "org.slf4j:slf4j-android", version.ref = "slf4jAndroidVersion" }
ui = { module = "androidx.compose.ui:ui", version.ref = "ui" } ui = { module = "androidx.compose.ui:ui", version.ref = "ui" }
ui-graphics = { module = "androidx.compose.ui:ui-graphics", version.ref = "uiGraphics" } ui-graphics = { module = "androidx.compose.ui:ui-graphics", version.ref = "uiGraphics" }
ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "uiTestJunit4" } ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "uiTestJunit4" }

View File

@@ -1,2 +1,2 @@
# Changelog # Changelog
## - FIX: I forgot update new data ## - UPDATE: Re-Optima apk

View File

@@ -1,5 +1,5 @@
{ {
"tag": "3.6.4-02", "tag": "3.6.4-03",
"title": "PreBuild Version 3.6.54 - 02" "title": "PreBuild Version 3.6.54 - 03"
} }