termux / termux-widget

Termux add-on app which adds shortcuts to commands on the home screen.
https://f-droid.org/en/packages/com.termux.widget
Other
992 stars 115 forks source link

Shortcuts to scripts on the home screen no longer works on MIUI 13 #74

Closed MR-Diamond closed 2 years ago

MR-Diamond commented 2 years ago

This happen both on default launcher as well on Nova launcher. This issue started to happen when I received MIUI 13.

Steps to reproduce the issue:

I add the widget "Termux Shortcut" and I choose a script to add on the home screen

Clicking such widget doesn't launch the script. Instead, if I place the widget with the list of scripts, from here the scripts are properly executed.

I add images to better explain the issue:

Screenshot_2022-03-28-13-07-12-595_com teslacoilsw launcher Screenshot_2022-03-28-13-09-02-942_com teslacoilsw launcher

Additional information

Grimler91 commented 2 years ago

Try capturing a logcat, with adb or as root, to see if there are any warnings or errors when pressing the icon

MR-Diamond commented 2 years ago

Try capturing a logcat, with adb

adb logcat | grep termux:

03-28 13:56:35.086  1612  2557 I ActivityTaskManager: START u0 {act=com.termux.service_execute dat=com.termux.file:/data/data/com.termux/files/home/.shortcuts/stop-kde.sh flg=0x10000000 cmp=com.termux.widget/.TermuxLaunchShortcutActivity bnds=[838,995][1014,1171] (has extras)} from uid 10437
03-28 13:56:35.089  1612  2557 D ActivityStarterImpl: MIUILOG- Permission Denied Activity : Intent { act=com.termux.service_execute dat=com.termux.file:/data/data/com.termux/files/home/.shortcuts/stop-kde.sh flg=0x10000000 cmp=com.termux.widget/.TermuxLaunchShortcutActivity bnds=[838,995][1014,1171] (has extras) } pkg : com.termux.widget uid : 10437 tuid : 10261
agnostic-apollo commented 2 years ago

Try granting Display pop-up windows while running in the background to termux-widget.

https://stackoverflow.com/a/65139148

Although, termux-widget does not request SYSTEM_ALTERT_WINDOW (Draw over apps) permission like termux-app, so option may not show.

MR-Diamond commented 2 years ago

Try granting Display pop-up windows while running in the background to termux-widget

Yeah, this permission fixed the issue. In some way the update to MIUI 13 has reset this setting.