New firmware for Sony Xperia M2 LTE, M2 Aqua, M2 Dual

Here are unofficial builds LineageOS 14.1 (Android Nougat) and LineageOS 15.1 (Android Oreo) for Sony Xperia M2 (D2303 LTE, D2302 Dual, D2403 Aqua).

The firmware did not pass a long test, there may be a variety of new bugs…

Your warranty is now void! You use these firmware at your own risk, there are no guarantees. Theoretically, the phone can be damaged.
All questions and discussions write on the forum 4pda or forum XDA.

Known bugs, that have not yet been fixed

  • Auto brightness adjustment sometimes stops working.
  • There is a very quiet sound on the videocamera (the mixer works in the sensitivity mode of a telephone conversation, it does not hear surrounding sounds). When recording a telephone conversation – the remote side is written with strong distortion.
  • Audio mixer’s configs are not very correct (mixer_paths.xml, etc…).
  • Stabilizer and continuous shooting in the camera do not work.
  • The camera sometimes does not work from the first launch. After leaving the camera, clean recent apps and re-launching it, everything is fine. The problem is only in Oreo and Pie, in Nougat everything is fine.
  • Offline charging is not working properly, the phone freezes.
  • GPS-fix reset at the moment of switching 4G-3G data.
  • On some devices, a critical i2c bus error happens every few days – sensors stop working. The same problem was in the official firmware KitKat – the compass was hanging. In Lollipop everything was fine. But in custom firmware – the problem has returned, presumably this is due to the kernel.
  • On some revisions of M2 (with alternative sensors?), sometimes every few days there is an unexpected reboot. The reason is known – SensorService crashes with signal code 11 (SIGSEGV). Not fixed yet.
  • The sound of connecting the charger is sometimes absent.
  • In some firmware (AICP, Recurrection Remix, Pixel), the storage capacity in the main menu is incorrectly displayed – a negative value and / or more than 100 percent.
  • Some memory leaks in the kernel, after a few days everything starts to slow down. It is treated simply by restarting. Although most of this problem is not observed, it probably depends on the applications used.
  • In builds based on Oreo and Pie, there is no SElinux (policies are not configured and permissive mode is enabled).
  • Filesystem encryption does not work – it is impossible to encrypt the storage/microSD.
  • Resetting the settings from the menu does not work correctly (you must use the Factory Reset in TWRP). The problem is due to the fact that the reset of the settings should be performed from the android in recovery, but it is not clear how the firmware should indicate to the bootloader that the recovery is started (now the bootloader does not understand that it is waiting for the recovery to start and restart the system).
  • Problems with the use of root Magisk. We have an old kernel 3.4.113, for Magisk to work correctly need kernel 3.10.x.
  • When you turn on the Expanded desktop mode – difficulties with unlocking, the display does not turn on immediately.

Changelog, Downloads LineageOS 15.1 and AICP for Sony M2

Logo LineageOSLogo AICPLogo Resurrection Remix
Work on LineageOS for Sony M2 is not stopped, the builds will be published as security updates are released (usually monthly in the second half of the month).

Changelog LineageOS 15.1 (Android 8.1 Oreo)
2022.03.11

Download “lineage-15.1-20220311-UNOFFICIAL-eagle.zip” – 343.58 MB2022-03-11

Download “lineage-15.1-20220311-UNOFFICIAL-eagle-Go.zip” – 337.69 MB2022-03-11

  • Source LineageOS updated to 2022-03-11 (O_asb_2022-02).
2022.02.15

Download “lineage-15.1-20220215-UNOFFICIAL-eagle.zip” – 342.79 MB2022-02-15

Download “lineage-15.1-20220215-UNOFFICIAL-eagle-Go.zip” – 336.82 MB2022-02-15

  • Source LineageOS updated to 2022-02-15 (O_asb_2022-01).
2021.12.28

Download “lineage-15.1-20211228-UNOFFICIAL-eagle.zip” – 342.65 MB2021-12-28

Download “lineage-15.1-20211228-UNOFFICIAL-eagle-Go.zip” – 336.54 MB2021-12-28

  • Source LineageOS updated to 2021-12-28 (O_asb_2021-12).
2021.10.17

Download “lineage-15.1-20211017-UNOFFICIAL-eagle.zip” – 342.33 MB2021-10-17

Download “lineage-15.1-20211017-UNOFFICIAL-eagle-Go.zip” – 336.35 MB2021-10-17

  • Source LineageOS updated to 2021-10-17, security update from 5 October 2021.
2021.09.27
  • Source LineageOS updated to 2021-09-27, security update from 5 September 2021.
2021.08.11
  • Source LineageOS updated to 2021-08-11, security update from 5 August 2021.
2021.07.21
  • Source LineageOS updated to 2021-07-21, security update from 5 Jule 2021.
2021.06.18
  • Source LineageOS updated to 2021-06-18, security update from 5 June 2021.
2021.05.17
  • Source LineageOS updated to 2021-05-16, security update from 5 May 2021.
2021.04.15
  • Source LineageOS updated to 2021-04-15, security update from 5 April 2021.
2021.03.08
  • Source LineageOS updated to 2021-03-08, security update from 5 Mart 2021.
2021.02.17
  • Source LineageOS updated to 2021-02-17, security update from 5 February 2021.
2021.01.18
  • For M2 Dual (D2302) – fixed the ability to disable the second SIM in the Settings.
  • Source LineageOS updated to 2021-01-18, security update from 5 January 2021.
2020.12.22
  • Source LineageOS updated to 2020-12-22, security update from 5 December 2020.
2020.11.15
  • Source LineageOS updated to 2020-11-15, security update from 5 November 2020.
2020.10.11
  • Source LineageOS updated to 2020-10-11, security update from 5 October 2020.
2020.09.30
  • Source LineageOS updated to 2020-09-30, security update from 5 September 2020.
  • Minor kernel changes.
2020.08.23
  • Source LineageOS updated to 2020-08-23, security update from 5 August 2020.
2020.07.23
  • Source LineageOS updated to 2020-07-23, security update from 5 Jule 2020.
2020.06.10
  • Source LineageOS updated to 2020-06-10, security update from 5 June 2020.
2020.05.25
  • Optimization of memory settings for system services by analogy with Android Go.
  • Minor kernel changes.
  • Source LineageOS updated to 2020-05-25, security update from 5 May 2020.
2020.05.01
  • Source LineageOS updated to 2020-05-01, security update from 5 April 2020.
2020.03.10
  • Source LineageOS updated to 2020-03-10, security update from 5 Mart 2020.
2020.02.11
  • Source LineageOS updated to 2020-02-11, security update from 5 February 2020.
2020.01.23
  • Source LineageOS updated to 2020-01-23, security update from 5 January 2020.
2019.12.12
  • Source LineageOS updated to 2019-12-12, security update from 5 December 2019.
2019.11.27

Download “aicp_eagle_o-13.1-UNOFFICIAL-20191127.zip” – 347.27 MB2019-11-27

Download “aicp_eagle_o-13.1-UNOFFICIAL-20191127-Go.zip” – 333.01 MB2019-11-27

  • Source AICP updated to 2019-11-27, security update from 5 November 2019.
2019.11.17
  • Minor kernel changes.
  • Source LineageOS updated to 2019-11-17, security update from 5 November 2019.
2019.10.27

Download “lineage-15.1-20191027-kernel_overclock-eagle.zip” – 11.07 MB2019-10-27

  • Experimental kernel overclocking (CPU +17% (1.19 → 1.40 GHz), RAM +6% (533 → 566 MHz), GPU +18% (450 → 533 MHz)), in PCMark test, average performance increased by 10%. However, more detailed tests showed that there was no performance gain, only new frequencies in the settings, and in fact the additional frequencies do not work. This is only the kernel, installed on top of the latest LineageOS 15.1 firmware.
2019.10.17
  • Source LineageOS updated to 2019-10-17, security update from 5 October 2019.
2019.10.17
  • SDCardFS kernel driver.
  • Several hundred kernel commits (migrated from other kernels for msm8226, msm8960t, msm8916, msm8974).
  • Source AICP updated to 2019-10-17, but security update from 5 August 2019.
2019.08.15
  • Sources AICP and LineageOS updated to 2019-08-15, security update from 5 August 2019.
2019.07.10
  • Experimental build – Android Go configuration (faster and more responsive, but less beautiful, and some have problems with notifications from the messengers).
2019.07.10
  • Sources AICP and LineageOS updated to 2019-07-10, security update from 5 Jule 2019.
2019.06.16
  • Adaptive LMK.
  • Several hundred kernel commits (migrated from other kernels for msm8226, msm8960t, msm8916).
  • Source LineageOS updated to 2019-06-16, security update from 5 June 2019.
2019.05.21
  • Source AICP updated to 2019-05-20, security update from 5 May 2019.
2019.05.16
  • In driver Wi-Fi enabled BondingMode (included WCNSS_qcom_cfg.ini with settings).
  • Implemented the ability to reboot into recovery.
  • Increased rear microphone sensitivity (camcorder is now well hears,
    for voice recorders – use RecForge-II with a choice of rear microphone).
  • Various changes in zRAM and swap (theoretically multitasking would be better).
  • Various changes in driver i2c (sensors will probably stop hanging).
  • Source LineageOS updated to 2019-05-16, security update from 5 May 2019.
2019.04.08
  • The function of recording a conversation is unlocked and is now available in the dialer.
  • Minor changes and optimizations in build configurations, temporarily added debug of i2c in dmesg.
  • Source LineageOS updated to 2019-04-08, security update from 5 April 2019.
2019.03.12
  • Source LineageOS updated to 2019-03-11, security update from Mart 2019.
2019.03.04

Download “RR-O-v6.2.1-20190304-eagle-Unofficial.zip” – 343.77 MB2019-03-04

  • Source Resurrection Remix updated to 2019-03-04, security update from December 2018.
2019.03.02
  • Source AICP updated to 2019-03-02, security update from February 2019.
2019.02.28
  • Fixed problems with the video camera, built-in video camera works fine (video does not twitch, FullHD work).
  • Fixed problems with XTRA/AGPS, searching and fixing satellites is now as fast as on stock firmware.
  • The built-in firewall is fixed and works (in older versions this leads to an error and a bootlap after a reboot).
  • Source LineageOS updated to 2019-02-28, security update from February 2019.

Changelog, Downloads LineageOS 14.1 for Sony M2

Logo LineageOS
Work on LineageOS for Sony M2 is not stopped, the builds will be published as security updates are released (usually once a month, in middle of month).

Changelog LineageOS 14.1 (Android 7.1.2 Nougat)
2021.10.29

Download “lineage-14.1-20211029-UNOFFICIAL-eagle.zip” – 328.12 MB2021-10-29

  • Source LineageOS updated to 2021-10-29, security update from 5 June 2021 and some newer security updates (due to the absence of one of the updates, now the version line is not updated – reasons explained there)
2021.07.21

Download “lineage-14.1-20210721-UNOFFICIAL-eagle.zip” – 325.96 MB2021-07-21

  • Source LineageOS updated to 2021-07-21, security update from 5 June 2021.
2021.04.15
  • Source LineageOS updated to 2021-04-15, security update from 5 April 2021.
2021.03.08
  • Source LineageOS updated to 2021-03-08, security update from 5 Mart 2021.
2021.02.18
  • Source LineageOS updated to 2021-02-18, security update from 5 February 2021.
2020.12.22
  • Source LineageOS updated to 2020-12-21, security update from 5 December 2020.
2020.10.29
  • Source LineageOS updated to 2020-10-29, security update from 5 October 2020.
2020.10.06
  • Source LineageOS updated to 2020-10-06, security update from 5 September 2020.
  • Minor kernel changes.
2020.08.23
  • Source LineageOS updated to 2020-08-23, security update from 5 August 2020.
2020.07.23
  • Source LineageOS updated to 2020-07-23, security update from 5 Jule 2020.
2020.06.10
  • Source LineageOS updated to 2020-06-10, security update from 5 June 2020.
2020.06.07
  • Minor kernel changes.
  • Source LineageOS updated to 2020-06-07, security update from 5 May 2020.
2020.05.01
  • Source LineageOS updated to 2020-05-01, security update from 5 April 2020.
2020.04.07
  • Source LineageOS updated to 2020-04-07, security update from 5 Mart 2020.
2020.02.14
  • Source LineageOS updated to 2020-02-14, security update from 5 Ferbuary 2020.
2020.02.04
  • Source LineageOS updated to 2020-02-04, security update from 5 January 2020.
2019.12.23
  • Source LineageOS updated to 2019-12-23, security update from 5 December 2019.
2019.11.17
  • Minor kernel changes.
  • Source LineageOS updated to 2019-11-17, security update from 5 November 2019.
2019.10.23
  • SDCardFS kernel driver.
  • Several hundred kernel commits (migrated from other kernels for msm8226, msm8960t, msm8916, msm8974).
  • Source LineageOS updated to 2019-10-23, security update from 5 October 2019.
2019.08.15
  • Source LineageOS updated to 2019-08-15, security update from 5 August 2019.
2019.07.09
  • Source LineageOS updated to 2019-07-09, security update from 5 Jule 2019.
2019.06.16
  • Adaptive LMK.
  • Several hundred kernel commits (migrated from other kernels for msm8226, msm8960t, msm8916).
  • Source LineageOS updated to 2019-06-16, security update from 5 June 2019.
2019.05.21
  • Enabled BFQ by default (unification with Oreo builds).
  • Unified kernel from Oreo builds (Updated BFQ driver, etc).
  • In driver Wi-Fi enabled BondingMode (included WCNSS_qcom_cfg.ini with settings).
  • Implemented the ability to reboot into recovery.
  • Increased rear microphone sensitivity (camcorder is now well hears,
    for voice recorders – use RecForge-II with a choice of rear microphone).
  • Various changes in zRAM and swap (theoretically multitasking would be better).
  • Various changes in driver i2c (sensors will probably stop hanging).
  • Source LineageOS updated to 2019-05-20, security update from 5 May 2019.
2019.04.08
  • The function of recording a conversation is unlocked and is now available in the dialer.
  • Minor changes in build configurations.
  • Source LineageOS updated to 2019-04-08, security update from 5 April 2019.
2019.03.12
  • Source LineageOS updated to 2019-03-11, security update from Mart 2019.
2019.02.28
  • Update gps.conf.
  • Source LineageOS updated to 2019-02-28, security update from February 2019.

Changelog, Downloads TWRP-images for Sony M2

Логотип TWRP (Team Win Recovery Project)
Image recovery.img flash to Recovery-partition.

Changelog TWRP
3.5.0_9-2021.01.18

Download “TWRP-eagle-20210118.rar” – 14.13 MBVersion 3.5.0, 2021-01-18

  • Source TWRP updated to 2021-01-18.
3.4.0-2020.07.23

Download “TWRP-eagle-20200723.rar” – 14.13 MBVersion 3.4.0, 2020-07-23

  • Source TWRP updated to 2020-07-23.
3.4.0-2020.06.10
  • Minor kernel changes.
  • Source TWRP updated to 2020-06-10.
3.3.1-2020.05.01
  • Minor kernel changes.
  • Source TWRP updated to 2020-05-01.
3.3.1-2019.10.17
  • Update kernel (SDCardFS, etc).
  • Source TWRP updated to 2019-10-17.
3.3.1-2019.07.09
  • Source TWRP updated to 2019-07-09.
3.3.1-2019.06.17
  • Update kernel.
  • Source TWRP updated to 2019-06-17.
3.3.0-2019.04.21
  • Cleanup configs.
  • Various updates TWRP components.
3.2.3
  • Remove SuperSU from TWRP.
  • Support both md5 and md5sum file for ZIP files.
3.2.2
  • ADB backup fixes.
  • Minor tweaks to handling date/time on Qualcomm devices.

Quick Installation Guide Firmware on Sony Xperia M2

  • There must be an unlocked boot.
  • Latest official firmware ever previously flashed – should be 18.6.A.0.182 (5.1.1), this is due to the modem partition, since it remains from the official firmware.
  • Recovery must be installed – (rus) TWRP for Sony Xperia M2 (eng) TWRP for Sony Xperia M2
  • Do Factory Reset in TWRP (necessarily, otherwise the installation over the old LineageOS inherits some errors of the old LineageOS). I recommend doing an additional cleaning (this solves the problem with «update error 7»): TWRP – Wipe – Advanced Wipe – Dalvik,System,Cache,Data.
  • Install the firmware.
  • You can install GApps immediately, I use OpenGApps, ARM – 8.1 – Nano.
  • The first run may take several minutes.
  • If you need root – SuperSU, install after initial setup.

Brief instructions on updating LineageOS firmware on Sony Xperia M2

  • Update a similar series firmware (ie, 14.1 on the newer 14.1 15.1 15.1 a newer or AICP-Oreo on a new AICP-Oreo) can usually be simply installing it over the old one using TWRP. All settings and data are saved.
  • If the firmware of another series – you need to clean everything (do the cleaning of the Dalvik / ART Cache, System, Cache, Data sections in TWRP) before flashing.
  • Firmware Go-version and regular – are also not compatible with each other when flashing over. TWRP detects the fact of the old installation of the Go-version and independently saves its config. As a result, when you try to install regular firmware on top of Go, you may get the Go version again. Before switching from Go firmware to regular firmware and vice versa, you need to do the cleaning of the Dalvik / ART Cache, System, Cache, Data partitions.
  • When flashing over – gapps are saved.
  • When flashing over – the root disappears (because the boot image is updated). You must immediately re-flash SuperSU (if you need a root).

What is the difference between different Android firmware?

I installed and compared many different firmware – LineageOS (ex CyanogenMod), AEX (AOSP Extended), Resurrection Remix, Pixel, AOKP, AICP, dotOS, crDroid, Candy, XenonHD, MoKee and others.

LineageOS is one of the most popular firmware, regularly updated, but there are almost no additional configuration options – almost pure Android.
dotOS, Pixel, MoKee – do not have additional settings, different pre-designed themes.
In other firmware (AEX, AOKP, AICP, Resurrection Remix, XenonHD, etc.) there is a section of advanced settings, their composition is about the same for all. For example, you can include the output of the date and day of the week in the status bar near the clock. Configure traffic indicator. Adjust the battery indicator. In the menu of the latest applications show the occupied RAM. Configure the lock screen, disable the quick settings there. Customize the quick settings panel (size and number of icons, captions). And much more, only about a hundred of these options.

From the compared firmware, the maximum number of additional settings in the AICP and Resurrection Remix.

But almost all custom firmwares (except LineageOS) have a short support period, and in the spring of 2019 the compilation AICP and Resurrection Remix based on Oreo became impossible. Because parts inherited from AOSP have changed and become incompatible with old versions of AICP and RR, but the authors of AICP and RR did not update their Oreo firmware for new AOSP sources (they make firmware only for the latest versions – Pie). So regular builds of AICP-Oreo and RR-Oreo for Sony M2 are not expected. Although, AICP-Oreo builds will probably still be.

Firmwares Carbon and Omni – very different from the others, build on existing source config for M2 – they don’t work…

LineageOS has a long term support, even KitKat update (as of 2019).

What to choose – Android or Android Go (LineageOS Go, AICP Go)? Read this post.

All necessary drivers for Sony Xperia M2

Drivers posted there

Sources unofficial firmwares for Sony Xperia M2

All builds is based on the sources from XDA – from galaxyfreak, Konstantinosj77, sgspluss, AdrianDC.

Sources for building the firmware consist of many different components – Android itself, the kernel, components for supporting hardware from the chip manufacturer and from the smartphone manufacturer, specific platform configs, various proprietary hardware drivers from the stock firmware, etc.

https://github.com/LineageOS/android
https://github.com/LineageOS/android_external_sony_boringssl-compat
https://github.com/LineageOS/android_hardware_sony_timekeep
https://github.com/LineageOS/android_device_qcom_common
https://github.com/LineageOS/android_device_sony_common
https://github.com/LineageOS/android_hardware_sony_macaddrsetup
https://github.com/LineageOS/android_packages_resources_devicesettings
https://github.com/sonyxperiadev/packages_apps_ExtendedSettings
https://github.com/f2065/android_hardware_qcom_gps
https://github.com/f2065/device-sony-eagle
https://github.com/f2065/device-sony-yukon
https://github.com/f2065/vendor-yukon
https://github.com/f2065/android_kernel_sony_msm8226
https://github.com/f2065/platform_manifest_twrp_lineageos
https://github.com/ResurrectionRemix/platform_manifest
https://github.com/AICP/platform_manifest

A set of scripts to download LineageOS sources and build:
https://github.com/f2065/build_android