I was trying to pass Play Integrity on my rooted device using Play Integrity Fix with Magisk. I followed multiple tutorials and wasted a whole day trying to make it work, but nothing helped. Finally, I checked the GitHub, and guess what? Play Integrity now checks the kernel name, too!
Unfortunately, my kernel name was one of the blacklisted ones. So, I flashed the stock boot.img, and Play Integrity immediately passed without issues. However, I wanted to keep my custom kernel while still passing the check.
After experimenting, I found that simply modifying the kernel name inside the boot image was enough. This guide explains how to do it.
If you are using a custom ROM or custom kernel, ensure that your kernel name is not blacklisted. You can check by running:
uname -rList of banned kernel names: XDA Forums
-
Rooted Android device with TWRP (or any method to extract boot.img)
-
Linux environment (Debian, Ubuntu, might be possible in termux)
-
hexedit
installed:sudo apt install hexedit
-
Kitchen
for unpacking/repacking boot.img:git clone https://github.com/ravindu644/Kitchen.git
You should be able to use some diferent tool like magisk to unpack the boot.img
If you have a TWRP backup, you can use the file directly after renaming it, if you haven't enabled compression:
mv boot.emmc.win boot.img
Alternatively, use dd
or any other tool to dump the boot partition:
Navigate to the Kitchen folder and place your boot.img
inside it:
cd Kitchen
bash kitchen unpack boot.img
This creates a workspace/
directory containing the extracted files.
Inside workspace/
, you'll see a file named kernel
. We need to find occurrences of the blacklisted kernel name:
cd workspace
strings kernel | grep -i "ElementalX"
Replace "ElementalX"
with your kernel name blacklisted string.
My output looked something like this:
Linux version 4.19.110-ElementalX-OP8-2.06 (aaron@bella) ...
/lib/firmware/updates/4.19.110-ElementalX-OP8-2.06
/lib/firmware/4.19.110-ElementalX-OP8-2.06
4.19.110-ElementalX-OP8-2.06
The last line is the one we need to modify so copy it also it should match the output from uname -r
.
Now, we will modify the kernel name using hexedit
.
-
Open the
kernel
file inhexedit
:hexedit kernel
-
Press
TAB
to switch to ASCII mode. -
Press
CTRL + S
, type your kernel name (4.19.110-ElementalX-OP8-2.06
) , and hit Enter. -
Modify the name by moving with arrow keys and then typing the letter on spot you want to replace the letter. The new name must be the same length (e.g., replace
"ElementalX"
with"CustomKern"
). -
Save changes by pressing
CTRL + X
→Y
→Enter
.
Navigate back to the Kitchen root folder and repack the image:
cd ..
bash kitchen repack
This will generate a new boot image:
boot.img-new(signed).img
Copy the modified boot image to your phone:
adb push boot.img-new(signed).img /sdcard/
Flash it using TWRP or Fastboot:
fastboot flash boot boot.img-new(signed).img
After booting your phone, check if the modification was successful:
uname -r
If you see your new kernel name (instead of the blacklisted one), congratulations! 🎉
Additionally, test Play Integrity with Play Integrity API Checker or one of your liking. If everything was done correctly, your device integrity should pass!
Successful Play Integrity check | uname -r inside Termux showing the modified boot.img |
---|---|
![]() |
![]() |
I originally wanted to pass Play Integrity without flashing the stock kernel, because my OnePlus 8 Pro had weird behavior with the stock boot image.
- Stock boot.img made my phone extremely slow and increased boot times by 10x. Sometimes, it wouldn't even boot.
- Flashing stock boot.img broke WiFi. Even after restoring the modem firmware, WiFi wouldn't work.
- Using a different custom kernel might have fixed it, but I was lazy. 😆
So, instead of reinstalling my phone to fix the kernel issue, I just modified the kernel name, and everything worked perfectly.
You can also compile your own kernel and if you have the skill to do so, do it this might break something but it works for me, no crashes etc.
Hope this guide helps someone struggling with the same issue! 🚀
- Kitchen: ravindu644/Kitchen
- Play Integrity Fix: GitHub