void show_install_update_menu()
{
    static char* headers[] = {  "Apply update from .zip file on SD card",
                                "",
                                NULL
    };
    for (;;)
    {
        int chosen_item = get_menu_selection(headers, INSTALL_MENU_ITEMS, 0, 0);
        switch (chosen_item)
        {
            case ITEM_ASSERTS:
                toggle_script_asserts();
                break;
            case ITEM_SIG_CHECK:
                toggle_signature_check();
                break;
            case ITEM_APPLY_SDCARD:
            {
                if (confirm_selection("Confirm install?", "Yes - Install /sdcard/update.zip"))
                    install_zip(SDCARD_UPDATE_FILE);
                break;
            }
            case ITEM_CHOOSE_ZIP:
                show_choose_zip_menu();
                break;
            default:
                return;
        }

    }
}
示例#2
0
void updatemenu()
{

static char* headers[] = {  "Update Menu",
                                "",
                                NULL
    };

 static char* list[] = { "~~~> Go Back <~~~",
			 "Update.zip from Sdcard",
                         "Select .zip from Sdcard",
                         "Toggle Signature Verification",
                         "Toggle Script Asserts",
                            NULL
};

for (;;)
    {
        int chosen_item = get_menu_selection(headers, list, 0);
	if (chosen_item == GO_BACK)
            break;
	switch (chosen_item)
	{
		case 0:
		{
		return;
		break;
		}
		case 1:
		 {
                if (confirm_selection("Confirm install?", "Yes - Install /sdcard/update.zip"))
                    install_zip(SDCARD_PACKAGE_FILE);
                break;
            }
		case 2:
		{
		show_choose_zip_menu();
                break;
		}
		case 3:
		 toggle_signature_check();
                break;
		case 4:
		toggle_script_asserts();
		break;
	}
     }
}
void show_install_update_menu()
{
#ifdef BOARD_HAS_SDCARD_INTERNAL
    char sdcard_package_file[PATH_MAX];
    char confirm[PATH_MAX];
    int chosen_sdcard = -1;
#endif
    static char* headers[] = {  "Apply update from .zip file on SD card",
                                "",
                                NULL
    };
    for (;;)
    {
        int chosen_item = get_menu_selection(headers, INSTALL_MENU_ITEMS, 0, 0);
        switch (chosen_item)
        {
            case ITEM_ASSERTS:
                toggle_script_asserts();
                break;
            case ITEM_SIG_CHECK:
                toggle_signature_check();
                break;
            case ITEM_APPLY_SDCARD:
            {
#ifdef BOARD_HAS_SDCARD_INTERNAL
                chosen_sdcard = show_sdcard_selection_menu();
                if (chosen_sdcard > -1)
                {
                    switch (chosen_sdcard) {
                        case 0:
                            sprintf(sdcard_package_file, "/sdcard/update.zip");
                            break;
                        case 1:
                            sprintf(sdcard_package_file, "/sdcard-ext/update.zip");
                            break;
                    }
                    sprintf(confirm, "Yes - Install %s", sdcard_package_file);
                }
                else break;
                if (confirm_selection("Confirm install?", confirm))
                    install_zip(sdcard_package_file);
#else
                if (confirm_selection("Confirm install?", "Yes - Install /sdcard/update.zip"))
                    install_zip(SDCARD_UPDATE_FILE);
#endif
                break;
            }
            case ITEM_CHOOSE_ZIP:
#ifdef BOARD_HAS_SDCARD_INTERNAL
                chosen_sdcard = show_sdcard_selection_menu();
                if (chosen_sdcard > -1)
                {
                    switch (chosen_sdcard) {
                        case 0:
                            show_choose_zip_menu("/sdcard");
                            break;
                        case 1:
                            show_choose_zip_menu("/sdcard-ext");
                            break;
                    }
                }
                else break;
#else
                show_choose_zip_menu("/sdcard");
#endif
                break;
            default:
                return;
        }

    }
}