feat: v4
@@ -0,0 +1 @@
|
||||
*.aar filter=lfs diff=lfs merge=lfs -text
|
||||
@@ -0,0 +1,125 @@
|
||||
<<<<<<< HEAD
|
||||
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"
|
||||
=======
|
||||
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"
|
||||
>>>>>>> 2459650 (feat: v4)
|
||||
@@ -0,0 +1,18 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/app/release
|
||||
/app/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
||||
.history/
|
||||
@@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
@@ -0,0 +1 @@
|
||||
FireflyGoAndroid
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AndroidProjectSystem">
|
||||
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,123 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<JetCodeStyleSettings>
|
||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||
</JetCodeStyleSettings>
|
||||
<codeStyleSettings language="XML">
|
||||
<option name="FORCE_REARRANGE_MODE" value="1" />
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:android</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:id</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>style</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="kotlin">
|
||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
@@ -0,0 +1,5 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
</state>
|
||||
</component>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="17" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetSelector">
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
||||
@@ -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>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
<option name="parallelModelFetch" value="true" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,50 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="ComposePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ComposePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ComposePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ComposePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="GlancePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="GlancePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="GlancePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="GlancePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewApiLevelMustBeValid" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewDeviceShouldUseNewSpec" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewParameterProviderOnFirstParameter" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="2.0.21" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MarkdownSettings">
|
||||
<option name="previewPanelProviderInfo">
|
||||
<ProviderInfo name="Compose (experimental)" className="com.intellij.markdown.compose.preview.ComposePanelProvider" />
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectMigrations">
|
||||
<option name="MigrateToGradleLocalJavaHome">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,9 @@
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1 @@
|
||||
/build
|
||||
@@ -0,0 +1,111 @@
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
alias(libs.plugins.kotlin.compose)
|
||||
}
|
||||
kotlin {
|
||||
jvmToolchain(17)
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
}
|
||||
android {
|
||||
namespace = "com.example.firefly_go_android"
|
||||
compileSdk = 36
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.kain344.firefly_go_android"
|
||||
minSdk = 24
|
||||
targetSdk = 35
|
||||
versionCode = 2
|
||||
versionName = "1.0.1"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
ndk {
|
||||
abiFilters.addAll(listOf("arm64-v8a"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
compose = true
|
||||
viewBinding = true
|
||||
}
|
||||
|
||||
composeOptions {
|
||||
kotlinCompilerExtensionVersion = "1.5.0"
|
||||
}
|
||||
buildToolsVersion = "36.0.0"
|
||||
ndkVersion = "27.2.12479018"
|
||||
dependenciesInfo {
|
||||
includeInApk = false
|
||||
includeInBundle = false
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.androidx.core.ktx)
|
||||
implementation(libs.androidx.lifecycle.runtime.ktx.v293)
|
||||
implementation(libs.androidx.activity.compose.v1101)
|
||||
// Compose UI
|
||||
implementation(libs.ui)
|
||||
implementation(libs.ui.graphics)
|
||||
implementation(libs.ui.tooling.preview)
|
||||
|
||||
// Foundation & Animation
|
||||
implementation(libs.androidx.foundation)
|
||||
implementation(libs.androidx.animation)
|
||||
implementation(libs.androidx.animation.core)
|
||||
|
||||
// Material & Material3
|
||||
implementation(libs.androidx.material)
|
||||
implementation(libs.androidx.material.icons.extended)
|
||||
implementation(libs.material3)
|
||||
implementation(libs.androidx.material3.window.size.class1)
|
||||
|
||||
// Auto updater library
|
||||
implementation(libs.autoupdater)
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
// OkHttp Client
|
||||
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
||||
|
||||
// Chrome Custom Tabs
|
||||
implementation("androidx.browser:browser:1.8.0")
|
||||
|
||||
>>>>>>> 2459650 (feat: v4)
|
||||
// Unit Test
|
||||
testImplementation(libs.junit)
|
||||
|
||||
// Android Instrumentation Test
|
||||
androidTestImplementation(libs.androidx.junit.v130)
|
||||
androidTestImplementation(libs.androidx.espresso.core.v370)
|
||||
androidTestImplementation(libs.ui.test.junit4)
|
||||
|
||||
// Debug
|
||||
debugImplementation(libs.ui.tooling)
|
||||
debugImplementation(libs.ui.test.manifest)
|
||||
|
||||
// Local AAR library
|
||||
implementation(files("libs/firefly-go.aar"))
|
||||
|
||||
implementation(libs.slf4j.android)
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.example.firefly_go_android
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("com.example.fireflypsandorid", appContext.packageName)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
<<<<<<< HEAD
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"
|
||||
tools:ignore="ForegroundServicesPolicy" />
|
||||
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
|
||||
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"
|
||||
tools:ignore="RequestInstallPackagesPolicy" />
|
||||
<uses-permission android:name="android.permission.READ_LOGS"/>
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
|
||||
tools:ignore="ScopedStorage" />
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:theme="@style/Theme.FireflyGoAndroid"
|
||||
tools:targetApi="31">
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:theme="@style/Theme.FireflyGoAndroid">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name=".GolangServerService"
|
||||
android:foregroundServiceType="specialUse"
|
||||
android:exported="false">
|
||||
<property
|
||||
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
|
||||
android:value="Running local Golang TCP/UDP Server" />
|
||||
</service>
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
|
||||
=======
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"
|
||||
tools:ignore="ForegroundServicesPolicy" />
|
||||
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
|
||||
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"
|
||||
tools:ignore="RequestInstallPackagesPolicy" />
|
||||
<uses-permission android:name="android.permission.READ_LOGS"/>
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
|
||||
tools:ignore="ScopedStorage" />
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:theme="@style/Theme.FireflyGoAndroid"
|
||||
tools:targetApi="31">
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:theme="@style/Theme.FireflyGoAndroid">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="firefly-launcher" android:host="auth" android:path="/discord" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name=".GolangServerService"
|
||||
android:foregroundServiceType="specialUse"
|
||||
android:exported="false">
|
||||
<property
|
||||
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
|
||||
android:value="Running local Golang TCP/UDP Server" />
|
||||
</service>
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
|
||||
>>>>>>> 2459650 (feat: v4)
|
||||
</manifest>
|
||||
@@ -0,0 +1,588 @@
|
||||
{
|
||||
"leader": 2,
|
||||
"lineups": {
|
||||
"0": 1409,
|
||||
"1": 1407,
|
||||
"2": 1406,
|
||||
"3": 1403
|
||||
},
|
||||
"position": {
|
||||
"x": -4030,
|
||||
"z": -13006,
|
||||
"y": 0,
|
||||
"rot_y": 270000
|
||||
},
|
||||
"scene": {
|
||||
"plane_id": 10000,
|
||||
"floor_id": 10000000,
|
||||
"entry_id": 100000104
|
||||
},
|
||||
"player_outfit": [
|
||||
1003
|
||||
],
|
||||
"char_path": {
|
||||
"main": 8008,
|
||||
"march_7": 1224
|
||||
},
|
||||
"char_enhanced": {
|
||||
"1004": 1,
|
||||
"1005": 0,
|
||||
"1006": 1,
|
||||
"1102": 1,
|
||||
"1205": 1,
|
||||
"1212": 1,
|
||||
"1217": 1,
|
||||
"1306": 1,
|
||||
"1307": 1,
|
||||
"1310": 1
|
||||
},
|
||||
"challenge": {
|
||||
"challenge_id": 0,
|
||||
"skip_half": 0,
|
||||
"random_seed": 0,
|
||||
"blessings": [],
|
||||
"is_in_challenge": false,
|
||||
"current_stage_id": 0,
|
||||
"path_resonance_id": 0,
|
||||
"maze_buff": 0,
|
||||
"first_lineup": [],
|
||||
"second_lineup": []
|
||||
},
|
||||
"challenge_tierce": {
|
||||
"challenge_id": 0,
|
||||
"current_stage_id": 0,
|
||||
"maze_buff": 0,
|
||||
"path_resonance_id": 0,
|
||||
"is_in_challenge": false,
|
||||
"is_single_stage": false,
|
||||
"challenge_tierce_data": {
|
||||
"20245": {
|
||||
"stage_1": {
|
||||
"blessing": 3031361,
|
||||
"cycle_count": 0,
|
||||
"battle_status": 1,
|
||||
"DeadCount": 0,
|
||||
"score": 40000,
|
||||
"lineup": [
|
||||
1407,
|
||||
1413,
|
||||
1415,
|
||||
1409
|
||||
]
|
||||
},
|
||||
"stage_2": {
|
||||
"blessing": 3031361,
|
||||
"cycle_count": 0,
|
||||
"battle_status": 1,
|
||||
"DeadCount": 0,
|
||||
"score": 40000,
|
||||
"lineup": [
|
||||
1310,
|
||||
1225,
|
||||
1321,
|
||||
1222
|
||||
]
|
||||
},
|
||||
"stage_3": {
|
||||
"blessing": 3031362,
|
||||
"cycle_count": 0,
|
||||
"battle_status": 1,
|
||||
"DeadCount": 0,
|
||||
"score": 40000,
|
||||
"lineup": [
|
||||
1506,
|
||||
1502,
|
||||
1501,
|
||||
1217
|
||||
]
|
||||
}
|
||||
},
|
||||
"30185": {
|
||||
"stage_1": {
|
||||
"blessing": 3111090,
|
||||
"cycle_count": 0,
|
||||
"battle_status": 1,
|
||||
"DeadCount": 0,
|
||||
"score": 3932,
|
||||
"lineup": [
|
||||
1501,
|
||||
1502,
|
||||
1414,
|
||||
1506
|
||||
]
|
||||
},
|
||||
"stage_2": {
|
||||
"blessing": 3111085,
|
||||
"cycle_count": 0,
|
||||
"battle_status": 1,
|
||||
"DeadCount": 0,
|
||||
"score": 3913,
|
||||
"lineup": [
|
||||
1310,
|
||||
1225,
|
||||
1303,
|
||||
1321
|
||||
]
|
||||
},
|
||||
"stage_3": {
|
||||
"blessing": 3111071,
|
||||
"cycle_count": 0,
|
||||
"battle_status": 1,
|
||||
"DeadCount": 0,
|
||||
"score": 4000,
|
||||
"lineup": [
|
||||
1415,
|
||||
1413,
|
||||
1407,
|
||||
1409
|
||||
]
|
||||
}
|
||||
},
|
||||
"5213": {
|
||||
"stage_1": {
|
||||
"blessing": 0,
|
||||
"cycle_count": 0,
|
||||
"battle_status": 1,
|
||||
"DeadCount": 0,
|
||||
"score": 0,
|
||||
"lineup": [
|
||||
1407,
|
||||
1413,
|
||||
1415,
|
||||
1409
|
||||
]
|
||||
},
|
||||
"stage_2": {
|
||||
"blessing": 0,
|
||||
"cycle_count": 1,
|
||||
"battle_status": 1,
|
||||
"DeadCount": 0,
|
||||
"score": 0,
|
||||
"lineup": [
|
||||
1310,
|
||||
1321,
|
||||
1225,
|
||||
1222
|
||||
]
|
||||
},
|
||||
"stage_3": {
|
||||
"blessing": 0,
|
||||
"cycle_count": 0,
|
||||
"battle_status": 1,
|
||||
"DeadCount": 0,
|
||||
"score": 0,
|
||||
"lineup": [
|
||||
1506,
|
||||
1502,
|
||||
1501,
|
||||
1414
|
||||
]
|
||||
}
|
||||
},
|
||||
"5313": {
|
||||
"stage_1": {
|
||||
"blessing": 0,
|
||||
"cycle_count": 0,
|
||||
"battle_status": 3,
|
||||
"DeadCount": 0,
|
||||
"score": 0,
|
||||
"lineup": [
|
||||
1510,
|
||||
8001,
|
||||
1004,
|
||||
1414
|
||||
]
|
||||
},
|
||||
"stage_2": {
|
||||
"blessing": 0,
|
||||
"cycle_count": 0,
|
||||
"battle_status": 0,
|
||||
"DeadCount": 0,
|
||||
"score": 0,
|
||||
"lineup": [
|
||||
1302
|
||||
]
|
||||
},
|
||||
"stage_3": {
|
||||
"blessing": 0,
|
||||
"cycle_count": 0,
|
||||
"battle_status": 0,
|
||||
"DeadCount": 0,
|
||||
"score": 0,
|
||||
"lineup": [
|
||||
1321
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"challenge_peak": {
|
||||
"current_mode": "Knight",
|
||||
"group_id": 8,
|
||||
"is_in_challenge_peak": false,
|
||||
"challenge_peak_data": {
|
||||
"1": {
|
||||
"checkmate_data": {
|
||||
"challenge_id": 104,
|
||||
"blessing": 3033006,
|
||||
"lineup": [
|
||||
1413,
|
||||
1409,
|
||||
1407,
|
||||
1403
|
||||
],
|
||||
"stage_id": 30501022,
|
||||
"is_hard_mode": true
|
||||
},
|
||||
"knight_data": {
|
||||
"current_challenge_id": 103,
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"2": {
|
||||
"checkmate_data": {
|
||||
"challenge_id": 204,
|
||||
"blessing": 3033021,
|
||||
"lineup": [
|
||||
1415,
|
||||
1413,
|
||||
1409,
|
||||
1407
|
||||
],
|
||||
"stage_id": 30502022,
|
||||
"is_hard_mode": true
|
||||
},
|
||||
"knight_data": {
|
||||
"current_challenge_id": 203,
|
||||
"details_data": [
|
||||
{
|
||||
"lineup": [
|
||||
1302,
|
||||
1309,
|
||||
1410
|
||||
],
|
||||
"stage_id": 30502011,
|
||||
"challenge_id": 201
|
||||
},
|
||||
{
|
||||
"lineup": [
|
||||
1221,
|
||||
1222
|
||||
],
|
||||
"stage_id": 30502012,
|
||||
"challenge_id": 202
|
||||
},
|
||||
{
|
||||
"lineup": [
|
||||
1415,
|
||||
8001,
|
||||
1414,
|
||||
1313
|
||||
],
|
||||
"stage_id": 30502013,
|
||||
"challenge_id": 203
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"3": {
|
||||
"checkmate_data": {
|
||||
"challenge_id": 304,
|
||||
"blessing": 3033032,
|
||||
"lineup": [
|
||||
1222,
|
||||
1225,
|
||||
1310,
|
||||
1321
|
||||
],
|
||||
"stage_id": 30503021,
|
||||
"is_hard_mode": false
|
||||
},
|
||||
"knight_data": {
|
||||
"current_challenge_id": 302,
|
||||
"details_data": [
|
||||
{
|
||||
"lineup": [
|
||||
1003
|
||||
],
|
||||
"stage_id": 30503011,
|
||||
"challenge_id": 301
|
||||
},
|
||||
{
|
||||
"lineup": [
|
||||
1315
|
||||
],
|
||||
"stage_id": 30503012,
|
||||
"challenge_id": 302
|
||||
},
|
||||
{
|
||||
"lineup": [
|
||||
8001
|
||||
],
|
||||
"stage_id": 30503013,
|
||||
"challenge_id": 303
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"4": {
|
||||
"checkmate_data": {
|
||||
"challenge_id": 404,
|
||||
"blessing": 3033045,
|
||||
"lineup": [
|
||||
1310
|
||||
],
|
||||
"stage_id": 30504021,
|
||||
"is_hard_mode": false
|
||||
},
|
||||
"knight_data": {
|
||||
"current_challenge_id": 401,
|
||||
"details_data": [
|
||||
{
|
||||
"lineup": [
|
||||
1302
|
||||
],
|
||||
"stage_id": 30504011,
|
||||
"challenge_id": 401
|
||||
},
|
||||
{
|
||||
"lineup": [
|
||||
1321
|
||||
],
|
||||
"stage_id": 30504012,
|
||||
"challenge_id": 402
|
||||
},
|
||||
{
|
||||
"lineup": [
|
||||
1218
|
||||
],
|
||||
"stage_id": 30504013,
|
||||
"challenge_id": 403
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"5": {
|
||||
"checkmate_data": {
|
||||
"challenge_id": 504,
|
||||
"blessing": 3033050,
|
||||
"lineup": [
|
||||
1415,
|
||||
1413,
|
||||
1407,
|
||||
1409
|
||||
],
|
||||
"stage_id": 30505021,
|
||||
"is_hard_mode": false
|
||||
},
|
||||
"knight_data": {
|
||||
"current_challenge_id": 501,
|
||||
"details_data": [
|
||||
{
|
||||
"lineup": [
|
||||
1310
|
||||
],
|
||||
"stage_id": 30505011,
|
||||
"challenge_id": 501
|
||||
},
|
||||
{
|
||||
"lineup": [
|
||||
1407
|
||||
],
|
||||
"stage_id": 30505012,
|
||||
"challenge_id": 502
|
||||
},
|
||||
{
|
||||
"lineup": [
|
||||
1502
|
||||
],
|
||||
"stage_id": 30505013,
|
||||
"challenge_id": 503
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"6": {
|
||||
"checkmate_data": {
|
||||
"challenge_id": 604,
|
||||
"blessing": 3033053,
|
||||
"lineup": [
|
||||
1505,
|
||||
1217,
|
||||
1502,
|
||||
8001
|
||||
],
|
||||
"stage_id": 30506021,
|
||||
"is_hard_mode": false
|
||||
},
|
||||
"knight_data": {
|
||||
"current_challenge_id": 602,
|
||||
"details_data": [
|
||||
{
|
||||
"lineup": [
|
||||
1309
|
||||
],
|
||||
"stage_id": 30506011,
|
||||
"challenge_id": 601
|
||||
},
|
||||
{
|
||||
"lineup": [
|
||||
1321,
|
||||
1310,
|
||||
1225,
|
||||
1303
|
||||
],
|
||||
"stage_id": 30506012,
|
||||
"challenge_id": 602
|
||||
},
|
||||
{
|
||||
"lineup": [
|
||||
1415,
|
||||
1413,
|
||||
1409,
|
||||
1407
|
||||
],
|
||||
"stage_id": 30506013,
|
||||
"challenge_id": 603
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"7": {
|
||||
"checkmate_data": {
|
||||
"challenge_id": 704,
|
||||
"blessing": 3033061,
|
||||
"lineup": [
|
||||
1505,
|
||||
1502,
|
||||
1414,
|
||||
1410
|
||||
],
|
||||
"stage_id": 30507021,
|
||||
"is_hard_mode": false
|
||||
},
|
||||
"knight_data": {
|
||||
"current_challenge_id": 703,
|
||||
"details_data": [
|
||||
{
|
||||
"lineup": [
|
||||
1414
|
||||
],
|
||||
"stage_id": 30507011,
|
||||
"challenge_id": 701
|
||||
},
|
||||
{
|
||||
"lineup": [
|
||||
1501
|
||||
],
|
||||
"stage_id": 30507012,
|
||||
"challenge_id": 702
|
||||
},
|
||||
{
|
||||
"lineup": [
|
||||
1507,
|
||||
1222
|
||||
],
|
||||
"stage_id": 30507013,
|
||||
"challenge_id": 703
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"8": {
|
||||
"checkmate_data": {
|
||||
"challenge_id": 0,
|
||||
"blessing": 0,
|
||||
"lineup": null,
|
||||
"stage_id": 0,
|
||||
"is_hard_mode": false
|
||||
},
|
||||
"knight_data": {
|
||||
"current_challenge_id": 0,
|
||||
"details_data": null
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"theory_craft": {
|
||||
"hp": {
|
||||
"1": [
|
||||
200000,
|
||||
1000000,
|
||||
200000
|
||||
],
|
||||
"2": [
|
||||
2000000000,
|
||||
2000000000,
|
||||
2000000000
|
||||
],
|
||||
"3": []
|
||||
},
|
||||
"cycle_count": 1,
|
||||
"stage_id": 30118121,
|
||||
"mode": false,
|
||||
"custom_lineup": []
|
||||
},
|
||||
"profile_data": {
|
||||
"cur_chat_bubble_id": 220009,
|
||||
"cur_phone_theme_id": 221012,
|
||||
"cur_phone_case_id": 254001,
|
||||
"cur_pam_skin_id": 252000,
|
||||
"cur_pet_id": 0,
|
||||
"cur_avatar_player_icon": 202034,
|
||||
"cur_player_personal_card": 253001,
|
||||
"cur_signature": "Firefly GO By Kain",
|
||||
"cur_nickname": "Firefly GO",
|
||||
"cur_display_avatar": [
|
||||
1310,
|
||||
1309,
|
||||
1407,
|
||||
1413,
|
||||
1412
|
||||
],
|
||||
"cur_is_display_avatar": true
|
||||
},
|
||||
"skin_data": {
|
||||
"1001": 1100101,
|
||||
"1310": 1131001,
|
||||
"1407": 1140701,
|
||||
"1415": 1141501
|
||||
},
|
||||
"extra_setting": {
|
||||
"censorship": false,
|
||||
"cm": false,
|
||||
"first_person": false,
|
||||
"hide_ui": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
{
|
||||
"CNBETAAndroid4.3.51": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15261247_f6e6db2125cf_369da465b36faf",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15235885_6091fd15561a_83828f542dc1f3",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15265964_c2fbb1eb05fc_f2238199ee2b6e",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15242148_d40f856defc0_599b68a0adf7bd",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15265964_799df4f0ecef_5a94550ba64cff"
|
||||
},
|
||||
"CNBETAAndroid4.3.52": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15305566_fea016d35145_54bbf8ab4009f5",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15305566_fea016d35145_54bbf8ab4009f5",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15318724_a7af31327e74_b3328eb95329b2",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15305751_09783637ccc4_d16f9c81138ab3",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15265964_799df4f0ecef_5a94550ba64cff"
|
||||
},
|
||||
"CNBETAAndroid4.3.53": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15378434_99bffafdeff7_5d97713dcef07f",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15378434_99bffafdeff7_5d97713dcef07f",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15385668_07011a79dadf_1111728953724e",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15378559_7514340ac82f_70dad6c56b8bc7",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15384138_4e4be8cf97ac_1e3fcfa0a93bef"
|
||||
},
|
||||
"CNBETAAndroid4.3.54": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15440751_fb99372e1e48_fd11e486274779",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15440751_fb99372e1e48_fd11e486274779",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15497648_6ef97acf9b45_ea8ed0ff303308",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15440843_4201511c48d0_34717e44c82e30",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_0_40d2ce0253_6d871f8bca6eb4"
|
||||
},
|
||||
"CNBETAWin4.3.51": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15261247_f6e6db2125cf_369da465b36faf",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15235885_6091fd15561a_83828f542dc1f3",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15265964_c2fbb1eb05fc_f2238199ee2b6e",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15242148_d40f856defc0_599b68a0adf7bd",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15265964_799df4f0ecef_5a94550ba64cff"
|
||||
},
|
||||
"CNBETAWin4.3.52": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15305566_fea016d35145_54bbf8ab4009f5",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15305566_fea016d35145_54bbf8ab4009f5",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15318724_a7af31327e74_b3328eb95329b2",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15305751_09783637ccc4_d16f9c81138ab3",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15265964_799df4f0ecef_5a94550ba64cff"
|
||||
},
|
||||
"CNBETAWin4.3.53": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15378434_99bffafdeff7_5d97713dcef07f",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15378434_99bffafdeff7_5d97713dcef07f",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15385668_07011a79dadf_1111728953724e",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15378559_7514340ac82f_70dad6c56b8bc7",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15384138_4e4be8cf97ac_1e3fcfa0a93bef"
|
||||
},
|
||||
"CNBETAWin4.3.54": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15440751_fb99372e1e48_fd11e486274779",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15440751_fb99372e1e48_fd11e486274779",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15497648_6ef97acf9b45_ea8ed0ff303308",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15440843_4201511c48d0_34717e44c82e30",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_0_40d2ce0253_6d871f8bca6eb4"
|
||||
},
|
||||
"CNBETAiOS4.3.51": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15261247_f6e6db2125cf_369da465b36faf",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15235885_6091fd15561a_83828f542dc1f3",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15265964_c2fbb1eb05fc_f2238199ee2b6e",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15242148_d40f856defc0_599b68a0adf7bd",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15265964_799df4f0ecef_5a94550ba64cff"
|
||||
},
|
||||
"CNBETAiOS4.3.52": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15305566_fea016d35145_54bbf8ab4009f5",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15305566_fea016d35145_54bbf8ab4009f5",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15318724_a7af31327e74_b3328eb95329b2",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15305751_09783637ccc4_d16f9c81138ab3",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15265964_799df4f0ecef_5a94550ba64cff"
|
||||
},
|
||||
"CNBETAiOS4.3.53": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15378434_99bffafdeff7_5d97713dcef07f",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15378434_99bffafdeff7_5d97713dcef07f",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15385668_07011a79dadf_1111728953724e",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15378559_7514340ac82f_70dad6c56b8bc7",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15384138_4e4be8cf97ac_1e3fcfa0a93bef"
|
||||
},
|
||||
"CNBETAiOS4.3.54": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15440751_fb99372e1e48_fd11e486274779",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15440751_fb99372e1e48_fd11e486274779",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15497648_6ef97acf9b45_ea8ed0ff303308",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15440843_4201511c48d0_34717e44c82e30",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_0_40d2ce0253_6d871f8bca6eb4"
|
||||
},
|
||||
"OSBETAAndroid4.3.51": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15261247_f6e6db2125cf_369da465b36faf",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15235885_6091fd15561a_83828f542dc1f3",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15265964_c2fbb1eb05fc_f2238199ee2b6e",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15242148_d40f856defc0_599b68a0adf7bd",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15265964_799df4f0ecef_5a94550ba64cff"
|
||||
},
|
||||
"OSBETAAndroid4.3.52": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15305566_fea016d35145_54bbf8ab4009f5",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15305566_fea016d35145_54bbf8ab4009f5",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15318724_a7af31327e74_b3328eb95329b2",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15305751_09783637ccc4_d16f9c81138ab3",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15265964_799df4f0ecef_5a94550ba64cff"
|
||||
},
|
||||
"OSBETAAndroid4.3.53": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15378434_99bffafdeff7_5d97713dcef07f",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15378434_99bffafdeff7_5d97713dcef07f",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15385668_07011a79dadf_1111728953724e",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15378559_7514340ac82f_70dad6c56b8bc7",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15384138_4e4be8cf97ac_1e3fcfa0a93bef"
|
||||
},
|
||||
"OSBETAAndroid4.3.54": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15440751_fb99372e1e48_fd11e486274779",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15440751_fb99372e1e48_fd11e486274779",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15497648_6ef97acf9b45_ea8ed0ff303308",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15440843_4201511c48d0_34717e44c82e30",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_0_40d2ce0253_6d871f8bca6eb4"
|
||||
},
|
||||
"OSBETAWin4.3.51": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15261247_f6e6db2125cf_369da465b36faf",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15235885_6091fd15561a_83828f542dc1f3",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15265964_c2fbb1eb05fc_f2238199ee2b6e",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15242148_d40f856defc0_599b68a0adf7bd",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15265964_799df4f0ecef_5a94550ba64cff"
|
||||
},
|
||||
"OSBETAWin4.3.52": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15305566_fea016d35145_54bbf8ab4009f5",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15305566_fea016d35145_54bbf8ab4009f5",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15318724_a7af31327e74_b3328eb95329b2",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15305751_09783637ccc4_d16f9c81138ab3",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15265964_799df4f0ecef_5a94550ba64cff"
|
||||
},
|
||||
"OSBETAWin4.3.53": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15378434_99bffafdeff7_5d97713dcef07f",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15378434_99bffafdeff7_5d97713dcef07f",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15385668_07011a79dadf_1111728953724e",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15378559_7514340ac82f_70dad6c56b8bc7",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15384138_4e4be8cf97ac_1e3fcfa0a93bef"
|
||||
},
|
||||
"OSBETAWin4.3.54": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15440751_fb99372e1e48_fd11e486274779",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15440751_fb99372e1e48_fd11e486274779",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15497648_6ef97acf9b45_ea8ed0ff303308",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15440843_4201511c48d0_34717e44c82e30",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_0_40d2ce0253_6d871f8bca6eb4"
|
||||
},
|
||||
"OSBETAiOS4.3.51": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15261247_f6e6db2125cf_369da465b36faf",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15235885_6091fd15561a_83828f542dc1f3",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15265964_c2fbb1eb05fc_f2238199ee2b6e",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15242148_d40f856defc0_599b68a0adf7bd",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15265964_799df4f0ecef_5a94550ba64cff"
|
||||
},
|
||||
"OSBETAiOS4.3.52": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15305566_fea016d35145_54bbf8ab4009f5",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15305566_fea016d35145_54bbf8ab4009f5",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15318724_a7af31327e74_b3328eb95329b2",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15305751_09783637ccc4_d16f9c81138ab3",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15265964_799df4f0ecef_5a94550ba64cff"
|
||||
},
|
||||
"OSBETAiOS4.3.53": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15378434_99bffafdeff7_5d97713dcef07f",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15378434_99bffafdeff7_5d97713dcef07f",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15385668_07011a79dadf_1111728953724e",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15378559_7514340ac82f_70dad6c56b8bc7",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_15384138_4e4be8cf97ac_1e3fcfa0a93bef"
|
||||
},
|
||||
"OSBETAiOS4.3.54": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_15440751_fb99372e1e48_fd11e486274779",
|
||||
"asset_bundle_url_b": "https://autopatchos.starrails.com/asb/BetaLive/output_15440751_fb99372e1e48_fd11e486274779",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_15497648_6ef97acf9b45_ea8ed0ff303308",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_15440843_4201511c48d0_34717e44c82e30",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_0_40d2ce0253_6d871f8bca6eb4"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 649 KiB |
@@ -0,0 +1,350 @@
|
||||
<<<<<<< HEAD
|
||||
package com.example.firefly_go_android
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.NotificationChannel
|
||||
import android.app.NotificationManager
|
||||
import android.app.PendingIntent
|
||||
import android.app.Service
|
||||
import android.content.Intent
|
||||
import android.content.pm.ServiceInfo
|
||||
import android.graphics.BitmapFactory
|
||||
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 androidx.core.content.ContextCompat
|
||||
import libandroid.Libandroid
|
||||
import androidx.core.content.edit
|
||||
|
||||
class GolangServerService : Service() {
|
||||
|
||||
companion object {
|
||||
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
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
createNotificationChannel()
|
||||
}
|
||||
|
||||
@SuppressLint("WakelockTimeout")
|
||||
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")
|
||||
|
||||
val notificationIntent = Intent(this, MainActivity::class.java)
|
||||
val pendingIntent = PendingIntent.getActivity(
|
||||
this,
|
||||
0,
|
||||
notificationIntent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||
)
|
||||
val largeIcon = BitmapFactory.decodeResource(resources, R.mipmap.ic_launcher)
|
||||
|
||||
val notification = NotificationCompat.Builder(this, CHANNEL_ID)
|
||||
.setSmallIcon(R.mipmap.ic_launcher_round)
|
||||
.setLargeIcon(largeIcon)
|
||||
.setContentTitle("FireflyGO Server")
|
||||
.setContentText("Server is running...")
|
||||
.setColor(ContextCompat.getColor(this, R.color.teal_700))
|
||||
.setOngoing(true)
|
||||
.setOnlyAlertOnce(true)
|
||||
.setContentIntent(pendingIntent)
|
||||
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
|
||||
.setShowWhen(false)
|
||||
.setCategory(NotificationCompat.CATEGORY_SERVICE)
|
||||
.build()
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 34) {
|
||||
startForeground(
|
||||
NOTIFICATION_ID,
|
||||
notification,
|
||||
ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE
|
||||
)
|
||||
} else if (Build.VERSION.SDK_INT >= 29) {
|
||||
startForeground(
|
||||
NOTIFICATION_ID,
|
||||
notification,
|
||||
ServiceInfo.FOREGROUND_SERVICE_TYPE_MANIFEST
|
||||
)
|
||||
} else {
|
||||
startForeground(NOTIFICATION_ID, notification)
|
||||
}
|
||||
|
||||
// Khởi tạo WakeLock và WifiLock
|
||||
try {
|
||||
val powerManager = getSystemService(POWER_SERVICE) as PowerManager
|
||||
wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "GolangServer::WakeLock")
|
||||
wakeLock?.acquire()
|
||||
Log.d(TAG, "WakeLock acquired")
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Lock failed", e)
|
||||
}
|
||||
|
||||
Thread {
|
||||
try {
|
||||
val sharedPrefs = getSharedPreferences("AppPrefs", MODE_PRIVATE)
|
||||
var appDataPath = intent?.getStringExtra("appDataPath")
|
||||
|
||||
if (appDataPath != null) {
|
||||
sharedPrefs.edit { putString("saved_app_data_path", appDataPath) }
|
||||
} else {
|
||||
appDataPath = sharedPrefs.getString("saved_app_data_path", null)
|
||||
}
|
||||
|
||||
if (appDataPath != null) {
|
||||
Libandroid.setPathDataLocal(appDataPath)
|
||||
Log.d(TAG, "Set path data: $appDataPath")
|
||||
} else {
|
||||
isRunning = false
|
||||
Log.e(TAG, "appDataPath not received and not found in SharedPreferences")
|
||||
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
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
Log.d(TAG, "onDestroy called")
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
// Nhả các khóa tài nguyên
|
||||
try {
|
||||
wakeLock?.let {
|
||||
if (it.isHeld) {
|
||||
it.release()
|
||||
Log.d(TAG, "WakeLock released")
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Failed to release Locks", e)
|
||||
}
|
||||
isRunning = false
|
||||
}
|
||||
|
||||
override fun onBind(intent: Intent?): IBinder? = null
|
||||
|
||||
private fun createNotificationChannel() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
val channel = NotificationChannel(
|
||||
CHANNEL_ID,
|
||||
"Golang Server Channel",
|
||||
NotificationManager.IMPORTANCE_LOW
|
||||
).apply {
|
||||
description = "Channel for running Golang backend in foreground"
|
||||
}
|
||||
|
||||
val manager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
|
||||
manager.createNotificationChannel(channel)
|
||||
Log.d(TAG, "Notification channel created")
|
||||
}
|
||||
}
|
||||
=======
|
||||
package com.example.firefly_go_android
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.NotificationChannel
|
||||
import android.app.NotificationManager
|
||||
import android.app.PendingIntent
|
||||
import android.app.Service
|
||||
import android.content.Intent
|
||||
import android.content.pm.ServiceInfo
|
||||
import android.graphics.BitmapFactory
|
||||
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 androidx.core.content.ContextCompat
|
||||
import libandroid.Libandroid
|
||||
import androidx.core.content.edit
|
||||
|
||||
class GolangServerService : Service() {
|
||||
|
||||
companion object {
|
||||
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
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
createNotificationChannel()
|
||||
}
|
||||
|
||||
@SuppressLint("WakelockTimeout")
|
||||
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")
|
||||
|
||||
val notificationIntent = Intent(this, MainActivity::class.java)
|
||||
val pendingIntent = PendingIntent.getActivity(
|
||||
this,
|
||||
0,
|
||||
notificationIntent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||
)
|
||||
val largeIcon = BitmapFactory.decodeResource(resources, R.mipmap.ic_launcher)
|
||||
|
||||
val notification = NotificationCompat.Builder(this, CHANNEL_ID)
|
||||
.setSmallIcon(R.mipmap.ic_launcher_round)
|
||||
.setLargeIcon(largeIcon)
|
||||
.setContentTitle("FireflyGO Server")
|
||||
.setContentText("Server is running...")
|
||||
.setColor(ContextCompat.getColor(this, R.color.teal_700))
|
||||
.setOngoing(true)
|
||||
.setOnlyAlertOnce(true)
|
||||
.setContentIntent(pendingIntent)
|
||||
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
|
||||
.setShowWhen(false)
|
||||
.setCategory(NotificationCompat.CATEGORY_SERVICE)
|
||||
.build()
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 34) {
|
||||
startForeground(
|
||||
NOTIFICATION_ID,
|
||||
notification,
|
||||
ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE
|
||||
)
|
||||
} else if (Build.VERSION.SDK_INT >= 29) {
|
||||
startForeground(
|
||||
NOTIFICATION_ID,
|
||||
notification,
|
||||
ServiceInfo.FOREGROUND_SERVICE_TYPE_MANIFEST
|
||||
)
|
||||
} else {
|
||||
startForeground(NOTIFICATION_ID, notification)
|
||||
}
|
||||
|
||||
// Khởi tạo WakeLock và WifiLock
|
||||
try {
|
||||
val powerManager = getSystemService(POWER_SERVICE) as PowerManager
|
||||
wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "GolangServer::WakeLock")
|
||||
wakeLock?.acquire()
|
||||
Log.d(TAG, "WakeLock acquired")
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Lock failed", e)
|
||||
}
|
||||
|
||||
Thread {
|
||||
try {
|
||||
val sharedPrefs = getSharedPreferences("AppPrefs", MODE_PRIVATE)
|
||||
var appDataPath = intent?.getStringExtra("appDataPath")
|
||||
|
||||
if (appDataPath != null) {
|
||||
sharedPrefs.edit { putString("saved_app_data_path", appDataPath) }
|
||||
} else {
|
||||
appDataPath = sharedPrefs.getString("saved_app_data_path", null)
|
||||
}
|
||||
|
||||
if (appDataPath != null) {
|
||||
Libandroid.setPathDataLocal(appDataPath)
|
||||
Log.d(TAG, "Set path data: $appDataPath")
|
||||
} else {
|
||||
isRunning = false
|
||||
Log.e(TAG, "appDataPath not received and not found in SharedPreferences")
|
||||
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
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
Log.d(TAG, "onDestroy called")
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
// Nhả các khóa tài nguyên
|
||||
try {
|
||||
wakeLock?.let {
|
||||
if (it.isHeld) {
|
||||
it.release()
|
||||
Log.d(TAG, "WakeLock released")
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Failed to release Locks", e)
|
||||
}
|
||||
isRunning = false
|
||||
}
|
||||
|
||||
override fun onBind(intent: Intent?): IBinder? = null
|
||||
|
||||
private fun createNotificationChannel() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
val channel = NotificationChannel(
|
||||
CHANNEL_ID,
|
||||
"Golang Server Channel",
|
||||
NotificationManager.IMPORTANCE_LOW
|
||||
).apply {
|
||||
description = "Channel for running Golang backend in foreground"
|
||||
}
|
||||
|
||||
val manager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
|
||||
manager.createNotificationChannel(channel)
|
||||
Log.d(TAG, "Notification channel created")
|
||||
}
|
||||
}
|
||||
>>>>>>> 2459650 (feat: v4)
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.example.firefly_go_android.network
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import okhttp3.*
|
||||
import okhttp3.MediaType.Companion.toMediaType
|
||||
import okhttp3.RequestBody.Companion.toRequestBody
|
||||
import org.json.JSONObject
|
||||
import java.io.IOException
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
class AuthManager(private val context: Context) {
|
||||
private val sharedPrefs = context.getSharedPreferences("auth_prefs", Context.MODE_PRIVATE)
|
||||
private val client = OkHttpClient()
|
||||
|
||||
companion object {
|
||||
private const val BASE_URL = "https://api.punklorde.org"
|
||||
private const val TOKEN_KEY = "access_token"
|
||||
private const val EMAIL_KEY = "user_email"
|
||||
private const val IS_PLAYER_KEY = "is_player"
|
||||
}
|
||||
|
||||
var accessToken: String?
|
||||
get() = sharedPrefs.getString(TOKEN_KEY, null)
|
||||
set(value) = sharedPrefs.edit().putString(TOKEN_KEY, value).apply()
|
||||
|
||||
var userEmail: String?
|
||||
get() = sharedPrefs.getString(EMAIL_KEY, null)
|
||||
set(value) = sharedPrefs.edit().putString(EMAIL_KEY, value).apply()
|
||||
|
||||
var isPlayer: Boolean
|
||||
get() = sharedPrefs.getBoolean(IS_PLAYER_KEY, false)
|
||||
set(value) = sharedPrefs.edit().putBoolean(IS_PLAYER_KEY, value).apply()
|
||||
|
||||
val isLoggedIn: Boolean
|
||||
get() = accessToken != null
|
||||
|
||||
suspend fun login(email: String, password: String): Result<Boolean> = withContext(Dispatchers.IO) {
|
||||
val json = JSONObject().apply {
|
||||
put("email", email)
|
||||
put("password", password)
|
||||
}
|
||||
val body = json.toString().toRequestBody("application/json; charset=utf-8".toMediaType())
|
||||
val request = Request.Builder()
|
||||
.url("$BASE_URL/auth/signin")
|
||||
.post(body)
|
||||
.build()
|
||||
|
||||
try {
|
||||
client.newCall(request).execute().use { response ->
|
||||
val bodyStr = response.body?.string() ?: ""
|
||||
if (!response.isSuccessful) {
|
||||
val errMsg = try {
|
||||
JSONObject(bodyStr).getString("message")
|
||||
} catch (e: Exception) {
|
||||
"Login failed: ${response.code}"
|
||||
}
|
||||
return@withContext Result.failure(Exception(errMsg))
|
||||
}
|
||||
|
||||
val jsonResponse = JSONObject(bodyStr)
|
||||
if (!jsonResponse.getBoolean("status")) {
|
||||
return@withContext Result.failure(Exception(jsonResponse.optString("message", "Login failed")))
|
||||
}
|
||||
|
||||
val data = jsonResponse.getJSONObject("data")
|
||||
val token = data.getString("access_token")
|
||||
accessToken = token
|
||||
userEmail = email
|
||||
|
||||
// Fetch user profile to verify role
|
||||
return@withContext fetchProfileAndVerifyRole(token)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
return@withContext Result.failure(e)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun fetchProfileAndVerifyRole(token: String): Result<Boolean> = withContext(Dispatchers.IO) {
|
||||
val request = Request.Builder()
|
||||
.url("$BASE_URL/users/current")
|
||||
.header("Authorization", "Bearer $token")
|
||||
.get()
|
||||
.build()
|
||||
|
||||
try {
|
||||
client.newCall(request).execute().use { response ->
|
||||
val bodyStr = response.body?.string() ?: ""
|
||||
if (!response.isSuccessful) {
|
||||
// Token might have expired, clear local credentials
|
||||
if (response.code == 401) {
|
||||
logout()
|
||||
}
|
||||
return@withContext Result.failure(Exception("Failed to fetch profile: ${response.code}"))
|
||||
}
|
||||
|
||||
val jsonResponse = JSONObject(bodyStr)
|
||||
if (!jsonResponse.getBoolean("status")) {
|
||||
return@withContext Result.failure(Exception(jsonResponse.optString("message", "Failed to fetch profile")))
|
||||
}
|
||||
|
||||
val data = jsonResponse.getJSONObject("data")
|
||||
val rolesArray = data.getJSONArray("roles")
|
||||
var hasPlayerRole = false
|
||||
for (i in 0 until rolesArray.length()) {
|
||||
val roleObj = rolesArray.getJSONObject(i)
|
||||
val roleName = roleObj.getString("name").uppercase()
|
||||
if (roleName == "PLAYER" || roleName == "ADMIN" || roleName == "MOD") {
|
||||
hasPlayerRole = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
isPlayer = hasPlayerRole
|
||||
return@withContext Result.success(hasPlayerRole)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
return@withContext Result.failure(e)
|
||||
}
|
||||
}
|
||||
|
||||
fun logout() {
|
||||
accessToken = null
|
||||
userEmail = null
|
||||
isPlayer = false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,376 @@
|
||||
package com.example.firefly_go_android
|
||||
|
||||
import AutoUpdaterManager
|
||||
import android.content.Context
|
||||
import androidx.compose.animation.animateContentSize
|
||||
import androidx.compose.animation.core.FastOutSlowInEasing
|
||||
import androidx.compose.animation.core.Spring
|
||||
import androidx.compose.animation.core.animateFloatAsState
|
||||
import androidx.compose.animation.core.spring
|
||||
import androidx.compose.animation.core.tween
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.rounded.*
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.draw.scale
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import com.example.firefly_go_android.R
|
||||
import com.example.autoupdater.UpdateFeatures
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.io.File
|
||||
|
||||
@Composable
|
||||
fun AutoUpdateDialog(
|
||||
onDismiss: () -> Unit,
|
||||
appVersion: AppVersion,
|
||||
dataDir: File,
|
||||
isFirstOpen: Boolean = false
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
val autoUpdaterManager = AutoUpdaterManager(context)
|
||||
var update by remember { mutableStateOf<UpdateFeatures?>(null) }
|
||||
var progress by remember { mutableStateOf(0) }
|
||||
var showDialog by remember { mutableStateOf(false) }
|
||||
var isDownloading by remember { mutableStateOf(false) }
|
||||
var downloadComplete by remember { mutableStateOf(false) }
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
|
||||
val progressAnimation by animateFloatAsState(
|
||||
targetValue = progress / 100f,
|
||||
animationSpec = tween(300, easing = FastOutSlowInEasing),
|
||||
label = "progress"
|
||||
)
|
||||
|
||||
val scaleAnimation by animateFloatAsState(
|
||||
targetValue = if (showDialog) 1f else 0.8f,
|
||||
animationSpec = spring(dampingRatio = Spring.DampingRatioMediumBouncy),
|
||||
label = "scale"
|
||||
)
|
||||
|
||||
// Check for update
|
||||
LaunchedEffect(Unit) {
|
||||
val result = withContext(Dispatchers.IO) {
|
||||
autoUpdaterManager.checkForUpdate(
|
||||
JSONfileURL = "https://git.kain.io.vn/Firefly-Shelter/FireflyGo_Andoid/raw/branch/master/app/src/main/res/raw/app_version_json.json"
|
||||
)
|
||||
}
|
||||
|
||||
val hasUpdate = result != null && appVersion.latestVersion != result.latestversion
|
||||
|
||||
update = if (hasUpdate) result else null
|
||||
|
||||
showDialog = if (isFirstOpen) {
|
||||
hasUpdate
|
||||
} else {
|
||||
result != null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Download progress
|
||||
LaunchedEffect(progress) {
|
||||
if (progress >= 100 && isDownloading) {
|
||||
downloadComplete = true
|
||||
}
|
||||
}
|
||||
|
||||
if (showDialog) {
|
||||
Dialog(
|
||||
onDismissRequest = {
|
||||
if (!isDownloading) showDialog = false
|
||||
onDismiss()
|
||||
},
|
||||
properties = DialogProperties(
|
||||
dismissOnBackPress = !isDownloading,
|
||||
dismissOnClickOutside = !isDownloading,
|
||||
usePlatformDefaultWidth = false
|
||||
)
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth(0.9f)
|
||||
.scale(scaleAnimation)
|
||||
.animateContentSize()
|
||||
.background(Color.Black.copy(alpha = 0.85f), RoundedCornerShape(24.dp))
|
||||
.border(1.5.dp, Color.White.copy(alpha = 0.2f), RoundedCornerShape(24.dp))
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier.padding(24.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(72.dp)
|
||||
.background(
|
||||
Color.White.copy(alpha = 0.1f),
|
||||
CircleShape
|
||||
),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Icon(
|
||||
imageVector = if (update != null) Icons.Rounded.SystemUpdate
|
||||
else Icons.Rounded.CheckCircle,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(36.dp),
|
||||
tint = if (update != null) Color(0xFF2196F3) else Color(0xFF4CAF50)
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
Text(
|
||||
text = if (update != null) stringResource(id = R.string.update_available) else stringResource(id = R.string.no_update_available),
|
||||
style = MaterialTheme.typography.headlineSmall,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = Color.White,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
|
||||
if (update != null) {
|
||||
VersionInfoSection(update!!)
|
||||
ChangelogSection(update!!)
|
||||
DownloadProgressSection(
|
||||
isDownloading = isDownloading,
|
||||
downloadComplete = downloadComplete,
|
||||
progress = progressAnimation
|
||||
)
|
||||
ActionButtons(
|
||||
isDownloading = isDownloading,
|
||||
downloadComplete = downloadComplete,
|
||||
onDownloadClick = {
|
||||
isDownloading = true
|
||||
coroutineScope.launch {
|
||||
withContext(Dispatchers.IO) {
|
||||
autoUpdaterManager.downloadapk(
|
||||
context,
|
||||
update!!.apk_url,
|
||||
"FireflyGO_${update!!.latestversion}.apk"
|
||||
) { prog -> progress = prog }
|
||||
}
|
||||
}
|
||||
},
|
||||
onDismiss = { showDialog = false; onDismiss() }
|
||||
)
|
||||
} else {
|
||||
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.app_up_to_date),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = Color.White.copy(alpha = 0.7f),
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
|
||||
|
||||
Button(
|
||||
onClick = { showDialog = false; onDismiss() },
|
||||
modifier = Modifier.wrapContentWidth(),
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = Color(0xCC0D47A1),
|
||||
contentColor = Color.White
|
||||
),
|
||||
contentPadding = PaddingValues(horizontal = 32.dp, vertical = 12.dp)
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.ok),
|
||||
style = MaterialTheme.typography.labelMedium
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun VersionInfoSection(update: UpdateFeatures) {
|
||||
Card(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
colors = CardDefaults.cardColors(
|
||||
containerColor = Color.White.copy(alpha = 0.08f)
|
||||
),
|
||||
shape = RoundedCornerShape(12.dp)
|
||||
) {
|
||||
Column(modifier = Modifier.padding(16.dp)) {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.latest_version),
|
||||
style = MaterialTheme.typography.labelMedium,
|
||||
color = Color.White.copy(alpha = 0.7f)
|
||||
)
|
||||
Surface(
|
||||
shape = RoundedCornerShape(8.dp),
|
||||
color = Color(0xCC0D47A1)
|
||||
) {
|
||||
Text(
|
||||
text = "v${update.latestversion}",
|
||||
modifier = Modifier.padding(horizontal = 8.dp, vertical = 4.dp),
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
color = Color.White,
|
||||
fontWeight = FontWeight.Medium
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun ChangelogSection(update: UpdateFeatures) {
|
||||
Column(modifier = Modifier.fillMaxWidth()) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Icon(
|
||||
imageVector = Icons.Rounded.AutoAwesome,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(16.dp),
|
||||
tint = Color(0xFF4CAF50)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Text(
|
||||
text = stringResource(id = R.string.whats_new),
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
fontWeight = FontWeight.Medium,
|
||||
color = Color.White
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
Text(
|
||||
text = update.changelog,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = Color.White.copy(alpha = 0.8f),
|
||||
lineHeight = 20.sp
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun DownloadProgressSection(
|
||||
isDownloading: Boolean,
|
||||
downloadComplete: Boolean,
|
||||
progress: Float
|
||||
) {
|
||||
if (!isDownloading && !downloadComplete) return
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
Column(modifier = Modifier.fillMaxWidth()) {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Text(
|
||||
text = if (downloadComplete) stringResource(id = R.string.installation_ready) else stringResource(id = R.string.downloading),
|
||||
style = MaterialTheme.typography.labelMedium,
|
||||
color = Color.White,
|
||||
fontWeight = FontWeight.Medium
|
||||
)
|
||||
Text(
|
||||
text = "${(progress * 100).toInt()}%",
|
||||
style = MaterialTheme.typography.labelMedium,
|
||||
color = Color.White.copy(alpha = 0.8f)
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
LinearProgressIndicator(
|
||||
progress = { progress },
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(8.dp)
|
||||
.clip(RoundedCornerShape(4.dp)),
|
||||
color = if (downloadComplete) Color(0xFF4CAF50) else Color(0xFF2196F3),
|
||||
trackColor = Color.White.copy(alpha = 0.15f),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun ActionButtons(
|
||||
isDownloading: Boolean,
|
||||
downloadComplete: Boolean,
|
||||
onDownloadClick: () -> Unit,
|
||||
onDismiss: () -> Unit
|
||||
) {
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = if (!isDownloading && !downloadComplete) Arrangement.spacedBy(12.dp) else Arrangement.Center
|
||||
) {
|
||||
if (!downloadComplete) {
|
||||
OutlinedButton(
|
||||
onClick = onDismiss,
|
||||
modifier = Modifier.weight(1f),
|
||||
enabled = !isDownloading,
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
colors = ButtonDefaults.outlinedButtonColors(contentColor = Color.White),
|
||||
border = BorderStroke(1.dp, Color.White.copy(alpha = 0.3f))
|
||||
) {
|
||||
Text(text = stringResource(id = R.string.later), style = MaterialTheme.typography.labelLarge)
|
||||
}
|
||||
}
|
||||
|
||||
Button(
|
||||
onClick = onDownloadClick,
|
||||
modifier = if (downloadComplete) Modifier.widthIn(min = 160.dp) else Modifier.weight(1f),
|
||||
enabled = !isDownloading || downloadComplete,
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = if (downloadComplete) Color(0xFF4CAF50) else Color(0xCC0D47A1)
|
||||
)
|
||||
) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.Center) {
|
||||
when {
|
||||
downloadComplete -> {
|
||||
Icon(Icons.Rounded.InstallMobile, contentDescription = null, modifier = Modifier.size(18.dp), tint = Color.White)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Text(stringResource(id = R.string.install_now), style = MaterialTheme.typography.labelLarge, fontWeight = FontWeight.Medium, color = Color.White)
|
||||
}
|
||||
isDownloading -> {
|
||||
CircularProgressIndicator(modifier = Modifier.size(24.dp), color = Color.White)
|
||||
}
|
||||
else -> {
|
||||
Icon(
|
||||
imageVector = Icons.Rounded.Download,
|
||||
contentDescription = "Download",
|
||||
modifier = Modifier.size(24.dp),
|
||||
tint = Color.White
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,254 @@
|
||||
package com.example.firefly_go_android
|
||||
|
||||
import android.util.Log
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import com.example.firefly_go_android.R
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.text.AnnotatedString
|
||||
import androidx.compose.ui.text.SpanStyle
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.buildAnnotatedString
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.withStyle
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.io.BufferedReader
|
||||
import java.io.InputStreamReader
|
||||
|
||||
data class LogEntry(val id: Long, val text: String)
|
||||
|
||||
@Composable
|
||||
fun LogPopup(
|
||||
onDismiss: () -> Unit
|
||||
) {
|
||||
val logs = remember { mutableStateListOf<LogEntry>() }
|
||||
var nextLogId by remember { mutableLongStateOf(0L) }
|
||||
var autoScroll by remember { mutableStateOf(true) }
|
||||
val listState = rememberLazyListState()
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
withContext(Dispatchers.IO) {
|
||||
var process: Process? = null
|
||||
var reader: BufferedReader? = null
|
||||
try {
|
||||
process = Runtime.getRuntime().exec("logcat -T 300 -s GoLog")
|
||||
reader = BufferedReader(InputStreamReader(process.inputStream))
|
||||
|
||||
// Safely destroy the logcat process and close the stream when the coroutine is cancelled
|
||||
coroutineContext[Job]?.invokeOnCompletion {
|
||||
try {
|
||||
process?.destroy()
|
||||
reader?.close()
|
||||
} catch (e: Exception) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
var line: String?
|
||||
while (reader.readLine().also { line = it } != null) {
|
||||
val clean = parseGoLogLine(line!!)
|
||||
if (!clean.isNullOrBlank()) {
|
||||
withContext(Dispatchers.Main) {
|
||||
logs.add(LogEntry(nextLogId++, clean))
|
||||
if (logs.size > 500) {
|
||||
logs.removeAt(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
withContext(Dispatchers.Main) {
|
||||
logs.add(LogEntry(nextLogId++, "Error reading logcat: ${e.message}"))
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
process?.destroy()
|
||||
reader?.close()
|
||||
} catch (e: Exception) {
|
||||
// ignore
|
||||
}
|
||||
Log.i("LogPopup", "Logcat process destroyed and stream closed successfully")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LaunchedEffect(logs.size) {
|
||||
if (autoScroll && logs.isNotEmpty()) {
|
||||
listState.scrollToItem(logs.size - 1)
|
||||
}
|
||||
}
|
||||
|
||||
val defaultTextColor = Color.White.copy(alpha = 0.9f)
|
||||
|
||||
Dialog(
|
||||
onDismissRequest = { onDismiss() },
|
||||
properties = DialogProperties(usePlatformDefaultWidth = false)
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth(0.9f)
|
||||
.fillMaxHeight(0.7f)
|
||||
.background(Color.Black.copy(alpha = 0.8f), RoundedCornerShape(16.dp))
|
||||
.border(1.5.dp, Color.White.copy(alpha = 0.2f), RoundedCornerShape(16.dp))
|
||||
) {
|
||||
Column(modifier = Modifier.padding(16.dp)) {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.golog_output),
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = Color.White
|
||||
)
|
||||
|
||||
// Auto-Scroll Toggle Button
|
||||
val activeColor = Color(0xFF4CAF50)
|
||||
val inactiveColor = Color.White.copy(alpha = 0.4f)
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier
|
||||
.clickable { autoScroll = !autoScroll }
|
||||
.padding(4.dp)
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(8.dp)
|
||||
.background(if (autoScroll) activeColor else inactiveColor, CircleShape)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(6.dp))
|
||||
Text(
|
||||
text = stringResource(id = R.string.auto_scroll),
|
||||
fontSize = 11.sp,
|
||||
color = if (autoScroll) Color.White else Color.White.copy(alpha = 0.5f),
|
||||
fontWeight = FontWeight.Medium
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
|
||||
LazyColumn(state = listState, modifier = Modifier.weight(1f)) {
|
||||
items(
|
||||
items = logs,
|
||||
key = { log -> log.id }
|
||||
) { log ->
|
||||
Text(
|
||||
text = parseAnsi(log.text, defaultTextColor),
|
||||
fontSize = 12.sp,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
lineHeight = 14.sp,
|
||||
modifier = Modifier.padding(vertical = 2.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
TextButton(
|
||||
onClick = {
|
||||
logs.clear()
|
||||
try {
|
||||
Runtime.getRuntime().exec("logcat -c")
|
||||
} catch (e: Exception) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
) {
|
||||
Text(stringResource(id = R.string.clear), color = Color(0xFFE53935), fontWeight = FontWeight.SemiBold)
|
||||
}
|
||||
|
||||
TextButton(
|
||||
onClick = { onDismiss() }
|
||||
) {
|
||||
Text(stringResource(id = R.string.close), color = Color.White)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun parseGoLogLine(line: String): String? {
|
||||
val regex = Regex(""".*GoLog\s*:?\s*(.*)""")
|
||||
val match = regex.find(line)
|
||||
val content = match?.groupValues?.getOrNull(1)?.trim()
|
||||
|
||||
return if (content.isNullOrBlank()) null else content
|
||||
}
|
||||
|
||||
fun parseAnsi(text: String, defaultColor: Color): AnnotatedString {
|
||||
val regex = Regex("\u001B\\[(\\d+)(;\\d+)*m")
|
||||
val builder = buildAnnotatedString {
|
||||
var lastIndex = 0
|
||||
var currentColor = defaultColor
|
||||
|
||||
for (match in regex.findAll(text)) {
|
||||
val start = match.range.first
|
||||
|
||||
val before = text.substring(lastIndex, start)
|
||||
if (before.isNotEmpty()) {
|
||||
withStyle(SpanStyle(color = currentColor)) {
|
||||
append(before)
|
||||
}
|
||||
}
|
||||
|
||||
val code = try {
|
||||
match.groupValues[1].toInt()
|
||||
} catch (e: NumberFormatException) {
|
||||
0
|
||||
}
|
||||
|
||||
currentColor = when (code) {
|
||||
0 -> defaultColor
|
||||
30 -> Color.Black
|
||||
31 -> Color.Red
|
||||
32 -> Color(0xFF00C853) // Green
|
||||
33 -> Color(0xFFFFD600) // Yellow
|
||||
34 -> Color(0xFF2962FF) // Blue
|
||||
35 -> Color(0xFFD500F9) // Magenta
|
||||
36 -> Color(0xFF00B8D4) // Cyan
|
||||
37 -> Color.White
|
||||
else -> currentColor
|
||||
}
|
||||
|
||||
lastIndex = match.range.last + 1
|
||||
}
|
||||
|
||||
if (lastIndex < text.length) {
|
||||
val remain = text.substring(lastIndex)
|
||||
if (remain.isNotEmpty()) {
|
||||
withStyle(SpanStyle(color = currentColor)) {
|
||||
append(remain)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return builder
|
||||
}
|
||||
@@ -0,0 +1,328 @@
|
||||
package com.example.firefly_go_android
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Visibility
|
||||
import androidx.compose.material.icons.filled.VisibilityOff
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.input.KeyboardType
|
||||
import androidx.compose.ui.text.input.PasswordVisualTransformation
|
||||
import androidx.compose.ui.text.input.VisualTransformation
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import androidx.browser.customtabs.CustomTabsIntent
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
||||
import androidx.compose.ui.focus.FocusRequester
|
||||
import androidx.compose.ui.focus.focusRequester
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import com.example.firefly_go_android.network.AuthManager
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun LoginDialog(
|
||||
authManager: AuthManager,
|
||||
onDismiss: () -> Unit,
|
||||
onLoginSuccess: () -> Unit
|
||||
) {
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
var email by remember { mutableStateOf("") }
|
||||
var password by remember { mutableStateOf("") }
|
||||
var passwordVisible by remember { mutableStateOf(false) }
|
||||
var isLoading by remember { mutableStateOf(false) }
|
||||
var errorMessage by remember { mutableStateOf<String?>(null) }
|
||||
|
||||
val focusRequester = remember { FocusRequester() }
|
||||
val keyboardController = LocalSoftwareKeyboardController.current
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
kotlinx.coroutines.delay(250)
|
||||
try {
|
||||
focusRequester.requestFocus()
|
||||
keyboardController?.show()
|
||||
} catch (e: Exception) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
Dialog(
|
||||
onDismissRequest = { if (!isLoading) { keyboardController?.hide(); onDismiss() } },
|
||||
properties = DialogProperties(
|
||||
usePlatformDefaultWidth = false
|
||||
)
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth(0.9f)
|
||||
.background(Color.Black.copy(alpha = 0.85f), RoundedCornerShape(20.dp))
|
||||
.border(1.5.dp, Color.White.copy(alpha = 0.2f), RoundedCornerShape(20.dp))
|
||||
.padding(24.dp)
|
||||
) {
|
||||
if (authManager.isLoggedIn) {
|
||||
// Profile & Logout view
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.account_profile),
|
||||
fontSize = 20.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = Color.White
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
Text(
|
||||
text = stringResource(id = R.string.logged_in_as),
|
||||
fontSize = 12.sp,
|
||||
color = Color.White.copy(alpha = 0.6f)
|
||||
)
|
||||
Text(
|
||||
text = authManager.userEmail ?: "Unknown User",
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
color = Color.White
|
||||
)
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
|
||||
Text(
|
||||
text = stringResource(id = R.string.auto_update_status),
|
||||
fontSize = 12.sp,
|
||||
color = Color.White.copy(alpha = 0.6f)
|
||||
)
|
||||
val statusText = if (authManager.isPlayer) stringResource(id = R.string.unlocked_player) else stringResource(id = R.string.locked_no_permission)
|
||||
val statusColor = if (authManager.isPlayer) Color(0xFF4CAF50) else Color(0xFFE53935)
|
||||
Text(
|
||||
text = statusText,
|
||||
fontSize = 15.sp,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
color = statusColor
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(28.dp))
|
||||
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.spacedBy(12.dp)
|
||||
) {
|
||||
OutlinedButton(
|
||||
onClick = { keyboardController?.hide(); onDismiss() },
|
||||
modifier = Modifier.weight(1f),
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
colors = ButtonDefaults.outlinedButtonColors(contentColor = Color.White),
|
||||
border = BorderStroke(1.dp, Color.White.copy(alpha = 0.3f))
|
||||
) {
|
||||
Text(stringResource(id = R.string.back))
|
||||
}
|
||||
|
||||
Button(
|
||||
onClick = {
|
||||
keyboardController?.hide()
|
||||
authManager.logout()
|
||||
onLoginSuccess() // triggers UI refresh
|
||||
onDismiss()
|
||||
},
|
||||
modifier = Modifier.weight(1f),
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
colors = ButtonDefaults.buttonColors(containerColor = Color(0xFFD32F2F))
|
||||
) {
|
||||
Text(stringResource(id = R.string.logout), color = Color.White)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Sign In view
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.sign_in),
|
||||
fontSize = 22.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = Color.White
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
val pleaseEnterBothText = stringResource(id = R.string.please_enter_both)
|
||||
|
||||
TextField(
|
||||
value = email,
|
||||
onValueChange = { email = it; errorMessage = null },
|
||||
placeholder = { Text(stringResource(id = R.string.email), color = Color.White.copy(alpha = 0.4f)) },
|
||||
colors = TextFieldDefaults.colors(
|
||||
focusedTextColor = Color.White,
|
||||
unfocusedTextColor = Color.White,
|
||||
focusedContainerColor = Color.White.copy(alpha = 0.08f),
|
||||
unfocusedContainerColor = Color.White.copy(alpha = 0.04f),
|
||||
focusedIndicatorColor = Color.Transparent,
|
||||
unfocusedIndicatorColor = Color.Transparent,
|
||||
cursorColor = Color.White
|
||||
),
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
singleLine = true,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.border(1.dp, Color.White.copy(alpha = 0.15f), RoundedCornerShape(12.dp))
|
||||
.focusRequester(focusRequester),
|
||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Email)
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
|
||||
TextField(
|
||||
value = password,
|
||||
onValueChange = { password = it; errorMessage = null },
|
||||
placeholder = { Text(stringResource(id = R.string.password), color = Color.White.copy(alpha = 0.4f)) },
|
||||
visualTransformation = if (passwordVisible) VisualTransformation.None else PasswordVisualTransformation(),
|
||||
trailingIcon = {
|
||||
val image = if (passwordVisible) Icons.Filled.Visibility else Icons.Filled.VisibilityOff
|
||||
IconButton(onClick = { passwordVisible = !passwordVisible }) {
|
||||
Icon(imageVector = image, contentDescription = "Toggle password visibility", tint = Color.White.copy(alpha = 0.5f))
|
||||
}
|
||||
},
|
||||
colors = TextFieldDefaults.colors(
|
||||
focusedTextColor = Color.White,
|
||||
unfocusedTextColor = Color.White,
|
||||
focusedContainerColor = Color.White.copy(alpha = 0.08f),
|
||||
unfocusedContainerColor = Color.White.copy(alpha = 0.04f),
|
||||
focusedIndicatorColor = Color.Transparent,
|
||||
unfocusedIndicatorColor = Color.Transparent,
|
||||
cursorColor = Color.White
|
||||
),
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
singleLine = true,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.border(1.dp, Color.White.copy(alpha = 0.15f), RoundedCornerShape(12.dp)),
|
||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password)
|
||||
)
|
||||
|
||||
if (errorMessage != null) {
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
Text(
|
||||
text = errorMessage!!,
|
||||
color = Color(0xFFE53935),
|
||||
fontSize = 13.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
modifier = Modifier.align(Alignment.Start)
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.spacedBy(12.dp)
|
||||
) {
|
||||
OutlinedButton(
|
||||
onClick = { keyboardController?.hide(); onDismiss() },
|
||||
modifier = Modifier.weight(1f),
|
||||
enabled = !isLoading,
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
colors = ButtonDefaults.outlinedButtonColors(contentColor = Color.White),
|
||||
border = BorderStroke(1.dp, Color.White.copy(alpha = 0.3f))
|
||||
) {
|
||||
Text(stringResource(id = R.string.cancel))
|
||||
}
|
||||
|
||||
Button(
|
||||
onClick = {
|
||||
if (email.isBlank() || password.isBlank()) {
|
||||
errorMessage = pleaseEnterBothText
|
||||
return@Button
|
||||
}
|
||||
keyboardController?.hide()
|
||||
isLoading = true
|
||||
coroutineScope.launch {
|
||||
val result = authManager.login(email, password)
|
||||
isLoading = false
|
||||
if (result.isSuccess) {
|
||||
onLoginSuccess()
|
||||
onDismiss()
|
||||
} else {
|
||||
errorMessage = result.exceptionOrNull()?.message ?: "Login failed"
|
||||
}
|
||||
}
|
||||
},
|
||||
modifier = Modifier.weight(1f),
|
||||
enabled = !isLoading,
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
colors = ButtonDefaults.buttonColors(containerColor = Color(0xCC0D47A1))
|
||||
) {
|
||||
if (isLoading) {
|
||||
CircularProgressIndicator(modifier = Modifier.size(20.dp), color = Color.White, strokeWidth = 2.dp)
|
||||
} else {
|
||||
Text(stringResource(id = R.string.login), color = Color.White)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
// Divider "or"
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
HorizontalDivider(
|
||||
modifier = Modifier.weight(1f),
|
||||
color = Color.White.copy(alpha = 0.2f)
|
||||
)
|
||||
Text(
|
||||
text = stringResource(id = R.string.or),
|
||||
fontSize = 11.sp,
|
||||
color = Color.White.copy(alpha = 0.5f),
|
||||
modifier = Modifier.padding(horizontal = 8.dp)
|
||||
)
|
||||
HorizontalDivider(
|
||||
modifier = Modifier.weight(1f),
|
||||
color = Color.White.copy(alpha = 0.2f)
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
val context = LocalContext.current
|
||||
Button(
|
||||
onClick = {
|
||||
keyboardController?.hide()
|
||||
val url = "https://api.punklorde.org/auth/discord/login?redirect=https://area999.punklorde.org/auth/launcher/discord&origin=firefly-launcher&is_return_token=true"
|
||||
try {
|
||||
val customTabsIntent = CustomTabsIntent.Builder()
|
||||
.setShowTitle(true)
|
||||
.build()
|
||||
customTabsIntent.launchUrl(context, Uri.parse(url))
|
||||
} catch (e: Exception) {
|
||||
// Fallback to system browser
|
||||
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||
context.startActivity(intent)
|
||||
}
|
||||
},
|
||||
modifier = Modifier.fillMaxWidth().height(48.dp),
|
||||
enabled = !isLoading,
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
colors = ButtonDefaults.buttonColors(containerColor = Color(0xCC5865F2))
|
||||
) {
|
||||
Text(stringResource(id = R.string.login_with_discord), color = Color.White, fontWeight = FontWeight.Medium)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.example.firefly_go_android.ui
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Warning
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import com.example.firefly_go_android.R
|
||||
|
||||
@Composable
|
||||
fun ScamWarningDialog(
|
||||
onDismiss: () -> Unit
|
||||
) {
|
||||
Dialog(
|
||||
onDismissRequest = onDismiss,
|
||||
properties = DialogProperties(
|
||||
dismissOnBackPress = false,
|
||||
dismissOnClickOutside = false,
|
||||
usePlatformDefaultWidth = false
|
||||
)
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth(0.9f)
|
||||
.background(Color.Black.copy(alpha = 0.85f), RoundedCornerShape(20.dp))
|
||||
.border(1.5.dp, Color.White.copy(alpha = 0.2f), RoundedCornerShape(20.dp))
|
||||
.padding(24.dp)
|
||||
) {
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Warning,
|
||||
contentDescription = "Warning",
|
||||
tint = Color(0xFFFFB300),
|
||||
modifier = Modifier.size(48.dp)
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
Text(
|
||||
text = stringResource(id = R.string.scam_warning_title),
|
||||
fontSize = 20.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = Color.White
|
||||
)
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
|
||||
Text(
|
||||
text = stringResource(id = R.string.scam_warning_text),
|
||||
fontSize = 14.sp,
|
||||
color = Color.White.copy(alpha = 0.85f),
|
||||
textAlign = TextAlign.Center,
|
||||
lineHeight = 20.sp
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(28.dp))
|
||||
|
||||
Button(
|
||||
onClick = onDismiss,
|
||||
modifier = Modifier.fillMaxWidth().height(48.dp),
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
colors = ButtonDefaults.buttonColors(containerColor = Color(0xFF0D47A1))
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.i_understand),
|
||||
color = Color.White,
|
||||
fontWeight = FontWeight.SemiBold
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,429 @@
|
||||
package com.example.firefly_go_android
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.widget.Toast
|
||||
import androidx.compose.animation.animateColorAsState
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.*
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.geometry.Offset
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.Shadow
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.example.firefly_go_android.network.AuthManager
|
||||
import java.io.File
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
|
||||
@SuppressLint("ImplicitSamInstance")
|
||||
@Composable
|
||||
fun ServerControlScreen(
|
||||
appDataPath: String,
|
||||
dataDir: File,
|
||||
appVersion: AppVersion,
|
||||
authManager: AuthManager,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
val isRunning = GolangServerService.isRunning
|
||||
|
||||
var showResetDialog by remember { mutableStateOf(false) }
|
||||
var showUpdateDialog by remember { mutableStateOf(false) }
|
||||
var showLoginDialog by remember { mutableStateOf(false) }
|
||||
var showLogs by remember { mutableStateOf(false) }
|
||||
var refreshTrigger by remember { mutableIntStateOf(0) } // Used to trigger UI refresh on login/logout
|
||||
|
||||
Box(
|
||||
modifier = modifier.fillMaxSize()
|
||||
) {
|
||||
// Background image
|
||||
Image(
|
||||
painter = painterResource(id = R.drawable.background),
|
||||
contentDescription = "Background",
|
||||
contentScale = ContentScale.Crop,
|
||||
modifier = Modifier.fillMaxSize()
|
||||
)
|
||||
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(Color.Black.copy(alpha = 0.3f))
|
||||
)
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(horizontal = 24.dp, vertical = 16.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
// Header Row (Branding and Account Status Chip)
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(top = 16.dp),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
// Brand Title
|
||||
Column {
|
||||
Text(
|
||||
text = stringResource(id = R.string.app_name),
|
||||
fontSize = 24.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = Color.White,
|
||||
style = TextStyle(
|
||||
shadow = Shadow(
|
||||
color = Color.Black,
|
||||
offset = Offset(2f, 2f),
|
||||
blurRadius = 4f
|
||||
)
|
||||
)
|
||||
)
|
||||
Text(
|
||||
text = stringResource(id = R.string.android_edition),
|
||||
fontSize = 12.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
color = Color.White.copy(alpha = 0.7f),
|
||||
style = TextStyle(
|
||||
shadow = Shadow(
|
||||
color = Color.Black,
|
||||
offset = Offset(1f, 1f),
|
||||
blurRadius = 2f
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// Brand Logo / Icon (instead of Login Chip since login is disabled)
|
||||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
modifier = Modifier
|
||||
.size(42.dp)
|
||||
.background(Color.White.copy(alpha = 0.08f), CircleShape)
|
||||
.border(1.dp, Color.White.copy(alpha = 0.15f), CircleShape)
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Android,
|
||||
contentDescription = "Logo",
|
||||
tint = Color.White,
|
||||
modifier = Modifier.size(28.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(28.dp))
|
||||
|
||||
// Server status capsule
|
||||
val statusColor = if (isRunning) Color(0xFF4CAF50) else Color(0xFF9E9E9E)
|
||||
val statusText = if (isRunning) stringResource(id = R.string.server_running) else stringResource(id = R.string.server_stopped)
|
||||
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.background(Color.Black.copy(alpha = 0.4f), RoundedCornerShape(20.dp))
|
||||
.border(1.dp, Color.White.copy(alpha = 0.15f), RoundedCornerShape(20.dp))
|
||||
.padding(horizontal = 20.dp, vertical = 8.dp)
|
||||
) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.Center
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(10.dp)
|
||||
.background(statusColor, CircleShape)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(10.dp))
|
||||
Text(
|
||||
text = statusText,
|
||||
fontSize = 18.sp,
|
||||
color = Color.White,
|
||||
fontWeight = FontWeight.Medium
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.weight(1.8f).heightIn(min = 24.dp))
|
||||
// Toggle button
|
||||
val buttonColor by animateColorAsState(
|
||||
targetValue = if (isRunning) Color(0xCCB71C1C) else Color(0xCC0D47A1),
|
||||
label = "buttonColor"
|
||||
)
|
||||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth(0.75f)
|
||||
.height(54.dp)
|
||||
.bounceClick {
|
||||
try {
|
||||
if (!isRunning) {
|
||||
val intent = Intent(context, GolangServerService::class.java)
|
||||
intent.putExtra("appDataPath", appDataPath)
|
||||
ContextCompat.startForegroundService(context, intent)
|
||||
} else {
|
||||
context.stopService(Intent(context, GolangServerService::class.java))
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(context, "Error: ${e.message}", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
.background(buttonColor, RoundedCornerShape(14.dp))
|
||||
.border(1.dp, Color.White.copy(alpha = 0.25f), RoundedCornerShape(14.dp))
|
||||
) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.Center
|
||||
) {
|
||||
Icon(
|
||||
imageVector = if (isRunning) Icons.Default.Stop else Icons.Default.PlayArrow,
|
||||
contentDescription = null,
|
||||
tint = Color.White,
|
||||
modifier = Modifier.size(24.dp)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Text(
|
||||
text = if (isRunning) stringResource(id = R.string.stop_server) else stringResource(id = R.string.start_server),
|
||||
fontSize = 18.sp,
|
||||
color = Color.White,
|
||||
fontWeight = FontWeight.SemiBold
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(20.dp))
|
||||
|
||||
// Widget icons row
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.spacedBy(16.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
// Check Update widget (Now shown for all users since login is disabled)
|
||||
if (true) {
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center,
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.height(96.dp)
|
||||
.bounceClick { showUpdateDialog = true }
|
||||
.background(
|
||||
Color.White.copy(alpha = 0.15f),
|
||||
RoundedCornerShape(16.dp)
|
||||
)
|
||||
.border(
|
||||
1.dp,
|
||||
Color.White.copy(alpha = 0.2f),
|
||||
RoundedCornerShape(16.dp)
|
||||
)
|
||||
.padding(horizontal = 8.dp)
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.CloudDownload,
|
||||
contentDescription = "Check Update",
|
||||
tint = Color.White.copy(alpha = 0.85f),
|
||||
modifier = Modifier.size(28.dp)
|
||||
)
|
||||
Spacer(modifier = Modifier.height(6.dp))
|
||||
Text(
|
||||
text = stringResource(id = R.string.update),
|
||||
fontSize = 12.sp,
|
||||
color = Color.White,
|
||||
textAlign = TextAlign.Center,
|
||||
fontWeight = FontWeight.Medium,
|
||||
maxLines = 2
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Reset Data widget
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center,
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.height(96.dp)
|
||||
.bounceClick { showResetDialog = true }
|
||||
.background(
|
||||
Color.White.copy(alpha = 0.15f),
|
||||
RoundedCornerShape(16.dp)
|
||||
)
|
||||
.border(
|
||||
1.dp,
|
||||
Color.White.copy(alpha = 0.2f),
|
||||
RoundedCornerShape(16.dp)
|
||||
)
|
||||
.padding(horizontal = 8.dp)
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.RestartAlt,
|
||||
contentDescription = "Reset Data",
|
||||
tint = Color.White.copy(alpha = 0.85f),
|
||||
modifier = Modifier.size(28.dp)
|
||||
)
|
||||
Spacer(modifier = Modifier.height(6.dp))
|
||||
Text(
|
||||
text = stringResource(id = R.string.reset),
|
||||
fontSize = 12.sp,
|
||||
color = Color.White,
|
||||
textAlign = TextAlign.Center,
|
||||
fontWeight = FontWeight.Medium,
|
||||
maxLines = 2
|
||||
)
|
||||
}
|
||||
|
||||
// Logcat (Lynx) widget
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center,
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.height(96.dp)
|
||||
.bounceClick { showLogs = true }
|
||||
.background(
|
||||
Color.White.copy(alpha = 0.15f),
|
||||
RoundedCornerShape(16.dp)
|
||||
)
|
||||
.border(
|
||||
1.dp,
|
||||
Color.White.copy(alpha = 0.2f),
|
||||
RoundedCornerShape(16.dp)
|
||||
)
|
||||
.padding(horizontal = 8.dp)
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.BugReport,
|
||||
contentDescription = "Open Logcat",
|
||||
tint = Color.White.copy(alpha = 0.85f),
|
||||
modifier = Modifier.size(28.dp)
|
||||
)
|
||||
Spacer(modifier = Modifier.height(6.dp))
|
||||
Text(
|
||||
text = stringResource(id = R.string.logs),
|
||||
fontSize = 12.sp,
|
||||
color = Color.White,
|
||||
textAlign = TextAlign.Center,
|
||||
fontWeight = FontWeight.Medium,
|
||||
maxLines = 2
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.weight(0.4f).heightIn(min = 16.dp))
|
||||
}
|
||||
}
|
||||
|
||||
if (showLogs) {
|
||||
LogPopup(onDismiss = { showLogs = false })
|
||||
}
|
||||
|
||||
if (showLoginDialog) {
|
||||
LoginDialog(
|
||||
authManager = authManager,
|
||||
onDismiss = { showLoginDialog = false },
|
||||
onLoginSuccess = {
|
||||
refreshTrigger++ // Force UI update
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// Reset Data Confirmation Dialog
|
||||
if (showResetDialog) {
|
||||
Dialog(
|
||||
onDismissRequest = { showResetDialog = false },
|
||||
properties = DialogProperties(usePlatformDefaultWidth = false)
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth(0.9f)
|
||||
.background(Color.Black.copy(alpha = 0.85f), RoundedCornerShape(20.dp))
|
||||
.border(1.5.dp, Color.White.copy(alpha = 0.2f), RoundedCornerShape(20.dp))
|
||||
.padding(24.dp)
|
||||
) {
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.reset_data_title),
|
||||
fontSize = 20.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = Color.White
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
Text(
|
||||
text = stringResource(id = R.string.reset_data_confirm),
|
||||
fontSize = 14.sp,
|
||||
color = Color.White.copy(alpha = 0.8f),
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(28.dp))
|
||||
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.spacedBy(12.dp)
|
||||
) {
|
||||
OutlinedButton(
|
||||
onClick = { showResetDialog = false },
|
||||
modifier = Modifier.weight(1f),
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
colors = ButtonDefaults.outlinedButtonColors(contentColor = Color.White),
|
||||
border = BorderStroke(1.dp, Color.White.copy(alpha = 0.3f))
|
||||
) {
|
||||
Text(stringResource(id = R.string.no))
|
||||
}
|
||||
|
||||
Button(
|
||||
onClick = {
|
||||
showResetDialog = false
|
||||
try {
|
||||
copyRawToFile(context, dataDir, true)
|
||||
Toast.makeText(context, "Data has been reset successfully", Toast.LENGTH_SHORT).show()
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(context, "Reset failed: ${e.message}", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
},
|
||||
modifier = Modifier.weight(1f),
|
||||
shape = RoundedCornerShape(12.dp),
|
||||
colors = ButtonDefaults.buttonColors(containerColor = Color(0xFFD32F2F))
|
||||
) {
|
||||
Text(stringResource(id = R.string.yes), color = Color.White)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Auto Update Dialog
|
||||
if (showUpdateDialog) {
|
||||
AutoUpdateDialog(
|
||||
onDismiss = { showUpdateDialog = false },
|
||||
appVersion,
|
||||
dataDir
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.example.firefly_go_android.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
val Purple80 = Color(0xFFD0BCFF)
|
||||
val PurpleGrey80 = Color(0xFFCCC2DC)
|
||||
val Pink80 = Color(0xFFEFB8C8)
|
||||
|
||||
val Purple40 = Color(0xFF6650a4)
|
||||
val PurpleGrey40 = Color(0xFF625b71)
|
||||
val Pink40 = Color(0xFF7D5260)
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.example.firefly_go_android.ui.theme
|
||||
|
||||
import android.os.Build
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.dynamicDarkColorScheme
|
||||
import androidx.compose.material3.dynamicLightColorScheme
|
||||
import androidx.compose.material3.lightColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
|
||||
private val DarkColorScheme = darkColorScheme(
|
||||
primary = Purple80,
|
||||
secondary = PurpleGrey80,
|
||||
tertiary = Pink80
|
||||
)
|
||||
|
||||
private val LightColorScheme = lightColorScheme(
|
||||
primary = Purple40,
|
||||
secondary = PurpleGrey40,
|
||||
tertiary = Pink40
|
||||
|
||||
/* Other default colors to override
|
||||
background = Color(0xFFFFFBFE),
|
||||
surface = Color(0xFFFFFBFE),
|
||||
onPrimary = Color.White,
|
||||
onSecondary = Color.White,
|
||||
onTertiary = Color.White,
|
||||
onBackground = Color(0xFF1C1B1F),
|
||||
onSurface = Color(0xFF1C1B1F),
|
||||
*/
|
||||
)
|
||||
|
||||
@Composable
|
||||
fun FireflyPsAndoridTheme(
|
||||
darkTheme: Boolean = isSystemInDarkTheme(),
|
||||
// Dynamic color is available on Android 12+
|
||||
dynamicColor: Boolean = true,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
val colorScheme = when {
|
||||
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
|
||||
val context = LocalContext.current
|
||||
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
|
||||
}
|
||||
|
||||
darkTheme -> DarkColorScheme
|
||||
else -> LightColorScheme
|
||||
}
|
||||
|
||||
MaterialTheme(
|
||||
colorScheme = colorScheme,
|
||||
typography = Typography,
|
||||
content = content
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.example.firefly_go_android.ui.theme
|
||||
|
||||
import androidx.compose.material3.Typography
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
// Set of Material typography styles to start with
|
||||
val Typography = Typography(
|
||||
bodyLarge = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 16.sp,
|
||||
lineHeight = 24.sp,
|
||||
letterSpacing = 0.5.sp
|
||||
)
|
||||
/* Other default text styles to override
|
||||
titleLarge = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 22.sp,
|
||||
lineHeight = 28.sp,
|
||||
letterSpacing = 0.sp
|
||||
),
|
||||
labelSmall = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Medium,
|
||||
fontSize = 11.sp,
|
||||
lineHeight = 16.sp,
|
||||
letterSpacing = 0.5.sp
|
||||
)
|
||||
*/
|
||||
)
|
||||
|
After Width: | Height: | Size: 9.3 MiB |
@@ -0,0 +1,151 @@
|
||||
<<<<<<< HEAD
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
android:height="108dp"
|
||||
android:width="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
</vector>
|
||||
=======
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
android:height="108dp"
|
||||
android:width="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
</vector>
|
||||
>>>>>>> 2459650 (feat: v4)
|
||||
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
@@ -0,0 +1,12 @@
|
||||
<<<<<<< HEAD
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
=======
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
>>>>>>> 2459650 (feat: v4)
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,12 @@
|
||||
<<<<<<< HEAD
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
=======
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
>>>>>>> 2459650 (feat: v4)
|
||||
</adaptive-icon>
|
||||
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 153 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 267 KiB |
|
After Width: | Height: | Size: 46 KiB |
@@ -0,0 +1,57 @@
|
||||
<resources>
|
||||
<string name="app_name">Firefly Go</string>
|
||||
<string name="android_edition">Android版</string>
|
||||
<string name="sign_in">サインイン</string>
|
||||
<string name="server_running">サーバー稼働中</string>
|
||||
<string name="server_stopped">サーバー停止</string>
|
||||
<string name="start_server">サーバー起動</string>
|
||||
<string name="stop_server">サーバー停止</string>
|
||||
<string name="update">アップデート</string>
|
||||
<string name="reset">リセット</string>
|
||||
<string name="logs">ログ</string>
|
||||
<string name="reset_data_title">データリセット</string>
|
||||
<string name="reset_data_confirm">すべてのデータをリセットしますか?この操作は取り消せません。</string>
|
||||
<string name="no">いいえ</string>
|
||||
<string name="yes">はい</string>
|
||||
|
||||
<!-- Scam Warning -->
|
||||
<string name="scam_warning_title">セキュリティ警告</string>
|
||||
<string name="scam_warning_text">これはオープンソースプロジェクトです。もし誰かからこのアプリを購入した場合、あなたは詐欺に遭っています。</string>
|
||||
<string name="i_understand">了解しました</string>
|
||||
|
||||
<!-- LoginDialog -->
|
||||
<string name="account_profile">アカウントプロフィール</string>
|
||||
<string name="logged_in_as">ログイン中:</string>
|
||||
<string name="auto_update_status">自動更新ステータス:</string>
|
||||
<string name="unlocked_player">ロック解除 (PLAYER)</string>
|
||||
<string name="locked_no_permission">ロック中 (権限なし)</string>
|
||||
<string name="back">戻る</string>
|
||||
<string name="logout">ログアウト</string>
|
||||
<string name="email">メールアドレス</string>
|
||||
<string name="password">パスワード</string>
|
||||
<string name="cancel">キャンセル</string>
|
||||
<string name="login">ログイン</string>
|
||||
<string name="or">または</string>
|
||||
<string name="login_with_discord">Discordでログイン</string>
|
||||
<string name="please_enter_both">メールアドレスとパスワードを入力してください</string>
|
||||
<string name="login_failed">ログイン失敗</string>
|
||||
<string name="failed_to_fetch_profile">プロフィールの取得に失敗しました</string>
|
||||
|
||||
<!-- AutoUpdateDialog -->
|
||||
<string name="update_available">アップデートがあります</string>
|
||||
<string name="no_update_available">アップデートはありません</string>
|
||||
<string name="app_up_to_date">アプリは最新状態です</string>
|
||||
<string name="ok">確定</string>
|
||||
<string name="latest_version">最新バージョン</string>
|
||||
<string name="whats_new">更新内容</string>
|
||||
<string name="downloading">ダウンロード中...</string>
|
||||
<string name="installation_ready">インストールの準備完了</string>
|
||||
<string name="later">後で</string>
|
||||
<string name="install_now">今すぐインストール</string>
|
||||
|
||||
<!-- LogPopup -->
|
||||
<string name="golog_output">GoLog出力</string>
|
||||
<string name="auto_scroll">自動スクロール</string>
|
||||
<string name="clear">消去</string>
|
||||
<string name="close">閉じる</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,57 @@
|
||||
<resources>
|
||||
<string name="app_name">Firefly Go</string>
|
||||
<string name="android_edition">안드로이드 버전</string>
|
||||
<string name="sign_in">로그인</string>
|
||||
<string name="server_running">서버 실행 중</string>
|
||||
<string name="server_stopped">서버 정지됨</string>
|
||||
<string name="start_server">서버 시작</string>
|
||||
<string name="stop_server">서버 정지</string>
|
||||
<string name="update">업데이트</string>
|
||||
<string name="reset">초기화</string>
|
||||
<string name="logs">로그</string>
|
||||
<string name="reset_data_title">데이터 초기화</string>
|
||||
<string name="reset_data_confirm">모든 데이터를 초기화하시겠습니까? 이 작업은 취소할 수 없습니다.</string>
|
||||
<string name="no">아니오</string>
|
||||
<string name="yes">예</string>
|
||||
|
||||
<!-- Scam Warning -->
|
||||
<string name="scam_warning_title">보안 경고</string>
|
||||
<string name="scam_warning_text">이것은 오픈 소스 프로젝트입니다. 누군가로부터 이 앱을 구매하셨다면, 귀하는 사기를 당한 것입니다.</string>
|
||||
<string name="i_understand">확인했습니다</string>
|
||||
|
||||
<!-- LoginDialog -->
|
||||
<string name="account_profile">계정 프로필</string>
|
||||
<string name="logged_in_as">로그인 계정:</string>
|
||||
<string name="auto_update_status">자동 업데이트 상태:</string>
|
||||
<string name="unlocked_player">잠금 해제 (PLAYER)</string>
|
||||
<string name="locked_no_permission">잠김 (권한 없음)</string>
|
||||
<string name="back">뒤로</string>
|
||||
<string name="logout">로그아웃</string>
|
||||
<string name="email">이메일</string>
|
||||
<string name="password">비밀번호</string>
|
||||
<string name="cancel">취소</string>
|
||||
<string name="login">로그인</string>
|
||||
<string name="or">또는</string>
|
||||
<string name="login_with_discord">Discord로 로그인</string>
|
||||
<string name="please_enter_both">이메일과 비밀번호를 모두 입력하세요</string>
|
||||
<string name="login_failed">로그인 실패</string>
|
||||
<string name="failed_to_fetch_profile">프로필을 불러오지 못했습니다</string>
|
||||
|
||||
<!-- AutoUpdateDialog -->
|
||||
<string name="update_available">업데이트 가능</string>
|
||||
<string name="no_update_available">업데이트 없음</string>
|
||||
<string name="app_up_to_date">앱이 최신 상태입니다</string>
|
||||
<string name="ok">확인</string>
|
||||
<string name="latest_version">최신 버전</string>
|
||||
<string name="whats_new">업데이트 내역</string>
|
||||
<string name="downloading">다운로드 중...</string>
|
||||
<string name="installation_ready">설치 준비 완료</string>
|
||||
<string name="later">나중에</string>
|
||||
<string name="install_now">지금 설치</string>
|
||||
|
||||
<!-- LogPopup -->
|
||||
<string name="golog_output">GoLog 출력</string>
|
||||
<string name="auto_scroll">자동 스크롤</string>
|
||||
<string name="clear">지우기</string>
|
||||
<string name="close">닫기</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,57 @@
|
||||
<resources>
|
||||
<string name="app_name">Firefly Go</string>
|
||||
<string name="android_edition">Phiên bản Android</string>
|
||||
<string name="sign_in">Đăng nhập</string>
|
||||
<string name="server_running">Máy chủ đang chạy</string>
|
||||
<string name="server_stopped">Máy chủ đã dừng</string>
|
||||
<string name="start_server">Khởi động máy chủ</string>
|
||||
<string name="stop_server">Dừng máy chủ</string>
|
||||
<string name="update">Cập nhật</string>
|
||||
<string name="reset">Đặt lại</string>
|
||||
<string name="logs">Nhật ký</string>
|
||||
<string name="reset_data_title">Đặt lại dữ liệu</string>
|
||||
<string name="reset_data_confirm">Bạn có muốn đặt lại tất cả dữ liệu? Hành động này không thể hoàn tác.</string>
|
||||
<string name="no">Không</string>
|
||||
<string name="yes">Có</string>
|
||||
|
||||
<!-- Scam Warning -->
|
||||
<string name="scam_warning_title">Cảnh báo bảo mật</string>
|
||||
<string name="scam_warning_text">Đây là dự án mã nguồn mở. Nếu bạn mua ứng dụng này từ bất kỳ ai, bạn đã bị lừa đảo (scam).</string>
|
||||
<string name="i_understand">Tôi đã hiểu</string>
|
||||
|
||||
<!-- LoginDialog -->
|
||||
<string name="account_profile">Thông tin tài khoản</string>
|
||||
<string name="logged_in_as">Đăng nhập bằng:</string>
|
||||
<string name="auto_update_status">Trạng thái tự cập nhật:</string>
|
||||
<string name="unlocked_player">Đã mở khóa (PLAYER)</string>
|
||||
<string name="locked_no_permission">Bị khóa (Không có quyền)</string>
|
||||
<string name="back">Quay lại</string>
|
||||
<string name="logout">Đăng xuất</string>
|
||||
<string name="email">Email</string>
|
||||
<string name="password">Mật khẩu</string>
|
||||
<string name="cancel">Hủy</string>
|
||||
<string name="login">Đăng nhập</string>
|
||||
<string name="or">HOẶC</string>
|
||||
<string name="login_with_discord">Đăng nhập bằng Discord</string>
|
||||
<string name="please_enter_both">Vui lòng nhập cả Email và Mật khẩu</string>
|
||||
<string name="login_failed">Đăng nhập thất bại</string>
|
||||
<string name="failed_to_fetch_profile">Không thể tải thông tin cá nhân</string>
|
||||
|
||||
<!-- AutoUpdateDialog -->
|
||||
<string name="update_available">Có bản cập nhật mới</string>
|
||||
<string name="no_update_available">Không có bản cập nhật</string>
|
||||
<string name="app_up_to_date">Ứng dụng đã được cập nhật mới nhất</string>
|
||||
<string name="ok">Đồng ý</string>
|
||||
<string name="latest_version">Phiên bản mới nhất</string>
|
||||
<string name="whats_new">Có gì mới</string>
|
||||
<string name="downloading">Đang tải xuống...</string>
|
||||
<string name="installation_ready">Sẵn sàng cài đặt</string>
|
||||
<string name="later">Để sau</string>
|
||||
<string name="install_now">Cài đặt ngay</string>
|
||||
|
||||
<!-- LogPopup -->
|
||||
<string name="golog_output">Nhật ký GoLog</string>
|
||||
<string name="auto_scroll">Tự động cuộn</string>
|
||||
<string name="clear">Xóa</string>
|
||||
<string name="close">Đóng</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,57 @@
|
||||
<resources>
|
||||
<string name="app_name">Firefly Go</string>
|
||||
<string name="android_edition">安卓版</string>
|
||||
<string name="sign_in">登录</string>
|
||||
<string name="server_running">服务器正在运行</string>
|
||||
<string name="server_stopped">服务器已停止</string>
|
||||
<string name="start_server">启动服务器</string>
|
||||
<string name="stop_server">停止服务器</string>
|
||||
<string name="update">更新</string>
|
||||
<string name="reset">重置</string>
|
||||
<string name="logs">日志</string>
|
||||
<string name="reset_data_title">重置数据</string>
|
||||
<string name="reset_data_confirm">您确定要重置所有数据吗?此操作无法撤销。</string>
|
||||
<string name="no">取消</string>
|
||||
<string name="yes">确定</string>
|
||||
|
||||
<!-- Scam Warning -->
|
||||
<string name="scam_warning_title">安全警告</string>
|
||||
<string name="scam_warning_text">这是一个开源项目。如果您是从别人那里购买的这个应用,您就被骗了(欺诈)。</string>
|
||||
<string name="i_understand">我已知晓</string>
|
||||
|
||||
<!-- LoginDialog -->
|
||||
<string name="account_profile">账户信息</string>
|
||||
<string name="logged_in_as">已登录为:</string>
|
||||
<string name="auto_update_status">自动更新状态:</string>
|
||||
<string name="unlocked_player">已解锁 (PLAYER)</string>
|
||||
<string name="locked_no_permission">已锁定 (无权限)</string>
|
||||
<string name="back">返回</string>
|
||||
<string name="logout">退出登录</string>
|
||||
<string name="email">邮箱</string>
|
||||
<string name="password">密码</string>
|
||||
<string name="cancel">取消</string>
|
||||
<string name="login">登录</string>
|
||||
<string name="or">或</string>
|
||||
<string name="login_with_discord">使用 Discord 登录</string>
|
||||
<string name="please_enter_both">请输入邮箱和密码</string>
|
||||
<string name="login_failed">登录失败</string>
|
||||
<string name="failed_to_fetch_profile">获取个人资料失败</string>
|
||||
|
||||
<!-- AutoUpdateDialog -->
|
||||
<string name="update_available">有可用更新</string>
|
||||
<string name="no_update_available">没有可用更新</string>
|
||||
<string name="app_up_to_date">您的应用已是最新版本</string>
|
||||
<string name="ok">确定</string>
|
||||
<string name="latest_version">最新版本</string>
|
||||
<string name="whats_new">更新日志</string>
|
||||
<string name="downloading">正在下载...</string>
|
||||
<string name="installation_ready">准备安装</string>
|
||||
<string name="later">稍后</string>
|
||||
<string name="install_now">立即安装</string>
|
||||
|
||||
<!-- LogPopup -->
|
||||
<string name="golog_output">GoLog 输出</string>
|
||||
<string name="auto_scroll">自动滚动</string>
|
||||
<string name="clear">清除</string>
|
||||
<string name="close">关闭</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFBB86FC</color>
|
||||
<color name="purple_500">#FF6200EE</color>
|
||||
<color name="purple_700">#FF3700B3</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
</resources>
|
||||
@@ -0,0 +1,60 @@
|
||||
<resources>
|
||||
<string name="app_name">Firefly Go</string>
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
<string name="android_edition">Android Edition</string>
|
||||
<string name="sign_in">Sign In</string>
|
||||
<string name="server_running">Server is running</string>
|
||||
<string name="server_stopped">Server is stopped</string>
|
||||
<string name="start_server">Start Server</string>
|
||||
<string name="stop_server">Stop Server</string>
|
||||
<string name="update">Update</string>
|
||||
<string name="reset">Reset</string>
|
||||
<string name="logs">Logs</string>
|
||||
<string name="reset_data_title">Reset Data</string>
|
||||
<string name="reset_data_confirm">Do you want to reset all data? This action cannot be rolled back.</string>
|
||||
<string name="no">No</string>
|
||||
<string name="yes">Yes</string>
|
||||
|
||||
<!-- Scam Warning -->
|
||||
<string name="scam_warning_title">Security Warning</string>
|
||||
<string name="scam_warning_text">This is an open-source project. If you bought this application from someone, you have been scammed (fraud).</string>
|
||||
<string name="i_understand">I Understand</string>
|
||||
|
||||
<!-- LoginDialog -->
|
||||
<string name="account_profile">Account Profile</string>
|
||||
<string name="logged_in_as">Logged in as:</string>
|
||||
<string name="auto_update_status">Auto-Update Status:</string>
|
||||
<string name="unlocked_player">Unlocked (PLAYER)</string>
|
||||
<string name="locked_no_permission">Locked (No permission)</string>
|
||||
<string name="back">Back</string>
|
||||
<string name="logout">Logout</string>
|
||||
<string name="email">Email</string>
|
||||
<string name="password">Password</string>
|
||||
<string name="cancel">Cancel</string>
|
||||
<string name="login">Login</string>
|
||||
<string name="or">OR</string>
|
||||
<string name="login_with_discord">Login with Discord</string>
|
||||
<string name="please_enter_both">Please enter both Email and Password</string>
|
||||
<string name="login_failed">Login failed</string>
|
||||
<string name="failed_to_fetch_profile">Failed to fetch profile</string>
|
||||
|
||||
<!-- AutoUpdateDialog -->
|
||||
<string name="update_available">Update Available</string>
|
||||
<string name="no_update_available">No Update Available</string>
|
||||
<string name="app_up_to_date">Your app is up to date</string>
|
||||
<string name="ok">OK</string>
|
||||
<string name="latest_version">Latest Version</string>
|
||||
<string name="whats_new">What\'s New</string>
|
||||
<string name="downloading">Downloading...</string>
|
||||
<string name="installation_ready">Installation Ready</string>
|
||||
<string name="later">Later</string>
|
||||
<string name="install_now">Install Now</string>
|
||||
|
||||
<!-- LogPopup -->
|
||||
<string name="golog_output">GoLog Output</string>
|
||||
<string name="auto_scroll">Auto-Scroll</string>
|
||||
<string name="clear">Clear</string>
|
||||
<string name="close">Close</string>
|
||||
>>>>>>> 2459650 (feat: v4)
|
||||
</resources>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Theme.FireflyGoAndroid" parent="android:Theme.Material.Light.NoActionBar" />
|
||||
</resources>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample backup rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/guide/topics/data/autobackup
|
||||
for details.
|
||||
Note: This file is ignored for devices older than API 31
|
||||
See https://developer.android.com/about/versions/12/backup-restore
|
||||
-->
|
||||
<full-backup-content>
|
||||
<!--
|
||||
<include domain="sharedpref" path="."/>
|
||||
<exclude domain="sharedpref" path="device.xml"/>
|
||||
-->
|
||||
</full-backup-content>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample data extraction rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
|
||||
for details.
|
||||
-->
|
||||
<data-extraction-rules>
|
||||
<cloud-backup>
|
||||
<!-- TODO: Use <include> and <exclude> to control what is backed up.
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
-->
|
||||
</cloud-backup>
|
||||
<!--
|
||||
<device-transfer>
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
</device-transfer>
|
||||
-->
|
||||
</data-extraction-rules>
|
||||
@@ -0,0 +1,9 @@
|
||||
<<<<<<< HEAD
|
||||
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<external-files-path name="downloads" path="Download/"/>
|
||||
</paths>
|
||||
=======
|
||||
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<external-files-path name="downloads" path="Download/"/>
|
||||
</paths>
|
||||
>>>>>>> 2459650 (feat: v4)
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.example.firefly_go_android
|
||||
|
||||
import org.junit.Test
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
class ExampleUnitTest {
|
||||
@Test
|
||||
fun addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
alias(libs.plugins.android.application) apply false
|
||||
alias(libs.plugins.kotlin.android) apply false
|
||||
alias(libs.plugins.kotlin.compose) apply false
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
# Project-wide Gradle settings.
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
# For more details on how to configure your build environment visit
|
||||
# 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.
|
||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. For more details, visit
|
||||
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
|
||||
# org.gradle.parallel=true
|
||||
# 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
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
org.gradle.parallel=true
|
||||
android.useAndroidX=true
|
||||
# Kotlin code style for this project: "official" or "obsolete":
|
||||
kotlin.code.style=official
|
||||
# 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,
|
||||
# thereby reducing the size of the R class for that library
|
||||
android.nonTransitiveRClass=true
|
||||
#org.gradle.configuration-cache=false
|
||||
android.r8.optimizedResourceShrinking=true
|
||||
org.gradle.java.installations.auto-download=true
|
||||
@@ -0,0 +1,13 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/536afcd1dff540251f85e5d2c80458cf/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/536afcd1dff540251f85e5d2c80458cf/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e99bae143b75f9a10ead10248f02055e/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/658299a896470fbb3103ba3a430ee227/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/536afcd1dff540251f85e5d2c80458cf/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/248ffb1098f61659502d0c09aa348294/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/932015f6361ccaead0c6d9b8717ed96e/redirect
|
||||
toolchainVendor=JETBRAINS
|
||||
toolchainVersion=21
|
||||
@@ -0,0 +1,51 @@
|
||||
[versions]
|
||||
activityComposeVersion = "1.11.0"
|
||||
agp = "8.13.0"
|
||||
androidxJunit = "1.3.0"
|
||||
animationCore = "1.9.3"
|
||||
autoupdater = "1.0.1"
|
||||
espressoCoreVersion = "3.7.0"
|
||||
foundation = "1.9.3"
|
||||
kotlin = "2.2.20"
|
||||
coreKtx = "1.17.0"
|
||||
junit = "4.13.2"
|
||||
lifecycleRuntimeKtxVersion = "2.9.4"
|
||||
material = "1.9.3"
|
||||
material3WindowSizeClass = "1.4.0"
|
||||
materialIconsExtended = "1.7.8"
|
||||
slf4jAndroidVersion = "1.7.36"
|
||||
ui = "1.9.3"
|
||||
uiGraphics = "1.9.3"
|
||||
uiTestJunit4 = "1.9.3"
|
||||
uiTestManifest = "1.9.3"
|
||||
uiTooling = "1.9.3"
|
||||
uiToolingPreview = "1.9.3"
|
||||
|
||||
[libraries]
|
||||
androidx-activity-compose-v1101 = { module = "androidx.activity:activity-compose", version.ref = "activityComposeVersion" }
|
||||
androidx-animation = { module = "androidx.compose.animation:animation", version.ref = "animationCore" }
|
||||
androidx-animation-core = { module = "androidx.compose.animation:animation-core", version.ref = "animationCore" }
|
||||
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
||||
androidx-espresso-core-v370 = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCoreVersion" }
|
||||
androidx-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "foundation" }
|
||||
androidx-junit-v130 = { module = "androidx.test.ext:junit", version.ref = "androidxJunit" }
|
||||
androidx-lifecycle-runtime-ktx-v293 = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtxVersion" }
|
||||
androidx-material = { module = "androidx.compose.material:material", version.ref = "material" }
|
||||
androidx-material-icons-extended = { module = "androidx.compose.material:material-icons-extended", version.ref = "materialIconsExtended" }
|
||||
androidx-material3-window-size-class1 = { module = "androidx.compose.material3:material3-window-size-class", version.ref = "material3WindowSizeClass" }
|
||||
autoupdater = { module = "com.github.CSAbhiOnline:AutoUpdater", version.ref = "autoupdater" }
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
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-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-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "uiTestManifest" }
|
||||
ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "uiTooling" }
|
||||
ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "uiToolingPreview" }
|
||||
|
||||
[plugins]
|
||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
||||
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<<<<<<< HEAD
|
||||
#Wed Oct 08 15:20:16 ICT 2025
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
=======
|
||||
#Wed Oct 08 15:20:16 ICT 2025
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
>>>>>>> 2459650 (feat: v4)
|
||||
@@ -0,0 +1,185 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
@@ -0,0 +1,181 @@
|
||||
<<<<<<< HEAD
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
=======
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
>>>>>>> 2459650 (feat: v4)
|
||||
@@ -0,0 +1,8 @@
|
||||
<<<<<<< HEAD
|
||||
# Changelog
|
||||
|
||||
=======
|
||||
# Changelog
|
||||
|
||||
>>>>>>> 2459650 (feat: v4)
|
||||
## - UPDATE: Support 4.3.5X
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"tag": "4.3.4-02",
|
||||
"title": "PreBuild Version 4.3.54 - 02"
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven {
|
||||
setUrl("https://jitpack.io")
|
||||
}
|
||||
google {
|
||||
content {
|
||||
includeGroupByRegex("com\\.android.*")
|
||||
includeGroupByRegex("com\\.google.*")
|
||||
includeGroupByRegex("androidx.*")
|
||||
}
|
||||
}
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
|
||||
}
|
||||
}
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.10.0"
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
maven {
|
||||
setUrl("https://jitpack.io")
|
||||
}
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
rootProject.name = "FireflyGoAndroid"
|
||||
include(":app")
|
||||