Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 1 | #ifndef _EXTRAFUNCTIONS_HEADER |
| 2 | #define _EXTRAFUNCTIONS_HEADER |
| 3 | |
Dees_Troy | 657c309 | 2012-09-10 20:32:10 -0400 | [diff] [blame^] | 4 | #include "mincrypt/rsa.h" |
| 5 | #include "minzip/Zip.h" |
| 6 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 7 | int __system(const char *command); |
| 8 | FILE * __popen(const char *program, const char *type); |
| 9 | int __pclose(FILE *iop); |
| 10 | |
Dees_Troy | 657c309 | 2012-09-10 20:32:10 -0400 | [diff] [blame^] | 11 | // Install Zip functions |
| 12 | int TWtry_update_binary(const char *path, ZipArchive *zip, int* wipe_cache); |
| 13 | static RSAPublicKey* TWload_keys(const char* filename, int* numKeys); |
| 14 | int TWverify_file(const char* path, const RSAPublicKey *pKeys, unsigned int numKeys); |
| 15 | int TWinstall_zip(const char* path, int* wipe_cache); |
| 16 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 17 | // Device ID variable / function |
Dees_Troy | 5bf4392 | 2012-09-07 16:07:55 -0400 | [diff] [blame] | 18 | extern char device_id[64]; |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 19 | void get_device_id(); |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 20 | |
| 21 | void wipe_dalvik_cache(); |
| 22 | void wipe_battery_stats(); |
| 23 | void wipe_rotate_data(); |
| 24 | |
| 25 | static long tmplog_offset = 0; |
| 26 | |
| 27 | // Battery level |
| 28 | char* print_batt_cap(); |
| 29 | |
| 30 | void update_tz_environment_variables(); |
| 31 | |
| 32 | void fix_perms(); |
| 33 | |
| 34 | void run_script(const char *str1, const char *str2, const char *str3, const char *str4, const char *str5, const char *str6, const char *str7, int request_confirm); |
| 35 | |
| 36 | void install_htc_dumlock(void); |
| 37 | void htc_dumlock_restore_original_boot(void); |
| 38 | void htc_dumlock_reflash_recovery_to_boot(void); |
| 39 | |
| 40 | void check_and_run_script(const char* script_file, const char* display_name); |
| 41 | int check_backup_name(int show_error); |
Dees_Troy | 7d15c25 | 2012-09-05 20:47:21 -0400 | [diff] [blame] | 42 | void twfinish_recovery(const char *send_intent); |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 43 | |
Dees_Troy | 7d15c25 | 2012-09-05 20:47:21 -0400 | [diff] [blame] | 44 | #endif // _EXTRAFUNCTIONS_HEADER |