Commit c73a9339 by leiguo1029

\

parent 9e932f82
...@@ -3,12 +3,20 @@ plugins { ...@@ -3,12 +3,20 @@ plugins {
} }
android { android {
signingConfigs {
release {
storeFile file('/Users/reyun/Program/Android/reyunsdk/reyun.keystore')
storePassword 'reyun12345'
keyAlias 'reyun.keystore'
keyPassword 'reyun12345'
}
}
compileSdkVersion 30 compileSdkVersion 30
buildToolsVersion "30.0.3" buildToolsVersion "30.0.3"
defaultConfig { defaultConfig {
applicationId "com.reyun.sdktestdemo" applicationId "com.reyun.sdktestdemo"
minSdkVersion 21 minSdkVersion 19
targetSdkVersion 30 targetSdkVersion 30
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
...@@ -24,13 +32,10 @@ android { ...@@ -24,13 +32,10 @@ android {
release { release {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
} }
} }
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
externalNativeBuild { externalNativeBuild {
cmake { cmake {
......
File added
...@@ -35,9 +35,11 @@ void do_collect(JNIEnv* env) { ...@@ -35,9 +35,11 @@ void do_collect(JNIEnv* env) {
cJSON* json = collect_init(); cJSON* json = collect_init();
struct timespec ts = {0}; struct timespec ts = {0};
double start_time = 0, end_time = 0; double start_time = 0, end_time = 0;
if(WDSYSCALL(SYS_clock_gettime, CLOCK_MONOTONIC, &ts) == 0) { if(WDSYSCALL(SYS_clock_gettime, CLOCK_REALTIME, &ts) == 0) {
start_time = ts.tv_nsec / 1000000 + ts.tv_sec * 1000ULL; start_time = ts.tv_nsec / 1000000 + ts.tv_sec * 1000ULL;
} }
//添加sdk版本号
cJSON_AddStringToObject(json, "sdk_ver", "1.0.0");
collect_app_info(env, json); collect_app_info(env, json);
int permissions = collect_permissions(env, json); int permissions = collect_permissions(env, json);
collect_imei(env, json); collect_imei(env, json);
...@@ -67,7 +69,7 @@ void do_collect(JNIEnv* env) { ...@@ -67,7 +69,7 @@ void do_collect(JNIEnv* env) {
collect_time_info(env, json); collect_time_info(env, json);
if(WDSYSCALL(SYS_clock_gettime, CLOCK_MONOTONIC, &ts) == 0) { if(WDSYSCALL(SYS_clock_gettime, CLOCK_REALTIME, &ts) == 0) {
end_time = (double)ts.tv_nsec / 1000000 + (double)ts.tv_sec * 1000ULL; end_time = (double)ts.tv_nsec / 1000000 + (double)ts.tv_sec * 1000ULL;
} }
...@@ -111,7 +113,7 @@ void collect_app_info(JNIEnv* env, cJSON *json) { ...@@ -111,7 +113,7 @@ void collect_app_info(JNIEnv* env, cJSON *json) {
//version name //version name
jobject versionName = wdGetObjectField(env, pkgInfo, "versionName", "Ljava/lang/String;"); jobject versionName = wdGetObjectField(env, pkgInfo, "versionName", "Ljava/lang/String;");
addJniStringToJson(env, json, "versionName", versionName); addJniStringToJson(env, json, "version_name", versionName);
//signature's sha256 //signature's sha256
jobject signatures = wdGetObjectField(env, pkgInfo, "signatures", "[Landroid/content/pm/Signature;"); jobject signatures = wdGetObjectField(env, pkgInfo, "signatures", "[Landroid/content/pm/Signature;");
...@@ -375,7 +377,7 @@ void collect_libs_info(JNIEnv *env, cJSON *json) { ...@@ -375,7 +377,7 @@ void collect_libs_info(JNIEnv *env, cJSON *json) {
int mmap_call_num = 222; int mmap_call_num = 222;
uint8_t* base = (uint8_t*) WDSYSCALL(WD_SYS_mmap, 0, size, PROT_READ, MAP_SHARED, fd, 0); uint8_t* base = (uint8_t*) WDSYSCALL(WD_SYS_mmap, 0, size, PROT_READ, MAP_SHARED, fd, 0);
uint8_t out[16] = {0}; uint8_t out[16] = {0};
char md5_str[33] = {0}; char md5_str[32 + 1] = {0};
MD5(base, size, out); MD5(base, size, out);
bytes2Hex(out, md5_str, 16, 0); bytes2Hex(out, md5_str, 16, 0);
cJSON_AddStringToObject(item, lib_names[j], md5_str); cJSON_AddStringToObject(item, lib_names[j], md5_str);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment