Skip to content

Commit

Permalink
Merge branch 'release/v0.2.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
aaa1115910 committed Dec 6, 2024
2 parents 928a716 + 53dde2c commit f86ceda
Show file tree
Hide file tree
Showing 168 changed files with 7,135 additions and 2,890 deletions.
122 changes: 15 additions & 107 deletions .github/workflows/alpha_build_manually_without_sign.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: Alpha Build Manually (Without sign)
name: Alpha Build Manually (Without signature)

on:
workflow_dispatch:
inputs:
google_services_json:
description: "google-services.json"
required: true
description: "google-services.json (optional)"

jobs:
build-alpha:
Expand Down Expand Up @@ -34,103 +33,36 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build lite apk
run: ./gradlew assembleLiteAlpha assembleLiteDebug

- name: Build default apk
- name: Build apk
run: ./gradlew assembleDefaultAlpha assembleDefaultDebug

- name: Read lite alpha apk output metadata
id: apk-meta-lite-alpha
uses: juliangruber/read-file-action@v1
with:
path: app/build/outputs/apk/lite/alpha/output-metadata.json

- name: Read lite debug apk output metadata
id: apk-meta-lite-debug
uses: juliangruber/read-file-action@v1
with:
path: app/build/outputs/apk/lite/debug/output-metadata.json

- name: Read default alpha apk output metadata
id: apk-meta-default-alpha
- name: Read alpha apk output metadata
id: apk-meta-alpha
uses: juliangruber/read-file-action@v1
with:
path: app/build/outputs/apk/default/alpha/output-metadata.json

- name: Read default debug apk output metadata
id: apk-meta-default-debug
- name: Read alpha debug apk output metadata
id: apk-meta-alpha-debug
uses: juliangruber/read-file-action@v1
with:
path: app/build/outputs/apk/default/debug/output-metadata.json

- name: Parse lite apks info
id: lite-info
run: |
echo "lite_alpha_info_apk_filename=${{ fromJson(steps.apk-meta-lite-alpha.outputs.content).elements[0].outputFile }}" >> $GITHUB_ENV
echo "lite_debug_info_apk_filename=${{ fromJson(steps.apk-meta-lite-debug.outputs.content).elements[0].outputFile }}" >> $GITHUB_ENV
- name: Parse default apks info
id: default-info
- name: Parse apk infos
id: apk-infos
run: |
echo "default_alpha_info_version_code=${{ fromJson(steps.apk-meta-default-alpha.outputs.content).elements[0].versionCode }}" >> $GITHUB_ENV
echo "default_alpha_info_version_name=${{ fromJson(steps.apk-meta-default-alpha.outputs.content).elements[0].versionName }}" >> $GITHUB_ENV
echo "default_debug_info_version_code=${{ fromJson(steps.apk-meta-default-debug.outputs.content).elements[0].versionCode }}" >> $GITHUB_ENV
echo "default_debug_info_version_name=${{ fromJson(steps.apk-meta-default-debug.outputs.content).elements[0].versionName }}" >> $GITHUB_ENV
# upload artifacts lite-debug

- name: Archive lite debug build artifacts
uses: actions/upload-artifact@v4
with:
name: Lite debug build artifact
path: app/build/outputs/apk/lite/debug/${{ env.lite_debug_info_apk_filename }}

# upload artifacts lite-alpha

- name: Archive lite alpha build artifacts
uses: actions/upload-artifact@v4
with:
name: Lite alpha build artifact
path: app/build/outputs/apk/lite/alpha/${{ env.lite_alpha_info_apk_filename }}

- name: Archive lite alpha build mappings
uses: actions/upload-artifact@v4
with:
name: Lite alpha build mappings
path: app/build/outputs/mapping/liteAlpha
echo "alpha_info_version_code=${{ fromJson(steps.apk-meta-alpha.outputs.content).elements[0].versionCode }}" >> $GITHUB_ENV
echo "alpha_info_version_name=${{ fromJson(steps.apk-meta-alpha.outputs.content).elements[0].versionName }}" >> $GITHUB_ENV
echo "alpha_debug_info_version_code=${{ fromJson(steps.apk-meta-alpha-debug.outputs.content).elements[0].versionCode }}" >> $GITHUB_ENV
echo "alpha_debug_info_version_name=${{ fromJson(steps.apk-meta-alpha-debug.outputs.content).elements[0].versionName }}" >> $GITHUB_ENV
# upload artifacts default-debug

