| 6 |
| #define BREVENT_COMMON_H |
| 7 |
| 8 | #include <jni.h> |
| 9 | #include <stdbool.h> |
| 10 | #include <android/log.h> |
| 11 |
| 12 | #if __has_include("genuine.h") |
| 13 | #include "genuine.h" |
| 14 | #endif |
| 15 |
| 16 | #ifdef __cplusplus |
| 17 | extern "C" { |
| 18 | #endif |
| 19 |
| 20 | enum { |
| 21 | CHECK_TRUE, |
| 22 | CHECK_FALSE, |
| 23 | CHECK_FAKE, |
| 24 | CHECK_OVERLAY, |
| 25 | CHECK_ODEX, |
| 26 | CHECK_DEX, |
| 27 | CHECK_PROXY, |
| 28 | CHECK_ERROR, |
| 29 | CHECK_FATAL, |
| 30 | CHECK_NOAPK, |
| 31 | }; |
| 32 |
| 33 | #ifndef TAG |
| 34 | #define TAG "Genuine" |
| 35 | #endif |
| 36 |
| 37 | #ifndef LOGI |
| 38 | #define LOGI(...) (genuine_log_print(ANDROID_LOG_INFO, __VA_ARGS__)) |
| 39 | #endif |
| 40 |
| 41 | #ifndef LOGW |
| 42 | #define LOGW(...) (genuine_log_print(ANDROID_LOG_WARN, __VA_ARGS__)) |
| 43 | #endif |
| 44 |
| 45 | #ifndef LOGE |
| 46 | #define LOGE(...) (genuine_log_print(ANDROID_LOG_ERROR, __VA_ARGS__)) |
| 47 | #endif |
| 48 |
| 49 | void genuine_log_print(int prio, const char *fmt, ...); |
| 50 |
| 51 | char *getGenuinePackageName(); |
| 52 |
| 53 | bool setGenuine(JNIEnv *env, int genuine); |
| 54 |
| 55 | int getGenuine(); |
| 56 |
| 57 | int getSdk(); |
| 58 |
| 59 | bool has_native_libs(); |
| 60 |
| 61 | #ifdef DEBUG |
| 62 |
| 63 | void debug(JNIEnv *env, const char *format, jobject object); |
| 64 |
| 65 | #else |
| 66 | #define debug(...) do {} while(0); |
| 67 | #endif |
| 68 |
| 69 | #ifdef __cplusplus |
| 70 | } |
| 71 | #endif |
| 72 |
| 73 | #endif //BREVENT_COMMON_H |
| 74 |