yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Android Development] tobias.waldvogel:
Just a quick update regarding system-less xposed

Finally I have found a very nice solution for adding stuff without modifying the system partition.

I'm removing the link /vendor -> /system/vendor and move the links one level down, i.e. instead I create a folder /vendor and populate it with links to the contents of /system/vendor. For /vendor/bin, /vendor/lib and /vendor/lib64 the links are even populated at this level.

The big advantage is that we can now place stuff into /vendor/lib /vendor/lib64, which as in the search path of linker and linker64. This give us the possibility to have global preloads with a 32bit and 64bit version. Before the problem was when setting LD_PRELOAD globally let's say to a 32bit library then it would break 64bit executables and vice versa. With this solution we can set it just to the library name without the path and linker or linker64 will pick the right one. I already changed the installation of the drmfix library to this method and it works perfectly well. So we are sure it is loaded for everything and not only for single services.

Xposed is currently replacing several binaries in order to add call-points. I am adapting the code to a preload library, which means we can leave all binaries completely untouched and just modify a few functions. So this will be a much more elegant version to have system-less xposed. The framework however is the same .jar as usual, which makes it easy to upgrade when a new framework is released.

Once everything is completed the idea is to contribute the code to the xposed project.

Cheers,

Tobias
[Xperia Z5 Android Development] MasalaMan:
I am getting following error
[Xperia Z5 Android Development] tobias.waldvogel:
Sounds like you did not update the bootloader with the last update. When you create an ftf file make sure that you include _everything_

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] MasalaMan:
So I did the following steps

Phone is in Build Number 32.1.A.1.185

1) Download and extract rootkernel_v4.51_Windows_Linux.zip

2)downloaded the firmware using XperiFirm

3)Copy the kernel_S1-SW-LIVE-F936-PID1-0006-MMC.sin file to the path in Step 1

4)executed rootkernel kernel_S1-SW-LIVE-F936-PID1-0006-MMC.sin boot.img

5) Put phone in fastboot mode

6) Executed fastboot boot boot.img

Did i miss some step?
[Xperia Z5 Android Development] Klaus N.:
I let FlashTool create the ftf, extracted it with 7zip and put the kernel.elf into the rootkernel folder.
[Xperia Z5 Android Development] MasalaMan:
still the same error :confused:
[Xperia Z5 Android Development] Klaus N.:
Sorry, I forgot: There's a kernel.sin after unpacking the ftf. You've to extract kernel.sin with FlashTool - sin extractor (see startpost), and the result(= kernel.elf) you've to put into the rootkernel folder, indeed!
[Xperia Z5 Android Development] MasalaMan:
thanks got it working
[Xperia Z5 Android Development] erveemoskovic:
Sounds good! You probably noticed topjohnwu releasing a new version (v85.6) of Systemless Xposed. Did you already test with that version? Can't wait to test drive :fingers-crossed: :fingers-crossed: :fingers-crossed:
[Xperia Z5 Android Development] :
there is a bug on z5. when patching kernel, internal storage drops 8GB.
[Xperia Z5 Android Development] greg.chalk:
Same here, Z5 compact. Internal storage drops from 32gb to 16gb. After reading this, I opened TWRP >wipe>advanced wipe > check data > repair or change file system >resize .

Problem solved.
[Xperia Z5 Android Development] erveemoskovic:
I don't seem to have this bug on my Z5 Compact. When I look at the Storage info in Android I see 14.95GB Total used of 32.00 GB.
[Xperia Z5 Android Development] Alcedii:
After reading this I checked my z5c and apparently I also have just 16GB available. Didn't even notice it.

I can confirm repairing the data partition in twrp fixes the issue[emoji106]
[Xperia Z5 Android Development] tobias.waldvogel:
You can try the 5.0beta1.

- Please uninstall first the SuperSU app and xposed (The SuperSU app will show up again automatically)

- Please the xposed zip in the same folder as the script (the arm-x64 version)

- Say yes to all options

