Minimal install without Google - OnePlus 8 Pro Questions & Answers

Hi, I have an OnePlus 8 Pro coming from iOS. I've never had an Android device before except my eReader and I haven't customised that in any way since I just read books on it so I'm a complete noob.
I would like to get myself a minimal installation of Android without any bloat or Google services, instead I want MicroG + Aurora Store and F-Droid.
I have a few ideas on what to do:
Installing some precompiled GSI
Compiling AOSP from source
Compiling GSI from source
I've tried installing precompiled GSI from git hub.c0m/phhusson/treble_experimentations/releases aswell as from Google with the instructions provided here source.and roid.c0m/setup/build/gsi
Code:
Boot to fastboot mode and unlock the bootloader. The devices supporting fastbootd also need to boot into fastbootd by:
$ fastboot reboot fastboot
Disable verify boot (AVB) by flashing vbmeta.img:
$ fastboot --disable-verification flash vbmeta vbmeta.img
Erase and flash the GSI to the system partition:
$ fastboot erase system
$ fastboot flash system system.img
Wipe the user data and clear the data from other necessary partitions (for example, user data and system partitions):
$ fastboot -w
Reboot:
$ fastboot reboot
but I get stuck on the boot screen.
I use arm64 a/b vanilla images. Could anyone share image link + installation instructions if they've gotten it to work? I prefer dumb-proof instructions, especially when my stuff doesn't work.
I haven't tried compiling AOSP because I want some kind of confirmation of it working for other people before I try. I've heard that you just download the source and then add some vendor stuff in the manifest but I rather just use something precompiled first, and then compile something myself after I've tried the DeGoogled experience so I don't end up spending hours on something I don't even like. (Tinkering is fun but getting compilation errors is not).

Just use xXx NoLimits all the crap from Google is turned off, you can disable the lot if you need to. Check in the thread for details.

Related

[HOW-TO] Return to Factory Stock using fastboot commands

DISCLAIMER: I am not responsible for what you do to your tablet. I've done these steps dozens of times without issue on Windows and Linux. PLEASE READ THIS ENTIRE THREAD FIRST TO UNDERSTAND IT BEFORE ACTUALLY PERFORMING THEM ON YOUR DEVICE!!!
This is done using the Android SDK, the command incorporated in that called fastboot. No toolkit, I don't do them, never have, so I cannot support anyone trying anything from a toolkit. Doing this process will take you from start to finish no more than two minutes.
I haven't seen a "How-To" on returning to 100% out-of-the-box stock using fastboot commands and Google's factory N7 2013 images. If I've overlooked this, I apologize in advance. I've seen a lot of people asking how to do this in the forums, so I thought this may help.
This will work on Linux or Windows. I use Windows 7 x64 for work, Linux Mint 15 x64 otherwise. With Linux you will need to add permissions for the USB device in /etc/udev/rules.d. I had to do this on my Linux Mint 15 x64 laptop, you may not. If you get an error stating something to the effect of "insufficient permissions...", you'll want to Google "android udev rules setup". I won't cover that here.
This guide should work for the LTE N7 2013, but I don't have one to test.
Before we begin, back up anything on your internal /sdcard partition you want saved. This will 100% wipe your device to what it was when you first unboxed it. I warned you. You'll be erasing everything, and it will be reloaded. Stock Android recovery will be loaded, and you will not be rooted.
What you'll need:
Android SDK - specifically fastboot working
Google factory images from here.
Unlocked Nexus 7 tablet
Here we go (this will be based off of the N7 2013 Wifi-only device, JSS15R image):
1. Extract from the compressed image from the .tgz/.tar, you'll want to extract the folder called razor-jss15r. Extract this folder to your SDK/platform-tools location. My SDK is on my C:\, so my path to it on Windows is C:\sdk\platform-tools. Linux it would be at /home/ryan/sdk/platform-tools. Once extracted, you should have a folder called: razor-jss15r. There should be 5 files in there, 1 is a zipped folder called image-razor-jss15r.zip. DON'T UNZIP IT!
2. Open command prompt, and change directories to your SDK/platform-tools location. Boot your tablet to the bootloader, and plug it into your computer. We're ready to issue commands now.
3. After each command, hit Enter. I'm not going to state that to make sure people don't get confused. Each line is it's own command. I recommend copy then pasting each command below, one by one, into the command prompt window.
Code:
fastboot erase boot
Code:
fastboot erase cache
Code:
fastboot erase recovery
Code:
fastboot erase system
Code:
fastboot erase userdata
Code:
fastboot flash bootloader razor-krt16o/bootloader-flo-flo-03.14.img
Code:
fastboot reboot-bootloader
Code:
fastboot -w update razor-krt16o/image-razor-krt16o.zip
NOTE: You can remove the -w in the above to prevent internal sdcard from getting wiped.
After the last command, the tablet will automatically reboot itself.
Go through setup, hook up the device to your computer and copy anything you'd like on your device, I recommend a SuperSU flashable zip if you want to root. Download a custom recovery image, and place it into your SDK\platform-tools folder. You can then boot back into the bootloader and flash the custom recovery of your choice (fastboot flash recovery recoveryfilename.img). At that point you can reboot into that custom recovery, and flash the SuperSU zip to have root. Reboot. Done.
Some of the commands may take up to 30 seconds or so, just let them run. The ones that will take that time are erasing system and userdata, and the last command will take time.
OPTIONAL:
If you want to re-lock your bootloader, which is usually ONLY done if you are returning for warranty purposes (and WILL erase your internal sdcard!), boot back to the bootloader and run:
Code:
fastboot oem lock
RMarkwald said:
Code:
fastboot -w update razor-jss15r/image-razor-jss15r.zip
Click to expand...
Click to collapse
If you omit the -w from this step, doesn't it leave your sdcard intact?
Possibly I don't actually know as I've never run it without the -w.
- Sent from my Galaxy S3
meekrawb said:
If you omit the -w from this step, doesn't it leave your sdcard intact?
Click to expand...
Click to collapse
Yes, that is correct.
Updated for Android 4.4 krt16o images.

[OOS] darkware : full_vendor + building github_debug + unbricking + parted_sd*

