yashsingh1/xdaforums huggingface dataset:
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=6637628]Jax02[/MENTION], the purpose of the kernel is to provide a way to have root together with working fota system update.

So having the kernel without magisk init integrated would require everybody to patch the kernel boot image manually in order to get root when booted via 'fastboot boot'.

This is the reason the kernel already contains magisk init integrated, so anyone can simply boot it from usb, install upstream magisk manager and benefit from root with fota.

I am not really sure why do you need to hide bootloader unlock without having root?

In any case, you can split the kernel/ramdisk, replace the "pre-rooted" ramdisk with one extracted from stock firmware and combine the kernel with it, creating boot image without magisk having the kernel hiding bootloader unlock.

I know it is not straightforward. But your request is rather strange.

Please note, there are already too many variants that need to be built to support most yoshino phones (you may check this post linking to all the kernels threads), so the effort to make yet another variant of each kernel is not justified here, sorry...
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] Henry He:
Hey sir I have a question that I have already deleted simlock.ta and flash the firmware, this kernel works well or not?
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] Jax02:
[MENTION=4418980]j4nn[/MENTION]

Thank you for the reply.

I have tried what are you said. I have splitted boot.img, changed ramdisk from stock boot and repacked.

After flashing my phone was stuck in Sony logo for 2m and reboot. I'm very noob in Android modding...

I have used for unpack/repack mkbootimg on linux.

Sorry for my bad English

Ty
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=6637628]Jax02[/MENTION], please check README_Xperia from sony kernel open source archive to see how to assemble an adroid boot image from kernel and ramdisk parts.

Still I am not sure what are you trying to achieve.
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=7833645]Henry He[/MENTION], kernel works - it is like stock one plus hide of bootloader unlock.
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] Henry He:
All right. Thanks a lot
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] Jax02:
[MENTION=4418980]j4nn[/MENTION]

I have unpacked boot with umkbootimg, it get me 2 files ramdisk.cpio.gz and zImage. I have replaced ramdisk from stock, repacked the boot like Readme file you said and flashed boot.

stuck in Sony logo :(

The only thing I want is unroot this kernel for use application with root detection. I know is possible unistall Magisk with Manager but I change firmware so many times and is so boring do that...

Thanks
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=6637628]Jax02[/MENTION], how about the magiskhide - that should normally help with apps that detect root...

Find my kernel with stock ramdisk (i.e. not rooted) here:

boot-G8341-47.2.A.8.24-hideunlock.img

boot-G8342-47.2.A.8.24-hideunlock.img

Hope that helps you to sort out the bootloop problem of your repack of the boot image.
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] Jax02:
Thank you very much!!
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] jutphaas:
Maybe a small thing but at my pc i needed to type fastboot reboot-bootloader :)

I do have a question though, as this seems interesting to flash your boot img.

I did not have a TA backup, as there was no method when I bought my xz1 and I did not want to wait for root/magisk..

Now I have been using this kernel: [KERNEL/BOOT]+[DRMFIX][MAGISK]Sony XZ1 [G8341][G8342_Dual]-11-MARCH-2019, with which I seem to not need a drm patch or it is included.

If I have not my original TA backup, is your kernel similar in that I have equal quality with my camera etc? When Checking *#*#service#*#* i see nothing (with your kernel) ... oh correct that, i saw "None" but now i tried again and from "None" it did switch to some more info, though I still don't know if there is a difference in this regard with the other kernel.

Hopefully someone can give me a little clarity :)
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=3631598]jutphaas[/MENTION], that 'fastboot reboot-bootloader' depends on version of android platform tools you are using...

Concerning the [MENTION=490110]janjan[/MENTION]'s kernel - I assume he does not use my bootloader unlock hide patch, at least he did not ask or credit me about it.

Unfortunately he has still not released his kernel source code, so I cannot say without testing it.

Basically if you use my kernel as described (fastboot boot it) with unmodified stock fw, you may be able to fully install fota update.

That would not be possible with a kernel that does not hide boot loader unlock as done in my patch.

If you get "None" in security screen it most likely is caused by not flashing corresponding bootloader with the stock fw - like when you are on pie with oreo bootloader for example.
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] jutphaas:
[MENTION=4418980]j4nn[/MENTION] Thanks, for the reply & explanation.

The [MENTION=490110]janjan[/MENTION]'s kernel does not use your hide bootloader unlock patch as far as i know, before your kernel, I never had the possibility to install fota update, that worked now I did manage to install the fota update, while not needing to flash the entire (updated) tft file (after I had correct kernel and recovery back by flashing that from flashtool ;) ) .

For now I flashed your kernel to keep, and if I want to have the fota update, i can restore from twrp (i think) the boot img kernel (and recovery img too I think) , then fastboot boot your kernel and get the update.. That is a nice way of keeping updates... (and maybe better for some apps that may detect unlocked bootloader)

Although I did disable dm-verity as you described in this thread to gain more access I believe to the root, Maybe that would be a problem when i restore to stock kernel and want to fota update..

With all the xperia's I got, I really never got much of a clue what dm verity really meant, maybe I should have done some searching first..

I do have some info in security screen, now, since android 9 my camera works, (without additional patching) with [MENTION=490110]janjan[/MENTION]'s kernels, and it works with your kernel so i probably should not worry about drm..

Again, nice work!
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=3631598]jutphaas[/MENTION], dm-verity if enabled forces check of system and vendor partitions for consistency against signed checksums from sony.

In case of small differences it might even be able to revert some changes.

If there is any even minimal change to system or vendor, fota will fail (you would need to flash those too to fix that).

If you do not disable dm-verity you may be able to discover which app (or twrp flashable zip) changed something in those two partitions (phone would most likely not boot).

If disabled, you may find out that something did changes too late to be able to point out to the offending app/zip.

So if wanted to use fota it is better in my opinion not to disable dm-verity and use only systemless customizations via proper magisk modules.

Please note, even a simple mount of a partition in rw mode without any additional copy (or other change) makes changes to a partition.

Some twrp flashable zip files might mount partitions rw even if not needed...
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
You may try my pre-release of the kernels for 47.2.A.10.28 fw posted in the "[XZ1c/XZ1/XZp] temp root exploit to backup drm keys" thread, post#724.
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] SGH-i200:
My XZ1 is in 'fastboot mode' (blue LED is shining), but the device is not responding. Which driver should be installed? My Win7 device manager shows 'Android' and doesn't let me update to any other in the driver update list.
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=1995555]SGH-i200[/MENTION], unfortunately I have no experience with that.

But found this:

https://developer.sony.com/file/download/fastboot-driver/

Maybe that's the one?
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] SGH-i200:
Fastboot drivers for Xperia XZ1

Thank you very much for pointing me in the right direction! I figured out what is missing in the INF file included in the ADB drivers provided by SONY. I compared the file 'sa0116adb.inf' (XZ1 adb driver) with the linked fastboot driver (android_winusb.inf) and found that adding the following lines to 'sa0116adb.inf' allows to install the right driver to make my XZ1 to respond to fastboot commands, again! :good: My device is now listed as 'Android Bootloader Interface' in the Win7-64 device manager.

[AdbDevice.NTx86]
%CompositeAdbInterface% = USB_Install, USB\VID_0FCE&PID_0DDE&MI_01
%SingleBootLoaderInterface% = USB_Install, USB\VID_0FCE&PID_0DDE

[AdbDevice.NTamd64]
%CompositeAdbInterface% = USB_Install, USB\VID_0FCE&PID_0DDE&MI_01
%SingleBootLoaderInterface% = USB_Install, USB\VID_0FCE&PID_0DDE

