vendorsetup.sh 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #
  2. # Copyright (C) 2022 The OrangeFox Recovery Project
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. FDEVICE="hero2lte"
  17. fox_get_target_device() {
  18. local chkdev=$(echo "$BASH_SOURCE" | grep \"$FDEVICE\")
  19. if [ -n "$chkdev" ]; then
  20. FOX_BUILD_DEVICE="$FDEVICE"
  21. else
  22. chkdev=$(set | grep BASH_ARGV | grep \"$FDEVICE\")
  23. [ -n "$chkdev" ] && FOX_BUILD_DEVICE="$FDEVICE"
  24. fi
  25. }
  26. if [ -z "$1" -a -z "$FOX_BUILD_DEVICE" ]; then
  27. fox_get_target_device
  28. fi
  29. if [ "$1" = "$FDEVICE" -o "$FOX_BUILD_DEVICE" = "$FDEVICE" ]; then
  30. # Basic Vars
  31. export ALLOW_MISSING_DEPENDENCIES=true
  32. export LC_ALL="C"
  33. export FOX_USE_TWRP_RECOVERY_IMAGE_BUILDER="1"
  34. export OF_PATCH_AVB20=1
  35. export OF_USE_MAGISKBOOT=1
  36. export OF_USE_MAGISKBOOT_FOR_ALL_PATCHES=1
  37. export OF_DONT_PATCH_ENCRYPTED_DEVICE=1
  38. export OF_NO_TREBLE_COMPATIBILITY_CHECK=1
  39. export OF_NO_MIUI_PATCH_WARNING=1
  40. export FOX_REPLACE_BUSYBOX_PS=1
  41. export OF_USE_NEW_MAGISKBOOT=1
  42. export OF_SKIP_MULTIUSER_FOLDERS_BACKUP=1
  43. export OF_FBE_METADATA_MOUNT_IGNORE=1
  44. export FOX_DELETE_AROMAFM=1
  45. export OF_USE_SYSTEM_FINGERPRINT=1
  46. export FOX_BUGGED_AOSP_ARB_WORKAROUND="1600876644"; # Wednesday, September 23 2020 19:07:11 BST
  47. export FOX_USE_BASH_SHELL=1
  48. export FOX_ASH_IS_BASH=1
  49. export FOX_USE_NANO_EDITOR=1
  50. export FOX_USE_TAR_BINARY=1
  51. export FOX_USE_ZIP_BINARY=1
  52. export FOX_USE_SED_BINARY=1
  53. export FOX_USE_XZ_UTILS=1
  54. export OF_USE_GREEN_LED=0
  55. # OTA for custom ROMs
  56. export OF_SUPPORT_ALL_BLOCK_OTA_UPDATES=1
  57. export OF_FIX_OTA_UPDATE_MANUAL_FLASH_ERROR=1
  58. export OF_DISABLE_MIUI_OTA_BY_DEFAULT=1
  59. # Quick backup defaults
  60. export OF_QUICK_BACKUP_LIST="/boot;/data;/system_image;"
  61. # Exynos ($FDEVICE) Specific
  62. export FOX_RECOVERY_INSTALL_PARTITION="/dev/block/platform/155a0000.ufs/by-name/RECOVERY"
  63. export FOX_RECOVERY_SYSTEM_PARTITION="/dev/block/platform/155a0000.ufs/by-name/SYSTEM"
  64. # FOX_RECOVERY_VENDOR_PARTITION is not set as the device is non-treble
  65. export FOX_RECOVERY_BOOT_PARTITION="/dev/block/platform/155a0000.ufs/by-name/BOOT"
  66. export OF_FL_PATH1="/system/flashlight"
  67. export OF_DEVICE_WITHOUT_PERSIST="1"
  68. # R11.1 Settings
  69. export FOX_R11="1"
  70. export FOX_VERSION="R11.1_1"
  71. export OF_MAINTAINER="Sushrut1101"
  72. # Magisk
  73. export FOX_USE_SPECIFIC_MAGISK_ZIP=~/Magisk/Magisk.zip
  74. if [ -n "${FOX_USE_SPECIFIC_MAGISK_ZIP}" ]; then
  75. if [ ! -e "${FOX_USE_SPECIFIC_MAGISK_ZIP}" ]; then
  76. echo "Downloading the Latest Release of Magisk..."
  77. LATEST_MAGISK_URL="$(curl -sL https://api.github.com/repos/topjohnwu/Magisk/releases/latest | grep browser_download_url | grep Magisk- | cut -d : -f 2,3 | sed 's/"//g')"
  78. wget -q ${LATEST_MAGISK_URL} -O ${FOX_USE_SPECIFIC_MAGISK_ZIP} || wget ${LATEST_MAGISK_URL} -O ${FOX_USE_SPECIFIC_MAGISK_ZIP}
  79. [ "$?" = "0" ] && echo "Magisk Downloaded Successfully"
  80. echo "Done!"
  81. fi
  82. fi
  83. # let's see what are our build VARs
  84. if [ -n "$FOX_BUILD_LOG_FILE" -a -f "$FOX_BUILD_LOG_FILE" ]; then
  85. export | grep "FOX" >> $FOX_BUILD_LOG_FILE
  86. export | grep "OF_" >> $FOX_BUILD_LOG_FILE
  87. export | grep "TARGET_" >> $FOX_BUILD_LOG_FILE
  88. export | grep "TW_" >> $FOX_BUILD_LOG_FILE
  89. fi
  90. fi