这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions scripts/termux-open.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ fi
case "${TERMUX__USER_ID:-}" in ''|*[!0-9]*|0[0-9]*) TERMUX__USER_ID=0;; esac

am broadcast --user "$TERMUX__USER_ID" \
-a $ACTION \
-n com.termux/com.termux.app.TermuxOpenReceiver \
-a "$ACTION" \
-n "@TERMUX_APP_PACKAGE@/@TERMUX_APP_PACKAGE@.app.TermuxOpenReceiver" \
$EXTRAS \
-d "$FILE" \
> /dev/null
Expand Down
2 changes: 1 addition & 1 deletion scripts/termux-reload-settings.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ fi

case "${TERMUX__USER_ID:-}" in ''|*[!0-9]*|0[0-9]*) TERMUX__USER_ID=0;; esac

am broadcast --user "$TERMUX__USER_ID" -a com.termux.app.reload_style com.termux > /dev/null
am broadcast --user "$TERMUX__USER_ID" -a "@TERMUX_APP_PACKAGE@.app.reload_style" "@TERMUX_APP_PACKAGE@" > /dev/null
18 changes: 13 additions & 5 deletions scripts/termux-reset.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

unset LD_PRELOAD LD_LIBRARY_PATH

AM_APK_PATH="@TERMUX_PREFIX@/libexec/termux-am/am.apk"
AM_APK_TMP_PATH="@TERMUX_CACHE_DIR@/termux-am/am.apk"

echo
echo "You are going to reset your Termux installation."
echo
Expand All @@ -18,18 +21,18 @@ if ! [[ $CHOICE =~ (Y|y) ]]; then
else
HAS_TERMUX_AM=false

if [ -f "@TERMUX_PREFIX@/libexec/termux-am/am.apk" ]; then
if [ -f "$AM_APK_PATH" ]; then
HAS_TERMUX_AM=true

echo "Preserving package 'termux-am' for later use..."

if [ -d "@TERMUX_CACHE_DIR@" ]; then
/system/bin/rm -rf "@TERMUX_CACHE_DIR@/termux-am"
/system/bin/mkdir -p "@TERMUX_CACHE_DIR@/termux-am"
/system/bin/cp "@TERMUX_PREFIX@/libexec/termux-am/am.apk" "@TERMUX_CACHE_DIR@/termux-am/am.apk"
/system/bin/cp "$AM_APK_PATH" "$AM_APK_TMP_PATH"

# In case copying am.apk failed.
if [ ! -e "@TERMUX_CACHE_DIR@/termux-am/am.apk" ]; then
if [ ! -e "$AM_APK_TMP_PATH" ]; then
HAS_TERMUX_AM=false
fi
fi
Expand All @@ -44,7 +47,12 @@ else
echo "Terminating all sessions..."
/system/bin/killall -9 "$SHELL"
else
export CLASSPATH="@TERMUX_CACHE_DIR@/termux-am/am.apk"
/system/bin/app_process / com.termux.termuxam.Am stopservice com.termux/.app.TermuxService
# - https://github.com/termux/TermuxAm/commit/598a9c06
if [ -w "$AM_APK_TMP_PATH" ]; then
chmod 0400 "$AM_APK_TMP_PATH"
fi

export CLASSPATH="$AM_APK_TMP_PATH"
/system/bin/app_process -Xnoimage-dex2oat / "com.termux.termuxam.Am" stopservice "@TERMUX_APP_PACKAGE@/@TERMUX_APP_PACKAGE@.app.TermuxService"
fi
fi
5 changes: 3 additions & 2 deletions scripts/termux-setup-storage.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ fi
case "${TERMUX__USER_ID:-}" in ''|*[!0-9]*|0[0-9]*) TERMUX__USER_ID=0;; esac

am broadcast --user "$TERMUX__USER_ID" \
--es com.termux.app.reload_style storage \
-a com.termux.app.reload_style com.termux > /dev/null
-a "@TERMUX_APP_PACKAGE@.app.reload_style" \
--es "@TERMUX_APP_PACKAGE@.app.reload_style" "storage" \
"@TERMUX_APP_PACKAGE@" > /dev/null
4 changes: 2 additions & 2 deletions scripts/termux-wake-lock.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ case "${TERMUX__USER_ID:-}" in ''|*[!0-9]*|0[0-9]*) TERMUX__USER_ID=0;; esac

am startservice \
--user "$TERMUX__USER_ID" \
-a com.termux.service_wake_lock \
com.termux/com.termux.app.TermuxService \
-a "@TERMUX_APP_PACKAGE@.service_wake_lock" \
"@TERMUX_APP_PACKAGE@/@TERMUX_APP_PACKAGE@.app.TermuxService" \
> /dev/null
4 changes: 2 additions & 2 deletions scripts/termux-wake-unlock.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ case "${TERMUX__USER_ID:-}" in ''|*[!0-9]*|0[0-9]*) TERMUX__USER_ID=0;; esac

am startservice \
--user "$TERMUX__USER_ID" \
-a com.termux.service_wake_unlock \
com.termux/com.termux.app.TermuxService \
-a "@TERMUX_APP_PACKAGE@.service_wake_unlock" \
"@TERMUX_APP_PACKAGE@/@TERMUX_APP_PACKAGE@.app.TermuxService" \
> /dev/null