[ROM][UNOFFICIAL][6.0.1][E6653/E6603] CyanogenMod 13 for the Sony Xperia Z5 [ALPHA]

Search This thread

zacharias.maladroit

Recognized Developer
[ROM][UNOFFICIAL][6.0.1][E6653/E6603] CyanogenMod 13 for the Sony Xperia Z5 [ALPHA]


0vI9ZcB.jpg

CyanogenMod 13 for the Sony Xperia Z5 E6653 and E6603​

CyanogenMod is a free, community built, aftermarket firmware distribution of Android 6.0 (Marshmallow), which is designed to increase
performance and reliability over stock Android for your device.

CyanogenMod is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be
used without any need to have any Google application installed. You will need to provide your own Google Applications package (gapps).
CyanogenMod does still include various hardware-specific code, which is also slowly being open-sourced anyway.

Before you start

This ROM is only for the E6653 and the E6603

Code:
 *
 * Your warranty may be voided !
 *
 * I am not responsible for bricked devices, dead SD cards,
 * thermonuclear war, or you getting fired because the alarm app failed. Please
 * do some research if you have any concerns about features included in this ROM
 * before flashing it! YOU are choosing to make these modifications, and if
 * you point the finger at me for messing up your device, I will laugh at you.
 *

Special Thanks
  • @CTXz for getting the ball rolling on CyanogenMod for Z5 series and stemming the lion's share to get this working
  • @oshmoun for providing fixes ASAP
  • @AndroPlus for providing a great kernel that works with many recoveries
  • @moonbutt74 for reminding me that smashing your device can provide a solution
  • @sub77 for teaching me how to work with QCOM (I was on exynos before)
  • @Joeisgood99 for providing a solid working TWRP-3.0.0.0 build until we had our own
  • @bazhip for providing a well working twrp 2.8.7.0 for restoring until we had our own
  • @alphatact1cs has a great overview on lots of topics for the Z5 device family
  • @auras76 for his great Custom ROM
  • @infected_ for his experience
  • Thanks to @mpro420 for help to get Viper4Android working !
  • Thanks to @jimRnor for Project DiVA SoundMod !
  • The Sonyxperiadev team for releasing their sources to the public
  • SonyAOSP team
  • SonyCM team
  • Sony Xperia (community) devs
  • And ofcourse the entire CyanogenMod team!

(Known) Issues

  • Video Recording
  • Bluetooth (keeps restarting) (might be fixed, needs feedback + testing)
  • Camera Colors (can be circumvented by using specific apps CameraNext Mod )
  • Camera Focus & Sharpness (driver issue, probably since it uses Xperia Z (original) drivers but different lenses ?)
  • Camera lowlight pictures (might improve with release of Sony's "Experimental AOSP Camera" for the Z5 series, porting of other Framework + Stock Cam app; partially needs DRM magic)
  • Camera Focus (even with VCM2 actuator changes focus is still kind of murky)
  • Fingerprint sensor (might work depending on build date of ROM)
  • Lag after booting up device (Will resolve: lock screen after boot and waiting a few seconds)
  • Long bootup times & less smoothness with "stock" (prebuilt) kernel

What can not be fixed, changed - aka WONTFIX - NOTOURPROBLEM
  • There might be potential speed issues with Class 10+ microSD cards not properly being "tuned", in that case switch to slower cards or RMA it which should hopefully solve it. There is a possibility to force slower speeds on cards but that is not really the optimal solution with ultra speed cards and needs further investigation. Samsung (EVO/EVO+) cards, Transcend cards and a few others UHS-I(+) and faster are affected.

What has been Fixed
  • Horizontal color lines and color glitches during bootup
  • Gapps
  • Sudden Lag after some time
  • NFC
  • Odd calling numbers
  • In-call mic
  • Sound on calls
  • Camera button
  • Microphone
  • Thermal regulation
  • Red flashy frames
  • RIL (SIM detection)
  • Dex pre-optimization
  • Camera
  • Sensors
  • Crash after locking device
  • microSD access
  • Flash light / Torch
  • Full brightness (should be fully working)
  • Gapps (permissions issues) [occurs occasionally and should be circumvented by full-wipe approach (incl. internal storage)
  • Hang/Loop during boot stage (should be circumvented by full-wipe approach (incl. internal storage)) (use Custom Kernel, under investigation)
  • High battery drain [~ 10%-20% per hour] when dirty-flashing system (fastboot -S 256M flash system system.img), make sure to have data backed up, then format /data ; OTA updates should be fine though [need feedback] ); causes are: dirty flashing, certain apps, ROM issues, etc.

Guides/Instructions

Unlocking Bootloader

Warning! The following procedure may void your warranty and will wipe EVERYTHING



Steps on how to Fastboot, Flashmode, Recovery, Emergency/Force Poweroff

@alphatact1cs has a great overview on lots of topics for the Z5 device family

over at [GUIDE] Sony Xperia Z5 - UNLOCK / ROOT / TWEAKS - OS 5.1.1 / 6.0

There go to the [GUIDE] StockROM section , open it up and under #GENERAL you'll find everything you need to know.


Setting up fastboot and how to use it

For windows users

Please checkout this guide on how to use fastboot on windows

If you prefer to keep a low footprint instead of installing the whole Android SDK, take a look at its thread
[TOOL]Minimal ADB and Fastboot [8-28-15]


For Linux users

Installation

Debian based distros (Debian, Ubuntu etc.)

Open a terminal and enter the following :
Code:
sudo apt-get update && sudo apt-get install android-tools*

Confirm the installation by either hitting enter or typing y

Gentoo based Distros (Gentoo, Funtoo, Sabayon, Scientific Linux)

Once you're in a terminal, enter the following:

Code:
emerge dev-util/android-sdk-update-manager

Other distros (Arch, Fedora, Open Suse etc.)

Please find the apropriate packages to install android fastboot tools for your distro

How to use

Open a terminal in the location your .img file is located or cd into that directory like this:
Code:
cd <path to your directory that contains the .img files>
Replace <path to your directory that contains the .img files> with your actuall path

To boot temporarely into a .img (ex recovery) use the following command (replace <your.img> with your .img file) :

Code:
fastboot boot <yourfile>.img

To flash a kernel image enter the following (replace <your.img> with your .img file):

Code:
fastboot flash boot <your.img>

To flash a recovery image enter the following (replace <your.img> with your .img file):

Code:
fastboot flash recovery <your.img>

To exit fastboot enter :

Code:
fastboot reboot



How to install CM 13

Above all - do a Backup of ALL your data

When I write ALL I mean ALL (this includes the data on your micro SD card,

don't come whining to me if you lose your wedding photos/videos, kids' photos/videos or other important stuff !

For optimal experience I'd recommend my built custom kernel (quicker boot times, higher reliability, more tweakability)

General, in-depth instructions


  • Download one of the newer Z5 AndroPlusKernels v20+ by @AndroPlus from his official website (Scroll down and select Z5, then on AndroidFileHost search for Z5_AndroPlusKernel_Permissive_v2 (v20 - v23) and download it)
  • Extract the flashable zip-file e.g. Z5_AndroPlusKernel_Permissive_v23.zip
  • Download our TWRP 3.0.1-0 build for the Z5)
  • Download the appropriate gapps from below (Can be downloaded on your device)
  • Download the CM 13 Zip for the Z5 from below (Can be downloaded on your device)
  • Move the GAPPS zip and the CM 13 to your Z5 if you haven't downloaded them on your device
  • Power Off your Z5 and wait about 10-15 seconds to make sure it's off
  • To enter fastboot mode hold VOL UP and while holding VOL UP connect your device to your pc via cable
  • When the notification LED has turned blue you are in fastboot mode
  • On your PC flash the boot.img that has been extracted from the Z5_AndroPlusKernel_Permissive_v23.zip using fastboot (
    Code:
     fastboot flash boot boot.img
    )
  • Now flash twrp-3.0.1-0-E6653-20160403.img by using fastboot (
    Code:
     fastboot flash recovery twrp-3.0.1-0-E6653-20160403.img
    )
  • Once both of those images have been flashed you can reboot the device like so:
    Code:
     fastboot reboot
  • Quickly pull the usb cable from the computer (you can leave the other end in the phone's port)
  • When booting up wait for the notification light to turn yellow at the Sony logo
  • Once it has turned yellow, you will enter TWRP by pressing VOL UP (or VOL DOWN - up works more reliably)
  • If you've missed the step above, reboot your device and try the step above again
  • Alternatively you can force turn off the device via: Power Button + Volume Up , then turn it on again via Power Button
  • If TWRP asks you to enable read and write, swipe to continue
  • Go to settings and lower the max brightness to the minimum or one of the lower levels to preserve energy
  • In TWRP make a full backup to the microSD in case you want to revert back to stock.
  • After it has finished, in this case Reboot -> System.
  • Copy over the TWRP folder from the external microSD to your computer (reason: you might not have access to your external SD or have to reformat it
  • Thank Microsoft, Sony, etc. for that: "Stock" ROM uses texfat , AOSP, CM, etc. uses exfat, ext4, ntfs
  • The files on the microSD might get corrupted (filesystem problem) or the microSD going crazy (I already had both cases)
  • Now Power on your phone and follow the steps again to get into TWRP
  • Swipe to continue (?)
  • select Wipe > Advanced Wipe
  • Now ONLY tick Dalvik/ART cache, System, Cache and Data
  • WARNING! THE NEXT STEP WILL WIPE YOUR SYSTEM AND DATA, MEANING YOU WILL DELETE YOUR STOCK SONY SYSTEM AND ALL YOUR APPS
  • (You already DID a Backup of your files so nothing to worry about)
  • Once you've ticked the correct boxes, swipe to wipe
  • Once the wipe is complete, return to the main menu and select Install
  • Locate and select your CM 13 Zip
  • Select "Add more Zips" and add your GAPPS package and finally swipe to install
  • Once the installation succeeded you can select "Reboot System"
  • Wait for CM 13 to boot up (Can take several minutes)
  • Enjoy CM13 ;)
  • OPTIONAL: You can remove your TWRP backup that is located in the TWRP folder if you feel like you will no longer need it




How to ROOT

  • In CM 13, enable the developer options
  • Select Root access
  • Select Apps Only (Or Apps and ADB if you use ADB)
  • Done

How to disable the Thermal Manager

Before we start I want to set a few questions and warnings. Disabling the thermal manager will cause you device to run slightly hotter, do this at your own risk.

Let's start out with why you would want to disable the thermal manager. At this point it's not recommended to disable the thermal manager as it has been fixed. However some people still want the max performance out of their device. The average heat without the thermal manager will be roughly the same, if not less compared to the stock ROM with it's thermal manager enabled.

So why is the thermal manager even included if it the device runs mostly fine without it. As most of you already know, the Snapdragon 810 (MSM8994) has overheating problems. The first CM boot after flash is responsible for optimizing apps and android and can become extremely resource hungry at that point. Due to that, the device can heat tremendously! Not only can that cause a panic reboot but it can also damage your device in rare cases. To avoid that issue a thermal manager shrinks down process and slowers the boot animation (That's why the CM logo may lag at first boot).

Enough said, let's get going..

To disable the thermal manager you must do the following :
  • First enable root access (See "How to ROOT" guide)
  • Open the CM file manager
  • Go to settings > General Settings > Access Mode
  • Select root acess mode
  • Go back to the file manager
  • Swipe from left to right or press the menu button in the upper left corner
  • Select Root folder
  • Open the folder/directory called etc
  • Delete thermanger.xml
  • Reboot
  • Done

How return back to stock via TWRP backup

  • Reboot your device
  • Wait for the notification light to turn purple at the Sony logo
  • Once it has turned purple, you will enter TWRP by pressing VOL UP or VOL DOWN
  • If you've missed the step above reboot and try again
  • If TWRP will ask you to enable read and write, swipe to continue
  • In TWRP select restore and select your backup, then swipe to restore
  • Once the restore is done you can select "Reboot System"
  • If your device hangs at the Sony wave boot animation, force shut down and power your device up again.


Downloads

Latest recommended CyanogenMod release for the Sony Xperia Z5 E6653/E6603 :
6.0.1_13.0-20160626-UNOFFICIAL-sumire_r46_alternate

Latest recommended Kernel for the CM release for the Sony Xperia Z5 E6653/E6603 :
6.0.1_13.0-20160626-UNOFFICIAL-sumire_r46_alternate


All my releases can be found here on : Android File Host


TWRP for CM/AOSP-based ROMs:

[TWRP][E6653/E6603/E6633/E6683] 3.0.2 , for CM/AOSP ROMs


Gapps (Select ARM64 > 6.0) :

Open Gapps
[GAPPS][6.0/5.1/5.0][arm/arm64] Official Slim GApps ( recommended )


XPosed for Android:

[OFFICIAL] Xposed for Lollipop/Marshmallow (Installer in Thread)
XPosed Releases


SuperSU in SystemMode:

SuperSU in System-Mode [v2.65-STABLE] [v2.68-BETA] [v2.70-WIP/BETA-RC]


Sound MODs:

[Sound Mod ][Project DiVA][6.0 MM_Z5 series] KitaKami sound mod Prototype 01 (any effect ?)

A.R.I.S.E. Sound Systems - Auditory Research in Sound Enhancement - Exodus RC8.3 (works (RC8.3))

[SOUNDMOD][JB/KK/LP/MM]Project Yume Final, You are the Legend (needs testing)

[SUPER MOD][4.4+/6.0/N][ v7.5.2 ] XTREMEMusic™ THE SOUND THAT YOU'VE NEVER HEARD! (NOT working (7.4), needs testing of 7.5*

[Audio Mod] eXtremeBeats Aural Maximizer (needs testing)



[APP]Material ViPER4Android 2.4.0.1[Light/Dark][LP/MM]

mpro420 said:
1.)zip file install via twrp.
2.)reboot to system.
3.)enable v4a "write to sdcard" permission in setting/apps/viper4android/permission.
4.)open v4a and gain root permission.
5.)install driver for v4a.
6.)reboot system.
7.)[emoji39]




Questions and bug reporting

The following questions will be ignored
  • Inappropriate questions
  • Requests for other devices
  • Forced orders, EX. : "PLS FIX!!!!!!"
  • ETA's
  • Often repeated questions or requests usually by the same user
  • Requests that are out of CM's framework (Ex. Adding Sony Apps)

How to report a bug/issue
  • Explain exactly what happens
  • Mention a log if you can (Please use hastebin or any other paste site to keep the thread clean)
  • If you can't mention a log, explain as precise as possible when, why and where it occurs!




Source Code

All Source Code can be obtained from:

https://github.com/Sony-Kitakami
https://github.com/SonyAosp
https://github.com/sonyxperiadev
https://github.com/CyanogenMod
https://github.com/zachariasmaladroit/android_kernel_sony_msm8994_kitakami_r2

Kernel Source code can be obtained from : zachariasmaladroit/android_kernel_sony_msm8994_kitakami_r2

We gladly accept any developers that are willing to contribute to this project! Please PM @CTXz if you are interested in joining this project!


Build from Source

http://xdaforums.com/xperia-z5/general/guide-build-cm13-source-z5-z5c-z5p-t3357040


Screen Shots (Z5 compact)

Kzd7hM5l.jpg
NGSoziBl.jpg
D9NkEJml.jpg
asI5X07l.png
F9BDEXil.png



XDA:DevDB Information
CyanogenMod 13 for the Sony Xperia Z5 E6653 and E6603, ROM for the Sony Xperia Z5

Contributors
CTXz, Moonbutt74 , zacharias.maladroit , oshmoun , infected_

Source Code:
https://github.com/Sony-Kitakami
https://github.com/SonyAosp
https://github.com/sonyxperiadev
https://github.com/CyanogenMod
https://github.com/zachariasmaladroit/android_kernel_sony_msm8994_kitakami_r2



ROM OS Version: 6.0.x Marshmallow
ROM Firmware Required: 6.0 Recommended
Based On: CyanogenMod

Version Information
Status: Alpha

Created 2016-04-11
Last Updated 2016-06-28
 
Last edited:

zacharias.maladroit

Recognized Developer
Changelog
Code:
2016/05/06
[LIST]
[*]Dual SIM support (ROM) [COLOR="Red"][B][WIP][/B][/COLOR]
[*]Dual SIM support (Kernel) [COLOR="Red"][B][WIP][/B][/COLOR]
[*]smoother brightness (automatic & manual), lower default and manual brightness
[*]weather provider support (CM)
[*]thermal manager improvements (CM)
[*]potential stability-fixes (CM)
[*]brightness dimming disabled (once temperature raises) 
[*]VCM2 camera actuator (presumably working focus) == feature complete camera [LED torch still needs work]
[*]adb enabled from the start (diagnostics at this early ROM stage)
[*]upstream ROM + Kernel changes
[*]
[*] Sim-specific change: add DSDS (dual sim) detection script that starts second ril-daemon
[*]
[*] Custom Kernel changes:
[*] Intelliplug + Intellithermal by default [[B][COLOR="Red"]stability testing[/COLOR][/B]]
[*] added Quick Wakeup, PowerSuspend, 
[*] added AdrenoIdler
[*] CPU and general Kernel optimized compiler flags
[*] re-enabled efficient WorkQueue [[B][COLOR="Red"]stability testing[/COLOR][/B]]
[*] re-enabled nop idle governor for CPUIDLE driver [[B][COLOR="Red"]stability testing[/COLOR][/B]]
[*]
[/LIST]

2016/04/19
- LiveDisplay (CM upstream) should work more reliably and should not cause instabilities and (boot)loops anymore
- torch should work now (ROM)
- changes, improvement to Bootup (Kernel side) - should make prebuilt kernel more reliable

2016/04/17 [suzuran]
- Fixed Brightness
- Fixed Torch
- Fixed Double Tap 2 Wake
- Added CPU core optimization
- Added USB gadget support
- Synced with the latest CM sources
-----------------------------------------------
* For devs
- Added Kitakami patcher to manifests

2016/04/15
- Full brightness range + maximum brightness (ROM + Kernel)
- KCAL support (Kernel)
- alucard, elementalX, zzmoove governors (Kernel)
- upstream sync (Kernel), perhaps better, more reliable WiFi
- more battery efficiency during video playback (Kernel), [needs testing, lags ?]
- adreno (GPU) governor, lower default frequency (Kernel), perhaps lower battery consumption, [needs testing, lags ?]
- vibrator intensity control (Kernel) [needs testing]
- some more battery efficiency tweaks (Kernel)
- NTFS, exFAT filesystem support (for microSD) (Kernel)
- tweaks and reliability improvements (Kernel)
- Driver wakelock control (Kernel)
- NEON/FPU compiler optimizations (Kernel)
- improved Hotplug reliability and stability (Kernel)

2016/04/12 [suzuran]
- Fixed sdcard recognition
- Updated binaries to v4
- Released CM build guide
- Synced with newest sources

2016/04/11
 - CM 13 For the Z5 E6653 Released

2016/04/10
 - CM 13 For the Z5 Premium E6853 Released

2016/04/05
- Fixed GApps
- Partially fixed Bluetooth
- Synced to latest CM sources

2016/03/27
- Fix thermal manager lag
- Fix NFC
- Updated kernel configs
- Added ffmpeg codecs support
- Synced with newest CM sources
-------------------------------------------
* For devs
- Cleaned up suzuran and satsuki tree
   - > Moved common media configs to kitakami common tree
   - > Moved acdb files to vendor tree

2016/03/24
- Fix In-call Mic
- Add support for the E5803
- Add option to boot into recovery (On purple LED at Sony logo press VOL UP or VOL DOWN to enter recovery)
- Update Thermal manager
- Merge latest AOSP kernel commits
- Sync to newest CM source

2016/03/22
- Fix microphone
- Add settings for camera button
- Add settings for volume rockers
- Fix sound on calls

2016/03/20 - RIP TonyStark, you were a great moderator and we'll all miss you.
- Added Thermal regulation to avoid overheating problems
- Fixed Red flashy frames
- Fixed RIL (SIM detection)
- Fixed Dex pre-optimization
- Fixed Camera
- Fixed Sensors
- Fixed Crash after locking device

2016/03/18 - CM 13 For the Z5 Compact E5823 Released
 
Last edited:

Joeisgood99

Senior Member
Jan 4, 2015
303
192
Melbourne
Well done again to Sony Kitakami Developer Organization!
Sooooo much time and effort represented in those CM13 github projects. Total Respect.
Nuf said.
 

zacharias.maladroit

Recognized Developer
Finally get there....
Great job man!
Hope there will be dual sim support asap.

I've taken a look but haven't figured out yet on how to make it work,

if there are any developers out there with DSDS (dual sim) devices, interested on getting this working and read this - please take a look at it

Thanks !

Nice jobe, I'll wait for a more stable version to test it
keep up the good work :D
best regards.

Okay :D

Thanks

Well done again to Sony Kitakami Developer Organization!
Sooooo much time and effort represented in those CM13 github projects. Total Respect.
Nuf said.

Thanks ! <3
 

Uclydde

Senior Member
Jan 20, 2013
228
68
Orlando
Will you be making a guide on building this rom from source? And of course, thank you for all your hard work :) we all greatly appreciate it.
 

zacharias.maladroit

Recognized Developer
Will you be making a guide on building this rom from source? And of course, thank you for all your hard work :) we all greatly appreciate it.

Build from Source

The guide on how to build your own Z5 ROM will be posted once we feel like this ROM is ready enough

Take a look at the source and the repos, the guides are out there ...

... you got a PM



beat me to it ;)
 
Last edited:

Uclydde

Senior Member
Jan 20, 2013
228
68
Orlando
Okay, so I followed the steps for "General installation", and the rom is surprisingly smooth. The only issue I've noticed that isn't addressed in the original post is that vibration intensity is WAY higher than in the stock rom. Like it's actually pretty loud. I know it's a minor issue compared to some of the other things, but I'm just throwing that out there. I'll point out anything else I find.
 

atanu89

Senior Member
Jun 4, 2010
349
38
Absolute legend! Thanks man. I'll get to testing once i get home off this drilling rig
 

zacharias.maladroit

Recognized Developer
Okay, so I followed the steps for "General installation", and the rom is surprisingly smooth. The only issue I've noticed that isn't addressed in the original post is that vibration intensity is WAY higher than in the stock rom. Like it's actually pretty loud. I know it's a minor issue compared to some of the other things, but I'm just throwing that out there. I'll point out anything else I find.

Thanks for testing :)

Actually it already was higher on AOSP, if recall correctly, but I'll ask the other devs if they noticed something out of the ordinary

Thanks

Absolute legend! Thanks man. I'll get to testing once i get home off this drilling rig

Thanks :)
 
  • Like
Reactions: albertobom

Sovjet

Member
Jan 25, 2015
41
8
Thanks for this great rom, the only problem i encounter is that my phone keeps stuck in first startup (cyanogenmod logo) and that keeps going i force my phone to switch off after 45 minutes, is there something i do wrong i followed the in depth guide
 

zacharias.maladroit

Recognized Developer
Thanks for this great rom, the only problem i encounter is that my phone keeps stuck in first startup (cyanogenmod logo) and that keeps going i force my phone to switch off after 45 minutes, is there something i do wrong i followed the in depth guide

That partially is caused by the "stock" built kernel,

you can see whether is improved by flashing my custom kernel.


One observation (according to @moonbutt74 afaik) led to the conclusion that the upstream (from sonyxperiadev) setting of coherent_pool=8M doesn't match with Sony's ("Stock ROM") setting of coherent_pool=2M,

and does no good for startup time (and reliability ?).

Another factor (like in most AOSP-based ROMs, Kernels) is that the kernel was built with a less tuned toolchain (gcc),

can't directly explain though why does leads to exactly that behavior.


Tl;dr:

Give the custom kernel a try - the "stock" kernel should work but for some reason sometimes it does not

custom has exfat + ntfs support to make microSDs work reliably and other things


Thanks :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 38
    [ROM][UNOFFICIAL][6.0.1][E6653/E6603] CyanogenMod 13 for the Sony Xperia Z5 [ALPHA]


    0vI9ZcB.jpg

    CyanogenMod 13 for the Sony Xperia Z5 E6653 and E6603​

    CyanogenMod is a free, community built, aftermarket firmware distribution of Android 6.0 (Marshmallow), which is designed to increase
    performance and reliability over stock Android for your device.

    CyanogenMod is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be
    used without any need to have any Google application installed. You will need to provide your own Google Applications package (gapps).
    CyanogenMod does still include various hardware-specific code, which is also slowly being open-sourced anyway.

    Before you start

    This ROM is only for the E6653 and the E6603

    Code:
     *
     * Your warranty may be voided !
     *
     * I am not responsible for bricked devices, dead SD cards,
     * thermonuclear war, or you getting fired because the alarm app failed. Please
     * do some research if you have any concerns about features included in this ROM
     * before flashing it! YOU are choosing to make these modifications, and if
     * you point the finger at me for messing up your device, I will laugh at you.
     *

    Special Thanks
    • @CTXz for getting the ball rolling on CyanogenMod for Z5 series and stemming the lion's share to get this working
    • @oshmoun for providing fixes ASAP
    • @AndroPlus for providing a great kernel that works with many recoveries
    • @moonbutt74 for reminding me that smashing your device can provide a solution
    • @sub77 for teaching me how to work with QCOM (I was on exynos before)
    • @Joeisgood99 for providing a solid working TWRP-3.0.0.0 build until we had our own
    • @bazhip for providing a well working twrp 2.8.7.0 for restoring until we had our own
    • @alphatact1cs has a great overview on lots of topics for the Z5 device family
    • @auras76 for his great Custom ROM
    • @infected_ for his experience
    • Thanks to @mpro420 for help to get Viper4Android working !
    • Thanks to @jimRnor for Project DiVA SoundMod !
    • The Sonyxperiadev team for releasing their sources to the public
    • SonyAOSP team
    • SonyCM team
    • Sony Xperia (community) devs
    • And ofcourse the entire CyanogenMod team!

    (Known) Issues

    • Video Recording
    • Bluetooth (keeps restarting) (might be fixed, needs feedback + testing)
    • Camera Colors (can be circumvented by using specific apps CameraNext Mod )
    • Camera Focus & Sharpness (driver issue, probably since it uses Xperia Z (original) drivers but different lenses ?)
    • Camera lowlight pictures (might improve with release of Sony's "Experimental AOSP Camera" for the Z5 series, porting of other Framework + Stock Cam app; partially needs DRM magic)
    • Camera Focus (even with VCM2 actuator changes focus is still kind of murky)
    • Fingerprint sensor (might work depending on build date of ROM)
    • Lag after booting up device (Will resolve: lock screen after boot and waiting a few seconds)
    • Long bootup times & less smoothness with "stock" (prebuilt) kernel

    What can not be fixed, changed - aka WONTFIX - NOTOURPROBLEM
    • There might be potential speed issues with Class 10+ microSD cards not properly being "tuned", in that case switch to slower cards or RMA it which should hopefully solve it. There is a possibility to force slower speeds on cards but that is not really the optimal solution with ultra speed cards and needs further investigation. Samsung (EVO/EVO+) cards, Transcend cards and a few others UHS-I(+) and faster are affected.

    What has been Fixed
    • Horizontal color lines and color glitches during bootup
    • Gapps
    • Sudden Lag after some time
    • NFC
    • Odd calling numbers
    • In-call mic
    • Sound on calls
    • Camera button
    • Microphone
    • Thermal regulation
    • Red flashy frames
    • RIL (SIM detection)
    • Dex pre-optimization
    • Camera
    • Sensors
    • Crash after locking device
    • microSD access
    • Flash light / Torch
    • Full brightness (should be fully working)
    • Gapps (permissions issues) [occurs occasionally and should be circumvented by full-wipe approach (incl. internal storage)
    • Hang/Loop during boot stage (should be circumvented by full-wipe approach (incl. internal storage)) (use Custom Kernel, under investigation)
    • High battery drain [~ 10%-20% per hour] when dirty-flashing system (fastboot -S 256M flash system system.img), make sure to have data backed up, then format /data ; OTA updates should be fine though [need feedback] ); causes are: dirty flashing, certain apps, ROM issues, etc.

    Guides/Instructions

    Unlocking Bootloader

    Warning! The following procedure may void your warranty and will wipe EVERYTHING



    Steps on how to Fastboot, Flashmode, Recovery, Emergency/Force Poweroff

    @alphatact1cs has a great overview on lots of topics for the Z5 device family

    over at [GUIDE] Sony Xperia Z5 - UNLOCK / ROOT / TWEAKS - OS 5.1.1 / 6.0

    There go to the [GUIDE] StockROM section , open it up and under #GENERAL you'll find everything you need to know.


    Setting up fastboot and how to use it

    For windows users

    Please checkout this guide on how to use fastboot on windows

    If you prefer to keep a low footprint instead of installing the whole Android SDK, take a look at its thread
    [TOOL]Minimal ADB and Fastboot [8-28-15]


    For Linux users

    Installation

    Debian based distros (Debian, Ubuntu etc.)

    Open a terminal and enter the following :
    Code:
    sudo apt-get update && sudo apt-get install android-tools*

    Confirm the installation by either hitting enter or typing y

    Gentoo based Distros (Gentoo, Funtoo, Sabayon, Scientific Linux)

    Once you're in a terminal, enter the following:

    Code:
    emerge dev-util/android-sdk-update-manager

    Other distros (Arch, Fedora, Open Suse etc.)

    Please find the apropriate packages to install android fastboot tools for your distro

    How to use

    Open a terminal in the location your .img file is located or cd into that directory like this:
    Code:
    cd <path to your directory that contains the .img files>
    Replace <path to your directory that contains the .img files> with your actuall path

    To boot temporarely into a .img (ex recovery) use the following command (replace <your.img> with your .img file) :

    Code:
    fastboot boot <yourfile>.img

    To flash a kernel image enter the following (replace <your.img> with your .img file):

    Code:
    fastboot flash boot <your.img>

    To flash a recovery image enter the following (replace <your.img> with your .img file):

    Code:
    fastboot flash recovery <your.img>

    To exit fastboot enter :

    Code:
    fastboot reboot



    How to install CM 13

    Above all - do a Backup of ALL your data

    When I write ALL I mean ALL (this includes the data on your micro SD card,

    don't come whining to me if you lose your wedding photos/videos, kids' photos/videos or other important stuff !

    For optimal experience I'd recommend my built custom kernel (quicker boot times, higher reliability, more tweakability)

    General, in-depth instructions


    • Download one of the newer Z5 AndroPlusKernels v20+ by @AndroPlus from his official website (Scroll down and select Z5, then on AndroidFileHost search for Z5_AndroPlusKernel_Permissive_v2 (v20 - v23) and download it)
    • Extract the flashable zip-file e.g. Z5_AndroPlusKernel_Permissive_v23.zip
    • Download our TWRP 3.0.1-0 build for the Z5)
    • Download the appropriate gapps from below (Can be downloaded on your device)
    • Download the CM 13 Zip for the Z5 from below (Can be downloaded on your device)
    • Move the GAPPS zip and the CM 13 to your Z5 if you haven't downloaded them on your device
    • Power Off your Z5 and wait about 10-15 seconds to make sure it's off
    • To enter fastboot mode hold VOL UP and while holding VOL UP connect your device to your pc via cable
    • When the notification LED has turned blue you are in fastboot mode
    • On your PC flash the boot.img that has been extracted from the Z5_AndroPlusKernel_Permissive_v23.zip using fastboot (
      Code:
       fastboot flash boot boot.img
      )
    • Now flash twrp-3.0.1-0-E6653-20160403.img by using fastboot (
      Code:
       fastboot flash recovery twrp-3.0.1-0-E6653-20160403.img
      )
    • Once both of those images have been flashed you can reboot the device like so:
      Code:
       fastboot reboot
    • Quickly pull the usb cable from the computer (you can leave the other end in the phone's port)
    • When booting up wait for the notification light to turn yellow at the Sony logo
    • Once it has turned yellow, you will enter TWRP by pressing VOL UP (or VOL DOWN - up works more reliably)
    • If you've missed the step above, reboot your device and try the step above again
    • Alternatively you can force turn off the device via: Power Button + Volume Up , then turn it on again via Power Button
    • If TWRP asks you to enable read and write, swipe to continue
    • Go to settings and lower the max brightness to the minimum or one of the lower levels to preserve energy
    • In TWRP make a full backup to the microSD in case you want to revert back to stock.
    • After it has finished, in this case Reboot -> System.
    • Copy over the TWRP folder from the external microSD to your computer (reason: you might not have access to your external SD or have to reformat it
    • Thank Microsoft, Sony, etc. for that: "Stock" ROM uses texfat , AOSP, CM, etc. uses exfat, ext4, ntfs
    • The files on the microSD might get corrupted (filesystem problem) or the microSD going crazy (I already had both cases)
    • Now Power on your phone and follow the steps again to get into TWRP
    • Swipe to continue (?)
    • select Wipe > Advanced Wipe
    • Now ONLY tick Dalvik/ART cache, System, Cache and Data
    • WARNING! THE NEXT STEP WILL WIPE YOUR SYSTEM AND DATA, MEANING YOU WILL DELETE YOUR STOCK SONY SYSTEM AND ALL YOUR APPS
    • (You already DID a Backup of your files so nothing to worry about)
    • Once you've ticked the correct boxes, swipe to wipe
    • Once the wipe is complete, return to the main menu and select Install
    • Locate and select your CM 13 Zip
    • Select "Add more Zips" and add your GAPPS package and finally swipe to install
    • Once the installation succeeded you can select "Reboot System"
    • Wait for CM 13 to boot up (Can take several minutes)
    • Enjoy CM13 ;)
    • OPTIONAL: You can remove your TWRP backup that is located in the TWRP folder if you feel like you will no longer need it




    How to ROOT

    • In CM 13, enable the developer options
    • Select Root access
    • Select Apps Only (Or Apps and ADB if you use ADB)
    • Done

    How to disable the Thermal Manager

    Before we start I want to set a few questions and warnings. Disabling the thermal manager will cause you device to run slightly hotter, do this at your own risk.

    Let's start out with why you would want to disable the thermal manager. At this point it's not recommended to disable the thermal manager as it has been fixed. However some people still want the max performance out of their device. The average heat without the thermal manager will be roughly the same, if not less compared to the stock ROM with it's thermal manager enabled.

    So why is the thermal manager even included if it the device runs mostly fine without it. As most of you already know, the Snapdragon 810 (MSM8994) has overheating problems. The first CM boot after flash is responsible for optimizing apps and android and can become extremely resource hungry at that point. Due to that, the device can heat tremendously! Not only can that cause a panic reboot but it can also damage your device in rare cases. To avoid that issue a thermal manager shrinks down process and slowers the boot animation (That's why the CM logo may lag at first boot).

    Enough said, let's get going..

    To disable the thermal manager you must do the following :
    • First enable root access (See "How to ROOT" guide)
    • Open the CM file manager
    • Go to settings > General Settings > Access Mode
    • Select root acess mode
    • Go back to the file manager
    • Swipe from left to right or press the menu button in the upper left corner
    • Select Root folder
    • Open the folder/directory called etc
    • Delete thermanger.xml
    • Reboot
    • Done

    How return back to stock via TWRP backup

    • Reboot your device
    • Wait for the notification light to turn purple at the Sony logo
    • Once it has turned purple, you will enter TWRP by pressing VOL UP or VOL DOWN
    • If you've missed the step above reboot and try again
    • If TWRP will ask you to enable read and write, swipe to continue
    • In TWRP select restore and select your backup, then swipe to restore
    • Once the restore is done you can select "Reboot System"
    • If your device hangs at the Sony wave boot animation, force shut down and power your device up again.


    Downloads

    Latest recommended CyanogenMod release for the Sony Xperia Z5 E6653/E6603 :
    6.0.1_13.0-20160626-UNOFFICIAL-sumire_r46_alternate

    Latest recommended Kernel for the CM release for the Sony Xperia Z5 E6653/E6603 :
    6.0.1_13.0-20160626-UNOFFICIAL-sumire_r46_alternate


    All my releases can be found here on : Android File Host


    TWRP for CM/AOSP-based ROMs:

    [TWRP][E6653/E6603/E6633/E6683] 3.0.2 , for CM/AOSP ROMs


    Gapps (Select ARM64 > 6.0) :

    Open Gapps
    [GAPPS][6.0/5.1/5.0][arm/arm64] Official Slim GApps ( recommended )


    XPosed for Android:

    [OFFICIAL] Xposed for Lollipop/Marshmallow (Installer in Thread)
    XPosed Releases


    SuperSU in SystemMode:

    SuperSU in System-Mode [v2.65-STABLE] [v2.68-BETA] [v2.70-WIP/BETA-RC]


    Sound MODs:

    [Sound Mod ][Project DiVA][6.0 MM_Z5 series] KitaKami sound mod Prototype 01 (any effect ?)

    A.R.I.S.E. Sound Systems - Auditory Research in Sound Enhancement - Exodus RC8.3 (works (RC8.3))

    [SOUNDMOD][JB/KK/LP/MM]Project Yume Final, You are the Legend (needs testing)

    [SUPER MOD][4.4+/6.0/N][ v7.5.2 ] XTREMEMusic™ THE SOUND THAT YOU'VE NEVER HEARD! (NOT working (7.4), needs testing of 7.5*

    [Audio Mod] eXtremeBeats Aural Maximizer (needs testing)



    [APP]Material ViPER4Android 2.4.0.1[Light/Dark][LP/MM]

    mpro420 said:
    1.)zip file install via twrp.
    2.)reboot to system.
    3.)enable v4a "write to sdcard" permission in setting/apps/viper4android/permission.
    4.)open v4a and gain root permission.
    5.)install driver for v4a.
    6.)reboot system.
    7.)[emoji39]




    Questions and bug reporting

    The following questions will be ignored
    • Inappropriate questions
    • Requests for other devices
    • Forced orders, EX. : "PLS FIX!!!!!!"
    • ETA's
    • Often repeated questions or requests usually by the same user
    • Requests that are out of CM's framework (Ex. Adding Sony Apps)

    How to report a bug/issue
    • Explain exactly what happens
    • Mention a log if you can (Please use hastebin or any other paste site to keep the thread clean)
    • If you can't mention a log, explain as precise as possible when, why and where it occurs!




    Source Code

    All Source Code can be obtained from:

    https://github.com/Sony-Kitakami
    https://github.com/SonyAosp
    https://github.com/sonyxperiadev
    https://github.com/CyanogenMod
    https://github.com/zachariasmaladroit/android_kernel_sony_msm8994_kitakami_r2

    Kernel Source code can be obtained from : zachariasmaladroit/android_kernel_sony_msm8994_kitakami_r2

    We gladly accept any developers that are willing to contribute to this project! Please PM @CTXz if you are interested in joining this project!


    Build from Source

    http://xdaforums.com/xperia-z5/general/guide-build-cm13-source-z5-z5c-z5p-t3357040


    Screen Shots (Z5 compact)

    Kzd7hM5l.jpg
    NGSoziBl.jpg
    D9NkEJml.jpg
    asI5X07l.png
    F9BDEXil.png



    XDA:DevDB Information
    CyanogenMod 13 for the Sony Xperia Z5 E6653 and E6603, ROM for the Sony Xperia Z5

    Contributors
    CTXz, Moonbutt74 , zacharias.maladroit , oshmoun , infected_

    Source Code:
    https://github.com/Sony-Kitakami
    https://github.com/SonyAosp
    https://github.com/sonyxperiadev
    https://github.com/CyanogenMod
    https://github.com/zachariasmaladroit/android_kernel_sony_msm8994_kitakami_r2



    ROM OS Version: 6.0.x Marshmallow
    ROM Firmware Required: 6.0 Recommended
    Based On: CyanogenMod

    Version Information
    Status: Alpha

    Created 2016-04-11
    Last Updated 2016-06-28
    7
    Changelog
    Code:
    2016/05/06
    [LIST]
    [*]Dual SIM support (ROM) [COLOR="Red"][B][WIP][/B][/COLOR]
    [*]Dual SIM support (Kernel)  [COLOR="Red"][B][WIP][/B][/COLOR]
    [*]smoother brightness (automatic & manual), lower default and manual brightness
    [*]weather provider support (CM)
    [*]thermal manager improvements (CM)
    [*]potential stability-fixes (CM)
    [*]brightness dimming disabled (once temperature raises) 
    [*]VCM2 camera actuator (presumably working focus) == feature complete camera [LED torch still needs work]
    [*]adb enabled from the start (diagnostics at this early ROM stage)
    [*]upstream ROM + Kernel changes
    [*]
    [*] Sim-specific change: add DSDS (dual sim) detection script that starts second ril-daemon
    [*]
    [*] Custom Kernel changes:
    [*] Intelliplug + Intellithermal by default [[B][COLOR="Red"]stability testing[/COLOR][/B]]
    [*] added Quick Wakeup, PowerSuspend, 
    [*] added AdrenoIdler
    [*] CPU and general Kernel optimized compiler flags
    [*] re-enabled efficient WorkQueue [[B][COLOR="Red"]stability testing[/COLOR][/B]]
    [*] re-enabled nop idle governor for CPUIDLE driver [[B][COLOR="Red"]stability testing[/COLOR][/B]]
    [*]
    [/LIST]

    Kernel:

    Z5_Sunkernel_Permissive_vIII.1_3_2_cm_06.05.16_intelli-def.zip

    ROM:

    cm-13.0-20160506-UNOFFICIAL-sumire.zip


    Updated first few posts


    DSDS (dual sim) support is currently broken

    You're welcome to test the ROM and provide

    • logcat
    • dmesg output

    in the following thread:

    [Feedback] [CM13] [AOSP] Xperia Z5, Xperia Z4, DSDS (dual sim) feedback Thread


    Thank you !
    6
    Changelog
    Code:
    2016/05/06
    [LIST]
    [*]Dual SIM support (ROM) [COLOR="Red"][B][WIP][/B][/COLOR]
    [*]Dual SIM support (Kernel) [COLOR="Red"][B][WIP][/B][/COLOR]
    [*]smoother brightness (automatic & manual), lower default and manual brightness
    [*]weather provider support (CM)
    [*]thermal manager improvements (CM)
    [*]potential stability-fixes (CM)
    [*]brightness dimming disabled (once temperature raises) 
    [*]VCM2 camera actuator (presumably working focus) == feature complete camera [LED torch still needs work]
    [*]adb enabled from the start (diagnostics at this early ROM stage)
    [*]upstream ROM + Kernel changes
    [*]
    [*] Sim-specific change: add DSDS (dual sim) detection script that starts second ril-daemon
    [*]
    [*] Custom Kernel changes:
    [*] Intelliplug + Intellithermal by default [[B][COLOR="Red"]stability testing[/COLOR][/B]]
    [*] added Quick Wakeup, PowerSuspend, 
    [*] added AdrenoIdler
    [*] CPU and general Kernel optimized compiler flags
    [*] re-enabled efficient WorkQueue [[B][COLOR="Red"]stability testing[/COLOR][/B]]
    [*] re-enabled nop idle governor for CPUIDLE driver [[B][COLOR="Red"]stability testing[/COLOR][/B]]
    [*]
    [/LIST]
    
    2016/04/19
    - LiveDisplay (CM upstream) should work more reliably and should not cause instabilities and (boot)loops anymore
    - torch should work now (ROM)
    - changes, improvement to Bootup (Kernel side) - should make prebuilt kernel more reliable
    
    2016/04/17 [suzuran]
    - Fixed Brightness
    - Fixed Torch
    - Fixed Double Tap 2 Wake
    - Added CPU core optimization
    - Added USB gadget support
    - Synced with the latest CM sources
    -----------------------------------------------
    * For devs
    - Added Kitakami patcher to manifests
    
    2016/04/15
    - Full brightness range + maximum brightness (ROM + Kernel)
    - KCAL support (Kernel)
    - alucard, elementalX, zzmoove governors (Kernel)
    - upstream sync (Kernel), perhaps better, more reliable WiFi
    - more battery efficiency during video playback (Kernel), [needs testing, lags ?]
    - adreno (GPU) governor, lower default frequency (Kernel), perhaps lower battery consumption, [needs testing, lags ?]
    - vibrator intensity control (Kernel) [needs testing]
    - some more battery efficiency tweaks (Kernel)
    - NTFS, exFAT filesystem support (for microSD) (Kernel)
    - tweaks and reliability improvements (Kernel)
    - Driver wakelock control (Kernel)
    - NEON/FPU compiler optimizations (Kernel)
    - improved Hotplug reliability and stability (Kernel)
    
    2016/04/12 [suzuran]
    - Fixed sdcard recognition
    - Updated binaries to v4
    - Released CM build guide
    - Synced with newest sources
    
    2016/04/11
     - CM 13 For the Z5 E6653 Released
    
    2016/04/10
     - CM 13 For the Z5 Premium E6853 Released
    
    2016/04/05
    - Fixed GApps
    - Partially fixed Bluetooth
    - Synced to latest CM sources
    
    2016/03/27
    - Fix thermal manager lag
    - Fix NFC
    - Updated kernel configs
    - Added ffmpeg codecs support
    - Synced with newest CM sources
    -------------------------------------------
    * For devs
    - Cleaned up suzuran and satsuki tree
       - > Moved common media configs to kitakami common tree
       - > Moved acdb files to vendor tree
    
    2016/03/24
    - Fix In-call Mic
    - Add support for the E5803
    - Add option to boot into recovery (On purple LED at Sony logo press VOL UP or VOL DOWN to enter recovery)
    - Update Thermal manager
    - Merge latest AOSP kernel commits
    - Sync to newest CM source
    
    2016/03/22
    - Fix microphone
    - Add settings for camera button
    - Add settings for volume rockers
    - Fix sound on calls
    
    2016/03/20 - RIP TonyStark, you were a great moderator and we'll all miss you.
    - Added Thermal regulation to avoid overheating problems
    - Fixed Red flashy frames
    - Fixed RIL (SIM detection)
    - Fixed Dex pre-optimization
    - Fixed Camera
    - Fixed Sensors
    - Fixed Crash after locking device
    
    2016/03/18 - CM 13 For the Z5 Compact E5823 Released
    6
    First of all thank you for that great ROM
    I made that video https://www.youtube.com/watch?v=jWGrzHuy77Y
    Beginning was just for fun. You can see the ROM from 1:22m on. Sadly i didn´t had much time and things are difficult if you can´t record the screen on the device :)
    If im not allowed to post that in here just delet it!
    Will make a complete tutorial video these days!

    Thank you again @zacharia.maladroit
    6
    New build:

    CM-13.0

    6.0.1_13.0-20160419-UNOFFICIAL-sumire

    (hosted on Android File Host)

    You have the choice to either flash via TWRP (cm-13.0-20160419-UNOFFICIAL-sumire.zip) or via fastboot (boot.img, system.img)

    OTA

    the OTA package is 406.6MB big - and currently uploading,

    for those who are currently running CM13 - you can try it out once it has finished uploading.

    Please place it in internal storage (or microSD) and flash it via TWRP

    md5sum:
    Code:
    b386d39330dd4a9fb6e17e683ad11053  cm_sumire-ota-b829d6693a.zip




    Custom Kernel for CM-13.0

    Z5_Sunkernel_Permissive_vI.1_10_7_cm

    Z5_Sunkernel_Permissive_vII.1_cm.zip (if you're having stability issues, "sleep of death", etc. - try this out)


    Custom Kernel source:

    Sun-Kernel_LA.BF64.1.2.2_rb4.7_02.04.2016_I.1_10_7_cm_dsds

    Sun-Kernel_cm-13.0_II.1_plain

    Changelog for Sunkernel I.1_10_7 said:
    - reverted optimization flags (evaluation with stability)
    - sync with upstream sonyxperiadev kernel changes




    ROM Changes said:
    Changelog:
    - LiveDisplay (CM upstream) should work more reliably and should not cause instabilities and (boot)loops anymore
    - torch should work now (ROM)
    - changes, improvement to Bootup (Kernel side) - should make prebuilt kernel more reliable


    I haven't tested the build and/or kernel personally yet,

    battery is currently close to empty ;)