The standard xposed installer will report that the framwork is not installed because it is looking for /system/xposed.props which is now in /vendor/xposed.props. But you can verify it from the command line with

app_process --xposedversion

The app_process is the original executable from /system/bin and I am injecting the xposed calls via a preload library. The rest of the xposed stuff moved from /system to /vendor, but I am working preload implementation as well.

The libraries are loaded automatically from /vendor because it is first in the search path. For dex2oat and oatdump my preload library is redirecting it. Patchoat is identical with stock, so no replacement required.

So far all my modules work. Please share your experience.
[Xperia Z5 Android Development] erveemoskovic:
Hi Tobias

I'm running this on the latest Z5 Compact kernel (32.2.A.0.224).

Downloaded the lates SuperSU Beta (BETA-SuperSU-v2.74-2-20160519174328.zip, renamed it to (SuperSU-v2.74-2-20160519174328.zip).

Downloaded the latest Xposed systemless ZIP (xposed-v85.7-sdk23-systemless.zip) which is not for arm or arm64 specific anymore.

Placed it all in one folder and executed it in an admin command prompt.

Here are the results:

C:\rootkern\5.0b1>rootkernel kernel_32.2.A.0.224.elf boot_32.2.A.0.224.img
- Unpacking kernel
Found elf boot image
Kernel version: 3.10.84-perf-g4a67e86
Found appended DTB
- Detected vendor: somc (Sony), device: suzuran (Z5C), variant: row
- Unpacking initramfs
- Detected platform: 64-bit
- Detected Android version: 6.0.1
- Disabling dm-verity
- Sony RIC is enabled. Disable? [Y/n] N
- Install TWRP recovery? [Y/n] Y
Installing TWRP
- Install busybox? [Y/n] N
- Found SuperSU-v2.74-2-20160519174328.zip. Install? [Y/n] Y
Adding service entry for SuperSU
- Install DRM fix? [Y/n] Y
- Creating new initramfs
- Creating boot image
- Cleaning up
Done

What did you mean with "Say yes to all options"? Should I disable RIC and Install Bussybox?

Or am I missing some questions about Xposed? Because I see nothing about Exposed in the output.

Edit: I see rootkernel.sh is searching for "xposed-*-arm64.zip". Should I rename the ZIP or is rootkernel not able to cope with the new mutli-architecture version ZIP?

Edit 2: putting -arm64.zip at the end of the Xposed ZIP filename yields this output:

[...snip...]
- Found xposed-v85.7-sdk23-systemless-arm64.zip. Install? [Y/n] Y
cp: can't stat 'xposed/system/framework/XposedBridge.jar': No such file or directory
cp: can't stat 'xposed/system/xposed.prop': No such file or directory
cp: can't stat 'xposed/system/bin/dex2oat': No such file or directory
cp: can't stat 'xposed/system/bin/oatdump': No such file or directory
cp: can't stat 'xposed/system/lib/libart.so': No such file or directory
xz: ramdisk/vendor/lib/libart.so: No such file or directory
cp: can't stat 'xposed/system/lib/libart-compiler.so': No such file or directory
xz: ramdisk/vendor/lib/libart-compiler.so: No such file or directory
cp: can't stat 'xposed/system/lib/libxposed_art.so': No such file or directory
cp: can't stat 'xposed/system/lib64/libart.so': No such file or directory
xz: ramdisk/vendor/lib64/libart.so: No such file or directory
cp: can't stat 'xposed/system/lib64/libart-disassembler.so': No such file or directory
cp: can't stat 'xposed/system/lib64/libxposed_art.so': No such file or directory
- Install DRM fix? [Y/n] Y
- Creating new initramfs
- Creating boot image
- Cleaning up
Done
[Xperia Z5 Android Development] tobias.waldvogel:
Please use the _ official_ _standard_ xposed archives. Not the the unofficial system-less.

It will be installed in a system-less way.

Busybox is mandantory for this. The dependency is still not considered in the script.
[Xperia Z5 Android Development] erveemoskovic:
Ah okay I understand :)

