[Android Software/Hacking General [Developers Only]] amarullz:
CONFIGURATION FUNCTIONS

setcolor

Descriptions:

Set AROMA Installer Color Scheme. It can also defined in themes with theme.prop file
​

Sintax:

void setcolor(colorname, hexcolor);

​

Parameters:

colorname - Name of color to be set. colorname with "_g" for gradient color.

winbg, winbg_g : Main/Top Most Window Backgroud

winfg : Main/Top Most Window Text Foreground

winfg_gray : Main/Top Most Window Gray Text Foreground

dialogbg, dialogbg_g : Popup Window Backgroud (Alert, Confirm, About)

dialogfg : Popup Window Text Foreground

textbg, textbg_g : Textbox, Checkbox, and any scrollable UI Background

textfg : Textbox, Checkbox, and any scrollable UI Text Foreground

textfg_gray : Gray Text ( on Optionbox/Checkbox Item Description )

controlbg, controlbg_g : Control / Button / Checkbox border - Background Color

controlfg : Button Text Color

selectbg, selectbg_g : Selected Element Background ( Pushed/focused Button/items, etc )

selectfg : Selected Element Text/Foreground Color

titlebg, titlebg_g : Window Title Background

titlefg : Window Title Text Foreground Color

navbg, navbg_g : Bottom Bar (Navigation Bar) Background. Next-Previous Area

scrollbar : Scrollbar indicator color

border, border_g : Common Border Color

progressglow : Progress Animation Color

hexcolor - Hexadecimal Color in RGB. it support 3 and 6 characters hexadecimal started with #. example: "#a8e" or "#ff5599".

Return Value:

none
​

Examples:

# Set Color with 3 chars hexcolor
setcolor("winbg", "#444");
setcolor("winbg_g", "#222");
setcolor("textbg", "#333");
setcolor("textfg", "#fff");

# Set Color with 6 chars hexcolor
setcolor("textfg_gray", "#bbbbbb");
setcolor("controlbg", "#446699");
setcolor("controlbg_g", "#223355");

ini_set

Descriptions:

Sets the value of a AROMA Installer configuration option
​

Sintax:

void setcolor(configname, newvalue);

​

Parameters:

configname - Configuration name to be set.

roundsize : Set Corner size of rounded rectangle for common controls (default:"3")

button_roundsize: Set Corner size of rounded rectangle for button controls (default:"2")

window_roundsize : Set Corner size of rounded rectangle for main window (default:"4")

transition_frame : Set number of frames for transition (default:"5")

text_ok : Set text for common OK text (default:"OK")

text_next : Set text for wizard next button (default:"Next >")

text_back : Set text for wizard back button (default:"< Back")

text_yes : Set text for default yes button (default:"Yes")

text_no : Set text for default no button (default:"No")

text_about : Set text for About menu (default:"About & Informations")

text_calibrating : Set text for Calibration Menu (default:"Calibrating Tools")

text_quit : Set text for Quit Menu (default:"Quit Installation")

text_quit_msg : Set text for Quit Confirmation Message (default:"Are you sure to quit the Installer?")

rom_name : Set ROM Name Information

rom_version : Set ROM Version Information

rom_author : Set ROM Author Information

rom_device : Set ROM Device Information

customkeycode_up : Set Alternative keycode for up key (navigate up)

customkeycode_down : Set Alternative keycode for down key (navigate down)

customkeycode_select : Set Alternative keycode for select key (select an item)

customkeycode_back : Set Alternative keycode for back key

customkeycode_menu : Set Alternative keycode for menu key

newvalue - New value to be set for configname

Return Value:

none
​

Examples:

# Set ROM Informations
ini_set("rom_name", "AROMA ROM");
ini_set("rom_version", "1.0");
ini_set("rom_author", "amarullz");
ini_set("rom_device", "HTC Desire (bravo)");

# Set Custom Text
ini_set("text_ok", "OK Man");
ini_set("text_next", ">>");
ini_set("text_back", "<<");

# Set Alternative Key Code - You can use keycapture tool
# to capture your device keycode
ini_set("customkeycode_up", "115");
ini_set("customkeycode_down", "114");
ini_set("customkeycode_select", "116");
ini_set("customkeycode_menu", "229");
ini_set("customkeycode_back", "158");

calibrate

Descriptions:

Set Touch Screen Calibration Data. Different device may had different touch screen calibration data. To get calibration data, press menu, select calibration tools then follow the intructions.
​

