Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 84cf16c3bf | |||
| becf6779f7 | |||
| d61b2aa907 | |||
| 534c08c70a | |||
| bc3e6f514a | |||
| 2469b9ff83 | |||
| f3abdff971 | |||
| af1b71f929 | |||
| 4146f260ac | |||
| 7c5200f838 | |||
| 17d6856f58 | |||
| 2ba164a05c | |||
| ecd02b8885 | |||
| 08caef28ab | |||
| b587da0b9a | |||
| 0f7748a1df | |||
| 2a2159eb8a | |||
| 866de7a49e | |||
| c49be0b2e7 | |||
| 00155e3619 | |||
| 6a9b6bc3a8 | |||
| e7b7751fbb | |||
| 66f6ef6cec | |||
| 1d149bfa19 | |||
| 707f7adbeb | |||
| b9f73f0d0f | |||
| 2f191a2c41 | |||
| 47f3f1f55d | |||
| 9399dbe051 | |||
| a044ca8189 | |||
| 67e06fd017 | |||
| 629e0cb456 | |||
| 4135f02885 | |||
| 6149ff55ab |
57
.gitea/workflows/build.yml
Normal file
57
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,57 @@
|
||||
name: Build
|
||||
run-name: ${{ gitea.actor }} build 🚀
|
||||
|
||||
on: [push]
|
||||
|
||||
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: '21.0.7'
|
||||
|
||||
- name: Setup Android SDK
|
||||
uses: amyu/setup-android@v5
|
||||
with:
|
||||
cache-disabled: true
|
||||
|
||||
- name: Grant execute permissions
|
||||
run: |
|
||||
chmod +x ./gradlew
|
||||
chmod +x ./script/release-uploader
|
||||
|
||||
- name: Download AAR manually
|
||||
run: |
|
||||
FILE="app/libs/firefly-go.aar"
|
||||
URL="https://git.kain.io.vn/Firefly-Shelter/FireflyGo_Android/media/branch/master/app/libs/firefly-go.aar"
|
||||
echo "📥 Downloading $FILE from $URL"
|
||||
curl -L -o "$FILE" "$URL"
|
||||
|
||||
- name: Build signed release APK
|
||||
env:
|
||||
KEYSTORE_PATH: ${{ github.workspace }}/KeyStore.jks
|
||||
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
||||
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
||||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
||||
run: |
|
||||
./gradlew assembleRelease \
|
||||
-Pandroid.injected.signing.store.file=$KEYSTORE_PATH \
|
||||
-Pandroid.injected.signing.store.password=$KEYSTORE_PASSWORD \
|
||||
-Pandroid.injected.signing.key.alias=$KEY_ALIAS \
|
||||
-Pandroid.injected.signing.key.password=$KEY_PASSWORD
|
||||
|
||||
- name: Find and rename release APK
|
||||
run: |
|
||||
APK_FILE=$(ls app/build/outputs/apk/release/*.apk | head -n 1)
|
||||
echo "Found APK: $APK_FILE"
|
||||
mv "$APK_FILE" app/build/outputs/apk/release/firefly_go_android.apk
|
||||
|
||||
- name: Upload release
|
||||
env:
|
||||
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
|
||||
run: script/release-uploader -token=$REPO_TOKEN -release-url="https://git.kain.io.vn/api/v1/repos/Firefly-Shelter/FireflyGo_Android/releases" -files="app/build/outputs/apk/release/firefly_go_android.apk"
|
||||
2
.idea/.name
generated
2
.idea/.name
generated
@@ -1 +1 @@
|
||||
FireflyPsAndorid
|
||||
FireflyGoAndroid
|
||||
13
.idea/deviceManager.xml
generated
Normal file
13
.idea/deviceManager.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DeviceTable">
|
||||
<option name="columnSorters">
|
||||
<list>
|
||||
<ColumnSorterState>
|
||||
<option name="column" value="Name" />
|
||||
<option name="order" value="ASCENDING" />
|
||||
</ColumnSorterState>
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
@@ -1,3 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
|
||||
import com.android.build.api.dsl.Packaging
|
||||
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
@@ -11,7 +14,7 @@ android {
|
||||
compileSdk = 36
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.firefly_go_android"
|
||||
applicationId = "com.kain344.firefly_go_android"
|
||||
minSdk = 24
|
||||
//noinspection OldTargetApi
|
||||
targetSdk = 35
|
||||
@@ -21,6 +24,11 @@ android {
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
fun Packaging.() {
|
||||
jniLibs {
|
||||
useLegacyPackaging = true
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
@@ -32,16 +40,17 @@ android {
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "11"
|
||||
jvmTarget = "17"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
compose = true
|
||||
viewBinding = true
|
||||
}
|
||||
|
||||
composeOptions {
|
||||
@@ -49,6 +58,10 @@ android {
|
||||
}
|
||||
buildToolsVersion = "36.0.0"
|
||||
ndkVersion = "27.2.12479018"
|
||||
dependenciesInfo {
|
||||
includeInApk = false
|
||||
includeInBundle = false
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -87,6 +100,6 @@ dependencies {
|
||||
debugImplementation(libs.ui.test.manifest)
|
||||
|
||||
// Local AAR library
|
||||
implementation(files("../library/firefly-go.aar"))
|
||||
implementation(files("libs/firefly-go.aar"))
|
||||
}
|
||||
|
||||
|
||||
BIN
app/libs/firefly-go-sources.jar
Normal file
BIN
app/libs/firefly-go-sources.jar
Normal file
Binary file not shown.
BIN
app/libs/firefly-go.aar
LFS
Normal file
BIN
app/libs/firefly-go.aar
LFS
Normal file
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"latest_version": "3.6.2-05",
|
||||
"changelog": "UPDATE: Re-optimize performance",
|
||||
"apk_url": "https://git.kain.io.vn/Firefly-Shelter/FireflyGo_Android/releases/download/3.6.2-05/firefly_go_android.apk"
|
||||
"latest_version": "3.6.4-01",
|
||||
"changelog": "UPDATE: Update to 3.6.54",
|
||||
"apk_url": "https://git.kain.io.vn/Firefly-Shelter/FireflyGo_Android/releases/download/3.6.4-01/firefly_go_android.apk"
|
||||
}
|
||||
@@ -14,12 +14,12 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# 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
|
||||
android.enableJetifier=false
|
||||
# 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=true
|
||||
#org.gradle.configuration-cache=false
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
[versions]
|
||||
activityComposeVersion = "1.10.1"
|
||||
agp = "8.9.3"
|
||||
activityComposeVersion = "1.11.0"
|
||||
agp = "8.13.0"
|
||||
androidxJunit = "1.3.0"
|
||||
animationCore = "1.9.0"
|
||||
animationCore = "1.9.2"
|
||||
autoupdater = "1.0.1"
|
||||
espressoCoreVersion = "3.7.0"
|
||||
foundation = "1.9.0"
|
||||
kotlin = "2.0.21"
|
||||
foundation = "1.9.2"
|
||||
kotlin = "2.2.20"
|
||||
coreKtx = "1.17.0"
|
||||
junit = "4.13.2"
|
||||
lifecycleRuntimeKtxVersion = "2.9.3"
|
||||
material = "1.9.0"
|
||||
material3WindowSizeClass = "1.3.2"
|
||||
lifecycleRuntimeKtxVersion = "2.9.4"
|
||||
material = "1.9.2"
|
||||
material3WindowSizeClass = "1.4.0"
|
||||
materialIconsExtended = "1.7.8"
|
||||
ui = "1.9.0"
|
||||
uiGraphics = "1.9.0"
|
||||
uiTestJunit4 = "1.9.0"
|
||||
uiTestManifest = "1.9.0"
|
||||
uiTooling = "1.9.0"
|
||||
uiToolingPreview = "1.9.0"
|
||||
ui = "1.9.2"
|
||||
uiGraphics = "1.9.2"
|
||||
uiTestJunit4 = "1.9.2"
|
||||
uiTestManifest = "1.9.2"
|
||||
uiTooling = "1.9.2"
|
||||
uiToolingPreview = "1.9.2"
|
||||
|
||||
[libraries]
|
||||
androidx-activity-compose-v1101 = { module = "androidx.activity:activity-compose", version.ref = "activityComposeVersion" }
|
||||
|
||||
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
#Mon Apr 28 17:05:34 ICT 2025
|
||||
#Wed Oct 08 15:20:16 ICT 2025
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b2890a23bc1bad9326247f5b8a055f7bfe93eeaaf0e89e220fe27cf9aedf07b5
|
||||
size 89623442
|
||||
2
script/.gitignore
vendored
2
script/.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
.env
|
||||
*.exe
|
||||
@@ -1,2 +1,2 @@
|
||||
# Changelog
|
||||
## - UPDATE: Re-optimize performance
|
||||
## - UPDATE: Update to 3.6.54
|
||||
@@ -1,5 +0,0 @@
|
||||
module release
|
||||
|
||||
go 1.25.0
|
||||
|
||||
require github.com/joho/godotenv v1.5.1
|
||||
@@ -1,2 +0,0 @@
|
||||
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
|
||||
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
|
||||
154
script/main.go
154
script/main.go
@@ -1,154 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"github.com/joho/godotenv"
|
||||
)
|
||||
|
||||
const (
|
||||
repoOwner = "Firefly-Shelter"
|
||||
repoName = "FireflyGo_Android"
|
||||
giteaURL = "https://git.kain.io.vn"
|
||||
)
|
||||
|
||||
type ReleaseInput struct {
|
||||
TagName string `json:"tag_name"`
|
||||
Name string `json:"name"`
|
||||
Body string `json:"body"`
|
||||
Draft bool `json:"draft"`
|
||||
Prerelease bool `json:"prerelease"`
|
||||
}
|
||||
|
||||
type ReleaseResponse struct {
|
||||
ID int `json:"id"`
|
||||
HTMLURL string `json:"html_url"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
func readFile(path string) string {
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("Failed to read %s: %v", path, err))
|
||||
}
|
||||
return string(data)
|
||||
}
|
||||
|
||||
func main() {
|
||||
err := godotenv.Load("script/.env")
|
||||
if err != nil {
|
||||
fmt.Println("Error loading .env file")
|
||||
}
|
||||
|
||||
token := os.Getenv("TOKEN")
|
||||
if token == "" {
|
||||
fmt.Println("TOKEN not found in .env")
|
||||
}
|
||||
|
||||
|
||||
releaseJSON := readFile("script/release.json")
|
||||
var meta map[string]string
|
||||
if err := json.Unmarshal([]byte(releaseJSON), &meta); err != nil {
|
||||
panic("Invalid release.json")
|
||||
}
|
||||
tag := meta["tag"]
|
||||
title := meta["title"]
|
||||
body := readFile("script/README_Note.md")
|
||||
|
||||
// Step 1: Create release
|
||||
releaseInput := ReleaseInput{
|
||||
TagName: tag,
|
||||
Name: title,
|
||||
Body: body,
|
||||
Draft: false,
|
||||
Prerelease: false,
|
||||
}
|
||||
payload, _ := json.Marshal(releaseInput)
|
||||
|
||||
req, _ := http.NewRequest("POST",
|
||||
fmt.Sprintf("%s/api/v1/repos/%s/%s/releases", giteaURL, repoOwner, repoName),
|
||||
bytes.NewReader(payload),
|
||||
)
|
||||
req.Header.Set("Authorization", "token "+token)
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode != http.StatusCreated {
|
||||
bodyBytes, _ := io.ReadAll(resp.Body)
|
||||
panic(fmt.Sprintf("Failed to create release: %s", bodyBytes))
|
||||
}
|
||||
|
||||
var releaseResp ReleaseResponse
|
||||
if err := json.NewDecoder(resp.Body).Decode(&releaseResp); err != nil {
|
||||
panic("Failed to decode release response")
|
||||
}
|
||||
|
||||
fmt.Printf("Release created:\n- ID: %d\n- HTML: %s\n", releaseResp.ID, releaseResp.HTMLURL)
|
||||
|
||||
uploadURL := releaseResp.URL
|
||||
if uploadURL == "" {
|
||||
panic("url missing in release response")
|
||||
}
|
||||
|
||||
files, err := os.ReadDir("app/release")
|
||||
if err != nil {
|
||||
panic("Cannot read prebuild folder")
|
||||
}
|
||||
|
||||
for _, file := range files {
|
||||
if filepath.Ext(file.Name()) != ".apk" {
|
||||
continue
|
||||
}
|
||||
uploadPath := filepath.Join("app/release", file.Name())
|
||||
fmt.Println("Uploading:", uploadPath)
|
||||
|
||||
buf := new(bytes.Buffer)
|
||||
writer := multipart.NewWriter(buf)
|
||||
part, err := writer.CreateFormFile("attachment", filepath.Base(uploadPath))
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to create form: %v\n", err)
|
||||
continue
|
||||
}
|
||||
|
||||
src, err := os.Open(uploadPath)
|
||||
if err != nil {
|
||||
fmt.Printf("Cannot open file %s: %v\n", file.Name(), err)
|
||||
continue
|
||||
}
|
||||
io.Copy(part, src)
|
||||
src.Close()
|
||||
writer.Close()
|
||||
|
||||
req, err := http.NewRequest("POST", uploadURL+"/assets", buf)
|
||||
if err != nil {
|
||||
fmt.Printf("NewRequest error: %v\n", err)
|
||||
continue
|
||||
}
|
||||
req.Header.Set("Authorization", "token "+token)
|
||||
req.Header.Set("Content-Type", writer.FormDataContentType())
|
||||
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
if err != nil {
|
||||
fmt.Printf("Upload failed: %v\n", err)
|
||||
continue
|
||||
}
|
||||
if resp.StatusCode != http.StatusCreated {
|
||||
bodyBytes, _ := io.ReadAll(resp.Body)
|
||||
fmt.Printf("Upload failed: %s\n", bodyBytes)
|
||||
} else {
|
||||
fmt.Println("Uploaded:", file.Name())
|
||||
}
|
||||
resp.Body.Close()
|
||||
}
|
||||
}
|
||||
BIN
script/release-uploader
Normal file
BIN
script/release-uploader
Normal file
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"tag": "3.6.2-05",
|
||||
"title": "PreBuild Version 3.6.52 - 05"
|
||||
"tag": "3.6.4-01",
|
||||
"title": "PreBuild Version 3.6.54 - 01"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven {
|
||||
setUrl("https://jitpack.io")
|
||||
}
|
||||
google {
|
||||
content {
|
||||
includeGroupByRegex("com\\.android.*")
|
||||
@@ -9,18 +12,20 @@ pluginManagement {
|
||||
}
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
|
||||
}
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
maven {
|
||||
setUrl("https://jitpack.io")
|
||||
}
|
||||
google()
|
||||
mavenCentral()
|
||||
maven{
|
||||
url=uri("https://jitpack.io")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
rootProject.name = "FireflyPsAndorid"
|
||||
rootProject.name = "FireflyGoAndroid"
|
||||
include(":app")
|
||||
|
||||
Reference in New Issue
Block a user