361 pagesV  1 2 3 4 5 6 > »  
 
REPLY
> Create update.zip patch for firmware through recovery
~ Santino ~
Message#1
20.12.13, 21:40
*******
[offline]

Group: Friendssavagemessiahzine.com
Messages 891
Check in: 25.09.13

Reputation:-  236  +


FAQ �� �������� ����� update.zip ��� �������� ����� �������� download



�������������� Updater-script. ����������, �������, �������, ������� ������.
���������� �� ��������� ��������� � ���������������� ���������� � ������� recovery
�������������� ������������� �������� � �������� ��������� ����������
(keywords)


If an error occurs, state it as accurately as possible (and be sure to post a log) and under the spoiler attach the script code.
But first try to figure it out yourself by doing the suggested actions described under the spoiler."Errors"


I remind you, this is not a table of orders .. Posts asking for a zip for"xxxx"Recovery Offtop
Messages that are not related to the discussion topic (offtopic) are deleted without warning.


Opportunities
  • Add multiple user / system applications "one click" (one patch).
  • Add / remove system applications without root rights and auxiliary programs.
  • Change the firmware (replacing files, decorations, etc.).
  • Update the program or firmware.
  • Remapping memory (discussion in another topic)
  • Getting root rights (Superuser)
Tools and files
Instruments
  1. Installed on the phonecustomrecovery (CWM/TWRP)
  2. NotePad ++(editor with saving Unix format)
  3. Zip_signer (archive subscriber)
  4. ZIP Archiver
  5. Sample.zip blank file (or update-binary for manual build)
    Attached fileZip_signer.rar(13.28 KB)
    Attached filesample-patch.rar(4.77 MB)
    Attached fileupdate-binary.rar(113.25 KB)
  6. Additional versions of the binary.Attached filebinary_all.rar(649.36 KB)
  7. Binary (archive / source)
    Binary (source)
    Binary sources, main link:
    https: //android.google...ootable/recovery/+refs
    We choose for example "android-9.0.0_r18" (the latest build for today), then we look for the folder "updater", in the folder "updater" the source code of the binary

    For examplehttps: //android.google...droid-9.0.0_r18/updater- you can look at all the commands that binaries can execute in android 9.0.0 (in the install.cpp file, at the very bottom)

    © Octanium
  8. Linux Subscriber:Attached filesignapk.zip(9.24 KB)
    + Android update-script (Post Nyashnaya # 63580419)
Attention! Patches are created only for mod.rekovery and effectively work only in them. In the stock recovery (on the devices out of the box) patches do not work.
Software to create update.zip
Automatic Patching Software
  1. The program for creating update.zip - Android Script Creator
    Developer: Octanium
    Interface: Graphic (rus, eng)
    OS: Windows \ Linux \ MAC OS \ Solaris
    Recovery: CWM, TWRP
  2. The program for creating update.zip - Update Zip Creator
    Developer: Shipiloff69
    Interface: Command Line (eng)
    OS: Windows
    Recovery: CWM, TWRP
  3. Auto-generation updater-script
    Sh-script for auto-generation updater-script with all symbolic links and system file permissions. - another script
  4. The program for creating update.zip - ® ZIPme
    Developer: JRummy Apps Inc.
    Interface: Graphic (rus, eng)
    OS: Android
Creature
In order to install new apk system applications into your device, you must perform three steps:
  1. Build your update.zip (from sample.zip)
  2. Sign update.zip with the Zip_signer utility
  3. Throw on the flash drive and install into the device via ClockWorkMod Recovery
These steps are universal, i.e. suitable for other similar operations.

STEP # 1
Build a new update.zip using sample image sample.zip
The procedure for using sample.zip:
  1. Unzip sample.zip archive
  2. Delete signature files META-INF / CERT.RSA, CERT.SF, MANIFEST.MF (as we will create them for our assembly in 2 steps)
  3. Place your custom application in the / data / app folder (xxxxx.apk)
  4. If necessary, edit the updater-script file (more later)
  5. Archive all (META-INF and data) ZIP without compression
STEP №2
Sign update.zip using Zip_signer utility
The procedure for using the utility Zip_signer:
  1. Rename your edited (i.e. already with the application inside) sample.zip to update.zip
  2. Put it in the folder with the program Zip_signer
  3. Run zip_signer.bat file
  4. Wait for the process to complete.
  5. The file update-finished.zip appears in the folder - this is the signed file.
  6. Rename update-finished.zip at its discretion (according to the patch logic)
STEP №3
Installing a new application
  1. Transfer (renamed) update-finished.zip to a flash drive and install it into the device via TWRP or CWM (install zip from sdcard ->chooze zip from internal sdcard ->Yes, install sample.zip)
  2. Reboot machine
Linux Creation
The actions are the same as described above, except for the signature.
ZIP archive signature:
  • Download signapk.zip and unzip to folder<folder signapk>
  • Assign rights to all content - "rwxrwxrwx" (chmod -R 777 ~ /<folder signapk>)
  • We execute the signature program (signapk<archive name with extension>)

A little manual for creating an update script based on system.img and boot.img

Attention! Patches are created only for mod.rekovery and effectively work only in them. In the stock recovery (on the devices out of the box) patches do not work.
Patch structure. . . Editing update-script
Structure
Patch root:
  • folder META-INF
  • folder application installation source (system, data, sdcard, cache, sd-ext)
    Required files:
  • META-INF / com / google / android / update-binary - the system tool for launching this patch, also creates a temporary working folder tmp
  • META-INF / com / google / android / updater-script - executable script for which copy operations take place, etc.
Editing
Let's analyze sample.zip
The patch adds a custom application MyPiano to Data.

Code:
ui_print ("=== Patching new application ===");
ui_print ("");
- displays an inscription and an empty line
run_program ("/ sbin / busybox", "mount", "/ data");- (mounts data) allows access to work with the system partition
package_extract_dir ("data", "/ data");- copies the contents of the data folder to the appropriate folder on the device
set_perm_recursive (1000, 1000, 0771, 0644, "/ data / app");- sets the owner, group and permissions for the contents of the folder on the device (info code below)
run_program ("/ sbin / busybox", "umount", "/ data");- unmounting data
ui_print ("=== Complete ===");- displays a process completion message

busybox- command line application, installed with custom recovery, located in ramdisk / sbin. in custom firmware it is often added to system / xbin

Possible corrections for their own purposes.
  1. Change of rights
    set_perm_recursive (1000, 1000, 0771, 0644, "/ data / app /");
    can be replaced by:
    set_perm (1000, 1000, 0644, "/data/app/mypiano.apk"); - in this case, the rights will change only for the added application
  2. Add system application
    but. root data folder is changed to system
    b. In the updater-script code, the same thing
    at. permissions are assigned via set_perm only for the application being added, for system code 0675 (info on codes below)
  3. Deleting an application / file
    A line like this is added to the code:
    delete ("/ system / app / OldApk.apk");
    Provided that busybox is in a different place, possible replacement
    run_program ("/ sbin / busybox", "mount", "/ data");- on -run_program ("/ system / xbin / busybox", "mount", "/ data");
    or
    mount ("ext4", "EMMC", "/ dev / block / mmcblk0p5"," / data ");- while clarifying the locationblocksection you want

The rules of good form in writing any code is the use of TABs (indents at the beginning of a line).
Example Explanation
At first, this is developed as a habit, and later when viewing a complex code, it makes it very easy to “read” the code, search for necessary information, and visualize sections / steps of the code.
In the example, a simple script in which the main working functions are indented. Those. all the rest is simply for beauty and convenience (they can even be removed).
It is also possible to use double and triple TABs, a good example is writing code for html sites.
show_progress (1.000000, 2);
ui_print ("");
ui_print ("========================================");
ui_print ("---------- Silent AUDIO Patch ----------");
ui_print ("========================================");
ui_print (">Mounting system ... ");
run_program ("/ sbin / busybox", "mount", "/ system");
ui_print (">Copying files ... ");
package_extract_dir ("system", "/ system");
ui_print (">Fixing permissions ... ");
set_perm_recursive (0, 0, 0755, 0644, "/ system / media /");
ui_print (">Unmounting system ... ");
run_program ("/ sbin / busybox", "umount", "/ system");
ui_print ("------- Changing AUDIO Complete --------");
ui_print ("");
Description of the updater-script commands. . . Command Usage Examples
Teams
package_extract_dir
Syntax: package_extract_dir ("<src-dir>", "<dst-dir>");
Copy content<src-dir>at<dst-dir>. Files in<dst-dir>available in<src-dir>overwritten.
Example: package_extract_dir ("system", "/ system");Copies files from the update.zip/system folder to / system

package_extract_file
Syntax: package_extract_file ("<src-file>", "<dst-file>");
Copy file<src-file>at<dst-file>. If file<dst-file>exists, it is overwritten.
Example: package_extract_file ("test.sh", "/tmp/test.sh");Copies the test.sh file from update.zip to /tmp/test.sh

format
Syntax: format ("MTD", "<root>");
Format the partition<root>(see Attachment).
Example: format ("MTD", "system");Fully formatted / system. Note: formatting deletes data irreversibly.
Example 2: format ("ext4", "EMMC", "/ dev / block / mtdblock5", "0", "/ system");
Determining the number of the block under the spoiler "info and materials."

delete
Syntax: delete ("<file1>"[" file2 ", ..." fileN "]);
Deletes file (s)
Example: delete ("/ system / app / Calculator.apk");Delete Calculator.apk from the system / app folder.

delete_recursive
Syntax: delete_recursive ("<dir1>"[" dir2 ", ..." dirN "]);
Recursively deletes the folder (s) with all its contents.
Example: delete_recursive ("/ data / dalvik-cache");Delete the folder / data / dalvik-cache with all its contents.

run_program
Syntax: run_program ("<filetorun>"[, "<opt1>", "<opt2>", "<opt3>"]);
Runs the program (script)<filetorun>.
Example: run_program ("/ tmp / install_busybox.sh");Run the script /tmp/install_busybox.sh.

set_perm
Syntax: set_perm (<uid>, <gid>, <mode>, "<pathtofile>"[ ..." pathtofileN "]);
Sets the owner, group and permissions for a file or folder as ‘chmod’, ‘chown’, and ‘chgrp’ all in one
Example: set_perm (0, 2000, 0550, "/system/etc/init.goldfish.sh");Set owner, group and permissions for the file /system/etc/init.goldfish.sh

set_perm_recursive
Syntax: set_perm_recursive (<uid>, <gid>, <dir-mode>, <file-mode>, "<path>"[, ... "<pathN>"])
Recursively sets the owner, group and permissions for the contents of the folder.<dir-mode>- for folders,<file-mode>- for files.
Example: set_perm_recursive (0, 0, 0755, 0644, "/ system / app");Set permissions for the contents of / system / app, for folders - 0755, for files - 0644.

show_progress
Syntax:show_progress (<fraction>, <duration>);
Promotion progress bar to share<fraction>behind<duration>seconds<duration>may be null for advancing it by the set_progress command, and not by time.
Example: show_progress (0.100000, 1);Increases progress by 0.1 in 1 second.

set_progress
Syntax:set_progress (<fraction>);
Sets the position of the progress bar to the beat.<fraction>, for the most recent invocation of the show_progress command.
Example: set_progress (0.500000);

symlink
Syntax: symlink ("<link target>", "<link-path1 "["<link-path2>", "<link-path3>"]);
Creates a symbolic link (like ‘ln-s’).<link-path>written in root format: path, and<link target>in the format of the target file system (and can be relative).Wikipedia Symlink.
Example: symlink ("/ data / app_s", "/ system / app");Creates a symbolic link to the / data / app_s folder for the / system / app folder

mount
Syntax: mount ("<kind>", "<what>", "<path>");
Mounts<what>let's hit the road<path>. <what>there should be a section name if<kind>this is "MTD", or a block of memory if<kind>this is "vfat"
Example: mount ("MTD", "userdata", "/ data");

unmount
Syntax: unmount ("<path>");
Disables<path>.
Example: unmount ("/ data");

ui_print
Syntax: ui_print ("<message>");
Displays a message<message>
Example: ui_print ("Formatting SYSTEM ...");

sleep
Syntax: sleep (<time>);
Pause process on<time>seconds
Example: sleep (5);- pause 5 seconds, after which the script code is executed further.

wipe data-Read more

Several useful commands to check the version of Android before installing the update
Information on launching shell scripts using updater-script+ moreoption
Android 4.4+ commands
set_metadata / set_metadata_recursive
Syntax: set_metadata (?????);
Sets owner, group and permissions (new command instead of set_perm for andriod 4.4. *)
Examples: Android update-script (Post # 32151495)
Creating a patch update.zip for firmware through recovery (Post kory-vadim # 81945464)

set_metadata / set_metadata_recursive
Syntax:
set_metadata ("file name", "key1", "value1", "key2", "value2", ...)
set_metadata_recursive ("directory name", "key1", "value1", "key2", "value2", ...)
Keys:
* uid
* gid
* mode (set_perm_extd only)
* fmode (set_perm_extd_recursive only)
* dmode (set_perm_extd_recursive only)
* selabel
* capabilities
the first three (uid, gid, mode) are the same as in chmod, filled with "uid", 0, "gid", 1000, "mode", 06754.
To install the firmware, there are three keys "uid", 0, "gid", 1000, "mode", 06754.
Example: set_metadata ("/ system / xbin / shelld", "uid", 0, "gid", 1000, "mode", 06754, "capabilities", 0x0, "selabel", "u: object_r: system_file: s0") ;
set_metadata_recursive ("/ system / xbin", "uid", 0, "gid", 2000, "dmode", 0755, "fmode", 0755, "capabilities", "0x0", "selabel", "u: object_r: system_file: s0 ");

commands for Nexus
block_image_update ("/ dev / block / platform / msm_sdcc.1 / by-name / system", package_extract_file ("system.transfer.list"), "system.new.dat", "system.patch.dat");
Syntax: block_image_update ("Path to section block", package_extract_file ("list of information for a patch (?)"), "image", "patch of an image");
I understand that this is how a highly compressed firmware is flashed (the image of the system).
More ifelse
Example: ifelse (is_mounted ("/ system"), unmount ("/ system")); - if a partition is mounted, a command is given to unmount it, if unmounting something, nothing happens.

Information on set_metadata attributes and similar commands on Android 4.4+
Android update-script (Post blackeangel # 50803606)
Description of where the "u: object_r: uncrypt_exec: s0" and similar attributes come from. . .
Examples
An example of a script that can delete \ move \ backup files and log actions
Android Script Creator (Post Octanium # 51085030)

Temporary Busybox
temporary busybox
It is used when there is no busybox, or so as not to be attached to its location in the system.

package_extract_file ("busybox", "/ tmp / busybox");
set_perm (0, 0, 0777, "/ tmp / busybox");
run_program ("/ tmp / busybox", "mount", "/ data");
...
run_program ("/ tmp / busybox", "unmount", "/ data");

Reboot Commands
reboot
The "reboot" and "reboot into recovery" code, respectively:

run_program ("/ sbin / reboot");

run_program ("/ sbin / reboot", "recovery");

Team for new versions of androidjust read itThisfast.

run_program
run_program
Install BusyBox
File busybox put in / system / xbin
In the updater-script:
set_perm_recursive (0, 2000, 0755, 0755, "/ system / xbin");
set_perm (0, 1000, 0755, "/ system / xbin / busybox");
run_program ("/ system / xbin / busybox", "--install", "-s", "/ system / xbin");

------------------------------------------------------------

...

show_progress / set_progress
set_progress

Example №1 -Android Script Creator (Post Octanium # 44840383)

------------------------------------------------------------

Example 2

When the script runs very quickly (1-4 seconds), I used the following code:
show_progress (1.000000, 3);
Those. for 3 seconds, the progress bar reaches 100% (gradually).
The number "3" is selected as [script installation time] +1 sec, so that the progress bar during installation is guaranteed to move and did not have time to reach 100% before the script is established.

------------------------------------------------------------

...

sleep
sleep

Example №1 -Android Script Creator (Post Octanium # 44840383)

------------------------------------------------------------

...

package_extract_dir
package_extract_dir
Syntax: package_extract_dir ("<src-dir>", "<dst-dir>");
Copy content<src-dir>at<dst-dir>. Files in<dst-dir>available in<src-dir>overwritten.
Example: package_extract_dir ("system", "/ system");Copies files from the update.zip/system folder to / system

package_extract_file
package_extract_file
Syntax: package_extract_file ("<src-file>", "<dst-file>");
Copy file<src-file>at<dst-file>. If file<dst-file>exists, it is overwritten.
Example: package_extract_file ("test.sh", "/tmp/test.sh");Copies the test.sh file from update.zip to /tmp/test.sh

format
format
Syntax: format ("MTD", "<root>");
Format the partition<root>
Example: format ("MTD", "system");Fully formatted / system.Note: formatting deletes data irreversibly.

delete
delete
Syntax: delete ("<file1>"[" file2 ", ..." fileN "]);
Deletes file (s)
Example: delete ("/ system / app / Calculator.apk");Remove Calculator.apk from the system / app folder

delete_recursive
delete_recursive
Syntax: delete_recursive ("<dir1>"[" dir2 ", ..." dirN "]);
Recursively deletes the folder (s) with all its contents.
Example: delete_recursive ("/ data / dalvik-cache");Delete the folder / data / dalvik-cache with all its contents.

set_perm
set_perm
Syntax: set_perm (<uid>, <gid>, <mode>, "<pathtofile>"[ ..." pathtofileN "]);
Sets the owner, group and permissions for a file or folder as ‘chmod’, ‘chown’, and ‘chgrp’ all in one
Example: set_perm (0, 2000, 0550, "/system/etc/init.goldfish.sh")Set owner, group and permissions for the file /system/etc/init.goldfish.sh

set_perm_recursive
set_perm_recursive
Syntax: set_perm_recursive (<uid>, <gid>, <dir-mode>, <file-mode>, "<path>"[, ... "<pathN>"])
Recursively sets the owner, group and permissions for the contents of the folder.<dir-mode>- for folders,<file-mode>- for files.
Example: set_perm_recursive (0, 0, 0755, 0644, "/ system / app")Set permissions for the contents of / system / app, for folders - 0755, for files - 0644.

symlink
symlink
Syntax: symlink ("<link target>", "<link-path1 "["<link-path2>", "<link-path3>"]);
Creates a symbolic link (like ‘ln-s’).<link-path>written in root format: path, and<link target>in the format of the target file system (and can be relative)
Example: symlink ("/ data / app_s", "/ system / app")Creates a symbolic link to the / data / app_s folder for the / system / app folder

mount
mount
Syntax: mount ("<kind>", "<what>", "<path>");
Mounts<what>let's hit the road<path>. <what>there should be a section name if<kind>this is "MTD", or a block of memory if<kind>this is "vfat"
Example: mount ("MTD", "userdata", "/ data");

unmount
unmount
Syntax: unmount ("<path>");
Disables<path>.
Example: unmount ("/ data");

ui_print
ui_print
Syntax: ui_print ("<message>");
Displays a message<message>
Example: ui_print ("Formatting SYSTEM ...");
Errors
Possible errors and their solution

If you know what Recovery, CWM, TWRP is, you know what custom firmwares are and what they eat with, then surely you have come across the fact that the firmware or update is not installed while rendering the "Status #" error.

  • Signature verification failed. Installation aborted- Patches are created only for mod.rekaveri and effectively work only in them. In the stock recovery (on the devices "out of the box") patches do not work. Replace stock recovery with CWM or TWRP.
  • Status 0- this error code arose due to the fact that the updater-script or update-binary file is missing in the firmware or update
  • Status 255- this error code arose due to the fact that the update-binary file does not fit
    In both cases, it is treated the same way, you need to get update-binary from any firmware for your device.
  • Status 1- this error code arose due to the fact that the wrong ways to mount partitions are set
  • Status 4- this error code arose due to the fact that the archive firmware or archive update was designed for an earlier version of CWM (there was used updater-script without update-binary binary).
  • Status 6- a) Indicates that updater-scpript was not created in Unix format, therefore, when installing, Android does not recognize what is written there and gives an error Status 6. To fix this, I advise you to download and install NotePad ++ and change the format;
    b) Syntax error (any character is missing, for example, ";", the letter in the command is missing)
  • Status 7- a) The firmware is not suitable for your device and a different model name is written in the updater-script. Open updater-script and delete the lines containing the name of another model and re-sign the firmware.
    b) through the recovery, first mount the system (mounts & storage - mount / system), then install the patch
    c) Solving the problem with the STATUS 7 error:Sony Ericsson XPERIA neo - CyanogenMod 7 - FreeXperia PROJECT (OS 2.3) (Post # 11599821)
  • line *** col **: syntax error - Syntax error in the line of the code number *** and character number ** (look for where you missed or put an extra character, usually commas and quotes)
  • Symlink: some symlinks failed - Not enough space in the system partition. The patch installs files in the wrong section / block.
  • No space left on device - Not enough space in the system partition. The patch installs files in the wrong section / block.
  • format () expects 4 args got 5 orformat () expects 5 args got 4- [function format () expected X argument, but received Y] - in the content of the format we remove or add the section name, for example("ext4", "EMMC", "/ dev / block / mmcblk0p6","0", "/ system"). "argument" - those data that is written inside the brackets separated by commas.
  • No space left on device- not enough space in the firmware section
  • It does not issue an error, the patch in mod. Recovery works, but the necessary application is not added- see the section heading EDITING UPDATER-SCRIPT ->p.4, or manually mount the necessary section.
  • Please upgrade to latest binaryor..... binary- The update-binary file is not suitable, you need to get update-binary from any firmware for your device.
  • Zip_signer subscriber not working- checkjavaon the computer, update or reinstall.
    "java" is not an internal or external command, executable program or batch file.- error in Zip_signer - install Java,Android update-script (Post Vulcanus # 54856173)

ps: If errors occur frequently in the course of your experiments, try creating the simplest patch first (taking sample.zip as a basis), and then moving on to more complex ones.
This is done primarily to avoid mechanical errors in the process of creating the patch, as well as to check for compatibility with update-binary, compatibility with mod.rekaveri and compliance signature.
Information. . . Related topics. . . Sources. . . suggestions
Info and materials

miscellanea
Sources and thanks
suggestions
If you have noticed errors in the description or there are materials to supplement the article - please report it in the topic or through QMS

I would also like to supplement this manual with other examples and features of patches. In particular, illustrative examples of command execution ** _ progress and symlink.
I will try to do this as you create patches. And if you have the standing materials - also lay out)

In addition to the sample.zip patch, I would like to add a number of other "standard" patches.
For questions of filling and updating the topic header, the Curator is always ready to help you.Trykath

Post has been editedTrykath - 14.04.19, 22:40
Reason for editing: Reboot command for new version of android
sk0t
Message#2
14.12.10, 20:52
Picker APK
********
[offline]

Group: Friendssavagemessiahzine.com
Messages 1935
Check in: 03.12.09
HTC Desire S

Reputation:-  4399  +

Here we will share information onAndroid update-script

Due to the steady transition toEdit update scriptingdecided to cover this topic here
The script itself is locatedupdate.zip/META-INF/com/google/android/updater-script
The script requires a fileupdate.zip/META-INF/com/google/android/update-binary
Attached fileupdate_binary.rar(149.61 KB)

Edit update scripting
show_progress (0.100000, 0);
ui_print ("Mounting SYSTEM ...");
mount ("MTD", "system", "/ system");
show_progress (0.100000, 0);
ui_print ("Extracting files ...");
package_extract_dir ("system", "/ system");
show_progress (0.400000, 0);
ui_print ("Setting permissions ...");
set_perm (0, 0, 0644, "/system/framework/framework-res.apk");
show_progress (0.200000, 0);
ui_print ("Unmounting SYSTEM ...");
unmount ("/ system");
show_progress (0.100000, 0);

Command Description
  • package_extract_dir
    Syntax: package_extract_dir ("<src-dir>", "<dst-dir>");
    Copy content<src-dir>at<dst-dir>. Files in<dst-dir>available in<src-dir>overwritten.
    Example: package_extract_dir ("system", "/ system"); Copies files from the update.zip/system folder to / system

  • package_extract_file
    Syntax: package_extract_file ("<src-file>", "<dst-file>");
    Copy file<src-file>at<dst-file>. If file<dst-file>exists, it is overwritten.
    Example: package_extract_file ("test.sh", "/tmp/test.sh"); Copies the test.sh file from update.zip to /tmp/test.sh

  • format
    Syntax: format ("MTD", "<root>");
    Format the partition<root>(see Attachment).
    Example: format ("MTD", "system"); Fully formatted / system. Note: formatting deletes data irreversibly.

  • delete
    Syntax: delete ("<file1>"[" file2 ", ..." fileN "]);
    Deletes file (s)
    Example: delete ("/ system / app / Calculator.apk"); Delete Calculator.apk from the system / app folder.

  • delete_recursive
    Syntax: delete_recursive ("<dir1>"[" dir2 ", ..." dirN "]);
    Recursively deletes the folder (s) with all its contents.
    Example: delete_recursive ("/ data / dalvik-cache"); Delete the folder / data / dalvik-cache with all its contents.

  • run_program
    Syntax: run_program ("<filetorun>"[, "<opt1>", "<opt2>", "<opt3>"]);
    Runs the program (script)<filetorun>.
    Example: run_program ("/ tmp / install_busybox.sh"); Run the script /tmp/install_busybox.sh.

  • set_perm
    Syntax: set_perm (<uid>, <gid>, <mode>, "<pathtofile>"[ ..." pathtofileN "]);
    Sets the owner, group and permissions for a file or folder as ‘chmod’, ‘chown’, and ‘chgrp’ all in one
    Example: set_perm (0, 2000, 0550, "/system/etc/init.goldfish.sh") Set owner, group and permissions for the file /system/etc/init.goldfish.sh

  • set_perm_recursive
    Syntax: set_perm_recursive (<uid>, <gid>, <dir-mode>, <file-mode>, "<path>"[, ... "<pathN>"])
    Recursively sets the owner, group and permissions for the contents of the folder.<dir-mode>- for folders,<file-mode>- for files.
    Example: set_perm_recursive (0, 0, 0755, 0644, "/ system / app") Set permissions for the contents of / system / app, for folders - 0755, for files - 0644.

  • show_progress
    Syntax: show_progress (<fraction>, <duration>)
    Promotion progress bar to share<fraction>behind<duration>seconds<duration>can be zero to advance it by commandset_progress and not on time.
    Example: show_progress (0.100000, 1) Increases progress by 0.1 in 1 second.

  • set_progress
    Syntax: set_progress (<fraction>)
    Sets the position of the progress bar to the beat.<fraction>for the most recent command invocationshow_progress .
    Example: set_progress (0.500000)

  • symlink
    Syntax: symlink ("<link target>", "<link-path1 "["<link-path2>", "<link-path3>"]);
    Creates a symbolic link (like ‘ln-s’).<link-path>written in root format: path, and<link target>in the format of the target file system (and can be relative)
    Example: symlink ("/ data / app_s", "/ system / app") Creates a symbolic link to the / data / app_s folder for the / system / app folder

  • mount
    Syntax: mount ("<kind>", "<what>", "<path>");
    Mounts<what>let's hit the road<path>. <what>there should be a section name if<kind>this is "MTD", or a block of memory if<kind>this is "vfat"
    Example: mount ("MTD", "userdata", "/ data");

  • unmount
    Syntax: unmount ("<path>");
    Disables<path>.
    Example: unmount ("/ data");

  • ui_print
    Syntax: ui_print ("<message>");
    Displays a message<message>
    Example: ui_print ("Formatting SYSTEM ...");


Info was takenfrom here, from hereandfrom here
The most complete description of commands with exampleshere(En)

################################################################################

Amend update-script - this is a list of commands for the system RECOVERY performed when updating from a format file update.zip
The script is in the folderupdate.zip \ META-INF \ com \ google \ androidand has the following form:
Amend update-script
show_progress 0.1 0

copy_dir PACKAGE: system SYSTEM:

show_progress 0.1 10

Description of commands takenfrom here
Command Description
  • copy_dir
    Syntax: copy_dir<src-dir><dst-dir> [<timestamp>]
    Copy content<src-dir>at<dst-dir>. Files in<dst-dir>available in<src-dir>overwritten.
    Example: copy_dir PACKAGE: system SYSTEM: Copies files from the update.zip/system folder to / system

  • format
    Syntax: format<root>
    Format the section (see attachment)
    Example: format SYSTEM: Fully formatted / system. Note: formatting deletes data irreversibly.

  • delete
    Syntax: delete<file1> [... <fileN>]
    Deletes file (s)
    Example: delete SYSTEM: app / Calculator.apk Delete Calculator.apk from the system / app folder.

  • delete_recursive
    Syntax: delete_recursive<file-or-dir1> [... <file-or-dirN>]
    Recursively deletes files and folders with all contents.
    Example: delete_recursive DATA: dalvik-cache Delete the folder / data / dalvik-cache with all its contents

  • run_program
    Syntax: run_program<program-file> [<args> ...]
    Runs the program (script).
    Example: run_program PACKAGE: install_busybox.sh Run the update.zip/install_busybox.sh script.

  • set_perm
    Syntax: set_perm<uid><gid><mode><path> [... <pathN>]
    Sets the owner, group and permissions for a file or folder as ‘chmod’, ‘chown’, and ‘chgrp’ all in one
    Example: set_perm 0 2000 0550 SYSTEM: etc / init.goldfish.sh Set owner, group and permissions for the file /system/etc/init.goldfish.sh

  • set_perm_recursive
    Syntax: set_perm_recursive<uid><gid><dir-mode><file-mode><path> [... <pathN>]
    Recursively sets the owner, group and permissions for the contents of the folder.<dir-mode>- for folders,<file-mode>- for files.
    Example: set_perm_recursive 0 0 0755 0644 SYSTEM: app Set permissions for the contents of / system / app, for folders - 0755, for files - 0644.

  • show_progress *
    Syntax: show_progress<fraction><duration>
    Shows the progress bar in position<fraction><duration>seconds (or faster if the actual execution speed can be determined).
    Example: show_progress 0.1 0

  • symlink
    Syntax: symlink<link target><link-path>
    Creates a symbolic link (like ‘ln-s’).<link-path>written in root format: path, and<link target>in the format of the target file system (and can be relative)
    Example: symlink / data / app_s SYSTEM: app Creates a symbolic link to the / data / app_s folder for the / system / app folder

Appendix: Section Definitions
ROOT: (Linux block device) / mountpoint / fs size Description.
-----------------------------------------------------------------------------------------------------------------------
BOOT: (/ dev / mtdblock [?]) / (RAM) Raw Kernel - ramdisk and boot config.
DATA: (/ dev / mtdblock5) / data / yaffs2 91904kb User, system config, app config, and apps (without a2sd)
CACHE: (/ dev / mtdblock4) / cache / yaffs2 30720kb OTA cache, Recovery / update config and temp
MISC: (/ dev / mtdblock [?]) N / A Raw - -
PACKAGE: (Relative to package file) N / A - - Pseudo-filesystem for update package.
RECOVERY: (/ dev / mtdblock [?]) / (RAM) Raw [?] Kb ramdisk. BOOT:
SDCARD: (/ dev / mmcblk0 (p1)) / sdcard / fat32 32MB-32GB The microSD card. Update zip is usually here.
SYSTEM: (/ dev / mtdblock3) / system / yaffs2 92160kb The OS partition, static and read-only.
TMP: - / tmp / - - in RAM Standard Linux temporary directory. Cleared on poweroff / reboot.

* About the show_progress, not sure what I correctly understood and described. I would be glad if someone interprets.


Well, perhaps a small chip
Chip
Everyone probably encountered an error
E: Failure at line 1:
copy_dir PACKAGE: system SYSTEM:
Sync data ...
.Installation failed

If you look at sdcard / recovery.log you can see the following:
Finding update package ...
I: Update location: SDCARD: update.zip
Opening update package ...
I: Update file path: /sdcard/update.zip
Verifying update package ...
I: Verified META-INF / CERT.RSA
I: Verified META-INF / MANIFEST.MF
I: Verified META-INF / com / google / android / update-script
I: Verified system / app / Launcher.apk
Installing update ...
I: Parsed META-INF / com / google / android / update-script
calling command copy_dir
Copying files ...
minzip: Can't create target file "/system/app/Launcher.apk": Read-only file system
W: Command copy_dir: couldn't extract "PACKAGE: system" to "SYSTEM:"
E: Failure at line 1:
copy_dir PACKAGE: system SYSTEM:
Sync data ...
.Installation failed

i.esystem mounted in read only mode
If you runFix packages permissions system will be in read-write mode and the update will apply successfully
Now I put the mnt.sh file in each zip for recovery, this content:
#! / sbin / sh

mount -o remount, rw / system;
mount -rw data;

exit 0;

and update-script looks like this:
run_program PACKAGE: mnt.sh
copy_dir PACKAGE: system SYSTEM:



Post has been editedsk0t - 29.11.11, 17:03


--------------------
Winner of the Sixth Prizesavagemessiahzine.comin the "Rescuer 2011" nomination
.: Instructions and tools :.
IAxelfoxI
Message#3
16.12.10, 08:10
Smartstupid
******
[offline]

Group: Friendssavagemessiahzine.com
Messages 530
Check in: 01.08.10
Sony Xperia ZL

Reputation:-  32  +

http://forum.xda-developers.com/showthread.php?t=641223
http://www.londatiga.net/it/how-to-create-...te-zip-package/
here is a couple of references, it is possible to find out everything that is necessary for them


--------------------
2.3.1. Signatures containing:
- any contact information: telephone numbers, website addresses (including abbreviations of references), e-mail, ICQ, etc.
akifjev
Message#4
10.01.11, 00:04
Talk less, work more
******
[offline]

Group: Friendssavagemessiahzine.com
Messages 501
Check in: 21.10.10
Google nexus 5

Reputation:-  111  +

Here is an interestinginformationHow can I completely flip through recovery (even bootloader) through redbend_ua


--------------------
Google Nexus 5 + SlimKat (4.4.4)
Samsung GT-P7500 Galaxy Tab 10.1 XWKHC-Stock + Root + CWM
da_jok3r
Message#5
06.03.11, 18:51
Trance music station
********
[offline]

Group: Friendssavagemessiahzine.com
Messages 1845
Check in: 03.07.10
Samsung Galaxy S8 Exynos

Reputation:-  573  +

What is the difference between update-script and updater-script?
assassin117
Message#6
06.03.11, 21:46
a guest
*
[offline]

Group: Users
Messages 9
Check in: 15.11.10
HTC Desire HD

Reputation:-  0  +

da_jok3r @ 03/06/2011, 18:51*
What is the difference between update-script and updater-script?

look carefully at the contents of the script and you will understand that the script is made using a new technology and basically (as I understand it) serves for firmware (although it may be appropriate for programs)
I read on one site that some phones see only this kind of script
I do not remember the name of this script, so I'm sorry it is better to contact the author of the topic, he should know
sk0t
Message#7
21.07.11, 19:48
Picker APK
********
[offline]

Group: Friendssavagemessiahzine.com
Messages 1935
Check in: 03.12.09
HTC Desire S

Reputation:-  4399  +

Nesud'ba @ 07/21/2011, 13:44*
And yet, it is very necessary, how to copy the / system partition to a USB flash drive using a script ???
Something like this:
updater-script
show_progress (0.100000, 0);
package_extract_file ("copy.sh", "/tmp/copy.sh");
show_progress (0.200000, 0);
set_perm (0, 0, 0777, "/tmp/copy.sh");
show_progress (0.200000, 0);
run_program ("/ tmp / copy.sh");
show_progress (0.400000, 0);
show_progress (0.100000, 0);

copy.sh
#! / sbin / sh

mount -w system
cp -r / system / sdcard / old_sys

Let me remind you that the line break in both files must be LF (UNIX)
and at the end of each empty line


--------------------
Winner of the Sixth Prizesavagemessiahzine.comin the "Rescuer 2011" nomination
.: Instructions and tools :.
LOTOSnnm
Message#8
26.07.11, 20:54
Visitor
**
[offline]

Group: Active users
Messages 23
Check in: 04.12.08
Samsung Galaxy A5 SM-A500

Reputation:-  0  +

aaleo
Message#9
31.08.11, 14:52
Tula gingerbread :)
*******
[offline]

Group: Friendssavagemessiahzine.com
Messages 1154
Check in: 28.04.08
Samsung Galaxy Note 2 GT-N7100

Reputation:-  174  +

Niter43 @ 08/31/2011, 15:21*
And how to fix it? I read that it is necessary to use notepad ++ - I already used it from the very beginning.

notepad ++ ->Menu ->Encodings ->Encode to UTF-8
After that we write a script. :)


--------------------
Samsung Galaxy S - ROM: cm-10-NIGHTLY-galaxysmtd | Core: 3.0.31 | Modem: XXJVT
aaleo
Message#10
12.09.11, 15:58
Tula gingerbread :)
*******
[offline]

