Skip to content

Commit

Permalink
Added pid and object ref for activity
Browse files Browse the repository at this point in the history
  • Loading branch information
Kardelio committed May 12, 2023
1 parent 0a87300 commit 4757d05
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions easy-dumpsys
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ do
elif [[ "$line" =~ " ACTIVITY".* ]]; then
activityCounter=$((activityCounter+1))
activityDisplayLine=$(printf "$line" | sed -e 's/^[[:space:]]*//' | cut -d' ' -f2 | cut -d'/' -f2)
pidLine=$(printf "$line" | sed -e 's/^[[:space:]]*//' | cut -d' ' -f4 | cut -d'=' -f2)
objectref=$(printf "$line" | sed -e 's/^[[:space:]]*//' | cut -d' ' -f3)
activityStateLine=$(sed -n "$((simpleLineIterator + 1))p" "$simpleFile")
SAVEIFS=$IFS
IFS=' ' read -r -a array <<< "$activityStateLine"
Expand All @@ -208,7 +210,7 @@ do
if [[ "$resumedPreManip" == true ]]; then
ext="Active"
fi
echo "A $activityDisplayLine $ext - -" >> "$mapFile"
echo "A $activityDisplayLine{$objectref}[$pidLine] $ext - -" >> "$mapFile"
activityMap["$activityCounter"]="$simpleLineIterator"
#elif [[ "$line" =~ [[:space:]]{2,}[a-zA-Z1-9]+\{[a-z0-9]+\}\ \( ]]; then
#elif [[ "$line" =~ \ [a-zA-Z1-9]+\{[a-z0-9\}]+\ .*id\= ]]; then
Expand Down Expand Up @@ -258,12 +260,17 @@ do
elif [[ "$part1" == "A" ]]; then
unset barMap
currentActivtyNum=$((currentActivtyNum+1))
justClass=$(printf "$part2" | cut -d'{' -f1)
obj=$(printf "$part2" | cut -d'{' -f2 | cut -d'}' -f1)
objStr=" - ${objectcolor}${obj}${reset}"
pid=$(printf "$part2" | cut -d'[' -f2 | cut -d']' -f1)
pidStatus=" \033[93;2mpid:${pid}\033[0m"
activeStatus=""
if [[ "$part3" == "Active" ]]; then
activeStatus=" - \033[93mActive\033[0m"
activeStatus=" \033[93mActive\033[0m"
fi
echo ""
printf "${activitycolor}$part2${reset}${activeStatus}\n"
printf "${activitycolor}$justClass${reset}${objStr}${pidStatus}${activeStatus}\n"
elif [[ "$part1" == "F" ]]; then
nextActLineNum=$((currentActivtyNum+1))
nextActLine="${activityMap[$nextActLineNum]}"
Expand Down

0 comments on commit 4757d05

Please sign in to comment.