yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Android Development] ninestarkoko:
I already knew you cannot modify /system partition, but gaining root priviledges, even temporarily, should allow backup of TA partition (and might also allow setting SELinux to permissive mode) and so the possibility to completely revert to factory state (stock image, locked bl and original DRM keys) in case of need, for example to avoid any problems with warranty service (every Country has its laws about hardware defects) or simply to go back to a fully clean functional rom.

Correct me if i'm wrong :)
[Xperia Z5 Android Development] arismelachrinos:
Root video tutorial

i just made a video on how to root the z5 , for those who need help here it is https://youtu.be/dTlosea6SJE
[Xperia Z5 Android Development] tobias.waldvogel:
New kernel repack package

I just created a new automatic kernel repack package, which modifies the installed stock kernel in order to

- disable dm-verity

- disable sony ric

- add TWRP

http://xdaforums.com/xperia-z5/development/root-automatic-repack-stock-kernel-dm-t3301605/post64990566#post64990566

:D
[Xperia Z5 Android Development] azaide:
Guys, sorry if it's been asked before but this is my first Sony device since the P800-P910 days :)

Now that I was able to successfully root my Z5 using this method. (Many Thanks), Should I still expect to receive the upcoming MM update when it is pushed out? Dunno how Sony deals with unlocked bootloaders etc. I'm obviously just running rooted stock but I did delete most of the Sony bloat. Thanks in advance!
[Xperia Z5 Android Development] Duvel999:
OTA is possible, but don't update by pc companion.

That bricks your phone.

Better use flashtool or a custom rom.

Sent from my E6653 @ XDA Portal
[Xperia Z5 Android Development] azaide:
Thanks for the reply. Just to clarify, won't the official update via ota and doing ot via pc companion just flash the same z5 mm update? So this means just don't take the official version and just wait for a custom rom?
[Xperia Z5 Android Development] Duvel999:
Yes wait for custom rom

Sent from my E6653 @ XDA Portal
[Xperia Z5 Android Development] emko7:
E6683 kernel

Hi,

Is this kernel compatible with the E6683 dual, or is just the recovery for the E6683? Can I use this kernel, or do I need to use the one from post #67?
[Xperia Z5 Android Development] uripiruli:
Someone is working about root with locked bootloader?? Are there some advance about it?? Sorry for my curiosity and my poor english.

Enviado desde mi LG-D802 mediante Tapatalk
[Xperia Z5 Android Development] uripiruli:
Silence in this thread it's so bad...
[Xperia Z5 Android Development] neonixxx:
Honestly, don't expect much to happen with this device. I hate being "that guy", the negative naysayer, but the Z5 is a poor phone for its price. The Z3 still runs better than it, gets WAY better battery life, has an established development community, and can be bought for a fraction of the Z5's cost. It seems the Z5 didn't sell all that well overall and the Compact and Premium seem to have sold better than the standard one (at least around these parts), so development is especially stagnant here. And the Z5 certainly won't be selling much more now with the Xperia X line revealed and coming. I consider the Z5 dead and gone for development.
[Xperia Z5 Android Development] uripiruli:
You don't bury Z5 so soon. I'm positive with this device. We just need a boost with the arrival of M and root. For me Z5 is very good, it has all I need. I don't understand why a lot of people atack it so much.... :silly: When the new X series will arrives I think so the price of z5 will be more cheaper than it and the sales will grow up. And Finally if there aren't devs for our z5.... this will be a good excuse to learn to cook us :cool:
[Xperia Z5 Android Development] a00r:
not to mention the problems that are begining to surface
[Xperia Z5 Android Development] neonixxx:
What problems are beginning to surface?
[Xperia Z5 Android Development] a00r:
well I can speak from experience and search xda here, you will find some users who are having serious battery life issues, my phone cannot last longer than 5 hours on standby, it gets very hot when charging and takes hours to charge fully
[Xperia Z5 Android Development] roke2:
I don't think so. From experience, the battery last two days on standby, and gets a full charge in less than a couple of hours. Unless some apps (especially those using mobile data) are running in background. It gets very hot when charging only when you are using your phone while charging. I had my setting restrictions at most 2 apps running in background.
[Xperia Z5 Android Development] a00r:
I'm not speaking for everybody but it does have problems , like here

http://xdaforums.com/xperia-z5/help/heating-charge-loosing-problem-t3325490
[Xperia Z5 Android Development] roke2:
Well, sorry. I guess it's just a software bug. I just bought my z5c and immediately updated its firmware with the latest release. My advise is enable Don't Keep Activities or Background Process Limit: 2 under the Devs option.
[Xperia Z5 Android Development] NUTELLICA:
Hello everyone who still here !

I've a problem trying to root my Z5.

I've unlocked my bootloader, I've install the adb drivers, Android SDK, platforms-tools but I've always the same error :

sending boot

OKAY

wirting boot...

FAILED (remote : command not allowed)

Can someone tell me if they have this issue before, and how solve it?

it's been twoo days I'm searching and triyng to do what I see but I can't go any longer of that issue.

Thanks everyone !
[Xperia Z5 Android Development] Zarreck:
I have a E6683 Premium Dual running 32.1.A.1.163 marshmallow 6.0, and I'm a bit unsure where to go. I've read that there might be a difference in kernels between premium and regular but can't really confirm, I've also found prepackaged kernels for 31.1.A.1.163 but they appear to be for a different model.

Anybody able to point me in the right direction? I don't know what's safe to flash onto what and any information would be hugely appreciated!

Edit: Nevermind, I'm in the wrong forum.
[Xperia Z5 Android Development] ivanmemento:
Hi, to all :D since i brought this phone, i feel that will be more difficult than my old z1compact, when the root process was complicated, this one is a bit more :) I was on the dirty root method of z5 up here , and i did not find the link of 5.1 stock rom (i mean was removed) I want to ask if someone can give me a suggestion, because the stock before 6.0 was good and many apps works correctly, at the end with root and 5.1 i think is a good product and something like call recorder will work again (not like now that 6.0 is locking all this kind of features) By the way i understand that Backup of TA partition is not possible if i don't do root and need to unlock bootloader (and this is normal) but the best way to do this kind of "project" what is? --- I found 32.---A---200 firmware on line that is last for 5.1 (really don0t know what is the personalization and i guess there is italian in it) somebody can give me a suggestion if i can use this firmware to get back lollypop and do root ? thanks a lot i hope have write not so bad with my english :P
[Xperia Z5 Android Development] CloudOneX:
Is the DRM Patch working on Marshmallow?
[Xperia Z5 Android Development] :
[deleted]
[Xperia Z5 Android Development] slayerz:
Greetings Tobias,

Is there any chance you make an updated flashable zip for Android Nougat? I get a bootloop when using it.

Kernel drm fix is not a solution as it has a some modifications that messes certificates or something that makes my VPN app (VPN Unlimited) fail to launch.

Perhaps you could guide me into modifying the system files myself (editing hex codes?).

Thanks.

Kind regards
[Xperia Z5 Android Development] Devo7v:
Sounds like your VPN app is performing a SafetyNet check. I would suggest following all the steps in the thread below to pass SafetyNet, this should get your VPN app working again. If you're already on Stock 7.1.1 then you only need to flash the modified kernel, recovery, and Magisk.

https://xdaforums.com/xperia-z5/development/kernel-stock-kernel-safetynet-patch-drm-t3616606
[Xperia Z5 Android Development] slayerz:
Thanks for the input,

I have no problem running it with modded kernel and being rooted. It's just the DRM fix that messes it up.

Prior to Marshmallow, I have been using the flashable drmrestore.zip, and the VPN app worked fine.

It's actually after finding out and trying magisk/SafetyNet that I resorted to reviving this thread.

