[GUIDE] How to flash Lineage OS 16 Official + Gapps from OOS10 and pass SafetyNet

Search This thread

h8Aramex

Senior Member
Oct 24, 2012
687
194
Google Pixel 6a
- In case some step fails, just make sure your bootloader is unlocked.
- I assume you have a working adb and fastboot. I used the official Google package: https://developer.android.com/studio/releases/platform-tools . It's possible you will still have an older version installed because some "pack" installed it and put it in your path. How to edit PATH? What is PATH?! https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/
- Advanced Reboot is an option so you can easily enter recovery/fastboot mode. Enable it in Developer Options. How to enable Developer Options? Tap Build Number several times.

I realize the guide is long but it's overly detailed. If you get stuck, have questions, just ask and I will also edit the OP to answer more questions / clarify on points I guess.

Let's go back to latest OOS9.
  1. Make sure to back everything up. If you have Google One, you can do a backup there. If you have root, even better, you can do a full backup with TWRP. I would also copy every important files over to my PC as well - just in case.
  2. Make sure you are unlocked. This can reset if you flashed a full system update or anything so just make sure. If not, unlock.
  3. Grab the MSM toolkit - we will use this to flash back OOS9. See: https://xdaforums.com/oneplus-7-pro/how-to/msm-tool-guac-t3934691
    In my case I didn't have to mess with drivers or anything, just had to run the tool as admin. However, do read the steps, follow them in case you run into any trouble. Also, I just plug in the phone from a power off state with VOL buttons held down, start it, and I can start the flash process.
  4. At this point you are locked, but does not matter for now. Thing is, now you are on a bit borked image. The stock image has broken fastboot, and might be AA or BA. Point is, you have to flash the correct update at this point. Grab the correct 9.5.11 for your device (AA = global; BA = EU): https://xdaforums.com/oneplus-7-pro/how-to/oneplus-7-pro-global-repo-oxygen-os-t3930585
    Just copy it up to your device and use System Update -> Local Update once again to flash it.
Now it's time to flash LineageOS 16.
  1. Now it's time to bootloader unlock again. (Via Developer Options, enable oem unlock and advanced reboot, go into Bootloader, use fastboot oem unlock.)
  2. Now download the latest LineageOS rom from the official site: https://download.lineageos.org/guacamole
  3. Copy up the files to your phone. You can also use adb push at later step. I leave it to you. Copying up might be easier.
  4. Use fastboot boot ...img to boot up the latest unofficial TWRP: https://xdaforums.com/oneplus-7-pro/development/recovery-unofficial-twrp-recovery-t3931322 . You need the .img, but also grab the installer. Make sure you grab the Pie version, LOS16 == Android 9 (Pie).
  5. Once you are in TWRP, go Install, and pick the Lineage zip. Then make sure to do a Wipe from the TWRP menu.
  6. Reboot, let phone boot LineageOS. Shut down once it's booted. No need to set anything.
  7. Press VOL_DOWN + Power to go into Lineage Recovery. Press Sideload here.
  8. You need to grab "Mindthegapps" package from here: http://downloads.codefi.re/jdcteam/javelinanddart/gapps and you need to use adb sideload ...zip to load it onto the phone. It will cry about the zip being unverified, just tap proceed.
  9. Now, once it's installed, wipe again from LineageOS Recovery again. At this point, you can also sideload TWRP. You need to use the .zip, and again - make sure you have the Pie version.
  10. Phew, we are almost there! Reboot, log in to Google, do whatever. Set up your device.
Now, finally, let's finish up with SafetyNet.
  1. Once everything is done, install the Magisk Manager APK and grab the ZIP from here. Since you have TWRP, you can just grab the zip to the phone itself.: https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
  2. Enter TWRP by using Advanced Reboot, Install magisk ZIP.
    Almost done!
  3. Go into Magisk Manager, make sure all is green. Go into the left hamburger menu -> Downloads. Grab "MagiskHide Props Config", Install. Reboot.
  4. Now you have to install "Busybox" from Play Store, and you need to install a Terminal Emulator from Play Store as well. Just grab any.
  5. Go into BusyBox, grant root, Install.
  6. Open Terminal, type "su", then type "props".
  7. Just go through the menu system and pick your phone. Just type in a number, and enter. And so on. If you get stuck / afraid to do harm, just reboot the phone and install busybox again, open terminal again, try again. Or ask.
  8. Upon rebooting as you go through the tool, SafetyNet should 100% pass upon reboot.
 

