yashsingh1/xdaforums huggingface dataset:
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
[MENTION=4173406]Kayant[/MENTION], I am sorry but I do not know any method to unlock bootloader in case it says that bootloader unlock is not allowed. The kernel is not useful, because with locked bootloader, you will not be able to boot it nor flash it.

My theory is that bootloader lock/unlock state might be possible to control without need of sony codes if qualcomm trust zone is exploited, getting full control over the soc. But I am afraid that is not going to happen.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Kayant:
Fair enough thanks for the detailed answer. Just started to learn about operating systems in my computer science class maybe I will start understand your awesome work more :)
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] SGH-i200:
You find the new version here: https://xdaforums.com/xperia-xz1-co...its-temp-root-to-backup-t3795510/post79002413

j4nn posted that link a few post above yours, but did not add the link to the 'Downloads' post of this thread (post no. 3), yet.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
[MENTION=1995555]SGH-i200[/MENTION], the kernels are not added into post#2 yet, because kernel sources have still not been released by sony. So it's a pre-release, just for the meantime, for experimentations. It can happen that the released sources would be the same as I've used (I've extracted the changes from sony release for different phones picking only the relevant stuff). But who knows, let's see...
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] goofnorf101:
I am on 47.1.A.16.20 with restored TA and I would like to be able to upgrade to Pie. I have annoying bugs at the moment like Smart Unlock not working and Do Not Disturb always defaulting to forever instead of the last selected time (like 1 hour) - it's driving me crazy.

I am rooted with Magisk, but I don't think much else. What is the best way for me to proceed with the upgrade?

Do I need to flash the stock boot partition for 47.1.A.16.20 ? Can I use fastboot or do I need to use newflasher?

After that I believe I can use fastboot boot to boot this kernel and then apply the OTA update (it is already offering it to me)

After installing that, how do I get root back again? I should flash one of these hideunlock kernels? Likewise do I need to use newflasher or can it be done with fastboot?

Many thanks. Sorry for the noobish questions.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
[MENTION=7394388]goofnorf101[/MENTION], the easiest upgrade for you is probably to download latest fw and flash it with newflasher.

You can achieve the same thing using my kernels with OTA system upgrades, but that would involve several steps to get from oreo to the latest pie. And in case you have system/vendor partitions modified, you would need to reflash stock oreo first in order to make ota verification pass to fota install go through.

Stock fw contains .sin files, you need to flash them in flash mode, not in fastboot mode.

If you use my kernels with unmodified stock fw, you can apply ota system updates, having root before and after - magisk is integrated already, you would just install magisk manager app if not having it already.

If you like to flash my kernel, you would do it with 'fastboot flash boot kernel.img'. But follow the "alternate use" howto, as flashing the kernel disables ability to install system fota update.

It is useful to use my kernel in order to re-enable all sony proprietary functions by hiding bootloader unlocked state, assuming locked TA (aka drm keys) had been restored.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
updated post#2: added hideunlock rooted kernel for 47.2.A.8.24 fw.

The pre-released version has been already pretty good. The only difference in compiled kernel is in "QTI WCD CODEC Soundwire controller" - the official released source code for xzp/xz1/xz1c contains an older version.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] SGH-i200:
Thank you very much again for the pre-released version! Sony should hire you, for sure! :good:
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] AndilX:
Hello guys, newbie here!

trying to get to root my xz1c but not sure if I am following the right guide, need some guidance as I am confused, please. At the moment my xz1c G8441 is on latest update 47.2.A.8.24, but my bootloader unlocker is on "no". Should I factory reset my phone and follow this guide? or?

Thanks in advance
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
[MENTION=9806203]AndilX[/MENTION], if your "bootloader unlock allowed" says "no", I am afraid, you are out of luck - no known method for unlock. You can backup your TA via the renoroot tools if you downgrade to supported fw version, but using sony website's unlock code most likely would fail.

I am not sure why some phones do not have unlock allowed - is your's kind of branded to some operator (simlocked too) or has it been sold on special sale or something?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] XDAMaxe:
maybe FYI: I've read somewhere that you have to connect to the internet to really check that dev option, so please assure to have internet access and check again.

Then goto https://developer.sony.com/develop/open-devices/get-started/unlock-bootloader/ to get your unlock code and proceed.

You also can check on your phone (if you hadn't already):

dialer: +#+#7378423#+#+

wait until the screen shows "service menu"

then go into "service info",

then "configuration"

watch Rooting status: bootloader unlock allowed: XXX

XXX has to be "Yes" if your bootloader is capable of being unlocked.

Otherwise you probably have a promotional or business device which sony provides outside the common market...
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] SGH-i200:
I read that in j4nn's instruction for renoroot! ;)
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] 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 Compact ROMs, Kernels, Recoveries,] cecato:
[MENTION=4418980]j4nn[/MENTION] I really appreciate your work on the kernel and maybe you should put a link to the first page for your 47.2.A.10.28 hideunlock pre-release kernels.

