View Issue Details

IDProjectCategoryView StatusLast Update
0009554Kali LinuxKali Package Improvementpublic2026-02-18 21:08
Reporterpregnol Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Summary0009554: Oneplus One App error on boot
Description

Flashed Nethunter 11 onto a rooted OnePlus One without problems.
Location permission:
--> App permissions
--> No permission denied

When I try to open for the first time NetHunter Store it
says: certificates not installed properly.
App does not update, more precisely it retry but app page
still remain black and say: successfully updated. Isn't
true: no classical Store apps comes out, just blank...

When open NetHunter app a popup say:

"NetHunter app cannot be run properly
Please grant all the permissions requests
from outside the app or restart the app to
grant the rest of permissions again."

NetHunter terminal appear green, not red.
When open terminal wrote:

exec("/data/data/com.offsec.nhterm/files/usr/bin/kali"):
Permission denied

[Process completed (code 1) - press Enter]

NetHunter version flashed:
nethunter-2023.4-oneplus1-eleven-kalifs-full.zip

Later versions doesn't flash cause give RAM memory errors.
I've also tryed latest (minimal) on "Get Kali" web page but
it give error saying no bootable image to be flashed.

Intention was flash older then update.
Tryed without success a couple of times flashing upper
explained following g0tmi1k instructions:
https://www.kali.org/docs/nethunter/installing-nethunter-on-the-oneplus-one/

I also wrote a script for speeding up process.
Let me know where I'm wrong.

Regards,

b1tl0ver

################################################### OnePlus One BashFlash #########################################################

#!/bin/bash

Written by b1tl0ver

Based on g0tm1lk instructions:

https://www.kali.org/docs/nethunter/installing-nethunter-on-the-oneplus-one/

function Input()
{
local exp=0
local _timeout=0
local _input=""

if [[ $1 != "" ]]; then exp=$1; else exp=60; fi

_timeout=$(($(date +%s) + $exp))

while [[ $_input != $'\n' ]]; do
read -t 1 -rs -N 1 _input
if (( $(date +%s) > $_timeout )); then
echo -e "\nTimeout"
exit 1
fi
done
}

function GetMode()
{
timeout=$(($(date +%s) + 100))
echo
while true; do
while read -r "line"; do
[[ $line =~ "waiting" ]] && continue
[[ $line =~ "fastboot" ]] && { device=$(cut -d $'\t' -f1 <<< "$line"); mode="fastboot"; break; }
sleep 1
done < <(fastboot devices)
while read -r "line"; do
[[ $line =~ "attached" ]] && continue
[[ $line =~ "waiting" ]] && continue
[[ $line =~ "no devices" ]] && continue
[[ $line =~ "recovery" ]] && { device=$(cut -d $'\t' -f1 <<< "$line"); mode="recovery"; break; }
[[ $line =~ "device" && ! $line =~ "no" ]] && { device=$(cut -d $'\t' -f1 <<< "$line"); mode="adb"; break; }
tput ed
echo "No device detected, connect the phone to your PC."
tput cuu 1
sleep 1
done < <(adb devices)
if [[ $device != "" ]]; then
tput cuu 1
tput ed
echo
case $mode in
"adb") echo "device \"$(tr -d "\t" <<< "$device")\" detected in adb mode";;
"fastboot") echo "device \"$(tr -d "\t" <<< "$device")\" detected in fastboot mode";;
esac
break
fi
sleep 1
if (( $(date +%s) > $timeout )); then
echo -e "\n\nTimeout"
exit 1
fi
done
}

function FolderCheck()
{
if [[ ! -e "OneFlash" ]]; then mkdir "OneFlash/"; fi
mv "OneplusOneFlash.sh" "OneFlash/"
if [[ -e "Report.txt" ]]; then mv "Report.txt" "OneFlash/"; fi
if [[ -e "$file_cm11" ]]; then mv "$file_cm11" "OneFlash/"; fi
if [[ -e "$file_cm13" ]]; then mv "$file_cm13" "OneFlash/"; fi
if [[ -e "$file_los17" ]]; then mv "$file_los17" "OneFlash/"; fi
if [[ -e "$file_los18" ]]; then mv "$file_los18" "OneFlash/"; fi
if [[ -e "$file_m27" ]]; then mv "$file_m27" "OneFlash/"; fi
if [[ -e "$file_m28" ]]; then mv "$file_m28" "OneFlash/"; fi
if [[ -e "$file_twrp" ]]; then mv "$file_twrp" "OneFlash/"; fi

mv $(find -type f -name "$file_NH") "OneFlash" 2> /dev/null

cd "OneFlash/"
. OneplusOneFlash.sh
}

