Skip to content

Commit

Permalink
Fix user reporting on some custom roms.
Browse files Browse the repository at this point in the history
the "id" command does not return the username, so just check for root
privileges, and if its not that its system, as no one else could
possibly login
  • Loading branch information
partcyborg committed Aug 5, 2019
1 parent 58153ec commit d4b1366
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions zsh_arm64/system/etc/zsh/zshenv
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
# output or assume the shell is attached to a tty.
#
# Global Order: zshenv, zprofile, zshrc, zlogin
USER=$(id | awk '{print $1}' | grep -Eo '\([a-z]*')
export USER=${USER[2,99]}
export USER=$([[ "$(print -P "%#")" == '#' ]] && print 'root' || print 'system')
export HOME=/data/local/${USER}
export ANDROID_ROOT=/system
export ANDROID_DATA=/data
Expand Down

0 comments on commit d4b1366

Please sign in to comment.