I don't care about the official ota update and I like to change the system partition, I'm on: 47.2.A.10.28_R2C and I'm using the original kernel with this patch.

Everything works fine, but I'd like to ask you: I might have some disadvantages compared to the kernel hiding bootloader?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
[MENTION=6240805]cecato[/MENTION], that secd patch even though looks like doing the same (ignore BL unlock) as my BL unlock hiding kernel does not do that to the same extent.

There is not only the secd binary that retrieves the bootloader state from trust zone - there are many other binaries doing it similarly.

They are using either direct TZ call or a statically compiled lib with api for that. Done in multiple binaries.

That is the reason drmfix cannot be implemented the same way as it was done in oreo - preloading dynamic lib is not effective because the critical functions are statically compiled.

So that secd patch fixes one thing - just the secd. Not the other binaries.

On the other hand, my kernel patch - it overwrites the to be returned bootloader state from TZ with "still locked" value on kernel level, so all binaries checking it get the faked value and do not need to be patched at all.

Even though I cannot point you exactly to differences with regard to user experience, I can see multiple binaries not fixed with the secd-ignore patch, so I would consider it incomplete.

For sure you cannot install system fota update with it - that may be one of the differences - but as you do not care, it's ok, still there may be something else still left...

But even in your case, you could use my kernel instead of the secd ignore patch and still modify system (if wanted) and do not install system fota update, it is all described.

Nevertheless I would recommend to use systemless modifications - that allows you much easier upgrades to next fw version - as stated in the XZp kernel variant thread:

Concerning a link to 47.2.A.10.28 hideunlock pre-release kernels - the link is not in the first post exactly because of the pre-release state. Anybody wanting this can get the link from a recent post in the thread. I do not see a problem with that. Normally we would need to wait till sony releases the kernel sources - did not happen yet...

Because of this I cannot be 100% sure that my kernel pre-release will match the official one.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
updated post#2: added hideunlock rooted kernel for 47.2.A.10.28 fw.

(pre-release version did not include few most likely security fixes)
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] williamgrant:
Lock BL? Or remove boot error screen?

Dear J4nn,

I unlocked my XZ1C, backup TA, restore TA, everything is good for me, but in my phone's LCD appearing yellow patches. I think my LCD is fault.

I want to send my phone to the service while my warranty time is not expired.

I tested the service with my Z5 phone, if no any error message while starts the hw, they don't check any software information ( i sent my Z5c with TWRP and open BL, the fixed).

My XZ1C shows in the start screen "Your device can't be checked [...] Please lock the bootloader". Okay Sony, I want to lock but how? :D

Have You any idea how can I remove that boot screen, or lock my BL again? I have the unlock code, and TA-unlocked.img .

Thanks,

WG
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
Dear williamgrant,

I am sorry, but it seems there is no way to re-lock the bootloader, not even with user-supplied signing keys for Verified Boot (that I've hoped for too) - see answers from sony employees here on their oss kernel github:

https://github.com/sonyxperiadev/kernel/issues/1838#issuecomment-444004080

Concerning your story, I hope you did your TA backup first, before the unlock.

And so you are having TA-locked.img, not only the TA-unlocked.img you've mentioned.

In any case, I believe that a hardware fault, that has not been caused by fall down for example, should be repaired under warranty regardless bootloader unlock.

You can easily argue, that unlocked bootloader cannot cause a LCD malfunction.

In my opinion, this argument is easier justifiable than proving, that the LCD malfunction had not been caused by a fall down for example.

I would also recommend you to check your local country law about warranties - most likely a vendor cannot remove warranty guarantees just because of something like bootloader unlock regardless what is written on that unlock page. In my opinion it is there mainly to scare ordinary users to avoid excessive use of unlocking.

It seems to me you are sad that with TA-locked restored, the bootloader is still unlocked.

Well, as discussed several times in the temproot thread, bootloader lock/unlock status is not stored in TA, like it had been with previous xperia generations.

Security is greatly improved with recent android platforms having verified boot protected in hardware, with a supervisor OS running in Trust Zone, that even android kernel cannot reach. Bootloader unlock/lock state is most likely represented by a chipset fuse not reachable from any software except bootloader itself, which needs sony signed control message to accept any request.

On the other hand, it is a positive thing that with locked TA restore, we can restore DRM keys and keep the bootloader unlocked to allow rooting of android.

So running unmodified stock firmware with root _and_ full TA restored including drm keys is possible without a need to inject dynamic libs to load drm key backed up into alternate TA unit like it was with some previous xperia phones.

Back to your warranty issue - I really believe you can be successful with it regardless bootloader unlock, if it is somehow a manufacturing fault.

Just try it, please.

j4nn
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Yokurt815:
I successfully backed up drm keys as posted in [XZ1c/XZ1/XZp] temp root exploit to backup drm keys implemented thread.

Next steps:

* started FOTA update

* 47.1.A.12.34 was installed and boots (with unpatched kernel), camera works too.

* when trying fastboot boot boot-G8441-47.1.A.12.34-hideunlock-rooted.img , I only get white sony screen shortly and it goes back to charging

(as I anyway wanted to update to Pie and skip many FOTA's)

* downloaded G8441_Customized CE1_1310-7123_47.2.A.8.24_R1C with XperiFirm

* intalled with newflasher (including boot; except ersist_X-FLASH-ALL-C93B.sin)

* directly tried to fastboot boot boot-G8441-47.2.A.8.24-hideunlock-rooted.img, but again white sony screen for a few seconds

* booting with untouched kernelworks

Any idea what could be wrong?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] cecato:
[MENTION=5088890]Yokurt815[/MENTION] Connect the phone in fastboot mode and before giving the command fastboot boot Kernel you must give the command: "fastboot reboot bootloader"
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Yokurt815:
You're right. And it clearly says so in OP. But it was late yesterday and I forgot that step.

I'll check in the evening when I'm back at home.

Shame on me, as soon as you follow the instructions it works :)

