Compare commits
37 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 527c8176e4 | |||
| a54219b781 | |||
| 84cf16c3bf | |||
| becf6779f7 | |||
| d61b2aa907 | |||
| 534c08c70a | |||
| bc3e6f514a | |||
| 2469b9ff83 | |||
| f3abdff971 | |||
| af1b71f929 | |||
| 4146f260ac | |||
| 7c5200f838 | |||
| 17d6856f58 | |||
| 2ba164a05c | |||
| ecd02b8885 | |||
| 08caef28ab | |||
| b587da0b9a | |||
| 0f7748a1df | |||
| 2a2159eb8a | |||
| 866de7a49e | |||
| c49be0b2e7 | |||
| 00155e3619 | |||
| 6a9b6bc3a8 | |||
| e7b7751fbb | |||
| 66f6ef6cec | |||
| 1d149bfa19 | |||
| 707f7adbeb | |||
| b9f73f0d0f | |||
| 2f191a2c41 | |||
| 47f3f1f55d | |||
| 9399dbe051 | |||
| a044ca8189 | |||
| 67e06fd017 | |||
| 629e0cb456 | |||
| 4135f02885 | |||
| 6149ff55ab | |||
| 7722e5fa70 |
61
.gitea/workflows/build.yml
Normal file
61
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
name: Build
|
||||||
|
run-name: ${{ gitea.actor }} build 🚀
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Set Up JDK
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: 'zulu'
|
||||||
|
java-version: '17'
|
||||||
|
|
||||||
|
- name: Setup Android SDK
|
||||||
|
uses: amyu/setup-android@v5
|
||||||
|
with:
|
||||||
|
cache-disabled: true
|
||||||
|
|
||||||
|
- name: Grant execute permissions
|
||||||
|
run: |
|
||||||
|
chmod +x ./gradlew
|
||||||
|
chmod +x ./script/release-uploader
|
||||||
|
|
||||||
|
- name: Download AAR manually
|
||||||
|
run: |
|
||||||
|
FILE="app/libs/firefly-go.aar"
|
||||||
|
URL="https://git.kain.io.vn/Firefly-Shelter/FireflyGo_Android/media/branch/master/app/libs/firefly-go.aar"
|
||||||
|
echo "📥 Downloading $FILE from $URL"
|
||||||
|
curl -L -o "$FILE" "$URL"
|
||||||
|
|
||||||
|
- name: Build signed release APK
|
||||||
|
env:
|
||||||
|
KEYSTORE_PATH: ${{ github.workspace }}/KeyStore.jks
|
||||||
|
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
||||||
|
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
||||||
|
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
||||||
|
run: |
|
||||||
|
./gradlew assembleRelease \
|
||||||
|
-Pandroid.injected.signing.store.file=$KEYSTORE_PATH \
|
||||||
|
-Pandroid.injected.signing.store.password=$KEYSTORE_PASSWORD \
|
||||||
|
-Pandroid.injected.signing.key.alias=$KEY_ALIAS \
|
||||||
|
-Pandroid.injected.signing.key.password=$KEY_PASSWORD
|
||||||
|
|
||||||
|
- name: Find and rename release APK
|
||||||
|
run: |
|
||||||
|
APK_FILE=$(ls app/build/outputs/apk/release/*.apk | head -n 1)
|
||||||
|
echo "Found APK: $APK_FILE"
|
||||||
|
mv "$APK_FILE" app/build/outputs/apk/release/firefly_go_android.apk
|
||||||
|
|
||||||
|
- name: Upload release
|
||||||
|
env:
|
||||||
|
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
|
||||||
|
run: script/release-uploader -token=$REPO_TOKEN -release-url="https://git.kain.io.vn/api/v1/repos/Firefly-Shelter/FireflyGo_Android/releases" -files="app/build/outputs/apk/release/firefly_go_android.apk"
|
||||||
2
.idea/.name
generated
2
.idea/.name
generated
@@ -1 +1 @@
|
|||||||
FireflyPsAndorid
|
FireflyGoAndroid
|
||||||
2
.idea/compiler.xml
generated
2
.idea/compiler.xml
generated
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="CompilerConfiguration">
|
<component name="CompilerConfiguration">
|
||||||
<bytecodeTargetLevel target="21" />
|
<bytecodeTargetLevel target="17" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
13
.idea/deviceManager.xml
generated
Normal file
13
.idea/deviceManager.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DeviceTable">
|
||||||
|
<option name="columnSorters">
|
||||||
|
<list>
|
||||||
|
<ColumnSorterState>
|
||||||
|
<option name="column" value="Name" />
|
||||||
|
<option name="order" value="ASCENDING" />
|
||||||
|
</ColumnSorterState>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
3
.idea/misc.xml
generated
3
.idea/misc.xml
generated
@@ -1,6 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|||||||
@@ -5,13 +5,16 @@ plugins {
|
|||||||
alias(libs.plugins.kotlin.android)
|
alias(libs.plugins.kotlin.android)
|
||||||
alias(libs.plugins.kotlin.compose)
|
alias(libs.plugins.kotlin.compose)
|
||||||
}
|
}
|
||||||
|
kotlin {
|
||||||
|
jvmToolchain(17)
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "com.example.firefly_go_android"
|
namespace = "com.example.firefly_go_android"
|
||||||
compileSdk = 36
|
compileSdk = 36
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "com.example.firefly_go_android"
|
applicationId = "com.kain344.firefly_go_android"
|
||||||
minSdk = 24
|
minSdk = 24
|
||||||
//noinspection OldTargetApi
|
//noinspection OldTargetApi
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
@@ -23,7 +26,8 @@ android {
|
|||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
isMinifyEnabled = false
|
isMinifyEnabled = true
|
||||||
|
isShrinkResources = true
|
||||||
proguardFiles(
|
proguardFiles(
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
"proguard-rules.pro"
|
"proguard-rules.pro"
|
||||||
@@ -31,17 +35,9 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_11
|
|
||||||
targetCompatibility = JavaVersion.VERSION_11
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = "11"
|
|
||||||
}
|
|
||||||
|
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
compose = true
|
compose = true
|
||||||
|
viewBinding = true
|
||||||
}
|
}
|
||||||
|
|
||||||
composeOptions {
|
composeOptions {
|
||||||
@@ -49,6 +45,10 @@ android {
|
|||||||
}
|
}
|
||||||
buildToolsVersion = "36.0.0"
|
buildToolsVersion = "36.0.0"
|
||||||
ndkVersion = "27.2.12479018"
|
ndkVersion = "27.2.12479018"
|
||||||
|
dependenciesInfo {
|
||||||
|
includeInApk = false
|
||||||
|
includeInBundle = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -87,6 +87,8 @@ dependencies {
|
|||||||
debugImplementation(libs.ui.test.manifest)
|
debugImplementation(libs.ui.test.manifest)
|
||||||
|
|
||||||
// Local AAR library
|
// Local AAR library
|
||||||
implementation(files("../library/firefly-go.aar"))
|
implementation(files("libs/firefly-go.aar"))
|
||||||
|
|
||||||
|
implementation("org.slf4j:slf4j-android:1.7.36")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
app/libs/firefly-go-sources.jar
Normal file
BIN
app/libs/firefly-go-sources.jar
Normal file
Binary file not shown.
BIN
app/libs/firefly-go.aar
LFS
Normal file
BIN
app/libs/firefly-go.aar
LFS
Normal file
Binary file not shown.
@@ -18,12 +18,12 @@
|
|||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
android:theme="@style/Theme.FireflyPsAndorid"
|
android:theme="@style/Theme.FireflyGoAndroid"
|
||||||
tools:targetApi="31">
|
tools:targetApi="31">
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:theme="@style/Theme.FireflyPsAndorid">
|
android:theme="@style/Theme.FireflyGoAndroid">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import android.app.NotificationChannel
|
|||||||
import android.app.NotificationManager
|
import android.app.NotificationManager
|
||||||
import android.app.PendingIntent
|
import android.app.PendingIntent
|
||||||
import android.app.Service
|
import android.app.Service
|
||||||
import android.content.Context
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.graphics.BitmapFactory
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.IBinder
|
import android.os.IBinder
|
||||||
import android.os.PowerManager
|
import android.os.PowerManager
|
||||||
@@ -14,6 +14,7 @@ import androidx.compose.runtime.getValue
|
|||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.core.app.NotificationCompat
|
import androidx.core.app.NotificationCompat
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import libandroid.Libandroid
|
import libandroid.Libandroid
|
||||||
|
|
||||||
class GolangServerService : Service() {
|
class GolangServerService : Service() {
|
||||||
@@ -47,20 +48,29 @@ class GolangServerService : Service() {
|
|||||||
notificationIntent,
|
notificationIntent,
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||||
)
|
)
|
||||||
|
val largeIcon = BitmapFactory.decodeResource(resources, R.mipmap.ic_launcher)
|
||||||
|
|
||||||
val notification = NotificationCompat.Builder(this, CHANNEL_ID)
|
val notification = NotificationCompat.Builder(this, CHANNEL_ID)
|
||||||
|
.setSmallIcon(R.mipmap.ic_launcher_round)
|
||||||
|
.setLargeIcon(largeIcon)
|
||||||
.setContentTitle("FireflyGO Server")
|
.setContentTitle("FireflyGO Server")
|
||||||
.setContentText("FireflyGO is running...")
|
.setContentText("Server is running...")
|
||||||
.setSmallIcon(R.drawable.ic_launcher_foreground)
|
.setColor(ContextCompat.getColor(this, R.color.teal_700))
|
||||||
|
.setOngoing(true)
|
||||||
|
.setOnlyAlertOnce(true)
|
||||||
.setContentIntent(pendingIntent)
|
.setContentIntent(pendingIntent)
|
||||||
|
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
|
||||||
|
.setShowWhen(false)
|
||||||
|
.setCategory(NotificationCompat.CATEGORY_SERVICE)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
|
|
||||||
startForeground(NOTIFICATION_ID, notification)
|
startForeground(NOTIFICATION_ID, notification)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val powerManager = getSystemService(POWER_SERVICE) as PowerManager
|
val powerManager = getSystemService(POWER_SERVICE) as PowerManager
|
||||||
wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "GolangServer::WakeLock")
|
wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "GolangServer::WakeLock")
|
||||||
wakeLock?.acquire()
|
wakeLock?.acquire(10*60*1000L)
|
||||||
Log.d(TAG, "✅ WakeLock acquired")
|
Log.d(TAG, "✅ WakeLock acquired")
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e(TAG, "❌ WakeLock failed", e)
|
Log.e(TAG, "❌ WakeLock failed", e)
|
||||||
@@ -106,7 +116,6 @@ class GolangServerService : Service() {
|
|||||||
Log.e(TAG, "Error shutting down server", e)
|
Log.e(TAG, "Error shutting down server", e)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Giải phóng WakeLock nếu còn giữ
|
|
||||||
try {
|
try {
|
||||||
wakeLock?.let {
|
wakeLock?.let {
|
||||||
if (it.isHeld) {
|
if (it.isHeld) {
|
||||||
@@ -132,7 +141,7 @@ class GolangServerService : Service() {
|
|||||||
description = "Channel for running Golang backend in foreground"
|
description = "Channel for running Golang backend in foreground"
|
||||||
}
|
}
|
||||||
|
|
||||||
val manager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
val manager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
|
||||||
manager.createNotificationChannel(channel)
|
manager.createNotificationChannel(channel)
|
||||||
Log.d(TAG, "✅ Notification channel created")
|
Log.d(TAG, "✅ Notification channel created")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import androidx.compose.foundation.layout.*
|
|||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material3.*
|
import androidx.compose.material3.*
|
||||||
import androidx.compose.runtime.*
|
import androidx.compose.runtime.*
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
@@ -56,12 +55,17 @@ import androidx.compose.ui.draw.clip
|
|||||||
import androidx.compose.ui.draw.scale
|
import androidx.compose.ui.draw.scale
|
||||||
import androidx.compose.ui.geometry.Offset
|
import androidx.compose.ui.geometry.Offset
|
||||||
import androidx.compose.ui.graphics.Shadow
|
import androidx.compose.ui.graphics.Shadow
|
||||||
|
import androidx.compose.ui.text.AnnotatedString
|
||||||
|
import androidx.compose.ui.text.SpanStyle
|
||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
|
import androidx.compose.ui.text.withStyle
|
||||||
|
import androidx.compose.ui.text.buildAnnotatedString
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.window.Dialog
|
import androidx.compose.ui.window.Dialog
|
||||||
import androidx.compose.ui.window.DialogProperties
|
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
|
||||||
|
|
||||||
data class AppVersion(
|
data class AppVersion(
|
||||||
val latestVersion: String,
|
val latestVersion: String,
|
||||||
@@ -98,7 +102,7 @@ class MainActivity : ComponentActivity() {
|
|||||||
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
|
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
|
||||||
Box(modifier = Modifier.fillMaxSize()) {
|
Box(modifier = Modifier.fillMaxSize()) {
|
||||||
ServerControlScreen(appDataPath, dataDir, appVersion, Modifier.padding(innerPadding))
|
ServerControlScreen(appDataPath, dataDir, appVersion, Modifier.padding(innerPadding))
|
||||||
AutoUpdateDialog(onDismiss = {}, appVersion, true)
|
AutoUpdateDialog(onDismiss = {}, appVersion, dataDir, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -126,6 +130,28 @@ fun copyRawToFile(context: Context, targetDir: File, fileName: String, resId: In
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun removeFile(targetDir: File, fileName: String): Boolean {
|
||||||
|
val file = File(targetDir, fileName)
|
||||||
|
return if (file.exists()) {
|
||||||
|
try {
|
||||||
|
if (file.delete()) {
|
||||||
|
Log.i("FileRemove", "🗑️ Removed $fileName from ${file.absolutePath}")
|
||||||
|
true
|
||||||
|
} else {
|
||||||
|
Log.e("FileRemove", "❌ Failed to remove $fileName from ${file.absolutePath}")
|
||||||
|
false
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e("FileRemove", "❌ Error removing $fileName: ${e.message}")
|
||||||
|
false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.i("FileRemove", "ℹ️ $fileName does not exist in ${targetDir.absolutePath}")
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@SuppressLint("ImplicitSamInstance")
|
@SuppressLint("ImplicitSamInstance")
|
||||||
@Composable
|
@Composable
|
||||||
fun ServerControlScreen(appDataPath: String, dataDir: File, appVersion: AppVersion, modifier: Modifier = Modifier) {
|
fun ServerControlScreen(appDataPath: String, dataDir: File, appVersion: AppVersion, modifier: Modifier = Modifier) {
|
||||||
@@ -161,7 +187,7 @@ fun ServerControlScreen(appDataPath: String, dataDir: File, appVersion: AppVersi
|
|||||||
) {
|
) {
|
||||||
// Title
|
// Title
|
||||||
Text(
|
Text(
|
||||||
text = "Firefly Ps for Android",
|
text = "Firefly GO for Android",
|
||||||
fontSize = 26.sp,
|
fontSize = 26.sp,
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
modifier = Modifier.padding(top = 24.dp),
|
modifier = Modifier.padding(top = 24.dp),
|
||||||
@@ -248,7 +274,6 @@ fun ServerControlScreen(appDataPath: String, dataDir: File, appVersion: AppVersi
|
|||||||
horizontalArrangement = Arrangement.spacedBy(32.dp),
|
horizontalArrangement = Arrangement.spacedBy(32.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
val context = LocalContext.current
|
|
||||||
|
|
||||||
// Check Update widget
|
// Check Update widget
|
||||||
Column(
|
Column(
|
||||||
@@ -381,7 +406,9 @@ fun ServerControlScreen(appDataPath: String, dataDir: File, appVersion: AppVersi
|
|||||||
// Auto Update Dialog
|
// Auto Update Dialog
|
||||||
if (showUpdateDialog) {
|
if (showUpdateDialog) {
|
||||||
AutoUpdateDialog(
|
AutoUpdateDialog(
|
||||||
onDismiss = { showUpdateDialog = false }, appVersion
|
onDismiss = { showUpdateDialog = false },
|
||||||
|
appVersion,
|
||||||
|
dataDir
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -394,6 +421,63 @@ fun parseGoLogLine(line: String): String? {
|
|||||||
return if (content.isNullOrBlank()) null else content
|
return if (content.isNullOrBlank()) null else content
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun parseAnsi(text: String): AnnotatedString {
|
||||||
|
val regex = Regex("\u001B\\[(\\d+)(;\\d+)*m")
|
||||||
|
val builder = buildAnnotatedString {
|
||||||
|
var lastIndex = 0
|
||||||
|
var currentColor = Color.Black
|
||||||
|
|
||||||
|
for (match in regex.findAll(text)) {
|
||||||
|
val start = match.range.first
|
||||||
|
val before = text.substring(lastIndex, start)
|
||||||
|
withStyle(SpanStyle(color = currentColor)) {
|
||||||
|
append(before)
|
||||||
|
}
|
||||||
|
|
||||||
|
val code = match.groupValues[1].toInt()
|
||||||
|
currentColor = when (code) {
|
||||||
|
30 -> {
|
||||||
|
Color.Black
|
||||||
|
}
|
||||||
|
31 -> {
|
||||||
|
Color.Red
|
||||||
|
}
|
||||||
|
32 -> {
|
||||||
|
Color(0xFF00C853)
|
||||||
|
}
|
||||||
|
33 -> {
|
||||||
|
Color(0xFFFFD600)
|
||||||
|
}
|
||||||
|
34 -> {
|
||||||
|
Color(0xFF2962FF)
|
||||||
|
}
|
||||||
|
35 -> {
|
||||||
|
Color(0xFFD500F9)
|
||||||
|
}
|
||||||
|
36 -> {
|
||||||
|
Color(0xFF00B8D4)
|
||||||
|
}
|
||||||
|
|
||||||
|
37 -> {
|
||||||
|
Color.White
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
Color.Black
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lastIndex = match.range.last + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
val remain = text.substring(lastIndex)
|
||||||
|
withStyle(SpanStyle(color = currentColor)) {
|
||||||
|
append(remain)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun LogPopup(
|
fun LogPopup(
|
||||||
@@ -444,19 +528,16 @@ fun LogPopup(
|
|||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(8.dp))
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
|
|
||||||
LazyColumn(
|
LazyColumn(state = listState, modifier = Modifier.weight(1f)) {
|
||||||
state = listState,
|
|
||||||
modifier = Modifier.weight(1f)
|
|
||||||
) {
|
|
||||||
items(logs.size) { index ->
|
items(logs.size) { index ->
|
||||||
Text(
|
Text(
|
||||||
text = logs[index],
|
text = parseAnsi(logs[index]),
|
||||||
fontSize = 12.sp,
|
fontSize = 12.sp,
|
||||||
color = Color.Black,
|
|
||||||
modifier = Modifier.padding(vertical = 2.dp)
|
modifier = Modifier.padding(vertical = 2.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(8.dp))
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
Button(
|
Button(
|
||||||
onClick = { onDismiss() },
|
onClick = { onDismiss() },
|
||||||
@@ -475,6 +556,7 @@ fun LogPopup(
|
|||||||
fun AutoUpdateDialog(
|
fun AutoUpdateDialog(
|
||||||
onDismiss: () -> Unit,
|
onDismiss: () -> Unit,
|
||||||
appVersion: AppVersion,
|
appVersion: AppVersion,
|
||||||
|
dataDir: File,
|
||||||
isFirstOpen: Boolean = false
|
isFirstOpen: Boolean = false
|
||||||
) {
|
) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
@@ -522,6 +604,10 @@ fun AutoUpdateDialog(
|
|||||||
LaunchedEffect(progress) {
|
LaunchedEffect(progress) {
|
||||||
if (progress >= 100 && isDownloading) {
|
if (progress >= 100 && isDownloading) {
|
||||||
downloadComplete = true
|
downloadComplete = true
|
||||||
|
|
||||||
|
removeFile(dataDir, "data-in-game.json" )
|
||||||
|
removeFile(dataDir, "freesr-data.json")
|
||||||
|
removeFile(dataDir, "version.json")
|
||||||
delay(500)
|
delay(500)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -601,7 +687,7 @@ fun AutoUpdateDialog(
|
|||||||
autoUpdaterManager.downloadapk(
|
autoUpdaterManager.downloadapk(
|
||||||
context,
|
context,
|
||||||
update!!.apk_url,
|
update!!.apk_url,
|
||||||
"MyApp_${update!!.latestversion}.apk"
|
"FireflyGO_${update!!.latestversion}.apk"
|
||||||
) { prog -> progress = prog }
|
) { prog -> progress = prog }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"latest_version": "3.6.2-04",
|
"latest_version": "3.6.4-02",
|
||||||
"changelog": "UPDATE: New res",
|
"changelog": "UPDATE: Update to 3.6.54",
|
||||||
"apk_url": "https://git.kain.io.vn/Firefly-Shelter/FireflyGo_Android/releases/download/3.6.2-04/firefly_go_android.apk"
|
"apk_url": "https://git.kain.io.vn/Firefly-Shelter/FireflyGo_Android/releases/download/3.6.4-02/firefly_go_android.apk"
|
||||||
}
|
}
|
||||||
@@ -151,13 +151,13 @@
|
|||||||
200000
|
200000
|
||||||
],
|
],
|
||||||
"2": [
|
"2": [
|
||||||
500000,
|
2000000000,
|
||||||
10000000,
|
2000000000,
|
||||||
500000
|
2000000000
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"cycle_count": 1,
|
"cycle_count": 1,
|
||||||
"mode": true
|
"mode": false
|
||||||
},
|
},
|
||||||
"profile_data": {
|
"profile_data": {
|
||||||
"cur_chat_bubble_id": 220008,
|
"cur_chat_bubble_id": 220008,
|
||||||
@@ -180,5 +180,11 @@
|
|||||||
"skin_data": {
|
"skin_data": {
|
||||||
"1001": 1100101,
|
"1001": 1100101,
|
||||||
"1310": 1131001
|
"1310": 1131001
|
||||||
|
},
|
||||||
|
"extra_setting": {
|
||||||
|
"censorship": false,
|
||||||
|
"cm": false,
|
||||||
|
"first_person": false,
|
||||||
|
"hide_ui": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1206,7 +1206,7 @@
|
|||||||
"level": 15,
|
"level": 15,
|
||||||
"relic_id": 63095,
|
"relic_id": 63095,
|
||||||
"relic_set_id": 309,
|
"relic_set_id": 309,
|
||||||
"main_affix_id": 8,
|
"main_affix_id": 9,
|
||||||
"sub_affixes": [
|
"sub_affixes": [
|
||||||
{
|
{
|
||||||
"sub_affix_id": 5,
|
"sub_affix_id": 5,
|
||||||
@@ -9104,10 +9104,10 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"rank": 0,
|
"rank": 0,
|
||||||
"skills": {
|
"skills": {
|
||||||
"1013001": 1,
|
"1013001": 6,
|
||||||
"1013002": 1,
|
"1013002": 10,
|
||||||
"1013003": 1,
|
"1013003": 10,
|
||||||
"1013004": 1,
|
"1013004": 10,
|
||||||
"1013007": 1,
|
"1013007": 1,
|
||||||
"1013101": 1,
|
"1013101": 1,
|
||||||
"1013102": 1,
|
"1013102": 1,
|
||||||
@@ -9296,10 +9296,10 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"rank": 0,
|
"rank": 0,
|
||||||
"skills": {
|
"skills": {
|
||||||
"1104001": 1,
|
"1104001": 6,
|
||||||
"1104002": 1,
|
"1104002": 10,
|
||||||
"1104003": 1,
|
"1104003": 10,
|
||||||
"1104004": 1,
|
"1104004": 10,
|
||||||
"1104007": 1,
|
"1104007": 1,
|
||||||
"1104101": 1,
|
"1104101": 1,
|
||||||
"1104102": 1,
|
"1104102": 1,
|
||||||
@@ -9360,8 +9360,8 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"rank": 6,
|
"rank": 6,
|
||||||
"skills": {
|
"skills": {
|
||||||
"1106001": 3,
|
"1106001": 6,
|
||||||
"1106002": 9,
|
"1106002": 10,
|
||||||
"1106003": 10,
|
"1106003": 10,
|
||||||
"1106004": 10,
|
"1106004": 10,
|
||||||
"1106007": 1,
|
"1106007": 1,
|
||||||
@@ -9858,10 +9858,10 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"rank": 0,
|
"rank": 0,
|
||||||
"skills": {
|
"skills": {
|
||||||
"1209001": 1,
|
"1209001": 6,
|
||||||
"1209002": 1,
|
"1209002": 10,
|
||||||
"1209003": 1,
|
"1209003": 10,
|
||||||
"1209004": 1,
|
"1209004": 10,
|
||||||
"1209007": 1,
|
"1209007": 1,
|
||||||
"1209101": 1,
|
"1209101": 1,
|
||||||
"1209102": 1,
|
"1209102": 1,
|
||||||
@@ -11563,21 +11563,38 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"battle_config": {
|
"battle_config": {
|
||||||
"battle_type": "CE",
|
"battle_type": "MOC",
|
||||||
"blessings": [],
|
"blessings": [
|
||||||
|
{
|
||||||
|
"level": 1,
|
||||||
|
"id": 3030141
|
||||||
|
}
|
||||||
|
],
|
||||||
"custom_stats": [],
|
"custom_stats": [],
|
||||||
"cycle_count": 30,
|
"cycle_count": 30,
|
||||||
"stage_id": 103202,
|
"stage_id": 30118121,
|
||||||
"path_resonance_id": 0,
|
"path_resonance_id": 0,
|
||||||
"monsters": [
|
"monsters": [
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"monster_id": 8034012,
|
"monster_id": 2023030,
|
||||||
"level": 95,
|
"level": 95,
|
||||||
"amount": 1
|
"amount": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"monster_id": 8034012,
|
"monster_id": 4053020,
|
||||||
|
"level": 95,
|
||||||
|
"amount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"monster_id": 2023030,
|
||||||
|
"level": 95,
|
||||||
|
"amount": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"monster_id": 4014020,
|
||||||
"level": 95,
|
"level": 95,
|
||||||
"amount": 1
|
"amount": 1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,20 @@
|
|||||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12103115_ee78155e9867_3626f0948d93e2",
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12103115_ee78155e9867_3626f0948d93e2",
|
||||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12118783_55113408814f_c874267d04c04a"
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12118783_55113408814f_c874267d04c04a"
|
||||||
},
|
},
|
||||||
|
"CNBETAAndroid3.6.52": {
|
||||||
|
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12150127_00d6d096d968_cd76a04beb7ba6",
|
||||||
|
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12150127_00d6d096d968_cd76a04beb7ba6",
|
||||||
|
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_12178965_e246796e0bb6_05bcce36cd648b",
|
||||||
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12150614_5279f6d8029a_bdecff99d2d817",
|
||||||
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12164593_8e3fba5163df_b2b6fc46de4c06"
|
||||||
|
},
|
||||||
|
"CNBETAAndroid3.6.53": {
|
||||||
|
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12267173_87c48b19cccf_e57c755c3b27d6",
|
||||||
|
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12267173_87c48b19cccf_e57c755c3b27d6",
|
||||||
|
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_12291938_90c393f370b8_ecf686154f9ea4",
|
||||||
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12295568_47061d21355e_62b79a4851861d",
|
||||||
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12279762_593428c5dc22_788410d8dabf6a"
|
||||||
|
},
|
||||||
"CNBETAWin3.6.51": {
|
"CNBETAWin3.6.51": {
|
||||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12066992_f083970b907e_999074cab6dce6",
|
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12066992_f083970b907e_999074cab6dce6",
|
||||||
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12056690_16bfd67c199f_f3c0367d7b051e",
|
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12056690_16bfd67c199f_f3c0367d7b051e",
|
||||||
@@ -13,6 +27,20 @@
|
|||||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12103115_ee78155e9867_3626f0948d93e2",
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12103115_ee78155e9867_3626f0948d93e2",
|
||||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12118783_55113408814f_c874267d04c04a"
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12118783_55113408814f_c874267d04c04a"
|
||||||
},
|
},
|
||||||
|
"CNBETAWin3.6.52": {
|
||||||
|
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12150127_00d6d096d968_cd76a04beb7ba6",
|
||||||
|
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12150127_00d6d096d968_cd76a04beb7ba6",
|
||||||
|
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_12178965_e246796e0bb6_05bcce36cd648b",
|
||||||
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12150614_5279f6d8029a_bdecff99d2d817",
|
||||||
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12164593_8e3fba5163df_b2b6fc46de4c06"
|
||||||
|
},
|
||||||
|
"CNBETAWin3.6.53": {
|
||||||
|
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12267173_87c48b19cccf_e57c755c3b27d6",
|
||||||
|
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12267173_87c48b19cccf_e57c755c3b27d6",
|
||||||
|
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_12291938_90c393f370b8_ecf686154f9ea4",
|
||||||
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12295568_47061d21355e_62b79a4851861d",
|
||||||
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12279762_593428c5dc22_788410d8dabf6a"
|
||||||
|
},
|
||||||
"CNBETAiOS3.6.51": {
|
"CNBETAiOS3.6.51": {
|
||||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12066992_f083970b907e_999074cab6dce6",
|
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12066992_f083970b907e_999074cab6dce6",
|
||||||
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12056690_16bfd67c199f_f3c0367d7b051e",
|
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12056690_16bfd67c199f_f3c0367d7b051e",
|
||||||
@@ -20,6 +48,20 @@
|
|||||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12103115_ee78155e9867_3626f0948d93e2",
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12103115_ee78155e9867_3626f0948d93e2",
|
||||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12118783_55113408814f_c874267d04c04a"
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12118783_55113408814f_c874267d04c04a"
|
||||||
},
|
},
|
||||||
|
"CNBETAiOS3.6.52": {
|
||||||
|
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12150127_00d6d096d968_cd76a04beb7ba6",
|
||||||
|
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12150127_00d6d096d968_cd76a04beb7ba6",
|
||||||
|
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_12178965_e246796e0bb6_05bcce36cd648b",
|
||||||
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12150614_5279f6d8029a_bdecff99d2d817",
|
||||||
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12164593_8e3fba5163df_b2b6fc46de4c06"
|
||||||
|
},
|
||||||
|
"CNBETAiOS3.6.53": {
|
||||||
|
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12267173_87c48b19cccf_e57c755c3b27d6",
|
||||||
|
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12267173_87c48b19cccf_e57c755c3b27d6",
|
||||||
|
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_12291938_90c393f370b8_ecf686154f9ea4",
|
||||||
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12295568_47061d21355e_62b79a4851861d",
|
||||||
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12279762_593428c5dc22_788410d8dabf6a"
|
||||||
|
},
|
||||||
"OSBETAAndroid3.6.51": {
|
"OSBETAAndroid3.6.51": {
|
||||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12066992_f083970b907e_999074cab6dce6",
|
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12066992_f083970b907e_999074cab6dce6",
|
||||||
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12056690_16bfd67c199f_f3c0367d7b051e",
|
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12056690_16bfd67c199f_f3c0367d7b051e",
|
||||||
@@ -27,6 +69,20 @@
|
|||||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12103115_ee78155e9867_3626f0948d93e2",
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12103115_ee78155e9867_3626f0948d93e2",
|
||||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12118783_55113408814f_c874267d04c04a"
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12118783_55113408814f_c874267d04c04a"
|
||||||
},
|
},
|
||||||
|
"OSBETAAndroid3.6.52": {
|
||||||
|
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12150127_00d6d096d968_cd76a04beb7ba6",
|
||||||
|
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12150127_00d6d096d968_cd76a04beb7ba6",
|
||||||
|
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_12178965_e246796e0bb6_05bcce36cd648b",
|
||||||
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12150614_5279f6d8029a_bdecff99d2d817",
|
||||||
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12164593_8e3fba5163df_b2b6fc46de4c06"
|
||||||
|
},
|
||||||
|
"OSBETAAndroid3.6.53": {
|
||||||
|
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12267173_87c48b19cccf_e57c755c3b27d6",
|
||||||
|
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12267173_87c48b19cccf_e57c755c3b27d6",
|
||||||
|
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_12291938_90c393f370b8_ecf686154f9ea4",
|
||||||
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12295568_47061d21355e_62b79a4851861d",
|
||||||
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12279762_593428c5dc22_788410d8dabf6a"
|
||||||
|
},
|
||||||
"OSBETAWin3.6.51": {
|
"OSBETAWin3.6.51": {
|
||||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12066992_f083970b907e_999074cab6dce6",
|
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12066992_f083970b907e_999074cab6dce6",
|
||||||
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12056690_16bfd67c199f_f3c0367d7b051e",
|
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12056690_16bfd67c199f_f3c0367d7b051e",
|
||||||
@@ -34,11 +90,39 @@
|
|||||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12103115_ee78155e9867_3626f0948d93e2",
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12103115_ee78155e9867_3626f0948d93e2",
|
||||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12118783_55113408814f_c874267d04c04a"
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12118783_55113408814f_c874267d04c04a"
|
||||||
},
|
},
|
||||||
|
"OSBETAWin3.6.52": {
|
||||||
|
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12150127_00d6d096d968_cd76a04beb7ba6",
|
||||||
|
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12150127_00d6d096d968_cd76a04beb7ba6",
|
||||||
|
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_12178965_e246796e0bb6_05bcce36cd648b",
|
||||||
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12150614_5279f6d8029a_bdecff99d2d817",
|
||||||
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12164593_8e3fba5163df_b2b6fc46de4c06"
|
||||||
|
},
|
||||||
|
"OSBETAWin3.6.53": {
|
||||||
|
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12267173_87c48b19cccf_e57c755c3b27d6",
|
||||||
|
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12267173_87c48b19cccf_e57c755c3b27d6",
|
||||||
|
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_12291938_90c393f370b8_ecf686154f9ea4",
|
||||||
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12295568_47061d21355e_62b79a4851861d",
|
||||||
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12279762_593428c5dc22_788410d8dabf6a"
|
||||||
|
},
|
||||||
"OSBETAiOS3.6.51": {
|
"OSBETAiOS3.6.51": {
|
||||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12066992_f083970b907e_999074cab6dce6",
|
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12066992_f083970b907e_999074cab6dce6",
|
||||||
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12056690_16bfd67c199f_f3c0367d7b051e",
|
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12056690_16bfd67c199f_f3c0367d7b051e",
|
||||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_12114942_e99cbde25134_e63a6b835f17f9",
|
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_12114942_e99cbde25134_e63a6b835f17f9",
|
||||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12103115_ee78155e9867_3626f0948d93e2",
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12103115_ee78155e9867_3626f0948d93e2",
|
||||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12118783_55113408814f_c874267d04c04a"
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12118783_55113408814f_c874267d04c04a"
|
||||||
|
},
|
||||||
|
"OSBETAiOS3.6.52": {
|
||||||
|
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12150127_00d6d096d968_cd76a04beb7ba6",
|
||||||
|
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12150127_00d6d096d968_cd76a04beb7ba6",
|
||||||
|
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_12178965_e246796e0bb6_05bcce36cd648b",
|
||||||
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12150614_5279f6d8029a_bdecff99d2d817",
|
||||||
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12164593_8e3fba5163df_b2b6fc46de4c06"
|
||||||
|
},
|
||||||
|
"OSBETAiOS3.6.53": {
|
||||||
|
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12267173_87c48b19cccf_e57c755c3b27d6",
|
||||||
|
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12267173_87c48b19cccf_e57c755c3b27d6",
|
||||||
|
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_12291938_90c393f370b8_ecf686154f9ea4",
|
||||||
|
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12295568_47061d21355e_62b79a4851861d",
|
||||||
|
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12279762_593428c5dc22_788410d8dabf6a"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="Theme.FireflyPsAndorid" parent="android:Theme.Material.Light.NoActionBar" />
|
<style name="Theme.FireflyGoAndroid" parent="android:Theme.Material.Light.NoActionBar" />
|
||||||
</resources>
|
</resources>
|
||||||
@@ -14,12 +14,12 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
|||||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||||
# Android operating system, and which are packaged with your app's APK
|
# Android operating system, and which are packaged with your app's APK
|
||||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||||
|
org.gradle.parallel=true
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.enableJetifier=false
|
|
||||||
# Kotlin code style for this project: "official" or "obsolete":
|
# Kotlin code style for this project: "official" or "obsolete":
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
# Enables namespacing of each library's R class so that its R class includes only the
|
# Enables namespacing of each library's R class so that its R class includes only the
|
||||||
# resources declared in the library itself and none from the library's dependencies,
|
# resources declared in the library itself and none from the library's dependencies,
|
||||||
# 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=true
|
#org.gradle.configuration-cache=false
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
[versions]
|
[versions]
|
||||||
activityComposeVersion = "1.10.1"
|
activityComposeVersion = "1.11.0"
|
||||||
agp = "8.9.3"
|
agp = "8.13.0"
|
||||||
androidxJunit = "1.3.0"
|
androidxJunit = "1.3.0"
|
||||||
animationCore = "1.9.0"
|
animationCore = "1.9.2"
|
||||||
autoupdater = "1.0.1"
|
autoupdater = "1.0.1"
|
||||||
espressoCoreVersion = "3.7.0"
|
espressoCoreVersion = "3.7.0"
|
||||||
foundation = "1.9.0"
|
foundation = "1.9.2"
|
||||||
kotlin = "2.0.21"
|
kotlin = "2.2.20"
|
||||||
coreKtx = "1.17.0"
|
coreKtx = "1.17.0"
|
||||||
junit = "4.13.2"
|
junit = "4.13.2"
|
||||||
lifecycleRuntimeKtxVersion = "2.9.3"
|
lifecycleRuntimeKtxVersion = "2.9.4"
|
||||||
material = "1.9.0"
|
material = "1.9.2"
|
||||||
material3WindowSizeClass = "1.3.2"
|
material3WindowSizeClass = "1.4.0"
|
||||||
materialIconsExtended = "1.7.8"
|
materialIconsExtended = "1.7.8"
|
||||||
ui = "1.9.0"
|
ui = "1.9.2"
|
||||||
uiGraphics = "1.9.0"
|
uiGraphics = "1.9.2"
|
||||||
uiTestJunit4 = "1.9.0"
|
uiTestJunit4 = "1.9.2"
|
||||||
uiTestManifest = "1.9.0"
|
uiTestManifest = "1.9.2"
|
||||||
uiTooling = "1.9.0"
|
uiTooling = "1.9.2"
|
||||||
uiToolingPreview = "1.9.0"
|
uiToolingPreview = "1.9.2"
|
||||||
|
|
||||||
[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" }
|
||||||
|
|||||||
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
#Mon Apr 28 17:05:34 ICT 2025
|
#Wed Oct 08 15:20:16 ICT 2025
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:87408dc51a2862b36217129b2a675518705b4b69bbf33b8a6c876b0bdefb91b9
|
|
||||||
size 89628224
|
|
||||||
2
script/.gitignore
vendored
2
script/.gitignore
vendored
@@ -1,2 +0,0 @@
|
|||||||
.env
|
|
||||||
*.exe
|
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
## - UPDATE: New res
|
## - FIX: I forgot update new data
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
module release
|
|
||||||
|
|
||||||
go 1.25.0
|
|
||||||
|
|
||||||
require github.com/joho/godotenv v1.5.1
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
|
|
||||||
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
|
|
||||||
154
script/main.go
154
script/main.go
@@ -1,154 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"io"
|
|
||||||
"mime/multipart"
|
|
||||||
"net/http"
|
|
||||||
"os"
|
|
||||||
"path/filepath"
|
|
||||||
"github.com/joho/godotenv"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
repoOwner = "Firefly-Shelter"
|
|
||||||
repoName = "FireflyGo_Android"
|
|
||||||
giteaURL = "https://git.kain.io.vn"
|
|
||||||
)
|
|
||||||
|
|
||||||
type ReleaseInput struct {
|
|
||||||
TagName string `json:"tag_name"`
|
|
||||||
Name string `json:"name"`
|
|
||||||
Body string `json:"body"`
|
|
||||||
Draft bool `json:"draft"`
|
|
||||||
Prerelease bool `json:"prerelease"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type ReleaseResponse struct {
|
|
||||||
ID int `json:"id"`
|
|
||||||
HTMLURL string `json:"html_url"`
|
|
||||||
URL string `json:"url"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func readFile(path string) string {
|
|
||||||
data, err := os.ReadFile(path)
|
|
||||||
if err != nil {
|
|
||||||
panic(fmt.Sprintf("Failed to read %s: %v", path, err))
|
|
||||||
}
|
|
||||||
return string(data)
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
err := godotenv.Load("script/.env")
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println("Error loading .env file")
|
|
||||||
}
|
|
||||||
|
|
||||||
token := os.Getenv("TOKEN")
|
|
||||||
if token == "" {
|
|
||||||
fmt.Println("TOKEN not found in .env")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
releaseJSON := readFile("script/release.json")
|
|
||||||
var meta map[string]string
|
|
||||||
if err := json.Unmarshal([]byte(releaseJSON), &meta); err != nil {
|
|
||||||
panic("Invalid release.json")
|
|
||||||
}
|
|
||||||
tag := meta["tag"]
|
|
||||||
title := meta["title"]
|
|
||||||
body := readFile("script/README_Note.md")
|
|
||||||
|
|
||||||
// Step 1: Create release
|
|
||||||
releaseInput := ReleaseInput{
|
|
||||||
TagName: tag,
|
|
||||||
Name: title,
|
|
||||||
Body: body,
|
|
||||||
Draft: false,
|
|
||||||
Prerelease: false,
|
|
||||||
}
|
|
||||||
payload, _ := json.Marshal(releaseInput)
|
|
||||||
|
|
||||||
req, _ := http.NewRequest("POST",
|
|
||||||
fmt.Sprintf("%s/api/v1/repos/%s/%s/releases", giteaURL, repoOwner, repoName),
|
|
||||||
bytes.NewReader(payload),
|
|
||||||
)
|
|
||||||
req.Header.Set("Authorization", "token "+token)
|
|
||||||
req.Header.Set("Content-Type", "application/json")
|
|
||||||
|
|
||||||
resp, err := http.DefaultClient.Do(req)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusCreated {
|
|
||||||
bodyBytes, _ := io.ReadAll(resp.Body)
|
|
||||||
panic(fmt.Sprintf("Failed to create release: %s", bodyBytes))
|
|
||||||
}
|
|
||||||
|
|
||||||
var releaseResp ReleaseResponse
|
|
||||||
if err := json.NewDecoder(resp.Body).Decode(&releaseResp); err != nil {
|
|
||||||
panic("Failed to decode release response")
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Printf("Release created:\n- ID: %d\n- HTML: %s\n", releaseResp.ID, releaseResp.HTMLURL)
|
|
||||||
|
|
||||||
uploadURL := releaseResp.URL
|
|
||||||
if uploadURL == "" {
|
|
||||||
panic("url missing in release response")
|
|
||||||
}
|
|
||||||
|
|
||||||
files, err := os.ReadDir("app/release")
|
|
||||||
if err != nil {
|
|
||||||
panic("Cannot read prebuild folder")
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, file := range files {
|
|
||||||
if filepath.Ext(file.Name()) != ".apk" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
uploadPath := filepath.Join("app/release", file.Name())
|
|
||||||
fmt.Println("Uploading:", uploadPath)
|
|
||||||
|
|
||||||
buf := new(bytes.Buffer)
|
|
||||||
writer := multipart.NewWriter(buf)
|
|
||||||
part, err := writer.CreateFormFile("attachment", filepath.Base(uploadPath))
|
|
||||||
if err != nil {
|
|
||||||
fmt.Printf("Failed to create form: %v\n", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
src, err := os.Open(uploadPath)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Printf("Cannot open file %s: %v\n", file.Name(), err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
io.Copy(part, src)
|
|
||||||
src.Close()
|
|
||||||
writer.Close()
|
|
||||||
|
|
||||||
req, err := http.NewRequest("POST", uploadURL+"/assets", buf)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Printf("NewRequest error: %v\n", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
req.Header.Set("Authorization", "token "+token)
|
|
||||||
req.Header.Set("Content-Type", writer.FormDataContentType())
|
|
||||||
|
|
||||||
resp, err := http.DefaultClient.Do(req)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Printf("Upload failed: %v\n", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if resp.StatusCode != http.StatusCreated {
|
|
||||||
bodyBytes, _ := io.ReadAll(resp.Body)
|
|
||||||
fmt.Printf("Upload failed: %s\n", bodyBytes)
|
|
||||||
} else {
|
|
||||||
fmt.Println("Uploaded:", file.Name())
|
|
||||||
}
|
|
||||||
resp.Body.Close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
BIN
script/release-uploader
Normal file
BIN
script/release-uploader
Normal file
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"tag": "3.6.2-04",
|
"tag": "3.6.4-02",
|
||||||
"title": "PreBuild Version 3.6.52 - 04"
|
"title": "PreBuild Version 3.6.54 - 02"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
pluginManagement {
|
pluginManagement {
|
||||||
repositories {
|
repositories {
|
||||||
|
maven {
|
||||||
|
setUrl("https://jitpack.io")
|
||||||
|
}
|
||||||
google {
|
google {
|
||||||
content {
|
content {
|
||||||
includeGroupByRegex("com\\.android.*")
|
includeGroupByRegex("com\\.android.*")
|
||||||
@@ -9,18 +12,20 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||||
repositories {
|
repositories {
|
||||||
|
maven {
|
||||||
|
setUrl("https://jitpack.io")
|
||||||
|
}
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven{
|
|
||||||
url=uri("https://jitpack.io")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = "FireflyPsAndorid"
|
rootProject.name = "FireflyGoAndroid"
|
||||||
include(":app")
|
include(":app")
|
||||||
|
|||||||
Reference in New Issue
Block a user