Group: Friendssavagemessiahzine.com
Messages 1154
Check in: 28.04.08
Samsung Galaxy Note 2 GT-N7100

Reputation:-  174  +

Loginov916,
Here I change the screen resolution
cat /system/build.prop | sed -e "s / ro.sf.lcd_density =. *. / ro.sf.lcd_density = $ DPI /"> /system/build.prop1
rm /system/build.prop
mv /system/build.prop1 /system/build.prop


From update-script via run_program I call the script to change the build.prop like this:
package_extract_file ("setdpi.sh", "/tmp/setdpi.sh");
set_perm (0, 0, 0755, "/tmp/setdpi.sh");
run_program ("/ tmp / setdpi.sh", "220");


--------------------
Samsung Galaxy S - ROM: cm-10-NIGHTLY-galaxysmtd | Core: 3.0.31 | Modem: XXJVT
finist1
Message#11
06.10.11, 05:13
Veteran
*********
[offline]

Group: Friendssavagemessiahzine.com
Messages 4077
Check in: 04.03.11
Xiaomi Redmi Note 5 3/32

Reputation:-  1840  +

Update for backup proshi under One.

Sometimes it happens that a new prose appears, and there is no place to download it. Ie a person in the service or the store received a request, which is not present anywhere. According to the law of meanness, these people with the new prosh really do not understand the phones, but I want a new want everything. It is very easy to save under One (well, or who sew what). For this:
updater-script
package_extract_file ("copy.sh", "/tmp/copy.sh");
set_perm (0, 0, 0777, "/tmp/copy.sh");
run_program ("/ tmp / copy.sh"); (a binary should support the run program command)
delete ("/ tmp / copy.sh"); (not sure if this command is necessary, tempo and tempo)

copy.sh
#! / sbin / sh

# if sbin is non-working, then we make it out of #! / system / bin / sh or #! / system / xbin / sh depending on where the SH file is located. And in these cases, it is MANDATORY you need to install the systems in the main script before the runes.
For reference, the mount command on my device:
mount ("ext4", "EMMC", "/ dev / block / stl12", "/ system");
mount ("rfs", "EMMC", "/ dev / block / stl12", "/ system");

mount ("ext4", "EMMC", "/ dev / block / stl13", "/ data");
mount ("rfs", "EMMC", "/ dev / block / stl13", "/ data");

mount ("ext4", "EMMC", "/ dev / block / stl14", "/ cache");
mount ("rfs", "EMMC", "/ dev / block / stl14", "/ cache");

mount ("ext4", "EMMC", "/ dev / block / mmcblk0p2", "/ sd-ext");
mount ("vfat", "EMMC", "/ dev / block / mmcblk0p1", "/ sdcard");
Binary should support command mount (there are some that do not support)
###################################################

mkdir / sdcard / Backup
dd if = / dev / block / stl12 of = / sdcard / Backup / system.rfs
dd if = / dev / block / bml8 of = / sdcard / Backup / boot.img
dd if = / dev / block / bml9 of = / sdcard / Backup / recovery.img
dd if = / dev / block / bml4 of = / sdcard / Backup / amss
# (Here you need to know exactly which unit you are responsible for and fill in your own, Ie, you need to find out the units for your device (ramdisk can be used))
cd / sdcard / backup
busybox tar cf PDA.tar boot.img recovery.img system.rfs
md5sum -t PDA.tar >> PDA.tar
mv PDA.tar PDA.tar.md5
cd / sdcard / backup
busybox tar cf Modem.tar amss
md5sum -t Modem.tar >> Modem.tar
mv Modem.tar Modem.tar.md5