- name: Archive default debug build artifacts (universal)
uses: actions/upload-artifact@v4
with:
name: Default debug build artifact (universal)
path: app/build/outputs/apk/default/debug/BV_${{ env.default_debug_info_version_code }}_${{ env.default_debug_info_version_name }}_default_universal.apk

- name: Archive default debug build artifacts (armeabi-v7a)
uses: actions/upload-artifact@v4
with:
name: Default debug build artifact (armeabi-v7a)
path: app/build/outputs/apk/default/debug/BV_${{ env.default_debug_info_version_code }}_${{ env.default_debug_info_version_name }}_default_armeabi-v7a.apk

- name: Archive default debug build artifacts (arm64-v8a)
uses: actions/upload-artifact@v4
with:
name: Default debug build artifact (arm64-v8a)
path: app/build/outputs/apk/default/debug/BV_${{ env.default_debug_info_version_code }}_${{ env.default_debug_info_version_name }}_default_arm64-v8a.apk

- name: Archive default debug build artifacts (x86)
uses: actions/upload-artifact@v4
with:
name: Default debug build artifact (x86)
path: app/build/outputs/apk/default/debug/BV_${{ env.default_debug_info_version_code }}_${{ env.default_debug_info_version_name }}_default_x86.apk

- name: Archive default debug build artifacts (x86_64)
uses: actions/upload-artifact@v4
with:
name: Default debug build artifact (x86_64)
path: app/build/outputs/apk/default/debug/BV_${{ env.default_debug_info_version_code }}_${{ env.default_debug_info_version_name }}_default_x86_64.apk
path: app/build/outputs/apk/default/debug/BV_${{ env.alpha_debug_info_version_code }}_${{ env.alpha_debug_info_version_name }}_default_universal.apk

# upload artifacts default-alpha

Expand All @@ -144,28 +76,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: Default alpha build artifact (universal)
path: app/build/outputs/apk/default/alpha/BV_${{ env.default_alpha_info_version_code }}_${{ env.default_alpha_info_version_name }}_default_universal.apk

- name: Archive default alpha build artifacts (armeabi-v7a)
uses: actions/upload-artifact@v4
with:
name: Default alpha build artifact (armeabi-v7a)
path: app/build/outputs/apk/default/alpha/BV_${{ env.default_alpha_info_version_code }}_${{ env.default_alpha_info_version_name }}_default_armeabi-v7a.apk

- name: Archive default alpha build artifacts (arm64-v8a)
uses: actions/upload-artifact@v4
with:
name: Default alpha build artifact (arm64-v8a)
path: app/build/outputs/apk/default/alpha/BV_${{ env.default_alpha_info_version_code }}_${{ env.default_alpha_info_version_name }}_default_arm64-v8a.apk

- name: Archive default alpha build artifacts (x86)
uses: actions/upload-artifact@v4
with:
name: Default alpha build artifact (x86)
path: app/build/outputs/apk/default/alpha/BV_${{ env.default_alpha_info_version_code }}_${{ env.default_alpha_info_version_name }}_default_x86.apk

