Commit 599ea5fb by sikang

添加同盾指纹

parent 7b5114c7
......@@ -43,7 +43,7 @@ repositories {
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: 'libs', include: ['*.jar',"*.aar"])
testImplementation 'junit:junit:4.12'
// noinspection GradleCompatible
androidTestImplementation 'com.android.support.test:runner:1.0.2'
......@@ -66,7 +66,7 @@ dependencies {
// api 'me.jessyan:autosize:1.0.6'
//同盾
api(name: 'android_shujumohe_sdk_beta_20180907_1.0.8.2', ext: 'aar')
// api(name: 'android_shujumohe_sdk_beta_20180907_1.0.8.2', ext: 'aar')
api 'com.alibaba:fastjson:1.1.58.android'
//QMUI
......
......@@ -65,6 +65,7 @@ public class LibConfig {
public static String ZENDESK_OAUTH_CLIENT_ID;
public static String TONGDUN_PARENT_CODE;
public static String TONGDUN_PARENT_KEY;
public static String TONGDUN_DEVICE_PARENT_CODE;
public static String APPSFLYER_DEV_KEY;
public static String XH_CHANNEL_NAME;
public static String TEST_TOKEN;
......
......@@ -22,16 +22,24 @@ import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import cn.tongdun.android.shell.FMAgent;
import cn.tongdun.android.shell.exception.FMException;
import cn.tongdun.android.shell.inter.FMCallback;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Function;
import io.reactivex.schedulers.Schedulers;
import tech.starwin.LibConfig;
import com.common.Collector;
import tech.starwin.database.DataBaseHelper;
import com.common.bean.CollectInfoEntity;
import com.common.bean.IncomeMessageProto;
......@@ -89,6 +97,7 @@ public class UploadManager {
return false;
}
//开始上传
uploadBlackBox();
startUpload(infos, sessionId);
return true;
......@@ -100,6 +109,28 @@ public class UploadManager {
}
/**
* 同盾指纹信息
*/
public static void uploadBlackBox() {
if (TextUtils.isEmpty(LibConfig.TONGDUN_DEVICE_PARENT_CODE)) {
return;
}
try {
Map<String, Object> options = new HashMap<>();
options.put(FMAgent.OPTION_DOMAIN, "环境配置url(此处分为正式环境和测试使唤)");
options.put(FMAgent.OPTION_BLACKBOX_MAXSIZE, 5 * 1024);
FMAgent.initWithCallback(LibConfig.getContext(), FMAgent.ENV_PRODUCTION, options, new FMCallback() {
@Override
public void onEvent(String blackbox) {
LogUtils.d(TAG, "callback_blackbox: " + blackbox);
}
});
} catch (FMException e) {
e.printStackTrace();
}
}
/**
* 开始上传
*/
public static void startUpload(List<CollectInfoEntity> infoList, String sessionId) throws RuntimeException {
......@@ -331,7 +362,7 @@ public class UploadManager {
sendControlCommand(os, "CLOSE", sessionId, "exception upload completed");
} catch (Exception e) {
uploadException(e,e.getMessage());
uploadException(e, e.getMessage());
} finally {
try {
if (os != null) {
......
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