Themes / Apps / Mods [DEV] Kernel Flasher

Search This thread

capntrips

Senior Member
Aug 29, 2020
336
772
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 partition images and AK3 kernel zips
  • Backup and Restore kernel partitions
  • Mount, Map, and Resize vendor_dlkm
  • Save dmesg, logcat, and ramoops
  • Check for kernel updates

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.

Depending on the method used, the updated contents of vendor_dlkm may not be immediately available for backup after flash or restore. This can be resolved by unmounting, unmapping, then remapping it.

AK3 helper modules are not backed up.


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

2023-02-20 v1.0.0-alpha13
 
Last edited:

capntrips

Senior Member
Aug 29, 2020
336
772
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
336
772
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
336
772
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
336
772
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,649
35,392
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
336
772
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,649
35,392
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
336
772
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,064
879
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.
  • 63
    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 partition images and AK3 kernel zips
    • Backup and Restore kernel partitions
    • Mount, Map, and Resize vendor_dlkm
    • Save dmesg, logcat, and ramoops
    • Check for kernel updates

    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.

    Depending on the method used, the updated contents of vendor_dlkm may not be immediately available for backup after flash or restore. This can be resolved by unmounting, unmapping, then remapping it.

    AK3 helper modules are not backed up.


    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

    2023-02-20 v1.0.0-alpha13
    7
    This is looking great! My only feedback is that it would be nice if when displaying kernel version it would also show the build # a lot of developers use to show their versions/revisions.

    E.g. 4.19.110+blu-spark-OOS #130

    This is done in my personal build, will be included in the next release. For long kernel strings, you can tap the text to reveal the whole thing. The full string will be included in any new backups, as well.

    Hi , thanks for the great app
    Supports flashing vendor_ dlkm , vendor_ boot img also?..( asking because if yes ..i can restore stock kernel on my p6pro without using a pc)..it could be useful

    Yes, it supports boot, vbmeta, dtbo, vendor_boot, vendor_dlkm, init_boot, and recovery on the devices that include them. For logical partitions (vendor_dlkm), it uses the same method as AK3 to flash it. The note about lptools from my last message applies.
    7
    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.
    7
    There is a bug that affects at least some Pixel 4a and OnePlus 7 Pro users that may force an update sooner than later.
    A test build, v1.0.0-alpha12+tempfs, that fixes this issue is up. I'll make a proper release in the next few days soon.
    7
    A new build is up and the changes are:

    fixed init_boot devices
    added tap to expand for long strings
    bumped lptools

    This defaults to init_boot as the source of the ramdisk, if it is present. As I was typing this, I realized this will break the kernel version search on those devices, so I'll likely need to keep up with both going forward. I'll look into that in the next day or so.