104 lines
4.1 KiB
Java
104 lines
4.1 KiB
Java
package com.ubt.jimu.base.http;
|
|
|
|
import com.ubt.jimu.JimuApplication;
|
|
import com.ubt.jimu.utils.EncryptUtils;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class ApiConstants {
|
|
public static final String APP_ID = "400010011";
|
|
static final String APP_SOURCE = "appSource";
|
|
static final String APP_TYPE = "app_type";
|
|
public static final String AREA = "area";
|
|
public static final String AUTHORIZATION = "authorization";
|
|
public static final String ENCODE_KEY = "UBTech832%1293*6";
|
|
public static final int GDPR_NO_RESULT = -1;
|
|
private static String HOST_URL = "https://jimu.ubtrobot.com";
|
|
public static final String KEY_APP_ID = "X-UBT-AppId";
|
|
static final String KEY_APP_TYPE = "appType";
|
|
public static final String KEY_DEVICE_ID = "X-UBT-DeviceId";
|
|
static final String KEY_REQUEST_KEY = "requestKey";
|
|
static final String KEY_REQUEST_TIME = "requestTime";
|
|
static final String KEY_SERVICE_VERSION = "serviceVersion";
|
|
public static final String KEY_SIGN = "X-UBT-Sign";
|
|
public static final String LANGUAGE = "language";
|
|
public static final String PRODECT_ID = "20001";
|
|
static final String SOURCE = "app_source";
|
|
static final String SYSTEM_AREA = "systemArea";
|
|
static final String SYSTEM_LANGUAGE = "systemLanguage";
|
|
public static final int USER_PRIVACY = 2;
|
|
static final String VERSION = "version";
|
|
|
|
public static String getAppVersion() {
|
|
return "3.9.6";
|
|
}
|
|
|
|
public static Map<String, Object> getBaseParams() {
|
|
HashMap hashMap = new HashMap();
|
|
hashMap.put(KEY_APP_TYPE, "2");
|
|
hashMap.put(KEY_SERVICE_VERSION, getAppVersion());
|
|
long currentTimeMillis = System.currentTimeMillis();
|
|
hashMap.put(KEY_REQUEST_TIME, String.valueOf(currentTimeMillis));
|
|
hashMap.put(KEY_REQUEST_KEY, EncryptUtils.a(currentTimeMillis + ENCODE_KEY, 32));
|
|
hashMap.put(SYSTEM_LANGUAGE, JimuApplication.l().g());
|
|
hashMap.put(SYSTEM_AREA, JimuApplication.l().c());
|
|
hashMap.put(APP_SOURCE, "Jimu");
|
|
hashMap.put("language", JimuApplication.l().g());
|
|
return hashMap;
|
|
}
|
|
|
|
public static Map<String, String> getBasicParams() {
|
|
HashMap hashMap = new HashMap();
|
|
hashMap.put(KEY_APP_TYPE, "2");
|
|
hashMap.put(KEY_SERVICE_VERSION, getAppVersion());
|
|
long currentTimeMillis = System.currentTimeMillis();
|
|
hashMap.put(KEY_REQUEST_TIME, String.valueOf(currentTimeMillis));
|
|
hashMap.put(KEY_REQUEST_KEY, EncryptUtils.a(currentTimeMillis + ENCODE_KEY, 32));
|
|
hashMap.put(SYSTEM_LANGUAGE, JimuApplication.l().g());
|
|
hashMap.put(SYSTEM_AREA, JimuApplication.l().c());
|
|
hashMap.put(APP_SOURCE, "Jimu");
|
|
hashMap.put("language", JimuApplication.l().g());
|
|
return hashMap;
|
|
}
|
|
|
|
public static Map<String, String> getHeaderParams() {
|
|
HashMap hashMap = new HashMap();
|
|
hashMap.put("product", PRODECT_ID);
|
|
hashMap.put("version", getAppVersion());
|
|
hashMap.put(APP_TYPE, "2");
|
|
hashMap.put(SOURCE, "Jimu");
|
|
hashMap.put(KEY_APP_ID, APP_ID);
|
|
return hashMap;
|
|
}
|
|
|
|
public static String getHostUrl() {
|
|
return HOST_URL;
|
|
}
|
|
|
|
public static List<String> getVerifiedHostNames() {
|
|
ArrayList arrayList = new ArrayList();
|
|
arrayList.add("jimu.ubtrobot.com:543");
|
|
arrayList.add("jimu.ubtrobot.com");
|
|
arrayList.add("service.ubtrobot.com");
|
|
arrayList.add("www.qq.com");
|
|
arrayList.add("graph.qq.com");
|
|
arrayList.add("api.weixin.qq.com");
|
|
arrayList.add("api.twitter.com");
|
|
arrayList.add("www.facebook.com");
|
|
arrayList.add("graph.facebook.com");
|
|
arrayList.add("twitter.com");
|
|
arrayList.add("test79.ubtrobot.com");
|
|
arrayList.add("e.crashlytics.com");
|
|
arrayList.add("reports.crashlytics.com");
|
|
arrayList.add("video.ubtrobot.com");
|
|
arrayList.add("apis.ubtrobot.com");
|
|
arrayList.add("account.ubtrobot.com");
|
|
arrayList.add("imu.ubtrobot.com");
|
|
arrayList.add("prerelease.ubtrobot.com");
|
|
return arrayList;
|
|
}
|
|
}
|