To unpack and modify the original system.img file it’s not so complicated and in this post, we will walk you through a step by step guide how to do it. The original system.img file, like the Google factory image represents a sparsed ext4 loop mounted the file system.
It is mounted on the /system of your Android device. Not all the system images are an ext4 file. It might be for example a system file yaffs2. This is completely another thing so:
This method will work only on ext4 file systems. Do not try to extract any other file system.
Below is a way how a system image file is mounted on a Nexus device:
- /dev/block/platform/omap/omap_hsmmc.0/by-name/system /system ext4 ro,realtime,barrier=1,data=ordered 0 0″
Prerequisites:
- Linux box or virtual machine
- simg2img, make_ext4fs binaries which can be downloaded from here.
Guide:
Place the system.img and the 2 binaries in one directory and make sure that binaries have exec permission.
Step 1: Mount the file system.
- mkdir sys
- 2. ./simg2img system.img sys.raw
- 3. sudo mount -t ext4 -o loop sys.raw sys/
Then you will have all your system partition mounted in ‘sys’ and you can modify whatever you want in ‘sys’. You can deodex apk and frameworks jars for example.
Step 2: Create a new flashable system image.
- sudo ./make_ext4fs -s -l 512M -a system new.img sys/
- sudo umount sys
- rm -fr sys
Now simply you have to type ‘fastboot flash system new.img’
Note: You have to use the correct size for your new system image. Use tune2fs -l sys.raw and ‘Block count’, ‘Block size’ for making ext4fs -s parameters. you also can use ;cat/proc/partitions/ andyour device will find out the correct size.
If you have a Samsung Galaxy device and it doesn’t support fastboot, you can use heimdall instead.
Related posts
7 Online Tools To Record Lectures [2023]
The educational environment seems a lot different compared to a few years ago, with technology bringing major changes. Are you as a lecturer or a learner up to date with the apps and software that can make your life a little easier, for example catering…
Should You Take Mobile Security Seriously? Here Is Why
Gone are the days when the biggest security threats only existed on your computer. Most people think that a cell phone can be a safe space for personal, financial as well as confidential data. However, nowadays with the extensive use of cell phones for literally…
The Best Android Apps To Download This Year [2020]
As our mobile phones have become an essential part of our lives in this technologically advanced world of ours, we have found more ways in which we can use them. Some people stick to the traditional methods of calling and texting, while others venture into…
The Best Photo Editing Apps That You Need to Increase Your Instagram Followers
Instagram is probably the most used social media network nowadays. For some people, it’s just a simple a place to share photos and try to impress the other with the “good life” they have while some others have discovered the power of Instagram and run…
Comparison Of Smart Watches – Apple Watch 8 vs Google Pixel Watch
Since the introduction of smartwatches in the market, people have started to rely more on them because of their convenience. You can use smartwatches to receive notifications, make and receive calls, and access various apps. Smartwatches are not just about looking at the time; they…
Why You Should Use a Personal VPN on a Daily Basis
Personal VPN is one of those technologies which is gaining more and more popularity and importance from day to day. Generally, VPN (Virtual Private Network) was designed to get a secure connection for business purposes mainly. Now, the role of VPNs has changed a lot….
Best Instagram Usernames For Boys and Girls To Get More Followers in 2019 (Updated)
If you are an Instagram user, you have to agree that there is nothing as cool as a catchy name. The importance of a good and unique Instagram name is something that can’t be ignored. The username determines who follows you, the comments that are…
How IoT is Influencing App Development
As you leave your office for the day, you tap an app on your phone and start your car. Another app allows you to turn on lights at your house, maybe even get dinner started. Welcome to IoT, the Internet of Things, in which an…