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; } } }
void show_install_update_menu() { static char* headers[] = { "Install update from zip file", "", NULL }; char* install_menu_items[] = { "choose zip from sdcard", "install zip from sideload", "apply /sdcard/update.zip", "toggle signature verification", NULL, NULL }; char *other_sd = NULL; if (volume_for_path("/emmc") != NULL) { other_sd = "/emmc/"; install_menu_items[4] = "choose zip from internal sdcard"; } else if (volume_for_path("/external_sd") != NULL) { other_sd = "/external_sd/"; install_menu_items[4] = "choose zip from external sdcard"; } for (;;) { int chosen_item = get_menu_selection(headers, install_menu_items, 0, 0); switch (chosen_item) { case ITEM_SIG_CHECK: toggle_signature_check(); break; case ITEM_APPLY_UPDATE: { if (confirm_selection("Confirm install?", "Yes - Install /sdcard/update.zip")) install_zip(SDCARD_UPDATE_FILE); break; } case ITEM_CHOOSE_ZIP: show_choose_zip_menu("/sdcard/"); write_recovery_version(); break; case ITEM_APPLY_SIDELOAD: apply_from_adb(); break; case ITEM_CHOOSE_ZIP_INT: if (other_sd != NULL) show_choose_zip_menu(other_sd); break; default: return; } } }
void show_install_update_menu() { static char* headers[] = { "从SD卡选择ZIP格式文件进行刷机", "", NULL }; char* install_menu_items[] = { "从SD卡中选择一个ZIP格式刷机包", "从电脑用ADB载入刷机包", "直接应用/sdcard/update.zip刷机", "启用/禁用签名校验", NULL, NULL }; char *other_sd = NULL; if (volume_for_path("/emmc") != NULL) { other_sd = "/emmc/"; install_menu_items[4] = "从内置SD卡选择ZIP文件"; } else if (volume_for_path("/external_sd") != NULL) { other_sd = "/external_sd/"; install_menu_items[4] = "从外置SD卡选择ZIP文件"; } for (;;) { int chosen_item = get_menu_selection(headers, install_menu_items, 0, 0); switch (chosen_item) { case ITEM_SIG_CHECK: toggle_signature_check(); break; case ITEM_APPLY_UPDATE: { if (confirm_selection("确认安装?", "是-直接刷入/sdcard/update.zip")) install_zip(SDCARD_UPDATE_FILE); break; } case ITEM_CHOOSE_ZIP: show_choose_zip_menu("/sdcard/"); write_recovery_version(); break; case ITEM_APPLY_SIDELOAD: apply_from_adb(); break; case ITEM_CHOOSE_ZIP_INT: if (other_sd != NULL) show_choose_zip_menu(other_sd); break; default: return; } } }
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; } } }