[Strings]
ProviderName = "Sony"
CompositeAdbInterface = "Sony sa0116 ADB Interface Driver"
SingleBootLoaderInterface = "Android Bootloader Interface"
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] SGH-i200:
Works without problems! :good:
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] Tesmuk:
Has anyone tested this on 47.1.A.8.49? I'm afraid I could harm my phone by flashing this...
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=9829660]Tesmuk[/MENTION], I do not understand your question. If you are running XZ1 (not compact variant) with 47.1.A.8.49 fw version then I am not really sure what would you like to use from this thread?

If you have your bootloader still locked, follow the link in step 1. of this thread to a thread with howto for TA backup and restore method. After you do that, you may return here to use a kernel for one of supported versions of fw.
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] lilbrat:
[MENTION=4418980]j4nn[/MENTION], while I do admire your work, I personally think that having to go into fastboot every time I start my phone is a bit much for me.. But I did try your . 28 pre release kernel for my XZ1 dual on the alternative method and just wanted to inform you that everything is working fine.. Here's a pic with my ta. partition backup and restore and your kernel.. Well done..
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=4133204]lilbrat[/MENTION], it is just fine to use the kernel in the 'alternative' way - if you know what you are doing you still can revert very easily to be able to install fota system update. And not needing to download full fw at all if backup of stock kernel is done right after update (as described here and in the following post).
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] Cyanogen_Mod:
[MENTION=4418980]j4nn[/MENTION] Works perfectly on my G8342. Thx!

But when I tried to follow the alternative use, it just kept loop on Sony Logo.

The things I did: Because I forgot to backup my stock Kernel, I had to patch the kernel on my another phone, and then flash it to XZ1. Is the patch must be done on XZ1?
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] lilbrat:
Did you download the correct "alternate" kernel for your current firmware? If so you can patch it on your phone, it wil be called "patched_boot.img" and then just flash it to your phone either by fastboot or through twrp...
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=7768100]Cyanogen_Mod[/MENTION], you may need the stock kernel backup to be prepared for a fota system update in future in case you go the alternative way and flash my kernel (so you can revert to stock one to make system fota update verification phase to pass). That means the stock kernel backup is never to be patched.

For alternate use of my kernel, you may like to patch it to allow system and vendor partitions persistent modifications, but I would not recommend that either.

You can flash my kernel as is to avoid need to always boot the phone from usb and do all your customizations via magisk modules that use 'systemless' changes.

This way when you upgrade to next version, your customizations would be preserved without need to re-apply them. And you would not need to flash stock fw system and vendor partitions to revert changes for system fota update to pass the verification phase.

So patching my kernel to disable dm-verity is needed only in case you really need direct system modifications and either do not care about fota or be prepared to flash current full stock fw before test of fota system update to next version.

The patching itself could most likely be done on any magisk running phone, but I cannot tell for sure - that depends on magisk and magisk manager implementation.
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] Cyanogen_Mod:
Yes, I did. I downloaded "boot-G8342-47.2.A.6.30-hideunlock-rooted.img" from #post 2 which is matching with my system. But when I disabled dm-verity by Magisk Manager and flash it to my phone, it just got a loop on Sony Logo. P.S. thanks for replying.

I got it, thx. But I want to modify system directly (too lazy to create a Magisk flashable zip ). Unfortunately, like my description above, it just failed. Thanks for replying!
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] lilbrat:
[MENTION=7768100]Cyanogen_Mod[/MENTION]

And there is your problem as those are the "regular" kernels, the "alternate" post #3 were only made for firmware version . 20, then j4nn did pre-releases for firmware version . 24 and .28.
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=4133204]lilbrat[/MENTION], the alternate kernels prepared by me are release only for oreo versions, because it is not that easy to convert "regular" to "alternate" in oreo case. With pie versions, the process is easy and therefore anybody wanting the alternate use should convert themselves.

[MENTION=7768100]Cyanogen_Mod[/MENTION], could you please stop full quoting big posts when replying right under them? I believe it does not provide any benefit, does it?