I use Q/A so users can bring up useful info-tech 'live', whatever they found.
After building OOS from github, the fastboot-ed [_debug].img stuck on 'ANDROID' silver bootlogo, with adb log working. In case some want to help debugging, all [_debug].img are uploaded to AFH; the purpose is to provide a clean (1.5GB sparse image) OOSrom without Gapps & Addons, and with minimal patches like MicroG/host/...
Code:
out/target/product/msm8998/msm8998-ota-eng.nn.zip
(& make otapackage always failed.)
Thx to @regalstreak for UltraCAF _repo.
The complete OP5 vendor are zipped; I noticed that vendor on various op5' github were missing (a very) few files; so you can meld with yours: boot in twrp and mount system +mtp for complete extraction https://github.com/OnePlusOSS/android/blob/oneplus/QC8998_N_7.1/pull_library.sh .
Attached op5PARTED.txt for full info on OP5 partitions; abl.elf(edk2) is "auto motive bootloader" ? (like Samsung s8) and differs from emmc_appsboot.mbn (like OP3T 'LittleKernel')
Unbricking : WIP (rawprogram_.xml...)
- uncertified Playstore : clean Playstore.apk's via /Setting /Apps /AppInfo /Storage data &cache + /force stop
- Magisk SafetyNet error : reflash OOS4.5.x.zip+magisk.zip+wipe cache/Dalvik
If you can't correct wrong Playstore and Magisk SafetyNet
http://oxygenos.oneplus.net.s3.amazonaws.com/OP5_recovery.img​
0) reflash FIRST official Oneplus5 Recovery : OP5_recovery.img
1_r) check twice that official OP5_recovery.img is effective : boot into recovery and use option reboot to recovery...
2_r) use recovery's option to wipe: all 3 possibilities
3_r) use recovery's option to reboot to bootloader
4_b) fastboot oem lock ...& reboot to bootloader
5_b) fastboot oem unlock ...& reboot to bootloader
6_b) fastboot erase boot + fastboot erase system + fastboot erase userdata + fastboot erase cache
7_b) fastboot boot recovery OP5_recovery.img
8_r) use recovery's option to sideload
9_r) adb sideload official OnePlus5Oxygen'_..._...'.zip
10_r) check that it failed to 0 received data
11_r) use recovery's option to wipe: all 3 possibilities then repeat 8) 9)
11.8_r) use recovery's option to sideload
11.9_r) adb sideload official OnePlus5Oxygen'_..._...'.zip
You should now see working sideload with % ; wait to 100% and reboot to CLEAN OOS
If you want to proceed Magisk SafetyNet ok with certified Playstore, ALWAYS ONLY USE OFFICIAL TWRP.
Nota, for info, rawprogram4.xml, from op3T rescue files (via Qualcomm QFIL), is attached.
CAUTION : always check your IMEI *#06# and backup: modemst1 (/dev/block/sdf1) + modemst2 (/dev/block/sdf2)
Thanks for the steps ! This was a new learning for me
Thanks ! I Will Test.

[GUIDE] Unlock/Flash/Root for the Pixel 2 XL (taimen)

