Advertisement
metalx1000

Quick Install Termux with adb on Android

Nov 19th, 2023
999
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.43 KB | None | 0 0
  1. #!/bin/bash
  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. function error(){
  20.   echo $*
  21.   exit 1
  22. }
  23.  
  24. function get_apk(){
  25.   [[ "$1" ]] || exit 1
  26.   app="$1"
  27.   url="https://f-droid.org/en/packages/$app/"
  28.   search="https://f-droid.org/repo/com"
  29.   url="$(wget -qO- "$url"|grep "$search"|grep '.apk'|head -n1|cut -d\" -f2)"
  30.   [[ $url ]] || error fail
  31.   apk="$(basename $url)"
  32.   wget -c "$url"
  33.   adb install -g "$apk"
  34. }
  35.  
  36. adb get-state || error "No Devices Connected"
  37. get_apk com.termux
  38. adb shell am start -a android.intent.action.MAIN -n com.termux/.app.TermuxActivity
  39. get_apk com.termux.api
  40. get_apk com.termux.boot
  41. adb shell am start -a android.intent.action.MAIN -n com.termux.boot/.BootActivity
  42.  
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement