1

I apologize if this is not the right place to post this... let me know where is, and I can move it.

Can someone help me figure out what I am doing wrong here.

I am trying to buuild a rom (and the normal install works just fine), with an Aroma installer for some config options.

Right now, all I want to do is to show the values of the options checked on the screen, but nothing is happenning. The Aroma config works just fine, but when I get to the install now, nothing is showing...

Aroma Config

# FORCE COLOR
ini_set("force_colorspace","rgba");

# ROM/Mod INFORMATION
ini_set("rom_name",             "o7th S5 Edition");
ini_set("rom_version",          "1.4");
ini_set("rom_author",           "kevp75");
ini_set("rom_device",           "Galaxy s4 I337");
ini_set("rom_date",             "8-22-14");

# THEME
theme("franzyroy");

splash(7000, "o7th");

# FONT
fontresload( "0", "ttf/Roboto-Regular.ttf;ttf/DroidSansFallback.ttf;", "10" );
fontresload( "1", "ttf/Roboto-Regular.ttf;ttf/DroidSansFallback.ttf;", "12" );

# LANGUAGE
loadlang("langs/en.lang");

# SHOW ROM/Mod INFORMATION

viewbox(
    #-- Title
    "<~welcome.title>",  
    #-- Text
    "<~welcome.text1> <b>"+
    #-- Get Config Value
    ini_get("rom_name")+
    "</b> <~common.for> <b>"+ini_get("rom_device")+"</b>.\n\n"+    
    "<~welcome.text2>\n\n"+ 
    "  <~welcome.version>\t: <b><#selectbg_g>"+ini_get("rom_version")+"</#></b>\n"+
    "  <~welcome.updated>\t: <b><#selectbg_g>"+ini_get("rom_date")+"</#></b>\n\n\n"+
    "<~welcome.next>",  
    #-- Icon
    "@welcome"
);

# LICENSE
agreebox(
    #-- Title
    "o7th S5 Edition",  
    #-- Subtitle / Description
    "Read Carefully",  
    #-- Icon:
    "@license",  
    #-- Text Content 
    resread("license.txt"),  
    #-- Checkbox Text
    "Do you agree??",  
    #-- Unchecked Alert Message
    "You've to agree!!"
);

menubox(
    "o7th S5 Edition",  
    "Install or Not, it's your choice!",  
    "@apps",    
    "menu.prop",    
    "Install", "Install This Rom", "@install",
    "QUIT", "I'm a quitter... get me outta here", "@install"
);

if prop("menu.prop", "selected") == "1" then

    # Tweak Selection
    checkbox(
        "Tweaker",
        "Choose Tweaks to Apply:",
        "@personalize",
        "tweaks.prop",  
        "Zip-Align Data", "Select to zip-align your installed apps every 3 days", 1,
        "Modify Mounts", "Select to speed up your main partitions", 1,
        "Move Dalvik Cache", "This will move your dalvik-cache to your /cache partition freeing up space for apps", 0,
        "Kevs Tweaks", "Clean Logs, Vaccuum Databases, Tweak Network Speeds, etc...", 1
    );

    # App Selection
    checkbox(
        "App Selection",
        "Please note, that if you do not select an S5 app, the S4 counterpart if any, will be installed instead. And as always, any 3rd party launcher can and probably will make some widgets go haywire",
        "@personalize",
        "apps.prop",    
        "S5 AccuWeather Widget", "", 1,
        "S5 Activity Zone", "", 1,
        "S5 Browser", "", 1,
        "S5 Calculator", "", 1,
        "S5 Gallery", "", 1,
        "S5 Group Play", "", 1,
        "S5 Memo", "", 1,
        "S5 Music Player", "", 1,
        "S5 S Note", "", 1,
        "S5 S Planner", "", 1,
        "S5 S Health", "", 1,
        "S5 Smart Remote", "", 1,
        "S5 Translator", "", 1,
        "S5 Video Player", "", 1,
        "S5 Camera", "", 1,
        "ViPER4Android", "Best audio effects out there", 0,
        "XPosed & Wanam", "XPosed Framework installer and Wanam", 0
    );

    # De-Bloater
    menubox(
        "De-Bload This Sucka!",  
        "De-Bloating will not remove any apps you have chosen to include.\nBut will get rid of the rest.",  
        "@apps",    
        "debloat.prop",    
        #-------------------------+-----------------[ Menubox Items ]-------------------------+---------------#
        # TITLE                   |  SUBTITLE                                                 |   Item Icons  #
        #-------------------------+-----------------------------------------------------------+---------------#     
        "De-Bloat", "Make me slim",      "@install",      #-- selected = 1
        "Don't De-Bloat",  "Keep me a piggy",                        "@install"       #-- selected = 2
    );

    # Launcher Selection
    selectbox(
        "o7th S5 Edition",  
        "Select your default launcher",
        "icons/install",
        "launcher.prop",
        "Select One", "", 2,       #-- Group 1. key = "selected.1"
        "Touchwiz", "Default Samsung launcher", 1,       #-- selected.1 = 1
        "Nova", "Highly customizable, performance driven launcher", 0,       #-- selected.1 = 2
        "Smart Launcher", "Lightweight intuitive launcher", 0,        #-- selected.1 = 3
        "Go Launcher EX", "Themable feature packed launcher", 0,        #-- selected.1 = 4
        "Google Now", "Google's launcher", 0,        #-- selected.1 = 5
        "Themer", "Highly themable launcher", 0        #-- selected.1 = 6
    );

    # Installation UI
    ini_set("text_next", "Install Now");
    ini_set("icon_next", "@installbutton"); 
    viewbox(
      #-- Title
        "Ready to Install",
      #-- Text
        "Ready to install.\n\n"+
        "Press <b>Install ROM</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"
    );
    alert( "Alert", "Installation will begin now...");
endif;

# INSTALLATION PROCESS
if prop("menu.prop","selected")== "1" then

    ini_set("text_next", "Next");
    ini_set("icon_next", "@next");

    install(
        "o7th S5 Edition Installing",
        getvar("rom_name") + "\n" +
        "Go grab a coffee... this may take awhile." +
        "",
        "icons/install"
    );

    ini_set("text_next", "Finish");
    ini_set("icon_next", "@finish");

    checkviewbox(
        #-- Title
        "Installation Completed",   
        #-- Text
        "<#selectbg_g><b>Congrats...</b></#>\n\n"+
        "<b>"+ini_get("rom_name")+"</b> has been installed.\n\n",    
        #-- Icon
        "@welcome",
        #-- Checkbox Text
        "Reboot your device now.",
        #-- Initial Checkbox value ( 0=unchecked, 1=checked ) -  (Optional, default:0)
        "1",
        #-- Save checked value in variable "reboot_it" (Optional)
        "reboot_it"
    );
endif;

# Check if reboot checkbox was checked
if getvar("reboot_it")=="1" then
    reboot("onfinish");
endif;

Updater-Script

ui_print("Just Testing the Installer...");
sleep(1);
ui_print("-- Tweaks");
sleep(1);
ui_print("Zip-Align: ");
ui_print(file_getprop("/tmp/aroma/tweaks.prop", "item.1.1") == "1");
ui_print("Modify Mounts: ");
ui_print(file_getprop("/tmp/aroma/tweaks.prop", "item.1.2") == "1");
ui_print("Move Dalvik: ");
ui_print(file_getprop("/tmp/aroma/tweaks.prop", "item.1.3") == "1");
ui_print("Kevs Tweaks: ");
ui_print(file_getprop("/tmp/aroma/tweaks.prop", "item.1.4") == "1");
sleep(1);
ui_print("-- Apps");
sleep(1);
ui_print("S5 AccuWeather Widget: ");
ui_print(file_getprop("/tmp/aroma/apps.prop", "item.1.1") == "1");
ui_print("S5 Activity Zone: ");
ui_print(file_getprop("/tmp/aroma/apps.prop", "item.1.2") == "1");
ui_print("S5 Browser: ");
ui_print(file_getprop("/tmp/aroma/apps.prop", "item.1.3") == "1");
ui_print("S5 Calculator: ");
ui_print(file_getprop("/tmp/aroma/apps.prop", "item.1.4") == "1");
ui_print("S5 Gallery: ");
ui_print(file_getprop("/tmp/aroma/apps.prop", "item.1.5") == "1");
ui_print("S5 Group Play: ");
ui_print(file_getprop("/tmp/aroma/apps.prop", "item.1.6") == "1");
ui_print("S5 Memo: ");
ui_print(file_getprop("/tmp/aroma/apps.prop", "item.1.7") == "1");
ui_print("S5 Music Player: ");
ui_print(file_getprop("/tmp/aroma/apps.prop", "item.1.8") == "1");
ui_print("S5 S Note: ");
ui_print(file_getprop("/tmp/aroma/apps.prop", "item.1.9") == "1");
ui_print("S5 S Planner: ");
ui_print(file_getprop("/tmp/aroma/apps.prop", "item.1.10") == "1");
ui_print("S5 Shealth: ");
ui_print(file_getprop("/tmp/aroma/apps.prop", "item.1.11") == "1");
ui_print("S5 Smart Remote: ");
ui_print(file_getprop("/tmp/aroma/apps.prop", "item.1.12") == "1");
ui_print("S5 Translator: ");
ui_print(file_getprop("/tmp/aroma/apps.prop", "item.1.13") == "1");
ui_print("S5 Video Player: ");
ui_print(file_getprop("/tmp/aroma/apps.prop", "item.1.14") == "1");
ui_print("S5 Camera: ");
ui_print(file_getprop("/tmp/aroma/apps.prop", "item.1.15") == "1");
ui_print("ViPER4Android: ");
ui_print(file_getprop("/tmp/aroma/apps.prop", "item.1.16") == "1");
ui_print("XPosed & Wanam: ");
ui_print(file_getprop("/tmp/aroma/apps.prop", "item.1.17") == "1");
sleep(1);
ui_print("-- De-Bloater");
sleep(1);
ui_print("De-Bloat or Not: ");
ui_print(file_getprop("/tmp/aroma/debloat.prop", "selected") == "1");
sleep(1);
ui_print("-- Launcher");
sleep(1);
ui_print("S5 Touchwiz: ");
ui_print(file_getprop("/tmp/aroma/launcher.prop", "selected.1") == "1");
ui_print("Nova: ");
ui_print(file_getprop("/tmp/aroma/launcher.prop", "selected.2") == "1");
ui_print("Smart: ");
ui_print(file_getprop("/tmp/aroma/launcher.prop", "selected.3") == "1");
ui_print("Go: ");
ui_print(file_getprop("/tmp/aroma/launcher.prop", "selected.4") == "1");
ui_print("Google: ");
ui_print(file_getprop("/tmp/aroma/launcher.prop", "selected.5") == "1");
ui_print("Themer: ");
ui_print(file_getprop("/tmp/aroma/launcher.prop", "selected.6") == "1");

