Android customized adb shell displays the logo of shell @ xxx after entering
- 2021-10-27 08:53:31
- OfStack
First, find the source code, in external/mksh/mkshrc, and when you open this file, you will see the following script at the beginning:
The source code of android4.2 is as follows:
: ${TERM:=vt100} ${HOME:=/data} ${MKSH:=/system/bin/sh} ${HOSTNAME:=android}
: ${SHELL:=$MKSH} ${USER:=$(typeset x=$(id); x=${x#*\(}; print -r -- ${x%%\)*})}
if (( USER_ID )); then PS1='$'; else PS1='#'; fi
The source code of android5.0 is as follows:
: ${TERM:=vt100} ${HOME:=/data} ${MKSH:=/system/bin/sh} ${HOSTNAME:=$(getprop ro.product.device)}
: ${SHELL:=$MKSH} ${USER:=$(typeset x=$(id); x=${x#*\(}; print -r -- ${x%%\)*})} ${HOSTNAME:=android}
The source code of android 6.0 is as follows:
: ${HOME:=/data}
: ${HOSTNAME:=$(getprop ro.product.device)}
: ${HOSTNAME:=android}
: ${MKSH:=/system/bin/sh}
: ${SHELL:=$MKSH}
: ${TERM:=xterm}
: ${TMPDIR:=/data/local/tmp}
: ${USER:=$(id -un)}
Find the first one
HOSTNAME=$(getprop ro.product.device)
, put the following
$(getprop ro.product.device)
The value of this variable can be changed to its own name.
Summarize