function WipePhone()
{
echo -e "\nAre you sure, all data will be lost? (Y/n)\n"
read -t 70 choice
case $choice in
y | Y)
if [[ $mode != "fastboot" ]]; then GetMode; fi
if [[ $mode == "adb" ]]; then
adb reboot recovery
#adb reboot bootloader
echo "Wait a minute, rebooting to recovery mode..."
#echo -e "\nWait, rebooting to bootloader..."
sleep 35
mode=""
fi
if [[ $mode == "" ]]; then GetMode; fi
case $mode in
"recovery")
adb shell 'twrp wipe cache'
adb shell 'twrp wipe dalvik'
adb shell 'twrp wipe system'
adb shell 'twrp wipe data'
;;
"fastboot")

fastboot erase *

  #  fastboot erase *
  #  fastboot erase *
  #  fastboot erase *
;;
*)
  echo -e "Please set phone to recovery mode (Buttons: Power + Volume-Up) then restart script.\n"
  exit 1
;;
esac
if [[ $mode != "fastboot" ]]; then
  if [[ -e "Report.txt" ]]; then rm "Report.txt"; fi
  echo -e "\nAll done, now phone is like a stone ready to be reflashed, rebooting."
  sleep 2
  adb reboot
fi

;;
n | N)
exit 0
;;
esac
}

if [[ ! -x $(which adb) ]]; then
echo "installing adb fastboot..."
sudo apt update
sudo apt install --yes adb fastboot
fi
if [[ ! -x $(which adb) ]]; then
echo "adb not installed!"
exit 1
fi

timeout=0
mode=""
input=""
device=""
file_cm11="cm-11.0-XNPH44S-bacon-signed-fastboot.zip"
file_cm13="cm-13.1.2-ZNH2KAS3P0-bacon-signed-8502142fdc.zip"
file_los17="lineage-17.1-20210325-nightly-bacon-signed.zip"
file_los18="lineage-18.1-20240306-nightly-bacon-signed.zip"
file_m27="Magisk-v27.0.apk"
file_m28="Magisk-v28.0.apk"
file_twrp="twrp-3.6.2_9-0-bacon.img"
file_NH="nethunter-*-oneplus1-eleven-kalifs-full.zip"
configured=false
cm11flashed=false
twrpflashed=false
cm13flashed=false
ls17flashed=false
ls18flashed=false
rooted=false

declare -a Report=()

if [[ ! $(pwd) =~ "OneFlash" ]]; then
FolderCheck
exit 0
fi

if [[ ! -e "Report.txt" ]]; then
touch Report.txt
else
readarray -t Report < Report.txt
if [[ ${Report[@]} =~ "configured" ]]; then configured=true; fi
if [[ ${Report[@]} =~ "cm11flashed" ]]; then cm11flashed=true; fi
if [[ ${Report[@]} =~ "twrpflashed" ]]; then twrpflashed=true; fi
if [[ ${Report[@]} =~ "cm13flashed" ]]; then cm13flashed=true; fi
if [[ ${Report[@]} =~ "ls17flashed" ]]; then ls17flashed=true; fi
if [[ ${Report[@]} =~ "ls18flashed" ]]; then ls18flashed=true; fi
if [[ ${Report[@]} =~ "rooted" ]]; then rooted=true; fi
fi

First phase

