Merge branch 'dev' into 'master'
dev See merge request AuroraOSS/AuroraStore!562
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
@@ -8,7 +9,10 @@ package com.aurora.store.compose.navigation
|
||||
import android.content.Intent
|
||||
import androidx.activity.compose.LocalActivity
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.compose.LifecycleEventEffect
|
||||
import androidx.lifecycle.viewmodel.navigation3.rememberViewModelStoreNavEntryDecorator
|
||||
import androidx.navigation.NavDeepLinkBuilder
|
||||
import androidx.navigation3.runtime.NavKey
|
||||
@@ -16,6 +20,10 @@ import androidx.navigation3.runtime.entryProvider
|
||||
import androidx.navigation3.runtime.rememberNavBackStack
|
||||
import androidx.navigation3.runtime.rememberSaveableStateHolderNavEntryDecorator
|
||||
import androidx.navigation3.ui.NavDisplay
|
||||
import com.aurora.Constants.PACKAGE_NAME_GMS
|
||||
import com.aurora.extensions.toast
|
||||
import com.aurora.store.AuroraApp
|
||||
import com.aurora.store.ComposeActivity
|
||||
import com.aurora.store.MainActivity
|
||||
import com.aurora.store.R
|
||||
import com.aurora.store.compose.ui.about.AboutScreen
|
||||
@@ -33,6 +41,11 @@ import com.aurora.store.compose.ui.onboarding.OnboardingScreen
|
||||
import com.aurora.store.compose.ui.preferences.installation.InstallerScreen
|
||||
import com.aurora.store.compose.ui.search.SearchScreen
|
||||
import com.aurora.store.compose.ui.spoof.SpoofScreen
|
||||
import com.aurora.store.data.event.InstallerEvent
|
||||
import com.aurora.store.data.model.AccountType
|
||||
import com.aurora.store.data.providers.AccountProvider
|
||||
import com.aurora.store.util.PackageUtil
|
||||
import com.aurora.store.util.Preferences
|
||||
|
||||
/**
|
||||
* Navigation display for compose screens
|
||||
@@ -58,6 +71,36 @@ fun NavDisplay(startDestination: NavKey) {
|
||||
if (backstack.size == 1) activity?.finish() else backstack.removeLastOrNull()
|
||||
}
|
||||
|
||||
val context = LocalContext.current
|
||||
|
||||
fun isMicroGAuthInvalidated(): Boolean =
|
||||
Preferences.getBoolean(context, Preferences.PREFERENCE_AUTH_VIA_MICROG, false) &&
|
||||
AccountProvider.getAccountType(context) == AccountType.GOOGLE &&
|
||||
!PackageUtil.hasSupportedMicroGVariant(context)
|
||||
|
||||
fun handleMicroGRemoved() {
|
||||
context.toast(R.string.microg_removed_auth_warning)
|
||||
AccountProvider.logout(context)
|
||||
val intent = Intent(context, ComposeActivity::class.java).apply {
|
||||
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
}
|
||||
context.startActivity(intent)
|
||||
}
|
||||
|
||||
// Check every time the screen resumes in case microG was removed while Aurora was in background.
|
||||
LifecycleEventEffect(Lifecycle.Event.ON_RESUME) {
|
||||
if (isMicroGAuthInvalidated()) handleMicroGRemoved()
|
||||
}
|
||||
|
||||
// Also react immediately if the GMS package is uninstalled while Aurora is in the foreground.
|
||||
LaunchedEffect(Unit) {
|
||||
AuroraApp.events.installerEvent.collect { event ->
|
||||
if (event is InstallerEvent.Uninstalled && event.packageName == PACKAGE_NAME_GMS) {
|
||||
if (isMicroGAuthInvalidated()) handleMicroGRemoved()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NavDisplay(
|
||||
backStack = backstack,
|
||||
entryDecorators = listOf(
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2024-2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package com.aurora.store.compose.theme
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.ContextWrapper
|
||||
import android.os.Build
|
||||
import androidx.activity.compose.LocalActivity
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.MaterialExpressiveTheme
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
@@ -31,6 +30,7 @@ import com.aurora.store.util.Preferences
|
||||
@Composable
|
||||
fun AuroraTheme(content: @Composable () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
|
||||
val themeStyle = Preferences.getInteger(context, Preferences.PREFERENCE_THEME_STYLE)
|
||||
val isDynamicColorSupported = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S
|
||||
|
||||
@@ -63,10 +63,11 @@ fun AuroraTheme(content: @Composable () -> Unit) {
|
||||
* This is necessary on OEM devices that don't properly support dynamic theming and may have issues with light/dark status bar icons.
|
||||
*/
|
||||
val view = LocalView.current
|
||||
val activity = LocalActivity.current
|
||||
if (!view.isInEditMode) {
|
||||
SideEffect {
|
||||
val activity = view.context.findActivity() ?: return@SideEffect
|
||||
val window = activity.window
|
||||
val currentActivity = activity ?: return@SideEffect
|
||||
val window = currentActivity.window
|
||||
|
||||
// Transparent system bars
|
||||
window.statusBarColor = android.graphics.Color.TRANSPARENT
|
||||
@@ -84,9 +85,3 @@ fun AuroraTheme(content: @Composable () -> Unit) {
|
||||
|
||||
MaterialExpressiveTheme(colorScheme = colorScheme, content = content)
|
||||
}
|
||||
|
||||
tailrec fun Context.findActivity(): Activity? = when (this) {
|
||||
is Activity -> this
|
||||
is ContextWrapper -> baseContext.findActivity()
|
||||
else -> null
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
@@ -8,7 +9,7 @@ package com.aurora.store.compose.ui.commons
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.adaptive.WindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfoV2
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.Modifier
|
||||
@@ -57,7 +58,7 @@ private fun ScreenContent(
|
||||
permissions: List<Permission> = emptyList(),
|
||||
onNavigateUp: () -> Unit = {},
|
||||
onPermissionCallback: (type: PermissionType) -> Unit = {},
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
Scaffold(
|
||||
topBar = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
@@ -23,7 +24,7 @@ import androidx.compose.foundation.lazy.rememberLazyListState
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.adaptive.WindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfoV2
|
||||
import androidx.compose.material3.adaptive.layout.AdaptStrategy
|
||||
import androidx.compose.material3.adaptive.layout.AnimatedPane
|
||||
import androidx.compose.material3.adaptive.layout.PaneAdaptedValue
|
||||
@@ -241,7 +242,7 @@ private fun ScreenContentApp(
|
||||
onUninstall: () -> Unit = {},
|
||||
onOpen: () -> Unit = {},
|
||||
onTestingSubscriptionChange: (subscribe: Boolean) -> Unit = {},
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo(),
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2(),
|
||||
forceSinglePane: Boolean = false,
|
||||
onForceRestart: () -> Unit = {}
|
||||
) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
@@ -17,7 +18,7 @@ import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.adaptive.WindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfoV2
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
@@ -58,7 +59,7 @@ fun ExodusScreen(
|
||||
onNavigateUp: () -> Unit,
|
||||
appDetailsViewModel: AppDetailsViewModel = hiltViewModel(key = packageName),
|
||||
exodusViewModel: ExodusViewModel = hiltViewModel(key = "$packageName/exodus"),
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
|
||||
@@ -103,7 +104,7 @@ private fun ScreenContentReport(
|
||||
trackers: List<ExodusTracker> = emptyList(),
|
||||
onNavigateUp: () -> Unit = {},
|
||||
onRequestAnalysis: () -> Unit = {},
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
|
||||
@@ -175,7 +176,7 @@ private fun ScreenContentError(
|
||||
topAppBarTitle: String? = null,
|
||||
onNavigateUp: () -> Unit = {},
|
||||
onRequestAnalysis: () -> Unit = {},
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
Scaffold(
|
||||
topBar = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
@@ -25,7 +26,7 @@ import androidx.compose.material3.SnackbarHost
|
||||
import androidx.compose.material3.SnackbarHostState
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.adaptive.WindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfoV2
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
@@ -71,7 +72,7 @@ fun ManualDownloadScreen(
|
||||
onNavigateUp: () -> Unit,
|
||||
onRequestInstall: (requestedApp: App) -> Unit,
|
||||
viewModel: AppDetailsViewModel = hiltViewModel(key = packageName),
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
val app by viewModel.app.collectAsStateWithLifecycle()
|
||||
val state by viewModel.state.collectAsStateWithLifecycle()
|
||||
@@ -106,7 +107,7 @@ private fun ScreenContent(
|
||||
currentVersionCode: Long = 0L,
|
||||
onNavigateUp: () -> Unit = {},
|
||||
onRequestInstall: (versionCode: Long) -> Unit = {},
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
val snackBarHostState = remember { SnackbarHostState() }
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
@@ -20,7 +21,7 @@ import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.adaptive.WindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfoV2
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.Alignment
|
||||
@@ -58,7 +59,7 @@ fun MicroGScreen(
|
||||
onIgnore: (Boolean) -> Unit,
|
||||
appDetailsViewModel: AppDetailsViewModel = hiltViewModel(key = packageName),
|
||||
viewModel: MicroGViewModel = hiltViewModel(),
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
val app by appDetailsViewModel.app.collectAsStateWithLifecycle()
|
||||
val topAppBarTitle = when {
|
||||
@@ -84,7 +85,7 @@ private fun ScreenContent(
|
||||
onInstall: () -> Unit = {},
|
||||
onRetry: () -> Unit = {},
|
||||
onIgnore: (Boolean) -> Unit = {},
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
val listState = rememberLazyListState()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
@@ -18,7 +19,7 @@ import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.adaptive.WindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfoV2
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.Alignment
|
||||
@@ -78,7 +79,7 @@ private fun ScreenContent(
|
||||
dependencies: List<App>? = null,
|
||||
onNavigateUp: () -> Unit = {},
|
||||
onNavigateToAppDetails: (packageName: String) -> Unit = {},
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
val topAppBarTitle = when {
|
||||
windowAdaptiveInfo.isWindowCompact -> app.displayName
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
@@ -15,7 +16,7 @@ import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.adaptive.WindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfoV2
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.Alignment
|
||||
@@ -54,7 +55,7 @@ fun PermissionScreen(
|
||||
factory.create(appDetailsViewModel.app.value!!.permissions)
|
||||
}
|
||||
),
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
val app by appDetailsViewModel.app.collectAsStateWithLifecycle()
|
||||
val permissionsInfo by permissionViewModel.permissionsInfo.collectAsStateWithLifecycle()
|
||||
@@ -76,7 +77,7 @@ private fun ScreenContent(
|
||||
topAppBarTitle: String? = null,
|
||||
permissionsInfo: Map<String, PermissionInfo> = emptyMap(),
|
||||
onNavigateUp: () -> Unit = {},
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
val packageManager = LocalContext.current.packageManager
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
@@ -21,7 +22,7 @@ import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.adaptive.WindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfoV2
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
@@ -71,7 +72,7 @@ fun ReviewScreen(
|
||||
factory.create(appDetailsViewModel.app.value!!.packageName)
|
||||
}
|
||||
),
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
val app by appDetailsViewModel.app.collectAsStateWithLifecycle()
|
||||
val reviews = reviewViewModel.reviews.collectAsLazyPagingItems()
|
||||
@@ -95,7 +96,7 @@ private fun ScreenContent(
|
||||
onNavigateUp: () -> Unit = {},
|
||||
reviews: LazyPagingItems<Review> = emptyPagingItems(),
|
||||
onFilter: (filter: Review.Filter) -> Unit = {},
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
Scaffold(
|
||||
topBar = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
@@ -11,7 +12,7 @@ import androidx.compose.foundation.pager.HorizontalPager
|
||||
import androidx.compose.foundation.pager.rememberPagerState
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.adaptive.WindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfoV2
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
@@ -37,7 +38,7 @@ fun ScreenshotScreen(
|
||||
index: Int,
|
||||
onNavigateUp: () -> Unit,
|
||||
viewModel: AppDetailsViewModel = hiltViewModel(key = packageName),
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
val app by viewModel.app.collectAsStateWithLifecycle()
|
||||
|
||||
@@ -60,7 +61,7 @@ private fun ScreenContent(
|
||||
onNavigateUp: () -> Unit = {},
|
||||
screenshots: List<Artwork> = emptyList(),
|
||||
index: Int = 0,
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
val displayMetrics = LocalContext.current.resources.displayMetrics
|
||||
val pagerState = rememberPagerState(initialPage = index) { screenshots.size }
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
@@ -16,7 +17,7 @@ import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.FilledTonalButton
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.adaptive.WindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfoV2
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.dimensionResource
|
||||
@@ -47,7 +48,7 @@ fun Actions(
|
||||
isSecondaryActionEnabled: Boolean = true,
|
||||
onPrimaryAction: () -> Unit = {},
|
||||
onSecondaryAction: () -> Unit = {},
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
@@ -20,7 +21,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.adaptive.WindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfoV2
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
@@ -58,7 +59,7 @@ fun RatingAndReviews(
|
||||
rating: Rating,
|
||||
featuredReviews: List<Review> = emptyList(),
|
||||
onNavigateToDetailsReview: () -> Unit = {},
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
val stars = listOf(
|
||||
rating.oneStar,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
@@ -10,7 +11,7 @@ import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.adaptive.WindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfoV2
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.ui.Modifier
|
||||
@@ -83,7 +84,7 @@ private fun ScreenContent(
|
||||
topAppBarTitle: String,
|
||||
onNavigateUp: () -> Unit = {},
|
||||
onNavigateToAppDetails: (packageName: String) -> Unit = {},
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
Scaffold(
|
||||
topBar = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
@@ -24,7 +25,7 @@ import androidx.compose.material3.TextButton
|
||||
import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.material3.TopAppBarDefaults
|
||||
import androidx.compose.material3.adaptive.WindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfoV2
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.ui.Alignment
|
||||
@@ -71,7 +72,7 @@ private fun ScreenContent(
|
||||
onFinishOnboarding: () -> Unit = {},
|
||||
uiState: OnboardingUiState,
|
||||
onMicrogTOSChecked: (Boolean) -> Unit,
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo()
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||
) {
|
||||
val pagerState = rememberPagerState { pages.size }
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -116,6 +116,14 @@ class DownloadHelper @Inject constructor(
|
||||
downloadDao.updateStatus(packageName, DownloadStatus.CANCELLED)
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the download record from the database without deleting downloaded files.
|
||||
* @param packageName Name of the package
|
||||
*/
|
||||
suspend fun removeDownload(packageName: String) {
|
||||
downloadDao.delete(packageName)
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the entry & downloaded files for the given package
|
||||
* @param packageName Name of the package of the app
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
@@ -28,7 +29,7 @@ class GenericPagingSource<T : Any>(
|
||||
) : PagingSource<Int, T>() {
|
||||
|
||||
companion object {
|
||||
private const val DEFAULT_PAGE_SIZE = 20
|
||||
const val DEFAULT_PAGE_SIZE = 20
|
||||
|
||||
/**
|
||||
* Method to create pager objects using [PagingSource]
|
||||
|
||||
@@ -80,5 +80,6 @@ object AccountProvider {
|
||||
Preferences.remove(context, Constants.ACCOUNT_EMAIL_PLAIN)
|
||||
Preferences.remove(context, Constants.ACCOUNT_AAS_PLAIN)
|
||||
Preferences.remove(context, Constants.ACCOUNT_AUTH_PLAIN)
|
||||
Preferences.remove(context, Preferences.PREFERENCE_AUTH_VIA_MICROG)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package com.aurora.store.data.work
|
||||
|
||||
import android.app.NotificationManager
|
||||
|
||||
@@ -48,6 +48,7 @@ object Preferences {
|
||||
const val PREFERENCE_PROXY_INFO = "PREFERENCE_PROXY_INFO"
|
||||
|
||||
const val PREFERENCE_MICROG_AUTH = "PREFERENCE_MICROG_AUTH"
|
||||
const val PREFERENCE_AUTH_VIA_MICROG = "PREFERENCE_AUTH_VIA_MICROG"
|
||||
|
||||
const val PREFERENCE_DISPENSER_URLS = "PREFERENCE_DISPENSER_URLS"
|
||||
const val PREFERENCE_VENDING_VERSION = "PREFERENCE_VENDING_VERSION"
|
||||
|
||||
@@ -27,6 +27,7 @@ import androidx.paging.cachedIn
|
||||
import com.aurora.gplayapi.data.models.App
|
||||
import com.aurora.gplayapi.helpers.web.WebAppDetailsHelper
|
||||
import com.aurora.store.data.PageResult
|
||||
import com.aurora.store.data.paging.GenericPagingSource
|
||||
import com.aurora.store.data.paging.GenericPagingSource.Companion.manualPager
|
||||
import com.aurora.store.data.providers.BlacklistProvider
|
||||
import com.aurora.store.util.PackageUtil
|
||||
@@ -65,7 +66,7 @@ class InstalledViewModel @Inject constructor(
|
||||
) {
|
||||
PackageUtil.getAllValidPackages(context)
|
||||
.filterNot { it.packageName in blacklist }
|
||||
.chunked(PAGE_SIZE)
|
||||
.chunked(GenericPagingSource.DEFAULT_PAGE_SIZE)
|
||||
}
|
||||
|
||||
init {
|
||||
@@ -73,7 +74,7 @@ class InstalledViewModel @Inject constructor(
|
||||
}
|
||||
|
||||
private fun fetchApps() {
|
||||
manualPager(pageSize = PAGE_SIZE) { page ->
|
||||
manualPager(pageSize = GenericPagingSource.DEFAULT_PAGE_SIZE) { page ->
|
||||
// page is 1-indexed, but list is 0-indexed
|
||||
val chunks = pagedPackages.await()
|
||||
val chunk = chunks.getOrNull(page - 1)
|
||||
@@ -85,8 +86,4 @@ class InstalledViewModel @Inject constructor(
|
||||
.onEach { _apps.value = it }
|
||||
.launchIn(viewModelScope)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val PAGE_SIZE = 20
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ import com.aurora.store.data.model.AuthState
|
||||
import com.aurora.store.data.providers.AccountProvider
|
||||
import com.aurora.store.data.providers.AuthProvider
|
||||
import com.aurora.store.util.AC2DMTask
|
||||
import com.aurora.store.util.PackageUtil
|
||||
import com.aurora.store.util.Preferences
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
@@ -171,13 +172,26 @@ class AuthViewModel @Inject constructor(
|
||||
_authState.value = AuthState.Verifying
|
||||
if (authData.authToken.isNotEmpty() && authData.deviceConfigToken.isNotEmpty()) {
|
||||
authProvider.saveAuthData(authData)
|
||||
val tokenType =
|
||||
if (authData.aasToken.isBlank()) AuthHelper.Token.AUTH else AuthHelper.Token.AAS
|
||||
AccountProvider.login(
|
||||
context,
|
||||
authData.email,
|
||||
authData.aasToken.ifBlank { authData.authToken },
|
||||
if (authData.aasToken.isBlank()) AuthHelper.Token.AUTH else AuthHelper.Token.AAS,
|
||||
authData.aasToken.ifBlank {
|
||||
authData.authToken
|
||||
},
|
||||
tokenType,
|
||||
accountType
|
||||
)
|
||||
// Record whether this Google session relies on microG's AccountManager so we
|
||||
// can warn the user if microG is later uninstalled.
|
||||
Preferences.putBoolean(
|
||||
context,
|
||||
Preferences.PREFERENCE_AUTH_VIA_MICROG,
|
||||
accountType == AccountType.GOOGLE &&
|
||||
tokenType == AuthHelper.Token.AUTH &&
|
||||
PackageUtil.hasSupportedMicroGVariant(context)
|
||||
)
|
||||
_authState.value = AuthState.SignedIn
|
||||
} else {
|
||||
authProvider.removeAuthData(context)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -155,12 +155,22 @@ class AppDetailsViewModel @Inject constructor(
|
||||
_app.value = appDetailsHelper.getAppByPackageName(packageName).copy(
|
||||
isInstalled = PackageUtil.isInstalled(context, packageName)
|
||||
)
|
||||
// Seed state from any in-flight download for this package so reopening
|
||||
// the screen doesn't briefly flash the default install action while the
|
||||
// download flow catches up.
|
||||
_state.value = downloadHelper.getDownload(packageName)
|
||||
?.let { stateFromDownload(it) }
|
||||
?: defaultAppState
|
||||
val existingDownload = downloadHelper.getDownload(packageName)
|
||||
|
||||
// A COMPLETED record for an app that is no longer installed means the app was
|
||||
// installed then removed while Aurora held a stale record.
|
||||
// Remove it so the live download observer doesn't lock the UI in Installing state
|
||||
// indefinitely.
|
||||
if (existingDownload?.status == DownloadStatus.COMPLETED && !isInstalled) {
|
||||
downloadHelper.removeDownload(packageName)
|
||||
_state.value = defaultAppState
|
||||
} else {
|
||||
// Seed state from any in-flight download for this package so reopening
|
||||
// the screen doesn't briefly flash the default install action while the
|
||||
// download flow catches up.
|
||||
_state.value =
|
||||
existingDownload?.let { stateFromDownload(it) } ?: defaultAppState
|
||||
}
|
||||
} catch (exception: Exception) {
|
||||
Log.e(TAG, "Failed to fetch app details", exception)
|
||||
_app.value = null
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Aurora OSS
|
||||
* SPDX-FileCopyrightText: 2021 Rahul Kumar Patel <whyorean@gmail.com>
|
||||
* SPDX-FileCopyrightText: 2025 The Calyx Institute
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
@@ -392,6 +392,7 @@
|
||||
<string name="native_installer_desc">Best suited for devices running below Android 4.4</string>
|
||||
<string name="services_installer_subtitle">Installer for background installations</string>
|
||||
<string name="services_installer_desc">Requires Aurora Services to be installed as a privileged-system app</string>
|
||||
<string name="microg_removed_auth_warning">microG is no longer installed. Run setup again to keep things working smoothly.</string>
|
||||
<string name="microg_installer_subtitle">Requires microG companion app to be installed</string>
|
||||
<string name="microg_installer_desc">Helps you bypass App Integrity (installer only) check</string>
|
||||
<string name="am_installer_subtitle">Full-featured open source package manager</string>
|
||||
|
||||
Reference in New Issue
Block a user