自学android刷机包,Android刷机包解包打包
作者:ghostry
發布時間:2018-02-04
瀏覽: 3935
轉載注明出處: https://blog.ghostry.cn/technique/852.html
#安裝命令
sudo apt-get install android-tools-adb android-tools-fastboot android-tools-fsutils abootimg
#每個工具的用途,根據需要安裝
android-tools-adb
Android Debug Bridge CLI tool
android-tools-fastboot
Android Fastboot protocol CLI tool
android-tools-fsutils
Android ext4 utilities with sparse support
abootimg
Tool to read/write/update android boot images
system.img有可能有幾種格式。Android sparse image,Linux rev 1.0 ext4 filesystem data,sfs
Ubuntu下有轉化工具。//sparse image轉化成為ext4的raw imge
Usage: simg2img
//ext4的raw image to sparse image
Usage: img2simg []
ext4文件格式的可以直接mountmount system.img /mnt/system
掛載后修改完umount
如果原來就是ext4直接用就好,如果原來是sparse就轉換一下。
sfs格式的也可以直接掛載mount -o loop system.sfs
掛載后可以看到里邊有一個ext4格式的鏡像,再次掛載就好了。
boot.img是文件組合在一起的。使用abootimg工具可以解包打包。
操作命令mkdir boot && cd boot
abootimg -x ../boot.img
得到這三個文件 :bootimg.cfg initrd.img zImage
initrd.img文件的解包file initrd.img
initrd.img: gzip compressed data, from Unix #可以看到是一個gzip的壓縮文件
下面是解壓initrd.img文件的命令mkdir initrd
cd initrd
cat ../initrd.img | gunzip | cpio -vid
解壓上面的initrd.img后,可以看到非常多的文件
上面編輯完后,重新打包命令如下cd initrd
find . | cpio --create --format='newc' | gzip -9 > ../myinitd.img
新寫打包boot.imgabootimg --create myboot.img -f bootimg.cfg -k zImage -r myinitrd.img
下面的命令可以打印出myboot.img文件中的config信息abootimg -i myboot.img
iptables端口映射后php獲取客戶端ip問題
下一篇:?用docker安裝gitlab
總結
以上是生活随笔為你收集整理的自学android刷机包,Android刷机包解包打包的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: html颜色渐变讲解,20个网页设计中渐
- 下一篇: android sina oauth2.