Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b54d8bd0c5 | |||
| 89a772152b | |||
| ed411fc284 | |||
| b7b0457685 |
BIN
KeyStore.jks
BIN
KeyStore.jks
Binary file not shown.
@@ -10,6 +10,9 @@ import android.os.Build
|
||||
import android.os.IBinder
|
||||
import android.os.PowerManager
|
||||
import android.util.Log
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.core.app.NotificationCompat
|
||||
import libandroid.Libandroid
|
||||
|
||||
@@ -19,6 +22,7 @@ class GolangServerService : Service() {
|
||||
const val CHANNEL_ID = "GolangServerChannel"
|
||||
const val NOTIFICATION_ID = 1
|
||||
private const val TAG = "GolangServerService"
|
||||
var isRunning by mutableStateOf(false)
|
||||
}
|
||||
|
||||
private var wakeLock: PowerManager.WakeLock? = null
|
||||
@@ -29,9 +33,13 @@ class GolangServerService : Service() {
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
if (isRunning) {
|
||||
Log.d(TAG, "❗ Server is already running")
|
||||
return START_STICKY
|
||||
}
|
||||
isRunning = true
|
||||
Log.d(TAG, "onStartCommand called")
|
||||
|
||||
// 1. Tạo intent để mở lại MainActivity khi người dùng click vào thông báo
|
||||
val notificationIntent = Intent(this, MainActivity::class.java)
|
||||
val pendingIntent = PendingIntent.getActivity(
|
||||
this,
|
||||
@@ -40,18 +48,15 @@ class GolangServerService : Service() {
|
||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||
)
|
||||
|
||||
// 2. Tạo notification
|
||||
val notification = NotificationCompat.Builder(this, CHANNEL_ID)
|
||||
.setContentTitle("Golang Server")
|
||||
.setContentText("Server đang chạy")
|
||||
.setContentTitle("FireflyGO Server")
|
||||
.setContentText("FireflyGO is running...")
|
||||
.setSmallIcon(R.drawable.ic_launcher_foreground)
|
||||
.setContentIntent(pendingIntent)
|
||||
.build()
|
||||
|
||||
// 3. Chạy foreground
|
||||
startForeground(NOTIFICATION_ID, notification)
|
||||
|
||||
// 4. Giữ CPU không sleep (tùy chọn, nhưng hữu ích)
|
||||
try {
|
||||
val powerManager = getSystemService(POWER_SERVICE) as PowerManager
|
||||
wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "GolangServer::WakeLock")
|
||||
@@ -61,7 +66,6 @@ class GolangServerService : Service() {
|
||||
Log.e(TAG, "❌ WakeLock failed", e)
|
||||
}
|
||||
|
||||
// 5. Chạy server trong thread riêng
|
||||
Thread {
|
||||
try {
|
||||
val appDataPath = intent?.getStringExtra("appDataPath")
|
||||
@@ -69,16 +73,23 @@ class GolangServerService : Service() {
|
||||
Libandroid.setPathDataLocal(appDataPath)
|
||||
Log.d(TAG, "✅ Set path data: $appDataPath")
|
||||
} else {
|
||||
isRunning = false
|
||||
Log.e(TAG, "❌ appDataPath not received in intent")
|
||||
stopSelf()
|
||||
return@Thread
|
||||
}
|
||||
|
||||
Libandroid.setServerRunning(true)
|
||||
isRunning = true
|
||||
Log.d(TAG, "✅ Server started")
|
||||
} catch (e: Exception) {
|
||||
isRunning = false
|
||||
Log.e(TAG, "❌ Error starting server", e)
|
||||
stopSelf()
|
||||
}
|
||||
}.start()
|
||||
|
||||
|
||||
return START_STICKY
|
||||
}
|
||||
|
||||
@@ -89,6 +100,7 @@ class GolangServerService : Service() {
|
||||
// 1. Tắt server
|
||||
try {
|
||||
val result = Libandroid.setServerRunning(false)
|
||||
isRunning = false
|
||||
Log.d(TAG, "Server shutdown result: $result")
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Error shutting down server", e)
|
||||
@@ -105,6 +117,7 @@ class GolangServerService : Service() {
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "❌ Failed to release WakeLock", e)
|
||||
}
|
||||
isRunning = false
|
||||
}
|
||||
|
||||
override fun onBind(intent: Intent?): IBinder? = null
|
||||
|
||||
@@ -72,9 +72,8 @@ class MainActivity : ComponentActivity() {
|
||||
@Composable
|
||||
fun ServerControlScreen(appDataPath: String, modifier: Modifier = Modifier) {
|
||||
val context = LocalContext.current
|
||||
var isServerRunning by remember { mutableStateOf(false) }
|
||||
|
||||
val serverImage = if (isServerRunning)
|
||||
val isRunning = GolangServerService.isRunning
|
||||
val serverImage = if (isRunning)
|
||||
painterResource(id = R.drawable.server_running)
|
||||
else
|
||||
painterResource(id = R.drawable.server_stopped)
|
||||
@@ -115,8 +114,7 @@ fun ServerControlScreen(appDataPath: String, modifier: Modifier = Modifier) {
|
||||
Button(
|
||||
onClick = {
|
||||
try {
|
||||
isServerRunning = !isServerRunning
|
||||
if (isServerRunning) {
|
||||
if (!isRunning) {
|
||||
val intent = Intent(context, GolangServerService::class.java)
|
||||
intent.putExtra("appDataPath", appDataPath)
|
||||
context.startService(intent)
|
||||
@@ -128,7 +126,7 @@ fun ServerControlScreen(appDataPath: String, modifier: Modifier = Modifier) {
|
||||
}
|
||||
},
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = if (isServerRunning) Color(0xFFB71C1C) else Color(0xFF2196F3),
|
||||
containerColor = if (isRunning) Color(0xFFB71C1C) else Color(0xFF2196F3),
|
||||
contentColor = Color.White
|
||||
),
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
@@ -137,7 +135,7 @@ fun ServerControlScreen(appDataPath: String, modifier: Modifier = Modifier) {
|
||||
.height(50.dp)
|
||||
) {
|
||||
Text(
|
||||
text = if (isServerRunning) "Stop Server" else "Start Server",
|
||||
text = if (isRunning) "Stop Server" else "Start Server",
|
||||
fontSize = 20.sp
|
||||
)
|
||||
}
|
||||
@@ -146,9 +144,9 @@ fun ServerControlScreen(appDataPath: String, modifier: Modifier = Modifier) {
|
||||
|
||||
// Server status text
|
||||
Text(
|
||||
text = if (isServerRunning) "Server is running" else "Server is stopped",
|
||||
text = if (isRunning) "Server is running" else "Server is stopped",
|
||||
fontSize = 24.sp,
|
||||
color = if (isServerRunning) Color(0xFF4CAF50) else Color.Gray
|
||||
color = if (isRunning) Color(0xFF4CAF50) else Color.Gray
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
{
|
||||
"leader": 1,
|
||||
"leader": 0,
|
||||
"lineups": {
|
||||
"0": 1310,
|
||||
"1": 1410,
|
||||
"0": 1413,
|
||||
"1": 1403,
|
||||
"2": 1409,
|
||||
"3": 1407
|
||||
},
|
||||
"position": {
|
||||
"x": -4030,
|
||||
"z": -13006,
|
||||
"y": 0,
|
||||
"rot_y": 270000
|
||||
"x": -30,
|
||||
"z": -22750,
|
||||
"y": -15000,
|
||||
"rot_y": 234288
|
||||
},
|
||||
"scene": {
|
||||
"plane_id": 10000,
|
||||
"floor_id": 10000000,
|
||||
"entry_id": 100000104
|
||||
"floor_id": 10000003,
|
||||
"entry_id": 100000352
|
||||
},
|
||||
"char_path": {
|
||||
"main": 8008,
|
||||
@@ -38,6 +38,62 @@
|
||||
"first_lineup": [],
|
||||
"second_lineup": []
|
||||
},
|
||||
"battle_peak": {
|
||||
"current_mode": "Knight",
|
||||
"group_id": 1,
|
||||
"is_in_challenge_peak": false,
|
||||
"challenge_peak_data": {
|
||||
"1": {
|
||||
"checkmate_data": {
|
||||
"challenge_id": 104,
|
||||
"blessing": 3033006,
|
||||
"lineup": [
|
||||
1413,
|
||||
1409,
|
||||
1407,
|
||||
1403
|
||||
],
|
||||
"stage_id": 30501021,
|
||||
"is_hard_mode": false
|
||||
},
|
||||
"knight_data": {
|
||||
"current_challenge_id": 101,
|
||||
"details_data": [
|
||||
{
|
||||
"lineup": [
|
||||
1222,
|
||||
1225,
|
||||
1310,
|
||||
1303
|
||||
],
|
||||
"stage_id": 30501011,
|
||||
"challenge_id": 101
|
||||
},
|
||||
{
|
||||
"lineup": [
|
||||
1412,
|
||||
1414,
|
||||
1408,
|
||||
1313
|
||||
],
|
||||
"stage_id": 30501012,
|
||||
"challenge_id": 102
|
||||
},
|
||||
{
|
||||
"lineup": [
|
||||
1407,
|
||||
1403,
|
||||
1409,
|
||||
1413
|
||||
],
|
||||
"stage_id": 30501013,
|
||||
"challenge_id": 103
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"theory_craft": {
|
||||
"hp": {
|
||||
"1": 600000,
|
||||
@@ -48,11 +104,11 @@
|
||||
"mode": false
|
||||
},
|
||||
"profile_data": {
|
||||
"cur_chat_bubble_id": 220008,
|
||||
"cur_phone_theme_id": 221011,
|
||||
"cur_chat_bubble_id": 220000,
|
||||
"cur_phone_theme_id": 221012,
|
||||
"cur_phone_case_id": 254001,
|
||||
"cur_pam_skin_id": 252000,
|
||||
"cur_pet_id": 1002,
|
||||
"cur_pet_id": 1003,
|
||||
"cur_avatar_player_icon": 202034,
|
||||
"cur_player_personal_card": 253001,
|
||||
"cur_signature": "Firefly GO By Kain",
|
||||
@@ -60,8 +116,8 @@
|
||||
1310,
|
||||
1309,
|
||||
1407,
|
||||
1412,
|
||||
1001
|
||||
1413,
|
||||
1412
|
||||
],
|
||||
"cur_is_display_avatar": true
|
||||
},
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,38 +1,51 @@
|
||||
{
|
||||
"CNBETAAndroid3.4.55": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11217430_23c5cfd2cafc_071126dd600bae",
|
||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_11218061_68ee992558e3_fe33df3598d887",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_11218130_15360461a27a_91a0fd1d2b4db3",
|
||||
"CNBETAAndroid3.5.52": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11537608_83921e2bbfb5_f15a1cc2aaba76",
|
||||
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11531357_ac5c50fe7c5c_5b8f1dfdef8d06",
|
||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_11555075_e532a47d9e06_61b3c1ed162173",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_11531873_abaa8247cede_b13c1ccb975acd",
|
||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_0_40d2ce0253_c61ba99f70b885"
|
||||
},
|
||||
"CNBETAWin3.4.55": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11217430_23c5cfd2cafc_071126dd600bae",
|
||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_11218061_68ee992558e3_fe33df3598d887",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_11218130_15360461a27a_91a0fd1d2b4db3",
|
||||
"CNBETAWin3.5.52": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11537608_83921e2bbfb5_f15a1cc2aaba76",
|
||||
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11531357_ac5c50fe7c5c_5b8f1dfdef8d06",
|
||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_11555075_e532a47d9e06_61b3c1ed162173",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_11531873_abaa8247cede_b13c1ccb975acd",
|
||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_0_40d2ce0253_c61ba99f70b885"
|
||||
},
|
||||
"CNBETAiOS3.4.55": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11217430_23c5cfd2cafc_071126dd600bae",
|
||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_11218061_68ee992558e3_fe33df3598d887",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_11218130_15360461a27a_91a0fd1d2b4db3",
|
||||
"CNBETAiOS3.5.52": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11537608_83921e2bbfb5_f15a1cc2aaba76",
|
||||
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11531357_ac5c50fe7c5c_5b8f1dfdef8d06",
|
||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_11555075_e532a47d9e06_61b3c1ed162173",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_11531873_abaa8247cede_b13c1ccb975acd",
|
||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_0_40d2ce0253_c61ba99f70b885"
|
||||
},
|
||||
"OSBETAAndroid3.4.55": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11217430_23c5cfd2cafc_071126dd600bae",
|
||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_11218061_68ee992558e3_fe33df3598d887",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_11218130_15360461a27a_91a0fd1d2b4db3",
|
||||
"OSBETAAndroid3.5.52": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11537608_83921e2bbfb5_f15a1cc2aaba76",
|
||||
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11531357_ac5c50fe7c5c_5b8f1dfdef8d06",
|
||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_11555075_e532a47d9e06_61b3c1ed162173",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_11531873_abaa8247cede_b13c1ccb975acd",
|
||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_0_40d2ce0253_c61ba99f70b885"
|
||||
},
|
||||
"OSBETAWin3.4.55": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11217430_23c5cfd2cafc_071126dd600bae",
|
||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_11218061_68ee992558e3_fe33df3598d887",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_11218130_15360461a27a_91a0fd1d2b4db3",
|
||||
"OSBETAWin3.5.52": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11537608_83921e2bbfb5_f15a1cc2aaba76",
|
||||
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11531357_ac5c50fe7c5c_5b8f1dfdef8d06",
|
||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_11555075_e532a47d9e06_61b3c1ed162173",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_11531873_abaa8247cede_b13c1ccb975acd",
|
||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_0_40d2ce0253_c61ba99f70b885"
|
||||
},
|
||||
"OSBETAiOS3.4.55": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11217430_23c5cfd2cafc_071126dd600bae",
|
||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_11218061_68ee992558e3_fe33df3598d887",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_11218130_15360461a27a_91a0fd1d2b4db3",
|
||||
"OSBETAiOS3.5.52": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11537608_83921e2bbfb5_f15a1cc2aaba76",
|
||||
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11531357_ac5c50fe7c5c_5b8f1dfdef8d06",
|
||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_11555075_e532a47d9e06_61b3c1ed162173",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_11531873_abaa8247cede_b13c1ccb975acd",
|
||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_0_40d2ce0253_c61ba99f70b885"
|
||||
},
|
||||
"CNBETAWin3.5.51": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11497493_b4a5d8f717df_d632f2f00b0108",
|
||||
"asset_bundle_url_b": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11443120_75e75bb630b2_bb1653f50a24b3",
|
||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_11503893_72129078bcdf_31a0117dd0c5aa",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_11475376_d8a6597dc30c_b9f6afe07715f3",
|
||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_11454524_a18a9e47d5b8_3647b1d6ce2d9a"
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">FireflyGo-3.4.5X</string>
|
||||
<string name="app_name">FireflyGo-3.5.5X</string>
|
||||
</resources>
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ab23bd9a708e04ce0817aa7e3d05e81e3bd64e8846d0df54af9647b550d30859
|
||||
size 72329407
|
||||
oid sha256:abad4850602cbc65eba293b5d11527f6412275c1c7e5fd4e146c59fe3cf6258d
|
||||
size 73423352
|
||||
|
||||
Reference in New Issue
Block a user