In this article, we are going to learn how to create an updater script for Android or edit a script you already have. An updater-script file is simply a text file that contains all the commands which tell the clockworldmod CWM what to do with a zip file. The updater-script file is written with a scripting language.
To create an updater script you need Notepad++, It’s strongly recommended to use it instead of Notepad. You can download Notepad++ from here and install it on your PC. After downloading Notepad++, open it and from the File Menu select New, create the commands and create your own updater-script.
Warning
We are not responsible for anything that could happen to your phone. If you don’t know what you are doing then go and make some searches. If you wanna go further do it at your own risk and don’t put the finger on us if something goes wrong.
The updater-script is located in Meta-inf/com/google/android/updater-script. Below you will find all the command used in the updater-script file with the explanation what the commands do.
Ui_print. This command prints the word inside the quotations.
Example – ui_print(“xolo – next level”); prints Xolo next level in your cwm recovery.
Mount – This command mounts the partition, so if you want to add files to system partition you have to mount system partition, data for data partition
To mount system – mount(“ext4″, “EMMC”, “/dev/block/mmcblk0p5″, “/system”);
Here mmcblk0p5 is the name of system partition for mtk 6589 chipsets (this name varies from device to device)
To mount data – mount(“ext4″, “EMMC”, “/dev/block/mmcblk0p7″, “/data”); (partition name varies from device to device)
format – This command formats the specified partition.
It is highly recommended to include this command to format system and data if you are making updater-script for ROM
To Format system – format(“ext4″, “EMMC”, “/dev/block/mmcblk0p5″, “0″);(partition name varies from device to device)
To Format data – format(“ext4″, “EMMC”, “/dev/block/mmcblk0p7″, “0″);(partition name varies from device to device)
package_extract_dir(” “, “/”) – This command extracts all the files from the folder mentioned inside first quotation to the partition or directory inside second quotation
For system – package_extract_dir(“system”, “/system”);
(this copies all files from system folder in zip to system partition in phone)
For data – package_extract_dir(“data”, “/data”);
package_extract_file(” “,”/”) – This command extracts the single file inside between the first quotation from zip to the partition or directory inside the second quotation
symlink – This command creates links to its executable files
Here is an example for super su binaries – symlink(“/system/xbin/su”, “/system/bin/su”);
set_perm_recursive – This command sets permission for folders
here android uses Unix permission system
in Unix
4 – read
2 – write
1 – execute
so
rwx is 4+2+1 = 7
rw is 4+2 = 6
rx is 4+1 = 5
Example – set_perm_recursive(0, 0, 0755, 0644, “/system”);
In this 0 is a user id for the owner that refers to root. It means that permission owner for system folder. and 0 is root user means it unrestricted access to the system. it is given in order to run programs to run properly
second 0 also refers to root. but here it refers to group id 0
set_perm – This command sets permission for a specific file
Example – set_perm(1000, 1000, 0640, “/system/etc/bluetooth/auto_pairing.conf”);
here 1000 refers to user id system and 0640 is rw-r—–
and this command sets the permission rw-r—– for the file auto_pairing.conf.
unmount – This command unmounts the partition
Example – unmount(“/system”); – unmounts system.
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…