Didn't manage to get a SafetyNet pass though, I'm on Z5P.
[Xperia Z5 Android Development] Devo7v:
Did you enable Magisk-hide in the settings?

The only way you're going to pass SafetyNet is if you have not modified your system partition. Once you modify that, even Magisk can't help you pass SafetyNet, you'll have to start over and reflash the entire stock ROM.
[Xperia Z5 Android Development] slayerz:
Did so just after updating to 7.1.1 and MagiskHide was on by default.

But then again, I have system apps frozen in Titanium Backup, which remains as such even when new firnware is flashed.

Just been reading, its possible there were leftovers from SuperSU, trying a 'unSU' to clean stuff.

Will investigate those and report if I get it a pass.

Thanks again.
[Xperia Z5 Android Development] sheri khan:
is there any video tutorial for this and will it work on sony z5 docomo so-01h?
[Xperia Z5 Android Development] harfot:
Well, at least it still works on 32.0.A.6.152 with "old" kernel from OP
[Xperia Z5 Android Development] nilezon:
No, sorry.

I don't have any build environment set up for regular Z5, so I cannot easily re-compile the kernel.

I was hoping someone who owns a Z5 would step up to the task.

Right now I'm busy fixing Z5 Compact TWRP.
[Xperia Z5 Android Development] bazhip:
Any chance you could put down some instructions? I've never done it but been curious. Or point me to where I could find some?
[Xperia Z5 Android Development] nilezon:
Sure.

Download your kernel source code from here:

http://developer.sonymobile.com/downloads/all-android/

Latest seem to be:

http://developer.sonymobile.com/dow...rchives/open-source-archive-for-32-0-a-6-115/

Instructions from Sony:

http://developer.sonymobile.com/kno...h-a-linux-kernel-from-sony-copyleft-archives/

But remember, this is a fairly though task for a new developer. Good luck!
[Xperia Z5 Android Development] bazhip:
Sweet, thanks. Then, what needs to get changed to allow for root and make /system writeable?

Appreciate the help
[Xperia Z5 Android Development] nilezon:
As I wrote earlier, you need to disable Sony RIC in the kernel config:

CONFIG_SECURITY_SONY_RIC=n

Start with building a kernel using default config, following Sony's instructions.

When you get that going, I'll be glad to help you configure the kernel.
[Xperia Z5 Android Development] bazhip:
Alright... I built the kernel, but I having a heck of a time with step 8 and forward. Where on earth do I get the ramdisk to combine with the kernel to make the boot.img? I downloaded the stock .ftf file, and extracted the kernel.sin, but I can't extract that because apparently flashtool doesn't support the 64 bit processor inside of it yet.

---------- Post added at 03:52 AM ---------- Previous post was at 03:19 AM ----------

Scratch that. I opened it up in a hex editor and pulled out the ramdisk. Although now, since I never had a boot.img and didn't use unmkbootimg, how do I figure out the command needed to repack it?

---------- Post added at 04:49 AM ---------- Previous post was at 03:52 AM ----------

Okay, a lot of talking to myself. I just realized that you provided a boot.img. Anyways, I took your ramdisk and the kernel I compiled and used mkbootimg, but when I fastboot boot it, it says "remote: dtb not found". So, I started over, and just tried to unpack and repack yours, and I got the same error. Bleh. The kernel compilation was the easy part. I have no idea how to pack this together apparently.

---------- Post added at 04:58 AM ---------- Previous post was at 04:49 AM ----------

HOLY @!$# I DID IT! For some reason (I know nothing about this) unmkbootimg wasn't crapping out a dt.img file. I ended up using this: https://github.com/xiaolu/mkbootimg_tools and that did it wonderfully. Any chance you could give me a run down on how I *should* do this in the future? I have no idea how I would have gotten the ramdisk and dt.img if it wasn't for your boot.img. So, I guess I'm wondering what I would do if I didn't have that. Anyways, how should I modify the config to make /system properly writable? I know you said to set the CONFIG_SECURITY_SONY_RIC=n, but is that the only thing I need to do?

