Skip to main content

πŸ“œ Extra Edify References

Simulated Edify actions for users familiar with traditional scripts.


file_getprop​

Extracts a property from one or more prop files.

ArgumentDescription
FILEProp file(s) to search
PROPProperty 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.

ArgumentDescription
FILEFile to install
PARTTarget partition
# Install
write_raw_image /sdcard/boot.img $(find_block boot)

# Extract it
write_raw_image $(find_block boot) /sdcard/boot.img
warning

It is recommended to use update instead.


ifelse​

Executes an action; if it fails, runs a second action.

ArgumentDescription
TESTAction to test
ELSEAction 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).

ArgumentDescription
NUM1First number
NUM2Second 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).

ArgumentDescription
NUM1First number
NUM2Second 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.

ArgumentDescription
STRINGStrings 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.

ArgumentDescription
ACTIONAction to execute
# Redirect stderr to stdout
stdout echo2 uwu
note

Does not guarantee screen output; use stdprint for that.


stderr​

Redirects all output of an action to stderr.

ArgumentDescription
ACTIONAction to execute
# Print as error
stderr echo uwu

stdprint​

Prints an action’s stdout to the screen in recovery.

ArgumentDescription
ACTIONAction to execute
# Print to screen
stdprint echo uwu

# Visualize process
stdprint apktool --help

read_file​

Gets the contents of one or more files.

ArgumentDescription
FILEFile(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.

ArgumentDescription
PROGProgram to run
ARGArguments (multiple allowed)
run_program "$TMP/busybox" --help

Creates symbolic links from a file.

ArgumentDescription
FILESource file
LINKSymlink(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).

ArgumentDescription
SRCEdify script path
DESTOutput path (optional, overwrites SRC if omitted)
# Convert with output
convert_edify "/sdcard/edify-script" "/sdcard/result"

# Overwrite source
convert_edify "/sdcard/edify-script"
warning

Manually review the result; not definitive.