From 6dbe52089fc45634122e693e4e97571a946d7967 Mon Sep 17 00:00:00 2001 From: threeoh6000 Date: Wed, 13 Nov 2024 16:29:25 +0000 Subject: [PATCH] Add processor detection on `linux/android`. Also tweak how machine is detected on `linux/android`. --- distro_machine_detection.7 | 4 +++- processor_detection.4 | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/distro_machine_detection.7 b/distro_machine_detection.7 index f9a6bfd..8ed9244 100644 --- a/distro_machine_detection.7 +++ b/distro_machine_detection.7 @@ -38,7 +38,9 @@ if [ "$subtype" = "proxmox" ]; then fi fi if [ "$subtype" = "android" ]; then - machine="$(getprop ro.product.manufacturer) $(getprop ro.product.model)" + if [ -n "$(getprop ro.product.manufacturer)$(getprop ro.product.model)" ]; then + machine="$(getprop ro.product.manufacturer) $(getprop ro.product.model)" + fi fi if [ "$system_type" = "openbsd" ]; then diff --git a/processor_detection.4 b/processor_detection.4 index da9927b..994ecac 100644 --- a/processor_detection.4 +++ b/processor_detection.4 @@ -28,6 +28,11 @@ if [ "$hassed" -eq 1 ] && [ "$system_type" = "windows" ] && [ -z "$processor" ]; processor="$(wmic.exe cpu get name | sed -n 2p | head -n 1)" fi fi +if [ "$subtype" = "android" ]; then + if [ -n "$(getprop ro.soc.manufacturer)$(getprop ro.soc.model)" ]; then + machine="$(getprop ro.soc.manufacturer) $(getprop ro.soc.model)" + fi +fi if [ "$hassed" -eq 1 ] && [ "$hasawk" -eq 1 ] && [ -n "$processor" ]; then if [ -n "$(echo $processor | awk -F "@" '{print $1}' | sed "s/Processor//g" | sed "s/CPU//g" | sed "s/(R)//g" | sed "s/(r)//g" | sed "s/(TM)//g" | sed "s/(tm)//g" | tr -s " ")" ]; then processor="$(echo $processor | awk -F "@" '{print $1}' | sed "s/Processor//g" | sed "s/CPU//g" | sed "s/(R)//g" | sed "s/(r)//g" | sed "s/(TM)//g" | sed "s/(tm)//g" | tr -s " ")"