-
Notifications
You must be signed in to change notification settings - Fork 4
/
vendorsetup.sh
94 lines (83 loc) · 2.74 KB
/
vendorsetup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#
# Copyright (C) 2023 The OrangeFox Recovery Project
#
# SPDX-License-Identifier: Apache-2.0
#
FDEVICE="everpal"
fox_get_target_device() {
local chkdev=$(echo "$BASH_SOURCE" | grep -w $FDEVICE)
if [ -n "$chkdev" ]; then
FOX_BUILD_DEVICE="$FDEVICE"
else
chkdev=$(set | grep BASH_ARGV | grep -w $FDEVICE)
[ -n "$chkdev" ] && FOX_BUILD_DEVICE="$FDEVICE"
fi
}
if [ -z "$1" -a -z "$FOX_BUILD_DEVICE" ]; then
fox_get_target_device
fi
if [ "$1" = "$FDEVICE" -o "$FOX_BUILD_DEVICE" = "$FDEVICE" ]; then
export FOX_VANILLA_BUILD=1
export FOX_ENABLE_APP_MANAGER=1
export FOX_VIRTUAL_AB_DEVICE=1
export FOX_RECOVERY_SYSTEM_PARTITION="/dev/block/mapper/system"
export FOX_RECOVERY_VENDOR_PARTITION="/dev/block/mapper/vendor"
export FOX_USE_BASH_SHELL=1
export FOX_ASH_IS_BASH=1
export FOX_USE_TAR_BINARY=1
export FOX_USE_SED_BINARY=1
export FOX_USE_XZ_UTILS=1
export FOX_USE_NANO_EDITOR=1
export FOX_DELETE_AROMAFM=1
export FOX_BUGGED_AOSP_ARB_WORKAROUND="1616300800"; # Sun 21 Mar 04:26:40 GMT 2021
# Screen Settings
export OF_SCREEN_H=2400
export OF_STATUS_H=100
export OF_STATUS_INDENT_LEFT=48
export OF_STATUS_INDENT_RIGHT=48
export OF_HIDE_NOTCH=1
export OF_CLOCK_POS=1
# MediaTek
export FOX_RECOVERY_BOOT_PARTITION="/dev/block/by-name/boot"
# Asserts
export FOX_TARGET_DEVICES="evergo,evergreen,everpal,opal"
export TARGET_DEVICE_ALT="evergo,evergreen,opal"
# Flashlight
export OF_FL_PATH1="/system/flashlight"
# R11.1 Settings
export FOX_VERSION="R11.1"
export OF_MAINTAINER="Sushrut1101"
# Magisk
function download_magisk(){
# Usage: download_magisk <destination_path>
local DEST=$1
if [ -n "${DEST}" ]; then
if [ ! -e ${DEST} ]; then
echo "Downloading the Latest Release of Magisk..."
local LATEST_MAGISK_URL=$(curl -sL https://api.github.com/repos/topjohnwu/Magisk/releases/latest | grep "browser_download_url" | grep ".apk" | cut -d : -f 2,3 | tr -d '"')
mkdir -p $(dirname ${DEST})
wget -q ${LATEST_MAGISK_URL} -O ${DEST} || wget ${LATEST_MAGISK_URL} -O ${DEST}
local RCODE=$?
if [ "$RCODE" = "0" ]; then
echo "Successfully Downloaded Magisk to ${DEST}!"
echo "Done!"
else
echo "Failed to Download Magisk to ${DEST}!"
fi
fi
fi
}
export FOX_USE_SPECIFIC_MAGISK_ZIP=~/Magisk/Magisk.zip
download_magisk $FOX_USE_SPECIFIC_MAGISK_ZIP
# let's see what are our build VARs
if [ -n "$FOX_BUILD_LOG_FILE" -a -f "$FOX_BUILD_LOG_FILE" ]; then
export | grep "FOX" >> $FOX_BUILD_LOG_FILE
export | grep "OF_" >> $FOX_BUILD_LOG_FILE
export | grep "TARGET_" >> $FOX_BUILD_LOG_FILE
export | grep "TW_" >> $FOX_BUILD_LOG_FILE
fi
else
if [ -z "$FOX_BUILD_DEVICE" -a -z "$BASH_SOURCE" ]; then
echo "I: This script requires bash. Not processing the $FDEVICE $(basename $0)"
fi
fi