Commit 9c0e1897 authored by topjohnwu's avatar topjohnwu

Fallback to getprop when reading system props

Close #4153
parent 3da318b4
......@@ -33,6 +33,16 @@ grep_prop() {
cat $FILES 2>/dev/null | dos2unix | sed -n "$REGEX" | head -n 1
}
grep_get_prop() {
local result=$(grep_prop $@)
if [ -z "$result" ]; then
# Fallback to getprop
getprop "$1"
else
echo $result
fi
}
getvar() {
local VARNAME=$1
local VALUE
......@@ -508,10 +518,10 @@ remove_system_su() {
}
api_level_arch_detect() {
API=`grep_prop ro.build.version.sdk`
ABI=`grep_prop ro.product.cpu.abi | cut -c-3`
ABI2=`grep_prop ro.product.cpu.abi2 | cut -c-3`
ABILONG=`grep_prop ro.product.cpu.abi`
API=$(grep_get_prop ro.build.version.sdk)
ABI=$(grep_get_prop ro.product.cpu.abi | cut -c-3)
ABI2=$(grep_get_prop ro.product.cpu.abi2 | cut -c-3)
ABILONG=$(grep_get_prop ro.product.cpu.abi)
ARCH=arm
ARCH32=arm
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment