W dniach 16.05.2019 do 13.06.2019 mail z forum nie działał poprawnie i mógł zgubić kilka maili, jeśli ktoś się próbował kontaktować proszę zrobić to ponownie. Za utrudnienia przepraszam!


[-]
Reklama



Ocena wątku:
  • 8 głosów - średnia: 3.25
  • 1
  • 2
  • 3
  • 4
  • 5

[-]
Tags
aroma

[Tutorial] Aroma
Aroma to nic innego jak skrypt z UI dzięki któremu użytkownicy romów będą mieli wybór jaki apek czy konfiguracja, mod zostanie zainstalowany w telefonie.

Interesują nas w głównie 2 pliki , updater-script oraz aroma-config. Oczywiście całe aroma trzeba wrzucić do META-INF\com\google\android\

1. Przygotowanie ROMu ZIP pod Aroma

W naszym romie ZIP obok folderu System, robimy sobie folder z naszymi apkami/modami które Aroma ma mieć na liście.

Np.
Dodatki/SetCPU/SetCPU.apk
Dodatki/Opera/OperaMobile.apk
Dodatki/RootExplorer/RootExplorer.apk
Dodatki/Framework1/Framework.apk
Dodatki/Framework2/Framework.apk

2. Przygotowanie pliku aroma-config
### LICENSE:
#
# Copyright © 2011 Ahmad Amarullah ( http://amarullz.com/ )
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

calibrate("0.9718","4","1.0176","-9");

theme("ics");

##
# Initializing Rom Information
#
ini_set("rom_name", "Codename-7");
ini_set("rom_version", "0.3");
ini_set("rom_author", "The Alliance");
ini_set("rom_device", "Xperia Neo V / Neo");
ini_set("rom_date", "5 May 2012");

##
# WELCOME
#
textbox(
#-- Title
"Welcome",

#-- Subtitle
"Welcome to the installer for "+ini_get("rom_name")+".\n\n"+
"Right below is the latest changelog.",

#-- Icon
"@welcome",

#-- Arg 4
resread("changelog.txt")
);

##
# MAIN MENU
#
menubox(
#-- Title
"Codename-7 "+ini_get("rom_version"),

#-- Sub Title
"Select an item below to continue.",

#-- Icon
"@apps",

#-- Will be saved in /tmp/aroma/demo.prop
"demo.prop",

#----------------------+-----------------[ Menubox Items ]-------------------------+---------------#
# TITLE | SUBTITLE | Item Icons #
#----------------------+-----------------------------------------------------------+---------------#

"Install ROM", "Flash Codename 7 on this device", "@install", #-- selected = 1
"Miscellaneous", "", "@apps" #-- selected = 2
);

##
# MISC MENU
#
if prop("demo.prop","selected")=="2" then

menubox(

"Miscellaneous", "Select an item below to continue.", "@apps","other_demo.prop",

#-------------------------+-----------------[ Menubox Items ]-----------------+---------------#
# TITLE | SUBTITLE | Item Icons #
#-------------------------+---------------------------------------------------+---------------#

"Reboot", "Reboot device", "@alert", #-- selected = 1
"Exit", "Return to recovery", "@install" #-- selected = 2
);

#-- Reboot
if prop("other_demo.prop","selected")=="1" then
if
confirm(
#-- Title
"Reboot",
#-- Text
"Reboot device?",
#-- Icon (Optional)
"@alert"
)=="yes"
then
reboot("now");
endif;
endif;

#-- Exit
if prop("other_demo.prop","selected")=="2" then
if
confirm(
#-- Title
"Exit",
#-- Text
"Return to recovery?",
#-- Icon (Optional)
"@alert"
)=="yes"
then
#-- Exit - NOTE: Add dummy argument
exit("");
endif;
endif;

#-- Back To Other Demo Menu
back(
getvar("1")
);
endif;

##
# INSTALLATION TYPE
#
menubox(
"Installation Type",

"Choose the installation type that best suits your needs.",

"@install",

"type.prop",

#------------------------+-----------------[ Menubox Items ]------------------------+---------------#
# TITLE | SUBTITLE | Item Icons #
#------------------------+----------------------------------------------------------+---------------#

"Default", "Installs default pre-AROMA features and configurations", "@install",
"Barebones", "Only required features will be installed", "@apps",
"Custom", "Choose which apps you want to be installed", "@customize"
);