- name: Archive default alpha build artifacts (x86_64)
uses: actions/upload-artifact@v4
with:
name: Default alpha build artifact (x86_64)
path: app/build/outputs/apk/default/alpha/BV_${{ env.default_alpha_info_version_code }}_${{ env.default_alpha_info_version_name }}_default_x86_64.apk
path: app/build/outputs/apk/default/alpha/BV_${{ env.alpha_info_version_code }}_${{ env.alpha_info_version_name }}_default_universal.apk
11 changes: 8 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ plugins {
alias(gradleLibs.plugins.kotlin.android)
alias(gradleLibs.plugins.kotlin.serialization)
}
if (file("google-services.json").let {
it.exists() && it.readText().contains(AppConfiguration.appId)
}) {

if (AppConfiguration.googleServicesAvailable) {
apply(plugin = gradleLibs.plugins.google.services.get().pluginId)
}

Expand Down Expand Up @@ -71,6 +70,9 @@ android {
"proguard-rules.pro"
)
if (signingProp.exists()) signingConfig = signingConfigs.getByName("key")
configure<CrashlyticsExtension> {
mappingFileUploadEnabled = AppConfiguration.googleServicesAvailable
}
}
debug {
isMinifyEnabled = false
Expand Down Expand Up @@ -102,6 +104,9 @@ android {
"proguard-rules.pro"
)
if (signingProp.exists()) signingConfig = signingConfigs.getByName("key")
configure<CrashlyticsExtension> {
mappingFileUploadEnabled = AppConfiguration.googleServicesAvailable
}
}
}
// https://issuetracker.google.com/issues/260059413
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@
android:label="@string/title_activity_tag"
android:theme="@style/Theme.BV" />
<activity
android:name=".activities.anime.AnimeIndexActivity"
android:name=".activities.pgc.PgcIndexActivity"
android:exported="false"
android:label="@string/title_activity_anime_index"
android:label="@string/title_activity_pgc_index"
android:theme="@style/Theme.BV" />
<activity
android:name=".activities.user.FollowingSeasonActivity"
android:exported="false"
android:label="@string/title_activity_following_season"
android:theme="@style/Theme.BV" />
<activity
android:name=".activities.anime.AnimeTimelineActivity"
android:name=".activities.pgc.anime.AnimeTimelineActivity"
android:exported="false"
android:label="@string/title_activity_anime_timeline"
android:theme="@style/Theme.BV" />
Expand Down
24 changes: 18 additions & 6 deletions app/src/main/kotlin/dev/aaa1115910/bv/BVApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ import dev.aaa1115910.biliapi.repositories.AuthRepository
import dev.aaa1115910.biliapi.repositories.ChannelRepository
import dev.aaa1115910.biliapi.repositories.FavoriteRepository
import dev.aaa1115910.biliapi.repositories.HistoryRepository
import dev.aaa1115910.biliapi.repositories.IndexRepository
import dev.aaa1115910.biliapi.repositories.LoginRepository
import dev.aaa1115910.biliapi.repositories.PgcRepository
import dev.aaa1115910.biliapi.repositories.RecommendVideoRepository
import dev.aaa1115910.biliapi.repositories.SearchRepository
import dev.aaa1115910.biliapi.repositories.SeasonRepository
import dev.aaa1115910.biliapi.repositories.UgcRepository
import dev.aaa1115910.biliapi.repositories.VideoDetailRepository
import dev.aaa1115910.biliapi.repositories.VideoPlayRepository
import dev.aaa1115910.bv.dao.AppDatabase
Expand All @@ -34,13 +35,18 @@ import dev.aaa1115910.bv.viewmodel.PlayerViewModel
import dev.aaa1115910.bv.viewmodel.TagViewModel
import dev.aaa1115910.bv.viewmodel.UserViewModel
import dev.aaa1115910.bv.viewmodel.VideoPlayerV3ViewModel
import dev.aaa1115910.bv.viewmodel.home.AnimeViewModel
import dev.aaa1115910.bv.viewmodel.home.DynamicViewModel
import dev.aaa1115910.bv.viewmodel.home.PopularViewModel
import dev.aaa1115910.bv.viewmodel.home.RecommendViewModel
import dev.aaa1115910.bv.viewmodel.index.AnimeIndexViewModel
import dev.aaa1115910.bv.viewmodel.index.PgcIndexViewModel
import dev.aaa1115910.bv.viewmodel.login.AppQrLoginViewModel
import dev.aaa1115910.bv.viewmodel.login.SmsLoginViewModel
import dev.aaa1115910.bv.viewmodel.pgc.PgcAnimeViewModel
import dev.aaa1115910.bv.viewmodel.pgc.PgcDocumentaryViewModel
import dev.aaa1115910.bv.viewmodel.pgc.PgcGuoChuangViewModel
import dev.aaa1115910.bv.viewmodel.pgc.PgcMovieViewModel
import dev.aaa1115910.bv.viewmodel.pgc.PgcTvViewModel
import dev.aaa1115910.bv.viewmodel.pgc.PgcVarietyViewModel
import dev.aaa1115910.bv.viewmodel.search.SearchInputViewModel
import dev.aaa1115910.bv.viewmodel.search.SearchResultViewModel
import dev.aaa1115910.bv.viewmodel.user.FavoriteViewModel
Expand Down Expand Up @@ -156,7 +162,8 @@ val appModule = module {
single { VideoDetailRepository(get(), get(), get()) }
single { SeasonRepository(get()) }
single { dev.aaa1115910.biliapi.repositories.UserRepository(get(), get()) }
single { IndexRepository() }
single { PgcRepository() }
single { UgcRepository(get()) }
viewModel { DynamicViewModel(get(), get()) }
viewModel { RecommendViewModel(get()) }
viewModel { PopularViewModel(get()) }
Expand All @@ -170,13 +177,18 @@ val appModule = module {
viewModel { FollowViewModel(get()) }
viewModel { SearchInputViewModel(get()) }
viewModel { SearchResultViewModel(get()) }
viewModel { AnimeViewModel() }
viewModel { FollowingSeasonViewModel(get()) }
viewModel { TagViewModel() }
viewModel { VideoPlayerV3ViewModel(get(), get()) }
viewModel { VideoDetailViewModel(get()) }
viewModel { UserSwitchViewModel(get()) }
viewModel { AnimeIndexViewModel(get()) }
viewModel { PgcIndexViewModel(get()) }
viewModel { PgcAnimeViewModel(get()) }
viewModel { PgcGuoChuangViewModel(get()) }
viewModel { PgcDocumentaryViewModel(get()) }
viewModel { PgcMovieViewModel(get()) }
viewModel { PgcTvViewModel(get()) }
viewModel { PgcVarietyViewModel(get()) }
}

val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = "Settings")
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import dev.aaa1115910.bv.repository.UserRepository
import dev.aaa1115910.bv.screen.HomeScreen
import dev.aaa1115910.bv.screen.MainScreen
import dev.aaa1115910.bv.screen.RegionBlockScreen
import dev.aaa1115910.bv.screen.user.lock.UnlockUserScreen
import dev.aaa1115910.bv.ui.theme.BVTheme
Expand Down Expand Up @@ -67,7 +67,7 @@ class MainActivity : ComponentActivity() {
} else {
//HomeScreen()
if (!userLockLocked) {
HomeScreen()
MainScreen()
} else {
UnlockUserScreen(
onUnlockSuccess = { user ->
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package dev.aaa1115910.bv.activities.pgc

import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import dev.aaa1115910.biliapi.entity.pgc.PgcType
import dev.aaa1115910.bv.screen.main.pgc.PgcIndexScreen
import dev.aaa1115910.bv.ui.theme.BVTheme

class PgcIndexActivity : ComponentActivity() {
companion object {
fun actionStart(
context: Context,
pgcType: PgcType
) {
context.startActivity(
Intent(context, PgcIndexActivity::class.java).apply {
putExtra("pgcType", pgcType.ordinal)
}
)
}
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
BVTheme {
PgcIndexScreen()
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package dev.aaa1115910.bv.activities.anime
package dev.aaa1115910.bv.activities.pgc.anime

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import dev.aaa1115910.bv.screen.home.anime.AnimeTimelineScreen
import dev.aaa1115910.bv.screen.main.pgc.anime.AnimeTimelineScreen
import dev.aaa1115910.bv.ui.theme.BVTheme

class AnimeTimelineActivity : ComponentActivity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ package dev.aaa1115910.bv.activities.search
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.runtime.remember
import androidx.compose.ui.focus.FocusRequester
import dev.aaa1115910.bv.screen.search.SearchInputScreen
import dev.aaa1115910.bv.ui.theme.BVTheme

class SearchInputActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
val defaultFocusRequester = remember { FocusRequester() }
BVTheme {
SearchInputScreen()
SearchInputScreen(defaultFocusRequester = defaultFocusRequester)
}
}
}
Expand Down
Loading

0 comments on commit f86ceda

Please sign in to comment.