yashsingh1/xdaforums huggingface dataset:
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] DHGE:
RIC OK, SELinux?

[MENTION=5169444]AndroPlus[/MENTION]

Getting rid of RIC and SELinux was a bit more work than in your repository.

But the kernel is fine and you can see my dumb-patched source in the attachments. Look for "//ew"

Comments welcome

rootfs / rootfs rw,relatime 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,size=1418940k,nr_inodes=354735,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
...
tmpfs /mnt/asec tmpfs rw,seclabel,relatime,size=1418940k,nr_inodes=354735,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,seclabel,relatime,size=1418940k,nr_inodes=354735,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
tmpfs /tmp tmpfs rw,seclabel,nosuid,relatime,size=1418940k,nr_inodes=354735,mode=755 0 0
/dev/block/bootdevice/by-name/system /system ext4 rw,seclabel,relatime,discard,data=ordered 0 0
/dev/block/bootdevice/by-name/userdata /data ext4 rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered 0 0
/dev/block/bootdevice/by-name/cache /cache ext4 rw,seclabel,nosuid,nodev,noatime,discard,data=ordered 0 0
/dev/block/bootdevice/by-name/persist /persist ext4 rw,seclabel,nosuid,nodev,relatime,data=ordered 0 0
...
adb /dev/usb-ffs/adb functionfs rw,relatime 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
/dev/fuse /mnt/shell/emulated fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other,allow_utime_grp 0 0
/dev/block/vold/179:65 /mnt/media_rw/sdcard1 texfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,umask=0007,allow_utime=0020,iocharset=utf8,min_prealloc_size=64k,max_prealloc_size=122598k,readahead=4M,fail_safe,discard,hidden=show,errors=continue 0 0
/dev/block/vold/179:65 /mnt/secure/asec texfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,umask=0007,allow_utime=0020,iocharset=utf8,min_prealloc_size=64k,max_prealloc_size=122598k,readahead=4M,fail_safe,discard,hidden=show,errors=continue 0 0
/dev/fuse /storage/sdcard1 fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other,allow_utime_grp 0 0

Still some issues left:

- get rid of nosuid on mounts:

type=1400 audit(1436734934.698:20): avc: denied { execute_no_trans } for pid=5927 comm="sh" path="/sbin/su" dev="rootfs" ino=10535 scontext=u:r:adbd:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=1 ppid=5487 pcomm="sh" pgid=5487 pgcomm="sh"

or I have an oversight in my patches.

- I can not get into root-shell

I will try to nail things via an init-service.

The royal flush will be a successful run of Chainfire's update-binary. The neccessary ingredients (files) are already in my boot.img ...

insecure c-files are originally from http://developer.sonymobile.com/dow...archives/open-source-archive-for-28-0-a-7-24/
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] DHGE:
Another one bites the dust! -> tastes ...

Finally I made it but it is not for the faint of heart and an ugly hack and procedure.

You need a patched kernel (see the files in the previous post). Just fiddling with the .config does not cut it since stock rom does some very thorough checks of modifications.

I guess it is even hardcoded in the init but I have no source for that and did not debug it.

My patches just make the SELinux and RIC checks say "everything OK" but for SONY's behind the scenes magic it looks like everything is set up normally.

Then you need to tweak a rootfs:

http://whiteboard.ping.se/Android/Rooting

Thank you, Mikael Q Kuisma!

I changed chmod 4750 sbin/rootsh to chmod 6750 sbin/rootsh

Do not follow his link for root-finishing the SAMSUNG device!

It is for 32bit. Look at the date of the post.

Do this:

Get the latest SuperSU from Chainfire. I used BETA-SuperSU-v2.49 because of the tweaks for Lollipop (I might enable SELinux again, if I can surgically remove the SONY tweaks on top of it and beside: RIC).

Problem here: Chainfire has the correct installer for a recovery and we do not have one (yet) on stock rom.

So I copied the relevant files (common and arm64) into /SuperSU_files and the su on top of it into /sbin.

