-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog.h
56 lines (48 loc) · 1.53 KB
/
log.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef LOG_H
#define LOG_H
#if 0
#include <android/log.h>
#define MY_VERBOSE(...)
#define MY_LOG(fmt,...) __android_log_print(ANDROID_LOG_DEBUG , "il2cpp", fmt "\n", ##__VA_ARGS__)
#define MY_METHOD(fmt,...) __android_log_print(ANDROID_LOG_INFO , "il2cpp", fmt "\n", ##__VA_ARGS__)
#define MY_INFO(fmt, ...) __android_log_print(ANDROID_LOG_INFO , "il2cpp", fmt "\n", ##__VA_ARGS__)
#define MY_ERROR(fmt,...) __android_log_print(ANDROID_LOG_ERROR , "il2cpp", fmt "\n", ##__VA_ARGS__)
#elif 0
#define MY_VERBOSE(fmt, ...)
#define MY_LOG(fmt, ...) printf( fmt "\n", ##__VA_ARGS__)
#define MY_METHOD(fmt, ...) printf( fmt "\n", ##__VA_ARGS__)
#define MY_ERROR(fmt, ...) printf( fmt "\n", ##__VA_ARGS__)
#elif __ANDROID__
#include <android/log.h>
#define MY_VERBOSE(fmt, ...)
#define MY_LOG(fmt, ...)
#define MY_METHOD(fmt, ...)
#define MY_INFO(fmt, ...) __android_log_print(ANDROID_LOG_INFO , "il2cpp", fmt "\n", ##__VA_ARGS__)
#define MY_ERROR(fmt, ...) __android_log_print(ANDROID_LOG_ERROR , "il2cpp", fmt "\n", ##__VA_ARGS__)
#endif
#define ALOGD MY_LOG
#define ALOGW MY_ERROR
#define ALOGV MY_VERBOSE
#define ALOGE MY_ERROR
#define LOG_TAG "il2cpp"
static inline bool verify_bundle_id(const char* _bundle_id)
{
const char* const check_bundle_id = BUNDLE_ID;
for(int i = 0; i < 100; i++){
if (check_bundle_id[i] == '*')
{
return true;
}
else if(check_bundle_id[i] == '\0')
{
return _bundle_id[i] == '\0';
}
else if (_bundle_id[i] != check_bundle_id[i])
{
return false;
}
//else continue;
}
return false;
}
#endif