vendorsetup.sh 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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="herolte"
  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. # Base
  31. export ALLOW_MISSING_DEPENDENCIES=true
  32. export LC_ALL="C"
  33. export FOX_USE_TWRP_RECOVERY_IMAGE_BUILDER="1"
  34. # Exynos ($FDEVICE) specific
  35. export FOX_RECOVERY_INSTALL_PARTITION="/dev/block/platform/155a0000.ufs/by-name/RECOVERY"
  36. export FOX_RECOVERY_SYSTEM_PARTITION="/dev/block/platform/155a0000.ufs/by-name/SYSTEM"
  37. # FOX_RECOVERY_VENDOR_PARTITION is not set as the device is non-treble
  38. export FOX_RECOVERY_BOOT_PARTITION="/dev/block/platform/155a0000.ufs/by-name/BOOT"
  39. export OF_FL_PATH1="/system/flashlight"
  40. export OF_DEVICE_WITHOUT_PERSIST=1
  41. export OF_SKIP_FBE_DECRYPTION=1
  42. # R11.1 Settings
  43. export FOX_VERSION="R11.1_1"
  44. export OF_MAINTAINER="Sushrut1101"
  45. export OF_MAINTAINER_AVATAR="misc/Sushrut1101.png"
  46. export FOX_ADVANCED_SECURITY="1"
  47. export OF_USE_TWRP_SAR_DETECT="1"
  48. export OF_SUPPORT_ALL_BLOCK_OTA_UPDATES=1
  49. export OF_DISABLE_MIUI_OTA_BY_DEFAULT=0
  50. export OF_FIX_OTA_UPDATE_MANUAL_FLASH_ERROR=1
  51. export OF_OTA_BACKUP_STOCK_BOOT_IMAGE=1
  52. # Quick Backup Defaults
  53. export OF_QUICK_BACKUP_LIST="/boot;/data;/system_image;"
  54. # Common
  55. export TARGET_ARCH=arm64
  56. export TW_DEFAULT_LANGUAGE="en"
  57. export OF_KEEP_FORCED_ENCRYPTION="1"
  58. export OF_PATCH_AVB20="1"
  59. export OF_USE_MAGISKBOOT="1"
  60. export OF_USE_MAGISKBOOT_FOR_ALL_PATCHES="1"
  61. export OF_DONT_PATCH_ENCRYPTED_DEVICE="1"
  62. export OF_NO_TREBLE_COMPATIBILITY_CHECK="1"
  63. export FOX_USE_LZMA_COMPRESSION="1"
  64. export FOX_USE_BASH_SHELL="1"
  65. export FOX_ASH_IS_BASH="1"
  66. export FOX_USE_TAR_BINARY="1"
  67. export FOX_USE_ZIP_BINARY="1"
  68. export FOX_REPLACE_BUSYBOX_PS="1"
  69. export OF_USE_NEW_MAGISKBOOT="1"
  70. export OF_SKIP_MULTIUSER_FOLDERS_BACKUP="1"
  71. # Use the System (ROM) Fingerprint where Available
  72. export OF_USE_SYSTEM_FINGERPRINT="1"
  73. # Run Post Format Process for MTP
  74. export OF_RUN_POST_FORMAT_PROCESS=1
  75. # Magisk
  76. export FOX_USE_SPECIFIC_MAGISK_ZIP=~/Magisk/Magisk.zip
  77. if [ -n "${FOX_USE_SPECIFIC_MAGISK_ZIP}" ]; then
  78. if [ ! -e "${FOX_USE_SPECIFIC_MAGISK_ZIP}" ]; then
  79. echo "Downloading the Latest Release of Magisk..."
  80. 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')"
  81. wget -q ${LATEST_MAGISK_URL} -O ${FOX_USE_SPECIFIC_MAGISK_ZIP} || wget ${LATEST_MAGISK_URL} -O ${FOX_USE_SPECIFIC_MAGISK_ZIP}
  82. [ "$?" = "0" ] && echo "Magisk Downloaded Successfully"
  83. echo "Done!"
  84. fi
  85. fi
  86. # Let's See what are our Build VARs
  87. if [ -n "$FOX_BUILD_LOG_FILE" -a -f "$FOX_BUILD_LOG_FILE" ]; then
  88. export | grep "FOX" >> $FOX_BUILD_LOG_FILE
  89. export | grep "OF_" >> $FOX_BUILD_LOG_FILE
  90. export | grep "TARGET_" >> $FOX_BUILD_LOG_FILE
  91. export | grep "TW_" >> $FOX_BUILD_LOG_FILE
  92. fi
  93. fi