Skip to content
This repository was archived by the owner on Jan 5, 2022. It is now read-only.

Commit c349436

Browse files
committed
Added details from build.prop to deviceInfo.md
1 parent 2691177 commit c349436

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

adebar-cli

+41-1
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,53 @@ getDeviceInfo() {
190190
[ $MK_DEVICEINFO -ne 1 ] && return
191191
local item=""
192192

193-
echo "# Device features" > "${OUTDIR}/deviceInfo.md"
193+
echo "# Device Information" > "${OUTDIR}/deviceInfo.md"
194+
195+
adb pull /system/build.prop "${OUTDIR}/build.prop"
196+
if [ $? -eq 0 ]; then # successfully pulled the build.prop
197+
echo >> "${OUTDIR}/deviceInfo.md"
198+
echo "## Device and ROM properties (from \`build.prop\`)" >> "${OUTDIR}/deviceInfo.md"
199+
while read zeile; do
200+
zeile="${zeile//=/ }"
201+
foo=($zeile)
202+
case ${foo[0]} in
203+
"ro.build.version.sdk") local sdk=${foo[1]} ;;
204+
"ro.build.version.release") local aver=${foo[1]} ;;
205+
"ro.modversion") local modver=${foo[1]} ;; # ro.modversion=10-20121228-NIGHTLY-milestone2
206+
"ro.product.manufacturer") local manu=${foo[1]} ;; # ro.product.manufacturer=Motorola
207+
"ro.product.model") local model=${foo[1]} ;; # ro.product.model=A953
208+
"ro.product.device") local device=${foo[1]} ;; # ro.product.device=milestone2
209+
"ro.product.cpu.abi") local cpu=${foo[1]} ;; # ro.product.cpu.abi=armeabi-v7a
210+
"ro.product.locale.language") local lang=${foo[1]} ;; # ro.product.locale.language=en
211+
"ro.product.locale.region") local region=${foo[1]} ;; # ro.product.locale.region=US
212+
"ro.sf.lcd_density") local density=${foo[1]} ;; # ro.sf.lcd_density=240
213+
"net.dns1") local dns1=${foo[1]} ;; # net.dns1=8.8.8.8
214+
"net.dns2") local dns2=${foo[1]} ;;
215+
esac
216+
done < "${OUTDIR}/build.prop"
217+
echo "* Manufacturer: ${manu}" >> "${OUTDIR}/deviceInfo.md"
218+
echo "* Model: ${model} (${device})" >> "${OUTDIR}/deviceInfo.md"
219+
echo "* CPU: ${cpu}" >> "${OUTDIR}/deviceInfo.md"
220+
echo "* Screen density: ${density}" >> "${OUTDIR}/deviceInfo.md"
221+
echo "* SDK/Android version: ${sdk}/${aver}" >> "${OUTDIR}/deviceInfo.md"
222+
[ -n "$modver" ] && echo "* Mod: ${modver}" >> "${OUTDIR}/deviceInfo.md"
223+
echo "* Language: ${lang}_${region}" >> "${OUTDIR}/deviceInfo.md"
224+
[ -n "${dns1}${dns2}" ] && echo "* Default DNS server: ${dns1}/${dns2}" >> "${OUTDIR}/deviceInfo.md"
225+
# ro.product.brand=MOTO
226+
# ro.product.name=A953_DFP
227+
# ro.product.board=milestone2
228+
# ro.product.cpu.abi2=armeabi
229+
fi
230+
231+
echo >> "${OUTDIR}/deviceInfo.md"
232+
echo "## Device features" >> "${OUTDIR}/deviceInfo.md"
194233
for feature in $(adb shell "pm list features"); do
195234
item=$(echo $feature | tr -d '\r' | awk -F : '{print $2}')
196235
echo "* $item" >> "${OUTDIR}/deviceInfo.md"
197236
done
198237
}
199238

239+
200240
# Get settings
201241
# includes WiFi APs etc.
202242
getSettings() {

doc/files.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* `deadReceivers.md`: the same in markdown format, so you can read it easier
1818
* `deadReceivers.sh`: script which (hopefully) disables those components again, e.g. after a factory-reset
1919
* `defaultInstallLoc`: 1-liner to set the default-install-location for apps
20-
* `deviceInfo.md`: information on the device, e.g. device-features
20+
* `deviceInfo.md`: information on the device, e.g. device-features and properties
2121
* `disable`: shell script utilizing ADB to disable packages
2222
* `packages.xml`: this file is pulled from your device(s) if possible
2323
* `sysbackup`: script to backup all data of your system apps, including shared storage (data from the SD cards)

doc/hints.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ What the settings are standing for is:
8686
Creates a 1-liner script to set that again.
8787
* `MK_DEVICEINFO`: Create a (Markdown) document containing device information.
8888
Currently it lists the "device features" as returned by `pm list features`,
89-
more might be added in the future.
89+
plus some selected details from the `build.prop`; more might be added in
90+
the future.
9091

9192

9293
## Shared Storage

0 commit comments

Comments
 (0)