wp007

Senior Member
Aug 22, 2016
103
17
Thanks for this guide. I can' use MSM toolkit because I'm not on windows. Is there a linux version? Why can't I just dirtyflash 9.5.1.1 zip over installed OOS 10?
 
Great guide. I just have one question for you. I have a GM1910 Model of the phone with international rom. I'm currently on Oxygen OS 10.0.2, can I still follow your steps to downgrade to the 9.5.1.1 and then flash Lineage as per your instructions? I'm new to the OnePlus devices and I want to be sure before doing something that I'll end up regretting. I know that with my S10+ I was able to downgrade between builds easily, but don't know what to do with my OP7P.

Thanks for your time and help in advance.

Edit: How stupid of me, I didn't even read properly before commenting. My apologies. Your title clearly states how to install Lineage OS from OOS10. Disregard my question about downgrading. I just would like to know if my GM1910 model is supported with Lineage or other OOS ROMs. I would think yes, but better to make sure of course.
 
Last edited:
Thanks for this guide. I can' use MSM toolkit because I'm not on windows. Is there a linux version? Why can't I just dirtyflash 9.5.1.1 zip over installed OOS 10?

Usually, you cannot dirty flash an older Build to downgrade. This will most likely cause an issue. You need to perform a clean install. I'm not entirely sure in OP7s case, but I do know this applies to Samsung devices and many others as well.
 

Iolaum

Member
Sep 2, 2015
48
17
If one unlocks bootloader, flashes twrp and then installs LineageOS16 + openGapps only on guacamole, will they pass safetynet or do they need magisk?
 
[*] Just go through the menu system and pick your phone. Just type in a number, and enter. And so on.
[/LIST]

I have followed all of your instructions and have successfully installed Lineage, TWRP, and Magisk. I've even downloaded the Magisk hide prop from downloads. The only thing I DO NOT understand is STEP 7. PLEASE explain what you have to exactly do here. I don't understand what you mean by: "Just go through the menu system and pick your phone. Just type in a number, and enter. And so on." After I type su, and then props, I get the following options:
1. Edit Device Fingerprint
2. Device Simulation(Disabled)
3. Edit MagiskHide props
4. Add/edit custom props
5. Delete prop values
6. Script settings
7. Collect logs
r. Reset all options/settings
b. Reboot Device
e. Exit

Where do I go to select my phone and number as you're mentioning? And when you say just type in a number and enter? What does that mean? What exactly do I type in? Any random number and enter? I don't understand this at all.

I'd appreciate some feedback here.

- Thanks

Edit: Turns out it only needs the fingerprint to be updated. (ro.build.version.security_patch) Do you have such a code. The developer says he has OP7P added to the list, but I for one, cannot seem to find it. What have you put for yours?

Edit #2: Issue has been resolved. Just did some digging of my own and figured it out. So all that needs to be done is you need to pick your device from the options of 1. Edit device fingerprint, follow the menu options until you see select from certified devices, and then you will see a list of certified devices.

Edit#3: Unfortunately, my devices model is not listed for the certified fingerprints. My model is GM1910, and I tried using the 1911 model, but it doesn't seem as though it worked. Because Google Play is still saying device not certified. Any other model numbers I can try for my model (GM1910)?

Edit #4: What a rough day it has been LOL. Finally found a working version. GM1913 works fine and I can confirm that my device has been indeed certified by Google Play Store. So for my model (GM1910) the GM1913 is the one that works. Ignore all of the above as I've explained it all here in case someone else is confused.
 
Last edited:

h8Aramex

Senior Member
Oct 24, 2012
687
194
Google Pixel 6a
Oh man, I am terribly sorry I wasn't really around. Sorry.

