Z1c Nougat Roms

levone1

Senior Member
Dec 28, 2014
3,741
1,451
243
Donated my phone, so been out of the loop for a few weeks, but just got a new one. Going to try to update op tonight...
 

ULT][MO

Senior Member
Oct 11, 2015
99
24
0
Hi there,

I made a CM14.1 build for amami for you to try, based on the sources of sonyxperiadev, SonyCM and SonyAosp. So a big thank you is in order to everyone involved in these projects. I only modified the sonyxperiadev amami sources to work with this build, set SELinux to enforced and removed the Gello browser from the build (there are more updated derivatives on the Play Store anyway).

I have run it for a little bit, and noticed the following bugs so far:

- deepsleep not working when wifi is on (I think)
- camera sometimes force closes, sometimes works (known memory leak bug I think, cam is work in progress)
- lots of CM stuff is not there yet, including themes (remember, CM14.1 is a work in progress)
- ?

To install it, you most likely need real recovery with TWRP3. It includes the new Sony init, so reboot to recovery from ROM works. I'm currently using it with latest OpenGapps and SuperSU, which both seem to work fine as well.

The Z1C is currently my secondary phone, but once it becomes more stable and feature-rich and once Xposed is available for 7.1 (fingers crossed), I will probably also build for the Z3C. Unless we get to see some official CM love again of course.

Sources:

sonyxperiadev: https://github.com/sonyxperiadev
SonyCM: https://github.com/SonyCM
SonyAosp: https://github.com/sonyaosp
Mine (for amami): https://github.com/derfelot/android_device_sony_amami

Download: https://www.androidfilehost.com/?fid=457095661767120697

Cheers :)
Tried this evening. Only one hour, but rom seems very stable, cam is dark and sometimes shut down. Mobile data is not working. Cm file manager don't "see" the root permissions to open external sd Some little fixes and could be a great CM rom. Thanks a lot derf elot;)
 

Micha_Btz

Senior Member
Jul 27, 2012
294
92
58

derf elot

Senior Member
May 7, 2011
817
1,706
0
Hi,

Awsome!, open a new thread. It will be very useful, for development :D
I will try to tinker with it a bit more this weekend if I have the time. Also, I would like to wait for new Sony blobs first to see if (and how) cam will improve.

Tried this evening. Only one hour, but rom seems very stable, cam is dark and sometimes shut down. Mobile data is not working. Cm file manager don't "see" the root permissions to open external sd Some little fixes and could be a great CM rom. Thanks a lot derf elot;)
Cam will get better soon hopefully (see above). As for mobile data, I wasn't able to check, since the Z1C is my secondary phone and it only has a prepaid sim without any credit right now ;) CM file manager is likely a CM issue that will get fixed. Root browser for example works.

hey, from were do you get the binary blobs?
Since the repo from muppet is really outdatet.
https://github.com/TheMuppets/proprietary_vendor_sony
Check the manifest on the SonyCM github. It uses the up-to-date blobs from SonyAosp. Which is good, because this way they are always updated.

Has anyone tried encryption yet by any chance? If I get around to it this weekend, I also want to make a new twrp that can decrypt, built from within these sources.

Overall, this was just a first build I did after setting up the compile environment, manifests and modified the amami sources.

Cheers
 

gullz

Member
Jan 16, 2012
17
1
0
Has anyone tried encryption yet by any chance? If I get around to it this weekend, I also want to make a new twrp that can decrypt, built from within these sources.
When I try to encrypt the phone from the settings menu, it simply soft reboots. This is shown in the log (I did not dig deeper yet):
Code:
12-11 15:58:15.808  8467  9207 D CryptdConnector: SND -> {12 cryptfs enablecrypto inplace default}
12-11 15:58:15.811  8467  8710 D CryptdConnector: RCV <- {200 12 0}
12-11 15:58:15.812   314 11947 E Cryptfs : Bad magic for real block device /dev/block/bootdevice/by-name/userdata
12-11 15:58:15.813   314 11947 E Cryptfs : Orig filesystem overlaps crypto footer region.  Cannot encrypt in place.
Other than that (and the camera), the rom runs fine so far. Thank you for sharing your efforts.
 
  • Like
Reactions: derf elot

derf elot

Senior Member
May 7, 2011
817
1,706
0
Hi,

thanks for testing. I just tested on mine and it works. My guess is, that you need to format once with a "proper" TWRP contining the right fstab lines for data:

Code:
/data auto /dev/block/platform/msm_sdcc.1/by-name/userdata flags=length=-16384
The length flag is important here I think, otherwise there won't be room for the crypto footer. My previous TWRP build, compiled from within the CM12.1 sources, seems to work for that. But I am currently making a new TWRP built from the CM14.1 sources. It builds fine, just have to add the required things for decryption (quite a few things).

Also made an updated build, now running on 7.1.1. Will upload it later if I have the time.

Cheers
 

karamancho

Senior Member
May 14, 2014
476
134
73
is there any way to remap the hardware buttons without xposed?

my power button went kaputt one month ago and I rely on xposed to make the camera button act as power button for now but I'd like to try some N roms.
 

gullz

Member
Jan 16, 2012
17
1
0
Hi,

thanks for testing. I just tested on mine and it works. My guess is, that you need to format once with a "proper" TWRP contining the right fstab lines for data:

Code:
/data auto /dev/block/platform/msm_sdcc.1/by-name/userdata flags=length=-16384
The length flag is important here I think, otherwise there won't be room for the crypto footer. My previous TWRP build, compiled from within the CM12.1 sources, seems to work for that. But I am currently making a new TWRP built from the CM14.1 sources. It builds fine, just have to add the required things for decryption (quite a few things).

Also made an updated build, now running on 7.1.1. Will upload it later if I have the time.

Cheers
Thanks, it seems when formatting an encrypted /data in a TWRP that does not support decrypting it, the partition gets too big (even with the length flag in fstab). I think this was the problem, I could reproduce this behaviour and it can be fixed by resizing the partition (e.g., like so https://dustri.org/b/cyanogen-reboot-without-encrypting-the-phone.html).
With your sources, I can build CM 14.1 for amami, this is really nice. However, I am not sure how to include TWRP. Would you mind sharing your repo manifest?

Best regards
 

derf elot

Senior Member
May 7, 2011
817
1,706
0
Thanks, it seems when formatting an encrypted /data in a TWRP that does not support decrypting it, the partition gets too big (even with the length flag in fstab). I think this was the problem, I could reproduce this behaviour and it can be fixed by resizing the partition (e.g., like so https://dustri.org/b/cyanogen-reboot-without-encrypting-the-phone.html).
With your sources, I can build CM 14.1 for amami, this is really nice. However, I am not sure how to include TWRP. Would you mind sharing your repo manifest?

Best regards
Encryption is still a bit of a mystery to me sometimes. Been trying to get decryption working in TWRP with my latest CM build, but it's not even asking for a password/pin anymore right now (even though I have set all the TW flags that were enough to get it to work in LP and MM). I will try some more at a later time.

Here's my manifest to build TWRP:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!--Please do not manually edit this file-->
<manifest>
  <!-- This xml is project for make sony targets work with AOSP hardware -->
  <!-- CM stuff -->

  <remove-project name="CyanogenMod/android_bootable_recovery" />
  <remove-project name="CyanogenMod/android_hardware_qcom_audio" />
  <remove-project name="CyanogenMod/android_hardware_qcom_display" />
  <remove-project name="CyanogenMod/android_hardware_qcom_fm" />
  <remove-project name="CyanogenMod/android_hardware_qcom_media" />
  <remove-project name="CyanogenMod/android_packages_apps_FMRadio" />

  <project name="derfelot/android_bootable_recovery" path="bootable/recovery" remote="github" revision="android-7.1" />
  <project name="sonyxperiadev/packages-apps-FMRadio" path="packages/apps/FMRadio" remote="github" revision="master" />

  <!-- common -->
  <project name="derfelot/android_device_sony_common" path="device/sony/common" remote="github" revision="cm-14.1" />

  <!-- rhine -->
  <project name="SonyCM/android_device_sony_rhine" path="device/sony/rhine" remote="github" revision="cm-14.1" />
  <project name="derfelot/android_device_sony_amami" path="device/sony/amami" remote="github" revision="cm-14.1-twrp" />

  <!-- sony sepolicy -->
  <project name="sonyxperiadev/device-sony-sepolicy" path="device/sony/sepolicy" remote="github" revision="n-mr0" />
  
  <!-- kernel 3.10 -->
  <project name="sonyxperiadev/kernel" path="kernel/sony/msm" remote="github" revision="aosp/LA.BR.1.3.3_rb2.14" />

  <!-- qcom hardware -->
  <project name="SonyCM/android_hardware_qcom_audio" path="hardware/qcom/audio/default" remote="github" revision="cm-14.1" />
  <project name="SonyCM/android_hardware_qcom_display" path="hardware/qcom/display" remote="github" revision="cm-14.1" />
  <project name="sonyxperiadev/vendor-qcom-opensource-fm" path="hardware/qcom/fm" remote="github" revision="master" />
  <project name="SonyCM/android_hardware_qcom_media" path="hardware/qcom/media" remote="github" revision="cm-14.1" />

  <!-- sony hardware -->
  <project name="derfelot/android_hardware_sony_camera" path="hardware/sony/camera" remote="github" revision="cm-14.1" />
  <project name="sonyxperiadev/thermanager" path="hardware/sony/thermanager" remote="github" revision="master" />
  <project name="sonyxperiadev/timekeep" path="hardware/sony/timekeep" remote="github" revision="master" />
  <project name="sonyxperiadev/macaddrsetup" path="hardware/sony/macaddrsetup" remote="github" revision="master" />
  <project name="sonyxperiadev/device-sony-common-init" path="hardware/sony/init" remote="github" revision="master" />
  <project name="sonyxperiadev/vendor-qcom-opensource-dataservices" path="hardware/sony/dataservices" remote="github" revision="master" />
  
  <!-- vendor -->
  <project name="SonyAosp/vendor_nxp" path="vendor/nxp" remote="github" revision="android-7.0" />
  <project name="SonyAosp/vendor_qcom" path="vendor/qcom" remote="github" revision="android-7.0" />
  <project name="SonyAosp/vendor_sony" path="vendor/sony" remote="github" revision="android-7.0" />
  <project name="SonyAosp/vendor_qcom_firmware" path="vendor/qcom/firmware" remote="github" revision="android-7.0" />
</manifest>
You will also need a busybox, I got the one from omnirom

Code:
<project name="omnirom/android_external_busybox" path="external/busybox" remote="github" revision="android-7.1" />
I have forked some SonyCM stuff to merge updates from sonyxperiadev. Also, the android_bootable_recovery from omnirom needed a little tweak.

what would I need to edit so that the camera button acts as a power button?
You could try to comment out the the key that says "key xxx POWER" and replace the CAMERA in "key xxx CAMERA" to POWER. It might work, not sure though.

I have uploaded a new CM14.1 build, now based on Android 7.1.1. Some upstream changes from sonyxperiadev are in there too. You can grab it here:

https://www.androidfilehost.com/?fid=673368273298916137
 
Last edited:

karamancho

Senior Member
May 14, 2014
476
134
73
You could try to comment out the the key that says "key xxx POWER" and replace the CAMERA in "key xxx CAMERA" to POWER. It might work, not sure though.
there were 2 lines labeled as POWER and I commented them both, changed the CAMERA line to POWER, and restarted the prone.

unfortunately it didn't work
 

ULT][MO

Senior Member
Oct 11, 2015
99
24
0
Encryption is still a bit of a mystery to me sometimes. Been trying to get decryption working in TWRP with my latest CM build, but it's not even asking for a password/pin anymore right now (even though I have set all the TW flags that were enough to get it to work in LP and MM). I will try some more at a later time.

Here's my manifest to build TWRP:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!--Please do not manually edit this file-->
<manifest>
  <!-- This xml is project for make sony targets work with AOSP hardware -->
  <!-- CM stuff -->

  <remove-project name="CyanogenMod/android_bootable_recovery" />
  <remove-project name="CyanogenMod/android_hardware_qcom_audio" />
  <remove-project name="CyanogenMod/android_hardware_qcom_display" />
  <remove-project name="CyanogenMod/android_hardware_qcom_fm" />
  <remove-project name="CyanogenMod/android_hardware_qcom_media" />
  <remove-project name="CyanogenMod/android_packages_apps_FMRadio" />

  <project name="derfelot/android_bootable_recovery" path="bootable/recovery" remote="github" revision="android-7.1" />
  <project name="sonyxperiadev/packages-apps-FMRadio" path="packages/apps/FMRadio" remote="github" revision="master" />

  <!-- common -->
  <project name="derfelot/android_device_sony_common" path="device/sony/common" remote="github" revision="cm-14.1" />

  <!-- rhine -->
  <project name="SonyCM/android_device_sony_rhine" path="device/sony/rhine" remote="github" revision="cm-14.1" />
  <project name="derfelot/android_device_sony_amami" path="device/sony/amami" remote="github" revision="cm-14.1-twrp" />

  <!-- sony sepolicy -->
  <project name="sonyxperiadev/device-sony-sepolicy" path="device/sony/sepolicy" remote="github" revision="n-mr0" />
  
  <!-- kernel 3.10 -->
  <project name="sonyxperiadev/kernel" path="kernel/sony/msm" remote="github" revision="aosp/LA.BR.1.3.3_rb2.14" />

  <!-- qcom hardware -->
  <project name="SonyCM/android_hardware_qcom_audio" path="hardware/qcom/audio/default" remote="github" revision="cm-14.1" />
  <project name="SonyCM/android_hardware_qcom_display" path="hardware/qcom/display" remote="github" revision="cm-14.1" />
  <project name="sonyxperiadev/vendor-qcom-opensource-fm" path="hardware/qcom/fm" remote="github" revision="master" />
  <project name="SonyCM/android_hardware_qcom_media" path="hardware/qcom/media" remote="github" revision="cm-14.1" />

  <!-- sony hardware -->
  <project name="derfelot/android_hardware_sony_camera" path="hardware/sony/camera" remote="github" revision="cm-14.1" />
  <project name="sonyxperiadev/thermanager" path="hardware/sony/thermanager" remote="github" revision="master" />
  <project name="sonyxperiadev/timekeep" path="hardware/sony/timekeep" remote="github" revision="master" />
  <project name="sonyxperiadev/macaddrsetup" path="hardware/sony/macaddrsetup" remote="github" revision="master" />
  <project name="sonyxperiadev/device-sony-common-init" path="hardware/sony/init" remote="github" revision="master" />
  <project name="sonyxperiadev/vendor-qcom-opensource-dataservices" path="hardware/sony/dataservices" remote="github" revision="master" />
  
  <!-- vendor -->
  <project name="SonyAosp/vendor_nxp" path="vendor/nxp" remote="github" revision="android-7.0" />
  <project name="SonyAosp/vendor_qcom" path="vendor/qcom" remote="github" revision="android-7.0" />
  <project name="SonyAosp/vendor_sony" path="vendor/sony" remote="github" revision="android-7.0" />
  <project name="SonyAosp/vendor_qcom_firmware" path="vendor/qcom/firmware" remote="github" revision="android-7.0" />
</manifest>
You will also need a busybox, I got the one from omnirom

Code:
<project name="omnirom/android_external_busybox" path="external/busybox" remote="github" revision="android-7.1" />
I have forked some SonyCM stuff to merge updates from sonyxperiadev. Also, the android_bootable_recovery from omnirom needed a little tweak.



You could try to comment out the the key that says "key xxx POWER" and replace the CAMERA in "key xxx CAMERA" to POWER. It might work, not sure though.

I have uploaded a new CM14.1 build, now based on Android 7.1.1. Some upstream changes from sonyxperiadev are in there too. You can grab it here:

https://www.androidfilehost.com/?fid=673368273298916137
Tested.
- Camera crash after photo click
- Front camera has good quality, but its upside-down
- sim data not working
- some battery errors in the log
My PC is offline and I can't post the log I've done from my phone. I hope to post it soon
 

gullz

Member
Jan 16, 2012
17
1
0
I have run it for a little bit, and noticed the following bugs so far:

- deepsleep not working when wifi is on (I think)
- camera sometimes force closes, sometimes works (known memory leak bug I think, cam is work in progress)
- lots of CM stuff is not there yet, including themes (remember, CM14.1 is a work in progress)
- ?
Concerning the sleep, it seems the CPU stays awake all the time. Even in flight mode 'dumpsys batterystats' shows that the CPU is constantly running. The wakelocks are only taken for short amounts of time and therefore seem fine. I will try to find out more about this some time this week.

Edit: It was the Android OS itself, more precisely msm_dwc3 that seems to have gotten stuck taking a wakelock after USB charging or debugging. After a reboot, deep sleep is working fine again...

Regards
 
Last edited:

derf elot

Senior Member
May 7, 2011
817
1,706
0
Concerning the sleep, it seems the CPU stays awake all the time. Even in flight mode 'dumpsys batterystats' shows that the CPU is constantly running. The wakelocks are only taken for short amounts of time and therefore seem fine. I will try to find out more about this some time this week.

Edit: It was the Android OS itself, more precisely msm_dwc3 that seems to have gotten stuck taking a wakelock after USB charging or debugging. After a reboot, deep sleep is working fine again...

Regards

Ah yes, I think that's a known bug and can be fixed for now by reverting it back to the one from the 1.2.2 kernel : https://github.com/rcstar6696/kernel/commit/fc3f0f55cdc165796c0117b89330c88165b5c4f2

What I found though was that even if CPU goes to deepsleep, my phone uses about 1/3rd of battery per day, while on airplane mode. Used to be 5-10% on CM12.1. I will investigate when I have some time. Maybe reverting the driver will help already.
 
  • Like
Reactions: Jesusnagler