Sintax:

void calibrate(divx, addx, divy, addy [, alternative_method]);

​

Parameters:

divx - Division value for horizontal touchscreen to display resolution.

addx - Add value for horizontal alignment.

divy - Division value for vertical touchscreen to display resolution.

addy - Add value for vertical alignment.

alternative_method [Optional] - Use alternative method for touch screen handling if normal method not works in your device (default:"no")

Return Value:

none
​

Examples:

# HTC Desire Calibrated Data
calibrate("7.90","20","7.90","20");

# Alternative method Calibrated Data
calibration("1.8447", "37", "1.2158", "27", "yes");

calibtool

Descriptions:

Start calibration tool.
​

Sintax:

void calibtool(dummy_arguments);

​

Parameters:

dummy_arguments - Edify should pass at least 1 arguments. Just Pass "" for it

Return Value:

none
​

Examples:

# Start Calibrating Tools
calibtool("");

theme

Descriptions:

Set AROMA Installer Theme will be used in next display.
​

Sintax:

void theme(theme_name);

​

Parameters:

theme_name - Theme Name will be used. It was theme directory name located in "META-INF/com/google/android/aroma/themes"

Return Value:

none
​

Examples:

# Use ICS Theme located at:
# META-INF/com/google/android/aroma/themes/ics
theme("ics");

VARIABLE FUNCTIONS

getvar

Descriptions:

Get Variable
​

Sintax:

variable_value getvar(varname);

​

Parameters:

varname - Variable Name

Return Value:

Variable Value
​

Examples:

# Show "testvar" value in alert
alert(
"Value of testvar",
getvar("testvar")
);

setvar

Descriptions:

Set Variable
​

Sintax:

void setvar(varname, value);

​

Parameters:

varname - Variable Name to be set

value - New Value for Variable

Return Value:

none
​

Examples:

# Set new value for "testvar"
setvar("testvar", "This is only test!!");

# Now Show the "testvar" value in alert
alert(
"Value of testvar",
getvar("testvar")
);

appendvar

Descriptions:

Append new value after previous value, it's like concating strings ( previous_value + newvalue )
​

Sintax:

void appendvar(varname, value);

​

Parameters:

varname - Variable Name to be set

value - New Value to be appended in variable

Return Value:

none
​

Examples:

# Set new value for "testvar"
setvar("testvar", "This is only test!!");

# Append new value
appendvar("testvar", "Add String");

# "testvar" now will contain "This is only test!!Add String"

prependvar

Descriptions:

Prepend new value before previous value, it's like concating strings ( newvalue + previous_value )
​

Sintax:

void prependvar(varname, value);

​

Parameters:

varname - Variable Name to be set

value - New Value to be prepended in variable

Return Value:

none
​

Examples:

# Set new value for "testvar"
setvar("testvar", "This is only test!!");

# Prepend new value
prependvar("testvar", "Add String!! ");

# "testvar" now will contain "Add String!! This is only test!!"

PROP FILE HANDLER FUNCTIONS

file_getprop

Descriptions:

Read prop file value for given keyname
​

Sintax:

prop_value file_getprop(filename, keyname);

​

Parameters:

filename - Absolute path of prop file in filesystem

keyname - Prop Key Name

Return Value:

Value of prop for given keyname
​

Examples:

# Get value of "item.1.1" from /tmp/aroma-data/custom.prop
alert(
"Value of Prop",
file_getprop("/tmp/aroma-data/custom.prop", "item.1.1")
);

prop

Descriptions:

Same with file_getprop, but will read relatively from AROMA Temporary Directory "/tmp/aroma-data/"
​

Sintax:

prop_value prop(filename, keyname);

​

Parameters:

filename - Relative path of prop file in AROMA Temporary Directory "/tmp/aroma-data/"

keyname - Prop Key Name

Return Value:

Value of prop for given keyname
​

Examples:

# Get value of "item.1.1" from /tmp/aroma-data/custom.prop
alert(
"Value of Prop",
prop("custom.prop", "item.1.1")
);

zipprop

Descriptions:

Same with file_getprop, but will read the prop file from Zip
​

Sintax:

prop_value zipprop(zip_path, keyname);

​

Parameters:

