#include #include #define PACKAGE "com.tencent.mm" #define DATA_PATH "/data/data/"PACKAGE"/" #define WECHAT_KEY_LEN 7 #define MAX_PATH 256 #define DATE_LEN 64 #define RECORD_COUNT "200" #define STREQ(a, b) (strcmp((a), (b)) == 0) #define LOG_TAG "CHAITIN" #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__) #define LOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__) #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__) #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) #define OK 0 #define UNABLE_TO_CALL_SERVICE -1 #define INSUFFICIENT_BUF -2 /* openssl */ #if defined(__LP32__) #define MD5_LONG unsigned long #elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) #define MD5_LONG unsigned long #define MD5_LONG_LOG2 3 #else #define MD5_LONG unsigned int #endif #define MD5_CBLOCK 64 #define MD5_LBLOCK (MD5_CBLOCK/4) #define MD5_DIGEST_LENGTH 16 #define HEX_DIGEST_LENGTH MD5_DIGEST_LENGTH * 2 + 1 typedef struct MD5state_st { MD5_LONG A,B,C,D; MD5_LONG Nl,Nh; MD5_LONG data[MD5_LBLOCK]; unsigned int num; } MD5_CTX; typedef void (*MD5INIT_FN_PTR)(MD5_CTX *context); typedef void (*MD5UPDATE_FN_PTR)(MD5_CTX *context, unsigned char *input, unsigned int inlen); typedef void (*MD5FINAL_FN_PTR)(unsigned char *output, MD5_CTX *context); /* end of openssl */ /* sqlcipher */ #define SQLITE_OPEN_READONLY 0x00000001 #define SQLITE_OK 0 typedef void sqlite3; /* we don't care about what exatcly this struct is defined */ typedef int(*SQLITE3_KEY_FN_PTR) ( sqlite3 *db, /* Database to be rekeyed */ const void *pKey, int nKey /* The key, and the length of the key in bytes */ ); typedef int (*SQLITE3_OPEN_V2_FN_PTR) ( const char *filename, /* Database filename (UTF-8) */ sqlite3 **ppDb, /* OUT: SQLite db handle */ int flags, /* Flags */ const char *zVfs /* Name of VFS module to use */ ); typedef int (*SQLITE3_CLOSE_V2_FN_PTR) (sqlite3*); typedef int (*SQLITE3_EXEC_FN_PTR) ( sqlite3*, /* An open database */ const char *sql, /* SQL to be evaluated */ int (*callback)(void*,int,char**,char**), /* Callback function */ void *, /* 1st argument to callback */ char **errmsg /* Error msg written here */ ); typedef void (*SQLITE3_FREE_FN_PTR) (void*); /* end of sqlcipher */