Foreword Updater-script is the script file that the Android phone brushes into the system, it decides which content the Android system needs to brush into, how to brush in.
Syntax 1. Mount Syntax: Mount (Fs_type, Partition_type, location, Mount_point). Role: Mounts a file system to the specified mount point. Return value: The mount point was successfully returned, and the failure returned null. Description
- Fs_type: "YAFFS2" or "EXT4"
- Partition_type: "MTD" or "EMMC"
- Location: partition (partition) or drive (device)
- Mount_point: Mount the destination folder of the file system
Example: Mount ("Ext4", "EMMC", "/dev/block/mmcblk0p8", "/system");
2. Unmount syntax: unmount (mount_point). Function: Unlocks the file system mount. Return value: The mount point was successfully returned, and the failure returned null. Example: Unmount ("/system");
3. Format syntax: Format (fs_type, Partition_type, location) functions: Formats the specified file system description:
- Fs_type: "YAFFS2" or "EXT4"
- Partition_type: "MTD" or "EMMC"
- Location: partition or drive
Example: Format ("Ext4", "EMMC", "/cache");
4. Delete syntax: Delete (File1, file2, ..., filen): Deletes the file. Variable length parameter, supports deleting multiple files. Example: Delete ("/tmp/boot.img");
5. Delete_recursive Syntax: delete_recursive (<path>) function: Delete the directory recursively. Example: Delete_recursive ("/data/media/appstorewidget")
6. Show_progress Syntax: show_progress (fraction, duration) function: Displays the progress bar for the following program operation in recovery. The progress bar will advance fraction according to duration. Description
- Fraction: Progress Completion value
- Duration: Total number of seconds
Example: Show_progress (0.950000, 50); (The operation after ps:show_progress may take 0.95s, the progress bar progresses after completion 50%)
7. Package_extract_dir Syntax: Package_extract_dir (Package_path, Destination_path); function: Release the card in the brush package Package_ The contents of path to Destination_path. Example: Package_extract_dir ("System", "/system"); (PS: Releases all files and subfolders under the System folder in the ROM package to/system)
8. Package_extract_file Syntax: Package_extract_file (File_path, Destination_path); function: Extracts a single file from the ROM package to the specified destination directory. Example: Package_extract_file ("boot.img", "/tmp/boot.img");
9. Symlink Syntax: symlink (target, Src1, SRC2, ...); Role: Establish a symbolic link to target src1, src2 ... Description
- Target: Symbolic link target
- SRC1: The symbolic link target point to create
Example: Symlink ("Mksh", "/system/bin/sh");
Set_perm syntax: set_perm (UID, GID, mode, file1, File2, ..., filen); role: Set permissions for a single file or multiple files. Description
- UID: User ID
- GID: User group ID
- Mode: Permissions
- File1: The file path that needs to be set
Example: Set_perm (0, 3004, 02755, "/system/bin/ping");
Set_perm_recursive syntax: set_perm_recursive (UID, GID, Dir-mode, file-mode, path); function: Sets the permissions for the files in the specified folder and folder. Example: set_perm_recursive (0, 0, 0755, 0644, "/system");
Ui_print Syntax: ui_print ("str"): Recovery prints out the contents of the STR string, similar to System.out.println () in Java; example: Ui_print ("+++++++++++++ ++++++++++++++++++++++++++++++++");
Run_program Syntax: Run_program (path, arg1, ..., ArgN) function: Executes the program with the specified parameters. Description
- Path: The path of the program to execute
- ARG1: Run parameter information
Example: Run_program ("/sbin/busybox", "Mount", "/system");
Write_raw_image syntax: write_raw_image (File_path, partition); Description:
- File_path: img Source file to read
- Partition: Destination partition to write to the img file
Example: Write_raw_image ("/tmp/boot.img", "bootimg");
Assert syntax: Assert (Condition1, ..., conditionn); function: Terminates the run of the script if the condition evaluates to False. Example: Assert (Package_extract_file ("boot.img", "/tmp/boot.img"), Write_raw_image ("/tmp/boot.img", "bootimg"), Delete (" /tmp/boot.img "));
Android Brush Machine Script--updater-script