Anyway, I can only suggest to flash full stock fw and from the running version patch via magisk manager the regular kernel into alternate one as described. I've tested that with v6.1.0 magisk manager, cannot tell if it works the same way with other version.
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] Cyanogen_Mod:
[MENTION=4418980]j4nn[/MENTION] Sincerelys orry about that, I am really unfamiliar with the operation on XDA forum.... ? Now I have edited it to reduce consumption of the space.

The Magisk Manager that I am using is 7.1.1, Magisk 18.1. I will downgrade it later to test if it works, and then post the results here. All in all, thanks for your help!

--------------------------------------------------------------------

Updated: Running on full stock environment (system, kernel, etc), disabling dm-verity by Magisk Manager 7.1.1, Magisk 18.1 and flashing it, works fine. Thanks for your solution!
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
updated post#2: added hideunlock rooted kernels for 47.2.A.10.28 fw.

(pre-released version did not include few most likely security fixes)
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
Repacks of pie 10.28 kernels for 10.45 firmware versions are posted in the temproot thread post#874.
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] Klaus N.:
[MENTION=4418980]j4nn[/MENTION]

I have updated my XZ1 to 10.45 fw. And now I ask myself, if - from the point of security - it's better to flash your pre-release of hideunlock rooted kernel, or to flash the drm fix by modpunk?

Thanks in advance!
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=4898998]Klaus N.[/MENTION], in my opinion, there is no need to go after the latest security patch of a kernel itself, particularly if you can use a previous one.

Running latest security patch of system, i.e. all userspace libs/apps/services secure, would not allow a malvare/hacker to obtain execution rights at all.

Kernel security level is useful only after the intruder already has execution rights in order to escalate to full root level.

And I can tell you from my experience, that is not easy at all even if you have physical access to the phone (vs remote attack).

So having one level older - no big deal at all imho.

Concenring the secd ignore unlock patch for pie - as mentioned it does not cover all unlock checks in the fw, I would not consider it as a full alternative.

Changing system/vendor partition is not nice either (for fota possibility).
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
Updated post#2: added hideunlock rooted kernels for 47.2.A.10.45 fw.
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] lilbrat:
Hi.. I know it's against the rules to ask.. But are we going to get an alternative version... Thanks..
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=4133204]lilbrat[/MENTION], not sure what rules do you mean, but "alternative use" is described and the kernels to be used are those released, you just need to disable verity in them (in case of pie, oreo variants released specifically) - just follow to post#3, where is a link to this post, where you can read this:
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] lilbrat:
I drinking and posting last night.. I was just asking due to you having one post here the fota kernels (the fastboot ones) then there is one for the alternative use ones.. The normal one I see was updated to the latest firmware version, while the alternative wasn't.. That's all.. So all I need to do download the latest version, patch it and flash it..

Sorry for confusion..
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] SGH-i200:
If a new firmware has been released, I wait for the new (pre)release rooted kernel. If it is available, I flash the newest firmware via newflasher and than boot to TWRP and flash the kernel from there and flash the latest Magisk ZIP right after to remove verity.

There is no need for an 'updated alternative kernel version'!?
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
Updated post#2 and post#3: ported my patch of magisk for sony ric daemon to magisk-19.1 and repacked oreo kernels with it (link to source code updated in OP):

boot-G8341-47.1.A.16.20-hideunlock-magisk-19.1.img

boot-G8341-47.1.A.16.20-hideunlock-magisk-19.1-noverity.img

boot-G8342-47.1.A.16.20-hideunlock-magisk-19.1.img

boot-G8342-47.1.A.16.20-hideunlock-magisk-19.1-noverity.img
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
Added a poll asking about form of future releases of my unlock hiding kernel - please vote.

