diff --git a/src/lib/debug.ts b/src/lib/debug.ts index 5dbdc98..a40ce46 100644 --- a/src/lib/debug.ts +++ b/src/lib/debug.ts @@ -48,7 +48,9 @@ export const versionHash = "__vendettaVersion"; export function getDebugInfo(string: boolean = false) { const InfoDictionaryManager = RN.NativeModules.InfoDictionaryManager; const hermesProps = window.HermesInternal.getRuntimeProperties(); - const rnVer = RN.Platform.constants.reactNativeVersion; + const PlatformConstants = RN.Platform.constants; + const rnVer = PlatformConstants.reactNativeVersion; + const DCDDeviceManager = RN.NativeModules.DCDDeviceManager; return { vendetta: { @@ -66,6 +68,41 @@ export function getDebugInfo(string: boolean = false) { version: hermesProps["OSS Release Version"], buildType: hermesProps["Build"], bytecodeVersion: hermesProps["Bytecode Version"], - } + }, + ...RN.Platform.select( + { + android: { + os: { + name: "Android", + version: PlatformConstants.Release, + sdk: PlatformConstants.Version + }, + }, + ios: { + os: { + name: PlatformConstants.systemName, + version: PlatformConstants.osVersion + }, + } + } + )!, + ...RN.Platform.select( + { + android: { + device: { + manufacturer: PlatformConstants.Manufacturer, + brand: PlatformConstants.Brand, + model: PlatformConstants.Model + } + }, + ios: { + device: { + manufacturer: DCDDeviceManager.deviceManufacturer, + brand: DCDDeviceManager.deviceBrand, + model: DCDDeviceManager.device + } + } + } + )! } } \ No newline at end of file diff --git a/src/ui/settings/pages/General.tsx b/src/ui/settings/pages/General.tsx index da90aac..4e397b4 100644 --- a/src/ui/settings/pages/General.tsx +++ b/src/ui/settings/pages/General.tsx @@ -40,6 +40,34 @@ export default function General() { }, ]; + const platformInfo = [ + { + label: "Operating System", + version: `${debugInfo.os.name} ${debugInfo.os.version}`, + icon: "ic_cog_24px" + }, + ...(debugInfo.os.sdk ? [{ + label: "Software Development Kit", + version: debugInfo.os.sdk, + icon: "ic_cog_24px" + }] : []), + { + label: "Manufacturer", + version: debugInfo.device.manufacturer, + icon: "ic_hammer_and_chisel_24px" + }, + { + label: "Brand", + version: debugInfo.device.brand, + icon: "ic_megaphone_16px" + }, + { + label: "Model", + version: debugInfo.device.model, + icon: "ic_phonelink_24px" + } + ]; + return ( @@ -65,6 +93,14 @@ export default function General() { ))} + + {platformInfo.map((p) => ( + <> + + + + ))} +