Thanks!

---------- Post added at 05:28 AM ---------- Previous post was at 04:58 AM ----------

I hate everything. The README of all places. That is all I needed to know. I have wasted so much of my life :)
[Xperia Z5 Android Development] nilezon:
Did I forget to mention the README_Xperia file? Oh, my bad ;)

Anyway, mkboot from mkbootimg_tools is way better than Sony's tools, as you seem to have discovered.

You should at least disable Sony RIC and DM VERITY in your kernel. This commit shows you how:

https://github.com/Tommy-Geenexus/a...mmit/09d8253cd1c8bc2182a4df1f3325cd94e8a1e75b

You can, and should, extract ramdisk, kernel and dtb from stock firmware with FlashTool. You can download and decrypt the firmware with XperiFirm (now integrated into FlashTool) and then extract the kernel using first the SIN editor/extracor (dump RAW, if I recall correctly), and then the ELF extractor. You will end up with three files: kernel, ramdisk (gzipped cpio) and dt image.

You can use your own kernel (zImage) with the stock dt.img. The ramdisk you should unpack, modify and re-pack.

Changes to ramdisk:

In default.prop, set ro.secure to 0 and debuggable to 1.

Optional is to remove "verity" flag on /system in fstab, but shouldn't be required if you disable DM VERTY in your config.

Also optional is to disable Sony RIC service in init.sony-platform.rc, but should not be required when RIC is disabled in config.
[Xperia Z5 Android Development] Tommy-Geenexus:
Thats right.

Also [MENTION=2458514]bazhip[/MENTION] should use dtbtool v3 to build the dtb's.

Its on CAF's cgit, you need to compile it from there.
[Xperia Z5 Android Development] Sebi673:
What I (and maybe We) need is:

-Ability to backup TA, relock bootloader, restore TA - we're paying extra on the Z5 to have all the sony goodies in an elegant waterproof shape.

-DRM restore MOD compatibility would be a nice workaround.

In the meantime I'll keep my card in my wallet and keep on lurking for a friendly root method for the mighty Z5 (maybe LB - i wish).

My Xperia Z would be useless without xposed fully working n without root to mess with fw. I want the Z5 so bad.... :))))
[Xperia Z5 Android Development] bazhip:
Awesome, thanks for the info. This has been surprisingly fun, even if I did spend all night doing it. A lot of learning. Quick question: So, with Sony's instructions, I get 'Image' instead of 'zImage'. Some googling told me that the zImage is a compressed version. Should I be shooting for that with mkbootimg_tools, or is the Image fine? Also, if so, what option do I use during compilation to do the compression? I tried looking on my own, but due to the nature of the naming (Image), it makes it really tricky to google.

Appreciate it!
[Xperia Z5 Android Development] nilezon:
Yes, building and running your own kernel gives you such a warm fuzzy feeling :)

In arch/arm64/boot you have both Image and Image.gz (compressed), but as far as I know, you should still use the uncompressed one: Image

Just rename it to zImage so that mkboot finds it.
[Xperia Z5 Android Development] bazhip:
Ah, okay. I was going off of http://stackoverflow.com/questions/22322304/image-vs-zimage-vs-uimage, so I thought I was outputting the wrong file.
[Xperia Z5 Android Development] bazhip:
Bleh... I must be doing something wrong. I think something is going wrong when compiling the kernel. When I compile it stock (or with the config modifications) it comes out to 25.2MB, instead of 24.5MB like the one I extracted and the one you provided.

I did:

export ARCH=arm64

export PATH=/home/parallels/aarch64-linux-android-4.9/bin:$PATH

export CROSS_COMPILE=aarch64-linux-android-

export KBUILD_DIFFCONFIG=sumire_diffconfig