After a similar assembly, Onin swears a couple of times but sews. Such an update should be in every header of the past.
Attached filetarmd5.zip(99.46 KB)


Post has been editedfinist1 - 06.10.11, 05:16
finist1
Message#12
18.11.11, 16:00
Veteran
*********
[offline]

Group: Friendssavagemessiahzine.com
Messages 4077
Check in: 04.03.11
Xiaomi Redmi Note 5 3/32

Reputation:-  1840  +

I want to share my work.
On my device, in addition to the two official Recovers, there are three CWM pieces. Some of them contain a command line in / sbin; some are not. There was a question about that the updates containing additional scripts were universal. In order to launch an update, a person did not have to re-arrange the re-search first.
The way out was this:
updater-script
package_extract_dir ("tmp", "/ tmp");
set_perm_recursive (0, 0, 2000, 4777, "/ tmp");

Insert the buzibox and command line into the tempo !!!
run_program ("/ tmp / busybox", "/ tmp / sh", "/ tmp / your script.sh");

delete ("/ tmp / your script.sh", "/ tmp / busybox", "/ tmp / sh");

your script.sh
#! / tmp / busybox sh

And all things;)

This is relevant if there is no command line in the recovery (#! / Sbin / sh) or the inability to access the command line in the systems (#! / System / bin / sh) - formatting-converting, etc.

Post has been editedfinist1 - 18.11.11, 16:14
gwindlord
Message#13
26.12.11, 19:22
Guru
*********
[offline]

Group: Friendssavagemessiahzine.com
Messages 2448
Check in: 11.07.11
Oneplus 5 8/128

Reputation:-  493  +

I wanted to add a little: for the Edify script, there is still the assert command, I did not find its references in this topic. Came across by chance, it looks like this (in this case, test properties that define the phone as HTC Desire HD, respectively, the getprop command also exists):

assert (getprop ("ro.product.device") == "ace" || getprop ("ro.build.product") == "ace" || getprop ("ro.product.board") == "ace ");

well or so for one property:
assert (getprop ("ro.product.device") == "ace");

But in general, as far as I remember from programming, assert is a test command that continues to run further, if the condition specified in it passes, and everything collapses if not (in this case, on another phone, when applying the patch, it will fail with an error, unfortunately I do not remember with what exactly, and by the way having little to do with the "test failed").

Yes, this command is already in the full description of the commands ... Accordingly, if the message is unnecessary, the moderator / curator will delete it, I am not sure.

Post has been editedgwindlord - 26.12.11, 19:31
faplug
Message#14
19.03.12, 00:05
googloman
*********
[online]

Group: Honorary Gameday
Messages 4269
Check in: 24.07.10
Oukitel K6000 Pro

Reputation:-  473  +

Aksidan @ 03/18/2012, 9:07 PM*
Question: Is it possible to do this through the recovery from the official firmware, if so, what did I do wrong?
If such a question was raised, please do not scold, tell me where to look?

Try to sign this set.
Attached fileUpdate_Zip_Packager.zip(541.93 KB)

On my tablet it helped. And by the way, the script will most likely have to be rewritten on Edify.


--------------------
User Moderation - implementation
If a person is bitten by a vampire, he becomes a vampire. It feels like some people have bitten sheep.
affectiosus
Message#15
24.03.12, 08:48
Local
*****
[offline]

Group: Friendssavagemessiahzine.com
Messages 174
Check in: 23.10.11
Xiaomi Redmi Note 3 Pro Prime

Reputation:-  6  +

Aksidan @ 03/23/2012, 11:55*
But still, is the update-binary needed for the Amend script or not?

For Amend, no, for Edify, yes


--------------------
kenzo | RR [email protected] | stock kernel
aksidan
Message#16
17.04.12, 01:41
User
****
[offline]

Group: Friendssavagemessiahzine.com
Messages 60
Check in: 11.10.11

Reputation:-  12  +

Attached fileWork.zip(2.13 MB)
If you need someone, attach a few update.zip
In the UpdateZipCreate folder there are utilities for packaging and signing update.zip
All tested and 100% working on factory recovery 3e
Firmware firmware.

Tel Beeline E300 (Huawei U8500)
U8500 V100R001C278B712 Firmware

Good luck to all.
faplug
Message#17
09.05.12, 20:34
googloman
*********
[online]

Group: Honorary Gameday
Messages 4269
Check in: 24.07.10
Oukitel K6000 Pro

Reputation:-  473  +

GooD_DeviL @ 05/09/2012, 13:27*
Since no one answered about the subscription I will ask so ... Can I sign update.zip so that it can get up through the stock recovery 4.0.3? If so, what?

I signedby thisfor a Chinese tablet and he ate it. Other signatories swore too


--------------------
User Moderation - implementation
If a person is bitten by a vampire, he becomes a vampire. It feels like some people have bitten sheep.
GooD_DeviL
Message#18
09.05.12, 22:52
Local
*****
[offline]

Group: Friendssavagemessiahzine.com
Messages 336
Check in: 08.07.09
Samsung Galaxy Note8 SM-N950F / DS

Reputation:-  5  +

faplug
And what in it where to push? : blush:
Do not share what else you tried to sign? I just tried something with this branch, I started the update, it came to 1/3 and the dead robot: wacko:
faplug
Message#19
09.05.12, 23:56
googloman
*********
[online]

Group: Honorary Gameday
Messages 4269
Check in: 24.07.10
Oukitel K6000 Pro

Reputation:-  473  +

GooD_DeviL @ 05/09/2012, 10:52*
faplug
And what in it where to push?
Do not share what else you tried to sign? I just tried something from this branch, I started the update, it came to 1/3 and the dead robot

Put the finished firmware in the placehere folder, run script.bat? refuse the proposal and select clause 2. everything else led to a signature verification error - verification failed


--------------------
User Moderation - implementation
If a person is bitten by a vampire, he becomes a vampire. It feels like some people have bitten sheep.
GooD_DeviL
Message#20
10.05.12, 13:50
Local
*****
[offline]

Group: Friendssavagemessiahzine.com
Messages 336
Check in: 08.07.09
Samsung Galaxy Note8 SM-N950F / DS

Reputation:-  5  +

faplug
And can you try to sign the archive that I posted above? If not difficult ...
faplug
Message#21
10.05.12, 14:27
googloman
*********
[online]

Group: Honorary Gameday
Messages 4269
Check in: 24.07.10
Oukitel K6000 Pro

Reputation:-  473  +

GooD_DeviL @ 05/10/2012, 1:50 pm*
And can you try to sign the archive that I posted above? If not difficult ...

only in the evening, I will attach to this post

Attached fileupdate.zip(1.43 MB)


In general, the script is confused. And by the way, I was mistaken about the instructions - you need to unpack the firmware into the placehere folder: blush:

Post has been editedfaplug - 10.05.12, 23:21


--------------------
User Moderation - implementation
If a person is bitten by a vampire, he becomes a vampire. It feels like some people have bitten sheep.

361 pagesV  1 2 3 4 5 6 > » 


 mobile version    Now: 05/20/19 08:04