blob: 0c702b7dadbb914bffd8b506bdb23a6feace6df3 [file] [log] [blame]
Dees_Troy51a0e822012-09-05 15:24:24 -04001#ifndef _EXTRAFUNCTIONS_HEADER
2#define _EXTRAFUNCTIONS_HEADER
3
Dees_Troy657c3092012-09-10 20:32:10 -04004#include "mincrypt/rsa.h"
5#include "minzip/Zip.h"
6
Dees_Troy51a0e822012-09-05 15:24:24 -04007int __system(const char *command);
8FILE * __popen(const char *program, const char *type);
9int __pclose(FILE *iop);
10
Dees_Troy657c3092012-09-10 20:32:10 -040011// Install Zip functions
12int TWtry_update_binary(const char *path, ZipArchive *zip, int* wipe_cache);
13static RSAPublicKey* TWload_keys(const char* filename, int* numKeys);
14int TWverify_file(const char* path, const RSAPublicKey *pKeys, unsigned int numKeys);
15int TWinstall_zip(const char* path, int* wipe_cache);
16
Dees_Troy51a0e822012-09-05 15:24:24 -040017// Device ID variable / function
Dees_Troy5bf43922012-09-07 16:07:55 -040018extern char device_id[64];
Dees_Troy51a0e822012-09-05 15:24:24 -040019void get_device_id();
Dees_Troy51a0e822012-09-05 15:24:24 -040020
21void wipe_dalvik_cache();
22void wipe_battery_stats();
23void wipe_rotate_data();
24
25static long tmplog_offset = 0;
26
27// Battery level
28char* print_batt_cap();
29
30void update_tz_environment_variables();
31
32void fix_perms();
33
34void 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
36void install_htc_dumlock(void);
37void htc_dumlock_restore_original_boot(void);
38void htc_dumlock_reflash_recovery_to_boot(void);
39
40void check_and_run_script(const char* script_file, const char* display_name);
41int check_backup_name(int show_error);
Dees_Troy7d15c252012-09-05 20:47:21 -040042void twfinish_recovery(const char *send_intent);
Dees_Troy51a0e822012-09-05 15:24:24 -040043
Dees_Troy7d15c252012-09-05 20:47:21 -040044#endif // _EXTRAFUNCTIONS_HEADER