Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. function error_exit {
  4. echo ""
  5. echo "There was an error installing the game or the obb file. Look above for more info."
  6. echo ""
  7. echo "Things to try:"
  8. echo "Check that the device (and only the device) is listed with "adb devices" from a command prompt."
  9. echo "Make sure all Developer options look normal on the device"
  10. echo "Check that the device has an SD card."
  11. exit 1
  12. }
  13. function pause {
  14. read -n1 -r -p "Press any key to continue..."
  15. }
  16.  
  17.  
  18. ADB=$(command -v adb)
  19. RV=$?
  20. if [[ $RV != 0 ]]; then
  21. echo "Could not find 'adb' binary in path, please verify you have it installed"
  22. exit 2
  23. fi
  24.  
  25. DEVICE=""
  26. if [[ ${#1} -gt 0 ]]; then
  27. DEVICE="-s $1"
  28. fi
  29.  
  30. STORAGE=$($ADB $DEVICE shell "echo \$EXTERNAL_STORAGE")
  31.  
  32. if [[ $DEBUG == 1 ]]; then
  33. echo "===================="
  34. echo " Variables"
  35. echo "===================="
  36. echo "ADB: $ADB"
  37. echo "DEVICE: $DEVICE"
  38. echo "STORAGE: $STORAGE"
  39. echo "===================="
  40. fi
  41.  
  42. if [[ $DRYRUN == 1 ]]; then
  43. exit 0
  44. fi
  45.  
  46. echo ""
  47. echo "Uninstalling existing application. Failures here can almost always be ignored."
  48. $ADB $DEVICE uninstall com.davevillz.pavlov
  49.  
  50. echo ""
  51. echo "Installing existing application. Failures here indicate a problem with the device (connection or storage permissions) and are fatal."
  52. $ADB $DEVICE install Pavlov-Android-Shipping-armv7-es2.apk
  53. RV=$?
  54. if [[ $RV != 0 ]]; then
  55. error_exit
  56. fi
  57.  
  58. $ADB $DEVICE shell rm -r $STORAGE/UE4Game/Pavlov
  59. $ADB $DEVICE shell rm -r $STORAGE/UE4Game/UE4CommandLine.txt
  60. $ADB $DEVICE shell rm -r $STORAGE/obb/com.davevillz.pavlov
  61. $ADB $DEVICE shell rm -r $STORAGE/Android/obb/com.davevillz.pavlov
  62. $ADB shell pm grant com.davevillz.pavlov android.permission.RECORD_AUDIO
  63. echo ""
  64. echo "Installing new data. Failures here indicate storage problems (missing SD card or bad permissions) and are fatal."
  65. $ADB $DEVICE push main.1.com.davevillz.pavlov.obb $STORAGE/Download/obb/com.davevillz.pavlov/main.1.com.davevillz.pavlov.obb
  66. RV=$?
  67. if [[ $RV != 0 ]]; then
  68. error_exit
  69. fi
  70.  
  71. $ADB $DEVICE shell mv $STORAGE/Download/obb/com.davevillz.pavlov $STORAGE/Android/obb/com.davevillz.pavlov
  72. RV=$?
  73. if [[ $RV != 0 ]]; then
  74. error_exit
  75. fi
  76.  
  77. echo ""
  78.  
  79. echo ""
  80. echo "Installation successful"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement