Themes / Apps / Mods [DEV] Kernel Flasher

Search This thread

capntrips

Senior Member
Aug 29, 2020
215
408
OnePlus 6T
Google Pixel 6
kernel-flasher-1.jpg
kernel-flasher-2.jpg
kernel-flasher-3.jpg


Kernel Flasher is an Android app to flash, backup, and restore kernels.

Features
  • Flash AK3 kernel zips
  • Backup and Restore kernel partitions
  • Mount, Map, and Resize vendor_dlkm
  • Save dmesg and logcat

Planned and Potential Features
  • Keep original AK3 zip filename during flash (useful when viewing logs)
  • Add support for FKM update json format
  • Periodically check update json URLs automatically in the background?
  • Move backups to a folder in the sdcard root (breaking change)
  • Allow selective backup and restoration of raw partitions
  • Create and display hashes for all partitions
  • Verify hashes after backup and restoration?
  • Add a setting for preferred hashing algorithms?
  • Named backups? notes?
  • Reallow flashing to the inactive slot?
  • Attempt to fallback on resize when there is no room for replace
  • Provide multiple reboot options

Notes

When making a backup of the active slot, to save time, it is assumed that the kernel on disk is the same as the running kernel. The Check Kernel Version button can retrieve it from disk prior to backup.

After restore (or flash from AK3), the updated contents of vendor_dlkm can't immediately be backed up. Unmounting, unmapping, then remapping it can make it available for backup.

AK3 helper modules are not backed up. Flashing the AK3 zip is preferable. The backup function is mostly intended for stock.


Credits

@osm0sis for AK3, feedback, and general guidance
@eng.stk & @Freak07 for feedback, advice, and encouragement
@phhusson for lptools
@topjohnwu for Magisk and libsu


Latest Update

2022-08-07 v1.0.0-alpha08
 
Last edited:

capntrips

Senior Member
Aug 29, 2020
215
408
OnePlus 6T
Google Pixel 6
Can you please leave the kernel installation log opened after the process ends with an error? Currently it's impossible to see what went wrong since the log disappears instantly and is being replaced by an error screen.
That is already done in my own personal test version of the app, but I haven't had a chance to clean it up and get it released. I'll make an effort to get that done this evening.

I've got several other enhancements planned, but most of my focus has been on Hashtree Patcher lately, though I think that is nearly wrapped up. I'll try to get the installation log issue fixed asap, then I'll work on the rest over the next few days.
 
Last edited:

capntrips

Senior Member
Aug 29, 2020
215
408
OnePlus 6T
Google Pixel 6
I pushed a new build that resolves the installation log issue. Here is the full changelog:

added option to backup AK3 zips
disabled flash and restore on inactive slot
added save ramoops button
added stderr to AK3 logs
added .log file extension to log files
filtered ui_print and progress in AK3 logs
sorted backups

I also added a list of planned and potential features to the OP. If you've got some interest in seeing any of them or anything I may have missed in a future build, feel free to note it here. If the list gets to be too big of a pain to maintain here, I may request that they go to the issue tracker, instead. Note that I don't currently plan to add kernel tweaks to the app.

Edit: There was a bug in the v1.0.0-alpha03 build that caused it to crash frequently. This has been fixed in v1.0.0-alpha04.
 
Last edited:

capntrips

Senior Member
Aug 29, 2020
215
408
OnePlus 6T
Google Pixel 6
Alpha 4 seems like a bad upload? I have downloaded it a couple times but Android just reports "There was a problem parsing the package"
I have that checksum too but it's not working, maybe it's minimum Android 12?
Yes, I was playing with the new Splashscreen API, which requires Android 12, and I don't have an Android 11 device to test on, so I just set minSdk to 31. I'll see if I can get it to build against something lower.
 
Last edited:
  • Like
Reactions: eng.stk and osm0sis

capntrips

Senior Member
Aug 29, 2020
215
408
OnePlus 6T
Google Pixel 6
I pushed a new build that will hopefully work on Android 11. Here are the changes:

lowered minSdk to 30
added vbmeta to raw partition backups
fixed vendor_dlkm map and mount

Note: With verity enabled, you may have to unmap vendor_dlkm twice, once for the verity device and again for the actual partition. The partition is remounted without verity, though I'm not sure there's a scenario where it's necessary to remount it at all.
 
Last edited:
  • Like
Reactions: eng.stk and osm0sis

osm0sis

Senior Recognized Developer / Contributor
Mar 14, 2012
15,014
34,054
Halifax
GT-i9250
Google Nexus 4
I pushed a new build that will hopefully work on Android 11. Here are the changes:



Note: With verity enabled, you may have to unmap vendor_dlkm twice, once for the verity device and again for the actual partition. The partition is remounted without verity, though I'm not sure there's a scenario where it's necessary to remount it at all.
Thanks! Crashes after the splash screen on my OP8T on OOS11, not seeing anything in the logcat however..🤔
 
  • Like
Reactions: capntrips

capntrips

Senior Member
Aug 29, 2020
215
408
OnePlus 6T
Google Pixel 6
Thanks! Crashes after the splash screen on my OP8T on OOS11, not seeing anything in the logcat however..🤔
I pushed a new build that hopefully fixes the issue. It now makes it to the point where it requires root to continue on an Android 11 AVD. I assume if it makes it to that point, the rest will work as expected. Anything beyond that, and I'll have to root the AVD to test it (though I did see an article about that a few weeks back, and it seemed simple enough).
 
  • Like
Reactions: osm0sis and shoey63

osm0sis

Senior Recognized Developer / Contributor
Mar 14, 2012
15,014
34,054
Halifax
GT-i9250
Google Nexus 4
A few random thoughts/ideas while testing on my 8T :):

Got some errors trying to backup on my 8T since there's no vendor_boot, so I guess some logic will be needed for whether they exist.

Probably the feature should be like "backup slot" and save init_boot, boot, vendor_boot, dtbo, recovery, vendor_dlkm and vbmeta from the chosen slot if any of them exist.

If vendor_dlkm doesn't exist on an older device it doesn't make sense to show "Not Found" all over the place, nor offer to allow me to map it, it should hide those messages/buttons and just only show boot or whatever other partitions exist on the device.

If the reboot button had a ... to reveal an advanced reboot menu (menu items like the Magisk app) that would be excellent!


Overall looking really good! Exciting to see a well written free alternative. 🤘
 
Last edited:

capntrips

Senior Member
Aug 29, 2020
215
408
OnePlus 6T
Google Pixel 6
When you have time to work on the next update, would it be possible to make boot image flashing possible (External ones, not just saved backups), as well as zips?
The backup format is very basic. You could easily drop the image you want into the backup folder and create the properties file. I'll take a look at adding something to simplify direct flashing in the next few revisions. I'm out of pocket through the weekend and will probably need a few days of catch-up when I get back.
 
  • Like
Reactions: shoey63 and osm0sis

Enddo

Senior Member
Oct 31, 2013
2,039
864
Atlanta, Ga.
www.youtube.com
can I flash an uncompressed boot.img file with this app? the github only mentions flashing an AK3 zip file, so I was curious

sorry, I see the other reply. I'm hoping this app gets this feature in a future update soon. making a video about this app right now :)
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 26
    kernel-flasher-1.jpg
    kernel-flasher-2.jpg
    kernel-flasher-3.jpg


    Kernel Flasher is an Android app to flash, backup, and restore kernels.

    Features
    • Flash AK3 kernel zips
    • Backup and Restore kernel partitions
    • Mount, Map, and Resize vendor_dlkm
    • Save dmesg and logcat

    Planned and Potential Features
    • Keep original AK3 zip filename during flash (useful when viewing logs)
    • Add support for FKM update json format
    • Periodically check update json URLs automatically in the background?
    • Move backups to a folder in the sdcard root (breaking change)
    • Allow selective backup and restoration of raw partitions
    • Create and display hashes for all partitions
    • Verify hashes after backup and restoration?
    • Add a setting for preferred hashing algorithms?
    • Named backups? notes?
    • Reallow flashing to the inactive slot?
    • Attempt to fallback on resize when there is no room for replace
    • Provide multiple reboot options

    Notes

    When making a backup of the active slot, to save time, it is assumed that the kernel on disk is the same as the running kernel. The Check Kernel Version button can retrieve it from disk prior to backup.

    After restore (or flash from AK3), the updated contents of vendor_dlkm can't immediately be backed up. Unmounting, unmapping, then remapping it can make it available for backup.

    AK3 helper modules are not backed up. Flashing the AK3 zip is preferable. The backup function is mostly intended for stock.


    Credits

    @osm0sis for AK3, feedback, and general guidance
    @eng.stk & @Freak07 for feedback, advice, and encouragement
    @phhusson for lptools
    @topjohnwu for Magisk and libsu


    Latest Update

    2022-08-07 v1.0.0-alpha08
    6
    Can you please leave the kernel installation log opened after the process ends with an error? Currently it's impossible to see what went wrong since the log disappears instantly and is being replaced by an error screen.
    That is already done in my own personal test version of the app, but I haven't had a chance to clean it up and get it released. I'll make an effort to get that done this evening.

    I've got several other enhancements planned, but most of my focus has been on Hashtree Patcher lately, though I think that is nearly wrapped up. I'll try to get the installation log issue fixed asap, then I'll work on the rest over the next few days.
    6
    A few random thoughts/ideas while testing on my 8T :)
    All good ideas. Probably good enough to check by path for the existence of a partition, rather than finding and parsing fstab. My next two weeks are brutal, but I'll see if I find some time to fiddle with it in there.
    4
    I pushed a new build that resolves the installation log issue. Here is the full changelog:

    added option to backup AK3 zips
    disabled flash and restore on inactive slot
    added save ramoops button
    added stderr to AK3 logs
    added .log file extension to log files
    filtered ui_print and progress in AK3 logs
    sorted backups

    I also added a list of planned and potential features to the OP. If you've got some interest in seeing any of them or anything I may have missed in a future build, feel free to note it here. If the list gets to be too big of a pain to maintain here, I may request that they go to the issue tracker, instead. Note that I don't currently plan to add kernel tweaks to the app.

    Edit: There was a bug in the v1.0.0-alpha03 build that caused it to crash frequently. This has been fixed in v1.0.0-alpha04.
    3
    Now works on lineage 18.1 Sony xz2 slot a/b device