-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
358 lines (225 loc) · 9.12 KB
/
README
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
___ ____ _
/ _ \ _ __ ___| _ \| |_ _ ___
| | | | '_ \ / _ \ |_) | | | | / __|
| |_| | | | | __/ __/| | |_| \__ \
\___/|_| |_|\___|_| |_|\__,_|___/
_____ _____ ____
|___ |_ _| _ \ _ __ ___
/ / | | | |_) | '__/ _ \
/ / | | | __/| | | (_) |
/_/ |_| |_| |_| \___/
This tutorial explains how to root, unroot, and update a rooted OnePlus 7T Pro phone.
#-----------------------------------
SETUP
#-----------------------------------
- Follow this guide for setting up adb on the PC:
https://www.androidauthority.com/lineageos-install-guide-893303/
- Should have this downloaded and unzipped:
platform-tools_r33.0.1-linux.zip
- Download these files and link if switching to LineageOS:
RECOVERY.img -> lineage-18.1-20220412-recovery-hotdog.img
LINEAGE.zip -> lineage-18.1-20220412-nightly-hotdog-signed.zip
GAPPS.zip -> MindTheGapps-11.0.0-arm64-20220217_100228.zip
TWRP.img -> twrp-3.6.1_11-0-hotdog.img # Probably not needed.
- Create folder: COPY_TO_DOWNLOADS and add to it:
app-debug.apk (Magisk) from https://raw.githubusercontent.com/topjohnwu/magisk-files/canary/app-debug.apk
boot -> ../STOCK/images/latest/boot.img
safetynet-fix-v2.2.1.zip from https://github.com/kdrag0n/safetynet-fix/releases/tag/v2.2.0
- Stock Rom:
- Download:
https://www.oneplus.com/global/support/softwareupgrade/details?code=PM1574162297465
- Unzip using:
payload-dumper-go_1.2.0_linux_amd64/payload-dumper-go
- Copy extracted folder to:
STOCK/images/OnePlus7TProOxygen_14.O.32_OTA_0320/
- Create links to latest stock build:
A11.0.6.1 -> OnePlus7TProOxygen_14.O.32_OTA_0320
latest -> A11.0.6.1
#-----------------------------------
Custom ROM
#-----------------------------------
This will change to a custom ROM (LineageOS):
https://wiki.lineageos.org/devices/hotdog/#supported-models
#-----------------------------------
RESTORE/ROOT
#-----------------------------------
This will restore OnePlus 7T Pro to Stock Rom
(Optionally Root):
- Create boot.img patch file (If rooting):
https://forum.xda-developers.com/t/working-safetynet-with-pixel-6-pro-android-12.4354149/
- Use Magisk to create magisk_patched-*.img from boot.img
- Copy patch file to STOCK/images/latest/
- Flash the stock ROM (OOS latest version)
cd STOCK
adb reboot fastboot
fastboot devices
FLASH_STOCK.sh # --slot=all only works when in recovery->fastboot
- Do a full factory reset through the TWRP recovery # Optional?
fastboot boot TWRP.img
# Wipe -> All options.
- Flash stock boot.img
adb reboot fastboot
fastboot flash --slot=all boot images/latest/boot.img
- Flash custom boot (If rooting):
ROOT.sh
- Again enter recovery mode in stock recovery. Do a full wipe.
fastboot reboot recovery
# Wipe -> All options.
- Now lock the bootloader (unless rooting): # Do not lock if rooting!
fastboot oem lock --skip-reboot
- Reboot to enter stock recovery and wipe all again
fastboot reboot recovery
# Wipe -> All options.
- Reboot
This may require a factory reset if you get put into 'Data may be corrupted'
- Additional setup (if rooting):
- Copy 'COPY_TO_DOWNLOADS' to downloads folder on the phone.
- Install Magisk apk on the phone.
- Open Magisk -> Go to Install > Install and click on Direct Install.
- Click button to finish setup (which will also reboot the phone).
- Pass SafetyNet Checks:
- Magisk -> Direct Install -> safetynet-fix-v2.2.1.zip
- Magisk -> Settings -> enable Zygisk
- Magisk -> Settings -> Enforce DenyList
- Show system apps.
- Select: Google Pay.
- Select: Google Play Store.
- Select: (Banking apps).
- Magisk -> Settings -> Hide the Magisk app.
- Reboot your device and test SafetyNet with an app like YASNAC
- Clear app data for "Play Store"
#-----------------------------------
UPDATE
#-----------------------------------
How to install OTA update and keep root:
- https://nerdschalk.com/oneplus-7t-pro-root/
- https://forum.xda-developers.com/t/update-to-latest-firmware-ota-update-without-losing-magisk-root-permissions.4233391/
- https://topjohnwu.github.io/Magisk/ota.html
- https://forum.xda-developers.com/conversations/welcome-to-xda.14668127/#convMessage-14988935
- https://forum.xda-developers.com/t/root-android-11-latest-stock-and-patched-imgs-payload-dumper-magisk_patched-guides.4175033/
SUMMARY:
- Disable Automatic system updates:
Settings
-> System
-> Developer Options
-> Automatic system updates
(Uncheck it)
- Disable all Magisk modules.
- Reboot.
Settings
-> System update
-> Download & Update
- This is just to have a copy of the update
(incase future updates fail):
- Backup the OTA update file which is found
here on the phone:
Internal/.Ota
- Copy back to PC (do not unzip it):
STOCK/images/OnePlus7TProOxygen_14.O.33_OTA_0330.zip
- Extract images:
../../payload-dumper-go One*.zip
- Rename extracted folder:
mv extracted* OnePlus7TProOxygen_14.O.33_OTA_0330
- Link new version:
A11.0.7.1 -> OnePlus7TProOxygen_14.O.33_OTA_0330
latest -> A11.0.7.1
- Copy boot.img back to the phone.
- Patch boot.img:
Magisk
-> Install
-> "Select and Patch a File"
- Copy patched file back to the PC:
STOCK/images/latest/
- Continue with normal update:
Settings
-> System Update
-> Click "Install Now"
- Wait for the update to be installed.
- !!! DO NOT REBOOT !!!
- Open Magisk.
- Run Magisk post-installer:
Magisk Manager
-> Install
-> Install/Inactive Slot (After OTA).
(Acknowledge warning)
- Reboot.
- Enable Magisk modules again.
- Check SafetyNet checks.
- Add star to github repo ;)
#-----------------------------------
Custom ROM - LineageOS
#-----------------------------------
These steps should help to install LineageOS:
(Ended up reverting due to screen flicker).
XDA LineageOS Page:
- https://xdaforums.com/t/rom-official-14-lineageos-21-for-oneplus-7t-pro-hotdog.4648947/
Gapps Download:
- https://wiki.lineageos.org/gapps
- Click LineageOS 21 (Android 14) ARM64 (Download Mind*).
Restore to Stock OS (follow instruction in an above section).
Make sure these commands are already installed:
adb devices
fastboot -h
- https://wiki.lineageos.org/adb_fastboot_guide
Unlock the bootloader.
adb -d reboot bootloader
fastboot devices
fastboot oem unlock
Flash extra partitions:
fastboot flash dtbo dtbo.img
fastboot flash vbmeta vbmeta.img
Flash lineage recovery:
adb -d reboot bootloader
fastboot devices
fastboot flash recovery recovery.img
Install LineageOS zip:
adb -d reboot reovery
- Do "Factory reset/format data"
- Enable ADB.
- Apply Update -> Apply from ADB
adb -d sideload lineage-*.zip
- Confirm to reboot.
Install Google Apps:
- Enable ADB.
- Apply Update -> Apply from ADB
adb -d sideload Mind*.zip
(Signature verification will fail)
#-----------------------------------
Clean Partitions
#-----------------------------------
https://rootmygalaxy.net/fix-remote-not-enough-space-to-resize-partition/
https://xdaforums.com/t/fastboot-invalid-sparse-file-format-at-header-magic-how-to-fix.4281719/
adb reboot fastboot
fastboot boot RECOVERY.img
# Get all fastboot variables:
fastboot getvar all
# Delete product partition
fastboot delete-logical-partition product_a
#-----------------------------------
QUALCOMM CrashDump Mode
#-----------------------------------
Bricked! - Not really.
Press and hold volume Up and Power buttons for 8 seconds.
Once shutdown:
Press and hold Volume down and power.
Once seeing the logo, release just the power button.
#-----------------------------------
Errors / Warnings
#-----------------------------------
Warning: "Spare file format at header magic"
Comment: "That warning is normal"
Current image boot/recovery have been destroyed
and can not boot.
"Writing 'odm_b' FAILED (remote: 'No such file or directory'"
fastboot delete-logical-partition odm_b
fastboot create-logical-partition odm_b 1000
fastboot flash --slot=b odm images/latest/odm.img
#-----------------------------------
Backup
#-----------------------------------
I did system update and would like to backup boot.img file.
adb root
adb shell
su
dd if=/dev/block/bootdevice/by-name/boot of=/sdcard/boot.img
Can patch that file (boot.img) on the phone.