I still may keep RIC disabled?

The output:

C:\rootkern\5.0b1>rootkernel kernel_32.2.A.0.224.elf boot_32.2.A.0.224.img
- Unpacking kernel
Found elf boot image
Kernel version: 3.10.84-perf-g4a67e86
Found appended DTB
- Detected vendor: somc (Sony), device: suzuran (Z5C), variant: row
- Unpacking initramfs
- Detected platform: 64-bit
- Detected Android version: 6.0.1
- Disabling dm-verity
- Sony RIC is enabled. Disable? [Y/n] N
- Install TWRP recovery? [Y/n] Y
Installing TWRP
- Install busybox? [Y/n] Y
- Found SuperSU-v2.74-2-20160519174328.zip. Install? [Y/n] Y
Adding service entry for SuperSU
- Found xposed-v85-sdk23-arm64.zip. Install? [Y/n] Y
- Install DRM fix? [Y/n] Y
- Creating new initramfs
- Creating boot image
- Cleaning up
Done
[Xperia Z5 Android Development] tobias.waldvogel:
Looks good. Yes, may keep RIC enabled.

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] RyTekk:
Should disable Sony RIC or you aren't able to mount system as rw.
[Xperia Z5 Android Development] erveemoskovic:
I don't want/need system read-write.

Okay. So:

I made an adb backup

And some manual backups :)

Forgot to remove the SuperSU App (is this bad? I did not install this myself, it came from a previous repack)

Put the phone in airplaine mode (I usually do that to prevent data leakage in case Xposed/Xprivacy don't work and to prevent WhatsApp messages coming in invalidating my backups)

Rebooted in recovery and flashed xposed-uninstaller-20150831-arm64.zip

Rebooted to flash mode and flashed my new E5823_32.2.A.0.224_1299-7245_R5C.ftf with flashtool

Rebooted to fastboot mode and flashed boot_32.2.A.0.224.img

Rebooted to flash mode and flashed the TA.ftf created with flash_dk with flashtool (this was probably not needed)

Rebooted to system.

Needed to unlock my encrypted data along the way.

And after that all apps were updated which took a looooooooong time...

It looks like all went well!

My build number shown is 32.2.A.0.224

SuperSU version shows 2.74

Yes: Xposed Framework says the framework is not installed

But the modules seem to work fine

shell@E5823:/ $ app_process --xposedversion
Xposed version: 85

Edit: In the Service menu Service Tests > Security all show [Active] and even my FIDO_KEYS are now provisioned. They were not before. Don't know why and what it is but it sounds good :)
[Xperia Z5 Android Development] tobias.waldvogel:
Thanks for testing and the feedback :)

Right now I still have to package the xposed art libs to /vendor/lib which are making the boot image very big. The idea is to inject the modification in the standard libs rather than replacing it, but it will take some more time. Anyway it will not change the way it works, so you can use any future releases without recreating the oat files (the process that took that long).

For security reasons I had decided not to create a writable file system but rather putting everything into the boot image.

But anyway you can rerun the script at any time if you want to update to a newer xposed version.
[Xperia Z5 Android Development] serpico84:
I tested the last build. I've built my kernel with all options yes except Sony ric and each time that I reboot, the phone shows Android is upgrading. I don't know what is happenning with my phone....

Enviado desde mi E6653 mediante Tapatalk
[Xperia Z5 Android Development] raimondomartire:
[MENTION=357342]tobias.waldvogel[/MENTION] I'm noobs on Sony scene so I ask you if possible explain how flash DK.ftf. I put file (567 byte) in firmware directory and flash with flashtool but stil got FIDO Key: Not provisioned, SUNTORY error. My device is Z5P. Thanks for reply

PS This is log

17/028/2016 22:28:24 - INFO - Selected Bundle for Sony Xperia Z5 Premium(E6853). FW release : 1.0. Customization : DeviceKey

17/028/2016 22:28:24 - INFO - Preparing files for flashing

17/028/2016 22:28:24 - INFO - Please connect your device into flashmode.