So far, everything I've read shows that this should be correct... but it's obviously not...

True updater-script

ifelse(file_getprop("/tmp/aroma/menu.prop","selected") == "1",
(
    ui_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
    ui_print("~                                       ~");
    ui_print("~     Galaxy i337 S5 Edition v.1.1.5    ~");
    ui_print("~         Safestrap KitKat 4.4.2        ~");
    ui_print("~               By kevp75               ~");
    ui_print("~                                       ~");
    ui_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
    unmount("/system");
    unmount("/cache");
    unmount("/data");
    ui_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
    ui_print("~ Prepping Your System                  ~");
    ui_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
    mount("ext4", "EMMC", "/dev/block/mmcblk0p18", "/cache");
    mount("ext4", "EMMC", "/dev/block/mmcblk0p29", "/data");
    mount("ext4", "EMMC", "/dev/block/mmcblk0p16", "/system");
    sleep(1);
    show_progress(0.1, 0);
),
(
    ui_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
    ui_print("~                                       ~");
    ui_print("~     Galaxy i337 S5 Edition v.1.1.5    ~");
    ui_print("~         Safestrap KitKat 4.4.2        ~");
    ui_print("~               By kevp75               ~");
    ui_print("~                                       ~");
    ui_print("~                QUITTER                ~");
    ui_print("~                                       ~");
    ui_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
    unmount("/system");
    unmount("/cache");
    unmount("/data");
)
);

Error Message In Log

Finally have a log file getting written, but here is the message: line 1 col 8:syntax error, unexpected BAD 1 parse errors

4

1 回答 1

1

这是你没有注意到的一件事。如果您熟悉 Google 的 Edify 恢复脚本,您应该知道 ui_print 的语法是 with ("sampletext");

当您拥有此代码时:

ui_print(file_getprop("/tmp/aroma/tweaks.prop", "item.1.3") == "1");

有一对双引号。这在很多层面上都破坏了语法。你实际上应该这样做:

ui_print("file_getprop(/tmp/aroma/tweaks.prop, item.1.3) == 1");

注意我把双引号放在哪里。再次重写,ui_print 仅在括号内和引号内打印。在一个 ui_print 命令中不能有双对或更多对。理论上,您上面的命令将打印 /tmp/aroma/tweaks.prop 然后打印出 item.1.3 和 1。按以下顺序:

/tmp/aroma/tweaks.prop
item.1.3
1

这不是语法的工作方式,只会返回错误。香气安装程序不会这样做,而是继续执行下一个可行的操作。但是,如果您这样做:

ui_print("file_getprop /tmp/aroma/tweaks.prop, item.1.3 ==1");

它会打印出你想要的东西。

此外,您不能在 (" ") 中使用任何类型的括号或任何类型的引号。 Edify 内置的解释器只会将第二个括号视为新命令的开始。但是语法错误会返回错误状态 1。

///////////////////////////////////////// ///////////////////////////////////////// /

大时间把我所说的一切改写成简单的术语。

你的代码有一个大问题。问题是您在 ui_print 命令中使用的额外符号。

ui_print(file_getprop("/tmp/aroma/tweaks.prop", "item.1.3") == "1");

此代码的 3 个主要问题是第一对原始对中的额外括号。系统将与额外的混淆,并从他们那里接受新的命令。第一对中的额外引号也使系统更加混乱,因为它现在认为这是一个新命令。经验法则:永远不要在命令中使用多个引号、括号、斜杠、句点,因为机器不像你那样思考。他们通过书面语言得到的想法与您的想法不同。这会导致错误。

您看不到任何内容的原因是因为所有命令都出错了。我希望从 2 个版本的解释中你知道我在说什么:P

于 2014-08-25T21:22:24.240 回答