Thanks.
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] lilbrat:
Hmm, where's the poll?
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=4133204]lilbrat[/MENTION], at the top of each kernel variant thread :)
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] lilbrat:
Poll doesn't show when on the labs app.. but voted..
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=4133204]lilbrat[/MENTION], hmm, that must be a limitation of the app, nothing I can do about it
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] lilbrat:
[MENTION=4418980]j4nn[/MENTION] .. All good..
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] SGH-i200:
[MENTION=4418980]j4nn[/MENTION] - SONY informed me on May 21 via e-mail that firmware 47.2.A.10.62 (May security patch level) is available for XZ1 (XZ1c?) Customized DE. Will you provide a prelease kernel, again or will you wait till there kernel sources are released?
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=1995555]SGH-i200[/MENTION], it is not that simple, to build a pre-release. I can try to repack the last kernel version to be bootable with the latest fw version, assuming there are not changes in the kernel at all or at least not some that would make the kernels incompatible. Because of that, the only way is to test it. As I moved to LineageOS 16 with my unlocked phone, it is difficult for me to test stock kernel - it would mean full flash of stock fw including factory reset. I might do a repack without testing if you like.
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
And it would be nice if everybody who likes to use this kernel voted about the form in which the kernel should be released. Not many votes there yet - is the target audience really that small?

I wonder if the effort is worth it then.
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] lilbrat:
[MENTION=4418980]j4nn[/MENTION], first off I do really appreciate your time and effort you put in on this but I imagine like you said your target group here is a bit smaller.

That could be due to a number of reasons, a) how many folks had already unlocked their BL in Oreo and just used the drm fix at the time (keys lost), b) those who are not tech savvy as when you first look at how to downgrade, then backup and the restore the TA ect .. is a bit intimating and folks don't have the patience to do it.. c) Though at least with the XZ1 kernels you do (and I'm a bit lost ) on the one that to use fota, you can't change anything in the system ( there goes my main reason ) it's the first thing I do is debloat my phone.. and to use fastboot everytime I reboot my phone would be a killer, that's the reason I use your "alternative" method.. I do a fresh install with each new update takes me about 45 minutes and I am good to go for the next month..

I would like to see a kernel with your " alternate " use with a touch of the Zest kernel from the xz premium side and add in d2tw.. I can wish..

But thanks again for your time and effort ..
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=1995555]SGH-i200[/MENTION], [MENTION=4133204]lilbrat[/MENTION], so here is a repack of pie 10.45 kernel to be bootable with 10.62 firmware - not tested at all - please test it and let me know if it works.

It is pre-rooted with Magisk-19.2 (keeping the form as before as the number of votes is quite low to be any conclusive).

boot-G8341-47.2.A.10.62-hideunlock-magisk-19.2-kernel-10.45.img
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] SGH-i200:
Thank you so much! I will test this kernel as soon as I have downloaded the newest firmware after work! :svetius:
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
Testing procedure:

- upgrade either via fota or full flash of pie 10.62 fw

- try to boot the kernel via 'fastboot boot boot-G8341-47.2.A.10.62-hideunlock-rooted-kernel-10.45.img' (after rebooting to fastboot via a command: 'adb reboot bootloader' or 'fastboot reboot bootloader' depending on phone's state)

- if it boots up, test few functions, like wifi, camera, etc...

- if it does not boot, either it reboots itself or you can force a hard reboot via 'power' and 'vol-up' buttons held for several seconds simultaneously

- your stock kernel would boot up then (since you've upgraded to latest fw and not flashed any custom kernel yet): unlock would not be hidden, but that should not be a big deal as camera works in any case
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] lilbrat:
Will flash it later today ( almost 2 am here) and I need to do a backup as I find Magisk 19.2 a bit buggy.. thanks
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=4133204]lilbrat[/MENTION], here is the variant without pre-root:

boot-G8341-47.2.A.10.62-hideunlock-kernel-10.45.img

but I would appreciate if the variant with magisk-19.2 could also be tested to see if it worked in general (not considering that magisk release bugs).
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] lilbrat:
[MENTION=4418980]j4nn[/MENTION], don't shoot me but I have the dual version..
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] MartinX3:
[MENTION=4418980]j4nn[/MENTION] sToRm// is back ;)
[Sony Xperia XZ1  ROMs, Kernels, Recoveries, & Othe] j4nn:
[MENTION=6031898]MartinX3[/MENTION], I am not sure what are you trying to tell us here.