修改Android boot.img

本文介绍了两种操作Android设备boot.img文件的方法:一种是通过手动拆解和重构;另一种是利用第三方工具简化整个过程。文章详细说明了每一步的操作细节,并提供了一些调试建议。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一 大概流程

1)  From running boot.img
 
- retrieve boot.img from device using dd on the LNX partition
- use umkbootimg to explode it
- unzip initramfs and then cpio to get the default.prop, init.rc, init.trace.rc, etc.
- change desired files
- use mkbootimg to rebuild a RENAMED bootXX.img
- adb reboot bootloader
- fastboot boot ./bootXX.img to load the image without writing to flash
- IF it comes up, check to make sure props and init is run okay ELSE powercycle to boot flashed boot.img
- Once the new image is soaked write the new image to flash: fastboot flash boot bootXX.img
 
2) From local build area
- GIT clone the android area
- change the desired files, 
- do a "make bootimage" to build boot.img
- save the running boot.img as above
- follow steps above to fastboot your private image, soak it and then flash it.
 
 用第一种流程。
 

二 具体流程

参考:

  http://www.imajeenyus.com/computer/20130301_android_tablet/android/unpack_repack_recovery_image.html

  http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images#Background

  有照着这两篇的方法做。但我重新压缩出来的img是不对的。原img有14.5M,我重新打包后只有8M,fastboot flash进去无法启动。肯定有参数没有指定对。但具体的实现就是这样。

 

三 简单可行的方法

  用xda上提供的简单工具直接pack/unpack

  http://forum.xda-developers.com/showthread.php?t=2073775

  https://github.com/OrenHg/Android-Image-Kitchen/tree/AIK-Linux

  直接可用。

转载于:https://www.cnblogs.com/blowing-in-the-wind/p/5684524.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值