import { ReactNative as RN, url, invites } from "@metro/common"; import { getAssetIDByName } from "@ui/assets"; import { Forms, Summary } from "@ui/components"; import { DISCORD_SERVER, GITHUB } from "@lib/constants"; import { getDebugInfo } from "@lib/debug"; import { useProxy } from "@lib/storage"; import settings from "@lib/settings"; import Version from "@ui/settings/components/Version"; import ErrorBoundary from "@ui/components/ErrorBoundary"; const { FormRow, FormSwitchRow, FormSection, FormDivider } = Forms; const debugInfo = getDebugInfo(); export default function General() { useProxy(settings); const versions = [ { label: "Vendetta", version: debugInfo.vendetta.version, icon: "ic_progress_wrench_24px", }, { label: "Discord", version: `${debugInfo.discord.version} (${debugInfo.discord.build})`, icon: "Discord", }, { label: "React", version: debugInfo.react.version, icon: "ic_category_16px", }, { label: "React Native", version: debugInfo.react.nativeVersion, icon: "mobile", }, { label: "Bytecode", version: debugInfo.hermes.bytecodeVersion, icon: "ic_server_security_24px", }, ]; const platformInfo = [ { label: "Loader", version: debugInfo.vendetta.loader, icon: "ic_download_24px", }, { label: "Operating System", version: `${debugInfo.os.name} ${debugInfo.os.version}`, icon: "ic_cog_24px" }, ...(debugInfo.os.sdk ? [{ label: "SDK", version: debugInfo.os.sdk, icon: "ic_profile_badge_verified_developer_color" }] : []), { label: "Manufacturer", version: debugInfo.device.manufacturer, icon: "ic_badge_staff" }, { label: "Brand", version: debugInfo.device.brand, icon: "ic_settings_boost_24px" }, { label: "Model", version: debugInfo.device.model, icon: "ic_phonelink_24px" }, { label: RN.Platform.select({ android: "Codename", ios: "Machine ID" })!, version: debugInfo.device.codename, icon: "ic_compose_24px" } ]; return ( } trailing={FormRow.Arrow} onPress={() => invites.acceptInviteAndTransitionToInviteChannel({ inviteKey: DISCORD_SERVER })} /> } trailing={FormRow.Arrow} onPress={() => url.openURL(GITHUB)} /> } onPress={() => RN.NativeModules.BundleUpdaterManager.reload()} /> } value={settings.developerSettings} onValueChange={(v: boolean) => { settings.developerSettings = v; }} /> {versions.map((v, i) => ( <> {i !== versions.length - 1 && } ))} {platformInfo.map((p, i) => ( <> {i !== platformInfo.length - 1 && } ))} ) }