Then I ran my script install_SuperSU.sh (see attachment) stolen and edited from Chainfires update-binary.

After a reboot you are done. :cowboy:

SuperSU works as intended (just made my first Titanium backup) but complains it needs to update his su binary. Ignore this message. It did not go away after flashing the SuperSU.zip with FlashFire.

I guess it is because the apk is checking the existence of a su in the recovery. No recovery -> no su. Hence the message.

To be very clear:

- you need to unlock your boot loader

- you are running without the IMO useful protection of SELinux

- you are running without SONY's protection (gone for good IMO)
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] kookahdoo:
I wanna try it but I'm scared lol
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] Koto99:
I Hope it come a Root Method that is very simply.:D
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] eman2001:
If I had a stock ftf I would try just in case something goes wrong then I would flash back the stock rom
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] DHGE:
flashtool (with xperifirm)

had to use it twice in my endavours ...
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] EvoDrifter:
Thanks for the effort!

but does this method effects the sony warranty ?
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] DHGE:
I do not think so - I flashed a SONY provided stock ROM.

Unlocking the bootloader can affect your warranty.
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] baddison:
Wow. ... you have certainly put a lot of effort into this. THank you very much. I promised myself that as soon as ROOT was available, I would purchase the Z4 Tablet!!! THanks again.:good::good:
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] abillybob:
Same. I really need it to work with Six axis controller app and Folder Mount! Though I'd be too scared to try the above! I'm waiting for a flashable .zip to come along!
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] DHGE:
better wait for AOSP

I doubt there ever will be one.

For the newer kernels you'd need a still undiscovered exploit that also needs to defeat SELinux and RIC in order to install a su executable.

I bought the tablet since I am quite satisfied with my venerable Tablet Z and like more speed, less weight, better display and not fiddling with the USB-cap.

AND: SONY make it easy to unlock the bootloader and have an AOSP-policy for their devices.

http://developer.sonymobile.com/knowledge-base/open-source/open-devices/

There is not too much available (the kernel source I used) right now but I am confident, soon we will have the AOSP version of the ROM code availabe. This will be Android 5.1 I guess and from there it is not too complicated to build a M version or a CyanogenMod or ... .

If you do not do it yourself it will be a 2 GBytes download for the ROM image and you will flash it with fastboot (another plus for SONY devices) or Androxyde's flashtool.

I hope the AOSP sources will be available any day. Maybe the 64bitness of the new processor delays the release a bit.

I guess from the availability of the sources it would be less of a month to find a downloadable release of the ROM somewhere (you better trust the builder ...).

My bet (a bottle of non-vintage Pol Roger :highfive:) is that such a ROM will be available before November 2015.
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] Koto99:
I hope it come a simpler method or a Rom
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] rm40f2:
Many thanks, DHGE, for the link about the AOSP policy. That alleviates *some* of my concern.
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] abillybob:
Cheers mate. I'll probably stick with my Tab S then for now until a working build of a custom ROM or some how root is available. My tab S is a bit slow when it comes to gaming so I though this would be a hell of a lot better, though without being able to use apps like Six Axis controller would defeat the purpose for me.

Its a big shame it's obviously quite a difficult task to get this device rooted compared to others due to the 64bit architecture. I'm not going to pretend that I understand how the rooting process works but I do have some contacts with Sony and there Xperia development team. If I can be of any help in anyway I'll try my best if you need software or have questions etc...
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] GhostLeader:
ask them for a working recovery -.-
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] abillybob:
I don't own the Z4. Does it not come with a working recovery? If you can give a bit more information I'll ask them! :)
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] DHGE:
Recovery is part of the AOSP policy

http://developer.sonymobile.com/201...for-a-range-of-unlocked-xperia-devices-video/

So we need a little more patience.
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] deecept:
I'm willing to try something like that explained in post #8 on my Z3+ E6553 (Single Sim), if someone knowledgable could help me out.
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] biofx80:
Hi everyone,

No other way more easy to root our device?

Best regards
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] AndroPlus:
Here's my first custom kernel for Z4T;)

Thanks DHGE for rooting method.

