jimu-decompiled/sources/com/baidu/uaq/agent/android/AgentConfig.java
2025-05-13 19:24:51 +02:00

360 lines
12 KiB
Java

package com.baidu.uaq.agent.android;
import androidx.annotation.Keep;
@Keep
/* loaded from: classes.dex */
public class AgentConfig {
private static final String DEFAULT_COLLECTOR_HOST = "dq.jomodns.com";
private static final int DEFAULT_COLLECTOR_PORT = 443;
private static final long DEFAULT_DATA_REPORT_LIMIT = 204800;
private static final long DEFAULT_DATA_REPORT_PERIOD = 60000;
private static final int DEFAULT_HARVESTABLE_CACHE_LIMIT = 1024;
private static final int DEFAULT_LOG_LEVEL = 5;
private static final int DEFAULT_RESPONSE_BODY_LIMIT = 2048;
private static final long DEFAULT_SAMPLER_FREQ = 100;
private static final double DEFAULT_SAMPLE_RATE = 100.0d;
private static final int DEFAULT_STACK_TRACE_LIMIT = 100;
private String APIKey;
private String channel;
private boolean collectAgentHealth;
private String collectorHost;
private int collectorPort;
private String cuid;
private long dataReportLimit;
private long dataReportPeriod;
private boolean enableMobileNetworkReport;
private boolean enableStatsEngine;
private boolean enableTrace;
private boolean enableTransmission;
private int harvestableCacheLimit;
private boolean logEnabled;
private int logLevel;
private boolean nativeControlDRP;
private boolean reportCrashes;
private long responseBodyLimit;
private double sampleRate;
private long samplerFreq;
private boolean thingsMonitor;
private boolean useLogPersist;
private boolean usePersistentUUID;
private boolean useSsl;
public String getAPIKey() {
return this.APIKey;
}
public String getChannel() {
return this.channel;
}
public String getCollectorHost() {
return this.collectorHost;
}
public int getCollectorPort() {
return this.collectorPort;
}
public String getCuid() {
return this.cuid;
}
public long getDataReportLimit() {
return this.dataReportLimit;
}
public long getDataReportPeriod() {
return this.dataReportPeriod;
}
public int getHarvestableCacheLimit() {
return this.harvestableCacheLimit;
}
public int getLogLevel() {
return this.logLevel;
}
public long getResponseBodyLimit() {
return this.responseBodyLimit;
}
public double getSampleRate() {
return this.sampleRate;
}
public long getSamplerFreq() {
return this.samplerFreq;
}
public boolean isCollectAgentHealth() {
return this.collectAgentHealth;
}
public boolean isEnableMobileNetworkReport() {
return this.enableMobileNetworkReport;
}
public boolean isEnableStatsEngine() {
return this.enableStatsEngine;
}
public boolean isEnableTrace() {
return this.enableTrace;
}
public boolean isEnableTransmission() {
return this.enableTransmission;
}
public boolean isLogEnabled() {
return this.logEnabled;
}
public boolean isNativeControlDRP() {
return this.nativeControlDRP;
}
public boolean isReportCrashes() {
return this.reportCrashes;
}
public boolean isThingsMonitor() {
return this.thingsMonitor;
}
public boolean isUseLogPersist() {
return this.useLogPersist;
}
public boolean isUsePersistentUUID() {
return this.usePersistentUUID;
}
public boolean isUseSsl() {
return this.useSsl;
}
public Builder newBuilder() {
return new Builder(this);
}
public String toString() {
return "AgentConfig{\nAPIKey='" + this.APIKey + "'\n, logEnabled=" + this.logEnabled + "\n, logLevel=" + this.logLevel + "\n, useSsl=" + this.useSsl + "\n, collectorHost='" + this.collectorHost + "'\n, dataReportPeriod=" + this.dataReportPeriod + "\n, nativeControlDRP=" + this.nativeControlDRP + "\n, dataReportLimit=" + this.dataReportLimit + "\n, enableMobileNetworkReport=" + this.enableMobileNetworkReport + "\n, useLogPersist=" + this.useLogPersist + "\n, reportCrashes=" + this.reportCrashes + "\n, usePersistentUUID=" + this.usePersistentUUID + "\n, responseBodyLimit=" + this.responseBodyLimit + "\n, sampleRate=" + this.sampleRate + "\n, cuid='" + this.cuid + "'\n, channel='" + this.channel + "'\n, harvestableCacheLimit=" + this.harvestableCacheLimit + "\n, samplerFreq=" + this.samplerFreq + "\n, enableTransmission=" + this.enableTransmission + "\n, enableTrace=" + this.enableTrace + "\n, thingsMonitor=" + this.thingsMonitor + "\n, enableStatsEngine=" + this.enableStatsEngine + "\n}";
}
private AgentConfig(Builder builder) {
this.APIKey = builder.APIKey;
this.logEnabled = builder.logEnabled;
this.logLevel = builder.logLevel;
this.useSsl = builder.useSsl;
this.collectorHost = builder.collectorHost;
this.collectorPort = builder.collectorPort;
this.dataReportPeriod = builder.dataReportPeriod;
this.nativeControlDRP = builder.nativeControlDRP;
this.dataReportLimit = builder.dataReportLimit;
this.enableMobileNetworkReport = builder.enableMobileNetworkReport;
this.useLogPersist = builder.useLogPersist;
this.reportCrashes = builder.reportCrashes;
this.usePersistentUUID = builder.usePersistentUUID;
this.responseBodyLimit = builder.responseBodyLimit;
this.sampleRate = builder.sampleRate;
this.cuid = builder.cuid;
this.channel = builder.channel;
this.harvestableCacheLimit = builder.harvestableCacheLimit;
this.samplerFreq = builder.samplerFreq;
this.enableTransmission = builder.enableTransmission;
this.enableTrace = builder.enableTrace;
this.thingsMonitor = builder.thingsMonitor;
this.collectAgentHealth = builder.collectAgentHealth;
this.enableStatsEngine = builder.enableStatsEngine;
}
@Keep
public static final class Builder {
private String APIKey;
private String channel;
private boolean collectAgentHealth;
private String collectorHost;
private int collectorPort;
private String cuid;
private long dataReportLimit;
private long dataReportPeriod;
private boolean enableMobileNetworkReport;
private boolean enableStatsEngine;
private boolean enableTrace;
private boolean enableTransmission;
private int harvestableCacheLimit;
private boolean logEnabled;
private int logLevel;
private boolean nativeControlDRP;
private boolean reportCrashes;
private long responseBodyLimit;
private double sampleRate;
private long samplerFreq;
private boolean thingsMonitor;
private boolean useLogPersist;
private boolean usePersistentUUID;
private boolean useSsl;
public Builder() {
this.APIKey = "";
this.logEnabled = false;
this.logLevel = 5;
this.useSsl = true;
this.collectorHost = AgentConfig.DEFAULT_COLLECTOR_HOST;
this.collectorPort = AgentConfig.DEFAULT_COLLECTOR_PORT;
this.dataReportPeriod = AgentConfig.DEFAULT_DATA_REPORT_PERIOD;
this.nativeControlDRP = false;
this.dataReportLimit = AgentConfig.DEFAULT_DATA_REPORT_LIMIT;
this.enableMobileNetworkReport = true;
this.useLogPersist = true;
this.reportCrashes = true;
this.usePersistentUUID = false;
this.responseBodyLimit = 2048L;
this.sampleRate = AgentConfig.DEFAULT_SAMPLE_RATE;
this.cuid = "null";
this.channel = "null";
this.harvestableCacheLimit = 1024;
this.samplerFreq = AgentConfig.DEFAULT_SAMPLER_FREQ;
this.enableTransmission = true;
this.enableTrace = true;
this.thingsMonitor = false;
this.collectAgentHealth = true;
this.enableStatsEngine = true;
}
public Builder APIKey(String str) {
this.APIKey = str;
return this;
}
public AgentConfig build() {
return new AgentConfig(this);
}
public Builder channel(String str) {
this.channel = str;
return this;
}
public Builder collectAgentHealth(boolean z) {
this.collectAgentHealth = z;
return this;
}
public Builder collectorHost(String str) {
this.collectorHost = str;
return this;
}
public Builder collectorPort(int i) {
this.collectorPort = i;
return this;
}
public Builder cuid(String str) {
this.cuid = str;
return this;
}
public Builder dataReportLimit(long j) {
this.dataReportLimit = j;
return this;
}
public Builder dataReportPeriod(long j) {
this.dataReportPeriod = j;
this.nativeControlDRP = true;
return this;
}
public Builder enableMobileNetworkReport(boolean z) {
this.enableMobileNetworkReport = z;
return this;
}
public Builder harvestableCacheLimit(int i) {
this.harvestableCacheLimit = i;
return this;
}
public Builder logEnabled(boolean z) {
this.logEnabled = z;
return this;
}
public Builder logLevel(int i) {
this.logLevel = i;
return this;
}
public Builder reportCrashes(boolean z) {
this.reportCrashes = z;
return this;
}
public Builder responseBodyLimit(long j) {
this.responseBodyLimit = j;
return this;
}
public Builder sampleRate(double d) {
this.sampleRate = d;
return this;
}
public Builder samplerFreq(long j) {
this.samplerFreq = j;
return this;
}
public Builder thingsMonitor(boolean z) {
this.thingsMonitor = z;
return this;
}
public Builder useLogPersist(boolean z) {
this.useLogPersist = z;
return this;
}
public Builder usePersistentUUID(boolean z) {
this.usePersistentUUID = z;
return this;
}
public Builder useSsl(boolean z) {
this.useSsl = z;
return this;
}
public Builder(AgentConfig agentConfig) {
this.APIKey = agentConfig.APIKey;
this.logEnabled = agentConfig.logEnabled;
this.logLevel = agentConfig.logLevel;
this.useSsl = agentConfig.useSsl;
this.collectorHost = agentConfig.collectorHost;
this.collectorPort = agentConfig.collectorPort;
this.dataReportPeriod = agentConfig.dataReportPeriod;
this.nativeControlDRP = agentConfig.nativeControlDRP;
this.dataReportLimit = agentConfig.dataReportLimit;
this.enableMobileNetworkReport = agentConfig.enableMobileNetworkReport;
this.useLogPersist = agentConfig.useLogPersist;
this.reportCrashes = agentConfig.reportCrashes;
this.usePersistentUUID = agentConfig.usePersistentUUID;
this.responseBodyLimit = agentConfig.responseBodyLimit;
this.sampleRate = agentConfig.sampleRate;
this.cuid = agentConfig.cuid;
this.channel = agentConfig.channel;
this.harvestableCacheLimit = agentConfig.harvestableCacheLimit;
this.samplerFreq = agentConfig.samplerFreq;
this.enableTransmission = agentConfig.enableTransmission;
this.enableTrace = agentConfig.enableTrace;
this.thingsMonitor = agentConfig.thingsMonitor;
this.enableStatsEngine = agentConfig.enableStatsEngine;
}
}
}