if [[ $configured == false ]]; then
echo
if [[ $ls18flashed == false ]]; then
if [[ ! ${Report[@]} =~ "cm-11,OK" ]]; then
if [[ -e "$filecm11" ]]; then
echo "CyanogenMod 11.0 (Android 4 \"KitKat\") present, OK..."
sleep 1
else
echo "Downloading CyanogenMod 11.0 (Android 4 \"KitKat\")"
wget 'https://web.archive.org/web/20150302130830if
/http://builds.cyngn.com/factory/bacon/cm-11.0-XNPH44S-bacon-signed-fastboot.zip'
if [[ ! -e "$file_cm11" ]]; then
echo "Download failed, aborting flash!"
rm Report.txt
exit 1
fi
fi
echo "Checking shasum..."
if [[ $(cut -d ' ' -f1 <<< "$(shasum -a 256 -b "$file_cm11")") != "249bf098bb2b9ea187691c5b9f6b11084071ab7a0997f38921370bfbb03ad80f" ]]; then
echo "File result corrupted, aborting flash!"
rm Report.txt
exit 1
fi
echo "SHA256 result valid..."
echo "cm-11,OK" >> "Report.txt"
else
echo "CyanogenMod 11.0 (Android 4 \"KitKat\") present, OK..."
sleep 1
fi
if [[ ! ${Report[@]} =~ "cm-13,OK" ]]; then
if [[ -e "$file_cm13" ]]; then
echo "CyanogenMod 13.1.2 (Android 5 \"Lollipop\") present, OK..."
sleep 1
else
echo "Downloading CyanogenMod 13.1.2 (Android 5 \"Lollipop\")"
wget 'https://web.archive.org/web/20161228005517/http://builds.cyngn.com/factory/bacon/cm-13.1.2-ZNH2KAS3P0-bacon-signed-8502142fdc.zip'
if [[ ! -e "cm-13.1.2-ZNH2KAS3P0-bacon-signed-8502142fdc.zip" ]]; then
echo "Download failed, aborting flash!"
rm Report.txt
exit 1
fi
fi
echo "Checking shasum..."
if [[ $(cut -d ' ' -f1 <<< "$(shasum -a 256 -b "$file_cm13")") != "53f0e58953e630e167aef100dc120d7c85a2ca779b67dfdb26f02b53547e2638" ]]; then
echo "File result corrupted, aborting flash!"
rm Report.txt
exit 1
fi
echo "SHA256 result valid..."
echo "cm-13,OK" >> "Report.txt"
else
echo "CyanogenMod 13.1.2 (Android 5 \"Lollipop\") present, OK..."
sleep 1
fi
if [[ ! ${Report[@]} =~ "los-17,OK" ]]; then
if [[ -e "$file_los17" ]]; then
echo "LineageOS 17.1 (Android 10 \"Ten\") present, OK..."
sleep 1
else
echo "Downloading LineageOS 17.1 (Android 10 \"Ten\")"
wget 'https://archive.org/download/lineageos-17.1-20210325-bacon/lineage-17.1-20210325-nightly-bacon-signed.zip'
if [[ ! -e "$file_los17" ]]; then
echo "Download failed, aborting flash!"
rm Report.txt
exit 1
fi
fi
echo "Checking shasum..."
if [[ $(cut -d ' ' -f1 <<< "$(shasum -a 256 -b "lineage-17.1-20210325-nightly-bacon-signed.zip")") != "50d9b2a4a60b110c6f9c7b602e13ae23a85d6036352fbc877f72fec512f4682b" ]]; then
echo "File result corrupted, aborting flash!"
rm Report.txt
exit 1
fi
echo "SHA256 result valid..."
echo "los-17,OK" >> "Report.txt"
else
echo "LineageOS 17.1 (Android 10 \"Ten\") present, OK..."
sleep 1
fi
if [[ ! ${Report[@]} =~ "los-18,OK" ]]; then
if [[ -e "$file_los18" ]]; then
echo "LineageOS 18.1 (Android 11 \"Eleven\") present, OK..."
sleep 1
else
echo "Downloading LineageOS 18.1 (Android 11 \"Eleven\")"
wget 'https://lineage-archive.timschumi.net/build/18166'
if [[ ! -e "lineage-18.1-20240306-nightly-bacon-signed.zip" ]]; then
echo "Download failed, aborting flash!"
rm Report.txt
exit 1
fi
fi
echo "Checking shasum..."
if [[ $(cut -d ' ' -f1 <<< "$(shasum -a 256 -b "$file_los18")") != "d19c26cee2e2b664dc4a84378eb92c9ced986fcba0a8e926d93e247aaa673723" ]]; then
echo "File result corrupted, aborting flash!"
rm Report.txt
exit 1
fi
echo "SHA256 result valid..."
echo "los-18,OK" >> "Report.txt"
else
echo "LineageOS 18.1 (Android 11 \"Eleven\") present, OK..."
sleep 1
fi
if [[ ! ${Report[@]} =~ "Magisk-v27,OK" ]]; then
if [[ -e "$file_m27" ]]; then
echo "Magisk-v27.0.apk present, OK..."
sleep 1
else
echo "Downloading Magisk-v27.0.apk"
wget 'https://github.com/topjohnwu/Magisk/releases/download/v27.0/Magisk-v27.0.apk'
if [[ ! -e "Magisk-v27.0.apk" ]]; then
echo "Download failed, aborting flash!"
rm Report.txt
exit 1
fi
fi
echo "Checking shasum..."
if [[ $(cut -d ' ' -f1 <<< "$(shasum -a 256 -b "$file_m27")") != "f511bd33d3242911d05b0939f910a3133ef2ba0e0ff1e098128f9f3cd0c16610" ]]; then
echo "File result corrupted, aborting flash!"
rm Report.txt
exit 1
fi
echo "SHA256 result valid..."
echo "Magisk-v27,OK" >> "Report.txt"
else
echo "$file_m27 present, OK..."
sleep 1
fi
if [[ ! ${Report[@]} =~ "Magisk-v28,OK" ]]; then
if [[ -e "$file_m28" ]]; then
echo "Magisk-v28.0.apk present, OK..."
sleep 1
else
echo "Downloading Magisk-v28.0.apk"
wget 'https://github.com/topjohnwu/Magisk/releases/download/v28.0/Magisk-v28.0.apk'
if [[ ! -e "$file_m28" ]]; then
echo "Download failed, aborting flash!"
rm Report.txt
exit 1
fi
fi
echo "Checking shasum..."
if [[ $(cut -d ' ' -f1 <<< "$(shasum -a 256 -b "$file_m28")") != "1b1eebac29f8ab1a41e5f20bbdceefb3341e93bc3d55a0f995c902b0fe877fe2" ]]; then
echo "File result corrupted, aborting flash!"
rm Report.txt
exit 1
fi
echo "SHA256 result valid..."
echo "Magisk-v28,OK" >> "Report.txt"
else
echo "$file_m28 present, OK..."
sleep 1
fi
if [[ ! ${Report[@]} =~ "twrp,OK" ]]; then
if [[ -e "$file_twrp" ]]; then
echo "twrp-3.6.2_9-0-bacon.img present, OK..."
sleep 1
else
echo "Downloading twrp-3.6.2_9-0-bacon.img"
wget 'https://dl.twrp.me/bacon/twrp-3.6.2_9-0-bacon.img'
if [[ ! -e "twrp-3.6.2_9-0-bacon.img" ]]; then
echo "Download failed, aborting flash!"
rm Report.txt
exit 1
fi
fi
echo "Checking shasum..."
if [[ $(cut -d ' ' -f1 <<< "$(shasum -a 256 -b "$file_twrp")") != "1b165d6feee41e705e5fc3d208762aba6fac400fb61f12fd0ae54ced0642acc8" ]]; then
echo "File result corrupted, aborting flash!"
rm Report.txt
exit 1
fi
echo "SHA256 result valid..."
echo "twrp,OK" >> "Report.txt"
else
echo "$file_twrp present, OK..."
sleep 1
fi

echo -e "\n$(tput bold)Preventing errors, before start flashing wipe all phone data, would you like to proceed? (Y/n).$(tput sgr0)\n"

read -t 70 choice
case $choice in
y | Y) WipePhone;;
esac
if [[ $choice == "" ]]; then
  echo "Exiting..."
  sleep 1
  exit 1
fi

GetMode

if [[ $mode == "adb" ]]; then
  timeout=$(($(date +%s) + 100))
  adb reboot bootloader
  while true; do
    while read -r "line"; do
        [[ $line =~ "fastboot" ]] && { mode="fastboot"; break; }
        sleep 1
    done < <(fastboot devices)
    sleep 1
    if [[ $mode == "fastboot" ]]; then break; fi
    if (( $(date +%s) > $timeout )); then
      echo "Timeout..."
      exit 1
    fi
  done
fi

if [[ $cm11flashed == false ]]; then
  echo -e "\nStart flashing CyanogenMod 11.0 (Android 4 \"KitKat\")"

  mkdir -pv cm/ && cd cm/ && unzip "../$file_cm11"
  fastboot oem unlock
  fastboot flash modem NON-HLOS.bin
  fastboot flash sbl1 sbl1.mbn
  fastboot flash dbi sdi.mbn
  fastboot flash aboot emmc_appsboot.mbn
  fastboot flash rpm rpm.mbn
  fastboot flash tz tz.mbn
  fastboot flash LOGO logo.bin
  fastboot flash oppostanvbk static_nvbk.bin
  #fastboot flash recovery recovery.img
  fastboot flash system system.img
  fastboot flash boot boot.img
  fastboot flash cache cache.img
  # OnePlus One 16GB
  #fastboot flash userdata userdata.img    # OnePlus One 16GB
  fastboot flash userdata userdata_64G.img # OnePlus One 64GB
  cd ../ && rm -rf cm/

  echo "cm11flashed" >> "Report.txt"
fi
if [[ $twrpflashed == false ]]; then
  echo -e "\nStart flashing TWRP"
  fastboot flash recovery $file_twrp

  echo "twrpflashed" >> "Report.txt"
  sleep 15
  fastboot boot $file_twrp
  sleep 15
fi

mode=""
timeout=$(($(date +%s) + 60))

while true; do
  while read -r "line"; do
    [[ $line =~ "recovery" ]] && { mode="recovery"; break; }
    sleep 1
  done < <(adb devices)
  if [[ $mode == "recovery" ]]; then break; fi
  sleep 1
  if (( $(date +%s) > $timeout )); then
    echo "Timeout..."
    exit 1
  fi
done

if [[ $cm13flashed == false ]]; then
  echo -e "\nStart flashing CyanogenMod 13.1.2 (Android 5 \"Lollipop\")"
  adb push $file_cm13 /sdcard/Download/cm-13.1.2.zip; adb shell 'twrp install /sdcard/Download/cm-13.1.2.zip'
  echo "cm13flashed" >> "Report.txt"
else
  echo "CyanogenMod 13.1.2 (Android 5 \"Lollipop\") installed, OK..."
fi
sleep 2
if [[ $ls17flashed == false ]]; then
  echo -e "\nStart flashing LineageOS 17.1 (Android 10 \"Ten\")"
  adb push $file_los17 /sdcard/Download/los-17.1.zip; adb shell 'twrp install /sdcard/Download/los-17.1.zip'
  echo "ls17flashed" >> "Report.txt"
else
  echo "LineageOS 17.1 (Android 10 \"Ten\") installed, OK..."
fi
sleep 2
echo -e "\nStart flashing LineageOS 18.1 (Android 11 \"Eleven\")"
sleep 2
adb push $file_los18 /sdcard/Download/los-18.1.zip; adb shell 'twrp install /sdcard/Download/los-18.1.zip'
echo -e "\nWiping data..."
sleep 1
adb shell 'twrp wipe data' # Alt: adb shell 'twrp format data'
adb reboot
echo "ls18flashed" >> "Report.txt"
echo -e "\nWait a minute, rebooting...\n"
sleep 50
ls18flashed=true

fi
if [[ $ls18flashed == true ]]; then
echo -e "$(tput bold)LineageOS 18.1 (Android 11 \"Eleven\") installed, OK...$(tput sgr0)"

if [[ ! ${Report[@]} =~ "step0" ]]; then
  echo -e "$(tput bold)Let's do necessary steps before rooting the phone...\nPress 'Enter' after first phone configuration.\n$(tput sgr0)"
  Input 300
  echo "step0" >> "Report.txt"