http://xdaforums.com/z4-tablet/development/kernel-andropluskernel-v1-t3170689
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] hWorblehat:
Hi [MENTION=6774113]DHGE[/MENTION],

I'm trying to follow what you did here, but for the Z3+ phone. It uses the same kernel so I'm hoping for success. In Mikael's instructions, he suggests booting into a modified kernel using directly from fastboot without flashing. Whenever I try this (using modified kernel or stock), I get an error message:

creating boot image...
creating boot image - 30177280 bytes
downloading 'boot.img'...
OKAY [ 0.723s]
booting...
FAILED (remote: dtb not found)

Did you experience this at all? Did you boot directly from fastboot, or did you flash the kernel first. I'm scared to do this in case I brick my device.

--Edit--

Scratch that - I appear to have gotten over that problem by using a different dtbTool.

running fastboot boot now "works"... except it doesn't - splash screen appears then it shuts down. I'll have another poke around tomorrow...
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] DHGE:
Not this but I could not "boot-without-flashing". I always had to flash my newer kernel.

No big deal: stash away a working kernel or get one via xperifirm.
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] DHGE:
28.0.A.31 thirtyone!

From the SONY developer site you can get a new kernel source for the yet unreleased 28.0.A.31 ROM.

I grabbed this source and on the pristine files I only changed kitakami_defconfig and there #CONFIG_SECURITY_SONY_RIC is not set from y

I flashed the new boot.img over my SELinux-disabled (necessary to root the device) 28.0.A.24 boot partition (see post #8 in this thread) and got:

SELinux AND root :good:

Only needed is a changelog for the kernel from SONY - the version number still is arm64 3.10.49. I hope it comes with the 28.0.A.31 ROM.

new info: No need for a changelog: The files inside the archive are identical to those inside the .24 archive. What are they up to?
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] mcraeally44:
Hi all,

I take it once you flash the patched kernel, x-reality and other visual features are lost anybody confirms that?

Thanks
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] DHGE:
betterment for xperia devices

[MENTION=3132595]mcraeally44[/MENTION]

I really don't care - for me root is far better than any perceived SONY tricks.

But some people care:

http://xdaforums.com/crossdevice-dev/sony

I will try xposed for xprivacy.

Beware of 64Bit issues!
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] hWorblehat:
Hi [MENTION=6774113]DHGE[/MENTION],

So I tried flashing -> bootloop. I even tried building the Sony stock kernel without any modifications and flashing that. Still bootloops. I had to flash a firmware from xperifirm to fix (thanks for pointing me in that direction).

I have a feeling the problem may be down to teh version of dbtTool/mkbootimg I used to make the boot.img. As far as I can tell there are several versions around. Could you point me in the direction of the exact version you used?

Thanks,
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] DHGE:
the readme could be better

Hi hWorblehat,

I use dtbtoolCM from the CyanogenMod toolchain. I found it on GitHub. https://github.com/xiaolu/mkbootimg_tools

dtbToolCM -o dt.img [B][COLOR="Red"]-2[/COLOR][/B] -s 2048 -p scripts/dtc/ arch/arm/boot/dts/

The SONY readme is a sloppily revised version from earlier readmes for other devices me thinks.

I have attached a dt.img for the SGP712/karin_windy.

It works here with 28.0.A.7.24 and ...31 sources.

With the latest flashtool 0.9.19.0 getting the ramdisk and the device tree image is a piece of cake.

I had to learn my ropes the hard way in my first attempt to develop anything on Android last month.

But as long as you have not disabled RIC you will continue boot looping. Apply the patches from post #7 in this thread.

Enjoy the feeling once you get there :)
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] Peroni1:
Rooting successful!

Thanks to DHGE and AndroPlus for their efforts on root access to the Z4T! Based on their work, I have successfully rooted my SGP712 (Z4 Tablet WiFi).

