这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions scripts/termux-info.in
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ $(getprop ro.product.model)
LD Variables:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH
LD_PRELOAD=$LD_PRELOAD"
# Escape '\$[](){}|^.?+*' with backslashes for regex
escaped_package_name="$(echo -n "@TERMUX_APP_PACKAGE@" | sed -zE -e 's/[][\.|$(){}?+*^]/\\&/g')"
show_version_code=""
sdk_version="$(getprop ro.build.version.sdk || :)"
if [[ "$sdk_version" =~ ^[0-9]+$ ]] && [ "$sdk_version" -ge "26" ]; then
show_version_code="--show-versioncode"
fi
TERMUX_PLUGINS="$(pm list packages --user "${TERMUX__USER_ID:-0}" $show_version_code 2>&1 </dev/null | grep -E "^package:$escaped_package_name\.[a-zA-Z]" | cut -d ":" -f 2- | grep -vE "^$escaped_package_name\.tapm\.[a-zA-Z]")"
if [ -n "$TERMUX_PLUGINS" ]; then
output+="$(printf "\nInstalled termux plugins:\n${TERMUX_PLUGINS}\n")"
fi
echo "$output"

if [ -n "$(command -v termux-clipboard-set)" ]; then
Expand Down