[KERNEL] Stock Kernel + SafetyNet Patch

Search This thread

iissmart

Senior Member
Aug 7, 2010
159
228
Stock Pixel/Pixel XL Kernel + SafetyNet Patch
Current version: android-9.0.0_r0.111
Suitable for build(s): August 2019
Suitable for devices(s): Pixel XL (marlin) | Pixel (sailfish)


I compiled the stock kernel for the Pixel/Pixel XL and applied the SafetyNet patch by sultanxda. The kernel name says marlin, but this also works on sailfish. Google just created one kernel that works on both sailfish (Pixel) and marlin (Pixel XL) devices.

Use case for this kernel:
- If you want to stay completely stock, but have an unlocked bootloader, the SafetyNet is tripped which disables features such as Android Pay and Netflix.
- This kernel is completely stock except for the addition of a patch that removes the SafetyNet check.
- This kernel is only for the builds listed above!!!! This will not work on any prior build.
- All stock features will work with this kernel (since it's just the stock kernel + patch).
- If you do not have an unlocked bootloader there is no need to use this kernel. It's exactly the same as the stock kernel, except with the addition of the SafetyNet patch.
- This will not prevent SafetyNet from tripping for other reasons, like rooting.
- This will not remove the "device corrupted" warning when the phone is turned on or rebooted.

Installation:
- Be prepared with backups or the factory image from Google in case you do something wrong
- Extract kernel from zip file
- Test with command: fastboot boot <filename>
- Flash with command: fastboot flash kernel <filename>

**WARNING**
If flashing this kernel for whatever reason ruins your device, I am not accountable. Use this at your own risk!


The current version will always be attached to this post. Older versions can be found HERE.

(shamelessly copied from Sakete's kernel for the Pixel/Pixel XL, which is no longer being maintained. Thanks for the inspiration, Sakete!)
 

Attachments

  • kernel_marlin_android-9.0.0_r0.111.zip
    12.3 MB · Views: 187
Last edited:

Cardflip

Member
Nov 9, 2016
17
8
Wow. I literally just compiled the patched kernel myself just now. What a ninja! While I'll be running my own, thanks for posting this so I didn't have to :p
 
  • Like
Reactions: iissmart

iissmart

Senior Member
Aug 7, 2010
159
228
For those who already downloaded the kernel, I checked and saw a new mr2.1 update so I've attached an updated kernel.
 

ipeedalil

Senior Member
Oct 30, 2009
108
9
I'm running a pixel on the nof27b build I don't really want to flash a new kernel would it be possible for you to make the patch a flashable zip
 

iissmart

Senior Member
Aug 7, 2010
159
228
Mine is based on that but mr2 and mr2.1 have the same commit so I'm pretty sure it's the same kernel.

Cheers

Good catch, I didn't look that closely before recompiling but they are indeed the same. Oh well! Maybe I'll start going off of tag names instead of branches...

I'm running a pixel on the nof27b build I don't really want to flash a new kernel would it be possible for you to make the patch a flashable zip

Curious - what difference is there between flashing a kernel using fastboot and using a flashable zip? Isn't the end result the same?
 

Cardflip

Member
Nov 9, 2016
17
8
Curious - what difference is there between flashing a kernel using fastboot and using a flashable zip? Isn't the end result the same?

I think he's asking for the patch itself to be a flashable zip so he can patch the boot image while it's already compiled and on the phone. Which AFAIK is impossible
 

puertorecon

Senior Member
Aug 17, 2010
640
194
Chicago
Google Pixel 6 Pro
We need one for the Non-Verizon models (N2G47E) & (N2G47J). This modified kernel is only for the Verizon version. If you can compile two more versions for Non-Verizon builds.
 
Last edited:

iissmart

Senior Member
Aug 7, 2010
159
228
It looks like the same kernel is used among NHG47K, N2G47J, and N2G47E, so my patched one should work for all of them. I'll update the post.
 
  • Like
Reactions: oF2pks

bobby janow

Senior Member
Jun 15, 2010
6,822
2,627
I'm just curious... So assuming you have the Google version and the oem unlock switch is fuctional and turned on, if you are not intending to root the device why would you unlock the bootloader? I mean you can always unlock it if you want or need to root, right?
 
  • Like
Reactions: rwp1960

iissmart

Senior Member
Aug 7, 2010
159
228
I'm just curious... So assuming you have the Google version and the oem unlock switch is fuctional and turned on, if you are not intending to root the device why would you unlock the bootloader? I mean you can always unlock it if you want or need to root, right?

In the past I would always root or install a custom ROM on my phone. I would like to with the Pixel, but I want to keep Android Pay since I use it almost daily and I haven't been satisfied with the root solutions I've seen for the Pixel so far. It seems like Google is doing a good job of making it difficult to root, given the three or four different ways to root a Pixel that I've seen. Also, with the advent of monthly security patches I would imagine it is a growing headache to unroot, flash the update, then re-root each month. Google has also done a great job with the stock experience on the Pixel that the reasons I'd root are fairly minor.

It's also just been a habit of mine that the first thing I do with a phone is to unlock the bootloader. I don't like the idea of artificially restricting full access to a device, whether it's software or hardware. Plus I don't have to deal with the silly anti-theft checks that people encounter when they wipe the phone and sell it legitimately (like with Swappa or eBay). There was also a time when Nexus phones would bootloop after receiving an OTA, and if you weren't already unlocked before the OTA hit you'd be stuck with a bricked phone.
 
  • Like
Reactions: bobby janow

bobby janow

Senior Member
Jun 15, 2010
6,822
2,627
In the past I would always root or install a custom ROM on my phone. I would like to with the Pixel, but I want to keep Android Pay since I use it almost daily and I haven't been satisfied with the root solutions I've seen for the Pixel so far. It seems like Google is doing a good job of making it difficult to root, given the three or four different ways to root a Pixel that I've seen. Also, with the advent of monthly security patches I would imagine it is a growing headache to unroot, flash the update, then re-root each month. Google has also done a great job with the stock experience on the Pixel that the reasons I'd root are fairly minor.

It's also just been a habit of mine that the first thing I do with a phone is to unlock the bootloader. I don't like the idea of artificially restricting full access to a device, whether it's software or hardware. Plus I don't have to deal with the silly anti-theft checks that people encounter when they wipe the phone and sell it legitimately (like with Swappa or eBay). There was also a time when Nexus phones would bootloop after receiving an OTA, and if you weren't already unlocked before the OTA hit you'd be stuck with a bricked phone.
Ok, fair enough. As I said I was just curious as to the reasoning. But what do you mean by anti-theft checks? I've never sold a phone so I don't really run into anything like that. But if you ever did need to sell it and you could unlock it at a moment notice wouldn't that suffice? I have a Verizon model locked bl so this is all rather moot to my situation, but I do have a 5x that I can unlock if I had to. I like the idea of being able to toggle the oem switch even though I would still remain locked. Something about being able to flash a factory image that I like. Thanks for your reasoning. Not that I agree or disagree with you entirely hehe. Personally, I just like the security of not being able to access my data if it's ever lost or stolen, but I suppose a concerted effort would get in.
 

iissmart

Senior Member
Aug 7, 2010
159
228
Ok, fair enough. As I said I was just curious as to the reasoning. But what do you mean by anti-theft checks? I've never sold a phone so I don't really run into anything like that. But if you ever did need to sell it and you could unlock it at a moment notice wouldn't that suffice? I have a Verizon model locked bl so this is all rather moot to my situation, but I do have a 5x that I can unlock if I had to. I like the idea of being able to toggle the oem switch even though I would still remain locked. Something about being able to flash a factory image that I like. Thanks for your reasoning. Not that I agree or disagree with you entirely hehe. Personally, I just like the security of not being able to access my data if it's ever lost or stolen, but I suppose a concerted effort would get in.

If a locked phone is wiped/factory reset then only the Google account that was previously on the phone is allowed to be added back to the device. Tons of people were selling Nexus phones when this change rolled out, and the people that bought the phones were unable to add their accounts even after factory resetting. By unlocking the bootloader it disables this restriction. Yeah, I could do it at the time of selling the phone but there's always a chance I'd forget if I got out of the habit of unlocking the bootloader.

I thought about it a lot - and I've never lost a phone before so I'm OK with having my phone accessible in that regard. If I lose my phone I'll have bigger issues (like 2FA locking me out of my accounts) anyway.

I'm on Verizon, but I intentionally bought the phone from Google just to be able to unlock the bootloader :).
 
  • Like
Reactions: oF2pks

bobby janow

Senior Member
Jun 15, 2010
6,822
2,627
If a locked phone is wiped/factory reset then only the Google account that was previously on the phone is allowed to be added back to the device. Tons of people were selling Nexus phones when this change rolled out, and the people that bought the phones were unable to add their accounts even after factory resetting. By unlocking the bootloader it disables this restriction. Yeah, I could do it at the time of selling the phone but there's always a chance I'd forget if I got out of the habit of unlocking the bootloader.

I thought about it a lot - and I've never lost a phone before so I'm OK with having my phone accessible in that regard. If I lose my phone I'll have bigger issues (like 2FA locking me out of my accounts) anyway.

I'm on Verizon, but I intentionally bought the phone from Google just to be able to unlock the bootloader :).
I've seen the term 2FA bandied about. I presume that's what you're talking about regarding the lockout. So to clarify, if you don't have an unlocked bootloader you can't sell the device? That seems weird. How do you get your account off? If I gave the phone to my wife she can't add her account?

I've never lost a device either although I have smashed one of them disastrously. But now I have a lot more stuff on the device including some personal pics and videos, password files, banking app and of course AP. I actually think my reasoning was more of like there is so much hacking and theft going on that rather than take a chance let me see what it's like being locked like normal people. It's hasn't been bad at all so far as I'm sure you know since you're not really modded either. I get the OTA on another slot and while it's updating I can use the device and a simple reboot updates it. But the bigger reason is that I got a Verizon model (Pixel 32gb) for $240 and not the $650 the Google one would have cost. I'm not sorry although I will revisit that once the Pixel 2 is released. Black Friday is your friend. I would even have bought the Google Pixel for $350 if they had a deal but they didn't. With a fully functioning 5X I just couldn't justify the full price.
 

coldconfession13

Senior Member
Oct 10, 2010
1,410
187
Hmm I extracted the file and used fastboot flash kernel kernel_marlin-3.18-nougat-mr2.img and it gives me an error "error: cannot load 'kernel_marlin-3.18-nougat-mr2.img"
 

Top Liked Posts

  • There are no posts matching your filters.
  • 31
    Stock Pixel/Pixel XL Kernel + SafetyNet Patch
    Current version: android-9.0.0_r0.111
    Suitable for build(s): August 2019
    Suitable for devices(s): Pixel XL (marlin) | Pixel (sailfish)


    I compiled the stock kernel for the Pixel/Pixel XL and applied the SafetyNet patch by sultanxda. The kernel name says marlin, but this also works on sailfish. Google just created one kernel that works on both sailfish (Pixel) and marlin (Pixel XL) devices.

    Use case for this kernel:
    - If you want to stay completely stock, but have an unlocked bootloader, the SafetyNet is tripped which disables features such as Android Pay and Netflix.
    - This kernel is completely stock except for the addition of a patch that removes the SafetyNet check.
    - This kernel is only for the builds listed above!!!! This will not work on any prior build.
    - All stock features will work with this kernel (since it's just the stock kernel + patch).
    - If you do not have an unlocked bootloader there is no need to use this kernel. It's exactly the same as the stock kernel, except with the addition of the SafetyNet patch.
    - This will not prevent SafetyNet from tripping for other reasons, like rooting.
    - This will not remove the "device corrupted" warning when the phone is turned on or rebooted.

    Installation:
    - Be prepared with backups or the factory image from Google in case you do something wrong
    - Extract kernel from zip file
    - Test with command: fastboot boot <filename>
    - Flash with command: fastboot flash kernel <filename>

    **WARNING**
    If flashing this kernel for whatever reason ruins your device, I am not accountable. Use this at your own risk!


    The current version will always be attached to this post. Older versions can be found HERE.

    (shamelessly copied from Sakete's kernel for the Pixel/Pixel XL, which is no longer being maintained. Thanks for the inspiration, Sakete!)
    7
    Updated OP with the latest kernel version for September 2017. New version is oreo-r3 (yes, they downgraded again from oreo-r6 to oreo-r3).
    7
    Updated OP with the November 2017 kernel update.
    5
    Updated OP with the new kernel for Android 8.0 Oreo. I haven't updated my Pixel XL to 8.0 yet so it's untested by me, but it's compiled using the same process as my other kernels. Let me know if it works or not!
    5
    Update OP for May 2018.