17/028/2016 22:28:28 - INFO - Device disconnected

17/028/2016 22:28:42 - INFO - Device connected in flash mode

17/028/2016 22:28:42 - INFO - Opening device for R/W

17/028/2016 22:28:42 - INFO - Reading device information

17/028/2016 22:28:43 - INFO - Phone ready for flashmode operations.

17/028/2016 22:28:43 - INFO - Opening TA partition 2

17/028/2016 22:28:43 - INFO - Current device : E6853 - CB5A29F0UW - 1299-1272_R8C - 1296-2432_32.2.A.0.224 - GENERIC_32.2.A.0.224

17/028/2016 22:28:43 - INFO - Closing TA partition

17/028/2016 22:28:43 - INFO - Start Flashing

17/028/2016 22:28:43 - INFO - No loader in the bundle. Searching for one

17/028/2016 22:28:43 - INFO - Processing loader.sin

17/028/2016 22:28:43 - INFO - Checking header

17/028/2016 22:28:44 - INFO - Flashing data

17/028/2016 22:28:45 - INFO - Loader : S1_Root_f936 - Version : MSM8994_50 / Boot version : S1_Boot_MSM8994_LA1.2.2_40 / Bootloader status : ROOTED

17/028/2016 22:28:45 - INFO - Max packet size set to 4M

17/028/2016 22:28:45 - INFO - USB buffer size set to 512K

17/028/2016 22:28:45 - INFO - No flash script found. Using 0.9.18 flash engine

17/028/2016 22:28:45 - INFO - Opening TA partition 2

17/028/2016 22:28:45 - INFO - Writing TA unit 00002774. Value : 01

17/028/2016 22:28:45 - INFO - Closing TA partition

17/028/2016 22:28:45 - INFO - Opening TA partition 2

17/028/2016 22:28:45 - INFO - Closing TA partition

17/028/2016 22:28:45 - INFO - Opening TA partition 2

17/028/2016 22:28:45 - INFO - Closing TA partition

17/028/2016 22:28:45 - INFO - Opening TA partition 2

17/028/2016 22:28:45 - INFO - Closing TA partition

17/028/2016 22:28:45 - INFO - Opening TA partition 2

17/028/2016 22:28:45 - INFO - Closing TA partition

17/028/2016 22:28:45 - INFO - Opening TA partition 2

17/028/2016 22:28:45 - INFO - Closing TA partition

17/028/2016 22:28:45 - INFO - Opening TA partition 2

17/028/2016 22:28:45 - INFO - Writing TA unit 00002725. Value : 32 30 31 36 2D 30 36 2D 31 37 20 32 32 3A 32 38 3A 34 35 00

17/028/2016 22:28:45 - INFO - Writing TA unit 00002774. Value : 00

17/028/2016 22:28:45 - INFO - Closing TA partition

17/028/2016 22:28:45 - INFO - Ending flash session

17/028/2016 22:28:45 - INFO - Flashing finished.
[Xperia Z5 Android Development] tobias.waldvogel:
Did you also create a bootimage with the rootkernel script and flashed it with fastboot?

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] raimondomartire:
No I flashed boot.img inside romaur rom. If I understand well before restore DK.ftf I must create a bootimage with the rootkernel script?
[Xperia Z5 Android Development] tobias.waldvogel:
Dk.ftf writes the key to an alternative unit. Write access to the original unit is blocked and the bootloader would wipe it again anyway. In order to read the key from this unit you must generate a boot image which includes my drmfix library. Dk.ftf does not work on its own

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] tobias.waldvogel:
Thanks for sharing this with us. I will put a hint in the first post. The original kernel format from Sony (ELF format) cannnot be unpacked by supersu, this is why it installs into the system partition. Images create from this script created boot images in standard Android boot format, which enables SuperSU to integrate in the system-less way.
[Xperia Z5 Android Development] blakwhite:
Bingo! You're smart and gracious my friend. Reading this, I checked again the bootloader file in the ftf and it was missing. Stupid me, I somehow left the xml file out of the creation process both times. And voila, back to easier life with root access.

