void parse_settings() {
	settings config;

	/* If we have an internal emmc check for sdcard, if it's not present
	 * default COTSETTINGS to the emmc otherwise check the sdcard for a
	 * settings file, if it's not present check the emmc (this sets the
	 * file to be created to the emmc as well). */
	if(OTHER_SD_CARD && OTHER_SD_CARD == EMMC) {
		if(ensure_path_mounted("/sdcard") != 0) {
			ensure_path_mounted("/emmc");
			COTSETTINGS = "/emmc/0/cotrecovery/settings.ini";
		} else if(ini_parse(COTSETTINGS, settings_handler, &config) < 0)
			COTSETTINGS = "/emmc/0/cotrecovery/settings.ini";
	} else if(ensure_path_mounted("/sdcard") != 0) {
		load_fallback_settings();
		parse_language();
		handle_theme(currenttheme);
		return;
	}

    if (ini_parse(COTSETTINGS, settings_handler, &config) < 0) {
        create_default_settings();
        ini_parse(COTSETTINGS, settings_handler, &config);
    }
    LOGI("COT Settings loaded!\n");
    orsreboot = config.orsreboot;
    orswipeprompt = config.orswipeprompt;
    backupprompt = config.backupprompt;
    signature_check_enabled = config.signaturecheckenabled;
    backupfmt = config.backupfmt;
    if (backupfmt == 0) {
		nandroid_switch_backup_handler(0);
	} else {
		nandroid_switch_backup_handler(1);
	}
	currenttheme = config.theme;
	is_sd_theme = config.is_sd_theme;
	maxX = config.ts_x;
	maxY = config.ts_y;
	touchY = config.ts_touchY;
    language = config.language;
	parse_language();
    handle_theme(config.theme);
}
void parse_settings() {
    if(ensure_path_mounted("/sdcard") != 0) {
		load_fallback_settings();
		parse_language();
		handle_theme(currenttheme);
		return;
	}
    settings config;

    if (ini_parse(COTSETTINGS, settings_handler, &config) < 0) {
        ui_print("Can't load COT settings!\nSetting defaults...\n");
        create_default_settings();
        ini_parse(COTSETTINGS, settings_handler, &config);
    }
    LOGI("COT Settings loaded!\n");
    orsreboot = config.orsreboot;
    orswipeprompt = config.orswipeprompt;
    backupprompt = config.backupprompt;
    signature_check_enabled = config.signature_check_enabled;
	currenttheme = config.theme;
    language = config.language;
	parse_language();
    handle_theme(config.theme);
}