make kitakami_defconfig

make

from the kernel directory, and it outputs a 25.2MB Image instead of 24.5MB. I've been throwing my head against my monitor and Googling like crazy, but I must be missing something.
[Xperia Z5 Android Development] bazhip:
IT BOOTS, IT BOOTS, IT BOOTS! I switched to the Linaro toolchain instead, and that fixed it. Why didn't the other toolchain work? Should I always use the Linaro one? So many new things to learn.

Z5 Kernel with root working:

https://goo.gl/8LTc9l

This now writes to /system

Thanks for the help!! I popped my kernel cherry.
[Xperia Z5 Android Development] nilezon:
You need to use marshmallow branch of the toolchain:

git clone [B]-b marshmallow-release[/B] https://android.googlesource.com/platform/prebuilts/gcc/darwin-x86/aarch64/aarch64-linux-android-4.9
[Xperia Z5 Android Development] bazhip:
Ah gotcha. Why is it that mine wouldn't work? I guess I'm just curious as to how this all works. Is it that there is just code in the 5.1.1 that the toolchain I used didn't know what to do with or something? I'm a bit confused as to why one 4.9 would work, but a different 4.9 would. Thanks again for everything. I never would have learned any of this if not for you!
[Xperia Z5 Android Development] nilezon:
I don't know.

I too had problems with the 4.9 toolchain from default branch.
[MENTION=5243932]Tommy-Geenexus[/MENTION] helped me overcome the problems:

http://xdaforums.com/showpost.php?p=63305108&postcount=8

Now that you got the kernel to compile, isn't it time to build TWRP for Z5?

Look at this post, section "How to build":

http://xdaforums.com/z5-compact/orig-development/twrp-z5-compact-t3235161

Quick instructions for changing from Z5C to regular Z5:

You need to remove device/sony/suzuran and kernel/sony/kitakami from the manifest.

Add your kernel to folder kernel/sony/kitakami and clone https://github.com/sonyxperiadev/device-sony-sumire to device/sony/sumire.

Put your kernel config in "arch/arm64/configs/twrp_kitakami_defconfig".

Make changes to device/sony/sumire similar to this commit:

https://github.com/jackfagner/twrp-...mmit/30f2cf558ffd87e1b33b27c65927966244ff37cc

The kernel modules (.ko files) you need to pull from your phone (/system/lib/modules)
[Xperia Z5 Android Development] bazhip:
::sigh:: Yeaaah.... May as well :/ lol. Here comes another 2AM night! But, I know you have a TWRP image in your OP. How would this be different? Or are you just saying so I can do it myself? Which I am (un)happy to do of course. Time to learn all the things.
[Xperia Z5 Android Development] nilezon:
You can't run someone elses recovery now, can you? ;)

Is the one in OP fully working?
[Xperia Z5 Android Development] bazhip:
Haha, I didn't test it out yet. All I did was do everything through adb. Even if it is working, I still want to build it myself. I was just on the curious side. I think I'll tackle this when I get home tonight, you know, right before I start weeping in confusion. My CSCI major didn't cover this ****.
[Xperia Z5 Android Development] harfot:
Yes, in the same way as described in OP
[Xperia Z5 Android Development] Azdian:
[MENTION=2458514]bazhip[/MENTION] so your kernel does work properly with xposed? and you were able to install busybox?
[Xperia Z5 Android Development] bazhip:
Yup! No camera force closing and busybox (more importantly, adaway) are a go.
[Xperia Z5 Android Development] abrahamjones:
After I updated the firmware (through Flashtool) I lost root (which was expected) and can't use the above kernel as it is built from the previous stock kernel. It would be appreciated if anyone shares modified kernel for firmware (32.0.A.6.152).
[Xperia Z5 Android Development] harfot:
No problems in using this kernel with 32.0.A.6.152
[Xperia Z5 Android Development] Azdian:
Unfortunately, the camera still force-closing after flashing xposed, even though I was able to install busybox.
[Xperia Z5 Android Development] abrahamjones:
Another mistake I've made made me think that the problem was with the kernel, thx for the heads up
[Xperia Z5 Android Development] bazhip:
Huh. I wonder what's up then
[Xperia Z5 Android Development] Azdian:
You sure flashed xposed and useing modules and the camera still does work?
[Xperia Z5 Android Development] abrahamjones:
I tried and I had camera fc as well so uninstalled Xposed and rebooting now.
[Xperia Z5 Android Development] bazhip:
Yeaaah.... I'm a fool. I forgot that I reflashed /system when updating the firmware which killed xposed. My bad. I reflashed xposed and yeah, no go.