Thanks a lot!!!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] williamgrant:
Oh yes, I just wrote it wrong. The blobs and any other thing is ok.

No, I asked the service company (Cordon), and they said no more warranty if the BL is open.

Probably yes, but the Unlock allowed line in the service menu now on NO. (Before unlock was Yes)

I thought it could be fixed by software solution, because it used to work with my older Z5C. (via flashtool)

I tried relock now with the new version of FT (.25) but I have TA error message when click to BLU button.

If I understand it well, you say that it wasn't long ago but now it works like the Samsung's fuse in Knox Chip? It is very wrong news for me, I admit when opened the BL I hoped it will be closeable again (like Z5C).

Probably yes, but in the past It was about if you opened your BL without TA backup, you loosed all drm keys. However if You found a solution to save the TA before unlock (for example with an exploit) you could do to send back your phone to the support if there was any hardware failure.

Now I'll order a new LCD from ebay, and fix myself, but it is good if everyone knows now that FACT, when you open the BL, you'll REALLY-REALLY loose your phone's warranty. ;)

WG.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] SGH-i200:
Sony has released 47.2.A.10.45 for the XZ1 "Customized DE" today! ;) Should I wait for your pre-release version or flash your final 10.28 for XZ1?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
[MENTION=1995555]SGH-i200[/MENTION], that is a surprise, I wonder what are the changes?

I guess you better go with the 10.28, who knows, when sony would release the new sources.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
[MENTION=5088890]Yokurt815[/MENTION], thank you for your donation.

[MENTION=4562655]williamgrant[/MENTION], I guess the warranty success with unlocked bootloader depends on a country jurisdiction, seller's (and/or the authorized service) friendliness and your persuasion.

I know for real that phone with unlocked bootloader can be repaired under warranty, but it obviously depends on all circumstances.

I agree that the boot up warning screen does not make it easy though.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] SGH-i200:
You are suprised that SONY does not wait till the end of april to release the firmware which includes the april security patches? :)
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
[MENTION=1995555]SGH-i200[/MENTION], right, the thing is that with the delay they release corresponding source package I can build a version few days before the next update becomes available.

I could repack the 10.28 version with hope that it is compatible with 10.45 and "pre-release it", but I am not sure, if it is worth it (obviously if there were security fixes in stock, they would not be present in the pre-release, similarly as it has been with 10.28).

It's a shame that sony does not simply push the kernel changes to their kernel-copyleft tree on github. If they did (and on time), it would be much easier.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
Anybody wants to test if kernel from 10.28 repacked for 10.45 works?

Here is the repack for xz1c.

I did not test it, do not want to reflash to that latest stock fw at the moment - so it may boot just fine if compatible or you get a bootloop if not.

boot-G8441-47.2.A.10.45-hideunlock-rooted-kernel-10.28.img
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Collongite:
Everything works fine. Thank you :)! I can not upload a screenshot.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
Repacks of pie 10.28 kernels for 10.45 firmware versions are posted in the temproot thread post#874.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
Updated post#2: added hideunlock rooted kernel for 47.2.A.10.45 fw.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] albenex:
Dear j4nn,

thank you for your work.

previously i followed your guide regarding TA partition backup & BL unlock

i flashed latest stock Customized IT (10.45) and relative kernel.

DRM keys seems fine and also Video Enhancer works well.

Safetynet shows all green

however i'm facing issue with many apps claiming phone is rooted (probably they found SU user).

i've also tried magisk hiding with no success.

