Advertisement
metalx1000

Launch Termux Widget Script from ADB

Jan 10th, 2025
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.58 KB | None | 0 0
  1. # Launch termux widget script from adb
  2.  
  3. # First get token from termux widget (Might need root)
  4. token_file="/data/data/com.termux.widget/shared_prefs/com.termux.widget_preferences.xml"
  5. grep token $token_file |sed -e 's/<[^>]*>//g;s/ //g' > /sdcard/termux.widget.token
  6. cat /sdcard/termux.widget.token
  7.  
  8.  
  9. # Launch script (you don't need root for this part
  10. token="$(</sdcard/termux.widget.token)"
  11. script="file://com.termux.widget/data/data/com.termux/files/home/.shortcuts/myscript"
  12. am start -n com.termux.widget/.TermuxLaunchShortcutActivity -d $script --es com.termux.shortcut.token $token
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement