正在查看: Jurassic World v1.83.4 应用的 AirshipConfigOptions.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Jurassic World v1.83.4 应用的 AirshipConfigOptions.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.urbanairship;
import android.content.Context;
import android.net.Uri;
import com.helpshift.util.Utils;
import com.urbanairship.push.PushProvider;
import com.urbanairship.util.Checks;
import com.urbanairship.util.ConfigParser;
import com.urbanairship.util.PropertiesConfigParser;
import com.urbanairship.util.UAStringUtil;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
import java.util.regex.Pattern;
public class AirshipConfigOptions {
public static final String ADM_TRANSPORT = "ADM";
private static final Pattern APP_CREDENTIAL_PATTERN = Pattern.compile("^[a-zA-Z0-9\\-_]{22}$");
private static final long DEFAULT_BG_REPORTING_INTERVAL_MS = 86400000;
private static final int DEFAULT_DEVELOPMENT_LOG_LEVEL = 3;
private static final int DEFAULT_PRODUCTION_LOG_LEVEL = 6;
private static final String EU_ANALYTICS_URL = "https://combine.asnapieu.com/";
private static final String EU_DEVICE_URL = "https://device-api.asnapieu.com/";
private static final String EU_REMOTE_DATA_URL = "https://remote-data.asnapieu.com/";
private static final String EU_WALLET_URL = "https://wallet-api.asnapieu.com";
public static final String FCM_TRANSPORT = "FCM";
public static final String FEATURE_ALL = "all";
public static final String FEATURE_ANALYTICS = "analytics";
public static final String FEATURE_CHAT = "chat";
public static final String FEATURE_CONTACTS = "contacts";
public static final String FEATURE_IN_APP_AUTOMATION = "in_app_automation";
public static final String FEATURE_LOCATION = "location";
public static final String FEATURE_MESSAGE_CENTER = "message_center";
public static final String FEATURE_NONE = "none";
public static final String FEATURE_PUSH = "push";
public static final String FEATURE_TAGS_AND_ATTRIBUTES = "tags_and_attributes";
public static final String HMS_TRANSPORT = "HMS";
private static final long MAX_BG_REPORTING_INTERVAL_MS = 86400000;
private static final long MIN_BG_REPORTING_INTERVAL_MS = 60000;
public static final String SITE_EU = "EU";
public static final String SITE_US = "US";
private static final String US_ANALYTICS_URL = "https://combine.urbanairship.com/";
private static final String US_DEVICE_URL = "https://device-api.urbanairship.com/";
private static final String US_REMOTE_DATA_URL = "https://remote-data.urbanairship.com/";
private static final String US_WALLET_URL = "https://wallet-api.urbanairship.com";
public final List<String> allowedTransports;
public final boolean analyticsEnabled;
public final String analyticsUrl;
public final String appKey;
public final String appSecret;
public final Uri appStoreUri;
public final boolean autoLaunchApplication;
public final long backgroundReportingIntervalMS;
public final boolean channelCaptureEnabled;
public final boolean channelCreationDelayEnabled;
public final String chatSocketUrl;
public final String chatUrl;
public final PushProvider customPushProvider;
@Deprecated
public final boolean dataCollectionOptInEnabled;
public final String deviceUrl;
public final int enabledFeatures;
public final boolean extendedBroadcastsEnabled;
public final String fcmFirebaseAppName;
public final boolean inProduction;
public final String initialConfigUrl;
public final int logLevel;
public final int notificationAccentColor;
public final String notificationChannel;
public final int notificationIcon;
public final int notificationLargeIcon;
public final String remoteDataUrl;
public final boolean requireInitialRemoteConfigEnabled;
public final List<String> urlAllowList;
public final List<String> urlAllowListScopeJavaScriptInterface;
public final List<String> urlAllowListScopeOpenUrl;
public final String walletUrl;
@Retention(RetentionPolicy.SOURCE)
public @interface Site {
}
private AirshipConfigOptions(Builder builder) {
if (builder.inProduction.booleanValue()) {
this.appKey = firstOrEmpty(builder.productionAppKey, builder.appKey);
this.appSecret = firstOrEmpty(builder.productionAppSecret, builder.appSecret);
this.logLevel = first(builder.productionLogLevel, builder.logLevel, 6);
} else {
this.appKey = firstOrEmpty(builder.developmentAppKey, builder.appKey);
this.appSecret = firstOrEmpty(builder.developmentAppSecret, builder.appSecret);
this.logLevel = first(builder.developmentLogLevel, builder.logLevel, 3);
}
String str = builder.site;
char c = 65535;
int hashCode = str.hashCode();
if (hashCode != 2224) {
if (hashCode == 2718 && str.equals(SITE_US)) {
c = 1;
}
} else if (str.equals(SITE_EU)) {
c = 0;
}
if (c != 0) {
this.deviceUrl = firstOrEmpty(builder.deviceUrl, US_DEVICE_URL);
this.analyticsUrl = firstOrEmpty(builder.analyticsUrl, US_ANALYTICS_URL);
this.remoteDataUrl = firstOrEmpty(builder.remoteDataUrl, US_REMOTE_DATA_URL);
this.walletUrl = firstOrEmpty(builder.walletUrl, US_WALLET_URL);
this.chatUrl = firstOrEmpty(builder.chatUrl);
this.chatSocketUrl = firstOrEmpty(builder.chatSocketUrl);
} else {
this.deviceUrl = firstOrEmpty(builder.deviceUrl, EU_DEVICE_URL);
this.analyticsUrl = firstOrEmpty(builder.analyticsUrl, EU_ANALYTICS_URL);
this.remoteDataUrl = firstOrEmpty(builder.remoteDataUrl, EU_REMOTE_DATA_URL);
this.walletUrl = firstOrEmpty(builder.walletUrl, EU_WALLET_URL);
this.chatUrl = firstOrEmpty(builder.chatUrl);
this.chatSocketUrl = firstOrEmpty(builder.chatSocketUrl);
}
this.allowedTransports = Collections.unmodifiableList(new ArrayList(builder.allowedTransports));
this.urlAllowList = Collections.unmodifiableList(new ArrayList(builder.urlAllowList));
this.urlAllowListScopeJavaScriptInterface = Collections.unmodifiableList(new ArrayList(builder.urlAllowListScopeJavaScriptInterface));
this.urlAllowListScopeOpenUrl = Collections.unmodifiableList(new ArrayList(builder.urlAllowListScopeOpenUrl));
this.inProduction = builder.inProduction.booleanValue();
this.analyticsEnabled = builder.analyticsEnabled;
this.backgroundReportingIntervalMS = builder.backgroundReportingIntervalMS;
this.autoLaunchApplication = builder.autoLaunchApplication;
this.channelCreationDelayEnabled = builder.channelCreationDelayEnabled;
this.channelCaptureEnabled = builder.channelCaptureEnabled;
this.notificationIcon = builder.notificationIcon;
this.notificationLargeIcon = builder.notificationLargeIcon;
this.notificationAccentColor = builder.notificationAccentColor;
this.notificationChannel = builder.notificationChannel;
this.customPushProvider = builder.customPushProvider;
this.appStoreUri = builder.appStoreUri;
this.dataCollectionOptInEnabled = builder.dataCollectionOptInEnabled;
this.enabledFeatures = builder.enabledFeatures;
this.extendedBroadcastsEnabled = builder.extendedBroadcastsEnabled;
this.requireInitialRemoteConfigEnabled = builder.requireInitialRemoteConfigEnabled;
this.fcmFirebaseAppName = builder.fcmFirebaseAppName;
this.initialConfigUrl = builder.initialConfigUrl;
}
public void validate() {
String str = this.inProduction ? "production" : "development";
Pattern pattern = APP_CREDENTIAL_PATTERN;
if (!pattern.matcher(this.appKey).matches()) {
throw new IllegalArgumentException("AirshipConfigOptions: " + this.appKey + " is not a valid " + str + " app key");
}
if (!pattern.matcher(this.appSecret).matches()) {
throw new IllegalArgumentException("AirshipConfigOptions: " + this.appSecret + " is not a valid " + str + " app secret");
}
long j = this.backgroundReportingIntervalMS;
if (j < MIN_BG_REPORTING_INTERVAL_MS) {
Logger.warn("AirshipConfigOptions - The backgroundReportingIntervalMS %s may decrease battery life.", Long.valueOf(j));
} else if (j > Utils.TIME_24HRS_MILLIS) {
Logger.warn("AirshipConfigOptions - The backgroundReportingIntervalMS %s may provide less detailed analytic reports.", Long.valueOf(j));
}
}
public static Builder newBuilder() {
return new Builder();
}
public static String parseSite(String value) {
if (SITE_EU.equalsIgnoreCase(value)) {
return SITE_EU;
}
if (SITE_US.equalsIgnoreCase(value)) {
return SITE_US;
}
throw new IllegalArgumentException("Invalid site: " + value);
}
private static String firstOrNull(String... args) {
for (String str : args) {
if (!UAStringUtil.isEmpty(str)) {
return str;
}
}
return null;
}
private static String firstOrEmpty(String... args) {
for (String str : args) {
if (!UAStringUtil.isEmpty(str)) {
return str;
}
}
return "";
}
private static int first(Integer... args) {
for (Integer num : args) {
if (num != null) {
return num.intValue();
}
}
return 0;
}
public static final class Builder {
private static final String CONFIG_ELEMENT = "AirshipConfigOptions";
private static final String DEFAULT_PROPERTIES_FILENAME = "airshipconfig.properties";
private static final String FIELD_ALLOWED_TRANSPORTS = "allowedTransports";
private static final String FIELD_ANALYTICS_ENABLED = "analyticsEnabled";
private static final String FIELD_ANALYTICS_URL = "analyticsUrl";
private static final String FIELD_APP_KEY = "appKey";
private static final String FIELD_APP_SECRET = "appSecret";
private static final String FIELD_APP_STORE_URI = "appStoreUri";
private static final String FIELD_AUTO_LAUNCH_APPLICATION = "autoLaunchApplication";
private static final String FIELD_BACKGROUND_REPORTING_INTERVAL_MS = "backgroundReportingIntervalMS";
private static final String FIELD_CHANNEL_CAPTURE_ENABLED = "channelCaptureEnabled";
private static final String FIELD_CHANNEL_CREATION_DELAY_ENABLED = "channelCreationDelayEnabled";
private static final String FIELD_CHAT_SOCKET_URL = "chatSocketUrl";
private static final String FIELD_CHAT_URL = "chatUrl";
private static final String FIELD_CUSTOM_PUSH_PROVIDER = "customPushProvider";
private static final String FIELD_DATA_COLLECTION_OPT_IN_ENABLED = "dataCollectionOptInEnabled";
private static final String FIELD_DEVELOPMENT_APP_KEY = "developmentAppKey";
private static final String FIELD_DEVELOPMENT_APP_SECRET = "developmentAppSecret";
private static final String FIELD_DEVELOPMENT_FCM_SENDER_ID = "developmentFcmSenderId";
private static final String FIELD_DEVELOPMENT_LOG_LEVEL = "developmentLogLevel";
private static final String FIELD_DEVICE_URL = "deviceUrl";
private static final String FIELD_ENABLED_FEATURES = "enabledFeatures";
private static final String FIELD_EXTENDED_BROADCASTS_ENABLED = "extendedBroadcastsEnabled";
private static final String FIELD_FCM_FIREBASE_APP_NAME = "fcmFirebaseAppName";
private static final String FIELD_FCM_SENDER_ID = "fcmSenderId";
private static final String FIELD_GCM_SENDER = "gcmSender";
private static final String FIELD_INITIAL_CONFIG_URL = "initialConfigUrl";
private static final String FIELD_IN_PRODUCTION = "inProduction";
private static final String FIELD_LEGACY_ANALYTICS_SERVER = "analyticsServer";
private static final String FIELD_LEGACY_DEVICE_URL = "hostURL";
private static final String FIELD_LEGACY_REMOTE_DATA_URL = "remoteDataURL";
private static final String FIELD_LOG_LEVEL = "logLevel";
private static final String FIELD_NOTIFICATION_ACCENT_COLOR = "notificationAccentColor";
private static final String FIELD_NOTIFICATION_CHANNEL = "notificationChannel";
private static final String FIELD_NOTIFICATION_ICON = "notificationIcon";
private static final String FIELD_NOTIFICATION_LARGE_ICON = "notificationLargeIcon";
private static final String FIELD_PRODUCTION_APP_KEY = "productionAppKey";
private static final String FIELD_PRODUCTION_APP_SECRET = "productionAppSecret";
private static final String FIELD_PRODUCTION_FCM_SENDER_ID = "productionFcmSenderId";
private static final String FIELD_PRODUCTION_LOG_LEVEL = "productionLogLevel";
private static final String FIELD_REMOTE_DATA_URL = "remoteDataUrl";
private static final String FIELD_REQUIRE_INITIAL_REMOTE_CONFIG_ENABLED = "requireInitialRemoteConfigEnabled";
private static final String FIELD_SITE = "site";
private static final String FIELD_SUPPRESS_ALLOW_LIST_ERROR = "suppressAllowListError";
private static final String FIELD_URL_ALLOW_LIST = "urlAllowList";
private static final String FIELD_URL_ALLOW_LIST_SCOPE_JAVASCRIPT_INTERFACE = "urlAllowListScopeJavaScriptInterface";
private static final String FIELD_URL_ALLOW_LIST_SCOPE_OPEN_URL = "urlAllowListScopeOpenUrl";
private static final String FIELD_WALLET_URL = "walletUrl";
private String analyticsUrl;
private String appKey;
private String appSecret;
private Uri appStoreUri;
private String chatSocketUrl;
private String chatUrl;
private PushProvider customPushProvider;
private boolean dataCollectionOptInEnabled;
private String developmentAppKey;
private String developmentAppSecret;
private Integer developmentLogLevel;
private String deviceUrl;
private boolean extendedBroadcastsEnabled;
private String fcmFirebaseAppName;
private String initialConfigUrl;
private Integer logLevel;
private String notificationChannel;
private int notificationIcon;
private int notificationLargeIcon;
private String productionAppKey;
private String productionAppSecret;
private Integer productionLogLevel;
private String remoteDataUrl;
private String walletUrl;
private List<String> allowedTransports = new ArrayList(Arrays.asList(AirshipConfigOptions.ADM_TRANSPORT, AirshipConfigOptions.FCM_TRANSPORT, AirshipConfigOptions.HMS_TRANSPORT));
private List<String> urlAllowList = new ArrayList();
private List<String> urlAllowListScopeJavaScriptInterface = new ArrayList();
private List<String> urlAllowListScopeOpenUrl = new ArrayList();
private Boolean inProduction = null;
private boolean analyticsEnabled = true;
private long backgroundReportingIntervalMS = Utils.TIME_24HRS_MILLIS;
private boolean autoLaunchApplication = true;
private boolean channelCreationDelayEnabled = false;
private boolean channelCaptureEnabled = true;
private int notificationAccentColor = 0;
private String site = AirshipConfigOptions.SITE_US;
public int enabledFeatures = 255;
private boolean suppressAllowListError = false;
private boolean requireInitialRemoteConfigEnabled = true;
public Builder applyDefaultProperties(Context context) {
return applyProperties(context, DEFAULT_PROPERTIES_FILENAME);
}
public Builder applyProperties(Context context, String propertiesFile) {
try {
applyConfigParser(context, PropertiesConfigParser.fromAssets(context, propertiesFile));
} catch (Exception e) {
Logger.error(e, "AirshipConfigOptions - Unable to apply config.", new Object[0]);
}
return this;
}
public Builder applyProperties(Context context, Properties properties) {
try {
applyConfigParser(context, PropertiesConfigParser.fromProperties(context, properties));
} catch (Exception e) {
Logger.error(e, "AirshipConfigOptions - Unable to apply config.", new Object[0]);
}
return this;
}
public com.urbanairship.AirshipConfigOptions.Builder applyConfig(android.content.Context r3, int r4) {
throw new UnsupportedOperationException("Method not decompiled: com.urbanairship.AirshipConfigOptions.Builder.applyConfig(android.content.Context, int):com.urbanairship.AirshipConfigOptions$Builder");
}
private void applyConfigParser(Context context, ConfigParser configParser) {
char c;
int i;
for (int i2 = 0; i2 < configParser.getCount(); i2++) {
try {
String name = configParser.getName(i2);
if (name != null) {
switch (name.hashCode()) {
case -2131444128:
if (name.equals(FIELD_CHANNEL_CREATION_DELAY_ENABLED)) {
c = 28;
break;
}
c = 65535;
break;
case -1829910004:
if (name.equals(FIELD_APP_STORE_URI)) {
c = ')';
break;
}
c = 65535;
break;
case -1776171144:
if (name.equals(FIELD_PRODUCTION_APP_SECRET)) {
c = 3;
break;
}
c = 65535;
break;
case -1720015653:
if (name.equals(FIELD_ANALYTICS_ENABLED)) {
c = 22;
break;
}
c = 65535;
break;
case -1653850041:
if (name.equals("whitelist")) {
c = 17;
break;
}
c = 65535;
break;
case -1597596356:
if (name.equals(FIELD_CUSTOM_PUSH_PROVIDER)) {
c = '(';
break;
}
c = 65535;
break;
case -1565695247:
if (name.equals(FIELD_DATA_COLLECTION_OPT_IN_ENABLED)) {
c = '+';
break;
}
c = 65535;
break;
case -1565320553:
if (name.equals(FIELD_PRODUCTION_APP_KEY)) {
c = 2;
break;
}
c = 65535;
break;
case -1554123216:
if (name.equals(FIELD_URL_ALLOW_LIST_SCOPE_JAVASCRIPT_INTERFACE)) {
c = 19;
break;
}
c = 65535;
break;
case -1411093378:
if (name.equals("appKey")) {
c = 0;
break;
}
c = 65535;
break;
case -1387253559:
if (name.equals(FIELD_URL_ALLOW_LIST_SCOPE_OPEN_URL)) {
c = 20;
break;
}
c = 65535;
break;
case -1285301710:
if (name.equals(FIELD_ALLOWED_TRANSPORTS)) {
c = 16;
break;
}
c = 65535;
break;
case -1266098791:
if (name.equals(FIELD_DEVELOPMENT_APP_KEY)) {
c = 4;
break;
}
c = 65535;
break;
case -1249058386:
if (name.equals(FIELD_AUTO_LAUNCH_APPLICATION)) {
c = 27;
break;
}
c = 65535;
break;
case -1106202922:
if (name.equals(FIELD_EXTENDED_BROADCASTS_ENABLED)) {
c = ',';
break;
}
c = 65535;
break;
case -1049518103:
if (name.equals(FIELD_INITIAL_CONFIG_URL)) {
c = '\f';
break;
}
c = 65535;
break;
case -956504956:
if (name.equals(FIELD_CHAT_SOCKET_URL)) {
c = 14;
break;
}
c = 65535;
break;
case -874660855:
if (name.equals(FIELD_ANALYTICS_URL)) {
c = '\t';
break;
}
c = 65535;
break;
case -516160866:
if (name.equals(FIELD_ENABLED_FEATURES)) {
c = '/';
break;
}
c = 65535;
break;
case -398391045:
if (name.equals(FIELD_DEVELOPMENT_LOG_LEVEL)) {
c = 24;
break;
}
c = 65535;
break;
case -361592578:
if (name.equals(FIELD_CHANNEL_CAPTURE_ENABLED)) {
c = 29;
break;
}
c = 65535;
break;
case -318159706:
if (name.equals(FIELD_GCM_SENDER)) {
c = 15;
break;
}
c = 65535;
break;
case -187695495:
if (name.equals(FIELD_PRODUCTION_LOG_LEVEL)) {
c = 25;
break;
}
c = 65535;
break;
case -116200981:
if (name.equals(FIELD_BACKGROUND_REPORTING_INTERVAL_MS)) {
c = 23;
break;
}
c = 65535;
break;
case -93122203:
if (name.equals(FIELD_DEVELOPMENT_FCM_SENDER_ID)) {
c = '$';
break;
}
c = 65535;
break;
case 3530567:
if (name.equals(FIELD_SITE)) {
c = '*';
break;
}
c = 65535;
break;
case 24145854:
if (name.equals(FIELD_IN_PRODUCTION)) {
c = 21;
break;
}
c = 65535;
break;
case 25200441:
if (name.equals(FIELD_DEVICE_URL)) {
c = 7;
break;
}
c = 65535;
break;
case 233293225:
if (name.equals("notificationLargeIcon")) {
c = 31;
break;
}
c = 65535;
break;
case 282201398:
if (name.equals(FIELD_DEVELOPMENT_APP_SECRET)) {
c = 5;
break;
}
c = 65535;
break;
case 290002134:
if (name.equals(FIELD_SUPPRESS_ALLOW_LIST_ERROR)) {
c = '-';
break;
}
c = 65535;
break;
case 476084841:
if (name.equals(FIELD_LEGACY_ANALYTICS_SERVER)) {
c = '\b';
break;
}
c = 65535;
break;
case 739105527:
if (name.equals(FIELD_CHAT_URL)) {
c = '\r';
break;
}
c = 65535;
break;
case 770975322:
if (name.equals(FIELD_REQUIRE_INITIAL_REMOTE_CONFIG_ENABLED)) {
c = '.';
break;
}
c = 65535;
break;
case 988154272:
if (name.equals(FIELD_FCM_SENDER_ID)) {
c = '#';
break;
}
c = 65535;
break;
case 1065256263:
if (name.equals("enableUrlWhitelisting")) {
c = '\'';
break;
}
c = 65535;
break;
case 1098683047:
if (name.equals(FIELD_LEGACY_DEVICE_URL)) {
c = 6;
break;
}
c = 65535;
break;
case 1465076406:
if (name.equals(FIELD_WALLET_URL)) {
c = '!';
break;
}
c = 65535;
break;
case 1485559857:
if (name.equals(FIELD_APP_SECRET)) {
c = 1;
break;
}
c = 65535;
break;
case 1505552078:
if (name.equals(FIELD_NOTIFICATION_ACCENT_COLOR)) {
c = ' ';
break;
}
c = 65535;
break;
case 1579823829:
if (name.equals(FIELD_FCM_FIREBASE_APP_NAME)) {
c = '&';
break;
}
c = 65535;
break;
case 1611189252:
if (name.equals("notificationIcon")) {
c = 30;
break;
}
c = 65535;
break;
case 1779744152:
if (name.equals(FIELD_NOTIFICATION_CHANNEL)) {
c = '\"';
break;
}
c = 65535;
break;
case 1790788391:
if (name.equals(FIELD_PRODUCTION_FCM_SENDER_ID)) {
c = '%';
break;
}
c = 65535;
break;
case 1855914712:
if (name.equals(FIELD_URL_ALLOW_LIST)) {
c = 18;
break;
}
c = 65535;
break;
case 1958618687:
if (name.equals(FIELD_LEGACY_REMOTE_DATA_URL)) {
c = '\n';
break;
}
c = 65535;
break;
case 1958619711:
if (name.equals(FIELD_REMOTE_DATA_URL)) {
c = 11;
break;
}
c = 65535;
break;
case 1995731616:
if (name.equals(FIELD_LOG_LEVEL)) {
c = 26;
break;
}
c = 65535;
break;
default:
c = 65535;
break;
}
switch (c) {
case 0:
setAppKey(configParser.getString(name));
break;
case 1:
setAppSecret(configParser.getString(name));
break;
case 2:
setProductionAppKey(configParser.getString(name));
break;
case 3:
setProductionAppSecret(configParser.getString(name));
break;
case 4:
setDevelopmentAppKey(configParser.getString(name));
break;
case 5:
setDevelopmentAppSecret(configParser.getString(name));
break;
case 6:
case 7:
setDeviceUrl(configParser.getString(name, this.deviceUrl));
break;
case '\b':
case '\t':
setAnalyticsUrl(configParser.getString(name, this.analyticsUrl));
break;
case '\n':
case 11:
setRemoteDataUrl(configParser.getString(name, this.remoteDataUrl));
break;
case '\f':
setInitialConfigUrl(configParser.getString(name, null));
break;
case '\r':
setChatUrl(configParser.getString(name, this.chatUrl));
break;
case 14:
setChatSocketUrl(configParser.getString(name, this.chatSocketUrl));
break;
case 15:
throw new IllegalArgumentException("gcmSender no longer supported. Please use fcmSender or remove it to allow the Airship SDK to pull from the google-services.json.");
case 16:
setAllowedTransports(configParser.getStringArray(name));
break;
case 17:
Logger.error("Parameter whitelist is deprecated and will be removed in a future version of the SDK. Use urlAllowList instead.", new Object[0]);
setUrlAllowList(configParser.getStringArray(name));
break;
case 18:
setUrlAllowList(configParser.getStringArray(name));
break;
case 19:
setUrlAllowListScopeJavaScriptInterface(configParser.getStringArray(name));
break;
case 20:
setUrlAllowListScopeOpenUrl(configParser.getStringArray(name));
break;
case 21:
Boolean bool = this.inProduction;
setInProduction(configParser.getBoolean(name, bool != null && bool.booleanValue()));
break;
case 22:
setAnalyticsEnabled(configParser.getBoolean(name, this.analyticsEnabled));
break;
case 23:
setBackgroundReportingIntervalMS(configParser.getLong(name, this.backgroundReportingIntervalMS));
break;
case 24:
setDevelopmentLogLevel(Logger.parseLogLevel(configParser.getString(name), 3));
break;
case 25:
setProductionLogLevel(Logger.parseLogLevel(configParser.getString(name), 6));
break;
case 26:
setLogLevel(Logger.parseLogLevel(configParser.getString(name), 6));
break;
case 27:
setAutoLaunchApplication(configParser.getBoolean(name, this.autoLaunchApplication));
break;
case 28:
setChannelCreationDelayEnabled(configParser.getBoolean(name, this.channelCreationDelayEnabled));
break;
case 29:
setChannelCaptureEnabled(configParser.getBoolean(name, this.channelCaptureEnabled));
break;
case 30:
setNotificationIcon(configParser.getDrawableResourceId(name));
break;
case 31:
setNotificationLargeIcon(configParser.getDrawableResourceId(name));
break;
case ' ':
setNotificationAccentColor(configParser.getColor(name, this.notificationAccentColor));
break;
case '!':
setWalletUrl(configParser.getString(name, this.walletUrl));
break;
case '\"':
setNotificationChannel(configParser.getString(name));
break;
case '#':
case '$':
case '%':
Logger.error("Support for Sender ID override has been removed. Configure a FirebaseApp and use fcmFirebaseAppName instead.", new Object[0]);
break;
case '&':
setFcmFirebaseAppName(configParser.getString(name));
break;
case '\'':
Logger.error("Parameter enableUrlWhitelisting has been removed. See urlAllowListScopeJavaScriptBridge and urlAllowListScopeOpen instead.", new Object[0]);
break;
case '(':
String string = configParser.getString(name);
Checks.checkNotNull(string, "Missing custom push provider class name");
setCustomPushProvider((PushProvider) Class.forName(string).asSubclass(PushProvider.class).newInstance());
break;
case ')':
setAppStoreUri(Uri.parse(configParser.getString(name)));
break;
case '*':
setSite(AirshipConfigOptions.parseSite(configParser.getString(name)));
break;
case '+':
setDataCollectionOptInEnabled(configParser.getBoolean(name, false));
break;
case ',':
setExtendedBroadcastsEnabled(configParser.getBoolean(name, false));
break;
case '-':
setSuppressAllowListError(configParser.getBoolean(name, false));
break;
case '.':
setRequireInitialRemoteConfigEnabled(configParser.getBoolean(name, false));
break;
case '/':
try {
i = configParser.getInt(name, -1);
} catch (Exception unused) {
i = -1;
}
if (i != -1) {
setEnabledFeatures(i);
break;
} else {
String[] stringArray = configParser.getStringArray(name);
if (stringArray == null) {
throw new IllegalArgumentException("Unable to parse enableFeatures: " + configParser.getString(name));
}
setEnabledFeatures(convertFeatureNames(stringArray));
break;
}
}
}
} catch (Exception e) {
Logger.error(e, "Unable to set config field '%s' due to invalid configuration value.", configParser.getName(i2));
}
}
if (this.inProduction == null) {
detectProvisioningMode(context);
}
}
private int convertFeatureNames(String[] features) {
int i = 0;
for (String str : features) {
if (str != null && !str.isEmpty()) {
str.hashCode();
switch (str) {
case "analytics":
i |= 16;
break;
case "contacts":
i |= 64;
break;
case "in_app_automation":
i |= 1;
break;
case "all":
i |= 255;
break;
case "chat":
i |= 8;
break;
case "push":
i |= 4;
break;
case "message_center":
i |= 2;
break;
case "tags_and_attributes":
i |= 32;
break;
case "location":
i |= 128;
break;
}
}
}
return i;
}
public Builder setNotificationChannel(String channel) {
this.notificationChannel = channel;
return this;
}
public Builder setNotificationIcon(int notificationIcon) {
this.notificationIcon = notificationIcon;
return this;
}
public Builder setNotificationLargeIcon(int notificationLargeIcon) {
this.notificationLargeIcon = notificationLargeIcon;
return this;
}
public Builder setNotificationAccentColor(int notificationAccentColor) {
this.notificationAccentColor = notificationAccentColor;
return this;
}
public Builder setAppKey(String appKey) {
this.appKey = appKey;
return this;
}
public Builder setAppSecret(String appSecret) {
this.appSecret = appSecret;
return this;
}
public Builder setProductionAppKey(String productionAppKey) {
this.productionAppKey = productionAppKey;
return this;
}
public Builder setProductionAppSecret(String productionAppSecret) {
this.productionAppSecret = productionAppSecret;
return this;
}
public Builder setDevelopmentAppKey(String developmentAppKey) {
this.developmentAppKey = developmentAppKey;
return this;
}
public Builder setDevelopmentAppSecret(String developmentAppSecret) {
this.developmentAppSecret = developmentAppSecret;
return this;
}
public Builder setDeviceUrl(String deviceUrl) {
this.deviceUrl = deviceUrl;
return this;
}
public Builder setAnalyticsUrl(String analyticsUrl) {
this.analyticsUrl = analyticsUrl;
return this;
}
public Builder setRemoteDataUrl(String remoteDataUrl) {
this.remoteDataUrl = remoteDataUrl;
return this;
}
public Builder setInitialConfigUrl(String initialConfigUrl) {
this.initialConfigUrl = initialConfigUrl;
return this;
}
public Builder setAllowedTransports(String[] allowedTransports) {
this.allowedTransports.clear();
if (allowedTransports != null) {
this.allowedTransports.addAll(Arrays.asList(allowedTransports));
}
return this;
}
public Builder setUrlAllowList(String[] urlAllowList) {
this.urlAllowList.clear();
if (urlAllowList != null) {
this.urlAllowList.addAll(Arrays.asList(urlAllowList));
}
return this;
}
public Builder setUrlAllowListScopeJavaScriptInterface(String[] urlAllowListScopeJavaScriptInterface) {
this.urlAllowListScopeJavaScriptInterface.clear();
if (urlAllowListScopeJavaScriptInterface != null) {
this.urlAllowListScopeJavaScriptInterface.addAll(Arrays.asList(urlAllowListScopeJavaScriptInterface));
}
return this;
}
public Builder setUrlAllowListScopeOpenUrl(String[] urlAllowListScopeOpenUrl) {
this.urlAllowListScopeOpenUrl.clear();
if (urlAllowListScopeOpenUrl != null) {
this.urlAllowListScopeOpenUrl.addAll(Arrays.asList(urlAllowListScopeOpenUrl));
}
return this;
}
public Builder setInProduction(boolean inProduction) {
this.inProduction = Boolean.valueOf(inProduction);
return this;
}
public Builder detectProvisioningMode(Context context) {
try {
this.inProduction = Boolean.valueOf(!((Boolean) Class.forName(new StringBuilder().append(context.getPackageName()).append(".BuildConfig").toString()).getField("DEBUG").get(null)).booleanValue());
} catch (Exception unused) {
Logger.warn("AirshipConfigOptions - Unable to determine the build mode. Defaulting to debug.", new Object[0]);
this.inProduction = false;
}
return this;
}
public Builder setAnalyticsEnabled(boolean analyticsEnabled) {
this.analyticsEnabled = analyticsEnabled;
return this;
}
public Builder setBackgroundReportingIntervalMS(long backgroundReportingIntervalMS) {
this.backgroundReportingIntervalMS = backgroundReportingIntervalMS;
return this;
}
public Builder setDevelopmentLogLevel(int developmentLogLevel) {
this.developmentLogLevel = Integer.valueOf(developmentLogLevel);
return this;
}
public Builder setProductionLogLevel(int productionLogLevel) {
this.productionLogLevel = Integer.valueOf(productionLogLevel);
return this;
}
public Builder setLogLevel(int logLevel) {
this.logLevel = Integer.valueOf(logLevel);
return this;
}
public Builder setAutoLaunchApplication(boolean autoLaunchApplication) {
this.autoLaunchApplication = autoLaunchApplication;
return this;
}
public Builder setChannelCreationDelayEnabled(boolean channelCreationDelayEnabled) {
this.channelCreationDelayEnabled = channelCreationDelayEnabled;
return this;
}
public Builder setChannelCaptureEnabled(boolean channelCaptureEnabled) {
this.channelCaptureEnabled = channelCaptureEnabled;
return this;
}
public Builder setWalletUrl(String walletUrl) {
this.walletUrl = walletUrl;
return this;
}
public Builder setChatUrl(String chatUrl) {
this.chatUrl = chatUrl;
return this;
}
public Builder setChatSocketUrl(String chatSocketUrl) {
this.chatSocketUrl = chatSocketUrl;
return this;
}
public Builder setCustomPushProvider(PushProvider customPushProvider) {
this.customPushProvider = customPushProvider;
return this;
}
public Builder setAppStoreUri(Uri appStoreUri) {
this.appStoreUri = appStoreUri;
return this;
}
public Builder setSite(String site) {
this.site = site;
return this;
}
@Deprecated
public Builder setDataCollectionOptInEnabled(boolean dataCollectionOptInEnabled) {
this.dataCollectionOptInEnabled = dataCollectionOptInEnabled;
return this;
}
public Builder setExtendedBroadcastsEnabled(boolean extendedBroadcastsEnabled) {
this.extendedBroadcastsEnabled = extendedBroadcastsEnabled;
return this;
}
public Builder setEnabledFeatures(int... enabledFeatures) {
this.enabledFeatures = PrivacyManager.combine(enabledFeatures);
return this;
}
public Builder setSuppressAllowListError(boolean suppressAllowListError) {
this.suppressAllowListError = suppressAllowListError;
return this;
}
public Builder setFcmFirebaseAppName(String fcmFirebaseAppName) {
this.fcmFirebaseAppName = fcmFirebaseAppName;
return this;
}
public Builder setRequireInitialRemoteConfigEnabled(boolean requireInitialRemoteConfigEnabled) {
this.requireInitialRemoteConfigEnabled = requireInitialRemoteConfigEnabled;
return this;
}
public AirshipConfigOptions build() {
if (this.urlAllowList.isEmpty() && this.urlAllowListScopeOpenUrl.isEmpty() && !this.suppressAllowListError) {
Logger.error("The airship config options is missing URL allow list rules for SCOPE_OPEN. By default only Airship, YouTube, mailto, sms, and tel URLs will be allowed.To suppress this error, specify allow list rules by providing rules for urlAllowListScopeOpenUrl or urlAllowList. Alternatively you can suppress this error and keep the default rules by using the flag suppressAllowListError. For more information, see https://docs.airship.com/platform/android/getting-started/#url-allow-list.", new Object[0]);
}
if (this.inProduction == null) {
this.inProduction = false;
}
String str = this.productionAppKey;
if (str != null && str.equals(this.developmentAppKey)) {
Logger.warn("Production App Key matches Development App Key", new Object[0]);
}
String str2 = this.productionAppSecret;
if (str2 != null && str2.equals(this.developmentAppSecret)) {
Logger.warn("Production App Secret matches Development App Secret", new Object[0]);
}
if (this.dataCollectionOptInEnabled) {
Logger.warn("dataCollectionOptInEnabled is deprecated. Use enabledFeatures instead.", new Object[0]);
if (this.enabledFeatures == 255) {
this.enabledFeatures = 0;
}
}
return new AirshipConfigOptions(this);
}
}
}