my question is:

-am i missing something in order to make app working fine even with this kernel?

-is a unrooted version of this kernel in order to get sony DRM stuff working along as regular apps not detecting root?

i don't care much about root but i do care with apps like NowTV (GOT fan here :P) and bank ones.

thank you in advance

Regards,

Alberto
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] cecato:
Some apps only detect the name of magisk, if you have this problem you can

Try going to magisk settings/ hide magisk manager and Install magisk manager with a random package name It should solve.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] albenex:
first i've tried uninstalling magisk manager itself but with no success.

root checker by superSu detected that SU User was present so i fear these apps detect this one

installing fotakernel.sin from original FW, SU User will disappear and apps work well but i'll miss sony stuff.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
Dear [MENTION=5171695]albenex[/MENTION], although I would also assume it should be possible to resolve this with use of magiskhide and other settings, I've uploaded not-pre-rooted kernels for the latest fw version into my experimental folder here.

So you can clean up all traces of magisk (factory reset may be needed to be sure) and use a boot-*-47.2.A.10.45-hideunlock.img kernel to test it. Also be sure to run unmodified stock fw.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] albenex:
Thank you very much. I'll try it ASAP and revert.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] albenex:
proceeded flashing unrooted kernel on clean stock fw and eveything work fine, both sony DRM stuff and root-aware apps, thanks!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] fred0r:
[MENTION=4418980]j4nn[/MENTION]: Keep up the good Work !
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
[MENTION=4353139]fred0r[/MENTION], thank you for your donation.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] fred0r:
I dont know if this is the right place:

Updated from 47.1.A.16.20 to 47.2.A.4.45 via newflash - before i did a backup of my TA.

Then used your Kernel to install TA, Magisk and Adaway.

Now after every reboot, i need to redownload the latest Adaway-Updates to get it enabled at all.

Normally the last Update done on Adaway was used automatically after Reboot.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
[MENTION=4353139]fred0r[/MENTION], this is most likely caused by magisk systemless hosts support (for adblockers) - when you click on it, a module to support systemless hosts is added into active modules list. It most likely is not persistent (did not check though), so when you reboot, you need to re-download.

Most likely AdAway is not designed to work as a magisk module with persistent hosts support in systemless way.

If you do not use systemless way, the cause may be in not disabled dm-verity in the kernel - it can happen that verity module even reverts changes in system partition if they are "small".
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] danish0175:
Sorry [MENTION=4418980]j4nn[/MENTION] i asked you in the wrong thread ,I meant this kernel ;can it be used on los 16 to hide bootloader unlock
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] nAµ'izat:
hi All!

i made a nonchalant mistake - attempted updating Magisk, as it was continuously vexing me to do so. Natural result was bootloop (begin to get suspicious whether i can install anything Magisk without getting into one). Re-flashed the rooted boot img, but Magisk remains uninstalled…

What would be a recommemded course of action to regain root? Asking because i have no idea of the level of Magisk's integration (maybe the kernel only works with the pre-installed v18.1), and of course because it's easier to just follow already cooked up recipes ;)

Thanks!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] fred0r:
[MENTION=7773350]danish0175[/MENTION]: Try by yourself booting the corresponding Kernel using Fastboot - by this you wont install it, you just boot it.

---------- Post added at 04:15 AM ---------- Previous post was at 04:05 AM ----------

How did you try to update Magisk ?

First Update Magisk Manager and then it should work by using the 'recommended' install

I had no Problems updating it.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] nAµ'izat:
Yes, that is what i did, chose to restart, and got awarded eternal bootloop. Now that i re-flashed the rooted boot img, Magisk still asks for the latest version.

Maybe i should try flashing it via twrp..

thanks

· intalling via twrp results in the same bootloop

· as a last resort, tried patching the already patched rooted boot img - of course no luck with that either.

What might i be doing wrong?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] 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-G8441-47.1.A.8.49-hideunlock-magisk-19.1.img

boot-G8441-47.1.A.12.34-hideunlock-magisk-19.1.img

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

boot-G8441-47.1.A.16.20-hideunlock-magisk-19.1-noverity.img
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Joper_:
After update to 47.2.A.4.45 via FOTA and booting corresponding kernel through fastboot, can not install magisk. Magisk Manager shows that magisk isn't installed. It seems it's not rooted properly?(

What's wrong?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] nAµ'izat:
Thanks again, works like magiC!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
[MENTION=7140676]Joper_[/MENTION], I guess you've booted stock kernel. 'fastboot boot kernel.img' command just boots the kernel from usb, it does not flash it (that's intentional to keep the fw untouched in order to be able to install system fota update). You need to 'fastboot boot new-fw-version-rooted-kernel.img' in order to have unlock hidden with magisk manager providing root. Or see the alternate use guide if you like to flash the kernel.