##
# MAIN FEATURES
#
if (prop("type.prop","selected")=="1") then
writetmpfile(
"mods.prop",

#-- Default Values
"selected.1=1\n"+
"selected.2=1\n" +
"selected.3=1\n"
);
else
#-- IF Not "Default" Show Main Features Selection
selectbox(
#-- Title
"Main Features",

#-- Sub Title
"Please choose an option for each of the items:",

#-- Icon: <AROMA Resource Dir>/icons/default.png or <ThemeDir>/icon.default.png
"@default",

#-- Will be saved in /tmp/aroma/mods.prop
"mods.prop",

#-----------------------------------[ Selectbox With Groups]----------------------------------#
# TITLE | SUBTITLE | Initial Value #
#------------------+-----------------------------------------------------------+---------------#

"Device Model", "", 2, #-- Group 1. key = "selected.1"
"Xperia Neo v", "", 1, #-- selected.1 = 1
"Xperia Neo", "", 0, #-- selected.1 = 2
"Root Access", "", 2, #-- Group 2. key = "selected.2"
"Superuser", "Very stable and fast", 1, #-- selected.2 = 1
"SuperSU", "More powerful but less stable", 0, #-- selected.2 = 2
"Systemui", "", 2, #-- Group 3. key = "selected.3"
"Systemui1", "not configurable but has most common options", 0, #-- selected.3 = 1
"Systemui2", "Configurable with quick panel settings, not all options work", 1 #-- selected.3 = 2
);
endif;

##
# CUSTOMIZE
#
if (prop("type.prop","selected")!="3") then
writetmpfile(
#-- Prop file will write to /tmp/aroma/customize.prop
"customize.prop",

#-- Default Values ( item.x.x = value. value=1 selected, value=0 un-selected )
iif(
#-- If Minimalist
prop("type.prop","selected")=="2",

#-- True Value (minimal install)
"item.1.1=0\n"+ #-- Facebook
"item.1.2=0\n"+ #-- Talk
"item.1.3=0\n"+ #-- Twitter

"item.2.1=0\n"+ #-- FileManager
"item.2.2=0\n"+ #-- Nofrills
"item.2.3=0\n"+ #-- TitaniumBackup
"item.2.4=0\n"+ #-- XperiaS
"item.2.5=0\n"+ #-- SIMToolkit
"item.2.6=0\n"+ #-- VolumePLus
"item.2.7=0\n"+ #-- maps
"item.2.8=0\n"+ #-- email

"item.3.1=0\n"+ #-- formating
"item.3.2=0\n"+ #-- LBE
"item.3.3=0\n"+ #-- Cpuspy
"item.3.4=0\n"+ #-- Link2sd
"item.3.5=1\n" #-- Odexing

,
#-- False Value (non minimal install)
"item.1.1=0\n"+ #-- Facebook
"item.1.2=1\n"+ #-- Talk
"item.1.3=0\n"+ #-- Twitter

"item.2.1=1\n"+ #-- FileManager
"item.2.2=0\n"+ #-- Nofrills
"item.2.3=1\n"+ #-- TitaniumBackup
"item.2.4=0\n"+ #-- XperiaS
"item.2.5=1\n"+ #-- SIMToolkit
"item.2.6=1\n"+ #-- VolumePLus
"item.2.7=0\n"+ #-- maps
"item.2.8=0\n"+ #-- email
"item.3.1=0\n"+ #-- formating
"item.3.2=1\n"+ #-- LBE
"item.3.3=1\n"+ #-- Cpuspy
"item.3.4=0\n"+ #-- Link2sd
"item.3.5=1\n" #-- Odexing

)
);
else
#-- IF Installation type = "Custom" Show Customize Selection
checkbox(
#-- Title
"Customize",

#-- Sub Title
"Choose apps that you want to be 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 #
#---------------+-------------------------------------------------------+------------------------#
# Group 1
"Applications", "", 2,
"Facebook", "Share and stay connected with the Android app",0,
"Fonts", "Roboto Fonts",0,
"Twitter", "Official Twitter app", 0,
# Group 2.
"Tools","", 2,
"ES File Manager", "A simple file manager", 1,
"No-frills CPU Control","Allows you to adjust various CPU settings",0,
"Titanium Backup", "A powerful backup and restore tool",0,
"Xperia S style", "The Xperia S addon you used to download",0,
"SIM Toolkit", "SIM management app",0,
"Volume PLus", "Audio Effects app", 0,
"Google Maps","the popular map software",0,
"Email", "Xperia S email client",0,
# Group 3
"Advanced","", 2,
"Factory reset", " wipe all data from the device", 0,
"Security", "LBE Security app", 0,
"CpuSpy", "See whats drinkung your juice",0,
"Link2SD", " create more space on system",0,
"Odexing", "flashable odexing zip",0

);
endif;


##
#
# Next Screen is Installation UI, So change the next button text to "Install Now"
#
ini_set("text_next", "Install");

##
# READY TO INSTALL
#
viewbox(
#-- Title
"Ready to Install",

#-- Text
"ROM is ready to be installed.\n\n"+
"Press <b>Install</b> to begin the installation.\n\n"+
"To review or change any of your installation settings, press <b>Back</b>.\n\n"+
"Press Menu -> Quit Installation to quit.",

#-- Icon
"@install"
);

ini_set("text_next", "Next >");

#-- Extract sleep to /tmp/aroma/sleep. It will be used in updater-script for testing wait script
restotmp("exec_demo/sleep","sleep");

##
# INSTALLATION PROCESS
#
setvar("retstatus",
install(
#-- Title
"Installing",

#-- Installation Process message
"<b>"+ini_get("rom_name")+"</b> is being installed.\n\n"+
"It should take around 1-3 minutes.",

#-- Installation Icon
"@install",

#-- Installation Finish Message
"<b>"+ini_get("rom_name")+"</b> has been successfully installed. Press Next to continue."
)
);

ini_set("text_next", "Finish");


##
# FINISH
#
# You can use return value or "reboot_it" variable to retrive checkbox value
# Example:
# if (checkviewbox(....)=="1" then
# ... checked ...
# endif;
#
checkviewbox(
#-- Title
"Installation Complete",

#-- Text
"<b>"+ini_get("rom_name")+"</b> has been successfully installed.\n\n",

#-- Icon
"@welcome",

#-- Checkbox Text
"Reboot device",

#-- Initial Checkbox value ( 0=unchecked, 1=checked ) - (Optional, default:0)
"1",

#-- Save checked value in variable "reboot_it" (Optional)
"reboot_it"
);

if
getvar("reboot_it")=="1"
then
reboot("onfinish");
endif;

#---- FINISH
Odpowiedz
Oraz plik update-script zrobiony pod aroma-config

##########################################################
## updater-script for Codename 7 with AROMA Installer ##
##########################################################

ui_print("@Initializing file system...");
ui_print("Formatting /system");
format("yaffs2", "MTD", "system", "0");
format("yaffs2","MTD", "cache", "0");
# WipeData
if
file_getprop("/tmp/aroma/customize.prop","item.3.1") == "1"
then
ui_print("Wiping /data");
format( "yaffs2","MTD", "userdata", "0");
endif;

ui_print("Mounting /system");
mount( "yaffs2", "MTD", "system", "/system");
ui_print("Mounting /data");
mount( "yaffs2", "MTD", "userdata", "/data");
ui_print(" ");
delete_recursive("/sdcard/.android_secure");
delete_recursive("/data/dalvik-cache");
ui_print("@Copying files...");
show_progress(0.95, "-55000");
ui_print("- Core Files");
package_extract_dir("data", "/data");
package_extract_dir("system", "/system");
ui_print(" ");

##---- Features
ui_print("@Main Features");

# build.prop
if
file_getprop("/tmp/aroma/mods.prop","selected.1") == "1"
then
ui_print("Device is: Xperia Neo V (MT11)");
package_extract_dir("customize/Mt11", "/system");
else
ui_print("Device is: Xperia Neo (MT15)");
package_extract_dir("customize/Mt15", "/system");
endif;

# Superuser or SuperSU
if
file_getprop("/tmp/aroma/mods.prop","selected.2") == "1"
then
ui_print("Root Access: Superuser");
package_extract_dir("customize/Superuser", "/system");
else
ui_print("Root Access: SuperSU");
package_extract_dir("customize/SuperSU", "/system");
endif;
# System ui
if
file_getprop("/tmp/aroma/mods.prop","selected.3") == "1"
then
ui_print("SystemUi: non configurable");
package_extract_dir("customize/SysUi/allinone", "/system/app");
else
ui_print("SystemUi: with Quickpanel");
package_extract_dir("customize/SysUi/Qpanel", "/system/app");
endif;
ui_print(" ");
##---- End Features