One major thing that I cannot figure out - I wasn't able to update.
For some reason after I updated LOS (via TWRP), my whole installation of LOS + Gapps broke.
Now, I needed my phone ASAP so I had to revert to OOS quickly because I needed my phone the next morning.

But, maybe it would work if you update from LineageOS itself.
I would VERY, VERY heavily recommend doing a TWRP full backup before attempting a LOS upgrade.
Shouldn't take long, for me it was like 10 minutes tops, I copied over the files to my PC and that was it. If something breaks, just copy the backups back and restore the backup.

If someone figures out a safe way to upgrade from LOS to LOS... let us know and I'll update the thread.

Ps.: In case your LOS breaks during an upgrade and your backup doesn't restore, you can install OpenGapps now via TWRP (you need the bigger package). This way you'll still have permission issues (like for some reason all Google apps will have bad permissions, so you have to give all perms to each one-by-one) BUT you will have a kinda working phone...
 
Oh man, I am terribly sorry I wasn't really around. Sorry.

One major thing that I cannot figure out - I wasn't able to update.
For some reason after I updated LOS (via TWRP), my whole installation of LOS + Gapps broke.
Now, I needed my phone ASAP so I had to revert to OOS quickly because I needed my phone the next morning.

But, maybe it would work if you update from LineageOS itself.
I would VERY, VERY heavily recommend doing a TWRP full backup before attempting a LOS upgrade.
Shouldn't take long, for me it was like 10 minutes tops, I copied over the files to my PC and that was it. If something breaks, just copy the backups back and restore the backup.

If someone figures out a safe way to upgrade from LOS to LOS... let us know and I'll update the thread.

Ps.: In case your LOS breaks during an upgrade and your backup doesn't restore, you can install OpenGapps now via TWRP (you need the bigger package). This way you'll still have permission issues (like for some reason all Google apps will have bad permissions, so you have to give all perms to each one-by-one) BUT you will have a kinda working phone...

Thank you for your response. Never apologize, you have a great guide here. I understand you were busy and had to step away. Also, I'm not sure why you experienced that because I followed your guide every step of the way and everything went perfectly, aside for the safetycheck but I managed to figure that out so you're good! Furthermore, I used Dec. 3 build and right after I installed it, there was an update. I updated the phone in the settings of LOS itself and it worked flawlessly, I downloaded the OTA and updated, rebooted and it was great! No issues there. Did yours use the OTA update? If not, give that a try.

Thanks again for a such an easy guide! Its great! Really works!
 
Last edited:
Mar 15, 2017
38
8
Copenhagen
I hate A/B partitioning. It only works in increments with your guide, outdated tools everywhere and a ****ty system, on top of not having an sd card. I loved my Samsung. Not for the Touchwiz, bloat etc, but they had sd cards an the old system, which just....worked. Either the gapps fails, the twrp gets overwritten or it boots, without actually loading magisk or gapps. It seems random if the lineage recovery wants to boot to a or b. This is horrible, but now I have to finish it....
 
  • Like
Reactions: nukejello
Mar 15, 2017
38
8
Copenhagen
You have not specified what you include in a "wipe". This is never the same for anyone, often not necessary and mostly something people do superstitiously - Therefore clarification would be nice. Still fighting with getting this ****ty system to work. Hope it will be restored with a OOS10 flash, if this keeps failing
 

GeeAyeZee

Account currently disabled
- In case some step fails, just make sure your bootloader is unlocked.
- I assume you have a working adb and fastboot. I used the official Google package: https://developer.android.com/studio/releases/platform-tools . It's possible you will still have an older version installed because some "pack" installed it and put it in your path. How to edit PATH? What is PATH?! https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/
- Advanced Reboot is an option so you can easily enter recovery/fastboot mode. Enable it in Developer Options. How to enable Developer Options? Tap Build Number several times.

I realize the guide is long but it's overly detailed. If you get stuck, have questions, just ask and I will also edit the OP to answer more questions / clarify on points I guess.