To sum it up again: What you need to do is to 1) unlock your boot loader, 2) make sure you have 28.0.A.7.24 (if you don't have it update with flashtool), 3) use fastboot to flash the custom kernel provided by AndroPlus in #26 of this thread (also consult the links provided there).

I must say that I am a complete noob concerning Android/Linux programming, and I complety relied on the descriptions in #26 without knowing more than vaguely what I was doing, and without having any recovery at all. Despite my success I'm not sure whether to recommend the procedure to everybody, since there are things that can go wrong (for example, probably due to installing some wrong drivers, I had a hard time with step 2) including an intermediate state of my Z4T without a working touchscreen).

The reason why I needed root access in the first place was to use BubblePnP with AudioCast for Spotify streaming from my Z4T on a audio network player, which needs the Xposed Framework, which in turn needs root access. Now, with the root access, I am having a hard time to install the Xposed Framework which doesn't seem to work yet for Lollipop (any hints on how to install that on the rooted Z4T are very welcome!) . So for the time being, I'm still stuck with my old Xperia S Tablet for audio streaming which is kind of annoying.
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] DHGE:
Well written!

That is why I admire Androplus to be so brave to offer a boot partition for download.

[rant]

I am really fed up with some guys showing up here asking the same questions without doing any(?) reading before and shouting for others to do their homework or whining about some vague loss of functionality after opening the bootloader.

Wake up guys!

- This is a new 64bit device with kernels where the exploits that used to root older xperia device do not work.

- We are on Lollipop where we have SELinux enabled (a good thing IMO).

- SONY have tightened the security in their 2015 devices.

Please do some homework and do read threads here before asking for "one click ..."

If you do not find info here look into the phone threads for Z4/3+ and into xperia cross devices.

e.g. http://xdaforums.com/crossdevice-dev/sony/xposed-serajr-xperia-xposed-lp-v1-0-27-t3094251

After all, this is xdadevelopers. I expect more than what I am reading out of some questions here. I hope that it is not just me ...

[/rant]

I really recommend reading the forum rules.

http://xdaforums.com/announcement.php?f=4058

Much wisdom and common sense there.
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] JohnnyTactic:
It just became available over at Sony Developer page but can't link.

"Sony has been making a major effort to open up its devices to third party ROM development and has now uploaded a new set of 5.1 Lollipop AOSP binaries for the company’s first 64-bit devices – the Xperia Z3+, Xperia Z4 Tablet and Xperia Z4 Tablet WiFi."
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] DHGE:
only the AOSP sources ...

my first compile went nicely - but no touch screen on boot

http://xdaforums.com/showpost.php?p=62372943&postcount=5

second compile with a tweak is running ...
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] kookahdoo:
Sweet. Can't wait!

Sent from my Nexus 6
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] DHGE:
AOSP needs finishing

I am back to 28.0.A.7.24.

I wish the SONY developers had more respect for our time:

- the Tablet has no touch funtionality

"we are debugging"

- the phone has no phone-network connectivity

"we will add that later"

Unfortunately one needs >100 Gbytes (with at least 10 GBytes download) free harddisk and several hours compiling to learn this.

A SAP virtual machine eats 600 GBytes on my 1 TB harddisk...

If I had more space I would try to build a CyanogenMod. This has to wait til I get a new developer machine next year.

I might try another AOSP sync next month.

At least my backup is OK. ;)
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] AndroPlus:
And now they fixed touch issue... it's fast enough, though they should have check before publishing.
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] DHGE:
*no* stagefright patches in AOSP

AOSP is still a work in progress

on July 9th these stagefright patches appered on Google's Git:

https://android.googlesource.com/platform/frameworks/av/+/aeea52da00d210587fb3ed895de3d5f2e0264c88
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] kookahdoo:
It says my "bootloader unlockable: No". Is there a way around this?
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] DHGE:
beware of 28.0.A.8.251 if you want to keep your root rights

I just installed the new SONY ROM hoping there are stagefright patches included.

As usual no changelog.

Before you ask: it is Android 5.02

I booted it: works, my apps and data preserved - fine if you are only interested in a newer ROM version.

Then I tried to root it again:

I flashed my "insecure" 28.0.A.8.24 boot image. That does not stay up more than a minute when USB is connected.