[MENTION=811738]nilezon[/MENTION], any idea on what needs to get changed to get the camera working with xposed?

EDIT: Ah, I see that you mentioned SELinux has to be set to permissive at boot. I'll try that and recompile.
[Xperia Z5 Android Development] abrahamjones:
Tried to uninstall xposed with script, Sony Camera still fc.

If you can achieve it with permissive SELinux pls let me know.
[Xperia Z5 Android Development] Masa. T:
This rooting method can be applied to Z5 dual (E6683) ? Anyone tried to ?
[Xperia Z5 Android Development] bazhip:
I set it to permissive on boot and it is still doing it. Luckily, Google camera still works. I'll try the uninstall script and see if it works. I remember it working for me before, a couple days ago
[Xperia Z5 Android Development] Azdian:
[MENTION=6266323]abrahamjones[/MENTION] [MENTION=2458514]bazhip[/MENTION] flashing the uninstalling script via twrp does work and remove xposed completely, and the Camera does work again.
[Xperia Z5 Android Development] abrahamjones:
It didn't work for me, maybe I did something wrong. Anyways, I flashed FTF file via FlashTool and re-rooted. Everything works as expected now (no xposed for sure).
[Xperia Z5 Android Development] ChrissehB:
Has anyone found a fix for Xposed + Camera FC yet? I'm just using Google Camera for now but it would be nice to get Sony camera back. Setting SELinux to permissive hasn't worked.
[Xperia Z5 Android Development] Seelbreaker:
Would the Recovery Option of PC Companion give me the DRM Keys back? I would be willing to get root and loose my drm when i can get it back by reinstalling with sony pc companion recovery - i mean those drm keys can't be installed only when the rom ist being installed the first time right?
[Xperia Z5 Android Development] skordilis:
hi to all friends. my bootloader is allowed to :YES. if i root with the methods you provide in the start of the post,that affect my guarantee status? it is possible in the next months someone to make a simple root method? ty for all
[Xperia Z5 Android Development] _Dennis_:
The root method will destroy your DRM keys and could cause sony to deny warentee claims if the claim could be attributed to flashing (depending on local laws).

The method is easy, and the one correct way to root. I to hope for a method that would not destroy the DRM keys, but I know any method used is probably a method that could be used in a nefarious easy also, and I prefer my devices to be as safe as possible for so I can be a bit more assured that my information is not leaked or stolen.

So I'm kind of on the fence, I would prefer root, not losing my DRM keys, and being secure.
[Xperia Z5 Android Development] skordilis:
thank you very much for your answer Dennis.so you suggest i w8 for a method secure drm keys included?
[Xperia Z5 Android Development] _Dennis_:
Only you can decide that. I am going to mess with my phone (after I receive it) for a bit before I decide.

I'm leaning towards unlocking my bootloader and rooting, but it comes with some down sides besides losing DRM keys. Rooting can lead (does lead) to vulnerability. So it's not recommended unless you know what your doing.

By definition, if there is a root without unlocking bootloader it means your already vulnerable, but rooting will again will open more vulnerabilities, so it's hard to recommend anything.
[Xperia Z5 Android Development] skordilis:
thank you very much indeed Dennis