Let's go back to latest OOS9.
  1. Make sure to back everything up. If you have Google One, you can do a backup there. If you have root, even better, you can do a full backup with TWRP. I would also copy every important files over to my PC as well - just in case.
  2. Make sure you are unlocked. This can reset if you flashed a full system update or anything so just make sure. If not, unlock.
  3. Grab the MSM toolkit - we will use this to flash back OOS9. See: https://xdaforums.com/oneplus-7-pro/how-to/msm-tool-guac-t3934691
    In my case I didn't have to mess with drivers or anything, just had to run the tool as admin. However, do read the steps, follow them in case you run into any trouble. Also, I just plug in the phone from a power off state with VOL buttons held down, start it, and I can start the flash process.
  4. At this point you are locked, but does not matter for now. Thing is, now you are on a bit borked image. The stock image has broken fastboot, and might be AA or BA. Point is, you have to flash the correct update at this point. Grab the correct 9.5.11 for your device (AA = global; BA = EU): https://xdaforums.com/oneplus-7-pro/how-to/oneplus-7-pro-global-repo-oxygen-os-t3930585
    Just copy it up to your device and use System Update -> Local Update once again to flash it.
Now it's time to flash LineageOS 16.
  1. Now it's time to bootloader unlock again. (Via Developer Options, enable oem unlock and advanced reboot, go into Bootloader, use fastboot oem unlock.)
  2. Now download the latest LineageOS rom from the official site: https://download.lineageos.org/guacamole
  3. Copy up the files to your phone. You can also use adb push at later step. I leave it to you. Copying up might be easier.
  4. Use fastboot boot ...img to boot up the latest unofficial TWRP: https://xdaforums.com/oneplus-7-pro/development/recovery-unofficial-twrp-recovery-t3931322 . You need the .img, but also grab the installer. Make sure you grab the Pie version, LOS16 == Android 9 (Pie).
  5. Once you are in TWRP, go Install, and pick the Lineage zip. Then make sure to do a Wipe from the TWRP menu.
  6. Reboot, let phone boot LineageOS. Shut down once it's booted. No need to set anything.
  7. Press VOL_DOWN + Power to go into Lineage Recovery. Press Sideload here.
  8. You need to grab "Mindthegapps" package from here: http://downloads.codefi.re/jdcteam/javelinanddart/gapps and you need to use adb sideload ...zip to load it onto the phone. It will cry about the zip being unverified, just tap proceed.
  9. Now, once it's installed, wipe again from LineageOS Recovery again. At this point, you can also sideload TWRP. You need to use the .zip, and again - make sure you have the Pie version.
  10. Phew, we are almost there! Reboot, log in to Google, do whatever. Set up your device.
Now, finally, let's finish up with SafetyNet.
  1. Once everything is done, install the Magisk Manager APK and grab the ZIP from here. Since you have TWRP, you can just grab the zip to the phone itself.: https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
  2. Enter TWRP by using Advanced Reboot, Install magisk ZIP.
    Almost done!
  3. Go into Magisk Manager, make sure all is green. Go into the left hamburger menu -> Downloads. Grab "MagiskHide Props Config", Install. Reboot.
  4. Now you have to install "Busybox" from Play Store, and you need to install a Terminal Emulator from Play Store as well. Just grab any.
  5. Go into BusyBox, grant root, Install.
  6. Open Terminal, type "su", then type "props".
  7. Just go through the menu system and pick your phone. Just type in a number, and enter. And so on. If you get stuck / afraid to do harm, just reboot the phone and install busybox again, open terminal again, try again. Or ask.
  8. Upon rebooting as you go through the tool, SafetyNet should 100% pass upon reboot.


