Magisk on z3 compact - Xperia Z3 Compact Q&A, Help & Troubleshooting

Hello guys,
I have a problem installing magisk on my Sony Xperia z3 compact with android stock 6.0.1 in order to root my phone.
Today, for the first time, I unlocked the bootloader and I installed TWRP recovery.
I tried to install the latest version of magisk (v. 18.1) via TWRP, but it shows "Error 1".
I read in the XDA forum that I should flash the boot.img and then I should reinstall magisk.
What I don't understand is where I can find this file "boot.img". I have a stock rom.
Can someone help me?
Thanks!

Related

[Solved] Magisk?

Solved: See this post.
After the recent SuperSU 2.81 update sent my Z3C into a boot-loop I came across a few comments on this XDA article saying that MagiskSU is the way to go these days.
Now, I gather from this thread that the best way to root is to just install stock Marshmallow and run the provided installer then flash a root binary via TWRP.
However, the FAQ in the official Magisk post states:
Sony Devices: If you're using stock kernel, it is using Sony's special ELF format. Magisk will repack it to standard AOSP format, which requires your device to be unlocked.
Click to expand...
Click to collapse
So, if the bootloader needs to be unlocked to install Magisk, does that mean you can't have the phone's DRM features active? Or is it possible to restore the DRM stuff after Magisk has been installed (assuming you've backed up the DRM keys)?
Also, does the fact that Magisk repacks the kernel mean SafetyNet will always fail on a Sony device, regardless of Magisk Hide being enabled?
I'm on latest MM and no problems with new SuperSU. All latest updates installed and 2.81 and 2.82 are working well.
Chamelleon said:
I'm on latest MM and no problems with new SuperSU. All latest updates installed and 2.81 and 2.82 are working well.
Click to expand...
Click to collapse
I guess you must be lucky then since Chainfire has advised Xperia users to stay on 2.79, as per the news article I linked.
Still, regardless of whether SuperSU works for some people or not, I'd still like to find out if MagiskSU is a viable alternative for Sony devices and what the correct procedure is to install it and retain all the phone's features.
Did Your SuperSU app was converted to system app? Mine wasn't, maybe thats an answer.
Chamelleon said:
Did Your SuperSU app was converted to system app? Mine wasn't, maybe thats an answer.
Click to expand...
Click to collapse
Possibly; can't remember to be honest. Anyway, flashing back to 2.79 fixed the boot loop and I've disabled auto-update until Chainfire says otherwise.
I still want to learn about Magisk though; not keep discussing SuperSU
I found a few bits of info on the subject:
RootKernel can apparently repack the stock kernel with a DRM fix so that all the DRM features can be restored with an unlocked bootloader.
BootBridge can install Magisk without repacking the ELF kernel in AOSP format, which the author says is preferable. However, BootBridge itself requires an unlocked bootloader so the DRM is still an issue I guess... <-- This is only meant for specific older devices; not the Z3C.
Magisk Patch claims Magisk won't work without disabling Sony RIC and provides a fix if you haven't used RootKernel already.
Trying to piece it all together is a little confusing so if anyone has actually done it, I'd be interested to hear from you.
Do we even need the SuperSU updates? 2.79 works fine for me without any issues plus the new versions are maintained by the Chinese company (I'm using some different version compiled by Chainfire himself). The only problem is the update notification in Play Store tho....
nogaff said:
After the recent SuperSU 2.81 update sent my Z3C into a boot-loop I came across a few comments on this XDA article saying that MagiskSU is the way to go these days.
Now, I gather from this thread that the best way to root is to just install stock Marshmallow and run the provided installer then flash a root binary via TWRP.
However, the FAQ in the official Magisk post states:
So, if the bootloader needs to be unlocked to install Magisk, does that mean you can't have the phone's DRM features active? Or is it possible to restore the DRM stuff after Magisk has been installed (assuming you've backed up the DRM keys)?
Also, does the fact that Magisk repacks the kernel mean SafetyNet will always fail on a Sony device, regardless of Magisk Hide being enabled?
Click to expand...
Click to collapse
actually, i have my DRM partition and Magisk on my z3c UB. Here is what i did, first i did patch boot.img with magisk and then used ta-poc tool to restore my TA-backed up partition. oh! magisk hide works properly as well giving me full access to SafetyNet.
espaciosalter20 said:
first i did patch boot.img with magisk and then used ta-poc tool to restore my TA-backed up partition
Click to expand...
Click to collapse
I finally got a chance to try this out and I'm not having much success to be honest.
I'm starting off with an unlocked bootloader and flashing stock MM 23.5.A.1.291, then flashing TWRP.
In TWRP, the current version of Magisk (v14.0) refuses to install; it just complains about Sony ELF32 format and instructs me to use BootBridge, which is only supposed to be required for older devices like the Z2.
Anyway, I tried installing Magisk via BootBridge and it claims to have installed successfully, but then Magisk Manager says Magisk is not installed when I boot into Android (yes, I've rebooted a couple of times as well).
Next, I started over from the beginning and tried Magisk v13.3 instead, which at least begins to install, but then fails to patch the boot image.
Does anyone have a working method they could describe here?
Solution
I figured it all out by myself in the end. For anyone else having trouble, here's what I did:
Made sure I had a backup of my DRM keys!!! I already had one from when I first rooted my phone on KitKat, but I decided to make another backup using Universal TA Backup v2, just in case anything was wrong with the original.
Obtained the official Marshmallow 23.5.A.1.291 firmware from XperiFirm, created a .ftf file with Flashtool, unlocked the bootloader on my device and flashed the .ftf file via Flashtool.
Flashed TWRP custom recovery via fastboot.
Extracted the stock kernel.elf boot image from the .ftf file using Flashtool.
Ran ta_poc on the kernel.elf file, answering "Y" when prompted to disable Sony RIC*. This produced a repacked boot.img with the DRM features added back in.
Copied the boot.img to my SD card.
Booted to Android and installed the Magisk Manager apk.
Used the "Install" button in Magisk Manager and selected the boot.img on my SD card.
Noted the location of the patched_boot.img that Magisk Manager created, then booted into TWRP and flashed patched_boot.img.
Booted back into Android and checked Magisk Manager status.
My device is now fully rooted, has all the DRM features intact and is passing all SafetyNet checks.
As an alternative to steps 7-9, you could simply flash the boot.img from step 6 via TWRP and then also flash the Magisk zip file via TWRP. You'd end up with exactly the same result at step 10.
I believe you could even complete the installation without TWRP or any custom recovery at all, by using Magisk Manager to create a patched_boot.img, then copying it to your PC and flashing it via fastboot.
* Disabling Sony RIC in my boot.img was what solved all my problems. This thread suggests you don't need to do that any more, but I couldn't get it to work without doing so.
Hi, I recently installed magisk 14, I get it to work. However, somehow it broke my wifi and LTE functionality. DNS NOT FOUND. I have a m4 aqua with 6.0.1 ver.1.33. Do you have any idea what could be the cause of this problem?
Enviado desde mi E2306 mediante Tapatalk
any know magisk for Z3 Compact Docomo MM 6.1 Bootloader Lock ?
Hi nogaff,
I tried your solution but there are two difficulties I can't resolve:
1) Where can I download a valid TWRP image for the Sony Xperia Z4 Tablet? My search in the internet was without success, and TWRP doesn't seem to support this device.
2) I used the same procedure to patch the kernel:
TA_POC'd the kernel with disabling DM-verity and disabling Sony-RIC
copied this image to a SD-card
put the SD-card into my SGP771
patched this image with Magisk 22.1 (this version of Magisk supports officially my Android 7.1.1)
flashed this image using FlashTool (because I don't have a TWRP recovery for the SGP771) - flashing ended without error!
BUT​​The SGP771 stucks in a boot loop!!!​​Can you tell me if I forgot something?​
Regards
Ansgar

can't install magisk`

i want magisk on my xperia z1 and use it but it can't be installed it fails when writing to boot.img
installing threw twrp makes phone go in bootloop no logo nothing had to reflash it to use it again
if anyone have xperia z1 with magisk and twrp can you please upload a recovery to use or can someone show me how to install magisk
Magsik is flashable through Boot bridge:
https://forum.xda-developers.com/crossdevice-dev/sony/mod-boot-bridge-sony-elf-t3506883
Read the whole first post and Follow the instructions for flashing magsik closely, Flash at your own risk.
it didn't work my device went into bootloop and no sony logo on startup had to flash twrp and recover boot
if can someone upload a twrp recovery with magisk and everything that would extremely help alot my device is xperia z1 c6902
Weird, it's working for me and I have magsik installed right now, did you follow the instructions step by step?
Yes i did and it didn't work
Can you please make a twrp recovery that contains boot only?
It might do the trick since my boot is the problem
Xperia z1 c6902

Boot Loops After Magisk Installation

I've been trying to hide root from an app with no luck from xposed and root cloak (and many other modules in xposed). So I discovered Magisk and decided to give it a go. I followed the instructions in the Magisk thread and unrooted my phone, downloaded Magisk and flashed with TWRP.
After the installation was "successful", I rebooted and just got boot loops after the Sony screen. I couldn't even boot into recovery. I'm assuming the cause of this was because I didn't have a stock kernel (I missed that part in the instructions lol). Anyway, to fix the boot loops, I flashed the kernel boot.img with fastboot.
I then tried installing Magisk with boot bridge, but got the exact same result.
So I'm gonna assume I need to go back to the stock kernel to install Magisk. Can someone help me with this? Or just point me in the right direction to installing Magisk? Would be very appreciated, cheers.
Phone info:
Xperia Z1 - C6903
5.1.1
14.6.A.1.236
using Kryptonian kernel
bootloader unlocked

TWRP + Magisk 19.3 on xperia z5 compact unsupported/unknown image format error 1

Sorry in advance I'm a noob.
So I unlocked the boot loader with fastboot on my sony xperia z5 compact.
Successfully installed TWRP, but got the image from this thread : https://forum.xda-developers.com/z5-compact/development/twrp-twrp-3-2-1-z5-compact-t3748952
As it seems that z5 is not supported on official twrp page ( https://twrp.me/Devices/Sony/ )
When I try to install mgisk 19/3 .zip via TWRP , it says "unsupported/unknown image format error 1"
I tried to install vai Magisk manager and I get the same error.
So I guess it' s a problem with the TWRP version I'm using ? Is there an alternative installation, or a compatible TWRP for z5 compact ?**Thanks for your help.

XZ1 compact no bootloader

Dear All,
My problems is that my xz1 compact has only TWRP working. (after badly installing lineage 15.1).
The file system seems ok, but I cant access the bootloader (not from the twrp neither from the button). Needless to say I cant install lineage as it fails and ends up in the TWRP.
Please Help, advise.
Thank you
Guy
guyxz1c said:
Dear All,
My problems is that my xz1 compact has only TWRP working. (after badly installing lineage 15.1).
The file system seems ok, but I cant access the bootloader (not from the twrp neither from the button). Needless to say I cant install lineage as it fails and ends up in the TWRP.
Please Help, advise.
Thank you
Guy
Click to expand...
Click to collapse
What firmware version did you have on the phone before you tried to flash Lineage?
The versions must match.
You could use newflasher and xperiafirm to reflash your phone to a working stock. Use Oreo firmware if you want to flash Lineage 15.
Then start from sctratch using the TWRP from the XZ1c thread.

Categories

Resources