π Extra Edify References
Simulated Edify actions for users familiar with traditional scripts.
file_getpropβ
Extracts a property from one or more prop files.
Argument | Description |
---|---|
FILE | Prop file(s) to search |
PROP | Property to extract |
# Single file
file_getprop /system/build.prop "ro.build.display.id"
# Multiple files
file_getprop /system/build.prop /vendor/build.prop /system_ext/build.prop "ro.build.display.id"
# Store result
myid=$(file_getprop /system/build.prop "ro.build.display.id")
write_raw_imageβ
Installs .img
or .bin
files to partitions.
Argument | Description |
---|---|
FILE | File to install |
PART | Target partition |
# Install
write_raw_image /sdcard/boot.img $(find_block boot)
# Extract it
write_raw_image $(find_block boot) /sdcard/boot.img
It is recommended to use update
instead.
ifelseβ
Executes an action; if it fails, runs a second action.
Argument | Description |
---|---|
TEST | Action to test |
ELSE | Action to run if test fails |
# Using single quotes for quotes in actions
ifelse "is_mounted /system" 'ui_print "/system isnβt mounted"'
# Preferred syntax
is_mounted /system || ui_print "/system isnβt mounted"
# Multiple actions
if is_mounted /system; then
ui_print "/system already mounted"
ui_print "Done"
else
ui_print "/system isnβt mounted"
ui_print "ERROR"
fi
greater_than_intβ
Checks if a number is greater than another (supports decimals).
Argument | Description |
---|---|
NUM1 | First number |
NUM2 | Second number |
if greater_than_int "2.2" "1.5"; then
ui_print "Is greater"
else
ui_print "Is less or equal"
fi
less_than_intβ
Checks if a number is less than another (supports decimals).
Argument | Description |
---|---|
NUM1 | First number |
NUM2 | Second number |
if less_than_int "1.5" "2"; then
ui_print "Is less"
else
ui_print "Is greater or equal"
fi
concatβ
Concatenates multiple strings.
Argument | Description |
---|---|
STRING | Strings to concatenate (multiple allowed) |
var="just test"
result=$(concat "h u h" "$var" " a ")
stdoutβ
Redirects all output (including errors) of an action to stdout.
Argument | Description |
---|---|
ACTION | Action to execute |
# Redirect stderr to stdout
stdout echo2 uwu
Does not guarantee screen output; use stdprint
for that.
stderrβ
Redirects all output of an action to stderr.
Argument | Description |
---|---|
ACTION | Action to execute |
# Print as error
stderr echo uwu
stdprintβ
Prints an actionβs stdout to the screen in recovery.
Argument | Description |
---|---|
ACTION | Action to execute |
# Print to screen
stdprint echo uwu
# Visualize process
stdprint apktool --help
read_fileβ
Gets the contents of one or more files.
Argument | Description |
---|---|
FILE | File(s) to read |
read_file "$TMP/file.txt"
# Native alternative
cat "$TMP/file.txt"
run_programβ
Executes a file (sh or binary) with arguments, auto-setting execution permissions.
Argument | Description |
---|---|
PROG | Program to run |
ARG | Arguments (multiple allowed) |
run_program "$TMP/busybox" --help
symlinkβ
Creates symbolic links from a file.
Argument | Description |
---|---|
FILE | Source file |
LINK | Symlink(s) to create (multiple allowed) |
# Create symlinks to busybox
symlink "$TMP/busybox" "$TMP/chmod" "$TMP/sed" "$TMP/tar"
convert_edifyβ
Converts Edify scripts to Dynamic Installer format (experimental).
Argument | Description |
---|---|
SRC | Edify script path |
DEST | Output path (optional, overwrites SRC if omitted) |
# Convert with output
convert_edify "/sdcard/edify-script" "/sdcard/result"
# Overwrite source
convert_edify "/sdcard/edify-script"
Manually review the result; not definitive.