##---- Customization
ui_print("@Applications");
# Facebook
if
file_getprop("/tmp/aroma/customize.prop","item.1.1") == "1"
then
ui_print("- Facebook");
package_extract_dir("customize/Facebook", "/data/app");
endif;

# Fonts
if
file_getprop("/tmp/aroma/customize.prop","item.1.2") == "1"
then
ui_print("- Roboto Fonts");
package_extract_dir("customize/Fonts", "/system");
endif;

# Twitter
if
file_getprop("/tmp/aroma/customize.prop","item.1.3") == "1"
then
ui_print("- Twitter");
package_extract_dir("customize/Twitter", "/data/app");
endif;
ui_print(" ");
ui_print("@Tools");
# EsFileManager
if
file_getprop("/tmp/aroma/customize.prop","item.2.1") == "1"
then
ui_print("- ES File Manager");
package_extract_dir("customize/ESfile", "/data/app");
endif;

# Nofrills
if
file_getprop("/tmp/aroma/customize.prop","item.2.2") == "1"
then
ui_print("- No-frills CPU Control");
package_extract_dir("customize/Nofrills", "/data/app");
endif;

# TitaniumBackup
if
file_getprop("/tmp/aroma/customize.prop","item.2.3") == "1"
then
ui_print("- Titanium Backup");
package_extract_dir("customize/TitaniumBackup", "/data/app");
endif;

# XperiaS
if
file_getprop("/tmp/aroma/customize.prop","item.2.4") == "1"
then
ui_print("- Xperia S");
package_extract_dir("customize/XperiaS", "/system");
endif;

# SIMToolkit
if
file_getprop("/tmp/aroma/customize.prop","item.2.5") == "1"
then
ui_print("- SIM Toolkit");
package_extract_dir("customize/Stk", "/system/app");
endif;
# VolumePlus
if
file_getprop("/tmp/aroma/customize.prop","item.2.6") == "1"
then
ui_print("- Volume PLus");
package_extract_dir("customize/VolumePlus", "/system/app");
endif;
# Maps
if
file_getprop("/tmp/aroma/customize.prop","item.2.7") == "1"
then
ui_print("- Maps");
package_extract_dir("customize/Maps", "/system/app");
endif;
# Email
if
file_getprop("/tmp/aroma/customize.prop","item.2.8") == "1"
then
ui_print("- Email");
package_extract_file("customize/XperiaS/app/SemcEmail.apk", "/system/app");
endif;
# LBE
if
file_getprop("/tmp/aroma/customize.prop","item.3.2") == "1"
then
ui_print("- LBE");
package_extract_dir("customize/LBE", "/system/app");
endif;
# CPUSPy
if
file_getprop("/tmp/aroma/customize.prop","item.3.3") == "1"
then
ui_print("- CpuSpy");
package_extract_dir("customize/CPuSPy", "/system/app");
endif;
# Link2SD
if
file_getprop("/tmp/aroma/customize.prop","item.3.4") == "1"
then
ui_print("- Link2sd");
package_extract_dir("customize/Link2SD", "/system/app");
endif;
# Odeing
if
file_getprop("/tmp/aroma/customize.prop","item.3.5") == "1"
then
ui_print("- Odexing.zip");
package_extract_dir("customize/Odexing", "/sdcard");
endif;

ui_print(" ");
##---- End Customization

set_progress(0.95);
show_progress(0.05, "-2000");
symlink("busybox", "/system/bin/busybox");
symlink("toolbox", "/system/bin/cat");
symlink("toolbox", "/system/bin/chmod");
symlink("toolbox", "/system/bin/chown");
symlink("toolbox", "/system/bin/cmp");
symlink("busybox", "/system/bin/cp");
symlink("toolbox", "/system/bin/ctrlaltdel");
symlink("toolbox", "/system/bin/date");
symlink("toolbox", "/system/bin/dd");
symlink("toolbox", "/system/bin/df");
symlink("toolbox", "/system/bin/dmesg");
symlink("toolbox", "/system/bin/getevent");
symlink("toolbox", "/system/bin/getprop");
symlink("toolbox", "/system/bin/hd");
symlink("toolbox", "/system/bin/id");
symlink("toolbox", "/system/bin/ifconfig");
symlink("toolbox", "/system/bin/iftop");
symlink("toolbox", "/system/bin/insmod");
symlink("toolbox", "/system/bin/ioctl");
symlink("toolbox", "/system/bin/ionice");
symlink("toolbox", "/system/bin/kill");
symlink("toolbox", "/system/bin/ln");
symlink("toolbox", "/system/bin/log");
symlink("toolbox", "/system/bin/ls");
symlink("toolbox", "/system/bin/lsmod");
symlink("toolbox", "/system/bin/lsof");
symlink("toolbox", "/system/bin/mkdir");
symlink("toolbox", "/system/bin/mount");
symlink("toolbox", "/system/bin/mv");
symlink("toolbox", "/system/bin/nandread");
symlink("toolbox", "/system/bin/netstat");
symlink("toolbox", "/system/bin/newfs_msdos");
symlink("toolbox", "/system/bin/notify");
symlink("toolbox", "/system/bin/printenv");
symlink("toolbox", "/system/bin/ps");
symlink("toolbox", "/system/bin/reboot");
symlink("toolbox", "/system/bin/renice");
symlink("toolbox", "/system/bin/rm");
symlink("toolbox", "/system/bin/rmdir");
symlink("toolbox", "/system/bin/rmmod");
symlink("toolbox", "/system/bin/route");
symlink("toolbox", "/system/bin/schedtop");
symlink("toolbox", "/system/bin/sendevent");
symlink("toolbox", "/system/bin/setconsole");
symlink("toolbox", "/system/bin/setprop");
symlink("toolbox", "/system/bin/sleep");
symlink("toolbox", "/system/bin/smd");
symlink("toolbox", "/system/bin/start");
symlink("toolbox", "/system/bin/stop");
symlink("toolbox", "/system/bin/sync");
symlink("toolbox", "/system/bin/top");
symlink("toolbox", "/system/bin/umount");
symlink("toolbox", "/system/bin/uptime");
symlink("toolbox", "/system/bin/vmstat");
symlink("toolbox", "/system/bin/watchprops");
symlink("toolbox", "/system/bin/wipe");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 0, 0777, 0777, "/system/etc/init.d");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm_recursive(1002, 1002, 0755, 0440, "/system/etc/bluetooth");
set_perm(0, 0, 0755, "/system/etc/bluetooth");
set_perm(1000, 1000, 0640, "/system/etc/bluetooth/auto_pairing.conf");
set_perm(3002, 3002, 0444, "/system/etc/bluetooth/blacklist.conf");
set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
set_perm(0, 0, 06755, "/system/bin/su");
symlink("/system/bin/su", "/system/xbin/su");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
show_progress(0.1, 10);
show_progress(0.2, 0);
package_extract_file("fix_permissions", "/tmp/fix_permissions");
set_perm(0, 0, 0777, "/tmp/fix_permissions");
run_program("/tmp/fix_permissions");
package_extract_file("installbusybox", "/tmp/installbusybox");
set_perm(0, 0, 0777, "/tmp/installbusybox");
run_program("/tmp/installbusybox");
ui_print(" ");

ui_print("@Unmounting...");
ui_print("/system");
unmount("/system");
ui_print("/data");
unmount("/data");
ui_print(" ");
ui_print("@Installation complete!");
set_progress(1);
Odpowiedz
Zrezygnowałem z tłumaczenia wszystkiego od zera, jest tego zbyt dużo. Oba pliki to gotowce wyjęte z romu. Łatwo można zauważyć zależności między plikami np :

Aroma-config :
"Device Model", "", 2, #-- Group 1. key = "selected.1"
"Xperia Neo v", "", 1, #-- selected.1 = 1
"Xperia Neo", "", 0, #-- selected.1 = 2


Update-Script :
if
file_getprop("/tmp/aroma/mods.prop","selected.1") == "1"
then
ui_print("Device is: Xperia Neo V (MT11)");
package_extract_dir("customize/Mt11", "/system");

else
ui_print("Device is: Xperia Neo (MT15)");
package_extract_dir("customize/Mt15", "/system");

endif;

z pliku update-script. Cały skrypt to jeden wielki If, czyli co wybrane to instalowane.
Odpowiedz


Skocz do:


Użytkownicy przeglądający ten wątek: 1 gości