Awesome! Thanks. I guess I'm liking the OnePlus more than my S10+ now. Samsung makes much more difficult to rollback using Odin and such. But this is just great!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    - In case some step fails, just make sure your bootloader is unlocked.
    - I assume you have a working adb and fastboot. I used the official Google package: https://developer.android.com/studio/releases/platform-tools . It's possible you will still have an older version installed because some "pack" installed it and put it in your path. How to edit PATH? What is PATH?! https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/
    - Advanced Reboot is an option so you can easily enter recovery/fastboot mode. Enable it in Developer Options. How to enable Developer Options? Tap Build Number several times.

    I realize the guide is long but it's overly detailed. If you get stuck, have questions, just ask and I will also edit the OP to answer more questions / clarify on points I guess.

    Let's go back to latest OOS9.
    1. Make sure to back everything up. If you have Google One, you can do a backup there. If you have root, even better, you can do a full backup with TWRP. I would also copy every important files over to my PC as well - just in case.
    2. Make sure you are unlocked. This can reset if you flashed a full system update or anything so just make sure. If not, unlock.
    3. Grab the MSM toolkit - we will use this to flash back OOS9. See: https://xdaforums.com/oneplus-7-pro/how-to/msm-tool-guac-t3934691
      In my case I didn't have to mess with drivers or anything, just had to run the tool as admin. However, do read the steps, follow them in case you run into any trouble. Also, I just plug in the phone from a power off state with VOL buttons held down, start it, and I can start the flash process.
    4. At this point you are locked, but does not matter for now. Thing is, now you are on a bit borked image. The stock image has broken fastboot, and might be AA or BA. Point is, you have to flash the correct update at this point. Grab the correct 9.5.11 for your device (AA = global; BA = EU): https://xdaforums.com/oneplus-7-pro/how-to/oneplus-7-pro-global-repo-oxygen-os-t3930585
      Just copy it up to your device and use System Update -> Local Update once again to flash it.
    Now it's time to flash LineageOS 16.
    1. Now it's time to bootloader unlock again. (Via Developer Options, enable oem unlock and advanced reboot, go into Bootloader, use fastboot oem unlock.)
    2. Now download the latest LineageOS rom from the official site: https://download.lineageos.org/guacamole
    3. Copy up the files to your phone. You can also use adb push at later step. I leave it to you. Copying up might be easier.
    4. Use fastboot boot ...img to boot up the latest unofficial TWRP: https://xdaforums.com/oneplus-7-pro/development/recovery-unofficial-twrp-recovery-t3931322 . You need the .img, but also grab the installer. Make sure you grab the Pie version, LOS16 == Android 9 (Pie).
    5. Once you are in TWRP, go Install, and pick the Lineage zip. Then make sure to do a Wipe from the TWRP menu.
    6. Reboot, let phone boot LineageOS. Shut down once it's booted. No need to set anything.
    7. Press VOL_DOWN + Power to go into Lineage Recovery. Press Sideload here.
    8. You need to grab "Mindthegapps" package from here: http://downloads.codefi.re/jdcteam/javelinanddart/gapps and you need to use adb sideload ...zip to load it onto the phone. It will cry about the zip being unverified, just tap proceed.
    9. Now, once it's installed, wipe again from LineageOS Recovery again. At this point, you can also sideload TWRP. You need to use the .zip, and again - make sure you have the Pie version.
    10. Phew, we are almost there! Reboot, log in to Google, do whatever. Set up your device.
    Now, finally, let's finish up with SafetyNet.
    1. Once everything is done, install the Magisk Manager APK and grab the ZIP from here. Since you have TWRP, you can just grab the zip to the phone itself.: https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
    2. Enter TWRP by using Advanced Reboot, Install magisk ZIP.
      Almost done!
    3. Go into Magisk Manager, make sure all is green. Go into the left hamburger menu -> Downloads. Grab "MagiskHide Props Config", Install. Reboot.
    4. Now you have to install "Busybox" from Play Store, and you need to install a Terminal Emulator from Play Store as well. Just grab any.
    5. Go into BusyBox, grant root, Install.
    6. Open Terminal, type "su", then type "props".
    7. Just go through the menu system and pick your phone. Just type in a number, and enter. And so on. If you get stuck / afraid to do harm, just reboot the phone and install busybox again, open terminal again, try again. Or ask.
    8. Upon rebooting as you go through the tool, SafetyNet should 100% pass upon reboot.
    1
    I hate A/B partitioning. It only works in increments with your guide, outdated tools everywhere and a ****ty system, on top of not having an sd card. I loved my Samsung. Not for the Touchwiz, bloat etc, but they had sd cards an the old system, which just....worked. Either the gapps fails, the twrp gets overwritten or it boots, without actually loading magisk or gapps. It seems random if the lineage recovery wants to boot to a or b. This is horrible, but now I have to finish it....