android - 香气安装程序问题

标签 android shell edify

如果这不是发布此内容的正确位置,我深表歉意...让我知道位置,我可以移动它。

谁能帮我弄清楚我在这里做错了什么。

我正在尝试使用 Aroma 安装程序构建一个 rom(并且正常安装工作正常),用于一些配置选项。

现在,我只想在屏幕上显示选中的选项的值,但什么也没有发生。 Aroma 配置工作正常,但是当我现在开始安装时,没有任何显示...

香气配置

# 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;

更新脚本<​​/h1>
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");

到目前为止,我读过的所有内容都表明这应该是正确的……但显然不是……

真正的更新程序脚本

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");
)
);

日志中的错误信息

终于有一个日志文件被写入,但这里是消息: 第 1 行第 8 列:语法错误,意外的 BAD 1 解析错误

最佳答案

这是您没有注意到的一件事。如果您熟悉 Google 的 Edify Recovery Scripts,您应该知道 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

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

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

关于android - 香气安装程序问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25463460/

相关文章:

android - 在某些时间间隔内导致 GPS 估计不稳定的原因是什么?

Python:从 python shell 命令替换 json 文件中的字符串

linux - ./executable 和 . 之间的区别可执行的

linux - 循环输入中的多个变量?

android - 无法在 android edify 更新程序脚本中挂载数据分区

android - 如何代理对 api.twitter.com 的请求,包括 SSL 证书?

android - 如何让 webview Android 应用程序不显示 adsense 广告?

android - 我应该在哪里为 Main Activity 实现 setOnTouchListener

android-source - META-INF/com/google/android/update-binary 源代码?