-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.bash_aliases.getprop
38 lines (32 loc) · 1.67 KB
/
.bash_aliases.getprop
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# vim: ft=bash noet:
! declare 2>&1 | grep -wq ^colors= && [ $BASH_VERSINFO -ge 4 ] && source $initDir/.colors
test "$debug" -gt 0 && echo "=> Running $bold${colors[blue]}$(basename ${BASH_SOURCE[0]})$normal ..."
export getprop="command getprop"
export setprop="command setprop"
type pm >/dev/null 2>&1 && {
alias findPackages="pm list packages -f -i"
alias disablePackage="pm disable"
alias enablePackage="pm enable"
}
alias getExtSDCardMountPoint=$'mount | awk \'/emulated|sdcard0|self/{next}/(Removable|storage)\//{if($2=="on")print$3;else print$2}\''
alias getADBTcpPort="$getprop service.adb.tcp.port"
alias getAndroidCodeName="$getprop ro.build.version.codename"
alias getAndroidSDK="$getprop ro.build.version.sdk"
alias getAndroidVersion="$getprop ro.build.version.release"
alias getArch="$getprop ro.product.cpu.abi"
alias getBatteryLevel="$getprop dumpsys battery | grep level"
alias getBrand="$getprop ro.product.brand"
alias getDeviceCodeName="$getprop ro.product.device"
alias codeName=getDeviceCodeName
alias getManufacturer="$getprop ro.product.manufacturer"
alias getModel="$getprop ro.product.model"
alias getSerial="$getprop ro.serialno"
export androidDeviceNetworkInterface=$($getprop wifi.interface | grep -v wifi.interface 2>/dev/null)
if [ -n "$androidDeviceNetworkInterface" ];then
alias getNetworkInterface='echo $androidDeviceNetworkInterface'
type awk >/dev/null 2>&1 && alias getNetworkIP="ip -o addr show $androidDeviceNetworkInterface | awk -F ' *|/' '/inet /{print\$4}'"
fi
alias getSerial="$getprop ro.serialno"
alias setADBTcpPort="$setprop service.adb.tcp.port"
set +x
test "$debug" -gt 0 && echo "=> END of $bold${colors[blue]}$(basename ${BASH_SOURCE[0]})$normal"