As I have ocd ?, I had to overcome this this weekend. Thanks to you, I have a much better life with root and latest OS.
[Xperia Z5 Android Development] celderic:
Great work this is working well now thanks.

Just curious what kernel/ramdisk checks stop it from booting when supersu is in system, i'm not sure if it was the apk or some other files? I couldnt see anything obvious after searching the ramdisk for something suspicious.

androplus kernel works with supersu in system or systemless.
[Xperia Z5 Android Development] tobias.waldvogel:
I could imagine that it might be changes to the sepolicy.
[Xperia Z5 Android Development] Oneironautics:
Thank you for your work Tobias!

I have a nooby question. I'm running Linux and have limited access to a windows computers. If I run the above quoted instructions, do I need to flash twrp beforehand via fastboot and will the script inject twrp again? Is it possible to use v3 from linux? As you notice, I'm a little bit unsure if I'm missing something. Any help is appreciated!

/O
[Xperia Z5 Android Development] tobias.waldvogel:
Unfortunately V3 for TWRP is still not ready although the script is pretty much the same. In order to make it portable I am using busybox in Windows as well as you might have noticed. It would also run pretty much on Linux but I did not have the time to compile the bootimg tools for Linux as well. Anyway it is 100% portable code.

I think I will have the time to provide a Linux and TWRP this week ;)

Cheers,

Tobias
[Xperia Z5 Android Development] Duvel999:
You could use Rasher from Playstore for flashing.

http s://play.google.com/store/apps/details?id=de.mkrtchyan.recoverytools

Sent from my E6653 @ XDA Portal
[Xperia Z5 Android Development] tobias.waldvogel:
Version V3.1 will now run on Windows and Linux. As I said basically I just had to compile bootimg for Linux :)

One more thing I did is leaving the included TWRP as plain files rather than putting it into a .cpio.gz. That makes it easier to update when there is a new version
[Xperia Z5 Android Development] Oneironautics:
QUOTE=tobias.waldvogel;357342]

Version V3.1 will now run on Windows and Linux. As I said basically I just had to compile bootimg for Linux :)

One more thing I did is leaving the included TWRP as plain files rather than putting it into a .cpio.gz. That makes it easier to update when there is a new version[/QUOTE]

You're the man Tobias, thank you for your work, without it this device would suffer greatly! :)
[Xperia Z5 Android Development] Thorstenk:
Would be cool if you could make that thing working for Z5C. I made a kernel of the most recent MM version, it boots fine and even TWRP is working, but root doesn't work any longer ...
[Xperia Z5 Android Development] shovcu:
z5 (e6603) How do we do this process on the phone
[Xperia Z5 Android Development] tobias.waldvogel:
Did you try to install SuperSU in TWRP afterwards? It should install then with the system-less mode.
[Xperia Z5 Android Development] Thorstenk:
in the Boot image patcher section it says

--- failure. aborting

right after "- Adding deamon launcher"

The full recovery.log is attached

any idea?
[Xperia Z5 Android Development] paulle:
adb

I unlocked my z5, activated the developer options, activated usb-debugging and tried to follow method2. But...

chris@yoyo:~$ adb devices

List of devices attached

BH90C5494D	offline

chris@yoyo:~$ sudo adb -d shell

error: device offline

chris@yoyo:~$ sudo adb -d shell

error: insufficient permissions for device

what's going wrong? I'm using linux and the z5 is running mm, z5 is E6653
[Xperia Z5 Android Development] shafiq01:
I had same issue last night on my Z5C running an early beta version of a global generic userdebug MM build (6.0.1). So I can confirm that this kernel mod v3.1 works for 6.0.1, but root didn't, so I decided to go away from stable supersu v2.65 to latest beta supersu v2.71 and than I succeeded :)

---------- Post added at 08:43 PM ---------- Previous post was at 07:50 PM ----------

