vendorsetup.sh 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. # m20lte specific
  35. export TARGET_DEVICE_ALT="herolte"
  36. export FOX_RECOVERY_INSTALL_PARTITION="/dev/block/platform/155a0000.ufs/by-name/RECOVERY"
  37. export FOX_RECOVERY_SYSTEM_PARTITION="/dev/block/platform/155a0000.ufs/by-name/SYSTEM"
  38. export FOX_RECOVERY_VENDOR_PARTITION="/dev/block/platform/155a0000.ufs/by-name/VENDOR"
  39. export FOX_RECOVERY_BOOT_PARTITION="/dev/block/platform/155a0000.ufs/by-name/BOOT"
  40. export OF_FLASHLIGHT_ENABLE="1"
  41. export OF_FL_PATH1="/etc/flashlight"
  42. export OF_DEVICE_WITHOUT_PERSIST=1
  43. # R11.1 Settings
  44. export FOX_R11="1"
  45. export FOX_VERSION="R11.1_0"
  46. export OF_MAINTAINER="yyscript"
  47. export OF_MAINTAINER_AVATAR="misc/yyscript.png"
  48. export FOX_ADVANCED_SECURITY="1"
  49. export OF_USE_TWRP_SAR_DETECT="1"
  50. export OF_SUPPORT_ALL_BLOCK_OTA_UPDATES=1
  51. export OF_DISABLE_MIUI_OTA_BY_DEFAULT=0
  52. export OF_FIX_OTA_UPDATE_MANUAL_FLASH_ERROR=1
  53. export OF_OTA_BACKUP_STOCK_BOOT_IMAGE=1
  54. # Quick Backup Defaults
  55. export OF_QUICK_BACKUP_LIST="/boot;/data;/system_image;/vendor_image;"
  56. # Common
  57. export TARGET_ARCH=arm64
  58. export TW_DEFAULT_LANGUAGE="en"
  59. export OF_KEEP_FORCED_ENCRYPTION="1"
  60. export OF_PATCH_AVB20="1"
  61. export OF_USE_MAGISKBOOT="1"
  62. export OF_USE_MAGISKBOOT_FOR_ALL_PATCHES="1"
  63. export OF_DONT_PATCH_ENCRYPTED_DEVICE="1"
  64. export OF_NO_TREBLE_COMPATIBILITY_CHECK="1"
  65. export FOX_USE_LZMA_COMPRESSION="1"
  66. export FOX_USE_BASH_SHELL="1"
  67. export FOX_ASH_IS_BASH="1"
  68. export FOX_USE_NANO_EDITOR="1"
  69. export FOX_USE_TAR_BINARY="1"
  70. export FOX_USE_ZIP_BINARY="1"
  71. export FOX_REPLACE_BUSYBOX_PS="1"
  72. export OF_USE_NEW_MAGISKBOOT="1"
  73. export OF_SKIP_MULTIUSER_FOLDERS_BACKUP="1"
  74. # Use the System (ROM) Fingerprint where Available
  75. export OF_USE_SYSTEM_FINGERPRINT="1"
  76. # Create Odin Flashable .tar files
  77. export OF_NO_SAMSUNG_SPECIAL=0
  78. # OF_MAINTAINER_AVATAR Setup
  79. if [ -n "$OF_MAINTAINER_AVATAR" ]; then
  80. if [ ! -f "$OF_MAINTAINER_AVATAR" ]; then
  81. # some colour codes
  82. RED='\033[0;31m'
  83. GREEN='\033[0;32m'
  84. ORANGE='\033[0;33m'
  85. BLUE='\033[0;34m'
  86. PURPLE='\033[0;35m'
  87. echo -e "${RED}-- File \"$OF_MAINTAINER_AVATAR\" not found ...${NC}"
  88. echo -e "${ORANGE}-- Downloading...${NC}"
  89. mkdir -p misc
  90. curl https://privtext.de/sheets/admin.png >> $OF_MAINTAINER_AVATAR
  91. echo -e "${BLUE}-- Successfully Downloaded the Avatar Image \"$OF_MAINTAINER_AVATAR\" ...${NC}"
  92. echo -e "${PURPLE}-- Using A Custom Maintainer Avatar from the Downloaded Image \"$OF_MAINTAINER_AVATAR\" ...${NC}"
  93. echo -e "${GREEN}-- Done!"
  94. fi
  95. fi
  96. # Let's See what are our Build VARs
  97. if [ -n "$FOX_BUILD_LOG_FILE" -a -f "$FOX_BUILD_LOG_FILE" ]; then
  98. export | grep "FOX" >> $FOX_BUILD_LOG_FILE
  99. export | grep "OF_" >> $FOX_BUILD_LOG_FILE
  100. export | grep "TARGET_" >> $FOX_BUILD_LOG_FILE
  101. export | grep "TW_" >> $FOX_BUILD_LOG_FILE
  102. fi
  103. add_lunch_combo omni_"$FDEVICE"-eng
  104. fi