-
Notifications
You must be signed in to change notification settings - Fork 2
/
npft
215 lines (199 loc) · 7.8 KB
/
npft
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
#!/bin/bash
PORT=/dev/ttyUSB0;
Partitions()
{
echo "All partitions:
1) sbl1 14) cmnlib64 27) modemst1 40) mcfg
2) sbl1bak 15) cmnlib64bak 28) modemst2 41) apdp
3) rpm 16) keymaster 29) misc 42) msadp
4) rpmbak 17) keymasterbak 30) batweak 43) dpo
5) tz 18) aboot 31) cache 44) logdump
6) tzbak 19) abootbak 32) sec 45) ztecfg
7) devcfg 20) boot 33) keystore 46) fsg
8) devcfgbak 21) recovery 34) config 47) devinfo
9) dsp 22) modem 35) oem 48) splash
10) DDR 23) factory 36) mota 49) fingerid
11) limits 24) ssd 37) dip 50) system
12) cmnlib 25) fsc 38) mdtp 51) vendor
13) cmnlibbak 26) persist 39) syscfg 52) userdata"
}
PORT_Search()
{
echo "Diagnostic port : "$PORT" : Seaching..."
while [ ! -c $PORT ]
do
sleep 1
done
echo "Diagnostic port : "$PORT" : Done!"
echo "Your port: "$PORT
}
VER="1.6"
while [[ $menu != 11 ]]
do
echo "PFT Linux v"$VER" by Zalexanninev15"
echo
echo "************************************"
echo "* *"
echo "* Choose a command: *"
echo "* *"
echo "* 1) DFU 👉️ EDL *"
echo "* 2) ADB 👉️ EDL *"
echo "* 3) Search Diagnostic port *"
echo "* *"
echo "* 4) All partitions *"
echo "* 5) Dump partition *"
echo "* 6) Flash partition *"
echo "* 7) Dump of all partitions *"
echo "* *"
echo "* 8) Stop ModemManager *"
echo "*(for more stable work in EDL mode)*"
echo "* 9) Add user to \"dialout\" group *"
echo "* *"
echo "* 10) Disable Google FRP *"
echo "* 11) Exit *"
echo "* *"
echo "************************************"
read menu
echo
if [[ $menu = 1 ]]
then
echo "DFU 👉️ EDL"
emmcdl -p $PORT -raw 0xFE
echo "OK!"
fi
if [[ $menu = 2 ]]
then
echo "ADB 👉️ EDL"
adb reboot edl
echo "OK!"
fi
if [[ $menu = 3 ]]
then
echo "You have a "$PORT" ? (Seach/No(I have other port))"
read SN
if [[ $SN = S || $SN = s ]]
then
PORT_Search;
fi
if [[ $SN = N || $SN = n ]]
then
echo "Please, write your ttyUSB* - where * is the number (usually \"0\") that you need to enter:"
read PORTN
PORT="/dev/ttyUSB"$PORTN
PORT_Search;
fi
fi
if [[ $menu = 4 ]]
then
Partitions;
fi
if [[ $menu = 5 ]]
then
echo "Write name of partition (also called file without extension) from item \"3\":"
read PAR
echo "===============Summary==============="
echo "Action = Dump partition"
echo "Partition = "$PAR
echo "File = files/"$PAR"_bak.bin"
echo "Diagnostic port = "$PORT
echo "MBN file = tools/emmc.mbn"
read -r -p '-- Press Enter to continue --'
emmcdl -p $PORT -f tools/emmc.mbn -d $PAR -o files/${PAR}_bak.bin
fi
if [[ $menu = 6 ]]
then
echo "Write name of partition (also called file without extension) from item \"3\":"
read PAR
echo "===============Summary==============="
echo "Action = Flash partition"
echo "Partition = "$PAR
echo "File = files/"$PAR".bin"
echo "Diagnostic port = "$PORT
echo "MBN file = tools/emmc.mbn"
read -r -p '-- Press Enter to continue --'
emmcdl -p $PORT -f tools/emmc.mbn -b $par files/${PAR}.bin
fi
if [[ $menu = 7 ]]
then
echo "===============Summary==============="
echo "Action = Dump of all partitions"
echo "Partition = "$PAR
echo "File = files/"$PAR".bin"
echo "Diagnostic port = "$PORT
echo "MBN file = tools/emmc.mbn"
read -r -p '-- Press Enter to continue --'
emmcdl -p $PORT -f tools/emmc.mbn -d boot -o files/boot_bak.bin #
emmcdl -p $PORT -f tools/emmc.mbn -d aboot -o files/aboot_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d modem -o files/modem_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d oem -o files/oem_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d abootbak -o files/abootbak_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d apdp -o files/apdp_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d batweak -o files/batweak_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d cache -o files/cache_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d cmnlib -o files/cmnlib_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d cmnlib64 -o files/cmnlib64_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d cmnlibbak -o files/cmnlibbak_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d config -o files/config_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d DDR -o files/DDR_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d recovery -o files/recovery_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d vendor -o files/vendor_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d devcfg -o files/devcfg_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d devcfgbak -o files/devcfgbak_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d devinfo -o files/devinfo_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d factory -o files/factory_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d keymaster -o files/keymaster_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d dip -o files/dip_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d dpo -o files/dpo_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d dsp -o files/dsp_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d fingerid -o files/fingerid_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d fsc -o files/fsc_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d fsg -o files/fsg_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d keymasterbak -o files/keymasterbak_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d keystore -o files/keystore_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d limits -o files/limits_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d ztecfg -o files/ztecfg_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d tzbak -o files/tzbak_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d logdump -o files/logdump_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d mcfg -o files/mcfg_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d mdtp -o files/mdtp_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d misc -o files/misc_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d modemst1 -o files/modemst1_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d modemst2 -o files/modemst2_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d mota -o files/mota_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d msadp -o files/msadp_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d rpm -o files/rpm_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d rpmbak -o files/rpmbak_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d persist -o files/persist_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d sbl1 -o files/sbl1_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d sbl1bak -o files/sbl1bak_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d splash -o files/splash_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d sec -o files/sec_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d ssd -o files/ssd_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d syscfg -o files/syscfg_bak.bin
emmcdl -p $PORT -f tools/emmc.mbn -d tz -o files/tz_bak.bin
fi
if [[ $menu = 8 ]]
then
echo "Please, write your password for stop ModemManager:"
sudo systemctl stop ModemManager
echo "OK!"
fi
if [[ $menu = 9 ]]
then
echo "Add user to \"dialout\" group"
sudo adduser ${LOGNAME:-$USER} dialout
echo "Re-login please"
fi
if [[ $menu = 10 ]]
then
echo "===============Summary==============="
echo "Action = Disable Google FRP"
echo "Diagnostic port = "$PORT
echo "MBN file = tools/emmc.mbn"
read -r -p '-- Press Enter to continue --'
emmcdl.exe -p $PORT -f tools/emmc.mbn -e config
fi
echo
read -r -p '-- Press Enter to continue --'
echo
done