fi
if [[ ! ${Report[@]} =~ "step1" ]]; then
  echo -e "Please go to:\n\n--> Setting\n--> About phone\n--> Build number: Press 7 times\n\nPress 'Enter' when you've done it.\n\n"
  Input
  echo "step1" >> "Report.txt"
fi
if [[ ! ${Report[@]} =~ "step2" ]]; then
  echo -e "Now go to:\n\n--> Settings\n--> System\n--> Advanced\n--> Developer options\n--> Enable \"USB debugging\"\nWait... then grant permissions to the displayed popup\n\nPress 'Enter' when you've done it.\n"
  Input 90
  echo "step2" >> "Report.txt"
fi
if [[ ! ${Report[@]} =~ "step3" ]]; then
  echo -e "Now go to:\n\n--> Settings\n--> System\n--> Advanced\n--> Gestures\n--> Power menu\n--> Advance restart\n--> Enable\n\nPress 'Enter' when you've done it.\n"
  Input 90
  echo "step3" >> "Report.txt"
fi
# if [[ ! ${Report[@]} =~ "step4" ]]; then
#  echo -e "Now go to:\n\n--> Settings\n--> System\n--> Updater\n--> Preferences\n--> Update recovery\n--> Disable\n\nPress 'Enter' when you've done it.\n"
#  Input 90
#  echo "step4" >> "Report.txt"
# fi
configured=true
echo "configured" >> "Report.txt"

fi
fi

Second phase

if [[ $rooted == false ]]; then
echo -e "\n\n$(tput bold)Phone need to be rooted, you can do it in a second moment, would you like to continue (y/N)$(tput sgr0)\n"
read -t 70 choice

case $choice in
y | Y)
GetMode
if [[ $mode != "adb" && ! ${Report[@]} =~ "step5" ]]; then
echo "\nBoot phone under LineageOS-18 then restart script."
exit 1
fi
if [[ ! ${Report[@]} =~ "step5" ]]; then
adb install "$file_m28"
#unzip "$file_los18" boot.img
#adb push boot.img /sdcard/Download/
adb push $file_los18 /sdcard/Download/los-18.1.zip

  echo -e "\nMagisk-v28.0.apk installed..."
  echo "LineageOS-18.1.zip, which is located inside \"Download\" folder, need to be patched..."
  sleep 3
  echo -e "For doing that open Magisk app the type:\n--> Install\n--> Select and Patch a file\n--> Open Downloads folder\n--> Select \"los-18.1.zip\"\n--> Let's go! -->\n\nPress 'Enter' when you've done it.\n"

  Input 300
  echo "step5" >> "Report.txt"
fi
if [[ ! ${Report[@]} =~ "step6" ]]; then
  echo "Rebooting to recovery..."
  sleep 2

  adb reboot recovery

  echo -e "When phone reboot (TWRP mode) go to:\n--> Install\n--> Install Image\n--> /sdcard/Download/: magisk_patched-*.img\n--> Boot\n\n--> Swipe to confirm Flash\n--> Reboot System.\n\nPress 'Enter' when you've done it."
  Input 300
  echo "step6" >> "Report.txt"
fi
if [[ ! ${Report[@]} =~ "step7" ]]; then
  GetMode
  if [[ $mode == "adb" ]]; then
    echo "Wait a minute, rebooting then going again to recovery..."
    adb reboot recovery
    sleep 30
    tput cuu 2
  fi
  GetMode
  if [[ $mode == "recovery" ]]; then
    echo "Flashing Magisk-v27.0.apk..."
    adb push $file_m27 /sdcard/Download/Magisk-27.apk
    adb shell 'twrp install /sdcard/Download/Magisk-27.apk'
    adb reboot
    echo "Wait, rebooting..."
    echo "step7" >> "Report.txt"
    sleep 5
  else
    adb reboot
    sleep 40
    . OneplusOneFlash.sh
  fi
  if [[ ! ${Report[@]} =~ "step7" ]]; then
    echo -e "\n\nType 'Enter' when phone rebooted.\n"
    Input 300
    echo -e "Launch Magisk app then upgrade...\n\nPress 'Enter' when you've done it."
    Input 300
    echo -e "Launch upgraded Magisk app, it will request additional setup, type\n--> ok\n-->\n--> upgrade\n--> install\n--> Direct install\n--> Let's go!.\n\nPress 'Enter' when you've done it."
    echo -e "\nNow phone should be rooted, you can verify it with \"Root Checker\" app."
    sleep 4
    echo "rooted" >> "Report.txt"
  fi
fi
sleep 1

;;
*)
exit 0
;;
esac
fi

Third phase, Kali NH installation

if [[ $configured == true && $rooted == true ]]; then
file_NH="$(find -type f -name "$file_NH")"
if [[ $file_NH =~ "./" ]]; then file_NH=${file_NH:2:${#file_NH}}; fi

if [[ ! ${Report[@]} =~ "nethun,OK" ]]; then
if [[ -e "$fileNH" ]]; then
echo -e "\nKali NetHunter 11 image present, OK..."
sleep 1
else
echo "Downloading Kali NetHunter 11 image."
#wget 'https://web.archive.org/web/20150302130830if
/http://builds.cyngn.com/factory/bacon/cm-11.0-XNPH44S-bacon-signed-fastboot.zip'
if [[ ! -e "$file_NH" ]]; then
echo "Download failed, aborting flash!"
exit 1
fi
fi
echo "Checking shasum..."
#if [[ $(cut -d ' ' -f1 <<< "$(shasum -a 256 -b "$file_NH")") != "" ]]; then

echo "File result corrupted, aborting flash!"

#  exit 1
#fi
echo "SHA256 result valid..."
echo "nethun,OK" >> "Report.txt"

elif [[ ! ${Report[@]} =~ "flashedall" ]]; then
echo -e "\nKali NetHunter 11 image present, OK..."
sleep 1
fi
if [[ ! ${Report[@]} =~ "flashedall" ]]; then
echo -e "\n$(tput bold)Phone result configured, rooted and ready for Kali Nethunter installation\nPress 'Enter' when you are ready.$(tput sgr0)"
Input 100

GetMode
if [[ $mode == "adb" ]]; then
  adb reboot recovery
  echo "Wait, rebooting to recovery mode..."
  sleep 35
fi

GetMode
if [[ $mode == "recovery" ]]; then
  echo -e "$(tput bold)Start flashing Kali Nethunter, if every bit flashed goes in the\nright place, it will take not less than a half hour to finish.\n$(tput sgr0)"
  adb push $file_NH /sdcard/Download/nh-11.zip
  device=""
  while read -r "line"; do
    if [[ $device != "" ]]; then device+="$line"; else device="$line"; fi
    [[ $line =~ "ERROR" ]] &&
    {
      echo "An error occured flashing Kali NetHunter 11, aborting!"
      sleep 2
      exit 1
    }
    [[ $line != "" ]] &&
    {
      tput ed
        echo "Be patient, flashing."
        sleep 0.2
        tput cuu 1; tput ed
        sleep 0.2
        echo "Be patient, flashing.."
        sleep 0.5
        tput cuu 1; tput ed
        echo "Be patient, flashing..."
        tput cuu 1
    }
  done < <(adb shell 'twrp install /sdcard/Download/nh-11.zip')
  echo -e "\n\n$(tput bold)Finished flashing Kali Nethunter 11, rebooting...$(tput sgr0)"
  echo "flashedall" >> "Report.txt"
  adb reboot
  sleep 1
  exit 0
else
  echo -e "Please set phone to recovery mode (Buttons: Power + Volume-Up) then restart script.\n"
  exit 1
fi

else
echo -e "\nKali NetHunter 11 result flashed."
fi
fi
if [[ $configured == true && $rooted == true && ${Report[@]} =~ "nethun,OK" ]]; then
echo -e "Would you like to wipe the phone?\nAll data/partitions will be lost. (Y/n)\n"
read -t 70 choice
case $choice in
y | Y)
WipePhone
;;
esac
if [[ $choice == "" ]]; then
echo "Timeout..."
fi
fi

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2026-02-18 21:08 pregnol New Issue