如何对system.img和userdata.img解包,再重新打包
1个回答
2016-10-20 · 知道合伙人软件行家
关注
展开全部
选择对应的版本:
cd extras
git checkout android-4.1.1_r1
编译 simg2img:
cd ext4_utils
gcc -o simg2img -lz sparse_crc32.c simg2img.c
拆包android镜像文件:
cd ../../
./extras/ext4_utils/simg2img system.img system.raw.img
./extras/ext4_utils/simg2img userdata.img userdata.raw.img
通过mount挂载镜像(Mac osx系统可以使用Paragon's ExtFS):
mkdir /mnt/my_system /mnt/my_userdata
mount -t ext4 -o loop userdata.raw.img /mnt/my_userdata
编译 make_ext4fs:
cd extras/ext4_utils
gcc -o make_ext4fs -lz make_ext4fs_main.c make_ext4fs.c ext4fixup.c ext4_utils.c allocate.c backed_block.c output_file.c contents.c extent.c indirect.c uuid.c sha1.c sparse_crc32.c wipe.c
重新打包镜像:
cd ../../
PATH="$PATH:$(pwd)/extras/ext4_utils/make_ext4fs" ./extras/ext4_utils/mkuserimg.sh -s /mnt/my_system_dir my_system.img ext4 /tmp 512M
cd extras
git checkout android-4.1.1_r1
编译 simg2img:
cd ext4_utils
gcc -o simg2img -lz sparse_crc32.c simg2img.c
拆包android镜像文件:
cd ../../
./extras/ext4_utils/simg2img system.img system.raw.img
./extras/ext4_utils/simg2img userdata.img userdata.raw.img
通过mount挂载镜像(Mac osx系统可以使用Paragon's ExtFS):
mkdir /mnt/my_system /mnt/my_userdata
mount -t ext4 -o loop userdata.raw.img /mnt/my_userdata
编译 make_ext4fs:
cd extras/ext4_utils
gcc -o make_ext4fs -lz make_ext4fs_main.c make_ext4fs.c ext4fixup.c ext4_utils.c allocate.c backed_block.c output_file.c contents.c extent.c indirect.c uuid.c sha1.c sparse_crc32.c wipe.c
重新打包镜像:
cd ../../
PATH="$PATH:$(pwd)/extras/ext4_utils/make_ext4fs" ./extras/ext4_utils/mkuserimg.sh -s /mnt/my_system_dir my_system.img ext4 /tmp 512M
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询