Enough to run my SuperSU_installer.sh (see in this thread).

Root and things work but the USB issue...

So after rooting I decided to flash the 28.0.A.8.251 boot.img back to have a coherent ROM -> bootloop :(

I guess RIC is kicking in again ...

I will wait until SONY post the sources for the newer kernel, disable RIC and try again.

Another approach might be fiddling the ramdisk but this did not go well in the past because of RIC.
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] kookahdoo:
SUcks cuz my bootloader says it can't be unlocked. Gotta wait until someone can root without unlocking the bootloader. Thanks for all your work.
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] ramontomzer:
Thanks to the OP for your work on this matter. I'm usually pretty competent when it comes to rooting android devices but I have no idea what you did to root your Z4T. Could you put together a more detailed tutorial on how exactly you obtained root? it would be GREATLY appreciate!
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] lilloscar:
Thanks for the info, I was going to update to 28.0.A.8.251 on my Z3+ Dual because am tired of this heat phone with consumption going down even connected to AC, so am not going to update and loose the only good thing I reached named root.
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] quakteng:
Any website can download the firmware?
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] dl12345:
I see much work has been done here, but if it's any help, here is what I did to root and set SELinux in permissive mode on my Z3+

In the kernel config

CONFIG_SONY_RIC=n
CONFIG_SECURITY_SELINUX_DEVELOP=y
CONFIG_SECURITY_SELINUX_DISABLE=y
CONFIG_DM_VERITY=n

Now edit the ramdisk. Delete the verity key in the root.

Get the flashable SuperSU. Open the updater script. Read it carefully

Unpack the system.sin from the stock firmware using Flashtool.

From here forward work as the root user to preserve permissions

Mount the resulting ext4 on a loopback

Install the supersu files as per the updater script paying careful attention to permissions and file contexts (ls -lZ and chcon are the tools for file context)

Create a /su.d folder

Create a file /su.d/permissive.sh

Chmod 700 /su.d/permissive.sh

# cat > /su.d/permissive.sh
#!/bin/sh
/system/bin/setenforce 0
<ctrl d>

create a system.img from the modified /system loopback

repack the ramdisk

create a boot.img

flash the boot.img and system.img with fastboot

You now have a rooted rom with selinux in permissive mode.

Note that you cannot use setenforce in an init script because the selinux policy does not permit it. Supersu runs in the init context so it can use setenforce.
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] DHGE:
CONFIG_SONY_RIC=n is enogh once you are rooted

[MENTION=5971873]dl12345[/MENTION]

Thanks - another elegant way to skin the beast.

I prefer to have SELinux enabled.

My installer-script (adapted from Chainfire's) also sets the context and could be used as a template for more work.

Actually once rooted one gets a long way with FlashFire. I will try xposed once I get the source for .251
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] dl12345:
Indeed, I also prefer selinux enabled. Unless you're running something that doesn't behave well with selinux then no need for the su.d script. SuperSu runs perfectly well in an enforcing environment
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] allofmex:
Maybe this helps for further rooting developement:

Zimperium has released it's stagefright exploit today!

https://blog.zimperium.com/the-late...xploit-is-now-available-for-testing-purposes/

I hope this will lead to (locked Bootloader) root or at leased an option to backup TA partition... ;)
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] mcraeally44:
And that is one good news, thanks! :D
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] DHGE:
[MENTION=4436640]allofmex[/MENTION]

Did you READ the disclaimer?

esp. about the Android version?
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] dl12345:
Yep, they know who are their paying customers. They're unlikely to release an exploit that works on currently shipping devices...
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] allofmex:
But it may give an idea about how to adjust the exploit for newer versions. So it's still a good news ;)
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] kookahdoo:
Nevermind

Sent from my Nexus 6
[Xperia Z4 Tablet Q&A, Help & Troubleshooting] AndroPlus:
"I rewrite this tutorial from xdaforums.com"

where is it lol

Please delete link since it's fake.

All websites which has the word "root" in domain name and says "I rewrite this ~" are fake.