[ui] Expose loader version

This commit is contained in:
amsyarasyiq 2024-04-30 17:07:23 +08:00
parent bd5a6bbf16
commit b40975a53f
5 changed files with 17 additions and 8 deletions

View file

@ -17,11 +17,11 @@ export default () => <ApplicationCommand>{
const info = getDebugInfo();
const content = [
"**Bunny Debug Info**",
`> Bunny: ${info.bunny.version} (${info.bunny.loader})`,
`> Bunny: ${info.bunny.version} (${info.bunny.loader.name} ${info.bunny.loader.version})`,
`> Discord: ${info.discord.version} (${info.discord.build})`,
`> React: ${info.react.version} (RN ${info.react.nativeVersion})`,
`> Hermes: ${info.hermes.version} (bcv${info.hermes.bytecodeVersion})`,
`> System: ${info.os.name} ${info.os.version} (SDK ${info.os.sdk})`,
`> System: ${info.os.name} ${info.os.version} ${info.os.sdk ? `(SDK ${info.os.sdk})` : ""}`.trimEnd(),
`> Device: ${info.device.model} (${info.device.codename})`,
].join("\n");

View file

@ -1,5 +1,6 @@
import { Strings } from "@core/i18n";
import Version from "@core/ui/components/Version";
import { getLoaderName, getLoaderVersion } from "@lib/api/native/loader";
import { useProxy } from "@lib/api/storage";
import { getDebugInfo } from "@lib/debug";
import { settings } from "@lib/settings";
@ -13,7 +14,7 @@ export default function About() {
const versions = [
{
label: Strings.BUNNY,
version: debugInfo.bunny.version,
version: `${getLoaderName()} (${getLoaderVersion()})`,
icon: "ic_progress_wrench_24px",
},
{
@ -41,7 +42,7 @@ export default function About() {
const platformInfo = [
{
label: Strings.LOADER,
version: debugInfo.bunny.loader,
version: debugInfo.bunny.loader.name,
icon: "ic_download_24px",
},
{

View file

@ -1,6 +1,7 @@
import { Strings } from "@core/i18n";
import { PyoncordIcon } from "@core/ui/settings";
import { getAssetIDByName } from "@lib/api/assets";
import { getLoaderName, getLoaderVersion } from "@lib/api/native/loader";
import { useProxy } from "@lib/api/storage";
import { getDebugInfo, toggleSafeMode } from "@lib/debug";
import { settings } from "@lib/settings";
@ -24,7 +25,7 @@ export default function General() {
<TableRow
label={Strings.BUNNY}
icon={<TableRow.Icon source={{ uri: PyoncordIcon }} />}
trailing={<TableRow.TrailingText text={debugInfo.bunny.version} />}
trailing={<TableRow.TrailingText text={`${getLoaderName()} (${getLoaderVersion()})`} />}
/>
<TableRow
label={"Discord"}
@ -88,7 +89,6 @@ export default function General() {
}}
/>
</TableRowGroup>
</Stack>
</ScrollView>
);

View file

@ -99,6 +99,11 @@ export function getLoaderName() {
return "Unknown";
}
export function getLoaderVersion(): string | null {
if (isPyonLoader()) return pyonLoaderIdentity.loaderVersion;
return null;
}
export function isLoaderConfigSupported() {
if (isPyonLoader()) {
return true;

View file

@ -1,5 +1,5 @@
import { getAssetIDByName } from "@lib/api/assets";
import { getLoaderName, isThemeSupported } from "@lib/api/native/loader";
import { getLoaderName, getLoaderVersion, isThemeSupported } from "@lib/api/native/loader";
import { BundleUpdaterManager, ClientInfoManager, DeviceManager } from "@lib/api/native/modules";
import { after } from "@lib/api/patcher";
import { getThemeFromLoader, selectTheme, themes } from "@lib/managers/themes";
@ -105,7 +105,10 @@ export function getDebugInfo() {
},
bunny: {
version: versionHash,
loader: getLoaderName(),
loader: {
name: getLoaderName(),
version: getLoaderVersion()
}
},
discord: {
version: ClientInfoManager.Version,