Skip to content

Commit 5d5ebfc

Browse files
committed
Improve OnePlus 6 script usability
1 parent d25e8b2 commit 5d5ebfc

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

android/flash_oneplus6.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ set -eu
2121
# You can find some MSM images here:
2222
# https://www.thecustomdroid.com/oneplus-6-6t-unbrick-guide/
2323

24+
# If you have issues in getting Fastboot to work, try a USB 2.0 cable or a USB 2.0 port.
25+
2426
# Enable factory reset if doing a clean install!
2527
FACTORY_RESET=true
2628
FLASH_A=true
@@ -42,6 +44,13 @@ LOG_PATH="${REPO_DIR}/logs/flash_oneplus6_${TIMESTAMP}.txt"
4244

4345
echo "Starting OnePlus 6 fastboot flash script." |& tee "${LOG_PATH}"
4446

47+
if [ -f "${FASTBOOT}" ]; then
48+
echo "Fastboot found."
49+
else
50+
echo "Fastboot was not found. Please run \"download_tools.sh\"."
51+
exit 1
52+
fi
53+
4554
# Directory checks
4655

4756
OTA_DIR="${CWD}/OTA"
@@ -59,6 +68,12 @@ else
5968
echo "LineageOS directory was not found. Please put the img files and signatures to the subdirectory \"LineageOS\"."
6069
exit 1
6170
fi
71+
if [ -f "${LINEAGEOS_DIR}/imgs.sha256" ]; then
72+
echo "LineageOS SHA256 file found."
73+
else
74+
echo "LineageOS SHA256 file was not found. Please create it from the SHA256 checksums on the download website."
75+
exit 1
76+
fi
6277

6378
TWRP_DIR="${CWD}/TWRP"
6479
if [ -d "${TWRP_DIR}" ]; then
@@ -74,8 +89,7 @@ sha256sum -c "./imgs.sha256"
7489
# "${CWD}"
7590

7691
cd "${TWRP_DIR}"
77-
TWRP_PATTERN="${TWRP_DIR}/*.img"
78-
TWRP_FILES=($TWRP_PATTERN)
92+
TWRP_FILES=("${TWRP_DIR}"/*.img)
7993
TWRP_IMG="${TWRP_FILES[0]}"
8094
sha256sum -c "${TWRP_IMG}.sha256"
8195
wget "https://eu.dl.twrp.me/public.asc" -O "${TWRP_DIR}/public.asc"

0 commit comments

Comments
 (0)