feat: add warning for GrapheneOS when applicable
This commit is contained in:
parent
23ef31a4bd
commit
123b2e601d
2 changed files with 19 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
package com.aliucord.manager.ui.screens.patching
|
package com.aliucord.manager.ui.screens.patching
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
import androidx.activity.compose.BackHandler
|
import androidx.activity.compose.BackHandler
|
||||||
import androidx.compose.animation.*
|
import androidx.compose.animation.*
|
||||||
|
|
@ -37,6 +38,7 @@ import com.aliucord.manager.ui.screens.patchopts.PatchOptions
|
||||||
import com.aliucord.manager.ui.util.paddings.*
|
import com.aliucord.manager.ui.util.paddings.*
|
||||||
import com.aliucord.manager.ui.util.spacedByLastAtBottom
|
import com.aliucord.manager.ui.util.spacedByLastAtBottom
|
||||||
import com.aliucord.manager.ui.util.thenIf
|
import com.aliucord.manager.ui.util.thenIf
|
||||||
|
import com.aliucord.manager.util.isGrapheneOS
|
||||||
import com.aliucord.manager.util.isIgnoringBatteryOptimizations
|
import com.aliucord.manager.util.isIgnoringBatteryOptimizations
|
||||||
import kotlinx.collections.immutable.persistentListOf
|
import kotlinx.collections.immutable.persistentListOf
|
||||||
import kotlinx.coroutines.flow.filter
|
import kotlinx.coroutines.flow.filter
|
||||||
|
|
@ -162,6 +164,22 @@ class PatchingScreen(private val data: PatchOptions) : Screen, Parcelable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
item(key = "GOS_WARNING") {
|
||||||
|
// Refer to ManifestPatcher for more information
|
||||||
|
BannerSection(visible = remember { Build.VERSION.SDK_INT < 29 && isGrapheneOS() }) {
|
||||||
|
TextBanner(
|
||||||
|
text = stringResource(R.string.installer_gos_warning),
|
||||||
|
icon = painterResource(R.drawable.ic_warning),
|
||||||
|
iconColor = MaterialTheme.customColors.onWarningContainer,
|
||||||
|
outlineColor = MaterialTheme.customColors.warning,
|
||||||
|
containerColor = MaterialTheme.customColors.warningContainer,
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(bottom = VERTICAL_PADDING)
|
||||||
|
.fillMaxWidth(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
item(key = "FAILED_BANNER") {
|
item(key = "FAILED_BANNER") {
|
||||||
BannerSection(visible = state is PatchingScreenState.Failed) {
|
BannerSection(visible = state is PatchingScreenState.Failed) {
|
||||||
val handler = LocalUriHandler.current
|
val handler = LocalUriHandler.current
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@
|
||||||
<string name="installer_uninstall_aborted">Cancelled uninstallation</string>
|
<string name="installer_uninstall_aborted">Cancelled uninstallation</string>
|
||||||
<string name="installer_dl_verify_fail">Failed to verify download</string>
|
<string name="installer_dl_verify_fail">Failed to verify download</string>
|
||||||
<string name="installer_minimization_warning">Since battery optimizations have not been disabled, minimizing this screen may abort the installation process!</string>
|
<string name="installer_minimization_warning">Since battery optimizations have not been disabled, minimizing this screen may abort the installation process!</string>
|
||||||
|
<string name="installer_gos_warning">"This device seems to be running GrapheneOS! A workaround will be applied that significantly reduces performance. Using a different ROM will avoid this."</string>
|
||||||
|
|
||||||
<string name="install_error_unknown">Installer failure (Unknown reason)</string>
|
<string name="install_error_unknown">Installer failure (Unknown reason)</string>
|
||||||
<string name="install_error_blocked">Installation was blocked</string>
|
<string name="install_error_blocked">Installation was blocked</string>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue