Development [Kernel][GKI][05.03.2023][Android 13] Kirisakura 1.0.3 for Sony Xperia 1 IV aka "Nagara"

Search This thread

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,240
21,764
Update to 1.0.0_T

Hey guys and girls,

Here´s the next update. Android 13 dropped for the Xperia 1 IV.
No kernel source was released yet, but thanks to this kernel being only based on the GKI part, I can update it without the source, by guessing the right GKI-base.

All previous features are brought to the Android 13 compatible GKI release.




More changes in the Changelog below:


Changelog:
- Update kernel for Android 13 firmware
- fix wifi vulnerabilities/cves



Download:
Attached to this post as AFH does not let me upload at the moment




Instructions can be found in the OP!
But look at this post too :)

Have fun, enjoy the kernel and your phone.

Donations are not mandatory but very welcome.
If you like my work and want to buy me a coffee/green tea to keep development going: http://paypal.me/freak07
 

Attachments

  • Kirisakura_Nagara_T_1.0.0.zip
    16.9 MB · Views: 147
Last edited:
Update to 1.0.0_T

Hey guys and girls,

Here´s the next update. Android 13 dropped for the Xperia 1 IV.
No kernel source was released yet, but thanks to this kernel being only based on the GKI part, I can update it without the source, by guessing the right GKI-base.

All previous features are brought to the Android 13 compatible GKI release.




More changes in the Changelog below:


Changelog:
- Update kernel for Android 13 firmware
- fix wifi vulnerabilities/cves



Download:
Attached to this post as AFH does not let me upload at the moment




Instructions can be found in the OP!
But look at this post too :)

Have fun, enjoy the kernel and your phone.

Donations are not mandatory but very welcome.
If you like my work and want to buy me a coffee/green tea to keep development going: http://paypal.me/freak07
Great will it comes also for Xperia 1 iii when android 13 is released ?
 

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,240
21,764
Great will it comes also for Xperia 1 iii when android 13 is released ?
That´s really not the correct place to ask.

Xperia 1 III works differently. I need to probably wait for the source once A13 is released.
When I find time and I´m able to manage, I´ll try to update the kernel for Android 13 there as well.
But no promises, life comes first.
 

raven213

Senior Member
Apr 12, 2011
841
108
Update to 1.0.0_T

Hey guys and girls,

Here´s the next update. Android 13 dropped for the Xperia 1 IV.
No kernel source was released yet, but thanks to this kernel being only based on the GKI part, I can update it without the source, by guessing the right GKI-base.

All previous features are brought to the Android 13 compatible GKI release.




More changes in the Changelog below:


Changelog:
- Update kernel for Android 13 firmware
- fix wifi vulnerabilities/cves



Download:
Attached to this post as AFH does not let me upload at the moment




Instructions can be found in the OP!
But look at this post too :)

Have fun, enjoy the kernel and your phone.

Donations are not mandatory but very welcome.
If you like my work and want to buy me a coffee/green tea to keep development going: http://paypal.me/freak07
AFH fails im gonna donwload T from the attachment
Edit: T works im assuming its the new version sorry
 

laubblaeser

New member
Dec 11, 2022
1
0
This sounds pretty promising and like a great piece of modification for our phones. Thanks for making it. I don't do very CPU heavy work on my phone and think that even level 2 or 3 would suit me just fine as long as it doesn't impact the usage of the phone's camera apps.

Has someone used this kernel for some time now and can talk about the impacts on power draw? I wonder how much of an impact it will make, e.g. if it's 10% or 20% more mileage out of a single battery charge. Thanks for any insights :)
 

htcmage

Senior Member
May 3, 2020
121
39
HTC U11+
HTC U12+
Hello, developer, there was no problem in Android 12. In Android 13, the heat increases when replacing the kernel. I get a lot of heat even without doing anything, can I know the cause?
 

Attachments

  • IMG_20221211_212624.png
    IMG_20221211_212624.png
    527.1 KB · Views: 54

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,240
21,764
Hello, developer, there was no problem in Android 12. In Android 13, the heat increases when replacing the kernel. I get a lot of heat even without doing anything, can I know the cause?
Sounds like a service or an app hogging in the background constantly requesting resources, unrelated to the kernel.

You can check for example with top command if something is hogging the CPU.

All good on my end, if i don't push the phone temps stay low.
 

Attachments

  • Screenshot_20221211-213815.png
    Screenshot_20221211-213815.png
    382.4 KB · Views: 43
  • Like
Reactions: htcmage
Is it possible to flash this kernel to the stock A13 update (december) ?

If so, would I still get OS updates via OTA? And for future kernel updates, I assume I would need to flash the new one over the old one, am I right?

Sorry for asking noobie questions, haven't touched android development in a while
 

Devries

Senior Member
Mar 7, 2012
178
208
Hello, thanks for your work on Xperia 1 IV, I am curious about how do you compile the kernel?
Are you using a separate build script?

I am currently build it under a AOSP project, but it cost too much disk space.
 

Mrxyzl

Senior Member
May 1, 2015
892
489
Sony Xperia 1 IV
Update to 1.0.0_T

Hey guys and girls,

Here´s the next update. Android 13 dropped for the Xperia 1 IV.
No kernel source was released yet, but thanks to this kernel being only based on the GKI part, I can update it without the source, by guessing the right GKI-base.

All previous features are brought to the Android 13 compatible GKI release.




More changes in the Changelog below:


Changelog:
- Update kernel for Android 13 firmware
- fix wifi vulnerabilities/cves



Download:
Attached to this post as AFH does not let me upload at the moment




Instructions can be found in the OP!
But look at this post too :)

Have fun, enjoy the kernel and your phone.

Donations are not mandatory but very welcome.
If you like my work and want to buy me a coffee/green tea to keep development going: http://paypal.me/freak07
Hello, the guide on first page tell Touch-Boost Restriction need to be set to 1 or 0 but the file only accept Y or N.
Also, can i request option to disable touch boost completely?
 

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,240
21,764
Hello, the guide on first page tell Touch-Boost Restriction need to be set to 1 or 0 but the file only accept Y or N.
Also, can i request option to disable touch boost completely?
Doesn't matter how you do it. N = 0 and Y = 1.

Touch boost can't be disabled via kernel as it's also handled by the power-hal.
If boosts are disabled completely, the phone gets a stuttery mess.
 

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,240
21,764
Update to 1.0.1_T

Hey guys and girls,


Here´s the next update. Latest firmware got a slight bump in the GKI kernel.
This update adds this to my kernel as well.

More changes in the Changelog below:


Changelog:
- Update GKI kernel base to proper latest state



Download:
Attached to this post as AFH does not let me upload at the moment




Instructions can be found in the OP!
But look at this post too :)

Have fun, enjoy the kernel and your phone.

Donations are not mandatory but very welcome.
If you like my work and want to buy me a coffee/green tea to keep development going: http://paypal.me/freak07
 

Attachments

  • Kirisakura_Nagara_T_1.0.1.zip
    16.5 MB · Views: 130

Freak07

Recognized Developer / Recognized Contributor
Jan 2, 2011
6,240
21,764
Hello, thanks for your work on Xperia 1 IV, I am curious about how do you compile the kernel?
Are you using a separate build script?

I am currently build it under a AOSP project, but it cost too much disk space.
Hello,

I´m using the QCOM build environment and just build the GKI kernel there. Similar to yours it takes just a lot of space.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    Kirisakura-Kernel for the Sony Xperia 1 IV

    Hello everyone,


    To keep it short: Here is Kirisakura- GKI - Kernel for the Sony Xperia 1 IV aka Nagara. Nagara is the internal codename for this years development platform of Sony Mark IV devices.
    I would appreciate if everybody that flashes the kernel, reads at least once through this opening post and the following ones.

    Kirisakura - Kernel is designed to bring a handful of beneficial features to the device, while ensuring excellent performance and smoothness to get you safely through the day!
    If you expect a custom kernel to magically improve your devices battery life manifold and this is your only priority then this might not be the right place for you.
    There´s also a cpu-battery saver mode that cuts back the CPU max- freqs, but without the disadvantages like delayed notifications from built into the system user-space power-saving modes.
    If that got your curious, I welcome you to continue reading if you´re still interested!

    Now lets continue with a list of features in the next paragraph!


    Main Features:
    - Based on kernel/common 5.10.149
    - compiled with Clang 12.0.5
    - CPU-Battery saver to be able to restrict max cpufreqs on the fly, without enabling powersaving modes that might cause missed notifications (see second post)
    - SSG IO scheduler for reduced overhead and less CPU cycles (more lightweight and android optimized)
    - Power saving workingqueues enabled by default
    - Change various drivers to use power efficient workingqueues. This compliments EAS in general
    - implement LRNG (thanks @arter97, see arter kernel OP for more info )
    - Enable support for TTL spoofing
    - wakelock blocker with the ability to block any wakelocks (dangerous, use with caution)
    - please read [URL="https://arstechnica.com/gadgets/2018/08/p-is-for-power-how-google-tests-tracks-and-improves-android-battery-life/"]this for further info
    - f2fs improvments for better efficiency
    - scheduler improvements
    - psi fixes
    - Flashing the kernel will keep root!
    - Flashable via EXKM, FKM or TWRP (if available) on a rooted system!


    Flashing Guide, Download and Changelog

    Requirements:

    - unlocked Bootloader
    - USB-Debugging in developer options enabled
    - latest adb and fastboot binaries
    - working adb and fastboot environment
    - magisk root
    - a backup of stock boot.img or your magisk patched boot.img in case you want to go back to stock.

    How to flash the Kernel:
    1. Download the latest kernel.zip and make sure you have properly updated to the latest matching Firmware (check the feature list for the current firmware the source is based on). When there´s an OTA update for the Sony Xperia 1 IV it takes Sony a while to release the source code for the new OS and me a while to build a new kernel. If you don´t want to face any issues, wait until I either release an updated kernel or give green light because there were no kernel changes.
    If you want to be sure there are no issues, always make sure to run the firmware the kernel is built for!
    If you feel adventurous and try in advance, make sure you have a backup ready!

    2. Flash the kernel.zip via latest TWRP (if available), EXKM or FKM app and do a full reboot.

    3. Reboot and profit.


    DOWNLOAD:
    Download is located always in this folder, or attached to the release posts in case AFH is wonky.

    Important: Read after Download
    Please take a look at the second post after flashing the kernel!

    Changelog:

    Android 12

    1.0.0 Initial Release

    Android 13
    1.0.0 https://forum.xda-developers.com/t/...-xperia-1-iv-aka-nagara.4480653/post-87711541
    1.0.1 https://forum.xda-developers.com/t/...-xperia-1-iv-aka-nagara.4480653/post-87945391
    1.0.3 https://forum.xda-developers.com/t/...-xperia-1-iv-aka-nagara.4480653/post-88241223


    Donations:
    Donations are not mandatory but very welcome if you want to support development or just buy me a coffee/tea :)
    If you like my work: http://paypal.me/freak07

    Credits:
    Sony for the development device, giving me the opportunity to create this project!
    @osm0sis for all his work, including the ak3 installer!
    @tbalden for being the best HTC, Pixel, OnePlus and now Asus wingman!
    @LeeDroid and @mwilky for their awesome roms and work I used on multiple devices!
    @Captain_Throwback for all the mentoring and guidance!
    @Eliminater74 for bringing me into the game and the Inspiration
    @nathanchance for his upstream guidance and assistance
    @RenderBroken for helping me out
    @flar2 for all his work
    @joshuous for all the help he provided to me in the past!
    @arter97 for giving me advice
    @kdrag0n for his help and advices!
    @topjohnwu for magisk!


    Source Code: https://github.com/freak07/Kirisakura_GKI_Nagara
    7
    F.A.Q:

    Question:
    Is root preserved when flashing this kernel?
    Answer: Yes, the AnyKernel.zip will detect root and keep it.

    Question: Safetynet does not pass on my phone since I unlocked the phone, why is this so?
    Answer: Google introduced hardware backed attestation recently. Unfortunately the old kernel tricks to still get safetynet passing won´t work. Instead you will have to rely on some magisk modules. Short guide in post #4 below.

    Question: How do I return back to stock or another kernel.
    Answer: Extract boot.img from the matching firmware you are on (you can do so by using this tool or similar ones found on XDA and when googling around) and flash via fastboot. If you want to keep root flash back the magisk_patched_boot.img. Or dirty flash your rom and re-root.

    Question: Why is having Magisk installed mandatory for this kernel?
    Answer: The kernel uses a ramdisk overlay to apply some settings after boot. If you are not rooted these settings will not get applied and you miss some of the optimizations.

    Question: How to report bugs properly?
    Answer: Have a look at post #3 in the linked thread. The linked guide is a pretty good starting point.
    Before reporting any bug make sure you´re running on a stock configuration. That´s means you´re not using any mods, tweaks in kernel managers or other root tweaks , magisk modules, scripts or other modifications that alter various functions like sound mods, data traffic, sleeping behaviour, scheduler, magical battery tweaks etc.
    Try to describe the issue as detailed as possible! Give your exact setup, like rom, magisk version, kernel version.
    Is the issue reproducible? Does it happen frequently?
    Provide logs, otherwise debugging is a lot harder. If you can already reproduce the issue and provide logs it greatly limits the amount of time I have to spent until I figure out how to reproduce it.
    5
    How to pass Safetynet after unlocking the bootloader

    With the introduction of hardware backed safetynet attestation, passing safetynet has become a lot more complicated.
    Some probably remember a while ago, flashing a kernel that forced some flags was enough to pass it. However these days are gone.
    Below is a short guide how to pass safetynet on phones that are flagged to use HW attestation (such as the ROG 5).

    1. Make sure you´re running latest magisk canary.
    2. In Magisk Manager enable both zygisk and deny list.
    4. Download the latest Universal Safety Net Fix from @kdrag0n ´s github for zygisk cand flash it in Magisk Manager. Reboot.
    5. Profit
    4
    Feature Documentation:
    Here´s a brief documentation about some of the features included in the kernel that can be changed as the user desires.
    They can be accessed via either terminal, scripts or for example EXKM manager ( tools -> user settings).

    CPU-Frequency Limiting:
    Another option is CPU-Freq Limiting. You can now limit the CPU frequency to a few different levels with a sysfs interface. Original implementation is from @tbalden, I only changed it to be accessible via traditional root methods.
    Main Switch:
    sys/module/cpufreq/parameters/batterysaver
    Set this option to "1" to enable the feature

    Max-Frequency Selection (Input boosts, such as scrolling boost or app launching boosts will still apply, if touch boost restriction is not set to 1)
    sys/module/cpufreq/parameters/batterysaver_level
    Set this to "1" to restrict the max CPU-Freqs to 1,6GHZ/1,9GHZ/2,22GHZ (Little Cluster/Big Cluster/Prime Core)
    Set this to "2" to restrict the max CPU-Freqs to 1,4GHZ/1,6GHZ/1,8GHZ (Little Cluster/Big Cluster/Prime Core)
    Set this to "3" to restrict the max CPU-Freqs to 1,1GHZ/1,1GHZ/1,1GHZ (Little Cluster/Big Cluster/Prime Core)

    Touch-Boost Restriction
    sys/module/cpufreq/parameters/batterysaver_touch limiting
    Set this to "1" to restrict the powerhal from boosting over the limit defined in batterysaver_level
    Set this to "0" to allow the powerhal to boost above the values defined in batterysaver_level, but only during interaction with the Phone!

    Screenshots:
    View attachment 5309899View attachment 5309901View attachment 5309903


    This is for example very useful during gaming to prevent additional heat, if not the highest performance from the CPU is required. Check if the game is running fine on level 1 or 2, and you´ll notice much less heat. Powerdraw will be reduced as well.
    Another very useful trick while doing video calls or long extended navigation sessions with google maps to preserve battery or keep the phone from heating. Especially during summer if the ambient temperatures are high.
    This is a very easy way to preserve battery or reduce heat without toggling the battery save mode in settings as that restricts background data usage, which can lead to delayed notifications.
    3
    Update to 1.0.0_T

    Hey guys and girls,

    Here´s the next update. Android 13 dropped for the Xperia 1 IV.
    No kernel source was released yet, but thanks to this kernel being only based on the GKI part, I can update it without the source, by guessing the right GKI-base.

    All previous features are brought to the Android 13 compatible GKI release.




    More changes in the Changelog below:


    Changelog:
    - Update kernel for Android 13 firmware
    - fix wifi vulnerabilities/cves



    Download:
    Attached to this post as AFH does not let me upload at the moment




    Instructions can be found in the OP!
    But look at this post too :)

    Have fun, enjoy the kernel and your phone.

    Donations are not mandatory but very welcome.
    If you like my work and want to buy me a coffee/green tea to keep development going: http://paypal.me/freak07