yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Android Development] tobias.waldvogel:
I just published beta2 with the fix. There is now also an option to leave dm-verity, as there is now no more reason to switch it off. If you still experience the lag issue then please try to clear the dalvik cache in recovery.

If you need any other stuff you can create a folder "install". Everything inside will be included into /vendor, so typically you would use inside directories bin,lib,lib64,app . If you place kernel modules in lib/modules they will be loaded automatically (e.g. for kcal ).

My experience is that the phone does not boot anymore if the image reaches approx. 30MB, this is why I started to compress several things with xz. But you have still 4MB more or less (compressed), so you can place probably 6-8MB there.

Once I complete a complete preload implementation then we will get rid of the large libraries and the size will be like 19MB again.

Happy testing;)
[Xperia Z5 Android Development] tobias.waldvogel:
Sure, I will adapt the tool, no problem. When I started, the focus was only on the new models. I think next week I could also add the source code to my git repository. Currently it is a VisualStudio Project, which uses the NDK to compile the arm and x86 binaries as well.
[Xperia Z5 Android Development] russel5:
[MENTION=357342]tobias.waldvogel[/MENTION] great work, thanks again.

one question: now you have this code in your script for adding your library

add_preload() {
local pattern
for rcfile in $RAMDISK/*.rc*; do
pattern=$(perform grep -h "LD_PRELOAD" $rcfile 2>/dev/null)
[ ! -z "$pattern" ] && perform sed -i -e "s!$pattern!$pattern:$1!" $rcfile && return
done

envrc=$(find_file $RAMDISK/init.environ.rc)
perform echo >>$envrc " export LD_PRELOAD $1"
}

and after make new boot.img i don't understand, are we need this string "export LD_PRELOAD" in init.environ.rc file or not?

because this string not added, i try on Z3C and Z5C kernels.
[Xperia Z5 Android Development] tobias.waldvogel:
In this code I look first if it set already in another .rc in order to append it. If not it is added to init.environ.rc

Sony is adding alread another preload library so the first part of the code applies [emoji6]

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] sovanyio:
I am still having problems taking Snapchats with beta 2, the app force closes when i take a picture. Anyone else seeing the same thing?
[Xperia Z5 Android Development] russel5:
[MENTION=357342]tobias.waldvogel[/MENTION]

trying beta2 with official xposed on z3c - not work

xposed modules not work, app_process command not show anything...
[Xperia Z5 Android Development] tobias.waldvogel:
Which android release does it have?

Does SuperSU work?

Please send me the output of "adb - d shell dmesg"

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] russel5:
Android 6.0.1

Yes

See log
[Xperia Z5 Android Development] tobias.waldvogel:
It seems the the vendor overlay is created correctly and there are no SELinux issues.

Please connect via adb shell and run the following commands:

su
env | grep LD_PRELOAD
ps | grep zygote

The last command will show you the pids for the zygote process (second column). Please run for each of them

cat /proc/<pid from command before>/maps
[Xperia Z5 Android Development] russel5:
see log (too many characters)
[Xperia Z5 Android Development] tobias.waldvogel:
That looks also good so far. The libart.so is loaded from /vendor/lib and my preload library is loaded as well.

Then I would need one more thing:

Reset your phone and when it is starting run the command

adb logcat >logcat.txt

You will get a message "waiting for device".

Once the booting is completed please provide me the file logcat.txt
[Xperia Z5 Android Development] russel5:
Here you go. + Some photos

Pls delete .zip in logcat file name
[Xperia Z5 Android Development] tobias.waldvogel:
Well, the problem is:

libxposed_preload: Could not load library libxposed_app_proc.so

So it seems to be a dependency problem. I will create a test case and get back to you.
[Xperia Z5 Android Development] tobias.waldvogel:
Could you please extract the following files from /system/lib and send me them:

libandroidfw.so

libandroid_runtime.so

libbinder.so

libc++.so

libcutils.so

libnativehelper.so

libselinux.so

libutils.so

Then I should be able to find the depdendency.
[Xperia Z5 Android Development] tobias.waldvogel:
One more thing just in case: What is the output of

ls -lZ /vendor/lib/libxposed_app_proc.so

?
[Xperia Z5 Android Development] russel5:
-rw-r--r-- root root u:object_r:system_file:s 0 libxposed_app_proc.so
[Xperia Z5 Android Development] tobias.waldvogel:
I created a new beta3, which should give some more details why the library could not be loaded. Could you create a new image which beta3 and send me the logcat?
[Xperia Z5 Android Development] erveemoskovic:
I installed Beta3:

C:\rootkern\5.0b3>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
- dm-verity is enabled. Disable? (Say yes if you modify /system) [Y/n] N
- Sony RIC is enabled. Disable? [Y/n] N
- Install TWRP recovery? [Y/n] Y
Installing TWRP
Compressing TWRP image
- 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

C:\rootkern\5.0b3>fastboot flash boot boot_32.2.A.0.224.img
target reported max download size of 536870912 bytes
sending 'boot' (25012 KB)...
OKAY [ 0.655s]
writing 'boot'...
OKAY [ 0.250s]
finished. total time: 0.905s

Booted in recovery, but clearing the dalvik/art cache failed. I saw this earlier, the log throws errors about not being able to do anything with /data. If I'm correct, that's my encrypted partition isn't it? Is the cache inside there? That was an issue before: TWRP is still not able to access the encrypted partition :)

So, I just booted the device. Unlock the encryption. It needed to optimize 250+ apps or so which took the normal way too long ;)

Xposed seems to work.

Rebooted the device and needed to optimize 1 app for some reason, but not the 250+ other, YAY :laugh:
[Xperia Z5 Android Development] tobias.waldvogel:
So, I just booted the device. Unlock the encryption. It needed to optimize 250+ apps or so which took the normal way too long ;)

This is great news. :D

Could you send me a logcat anyway? Just to check that everything is as expected. Just a normal restart as before.

I will also work in support for encryption in TWRP but it is not that easy. I have my device encrypted as well, but for now I'm doing any change without recovery.
[Xperia Z5 Android Development] erveemoskovic:
I'm not home at the moment. I hope to do that for you tonight.
[Xperia Z5 Android Development] russel5:
[MENTION=357342]tobias.waldvogel[/MENTION]

trying your beta3, but still have the same - xposed not work...sad.
[Xperia Z5 Android Development] tohidi:
hi

I want to backup my drm keys with ivoyroot

I got back together in its original state, but faced with the following error

please specify a ta image to restore

my phone sony z5p dule e6833
[Xperia Z5 Android Development] RyTekk:
Wrong topic guy, there're answers already in that thread, find it yourself.
[Xperia Z5 Android Development] tobias.waldvogel:
beta3 were not meant to work already but to give me the details why ;)

Unfortunately it seems that you did not start logcat immediately when restarting your phone, so the important part is missing. (Logcat is a cyclic log). Could you try one more time?
[Xperia Z5 Android Development] erveemoskovic:
I've sent you the logcat in a PM.
[Xperia Z5 Android Development] tobias.waldvogel:
Finally I figured out that I forgot to install libart-disassembler.so on 32bit devices (like Z3C). Please try beta4, this should work now.
[Xperia Z5 Android Development] russel5:
Sorry, but still the same. Reinstall xposed app, clear dalvik & cache - not work.

Logs will post later.
[Xperia Z5 Android Development] zhexi:
thank you it is very good
[Xperia Z5 Android Development] RyTekk:
Don't quote a long post, if you wanna do that, should put a HIDE BB Code to it.
[Xperia Z5 Android Development] shoey63:
Why quote anything to show appreciation? Just hit the thanks button.
[Xperia Z5 Android Development] russel5:
[MENTION=357342]tobias.waldvogel[/MENTION] one more thing. sometimes when i enter in supersu app, it's like "freeze" on apps tab and logs tab ( see only spinning circle ) then app is FC. SuperSU v.2.74-2

If i make boot.img without supersu.zip and flash it later all work normal.
[Xperia Z5 Android Development] tobias.waldvogel:
I'm afraid I would need the full pull
[Xperia Z5 Android Development] tobias.waldvogel:
Could you please run the following command as root and give me the output?

grep __modsi3 /system/lib/*
[Xperia Z5 Android Development] russel5:
shell@D5803:/ $ su
root@D5803:/ # grep __modsi3 /system/lib/*
grep: /system/lib/camera: Is a directory
grep: /system/lib/drm: Is a directory
grep: /system/lib/egl: Is a directory
grep: /system/lib/hw: Is a directory
grep: /system/lib/kobjeventd: Is a directory
Binary file /system/lib/libLLVM.so matches
Binary file /system/lib/libcompiler_rt.so matches
grep: /system/lib/libsysinfo_modules: Is a directory
grep: /system/lib/modules: Is a directory
grep: /system/lib/soundfx: Is a directory
grep: /system/lib/sysmon: Is a directory
grep: /system/lib/touchfilter: Is a directory
[Xperia Z5 Android Development] tobias.waldvogel:
That does it explain it then. I will create a new beta version and get back to you.
[Xperia Z5 Android Development] acabreram:
- Put TA-XXXXX.img in the same folder with tarestore.bat

- Open a command window from the folder (SHIFT + right click in an empty space of the folder -> open command window)

- connect your device (you should have previously installed correct adb drivers)

- Input:

tarestore TA-XXXXX.img

debug mode on (ADB), phone on
[Xperia Z5 Android Development] sovanyio:
PMed it to you
[Xperia Z5 Android Development] erveemoskovic:
I had the same issue with beta 1 but not with the latest beta and SuperSU 2.74 integrated.

I also have less lag, but still some lagg sometimes playing Alto.
[Xperia Z5 Android Development] tobias.waldvogel:
At least this part of the log doesn't look like SELinux. Which version did you use?

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] tobias.waldvogel:
Please try beta5. It would expect that it would work now. If it doesn't please provide me one more time the logcat.
[Xperia Z5 Android Development] .corrupt.:
Beta 4 of your toolchain on Linux on a 3.10 kernel of Sony's 32.A.0.224 build.
[Xperia Z5 Android Development] sovanyio:
Don't know if the force close was supposed to be fixed on this beta but I am still getting it, should I send an updated logcat?
[Xperia Z5 Android Development] russel5:
yes, xposed works now...but when i activate module and reboot device i have only bootloop, phone freeze and allways restart

after 5 - 10 times it's boot, but touch not work or another problem.

sorry, but i not make logcat, because i have always bootloop. i think i'm done with this, if i need xposed, i install it with normal methode.

thank you again for your hard work. good job anyway.

one more thing. when you start use your new methode with inject your drmfix in beta, now i see on my phone normal TA keys in security menu, ie status keys is active and ok.

before in normal version i always see status not active - errors, but i flashed my own TA backup with flashtool.

thanks.
[Xperia Z5 Android Development] russel5:
[MENTION=357342]tobias.waldvogel[/MENTION] one more "bug"

when repack kernel with stable supersu version 2.65 and then open program, supersu say that su not installed and can't update it, program just close.
[Xperia Z5 Android Development] Duvel999:
Did you tried supersu 2.73 beta?
[Xperia Z5 Android Development] najoor:
There seems to be a bug in SuperSU integration in v4.51. I patched the kernel for 32.2.A.0.224 for Z4 phone (E6553) using this version and supersu 2.71 zip. After that, running the following command in adb terminal as root gives an error:

root@E6553:/ # pm list packages
pm list packages
Error: Could not access the Package Manager. Is the system running?

Then I repeated the patching but this time without SuperSu integration. Instead, I flashed it in recovery. After that, the above command ran just fine.
[Xperia Z5 Android Development] tobias.waldvogel:
Thanks for commenting this. The issue was that SuperSU shell is running in init context, which will transition to zygote when calling app_process (which is invoked by pm).

SuperSU usually creates a local copy of app_process with system_exec context in order to address this. As I am install SuperSU into a read only file system this is not possible and therefore I added this step to my script in order to address it.

The issue is fixed in v5.0beta6. (Along with some other improvements for system-less xposed)
[Xperia Z5 Android Development] tobias.waldvogel:
Like Duvel999 already mentioned, you need at least 2.71. Version 2.65 still does not detect su in other locations
[Xperia Z5 Android Development] tobias.waldvogel:
default.prop in / is within the init ramdisk and not the system partition. As the name ramdisk states, it is only in the RAM and will be discarded on reboot. If you want to do a permanent modification you have to change the init ramdisk (what my script does)

dm-verity by the way does not revert any changes. It just refuses to mount the partition if changed. In other words: If you modify /system without deactivating dm-verity your phone won't boot anymore.

It is able to incorporate xposed without modifying /system. Also the integration of SuperSU without changing system has improved.

This is how Android works internally. _Don't_ mess it up. If you change anything it is very likely that your phone does not boot anymore, you lose data or you introduce a security hole.

Access to the external sdcard has been restricted from version 4.4.

If you want to enable access for all apps (which is insecure) you may try xposed and the module http://repo.xposed.info/module/com.pyler.xinternalsd

Anyway this (along with many other things) has improved on Marshmallow. I strongly recommend to update to Marshmallow
[Xperia Z5 Android Development] zegoo:
That's why i used your script ... I have launched your script to get the right to modify anything i want in /system or everywher. How i can do to be sure 'dm-verity' is really disactivated ? I haven't any doubts about RIC is off because i can mount /system in RW ... so in real or in ram ? Is is real or virtual ?

And , you said since 4.4, many changes appeared about how to restrict access to external sdcard. Is it normal to be not able to record photos taken with LL apps on external sdcard. I just need to make some little modifications to use all the entire phone i bought.

You talk about security holes, i understand but 'root user' is done for that at the origin. How an app could take or gain the rights to make things which only should be done by root ? Superuser or SuperSU is asking to the user to give root's rights to apps which need it. The user is the only one to decide to give or not give this access ... to make or not make the mistake to give this access asked by apps :crying:

About upgrading to Marshmallow, i heard N is going to be early ready but so many apps are not working fine under MM ... That's why i prefered staying on LL for now.

Humm, about mounting point, i'm very disapointed (old school ... one dev ... one mount point ... no conflict ...) about the mounting of this external sdcard ...

Is mnt or storage or twice or anything else the right 'place' where this sdcard is mount ? :eek:

To be short, i'll think about MM and i'll make the entire process again with the latest version of your script.

But, if logs told me that RIC is off and dm-verity is disabled, is it really the case and is there a way to be sure about it ?

Thanks a lot. :good:
[Xperia Z5 Android Development] tobias.waldvogel:
If dm-verity would not be deactivated your phone would not boot anymore, as I explained before.

I'm not going to comment on the file system layout. If you want further information there plenty of information on the android developer documentation. If you don't like you may complain at Google.

If an app has access to the whole SD card it can access information from other apps

There is an API how to access the SD card after 5.0, if your app does not use it it is a problem of this particular app.

And when Android N is available the probably you will wait for Android O ;), although you never know if Sony will actually port it. Anyway I don't know any apps which do not run on M.

Just because you don't understand the layout it doesn't mean that it does not make sense. Have in mind that Android runs on millions of devices. Google has to be extra careful regarding security as a small hole exposes millions of users to possible threads. And most users do not have any idea about technology or security.

I think that might be a good idea. :)

Anyway if you want to discuss the SD card topic any further I think it would be a good idea to open a new thread for this as this is pretty much off-topic ;)
[Xperia Z5 Android Development] zegoo:
Sometimes, there is nothing to add ... :o
[Xperia Z5 Android Development] tobias.waldvogel:
This was indeed helpful. It looks like the 32bit version of the drmfix library is exporting symbols which it shouldn't. I will provide an update shortly.
[Xperia Z5 Android Development] tobias.waldvogel:
Please try if if the issue is solved with 5.0beta7
[Xperia Z5 Android Development] sovanyio:
It works :) Thanks!!
[Xperia Z5 Android Development] raphoun:
Hello,

Which FTF do you use for .200 version, I can't make it work with this firmware (see http://xdaforums.com/showpost.php?p=67228625&postcount=733 )
[Xperia Z5 Android Development] .corrupt.:
[MENTION=357342]tobias.waldvogel[/MENTION], any news on the Threema issue? Could the reason it works with AndroPlus be that he leaves SELinux in permissive mode? If so, could you add an option to your script to do the same? I'd take a properly rooted stock image over AndroPlus' battery vampire any day.
[Xperia Z5 Android Development] laurent_1:
Unable to boot repacked boot.img on z5c with MM: FAILED (remote: dtb not found)

Hi,

I have the z5c with firmware E5823_32.2.A.0.224_1298-5497_R12C.ftf downloaded from XperiFirm. I've flashed this firmware to my phone and it's running fine.

I have unlocked my bootloader.

I followed the instruction to extract the kernel.elf and repack it but then I am unable to boot. Any advices? Thanks.

c:\data\tmp\root-z5c\rootkernel_v4.51_Windows_Linux>rootkernel.cmd kernel.elf boot.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

- Install DRM fix? [Y/n] Y

Configuring keyprovd

Configuring tpm-service

Configuring credmgrd

Configuring secd

Configuring wvkbd

Configuring drmserver

- Creating new initramfs

- Creating boot image

- Cleaning up

Done

c:\data\tmp\root-z5c\rootkernel_v4.51_Windows_Linux>fastboot boot boot.img

downloading 'boot.img'...

OKAY [ 0.421s]

booting...

FAILED (remote: dtb not found)

finished. total time: 0.500s
[Xperia Z5 Android Development] ninestarkoko:
copy&pasted my instructions from another post

good job boy:good:
[Xperia Z5 Android Development] jackq:
Flashed latest MM kernel patched using v5 beta7 and im really impressed about battery life. Great job dude! :good::good::good:
[Xperia Z5 Android Development] sovanyio:
This doesn't appear to be related to the kernel.
[Xperia Z5 Android Development] :
Maybe wrong part of logcat but it is. Only crashes with kernels created using 5.0b7. Unless you can explain it another way.
[Xperia Z5 Android Development] tobias.waldvogel:
Just a few more questions: So can you confirm that it did not happen with

- Earlier versions of this script

- xposed on system partition

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] :
Can confirm. Happened on both .224 and .185. No Xposed installed in kernel. All other options including SuperSU selected both times.
[Xperia Z5 Android Development] tobias.waldvogel:
And just to be sure: With the stock kernel it did not happen, correct?

If so then I would like to ask you to conduct one more test: Could you try if it happens if you don't include the drmfix?

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] :
Stock kernel or 4.51 ver no issues. I'll give it a shot right now. :)

---------- Post added at 11:20 PM ---------- Previous post was at 11:09 PM ----------

Creation log:

C:\adb\rootkernel>rootkernel C:\adb\rootkernel\kernel_S1-SW-LIVE-F936-PID1-0006-MMC.elf boot_50b7_drmfix.img
- Unpacking kernel
Found elf boot image
Kernel version: 3.10.84-perf-g4a67e86
Found appended DTB
- Detected vendor: somc (Sony), device: sumire (Z5), variant: row
- Unpacking initramfs
- Detected platform: 64-bit
- Detected Android version: 6.0.1
- dm-verity is enabled. Disable? (Say yes if you modify /system) [Y/n] Y
Disabling dm-verity
- Sony RIC is enabled. Disable? [Y/n] Y
Disabling Sony RIC
- Install TWRP recovery? [Y/n] Y
Installing TWRP
Compressing TWRP image
- Install busybox? [Y/n] Y
- Found xposed-v85-sdk23-arm64.zip. Install? [Y/n] N
- Install DRM fix? [Y/n] Y
- Creating new initramfs
- Creating boot image
- Cleaning up
Done

C:\adb\rootkernel>rootkernel C:\adb\rootkernel\kernel_S1-SW-LIVE-F936-PID1-0006-MMC.elf boot_50b7_nodrmfix.img
- Unpacking kernel
Found elf boot image
Kernel version: 3.10.84-perf-g4a67e86
Found appended DTB
- Detected vendor: somc (Sony), device: sumire (Z5), variant: row
- Unpacking initramfs
- Detected platform: 64-bit
- Detected Android version: 6.0.1
- dm-verity is enabled. Disable? (Say yes if you modify /system) [Y/n] Y
Disabling dm-verity
- Sony RIC is enabled. Disable? [Y/n] Y
Disabling Sony RIC
- Install TWRP recovery? [Y/n] Y
Installing TWRP
Compressing TWRP image
- Install busybox? [Y/n] Y
- Found xposed-v85-sdk23-arm64.zip. Install? [Y/n] N
- Install DRM fix? [Y/n] N
Skipping drmfix
- Creating new initramfs
- Creating boot image
- Cleaning up
Done

Results:

-Stock boot.img: no issues

-boot_50b7_nodrmfix.img: no issues

-boot_50b7_drmfix.img: crash on initial setup and accessing single conversation view
[Xperia Z5 Android Development] tobias.waldvogel:
Thanks for the testing. Then I think I know where to look

Gesendet von meinem E6683 mit Tapatalk
[Xperia Z5 Android Development] SovPanda:
Trying the betakernel, I haven't experienced any major issue, su and xposed installed systemless nicely. The only issue was my favorite game force closes using the beta, if you have time do mind looking at my log? Thank you

Game: one piece treasure cruise
[Xperia Z5 Android Development] langeveld024:
repacked OM5Z kernel using v4.51, xreality and vivid didnt work. then flashed the old obsolete drmrestore.zip and all is fine. how is this possible? am i missing something?