Introduction
Hello everyone, this is a guide to assist you with customizing your Pixel 2 XL! I will be going over installing fastboot and adb, unlocking your bootloader, how to flash the factory images for clean flashes and upgrades, and how to root. Please feel free to ask any questions if you need clarification. Enjoy!
This information has been distilled from Google's official factory image site and the Magisk thread.
Installing fastboot and adb
Thankfully, Google has provided just adb, fastboot, and systrace as a simple zip file, making this process super easy. You MUST be on at LEAST 26.0.2 for the commands in this guide to work. When in doubt, grab the latest copy and install them using the following instructions.
SDK Platform-Tools for Windows
SDK Platform-Tools for Mac
SDK Platform-Tools for Linux
Windows:
Unzip the folder somewhere on your hard drive.
Go to the folder containing the adb and fastboot files and type "cmd" in the path bar at the top.
A command prompt should open with the current folder showing on the prompt.
Type the following commands:
Code:
adb --version
fastboot --version
You should see some information appear. If that is the case, you were successful!
Mac/Linux:
Unzip the folder somewhere on your hard drive.
Navigate to that folder with your terminal.
Run the following commands:
Code:
sudo install adb dmtracedump e2fsdroid etc1tool fastboot hprof-conv make_f2fs mke2fs mke2fs.conf sload_f2fs sqlite3 /usr/local/bin
sudo mkdir -p /usr/local/lib64
sudo install lib64/libc++.so /usr/local/lib64
Type the following commands:
Code:
adb --version
fastboot --version
You should see the version information, along with telling you they are installed to /usr/local/bin. If so, you were successful!
Unlocking the bootloader
WARNING: This WILL wipe your entire phone. Please make copies or backups of any important data. This can also go wrong rendering your device inoperable. Proceed with caution.
On your phone, open Settings, navigate to "System" then "About phone", and tap on the build number 7 times.
Go one menu up, click on "Developer options", and turn on USB debugging and OEM unlocking.
In your terminal, type the following command:
Code:
adb reboot bootloader
Next, decide if you want to do a standard unlock or critical unlock. A critical unlock allows you to directly flash bootloader files, otherwise you will get an error when you try to do so.
Depending on what you decided in the previous step, run the following commands:
Code:
fastboot flashing unlock
(OPTIONAL)
Code:
fastboot flashing unlock_critical
Follow the prompts on your device then reboot!
Flashing factory images
NOTE #1: If you have mounted /system as rw at any point (like in TWRP), you must upgrade using the factory image method. OTAs will fail because they cannot verify the integrity of the disk since its verity data has been changed.
NOTE #2: Flashing the factory images requires an unlocked bootloader. Flashing the OTA zips does not (but if anything goes wrong, you may not be able to recover without an RMA).
Updating to a new release (factory image):
Download the latest factory image from Google's website.
Reboot into the bootloader:
Code:
adb reboot bootloader
Unzip the factory image.
Inside you will see a bootloader image, a radio image, an image zip file, and a couple of flash scripts.
If you are on Windows, open the "flash-all.bat" file in a text editor. If you are on Mac or Linux, open the "flash-all.sh" instead.
Remove the "-w" flag before the fastboot command towards the end of the file. This will prevent fastboot from formatting your device.
Run the flash all script! Open a command prompt, navigate to the folder with the script, and run one of the following commands:
Windows:
Code:
flash-all
Mac/Linux:
Code:
./flash-all.sh
Reboot once it is finished!
Updating to a new release (OTA zip):
Download the latest OTA zip from Google's website
Reboot into recovery:
Code:
adb reboot recovery
Hold down the power button and push volume up
Select "Apply update from ADB"
Run the following command from the folder containing the OTA zip:
Code:
adb sideload <zip_name>.zip
Reboot once it is finished!
Clean flashing a factory image (wipe everything):
Download the latest factory image from Google's website
Reboot into the bootloader:
Code:
adb reboot bootloader
Unzip the factory image.
Run the flash all script! Open a command prompt, navigate to the folder with the script, and run one of the following commands:
Windows:
Code:
flash-all
Mac/Linux:
Code:
./flash-all.sh
Reboot once it is finished!
Rooting with Magisk
NOTE #4: This section assumes you are not going to install TWRP. If you are, skip to the next section and just flash the latest Magisk zip after installing TWRP.
Download the Magisk zip from the official thread and install the manager from the zip.
Grab a boot image to patch (either the one from the latest factory image or a custom kernel one) and push it to your device:
Code:
adb push <path_to_file> /sdcard/Download
Open Magisk Manager and click the Install button.
Click "Install" at the first prompt then choose "Patch Boot Image File". A file manager will pop up.
Select the boot image you want to patch and let Magisk Manager patch it.
Pull it off your device:
Code:
adb pull /sdcard/MagiskManager/patched_boot.img
Reboot into the bootloader:
Code:
adb reboot bootloader
Flash the boot image and reboot.
Code:
fastboot flash boot patched_boot.img
fastboot reboot
Open Magisk Manager and you should be rooted!
Installing TWRP
NOTE #5: If you just want to temporarily boot TWRP to flash Magisk and your custom kernel, you can just skip flashing the installer zip in this process.
NOTE #6: TWRP can be unstable at times given the way that security has been set up on this device (lack of decryption, failing to boot, etc).
Download both the TWRP image and zip installer from the official site.
Temporarily boot the TWRP image.
Code:
fastboot boot <path_to_twrp_image>
Flash the TWRP installer zip.
Reinstall Magisk and your custom kernel if you had them.
Reboot and profit!
Common issues
Outdated fastboot/adb: This device requires the latest fastboot and adb binaries to work properly. A lot of common quick adb/fastboot installation guides link to installers that are old. Please manually install the latest using the information at the beginning of the thread!
Using a USB-3.0 or USB-C port: Some newer USB ports do not work with fastboot. Issues manifest as weird errors during a flash. Use a different USB cable/port.
Closing statements
If there are any procedures you would like to see added (like flashing a custom kernel or booting TWRP), I am happy to add them if requested. Also, when requesting help, please be as specific as possible where you get confused. I want this guide to be clear as possible.
Reserved
Reserved
Thanks @nathanchance I've been trying to keep track of things to do once my taimen ships, and I've been waiting on a "how-to" post. Thanks again!
Thanks so much for your efforts. These are much appreciated. Just what we needed for Pixel 2 XL.
One can only hope that we eventually get SU Root, TWRP and Custom ROMs. The Pixel 1 XL's development was disappointing. Hopefully this phone has more.
To Ubuntu users: the
Code:
android-tools-adb
android-tools-fastboot
packages won't necessarily work. The fastboot from the repos didn't have the same options as the one from the zip from Google. So if you are getting a usage dialog after running fastboot, that is why.
Thank you ninja!
The boss is back. Thanks for the guide man
followed from the nexus 6p threads, waiting for TWRP to get stable and then it's on!
I always took the noobish method and used twrp...
If my device is bootloader unlocked and in developer mode, and in a chance I am stuck in a bootloop, can I fastboot adb the stock image and be back up and running?
Question is: with fastboot enabled, can I recover if I F up installing magisk/root?
Mods...please make this thread a sticky:good:
pvtjoker42 said:
followed from the nexus 6p threads, waiting for TWRP to get stable and then it's on!
Click to expand...
Click to collapse
That's exactly what I'm doing. Waiting for TWRP, then I will buy the pixel. 6P is working perfect at the moment, after a battery replacement.
pvtjoker42 said:
followed from the nexus 6p threads, waiting for TWRP to get stable and then it's on!
Click to expand...
Click to collapse
choder said:
That's exactly what I'm doing. Waiting for TWRP, then I will buy the pixel. 6P is working perfect at the moment, after a battery replacement.
Click to expand...
Click to collapse
Not to sound pessimistic but if that's what you are waiting for, you'll probably never get this device lol. Even the Pixel 1's TWRP isn't the most stable thing (it's close but still).
Sent from my Pixel 2 XL using XDA Labs
nathanchance said:
Not to sound pessimistic but if that's what you are waiting for, you'll probably never get this device lol. Even the Pixel 1's TWRP isn't the most stable thing (it's close but still).
Click to expand...
Click to collapse
Oh no So you're saying we might never get a stable TWRP and no good custom ROMs for Pixel 2 XL?
Any idea whether PureNexus or any of the other custom ROMs of Nexus/Pixel will come to Pixel 2 XL?
Based on my experience custom ROMs/Kernels can transform a mid range device to Flagship performance and features. I am using the 2 XL and still within the return window. If it is speculated that this phone will not have much development, then I might as well return it and continue using OG Pixel XL or get a OnePlus. Thanks.
iamjimmy said:
Oh no So you're saying we might never get a stable TWRP and no good custom ROMs for Pixel 2 XL?
Any idea whether PureNexus or any of the other custom ROMs of Nexus/Pixel will come to Pixel 2 XL?
Based on my experience custom ROMs/Kernels can transform a mid range device to Flagship performance and features. I am using the 2 XL and still within the return window. If it is speculated that this phone will not have much development, then I might as well return it and continue using OG Pixel XL or get a OnePlus. Thanks.
Click to expand...
Click to collapse
I'm saying if that is your only deciding factor for owning this device, considering getting another like the OnePlus 5 which has a guarantee of that. TWRP may get stable eventually but it may not. I personally love the kernel source that Google puts out and have been digging stock so I'm comfortable with just root with my kernel. If you aren't, then doing something else may be a good idea.
ROMs may end up coming in the form of images though (like system and boot and such), negating a need for TWRP. We will have to see.
Sent from my Pixel 2 XL using XDA Labs
That's so strange. Why is that? It's a pixel which is the successor to Nexus phones so I'm not sure why the line of phones would have a hard time with twrp and custom ROM flashing.
JDROIDS said:
That's so strange. Why is that? It's a pixel which is the successor to Nexus phones so I'm not sure why the line of phones would have a hard time with twrp and custom ROM flashing.
Click to expand...
Click to collapse
Well few reasons...
1. A/B partitioning makes it so the boot and recovery partition are unified, meaning when you flash a ROM, you need to reflash TWRP.
2. With the Pixel 2 (XL), as stated in the TWRP thread, the secure crypto chip requires a rewrite of some things into Java, which will take time.
The Pixel isn't really a successor to the Nexus line because these are geared purely to consumers. It's Google's iPhone.
Sent from my Pixel 2 XL using XDA Labs
nathanchance said:
I'm saying if that is your only deciding factor for owning this device, considering getting another like the OnePlus 5 which has a guarantee of that. TWRP may get stable eventually but it may not. I personally love the kernel source that Google puts out and have been digging stock so I'm comfortable with just root with my kernel. If you aren't, then doing something else may be a good idea.
ROMs may end up coming in the form of images though (like system and boot and such), negating a need for TWRP. We will have to see.
Sent from my Pixel 2 XL using XDA Labs
Click to expand...
Click to collapse
Thanks for the reply.
That is unfortunate. If we can't have custom Kernels, we miss out on features such as color control, calibration, sound amplication , bluetooth high performance audio, USB fastcharge, vibration strength control and other mods. Will this be developed in any Kernel? I'm assuming it will take a long time (if ever) to get Elemental X, Franco Kernal or anything similar.
Also for Root, I just unlocked my bootloader. If I use the Magdisk Root Manager for Root, is there any way to flash next month's security patch WITHOUT factory reset. With SU root of Pixel XL, it was usually as simple as flashing factory images (without wipe switch) and then flashing SU plus kernel.
For Magdisk, will a full wipe or unroot needed before flashing an update?
iamjimmy said:
Thanks for the reply.
That is unfortunate. If we can't have custom Kernels, we miss out on features such as color control, calibration, sound amplication , bluetooth high performance audio, USB fastcharge, vibration strength control and other mods. Will this be developed in any Kernel? I'm assuming it will take a long time (if ever) to get Elemental X, Franco Kernal or anything similar.
Also for Root, I just unlocked my bootloader. If I use the Magdisk Root Manager for Root, is there any way to flash next month's security patch WITHOUT factory reset. With SU root of Pixel XL, it was usually as simple as flashing factory images (without wipe switch) and then flashing SU plus kernel.
For Magdisk, will a full wipe or unroot needed before flashing an update?
Click to expand...
Click to collapse
Custom kernels will absolutely be a thing on this device. I already have mine publicly available. I haven't looked into external features (and probably won't be able to for a bit as I am rather busy) but they will certainly come.
It's the same process for the Pixel 2 XL except you need to patch the boot image you are doing to flash first in Magisk Manager then flash it after the factory images.
nathanchance said:
I'm saying if that is your only deciding factor for owning this device, considering getting another like the OnePlus 5 which has a guarantee of that. TWRP may get stable eventually but it may not. I personally love the kernel source that Google puts out and have been digging stock so I'm comfortable with just root with my kernel. If you aren't, then doing something else may be a good idea.
ROMs may end up coming in the form of images though (like system and boot and such), negating a need for TWRP. We will have to see.
Sent from my Pixel 2 XL using XDA Labs
Click to expand...
Click to collapse
I need Verizon, so the OnePlus 5 is out of the question. Maybe once the V30 source is released and bootloader unlocked that may be worth looking at. But it probably won't get much development anyway.
Possibly the Essential Phone (seems to be a good deal now, and it has root and twrp)
I probably would be okay with kernel tweaks and root on the Pixel 2 XL.

[GUIDE] Flashing ROMs with TWRP black screen

Hello,
Many people report, that their TWRP/PBRP is black and they can't install custom ROM or flash stock ROM by recovery.
Problem occurs in devices with Jdi display.
It is recommended to flash Oreo, then recovery work, but if you want use Android Pie you must be on this stock firmware (I tried Oreo and flash Havoc (Pie) = bootloop).
We need:
Unlocked bootloader
Turned on android debugging
ADB (minimum 1.4.3)
TWRP/PBRP (.img file)
ROM, GAPPS,...
YOUR DATA/PHOTOS/DOWNLOADS WILL BE REMOVED, SO MAKE A BACKUP!
Let's get started:
1. FLASHING ROM
/the phone is on/
1. Use cmd and type: adb reboot-bootloader
<phone will turn on in fastboot mode>
2. Type: fastboot set_active b
Then: fastboot boot <your_recovery.img>, e.g. fastboot boot twrp.img
<phone will reboot, the screen will be black>
<wait to Windows new device sound>
3. Type: adb shell
twrp wipe cache
twrp wipe dalvik
twrp wipe system
twrp wipe data <- NOW YOUR DATA WILL BE REMOVED, SO MAKE A BACKUP BEFORE!
twrp sideload
adb sideload <location_of_your_ROM.zip>, e.g. adb sideload C:\Havoc.zip
When the installation is completed you will see "Total xfer X.XXx".
2. FLASHING GAPPS
Now: adb reboot-bootloader
<phone will turn on in fastboot mode>
fastboot set_active a
fastboot boot <your_recovery.img>, e.g. fastboot boot twrp.img
<phone will reboot, the screen will be black>
<wait to Windows new device sound>
adb shell
twrp wipe cache
twrp wipe dalvik
twrp sideload
adb sideload <location_of_your_GApps.zip>, e.g. adb sideload C:\GApps.zip
When the installation is completed you will see "Total xfer X.XXx".
3. FLASHING PATCHED BOOT IMAGE (MAGISK + ROOT)
adb reboot-bootloader
fastboot flash boot <your_patched_boot.img>, e.g. fastboot flash patched_boot.img
fastboot reboot
<phone will start, the first start may take some time>
It's instruction for performing these three steps sequentially.
System will be installed on slot B, the Gapps and patched boot on slot A.
Now you can enjoy custom ROM
Greetings
Flash999 said:
Hello,
Many people report, that their TWRP/PBRP is black and they can't install custom ROM or flash stock ROM by recovery.
Problem occurs in devices with Jdi display.
It is recommended to flash Oreo, then recovery work, but if you want use Android Pie you must be on this stock firmware (I tried Oreo and flash Havoc (Pie) = bootloop).
We need:
Unlocked bootloader
Turned on android debugging
ADB (minimum 1.4.3)
TWRP/PBRP (.img file)
ROM, GAPPS,...
YOUR DATA/PHOTOS/DOWNLOADS WILL BE REMOVED, SO MAKE A BACKUP!
Let's get started:
1. FLASHING ROM
/the phone is on/
1. Use cmd and type: adb reboot-bootloader
<phone will turn on in fastboot mode>
2. Type: fastboot set_active b
Then: fastboot boot <your_recovery.img>, e.g. fastboot boot twrp.img
<phone will reboot, the screen will be black>
<wait to Windows new device sound>
3. Type: adb shell
twrp wipe cache
twrp wipe dalvik
twrp wipe system
twrp wipe data <- NOW YOUR DATA WILL BE REMOVED, SO MAKE A BACKUP BEFORE!
twrp sideload
adb sideload <location_of_your_ROM.zip>, e.g. adb sideload C:\Havoc.zip
When the installation is completed you will see "Total xfer X.XXx".
2. FLASHING GAPPS
Now: adb reboot-bootloader
<phone will turn on in fastboot mode>
fastboot set_active a
fastboot boot <your_recovery.img>, e.g. fastboot boot twrp.img
<phone will reboot, the screen will be black>
<wait to Windows new device sound>
adb shell
twrp wipe cache
twrp wipe dalvik
twrp sideload
adb sideload <location_of_your_GApps.zip>, e.g. adb sideload C:\GApps.zip
When the installation is completed you will see "Total xfer X.XXx".
3. FLASHING PATCHED BOOT IMAGE (MAGISK + ROOT)
adb reboot-bootloader
fastboot flash boot <your_patched_boot.img>, e.g. fastboot flash patched_boot.img
fastboot reboot
<phone will start, the first start may take some time>
It's instruction for performing these three steps sequentially.
System will be installed on slot B, the Gapps and patched boot on slot A.
Now you can enjoy custom ROM
Greetings
Click to expand...
Click to collapse
Work well.. buuuut.... i think tha hard drive of phone is encrypted... and inwritable, so... works! but is not functional
Wormboymx said:
Work well.. buuuut.... i think tha hard drive of phone is encrypted... and inwritable, so... works! but is not functional
Click to expand...
Click to collapse
The data partition is encrypted. If you want to access this partition you have to format it by TWRP. When you start system with forced encryption, the data will be again encrypted (or use custom ROM without encryption or install script to disable it on stock software).
Flash999 said:
The data partition is encrypted. If you want to access this partition you have to format it by TWRP. When you start system with forced encryption, the data will be again encrypted (or use custom ROM without encryption or install script to disable it on stock software).
Click to expand...
Click to collapse
Ok, can you help me with that? I think with you excellent guide maybe is missing one step to avoid this.
Thanks!
Wormboymx said:
Ok, can you help me with that? I think with you excellent guide maybe is missing one step to avoid this.
Thanks!
Click to expand...
Click to collapse
I had a similar problem while using twrp to copy files to the phone storage, try this command before doing anything:
fastboot -w
Note: This wipes all data.
This made the phone storage accessible.
mma_1494 said:
I had a similar problem while using twrp to copy files to the phone storage, try this command before doing anything:
fastboot -w
Note: This wipes all data.
This made the phone storage accessible.
Click to expand...
Click to collapse
Doesn´t work too =(
"fastboot -w
wiping userdata...
CreateProcess failed: El sistema no puede encontrar el archivo especificado. (2)
error: Cannot generate image for userdata"
i Will back to stock rom Pie...
P.D. the encryption is when finishi whole process in the installed custom rom the hard drive doesn't work e.g... Open the camera and system say "Don't have sd card to save the files"
where will get patched_boot.img for mi a2 10.0.2 or 10.0.4
where will get patched_boot.img for mi a2 10.0.2 or 10.0.4
asad0181 said:
where will get patched_boot.img for mi a2 10.0.2 or 10.0.4
Click to expand...
Click to collapse
On this Youtube channel https://www.youtube.com/channel/UCuEtuySiR1DDYCRerutqvnA/videos
You can get some files...
Hello! How do I know if my device has a Jdi display panel? If it does have, do I need to follow this guide every time I flash or update a rom?
chrisdlc119 said:
Hello! How do I know if my device has a Jdi display panel? If it does have, do I need to follow this guide every time I flash or update a rom?
Click to expand...
Click to collapse
Try to boot TWRP on Pie, if you see TWRP GUI mean you don't have Jdi display. You don't have to flash anything, only boot by fastboot.
It depends of your ROM and system updater, I follow the guide to flash new version and all is working ok.
Flash999 said:
Try to boot TWRP on Pie, if you see TWRP GUI mean you don't have Jdi display. You don't have to flash anything, only boot by fastboot.
It depends of your ROM and system updater, I follow the guide to flash new version and all is working ok.
Click to expand...
Click to collapse
I think my display is tianman (ss atached). Is that right? Do you know if any display is affected with burning effect? It's just that I had a RN5 and I changed from MIUI to a custom ROM and one day the display just got the burning effect
Thanks for your reply.
Wormboymx said:
Doesn´t work too =(
"fastboot -w
wiping userdata...
CreateProcess failed: El sistema no puede encontrar el archivo especificado. (2)
error: Cannot generate image for userdata"
i Will back to stock rom Pie...
Click to expand...
Click to collapse
I'm getting the same error when doing fastboot -w, and the ROM I flashed (Resurrection Remix) is stuck on startup splash screen.
Any idea what can cause this, and how I can recover?
mma_1494 said:
I had a similar problem while using twrp to copy files to the phone storage, try this command before doing anything:
fastboot -w
Note: This wipes all data.
This made the phone storage accessible.
Click to expand...
Click to collapse
Thanks! Now I could install Havoc and have access to my files!
Op you should include ,,fastboot -w" in your guide.
Finally i can boot PitchBlack recovery without Blackscreen in JDI panels::
Boot this recovery file: https://sourceforge.net/projects/pitchblack-twrp/files/jasmine_sprout/
Only one difference between the guide of this Thread....
I can´t change the partitions in PitchBlack recovery... i used the command in the op to change the partitions.... NOW i can flashed the Resurection remix rom in my phone
hlg1 said:
I'm getting the same error when doing fastboot -w, and the ROM I flashed (Resurrection Remix) is stuck on startup splash screen.
Any idea what can cause this, and how I can recover?
Click to expand...
Click to collapse
So, I was able to recover from this by using Xiaomi Flash Tool (v20170425) to flash the V10.0.7.0 stock rom. That got me back to a working stock Android.
I then retried the steps from this guide (except Gapps and patched boot), and this time I was able to get my Resurrection Remix started. However, the userdata file structure looks like rubbish, and none of the apps can write to or read from it. I tried to do a factory reset (from within custom rom) to fix this, but then the phone turned off and would not boot to custom rom again. fastboot -w still doesn't work.
Any ideas how to make the userdata partition great again?
hlg1 said:
So, I was able to recover from this by using Xiaomi Flash Tool (v20170425) to flash the V10.0.7.0 stock rom. That got me back to a working stock Android.
I then retried the steps from this guide (except Gapps and patched boot), and this time I was able to get my Resurrection Remix started. However, the userdata file structure looks like rubbish, and none of the apps can write to or read from it. I tried to do a factory reset (from within custom rom) to fix this, but then the phone turned off and would not boot to custom rom again. fastboot -w still doesn't work.
Any ideas how to make the userdata partition great again?
Click to expand...
Click to collapse
I made it work by doing the first 2 steps from the OP and then after booting into system the first time I booted into bootloader and then used fastboot -w. I did this with Havoc OS though so it might not work for everyone.
When I wanted root and didn't know how to get a patched boot image for my ROM, I just followed the steps to access TWRP through ADB again and then wiped cache and dalvik, afterwards I used the sideload command to flash Magisk on my phone.
hlg1 said:
Any ideas how to make the userdata partition great again?
Click to expand...
Click to collapse
I eventually figured out that all my problems occurred because I was using old versions of ADB and fastboot. After updating to latest platform-tools (currently r28.0.2) I was able to run fastboot -w without problems. And once that worked I was able to set up a fully working system following the steps of this guide.
Thanks for a very useful guide, it saved my day!
i got failed command write failed. any suggestion?
I was also having the black screen problem
Can i flash twrp recovery while keeping the stock rom? If can sombody please help me
Sarath_sh said:
I was also having the black screen problem
Can i flash twrp recovery while keeping the stock rom? If can sombody please help me
Click to expand...
Click to collapse
I'm not entirely sure I understand your question, but please note that by following the OP instructions you never flash TWRP, you just boot right into it from RAM. So should be no problem to do that while keeping stock ROM.

[GUIDE] Re-locking the bootloader with a pre-built custom ROM, such as LineageOS official

DOES NOT WORK WITH NEW FIRMWARES FOR ANDROID 12! WILL NOT BOOT AND YOU WILL FIND YOURSELF IN EDL MODE TRYING TO UNBRICK YOUR PHONE.
Similar to https://forum.xda-developers.com/t/guide-re-locking-the-bootloader-on-the-oneplus-8t-with-a-self-signed-build-of-los-18-1.4259409/ but for pre-built custom ROMs, such as official LineageOS.
WARNING: This will wipe your data - as far as I know there is no way to change the bootloader status (locked/unlocked) without a wipe.
IMPORTANT
If you mount ANY partition R/W after installing your ROM, you will no longer be able to boot. This means you will not be able to install ANY flash-able zips, INCLUDING GAPPS!
You will still get a warning message on boot, though it will be yellow rather than orange and just point out that your operating system is custom.
It is unlikely it will fix your banking app, as the bootloader status will be yellow (rather than orange/red for unlocked).
If your ROM developer's verity key changes and you update, you will be stuck and not be able to get back to a working device without wiping your data.
In short this is pointless, carries a lot of risk and the only benefit you get is the questionable extra security of a locked bootloader that will only load an operating system that is signed by a key that you have explicitly trusted.
So how to do it?
STEP 1:
Download your ROM (eg: official LineageOS, or LineageOS with MicroG). Keep the ZIP to one side as we will need it later.
STEP 2:
Unlock your bootloader and install your ROM as normal, following the instructions given by the ROM maintainer. You must NOT flash any flash-able zips after installing the ROM or you will no longer be able to boot.
At this stage it is assumed you have your chosen ROM installed and your boot loader is unlocked.
STEP 3:
On your computer, extract the ZIP file containing the ROM.
STEP 4:
Use: payload dumper to extract the payload.bin file.
STEP 5:
Use: this tool to extract the public key from the vbmeta.img file.
Code:
ruby ./run.rb ./extracted/vbmeta.img output
This will generate "output.pem" and "output.img".
STEP 6:
Reboot into fastboot, run:
Code:
fastboot erase avb_custom_key
fastboot flash avb_custom_key ./output.img
fastboot oem lock
At this point your phone should reboot, wipe itself, have a locked boot loader and successfully boot your ROM of choice. When upgrading in the future you can extract the public key in the same way and compare it to the one you have loaded into fastboot to ensure you won't be forced into having to wipe your device again.
If something goes wrong and your ROM does not boot and gives a red error about corrupt OS, you will need to unlock the bootloader again in order for things to work.
Very nice! Will i be able to flash magisk before and still be ok?
I don't know (sorry) I've never used Magisk. I think it modifies the boot image right? If so I don't expect it would work as the boot image signature must match the one that is in the vbmeta image.
rlees85 said:
Similar to https://forum.xda-developers.com/t/guide-re-locking-the-bootloader-on-the-oneplus-8t-with-a-self-signed-build-of-los-18-1.4259409/ but for pre-built custom ROMs, such as official LineageOS.
WARNING: This will wipe your data - as far as I know there is no way to change the bootloader status (locked/unlocked) without a wipe.
IMPORTANT
If you mount ANY partition R/W after installing your ROM, you will no longer be able to boot. This means you will not be able to install ANY flash-able zips, INCLUDING GAPPS!
You will still get a warning message on boot, though it will be yellow rather than orange and just point out that your operating system is custom.
It is unlikely it will fix your banking app, as the bootloader status will be yellow (rather than orange/red for unlocked).
If your ROM developer's verity key changes and you update, you will be stuck and not be able to get back to a working device without wiping your data.
In short this is pointless, carries a lot of risk and the only benefit you get is the questionable extra security of a locked bootloader that will only load an operating system that is signed by a key that you have explicitly trusted.
So how to do it?
STEP 1:
Download your ROM (eg: official LineageOS, or LineageOS with MicroG). Keep the ZIP to one side as we will need it later.
STEP 2:
Unlock your bootloader and install your ROM as normal, following the instructions given by the ROM maintainer. You must NOT flash any flash-able zips after installing the ROM or you will no longer be able to boot.
At this stage it is assumed you have your chosen ROM installed and your boot loader is unlocked.
STEP 3:
On your computer, extract the ZIP file containing the ROM.
STEP 4:
Use: payload dumper to extract the payload.bin file.
STEP 5:
Use: this tool to extract the public key from the vbmeta.img file.
Code:
ruby ./run.rb ./extracted/vbmeta.img output
This will generate "output.pem" and "output.img".
STEP 6:
Reboot into fastboot, run:
Code:
fastboot erase avb_custom_key
fastboot flash avb_custom_key ./output.img
fastboot oem lock
At this point your phone should reboot, wipe itself, have a locked boot loader and successfully boot your ROM of choice. When upgrading in the future you can extract the public key in the same way and compare it to the one you have loaded into fastboot to ensure you won't be forced into having to wipe your device again.
If something goes wrong and your ROM does not boot and gives a red error about corrupt OS, you will need to unlock the bootloader again in order for things to work.
Click to expand...
Click to collapse
Thank You Soooooooo much, may God bless you always. By the way it's working with LineageOS microG as well.
rlees85 said:
Similar to https://forum.xda-developers.com/t/guide-re-locking-the-bootloader-on-the-oneplus-8t-with-a-self-signed-build-of-los-18-1.4259409/ but for pre-built custom ROMs, such as official LineageOS.
WARNING: This will wipe your data - as far as I know there is no way to change the bootloader status (locked/unlocked) without a wipe.
IMPORTANT
If you mount ANY partition R/W after installing your ROM, you will no longer be able to boot. This means you will not be able to install ANY flash-able zips, INCLUDING GAPPS!
You will still get a warning message on boot, though it will be yellow rather than orange and just point out that your operating system is custom.
It is unlikely it will fix your banking app, as the bootloader status will be yellow (rather than orange/red for unlocked).
If your ROM developer's verity key changes and you update, you will be stuck and not be able to get back to a working device without wiping your data.
In short this is pointless, carries a lot of risk and the only benefit you get is the questionable extra security of a locked bootloader that will only load an operating system that is signed by a key that you have explicitly trusted.
So how to do it?
STEP 1:
Download your ROM (eg: official LineageOS, or LineageOS with MicroG). Keep the ZIP to one side as we will need it later.
STEP 2:
Unlock your bootloader and install your ROM as normal, following the instructions given by the ROM maintainer. You must NOT flash any flash-able zips after installing the ROM or you will no longer be able to boot.
At this stage it is assumed you have your chosen ROM installed and your boot loader is unlocked.
STEP 3:
On your computer, extract the ZIP file containing the ROM.
STEP 4:
Use: payload dumper to extract the payload.bin file.
STEP 5:
Use: this tool to extract the public key from the vbmeta.img file.
Code:
ruby ./run.rb ./extracted/vbmeta.img output
This will generate "output.pem" and "output.img".
STEP 6:
Reboot into fastboot, run:
Code:
fastboot erase avb_custom_key
fastboot flash avb_custom_key ./output.img
fastboot oem lock
At this point your phone should reboot, wipe itself, have a locked boot loader and successfully boot your ROM of choice. When upgrading in the future you can extract the public key in the same way and compare it to the one you have loaded into fastboot to ensure you won't be forced into having to wipe your device again.
If something goes wrong and your ROM does not boot and gives a red error about corrupt OS, you will need to unlock the bootloader again in order for things to work.
Click to expand...
Click to collapse
If I may to ask, Why the OEM unlocking toggle doesn't appear in the Developer options menu after the steps above done successfully ?
ahmed.elsersi said:
If I may to ask, Why the OEM unlocking toggle doesn't appear in the Developer options menu after the steps above done successfully ?
Click to expand...
Click to collapse
The offical builds of LineageOS do not inlcude the OEM lock option in them for the 7/7Pro/8T (maybe others), so it does not appear in developers options.
To get it you'd have to recomiple LineageOS (maybe tweak build.props?).
Anyone thinking of doing this might be interested in a post I made over on reddit talking about relocking, which includes info on why using pre buildt ROM is probably a bad idea.
WhitbyGreg said:
The offical builds of LineageOS do not inlcude the OEM lock option in them for the 7/7Pro/8T (maybe others), so it does not appear in developers options.
To get it you'd have to recomiple LineageOS (maybe tweak build.props?).
Click to expand...
Click to collapse
Thank you, I appreciate it.
rlees85 said:
Similar to https://forum.xda-developers.com/t/guide-re-locking-the-bootloader-on-the-oneplus-8t-with-a-self-signed-build-of-los-18-1.4259409/ but for pre-built custom ROMs, such as official LineageOS.
WARNING: This will wipe your data - as far as I know there is no way to change the bootloader status (locked/unlocked) without a wipe.
IMPORTANT
If you mount ANY partition R/W after installing your ROM, you will no longer be able to boot. This means you will not be able to install ANY flash-able zips, INCLUDING GAPPS!
You will still get a warning message on boot, though it will be yellow rather than orange and just point out that your operating system is custom.
It is unlikely it will fix your banking app, as the bootloader status will be yellow (rather than orange/red for unlocked).
If your ROM developer's verity key changes and you update, you will be stuck and not be able to get back to a working device without wiping your data.
In short this is pointless, carries a lot of risk and the only benefit you get is the questionable extra security of a locked bootloader that will only load an operating system that is signed by a key that you have explicitly trusted.
So how to do it?
STEP 1:
Download your ROM (eg: official LineageOS, or LineageOS with MicroG). Keep the ZIP to one side as we will need it later.
STEP 2:
Unlock your bootloader and install your ROM as normal, following the instructions given by the ROM maintainer. You must NOT flash any flash-able zips after installing the ROM or you will no longer be able to boot.
At this stage it is assumed you have your chosen ROM installed and your boot loader is unlocked.
STEP 3:
On your computer, extract the ZIP file containing the ROM.
STEP 4:
Use: payload dumper to extract the payload.bin file.
STEP 5:
Use: this tool to extract the public key from the vbmeta.img file.
Code:
ruby ./run.rb ./extracted/vbmeta.img output
This will generate "output.pem" and "output.img".
STEP 6:
Reboot into fastboot, run:
Code:
fastboot erase avb_custom_key
fastboot flash avb_custom_key ./output.img
fastboot oem lock
At this point your phone should reboot, wipe itself, have a locked boot loader and successfully boot your ROM of choice. When upgrading in the future you can extract the public key in the same way and compare it to the one you have loaded into fastboot to ensure you won't be forced into having to wipe your device again.
If something goes wrong and your ROM does not boot and gives a red error about corrupt OS, you will need to unlock the bootloader again in order for things to work.
Click to expand...
Click to collapse
Great.
Thanks a lot. This worked also perfectly after installing LineageOS on enchilada (OnePlus 6).
See https://wiki.lineageos.org/devices/enchilada/install
Similar to https://forum.xda-developers.com/t/guide-re-locking-the-bootloader-on-the-oneplus-8t-with-a-self-signed-build-of-los-18-1.4259409/ but for pre-built custom ROMs, such as official LineageOS.
WARNING: This will wipe your data - as far as I know there is no way to change the bootloader status (locked/unlocked) without a wipe.
IMPORTANT
If you mount ANY partition R/W after installing your ROM, you will no longer be able to boot. This means you will not be able to install ANY flash-able zips, INCLUDING GAPPS!
You will still get a warning message on boot, though it will be yellow rather than orange and just point out that your operating system is custom.
It is unlikely it will fix your banking app, as the bootloader status will be yellow (rather than orange/red for unlocked).
If your ROM developer's verity key changes and you update, you will be stuck and not be able to get back to a working device IndigoCard Login without wiping your data.
In short this is pointless, carries a lot of risk and the only benefit you get is the questionable extra security of a locked bootloader that will only load an operating system that is signed by a key that you have explicitly trusted.
Click to expand...
Click to collapse
Thanks for the information you shared. Loved the way you explained everything in this blog.
I've gotten to the stage of
Code:
ruby ./run.rb ./extracted/vbmeta.img output
Except I run it directly in the output folder from the payload_dumper process.
When I run it, I get
Code:
ruby ./run.rb ./vbmeta.img output
Traceback (most recent call last):
1: from ./run.rb:46:in `<main>'
./run.rb:46:in `require_relative': cannot load such file -- /home/peter/Phone/phonec/output/lib/AvbVBMetaFooter.rb (LoadError)
It's looking for lib/AvbVBMetaFooter.rb. I've googled that, looked into the run.rb script, and can't find it.
Does anyone have an idea on this?
thanks very much
yiwogir691 said:
Very nice! Will i be able to flash magisk before and still be ok?
Click to expand...
Click to collapse
Working for you?
Scotm95 said:
Thanks for the information you shared. Loved the way you explained everything in this blog.
Click to expand...
Click to collapse
Working for you ?
jetcollins said:
I've gotten to the stage of
Code:
ruby ./run.rb ./extracted/vbmeta.img output
Except I run it directly in the output folder from the payload_dumper process.
When I run it, I get
Code:
ruby ./run.rb ./vbmeta.img output
Traceback (most recent call last):
1: from ./run.rb:46:in `<main>'
./run.rb:46:in `require_relative': cannot load such file -- /home/peter/Phone/phonec/output/lib/AvbVBMetaFooter.rb (LoadError)
It's looking for lib/AvbVBMetaFooter.rb. I've googled that, looked into the run.rb script, and can't find it.
Does anyone have an idea on this?
thanks very much
Click to expand...
Click to collapse
Late reply, sorry, you need to clone the whole repo and not just copy and paste run.rb
The missing files are in the same repo as run.rb
Does anyone tried this guide recently and worked?
Haven't tried it since November but I'm still having the setup running on my phone and auto updates worked without flaws so far.
Has anyone gotten this to work on a OP9 and/or Lineage 19? I was able to follow all the steps and I got a build that I think should work. In fact, it does work until I actually do the re-lock, at which point I get the red broken OS boot screen.
srwalter said:
Has anyone gotten this to work on a OP9 and/or Lineage 19? I was able to follow all the steps and I got a build that I think should work. In fact, it does work until I actually do the re-lock, at which point I get the red broken OS boot screen.
Click to expand...
Click to collapse
[GUIDE] Re-locking the bootloader on the OnePlus 8t with a self-signed build of LOS 18.1
What is this tutorial? This tutorial will: Creating an unofficial build of LineageOS 18.1 suitable for using to re-lock the bootloader on a OnePlus 8t Take you through the process of re-locking your bootloader after installing the above This...
forum.xda-developers.com
I am preparing to update my OnePlus 8T to LineageOS 19.1 MicroG edition. So far I've confirmed the key used for LineageOS 18.1 MicroG edition is the same so I shouldn't have to re-fiddle with any partitions/keys.
When I finally update I will post back here if I screw my phone/get the red message.

Categories

Resources