Fix: Fix Manager and About Manager Page
- Updates the file name to goon.json, consistent with the GoonCord rebrand - Fixes the metadata reading code to use the correct name - Update references in `InstallMetadata.kt` and `SaveMetadataStep.kt`. - Replace "ShiggyCord" with "GoonCord" in `AboutModel.kt`. - Rename `ContributorListItem` to `RegularContributorListItem` - Add a new "LeadContributorItem" composable. - Rename `shiggyXposedVersion` to `goonXposedVersion`. - Fix version up to date comparison
This commit is contained in:
parent
ba79a54b83
commit
49392ab273
7 changed files with 40 additions and 35 deletions
|
|
@ -6,6 +6,9 @@ import kotlinx.serialization.Serializable
|
|||
|
||||
/**
|
||||
* Data stored inside patched APKs as ~~"aliucord.json"~~ "shiggy.json" in order to preserve install-time information about Aliucord and the Manager.
|
||||
* Metadata about an Aliucord installation embedded in the APK.
|
||||
* @param options The patch options used for this installation
|
||||
* @param goonXposedVersion The version of GoonXposed used for this installation
|
||||
*/
|
||||
@Serializable
|
||||
data class InstallMetadata(
|
||||
|
|
@ -47,5 +50,5 @@ data class InstallMetadata(
|
|||
/**
|
||||
* Version of ShiggyXposed embedded into the APK.
|
||||
*/
|
||||
val shiggyXposedVersion: SemVer?,
|
||||
val goonXposedVersion: SemVer,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class SaveMetadataStep(private val options: PatchOptions) : Step(), KoinComponen
|
|||
val aliuhook = container.getStepOrNull<DownloadAliuhookStep>()
|
||||
val injector = container.getStepOrNull<DownloadInjectorStep>()
|
||||
val patches = container.getStepOrNull<DownloadPatchesStep>()
|
||||
val shiggyXposed = container.getStepOrNull<DownloadShiggyXposedStep>()
|
||||
val goonXposed = container.getStepOrNull<DownloadShiggyXposedStep>()
|
||||
|
||||
val metadata = InstallMetadata(
|
||||
options = options,
|
||||
|
|
@ -41,12 +41,12 @@ class SaveMetadataStep(private val options: PatchOptions) : Step(), KoinComponen
|
|||
injectorVersion = injector?.targetVersion,
|
||||
patchesVersion = patches?.targetVersion,
|
||||
lspatchVersion = LSPConfig.instance.VERSION_CODE,
|
||||
shiggyXposedVersion = shiggyXposed?.targetVersion,
|
||||
goonXposedVersion = goonXposed?.targetVersion ?: SemVer.parse("0.0.0"), // Provide a default if null
|
||||
)
|
||||
|
||||
container.log("Writing serialized install metadata to APK")
|
||||
ZipWriter(apk, /* append = */ true).use {
|
||||
it.writeEntry("shiggy.json", json.encodeToString<InstallMetadata>(metadata))
|
||||
it.writeEntry("goon.json", json.encodeToString<InstallMetadata>(metadata))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,13 @@ class AboutModel(
|
|||
mutableState.value = AboutScreenState.Loading
|
||||
|
||||
val allDevelopers = persistentListOf(
|
||||
Developer(
|
||||
username = "OTKUSteyler",
|
||||
avatarUrl = "https://github.com/OTKUSteyler.png",
|
||||
commits = 0,
|
||||
repositories = emptyList(),
|
||||
role = "GoonCord - Creator"
|
||||
),
|
||||
Developer(
|
||||
username = "kmmiio99o",
|
||||
avatarUrl = "https://github.com/kmmiio99o.png",
|
||||
|
|
@ -26,44 +33,34 @@ class AboutModel(
|
|||
repositories = emptyList(),
|
||||
role = "ShiggyCord - Creator"
|
||||
),
|
||||
Developer(
|
||||
username = "jonatanktk",
|
||||
avatarUrl = "https://github.com/jonatanktk.png",
|
||||
commits = 0,
|
||||
repositories = emptyList(),
|
||||
),
|
||||
Developer(
|
||||
username = "OTKUSteyler",
|
||||
avatarUrl = "https://github.com/OTKUSteyler.png",
|
||||
commits = 0,
|
||||
repositories = emptyList(),
|
||||
),
|
||||
Developer(
|
||||
username = "rushiiMachine",
|
||||
avatarUrl = "https://github.com/rushiiMachine.png",
|
||||
commits = 0,
|
||||
repositories = emptyList(),
|
||||
role = "Manager - Creator"
|
||||
),
|
||||
Developer(
|
||||
username = "maisymoe",
|
||||
avatarUrl = "https://github.com/maisymoe.png",
|
||||
commits = 0,
|
||||
repositories = emptyList(),
|
||||
role = "Vendetta - Creator"
|
||||
),
|
||||
Developer(
|
||||
username = "kmmiio99o",
|
||||
avatarUrl = "https://github.com/kmmiio99o.png",
|
||||
commits = 0,
|
||||
repositories = emptyList(),
|
||||
),
|
||||
Developer(
|
||||
username = "pylixonly",
|
||||
avatarUrl = "https://github.com/pylixonly.png",
|
||||
commits = 0,
|
||||
repositories = emptyList(),
|
||||
)
|
||||
)
|
||||
|
||||
role = "Bunny - Creator"
|
||||
),
|
||||
Developer(
|
||||
username = "jonatanktk",
|
||||
avatarUrl = "https://github.com/jonatanktk.png",
|
||||
commits = 0,
|
||||
repositories = emptyList(),
|
||||
role = "Random Person there"
|
||||
),
|
||||
)
|
||||
|
||||
mutableState.value = AboutScreenState.Loaded(allDevelopers.toUnsafeImmutable())
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import androidx.compose.ui.unit.dp
|
|||
import cafe.adriel.voyager.core.screen.Screen
|
||||
import cafe.adriel.voyager.koin.koinScreenModel
|
||||
import com.aliucord.manager.ui.components.*
|
||||
import com.aliucord.manager.ui.screens.about.components.ContributorListItem
|
||||
import com.aliucord.manager.ui.screens.about.components.RegularContributorListItem
|
||||
import com.aliucord.manager.ui.util.paddings.*
|
||||
import dev.goon.manager.R
|
||||
import kotlinx.parcelize.IgnoredOnParcel
|
||||
|
|
@ -29,7 +29,8 @@ import kotlinx.parcelize.Parcelize
|
|||
|
||||
@Parcelize
|
||||
class AboutScreen : Screen, Parcelable {
|
||||
@IgnoredOnParcel override val key = "About"
|
||||
@IgnoredOnParcel
|
||||
override val key = "About"
|
||||
|
||||
@Composable
|
||||
override fun Content() {
|
||||
|
|
@ -103,6 +104,7 @@ fun AboutScreenContent(state: State<AboutScreenState>) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
AboutScreenState.Failure -> {
|
||||
item(key = "LOAD_FAILURE") {
|
||||
Box(
|
||||
|
|
@ -115,12 +117,13 @@ fun AboutScreenContent(state: State<AboutScreenState>) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
is AboutScreenState.Loaded -> {
|
||||
itemsIndexed(
|
||||
items = currentState.contributors,
|
||||
key = { index, developer -> developer.username }
|
||||
) { index, developer ->
|
||||
ContributorListItem(
|
||||
RegularContributorListItem(
|
||||
contributor = developer,
|
||||
isLast = index == currentState.contributors.lastIndex
|
||||
)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import com.aliucord.manager.network.models.Developer
|
|||
import com.valentinilk.shimmer.shimmer
|
||||
|
||||
@Composable
|
||||
fun ContributorListItem(
|
||||
fun RegularContributorListItem(
|
||||
contributor: Developer,
|
||||
isLast: Boolean = false,
|
||||
modifier: Modifier = Modifier
|
||||
|
|
@ -86,7 +86,7 @@ fun ContributorListItem(
|
|||
}
|
||||
|
||||
if (!isLast) {
|
||||
Divider(
|
||||
HorizontalDivider(
|
||||
color = MaterialTheme.colorScheme.outline.copy(alpha = 0.1f),
|
||||
thickness = 1.dp,
|
||||
modifier = Modifier.padding(start = 100.dp, end = 24.dp)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import com.aliucord.manager.network.models.Developer
|
|||
import com.valentinilk.shimmer.shimmer
|
||||
|
||||
@Composable
|
||||
fun ContributorListItem(
|
||||
fun LeadContributorItem(
|
||||
contributor: Developer,
|
||||
isLast: Boolean = false,
|
||||
modifier: Modifier = Modifier
|
||||
|
|
@ -86,7 +86,7 @@ fun ContributorListItem(
|
|||
}
|
||||
|
||||
if (!isLast) {
|
||||
Divider(
|
||||
HorizontalDivider(
|
||||
color = MaterialTheme.colorScheme.outline.copy(alpha = 0.1f),
|
||||
thickness = 1.dp,
|
||||
modifier = Modifier.padding(start = 100.dp, end = 24.dp)
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class HomeModel(
|
|||
private val refreshingLock = Mutex()
|
||||
private var remoteDataJson: BuildInfo? = null
|
||||
private var trackerIndexJson: RNATrackerIndex? = null
|
||||
private var latestShiggyXposedVersion: SemVer? = null
|
||||
private var latestGoonXposedVersion: SemVer? = null
|
||||
private var latestAliuhookVersion: SemVer? = null
|
||||
|
||||
init {
|
||||
|
|
@ -178,7 +178,9 @@ class HomeModel(
|
|||
InstallData(
|
||||
name = name,
|
||||
packageName = pkg.packageName,
|
||||
isUpToDate = try { isInstallationUpToDate(pkg) } catch (e: Exception) {
|
||||
isUpToDate = try {
|
||||
isInstallationUpToDate(pkg)
|
||||
} catch (e: Exception) {
|
||||
Log.w(BuildConfig.TAG, "Failed to check up-to-date for ${pkg.packageName}", e)
|
||||
false
|
||||
},
|
||||
|
|
@ -349,6 +351,6 @@ class HomeModel(
|
|||
VersionPreference.Custom -> return true
|
||||
}
|
||||
|
||||
return latestByPref == versionCode && installMetadata.GoonXposedVersion == latestGoonXposedVersion
|
||||
return latestByPref == versionCode && installMetadata.goonXposedVersion == latestGoonXposedVersion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue