yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 Compact Android Development] esrevinu:
There is qcom's new sepolicy in LOSROOT/device/qcom/sepolicy, while kitakami uses LOSROOT/device/qcom/sepolicy-legacy.

The new one has policy on widevine DRM. Following this, I changed the patch:

diff --git a/sepolicy/vendor/file.te b/sepolicy/vendor/file.te
index 1111362..3f125e9 100644
--- a/sepolicy/vendor/file.te
+++ b/sepolicy/vendor/file.te
@@ -12,3 +12,6 @@ type sysfs_timekeep, fs_type, sysfs_type;
type ta_data_file, file_type;
type tad_socket, file_type;
type timekeep_data_file, file_type, data_file_type;
+#widevine data file
+type mediadrm_vendor_data_file, file_type, data_file_type;
+
diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts
index b1b988e..cc70ffa 100644
--- a/sepolicy/vendor/file_contexts
+++ b/sepolicy/vendor/file_contexts
@@ -22,6 +22,7 @@
# DRM
/(vendor|system/vendor)/bin/hw/android\.hardware\.drm@1\.2-service.clearkey u:object_r:hal_drm_clearkey_exec:s0
/(vendor|system/vendor)/bin/hw/android\.hardware\.drm@1\.1-service.widevine u:object_r:hal_drm_widevine_exec:s0
+/data/vendor/mediadrm(/.*)? u:object_r:mediadrm_vendor_data_file:s0

# BRCM BT FM
/sys/bus/platform/drivers/bcm_ldisc/bcmbt_ldisc(/.*)? u:object_r:brcm_ldisc_sysfs:s0
diff --git a/sepolicy/vendor/hal_drm_clearkey.te b/sepolicy/vendor/hal_drm_clearkey.te
index 286e248..ac671a3 100644
--- a/sepolicy/vendor/hal_drm_clearkey.te
+++ b/sepolicy/vendor/hal_drm_clearkey.te
@@ -8,3 +8,6 @@ allow hal_drm_clearkey hal_drm_hwservice:hwservice_manager { add find };
allow hal_drm_clearkey hidl_base_hwservice:hwservice_manager add;
allow hal_drm_clearkey hwservicemanager:binder { call transfer };
allow hal_drm_clearkey hwservicemanager_prop:file r_file_perms;
+
+allow mediadrmserver hal_drm_clearkey:binder { call transfer };
+allow hal_drm_clearkey mediadrmserver:binder { call transfer };
diff --git a/sepolicy/vendor/hal_drm_widevine.te b/sepolicy/vendor/hal_drm_widevine.te
new file mode 100644
index 0000000..105b2e9
--- /dev/null
+++ b/sepolicy/vendor/hal_drm_widevine.te
@@ -0,0 +1,2 @@
+allow hal_drm_widevine mediadrm_vendor_data_file:file create_file_perms;
+allow hal_drm_widevine mediadrm_vendor_data_file:dir create_dir_perms;
[Xperia Z5 Compact Android Development] esrevinu:
I have tried removing secd from TARGET_LD_SHIM_LIBS.

Now secd_exec denials disappear, and the phone works fine so far.

diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index 5aba7ff..341af83 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -197,7 +197,9 @@ TARGET_LD_SHIM_LIBS := \
/system/lib/libcammw.so|libsensor.so \
/system/vendor/lib/libizat_core.so|/system/vendor/lib/libshim_gps.so \
/system/vendor/lib64/libizat_core.so|/system/vendor/lib64/libshim_gps.so \
- /system/bin/secd|/system/lib64/lib-preload64.so
+
+
+ #/system/bin/secd|/system/lib64/lib-preload64.so

# SELinux
include device/qcom/sepolicy-legacy/sepolicy.mk
[Xperia Z5 Compact Android Development] Berni-0815:
Where is this information from?

FYI:

I'm not an expert in SELinux related thing. I'm just doing, what I'm able to do.

I often need more information; so, if you're able to, please help me!
[Xperia Z5 Compact Android Development] Berni-0815:
That's because of missing rights. My suggestion is not to do those kind of manipulations.

In my experience it's better to use a flashable ZIP file and modify the content of this ZIP file to fit your needs.
[Xperia Z5 Compact Android Development] esrevinu:
In the beginning, there is nothing under /data/vendor/mediadrm. If the phone starts with selinux permissive, widevine creates dirs and files under that directory. So you can know that the create permission is needed.

You can also see this policy in the LOSROOT/device/qcom/sepolicy.

Clearkey things were obtained by rebuild and logcat.
[Xperia Z5 Compact Android Development] Berni-0815:
At my device there is nothing in this directory.

See above. And I started with permissive SELInux mode!

Ok, that makes sense. As I wrote, I've included those permissions.

In our experience this sepolicy produces a lot of build errors.

(y)
[Xperia Z5 Compact Android Development] 1ggn3:
I just tested it "by accident", and I charged my phone from 0 to 30% while turned off. I was using a 2A charger, the same one I used to check the temperatures before. When I turned the phone on, the battery temperature was reported as almost 46°C, which is way to high. After the phone booted, the temperatures went back to their usual 40-42°C.

It looks like the charger binary really does not limit the charging current for some reason. I'm sure that there is some well-hidden config file that will fix it, but I have no idea where to look :)
[Xperia Z5 Compact Android Development] tarukanav:
Heya

first thanx for great work ,been using this one now for 3 weeks have no battery heating issues while charging have to say that battery even lasts longer than on stock , only issue is the camera problems that all other have also, other than that this rom works just great . ALSO one thing that really anoys me tho is the lockscreen clock u cant change or remove it ;)
[Xperia Z5 Compact Android Development] Ermann123:
Is it possible to just sideload 17.1 over 14.1; and if yes, also possible to sideload back to 14.1 over 17.1 in case of problems?
[Xperia Z5 Compact Android Development] Berni-0815:
That's no good idea; some users reported weird issues. It seems that /data is not compatible.
[Xperia Z5 Compact Android Development] beflythis:
This build getting the Jan 5 2021 security patch, or should people be migrating over to the updated 11 version in the alternate thread?
[Xperia Z5 Compact Android Development] Berni-0815:
Currently there are no updates available. It's not laying in my hands at which time any update will be available.

As soon as there are updates, I will build a new ROM.

Please be patient.

Nevertheless it is a good idea to switch to the latest available version of my ROMs. And los18.1 runs as stable as possible.
[Xperia Z5 Compact Android Development] Ermann123:
So, finally, I gave it a try, migrating from 14.1 to 17.1, and did the long hard way of backing up everything manually (without decrypting twrp).

I found out, that with 17.1 Encryption is working, when it is done BEFORE installing Magisk module.

The very first impression was quite nice, especially with the dark theming.

The next impression decreased quickly. The ROM does not at all feel as fast and snappy like 14.1, but rather laggy in responding to inputs. Also, battery life is ridiculous short.

The DO NOT DISTURB tile only works with standard setting, (until deactivation). Trying to tap the other options triggers some other things in layers behind the visible dialog.

Some apps refuse to work at all, e.g. an online chess application. (Which is pity, but minor issue).

In the meantime, when trying to perform a reboot, the ROM gets stuck in the boot animation,. Not a bootloop, but not even animating, just frozen picture.

Thought, that probably the device is just too old for modern android version, so , once erased the initial configuration anyway, I decided to try 15.1, but there the ENcrypion is resulting in a bootloop , even with Magisk not yet installed.

Would really like to switch back to 14.1 inmmediately, which is rock solid stable, but for backuo/restoring reasons, I need to take the indirect route via reinstalling 17.1 again, in order to shift my data to a again 14.1 compatible format.

I am very sorry to say, that 17.1 is not stable at all, against my big hope :(

Because of this messy way of keeping the data save each time, I wont test/try other ROMs again, until at least, TWRP is able to perform DEcryption. (In all day productive mode, an unencrypted phone is not an option).

Would really like to hear form other users about maybe similiar experiences or any hints. Thx!
[Xperia Z5 Compact Android Development] esrevinu:
I have an issue that wifi mac address is set to a fake one(00:90:4c:11:22:33) when wifi is connected to an AP. If I do `ifconfig wlan0 down`, it shows the factory device mac address.

01-19 23:50:40.609 1105 2714 I WifiClientModeImpl: Connecting with 00:90:4c:11:22:33 as the mac address

A similar issue is here.
[Xperia Z5 Compact Android Development] Berni-0815:
I can't confirm anything that you're writing. I think the main problem is that you've tried to encrypt the device. It's unfortunateley a well known issue that encryprion is not working at all. And I think, this may cause your mentioned problems with that ROM.

I for myself am using los18.1 as my daily driver since months now and I'm very happy with that ROM!
[Xperia Z5 Compact Android Development] Berni-0815:
My device shows the same mac address but a short look into the real connection at my AP shows the real mac address of the z5c.

I think it's due to mac randomization started in Android 10. But I'm not quite sure about that.

Fact is, the real mac address is served to the AP!
[Xperia Z5 Compact Android Development] esrevinu:
My phone is shown as an Epigram Inc. device with the fake mac address on my router. Having looked into the source code, I don't think that this is mac address randomization. If it is, that change should be logged. In addition, this fake mac address is not changing over boots.
[Xperia Z5 Compact Android Development] Berni-0815:
New version out; see 1st post. This issue should have been fixed. ;)
[Xperia Z5 Compact Android Development] pesho.balkansky:
I'm using this ROM for a month now and everything works great so far. There was only one app which couldn't run for some reason, but it's not a big deal.

One noob question though, is how to restore all of my settings after flashing a new version?

The problem is that when flashing without a full wipe many functions don't work for me.

So I perform a full wipe before each update and in order to save my configuration I used the Google backup and tried SeedVault, but nothing can restore all of my settings from before the wipe.

And my question is, what do you use to backup and restore your configurations?
[Xperia Z5 Compact Android Development] esrevinu:
What functions don't work after you flash without a full wipe?

You don't need to wipe data if you update this rom within the same OS version. Even if you have open-gapps installed, you only need to flash this rom. If you want a cleaner flash, you need to wipe system partition only and flash this rom and gapps.

Google backup and SeedVault seem not to backup all app data. SMS, Call log, Wifi settings, and some apps data are backed up. If you want to restore all app data after a full wipe, you have to use Titanium backup.
[Xperia Z5 Compact Android Development] petefoth:
I currently use TWRP for backing up my devices, when of upgrading from one build to the next. I usually start with a ‘dirty flash’ - installing the new ROM without wiping the existing data used by the old ROM. If that doesn’t work, I wipe the data partition and do a clean install, then restore my apps and data from the TWRP backup. This works well, and has rescued me a couple of times when I flashed my device into a non-functioning state :)
[Xperia Z5 Compact Android Development] Berni-0815:
That's interesting for me too! I can't believe that, because I never had such issues.
[Xperia Z5 Compact Android Development] pesho.balkansky:
Thank you! I'll try Titanium backup and the second approach with TWRP.

And for me, when trying "dirty flash" the mic stops working and the camera freezes.

I'll try to wipe only the system partition for the next update and see if the mic and camera still work
[Xperia Z5 Compact Android Development] ALEX88_XDA:
Do you think that I will encounter problems during installation because I have a z5 compact version of the docomo so-02 ??? Thanks!! I always preferred a custom rom !!
[Xperia Z5 Compact Android Development] Berni-0815:
Weird!!
[Xperia Z5 Compact Android Development] Berni-0815:
I really don't know. Give it a try. But before you do so, fetch a stock ROM of your devices version to go back eventually. For that you should use FlashTool and the integrated XPeriFirm
[Xperia Z5 Compact Android Development] ALEX88_XDA:
I had a lot of xperia phones and I played with them a lot when it comes to custom rom, I will unlock the bootloader first and I will try, anyway I will install the global version on it. It would be sad not to work, I still don't the phone arrived, come this week!!
[Xperia Z5 Compact Android Development] Ermann123:
Okay, I think that encryption is not the reason, because some things (like stuck boot animation loop) even occured at another, unencrypted try.

Maybe it has to do with the New Magisk (21.x) or I don't know. For now I stopped the trial, need to have it stable again with 14.1 :)
[Xperia Z5 Compact Android Development] Berni-0815:
I've only tested Magisk-21.1(21100).zip. And that worked good.
[Xperia Z5 Compact Android Development] jonathan_lau:
[MENTION=2693412]haggertk[/MENTION] may help you (builds AOSP for klte [Galaxy S5]). It's using a Snapdragon 801, not exactly the same, but helping is always possible.
[Xperia Z5 Compact Android Development] mrrocketdog:
[MENTION=7749536]Berni-0815[/MENTION] , although i am not currently using your rom (never know about the future though. :) ); i very much appreciate your work , time and sharing.:good:

i just got my z5c about 3wks ago , coming from years of galaxy s4 , and am very glad a dev is still providing options for us users. thank you again. all the best for you and yours ,

dave
[Xperia Z5 Compact Android Development] Berni-0815:
New version out; see 1st post: Android security patch level: 5 March 2020
[Xperia Z5 Compact Android Development] casouzaj:
Thanks, Bernhard! I think that my everlasting bootloop issue wherever I try to install your 17.1 builds might be related to the fact that half of my SD card is defined as adoptable storage. Anyone else here in the same situation?
[Xperia Z5 Compact Android Development] mrrocketdog:
not in that situation but have tried taking out sdcard? just put rom on internal. maybe?
[Xperia Z5 Compact Android Development] weasal:
I've read that adding the following to build.prop can help with RAM usage?

ro.config.low_ram=true

# Force high-end graphics in low ram mode

persist.sys.force_highendgfx=true

without affecting graphics performance.

Can someone who has the ROM installed test it out?
[Xperia Z5 Compact Android Development] Berni-0815:
I'll try it asap...

Edit:

RAM usage is much lower without gapps and I don't see lags any more. System doesn't freeze and wakes up without any problems.

But battery life is worse
[Xperia Z5 Compact Android Development] casouzaj:
It's not that simple! Once you set adoptable storage, internal storage (/storage/emulated/0) contents (files and folders) reside in that partition. The physical internal storage holds most apps (and their data) and caches, and it's not addressable by apps.
[Xperia Z5 Compact Android Development] weasal:
Maybe the persist.sys.force_highendgfx=true is causing this, it's supposed to reduce the choppiness due to the reduced memory usage so maybe try without it.

Or maybe, due to the available ram, some power hungry process is not getting killed.
[Xperia Z5 Compact Android Development] Berni-0815:
I'm ready to build a new version. What should I set?
[Xperia Z5 Compact Android Development] weasal:
Just

ro.config.low_ram=true
[Xperia Z5 Compact Android Development] Berni-0815:
Done. At first sight I can see no differences. 1,5 GB (see screenshot) have been used before too.

In my eyes this is way too much!
[Xperia Z5 Compact Android Development] Josh Guan:
Hi Berni

thanks for you projects, because i have 2 z5c, one using lineage 14.1 and another one using lineage 17.1 all ROM made by you, i really love what you did. :good::good::good:

and as the link https://xdaforums.com/android/software-hacking/mod-low-ram-property-patcher-android-t3737373

it seems like an another project about Android Go, i think maybe you can add this in the lineage os 17.1 what you made, i'm not sure if you can add it.

because when i using lineage os 15.1 in sony xperia sp with "android_lowram_enabler" to enable "Low-RAM Property Patcher" and also i found the different is about whether has ZRAM.

and i have z1c and install lineage os 16.0 as link https://xdaforums.com/sony-xperia-z...om-lineage-os-16-0-xperia-z1-compact-t3886233

it seems include"Low-RAM Property Patcher" becasue when i check the info can see it has ZRAM without enable "android_lowram_enabler", but stock ROM didn't have ZRAM.

and when i using lineage 17.1 or 16.0 in z1c, normally just only use 1.1 GB with gapp nano but i'm not sure, if "Low-RAM Property Patcher" can reduce system or other app usage to RAM?

if not, it's ok, i just try to help you.
[Xperia Z5 Compact Android Development] Berni-0815:
I'm not sure if that will help us. I don't really understand what this mod is doing... :confused:

Help is always welcome! :good:
[Xperia Z5 Compact Android Development] Berni-0815:
After a while laying on my table the system freezes and doesn't react any more... :eek:
[Xperia Z5 Compact Android Development] Berni-0815:
Outgoing calls

Hi,

if there is someone who's outgoing calls are working, please tell me:

which provider are you using?

in which country/region are you living?

which "Set preferred network type" (see 1st screenshot) are you using?

the first five/six numbers (MCC and MNC) of your IMSI (*#*#info#*#*; Phone Info); see 1st screenshot.

the value of "Voice service".

the value of "Voice network type".

Tap on the three dots in the upper right corner and tell me which "Set Radio Band Mode" are displayed? (see 2nd screenshot)

It would be best if you take a screenshot, delete all personal stuff and send me this screenshot (see my 1st one).
[Xperia Z5 Compact Android Development] Berni-0815:
Last night my z5c crashes with kernel panic after trying to wake it up after deep sleep (more than 2 hours).

If anyone is able to read (and understand) dmesg-ramoops; here is the file: Klick
[Xperia Z5 Compact Android Development] Josh Guan:
Hi Berni

yesterday i tried to outgoing calls two times and it can working well, as attached images.

update: i think i don't know how to attached image file

which provider are you using? 中華電信(CHT)

in which country/region are you living? Taiwan

which "Set preferred network type" (see 1st screenshot) are you using? GSM/WCDMA/LTE(PRL)

the first five/six numbers (MCC and MNC) of your (*#*#info#*#*; Phone Info); see 1st screenshot. 46692

the value of "Voice service". Emergency Calls Only(i don't know why i can calls other people)

the value of "Voice network type". Unknown

Tap on the three dots in the upper right corner and tell me which "Set Radio Band Mode" are displayed? (see 2nd screenshot) Automatic
[Xperia Z5 Compact Android Development] Berni-0815:
Thank you! :good:

Scroll down ("Additional Options"), then "Manage Attachments"...

But I can see your screenshots:

1st

2nd

3rd

Same here. This is definitely a problem! "Emergency Calls Only" is not ok. "Unknown voice network type" too...

Same here. In LineageOS 14.1 there are more options, e.g. "Europe".

Thank you very much! Now I know I'm not alone with these problems and I know where to search! This will take a long time because I don't know much about Java... :eek:
[Xperia Z5 Compact Android Development] Berni-0815:
New version out; see 1st post.

New: Phone calls and SMS fully working! :good:
[Xperia Z5 Compact Android Development] adytwjy:
Hi @Berni-0815 , thanks for your hardwork on this ROM.

I'd like to ask you why SafetyNet test on this ROM always failed? (I'm using SafetyNet Test app from Google Play). There is 1 banking app that detect my device is rooted, although I never did any root. I also did some test in another 2 devices (z3c and mi5) running official LOS 17.1, the SafetyNet test passed and that banking app can run well.

Are there differences between your LOS 17.1 and official LOS 17.1 that make SafetyNet test in this ROM failed? Is it possible to make this ROM passed the SafetyNet test without affecting your currently well-build LOS 17.1 for z5c? Please advice.. Thank you :)
[Xperia Z5 Compact Android Development] casouzaj:
@adytwjy, Bernhard will, probably, answer to your question, but let me give you my two cents: My Z5C phone is running the latest release of this ROM, it is rooted by the latest stable Magisk v21.4, and, after adding key apps (banking and work ones, among others) to Magisk's hide list, Safetynet tests pass fine here, both in Magisk"s built-in tests, and in Play Store's specific app. All my banking apps, as well as my working ones, which rely on MS' Intune Company Portal, run flawlessly (see attached screenshots).
[Xperia Z5 Compact Android Development] adytwjy:
Thank you @casouzaj for responding to my question, really appreciate it. May I know which variant of GApps you're using? I'm using pico.

In this case, are you suggesting that it would be better if I just rooting my z5c and adding key apps (perhaps there are other apps than the banking app that I should also adding in that list? I will try to search particular forum topic for this) to Magisk's hide list?

What I still don't understand is why SafetyNet test app showing failed result even though my z5c is not rooted, yet.. :unsure: I think I just wait for @Berni-0815 to explain about this..

Thank you :)
[Xperia Z5 Compact Android Development] Berni-0815:
Are you talking about official LineageOS 17.1 or shipped Android 10?

For sure there are differences! My LineageOS 17.1 is a grown project that started with cm14.1 (or cm13, if you will count that too).

And it's still WIP, currently I'm working on LineageOS 18.1.

And there are a lot of issues to fix.

But I really don't know why other operating systems pass this test and my os not...
[Xperia Z5 Compact Android Development] Berni-0815:
My device fails safety net check too. The "CTS profile match" fails. I have to take a closer look into that but I think it will be better to follow @casouzaj 's tip.
[Xperia Z5 Compact Android Development] casouzaj:
I remember now. This ROM, as is, really fails the CTS test. I have to install the MHPC Magisk module, then enter command props in a terminal emulator app (I use the one built-in in developer options) and enter: 1 > f > Sony > Z5C 6.0.1 > y > y. After rebooting is done, CTS now passes. I mean, you must be rooted by Magisk and change props in order to succeed.

And I use the opengapps mini version, because I prefer Pixel launcher.
[Xperia Z5 Compact Android Development] adytwjy:
Hi @Berni-0815 , thanks for your respond. I'm talking about the differences between your build and official LineageOS 17.1, not with shipped Android 10. Because if official LineageOS 17.1 are passed (I manage to test it on 3 different devices: z3c, mi5 and wt88047) and your build isn't, then perhaps there are some differences in config/files.. just a thought, because I don't have any experience in building custom rom :)
[Xperia Z5 Compact Android Development] adytwjy:
Thanks for confirming about this.. At this point I already tried what @casouzaj suggested, but still failed.. there must be some steps that I missed with MagiskHide
[Xperia Z5 Compact Android Development] casouzaj:
Have you read my post about MHPC just below Bernard's?
[Xperia Z5 Compact Android Development] adytwjy:
Hi @casouzaj , thank you.. this is such an enlightenment! I will try it.

Is this something that can be put in custom rom build, so we can have it after flashing and don't have to root our device, or we have to do this workaround every time regarding specific device? Would you and @Berni-0815 care to explain? Thanks! :)
[Xperia Z5 Compact Android Development] adytwjy:
Yes, thanks a lot @casouzaj ! I will try this now and report back to you ;)
[Xperia Z5 Compact Android Development] Berni-0815:
Could you please be a little more specific?
[Xperia Z5 Compact Android Development] casouzaj:
Enter command props on a terminal emulator app. A menu comes up. On it, choose item 1, then letter f, then the number corresponding to manufacturer Sony, then the number corresponding to Z5 Compact 6.01, then answer yes to the following questions (including reboot).