forked from jareddantis/unbrick_8960
-
Notifications
You must be signed in to change notification settings - Fork 0
/
basefix.sh
78 lines (68 loc) · 3.66 KB
/
basefix.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
# SHV-E160L 'baseband unknown' repair file
# Only possible with the help of XDA forum members, Mostly E:V:A for the Baseband fix, he reminded me that I have two
# chains of trust in this SoC based device, one for the AP (application Processor) and one for the CP (Communication Processor)
# Tested Only ON SHV-E160L device but may work for other Qualcomm devices, replace the loaders with the correct ones for you device
# Samsung partition only, HTC has differing partition information
# see brixfix.sh for more info
# there are many reasons why you may have the baseband unknown failure, this fix is for a particular error on my SHV-E160L
# that i have tried to document on
# http://forum.xda-developers.com/showthread.php?t=1914359
# please be aware of the dangers beefore using this file
# if you have your own recovery option installed and it supports ADB the you dont need to install the included recovery option
# *#06# does not seem to work in this device
# see shv-e160l-dial-codes.txt for alternatives
# included are ODIN recovery flash, Recovery mode flash update, dialer code, boot chain, adb for linux & windows
# please make sure you have all the other required files.
# WARNINGS
# This script can brick a device beyond software access repair, JTAG would be required or you need to find the EMMCBOOT resistor and short the low
# side to ground
mkdir backup
# for windows use md backup
# md backup
#back-up script
echo "Backing up Bootloaders"
echo
echo " if any of the following fail with errors do no reboot your device, correct the error and re-execute"
echo
adb shell dd if=/dev/block/mmcblk0p2 of=/sdcard/sbl1.mbn bs=512
adb pull /sdcard/sbl1.mbn backup/sbl1.mbn
adb shell dd if=/dev/block/mmcblk0p3 of=/sdcard/sbl2.mbn bs=512
adb pull /sdcard/sbl2.mbn backup/sbl2.mbn
adb shell dd if=/dev/block/mmcblk0p5 of=/sdcard/rpm.mbn bs=512
adb pull /sdcard/rpm.mbn backup/rpm.mbn
adb shell dd if=/dev/block/mmcblk0p6 of=/sdcard/sbl3.mbn bs=512
adb pull /sdcard/sbl3.mbn backup/sbl3.mbn
adb shell dd if=/dev/block/mmcblk0p7 of=/sdcard/aboot.mbn bs=512
adb pull /sdcard/aboot.mbn backup/aboot.mbn
adb shell dd if=/dev/block/mmcblk0p9 of=/sdcard/tz.mbn bs=512
adb pull /sdcard/sbl1.mbn backup/tz.mbn
#push bootloaders to device
echo "Copying bootloaders to device - /sdcard/"
echo
echo
adb push SHV-E160L/sbl1.mbn /sdcard/sbl1.mbn
adb push SHV-E160L/sbl2.mbn /sdcard/sbl2.mbn
adb push SHV-E160L/rpm.mbn /sdcard/rpm.mbn
adb push SHV-E160L/sbl3.mbn /sdcard/sbl3.mbn
# dont restore aboot.mbn but it's listed here for completeness
# adb push SHV-E160L/aboot.mbn /sdcard/aboot.mbn
adb push SHV-E160L/tz.mbn /sdcard/tz.mbn
# exit here if user not removed the exit code, user must read and understand documentation
# remove the following exit line after you confirmed the above has work without error
#exit
#restore
echo
echo "Copying Bootloaders to MMC"
echo " Restoring Chain of trust"
adb shell dd if=/sdcard/sbl1.mbn of=/dev/block/mmcblk0p2 bs=512
adb shell dd if=/sdcard/sbl2.mbn of=/dev/block/mmcblk0p3 bs=512
adb shell dd if=/sdcard/rpm.mbn of=/dev/block/mmcblk0p5 bs=512
adb shell dd if=/sdcard/sbl3.mbn of=/dev/block/mmcblk0p6 bs=512
# dont restore aboot.mbn but it's listed here for completeness
# adb shell dd if=/sdcard/aboot.mbn of=/dev/block/mmcblk0p7 bs=512
adb shell dd if=/sdcard/tz.mbn of=/dev/block/mmcblk0p9 bs=512
echo
echo "Restore complete, "
echo "if any error occurs please resolve the error and re-execute this script, dont reboot the phone or you could "
echo "end with a bootloop or worse a hang before aboot.mbn (little kernel/download mode loader) is executed and odin mode is activated"
echo "the hang will require JTAG or a hardware mod to reactivate QDload mode, you will then need to run brixfix.sh "