[TUT] Aroma Installer 2.5 S5570 - Samsung Galaxy Mini
You all know Aroma Installer, in the past, with the early versions it didnt work properly with LDPI devices, now i must confirm that it works preatty well; and there was no noob frendly tutorial out there ...
So i decided to make a very short, simple as possible tutorial on how to set it up for your build(no advanced backup setup etc), you must have basic knowledge of the system tree, editing scripts. and kitchen work. If you got any questions or bugs please report them here.
ALL THE CREDIT IS FOR AMARULLZ FOR HIS WORK ON THIS PROJECT,AND DSIXDA FOR THE KITCHEN
ORIGINAL TOPIC
KITCHEN
1. THE START
First of all you must download the installer HERE and THE KITCHEN if you dont have it.
2. AROMA-CONFIG
I wont explain how to set up the kitchen, you just have to go on the development topic and check that out.
Now, lets focus on the installer, you got the zip file, on the time of this topic it is v2.51, extract it where you want.
Create a folder (name it as you desire) lets say: DANY here you'll put all the apps/tweeks, in separate subfolders( will use this later)
Inside you will see a META-INF folder, i want you to open it, then navigate to the android subfolder.
Here you will see alot of stuff, that you may or may not be familiar with. For those who dont really know whats in there i suggest to leave this topic...now, for the people that are 5% familiar with the tree/editing (as i); all our focus is on 2 config files updater-script, aroma-config and one folder aroma
The starting point of the installer is the aroma-config from there the update-binary-installer, update-binary pull the instructions and send it to the updater-script so it will know what to install or what not... ok.
Next i want you to open the aroma-config, here you will see aalooot of info that maybe you have no ideea what it is for or what is does, no proplem i will try to explain as explicit as i can be.
Here in the config, as i said above are the main instructions that are sent to the updater-script, but also the main settings so that the installer can work on your device, here you set the : touch screen calibration settings, hardware keys, res of the installer...now note that all these resources so that the installer could display data are pulled from the aroma folder,witch will get to that later on.
Now what you have to do is: 1. on line 54 of the config remove the "#"
Code:
ini_set("force_colorspace","rgba");
what this does, its "For device which have a problem with color ( not displaying the correct color ) " as it says above on the config, so we must prevent that from happening.
2. lines 66-71 delete them.Here we must set our devices PPi, you just copy this
Code:
if sysprop("ro.sf.lcd_density")=="120" then
ini_set("dp","1"); #-- LDPI ( 240x320 / QVGA )
endif;
if sysprop("ro.sf.lcd_density")=="160" then
ini_set("dp","2"); #-- MDPI ( 340x480 / HVGA )
endif;
if sysprop("ro.sf.lcd_density")=="240" then
ini_set("dp","3"); #-- HDPI ( 480x800 / WVGA )
endif;
3. line 87, the touch screen calibration,delete the old one and copy this line of code
Code:
calibrate_matrix(
"11583.00", "432.00", "5356.50", "105.00",
"11830.00", "-28077.50", "12079.50", "0"
);
4. line 119 to 123, hardware buttons
Code:
ini_set("customkeycode_up", "115");
ini_set("customkeycode_down", "114");
ini_set("customkeycode_select", "102");
ini_set("customkeycode_menu", "139");
ini_set("customkeycode_back", "158");
5. line 129-133, i think that you can figure this out
6. 139-144, here you can define a .png splash screen 235X99
7. 172, 211-268 here you can define the font size, and the languages that you want in the build, recommanded font size is 19-20 or you can let it be as it is, but it will be small, you have to test it to see
Code:
if prop("lang.prop","selected.0")=="6" then
loadlang("langs/fr.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "19" );
fontresload( "1", "ttf/Roboto-Regular.ttf", "20" );
endif;
8. 295-370, are the themes for Aroma Installer, we wont touch this
9. Now, from where you'll see STEP5( i dunno the exact line :cyclops delete all the way down to STEP6, here the installer starts a demo, and we dont want all those options/tests and Copy this ---->
Code:
# STEP 5 - SHOW MENUBOX - AROMA INSTALLER MENU
#
menubox(
#-- Title
"MENU",
#-- Sub Title
"Select a menu to start:",
#-- Icon
"@apps",
#-- Will be saved in /tmp/aroma/demo.prop
"menu.prop",
#-------------------------+-----------------[ Menubox Items ]-------------------------+---------------#
# TITLE | SUBTITLE | Item Icons #
#-------------------------+-----------------------------------------------------------+---------------#
"Install "+ini_get("rom_name"), "Install Rom using AROMA Installer", "@install", #-- selected = 1
"System Info", "Info about Device/Partions", "@info", #-- selected = 2
"Return to...", "Retun to a previous Menu...", "@customize", #-- selected = 3
"Other Option", "Show Other Optionsi", "@apps" #-- selected = 4
);
###################################################################################################################
# #
# AROMA INSTALLER #
# #
###################################################################################################################
##--------------------------------------
#
# System Info
#
if prop("menu.prop","selected")=="2" then
#-- Show Please Wait
pleasewait("Getting System information...");
#-- Fetch System Information
setvar(
#-- Variable Name
"sysinfo",
#-- Variable Value
"<@center><b>Device Information!</b></@>\n\n"+
"Model\t\t\t: <b><#selectbg_g>"+sysprop("ro.product.model")+"</#></b>\n"+
"Name\t\t\t: <b><#selectbg_g>"+sysprop("ro.product.name")+"</#></b>\n"+
"Device Name\t\t: <b><#selectbg_g>"+sysprop("ro.product.device")+"</#></b>\n"+
"Board Name\t\t: <b><#selectbg_g>"+sysprop("ro.product.board")+"</#></b>\n"+
"Manufacturer\t\t: <b><#selectbg_g>"+sysprop("ro.product.manufacturer")+"</#></b>\n\n"+
"CPU\t\t\t: <b><#selectbg_g>"+sysprop("ro.product.cpu.abi")+"</#></b>\n"+
"LCD Desinty\t\t: <b><#selectbg_g>"+sysprop("ro.sf.lcd_density")+"</#></b>\n\n"+
"System Size\t\t: <b><#selectbg_g>"+getdisksize("/system","m")+" MB</#></b>\n"+
"\tFree\t\t: <b><#selectbg_g>"+getdiskfree("/system","m")+" MB</#></b>\n\n"+
"Data Size\t\t: <b><#selectbg_g>"+getdisksize("/data","m")+" MB</#></b>\n"+
"\tFree\t\t: <b><#selectbg_g>"+getdiskfree("/data","m")+" MB</#></b>\n\n"+
"(/mnt/sdcard)\t\t: <b><#selectbg_g>"+getdisksize("/mnt/sdcard","m")+" MB</#></b>\n"+
"\tFree\t\t: <b><#selectbg_g>"+getdiskfree("/mnt/sdcard","m")+" MB</#></b>\n\n"+
"SDCard Size\t\t: <b><#selectbg_g>"+getdisksize("/sdcard","m")+" MB</#></b>\n"+
"\tFree\t\t: <b><#selectbg_g>"+getdiskfree("/sdcard","m")+" MB</#></b>\n\n"+
"SD-EXT Size\t\t: <b><#selectbg_g>"+getdisksize("/sd-ext","m")+" MB</#></b>\n"+
"\tFree\t\t: <b><#selectbg_g>"+getdiskfree("/sd-ext","m")+" MB</#></b>\n\n"+
""
);
#-- Show Textbox
textbox(
#-- Title
"System info",
#-- Subtitle
"Loading...",
#-- Icon
"@info",
#-- Text
getvar("sysinfo")
);
#-- Show Alert
#alert(
#-- Alert Title
#"Info",
#-- Alert Text
#"You will get back to main menu now",
#-- Alert Icon
#"@alert"
#);
#-- Back to Demo Menu ( 2 Wizard UI to Back )
back("2");
endif;
##--------------------------------------
#
# Back Sequence Demo
#
if prop("menu.prop","selected")=="3" then
#-- Show Back Menu
menubox(
#-- Title
"Main Menu",
#-- Sub Title
"Please select the option that suits your needs.",
#-- Icon
"@customize",
#-- Will be saved in /tmp/aroma/back_demo.prop
"back_demo.prop",
#-------------------------+-----------------[ Menubox Items ]-------------------------+---------------#
# TITLE | SUBTITLE | Item Icons #
#-------------------------+-----------------------------------------------------------+---------------#
"Main Menu", "Return to main menu", "@apps", #-- selected = 1
"Changelog", "Return to changelog", "@update", #-- selected = 2
"Terms and Conditions", "Agreement", "@license", #-- selected = 3
"Start Menu", "Return to start menu", "@welcome", #-- selected = 4
"Select theme", "Return to theme menu", "@personalize" #-- selected = 5
);
#-- Back Size will be saved in "back_value" variable
setvar(
#-- Variable Name
"back_value",
#-- Variable Value ( use calculate to set selected+1 )
cal(
#-- First Value
prop("back_menu.prop","selected"),
#-- Operator (+ = add)
"+",
#-- Second Value
"1"
)
);
#-- Do Back Action
back(
getvar("back_value")
);
endif;
##--------------------------------------
#
# Other Demo
#
if prop("menu.prop","selected")=="4" then
#-- Show Other Demo
menubox(
#-- Title
"Other Options",
#-- Sub Title
"Select a option below.",
#-- Icon
"@apps",
#-- Will be saved in /tmp/aroma/other_demo.prop
"other_demo.prop",
#-------------------------+-----------------[ Menubox Items ]-------------------------+---------------#
# TITLE | SUBTITLE | Item Icons #
#-------------------------+-----------------------------------------------------------+---------------#
"Reboot", "Reboot the device", "@alert", #-- selected = 1
"Exit", "Exit rom installation, "@install" #-- selected = 2
);
#-- Reboot
if prop("other_demo.prop","selected")=="1" then
if
confirm(
#-- Title
"Rebooting",
#-- Text
"Do you really want to reboot the Device?",
#-- Icon (Optional)
"@alert"
)=="yes"
then
#
# reboot("onfinish"); - Reboot if anything finished
# reboot("now"); - Reboot Directly
# reboot("disable"); - If you set reboot("now") before, use this command to revert it.
#
reboot("now");
endif;
endif;
#-- Exit
if prop("other_demo.prop","selected")=="2" then
if
confirm(
#-- Title
"Exit",
#-- Text
"Are you sure want to exit to CWM??",
#-- Icon (Optional)
"@alert"
)=="yes"
then
#-- Exit - NOTE: Add dummy argument
exit("");
endif;
endif;
#-- Back To Other Demo Menu
back(
getvar("1")
);
endif;
###################################################################################################################
# #
# INSTALLATION #
# #
###################################################################################################################
###################################################################################################################
#
# STEP 6 - SHOW MENUBOX - INSTALLATION TYPE
#
menubox(
#-- Title
"Installation Type",
#-- Sub Title
"Choose the installation type that best suits your needs.",
#-- Icon
"@install",
#-- Will be saved in /tmp/aroma/type.prop
"type.prop",
#-------------------------+-----------------[ Menubox Items ]-------------------------+---------------#
# TITLE | SUBTITLE | Item Icons #
#-------------------------+-----------------------------------------------------------+---------------#
"Default", "Will install default features and configurations", "@install", #-- selected = 1
"Typical", "All recommended features will be installed", "@default", #-- selected = 2
"Minimalist", "Only required features will be installed", "@apps", #-- selected = 3
"Custom", "Choose which program or mod features you want to installed. "+
"Recommended for advanced users", "@customize" #-- selected = 4
);
10. Here starts the fun part, as seen above in the STEP6 code, there are 4 options "DEFAULT, TYPICAL, MINIMALISTIC, CUSTOM", you can keep only 2 or 1 option, that depends to you and what you need. You will also notice this line #-- Will be saved in /tmp/aroma/type.prop
"type.prop", what this mean is that for each option you press, the info in stored in a so called TYPE.PROP file that later on the updater-script will pull the info from, and this is not present just here, this is how aroma stores the information in .prop files
11. STEP 7- STEP 8 here we gonna define what kernel we want to install/mod/bootanimation, default or custom install.
Lets Focus on STEP7 to explain a little , line 1431-1443, what we see here,( i will translate :laugh: ) IF we selected the Default installation, then it will install by default 2.6.0 kernel, Nexus boot animation, generic app2sd etc.
The Code Part!!!
You can define here, witch apps,mods will be installed by default by pressing Default installation button. In mods.prop the binary wrote the option 1 so the updater script now what to do THEN the binary olso wrote the default app config on another .prop file, mods.prop.Applications are defined by a syntax so its easyer to assign selected1.=1, selected.2=2 you get the ideea.
Below now, on line 1464 (i guess), where the kernel, boot animation is, you can define the names of the Kernel, Mods
ex:
Code:
"Select Kernel", "", 2, #-- Group 1. key = "selected.1"
"SUPER EXTREME KERNEL", "YOU WILL SH*T BUTTER IF YOU INSTALL IT", [color=red]1, #-- selected.1 = 1[/color]
Note that the 1, it shows if i want to installet or not and selected.1 = 1 is for reference so you now with syntax is for witch application, and also selected.X.X the red X shows the group of the apps,the blue the order.
12. Now that you understood a lil, i will show you a CUSTOM config, so you can understand better
Code:
#-- IF Installation type = "Custom" Show Customize Selection
checkbox(
#-- Title
"Customize Your Installation",
#-- Sub Title
"Select the program or mod features you want to installed.\n"+ witch
"Select an item in the list below to change how a feature is installed.",
#-- Icon: <AROMA Resource Dir>/icons/personalize.png or <ThemeDir>/icon.personalize.png
"@personalize",
#-- Will be saved in /tmp/aroma/customize.prop
"customize.prop",
#------------------------------------------------[ Checkbox Without Group ]----------------------------------------------#
# TITLE | SUBTITLE | Initial Value #
#------------------+-------------------------------------------------------------------------------------+---------------#
"Applications", "",
2, #-- Group 1. key = "item.1.x"
"Deezer", "Listen to music online", 1,
"ES File Explorer ", "File manager", 1,
"Facebook", "Facebook app", 1,
"Google +", "Google Plus App", 1,
"Instagram", "Capture photos and share them", 1,
"No Frills CPU", "Overclock cpu change i/o", 1,
"Shazam", "Music/video recognison", 1,
"Swype", "Keyboard", 1,
"Twitter", "Twitter app", 1,
"Zedge", "Wallpapers/ringtones/live wp", 1,
"FM Radio", "FM Radio", 1,
"Terminal", "Terminal Emulator", 1,
"DPS Manager", "Phone equalizer", 1,
"Jelly Walls", "Jb wallpapers", 1,
"ICS Standard", "theme", 1,
"ICS Standard2", "theme", 1,
"ICS Blue", "theme", 1,
"Holo Locker", "Screen Locker", 1
#--------[ Initial Value = 0: Unselected, 1: Selected, 2: Group Item, 3: Not Visible ]---------#
);
endif;
Here in the code, you wil see the the info it will be writen to customize.prop, Grop Key: Group 1. key = "item.1.x, the Select values , all the apps are selected, but on the top, you saw something new, and that is checkbox, now, with this syntax on the screen will be displayed a menu where you can select the apps that you need and the info stored on customize.prop, not like in the previous type.prop that a set of apps was selected and you couldent do anything. Also note that checkbox is similar to menu box, but the menu box displays the option that you want to start with, and then displays a checkbox. But i will stop here so i wont confuse you.
3.UPDATER-SCRIPTThat was the aroma script basic understanding, editing. Now the updater script, now we need to pull the info from the aroma config, i wont explain edify-script you must search that on google, im just showing you the the updater-script pulls the data from the aroma-config.
I dont know if i mentioned this before...but all the .prop files will be stored in /tmp/aroma this is the path of the temporary folder.
Now lets open the default updater-script you will see on line73 ui_print("@INFORMATIONS"); in brackets you can insert what text you want, next on lines81 to 109 is all the mounting that must occur so that the installation process can happen, here are the syntaxes that you will need at first.
Code:
package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
set_perm(0, 0, 0777, "/tmp/backuptool.sh");
run_program("/tmp/backuptool.sh", "backup");
ui_print("FORMATING SYSTEM");
format("ext4", "EMMC", "/dev/block/stl12");
ui_print("MOUNTING SYSTEM")
mount("ext4", "EMMC", "/dev/block/stl12", "/system");
ui_print(" Mounting /data");
ui_print("|||||||||||");
unmount("/data");
mount("ext4", "EMMC", "/dev/block/stl13", "/data");
set_progress(0.04);
ui_print("Please Wait...");
ui_print("|||||||||||");
set_progress(0.05);
ui_print("|||||||||||");
ui_print("@ Wiping Data");
if
file_getprop("/tmp/aroma/wipe.prop","selected") == "1"
then
set_progress(0.06);
ui_print(" Formatting /data");
format("ext4", "EMMC", "/dev/block/stl13");
ui_print(" Formatting /cache");
format("ext4", "EMMC", "/dev/block/stl14");
ui_print(" Mounting /data");
ui_print(" Formatting /sd-ext");
format("ext4", "EMMC", "/dev/block/mmcblk0p2");
ui_print("|||||||||||");
set_progress(0.08);
ui_print(" Wiping /sdcard/.android_secure");
delete_recursive("/sdcard/.android_secure");
endif;
if
file_getprop("/tmp/aroma/wipe.prop","selected") == "0"
then
ui_print("SKIPING RESET");
endif;
Is like in linux, define the path: mount, unmount or format ,search on google for a better understanding.
Lets say in the aroma-config we defined that /system will be wiped, how does updater-script figure that out? Easy, will invoke the file where the date is stored plus a if sentance, the file is in tmp/aroma/wipe.prop and here is the code
Code:
if
file_getprop("/tmp/aroma/wipe.prop","selected") == "1"
then
set_progress(0.06);
ui_print(" Formatting /data");
unmount("/data");
format("ext4", "EMMC", "/dev/block/stl13");
ui_print(" Mounting /data");
mount("ext4", "EMMC", "/dev/block/stl13", "/data");
set_progress(0.07);
ui_print(" Formatting /sd-ext");
unmount("/sd-ext");
format("ext4", "EMMC", "/dev/block/mmcblk0p2");
ui_print("|||||||||||");
set_progress(0.08);
ui_print(" Wiping /sdcard/.android_secure");
delete_recursive("/sdcard/.android_secure");
endif;
TRANSLATED:if we selected to wipe the previous rom it will wipe the data partition, the EXT4 partition and .android_secure
But if we selected not to wipe?!
Code:
if
file_getprop("/tmp/aroma/wipe.prop","selected") == "0"
then
ui_print(" SKIP Wipe Data!");
set_progress(0.08);
endif;
and it will do nothing, wil move to the next step.
For the apps, the code is in customize.prop and the syntax looks like this
Code:
if
file_getprop("/tmp/aroma/customize.prop","item.1.1") == "0"
then
delete("/system/app/FM.apk");
ui_print("Deleting FM");
endif;
# Bootanim
if
file_getprop("/tmp/aroma/customize.prop","item.1.2") == "1"
then
ui_print(" Bootanimation");
package_extract_file("DANY/animationname.zip", "/system/media/animationname.zip");
endif;
TRANSLATED: IF item FM radio was selected to be installed then so it will be, if 0, (not) then it will be deleted. If the boot animation is selected to be installed, ( remember that i wanted you to create a folder in step 2?! we called it DANY there is the custom bootanimation stored as you can see, and keep attention on this folder cuz we gonna use it in our update.zip) it will be moved to /system/media.
4.AROMA FOLDERHere we are not gonna edit much, in the langs folder you can edit some text that that will apare in the installer itself, and in the main folder of aroma replace the sample.png with one that you desire, and in the splash folder you can resize the animation at startup 235X99 and the icons.
5.KITCHENNow all you have to do is save all the work, grab your META-INF and DANY folder place them on the working folder of the kitchen, but take note that you must delete the old META-INF in the kitchen also make sure You took an update-binary from a working ROM,
renamed it to update-binary-installer and overwrote the one in my AROMA Installer zip
Build the rom. but the zip on SD card, reboot into CWM then wipe cache ,reboot recovery, next install zip from SD card ,choose the zip and hope for the best
That covers it, enjoy now testing aroma in your device, and im sorry if i misspeled something, say thanks if i helped you and please, please correct me if i wrote something wrong!!!, i was so tired.
so now, i need your help guys so that we can get it working
thank for the guide!!!!!
Messi10 said:
i have resized aroma 2 months ago but the hardisk is damaged:crying:
Click to expand...
Click to collapse
thats a shame, but i quess ill have to start to edit the updater script step by step
i see that no one is interested...ok
I would if I could... sorry
Verstuurd van mijn GT-S5570 met Tapatalk
guy what is aroma installer??????
lackhoo said:
guy what is aroma installer??????
Click to expand...
Click to collapse
google it.
i will see what i can do
ive tried using the aroma installer on my mini
the basic tour thingy works on our device and even the touch but not so accurate
and editing the scripts, pm me, i'd like to help
P.S. i can handle scripts decently; not a noob
id made a clean updater script, but the problem is the config file...i wont start the installing process, id missed some atributes for sure
to use a good color, try to change it from aroma-config:
Code:
ini_set("force_colorspace","abgr");
to
Code:
ini_set("force_colorspace","rgba");
change font size:
Code:
fontresload( "0", "ttf/DroidSans.ttf", "15" );
fontresload( "1", "ttf/DroidSans.ttf", "24" );
to
Code:
fontresload( "0", "ttf/DroidSans.ttf", "20" );
fontresload( "1", "ttf/DroidSans.ttf", "22" );
here is my calibration data:
Code:
calibrate_matrix(
"11448.00","-27.00","6459.50","175.00",
"11375.00","-46075.00","11483.75","10"
);
interface problem isn't from AROMA Installer, its from recovery.
to fit interface, use recovery 4.0.0.5. (tass-recovery-cwm.tar)
sorry for my bad english
try using config files of this
http://forum.xda-developers.com/showthread.php?t=1381355
samsung rom with aroma installer
i guess this shall be a help!
ahmadsafar said:
to use a good color, try to change it from aroma-config:
Code:
ini_set("force_colorspace","abgr");
to
Code:
ini_set("force_colorspace","rgba");
change font size:
Code:
fontresload( "0", "ttf/DroidSans.ttf", "15" );
fontresload( "1", "ttf/DroidSans.ttf", "24" );
to
Code:
fontresload( "0", "ttf/DroidSans.ttf", "20" );
fontresload( "1", "ttf/DroidSans.ttf", "22" );
here is my calibration data:
Code:
calibrate_matrix(
"11448.00","-27.00","6459.50","175.00",
"11375.00","-46075.00","11483.75","10"
);
interface problem isn't from AROMA Installer, its from recovery.
to fit interface, use recovery 4.0.0.3. (tass-recovery-cwm.tar)
sorry for my bad english
Click to expand...
Click to collapse
still, this is not the most importent problem now, the installer wont load the system files to flash the rom, and the problem here is the config
http://www.youtube.com/watch?v=PsIOpVuslr4&feature=player_embedded Look good and interesting. I'll be waiting for it .
dany547 said:
still, this is not the most importent problem now, the installer wont load the system files to flash the rom, and the problem here is the config
Click to expand...
Click to collapse
try my AROMA Installer mod
https://www.box.com/shared/1de09310762fbf24b32b
it's tested & works for me!
ahmadsafar said:
try my AROMA Installer mod
https://www.box.com/shared/1de09310762fbf24b32b
it's tested & works for me!
Click to expand...
Click to collapse
on what recovery you used ?
dany547 said:
on what recovery you used ?
Click to expand...
Click to collapse
CWM 4.0.0.5.
i make that from original aroma installer 2.50 with your config.
It is really working?
Sent from my GT-S5570 using xda premium
Trublood_ said:
It is really working?
Sent from my GT-S5570 using xda premium
Click to expand...
Click to collapse
Yep..i tested and it works
Sent from my GT-S5570 using xda premium
Related
[INFO] Edify scripts in CWM recovery
Hi, I haven't seen any good resources for how to edit edify scripts, so I thought I would create this thread so we can pool our knowledge on the subject. Intro Inside your typical CWM zip there is a folder called META-INF, inside that there is a folder called com and come CERT files, inside that com folder there is a google folder, inside that is an android folder containing an update-binary file and an updater-script. If you only see an update-script, that means you are back in the Android 1.5 era and need to move on. The updater-script The updater-script file is a text file, it is linux formatted with regard to end of line conventions. If you use Windows then you have to edit the file using a program that keeps line feeds the way they are and has options for doing the conversion from <CR><LF> to just <LF>. Like lisp, the contents of the text file evaluate to one big expression, but it does have the ";" end of command convention to make things more familiar, it just means perform the action on the left. (ref. google source README) You can ignore that and just treat everything as a series of commands for all practical purposes. I mention it because you need not worry about having too large a procedural block or worry about having extra spaces or worry about ending on a line boundary. You could have your entire script on one giant line and it wouldn't matter. There are around a dozen commands, it's not terribly difficult to learn. The updater-binary There are a lot of updater-binary files out there in the wild, each manufacturer basically compiles there own with every other OTA update. Success in flashing your CWM zip is determined by picking the right one that works with what you are trying to do. If your knowledge says mount needs 4 arguments and the binary only supports 3, then you need to change your script to use 3 and vice versa. If you are trying to flash a radio, the updater-binary might have been recompiled to allow for that specific functionality and you will get a status 6 error when trying to flash it unless you use that update-binary. You will see the write_raw_image() function not supporting "/dev/block/mmcblk0p8" but instead "logo.bin". However, by and large, the generic functionality is the same across the board. Updater-script functions (In order of interest) ui_print(msg1, .. msgN); This is the means you have to display something on the screen in CWM, it takes a series of comma separated arguments, each comma needs to have a space after it, this applies to all commands. Ex. ui_print("Your version is: ", file_getprop("/system/build.prop", "ro.build.id")); show_progress(TOTALAMOUNT, TIMEINSEC); This command and the following command control what you see in the progress bar at the bottom. It is not necessary to use it, it's just another way to display information.TIMEINSEC refers to how long it will take for the progress bar to move to the AMOUNT specified. You would use this perhaps when something is taking a long time, you know approximately how long and want the screen to keep showing something while it is going on. If you use zero for TIME then nothing is done, you have just set the maximum amount for use with set_progress. The amount is a decimal number, 0.5 would be half the progress bar being filled. Ex. show_progress("0.300000", 10); set_progress(AMOUNT); This command sets the pointer or fill amount of the progress bar according to the last show_progress command. It should never be greater than the total of the show_progress amount. Ex. show_progress("0.300000", 0); set_progress("0.15"); mount(TYPE, DEV, PATH); This is one version of the mount command. The TYPE arg is usually "MTD", which refers to memory technology device. The DEV for a MTD would be something like "system", "userdata", "cache", and the PATH would be "/system", "/data", or "/cache". You will also see TYPE be "vfat". mount(FSTYPE, TYPE, DEV, PATH); This seems to be the more current mount command. It adds in the file system type. Ex. "ext3", "yaffs". TYPE with this command can be "MTD" or "EMMC". You would use "EMMC" with "/dev/block/mmcblk0p8". umount(PATH); This simply removes a previous mounted PATH from the system. Ex. umount("/system"); You'll notice the double quotes around command arguments, they are not strictly necessary. Unless it's a reserved word (if then else endif) then they can be anything. "consisting of only letters, numbers, colons, underscores, slashes, and periods". So if you just spend 10 minutes uploading your zip to your phone and notice that your unmount command is umount(/system);, it will work just fine. sleep(SECS); Simply pauses for SECS seconds. package_extract_file(FILE, FILEWITHPATH); This command extracts one of your files from the CWM zip package and save it to the phone. Ex. package_extract_file("bootanimation.zip", "/system/media/bootanimation.zip"); package_extract_dir(ZIPPATH, PATH); This command extracts an entire folder in your CWM zip to a folder on your phone. Ex. package_extract_dir("system", "/system"); *This is where having system mounted would be handy, without it being mounted, the files would be copied to the ramdisk /system. write_raw_image(PATH, PARTITION); This is one of those tricky ones, the PATH is somewhere on your phone with the image to be flashed to a PARTITION on your phone. The trouble is, how do you specify what partition gets flashed? Is there any restriction on where the file has to be? If MTD conventions are used, you are looking for "system", "boot", "recovery", "logo.bin". (All this means that each partition has a name stored somewhere, and if you know it, you can write to it.) Maybe it will accept device references like /dev/block/mmcblk0p8. This depends on the update-binary file you are using. Ex. write_raw_image("/tmp/logo.bin", "logo.bin"); Ex. write_raw_image("/tmp/logo.bin", "/dev/block/mmcblk0p8"); write_firmware_image(PATH, PARTITION); You would think it would be the same as write_raw_image. Not sure what the difference is. run_program(PROG, ARG1, .., ARGN); Pretty self explanatory, This command allows you to execute a program or script on the phone. Instead of all the bits of the command being separated by spaces, commas are used. It returns an error code as a string. Ex. run_command("ls", "-R", "/system"); Assert(condition); You'll see this one a lot in OTA updates, all it does is abort the script if something goes wrong. If condition is false, the script ends displaying a description on the phone of what command caused the exit. You can put in more than one statement here, separated by ";", if any one of them returns with an error, the script exits. Ex. Assert(mount("ext3", "EMCC", "/dev/block/mmcblk0p12", "/system")); *If you can't mount /system and your CWM zip only writes to system, you might as well stop it before continuing on to write to the ramdisk. ifelse(condition, true path, false path); This is your basic conditional statement, the tricky bit is to figure out what statements in edify can trigger a true of false condition. As for the rest of it, the commas separate the two blocks. Ex. ifelse(file_getprop("/system/default.prop", "ro.build.id") == "OLYFR1.2.3.4", ui_print("yes"), ui_print("false")); abort(); This stops the script, useful with ifelse. file_getprop(PATH, VALUE); This command looks for a text file containing A=B pairs and returns B if it can find an A. Ex. file bob.txt exists in /tmp, it contains cool=yes, and dorky=true123 each on separate lines. file_getprop("/tmp/bob.txt", "cool") == "yes" file_getprop("/tmp/bob.txt", "dorky") == "true123" getprop(VALUE); Functions the same as file_getprop, without the file part. It looks through the system value pairs for a matching value. Ex. getprop("ro.build.id") == "OLYEM1.2.3.4" delete(PATH1, ...,PATHN); Nothing to see here, just a delete command, full path to the file(s) as argument(s). delete_recursive(PATH1, ...,PATHN); It's a delete everything in a folder, including subfolders command. The folder itself is deleted as well. set_perm(UID, GID, MODE, PATH1, ..., PATHN); Set the linux permissions on a file, ownership and flags at the same time. Equivalent to chown and chmod in the one command. Ex. set_perm(0, 0, 06755, /system/bin/su, /system/bin/shsu); *0 stands for root, so it would be owned by root, of the group root, with suid bit set and standard executable bits set. set_perm_recursive(UID, GID, DIRMODE, FILEMODE, PATH1, ...,PATHN); Same as above except with folders instead of files. Use the DIRMODE to set the permissions and ownership of the folders themselves, and FILEMODE to set the permissions of the files within them. symlink(TARGET, LINK1, ...,LINKN); It's the equivalent to the linux ln -s command. For our purposes, it might as well be called busybox install. Ex. symlink("/system/bin/busybox", "/system/bin/awk", "/system/bin/wget", "/system/bin/sed"); To Be Continued.. References http://devphone.org/development/edify-script-syntax-explained/ http://www.synfulgeek.com/main/index.php/articles/76-scratchpad-documenting-edify-commands-for-android-updater-scritps-based-off-of-kernel-source-code https://github.com/koush/android_bootable_recovery/blob/eclair/edify/README http://tjworld.net/wiki/Android/UpdaterScriptEdifyFunctions
Tips: You can use the abort() command to step through your updater script, for instance if you wanted to check various combinations on syntax for write_raw_image(); In /tmp there is a text file called recovery.log, do a cat /tmp/recovery.log to see extra output of your script from failed commands.
NFHimself said: The updater-script file is a text file, it is linux formatted with regard to end of line conventions. If you use Windows then you have to edit the file using a program that keeps line feeds the way they are and has options for doing the conversion from <CR><LF> to just <LF>. Click to expand... Click to collapse If you are in windows, I have found that notepad++ does the job just fine. http://notepad-plus-plus.org/
what about the FORMAT command? actually i have error on a CM installation, its says Code: format() expects 3 args, got 2. but my format command have 3 args: Code: format("ext4", "/dev/block/mmcblk0p10", "/system");
NFHimself said: Hi, I haven't seen any good resources for how to edit edify scripts, so I thought I would create this thread so we can pool our knowledge on the subject. Intro Click to expand... Click to collapse Thanks for this... but I do have a question.... I am attempting to see if busybox is installed on a device, and if not install it, or proceed so, so far I have: Code: ifelse( BUSYBOX DOESNT EXIST, ( ui_print("* Did not find it. Installing..."); set_perm(0, 1000, 0755, "/system/xbin/busybox"); symlink("/system/xbin/busybox", "/system/bin/busybox"); run_program("/system/xbin/busybox", "--install", "-s", "/system/xbin"); ), ( ui_print("* Found it. Proceeding..."); ) ); You can see where I'm lost I was thinking of using assert to run_program("/system/xbin/busybox", "vi", "/system/xbin"); just as a simple check... but from what I can see, if the assertion fails it will stop the script, and print out the failure message, which of course is not what I am after here... or maybe I am, can it be used to do a check rather than stop the script?
Just an idea (ie. untested): Code: ifelse( run_program("/system/bin/sh", "-c", "test -e /system/xbin/busybox") ... )
ravilov said: Just an idea (ie. untested): Code: ifelse( run_program("/system/bin/sh", "-c", "test -e /system/xbin/busybox") ... ) Click to expand... Click to collapse trying to run that in adb sheel, and don't get a response, but it does seem like a good idea... I assume Edify would return a 1/0 or true/false string from it, and I can just check for that? EDIT: Maybe I do get something back... after running that in adb shell my next line looks like the following: Code: 1|[email protected]:/ # Am I right in assuming that "1" is the output?
Yes. The command won't ever return any output, it only returns the exit status. Your shell is obviously set so it includes a non-zero exit status in the prompt. (Non-zero traditionally means error.)
ravilov said: Yes. The command won't ever return any output, it only returns the exit status. Your shell is obviously set so it includes a non-zero exit status in the prompt. (Non-zero traditionally means error.) Click to expand... Click to collapse that prompt means that the test failed, and I don't have busybox installed? I'm just a tad confused... (this is my first full-on edify script), and I do have busybox installed I appreciate the help, and once I get my tapatalk working right on my phone, I'll give ya all the "thanks" for the help with this Eh... everything I 'test' returns the same thing Code: 1|[email protected]:/ #
Hm, weird. It works for me... Code: # /system/bin/sh -c 'test -e /system/xbin/busybox'; echo $? 0 [color=silver]<-- no error - file exists[/color] # /system/bin/sh -c 'test -e /system/xbin/busybox1'; echo $? 1 [color=silver]<-- error - file does not exist[/color] I didn't try it in an edify script because I don't feel like rebooting my phone right now, but I don't see why it wouldn't work. Try running the "sh -c test ..." command in adb shell while in recovery and see what happens. Also, just a side note: backslash is NOT the same as slash. If you are going to write shell/edify scripts, you need to know at least that distinction. That is why your Code: tags are not working right.[/b][/i][/size]
ravilov said: Hm, weird. It works for me... Code: # /system/bin/sh -c 'test -e /system/xbin/busybox'; echo $? 0 [color=silver]<-- no error - file exists[/color] # /system/bin/sh -c 'test -e /system/xbin/busybox1'; echo $? 1 [color=silver]<-- error - file does not exist[/color] I didn't try it in an edify script because I don't feel like rebooting my phone right now, but I don't see why it wouldn't work. Try running the "sh -c test ..." command in adb shell while in recovery and see what happens. Also, just a side note: backslash is NOT the same as slash. If you are going to write shell/edify scripts, you need to know at least that distinction. That is why your Code: tags are not working right.[/b][/i][/size][/QUOTE] I see, I wasn't doing the echo, and what you posted shows exactly what you posted. DOH on the CODE :good: So I have it on record (for my own personal reference) [CODE] ifelse( ((run_program("/system/bin/sh", "-c", "test -e /system/xbin/busybox; echo $?") == 1 || (run_program("/system/bin/sh", "-c", "test -e /system/bin/busybox; echo $?") == 1 || (run_program("/system/bin/sh", "-c", "test -e /system/xbin/busibox; echo $?") == 1 || (run_program("/system/bin/sh", "-c", "test -e /system/bin/busibox; echo $?") == 1), ( ui_print("* Did not find it. Installing..."); set_perm(0, 1000, 0755, "/system/xbin/busybox"); symlink("/system/xbin/busybox", "/system/bin/busybox"); run_program("/system/xbin/busybox", "--install", "-s", "/system/xbin"); ), ( ui_print("* Found it. Proceeding..."); ) ); and yes, I meant the 'busibox' part, because I have seen that in some roms Click to expand... Click to collapse
You guys know way more about this stuff than I do... although i am a programmer could I get some insight over here: http://forum.xda-developers.com/showthread.php?t=2796055 having an issue getting my shell scripts to actually run... Rockin' it from my Smartly GoldenEye 35 NF1 (muchas gracias:* @iB4STiD @loganfarrell @muniz_ri @Venom0642 @ted77usa @rebel1699* @iB4STiD) ~ 20GB free cloud https://copy.com?r=vtiraF Check me out online @ http://kevin.pirnie.us note: the scripts do run in adb shell
published API docs NFHimself said: Hi, I haven't seen any good resources for how to edit edify scripts, so I thought I would create this thread so we can pool our knowledge on the subject. Click to expand... Click to collapse I found some official documentation of the API on the Android Web site here: https://source.android.com/devices/tech/ota/inside_packages.html NFHimself said: [*]write_raw_image(PATH, PARTITION); This is one of those tricky ones, the PATH is somewhere on your phone with the image to be flashed to a PARTITION on your phone. The trouble is, how do you specify what partition gets flashed? Is there any restriction on where the file has to be? If MTD conventions are used, you are looking for "system", "boot", "recovery", "logo.bin". (All this means that each partition has a name stored somewhere, and if you know it, you can write to it.) Maybe it will accept device references like /dev/block/mmcblk0p8. This depends on the update-binary file you are using. Ex. write_raw_image("/tmp/logo.bin", "logo.bin"); Ex. write_raw_image("/tmp/logo.bin", "/dev/block/mmcblk0p8"); [*]write_firmware_image(PATH, PARTITION); You would think it would be the same as write_raw_image. Not sure what the difference is. Click to expand... Click to collapse I didn't do a line by line comparison between your description and theirs, but I noticed this part because I was trying to find information about these functions. Only write_raw_image() is a published API function. This is the description: write_raw_image(filename_or_blob, partition) Writes the image in filename_or_blob to the MTD partition. filename_or_blob can be a string naming a local file or a blob-valued argument containing the data to write. To copy a file from the OTA package to a partition, use: write_raw_image(package_extract_file("zip_filename"), "partition_name"); Probably write_firmware_image() is used internally. It could be removed at any time, or it even could be a stub - not a good idea to use it.
[DEV] Kernel Injector
I was teaching myself CM7 kernel build process yesterday (more here) and stumbled across AnyKernel. Big thanks to Koush! However whatever I tried I was not able to get rid of segmentation fault error in unpackbootimg. But I liked the AnyKernel idea so much that I cooked up my own version of it. Lets call it Kernel Injector. Whenever you want to deploy your kernel image you don't have to mess around with read-split-merge-write-boot-image procedure any more. This is all done by the update script now: Code: ui_print(""); ui_print("Kernel Injector by Aprold"); mount("ext4", "EMMC", "/dev/block/mmcblk0p8", "/system"); ui_print("Extracting files..."); package_extract_file("zImage", "/tmp/zImage"); package_extract_dir("modules", "/system/lib/modules"); package_extract_file("kinjector", "/tmp/kinjector"); set_perm(0, 0, 0777, "/tmp/kinjector"); ui_print("Injecting kernel..."); assert(run_program("/system/bin/dd", "if=/dev/block/mmcblk0p3", "of=/tmp/boot.img")=="0"); assert(run_program("/tmp/kinjector", "/tmp/boot.img", "/tmp/zImage", "/tmp/boot.new")=="0"); assert(run_program("/system/bin/dd", "if=/tmp/boot.new", "of=/dev/block/mmcblk0p3")=="0"); unmount("/system"); ui_print("Done!"); Boot image is read and written using system's own dd. Combining kernel image with existing ramdisk is the job for kinjector: Code: /* Kernel Injector by Aprold */ #include <stdio.h> #include <stdlib.h> #include <memory.h> int main(int argc, char **argv) { FILE *in, *out; unsigned char *header_buf, *kernel_buf, *ramdisk_buf; unsigned page_size, *kernel_size, kernel_buf_size, ramdisk_size, ramdisk_buf_size; if (argc < 3) { printf("Usage: %s <existing boot image> <new kernel image> [new boot image]\n", argv[0]); return 1; } // open existing boot image for reading header and ramdisk from there if (in = fopen(argv[1], "rb")) { // get page size from input file fseek(in, 36, SEEK_SET); fread(&page_size, sizeof(page_size), 1, in); fseek(in, 0, SEEK_SET); // read header header_buf = (unsigned char*)malloc(page_size); fread(header_buf, page_size, 1, in); // get kernel and ramdisk sizes from header kernel_size = (unsigned*)header_buf + 2; ramdisk_size = *((unsigned*)header_buf + 4); // read ramdisk ramdisk_buf_size = (ramdisk_size / page_size + 1) * page_size; ramdisk_buf = (unsigned char*)malloc(ramdisk_buf_size); fseek(in, (*kernel_size / page_size + 2) * page_size, SEEK_SET); fread(ramdisk_buf, ramdisk_buf_size, 1, in); fclose(in); // open new kernel image if (in = fopen(argv[2], "rb")) { // get kernel size fseek(in, 0, SEEK_END); *kernel_size = ftell(in); fseek(in, 0, SEEK_SET); // read kernel kernel_buf_size = (*kernel_size / page_size + 1) * page_size; kernel_buf = (unsigned char*)malloc(kernel_buf_size); fread(kernel_buf, *kernel_size, 1, in); memset(kernel_buf + *kernel_size, 0, kernel_buf_size - *kernel_size); // frite new boot image out = fopen(argv[argc > 3 ? 3 : 1], "wb"); fwrite(header_buf, page_size, 1, out); fwrite(kernel_buf, kernel_buf_size, 1, out); fwrite(ramdisk_buf, ramdisk_buf_size, 1, out); fclose(out); free(kernel_buf); } else { printf("Failed to open kernel image %s\n", argv[2]); return 2; } free(header_buf); free(ramdisk_buf); } else { printf("Failed to open boot image %s\n", argv[1]); return 1; } return 0; } Compile it like that: Code: /usr/bin/arm-linux-gnueabi-gcc -static -o kinjector kinjector.c Included is an update.zip which you can use as a reference for your own script. Tested with my phone and I even managed to not brick it. All comments and suggestions are most welcome! - Aprold
Nice. You succeeded where I have failed. Here was the template I was trying to have working for eMMC devices: http://dl.dropbox.com/u/13427114/AnyKernel-OB-test.7z
knzo said: Here was the template I was trying to have working for eMMC devices Click to expand... Click to collapse unpackbootimg from there works just fine. If I had found this working binary before I probably would not have written my own. Still, I'm happy that I did.
Good work dudes! But the question is... if you want to do changes to ramdisk too? Would Anykernel method be able to get rid of it? Regards.
Huexxx said: Would Anykernel method be able to get rid of it? Click to expand... Click to collapse Do you mean replacing kernel and/or ramdisk inside boot image? I must say, I don't know much about ramdisk yet, but it would be simple task to update kinjector to allow both parts replaced. However, then I must change the name of the tool to binjector
Hi, the question is (I can try by myself, but I've no time ATM), apart from zImage, does the script extract the ramdisk into a folder? If in the process the ramdisk is extracted, it's possible to make mods to the files with the updater-script. Regards.
The purpose of AnyKernel (and this kernel injector) is to maximize compatibility by only flashing the zImage and keeping the ramdisk out of it. For this, during the flash process it will unpack boot.img into ramdisk + zImage and replace the latter. But of course, it's possible to change the script to also replace files in the ramdisk (such as init.rc) - at least in AnyKernel - but it somewhat defeats the whole purpose of it.
Huexxx said: does the script extract the ramdisk into a folder? Click to expand... Click to collapse Yes, unpackbootimg does. But inside extracted compressed ramdisk file there is a ramdisk image. I don't see how you can modify this with update-script.
How to port Aroma installer to your Rom
(1) Download this META-INF (2) Extract & you will find "META-INF" folder. (3) Go to META-INF/com/google/android/, replace the updater-script in this folder with your ROM/MOD updater-script. (4) In the same folder, "aroma-config" file is also present, its contents are as follows: HTML: [CODE]Code: ## # # AROMA Installer - based on the Mod-installer by KamikaZeeFu # (c) 2011 by Ahmad Amarullah # amarullz - xda-developers # [url]http://www.amarullz.com/[/url] # NEO ROM AROMA SCRIPT BY LEVENTCCC [CODE]theme("ics");[/CODE] calibrate("0.9263","21","0.9944","1","yes"); viewbox( "Welcome", "\n\n\n\n\n"+ " You're about to flash\n"+ " NeO RoM v3.0\n\n"+ "\n\n\n"+ "Press Next to continue the installation...", "icons/info" ); textbox( #-- Title "NEO ROM v3", #-- Subtitle "FEATURES", #-- Icon "@update", #-- Arg 4 resread("changelogs.txt") ); appendvar("installmsg","\n\nPlease Select Installation Type Below:"); install( "Installing", "Now flashing the Neo ROM...\nPlease Wait...", "icons/install" ); # Set Next Text fo Finish ini_set("text_next", "Finish"); viewbox( "Installation Completed", "Congratulations...\n\n"+ "Your installation is now complete\n\n"+ "Press Finish, reboot and enjoy.\n\nThanks", "icons/info"[/CODE] ); (5) Editing aroma-config file: Code: theme("ics"); 4 themes are available- ics, sense, miui, miui4 Code: resread("changelogs.txt") "changelogs.txt" is also present in the folder Code: META-INF/com/google/android/ Edit this file to include features/changelog of your ROM/MOD.:good::laugh: (6) Final step is to replace your ROM's META-INF folder with this META-INF
222
Thanks will give a try to this. --------------------Signature-------------------- Don't Ever Post A Thanks Post, If I Helpes You, Your Hand Will Automatically Hit THANKS Do Visit My Website For More Information. www.hmpshah.com
Will try this asap... Sounds niceeee... :victory:
[Dev][Guide][All-About-Aroma][For-Tab2]
guys i started a new thread for devs that still don't use the aroma installer binary Click to expand... Click to collapse okay 1 step what is aroma aroma installer: Is an excutable binary that is based on the edify scripting that contains 2 excutables in meta-inf/com/google/android 1.is the ordinary update-binary (know as update binary installer) and the 2.is the aroma binary that split into two parts a.the aroma config and the b.the binary the config is which instructs the binary to make the ui like alert box and the menu box.. Click to expand... Click to collapse LETS DIG DEEPER NOW Setting Rom/Mod Name in Aroma-config Use these codes to show the name of your rom /mod copy pasta this code just under the license Code: ini_set("rom_name", "example rom"); ini_set("rom_version", "you rom version"); ini_set("rom_author", "mythi"); ini_set("rom_device", "GT-P31XX"); ini_set("rom_date", "date"); Then we need to Show this info so follow and some more typing !! add this just beneath the lines added previously Code: ################################################################################################################### # # STEP 1 - SHOW ROM INFORMATION # viewbox( #-- Title "Hello!", <<------ This can be changed #-- Text "You are about to install <b>"+ <<--------- this can be changed #-- Get Config Value ini_get("rom_name")+ "</b> for <b>"+ini_get("rom_device")+"</b>.\n\n"+ " VERSION\t: <b><#selectbg_g>"+ini_get("rom_version")+"</#></b>\n"+ " UPDATED\t: <b><#selectbg_g>"+ini_get("rom_date")+"</#></b>\n\n\n"+ "Press <b>Next</b> to continue the installation.", ^^^ | <----- this can be changed !! | #-- Icon "@welcome" ); <<----------- Remmeber this one We are not done yet !! ADD CREDITS SECTION !! TYPE THESE IN AROMA CONFIG Code: ################################################################################################################### # # STEP 3 - CREDITS # textbox( #-- Title "Thanks To", << THIS CAN BE CHANGED-------------- #-- Subtitle "", << THIS CAN BE CHANGED-------------- #-- Icon "@update", << THIS CAN BE CHANGED-------------- #-- Arg 4 resread("thanks.txt") << THIS CAN BE CHANGED-------------- ); << REMMEBER THIS-------------- NOW GOTO META-INF\COM\GOOGLE\ANDROID\AROMA\HERE AND MAKE A NEW NOTE PAD FILE CALLED thanks AND SAVE AS TXT THEN TYPE WHAT YOU WANT OR USE A TEMPLETE BY ME IN ATTACHMENT NOW YOU ADDED CREDITS PAGE HAVE FUN ADD LICENCE PAGE IN AROMA TYPE THESE Code: ################################################################################################################### # # STEP 2 - TERMS OF USE # agreebox( #-- Title "Important notes!", #-- Subtitle / Description "", #-- Icon "@quarantine", #-- Text Content resread("agreement.txt"), <<------------------ THIS CAN BE CHANGED #-- Checkbox Text "I agree with these and I am not high,drunk,mad !!.", <<------------- THIS TEXT SHOWS BEHIND THE CHECK BOX !! #-- Unchecked Alert Message "You need to agree with the Terms of Use..." <<---------------- THIS SHOWS WHEN BOX IS NOT CHECKED ); <<--------------- REMMBER THIS NOW GO TO META-INF\COM\GOOGLE\ANDROID\AROMA\HERE CALLED agreement AND SAVE AS TXT ANDWHAT YOU WANT TO BE DISPLAYED OR USE TEPELATE BE ME !! IN ATTACHMENT :silly: INSTALLING PROCESS TYPE THESE Code: ################################################################################################################### # # STEP 4 - INSTALLING # ini_set("text_next", "Install now"); viewbox( "Almost Done !!", "You are now ready to begin installation.\n\n"+ "Press <b>GOGOGO</b> to start.\n\n"+ "If you want to review or change any of your installation settings, press <b>Back</b> Button.", "@install" ); ini_set("text_next", "GOGOGO"); <<----------- THIS CAN BE CUSTOMIZED install( "Installing", "Flashing <b>"+ini_get("rom_name")+"</b>...\n"+ "Please Wait...", "icons/install", "Done! Press <b>Next</b> button" ); viewbox( "Installation was successful!", "You are now running <b>"+ini_get("rom_name")+"</b>.\n\n"+ "<b>If installation sucsess please reboot your tab and don't touch any thing</b>\n\n"+ "<b>Leave the tab for 5minutes</b>\n\n"+ "<b>After that setup basic installation</b>\n\n"+ "<b>Don't setup google account !</b>\n\n"+ "<b>If you choose to flash anything on top of the rom you may loose the mods included in it !</b>\n\n"+ "<#selectbg_g><b>Please hit thanks to support the author of this ROM is greatly appreciated!</b></#>\n\n", "@Welcome To FastDream HD" ALL OF THE ABOVE CAN BE CUSTOMIZED !! ); <<------------- REMMBER THIS COMING UP 1.ADD COMPLICATED MENU BOXES 2.ADD SIMPLE MENU BOXES 3.MAKE CUSTOM THEMES FOR AROMA now going to sleep more later
reserved
[GUIDE][Difficulty: Intermediate] Save top 100 quotes from your favourite subreddit
Greetings. After successfully implementing this, I've tried to take this task a further and tried to save the quotes in one (text) file at user desired location along with a prompt of how many posts user wants to pull from reddit. Taker Detail : Get desired (totally customizable from variables) titles/quotes from popular subreddits (like r/quotes) and save them in a text file for future use. GUIDE : 1. Task -> New Task 2. Variable -> Set -> Name "%subreddit" Value "quotes" {or your desired subreddit} 3. Variable -> Set -> Name "%NoOfPosts" Value "25" {25 by default, you can change it as well} Go back to main Task view. 4. Scene -> New Scene -> Name : Reddit1. 5. Add a TextFiled -> Name : How many posts? 6. Add Element -> NumberPicker -> Set Min : 1 , Max=100, Default = 25. Go to VALUE SELECTED Tab -> New Action -> Variable Set -> Name : "%NoOfPosts" to "%new_val" {Thanks to Reddit API, max can be 100 only} 7. Go Back to main scene edit screen. 8. Add Element -> Button -> Label : "OK" -> Go to TAP tab -> Add Action -> Destroy Scene -> Name : "Reddit1". 9. Go Back to TASKS tab. 10. Go to previously created task. {from step 3} 11. SCENE -> Show Scene -> Select "Reddit1" -> UnCheck : Continue Task Immediately 12. Add -> Alert -> Flash -> Text : Getting your data from %subreddit. 13. Add -> NET -> HTTP Get -> Serverort = "json.reddit.com/r/%subreddit/top/?sort=top&t=all&limit=%NoOfPosts" -> TimeOut : 82 {Again thanks to Reddit api} {You can change sort modes by looking at the reddit api} 14. Add -> Alert -> Flash -> Text : Saving %NoOfPosts posts from r/%subreddit... 15. Add -> Code -> Java Scriptlet -> Add following code : Code: var arr = JSON.parse(global("HTTPD")); var i = 0; var mytext = ""; var myarr = []; var i2 = 0; var path1 ="/storage/emulated/0/apks/myquotes3.txt"; var newtext = ""; for (;arr.data.children[i];) { myarr.push(arr.data.children[i].data.title); i++; } for(;myarr[i2];) { newtext = myarr[i2] + "\n \n" ; var ok = writeFile(path1, newtext, true ) i2++; } {you need to change the 'path1' variable} 16. Add-> Variable Clear -> Name : %HTTPD* 17. Add -> Alert -> Text : Saved! Congratulations. You've saved some of the good life quotes directly from reddit. Future enhancements : We can make some automated task where from this text file, daily (or at some interval) we can grab one quote and post it to any particular WhatsApp group or even send a text message. New Ideas are always welcomed. Screenshots here.
@tjhackz : Thank you for sharing! By the way, there is a ";" missing after ")" , before i2++. I was getting a error because that. You should edit your post and add it, because new tasker beginners ( like me ) will have a problem . Once again, thank you!