Skip to main content

โš™๏ธ Configs

The updater-script also controls how your installer behaves. Use setdefault commands to customize it.

By default:

setdefault   magisk_support       on
setdefault ensure_rw on
setdefault import_addons off
setdefault apex_mount off
setdefault overwrite_symlinks off
setdefault devices off
setdefault devices_alert on
setdefault dalvik_memory 800M
setdefault extraction_speed 4M
setdefault off_readonly ""
setdefault permissions "0:0:0755:0644"
note
  • All setdefault reads occur long before installation. It is advisable to place them at the beginning of the script (as they come by default) to guarantee fast reading and avoid errors.
  • Although some are modifiable during execution (such as permissions) for flexibility, others that influence directly in the initial execution configuration only consider the value of the first definition within the script.

devices (off)โ€‹

Restrict installation to specific devices (code names or models, separated by :).

setdefault devices "a51nsxx:Pixel 2"  # Only Galaxy A51 and Pixel 2
note

If a supported device is not found, then the installation is aborted early and also, an alert will be printed on the user screen who lists the supported devices.

tip

To know what device it was found, the DEVICE variable can be used. This contains the code or model according to the list defined in the devices configuration.

setdefault devices "ginkgo:a51"

if is_equal $DEVICE "ginkgo"; then
# Actions for ginkgo
elif is_equal $DEVICE "a51"; then
# Actions for a51
fi


devices_alert (on)โ€‹

Enable (on) or disable (off) abort on unsupported devices.

setdefault devices "SM-A515F"
setdefault devices_alert off

if undefined DEVICE; then
ui_print "Device not supported!"
abort
fi
note

It requires manually checking the DEVICE variable to identify when a supported device was not found.


apex_mount (off)โ€‹

Enable (on) or disable (off) /apex mounting with mount_all action.

setdefault apex_mount on  # Mount /apex for dalvikvm tasks
tip

It is necessary when you want to try to use dalvikvm. For example for actions such as dynamic_apktool / sign / run_jar from recovery mode.


dalvik_memory (800M)โ€‹

Limit or expand the memory that is available for dalvikvm. This affects functions such as dynamic_apktool / sign / run_jar.

setdefault dalvik_memory 1000M  # Expand

import_addons (off)โ€‹

Import .sh files from META-INF/addons (on or off).

setdefault import_addons on  # Load all addons alphabetically

magisk_support (on)โ€‹

Control Module (Magisk/KSU) usage: on (dual mode), off (recovery only), force (Module only).

setdefault magisk_support off  # Use updater-script only
note
  • force: Installs via Recovery using customize.sh, like a regular Magisk module. Only for Magisk, other Managers don't support this.
  • off: Installs via Managers (like Magisk/KSU) using updater-script. The module environment ($MODPATH, etc.) is not loaded and it won't be registered as a module, good for one-time scripts.
warning

Even with off, Magisk v28+ and KernelSU will still register it as a module and load the environment ($MODPATH, etc.). This is unavoidable due to their strict Module management, check here.


Allow (on) or skip (off) symlink replacement during extractions with package_extract_file and package_extract_dir actions.

setdefault overwrite_symlinks on
note

Ensures that only the symlink itself is overwritten, and not the source file (in any extraction case).


extraction_speed (5M)โ€‹

Set ZIP extraction speed only when performing these actions: update / write_raw_image

setdefault extraction_speed 5M

ensure_rw (on)โ€‹

Require RW mounts (on) or allow RO (off).

setdefault ensure_rw off  # Allow read-only systems

off_readonly ("")โ€‹

It allows deactivation of the Read/Only protection for specific native functions or variables (specified by name, separated by :) during execution, enabling their replacement.

setdefault off_readonly "TMP:ui_print"  # Allow its re-definition

TMP="My custom value"

ui_print() {
echo My custom ui_print function
}

permissionsโ€‹

Permissions used by default in all native functions that alter/generate files or generate folders.

Default: 0:0:0755:0644 (User:Group:Folder:File)

# New folders: 0 0 755 permissions
# New files: 0 0 777 permissions
setdefault permissions "0:0:755:777"
package_extract_dir tools "$TMP/tools"

# New folders: 0 0 755 permissions
# New files: 0 0 644 permissions
setdefault permissions "0:0:755:644"
package_extract_dir system /system