I guess you need to type "adb root" if applicable (userdebug) before you can use "adb -d shell" otherwise as I understood tobias's tuto, you first need to boot up in twrp(recovery) and then rund the adb -d shell, perhaps give it a half minute before as well.
[Xperia Z5 Android Development] paulle:
Thank you for your hints, but in the meantime I installed [ROM][E6653] [6.0] 32.1.A.1.163 Slim Stock. For this install I only needed fastboot (that always worked for me out of the box). In the next occasion when i have to use adb I will try "adb root".
[Xperia Z5 Android Development] TheFuzzy:
On my Windows 7 machine, in the rootkernel.sh script,

PWD=`pwd`

did not work, but

PWD=.

did.

If I print out $RC directly, I get

Unable to initialize device PRN

for some reason. Otherwise the script worked.
[Xperia Z5 Android Development] paulle:
Sony RIC

Can somebody explain me what is Sony RIC? Is it something like write protection for certain files on the sd-card ? I've read a lot of times of enabling/disabling RIC, but never found out what it really is or what RIC is doing.
[Xperia Z5 Android Development] acabreram:
Hi could yo tell me how is exactly te procedure in Windows? I already have kernel.sin extracted whats is next ?

Thank you!
[Xperia Z5 Android Development] Thorstenk:
Thanks man, that did the trick!
[Xperia Z5 Android Development] osm0sis:
[MENTION=357342]tobias.waldvogel[/MENTION], great work here with bootimg, seems to do a great job with newer Sony ELF images!

In testing today, however, I noticed that it aborts with "error: Did not find 3 elements" on kernel.elf files that don't contain a dtb or an rpm; can you update bootimg to support them?

Here are the test files in question:

Xperia Z: http://xdaforums.com/showpost.php?p=67137111&postcount=3287

Xperia C4: http://xdaforums.com/showpost.php?p=67142230&postcount=3294

Also, is there any possibility you might release the source for bootimg (at least unpackelf) somewhere? elftool is pretty outdated and doesn't handle ELF64 like yours can, I'd like to be able to cross-compile it for all of the NDK architectures, and of course there's no reason to reinvent the wheel when we've got a perfectly good wheel right here. ;)

Keep up the good work! :D

Edit: Found the source here, hopefully you can resolve the issues with the older images though. :)
[Xperia Z5 Android Development] comipa27:
Z4 Tablet touch screen cannot use

I flash my Z4T with v4.51, when I get into TWRP , the bar cannot be swipe!

I tried with Beta v5.0, the touch screen is not function anymore...so I back to 4.51 now

Anyone can teach me how to fix it?

Thanks so much!
[Xperia Z5 Android Development] erveemoskovic:
I don't know if it is the Sony 6.0.1 ROM or something with the modified kernel, but my device seems to lag now and then. Also sometimes with random App I get a "App not responding". Didn't have that with 6.0.0 and the V4.51 repack.

Edit: I just rebooted the phone and now I also get the "Optimizing app xxx of xxx". this is not good :(
[Xperia Z5 Android Development] tobias.waldvogel:
It seems that there is one SELinux rule for dex2oat missing. I will publish another beta in the evening.
[Xperia Z5 Android Development] tobias.waldvogel:
Touch never worked in TWRP with Z4T, sorry. As I don't have such a device I couldn't further analyze it so far.
[Xperia Z5 Android Development] comipa27:
Thanks for your quick reply, I will try to find another solution~

Anyway, Thanks for your hard working!
[Xperia Z5 Android Development] erveemoskovic:
Great, thank you!

Do you think that could also be a cause for the sluggishness I'm experiencing? Just played the game Alto for a while and that game never lagged on this Z5 :confused:
[Xperia Z5 Android Development] tobias.waldvogel:
Yes, that might be. Actually the issue was that installd us calling via exec dex2oat in /system/bin and not the xposed version in /vendor/bin. I'm intercepting this now and redirect it. Now there are no "starting application" anymore. It will be ready in one hour.

Gesendet von meinem E6683 mit Tapatalk