zip_path - Absolute path of prop file in Zip ( don't add "/" in first character )

keyname - Prop Key Name

Return Value:

Value of prop for given keyname
​

Examples:

# Get value of "item.1.1" from META-INF/com/google/android/aroma/custom.prop
alert(
"Value of Prop",
zipprop("META-INF/com/google/android/aroma/custom.prop", "item.1.1")
);

resprop

Descriptions:

Same with zipprop, but will read the prop file from Zip relatively from AROMA Resource Directory "META-INF/com/google/android/aroma/"
​

Sintax:

prop_value resprop(zip_path, keyname);

​

Parameters:

zip_path - Relative path of prop file in Zip from AROMA Resource Directory "META-INF/com/google/android/aroma/"

keyname - Prop Key Name

Return Value:

Value of prop for given keyname
​

Examples:

# Get value of "item.1.1" from META-INF/com/google/android/aroma/custom.prop
alert(
"Value of Prop",
resprop("custom.prop", "item.1.1")
);

sysprop, property_get

Descriptions:

Read system property value for given keyname
​

Sintax:

prop_value property_get(keyname);

prop_value sysprop(keyname);

​

Parameters:

keyname - Prop Key Name

Return Value:

Value of prop for given keyname
​

Examples:

# Get Device Board Name
alert(
"Device Board Name",
sysprop("ro.product.board")
);

# Get Board Platform
alert(
"Device Board Name",
property_get("ro.board.platform")
);

FILESYSTEM FUNCTIONS

writetmpfile

Descriptions:

Write string into file in AROMA temporary
​

Sintax:

void writetmpfile(filename, value);

​

Parameters:

filename - Destination file in AROMA temporary directory

value - String that will be write into the file

Return Value:

none
​

Examples:

# It will saved in from /tmp/aroma-data/test.txt
writetmpfile("test.txt", "This is test text");

# Show the content in alert with readtmpfile
alert(
"Value of test.txt",
readtmpfile("test.txt")
);

# Show the content in alert with read
alert(
"Value of test.txt",
read("/tmp/aroma-data/test.txt")
);

write

Descriptions:

Write string into file in filesystem
​

Sintax:

void write(filename, value);

​

Parameters:

filename - Absolute path to Destination file

value - String that will be write into the file

Return Value:

none
​

Examples:

# It will saved in from /sdcard/test.txt
writetmpfile("/sdcard/test.txt", "This is test text");

# Show the content in alert with read
alert(
"Value of test.txt",
read("/sdcard/test.txt")
);

readtmpfile

Descriptions:

Read string from file in AROMA temporary directory
​

Sintax:

content_of_file readtmpfile(filename);

​

Parameters:

filename - File in AROMA temporary directory that will be readed

Return Value:

Content of file in String
​

Examples:

# It will read data from /tmp/aroma-data/test.txt
# then save it in variable
setvar(
"testvar",
readtmpfile("test.txt")
);

read

Descriptions:

Read string from file in filesysten
​

Sintax:

content_of_file read(filename);

​

Parameters:

filename - Absolute path to Destination file that will be readed

Return Value:

Content of file in String
​

Examples:

# It will read data from /sdcard/test.txt
# then save it in variable
setvar(
"testvar",
read("/sdcard/test.txt")
);

ZIP CONTENT HANDLING FUNCTIONS

readfile

DEPRECATED!!! - Identical with zipread. Will be deleted soon.
​

readfile_aroma

DEPRECATED!!! - Identical with resread. Will be deleted soon.
​

zipread

Descriptions:

Read string from file in zip
​

Sintax:

content_of_file zipread(zip_path);

​

Parameters:

zip_path - Absolute path to Destination file in zip that will be readed

Return Value:

Content of file in String
​

Examples:

# It will read data from zip content "META-INF/com/google/android/aroma/text.txt"
# then save it in variable
setvar(
"testvar",
zipread("META-INF/com/google/android/aroma/text.txt")
);

# It will read data from zip content "tmp/text.txt"
# then save it in variable
setvar(
"testvar2",
zipread("tmp/text.txt")
);

resread

Descriptions:

Read string from file in zip relatively from AROMA Resource Directory "META-INF/com/google/android/aroma/"
​

Sintax:

content_of_file resread(zip_path);

​

Parameters:

zip_path - Relative path of file in Zip from AROMA Resource Directory "META-INF/com/google/android/aroma/" that will be readed

Return Value:

Content of file in String
​

Examples:

# It will read data from zip content "META-INF/com/google/android/aroma/text.txt"
# then save it in variable
setvar(
"testvar",
resread("text.txt")
);

ZIP EXTRACT FUNCTIONS

ziptotmp

Descriptions:

Extract file from zip content into AROMA Temporary directory, and automatically chmod it for executable.
​

Sintax:

void ziptotmp(zip_path, destination_name);

​

Parameters:

zip_path - Absolute path to Destination file in zip that will be extracted

destination_name - Extracted target filename

Return Value:

none
​

Examples:

# It will extract "tmp/busybox" into "/tmp/aroma-data/busybox"
ziptotmp("tmp/busybox", "busybox");

# Now we can execute it
exec("/tmp/aroma-data/busybox","ls","-l");

restotmp

Descriptions:

Extract file from zip content in AROMA Resource Directory "META-INF/com/google/android/aroma/" into AROMA Temporary directory, and automatically chmod it for executable.
​

Sintax:

void restotmp(zip_path, destination_name);

​

Parameters:

zip_path - Relative path of file in Zip from AROMA Resource Directory "META-INF/com/google/android/aroma/" that will be extracted

destination_name - Extracted target filename

Return Value:

none
​

Examples:

# It will extract "META-INF/com/google/android/aroma/busybox" into "/tmp/aroma-data/busybox"
restotmp("busybox", "busybox");

# Now we can execute it
exec("/tmp/aroma-data/busybox","ls","-l");

EXEC FUNCTIONS

zipexec

Descriptions:

Extract file from zip into AROMA temporary, chmod it, and execute it.
​

Sintax:

exit_status zipexec(zip_path [, argument1, argument2, ... ]);

​

Parameters:

zip_path - Absolute path of zip content that will be executed

arguments [Optional] - Command line Arguments

Return Value:

Return exit status. "0" for common success status

The output buffer/stdout will be automatically saved into "exec_buffer"
​

Examples:

# It will extract and run "META-INF/com/google/android/aroma/test.sh"
zipexec("META-INF/com/google/android/aroma/test.sh");

# With Arguments
zipexec("META-INF/com/google/android/aroma/test.sh", "argument1", "argument2");

# Get Return Status
if
zipexec("META-INF/com/google/android/aroma/test.sh") == "0"
then
alert(
"Exec Status",
"Shell was executed successfully"
);
endif;

# Get STDOUT
zipexec("META-INF/com/google/android/aroma/test.sh");
alert(
"Exec STDOUT",
getvar("exec_buffer")
);

resexec

Descriptions:

Same as zipexec, but it will extract and run the file from zip relatively from AROMA Resource Directory "META-INF/com/google/android/aroma"
​

Sintax:

exit_status resexec(zip_path [, argument1, argument2, ... ]);

​

Parameters:

zip_path - Relative path of zip content from AROMA Resource Directory "META-INF/com/google/android/aroma/" that will be executed

arguments [Optional] - Command line Arguments

Return Value:

Return exit status. "0" for common success status

The output buffer/stdout will be automatically saved into "exec_buffer"
​

Examples:

# It will extract and run "META-INF/com/google/android/aroma/test.sh"
resexec("test.sh");

# With Arguments
resexec("test.sh", "argument1", "argument2");

# Get Return Status
if
resexec("test.sh") == "0"
then
alert(
"Exec Status",
"Shell was executed successfully"
);
endif;

# Get STDOUT
resexec("test.sh");
alert(
"Exec STDOUT",
getvar("exec_buffer")
);

run_program, exec

Descriptions:

Run executable from filesystem
​

Sintax:

exit_status run_program(path [, argument1, argument2, ... ]);

exit_status exec(path [, argument1, argument2, ... ]);

​

Parameters:

zip_path - Absolute path to executable

arguments [Optional] - Command line Arguments

Return Value:

Return exit status. "0" for common success status

The output buffer/stdout will be automatically saved into "exec_buffer"
​

Examples:

# It will run "ls" command
run_program("/sbin/ls");

# or
exec("/sbin/ls");

# With some Arguments
run_program("/sbin/ls", "-l", "/sdcard");

# Mounting Device
exec("/sbin/mount", "-t", "auto", "/system");

# Get Return Status
if
exec("/sbin/mount", "-t", "auto", "/system") == "0"
then
alert(
"Exec Status",
"Mount was executed successfully"
);
endif;

# Get STDOUT
exec("/sbin/ls", "-l", "/sdcard/*.zip");
alert(
"List of Zip in SDCARD",
getvar("exec_buffer")
);