Add processor detection on linux/android.

Also tweak how machine is detected on `linux/android`.
This commit is contained in:
abbie 2024-11-13 16:29:25 +00:00
parent 6bc504a4c9
commit 6dbe52089f
Signed by: threeoh6000
GPG key ID: 801FE4AD456E922C
2 changed files with 8 additions and 1 deletions

View file

@ -38,7 +38,9 @@ if [ "$subtype" = "proxmox" ]; then
fi
fi
if [ "$subtype" = "android" ]; then
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

View file

@ -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 " ")"