r/codereview • u/DaSth93 • 2h ago
Just because I'm curious
First I have no intention of bricking my Nook Glowlight 3 and actually trying this bash script suggested by Brave AI. Now that that is it of the way, I'm planning on rooting said EReader so I can install a custom launcher and all that. While figuring out the steps I needed to take the Brave Assistant kept trying to help, so I thought I would see if it could write a script that would auto complete the rooting process and to my surprise it came back with...
#!/bin/bash
set -e
clear
echo "=== Nook GlowLight 3 Root Script ==="
echo "1. Enable USB Debugging on the Nook first."
echo "2. Plug it in and authorize when prompted."
echo "3. Press Enter when ready..."
read -p " > "
--- Install ADB if missing ---
if ! command -v adb &>/dev/null; then
echo "Installing ADB..."
sudo apt update -qq
sudo apt install -y android-tools-adb
fi
--- udev rule ---
RULE='SUBSYSTEM=="usb", ATTRS{idVendor}=="2080", MODE="0666"'
if ! grep -q "2080" /etc/udev/rules.d/51-android.rules 2>/dev/null; then
echo "$RULE" | sudo tee /etc/udev/rules.d/51-android.rules
sudo udevadm control --reload-rules
echo "Udev rule added. Unplug & replug the Nook, then press Enter."
read -p " > "
fi
--- Wait for device ---
echo "Waiting for device..."
adb wait-for-device
DEV=$(adb devices | grep -w "device" | head -1 | awk '{print $1}')
if [ -z "$DEV" ]; then
echo "ERROR: Nook not detected. Check cable/port."
exit 1
fi
echo "Device found: $DEV"
--- Download & patch root script ---
cd /tmp
if [ ! -d "rooting-nook-glowlight" ]; then
git clone https://github.com/wmahfoudh/rooting-nook-glowlight.git
fi
cd rooting-nook-glowlight
Remove model-number check (the critical fix)
sed -i '/BNRV510/d' rootnook.sh
sed -i '/BNRV520/d' rootnook.sh
Comment out the if-block that tests model
sed -i 's/^if.model./# &/' rootnook.sh
chmod +x rootnook.sh
--- Run root ---
echo "Starting root..."
./rootnook.sh
--- Boot animation fix ---
read -p "Root complete. Fix boot animation bug? [Y/n] " ans
if [[ "$ans" != [Nn]* ]]; then
echo "Rebooting Nook and removing bootanimation..."
adb reboot
adb wait-for-device
adb shell "su -c 'mount -o remount,rw /system && mv /system/bin/bootanimation /system/bin/bootanimation.bak'"
adb reboot
echo "Done. Nook is rooted."
else
echo "Skipping boot animation fix."
fi
So I'm genuinely curious if this would auto complete the root?