metalx1000

Android ADB Keep Screen on

Mar 2nd, 2023
661
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. #!/system/bin/sh
  2. ######################################################################
  3. #Copyright (C) 2023 Kris Occhipinti
  4. #https://filmsbykris.com
  5.  
  6. #This program is free software: you can redistribute it and/or modify
  7. #it under the terms of the GNU General Public License as published by
  8. #the Free Software Foundation version 3 of the License.
  9.  
  10. #This program is distributed in the hope that it will be useful,
  11. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. #GNU General Public License for more details.
  14.  
  15. #You should have received a copy of the GNU General Public License
  16. #along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. ######################################################################
  18.  
  19. #For use on Android Shell - ADB
  20. #run once to keep screen awake
  21. #run again to free screen
  22.  
  23. lock="$TMPDIR/keep_awake.lock"
  24.  
  25. if [[ -f "$lock" ]]
  26. then
  27. rm "$lock"
  28. echo "Freeing Screen Lock"
  29. else
  30. echo "Keeping Screen Awake"
  31. (
  32. touch "$lock"
  33. while [ -f "$lock" ]
  34. do
  35. input keyevent mouse
  36. sleep 5
  37. done) &
  38. fi
Add Comment
Please, Sign In to add comment