Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,590 @@
package com.facebook;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import com.facebook.AccessToken;
import com.facebook.LegacyTokenHelper;
import com.facebook.gamingservices.cloudgaming.internal.SDKConstants;
import com.facebook.internal.Utility;
import com.facebook.internal.Validate;
import com.ironsource.mediationsdk.logger.IronSourceError;
import com.ironsource.v8;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class AccessToken implements Parcelable {
public static final String ACCESS_TOKEN_KEY = "access_token";
private static final String APPLICATION_ID_KEY = "application_id";
public static final Parcelable.Creator<AccessToken> CREATOR;
private static final int CURRENT_JSON_FORMAT = 1;
public static final Companion Companion = new Companion(null);
public static final String DATA_ACCESS_EXPIRATION_TIME = "data_access_expiration_time";
private static final String DECLINED_PERMISSIONS_KEY = "declined_permissions";
private static final AccessTokenSource DEFAULT_ACCESS_TOKEN_SOURCE;
private static final Date DEFAULT_EXPIRATION_TIME;
public static final String DEFAULT_GRAPH_DOMAIN = "facebook";
private static final Date DEFAULT_LAST_REFRESH_TIME;
private static final String EXPIRED_PERMISSIONS_KEY = "expired_permissions";
private static final String EXPIRES_AT_KEY = "expires_at";
public static final String EXPIRES_IN_KEY = "expires_in";
public static final String GRAPH_DOMAIN = "graph_domain";
private static final String LAST_REFRESH_KEY = "last_refresh";
private static final Date MAX_DATE;
private static final String PERMISSIONS_KEY = "permissions";
private static final String SOURCE_KEY = "source";
private static final String TOKEN_KEY = "token";
public static final String USER_ID_KEY = "user_id";
private static final String VERSION_KEY = "version";
private final String applicationId;
private final Date dataAccessExpirationTime;
private final Set<String> declinedPermissions;
private final Set<String> expiredPermissions;
private final Date expires;
private final String graphDomain;
private final Date lastRefresh;
private final Set<String> permissions;
private final AccessTokenSource source;
private final String token;
private final String userId;
public interface AccessTokenCreationCallback {
void onError(FacebookException facebookException);
void onSuccess(AccessToken accessToken);
}
public interface AccessTokenRefreshCallback {
void OnTokenRefreshFailed(FacebookException facebookException);
void OnTokenRefreshed(AccessToken accessToken);
}
public /* synthetic */ class WhenMappings {
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
static {
int[] iArr = new int[AccessTokenSource.valuesCustom().length];
iArr[AccessTokenSource.FACEBOOK_APPLICATION_WEB.ordinal()] = 1;
iArr[AccessTokenSource.CHROME_CUSTOM_TAB.ordinal()] = 2;
iArr[AccessTokenSource.WEB_VIEW.ordinal()] = 3;
$EnumSwitchMapping$0 = iArr;
}
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public AccessToken(String accessToken, String applicationId, String userId, Collection<String> collection, Collection<String> collection2, Collection<String> collection3, AccessTokenSource accessTokenSource, Date date, Date date2, Date date3) {
this(accessToken, applicationId, userId, collection, collection2, collection3, accessTokenSource, date, date2, date3, null, 1024, null);
Intrinsics.checkNotNullParameter(accessToken, "accessToken");
Intrinsics.checkNotNullParameter(applicationId, "applicationId");
Intrinsics.checkNotNullParameter(userId, "userId");
}
public static final void createFromNativeLinkingIntent(Intent intent, String str, AccessTokenCreationCallback accessTokenCreationCallback) {
Companion.createFromNativeLinkingIntent(intent, str, accessTokenCreationCallback);
}
public static final void expireCurrentAccessToken() {
Companion.expireCurrentAccessToken();
}
public static final AccessToken getCurrentAccessToken() {
return Companion.getCurrentAccessToken();
}
public static final boolean isCurrentAccessTokenActive() {
return Companion.isCurrentAccessTokenActive();
}
public static final boolean isDataAccessActive() {
return Companion.isDataAccessActive();
}
public static final boolean isLoggedInWithInstagram() {
return Companion.isLoggedInWithInstagram();
}
public static final void refreshCurrentAccessTokenAsync() {
Companion.refreshCurrentAccessTokenAsync();
}
public static final void refreshCurrentAccessTokenAsync(AccessTokenRefreshCallback accessTokenRefreshCallback) {
Companion.refreshCurrentAccessTokenAsync(accessTokenRefreshCallback);
}
public static final void setCurrentAccessToken(AccessToken accessToken) {
Companion.setCurrentAccessToken(accessToken);
}
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
public final String getApplicationId() {
return this.applicationId;
}
public final Date getDataAccessExpirationTime() {
return this.dataAccessExpirationTime;
}
public final Set<String> getDeclinedPermissions() {
return this.declinedPermissions;
}
public final Set<String> getExpiredPermissions() {
return this.expiredPermissions;
}
public final Date getExpires() {
return this.expires;
}
public final String getGraphDomain() {
return this.graphDomain;
}
public final Date getLastRefresh() {
return this.lastRefresh;
}
public final Set<String> getPermissions() {
return this.permissions;
}
public final AccessTokenSource getSource() {
return this.source;
}
public final String getToken() {
return this.token;
}
public final String getUserId() {
return this.userId;
}
public /* synthetic */ AccessToken(String str, String str2, String str3, Collection collection, Collection collection2, Collection collection3, AccessTokenSource accessTokenSource, Date date, Date date2, Date date3, String str4, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(str, str2, str3, collection, collection2, collection3, accessTokenSource, date, date2, date3, (i & 1024) != 0 ? "facebook" : str4);
}
public AccessToken(String accessToken, String applicationId, String userId, Collection<String> collection, Collection<String> collection2, Collection<String> collection3, AccessTokenSource accessTokenSource, Date date, Date date2, Date date3, String str) {
Intrinsics.checkNotNullParameter(accessToken, "accessToken");
Intrinsics.checkNotNullParameter(applicationId, "applicationId");
Intrinsics.checkNotNullParameter(userId, "userId");
Validate.notEmpty(accessToken, SDKConstants.PARAM_ACCESS_TOKEN);
Validate.notEmpty(applicationId, "applicationId");
Validate.notEmpty(userId, "userId");
this.expires = date == null ? DEFAULT_EXPIRATION_TIME : date;
Set<String> unmodifiableSet = Collections.unmodifiableSet(collection != null ? new HashSet(collection) : new HashSet());
Intrinsics.checkNotNullExpressionValue(unmodifiableSet, "unmodifiableSet(if (permissions != null) HashSet(permissions) else HashSet())");
this.permissions = unmodifiableSet;
Set<String> unmodifiableSet2 = Collections.unmodifiableSet(collection2 != null ? new HashSet(collection2) : new HashSet());
Intrinsics.checkNotNullExpressionValue(unmodifiableSet2, "unmodifiableSet(\n if (declinedPermissions != null) HashSet(declinedPermissions) else HashSet())");
this.declinedPermissions = unmodifiableSet2;
Set<String> unmodifiableSet3 = Collections.unmodifiableSet(collection3 != null ? new HashSet(collection3) : new HashSet());
Intrinsics.checkNotNullExpressionValue(unmodifiableSet3, "unmodifiableSet(\n if (expiredPermissions != null) HashSet(expiredPermissions) else HashSet())");
this.expiredPermissions = unmodifiableSet3;
this.token = accessToken;
this.source = convertTokenSourceForGraphDomain(accessTokenSource == null ? DEFAULT_ACCESS_TOKEN_SOURCE : accessTokenSource, str);
this.lastRefresh = date2 == null ? DEFAULT_LAST_REFRESH_TIME : date2;
this.applicationId = applicationId;
this.userId = userId;
this.dataAccessExpirationTime = (date3 == null || date3.getTime() == 0) ? DEFAULT_EXPIRATION_TIME : date3;
this.graphDomain = str == null ? "facebook" : str;
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{AccessToken");
sb.append(" token:");
sb.append(tokenToString());
appendPermissions(sb);
sb.append("}");
String sb2 = sb.toString();
Intrinsics.checkNotNullExpressionValue(sb2, "builder.toString()");
return sb2;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof AccessToken)) {
return false;
}
AccessToken accessToken = (AccessToken) obj;
if (Intrinsics.areEqual(this.expires, accessToken.expires) && Intrinsics.areEqual(this.permissions, accessToken.permissions) && Intrinsics.areEqual(this.declinedPermissions, accessToken.declinedPermissions) && Intrinsics.areEqual(this.expiredPermissions, accessToken.expiredPermissions) && Intrinsics.areEqual(this.token, accessToken.token) && this.source == accessToken.source && Intrinsics.areEqual(this.lastRefresh, accessToken.lastRefresh) && Intrinsics.areEqual(this.applicationId, accessToken.applicationId) && Intrinsics.areEqual(this.userId, accessToken.userId) && Intrinsics.areEqual(this.dataAccessExpirationTime, accessToken.dataAccessExpirationTime)) {
String str = this.graphDomain;
String str2 = accessToken.graphDomain;
if (str == null) {
if (str2 == null) {
return true;
}
} else if (Intrinsics.areEqual(str, str2)) {
return true;
}
}
return false;
}
public int hashCode() {
int hashCode = (((((((((((((((((((IronSourceError.ERROR_NON_EXISTENT_INSTANCE + this.expires.hashCode()) * 31) + this.permissions.hashCode()) * 31) + this.declinedPermissions.hashCode()) * 31) + this.expiredPermissions.hashCode()) * 31) + this.token.hashCode()) * 31) + this.source.hashCode()) * 31) + this.lastRefresh.hashCode()) * 31) + this.applicationId.hashCode()) * 31) + this.userId.hashCode()) * 31) + this.dataAccessExpirationTime.hashCode()) * 31;
String str = this.graphDomain;
return hashCode + (str == null ? 0 : str.hashCode());
}
public final boolean isExpired() {
return new Date().after(this.expires);
}
public final boolean isDataAccessExpired() {
return new Date().after(this.dataAccessExpirationTime);
}
public final boolean isInstagramToken() {
String str = this.graphDomain;
return str != null && str.equals(FacebookSdk.INSTAGRAM);
}
public final JSONObject toJSONObject$facebook_core_release() throws JSONException {
JSONObject jSONObject = new JSONObject();
jSONObject.put("version", 1);
jSONObject.put("token", this.token);
jSONObject.put(EXPIRES_AT_KEY, this.expires.getTime());
jSONObject.put("permissions", new JSONArray((Collection) this.permissions));
jSONObject.put(DECLINED_PERMISSIONS_KEY, new JSONArray((Collection) this.declinedPermissions));
jSONObject.put(EXPIRED_PERMISSIONS_KEY, new JSONArray((Collection) this.expiredPermissions));
jSONObject.put(LAST_REFRESH_KEY, this.lastRefresh.getTime());
jSONObject.put("source", this.source.name());
jSONObject.put(APPLICATION_ID_KEY, this.applicationId);
jSONObject.put("user_id", this.userId);
jSONObject.put(DATA_ACCESS_EXPIRATION_TIME, this.dataAccessExpirationTime.getTime());
String str = this.graphDomain;
if (str != null) {
jSONObject.put("graph_domain", str);
}
return jSONObject;
}
private final String tokenToString() {
FacebookSdk facebookSdk = FacebookSdk.INSTANCE;
return FacebookSdk.isLoggingBehaviorEnabled(LoggingBehavior.INCLUDE_ACCESS_TOKENS) ? this.token : "ACCESS_TOKEN_REMOVED";
}
private final void appendPermissions(StringBuilder sb) {
sb.append(" permissions:");
sb.append(v8.i.d);
sb.append(TextUtils.join(", ", this.permissions));
sb.append(v8.i.e);
}
private final AccessTokenSource convertTokenSourceForGraphDomain(AccessTokenSource accessTokenSource, String str) {
if (str == null || !str.equals(FacebookSdk.INSTAGRAM)) {
return accessTokenSource;
}
int i = WhenMappings.$EnumSwitchMapping$0[accessTokenSource.ordinal()];
if (i == 1) {
return AccessTokenSource.INSTAGRAM_APPLICATION_WEB;
}
if (i != 2) {
return i != 3 ? accessTokenSource : AccessTokenSource.INSTAGRAM_WEB_VIEW;
}
return AccessTokenSource.INSTAGRAM_CUSTOM_CHROME_TAB;
}
public AccessToken(Parcel parcel) {
Intrinsics.checkNotNullParameter(parcel, "parcel");
this.expires = new Date(parcel.readLong());
ArrayList arrayList = new ArrayList();
parcel.readStringList(arrayList);
Set<String> unmodifiableSet = Collections.unmodifiableSet(new HashSet(arrayList));
Intrinsics.checkNotNullExpressionValue(unmodifiableSet, "unmodifiableSet(HashSet(permissionsList))");
this.permissions = unmodifiableSet;
arrayList.clear();
parcel.readStringList(arrayList);
Set<String> unmodifiableSet2 = Collections.unmodifiableSet(new HashSet(arrayList));
Intrinsics.checkNotNullExpressionValue(unmodifiableSet2, "unmodifiableSet(HashSet(permissionsList))");
this.declinedPermissions = unmodifiableSet2;
arrayList.clear();
parcel.readStringList(arrayList);
Set<String> unmodifiableSet3 = Collections.unmodifiableSet(new HashSet(arrayList));
Intrinsics.checkNotNullExpressionValue(unmodifiableSet3, "unmodifiableSet(HashSet(permissionsList))");
this.expiredPermissions = unmodifiableSet3;
this.token = Validate.notNullOrEmpty(parcel.readString(), "token");
String readString = parcel.readString();
this.source = readString != null ? AccessTokenSource.valueOf(readString) : DEFAULT_ACCESS_TOKEN_SOURCE;
this.lastRefresh = new Date(parcel.readLong());
this.applicationId = Validate.notNullOrEmpty(parcel.readString(), "applicationId");
this.userId = Validate.notNullOrEmpty(parcel.readString(), "userId");
this.dataAccessExpirationTime = new Date(parcel.readLong());
this.graphDomain = parcel.readString();
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel dest, int i) {
Intrinsics.checkNotNullParameter(dest, "dest");
dest.writeLong(this.expires.getTime());
dest.writeStringList(new ArrayList(this.permissions));
dest.writeStringList(new ArrayList(this.declinedPermissions));
dest.writeStringList(new ArrayList(this.expiredPermissions));
dest.writeString(this.token);
dest.writeString(this.source.name());
dest.writeLong(this.lastRefresh.getTime());
dest.writeString(this.applicationId);
dest.writeString(this.userId);
dest.writeLong(this.dataAccessExpirationTime.getTime());
dest.writeString(this.graphDomain);
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final AccessToken getCurrentAccessToken() {
return AccessTokenManager.Companion.getInstance().getCurrentAccessToken();
}
public final void setCurrentAccessToken(AccessToken accessToken) {
AccessTokenManager.Companion.getInstance().setCurrentAccessToken(accessToken);
}
public final boolean isCurrentAccessTokenActive() {
AccessToken currentAccessToken = AccessTokenManager.Companion.getInstance().getCurrentAccessToken();
return (currentAccessToken == null || currentAccessToken.isExpired()) ? false : true;
}
public final boolean isDataAccessActive() {
AccessToken currentAccessToken = AccessTokenManager.Companion.getInstance().getCurrentAccessToken();
return (currentAccessToken == null || currentAccessToken.isDataAccessExpired()) ? false : true;
}
public final boolean isLoggedInWithInstagram() {
AccessToken currentAccessToken = AccessTokenManager.Companion.getInstance().getCurrentAccessToken();
return (currentAccessToken == null || currentAccessToken.isExpired() || !currentAccessToken.isInstagramToken()) ? false : true;
}
public final void expireCurrentAccessToken() {
AccessToken currentAccessToken = AccessTokenManager.Companion.getInstance().getCurrentAccessToken();
if (currentAccessToken != null) {
setCurrentAccessToken(createExpired$facebook_core_release(currentAccessToken));
}
}
public final void refreshCurrentAccessTokenAsync() {
AccessTokenManager.Companion.getInstance().refreshCurrentAccessToken(null);
}
public final void refreshCurrentAccessTokenAsync(AccessTokenRefreshCallback accessTokenRefreshCallback) {
AccessTokenManager.Companion.getInstance().refreshCurrentAccessToken(accessTokenRefreshCallback);
}
public final void createFromNativeLinkingIntent(Intent intent, final String applicationId, final AccessTokenCreationCallback accessTokenCallback) {
Intrinsics.checkNotNullParameter(intent, "intent");
Intrinsics.checkNotNullParameter(applicationId, "applicationId");
Intrinsics.checkNotNullParameter(accessTokenCallback, "accessTokenCallback");
if (intent.getExtras() == null) {
accessTokenCallback.onError(new FacebookException("No extras found on intent"));
return;
}
final Bundle bundle = new Bundle(intent.getExtras());
String string = bundle.getString("access_token");
if (string == null || string.length() == 0) {
accessTokenCallback.onError(new FacebookException("No access token found on intent"));
return;
}
String string2 = bundle.getString("user_id");
if (string2 == null || string2.length() == 0) {
Utility utility = Utility.INSTANCE;
Utility.getGraphMeRequestWithCacheAsync(string, new Utility.GraphMeRequestWithCacheCallback() { // from class: com.facebook.AccessToken$Companion$createFromNativeLinkingIntent$1
@Override // com.facebook.internal.Utility.GraphMeRequestWithCacheCallback
public void onSuccess(JSONObject jSONObject) {
String string3;
AccessToken createFromBundle;
if (jSONObject == null) {
string3 = null;
} else {
try {
string3 = jSONObject.getString("id");
} catch (Exception unused) {
accessTokenCallback.onError(new FacebookException("Unable to generate access token due to missing user id"));
return;
}
}
if (string3 == null) {
throw new IllegalStateException("Required value was null.".toString());
}
bundle.putString("user_id", string3);
AccessToken.AccessTokenCreationCallback accessTokenCreationCallback = accessTokenCallback;
createFromBundle = AccessToken.Companion.createFromBundle(null, bundle, AccessTokenSource.FACEBOOK_APPLICATION_WEB, new Date(), applicationId);
accessTokenCreationCallback.onSuccess(createFromBundle);
}
@Override // com.facebook.internal.Utility.GraphMeRequestWithCacheCallback
public void onFailure(FacebookException facebookException) {
accessTokenCallback.onError(facebookException);
}
});
} else {
accessTokenCallback.onSuccess(createFromBundle(null, bundle, AccessTokenSource.FACEBOOK_APPLICATION_WEB, new Date(), applicationId));
}
}
@SuppressLint({"FieldGetter"})
public final AccessToken createFromRefresh$facebook_core_release(AccessToken current, Bundle bundle) {
Intrinsics.checkNotNullParameter(current, "current");
Intrinsics.checkNotNullParameter(bundle, "bundle");
if (current.getSource() != AccessTokenSource.FACEBOOK_APPLICATION_WEB && current.getSource() != AccessTokenSource.FACEBOOK_APPLICATION_NATIVE && current.getSource() != AccessTokenSource.FACEBOOK_APPLICATION_SERVICE) {
throw new FacebookException(Intrinsics.stringPlus("Invalid token source: ", current.getSource()));
}
Utility utility = Utility.INSTANCE;
Date bundleLongAsDate = Utility.getBundleLongAsDate(bundle, AccessToken.EXPIRES_IN_KEY, new Date(0L));
String string = bundle.getString("access_token");
if (string == null) {
return null;
}
String string2 = bundle.getString("graph_domain");
Date bundleLongAsDate2 = Utility.getBundleLongAsDate(bundle, AccessToken.DATA_ACCESS_EXPIRATION_TIME, new Date(0L));
if (Utility.isNullOrEmpty(string)) {
return null;
}
return new AccessToken(string, current.getApplicationId(), current.getUserId(), current.getPermissions(), current.getDeclinedPermissions(), current.getExpiredPermissions(), current.getSource(), bundleLongAsDate, new Date(), bundleLongAsDate2, string2);
}
public final AccessToken createExpired$facebook_core_release(AccessToken current) {
Intrinsics.checkNotNullParameter(current, "current");
return new AccessToken(current.getToken(), current.getApplicationId(), current.getUserId(), current.getPermissions(), current.getDeclinedPermissions(), current.getExpiredPermissions(), current.getSource(), new Date(), new Date(), current.getDataAccessExpirationTime(), null, 1024, null);
}
public final AccessToken createFromLegacyCache$facebook_core_release(Bundle bundle) {
String string;
Intrinsics.checkNotNullParameter(bundle, "bundle");
List<String> permissionsFromBundle$facebook_core_release = getPermissionsFromBundle$facebook_core_release(bundle, LegacyTokenHelper.PERMISSIONS_KEY);
List<String> permissionsFromBundle$facebook_core_release2 = getPermissionsFromBundle$facebook_core_release(bundle, LegacyTokenHelper.DECLINED_PERMISSIONS_KEY);
List<String> permissionsFromBundle$facebook_core_release3 = getPermissionsFromBundle$facebook_core_release(bundle, LegacyTokenHelper.EXPIRED_PERMISSIONS_KEY);
LegacyTokenHelper.Companion companion = LegacyTokenHelper.Companion;
String applicationId = companion.getApplicationId(bundle);
if (Utility.isNullOrEmpty(applicationId)) {
applicationId = FacebookSdk.getApplicationId();
}
String str = applicationId;
String token = companion.getToken(bundle);
if (token == null) {
return null;
}
JSONObject awaitGetGraphMeRequestWithCache = Utility.awaitGetGraphMeRequestWithCache(token);
if (awaitGetGraphMeRequestWithCache == null) {
string = null;
} else {
try {
string = awaitGetGraphMeRequestWithCache.getString("id");
} catch (JSONException unused) {
return null;
}
}
if (str == null || string == null) {
return null;
}
return new AccessToken(token, str, string, permissionsFromBundle$facebook_core_release, permissionsFromBundle$facebook_core_release2, permissionsFromBundle$facebook_core_release3, companion.getSource(bundle), companion.getExpirationDate(bundle), companion.getLastRefreshDate(bundle), null, null, 1024, null);
}
public final List<String> getPermissionsFromBundle$facebook_core_release(Bundle bundle, String str) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
ArrayList<String> stringArrayList = bundle.getStringArrayList(str);
if (stringArrayList == null) {
return CollectionsKt__CollectionsKt.emptyList();
}
List<String> unmodifiableList = Collections.unmodifiableList(new ArrayList(stringArrayList));
Intrinsics.checkNotNullExpressionValue(unmodifiableList, "{\n Collections.unmodifiableList(ArrayList(originalPermissions))\n }");
return unmodifiableList;
}
public final AccessToken createFromJSONObject$facebook_core_release(JSONObject jsonObject) throws JSONException {
Collection jsonArrayToStringList;
Intrinsics.checkNotNullParameter(jsonObject, "jsonObject");
if (jsonObject.getInt("version") > 1) {
throw new FacebookException("Unknown AccessToken serialization format.");
}
String token = jsonObject.getString("token");
Date date = new Date(jsonObject.getLong(AccessToken.EXPIRES_AT_KEY));
JSONArray permissionsArray = jsonObject.getJSONArray("permissions");
JSONArray declinedPermissionsArray = jsonObject.getJSONArray(AccessToken.DECLINED_PERMISSIONS_KEY);
JSONArray optJSONArray = jsonObject.optJSONArray(AccessToken.EXPIRED_PERMISSIONS_KEY);
Date date2 = new Date(jsonObject.getLong(AccessToken.LAST_REFRESH_KEY));
String string = jsonObject.getString("source");
Intrinsics.checkNotNullExpressionValue(string, "jsonObject.getString(SOURCE_KEY)");
AccessTokenSource valueOf = AccessTokenSource.valueOf(string);
String applicationId = jsonObject.getString(AccessToken.APPLICATION_ID_KEY);
String userId = jsonObject.getString("user_id");
Date date3 = new Date(jsonObject.optLong(AccessToken.DATA_ACCESS_EXPIRATION_TIME, 0L));
String optString = jsonObject.optString("graph_domain", null);
Intrinsics.checkNotNullExpressionValue(token, "token");
Intrinsics.checkNotNullExpressionValue(applicationId, "applicationId");
Intrinsics.checkNotNullExpressionValue(userId, "userId");
Utility utility = Utility.INSTANCE;
Intrinsics.checkNotNullExpressionValue(permissionsArray, "permissionsArray");
List<String> jsonArrayToStringList2 = Utility.jsonArrayToStringList(permissionsArray);
Intrinsics.checkNotNullExpressionValue(declinedPermissionsArray, "declinedPermissionsArray");
List<String> jsonArrayToStringList3 = Utility.jsonArrayToStringList(declinedPermissionsArray);
if (optJSONArray == null) {
jsonArrayToStringList = new ArrayList();
} else {
jsonArrayToStringList = Utility.jsonArrayToStringList(optJSONArray);
}
return new AccessToken(token, applicationId, userId, jsonArrayToStringList2, jsonArrayToStringList3, jsonArrayToStringList, valueOf, date, date2, date3, optString);
}
/* JADX INFO: Access modifiers changed from: private */
public final AccessToken createFromBundle(List<String> list, Bundle bundle, AccessTokenSource accessTokenSource, Date date, String str) {
Date bundleLongAsDate;
String string;
String string2 = bundle.getString("access_token");
if (string2 == null || (bundleLongAsDate = Utility.getBundleLongAsDate(bundle, AccessToken.EXPIRES_IN_KEY, date)) == null || (string = bundle.getString("user_id")) == null) {
return null;
}
return new AccessToken(string2, str, string, list, null, null, accessTokenSource, bundleLongAsDate, new Date(), Utility.getBundleLongAsDate(bundle, AccessToken.DATA_ACCESS_EXPIRATION_TIME, new Date(0L)), null, 1024, null);
}
}
static {
Date date = new Date(Long.MAX_VALUE);
MAX_DATE = date;
DEFAULT_EXPIRATION_TIME = date;
DEFAULT_LAST_REFRESH_TIME = new Date();
DEFAULT_ACCESS_TOKEN_SOURCE = AccessTokenSource.FACEBOOK_APPLICATION_WEB;
CREATOR = new Parcelable.Creator<AccessToken>() { // from class: com.facebook.AccessToken$Companion$CREATOR$1
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public AccessToken createFromParcel(Parcel source) {
Intrinsics.checkNotNullParameter(source, "source");
return new AccessToken(source);
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public AccessToken[] newArray(int i) {
return new AccessToken[i];
}
};
}
}

View File

@@ -0,0 +1,149 @@
package com.facebook;
import android.content.SharedPreferences;
import android.os.Bundle;
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
import kotlin.Unit;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class AccessTokenCache {
public static final String CACHED_ACCESS_TOKEN_KEY = "com.facebook.AccessTokenManager.CachedAccessToken";
public static final Companion Companion = new Companion(null);
private final SharedPreferences sharedPreferences;
private final SharedPreferencesTokenCachingStrategyFactory tokenCachingStrategyFactory;
private LegacyTokenHelper tokenCachingStrategyField;
public AccessTokenCache(SharedPreferences sharedPreferences, SharedPreferencesTokenCachingStrategyFactory tokenCachingStrategyFactory) {
Intrinsics.checkNotNullParameter(sharedPreferences, "sharedPreferences");
Intrinsics.checkNotNullParameter(tokenCachingStrategyFactory, "tokenCachingStrategyFactory");
this.sharedPreferences = sharedPreferences;
this.tokenCachingStrategyFactory = tokenCachingStrategyFactory;
}
private final LegacyTokenHelper getTokenCachingStrategy() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
if (this.tokenCachingStrategyField == null) {
synchronized (this) {
try {
if (this.tokenCachingStrategyField == null) {
this.tokenCachingStrategyField = this.tokenCachingStrategyFactory.create();
}
Unit unit = Unit.INSTANCE;
} finally {
}
}
}
LegacyTokenHelper legacyTokenHelper = this.tokenCachingStrategyField;
if (legacyTokenHelper != null) {
return legacyTokenHelper;
}
throw new IllegalStateException("Required value was null.".toString());
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
}
/* JADX WARN: Illegal instructions before constructor call */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public AccessTokenCache() {
/*
r3 = this;
android.content.Context r0 = com.facebook.FacebookSdk.getApplicationContext()
java.lang.String r1 = "com.facebook.AccessTokenManager.SharedPreferences"
r2 = 0
android.content.SharedPreferences r0 = r0.getSharedPreferences(r1, r2)
java.lang.String r1 = "FacebookSdk.getApplicationContext()\n .getSharedPreferences(\n AccessTokenManager.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE)"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r0, r1)
com.facebook.AccessTokenCache$SharedPreferencesTokenCachingStrategyFactory r1 = new com.facebook.AccessTokenCache$SharedPreferencesTokenCachingStrategyFactory
r1.<init>()
r3.<init>(r0, r1)
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.AccessTokenCache.<init>():void");
}
public final AccessToken load() {
if (hasCachedAccessToken()) {
return getCachedAccessToken();
}
if (!shouldCheckLegacyToken()) {
return null;
}
AccessToken legacyAccessToken = getLegacyAccessToken();
if (legacyAccessToken == null) {
return legacyAccessToken;
}
save(legacyAccessToken);
getTokenCachingStrategy().clear();
return legacyAccessToken;
}
public final void save(AccessToken accessToken) {
Intrinsics.checkNotNullParameter(accessToken, "accessToken");
try {
this.sharedPreferences.edit().putString(CACHED_ACCESS_TOKEN_KEY, accessToken.toJSONObject$facebook_core_release().toString()).apply();
} catch (JSONException unused) {
}
}
public final void clear() {
this.sharedPreferences.edit().remove(CACHED_ACCESS_TOKEN_KEY).apply();
if (shouldCheckLegacyToken()) {
getTokenCachingStrategy().clear();
}
}
private final boolean hasCachedAccessToken() {
return this.sharedPreferences.contains(CACHED_ACCESS_TOKEN_KEY);
}
private final AccessToken getCachedAccessToken() {
String string = this.sharedPreferences.getString(CACHED_ACCESS_TOKEN_KEY, null);
if (string == null) {
return null;
}
try {
return AccessToken.Companion.createFromJSONObject$facebook_core_release(new JSONObject(string));
} catch (JSONException unused) {
return null;
}
}
private final boolean shouldCheckLegacyToken() {
return FacebookSdk.isLegacyTokenUpgradeSupported();
}
private final AccessToken getLegacyAccessToken() {
Bundle load = getTokenCachingStrategy().load();
if (load == null || !LegacyTokenHelper.Companion.hasTokenInformation(load)) {
return null;
}
return AccessToken.Companion.createFromLegacyCache$facebook_core_release(load);
}
public static final class SharedPreferencesTokenCachingStrategyFactory {
public final LegacyTokenHelper create() {
return new LegacyTokenHelper(FacebookSdk.getApplicationContext(), null, 2, null);
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,509 @@
package com.facebook;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import androidx.core.app.NotificationCompat;
import androidx.core.view.accessibility.AccessibilityEventCompat;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.facebook.AccessToken;
import com.facebook.AccessTokenManager;
import com.facebook.GraphRequest;
import com.facebook.GraphRequestBatch;
import com.facebook.internal.Utility;
import com.vungle.ads.internal.signals.SignalManager;
import java.util.Date;
import java.util.HashSet;
import java.util.Locale;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class AccessTokenManager {
public static final String ACTION_CURRENT_ACCESS_TOKEN_CHANGED = "com.facebook.sdk.ACTION_CURRENT_ACCESS_TOKEN_CHANGED";
public static final Companion Companion = new Companion(null);
public static final String EXTRA_NEW_ACCESS_TOKEN = "com.facebook.sdk.EXTRA_NEW_ACCESS_TOKEN";
public static final String EXTRA_OLD_ACCESS_TOKEN = "com.facebook.sdk.EXTRA_OLD_ACCESS_TOKEN";
private static final String ME_PERMISSIONS_GRAPH_PATH = "me/permissions";
public static final String SHARED_PREFERENCES_NAME = "com.facebook.AccessTokenManager.SharedPreferences";
public static final String TAG = "AccessTokenManager";
private static final int TOKEN_EXTEND_RETRY_SECONDS = 3600;
private static final int TOKEN_EXTEND_THRESHOLD_SECONDS = 86400;
private static AccessTokenManager instanceField;
private final AccessTokenCache accessTokenCache;
private AccessToken currentAccessTokenField;
private Date lastAttemptedTokenExtendDate;
private final LocalBroadcastManager localBroadcastManager;
private final AtomicBoolean tokenRefreshInProgress;
public static final class FacebookRefreshTokenInfo implements RefreshTokenInfo {
private final String graphPath = "oauth/access_token";
private final String grantType = "fb_extend_sso_token";
@Override // com.facebook.AccessTokenManager.RefreshTokenInfo
public String getGrantType() {
return this.grantType;
}
@Override // com.facebook.AccessTokenManager.RefreshTokenInfo
public String getGraphPath() {
return this.graphPath;
}
}
public static final class InstagramRefreshTokenInfo implements RefreshTokenInfo {
private final String graphPath = "refresh_access_token";
private final String grantType = "ig_refresh_token";
@Override // com.facebook.AccessTokenManager.RefreshTokenInfo
public String getGrantType() {
return this.grantType;
}
@Override // com.facebook.AccessTokenManager.RefreshTokenInfo
public String getGraphPath() {
return this.graphPath;
}
}
public static final class RefreshResult {
private String accessToken;
private Long dataAccessExpirationTime;
private int expiresAt;
private int expiresIn;
private String graphDomain;
public final String getAccessToken() {
return this.accessToken;
}
public final Long getDataAccessExpirationTime() {
return this.dataAccessExpirationTime;
}
public final int getExpiresAt() {
return this.expiresAt;
}
public final int getExpiresIn() {
return this.expiresIn;
}
public final String getGraphDomain() {
return this.graphDomain;
}
public final void setAccessToken(String str) {
this.accessToken = str;
}
public final void setDataAccessExpirationTime(Long l) {
this.dataAccessExpirationTime = l;
}
public final void setExpiresAt(int i) {
this.expiresAt = i;
}
public final void setExpiresIn(int i) {
this.expiresIn = i;
}
public final void setGraphDomain(String str) {
this.graphDomain = str;
}
}
public interface RefreshTokenInfo {
String getGrantType();
String getGraphPath();
}
public static final AccessTokenManager getInstance() {
return Companion.getInstance();
}
public final AccessToken getCurrentAccessToken() {
return this.currentAccessTokenField;
}
public AccessTokenManager(LocalBroadcastManager localBroadcastManager, AccessTokenCache accessTokenCache) {
Intrinsics.checkNotNullParameter(localBroadcastManager, "localBroadcastManager");
Intrinsics.checkNotNullParameter(accessTokenCache, "accessTokenCache");
this.localBroadcastManager = localBroadcastManager;
this.accessTokenCache = accessTokenCache;
this.tokenRefreshInProgress = new AtomicBoolean(false);
this.lastAttemptedTokenExtendDate = new Date(0L);
}
public final void setCurrentAccessToken(AccessToken accessToken) {
setCurrentAccessToken(accessToken, true);
}
public final boolean loadCurrentAccessToken() {
AccessToken load = this.accessTokenCache.load();
if (load == null) {
return false;
}
setCurrentAccessToken(load, false);
return true;
}
public final void currentAccessTokenChanged() {
sendCurrentAccessTokenChangedBroadcastIntent(getCurrentAccessToken(), getCurrentAccessToken());
}
private final void setCurrentAccessToken(AccessToken accessToken, boolean z) {
AccessToken accessToken2 = this.currentAccessTokenField;
this.currentAccessTokenField = accessToken;
this.tokenRefreshInProgress.set(false);
this.lastAttemptedTokenExtendDate = new Date(0L);
if (z) {
if (accessToken != null) {
this.accessTokenCache.save(accessToken);
} else {
this.accessTokenCache.clear();
Utility utility = Utility.INSTANCE;
Utility.clearFacebookCookies(FacebookSdk.getApplicationContext());
}
}
if (Utility.areObjectsEqual(accessToken2, accessToken)) {
return;
}
sendCurrentAccessTokenChangedBroadcastIntent(accessToken2, accessToken);
setTokenExpirationBroadcastAlarm();
}
private final void sendCurrentAccessTokenChangedBroadcastIntent(AccessToken accessToken, AccessToken accessToken2) {
Intent intent = new Intent(FacebookSdk.getApplicationContext(), (Class<?>) CurrentAccessTokenExpirationBroadcastReceiver.class);
intent.setAction(ACTION_CURRENT_ACCESS_TOKEN_CHANGED);
intent.putExtra(EXTRA_OLD_ACCESS_TOKEN, accessToken);
intent.putExtra(EXTRA_NEW_ACCESS_TOKEN, accessToken2);
this.localBroadcastManager.sendBroadcast(intent);
}
private final void setTokenExpirationBroadcastAlarm() {
Context applicationContext = FacebookSdk.getApplicationContext();
AccessToken.Companion companion = AccessToken.Companion;
AccessToken currentAccessToken = companion.getCurrentAccessToken();
AlarmManager alarmManager = (AlarmManager) applicationContext.getSystemService(NotificationCompat.CATEGORY_ALARM);
if (companion.isCurrentAccessTokenActive()) {
if ((currentAccessToken == null ? null : currentAccessToken.getExpires()) == null || alarmManager == null) {
return;
}
Intent intent = new Intent(applicationContext, (Class<?>) CurrentAccessTokenExpirationBroadcastReceiver.class);
intent.setAction(ACTION_CURRENT_ACCESS_TOKEN_CHANGED);
try {
alarmManager.set(1, currentAccessToken.getExpires().getTime(), PendingIntent.getBroadcast(applicationContext, 0, intent, AccessibilityEventCompat.TYPE_VIEW_TARGETED_BY_SCROLL));
} catch (Exception unused) {
}
}
}
public final void extendAccessTokenIfNeeded() {
if (shouldExtendAccessToken()) {
refreshCurrentAccessToken(null);
}
}
private final boolean shouldExtendAccessToken() {
AccessToken currentAccessToken = getCurrentAccessToken();
if (currentAccessToken == null) {
return false;
}
long time = new Date().getTime();
return currentAccessToken.getSource().canExtendToken() && time - this.lastAttemptedTokenExtendDate.getTime() > 3600000 && time - currentAccessToken.getLastRefresh().getTime() > SignalManager.TWENTY_FOUR_HOURS_MILLIS;
}
public final void refreshCurrentAccessToken(final AccessToken.AccessTokenRefreshCallback accessTokenRefreshCallback) {
if (Intrinsics.areEqual(Looper.getMainLooper(), Looper.myLooper())) {
refreshCurrentAccessTokenImpl(accessTokenRefreshCallback);
} else {
new Handler(Looper.getMainLooper()).post(new Runnable() { // from class: com.facebook.AccessTokenManager$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
AccessTokenManager.m415refreshCurrentAccessToken$lambda0(AccessTokenManager.this, accessTokenRefreshCallback);
}
});
}
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: refreshCurrentAccessToken$lambda-0, reason: not valid java name */
public static final void m415refreshCurrentAccessToken$lambda0(AccessTokenManager this$0, AccessToken.AccessTokenRefreshCallback accessTokenRefreshCallback) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.refreshCurrentAccessTokenImpl(accessTokenRefreshCallback);
}
private final void refreshCurrentAccessTokenImpl(final AccessToken.AccessTokenRefreshCallback accessTokenRefreshCallback) {
final AccessToken currentAccessToken = getCurrentAccessToken();
if (currentAccessToken == null) {
if (accessTokenRefreshCallback == null) {
return;
}
accessTokenRefreshCallback.OnTokenRefreshFailed(new FacebookException("No current access token to refresh"));
return;
}
if (!this.tokenRefreshInProgress.compareAndSet(false, true)) {
if (accessTokenRefreshCallback == null) {
return;
}
accessTokenRefreshCallback.OnTokenRefreshFailed(new FacebookException("Refresh already in progress"));
return;
}
this.lastAttemptedTokenExtendDate = new Date();
final HashSet hashSet = new HashSet();
final HashSet hashSet2 = new HashSet();
final HashSet hashSet3 = new HashSet();
final AtomicBoolean atomicBoolean = new AtomicBoolean(false);
final RefreshResult refreshResult = new RefreshResult();
Companion companion = Companion;
GraphRequestBatch graphRequestBatch = new GraphRequestBatch(companion.createGrantedPermissionsRequest(currentAccessToken, new GraphRequest.Callback() { // from class: com.facebook.AccessTokenManager$$ExternalSyntheticLambda1
@Override // com.facebook.GraphRequest.Callback
public final void onCompleted(GraphResponse graphResponse) {
AccessTokenManager.m416refreshCurrentAccessTokenImpl$lambda1(atomicBoolean, hashSet, hashSet2, hashSet3, graphResponse);
}
}), companion.createExtendAccessTokenRequest(currentAccessToken, new GraphRequest.Callback() { // from class: com.facebook.AccessTokenManager$$ExternalSyntheticLambda2
@Override // com.facebook.GraphRequest.Callback
public final void onCompleted(GraphResponse graphResponse) {
AccessTokenManager.m417refreshCurrentAccessTokenImpl$lambda2(AccessTokenManager.RefreshResult.this, graphResponse);
}
}));
graphRequestBatch.addCallback(new GraphRequestBatch.Callback() { // from class: com.facebook.AccessTokenManager$$ExternalSyntheticLambda3
@Override // com.facebook.GraphRequestBatch.Callback
public final void onBatchCompleted(GraphRequestBatch graphRequestBatch2) {
AccessTokenManager.m418refreshCurrentAccessTokenImpl$lambda3(AccessTokenManager.RefreshResult.this, currentAccessToken, accessTokenRefreshCallback, atomicBoolean, hashSet, hashSet2, hashSet3, this, graphRequestBatch2);
}
});
graphRequestBatch.executeAsync();
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: refreshCurrentAccessTokenImpl$lambda-1, reason: not valid java name */
public static final void m416refreshCurrentAccessTokenImpl$lambda1(AtomicBoolean permissionsCallSucceeded, Set permissions, Set declinedPermissions, Set expiredPermissions, GraphResponse response) {
JSONArray optJSONArray;
Intrinsics.checkNotNullParameter(permissionsCallSucceeded, "$permissionsCallSucceeded");
Intrinsics.checkNotNullParameter(permissions, "$permissions");
Intrinsics.checkNotNullParameter(declinedPermissions, "$declinedPermissions");
Intrinsics.checkNotNullParameter(expiredPermissions, "$expiredPermissions");
Intrinsics.checkNotNullParameter(response, "response");
JSONObject jsonObject = response.getJsonObject();
if (jsonObject == null || (optJSONArray = jsonObject.optJSONArray("data")) == null) {
return;
}
permissionsCallSucceeded.set(true);
int length = optJSONArray.length();
if (length <= 0) {
return;
}
int i = 0;
while (true) {
int i2 = i + 1;
JSONObject optJSONObject = optJSONArray.optJSONObject(i);
if (optJSONObject != null) {
String optString = optJSONObject.optString("permission");
String status = optJSONObject.optString("status");
if (!Utility.isNullOrEmpty(optString) && !Utility.isNullOrEmpty(status)) {
Intrinsics.checkNotNullExpressionValue(status, "status");
Locale US = Locale.US;
Intrinsics.checkNotNullExpressionValue(US, "US");
String status2 = status.toLowerCase(US);
Intrinsics.checkNotNullExpressionValue(status2, "(this as java.lang.String).toLowerCase(locale)");
Intrinsics.checkNotNullExpressionValue(status2, "status");
int hashCode = status2.hashCode();
if (hashCode == -1309235419) {
if (status2.equals("expired")) {
expiredPermissions.add(optString);
}
Log.w(TAG, Intrinsics.stringPlus("Unexpected status: ", status2));
} else if (hashCode == 280295099) {
if (status2.equals("granted")) {
permissions.add(optString);
}
Log.w(TAG, Intrinsics.stringPlus("Unexpected status: ", status2));
} else {
if (hashCode == 568196142 && status2.equals("declined")) {
declinedPermissions.add(optString);
}
Log.w(TAG, Intrinsics.stringPlus("Unexpected status: ", status2));
}
}
}
if (i2 >= length) {
return;
} else {
i = i2;
}
}
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: refreshCurrentAccessTokenImpl$lambda-2, reason: not valid java name */
public static final void m417refreshCurrentAccessTokenImpl$lambda2(RefreshResult refreshResult, GraphResponse response) {
Intrinsics.checkNotNullParameter(refreshResult, "$refreshResult");
Intrinsics.checkNotNullParameter(response, "response");
JSONObject jsonObject = response.getJsonObject();
if (jsonObject == null) {
return;
}
refreshResult.setAccessToken(jsonObject.optString("access_token"));
refreshResult.setExpiresAt(jsonObject.optInt("expires_at"));
refreshResult.setExpiresIn(jsonObject.optInt(AccessToken.EXPIRES_IN_KEY));
refreshResult.setDataAccessExpirationTime(Long.valueOf(jsonObject.optLong(AccessToken.DATA_ACCESS_EXPIRATION_TIME)));
refreshResult.setGraphDomain(jsonObject.optString("graph_domain", null));
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: refreshCurrentAccessTokenImpl$lambda-3, reason: not valid java name */
public static final void m418refreshCurrentAccessTokenImpl$lambda3(RefreshResult refreshResult, AccessToken accessToken, AccessToken.AccessTokenRefreshCallback accessTokenRefreshCallback, AtomicBoolean permissionsCallSucceeded, Set permissions, Set declinedPermissions, Set expiredPermissions, AccessTokenManager this$0, GraphRequestBatch it) {
AccessToken accessToken2;
Date dataAccessExpirationTime;
Intrinsics.checkNotNullParameter(refreshResult, "$refreshResult");
Intrinsics.checkNotNullParameter(permissionsCallSucceeded, "$permissionsCallSucceeded");
Intrinsics.checkNotNullParameter(permissions, "$permissions");
Intrinsics.checkNotNullParameter(declinedPermissions, "$declinedPermissions");
Intrinsics.checkNotNullParameter(expiredPermissions, "$expiredPermissions");
Intrinsics.checkNotNullParameter(this$0, "this$0");
Intrinsics.checkNotNullParameter(it, "it");
String accessToken3 = refreshResult.getAccessToken();
int expiresAt = refreshResult.getExpiresAt();
Long dataAccessExpirationTime2 = refreshResult.getDataAccessExpirationTime();
String graphDomain = refreshResult.getGraphDomain();
try {
Companion companion = Companion;
if (companion.getInstance().getCurrentAccessToken() != null) {
AccessToken currentAccessToken = companion.getInstance().getCurrentAccessToken();
if ((currentAccessToken == null ? null : currentAccessToken.getUserId()) == accessToken.getUserId()) {
if (permissionsCallSucceeded.get() || accessToken3 != null || expiresAt != 0) {
Date expires = accessToken.getExpires();
if (refreshResult.getExpiresAt() != 0) {
expires = new Date(refreshResult.getExpiresAt() * 1000);
} else if (refreshResult.getExpiresIn() != 0) {
expires = new Date((refreshResult.getExpiresIn() * 1000) + new Date().getTime());
}
Date date = expires;
if (accessToken3 == null) {
accessToken3 = accessToken.getToken();
}
String str = accessToken3;
String applicationId = accessToken.getApplicationId();
String userId = accessToken.getUserId();
Set permissions2 = permissionsCallSucceeded.get() ? permissions : accessToken.getPermissions();
Set declinedPermissions2 = permissionsCallSucceeded.get() ? declinedPermissions : accessToken.getDeclinedPermissions();
Set expiredPermissions2 = permissionsCallSucceeded.get() ? expiredPermissions : accessToken.getExpiredPermissions();
AccessTokenSource source = accessToken.getSource();
Date date2 = new Date();
if (dataAccessExpirationTime2 != null) {
dataAccessExpirationTime = new Date(dataAccessExpirationTime2.longValue() * 1000);
} else {
dataAccessExpirationTime = accessToken.getDataAccessExpirationTime();
}
Date date3 = dataAccessExpirationTime;
if (graphDomain == null) {
graphDomain = accessToken.getGraphDomain();
}
AccessToken accessToken4 = new AccessToken(str, applicationId, userId, permissions2, declinedPermissions2, expiredPermissions2, source, date, date2, date3, graphDomain);
try {
companion.getInstance().setCurrentAccessToken(accessToken4);
this$0.tokenRefreshInProgress.set(false);
if (accessTokenRefreshCallback != null) {
accessTokenRefreshCallback.OnTokenRefreshed(accessToken4);
return;
}
return;
} catch (Throwable th) {
th = th;
accessToken2 = accessToken4;
this$0.tokenRefreshInProgress.set(false);
if (accessTokenRefreshCallback != null && accessToken2 != null) {
accessTokenRefreshCallback.OnTokenRefreshed(accessToken2);
}
throw th;
}
}
if (accessTokenRefreshCallback != null) {
accessTokenRefreshCallback.OnTokenRefreshFailed(new FacebookException("Failed to refresh access token"));
}
this$0.tokenRefreshInProgress.set(false);
return;
}
}
if (accessTokenRefreshCallback != null) {
accessTokenRefreshCallback.OnTokenRefreshFailed(new FacebookException("No current access token to refresh"));
}
this$0.tokenRefreshInProgress.set(false);
} catch (Throwable th2) {
th = th2;
accessToken2 = null;
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final AccessTokenManager getInstance() {
AccessTokenManager accessTokenManager;
AccessTokenManager accessTokenManager2 = AccessTokenManager.instanceField;
if (accessTokenManager2 != null) {
return accessTokenManager2;
}
synchronized (this) {
accessTokenManager = AccessTokenManager.instanceField;
if (accessTokenManager == null) {
LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(FacebookSdk.getApplicationContext());
Intrinsics.checkNotNullExpressionValue(localBroadcastManager, "getInstance(applicationContext)");
AccessTokenManager accessTokenManager3 = new AccessTokenManager(localBroadcastManager, new AccessTokenCache());
AccessTokenManager.instanceField = accessTokenManager3;
accessTokenManager = accessTokenManager3;
}
}
return accessTokenManager;
}
/* JADX INFO: Access modifiers changed from: private */
public final GraphRequest createGrantedPermissionsRequest(AccessToken accessToken, GraphRequest.Callback callback) {
Bundle bundle = new Bundle();
bundle.putString(GraphRequest.FIELDS_PARAM, "permission,status");
GraphRequest newGraphPathRequest = GraphRequest.Companion.newGraphPathRequest(accessToken, AccessTokenManager.ME_PERMISSIONS_GRAPH_PATH, callback);
newGraphPathRequest.setParameters(bundle);
newGraphPathRequest.setHttpMethod(HttpMethod.GET);
return newGraphPathRequest;
}
private final RefreshTokenInfo getRefreshTokenInfoForToken(AccessToken accessToken) {
String graphDomain = accessToken.getGraphDomain();
if (graphDomain == null) {
graphDomain = "facebook";
}
return Intrinsics.areEqual(graphDomain, FacebookSdk.INSTAGRAM) ? new InstagramRefreshTokenInfo() : new FacebookRefreshTokenInfo();
}
/* JADX INFO: Access modifiers changed from: private */
public final GraphRequest createExtendAccessTokenRequest(AccessToken accessToken, GraphRequest.Callback callback) {
RefreshTokenInfo refreshTokenInfoForToken = getRefreshTokenInfoForToken(accessToken);
Bundle bundle = new Bundle();
bundle.putString("grant_type", refreshTokenInfoForToken.getGrantType());
bundle.putString("client_id", accessToken.getApplicationId());
bundle.putString(GraphRequest.FIELDS_PARAM, "access_token,expires_at,expires_in,data_access_expiration_time,graph_domain");
GraphRequest newGraphPathRequest = GraphRequest.Companion.newGraphPathRequest(accessToken, refreshTokenInfoForToken.getGraphPath(), callback);
newGraphPathRequest.setParameters(bundle);
newGraphPathRequest.setHttpMethod(HttpMethod.GET);
return newGraphPathRequest;
}
}
}

View File

@@ -0,0 +1,52 @@
package com.facebook;
import java.util.Arrays;
/* loaded from: classes2.dex */
public enum AccessTokenSource {
NONE(false),
FACEBOOK_APPLICATION_WEB(true),
FACEBOOK_APPLICATION_NATIVE(true),
FACEBOOK_APPLICATION_SERVICE(true),
WEB_VIEW(true),
CHROME_CUSTOM_TAB(true),
TEST_USER(true),
CLIENT_TOKEN(true),
DEVICE_AUTH(true),
INSTAGRAM_APPLICATION_WEB(true),
INSTAGRAM_CUSTOM_CHROME_TAB(true),
INSTAGRAM_WEB_VIEW(true);
private final boolean canExtendToken;
public /* synthetic */ class WhenMappings {
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
static {
int[] iArr = new int[AccessTokenSource.valuesCustom().length];
iArr[AccessTokenSource.INSTAGRAM_APPLICATION_WEB.ordinal()] = 1;
iArr[AccessTokenSource.INSTAGRAM_CUSTOM_CHROME_TAB.ordinal()] = 2;
iArr[AccessTokenSource.INSTAGRAM_WEB_VIEW.ordinal()] = 3;
$EnumSwitchMapping$0 = iArr;
}
}
public final boolean canExtendToken() {
return this.canExtendToken;
}
AccessTokenSource(boolean z) {
this.canExtendToken = z;
}
public final boolean fromInstagram() {
int i = WhenMappings.$EnumSwitchMapping$0[ordinal()];
return i == 1 || i == 2 || i == 3;
}
/* renamed from: values, reason: to resolve conflict with enum method */
public static AccessTokenSource[] valuesCustom() {
AccessTokenSource[] valuesCustom = values();
return (AccessTokenSource[]) Arrays.copyOf(valuesCustom, valuesCustom.length);
}
}

View File

@@ -0,0 +1,85 @@
package com.facebook;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.facebook.internal.Utility;
import com.facebook.internal.Validate;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public abstract class AccessTokenTracker {
public static final Companion Companion = new Companion(null);
private static final String TAG = AccessTokenTracker.class.getSimpleName();
private final LocalBroadcastManager broadcastManager;
private boolean isTracking;
private final BroadcastReceiver receiver;
public final boolean isTracking() {
return this.isTracking;
}
public abstract void onCurrentAccessTokenChanged(AccessToken accessToken, AccessToken accessToken2);
public AccessTokenTracker() {
Validate.sdkInitialized();
this.receiver = new CurrentAccessTokenBroadcastReceiver(this);
LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(FacebookSdk.getApplicationContext());
Intrinsics.checkNotNullExpressionValue(localBroadcastManager, "getInstance(FacebookSdk.getApplicationContext())");
this.broadcastManager = localBroadcastManager;
startTracking();
}
public final void startTracking() {
if (this.isTracking) {
return;
}
addBroadcastReceiver();
this.isTracking = true;
}
public final void stopTracking() {
if (this.isTracking) {
this.broadcastManager.unregisterReceiver(this.receiver);
this.isTracking = false;
}
}
public final class CurrentAccessTokenBroadcastReceiver extends BroadcastReceiver {
final /* synthetic */ AccessTokenTracker this$0;
public CurrentAccessTokenBroadcastReceiver(AccessTokenTracker this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this.this$0 = this$0;
}
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(intent, "intent");
if (Intrinsics.areEqual(AccessTokenManager.ACTION_CURRENT_ACCESS_TOKEN_CHANGED, intent.getAction())) {
Utility utility = Utility.INSTANCE;
Utility.logd(AccessTokenTracker.TAG, "AccessTokenChanged");
this.this$0.onCurrentAccessTokenChanged((AccessToken) intent.getParcelableExtra(AccessTokenManager.EXTRA_OLD_ACCESS_TOKEN), (AccessToken) intent.getParcelableExtra(AccessTokenManager.EXTRA_NEW_ACCESS_TOKEN));
}
}
}
private final void addBroadcastReceiver() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(AccessTokenManager.ACTION_CURRENT_ACCESS_TOKEN_CHANGED);
this.broadcastManager.registerReceiver(this.receiver, intentFilter);
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,205 @@
package com.facebook;
import android.os.Parcel;
import android.os.Parcelable;
import com.facebook.AuthenticationTokenClaims;
import com.facebook.internal.Validate;
import com.facebook.internal.security.OidcSecurityUtil;
import com.ironsource.mediationsdk.logger.IronSourceError;
import csdk.gluads.Consts;
import java.io.IOException;
import java.security.spec.InvalidKeySpecException;
import java.util.List;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt__StringsKt;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class AuthenticationToken implements Parcelable {
public static final String AUTHENTICATION_TOKEN_KEY = "id_token";
private static final String CLAIMS_KEY = "claims";
private static final String EXPECTED_NONCE_KEY = "expected_nonce";
private static final String HEADER_KEY = "header";
private static final String SIGNATURE_KEY = "signature";
private static final String TOKEN_STRING_KEY = "token_string";
private final AuthenticationTokenClaims claims;
private final String expectedNonce;
private final AuthenticationTokenHeader header;
private final String signature;
private final String token;
public static final Companion Companion = new Companion(null);
public static final Parcelable.Creator<AuthenticationToken> CREATOR = new Parcelable.Creator<AuthenticationToken>() { // from class: com.facebook.AuthenticationToken$Companion$CREATOR$1
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public AuthenticationToken createFromParcel(Parcel source) {
Intrinsics.checkNotNullParameter(source, "source");
return new AuthenticationToken(source);
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public AuthenticationToken[] newArray(int i) {
return new AuthenticationToken[i];
}
};
public static final AuthenticationToken getCurrentAuthenticationToken() {
return Companion.getCurrentAuthenticationToken();
}
public static final void setCurrentAuthenticationToken(AuthenticationToken authenticationToken) {
Companion.setCurrentAuthenticationToken(authenticationToken);
}
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
public final AuthenticationTokenClaims getClaims() {
return this.claims;
}
public final String getExpectedNonce() {
return this.expectedNonce;
}
public final AuthenticationTokenHeader getHeader() {
return this.header;
}
public final String getSignature() {
return this.signature;
}
public final String getToken() {
return this.token;
}
public AuthenticationToken(String token, String expectedNonce) {
List split$default;
Intrinsics.checkNotNullParameter(token, "token");
Intrinsics.checkNotNullParameter(expectedNonce, "expectedNonce");
Validate.notEmpty(token, "token");
Validate.notEmpty(expectedNonce, "expectedNonce");
split$default = StringsKt__StringsKt.split$default((CharSequence) token, new String[]{Consts.STRING_PERIOD}, false, 0, 6, (Object) null);
if (!(split$default.size() == 3)) {
throw new IllegalArgumentException("Invalid IdToken string".toString());
}
String str = (String) split$default.get(0);
String str2 = (String) split$default.get(1);
String str3 = (String) split$default.get(2);
this.token = token;
this.expectedNonce = expectedNonce;
AuthenticationTokenHeader authenticationTokenHeader = new AuthenticationTokenHeader(str);
this.header = authenticationTokenHeader;
this.claims = new AuthenticationTokenClaims(str2, expectedNonce);
if (!isValidSignature(str, str2, str3, authenticationTokenHeader.getKid())) {
throw new IllegalArgumentException("Invalid Signature".toString());
}
this.signature = str3;
}
public AuthenticationToken(Parcel parcel) {
Intrinsics.checkNotNullParameter(parcel, "parcel");
this.token = Validate.notNullOrEmpty(parcel.readString(), "token");
this.expectedNonce = Validate.notNullOrEmpty(parcel.readString(), "expectedNonce");
Parcelable readParcelable = parcel.readParcelable(AuthenticationTokenHeader.class.getClassLoader());
if (readParcelable == null) {
throw new IllegalStateException("Required value was null.".toString());
}
this.header = (AuthenticationTokenHeader) readParcelable;
Parcelable readParcelable2 = parcel.readParcelable(AuthenticationTokenClaims.class.getClassLoader());
if (readParcelable2 == null) {
throw new IllegalStateException("Required value was null.".toString());
}
this.claims = (AuthenticationTokenClaims) readParcelable2;
this.signature = Validate.notNullOrEmpty(parcel.readString(), "signature");
}
public AuthenticationToken(JSONObject jsonObject) throws JSONException {
Intrinsics.checkNotNullParameter(jsonObject, "jsonObject");
String string = jsonObject.getString(TOKEN_STRING_KEY);
Intrinsics.checkNotNullExpressionValue(string, "jsonObject.getString(TOKEN_STRING_KEY)");
this.token = string;
String string2 = jsonObject.getString(EXPECTED_NONCE_KEY);
Intrinsics.checkNotNullExpressionValue(string2, "jsonObject.getString(EXPECTED_NONCE_KEY)");
this.expectedNonce = string2;
String string3 = jsonObject.getString("signature");
Intrinsics.checkNotNullExpressionValue(string3, "jsonObject.getString(SIGNATURE_KEY)");
this.signature = string3;
JSONObject headerJSONObject = jsonObject.getJSONObject(HEADER_KEY);
JSONObject claimsJSONObject = jsonObject.getJSONObject(CLAIMS_KEY);
Intrinsics.checkNotNullExpressionValue(headerJSONObject, "headerJSONObject");
this.header = new AuthenticationTokenHeader(headerJSONObject);
AuthenticationTokenClaims.Companion companion = AuthenticationTokenClaims.Companion;
Intrinsics.checkNotNullExpressionValue(claimsJSONObject, "claimsJSONObject");
this.claims = companion.createFromJSONObject$facebook_core_release(claimsJSONObject);
}
public final JSONObject toJSONObject$facebook_core_release() throws JSONException {
JSONObject jSONObject = new JSONObject();
jSONObject.put(TOKEN_STRING_KEY, this.token);
jSONObject.put(EXPECTED_NONCE_KEY, this.expectedNonce);
jSONObject.put(HEADER_KEY, this.header.toJSONObject$facebook_core_release());
jSONObject.put(CLAIMS_KEY, this.claims.toJSONObject$facebook_core_release());
jSONObject.put("signature", this.signature);
return jSONObject;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof AuthenticationToken)) {
return false;
}
AuthenticationToken authenticationToken = (AuthenticationToken) obj;
return Intrinsics.areEqual(this.token, authenticationToken.token) && Intrinsics.areEqual(this.expectedNonce, authenticationToken.expectedNonce) && Intrinsics.areEqual(this.header, authenticationToken.header) && Intrinsics.areEqual(this.claims, authenticationToken.claims) && Intrinsics.areEqual(this.signature, authenticationToken.signature);
}
public int hashCode() {
return ((((((((IronSourceError.ERROR_NON_EXISTENT_INSTANCE + this.token.hashCode()) * 31) + this.expectedNonce.hashCode()) * 31) + this.header.hashCode()) * 31) + this.claims.hashCode()) * 31) + this.signature.hashCode();
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel dest, int i) {
Intrinsics.checkNotNullParameter(dest, "dest");
dest.writeString(this.token);
dest.writeString(this.expectedNonce);
dest.writeParcelable(this.header, i);
dest.writeParcelable(this.claims, i);
dest.writeString(this.signature);
}
private final boolean isValidSignature(String str, String str2, String str3, String str4) {
try {
String rawKeyFromEndPoint = OidcSecurityUtil.getRawKeyFromEndPoint(str4);
if (rawKeyFromEndPoint == null) {
return false;
}
return OidcSecurityUtil.verify(OidcSecurityUtil.getPublicKeyFromString(rawKeyFromEndPoint), str + '.' + str2, str3);
} catch (IOException | InvalidKeySpecException unused) {
return false;
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final AuthenticationToken getCurrentAuthenticationToken() {
return AuthenticationTokenManager.Companion.getInstance().getCurrentAuthenticationToken();
}
public final void setCurrentAuthenticationToken(AuthenticationToken authenticationToken) {
AuthenticationTokenManager.Companion.getInstance().setCurrentAuthenticationToken(authenticationToken);
}
}
}

View File

@@ -0,0 +1,83 @@
package com.facebook;
import android.content.SharedPreferences;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class AuthenticationTokenCache {
public static final String CACHED_AUTHENTICATION_TOKEN_KEY = "com.facebook.AuthenticationManager.CachedAuthenticationToken";
public static final Companion Companion = new Companion(null);
private final SharedPreferences sharedPreferences;
public AuthenticationTokenCache(SharedPreferences sharedPreferences) {
Intrinsics.checkNotNullParameter(sharedPreferences, "sharedPreferences");
this.sharedPreferences = sharedPreferences;
}
/* JADX WARN: Illegal instructions before constructor call */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public AuthenticationTokenCache() {
/*
r3 = this;
android.content.Context r0 = com.facebook.FacebookSdk.getApplicationContext()
java.lang.String r1 = "com.facebook.AuthenticationTokenManager.SharedPreferences"
r2 = 0
android.content.SharedPreferences r0 = r0.getSharedPreferences(r1, r2)
java.lang.String r1 = "FacebookSdk.getApplicationContext()\n .getSharedPreferences(\n AuthenticationTokenManager.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE)"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r0, r1)
r3.<init>(r0)
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.AuthenticationTokenCache.<init>():void");
}
public final AuthenticationToken load() {
if (hasCachedAuthenticationToken()) {
return getCachedAuthenticationToken();
}
return null;
}
public final void save(AuthenticationToken authenticationToken) {
Intrinsics.checkNotNullParameter(authenticationToken, "authenticationToken");
try {
this.sharedPreferences.edit().putString(CACHED_AUTHENTICATION_TOKEN_KEY, authenticationToken.toJSONObject$facebook_core_release().toString()).apply();
} catch (JSONException unused) {
}
}
public final void clear() {
this.sharedPreferences.edit().remove(CACHED_AUTHENTICATION_TOKEN_KEY).apply();
}
private final boolean hasCachedAuthenticationToken() {
return this.sharedPreferences.contains(CACHED_AUTHENTICATION_TOKEN_KEY);
}
private final AuthenticationToken getCachedAuthenticationToken() {
String string = this.sharedPreferences.getString(CACHED_AUTHENTICATION_TOKEN_KEY, null);
if (string == null) {
return null;
}
try {
return new AuthenticationToken(new JSONObject(string));
} catch (JSONException unused) {
return null;
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,743 @@
package com.facebook;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Base64;
import androidx.annotation.VisibleForTesting;
import com.facebook.internal.Utility;
import com.facebook.internal.Validate;
import com.google.ar.core.ImageMetadata;
import com.ironsource.mediationsdk.logger.IronSourceError;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.IntCompanionObject;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.StringCompanionObject;
import kotlin.text.Charsets;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class AuthenticationTokenClaims implements Parcelable {
public static final String JSON_KEY_AUD = "aud";
public static final String JSON_KEY_EMAIL = "email";
public static final String JSON_KEY_EXP = "exp";
public static final String JSON_KEY_FAMILY_NAME = "family_name";
public static final String JSON_KEY_GIVEN_NAME = "given_name";
public static final String JSON_KEY_IAT = "iat";
public static final String JSON_KEY_ISS = "iss";
public static final String JSON_KEY_JIT = "jti";
public static final String JSON_KEY_MIDDLE_NAME = "middle_name";
public static final String JSON_KEY_NAME = "name";
public static final String JSON_KEY_NONCE = "nonce";
public static final String JSON_KEY_PICTURE = "picture";
public static final String JSON_KEY_SUB = "sub";
public static final String JSON_KEY_USER_AGE_RANGE = "user_age_range";
public static final String JSON_KEY_USER_BIRTHDAY = "user_birthday";
public static final String JSON_KEY_USER_FRIENDS = "user_friends";
public static final String JSON_KEY_USER_GENDER = "user_gender";
public static final String JSON_KEY_USER_HOMETOWN = "user_hometown";
public static final String JSON_KEY_USER_LINK = "user_link";
public static final String JSON_KEY_USER_LOCATION = "user_location";
public static final long MAX_TIME_SINCE_TOKEN_ISSUED = 600000;
private final String aud;
private final String email;
private final long exp;
private final String familyName;
private final String givenName;
private final long iat;
private final String iss;
private final String jti;
private final String middleName;
private final String name;
private final String nonce;
private final String picture;
private final String sub;
private final Map<String, Integer> userAgeRange;
private final String userBirthday;
private final Set<String> userFriends;
private final String userGender;
private final Map<String, String> userHometown;
private final String userLink;
private final Map<String, String> userLocation;
public static final Companion Companion = new Companion(null);
public static final Parcelable.Creator<AuthenticationTokenClaims> CREATOR = new Parcelable.Creator<AuthenticationTokenClaims>() { // from class: com.facebook.AuthenticationTokenClaims$Companion$CREATOR$1
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public AuthenticationTokenClaims createFromParcel(Parcel source) {
Intrinsics.checkNotNullParameter(source, "source");
return new AuthenticationTokenClaims(source);
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public AuthenticationTokenClaims[] newArray(int i) {
return new AuthenticationTokenClaims[i];
}
};
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@VisibleForTesting(otherwise = 2)
public AuthenticationTokenClaims(String jti, String iss, String aud, String nonce, long j, long j2, String sub) {
this(jti, iss, aud, nonce, j, j2, sub, null, null, null, null, null, null, null, null, null, null, null, null, null, 1048448, null);
Intrinsics.checkNotNullParameter(jti, "jti");
Intrinsics.checkNotNullParameter(iss, "iss");
Intrinsics.checkNotNullParameter(aud, "aud");
Intrinsics.checkNotNullParameter(nonce, "nonce");
Intrinsics.checkNotNullParameter(sub, "sub");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@VisibleForTesting(otherwise = 2)
public AuthenticationTokenClaims(String jti, String iss, String aud, String nonce, long j, long j2, String sub, String str) {
this(jti, iss, aud, nonce, j, j2, sub, str, null, null, null, null, null, null, null, null, null, null, null, null, 1048320, null);
Intrinsics.checkNotNullParameter(jti, "jti");
Intrinsics.checkNotNullParameter(iss, "iss");
Intrinsics.checkNotNullParameter(aud, "aud");
Intrinsics.checkNotNullParameter(nonce, "nonce");
Intrinsics.checkNotNullParameter(sub, "sub");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@VisibleForTesting(otherwise = 2)
public AuthenticationTokenClaims(String jti, String iss, String aud, String nonce, long j, long j2, String sub, String str, String str2) {
this(jti, iss, aud, nonce, j, j2, sub, str, str2, null, null, null, null, null, null, null, null, null, null, null, 1048064, null);
Intrinsics.checkNotNullParameter(jti, "jti");
Intrinsics.checkNotNullParameter(iss, "iss");
Intrinsics.checkNotNullParameter(aud, "aud");
Intrinsics.checkNotNullParameter(nonce, "nonce");
Intrinsics.checkNotNullParameter(sub, "sub");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@VisibleForTesting(otherwise = 2)
public AuthenticationTokenClaims(String jti, String iss, String aud, String nonce, long j, long j2, String sub, String str, String str2, String str3) {
this(jti, iss, aud, nonce, j, j2, sub, str, str2, str3, null, null, null, null, null, null, null, null, null, null, 1047552, null);
Intrinsics.checkNotNullParameter(jti, "jti");
Intrinsics.checkNotNullParameter(iss, "iss");
Intrinsics.checkNotNullParameter(aud, "aud");
Intrinsics.checkNotNullParameter(nonce, "nonce");
Intrinsics.checkNotNullParameter(sub, "sub");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@VisibleForTesting(otherwise = 2)
public AuthenticationTokenClaims(String jti, String iss, String aud, String nonce, long j, long j2, String sub, String str, String str2, String str3, String str4) {
this(jti, iss, aud, nonce, j, j2, sub, str, str2, str3, str4, null, null, null, null, null, null, null, null, null, 1046528, null);
Intrinsics.checkNotNullParameter(jti, "jti");
Intrinsics.checkNotNullParameter(iss, "iss");
Intrinsics.checkNotNullParameter(aud, "aud");
Intrinsics.checkNotNullParameter(nonce, "nonce");
Intrinsics.checkNotNullParameter(sub, "sub");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@VisibleForTesting(otherwise = 2)
public AuthenticationTokenClaims(String jti, String iss, String aud, String nonce, long j, long j2, String sub, String str, String str2, String str3, String str4, String str5) {
this(jti, iss, aud, nonce, j, j2, sub, str, str2, str3, str4, str5, null, null, null, null, null, null, null, null, 1044480, null);
Intrinsics.checkNotNullParameter(jti, "jti");
Intrinsics.checkNotNullParameter(iss, "iss");
Intrinsics.checkNotNullParameter(aud, "aud");
Intrinsics.checkNotNullParameter(nonce, "nonce");
Intrinsics.checkNotNullParameter(sub, "sub");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@VisibleForTesting(otherwise = 2)
public AuthenticationTokenClaims(String jti, String iss, String aud, String nonce, long j, long j2, String sub, String str, String str2, String str3, String str4, String str5, String str6) {
this(jti, iss, aud, nonce, j, j2, sub, str, str2, str3, str4, str5, str6, null, null, null, null, null, null, null, 1040384, null);
Intrinsics.checkNotNullParameter(jti, "jti");
Intrinsics.checkNotNullParameter(iss, "iss");
Intrinsics.checkNotNullParameter(aud, "aud");
Intrinsics.checkNotNullParameter(nonce, "nonce");
Intrinsics.checkNotNullParameter(sub, "sub");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@VisibleForTesting(otherwise = 2)
public AuthenticationTokenClaims(String jti, String iss, String aud, String nonce, long j, long j2, String sub, String str, String str2, String str3, String str4, String str5, String str6, Collection<String> collection) {
this(jti, iss, aud, nonce, j, j2, sub, str, str2, str3, str4, str5, str6, collection, null, null, null, null, null, null, 1032192, null);
Intrinsics.checkNotNullParameter(jti, "jti");
Intrinsics.checkNotNullParameter(iss, "iss");
Intrinsics.checkNotNullParameter(aud, "aud");
Intrinsics.checkNotNullParameter(nonce, "nonce");
Intrinsics.checkNotNullParameter(sub, "sub");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@VisibleForTesting(otherwise = 2)
public AuthenticationTokenClaims(String jti, String iss, String aud, String nonce, long j, long j2, String sub, String str, String str2, String str3, String str4, String str5, String str6, Collection<String> collection, String str7) {
this(jti, iss, aud, nonce, j, j2, sub, str, str2, str3, str4, str5, str6, collection, str7, null, null, null, null, null, 1015808, null);
Intrinsics.checkNotNullParameter(jti, "jti");
Intrinsics.checkNotNullParameter(iss, "iss");
Intrinsics.checkNotNullParameter(aud, "aud");
Intrinsics.checkNotNullParameter(nonce, "nonce");
Intrinsics.checkNotNullParameter(sub, "sub");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@VisibleForTesting(otherwise = 2)
public AuthenticationTokenClaims(String jti, String iss, String aud, String nonce, long j, long j2, String sub, String str, String str2, String str3, String str4, String str5, String str6, Collection<String> collection, String str7, Map<String, Integer> map) {
this(jti, iss, aud, nonce, j, j2, sub, str, str2, str3, str4, str5, str6, collection, str7, map, null, null, null, null, 983040, null);
Intrinsics.checkNotNullParameter(jti, "jti");
Intrinsics.checkNotNullParameter(iss, "iss");
Intrinsics.checkNotNullParameter(aud, "aud");
Intrinsics.checkNotNullParameter(nonce, "nonce");
Intrinsics.checkNotNullParameter(sub, "sub");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@VisibleForTesting(otherwise = 2)
public AuthenticationTokenClaims(String jti, String iss, String aud, String nonce, long j, long j2, String sub, String str, String str2, String str3, String str4, String str5, String str6, Collection<String> collection, String str7, Map<String, Integer> map, Map<String, String> map2) {
this(jti, iss, aud, nonce, j, j2, sub, str, str2, str3, str4, str5, str6, collection, str7, map, map2, null, null, null, ImageMetadata.SENSOR_EXPOSURE_TIME, null);
Intrinsics.checkNotNullParameter(jti, "jti");
Intrinsics.checkNotNullParameter(iss, "iss");
Intrinsics.checkNotNullParameter(aud, "aud");
Intrinsics.checkNotNullParameter(nonce, "nonce");
Intrinsics.checkNotNullParameter(sub, "sub");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@VisibleForTesting(otherwise = 2)
public AuthenticationTokenClaims(String jti, String iss, String aud, String nonce, long j, long j2, String sub, String str, String str2, String str3, String str4, String str5, String str6, Collection<String> collection, String str7, Map<String, Integer> map, Map<String, String> map2, Map<String, String> map3) {
this(jti, iss, aud, nonce, j, j2, sub, str, str2, str3, str4, str5, str6, collection, str7, map, map2, map3, null, null, 786432, null);
Intrinsics.checkNotNullParameter(jti, "jti");
Intrinsics.checkNotNullParameter(iss, "iss");
Intrinsics.checkNotNullParameter(aud, "aud");
Intrinsics.checkNotNullParameter(nonce, "nonce");
Intrinsics.checkNotNullParameter(sub, "sub");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@VisibleForTesting(otherwise = 2)
public AuthenticationTokenClaims(String jti, String iss, String aud, String nonce, long j, long j2, String sub, String str, String str2, String str3, String str4, String str5, String str6, Collection<String> collection, String str7, Map<String, Integer> map, Map<String, String> map2, Map<String, String> map3, String str8) {
this(jti, iss, aud, nonce, j, j2, sub, str, str2, str3, str4, str5, str6, collection, str7, map, map2, map3, str8, null, 524288, null);
Intrinsics.checkNotNullParameter(jti, "jti");
Intrinsics.checkNotNullParameter(iss, "iss");
Intrinsics.checkNotNullParameter(aud, "aud");
Intrinsics.checkNotNullParameter(nonce, "nonce");
Intrinsics.checkNotNullParameter(sub, "sub");
}
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
public final String getAud() {
return this.aud;
}
public final String getEmail() {
return this.email;
}
public final long getExp() {
return this.exp;
}
public final String getFamilyName() {
return this.familyName;
}
public final String getGivenName() {
return this.givenName;
}
public final long getIat() {
return this.iat;
}
public final String getIss() {
return this.iss;
}
public final String getJti() {
return this.jti;
}
public final String getMiddleName() {
return this.middleName;
}
public final String getName() {
return this.name;
}
public final String getNonce() {
return this.nonce;
}
public final String getPicture() {
return this.picture;
}
public final String getSub() {
return this.sub;
}
public final Map<String, Integer> getUserAgeRange() {
return this.userAgeRange;
}
public final String getUserBirthday() {
return this.userBirthday;
}
public final Set<String> getUserFriends() {
return this.userFriends;
}
public final String getUserGender() {
return this.userGender;
}
public final Map<String, String> getUserHometown() {
return this.userHometown;
}
public final String getUserLink() {
return this.userLink;
}
public final Map<String, String> getUserLocation() {
return this.userLocation;
}
public AuthenticationTokenClaims(String encodedClaims, String expectedNonce) {
Intrinsics.checkNotNullParameter(encodedClaims, "encodedClaims");
Intrinsics.checkNotNullParameter(expectedNonce, "expectedNonce");
Validate.notEmpty(encodedClaims, "encodedClaims");
byte[] decodedBytes = Base64.decode(encodedClaims, 8);
Intrinsics.checkNotNullExpressionValue(decodedBytes, "decodedBytes");
JSONObject jSONObject = new JSONObject(new String(decodedBytes, Charsets.UTF_8));
if (!isValidClaims(jSONObject, expectedNonce)) {
throw new IllegalArgumentException("Invalid claims".toString());
}
String string = jSONObject.getString(JSON_KEY_JIT);
Intrinsics.checkNotNullExpressionValue(string, "jsonObj.getString(JSON_KEY_JIT)");
this.jti = string;
String string2 = jSONObject.getString(JSON_KEY_ISS);
Intrinsics.checkNotNullExpressionValue(string2, "jsonObj.getString(JSON_KEY_ISS)");
this.iss = string2;
String string3 = jSONObject.getString(JSON_KEY_AUD);
Intrinsics.checkNotNullExpressionValue(string3, "jsonObj.getString(JSON_KEY_AUD)");
this.aud = string3;
String string4 = jSONObject.getString("nonce");
Intrinsics.checkNotNullExpressionValue(string4, "jsonObj.getString(JSON_KEY_NONCE)");
this.nonce = string4;
this.exp = jSONObject.getLong(JSON_KEY_EXP);
this.iat = jSONObject.getLong(JSON_KEY_IAT);
String string5 = jSONObject.getString(JSON_KEY_SUB);
Intrinsics.checkNotNullExpressionValue(string5, "jsonObj.getString(JSON_KEY_SUB)");
this.sub = string5;
Companion companion = Companion;
this.name = companion.getNullableString$facebook_core_release(jSONObject, "name");
this.givenName = companion.getNullableString$facebook_core_release(jSONObject, JSON_KEY_GIVEN_NAME);
this.middleName = companion.getNullableString$facebook_core_release(jSONObject, JSON_KEY_MIDDLE_NAME);
this.familyName = companion.getNullableString$facebook_core_release(jSONObject, JSON_KEY_FAMILY_NAME);
this.email = companion.getNullableString$facebook_core_release(jSONObject, "email");
this.picture = companion.getNullableString$facebook_core_release(jSONObject, "picture");
JSONArray optJSONArray = jSONObject.optJSONArray(JSON_KEY_USER_FRIENDS);
this.userFriends = optJSONArray == null ? null : Collections.unmodifiableSet(Utility.jsonArrayToSet(optJSONArray));
this.userBirthday = companion.getNullableString$facebook_core_release(jSONObject, JSON_KEY_USER_BIRTHDAY);
JSONObject optJSONObject = jSONObject.optJSONObject(JSON_KEY_USER_AGE_RANGE);
this.userAgeRange = optJSONObject == null ? null : Collections.unmodifiableMap(Utility.convertJSONObjectToHashMap(optJSONObject));
JSONObject optJSONObject2 = jSONObject.optJSONObject(JSON_KEY_USER_HOMETOWN);
this.userHometown = optJSONObject2 == null ? null : Collections.unmodifiableMap(Utility.convertJSONObjectToStringMap(optJSONObject2));
JSONObject optJSONObject3 = jSONObject.optJSONObject(JSON_KEY_USER_LOCATION);
this.userLocation = optJSONObject3 != null ? Collections.unmodifiableMap(Utility.convertJSONObjectToStringMap(optJSONObject3)) : null;
this.userGender = companion.getNullableString$facebook_core_release(jSONObject, JSON_KEY_USER_GENDER);
this.userLink = companion.getNullableString$facebook_core_release(jSONObject, JSON_KEY_USER_LINK);
}
public /* synthetic */ AuthenticationTokenClaims(String str, String str2, String str3, String str4, long j, long j2, String str5, String str6, String str7, String str8, String str9, String str10, String str11, Collection collection, String str12, Map map, Map map2, Map map3, String str13, String str14, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(str, str2, str3, str4, j, j2, str5, (i & 128) != 0 ? null : str6, (i & 256) != 0 ? null : str7, (i & 512) != 0 ? null : str8, (i & 1024) != 0 ? null : str9, (i & 2048) != 0 ? null : str10, (i & 4096) != 0 ? null : str11, (i & 8192) != 0 ? null : collection, (i & 16384) != 0 ? null : str12, (32768 & i) != 0 ? null : map, (65536 & i) != 0 ? null : map2, (131072 & i) != 0 ? null : map3, (262144 & i) != 0 ? null : str13, (i & 524288) != 0 ? null : str14);
}
@VisibleForTesting(otherwise = 2)
public AuthenticationTokenClaims(String jti, String iss, String aud, String nonce, long j, long j2, String sub, String str, String str2, String str3, String str4, String str5, String str6, Collection<String> collection, String str7, Map<String, Integer> map, Map<String, String> map2, Map<String, String> map3, String str8, String str9) {
Intrinsics.checkNotNullParameter(jti, "jti");
Intrinsics.checkNotNullParameter(iss, "iss");
Intrinsics.checkNotNullParameter(aud, "aud");
Intrinsics.checkNotNullParameter(nonce, "nonce");
Intrinsics.checkNotNullParameter(sub, "sub");
Validate.notEmpty(jti, JSON_KEY_JIT);
Validate.notEmpty(iss, JSON_KEY_ISS);
Validate.notEmpty(aud, JSON_KEY_AUD);
Validate.notEmpty(nonce, "nonce");
Validate.notEmpty(sub, JSON_KEY_SUB);
this.jti = jti;
this.iss = iss;
this.aud = aud;
this.nonce = nonce;
this.exp = j;
this.iat = j2;
this.sub = sub;
this.name = str;
this.givenName = str2;
this.middleName = str3;
this.familyName = str4;
this.email = str5;
this.picture = str6;
this.userFriends = collection != null ? Collections.unmodifiableSet(new HashSet(collection)) : null;
this.userBirthday = str7;
this.userAgeRange = map != null ? Collections.unmodifiableMap(new HashMap(map)) : null;
this.userHometown = map2 != null ? Collections.unmodifiableMap(new HashMap(map2)) : null;
this.userLocation = map3 != null ? Collections.unmodifiableMap(new HashMap(map3)) : null;
this.userGender = str8;
this.userLink = str9;
}
public AuthenticationTokenClaims(Parcel parcel) {
Intrinsics.checkNotNullParameter(parcel, "parcel");
this.jti = Validate.notNullOrEmpty(parcel.readString(), JSON_KEY_JIT);
this.iss = Validate.notNullOrEmpty(parcel.readString(), JSON_KEY_ISS);
this.aud = Validate.notNullOrEmpty(parcel.readString(), JSON_KEY_AUD);
this.nonce = Validate.notNullOrEmpty(parcel.readString(), "nonce");
this.exp = parcel.readLong();
this.iat = parcel.readLong();
this.sub = Validate.notNullOrEmpty(parcel.readString(), JSON_KEY_SUB);
this.name = parcel.readString();
this.givenName = parcel.readString();
this.middleName = parcel.readString();
this.familyName = parcel.readString();
this.email = parcel.readString();
this.picture = parcel.readString();
ArrayList<String> createStringArrayList = parcel.createStringArrayList();
this.userFriends = createStringArrayList != null ? Collections.unmodifiableSet(new HashSet(createStringArrayList)) : null;
this.userBirthday = parcel.readString();
HashMap readHashMap = parcel.readHashMap(IntCompanionObject.INSTANCE.getClass().getClassLoader());
readHashMap = readHashMap instanceof HashMap ? readHashMap : null;
this.userAgeRange = readHashMap != null ? Collections.unmodifiableMap(readHashMap) : null;
StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
HashMap readHashMap2 = parcel.readHashMap(stringCompanionObject.getClass().getClassLoader());
readHashMap2 = readHashMap2 instanceof HashMap ? readHashMap2 : null;
this.userHometown = readHashMap2 != null ? Collections.unmodifiableMap(readHashMap2) : null;
HashMap readHashMap3 = parcel.readHashMap(stringCompanionObject.getClass().getClassLoader());
readHashMap3 = readHashMap3 instanceof HashMap ? readHashMap3 : null;
this.userLocation = readHashMap3 != null ? Collections.unmodifiableMap(readHashMap3) : null;
this.userGender = parcel.readString();
this.userLink = parcel.readString();
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel dest, int i) {
Intrinsics.checkNotNullParameter(dest, "dest");
dest.writeString(this.jti);
dest.writeString(this.iss);
dest.writeString(this.aud);
dest.writeString(this.nonce);
dest.writeLong(this.exp);
dest.writeLong(this.iat);
dest.writeString(this.sub);
dest.writeString(this.name);
dest.writeString(this.givenName);
dest.writeString(this.middleName);
dest.writeString(this.familyName);
dest.writeString(this.email);
dest.writeString(this.picture);
if (this.userFriends == null) {
dest.writeStringList(null);
} else {
dest.writeStringList(new ArrayList(this.userFriends));
}
dest.writeString(this.userBirthday);
dest.writeMap(this.userAgeRange);
dest.writeMap(this.userHometown);
dest.writeMap(this.userLocation);
dest.writeString(this.userGender);
dest.writeString(this.userLink);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof AuthenticationTokenClaims)) {
return false;
}
AuthenticationTokenClaims authenticationTokenClaims = (AuthenticationTokenClaims) obj;
return Intrinsics.areEqual(this.jti, authenticationTokenClaims.jti) && Intrinsics.areEqual(this.iss, authenticationTokenClaims.iss) && Intrinsics.areEqual(this.aud, authenticationTokenClaims.aud) && Intrinsics.areEqual(this.nonce, authenticationTokenClaims.nonce) && this.exp == authenticationTokenClaims.exp && this.iat == authenticationTokenClaims.iat && Intrinsics.areEqual(this.sub, authenticationTokenClaims.sub) && Intrinsics.areEqual(this.name, authenticationTokenClaims.name) && Intrinsics.areEqual(this.givenName, authenticationTokenClaims.givenName) && Intrinsics.areEqual(this.middleName, authenticationTokenClaims.middleName) && Intrinsics.areEqual(this.familyName, authenticationTokenClaims.familyName) && Intrinsics.areEqual(this.email, authenticationTokenClaims.email) && Intrinsics.areEqual(this.picture, authenticationTokenClaims.picture) && Intrinsics.areEqual(this.userFriends, authenticationTokenClaims.userFriends) && Intrinsics.areEqual(this.userBirthday, authenticationTokenClaims.userBirthday) && Intrinsics.areEqual(this.userAgeRange, authenticationTokenClaims.userAgeRange) && Intrinsics.areEqual(this.userHometown, authenticationTokenClaims.userHometown) && Intrinsics.areEqual(this.userLocation, authenticationTokenClaims.userLocation) && Intrinsics.areEqual(this.userGender, authenticationTokenClaims.userGender) && Intrinsics.areEqual(this.userLink, authenticationTokenClaims.userLink);
}
public int hashCode() {
int hashCode = (((((((((((((IronSourceError.ERROR_NON_EXISTENT_INSTANCE + this.jti.hashCode()) * 31) + this.iss.hashCode()) * 31) + this.aud.hashCode()) * 31) + this.nonce.hashCode()) * 31) + Long.hashCode(this.exp)) * 31) + Long.hashCode(this.iat)) * 31) + this.sub.hashCode()) * 31;
String str = this.name;
int hashCode2 = (hashCode + (str == null ? 0 : str.hashCode())) * 31;
String str2 = this.givenName;
int hashCode3 = (hashCode2 + (str2 == null ? 0 : str2.hashCode())) * 31;
String str3 = this.middleName;
int hashCode4 = (hashCode3 + (str3 == null ? 0 : str3.hashCode())) * 31;
String str4 = this.familyName;
int hashCode5 = (hashCode4 + (str4 == null ? 0 : str4.hashCode())) * 31;
String str5 = this.email;
int hashCode6 = (hashCode5 + (str5 == null ? 0 : str5.hashCode())) * 31;
String str6 = this.picture;
int hashCode7 = (hashCode6 + (str6 == null ? 0 : str6.hashCode())) * 31;
Set<String> set = this.userFriends;
int hashCode8 = (hashCode7 + (set == null ? 0 : set.hashCode())) * 31;
String str7 = this.userBirthday;
int hashCode9 = (hashCode8 + (str7 == null ? 0 : str7.hashCode())) * 31;
Map<String, Integer> map = this.userAgeRange;
int hashCode10 = (hashCode9 + (map == null ? 0 : map.hashCode())) * 31;
Map<String, String> map2 = this.userHometown;
int hashCode11 = (hashCode10 + (map2 == null ? 0 : map2.hashCode())) * 31;
Map<String, String> map3 = this.userLocation;
int hashCode12 = (hashCode11 + (map3 == null ? 0 : map3.hashCode())) * 31;
String str8 = this.userGender;
int hashCode13 = (hashCode12 + (str8 == null ? 0 : str8.hashCode())) * 31;
String str9 = this.userLink;
return hashCode13 + (str9 != null ? str9.hashCode() : 0);
}
public String toString() {
String jSONObject = toJSONObject$facebook_core_release().toString();
Intrinsics.checkNotNullExpressionValue(jSONObject, "claimsJsonObject.toString()");
return jSONObject;
}
/* JADX WARN: Code restructure failed: missing block: B:16:0x0044, code lost:
if (kotlin.jvm.internal.Intrinsics.areEqual(new java.net.URL(r2).getHost(), "www.facebook.com") == false) goto L15;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private final boolean isValidClaims(org.json.JSONObject r7, java.lang.String r8) {
/*
r6 = this;
java.lang.String r0 = "iss"
r1 = 0
if (r7 != 0) goto L6
return r1
L6:
java.lang.String r2 = "jti"
java.lang.String r3 = r7.optString(r2)
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r3, r2)
int r2 = r3.length()
if (r2 != 0) goto L16
return r1
L16:
java.lang.String r2 = r7.optString(r0) // Catch: java.net.MalformedURLException -> Lc2
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r2, r0) // Catch: java.net.MalformedURLException -> Lc2
int r0 = r2.length() // Catch: java.net.MalformedURLException -> Lc2
if (r0 != 0) goto L24
goto L46
L24:
java.net.URL r0 = new java.net.URL // Catch: java.net.MalformedURLException -> Lc2
r0.<init>(r2) // Catch: java.net.MalformedURLException -> Lc2
java.lang.String r0 = r0.getHost() // Catch: java.net.MalformedURLException -> Lc2
java.lang.String r3 = "facebook.com"
boolean r0 = kotlin.jvm.internal.Intrinsics.areEqual(r0, r3) // Catch: java.net.MalformedURLException -> Lc2
if (r0 != 0) goto L47
java.net.URL r0 = new java.net.URL // Catch: java.net.MalformedURLException -> Lc2
r0.<init>(r2) // Catch: java.net.MalformedURLException -> Lc2
java.lang.String r0 = r0.getHost() // Catch: java.net.MalformedURLException -> Lc2
java.lang.String r2 = "www.facebook.com"
boolean r0 = kotlin.jvm.internal.Intrinsics.areEqual(r0, r2) // Catch: java.net.MalformedURLException -> Lc2
if (r0 != 0) goto L47
L46:
return r1
L47:
java.lang.String r0 = "aud"
java.lang.String r2 = r7.optString(r0)
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r2, r0)
int r0 = r2.length()
if (r0 != 0) goto L57
goto L61
L57:
java.lang.String r0 = com.facebook.FacebookSdk.getApplicationId()
boolean r0 = kotlin.jvm.internal.Intrinsics.areEqual(r2, r0)
if (r0 != 0) goto L62
L61:
return r1
L62:
java.util.Date r0 = new java.util.Date
java.lang.String r2 = "exp"
long r2 = r7.optLong(r2)
r4 = 1000(0x3e8, float:1.401E-42)
long r4 = (long) r4
long r2 = r2 * r4
r0.<init>(r2)
java.util.Date r2 = new java.util.Date
r2.<init>()
boolean r0 = r2.after(r0)
if (r0 == 0) goto L7d
return r1
L7d:
java.lang.String r0 = "iat"
long r2 = r7.optLong(r0)
java.util.Date r0 = new java.util.Date
long r2 = r2 * r4
r4 = 600000(0x927c0, double:2.964394E-318)
long r2 = r2 + r4
r0.<init>(r2)
java.util.Date r2 = new java.util.Date
r2.<init>()
boolean r0 = r2.after(r0)
if (r0 == 0) goto L99
return r1
L99:
java.lang.String r0 = "sub"
java.lang.String r2 = r7.optString(r0)
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r2, r0)
int r0 = r2.length()
if (r0 != 0) goto La9
return r1
La9:
java.lang.String r0 = "nonce"
java.lang.String r7 = r7.optString(r0)
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r7, r0)
int r0 = r7.length()
if (r0 != 0) goto Lb9
goto Lbf
Lb9:
boolean r7 = kotlin.jvm.internal.Intrinsics.areEqual(r7, r8)
if (r7 != 0) goto Lc0
Lbf:
return r1
Lc0:
r7 = 1
return r7
Lc2:
return r1
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.AuthenticationTokenClaims.isValidClaims(org.json.JSONObject, java.lang.String):boolean");
}
@VisibleForTesting(otherwise = 2)
public final String toEnCodedString() {
String authenticationTokenClaims = toString();
Charset charset = Charsets.UTF_8;
if (authenticationTokenClaims == null) {
throw new NullPointerException("null cannot be cast to non-null type java.lang.String");
}
byte[] bytes = authenticationTokenClaims.getBytes(charset);
Intrinsics.checkNotNullExpressionValue(bytes, "(this as java.lang.String).getBytes(charset)");
String encodeToString = Base64.encodeToString(bytes, 8);
Intrinsics.checkNotNullExpressionValue(encodeToString, "encodeToString(claimsJsonString.toByteArray(), Base64.URL_SAFE)");
return encodeToString;
}
@VisibleForTesting(otherwise = 2)
public final JSONObject toJSONObject$facebook_core_release() {
JSONObject jSONObject = new JSONObject();
jSONObject.put(JSON_KEY_JIT, this.jti);
jSONObject.put(JSON_KEY_ISS, this.iss);
jSONObject.put(JSON_KEY_AUD, this.aud);
jSONObject.put("nonce", this.nonce);
jSONObject.put(JSON_KEY_EXP, this.exp);
jSONObject.put(JSON_KEY_IAT, this.iat);
String str = this.sub;
if (str != null) {
jSONObject.put(JSON_KEY_SUB, str);
}
String str2 = this.name;
if (str2 != null) {
jSONObject.put("name", str2);
}
String str3 = this.givenName;
if (str3 != null) {
jSONObject.put(JSON_KEY_GIVEN_NAME, str3);
}
String str4 = this.middleName;
if (str4 != null) {
jSONObject.put(JSON_KEY_MIDDLE_NAME, str4);
}
String str5 = this.familyName;
if (str5 != null) {
jSONObject.put(JSON_KEY_FAMILY_NAME, str5);
}
String str6 = this.email;
if (str6 != null) {
jSONObject.put("email", str6);
}
String str7 = this.picture;
if (str7 != null) {
jSONObject.put("picture", str7);
}
if (this.userFriends != null) {
jSONObject.put(JSON_KEY_USER_FRIENDS, new JSONArray((Collection) this.userFriends));
}
String str8 = this.userBirthday;
if (str8 != null) {
jSONObject.put(JSON_KEY_USER_BIRTHDAY, str8);
}
if (this.userAgeRange != null) {
jSONObject.put(JSON_KEY_USER_AGE_RANGE, new JSONObject(this.userAgeRange));
}
if (this.userHometown != null) {
jSONObject.put(JSON_KEY_USER_HOMETOWN, new JSONObject(this.userHometown));
}
if (this.userLocation != null) {
jSONObject.put(JSON_KEY_USER_LOCATION, new JSONObject(this.userLocation));
}
String str9 = this.userGender;
if (str9 != null) {
jSONObject.put(JSON_KEY_USER_GENDER, str9);
}
String str10 = this.userLink;
if (str10 != null) {
jSONObject.put(JSON_KEY_USER_LINK, str10);
}
return jSONObject;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final String getNullableString$facebook_core_release(JSONObject jSONObject, String name) {
Intrinsics.checkNotNullParameter(jSONObject, "<this>");
Intrinsics.checkNotNullParameter(name, "name");
if (jSONObject.has(name)) {
return jSONObject.getString(name);
}
return null;
}
public final AuthenticationTokenClaims createFromJSONObject$facebook_core_release(JSONObject jsonObject) throws JSONException {
Intrinsics.checkNotNullParameter(jsonObject, "jsonObject");
String jti = jsonObject.getString(AuthenticationTokenClaims.JSON_KEY_JIT);
String iss = jsonObject.getString(AuthenticationTokenClaims.JSON_KEY_ISS);
String aud = jsonObject.getString(AuthenticationTokenClaims.JSON_KEY_AUD);
String nonce = jsonObject.getString("nonce");
long j = jsonObject.getLong(AuthenticationTokenClaims.JSON_KEY_EXP);
long j2 = jsonObject.getLong(AuthenticationTokenClaims.JSON_KEY_IAT);
String sub = jsonObject.getString(AuthenticationTokenClaims.JSON_KEY_SUB);
String nullableString$facebook_core_release = getNullableString$facebook_core_release(jsonObject, "name");
String nullableString$facebook_core_release2 = getNullableString$facebook_core_release(jsonObject, AuthenticationTokenClaims.JSON_KEY_GIVEN_NAME);
String nullableString$facebook_core_release3 = getNullableString$facebook_core_release(jsonObject, AuthenticationTokenClaims.JSON_KEY_MIDDLE_NAME);
String nullableString$facebook_core_release4 = getNullableString$facebook_core_release(jsonObject, AuthenticationTokenClaims.JSON_KEY_FAMILY_NAME);
String nullableString$facebook_core_release5 = getNullableString$facebook_core_release(jsonObject, "email");
String nullableString$facebook_core_release6 = getNullableString$facebook_core_release(jsonObject, "picture");
JSONArray optJSONArray = jsonObject.optJSONArray(AuthenticationTokenClaims.JSON_KEY_USER_FRIENDS);
String nullableString$facebook_core_release7 = getNullableString$facebook_core_release(jsonObject, AuthenticationTokenClaims.JSON_KEY_USER_BIRTHDAY);
JSONObject optJSONObject = jsonObject.optJSONObject(AuthenticationTokenClaims.JSON_KEY_USER_AGE_RANGE);
JSONObject optJSONObject2 = jsonObject.optJSONObject(AuthenticationTokenClaims.JSON_KEY_USER_HOMETOWN);
JSONObject optJSONObject3 = jsonObject.optJSONObject(AuthenticationTokenClaims.JSON_KEY_USER_LOCATION);
String nullableString$facebook_core_release8 = getNullableString$facebook_core_release(jsonObject, AuthenticationTokenClaims.JSON_KEY_USER_GENDER);
String nullableString$facebook_core_release9 = getNullableString$facebook_core_release(jsonObject, AuthenticationTokenClaims.JSON_KEY_USER_LINK);
Intrinsics.checkNotNullExpressionValue(jti, "jti");
Intrinsics.checkNotNullExpressionValue(iss, "iss");
Intrinsics.checkNotNullExpressionValue(aud, "aud");
Intrinsics.checkNotNullExpressionValue(nonce, "nonce");
Intrinsics.checkNotNullExpressionValue(sub, "sub");
return new AuthenticationTokenClaims(jti, iss, aud, nonce, j, j2, sub, nullableString$facebook_core_release, nullableString$facebook_core_release2, nullableString$facebook_core_release3, nullableString$facebook_core_release4, nullableString$facebook_core_release5, nullableString$facebook_core_release6, optJSONArray == null ? null : Utility.jsonArrayToStringList(optJSONArray), nullableString$facebook_core_release7, optJSONObject == null ? null : Utility.convertJSONObjectToHashMap(optJSONObject), optJSONObject2 == null ? null : Utility.convertJSONObjectToStringMap(optJSONObject2), optJSONObject3 != null ? Utility.convertJSONObjectToStringMap(optJSONObject3) : null, nullableString$facebook_core_release8, nullableString$facebook_core_release9);
}
}
}

View File

@@ -0,0 +1,183 @@
package com.facebook;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Base64;
import androidx.annotation.VisibleForTesting;
import com.facebook.internal.Validate;
import com.google.android.gms.fido.u2f.api.common.ClientData;
import com.ironsource.mediationsdk.logger.IronSourceError;
import java.nio.charset.Charset;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.Charsets;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class AuthenticationTokenHeader implements Parcelable {
private final String alg;
private final String kid;
private final String typ;
public static final Companion Companion = new Companion(null);
public static final Parcelable.Creator<AuthenticationTokenHeader> CREATOR = new Parcelable.Creator<AuthenticationTokenHeader>() { // from class: com.facebook.AuthenticationTokenHeader$Companion$CREATOR$1
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public AuthenticationTokenHeader createFromParcel(Parcel source) {
Intrinsics.checkNotNullParameter(source, "source");
return new AuthenticationTokenHeader(source);
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public AuthenticationTokenHeader[] newArray(int i) {
return new AuthenticationTokenHeader[i];
}
};
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
public final String getAlg() {
return this.alg;
}
public final String getKid() {
return this.kid;
}
public final String getTyp() {
return this.typ;
}
public AuthenticationTokenHeader(String encodedHeaderString) {
Intrinsics.checkNotNullParameter(encodedHeaderString, "encodedHeaderString");
if (!isValidHeader(encodedHeaderString)) {
throw new IllegalArgumentException("Invalid Header".toString());
}
byte[] decodedBytes = Base64.decode(encodedHeaderString, 0);
Intrinsics.checkNotNullExpressionValue(decodedBytes, "decodedBytes");
JSONObject jSONObject = new JSONObject(new String(decodedBytes, Charsets.UTF_8));
String string = jSONObject.getString("alg");
Intrinsics.checkNotNullExpressionValue(string, "jsonObj.getString(\"alg\")");
this.alg = string;
String string2 = jSONObject.getString(ClientData.KEY_TYPE);
Intrinsics.checkNotNullExpressionValue(string2, "jsonObj.getString(\"typ\")");
this.typ = string2;
String string3 = jSONObject.getString("kid");
Intrinsics.checkNotNullExpressionValue(string3, "jsonObj.getString(\"kid\")");
this.kid = string3;
}
public AuthenticationTokenHeader(Parcel parcel) {
Intrinsics.checkNotNullParameter(parcel, "parcel");
this.alg = Validate.notNullOrEmpty(parcel.readString(), "alg");
this.typ = Validate.notNullOrEmpty(parcel.readString(), ClientData.KEY_TYPE);
this.kid = Validate.notNullOrEmpty(parcel.readString(), "kid");
}
public AuthenticationTokenHeader(JSONObject jsonObject) throws JSONException {
Intrinsics.checkNotNullParameter(jsonObject, "jsonObject");
String string = jsonObject.getString("alg");
Intrinsics.checkNotNullExpressionValue(string, "jsonObject.getString(\"alg\")");
this.alg = string;
String string2 = jsonObject.getString(ClientData.KEY_TYPE);
Intrinsics.checkNotNullExpressionValue(string2, "jsonObject.getString(\"typ\")");
this.typ = string2;
String string3 = jsonObject.getString("kid");
Intrinsics.checkNotNullExpressionValue(string3, "jsonObject.getString(\"kid\")");
this.kid = string3;
}
@VisibleForTesting(otherwise = 2)
public AuthenticationTokenHeader(String alg, String typ, String kid) {
Intrinsics.checkNotNullParameter(alg, "alg");
Intrinsics.checkNotNullParameter(typ, "typ");
Intrinsics.checkNotNullParameter(kid, "kid");
this.alg = alg;
this.typ = typ;
this.kid = kid;
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel dest, int i) {
Intrinsics.checkNotNullParameter(dest, "dest");
dest.writeString(this.alg);
dest.writeString(this.typ);
dest.writeString(this.kid);
}
public String toString() {
String jSONObject = toJSONObject$facebook_core_release().toString();
Intrinsics.checkNotNullExpressionValue(jSONObject, "headerJsonObject.toString()");
return jSONObject;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof AuthenticationTokenHeader)) {
return false;
}
AuthenticationTokenHeader authenticationTokenHeader = (AuthenticationTokenHeader) obj;
return Intrinsics.areEqual(this.alg, authenticationTokenHeader.alg) && Intrinsics.areEqual(this.typ, authenticationTokenHeader.typ) && Intrinsics.areEqual(this.kid, authenticationTokenHeader.kid);
}
public int hashCode() {
return ((((IronSourceError.ERROR_NON_EXISTENT_INSTANCE + this.alg.hashCode()) * 31) + this.typ.hashCode()) * 31) + this.kid.hashCode();
}
private final boolean isValidHeader(String str) {
Validate.notEmpty(str, "encodedHeaderString");
byte[] decodedBytes = Base64.decode(str, 0);
Intrinsics.checkNotNullExpressionValue(decodedBytes, "decodedBytes");
try {
JSONObject jSONObject = new JSONObject(new String(decodedBytes, Charsets.UTF_8));
String alg = jSONObject.optString("alg");
Intrinsics.checkNotNullExpressionValue(alg, "alg");
boolean z = alg.length() > 0 && Intrinsics.areEqual(alg, "RS256");
String optString = jSONObject.optString("kid");
Intrinsics.checkNotNullExpressionValue(optString, "jsonObj.optString(\"kid\")");
boolean z2 = optString.length() > 0;
String optString2 = jSONObject.optString(ClientData.KEY_TYPE);
Intrinsics.checkNotNullExpressionValue(optString2, "jsonObj.optString(\"typ\")");
return z && z2 && (optString2.length() > 0);
} catch (JSONException unused) {
return false;
}
}
public final JSONObject toJSONObject$facebook_core_release() {
JSONObject jSONObject = new JSONObject();
jSONObject.put("alg", this.alg);
jSONObject.put(ClientData.KEY_TYPE, this.typ);
jSONObject.put("kid", this.kid);
return jSONObject;
}
@VisibleForTesting(otherwise = 2)
public final String toEnCodedString() {
String authenticationTokenHeader = toString();
Charset charset = Charsets.UTF_8;
if (authenticationTokenHeader == null) {
throw new NullPointerException("null cannot be cast to non-null type java.lang.String");
}
byte[] bytes = authenticationTokenHeader.getBytes(charset);
Intrinsics.checkNotNullExpressionValue(bytes, "(this as java.lang.String).getBytes(charset)");
String encodeToString = Base64.encodeToString(bytes, 0);
Intrinsics.checkNotNullExpressionValue(encodeToString, "encodeToString(claimsJsonString.toByteArray(), Base64.DEFAULT)");
return encodeToString;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,117 @@
package com.facebook;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.facebook.internal.Utility;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class AuthenticationTokenManager {
public static final String ACTION_CURRENT_AUTHENTICATION_TOKEN_CHANGED = "com.facebook.sdk.ACTION_CURRENT_AUTHENTICATION_TOKEN_CHANGED";
public static final Companion Companion = new Companion(null);
public static final String EXTRA_NEW_AUTHENTICATION_TOKEN = "com.facebook.sdk.EXTRA_NEW_AUTHENTICATION_TOKEN";
public static final String EXTRA_OLD_AUTHENTICATION_TOKEN = "com.facebook.sdk.EXTRA_OLD_AUTHENTICATION_TOKEN";
public static final String SHARED_PREFERENCES_NAME = "com.facebook.AuthenticationTokenManager.SharedPreferences";
public static final String TAG = "AuthenticationTokenManager";
private static AuthenticationTokenManager instanceField;
private final AuthenticationTokenCache authenticationTokenCache;
private AuthenticationToken currentAuthenticationTokenField;
private final LocalBroadcastManager localBroadcastManager;
public static final class CurrentAuthenticationTokenChangedBroadcastReceiver extends BroadcastReceiver {
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(intent, "intent");
}
}
public static final AuthenticationTokenManager getInstance() {
return Companion.getInstance();
}
public final AuthenticationToken getCurrentAuthenticationToken() {
return this.currentAuthenticationTokenField;
}
public AuthenticationTokenManager(LocalBroadcastManager localBroadcastManager, AuthenticationTokenCache authenticationTokenCache) {
Intrinsics.checkNotNullParameter(localBroadcastManager, "localBroadcastManager");
Intrinsics.checkNotNullParameter(authenticationTokenCache, "authenticationTokenCache");
this.localBroadcastManager = localBroadcastManager;
this.authenticationTokenCache = authenticationTokenCache;
}
public final void setCurrentAuthenticationToken(AuthenticationToken authenticationToken) {
setCurrentAuthenticationToken(authenticationToken, true);
}
public final boolean loadCurrentAuthenticationToken() {
AuthenticationToken load = this.authenticationTokenCache.load();
if (load == null) {
return false;
}
setCurrentAuthenticationToken(load, false);
return true;
}
public final void currentAuthenticationTokenChanged() {
sendCurrentAuthenticationTokenChangedBroadcastIntent(getCurrentAuthenticationToken(), getCurrentAuthenticationToken());
}
private final void setCurrentAuthenticationToken(AuthenticationToken authenticationToken, boolean z) {
AuthenticationToken currentAuthenticationToken = getCurrentAuthenticationToken();
this.currentAuthenticationTokenField = authenticationToken;
if (z) {
if (authenticationToken != null) {
this.authenticationTokenCache.save(authenticationToken);
} else {
this.authenticationTokenCache.clear();
Utility utility = Utility.INSTANCE;
Utility.clearFacebookCookies(FacebookSdk.getApplicationContext());
}
}
if (Utility.areObjectsEqual(currentAuthenticationToken, authenticationToken)) {
return;
}
sendCurrentAuthenticationTokenChangedBroadcastIntent(currentAuthenticationToken, authenticationToken);
}
private final void sendCurrentAuthenticationTokenChangedBroadcastIntent(AuthenticationToken authenticationToken, AuthenticationToken authenticationToken2) {
Intent intent = new Intent(FacebookSdk.getApplicationContext(), (Class<?>) CurrentAuthenticationTokenChangedBroadcastReceiver.class);
intent.setAction(ACTION_CURRENT_AUTHENTICATION_TOKEN_CHANGED);
intent.putExtra(EXTRA_OLD_AUTHENTICATION_TOKEN, authenticationToken);
intent.putExtra(EXTRA_NEW_AUTHENTICATION_TOKEN, authenticationToken2);
this.localBroadcastManager.sendBroadcast(intent);
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final AuthenticationTokenManager getInstance() {
AuthenticationTokenManager authenticationTokenManager;
AuthenticationTokenManager authenticationTokenManager2 = AuthenticationTokenManager.instanceField;
if (authenticationTokenManager2 != null) {
return authenticationTokenManager2;
}
synchronized (this) {
authenticationTokenManager = AuthenticationTokenManager.instanceField;
if (authenticationTokenManager == null) {
LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(FacebookSdk.getApplicationContext());
Intrinsics.checkNotNullExpressionValue(localBroadcastManager, "getInstance(applicationContext)");
AuthenticationTokenManager authenticationTokenManager3 = new AuthenticationTokenManager(localBroadcastManager, new AuthenticationTokenCache());
AuthenticationTokenManager.instanceField = authenticationTokenManager3;
authenticationTokenManager = authenticationTokenManager3;
}
}
return authenticationTokenManager;
}
}
}

View File

@@ -0,0 +1,85 @@
package com.facebook;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.facebook.internal.Utility;
import com.facebook.internal.Validate;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public abstract class AuthenticationTokenTracker {
public static final Companion Companion = new Companion(null);
private static final String TAG = AuthenticationTokenTracker.class.getSimpleName();
private final LocalBroadcastManager broadcastManager;
private boolean isTracking;
private final BroadcastReceiver receiver;
public final boolean isTracking() {
return this.isTracking;
}
public abstract void onCurrentAuthenticationTokenChanged(AuthenticationToken authenticationToken, AuthenticationToken authenticationToken2);
public AuthenticationTokenTracker() {
Validate.sdkInitialized();
this.receiver = new CurrentAuthenticationTokenBroadcastReceiver(this);
LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(FacebookSdk.getApplicationContext());
Intrinsics.checkNotNullExpressionValue(localBroadcastManager, "getInstance(FacebookSdk.getApplicationContext())");
this.broadcastManager = localBroadcastManager;
startTracking();
}
public final void startTracking() {
if (this.isTracking) {
return;
}
addBroadcastReceiver();
this.isTracking = true;
}
public final void stopTracking() {
if (this.isTracking) {
this.broadcastManager.unregisterReceiver(this.receiver);
this.isTracking = false;
}
}
public final class CurrentAuthenticationTokenBroadcastReceiver extends BroadcastReceiver {
final /* synthetic */ AuthenticationTokenTracker this$0;
public CurrentAuthenticationTokenBroadcastReceiver(AuthenticationTokenTracker this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this.this$0 = this$0;
}
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(intent, "intent");
if (Intrinsics.areEqual(AuthenticationTokenManager.ACTION_CURRENT_AUTHENTICATION_TOKEN_CHANGED, intent.getAction())) {
Utility utility = Utility.INSTANCE;
Utility.logd(AuthenticationTokenTracker.TAG, "AuthenticationTokenChanged");
this.this$0.onCurrentAuthenticationTokenChanged((AuthenticationToken) intent.getParcelableExtra(AuthenticationTokenManager.EXTRA_OLD_AUTHENTICATION_TOKEN), (AuthenticationToken) intent.getParcelableExtra(AuthenticationTokenManager.EXTRA_NEW_AUTHENTICATION_TOKEN));
}
}
}
private final void addBroadcastReceiver() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(AuthenticationTokenManager.ACTION_CURRENT_AUTHENTICATION_TOKEN_CHANGED);
this.broadcastManager.registerReceiver(this.receiver, intentFilter);
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,8 @@
package com.facebook;
/* loaded from: classes2.dex */
public final class BuildConfig {
public static final String BUILD_TYPE = "release";
public static final boolean DEBUG = false;
public static final String LIBRARY_PACKAGE_NAME = "com.facebook";
}

View File

@@ -0,0 +1,95 @@
package com.facebook;
import android.content.Intent;
import com.facebook.internal.CallbackManagerImpl;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public interface CallbackManager {
boolean onActivityResult(int i, int i2, Intent intent);
public static final class Factory {
public static final Factory INSTANCE = new Factory();
private Factory() {
}
public static final CallbackManager create() {
return new CallbackManagerImpl();
}
}
public static final class ActivityResultParameters {
private final Intent data;
private final int requestCode;
private final int resultCode;
public static /* synthetic */ ActivityResultParameters copy$default(ActivityResultParameters activityResultParameters, int i, int i2, Intent intent, int i3, Object obj) {
if ((i3 & 1) != 0) {
i = activityResultParameters.requestCode;
}
if ((i3 & 2) != 0) {
i2 = activityResultParameters.resultCode;
}
if ((i3 & 4) != 0) {
intent = activityResultParameters.data;
}
return activityResultParameters.copy(i, i2, intent);
}
public final int component1() {
return this.requestCode;
}
public final int component2() {
return this.resultCode;
}
public final Intent component3() {
return this.data;
}
public final ActivityResultParameters copy(int i, int i2, Intent intent) {
return new ActivityResultParameters(i, i2, intent);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ActivityResultParameters)) {
return false;
}
ActivityResultParameters activityResultParameters = (ActivityResultParameters) obj;
return this.requestCode == activityResultParameters.requestCode && this.resultCode == activityResultParameters.resultCode && Intrinsics.areEqual(this.data, activityResultParameters.data);
}
public final Intent getData() {
return this.data;
}
public final int getRequestCode() {
return this.requestCode;
}
public final int getResultCode() {
return this.resultCode;
}
public int hashCode() {
int hashCode = ((Integer.hashCode(this.requestCode) * 31) + Integer.hashCode(this.resultCode)) * 31;
Intent intent = this.data;
return hashCode + (intent == null ? 0 : intent.hashCode());
}
public String toString() {
return "ActivityResultParameters(requestCode=" + this.requestCode + ", resultCode=" + this.resultCode + ", data=" + this.data + ')';
}
public ActivityResultParameters(int i, int i2, Intent intent) {
this.requestCode = i;
this.resultCode = i2;
this.data = intent;
}
}
}

View File

@@ -0,0 +1,18 @@
package com.facebook;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class CurrentAccessTokenExpirationBroadcastReceiver extends BroadcastReceiver {
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(intent, "intent");
if (Intrinsics.areEqual(AccessTokenManager.ACTION_CURRENT_ACCESS_TOKEN_CHANGED, intent.getAction()) && FacebookSdk.isInitialized()) {
AccessTokenManager.Companion.getInstance().currentAccessTokenChanged();
}
}
}

View File

@@ -0,0 +1,68 @@
package com.facebook;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class CustomTabActivity extends Activity {
private static final int CUSTOM_TAB_REDIRECT_REQUEST_CODE = 2;
private BroadcastReceiver closeReceiver;
public static final Companion Companion = new Companion(null);
public static final String CUSTOM_TAB_REDIRECT_ACTION = Intrinsics.stringPlus(CustomTabActivity.class.getSimpleName(), ".action_customTabRedirect");
public static final String DESTROY_ACTION = Intrinsics.stringPlus(CustomTabActivity.class.getSimpleName(), ".action_destroy");
@Override // android.app.Activity
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
Intent intent = new Intent(this, (Class<?>) CustomTabMainActivity.class);
intent.setAction(CUSTOM_TAB_REDIRECT_ACTION);
intent.putExtra(CustomTabMainActivity.EXTRA_URL, getIntent().getDataString());
intent.addFlags(603979776);
startActivityForResult(intent, 2);
}
@Override // android.app.Activity
public void onActivityResult(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
if (i2 == 0) {
Intent intent2 = new Intent(CUSTOM_TAB_REDIRECT_ACTION);
intent2.putExtra(CustomTabMainActivity.EXTRA_URL, getIntent().getDataString());
LocalBroadcastManager.getInstance(this).sendBroadcast(intent2);
BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { // from class: com.facebook.CustomTabActivity$onActivityResult$closeReceiver$1
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent3) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(intent3, "intent");
CustomTabActivity.this.finish();
}
};
LocalBroadcastManager.getInstance(this).registerReceiver(broadcastReceiver, new IntentFilter(DESTROY_ACTION));
this.closeReceiver = broadcastReceiver;
}
}
@Override // android.app.Activity
public void onDestroy() {
BroadcastReceiver broadcastReceiver = this.closeReceiver;
if (broadcastReceiver != null) {
LocalBroadcastManager.getInstance(this).unregisterReceiver(broadcastReceiver);
}
super.onDestroy();
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,150 @@
package com.facebook;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import android.os.Bundle;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.facebook.internal.CustomTab;
import com.facebook.internal.InstagramCustomTab;
import com.facebook.internal.NativeProtocol;
import com.facebook.internal.Utility;
import com.facebook.login.LoginTargetApp;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class CustomTabMainActivity extends Activity {
private BroadcastReceiver redirectReceiver;
private boolean shouldCloseCustomTab = true;
public static final Companion Companion = new Companion(null);
public static final String EXTRA_ACTION = Intrinsics.stringPlus(CustomTabMainActivity.class.getSimpleName(), ".extra_action");
public static final String EXTRA_PARAMS = Intrinsics.stringPlus(CustomTabMainActivity.class.getSimpleName(), ".extra_params");
public static final String EXTRA_CHROME_PACKAGE = Intrinsics.stringPlus(CustomTabMainActivity.class.getSimpleName(), ".extra_chromePackage");
public static final String EXTRA_URL = Intrinsics.stringPlus(CustomTabMainActivity.class.getSimpleName(), ".extra_url");
public static final String EXTRA_TARGET_APP = Intrinsics.stringPlus(CustomTabMainActivity.class.getSimpleName(), ".extra_targetApp");
public static final String REFRESH_ACTION = Intrinsics.stringPlus(CustomTabMainActivity.class.getSimpleName(), ".action_refresh");
public static final String NO_ACTIVITY_EXCEPTION = Intrinsics.stringPlus(CustomTabMainActivity.class.getSimpleName(), ".no_activity_exception");
public /* synthetic */ class WhenMappings {
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
static {
int[] iArr = new int[LoginTargetApp.valuesCustom().length];
iArr[LoginTargetApp.INSTAGRAM.ordinal()] = 1;
$EnumSwitchMapping$0 = iArr;
}
}
@Override // android.app.Activity
public void onCreate(Bundle bundle) {
String stringExtra;
CustomTab customTab;
super.onCreate(bundle);
String str = CustomTabActivity.CUSTOM_TAB_REDIRECT_ACTION;
if (Intrinsics.areEqual(str, getIntent().getAction())) {
setResult(0);
finish();
return;
}
if (bundle != null || (stringExtra = getIntent().getStringExtra(EXTRA_ACTION)) == null) {
return;
}
Bundle bundleExtra = getIntent().getBundleExtra(EXTRA_PARAMS);
String stringExtra2 = getIntent().getStringExtra(EXTRA_CHROME_PACKAGE);
if (WhenMappings.$EnumSwitchMapping$0[LoginTargetApp.Companion.fromString(getIntent().getStringExtra(EXTRA_TARGET_APP)).ordinal()] == 1) {
customTab = new InstagramCustomTab(stringExtra, bundleExtra);
} else {
customTab = new CustomTab(stringExtra, bundleExtra);
}
boolean openCustomTab = customTab.openCustomTab(this, stringExtra2);
this.shouldCloseCustomTab = false;
if (!openCustomTab) {
setResult(0, getIntent().putExtra(NO_ACTIVITY_EXCEPTION, true));
finish();
} else {
BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { // from class: com.facebook.CustomTabMainActivity$onCreate$redirectReceiver$1
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(intent, "intent");
Intent intent2 = new Intent(CustomTabMainActivity.this, (Class<?>) CustomTabMainActivity.class);
intent2.setAction(CustomTabMainActivity.REFRESH_ACTION);
String str2 = CustomTabMainActivity.EXTRA_URL;
intent2.putExtra(str2, intent.getStringExtra(str2));
intent2.addFlags(603979776);
CustomTabMainActivity.this.startActivity(intent2);
}
};
this.redirectReceiver = broadcastReceiver;
LocalBroadcastManager.getInstance(this).registerReceiver(broadcastReceiver, new IntentFilter(str));
}
}
@Override // android.app.Activity
public void onNewIntent(Intent intent) {
Intrinsics.checkNotNullParameter(intent, "intent");
super.onNewIntent(intent);
if (Intrinsics.areEqual(REFRESH_ACTION, intent.getAction())) {
LocalBroadcastManager.getInstance(this).sendBroadcast(new Intent(CustomTabActivity.DESTROY_ACTION));
sendResult(-1, intent);
} else if (Intrinsics.areEqual(CustomTabActivity.CUSTOM_TAB_REDIRECT_ACTION, intent.getAction())) {
sendResult(-1, intent);
}
}
@Override // android.app.Activity
public void onResume() {
super.onResume();
if (this.shouldCloseCustomTab) {
sendResult(0, null);
}
this.shouldCloseCustomTab = true;
}
private final void sendResult(int i, Intent intent) {
BroadcastReceiver broadcastReceiver = this.redirectReceiver;
if (broadcastReceiver != null) {
LocalBroadcastManager.getInstance(this).unregisterReceiver(broadcastReceiver);
}
if (intent != null) {
String stringExtra = intent.getStringExtra(EXTRA_URL);
Bundle parseResponseUri = stringExtra != null ? Companion.parseResponseUri(stringExtra) : new Bundle();
NativeProtocol nativeProtocol = NativeProtocol.INSTANCE;
Intent intent2 = getIntent();
Intrinsics.checkNotNullExpressionValue(intent2, "intent");
Intent createProtocolResultIntent = NativeProtocol.createProtocolResultIntent(intent2, parseResponseUri, null);
if (createProtocolResultIntent != null) {
intent = createProtocolResultIntent;
}
setResult(i, intent);
} else {
NativeProtocol nativeProtocol2 = NativeProtocol.INSTANCE;
Intent intent3 = getIntent();
Intrinsics.checkNotNullExpressionValue(intent3, "intent");
setResult(i, NativeProtocol.createProtocolResultIntent(intent3, null, null));
}
finish();
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
/* JADX INFO: Access modifiers changed from: private */
public final Bundle parseResponseUri(String str) {
Uri parse = Uri.parse(str);
Utility utility = Utility.INSTANCE;
Bundle parseUrlQueryString = Utility.parseUrlQueryString(parse.getQuery());
parseUrlQueryString.putAll(Utility.parseUrlQueryString(parse.getFragment()));
return parseUrlQueryString;
}
}
}

View File

@@ -0,0 +1,125 @@
package com.facebook;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import com.facebook.internal.FacebookDialogFragment;
import com.facebook.internal.NativeProtocol;
import com.facebook.internal.Utility;
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
import com.facebook.internal.logging.dumpsys.EndToEndDumper;
import com.facebook.login.LoginFragment;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public class FacebookActivity extends FragmentActivity {
private static final String FRAGMENT_TAG = "SingleFragment";
public static final String PASS_THROUGH_CANCEL_ACTION = "PassThrough";
private Fragment currentFragment;
public static final Companion Companion = new Companion(null);
private static final String TAG = FacebookActivity.class.getName();
public final Fragment getCurrentFragment() {
return this.currentFragment;
}
@Override // androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, android.app.Activity
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
Intent intent = getIntent();
if (!FacebookSdk.isInitialized()) {
Utility utility = Utility.INSTANCE;
Utility.logd(TAG, "Facebook SDK not initialized. Make sure you call sdkInitialize inside your Application's onCreate method.");
Context applicationContext = getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext, "applicationContext");
FacebookSdk.sdkInitialize(applicationContext);
}
setContentView(com.facebook.common.R.layout.com_facebook_activity_layout);
if (Intrinsics.areEqual(PASS_THROUGH_CANCEL_ACTION, intent.getAction())) {
handlePassThroughError();
} else {
this.currentFragment = getFragment();
}
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r0v5, types: [androidx.fragment.app.DialogFragment, androidx.fragment.app.Fragment, com.facebook.internal.FacebookDialogFragment] */
public Fragment getFragment() {
LoginFragment loginFragment;
Intent intent = getIntent();
FragmentManager supportFragmentManager = getSupportFragmentManager();
Intrinsics.checkNotNullExpressionValue(supportFragmentManager, "supportFragmentManager");
Fragment findFragmentByTag = supportFragmentManager.findFragmentByTag(FRAGMENT_TAG);
if (findFragmentByTag != null) {
return findFragmentByTag;
}
if (Intrinsics.areEqual(FacebookDialogFragment.TAG, intent.getAction())) {
?? facebookDialogFragment = new FacebookDialogFragment();
facebookDialogFragment.setRetainInstance(true);
facebookDialogFragment.show(supportFragmentManager, FRAGMENT_TAG);
loginFragment = facebookDialogFragment;
} else {
LoginFragment loginFragment2 = new LoginFragment();
loginFragment2.setRetainInstance(true);
supportFragmentManager.beginTransaction().add(com.facebook.common.R.id.com_facebook_fragment_container, loginFragment2, FRAGMENT_TAG).commit();
loginFragment = loginFragment2;
}
return loginFragment;
}
@Override // androidx.activity.ComponentActivity, android.app.Activity, android.content.ComponentCallbacks
public void onConfigurationChanged(Configuration newConfig) {
Intrinsics.checkNotNullParameter(newConfig, "newConfig");
super.onConfigurationChanged(newConfig);
Fragment fragment = this.currentFragment;
if (fragment == null) {
return;
}
fragment.onConfigurationChanged(newConfig);
}
private final void handlePassThroughError() {
Intent requestIntent = getIntent();
NativeProtocol nativeProtocol = NativeProtocol.INSTANCE;
Intrinsics.checkNotNullExpressionValue(requestIntent, "requestIntent");
FacebookException exceptionFromErrorData = NativeProtocol.getExceptionFromErrorData(NativeProtocol.getMethodArgumentsFromIntent(requestIntent));
Intent intent = getIntent();
Intrinsics.checkNotNullExpressionValue(intent, "intent");
setResult(0, NativeProtocol.createProtocolResultIntent(intent, null, exceptionFromErrorData));
finish();
}
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
public void dump(String prefix, FileDescriptor fileDescriptor, PrintWriter writer, String[] strArr) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
Intrinsics.checkNotNullParameter(prefix, "prefix");
Intrinsics.checkNotNullParameter(writer, "writer");
EndToEndDumper companion = EndToEndDumper.Companion.getInstance();
if (Intrinsics.areEqual(companion == null ? null : Boolean.valueOf(companion.maybeDump(prefix, writer, strArr)), Boolean.TRUE)) {
return;
}
super.dump(prefix, fileDescriptor, writer, strArr);
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,33 @@
package com.facebook;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* loaded from: classes2.dex */
public final class FacebookAuthorizationException extends FacebookException {
public static final Companion Companion = new Companion(null);
public static final long serialVersionUID = 1;
public FacebookAuthorizationException() {
}
public FacebookAuthorizationException(String str) {
super(str);
}
public FacebookAuthorizationException(String str, Throwable th) {
super(str, th);
}
public FacebookAuthorizationException(Throwable th) {
super(th);
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,40 @@
package com.facebook;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.facebook.internal.NativeProtocol;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public class FacebookBroadcastReceiver extends BroadcastReceiver {
public void onFailedAppCall(String appCallId, String action, Bundle extras) {
Intrinsics.checkNotNullParameter(appCallId, "appCallId");
Intrinsics.checkNotNullParameter(action, "action");
Intrinsics.checkNotNullParameter(extras, "extras");
}
public void onSuccessfulAppCall(String appCallId, String action, Bundle extras) {
Intrinsics.checkNotNullParameter(appCallId, "appCallId");
Intrinsics.checkNotNullParameter(action, "action");
Intrinsics.checkNotNullParameter(extras, "extras");
}
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(intent, "intent");
String stringExtra = intent.getStringExtra(NativeProtocol.EXTRA_PROTOCOL_CALL_ID);
String stringExtra2 = intent.getStringExtra(NativeProtocol.EXTRA_PROTOCOL_ACTION);
Bundle extras = intent.getExtras();
if (stringExtra == null || stringExtra2 == null || extras == null) {
return;
}
if (NativeProtocol.isErrorResult(intent)) {
onFailedAppCall(stringExtra, stringExtra2, extras);
} else {
onSuccessfulAppCall(stringExtra, stringExtra2, extras);
}
}
}

View File

@@ -0,0 +1,486 @@
package com.facebook;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Fragment;
import android.content.ComponentCallbacks2;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
import androidx.activity.result.ActivityResultRegistryOwner;
import androidx.core.content.ContextCompat;
import com.facebook.appevents.InternalAppEventsLogger;
import com.facebook.internal.FragmentWrapper;
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
import kotlin.jvm.internal.Intrinsics;
@SuppressLint({"ResourceType"})
/* loaded from: classes2.dex */
public abstract class FacebookButtonBase extends Button {
private final String analyticsButtonCreatedEventName;
private final String analyticsButtonTappedEventName;
private final int defaultStyleResource;
private View.OnClickListener externalOnClickListener;
private View.OnClickListener internalOnClickListener;
private boolean overrideCompoundPadding;
private int overrideCompoundPaddingLeft;
private int overrideCompoundPaddingRight;
private FragmentWrapper parentFragment;
public abstract int getDefaultRequestCode();
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public FacebookButtonBase(Context context, AttributeSet attributeSet, int i, int i2, String analyticsButtonCreatedEventName, String analyticsButtonTappedEventName) {
super(context, attributeSet, 0);
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(analyticsButtonCreatedEventName, "analyticsButtonCreatedEventName");
Intrinsics.checkNotNullParameter(analyticsButtonTappedEventName, "analyticsButtonTappedEventName");
i2 = i2 == 0 ? getDefaultStyleResource() : i2;
configureButton(context, attributeSet, i, i2 == 0 ? com.facebook.common.R.style.com_facebook_button : i2);
this.analyticsButtonCreatedEventName = analyticsButtonCreatedEventName;
this.analyticsButtonTappedEventName = analyticsButtonTappedEventName;
setClickable(true);
setFocusable(true);
}
public final String getAnalyticsButtonCreatedEventName() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
return this.analyticsButtonCreatedEventName;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
}
public final String getAnalyticsButtonTappedEventName() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
return this.analyticsButtonTappedEventName;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
}
public final Fragment getNativeFragment() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
FragmentWrapper fragmentWrapper = this.parentFragment;
if (fragmentWrapper == null) {
return null;
}
return fragmentWrapper.getNativeFragment();
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
}
public final void setFragment(Fragment fragment) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
Intrinsics.checkNotNullParameter(fragment, "fragment");
this.parentFragment = new FragmentWrapper(fragment);
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
public final androidx.fragment.app.Fragment getFragment() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
FragmentWrapper fragmentWrapper = this.parentFragment;
if (fragmentWrapper == null) {
return null;
}
return fragmentWrapper.getSupportFragment();
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
}
public final void setFragment(androidx.fragment.app.Fragment fragment) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
Intrinsics.checkNotNullParameter(fragment, "fragment");
this.parentFragment = new FragmentWrapper(fragment);
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
public final ActivityResultRegistryOwner getAndroidxActivityResultRegistryOwner() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
ComponentCallbacks2 activity = getActivity();
if (activity instanceof ActivityResultRegistryOwner) {
return (ActivityResultRegistryOwner) activity;
}
return null;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
}
@Override // android.view.View
public void setOnClickListener(View.OnClickListener onClickListener) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
this.externalOnClickListener = onClickListener;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
public int getRequestCode() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return 0;
}
try {
return getDefaultRequestCode();
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return 0;
}
}
@Override // android.widget.TextView, android.view.View
public void onAttachedToWindow() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
super.onAttachedToWindow();
if (isInEditMode()) {
return;
}
logButtonCreated(getContext());
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
@Override // android.widget.TextView, android.view.View
public void onDraw(Canvas canvas) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
Intrinsics.checkNotNullParameter(canvas, "canvas");
if ((getGravity() & 1) != 0) {
int compoundPaddingLeft = getCompoundPaddingLeft();
int compoundPaddingRight = getCompoundPaddingRight();
int min = Math.min((((getWidth() - (getCompoundDrawablePadding() + compoundPaddingLeft)) - compoundPaddingRight) - measureTextWidth(getText().toString())) / 2, (compoundPaddingLeft - getPaddingLeft()) / 2);
this.overrideCompoundPaddingLeft = compoundPaddingLeft - min;
this.overrideCompoundPaddingRight = compoundPaddingRight + min;
this.overrideCompoundPadding = true;
}
super.onDraw(canvas);
this.overrideCompoundPadding = false;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
@Override // android.widget.TextView
public int getCompoundPaddingLeft() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return 0;
}
try {
return this.overrideCompoundPadding ? this.overrideCompoundPaddingLeft : super.getCompoundPaddingLeft();
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return 0;
}
}
@Override // android.widget.TextView
public int getCompoundPaddingRight() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return 0;
}
try {
return this.overrideCompoundPadding ? this.overrideCompoundPaddingRight : super.getCompoundPaddingRight();
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return 0;
}
}
public Activity getActivity() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
Context context = getContext();
while (!(context instanceof Activity) && (context instanceof ContextWrapper)) {
context = ((ContextWrapper) context).getBaseContext();
}
if (context instanceof Activity) {
return (Activity) context;
}
throw new FacebookException("Unable to get Activity.");
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
}
public int getDefaultStyleResource() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return 0;
}
try {
return this.defaultStyleResource;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return 0;
}
}
public int measureTextWidth(String str) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return 0;
}
try {
return (int) Math.ceil(getPaint().measureText(str));
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return 0;
}
}
public void configureButton(Context context, AttributeSet attributeSet, int i, int i2) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
Intrinsics.checkNotNullParameter(context, "context");
parseBackgroundAttributes(context, attributeSet, i, i2);
parseCompoundDrawableAttributes(context, attributeSet, i, i2);
parseContentAttributes(context, attributeSet, i, i2);
parseTextAttributes(context, attributeSet, i, i2);
setupOnClickListener();
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
public void callExternalOnClickListener(View view) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
View.OnClickListener onClickListener = this.externalOnClickListener;
if (onClickListener == null) {
return;
}
onClickListener.onClick(view);
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
public void setInternalOnClickListener(View.OnClickListener onClickListener) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
this.internalOnClickListener = onClickListener;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
public void logButtonCreated(Context context) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
InternalAppEventsLogger.Companion.createInstance(context, null).logEventImplicitly(this.analyticsButtonCreatedEventName);
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
public void logButtonTapped(Context context) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
InternalAppEventsLogger.Companion.createInstance(context, null).logEventImplicitly(this.analyticsButtonTappedEventName);
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
private final void parseBackgroundAttributes(Context context, AttributeSet attributeSet, int i, int i2) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
if (isInEditMode()) {
return;
}
TypedArray obtainStyledAttributes = context.getTheme().obtainStyledAttributes(attributeSet, new int[]{android.R.attr.background}, i, i2);
Intrinsics.checkNotNullExpressionValue(obtainStyledAttributes, "context.theme.obtainStyledAttributes(attrs, attrsResources, defStyleAttr, defStyleRes)");
try {
if (obtainStyledAttributes.hasValue(0)) {
int resourceId = obtainStyledAttributes.getResourceId(0, 0);
if (resourceId != 0) {
setBackgroundResource(resourceId);
} else {
setBackgroundColor(obtainStyledAttributes.getColor(0, 0));
}
} else {
setBackgroundColor(ContextCompat.getColor(context, com.facebook.common.R.color.com_facebook_blue));
}
obtainStyledAttributes.recycle();
} catch (Throwable th) {
obtainStyledAttributes.recycle();
throw th;
}
} catch (Throwable th2) {
CrashShieldHandler.handleThrowable(th2, this);
}
}
@SuppressLint({"ResourceType"})
private final void parseCompoundDrawableAttributes(Context context, AttributeSet attributeSet, int i, int i2) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
TypedArray obtainStyledAttributes = context.getTheme().obtainStyledAttributes(attributeSet, new int[]{android.R.attr.drawableLeft, android.R.attr.drawableTop, android.R.attr.drawableRight, android.R.attr.drawableBottom, android.R.attr.drawablePadding}, i, i2);
Intrinsics.checkNotNullExpressionValue(obtainStyledAttributes, "context.theme.obtainStyledAttributes(attrs, attrsResources, defStyleAttr, defStyleRes)");
try {
setCompoundDrawablesWithIntrinsicBounds(obtainStyledAttributes.getResourceId(0, 0), obtainStyledAttributes.getResourceId(1, 0), obtainStyledAttributes.getResourceId(2, 0), obtainStyledAttributes.getResourceId(3, 0));
int dimensionPixelSize = obtainStyledAttributes.getDimensionPixelSize(4, 0);
obtainStyledAttributes.recycle();
setCompoundDrawablePadding(dimensionPixelSize);
} catch (Throwable th) {
obtainStyledAttributes.recycle();
throw th;
}
} catch (Throwable th2) {
CrashShieldHandler.handleThrowable(th2, this);
}
}
private final void parseContentAttributes(Context context, AttributeSet attributeSet, int i, int i2) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
TypedArray obtainStyledAttributes = context.getTheme().obtainStyledAttributes(attributeSet, new int[]{android.R.attr.paddingLeft, android.R.attr.paddingTop, android.R.attr.paddingRight, android.R.attr.paddingBottom}, i, i2);
Intrinsics.checkNotNullExpressionValue(obtainStyledAttributes, "context.theme.obtainStyledAttributes(attrs, attrsResources, defStyleAttr, defStyleRes)");
try {
setPadding(obtainStyledAttributes.getDimensionPixelSize(0, 0), obtainStyledAttributes.getDimensionPixelSize(1, 0), obtainStyledAttributes.getDimensionPixelSize(2, 0), obtainStyledAttributes.getDimensionPixelSize(3, 0));
} finally {
obtainStyledAttributes.recycle();
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
private final void parseTextAttributes(Context context, AttributeSet attributeSet, int i, int i2) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
TypedArray obtainStyledAttributes = context.getTheme().obtainStyledAttributes(attributeSet, new int[]{android.R.attr.textColor}, i, i2);
Intrinsics.checkNotNullExpressionValue(obtainStyledAttributes, "context.theme.obtainStyledAttributes(attrs, colorResources, defStyleAttr, defStyleRes)");
try {
setTextColor(obtainStyledAttributes.getColorStateList(0));
obtainStyledAttributes.recycle();
obtainStyledAttributes = context.getTheme().obtainStyledAttributes(attributeSet, new int[]{android.R.attr.gravity}, i, i2);
Intrinsics.checkNotNullExpressionValue(obtainStyledAttributes, "context.theme.obtainStyledAttributes(attrs, gravityResources, defStyleAttr, defStyleRes)");
try {
int i3 = obtainStyledAttributes.getInt(0, 17);
obtainStyledAttributes.recycle();
setGravity(i3);
obtainStyledAttributes = context.getTheme().obtainStyledAttributes(attributeSet, new int[]{android.R.attr.textSize, android.R.attr.textStyle, android.R.attr.text}, i, i2);
Intrinsics.checkNotNullExpressionValue(obtainStyledAttributes, "context.theme.obtainStyledAttributes(attrs, attrsResources, defStyleAttr, defStyleRes)");
try {
setTextSize(0, obtainStyledAttributes.getDimensionPixelSize(0, 0));
setTypeface(Typeface.create(getTypeface(), 1));
String string = obtainStyledAttributes.getString(2);
obtainStyledAttributes.recycle();
setText(string);
} finally {
}
} finally {
}
} finally {
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
private final void setupOnClickListener() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
super.setOnClickListener(new View.OnClickListener() { // from class: com.facebook.FacebookButtonBase$$ExternalSyntheticLambda0
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
FacebookButtonBase.m420setupOnClickListener$lambda0(FacebookButtonBase.this, view);
}
});
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: setupOnClickListener$lambda-0, reason: not valid java name */
public static final void m420setupOnClickListener$lambda0(FacebookButtonBase this$0, View view) {
if (CrashShieldHandler.isObjectCrashing(FacebookButtonBase.class)) {
return;
}
try {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this$0.logButtonTapped(this$0.getContext());
View.OnClickListener onClickListener = this$0.internalOnClickListener;
if (onClickListener != null) {
onClickListener.onClick(view);
return;
}
View.OnClickListener onClickListener2 = this$0.externalOnClickListener;
if (onClickListener2 == null) {
return;
}
onClickListener2.onClick(view);
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, FacebookButtonBase.class);
}
}
}

View File

@@ -0,0 +1,10 @@
package com.facebook;
/* loaded from: classes2.dex */
public interface FacebookCallback<RESULT> {
void onCancel();
void onError(FacebookException facebookException);
void onSuccess(RESULT result);
}

View File

@@ -0,0 +1,131 @@
package com.facebook;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import android.os.ParcelFileDescriptor;
import android.util.Log;
import android.util.Pair;
import com.facebook.internal.NativeAppCallAttachmentStore;
import com.google.android.gms.drive.DriveFile;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.StringCompanionObject;
import kotlin.text.StringsKt__StringsKt;
/* loaded from: classes2.dex */
public final class FacebookContentProvider extends ContentProvider {
private static final String ATTACHMENT_URL_BASE = "content://com.facebook.app.FacebookContentProvider";
private static final String INVALID_FILE_NAME = "..";
public static final Companion Companion = new Companion(null);
private static final String TAG = FacebookContentProvider.class.getName();
public static final String getAttachmentUrl(String str, UUID uuid, String str2) {
return Companion.getAttachmentUrl(str, uuid, str2);
}
@Override // android.content.ContentProvider
public int delete(Uri uri, String str, String[] strArr) {
Intrinsics.checkNotNullParameter(uri, "uri");
return 0;
}
@Override // android.content.ContentProvider
public String getType(Uri uri) {
Intrinsics.checkNotNullParameter(uri, "uri");
return null;
}
@Override // android.content.ContentProvider
public Uri insert(Uri uri, ContentValues contentValues) {
Intrinsics.checkNotNullParameter(uri, "uri");
return null;
}
@Override // android.content.ContentProvider
public boolean onCreate() {
return true;
}
@Override // android.content.ContentProvider
public Cursor query(Uri uri, String[] strArr, String str, String[] strArr2, String str2) {
Intrinsics.checkNotNullParameter(uri, "uri");
return null;
}
@Override // android.content.ContentProvider
public int update(Uri uri, ContentValues contentValues, String str, String[] strArr) {
Intrinsics.checkNotNullParameter(uri, "uri");
return 0;
}
@Override // android.content.ContentProvider
public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
Intrinsics.checkNotNullParameter(uri, "uri");
Intrinsics.checkNotNullParameter(mode, "mode");
Pair<UUID, String> parseCallIdAndAttachmentName = parseCallIdAndAttachmentName(uri);
if (parseCallIdAndAttachmentName == null) {
throw new FileNotFoundException();
}
try {
NativeAppCallAttachmentStore nativeAppCallAttachmentStore = NativeAppCallAttachmentStore.INSTANCE;
File openAttachment = NativeAppCallAttachmentStore.openAttachment((UUID) parseCallIdAndAttachmentName.first, (String) parseCallIdAndAttachmentName.second);
if (openAttachment == null) {
throw new FileNotFoundException();
}
return ParcelFileDescriptor.open(openAttachment, DriveFile.MODE_READ_ONLY);
} catch (FileNotFoundException e) {
Log.e(TAG, Intrinsics.stringPlus("Got unexpected exception:", e));
throw e;
}
}
private final Pair<UUID, String> parseCallIdAndAttachmentName(Uri uri) {
List split$default;
try {
String path = uri.getPath();
if (path == null) {
throw new IllegalStateException("Required value was null.".toString());
}
String substring = path.substring(1);
Intrinsics.checkNotNullExpressionValue(substring, "(this as java.lang.String).substring(startIndex)");
split$default = StringsKt__StringsKt.split$default((CharSequence) substring, new String[]{"/"}, false, 0, 6, (Object) null);
Object[] array = split$default.toArray(new String[0]);
if (array == null) {
throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T>");
}
String[] strArr = (String[]) array;
String str = strArr[0];
String str2 = strArr[1];
if (INVALID_FILE_NAME.contentEquals(str) || INVALID_FILE_NAME.contentEquals(str2)) {
throw new Exception();
}
return new Pair<>(UUID.fromString(str), str2);
} catch (Exception unused) {
return null;
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final String getAttachmentUrl(String str, UUID callId, String str2) {
Intrinsics.checkNotNullParameter(callId, "callId");
StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
String format = String.format("%s%s/%s/%s", Arrays.copyOf(new Object[]{FacebookContentProvider.ATTACHMENT_URL_BASE, str, callId.toString(), str2}, 4));
Intrinsics.checkNotNullExpressionValue(format, "java.lang.String.format(format, *args)");
return format;
}
}
}

View File

@@ -0,0 +1,17 @@
package com.facebook;
import androidx.activity.result.contract.ActivityResultContract;
import com.facebook.CallbackManager;
/* loaded from: classes2.dex */
public interface FacebookDialog<CONTENT, RESULT> {
boolean canShow(CONTENT content);
ActivityResultContract<CONTENT, CallbackManager.ActivityResultParameters> createActivityResultContractForShowingDialog(CallbackManager callbackManager);
void registerCallback(CallbackManager callbackManager, FacebookCallback<RESULT> facebookCallback);
void registerCallback(CallbackManager callbackManager, FacebookCallback<RESULT> facebookCallback, int i);
void show(CONTENT content);
}

View File

@@ -0,0 +1,42 @@
package com.facebook;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class FacebookDialogException extends FacebookException {
public static final Companion Companion = new Companion(null);
public static final long serialVersionUID = 1;
private final int errorCode;
private final String failingUrl;
public final int getErrorCode() {
return this.errorCode;
}
public final String getFailingUrl() {
return this.failingUrl;
}
public FacebookDialogException(String str, int i, String str2) {
super(str);
this.errorCode = i;
this.failingUrl = str2;
}
@Override // com.facebook.FacebookException, java.lang.Throwable
public String toString() {
String str = "{FacebookDialogException: errorCode: " + this.errorCode + ", message: " + getMessage() + ", url: " + this.failingUrl + "}";
Intrinsics.checkNotNullExpressionValue(str, "StringBuilder()\n .append(\"{FacebookDialogException: \")\n .append(\"errorCode: \")\n .append(errorCode)\n .append(\", message: \")\n .append(message)\n .append(\", url: \")\n .append(failingUrl)\n .append(\"}\")\n .toString()");
return str;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,92 @@
package com.facebook;
import com.facebook.internal.FeatureManager;
import com.facebook.internal.instrument.errorreport.ErrorReportHandler;
import java.util.Random;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* loaded from: classes2.dex */
public class FacebookException extends RuntimeException {
public static final Companion Companion = new Companion(null);
public static final long serialVersionUID = 1;
public FacebookException() {
}
public FacebookException(final String str) {
super(str);
Random random = new Random();
if (str == null || !FacebookSdk.isInitialized() || random.nextInt(100) <= 50) {
return;
}
FeatureManager featureManager = FeatureManager.INSTANCE;
FeatureManager.checkFeature(FeatureManager.Feature.ErrorReport, new FeatureManager.Callback() { // from class: com.facebook.FacebookException$$ExternalSyntheticLambda0
@Override // com.facebook.internal.FeatureManager.Callback
public final void onCompleted(boolean z) {
FacebookException.m421_init_$lambda0(str, z);
}
});
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: _init_$lambda-0, reason: not valid java name */
public static final void m421_init_$lambda0(String str, boolean z) {
if (z) {
try {
ErrorReportHandler.save(str);
} catch (Exception unused) {
}
}
}
/* JADX WARN: Illegal instructions before constructor call */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public FacebookException(java.lang.String r2, java.lang.Object... r3) {
/*
r1 = this;
java.lang.String r0 = "args"
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r3, r0)
if (r2 != 0) goto L9
r2 = 0
goto L1c
L9:
int r0 = r3.length
java.lang.Object[] r3 = java.util.Arrays.copyOf(r3, r0)
int r0 = r3.length
java.lang.Object[] r3 = java.util.Arrays.copyOf(r3, r0)
java.lang.String r2 = java.lang.String.format(r2, r3)
java.lang.String r3 = "java.lang.String.format(this, *args)"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r2, r3)
L1c:
r1.<init>(r2)
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.FacebookException.<init>(java.lang.String, java.lang.Object[]):void");
}
public FacebookException(String str, Throwable th) {
super(str, th);
}
public FacebookException(Throwable th) {
super(th);
}
@Override // java.lang.Throwable
public String toString() {
String message = getMessage();
return message == null ? "" : message;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,44 @@
package com.facebook;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class FacebookGraphResponseException extends FacebookException {
private final GraphResponse graphResponse;
public final GraphResponse getGraphResponse() {
return this.graphResponse;
}
public FacebookGraphResponseException(GraphResponse graphResponse, String str) {
super(str);
this.graphResponse = graphResponse;
}
@Override // com.facebook.FacebookException, java.lang.Throwable
public String toString() {
GraphResponse graphResponse = this.graphResponse;
FacebookRequestError error = graphResponse == null ? null : graphResponse.getError();
StringBuilder sb = new StringBuilder();
sb.append("{FacebookGraphResponseException: ");
String message = getMessage();
if (message != null) {
sb.append(message);
sb.append(" ");
}
if (error != null) {
sb.append("httpResponseCode: ");
sb.append(error.getRequestStatusCode());
sb.append(", facebookErrorCode: ");
sb.append(error.getErrorCode());
sb.append(", facebookErrorType: ");
sb.append(error.getErrorType());
sb.append(", message: ");
sb.append(error.getErrorMessage());
sb.append("}");
}
String sb2 = sb.toString();
Intrinsics.checkNotNullExpressionValue(sb2, "errorStringBuilder.toString()");
return sb2;
}
}

View File

@@ -0,0 +1,33 @@
package com.facebook;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* loaded from: classes2.dex */
public final class FacebookOperationCanceledException extends FacebookException {
public static final Companion Companion = new Companion(null);
public static final long serialVersionUID = 1;
public FacebookOperationCanceledException() {
}
public FacebookOperationCanceledException(String str) {
super(str);
}
public FacebookOperationCanceledException(String str, Throwable th) {
super(str, th);
}
public FacebookOperationCanceledException(Throwable th) {
super(th);
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,270 @@
package com.facebook;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.VisibleForTesting;
import com.facebook.internal.FacebookRequestErrorClassification;
import com.facebook.internal.FetchedAppSettings;
import com.facebook.internal.FetchedAppSettingsManager;
import com.facebook.internal.qualityvalidation.Excuse;
import com.facebook.internal.qualityvalidation.ExcusesForDesignViolations;
import java.net.HttpURLConnection;
import java.util.Arrays;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONObject;
@ExcusesForDesignViolations({@Excuse(reason = "Legacy migration", type = "KOTLIN_JVM_FIELD")})
/* loaded from: classes2.dex */
public final class FacebookRequestError implements Parcelable {
private static final String BODY_KEY = "body";
private static final String CODE_KEY = "code";
private static final String ERROR_CODE_FIELD_KEY = "code";
private static final String ERROR_CODE_KEY = "error_code";
private static final String ERROR_IS_TRANSIENT_KEY = "is_transient";
private static final String ERROR_KEY = "error";
private static final String ERROR_MESSAGE_FIELD_KEY = "message";
private static final String ERROR_MSG_KEY = "error_msg";
private static final String ERROR_REASON_KEY = "error_reason";
private static final String ERROR_SUB_CODE_KEY = "error_subcode";
private static final String ERROR_TYPE_FIELD_KEY = "type";
private static final String ERROR_USER_MSG_KEY = "error_user_msg";
private static final String ERROR_USER_TITLE_KEY = "error_user_title";
public static final int INVALID_ERROR_CODE = -1;
public static final int INVALID_HTTP_STATUS_CODE = -1;
private final Object batchRequestResult;
private final Category category;
private final HttpURLConnection connection;
private final int errorCode;
private final String errorMessage;
private final String errorRecoveryMessage;
private final String errorType;
private final String errorUserMessage;
private final String errorUserTitle;
private FacebookException exception;
private final JSONObject requestResult;
private final JSONObject requestResultBody;
private final int requestStatusCode;
private final int subErrorCode;
public static final Companion Companion = new Companion(null);
private static final Range HTTP_RANGE_SUCCESS = new Range(200, 299);
public static final Parcelable.Creator<FacebookRequestError> CREATOR = new Parcelable.Creator<FacebookRequestError>() { // from class: com.facebook.FacebookRequestError$Companion$CREATOR$1
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public FacebookRequestError createFromParcel(Parcel parcel) {
Intrinsics.checkNotNullParameter(parcel, "parcel");
return new FacebookRequestError(parcel, (DefaultConstructorMarker) null);
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public FacebookRequestError[] newArray(int i) {
return new FacebookRequestError[i];
}
};
public /* synthetic */ FacebookRequestError(int i, int i2, int i3, String str, String str2, String str3, String str4, JSONObject jSONObject, JSONObject jSONObject2, Object obj, HttpURLConnection httpURLConnection, FacebookException facebookException, boolean z, DefaultConstructorMarker defaultConstructorMarker) {
this(i, i2, i3, str, str2, str3, str4, jSONObject, jSONObject2, obj, httpURLConnection, facebookException, z);
}
public /* synthetic */ FacebookRequestError(Parcel parcel, DefaultConstructorMarker defaultConstructorMarker) {
this(parcel);
}
public static final FacebookRequestError checkResponseAndCreateError(JSONObject jSONObject, Object obj, HttpURLConnection httpURLConnection) {
return Companion.checkResponseAndCreateError(jSONObject, obj, httpURLConnection);
}
public static final synchronized FacebookRequestErrorClassification getErrorClassification() {
FacebookRequestErrorClassification errorClassification;
synchronized (FacebookRequestError.class) {
errorClassification = Companion.getErrorClassification();
}
return errorClassification;
}
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
public final Object getBatchRequestResult() {
return this.batchRequestResult;
}
public final Category getCategory() {
return this.category;
}
public final HttpURLConnection getConnection() {
return this.connection;
}
public final int getErrorCode() {
return this.errorCode;
}
public final String getErrorRecoveryMessage() {
return this.errorRecoveryMessage;
}
public final String getErrorType() {
return this.errorType;
}
public final String getErrorUserMessage() {
return this.errorUserMessage;
}
public final String getErrorUserTitle() {
return this.errorUserTitle;
}
public final FacebookException getException() {
return this.exception;
}
public final JSONObject getRequestResult() {
return this.requestResult;
}
public final JSONObject getRequestResultBody() {
return this.requestResultBody;
}
public final int getRequestStatusCode() {
return this.requestStatusCode;
}
public final int getSubErrorCode() {
return this.subErrorCode;
}
private FacebookRequestError(int i, int i2, int i3, String str, String str2, String str3, String str4, JSONObject jSONObject, JSONObject jSONObject2, Object obj, HttpURLConnection httpURLConnection, FacebookException facebookException, boolean z) {
Category classify;
this.requestStatusCode = i;
this.errorCode = i2;
this.subErrorCode = i3;
this.errorType = str;
this.errorUserTitle = str3;
this.errorUserMessage = str4;
this.requestResultBody = jSONObject;
this.requestResult = jSONObject2;
this.batchRequestResult = obj;
this.connection = httpURLConnection;
this.errorMessage = str2;
if (facebookException == null) {
this.exception = new FacebookServiceException(this, getErrorMessage());
classify = Companion.getErrorClassification().classify(i2, i3, z);
} else {
this.exception = facebookException;
classify = Category.OTHER;
}
this.category = classify;
this.errorRecoveryMessage = Companion.getErrorClassification().getRecoveryMessage(classify);
}
public static final class Range {
private final int end;
private final int start;
public final boolean contains(int i) {
return i <= this.end && this.start <= i;
}
public Range(int i, int i2) {
this.start = i;
this.end = i2;
}
}
public final String getErrorMessage() {
String str = this.errorMessage;
if (str != null) {
return str;
}
FacebookException facebookException = this.exception;
if (facebookException == null) {
return null;
}
return facebookException.getLocalizedMessage();
}
@VisibleForTesting(otherwise = 4)
public FacebookRequestError(HttpURLConnection httpURLConnection, Exception exc) {
this(-1, -1, -1, null, null, null, null, null, null, null, httpURLConnection, exc instanceof FacebookException ? (FacebookException) exc : new FacebookException(exc), false);
}
public FacebookRequestError(int i, String str, String str2) {
this(-1, i, -1, str, str2, null, null, null, null, null, null, null, false);
}
public String toString() {
String str = "{HttpStatus: " + this.requestStatusCode + ", errorCode: " + this.errorCode + ", subErrorCode: " + this.subErrorCode + ", errorType: " + this.errorType + ", errorMessage: " + getErrorMessage() + "}";
Intrinsics.checkNotNullExpressionValue(str, "StringBuilder(\"{HttpStatus: \")\n .append(requestStatusCode)\n .append(\", errorCode: \")\n .append(errorCode)\n .append(\", subErrorCode: \")\n .append(subErrorCode)\n .append(\", errorType: \")\n .append(errorType)\n .append(\", errorMessage: \")\n .append(errorMessage)\n .append(\"}\")\n .toString()");
return str;
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel out, int i) {
Intrinsics.checkNotNullParameter(out, "out");
out.writeInt(this.requestStatusCode);
out.writeInt(this.errorCode);
out.writeInt(this.subErrorCode);
out.writeString(this.errorType);
out.writeString(getErrorMessage());
out.writeString(this.errorUserTitle);
out.writeString(this.errorUserMessage);
}
private FacebookRequestError(Parcel parcel) {
this(parcel.readInt(), parcel.readInt(), parcel.readInt(), parcel.readString(), parcel.readString(), parcel.readString(), parcel.readString(), null, null, null, null, null, false);
}
public enum Category {
LOGIN_RECOVERABLE,
OTHER,
TRANSIENT;
/* renamed from: values, reason: to resolve conflict with enum method */
public static Category[] valuesCustom() {
Category[] valuesCustom = values();
return (Category[]) Arrays.copyOf(valuesCustom, valuesCustom.length);
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final Range getHTTP_RANGE_SUCCESS$facebook_core_release() {
return FacebookRequestError.HTTP_RANGE_SUCCESS;
}
/* JADX WARN: Removed duplicated region for block: B:30:0x00d0 A[Catch: JSONException -> 0x012e, TryCatch #0 {JSONException -> 0x012e, blocks: (B:3:0x0012, B:5:0x0018, B:7:0x0022, B:9:0x0026, B:12:0x0034, B:30:0x00d0, B:33:0x0077, B:34:0x006e, B:35:0x0064, B:36:0x005c, B:37:0x0055, B:38:0x004b, B:39:0x0041, B:40:0x0084, B:43:0x0091, B:45:0x009a, B:49:0x00ab, B:50:0x00f1, B:52:0x00fb, B:54:0x0109, B:55:0x0112), top: B:2:0x0012 }] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final com.facebook.FacebookRequestError checkResponseAndCreateError(org.json.JSONObject r20, java.lang.Object r21, java.net.HttpURLConnection r22) {
/*
Method dump skipped, instructions count: 303
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.FacebookRequestError.Companion.checkResponseAndCreateError(org.json.JSONObject, java.lang.Object, java.net.HttpURLConnection):com.facebook.FacebookRequestError");
}
public final synchronized FacebookRequestErrorClassification getErrorClassification() {
FetchedAppSettingsManager fetchedAppSettingsManager = FetchedAppSettingsManager.INSTANCE;
FetchedAppSettings appSettingsWithoutQuery = FetchedAppSettingsManager.getAppSettingsWithoutQuery(FacebookSdk.getApplicationId());
if (appSettingsWithoutQuery == null) {
return FacebookRequestErrorClassification.Companion.getDefaultErrorClassification();
}
return appSettingsWithoutQuery.getErrorClassification();
}
}
}

View File

@@ -0,0 +1,913 @@
package com.facebook;
import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.os.AsyncTask;
import android.support.v4.media.session.PlaybackStateCompat;
import android.util.Base64;
import android.util.Log;
import androidx.annotation.RestrictTo;
import androidx.annotation.VisibleForTesting;
import com.facebook.FacebookSdk;
import com.facebook.GraphRequest;
import com.facebook.Profile;
import com.facebook.appevents.AppEventsLogger;
import com.facebook.appevents.AppEventsLoggerImpl;
import com.facebook.appevents.AppEventsManager;
import com.facebook.appevents.internal.ActivityLifecycleTracker;
import com.facebook.appevents.internal.AppEventsLoggerUtility;
import com.facebook.appevents.ondeviceprocessing.OnDeviceProcessingManager;
import com.facebook.internal.AttributionIdentifiers;
import com.facebook.internal.BoltsMeasurementEventListener;
import com.facebook.internal.FeatureManager;
import com.facebook.internal.FetchedAppGateKeepersManager;
import com.facebook.internal.FetchedAppSettingsManager;
import com.facebook.internal.LockOnGetVariable;
import com.facebook.internal.Logger;
import com.facebook.internal.NativeProtocol;
import com.facebook.internal.ServerProtocol;
import com.facebook.internal.Utility;
import com.facebook.internal.Validate;
import com.facebook.internal.instrument.InstrumentManager;
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
import com.unity3d.ads.core.data.datasource.AndroidStaticDeviceInfoDataSource;
import java.io.File;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.Executor;
import java.util.concurrent.FutureTask;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.ReentrantLock;
import kotlin.Unit;
import kotlin.collections.ArraysKt___ArraysKt;
import kotlin.collections.SetsKt__SetsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.StringCompanionObject;
import kotlin.text.StringsKt__StringsJVMKt;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class FacebookSdk {
public static final String ADVERTISER_ID_COLLECTION_ENABLED_PROPERTY = "com.facebook.sdk.AdvertiserIDCollectionEnabled";
public static final String APPLICATION_ID_PROPERTY = "com.facebook.sdk.ApplicationId";
public static final String APPLICATION_NAME_PROPERTY = "com.facebook.sdk.ApplicationName";
public static final String APP_EVENT_PREFERENCES = "com.facebook.sdk.appEventPreferences";
private static final String ATTRIBUTION_PREFERENCES = "com.facebook.sdk.attributionTracking";
public static final String AUTO_INIT_ENABLED_PROPERTY = "com.facebook.sdk.AutoInitEnabled";
public static final String AUTO_LOG_APP_EVENTS_ENABLED_PROPERTY = "com.facebook.sdk.AutoLogAppEventsEnabled";
public static final String CALLBACK_OFFSET_CHANGED_AFTER_INIT = "The callback request code offset can't be updated once the SDK is initialized. Call FacebookSdk.setCallbackRequestCodeOffset inside your Application.onCreate method";
public static final String CALLBACK_OFFSET_NEGATIVE = "The callback request code offset can't be negative.";
public static final String CALLBACK_OFFSET_PROPERTY = "com.facebook.sdk.CallbackOffset";
public static final String CLIENT_TOKEN_PROPERTY = "com.facebook.sdk.ClientToken";
public static final String CLOUDBRIDGE_SAVED_CREDENTIALS = "com.facebook.sdk.CloudBridgeSavedCredentials";
public static final String CODELESS_DEBUG_LOG_ENABLED_PROPERTY = "com.facebook.sdk.CodelessDebugLogEnabled";
public static final String DATA_PROCESSING_OPTIONS_PREFERENCES = "com.facebook.sdk.DataProcessingOptions";
public static final String DATA_PROCESSION_OPTIONS = "data_processing_options";
public static final String DATA_PROCESSION_OPTIONS_COUNTRY = "data_processing_options_country";
public static final String DATA_PROCESSION_OPTIONS_STATE = "data_processing_options_state";
private static final int DEFAULT_CALLBACK_REQUEST_CODE_OFFSET = 64206;
public static final String FACEBOOK_COM = "facebook.com";
public static final String FB_GG = "fb.gg";
public static final String GAMING = "gaming";
public static final String INSTAGRAM = "instagram";
public static final String INSTAGRAM_COM = "instagram.com";
private static final ReentrantLock LOCK;
private static final int MAX_REQUEST_CODE_RANGE = 100;
public static final String MONITOR_ENABLED_PROPERTY = "com.facebook.sdk.MonitorEnabled";
private static final String PUBLISH_ACTIVITY_PATH = "%s/activities";
public static final String WEB_DIALOG_THEME = "com.facebook.sdk.WebDialogTheme";
private static volatile String appClientToken;
private static Context applicationContext;
private static volatile String applicationId;
private static volatile String applicationName;
public static boolean bypassAppSwitch;
private static LockOnGetVariable<File> cacheDir;
private static int callbackRequestCodeOffset;
private static volatile Boolean codelessDebugLogEnabled;
private static Executor executor;
private static volatile String facebookDomain;
private static String graphApiVersion;
private static GraphRequestCreator graphRequestCreator;
public static boolean hasCustomTabsPrefetching;
public static boolean ignoreAppSwitchToLoggedOut;
private static volatile String instagramDomain;
private static volatile boolean isDebugEnabledField;
private static boolean isFullyInitialized;
private static boolean isLegacyTokenUpgradeSupported;
private static final HashSet<LoggingBehavior> loggingBehaviors;
private static AtomicLong onProgressThreshold;
private static final AtomicBoolean sdkInitialized;
public static final FacebookSdk INSTANCE = new FacebookSdk();
private static final String TAG = FacebookSdk.class.getCanonicalName();
@VisibleForTesting
public interface GraphRequestCreator {
GraphRequest createPostRequest(AccessToken accessToken, String str, JSONObject jSONObject, GraphRequest.Callback callback);
}
public interface InitializeCallback {
void onInitialized();
}
public static final void fullyInitialize() {
isFullyInitialized = true;
}
public static final String getFacebookDomain() {
return facebookDomain;
}
public static final String getFacebookGamingDomain() {
return "fb.gg";
}
public static final String getInstagramDomain() {
return instagramDomain;
}
public static final String getSdkVersion() {
return FacebookSdkVersion.BUILD;
}
public static final boolean isDebugEnabled() {
return isDebugEnabledField;
}
public static final boolean isFacebookRequestCode(int i) {
int i2 = callbackRequestCodeOffset;
return i >= i2 && i < i2 + 100;
}
public static final boolean isLegacyTokenUpgradeSupported() {
return isLegacyTokenUpgradeSupported;
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: sdkInitialize$lambda-6, reason: not valid java name */
public static final void m430sdkInitialize$lambda6(boolean z) {
if (z) {
hasCustomTabsPrefetching = true;
}
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: sdkInitialize$lambda-7, reason: not valid java name */
public static final void m431sdkInitialize$lambda7(boolean z) {
if (z) {
ignoreAppSwitchToLoggedOut = true;
}
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: sdkInitialize$lambda-8, reason: not valid java name */
public static final void m432sdkInitialize$lambda8(boolean z) {
if (z) {
bypassAppSwitch = true;
}
}
public static final void setApplicationName(String str) {
applicationName = str;
}
public static final void setClientToken(String str) {
appClientToken = str;
}
@VisibleForTesting
public static final void setGraphRequestCreator$facebook_core_release(GraphRequestCreator graphRequestCreator2) {
Intrinsics.checkNotNullParameter(graphRequestCreator2, "graphRequestCreator");
graphRequestCreator = graphRequestCreator2;
}
public static final void setIsDebugEnabled(boolean z) {
isDebugEnabledField = z;
}
public static final void setLegacyTokenUpgradeSupported(boolean z) {
isLegacyTokenUpgradeSupported = z;
}
private FacebookSdk() {
}
static {
HashSet<LoggingBehavior> hashSetOf;
hashSetOf = SetsKt__SetsKt.hashSetOf(LoggingBehavior.DEVELOPER_ERRORS);
loggingBehaviors = hashSetOf;
onProgressThreshold = new AtomicLong(PlaybackStateCompat.ACTION_PREPARE_FROM_SEARCH);
callbackRequestCodeOffset = DEFAULT_CALLBACK_REQUEST_CODE_OFFSET;
LOCK = new ReentrantLock();
graphApiVersion = ServerProtocol.getDefaultAPIVersion();
sdkInitialized = new AtomicBoolean(false);
instagramDomain = INSTAGRAM_COM;
facebookDomain = FACEBOOK_COM;
graphRequestCreator = new GraphRequestCreator() { // from class: com.facebook.FacebookSdk$$ExternalSyntheticLambda8
@Override // com.facebook.FacebookSdk.GraphRequestCreator
public final GraphRequest createPostRequest(AccessToken accessToken, String str, JSONObject jSONObject, GraphRequest.Callback callback) {
GraphRequest m425graphRequestCreator$lambda0;
m425graphRequestCreator$lambda0 = FacebookSdk.m425graphRequestCreator$lambda0(accessToken, str, jSONObject, callback);
return m425graphRequestCreator$lambda0;
}
};
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: graphRequestCreator$lambda-0, reason: not valid java name */
public static final GraphRequest m425graphRequestCreator$lambda0(AccessToken accessToken, String str, JSONObject jSONObject, GraphRequest.Callback callback) {
return GraphRequest.Companion.newPostRequest(accessToken, str, jSONObject, callback);
}
public static final Executor getExecutor() {
ReentrantLock reentrantLock = LOCK;
reentrantLock.lock();
try {
if (executor == null) {
executor = AsyncTask.THREAD_POOL_EXECUTOR;
}
Unit unit = Unit.INSTANCE;
reentrantLock.unlock();
Executor executor2 = executor;
if (executor2 != null) {
return executor2;
}
throw new IllegalStateException("Required value was null.".toString());
} catch (Throwable th) {
reentrantLock.unlock();
throw th;
}
}
public static final void setExecutor(Executor executor2) {
Intrinsics.checkNotNullParameter(executor2, "executor");
ReentrantLock reentrantLock = LOCK;
reentrantLock.lock();
try {
executor = executor2;
Unit unit = Unit.INSTANCE;
} finally {
reentrantLock.unlock();
}
}
public static final long getOnProgressThreshold() {
Validate.sdkInitialized();
return onProgressThreshold.get();
}
public static final void setOnProgressThreshold(long j) {
onProgressThreshold.set(j);
}
public static final String getGraphApiVersion() {
Utility utility = Utility.INSTANCE;
String str = TAG;
StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
String format = String.format("getGraphApiVersion: %s", Arrays.copyOf(new Object[]{graphApiVersion}, 1));
Intrinsics.checkNotNullExpressionValue(format, "java.lang.String.format(format, *args)");
Utility.logd(str, format);
return graphApiVersion;
}
public static final void setGraphApiVersion(String graphApiVersion2) {
Intrinsics.checkNotNullParameter(graphApiVersion2, "graphApiVersion");
Log.w(TAG, "WARNING: Calling setGraphApiVersion from non-DEBUG code.");
if (Utility.isNullOrEmpty(graphApiVersion2) || Intrinsics.areEqual(graphApiVersion, graphApiVersion2)) {
return;
}
graphApiVersion = graphApiVersion2;
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public static final synchronized boolean isFullyInitialized() {
boolean z;
synchronized (FacebookSdk.class) {
z = isFullyInitialized;
}
return z;
}
public static final void setFacebookDomain(String facebookDomain2) {
Intrinsics.checkNotNullParameter(facebookDomain2, "facebookDomain");
Log.w(TAG, "WARNING: Calling setFacebookDomain from non-DEBUG code.");
facebookDomain = facebookDomain2;
}
public static final synchronized void sdkInitialize(Context applicationContext2, int i) {
synchronized (FacebookSdk.class) {
Intrinsics.checkNotNullParameter(applicationContext2, "applicationContext");
sdkInitialize(applicationContext2, i, null);
}
}
/* JADX WARN: Code restructure failed: missing block: B:13:0x0021, code lost:
com.facebook.FacebookSdk.callbackRequestCodeOffset = r3;
sdkInitialize(r2, r4);
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static final synchronized void sdkInitialize(android.content.Context r2, int r3, com.facebook.FacebookSdk.InitializeCallback r4) {
/*
java.lang.Class<com.facebook.FacebookSdk> r0 = com.facebook.FacebookSdk.class
monitor-enter(r0)
java.lang.String r1 = "applicationContext"
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r2, r1) // Catch: java.lang.Throwable -> L1d
java.util.concurrent.atomic.AtomicBoolean r1 = com.facebook.FacebookSdk.sdkInitialized // Catch: java.lang.Throwable -> L1d
boolean r1 = r1.get() // Catch: java.lang.Throwable -> L1d
if (r1 == 0) goto L1f
int r1 = com.facebook.FacebookSdk.callbackRequestCodeOffset // Catch: java.lang.Throwable -> L1d
if (r3 != r1) goto L15
goto L1f
L15:
com.facebook.FacebookException r2 = new com.facebook.FacebookException // Catch: java.lang.Throwable -> L1d
java.lang.String r3 = "The callback request code offset can't be updated once the SDK is initialized. Call FacebookSdk.setCallbackRequestCodeOffset inside your Application.onCreate method"
r2.<init>(r3) // Catch: java.lang.Throwable -> L1d
throw r2 // Catch: java.lang.Throwable -> L1d
L1d:
r2 = move-exception
goto L30
L1f:
if (r3 < 0) goto L28
com.facebook.FacebookSdk.callbackRequestCodeOffset = r3 // Catch: java.lang.Throwable -> L1d
sdkInitialize(r2, r4) // Catch: java.lang.Throwable -> L1d
monitor-exit(r0)
return
L28:
com.facebook.FacebookException r2 = new com.facebook.FacebookException // Catch: java.lang.Throwable -> L1d
java.lang.String r3 = "The callback request code offset can't be negative."
r2.<init>(r3) // Catch: java.lang.Throwable -> L1d
throw r2 // Catch: java.lang.Throwable -> L1d
L30:
monitor-exit(r0)
throw r2
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.FacebookSdk.sdkInitialize(android.content.Context, int, com.facebook.FacebookSdk$InitializeCallback):void");
}
public static final synchronized void sdkInitialize(Context applicationContext2) {
synchronized (FacebookSdk.class) {
Intrinsics.checkNotNullParameter(applicationContext2, "applicationContext");
sdkInitialize(applicationContext2, (InitializeCallback) null);
}
}
public static final synchronized void sdkInitialize(Context applicationContext2, final InitializeCallback initializeCallback) {
synchronized (FacebookSdk.class) {
Intrinsics.checkNotNullParameter(applicationContext2, "applicationContext");
AtomicBoolean atomicBoolean = sdkInitialized;
if (atomicBoolean.get()) {
if (initializeCallback != null) {
initializeCallback.onInitialized();
}
return;
}
Validate.hasFacebookActivity(applicationContext2, false);
Validate.hasInternetPermissions(applicationContext2, false);
Context applicationContext3 = applicationContext2.getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext3, "applicationContext.applicationContext");
applicationContext = applicationContext3;
AppEventsLogger.Companion.getAnonymousAppDeviceGUID(applicationContext2);
Context context = applicationContext;
if (context != null) {
loadDefaultsFromMetadata$facebook_core_release(context);
String str = applicationId;
if (str == null || str.length() == 0) {
throw new FacebookException("A valid Facebook app id must be set in the AndroidManifest.xml or set by calling FacebookSdk.setApplicationId before initializing the sdk.");
}
String str2 = appClientToken;
if (str2 == null || str2.length() == 0) {
throw new FacebookException("A valid Facebook app client token must be set in the AndroidManifest.xml or set by calling FacebookSdk.setClientToken before initializing the sdk.");
}
atomicBoolean.set(true);
if (getAutoInitEnabled()) {
fullyInitialize();
}
Context context2 = applicationContext;
if (context2 != null) {
if ((context2 instanceof Application) && UserSettingsManager.getAutoLogAppEventsEnabled()) {
ActivityLifecycleTracker activityLifecycleTracker = ActivityLifecycleTracker.INSTANCE;
Context context3 = applicationContext;
if (context3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("applicationContext");
throw null;
}
ActivityLifecycleTracker.startTracking((Application) context3, applicationId);
}
FetchedAppSettingsManager.loadAppSettingsAsync();
NativeProtocol.updateAllAvailableProtocolVersionsAsync();
BoltsMeasurementEventListener.Companion companion = BoltsMeasurementEventListener.Companion;
Context context4 = applicationContext;
if (context4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("applicationContext");
throw null;
}
companion.getInstance(context4);
cacheDir = new LockOnGetVariable<>(new Callable() { // from class: com.facebook.FacebookSdk$$ExternalSyntheticLambda1
@Override // java.util.concurrent.Callable
public final Object call() {
File m427sdkInitialize$lambda3;
m427sdkInitialize$lambda3 = FacebookSdk.m427sdkInitialize$lambda3();
return m427sdkInitialize$lambda3;
}
});
FeatureManager featureManager = FeatureManager.INSTANCE;
FeatureManager.checkFeature(FeatureManager.Feature.Instrument, new FeatureManager.Callback() { // from class: com.facebook.FacebookSdk$$ExternalSyntheticLambda2
@Override // com.facebook.internal.FeatureManager.Callback
public final void onCompleted(boolean z) {
FacebookSdk.m428sdkInitialize$lambda4(z);
}
});
FeatureManager.checkFeature(FeatureManager.Feature.AppEvents, new FeatureManager.Callback() { // from class: com.facebook.FacebookSdk$$ExternalSyntheticLambda3
@Override // com.facebook.internal.FeatureManager.Callback
public final void onCompleted(boolean z) {
FacebookSdk.m429sdkInitialize$lambda5(z);
}
});
FeatureManager.checkFeature(FeatureManager.Feature.ChromeCustomTabsPrefetching, new FeatureManager.Callback() { // from class: com.facebook.FacebookSdk$$ExternalSyntheticLambda4
@Override // com.facebook.internal.FeatureManager.Callback
public final void onCompleted(boolean z) {
FacebookSdk.m430sdkInitialize$lambda6(z);
}
});
FeatureManager.checkFeature(FeatureManager.Feature.IgnoreAppSwitchToLoggedOut, new FeatureManager.Callback() { // from class: com.facebook.FacebookSdk$$ExternalSyntheticLambda5
@Override // com.facebook.internal.FeatureManager.Callback
public final void onCompleted(boolean z) {
FacebookSdk.m431sdkInitialize$lambda7(z);
}
});
FeatureManager.checkFeature(FeatureManager.Feature.BypassAppSwitch, new FeatureManager.Callback() { // from class: com.facebook.FacebookSdk$$ExternalSyntheticLambda6
@Override // com.facebook.internal.FeatureManager.Callback
public final void onCompleted(boolean z) {
FacebookSdk.m432sdkInitialize$lambda8(z);
}
});
getExecutor().execute(new FutureTask(new Callable() { // from class: com.facebook.FacebookSdk$$ExternalSyntheticLambda7
@Override // java.util.concurrent.Callable
public final Object call() {
Void m433sdkInitialize$lambda9;
m433sdkInitialize$lambda9 = FacebookSdk.m433sdkInitialize$lambda9(FacebookSdk.InitializeCallback.this);
return m433sdkInitialize$lambda9;
}
}));
return;
}
Intrinsics.throwUninitializedPropertyAccessException("applicationContext");
throw null;
}
Intrinsics.throwUninitializedPropertyAccessException("applicationContext");
throw null;
}
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: sdkInitialize$lambda-3, reason: not valid java name */
public static final File m427sdkInitialize$lambda3() {
Context context = applicationContext;
if (context != null) {
return context.getCacheDir();
}
Intrinsics.throwUninitializedPropertyAccessException("applicationContext");
throw null;
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: sdkInitialize$lambda-4, reason: not valid java name */
public static final void m428sdkInitialize$lambda4(boolean z) {
if (z) {
InstrumentManager.start();
}
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: sdkInitialize$lambda-5, reason: not valid java name */
public static final void m429sdkInitialize$lambda5(boolean z) {
if (z) {
AppEventsManager.start();
}
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: sdkInitialize$lambda-9, reason: not valid java name */
public static final Void m433sdkInitialize$lambda9(InitializeCallback initializeCallback) {
AccessTokenManager.Companion.getInstance().loadCurrentAccessToken();
ProfileManager.Companion.getInstance().loadCurrentProfile();
if (AccessToken.Companion.isCurrentAccessTokenActive()) {
Profile.Companion companion = Profile.Companion;
if (companion.getCurrentProfile() == null) {
companion.fetchProfileForCurrentAccessToken();
}
}
if (initializeCallback != null) {
initializeCallback.onInitialized();
}
AppEventsLogger.Companion companion2 = AppEventsLogger.Companion;
companion2.initializeLib(getApplicationContext(), applicationId);
UserSettingsManager.logIfAutoAppLinkEnabled();
Context applicationContext2 = getApplicationContext().getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext2, "getApplicationContext().applicationContext");
companion2.newLogger(applicationContext2).flush();
return null;
}
public static final boolean isInitialized() {
return sdkInitialized.get();
}
public static final Set<LoggingBehavior> getLoggingBehaviors() {
Set<LoggingBehavior> unmodifiableSet;
HashSet<LoggingBehavior> hashSet = loggingBehaviors;
synchronized (hashSet) {
unmodifiableSet = Collections.unmodifiableSet(new HashSet(hashSet));
Intrinsics.checkNotNullExpressionValue(unmodifiableSet, "unmodifiableSet(HashSet(loggingBehaviors))");
}
return unmodifiableSet;
}
public static final void addLoggingBehavior(LoggingBehavior behavior) {
Intrinsics.checkNotNullParameter(behavior, "behavior");
HashSet<LoggingBehavior> hashSet = loggingBehaviors;
synchronized (hashSet) {
hashSet.add(behavior);
INSTANCE.updateGraphDebugBehavior();
Unit unit = Unit.INSTANCE;
}
}
public static final void removeLoggingBehavior(LoggingBehavior behavior) {
Intrinsics.checkNotNullParameter(behavior, "behavior");
HashSet<LoggingBehavior> hashSet = loggingBehaviors;
synchronized (hashSet) {
hashSet.remove(behavior);
}
}
public static final void clearLoggingBehaviors() {
HashSet<LoggingBehavior> hashSet = loggingBehaviors;
synchronized (hashSet) {
hashSet.clear();
Unit unit = Unit.INSTANCE;
}
}
public static final boolean isLoggingBehaviorEnabled(LoggingBehavior behavior) {
boolean z;
Intrinsics.checkNotNullParameter(behavior, "behavior");
HashSet<LoggingBehavior> hashSet = loggingBehaviors;
synchronized (hashSet) {
if (isDebugEnabled()) {
z = hashSet.contains(behavior);
}
}
return z;
}
private final void updateGraphDebugBehavior() {
HashSet<LoggingBehavior> hashSet = loggingBehaviors;
if (hashSet.contains(LoggingBehavior.GRAPH_API_DEBUG_INFO)) {
LoggingBehavior loggingBehavior = LoggingBehavior.GRAPH_API_DEBUG_WARNING;
if (hashSet.contains(loggingBehavior)) {
return;
}
hashSet.add(loggingBehavior);
}
}
public static final String getGraphDomain() {
AccessToken currentAccessToken = AccessToken.Companion.getCurrentAccessToken();
return Utility.getGraphDomainFromTokenDomain(currentAccessToken != null ? currentAccessToken.getGraphDomain() : null);
}
public static final Context getApplicationContext() {
Validate.sdkInitialized();
Context context = applicationContext;
if (context != null) {
return context;
}
Intrinsics.throwUninitializedPropertyAccessException("applicationContext");
throw null;
}
@VisibleForTesting(otherwise = 3)
public static final void publishInstallAsync(Context context, final String applicationId2) {
if (CrashShieldHandler.isObjectCrashing(FacebookSdk.class)) {
return;
}
try {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(applicationId2, "applicationId");
final Context applicationContext2 = context.getApplicationContext();
if (applicationContext2 == null) {
return;
}
FetchedAppGateKeepersManager fetchedAppGateKeepersManager = FetchedAppGateKeepersManager.INSTANCE;
if (!FetchedAppGateKeepersManager.getGateKeeperForKey(AppEventsLoggerImpl.APP_EVENTS_KILLSWITCH, getApplicationId(), false)) {
getExecutor().execute(new Runnable() { // from class: com.facebook.FacebookSdk$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
FacebookSdk.m426publishInstallAsync$lambda15(applicationContext2, applicationId2);
}
});
}
FeatureManager featureManager = FeatureManager.INSTANCE;
if (FeatureManager.isEnabled(FeatureManager.Feature.OnDeviceEventProcessing) && OnDeviceProcessingManager.isOnDeviceProcessingEnabled()) {
OnDeviceProcessingManager.sendInstallEventAsync(applicationId2, ATTRIBUTION_PREFERENCES);
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, FacebookSdk.class);
}
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: publishInstallAsync$lambda-15, reason: not valid java name */
public static final void m426publishInstallAsync$lambda15(Context applicationContext2, String applicationId2) {
Intrinsics.checkNotNullParameter(applicationContext2, "$applicationContext");
Intrinsics.checkNotNullParameter(applicationId2, "$applicationId");
INSTANCE.publishInstallAndWaitForResponse(applicationContext2, applicationId2);
}
private final void publishInstallAndWaitForResponse(Context context, String str) {
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
AttributionIdentifiers attributionIdentifiers = AttributionIdentifiers.Companion.getAttributionIdentifiers(context);
SharedPreferences sharedPreferences = context.getSharedPreferences(ATTRIBUTION_PREFERENCES, 0);
String stringPlus = Intrinsics.stringPlus(str, "ping");
long j = sharedPreferences.getLong(stringPlus, 0L);
try {
AppEventsLoggerUtility appEventsLoggerUtility = AppEventsLoggerUtility.INSTANCE;
JSONObject jSONObjectForGraphAPICall = AppEventsLoggerUtility.getJSONObjectForGraphAPICall(AppEventsLoggerUtility.GraphAPIActivityType.MOBILE_INSTALL_EVENT, attributionIdentifiers, AppEventsLogger.Companion.getAnonymousAppDeviceGUID(context), getLimitEventAndDataUsage(context), context);
StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
String format = String.format(PUBLISH_ACTIVITY_PATH, Arrays.copyOf(new Object[]{str}, 1));
Intrinsics.checkNotNullExpressionValue(format, "java.lang.String.format(format, *args)");
GraphRequest createPostRequest = graphRequestCreator.createPostRequest(null, format, jSONObjectForGraphAPICall, null);
if (j == 0 && createPostRequest.executeAndWait().getError() == null) {
SharedPreferences.Editor edit = sharedPreferences.edit();
edit.putLong(stringPlus, System.currentTimeMillis());
edit.apply();
Logger.Companion companion = Logger.Companion;
LoggingBehavior loggingBehavior = LoggingBehavior.APP_EVENTS;
String TAG2 = TAG;
Intrinsics.checkNotNullExpressionValue(TAG2, "TAG");
companion.log(loggingBehavior, TAG2, "MOBILE_APP_INSTALL has been logged");
}
} catch (JSONException e) {
throw new FacebookException("An error occurred while publishing install.", e);
}
} catch (Exception e2) {
Utility.logd("Facebook-publish", e2);
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
public static final boolean getLimitEventAndDataUsage(Context context) {
Intrinsics.checkNotNullParameter(context, "context");
Validate.sdkInitialized();
return context.getSharedPreferences(APP_EVENT_PREFERENCES, 0).getBoolean("limitEventUsage", false);
}
public static final void setLimitEventAndDataUsage(Context context, boolean z) {
Intrinsics.checkNotNullParameter(context, "context");
context.getSharedPreferences(APP_EVENT_PREFERENCES, 0).edit().putBoolean("limitEventUsage", z).apply();
}
public static final void loadDefaultsFromMetadata$facebook_core_release(Context context) {
if (context == null) {
return;
}
try {
ApplicationInfo applicationInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(), 128);
Intrinsics.checkNotNullExpressionValue(applicationInfo, "try {\n context.packageManager.getApplicationInfo(\n context.packageName, PackageManager.GET_META_DATA)\n } catch (e: PackageManager.NameNotFoundException) {\n return\n }");
if (applicationInfo.metaData == null) {
return;
}
if (applicationId == null) {
Object obj = applicationInfo.metaData.get(APPLICATION_ID_PROPERTY);
if (obj instanceof String) {
String str = (String) obj;
Locale ROOT = Locale.ROOT;
Intrinsics.checkNotNullExpressionValue(ROOT, "ROOT");
String lowerCase = str.toLowerCase(ROOT);
Intrinsics.checkNotNullExpressionValue(lowerCase, "(this as java.lang.String).toLowerCase(locale)");
if (StringsKt__StringsJVMKt.startsWith$default(lowerCase, "fb", false, 2, null)) {
String substring = str.substring(2);
Intrinsics.checkNotNullExpressionValue(substring, "(this as java.lang.String).substring(startIndex)");
applicationId = substring;
} else {
applicationId = str;
}
} else if (obj instanceof Number) {
throw new FacebookException("App Ids cannot be directly placed in the manifest.They must be prefixed by 'fb' or be placed in the string resource file.");
}
}
if (applicationName == null) {
applicationName = applicationInfo.metaData.getString(APPLICATION_NAME_PROPERTY);
}
if (appClientToken == null) {
appClientToken = applicationInfo.metaData.getString(CLIENT_TOKEN_PROPERTY);
}
if (callbackRequestCodeOffset == DEFAULT_CALLBACK_REQUEST_CODE_OFFSET) {
callbackRequestCodeOffset = applicationInfo.metaData.getInt(CALLBACK_OFFSET_PROPERTY, DEFAULT_CALLBACK_REQUEST_CODE_OFFSET);
}
if (codelessDebugLogEnabled == null) {
codelessDebugLogEnabled = Boolean.valueOf(applicationInfo.metaData.getBoolean(CODELESS_DEBUG_LOG_ENABLED_PROPERTY, false));
}
} catch (PackageManager.NameNotFoundException unused) {
}
}
public static final String getApplicationSignature(Context context) {
PackageManager packageManager;
if (CrashShieldHandler.isObjectCrashing(FacebookSdk.class)) {
return null;
}
try {
Validate.sdkInitialized();
if (context == null || (packageManager = context.getPackageManager()) == null) {
return null;
}
try {
PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), 64);
Signature[] signatureArr = packageInfo.signatures;
if (signatureArr != null && signatureArr.length != 0) {
MessageDigest messageDigest = MessageDigest.getInstance(AndroidStaticDeviceInfoDataSource.ALGORITHM_SHA1);
messageDigest.update(packageInfo.signatures[0].toByteArray());
return Base64.encodeToString(messageDigest.digest(), 9);
}
} catch (PackageManager.NameNotFoundException | NoSuchAlgorithmException unused) {
}
return null;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, FacebookSdk.class);
return null;
}
}
public static final String getApplicationId() {
Validate.sdkInitialized();
String str = applicationId;
if (str != null) {
return str;
}
throw new FacebookException("A valid Facebook app id must be set in the AndroidManifest.xml or set by calling FacebookSdk.setApplicationId before initializing the sdk.");
}
public static final void setApplicationId(String applicationId2) {
Intrinsics.checkNotNullParameter(applicationId2, "applicationId");
Validate.notEmpty(applicationId2, "applicationId");
applicationId = applicationId2;
}
public static final String getApplicationName() {
Validate.sdkInitialized();
return applicationName;
}
public static final String getClientToken() {
Validate.sdkInitialized();
String str = appClientToken;
if (str != null) {
return str;
}
throw new FacebookException("A valid Facebook client token must be set in the AndroidManifest.xml or set by calling FacebookSdk.setClientToken before initializing the sdk. Visit https://developers.facebook.com/docs/android/getting-started#add-app_id for more information.");
}
public static final boolean getAutoInitEnabled() {
return UserSettingsManager.getAutoInitEnabled();
}
public static final void setAutoInitEnabled(boolean z) {
UserSettingsManager.setAutoInitEnabled(z);
if (z) {
fullyInitialize();
}
}
public static final boolean getAutoLogAppEventsEnabled() {
return UserSettingsManager.getAutoLogAppEventsEnabled();
}
public static final void setAutoLogAppEventsEnabled(boolean z) {
UserSettingsManager.setAutoLogAppEventsEnabled(z);
if (z) {
Application application = (Application) getApplicationContext();
ActivityLifecycleTracker activityLifecycleTracker = ActivityLifecycleTracker.INSTANCE;
ActivityLifecycleTracker.startTracking(application, getApplicationId());
}
}
public static final boolean getCodelessDebugLogEnabled() {
Validate.sdkInitialized();
Boolean bool = codelessDebugLogEnabled;
if (bool == null) {
return false;
}
return bool.booleanValue();
}
public static final boolean getCodelessSetupEnabled() {
return UserSettingsManager.getCodelessSetupEnabled();
}
public static final boolean getAdvertiserIDCollectionEnabled() {
return UserSettingsManager.getAdvertiserIDCollectionEnabled();
}
public static final void setAdvertiserIDCollectionEnabled(boolean z) {
UserSettingsManager.setAdvertiserIDCollectionEnabled(z);
}
public static final void setCodelessDebugLogEnabled(boolean z) {
codelessDebugLogEnabled = Boolean.valueOf(z);
}
public static final boolean getMonitorEnabled() {
return UserSettingsManager.getMonitorEnabled();
}
public static final void setMonitorEnabled(boolean z) {
UserSettingsManager.setMonitorEnabled(z);
}
public static final void setDataProcessingOptions(String[] strArr) {
if (CrashShieldHandler.isObjectCrashing(FacebookSdk.class)) {
return;
}
try {
setDataProcessingOptions(strArr, 0, 0);
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, FacebookSdk.class);
}
}
public static final void setDataProcessingOptions(String[] strArr, int i, int i2) {
List list;
if (CrashShieldHandler.isObjectCrashing(FacebookSdk.class)) {
return;
}
if (strArr == null) {
try {
strArr = new String[0];
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, FacebookSdk.class);
return;
}
}
try {
JSONObject jSONObject = new JSONObject();
list = ArraysKt___ArraysKt.toList(strArr);
jSONObject.put(DATA_PROCESSION_OPTIONS, new JSONArray((Collection) list));
jSONObject.put(DATA_PROCESSION_OPTIONS_COUNTRY, i);
jSONObject.put(DATA_PROCESSION_OPTIONS_STATE, i2);
Context context = applicationContext;
if (context == null) {
Intrinsics.throwUninitializedPropertyAccessException("applicationContext");
throw null;
}
context.getSharedPreferences(DATA_PROCESSING_OPTIONS_PREFERENCES, 0).edit().putString(DATA_PROCESSION_OPTIONS, jSONObject.toString()).apply();
} catch (JSONException unused) {
}
}
public static final File getCacheDir() {
Validate.sdkInitialized();
LockOnGetVariable<File> lockOnGetVariable = cacheDir;
if (lockOnGetVariable != null) {
return lockOnGetVariable.getValue();
}
Intrinsics.throwUninitializedPropertyAccessException("cacheDir");
throw null;
}
public static final void setCacheDir(File cacheDir2) {
Intrinsics.checkNotNullParameter(cacheDir2, "cacheDir");
cacheDir = new LockOnGetVariable<>(cacheDir2);
}
public static final int getCallbackRequestCodeOffset() {
Validate.sdkInitialized();
return callbackRequestCodeOffset;
}
}

View File

@@ -0,0 +1,33 @@
package com.facebook;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* loaded from: classes2.dex */
public final class FacebookSdkNotInitializedException extends FacebookException {
public static final Companion Companion = new Companion(null);
public static final long serialVersionUID = 1;
public FacebookSdkNotInitializedException() {
}
public FacebookSdkNotInitializedException(String str) {
super(str);
}
public FacebookSdkNotInitializedException(String str, Throwable th) {
super(str, th);
}
public FacebookSdkNotInitializedException(Throwable th) {
super(th);
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,10 @@
package com.facebook;
/* loaded from: classes2.dex */
public final class FacebookSdkVersion {
public static final String BUILD = "17.0.0";
public static final FacebookSdkVersion INSTANCE = new FacebookSdkVersion();
private FacebookSdkVersion() {
}
}

View File

@@ -0,0 +1,38 @@
package com.facebook;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class FacebookServiceException extends FacebookException {
public static final Companion Companion = new Companion(null);
private static final long serialVersionUID = 1;
private final FacebookRequestError requestError;
public final FacebookRequestError getRequestError() {
return this.requestError;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public FacebookServiceException(FacebookRequestError requestError, String str) {
super(str);
Intrinsics.checkNotNullParameter(requestError, "requestError");
this.requestError = requestError;
}
@Override // com.facebook.FacebookException, java.lang.Throwable
public String toString() {
String str = "{FacebookServiceException: httpResponseCode: " + this.requestError.getRequestStatusCode() + ", facebookErrorCode: " + this.requestError.getErrorCode() + ", facebookErrorType: " + this.requestError.getErrorType() + ", message: " + this.requestError.getErrorMessage() + "}";
Intrinsics.checkNotNullExpressionValue(str, "StringBuilder()\n .append(\"{FacebookServiceException: \")\n .append(\"httpResponseCode: \")\n .append(requestError.requestStatusCode)\n .append(\", facebookErrorCode: \")\n .append(requestError.errorCode)\n .append(\", facebookErrorType: \")\n .append(requestError.errorType)\n .append(\", message: \")\n .append(requestError.errorMessage)\n .append(\"}\")\n .toString()");
return str;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,262 @@
package com.facebook;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import androidx.annotation.VisibleForTesting;
import com.facebook.internal.Utility;
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
import java.net.HttpURLConnection;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.StringCompanionObject;
/* loaded from: classes2.dex */
public class GraphRequestAsyncTask extends AsyncTask<Void, Void, List<? extends GraphResponse>> {
public static final Companion Companion = new Companion(null);
private static final String TAG = GraphRequestAsyncTask.class.getCanonicalName();
private final HttpURLConnection connection;
private Exception exception;
private final GraphRequestBatch requests;
public final Exception getException() {
return this.exception;
}
public final GraphRequestBatch getRequests() {
return this.requests;
}
@Override // android.os.AsyncTask
public /* bridge */ /* synthetic */ List<? extends GraphResponse> doInBackground(Void[] voidArr) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
return doInBackground2(voidArr);
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
} catch (Throwable th2) {
CrashShieldHandler.handleThrowable(th2, this);
return null;
}
} catch (Throwable th3) {
CrashShieldHandler.handleThrowable(th3, this);
return null;
}
}
@Override // android.os.AsyncTask
public /* bridge */ /* synthetic */ void onPostExecute(List<? extends GraphResponse> list) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
onPostExecute2((List<GraphResponse>) list);
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
} catch (Throwable th2) {
CrashShieldHandler.handleThrowable(th2, this);
}
} catch (Throwable th3) {
CrashShieldHandler.handleThrowable(th3, this);
}
}
public GraphRequestAsyncTask(HttpURLConnection httpURLConnection, GraphRequestBatch requests) {
Intrinsics.checkNotNullParameter(requests, "requests");
this.connection = httpURLConnection;
this.requests = requests;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public GraphRequestAsyncTask(GraphRequest... requests) {
this((HttpURLConnection) null, new GraphRequestBatch((GraphRequest[]) Arrays.copyOf(requests, requests.length)));
Intrinsics.checkNotNullParameter(requests, "requests");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public GraphRequestAsyncTask(Collection<GraphRequest> requests) {
this((HttpURLConnection) null, new GraphRequestBatch(requests));
Intrinsics.checkNotNullParameter(requests, "requests");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public GraphRequestAsyncTask(GraphRequestBatch requests) {
this((HttpURLConnection) null, requests);
Intrinsics.checkNotNullParameter(requests, "requests");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public GraphRequestAsyncTask(HttpURLConnection httpURLConnection, GraphRequest... requests) {
this(httpURLConnection, new GraphRequestBatch((GraphRequest[]) Arrays.copyOf(requests, requests.length)));
Intrinsics.checkNotNullParameter(requests, "requests");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public GraphRequestAsyncTask(HttpURLConnection httpURLConnection, Collection<GraphRequest> requests) {
this(httpURLConnection, new GraphRequestBatch(requests));
Intrinsics.checkNotNullParameter(requests, "requests");
}
public String toString() {
String str = "{RequestAsyncTask: connection: " + this.connection + ", requests: " + this.requests + "}";
Intrinsics.checkNotNullExpressionValue(str, "StringBuilder()\n .append(\"{RequestAsyncTask: \")\n .append(\" connection: \")\n .append(connection)\n .append(\", requests: \")\n .append(requests)\n .append(\"}\")\n .toString()");
return str;
}
@Override // android.os.AsyncTask
@VisibleForTesting(otherwise = 4)
public void onPreExecute() {
Handler handler;
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
super.onPreExecute();
if (FacebookSdk.isDebugEnabled()) {
Utility utility = Utility.INSTANCE;
String str = TAG;
StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
String format = String.format("execute async task: %s", Arrays.copyOf(new Object[]{this}, 1));
Intrinsics.checkNotNullExpressionValue(format, "java.lang.String.format(format, *args)");
Utility.logd(str, format);
}
if (this.requests.getCallbackHandler() == null) {
if (Thread.currentThread() instanceof HandlerThread) {
handler = new Handler();
} else {
handler = new Handler(Looper.getMainLooper());
}
this.requests.setCallbackHandler(handler);
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
} catch (Throwable th2) {
CrashShieldHandler.handleThrowable(th2, this);
}
} catch (Throwable th3) {
CrashShieldHandler.handleThrowable(th3, this);
}
}
/* renamed from: onPostExecute, reason: avoid collision after fix types in other method */
public void onPostExecute2(List<GraphResponse> result) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
Intrinsics.checkNotNullParameter(result, "result");
super.onPostExecute((GraphRequestAsyncTask) result);
Exception exc = this.exception;
if (exc != null) {
Utility utility = Utility.INSTANCE;
String str = TAG;
StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
String format = String.format("onPostExecute: exception encountered during request: %s", Arrays.copyOf(new Object[]{exc.getMessage()}, 1));
Intrinsics.checkNotNullExpressionValue(format, "java.lang.String.format(format, *args)");
Utility.logd(str, format);
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
} catch (Throwable th2) {
CrashShieldHandler.handleThrowable(th2, this);
}
} catch (Throwable th3) {
CrashShieldHandler.handleThrowable(th3, this);
}
}
@VisibleForTesting(otherwise = 4)
/* renamed from: doInBackground, reason: avoid collision after fix types in other method */
public List<GraphResponse> doInBackground2(Void... params) {
List<GraphResponse> executeConnectionAndWait;
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
Intrinsics.checkNotNullParameter(params, "params");
try {
HttpURLConnection httpURLConnection = this.connection;
if (httpURLConnection == null) {
executeConnectionAndWait = this.requests.executeAndWait();
} else {
executeConnectionAndWait = GraphRequest.Companion.executeConnectionAndWait(httpURLConnection, this.requests);
}
return executeConnectionAndWait;
} catch (Exception e) {
this.exception = e;
return null;
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
} catch (Throwable th2) {
CrashShieldHandler.handleThrowable(th2, this);
return null;
}
} catch (Throwable th3) {
CrashShieldHandler.handleThrowable(th3, this);
return null;
}
}
}

View File

@@ -0,0 +1,234 @@
package com.facebook;
import android.os.Handler;
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import kotlin.collections.ArraysKt___ArraysJvmKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class GraphRequestBatch extends AbstractList<GraphRequest> {
public static final Companion Companion = new Companion(null);
private static final AtomicInteger idGenerator = new AtomicInteger();
private String batchApplicationId;
private Handler callbackHandler;
private List<Callback> callbacks;
private final String id;
private List<GraphRequest> requests;
private int timeoutInMilliseconds;
public interface Callback {
void onBatchCompleted(GraphRequestBatch graphRequestBatch);
}
public interface OnProgressCallback extends Callback {
void onBatchProgress(GraphRequestBatch graphRequestBatch, long j, long j2);
}
public final String getBatchApplicationId() {
return this.batchApplicationId;
}
public final Handler getCallbackHandler() {
return this.callbackHandler;
}
public final List<Callback> getCallbacks() {
return this.callbacks;
}
public final String getId() {
return this.id;
}
public final List<GraphRequest> getRequests() {
return this.requests;
}
public final int getTimeout() {
return this.timeoutInMilliseconds;
}
public final void setBatchApplicationId(String str) {
this.batchApplicationId = str;
}
public final void setCallbackHandler(Handler handler) {
this.callbackHandler = handler;
}
public /* bridge */ boolean contains(GraphRequest graphRequest) {
return super.contains((Object) graphRequest);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public final /* bridge */ boolean contains(Object obj) {
if (obj == null || (obj instanceof GraphRequest)) {
return contains((GraphRequest) obj);
}
return false;
}
public /* bridge */ int indexOf(GraphRequest graphRequest) {
return super.indexOf((Object) graphRequest);
}
@Override // java.util.AbstractList, java.util.List
public final /* bridge */ int indexOf(Object obj) {
if (obj == null || (obj instanceof GraphRequest)) {
return indexOf((GraphRequest) obj);
}
return -1;
}
public /* bridge */ int lastIndexOf(GraphRequest graphRequest) {
return super.lastIndexOf((Object) graphRequest);
}
@Override // java.util.AbstractList, java.util.List
public final /* bridge */ int lastIndexOf(Object obj) {
if (obj == null || (obj instanceof GraphRequest)) {
return lastIndexOf((GraphRequest) obj);
}
return -1;
}
@Override // java.util.AbstractList, java.util.List
public final /* bridge */ GraphRequest remove(int i) {
return removeAt(i);
}
public /* bridge */ boolean remove(GraphRequest graphRequest) {
return super.remove((Object) graphRequest);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public final /* bridge */ boolean remove(Object obj) {
if (obj == null || (obj instanceof GraphRequest)) {
return remove((GraphRequest) obj);
}
return false;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public final /* bridge */ int size() {
return getSize();
}
public final void setTimeout(int i) {
if (!(i >= 0)) {
throw new IllegalArgumentException("Argument timeoutInMilliseconds must be >= 0.".toString());
}
this.timeoutInMilliseconds = i;
}
public GraphRequestBatch() {
this.id = String.valueOf(Integer.valueOf(idGenerator.incrementAndGet()));
this.callbacks = new ArrayList();
this.requests = new ArrayList();
}
public GraphRequestBatch(Collection<GraphRequest> requests) {
Intrinsics.checkNotNullParameter(requests, "requests");
this.id = String.valueOf(Integer.valueOf(idGenerator.incrementAndGet()));
this.callbacks = new ArrayList();
this.requests = new ArrayList(requests);
}
public GraphRequestBatch(GraphRequest... requests) {
List asList;
Intrinsics.checkNotNullParameter(requests, "requests");
this.id = String.valueOf(Integer.valueOf(idGenerator.incrementAndGet()));
this.callbacks = new ArrayList();
asList = ArraysKt___ArraysJvmKt.asList(requests);
this.requests = new ArrayList(asList);
}
public GraphRequestBatch(GraphRequestBatch requests) {
Intrinsics.checkNotNullParameter(requests, "requests");
this.id = String.valueOf(Integer.valueOf(idGenerator.incrementAndGet()));
this.callbacks = new ArrayList();
this.requests = new ArrayList(requests);
this.callbackHandler = requests.callbackHandler;
this.timeoutInMilliseconds = requests.timeoutInMilliseconds;
this.callbacks = new ArrayList(requests.callbacks);
}
public final void addCallback(Callback callback) {
Intrinsics.checkNotNullParameter(callback, "callback");
if (this.callbacks.contains(callback)) {
return;
}
this.callbacks.add(callback);
}
public final void removeCallback(Callback callback) {
Intrinsics.checkNotNullParameter(callback, "callback");
this.callbacks.remove(callback);
}
@Override // java.util.AbstractList, java.util.AbstractCollection, java.util.Collection, java.util.List
public boolean add(GraphRequest element) {
Intrinsics.checkNotNullParameter(element, "element");
return this.requests.add(element);
}
@Override // java.util.AbstractList, java.util.List
public void add(int i, GraphRequest element) {
Intrinsics.checkNotNullParameter(element, "element");
this.requests.add(i, element);
}
@Override // java.util.AbstractList, java.util.AbstractCollection, java.util.Collection, java.util.List
public void clear() {
this.requests.clear();
}
@Override // java.util.AbstractList, java.util.List
public GraphRequest get(int i) {
return this.requests.get(i);
}
public GraphRequest removeAt(int i) {
return this.requests.remove(i);
}
@Override // java.util.AbstractList, java.util.List
public GraphRequest set(int i, GraphRequest element) {
Intrinsics.checkNotNullParameter(element, "element");
return this.requests.set(i, element);
}
public int getSize() {
return this.requests.size();
}
public final List<GraphResponse> executeAndWait() {
return executeAndWaitImpl();
}
public final GraphRequestAsyncTask executeAsync() {
return executeAsyncImpl();
}
private final List<GraphResponse> executeAndWaitImpl() {
return GraphRequest.Companion.executeBatchAndWait(this);
}
private final GraphRequestAsyncTask executeAsyncImpl() {
return GraphRequest.Companion.executeBatchAsync(this);
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,388 @@
package com.facebook;
import android.util.Log;
import com.facebook.AccessToken;
import com.facebook.internal.Logger;
import com.facebook.internal.Utility;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import kotlin.collections.CollectionsKt__IterablesKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.StringCompanionObject;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;
/* loaded from: classes2.dex */
public final class GraphResponse {
private static final String BODY_KEY = "body";
private static final String CODE_KEY = "code";
public static final String NON_JSON_RESPONSE_PROPERTY = "FACEBOOK_NON_JSON_RESULT";
private static final String RESPONSE_LOG_TAG = "Response";
public static final String SUCCESS_KEY = "success";
private final HttpURLConnection connection;
private final FacebookRequestError error;
private final JSONObject graphObject;
private final JSONArray graphObjectArray;
private final JSONArray jsonArray;
private final JSONObject jsonObject;
private final String rawResponse;
private final GraphRequest request;
public static final Companion Companion = new Companion(null);
private static final String TAG = GraphResponse.class.getCanonicalName();
public static final List<GraphResponse> constructErrorResponses(List<GraphRequest> list, HttpURLConnection httpURLConnection, FacebookException facebookException) {
return Companion.constructErrorResponses(list, httpURLConnection, facebookException);
}
public final HttpURLConnection getConnection() {
return this.connection;
}
public final FacebookRequestError getError() {
return this.error;
}
public final JSONArray getJSONArray() {
return this.graphObjectArray;
}
public final JSONObject getJSONObject() {
return this.graphObject;
}
public final JSONArray getJsonArray() {
return this.jsonArray;
}
public final JSONObject getJsonObject() {
return this.jsonObject;
}
public final String getRawResponse() {
return this.rawResponse;
}
public final GraphRequest getRequest() {
return this.request;
}
public GraphResponse(GraphRequest request, HttpURLConnection httpURLConnection, String str, JSONObject jSONObject, JSONArray jSONArray, FacebookRequestError facebookRequestError) {
Intrinsics.checkNotNullParameter(request, "request");
this.request = request;
this.connection = httpURLConnection;
this.rawResponse = str;
this.graphObject = jSONObject;
this.graphObjectArray = jSONArray;
this.error = facebookRequestError;
this.jsonObject = jSONObject;
this.jsonArray = jSONArray;
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public GraphResponse(GraphRequest request, HttpURLConnection httpURLConnection, String rawResponse, JSONObject jSONObject) {
this(request, httpURLConnection, rawResponse, jSONObject, null, null);
Intrinsics.checkNotNullParameter(request, "request");
Intrinsics.checkNotNullParameter(rawResponse, "rawResponse");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public GraphResponse(GraphRequest request, HttpURLConnection httpURLConnection, String rawResponse, JSONArray graphObjects) {
this(request, httpURLConnection, rawResponse, null, graphObjects, null);
Intrinsics.checkNotNullParameter(request, "request");
Intrinsics.checkNotNullParameter(rawResponse, "rawResponse");
Intrinsics.checkNotNullParameter(graphObjects, "graphObjects");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public GraphResponse(GraphRequest request, HttpURLConnection httpURLConnection, FacebookRequestError error) {
this(request, httpURLConnection, null, null, null, error);
Intrinsics.checkNotNullParameter(request, "request");
Intrinsics.checkNotNullParameter(error, "error");
}
public enum PagingDirection {
NEXT,
PREVIOUS;
/* renamed from: values, reason: to resolve conflict with enum method */
public static PagingDirection[] valuesCustom() {
PagingDirection[] valuesCustom = values();
return (PagingDirection[]) Arrays.copyOf(valuesCustom, valuesCustom.length);
}
}
public final GraphRequest getRequestForPagedResults(PagingDirection direction) {
String str;
JSONObject optJSONObject;
Intrinsics.checkNotNullParameter(direction, "direction");
JSONObject jSONObject = this.graphObject;
if (jSONObject == null || (optJSONObject = jSONObject.optJSONObject("paging")) == null) {
str = null;
} else if (direction == PagingDirection.NEXT) {
str = optJSONObject.optString("next");
} else {
str = optJSONObject.optString("previous");
}
if (Utility.isNullOrEmpty(str)) {
return null;
}
if (str != null && Intrinsics.areEqual(str, this.request.getUrlForSingleRequest())) {
return null;
}
try {
return new GraphRequest(this.request.getAccessToken(), new URL(str));
} catch (MalformedURLException unused) {
return null;
}
}
public String toString() {
String str;
try {
StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
Locale locale = Locale.US;
Object[] objArr = new Object[1];
HttpURLConnection httpURLConnection = this.connection;
objArr[0] = Integer.valueOf(httpURLConnection == null ? 200 : httpURLConnection.getResponseCode());
str = String.format(locale, "%d", Arrays.copyOf(objArr, 1));
Intrinsics.checkNotNullExpressionValue(str, "java.lang.String.format(locale, format, *args)");
} catch (IOException unused) {
str = "unknown";
}
String str2 = "{Response: responseCode: " + str + ", graphObject: " + this.graphObject + ", error: " + this.error + "}";
Intrinsics.checkNotNullExpressionValue(str2, "StringBuilder()\n .append(\"{Response: \")\n .append(\" responseCode: \")\n .append(responseCode)\n .append(\", graphObject: \")\n .append(graphObject)\n .append(\", error: \")\n .append(error)\n .append(\"}\")\n .toString()");
return str2;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final List<GraphResponse> fromHttpConnection$facebook_core_release(HttpURLConnection connection, GraphRequestBatch requests) {
List<GraphResponse> constructErrorResponses;
Intrinsics.checkNotNullParameter(connection, "connection");
Intrinsics.checkNotNullParameter(requests, "requests");
InputStream inputStream = null;
try {
try {
try {
} catch (FacebookException e) {
Logger.Companion.log(LoggingBehavior.REQUESTS, GraphResponse.RESPONSE_LOG_TAG, "Response <Error>: %s", e);
constructErrorResponses = constructErrorResponses(requests, connection, e);
}
} catch (Exception e2) {
Logger.Companion.log(LoggingBehavior.REQUESTS, GraphResponse.RESPONSE_LOG_TAG, "Response <Error>: %s", e2);
constructErrorResponses = constructErrorResponses(requests, connection, new FacebookException(e2));
}
if (!FacebookSdk.isFullyInitialized()) {
Log.e(GraphResponse.TAG, "GraphRequest can't be used when Facebook SDK isn't fully initialized");
throw new FacebookException("GraphRequest can't be used when Facebook SDK isn't fully initialized");
}
if (connection.getResponseCode() >= 400) {
inputStream = connection.getErrorStream();
} else {
inputStream = connection.getInputStream();
}
constructErrorResponses = createResponsesFromStream$facebook_core_release(inputStream, connection, requests);
Utility.closeQuietly(inputStream);
return constructErrorResponses;
} catch (Throwable th) {
Utility.closeQuietly(null);
throw th;
}
}
public final List<GraphResponse> createResponsesFromStream$facebook_core_release(InputStream inputStream, HttpURLConnection httpURLConnection, GraphRequestBatch requests) throws FacebookException, JSONException, IOException {
Intrinsics.checkNotNullParameter(requests, "requests");
String readStreamToString = Utility.readStreamToString(inputStream);
Logger.Companion.log(LoggingBehavior.INCLUDE_RAW_RESPONSES, GraphResponse.RESPONSE_LOG_TAG, "Response (raw)\n Size: %d\n Response:\n%s\n", Integer.valueOf(readStreamToString.length()), readStreamToString);
return createResponsesFromString$facebook_core_release(readStreamToString, httpURLConnection, requests);
}
public final List<GraphResponse> createResponsesFromString$facebook_core_release(String responseString, HttpURLConnection httpURLConnection, GraphRequestBatch requests) throws FacebookException, JSONException, IOException {
Intrinsics.checkNotNullParameter(responseString, "responseString");
Intrinsics.checkNotNullParameter(requests, "requests");
Object resultObject = new JSONTokener(responseString).nextValue();
Intrinsics.checkNotNullExpressionValue(resultObject, "resultObject");
List<GraphResponse> createResponsesFromObject = createResponsesFromObject(httpURLConnection, requests, resultObject);
Logger.Companion.log(LoggingBehavior.REQUESTS, GraphResponse.RESPONSE_LOG_TAG, "Response\n Id: %s\n Size: %d\n Responses:\n%s\n", requests.getId(), Integer.valueOf(responseString.length()), createResponsesFromObject);
return createResponsesFromObject;
}
/* JADX WARN: Removed duplicated region for block: B:11:0x0058 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private final java.util.List<com.facebook.GraphResponse> createResponsesFromObject(java.net.HttpURLConnection r9, java.util.List<com.facebook.GraphRequest> r10, java.lang.Object r11) throws com.facebook.FacebookException, org.json.JSONException {
/*
r8 = this;
int r0 = r10.size()
java.util.ArrayList r1 = new java.util.ArrayList
r1.<init>(r0)
r2 = 1
r3 = 0
if (r0 != r2) goto L53
java.lang.Object r2 = r10.get(r3)
com.facebook.GraphRequest r2 = (com.facebook.GraphRequest) r2
org.json.JSONObject r4 = new org.json.JSONObject // Catch: java.io.IOException -> L34 org.json.JSONException -> L36
r4.<init>() // Catch: java.io.IOException -> L34 org.json.JSONException -> L36
java.lang.String r5 = "body"
r4.put(r5, r11) // Catch: java.io.IOException -> L34 org.json.JSONException -> L36
if (r9 != 0) goto L22
r5 = 200(0xc8, float:2.8E-43)
goto L26
L22:
int r5 = r9.getResponseCode() // Catch: java.io.IOException -> L34 org.json.JSONException -> L36
L26:
java.lang.String r6 = "code"
r4.put(r6, r5) // Catch: java.io.IOException -> L34 org.json.JSONException -> L36
org.json.JSONArray r5 = new org.json.JSONArray // Catch: java.io.IOException -> L34 org.json.JSONException -> L36
r5.<init>() // Catch: java.io.IOException -> L34 org.json.JSONException -> L36
r5.put(r4) // Catch: java.io.IOException -> L34 org.json.JSONException -> L36
goto L54
L34:
r4 = move-exception
goto L38
L36:
r4 = move-exception
goto L46
L38:
com.facebook.GraphResponse r5 = new com.facebook.GraphResponse
com.facebook.FacebookRequestError r6 = new com.facebook.FacebookRequestError
r6.<init>(r9, r4)
r5.<init>(r2, r9, r6)
r1.add(r5)
goto L53
L46:
com.facebook.GraphResponse r5 = new com.facebook.GraphResponse
com.facebook.FacebookRequestError r6 = new com.facebook.FacebookRequestError
r6.<init>(r9, r4)
r5.<init>(r2, r9, r6)
r1.add(r5)
L53:
r5 = r11
L54:
boolean r2 = r5 instanceof org.json.JSONArray
if (r2 == 0) goto La8
r2 = r5
org.json.JSONArray r2 = (org.json.JSONArray) r2
int r4 = r2.length()
if (r4 != r0) goto La8
int r0 = r2.length()
if (r0 <= 0) goto La7
L67:
int r2 = r3 + 1
java.lang.Object r4 = r10.get(r3)
com.facebook.GraphRequest r4 = (com.facebook.GraphRequest) r4
r6 = r5
org.json.JSONArray r6 = (org.json.JSONArray) r6 // Catch: com.facebook.FacebookException -> L83 org.json.JSONException -> L85
java.lang.Object r3 = r6.get(r3) // Catch: com.facebook.FacebookException -> L83 org.json.JSONException -> L85
java.lang.String r6 = "obj"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r3, r6) // Catch: com.facebook.FacebookException -> L83 org.json.JSONException -> L85
com.facebook.GraphResponse r3 = r8.createResponseFromObject(r4, r9, r3, r11) // Catch: com.facebook.FacebookException -> L83 org.json.JSONException -> L85
r1.add(r3) // Catch: com.facebook.FacebookException -> L83 org.json.JSONException -> L85
goto La2
L83:
r3 = move-exception
goto L87
L85:
r3 = move-exception
goto L95
L87:
com.facebook.GraphResponse r6 = new com.facebook.GraphResponse
com.facebook.FacebookRequestError r7 = new com.facebook.FacebookRequestError
r7.<init>(r9, r3)
r6.<init>(r4, r9, r7)
r1.add(r6)
goto La2
L95:
com.facebook.GraphResponse r6 = new com.facebook.GraphResponse
com.facebook.FacebookRequestError r7 = new com.facebook.FacebookRequestError
r7.<init>(r9, r3)
r6.<init>(r4, r9, r7)
r1.add(r6)
La2:
if (r2 < r0) goto La5
goto La7
La5:
r3 = r2
goto L67
La7:
return r1
La8:
com.facebook.FacebookException r9 = new com.facebook.FacebookException
java.lang.String r10 = "Unexpected number of results"
r9.<init>(r10)
throw r9
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.GraphResponse.Companion.createResponsesFromObject(java.net.HttpURLConnection, java.util.List, java.lang.Object):java.util.List");
}
private final GraphResponse createResponseFromObject(GraphRequest graphRequest, HttpURLConnection httpURLConnection, Object NULL, Object obj) throws JSONException {
if (NULL instanceof JSONObject) {
JSONObject jSONObject = (JSONObject) NULL;
FacebookRequestError checkResponseAndCreateError = FacebookRequestError.Companion.checkResponseAndCreateError(jSONObject, obj, httpURLConnection);
if (checkResponseAndCreateError != null) {
Log.e(GraphResponse.TAG, checkResponseAndCreateError.toString());
if (checkResponseAndCreateError.getErrorCode() == 190) {
Utility utility = Utility.INSTANCE;
if (Utility.isCurrentAccessToken(graphRequest.getAccessToken())) {
if (checkResponseAndCreateError.getSubErrorCode() != 493) {
AccessToken.Companion.setCurrentAccessToken(null);
} else {
AccessToken.Companion companion = AccessToken.Companion;
AccessToken currentAccessToken = companion.getCurrentAccessToken();
if (Intrinsics.areEqual(currentAccessToken != null ? Boolean.valueOf(currentAccessToken.isExpired()) : null, Boolean.FALSE)) {
companion.expireCurrentAccessToken();
}
}
}
}
return new GraphResponse(graphRequest, httpURLConnection, checkResponseAndCreateError);
}
Object stringPropertyAsJSON = Utility.getStringPropertyAsJSON(jSONObject, "body", GraphResponse.NON_JSON_RESPONSE_PROPERTY);
if (stringPropertyAsJSON instanceof JSONObject) {
JSONObject jSONObject2 = (JSONObject) stringPropertyAsJSON;
return new GraphResponse(graphRequest, httpURLConnection, jSONObject2.toString(), jSONObject2);
}
if (stringPropertyAsJSON instanceof JSONArray) {
JSONArray jSONArray = (JSONArray) stringPropertyAsJSON;
return new GraphResponse(graphRequest, httpURLConnection, jSONArray.toString(), jSONArray);
}
NULL = JSONObject.NULL;
Intrinsics.checkNotNullExpressionValue(NULL, "NULL");
}
if (NULL == JSONObject.NULL) {
return new GraphResponse(graphRequest, httpURLConnection, NULL.toString(), (JSONObject) null);
}
throw new FacebookException(Intrinsics.stringPlus("Got unexpected object type in response, class: ", NULL.getClass().getSimpleName()));
}
public final List<GraphResponse> constructErrorResponses(List<GraphRequest> requests, HttpURLConnection httpURLConnection, FacebookException facebookException) {
Intrinsics.checkNotNullParameter(requests, "requests");
List<GraphRequest> list = requests;
ArrayList arrayList = new ArrayList(CollectionsKt__IterablesKt.collectionSizeOrDefault(list, 10));
Iterator<T> it = list.iterator();
while (it.hasNext()) {
arrayList.add(new GraphResponse((GraphRequest) it.next(), httpURLConnection, new FacebookRequestError(httpURLConnection, facebookException)));
}
return arrayList;
}
}
}

View File

@@ -0,0 +1,16 @@
package com.facebook;
import java.util.Arrays;
/* loaded from: classes2.dex */
public enum HttpMethod {
GET,
POST,
DELETE;
/* renamed from: values, reason: to resolve conflict with enum method */
public static HttpMethod[] valuesCustom() {
HttpMethod[] valuesCustom = values();
return (HttpMethod[]) Arrays.copyOf(valuesCustom, valuesCustom.length);
}
}

View File

@@ -0,0 +1,609 @@
package com.facebook;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import com.applovin.impl.sdk.utils.JsonUtils;
import com.facebook.internal.Logger;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class LegacyTokenHelper {
public static final String APPLICATION_ID_KEY = "com.facebook.TokenCachingStrategy.ApplicationId";
public static final String DECLINED_PERMISSIONS_KEY = "com.facebook.TokenCachingStrategy.DeclinedPermissions";
public static final String DEFAULT_CACHE_KEY = "com.facebook.SharedPreferencesTokenCachingStrategy.DEFAULT_KEY";
public static final String EXPIRATION_DATE_KEY = "com.facebook.TokenCachingStrategy.ExpirationDate";
public static final String EXPIRED_PERMISSIONS_KEY = "com.facebook.TokenCachingStrategy.ExpiredPermissions";
private static final long INVALID_BUNDLE_MILLISECONDS = Long.MIN_VALUE;
private static final String IS_SSO_KEY = "com.facebook.TokenCachingStrategy.IsSSO";
private static final String JSON_VALUE = "value";
private static final String JSON_VALUE_ENUM_TYPE = "enumType";
private static final String JSON_VALUE_TYPE = "valueType";
public static final String LAST_REFRESH_DATE_KEY = "com.facebook.TokenCachingStrategy.LastRefreshDate";
public static final String PERMISSIONS_KEY = "com.facebook.TokenCachingStrategy.Permissions";
public static final String TOKEN_KEY = "com.facebook.TokenCachingStrategy.Token";
public static final String TOKEN_SOURCE_KEY = "com.facebook.TokenCachingStrategy.AccessTokenSource";
private static final String TYPE_BOOLEAN = "bool";
private static final String TYPE_BOOLEAN_ARRAY = "bool[]";
private static final String TYPE_BYTE = "byte";
private static final String TYPE_BYTE_ARRAY = "byte[]";
private static final String TYPE_CHAR = "char";
private static final String TYPE_CHAR_ARRAY = "char[]";
private static final String TYPE_DOUBLE = "double";
private static final String TYPE_DOUBLE_ARRAY = "double[]";
private static final String TYPE_ENUM = "enum";
private static final String TYPE_FLOAT = "float";
private static final String TYPE_FLOAT_ARRAY = "float[]";
private static final String TYPE_INTEGER = "int";
private static final String TYPE_INTEGER_ARRAY = "int[]";
private static final String TYPE_LONG = "long";
private static final String TYPE_LONG_ARRAY = "long[]";
private static final String TYPE_SHORT = "short";
private static final String TYPE_SHORT_ARRAY = "short[]";
private static final String TYPE_STRING = "string";
private static final String TYPE_STRING_LIST = "stringList";
private final SharedPreferences cache;
private final String cacheKey;
public static final Companion Companion = new Companion(null);
private static final String TAG = LegacyTokenHelper.class.getSimpleName();
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
/* JADX WARN: Multi-variable type inference failed */
public LegacyTokenHelper(Context context) {
this(context, null, 2, 0 == true ? 1 : 0);
Intrinsics.checkNotNullParameter(context, "context");
}
public static final String getApplicationId(Bundle bundle) {
return Companion.getApplicationId(bundle);
}
public static final Date getExpirationDate(Bundle bundle) {
return Companion.getExpirationDate(bundle);
}
public static final long getExpirationMilliseconds(Bundle bundle) {
return Companion.getExpirationMilliseconds(bundle);
}
public static final Date getLastRefreshDate(Bundle bundle) {
return Companion.getLastRefreshDate(bundle);
}
public static final long getLastRefreshMilliseconds(Bundle bundle) {
return Companion.getLastRefreshMilliseconds(bundle);
}
public static final Set<String> getPermissions(Bundle bundle) {
return Companion.getPermissions(bundle);
}
public static final AccessTokenSource getSource(Bundle bundle) {
return Companion.getSource(bundle);
}
public static final String getToken(Bundle bundle) {
return Companion.getToken(bundle);
}
public static final boolean hasTokenInformation(Bundle bundle) {
return Companion.hasTokenInformation(bundle);
}
public static final void putApplicationId(Bundle bundle, String str) {
Companion.putApplicationId(bundle, str);
}
public static final void putDeclinedPermissions(Bundle bundle, Collection<String> collection) {
Companion.putDeclinedPermissions(bundle, collection);
}
public static final void putExpirationDate(Bundle bundle, Date date) {
Companion.putExpirationDate(bundle, date);
}
public static final void putExpirationMilliseconds(Bundle bundle, long j) {
Companion.putExpirationMilliseconds(bundle, j);
}
public static final void putExpiredPermissions(Bundle bundle, Collection<String> collection) {
Companion.putExpiredPermissions(bundle, collection);
}
public static final void putLastRefreshDate(Bundle bundle, Date date) {
Companion.putLastRefreshDate(bundle, date);
}
public static final void putLastRefreshMilliseconds(Bundle bundle, long j) {
Companion.putLastRefreshMilliseconds(bundle, j);
}
public static final void putPermissions(Bundle bundle, Collection<String> collection) {
Companion.putPermissions(bundle, collection);
}
public static final void putSource(Bundle bundle, AccessTokenSource accessTokenSource) {
Companion.putSource(bundle, accessTokenSource);
}
public static final void putToken(Bundle bundle, String str) {
Companion.putToken(bundle, str);
}
public LegacyTokenHelper(Context context, String str) {
Intrinsics.checkNotNullParameter(context, "context");
str = (str == null || str.length() == 0) ? DEFAULT_CACHE_KEY : str;
this.cacheKey = str;
Context applicationContext = context.getApplicationContext();
SharedPreferences sharedPreferences = (applicationContext != null ? applicationContext : context).getSharedPreferences(str, 0);
Intrinsics.checkNotNullExpressionValue(sharedPreferences, "context.getSharedPreferences(this.cacheKey, Context.MODE_PRIVATE)");
this.cache = sharedPreferences;
}
public /* synthetic */ LegacyTokenHelper(Context context, String str, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(context, (i & 2) != 0 ? null : str);
}
public final Bundle load() {
Bundle bundle = new Bundle();
for (String key : this.cache.getAll().keySet()) {
try {
Intrinsics.checkNotNullExpressionValue(key, "key");
deserializeKey(key, bundle);
} catch (JSONException e) {
Logger.Companion companion = Logger.Companion;
LoggingBehavior loggingBehavior = LoggingBehavior.CACHE;
String TAG2 = TAG;
Intrinsics.checkNotNullExpressionValue(TAG2, "TAG");
companion.log(loggingBehavior, 5, TAG2, "Error reading cached value for key: '" + ((Object) key) + "' -- " + e);
return null;
}
}
return bundle;
}
public final void save(Bundle bundle) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
SharedPreferences.Editor editor = this.cache.edit();
for (String key : bundle.keySet()) {
try {
Intrinsics.checkNotNullExpressionValue(key, "key");
Intrinsics.checkNotNullExpressionValue(editor, "editor");
serializeKey(key, bundle, editor);
} catch (JSONException e) {
Logger.Companion companion = Logger.Companion;
LoggingBehavior loggingBehavior = LoggingBehavior.CACHE;
String TAG2 = TAG;
Intrinsics.checkNotNullExpressionValue(TAG2, "TAG");
companion.log(loggingBehavior, 5, TAG2, "Error processing value for key: '" + ((Object) key) + "' -- " + e);
return;
}
}
editor.apply();
}
public final void clear() {
this.cache.edit().clear().apply();
}
/* JADX WARN: Removed duplicated region for block: B:10:0x018b */
/* JADX WARN: Removed duplicated region for block: B:15:? A[RETURN, SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private final void serializeKey(java.lang.String r9, android.os.Bundle r10, android.content.SharedPreferences.Editor r11) throws org.json.JSONException {
/*
Method dump skipped, instructions count: 418
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.LegacyTokenHelper.serializeKey(java.lang.String, android.os.Bundle, android.content.SharedPreferences$Editor):void");
}
private final void deserializeKey(String str, Bundle bundle) throws JSONException {
String str2;
String string;
String string2 = this.cache.getString(str, JsonUtils.EMPTY_JSON);
if (string2 == null) {
throw new IllegalStateException("Required value was null.".toString());
}
JSONObject jSONObject = new JSONObject(string2);
String string3 = jSONObject.getString(JSON_VALUE_TYPE);
if (string3 != null) {
int i = 0;
switch (string3.hashCode()) {
case -1573317553:
if (string3.equals(TYPE_STRING_LIST)) {
JSONArray jSONArray = jSONObject.getJSONArray("value");
int length = jSONArray.length();
ArrayList<String> arrayList = new ArrayList<>(length);
if (length > 0) {
while (true) {
int i2 = i + 1;
Object obj = jSONArray.get(i);
if (obj == JSONObject.NULL) {
str2 = null;
} else {
if (obj == null) {
throw new NullPointerException("null cannot be cast to non-null type kotlin.String");
}
str2 = (String) obj;
}
arrayList.add(i, str2);
if (i2 < length) {
i = i2;
}
}
}
bundle.putStringArrayList(str, arrayList);
return;
}
return;
case -1383386164:
if (string3.equals(TYPE_BOOLEAN_ARRAY)) {
JSONArray jSONArray2 = jSONObject.getJSONArray("value");
int length2 = jSONArray2.length();
boolean[] zArr = new boolean[length2];
int i3 = length2 - 1;
if (i3 >= 0) {
while (true) {
int i4 = i + 1;
zArr[i] = jSONArray2.getBoolean(i);
if (i4 <= i3) {
i = i4;
}
}
}
bundle.putBooleanArray(str, zArr);
return;
}
return;
case -1374008726:
if (string3.equals(TYPE_BYTE_ARRAY)) {
JSONArray jSONArray3 = jSONObject.getJSONArray("value");
int length3 = jSONArray3.length();
byte[] bArr = new byte[length3];
int i5 = length3 - 1;
if (i5 >= 0) {
while (true) {
int i6 = i + 1;
bArr[i] = (byte) jSONArray3.getInt(i);
if (i6 <= i5) {
i = i6;
}
}
}
bundle.putByteArray(str, bArr);
return;
}
return;
case -1361632968:
if (string3.equals(TYPE_CHAR_ARRAY)) {
JSONArray jSONArray4 = jSONObject.getJSONArray("value");
int length4 = jSONArray4.length();
char[] cArr = new char[length4];
int i7 = length4 - 1;
if (i7 >= 0) {
int i8 = 0;
while (true) {
int i9 = i8 + 1;
String string4 = jSONArray4.getString(i8);
if (string4 != null && string4.length() == 1) {
cArr[i8] = string4.charAt(0);
}
if (i9 <= i7) {
i8 = i9;
}
}
}
bundle.putCharArray(str, cArr);
return;
}
return;
case -1325958191:
if (string3.equals(TYPE_DOUBLE)) {
bundle.putDouble(str, jSONObject.getDouble("value"));
return;
}
return;
case -1097129250:
if (string3.equals(TYPE_LONG_ARRAY)) {
JSONArray jSONArray5 = jSONObject.getJSONArray("value");
int length5 = jSONArray5.length();
long[] jArr = new long[length5];
int i10 = length5 - 1;
if (i10 >= 0) {
while (true) {
int i11 = i + 1;
jArr[i] = jSONArray5.getLong(i);
if (i11 <= i10) {
i = i11;
}
}
}
bundle.putLongArray(str, jArr);
return;
}
return;
case -891985903:
if (string3.equals(TYPE_STRING)) {
bundle.putString(str, jSONObject.getString("value"));
return;
}
return;
case -766441794:
if (string3.equals(TYPE_FLOAT_ARRAY)) {
JSONArray jSONArray6 = jSONObject.getJSONArray("value");
int length6 = jSONArray6.length();
float[] fArr = new float[length6];
int i12 = length6 - 1;
if (i12 >= 0) {
while (true) {
int i13 = i + 1;
fArr[i] = (float) jSONArray6.getDouble(i);
if (i13 <= i12) {
i = i13;
}
}
}
bundle.putFloatArray(str, fArr);
return;
}
return;
case 104431:
if (string3.equals(TYPE_INTEGER)) {
bundle.putInt(str, jSONObject.getInt("value"));
return;
}
return;
case 3029738:
if (string3.equals(TYPE_BOOLEAN)) {
bundle.putBoolean(str, jSONObject.getBoolean("value"));
return;
}
return;
case 3039496:
if (string3.equals(TYPE_BYTE)) {
bundle.putByte(str, (byte) jSONObject.getInt("value"));
return;
}
return;
case 3052374:
if (string3.equals(TYPE_CHAR) && (string = jSONObject.getString("value")) != null && string.length() == 1) {
bundle.putChar(str, string.charAt(0));
return;
}
return;
case 3118337:
if (string3.equals(TYPE_ENUM)) {
try {
bundle.putSerializable(str, Enum.valueOf(Class.forName(jSONObject.getString(JSON_VALUE_ENUM_TYPE)), jSONObject.getString("value")));
return;
} catch (ClassNotFoundException | IllegalArgumentException unused) {
return;
}
}
return;
case 3327612:
if (string3.equals(TYPE_LONG)) {
bundle.putLong(str, jSONObject.getLong("value"));
return;
}
return;
case 97526364:
if (string3.equals(TYPE_FLOAT)) {
bundle.putFloat(str, (float) jSONObject.getDouble("value"));
return;
}
return;
case 100361105:
if (string3.equals(TYPE_INTEGER_ARRAY)) {
JSONArray jSONArray7 = jSONObject.getJSONArray("value");
int length7 = jSONArray7.length();
int[] iArr = new int[length7];
int i14 = length7 - 1;
if (i14 >= 0) {
while (true) {
int i15 = i + 1;
iArr[i] = jSONArray7.getInt(i);
if (i15 <= i14) {
i = i15;
}
}
}
bundle.putIntArray(str, iArr);
return;
}
return;
case 109413500:
if (string3.equals(TYPE_SHORT)) {
bundle.putShort(str, (short) jSONObject.getInt("value"));
return;
}
return;
case 1359468275:
if (string3.equals(TYPE_DOUBLE_ARRAY)) {
JSONArray jSONArray8 = jSONObject.getJSONArray("value");
int length8 = jSONArray8.length();
double[] dArr = new double[length8];
int i16 = length8 - 1;
if (i16 >= 0) {
while (true) {
int i17 = i + 1;
dArr[i] = jSONArray8.getDouble(i);
if (i17 <= i16) {
i = i17;
}
}
}
bundle.putDoubleArray(str, dArr);
return;
}
return;
case 2067161310:
if (string3.equals(TYPE_SHORT_ARRAY)) {
JSONArray jSONArray9 = jSONObject.getJSONArray("value");
int length9 = jSONArray9.length();
short[] sArr = new short[length9];
int i18 = length9 - 1;
if (i18 >= 0) {
while (true) {
int i19 = i + 1;
sArr[i] = (short) jSONArray9.getInt(i);
if (i19 <= i18) {
i = i19;
}
}
}
bundle.putShortArray(str, sArr);
return;
}
return;
default:
return;
}
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final boolean hasTokenInformation(Bundle bundle) {
String string;
return (bundle == null || (string = bundle.getString(LegacyTokenHelper.TOKEN_KEY)) == null || string.length() == 0 || bundle.getLong(LegacyTokenHelper.EXPIRATION_DATE_KEY, 0L) == 0) ? false : true;
}
public final String getToken(Bundle bundle) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
return bundle.getString(LegacyTokenHelper.TOKEN_KEY);
}
public final void putToken(Bundle bundle, String value) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
Intrinsics.checkNotNullParameter(value, "value");
bundle.putString(LegacyTokenHelper.TOKEN_KEY, value);
}
public final Date getExpirationDate(Bundle bundle) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
return getDate(bundle, LegacyTokenHelper.EXPIRATION_DATE_KEY);
}
public final void putExpirationDate(Bundle bundle, Date value) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
Intrinsics.checkNotNullParameter(value, "value");
putDate(bundle, LegacyTokenHelper.EXPIRATION_DATE_KEY, value);
}
public final long getExpirationMilliseconds(Bundle bundle) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
return bundle.getLong(LegacyTokenHelper.EXPIRATION_DATE_KEY);
}
public final void putExpirationMilliseconds(Bundle bundle, long j) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
bundle.putLong(LegacyTokenHelper.EXPIRATION_DATE_KEY, j);
}
public final Set<String> getPermissions(Bundle bundle) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
ArrayList<String> stringArrayList = bundle.getStringArrayList(LegacyTokenHelper.PERMISSIONS_KEY);
if (stringArrayList == null) {
return null;
}
return new HashSet(stringArrayList);
}
public final void putPermissions(Bundle bundle, Collection<String> value) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
Intrinsics.checkNotNullParameter(value, "value");
bundle.putStringArrayList(LegacyTokenHelper.PERMISSIONS_KEY, new ArrayList<>(value));
}
public final void putDeclinedPermissions(Bundle bundle, Collection<String> value) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
Intrinsics.checkNotNullParameter(value, "value");
bundle.putStringArrayList(LegacyTokenHelper.DECLINED_PERMISSIONS_KEY, new ArrayList<>(value));
}
public final void putExpiredPermissions(Bundle bundle, Collection<String> value) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
Intrinsics.checkNotNullParameter(value, "value");
bundle.putStringArrayList(LegacyTokenHelper.EXPIRED_PERMISSIONS_KEY, new ArrayList<>(value));
}
public final AccessTokenSource getSource(Bundle bundle) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
if (bundle.containsKey(LegacyTokenHelper.TOKEN_SOURCE_KEY)) {
return (AccessTokenSource) bundle.getSerializable(LegacyTokenHelper.TOKEN_SOURCE_KEY);
}
return bundle.getBoolean(LegacyTokenHelper.IS_SSO_KEY) ? AccessTokenSource.FACEBOOK_APPLICATION_WEB : AccessTokenSource.WEB_VIEW;
}
public final void putSource(Bundle bundle, AccessTokenSource value) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
Intrinsics.checkNotNullParameter(value, "value");
bundle.putSerializable(LegacyTokenHelper.TOKEN_SOURCE_KEY, value);
}
public final Date getLastRefreshDate(Bundle bundle) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
return getDate(bundle, LegacyTokenHelper.LAST_REFRESH_DATE_KEY);
}
public final void putLastRefreshDate(Bundle bundle, Date value) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
Intrinsics.checkNotNullParameter(value, "value");
putDate(bundle, LegacyTokenHelper.LAST_REFRESH_DATE_KEY, value);
}
public final long getLastRefreshMilliseconds(Bundle bundle) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
return bundle.getLong(LegacyTokenHelper.LAST_REFRESH_DATE_KEY);
}
public final void putLastRefreshMilliseconds(Bundle bundle, long j) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
bundle.putLong(LegacyTokenHelper.LAST_REFRESH_DATE_KEY, j);
}
public final String getApplicationId(Bundle bundle) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
return bundle.getString(LegacyTokenHelper.APPLICATION_ID_KEY);
}
public final void putApplicationId(Bundle bundle, String str) {
Intrinsics.checkNotNullParameter(bundle, "bundle");
bundle.putString(LegacyTokenHelper.APPLICATION_ID_KEY, str);
}
private final Date getDate(Bundle bundle, String str) {
if (bundle == null) {
return null;
}
long j = bundle.getLong(str, Long.MIN_VALUE);
if (j == Long.MIN_VALUE) {
return null;
}
return new Date(j);
}
private final void putDate(Bundle bundle, String str, Date date) {
bundle.putLong(str, date.getTime());
}
}
}

View File

@@ -0,0 +1,21 @@
package com.facebook;
import java.util.Arrays;
/* loaded from: classes2.dex */
public enum LoggingBehavior {
REQUESTS,
INCLUDE_ACCESS_TOKENS,
INCLUDE_RAW_RESPONSES,
CACHE,
APP_EVENTS,
DEVELOPER_ERRORS,
GRAPH_API_DEBUG_WARNING,
GRAPH_API_DEBUG_INFO;
/* renamed from: values, reason: to resolve conflict with enum method */
public static LoggingBehavior[] valuesCustom() {
LoggingBehavior[] valuesCustom = values();
return (LoggingBehavior[]) Arrays.copyOf(valuesCustom, valuesCustom.length);
}
}

View File

@@ -0,0 +1,10 @@
package com.facebook;
/* loaded from: classes2.dex */
public interface LoginStatusCallback {
void onCompleted(AccessToken accessToken);
void onError(Exception exc);
void onFailure();
}

View File

@@ -0,0 +1,290 @@
package com.facebook;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;
import com.facebook.AccessToken;
import com.facebook.internal.ImageRequest;
import com.facebook.internal.Utility;
import com.facebook.internal.Validate;
import com.ironsource.mediationsdk.logger.IronSourceError;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class Profile implements Parcelable {
private static final String FIRST_NAME_KEY = "first_name";
private static final String ID_KEY = "id";
private static final String LAST_NAME_KEY = "last_name";
private static final String LINK_URI_KEY = "link_uri";
private static final String MIDDLE_NAME_KEY = "middle_name";
private static final String NAME_KEY = "name";
private static final String PICTURE_URI_KEY = "picture_uri";
private final String firstName;
private final String id;
private final String lastName;
private final Uri linkUri;
private final String middleName;
private final String name;
private final Uri pictureUri;
public static final Companion Companion = new Companion(null);
private static final String TAG = Profile.class.getSimpleName();
public static final Parcelable.Creator<Profile> CREATOR = new Parcelable.Creator<Profile>() { // from class: com.facebook.Profile$Companion$CREATOR$1
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public Profile createFromParcel(Parcel source) {
Intrinsics.checkNotNullParameter(source, "source");
return new Profile(source, null);
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public Profile[] newArray(int i) {
return new Profile[i];
}
};
public /* synthetic */ Profile(Parcel parcel, DefaultConstructorMarker defaultConstructorMarker) {
this(parcel);
}
public Profile(String str, String str2, String str3, String str4, String str5, Uri uri) {
this(str, str2, str3, str4, str5, uri, null, 64, null);
}
public static final void fetchProfileForCurrentAccessToken() {
Companion.fetchProfileForCurrentAccessToken();
}
public static final Profile getCurrentProfile() {
return Companion.getCurrentProfile();
}
public static final void setCurrentProfile(Profile profile) {
Companion.setCurrentProfile(profile);
}
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
public final String getFirstName() {
return this.firstName;
}
public final String getId() {
return this.id;
}
public final String getLastName() {
return this.lastName;
}
public final Uri getLinkUri() {
return this.linkUri;
}
public final String getMiddleName() {
return this.middleName;
}
public final String getName() {
return this.name;
}
public final Uri getPictureUri() {
return this.pictureUri;
}
public /* synthetic */ Profile(String str, String str2, String str3, String str4, String str5, Uri uri, Uri uri2, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(str, str2, str3, str4, str5, uri, (i & 64) != 0 ? null : uri2);
}
public Profile(String str, String str2, String str3, String str4, String str5, Uri uri, Uri uri2) {
Validate.notNullOrEmpty(str, "id");
this.id = str;
this.firstName = str2;
this.middleName = str3;
this.lastName = str4;
this.name = str5;
this.linkUri = uri;
this.pictureUri = uri2;
}
public final Uri getProfilePictureUri(int i, int i2) {
String str;
Uri uri = this.pictureUri;
if (uri != null) {
return uri;
}
AccessToken.Companion companion = AccessToken.Companion;
if (companion.isCurrentAccessTokenActive()) {
AccessToken currentAccessToken = companion.getCurrentAccessToken();
str = currentAccessToken == null ? null : currentAccessToken.getToken();
} else {
str = "";
}
return ImageRequest.Companion.getProfilePictureUri(this.id, i, i2, str);
}
public boolean equals(Object obj) {
String str;
String str2;
String str3;
String str4;
Uri uri;
Uri uri2;
if (this == obj) {
return true;
}
if (!(obj instanceof Profile)) {
return false;
}
String str5 = this.id;
return ((str5 == null && ((Profile) obj).id == null) || Intrinsics.areEqual(str5, ((Profile) obj).id)) && (((str = this.firstName) == null && ((Profile) obj).firstName == null) || Intrinsics.areEqual(str, ((Profile) obj).firstName)) && ((((str2 = this.middleName) == null && ((Profile) obj).middleName == null) || Intrinsics.areEqual(str2, ((Profile) obj).middleName)) && ((((str3 = this.lastName) == null && ((Profile) obj).lastName == null) || Intrinsics.areEqual(str3, ((Profile) obj).lastName)) && ((((str4 = this.name) == null && ((Profile) obj).name == null) || Intrinsics.areEqual(str4, ((Profile) obj).name)) && ((((uri = this.linkUri) == null && ((Profile) obj).linkUri == null) || Intrinsics.areEqual(uri, ((Profile) obj).linkUri)) && (((uri2 = this.pictureUri) == null && ((Profile) obj).pictureUri == null) || Intrinsics.areEqual(uri2, ((Profile) obj).pictureUri))))));
}
public int hashCode() {
String str = this.id;
int hashCode = IronSourceError.ERROR_NON_EXISTENT_INSTANCE + (str != null ? str.hashCode() : 0);
String str2 = this.firstName;
if (str2 != null) {
hashCode = (hashCode * 31) + str2.hashCode();
}
String str3 = this.middleName;
if (str3 != null) {
hashCode = (hashCode * 31) + str3.hashCode();
}
String str4 = this.lastName;
if (str4 != null) {
hashCode = (hashCode * 31) + str4.hashCode();
}
String str5 = this.name;
if (str5 != null) {
hashCode = (hashCode * 31) + str5.hashCode();
}
Uri uri = this.linkUri;
if (uri != null) {
hashCode = (hashCode * 31) + uri.hashCode();
}
Uri uri2 = this.pictureUri;
return uri2 != null ? (hashCode * 31) + uri2.hashCode() : hashCode;
}
public final JSONObject toJSONObject() {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("id", this.id);
jSONObject.put(FIRST_NAME_KEY, this.firstName);
jSONObject.put("middle_name", this.middleName);
jSONObject.put(LAST_NAME_KEY, this.lastName);
jSONObject.put("name", this.name);
Uri uri = this.linkUri;
if (uri != null) {
jSONObject.put(LINK_URI_KEY, uri.toString());
}
Uri uri2 = this.pictureUri;
if (uri2 != null) {
jSONObject.put(PICTURE_URI_KEY, uri2.toString());
}
return jSONObject;
} catch (JSONException unused) {
return null;
}
}
public Profile(JSONObject jsonObject) {
Intrinsics.checkNotNullParameter(jsonObject, "jsonObject");
this.id = jsonObject.optString("id", null);
this.firstName = jsonObject.optString(FIRST_NAME_KEY, null);
this.middleName = jsonObject.optString("middle_name", null);
this.lastName = jsonObject.optString(LAST_NAME_KEY, null);
this.name = jsonObject.optString("name", null);
String optString = jsonObject.optString(LINK_URI_KEY, null);
this.linkUri = optString == null ? null : Uri.parse(optString);
String optString2 = jsonObject.optString(PICTURE_URI_KEY, null);
this.pictureUri = optString2 != null ? Uri.parse(optString2) : null;
}
private Profile(Parcel parcel) {
this.id = parcel.readString();
this.firstName = parcel.readString();
this.middleName = parcel.readString();
this.lastName = parcel.readString();
this.name = parcel.readString();
String readString = parcel.readString();
this.linkUri = readString == null ? null : Uri.parse(readString);
String readString2 = parcel.readString();
this.pictureUri = readString2 != null ? Uri.parse(readString2) : null;
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel dest, int i) {
Intrinsics.checkNotNullParameter(dest, "dest");
dest.writeString(this.id);
dest.writeString(this.firstName);
dest.writeString(this.middleName);
dest.writeString(this.lastName);
dest.writeString(this.name);
Uri uri = this.linkUri;
dest.writeString(uri == null ? null : uri.toString());
Uri uri2 = this.pictureUri;
dest.writeString(uri2 != null ? uri2.toString() : null);
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final Profile getCurrentProfile() {
return ProfileManager.Companion.getInstance().getCurrentProfile();
}
public final void setCurrentProfile(Profile profile) {
ProfileManager.Companion.getInstance().setCurrentProfile(profile);
}
public final void fetchProfileForCurrentAccessToken() {
AccessToken.Companion companion = AccessToken.Companion;
AccessToken currentAccessToken = companion.getCurrentAccessToken();
if (currentAccessToken == null) {
return;
}
if (!companion.isCurrentAccessTokenActive()) {
setCurrentProfile(null);
} else {
Utility utility = Utility.INSTANCE;
Utility.getGraphMeRequestWithCacheAsync(currentAccessToken.getToken(), new Utility.GraphMeRequestWithCacheCallback() { // from class: com.facebook.Profile$Companion$fetchProfileForCurrentAccessToken$1
@Override // com.facebook.internal.Utility.GraphMeRequestWithCacheCallback
public void onSuccess(JSONObject jSONObject) {
String str;
String optString = jSONObject == null ? null : jSONObject.optString("id");
if (optString == null) {
str = Profile.TAG;
Log.w(str, "No user ID returned on Me request");
} else {
String optString2 = jSONObject.optString("link");
String optString3 = jSONObject.optString("profile_picture", null);
Profile.Companion.setCurrentProfile(new Profile(optString, jSONObject.optString("first_name"), jSONObject.optString(AuthenticationTokenClaims.JSON_KEY_MIDDLE_NAME), jSONObject.optString("last_name"), jSONObject.optString("name"), optString2 != null ? Uri.parse(optString2) : null, optString3 != null ? Uri.parse(optString3) : null));
}
}
@Override // com.facebook.internal.Utility.GraphMeRequestWithCacheCallback
public void onFailure(FacebookException facebookException) {
String str;
str = Profile.TAG;
Log.e(str, Intrinsics.stringPlus("Got unexpected exception: ", facebookException));
}
});
}
}
}
}

View File

@@ -0,0 +1,53 @@
package com.facebook;
import android.content.SharedPreferences;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class ProfileCache {
public static final String CACHED_PROFILE_KEY = "com.facebook.ProfileManager.CachedProfile";
public static final Companion Companion = new Companion(null);
public static final String SHARED_PREFERENCES_NAME = "com.facebook.AccessTokenManager.SharedPreferences";
private final SharedPreferences sharedPreferences;
public ProfileCache() {
SharedPreferences sharedPreferences = FacebookSdk.getApplicationContext().getSharedPreferences("com.facebook.AccessTokenManager.SharedPreferences", 0);
Intrinsics.checkNotNullExpressionValue(sharedPreferences, "FacebookSdk.getApplicationContext()\n .getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE)");
this.sharedPreferences = sharedPreferences;
}
public final Profile load() {
String string = this.sharedPreferences.getString(CACHED_PROFILE_KEY, null);
if (string != null) {
try {
return new Profile(new JSONObject(string));
} catch (JSONException unused) {
}
}
return null;
}
public final void save(Profile profile) {
Intrinsics.checkNotNullParameter(profile, "profile");
JSONObject jSONObject = profile.toJSONObject();
if (jSONObject != null) {
this.sharedPreferences.edit().putString(CACHED_PROFILE_KEY, jSONObject.toString()).apply();
}
}
public final void clear() {
this.sharedPreferences.edit().remove(CACHED_PROFILE_KEY).apply();
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,103 @@
package com.facebook;
import android.content.Intent;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.facebook.internal.Utility;
import com.ironsource.f5;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class ProfileManager {
public static final String ACTION_CURRENT_PROFILE_CHANGED = "com.facebook.sdk.ACTION_CURRENT_PROFILE_CHANGED";
public static final Companion Companion = new Companion(null);
public static final String EXTRA_NEW_PROFILE = "com.facebook.sdk.EXTRA_NEW_PROFILE";
public static final String EXTRA_OLD_PROFILE = "com.facebook.sdk.EXTRA_OLD_PROFILE";
private static volatile ProfileManager instance;
private Profile currentProfileField;
private final LocalBroadcastManager localBroadcastManager;
private final ProfileCache profileCache;
public static final synchronized ProfileManager getInstance() {
ProfileManager companion;
synchronized (ProfileManager.class) {
companion = Companion.getInstance();
}
return companion;
}
public final Profile getCurrentProfile() {
return this.currentProfileField;
}
public ProfileManager(LocalBroadcastManager localBroadcastManager, ProfileCache profileCache) {
Intrinsics.checkNotNullParameter(localBroadcastManager, "localBroadcastManager");
Intrinsics.checkNotNullParameter(profileCache, "profileCache");
this.localBroadcastManager = localBroadcastManager;
this.profileCache = profileCache;
}
public final void setCurrentProfile(Profile profile) {
setCurrentProfile(profile, true);
}
public final boolean loadCurrentProfile() {
Profile load = this.profileCache.load();
if (load == null) {
return false;
}
setCurrentProfile(load, false);
return true;
}
private final void setCurrentProfile(Profile profile, boolean z) {
Profile profile2 = this.currentProfileField;
this.currentProfileField = profile;
if (z) {
if (profile != null) {
this.profileCache.save(profile);
} else {
this.profileCache.clear();
}
}
if (Utility.areObjectsEqual(profile2, profile)) {
return;
}
sendCurrentProfileChangedBroadcast(profile2, profile);
}
private final void sendCurrentProfileChangedBroadcast(Profile profile, Profile profile2) {
Intent intent = new Intent(ACTION_CURRENT_PROFILE_CHANGED);
intent.putExtra(EXTRA_OLD_PROFILE, profile);
intent.putExtra(EXTRA_NEW_PROFILE, profile2);
this.localBroadcastManager.sendBroadcast(intent);
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final synchronized ProfileManager getInstance() {
ProfileManager profileManager;
try {
if (ProfileManager.instance == null) {
LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(FacebookSdk.getApplicationContext());
Intrinsics.checkNotNullExpressionValue(localBroadcastManager, "getInstance(applicationContext)");
ProfileManager.instance = new ProfileManager(localBroadcastManager, new ProfileCache());
}
profileManager = ProfileManager.instance;
if (profileManager == null) {
Intrinsics.throwUninitializedPropertyAccessException(f5.o);
throw null;
}
} catch (Throwable th) {
throw th;
}
return profileManager;
}
}
}

View File

@@ -0,0 +1,70 @@
package com.facebook;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.facebook.internal.Validate;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public abstract class ProfileTracker {
private final LocalBroadcastManager broadcastManager;
private boolean isTracking;
private final BroadcastReceiver receiver;
public final boolean isTracking() {
return this.isTracking;
}
public abstract void onCurrentProfileChanged(Profile profile, Profile profile2);
public ProfileTracker() {
Validate.sdkInitialized();
this.receiver = new ProfileBroadcastReceiver(this);
LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(FacebookSdk.getApplicationContext());
Intrinsics.checkNotNullExpressionValue(localBroadcastManager, "getInstance(FacebookSdk.getApplicationContext())");
this.broadcastManager = localBroadcastManager;
startTracking();
}
public final void startTracking() {
if (this.isTracking) {
return;
}
addBroadcastReceiver();
this.isTracking = true;
}
public final void stopTracking() {
if (this.isTracking) {
this.broadcastManager.unregisterReceiver(this.receiver);
this.isTracking = false;
}
}
public final class ProfileBroadcastReceiver extends BroadcastReceiver {
final /* synthetic */ ProfileTracker this$0;
public ProfileBroadcastReceiver(ProfileTracker this$0) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
this.this$0 = this$0;
}
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(intent, "intent");
if (Intrinsics.areEqual(ProfileManager.ACTION_CURRENT_PROFILE_CHANGED, intent.getAction())) {
this.this$0.onCurrentProfileChanged((Profile) intent.getParcelableExtra(ProfileManager.EXTRA_OLD_PROFILE), (Profile) intent.getParcelableExtra(ProfileManager.EXTRA_NEW_PROFILE));
}
}
}
private final void addBroadcastReceiver() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(ProfileManager.ACTION_CURRENT_PROFILE_CHANGED);
this.broadcastManager.registerReceiver(this.receiver, intentFilter);
}
}

View File

@@ -0,0 +1,68 @@
package com.facebook;
import android.os.Handler;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class ProgressNoopOutputStream extends OutputStream implements RequestOutputStream {
private final Handler callbackHandler;
private GraphRequest currentRequest;
private RequestProgress currentRequestProgress;
private int maxProgress;
private final Map<GraphRequest, RequestProgress> progressMap = new HashMap();
public final int getMaxProgress() {
return this.maxProgress;
}
public final Map<GraphRequest, RequestProgress> getProgressMap() {
return this.progressMap;
}
public ProgressNoopOutputStream(Handler handler) {
this.callbackHandler = handler;
}
@Override // com.facebook.RequestOutputStream
public void setCurrentRequest(GraphRequest graphRequest) {
this.currentRequest = graphRequest;
this.currentRequestProgress = graphRequest != null ? this.progressMap.get(graphRequest) : null;
}
public final void addProgress(long j) {
GraphRequest graphRequest = this.currentRequest;
if (graphRequest == null) {
return;
}
if (this.currentRequestProgress == null) {
RequestProgress requestProgress = new RequestProgress(this.callbackHandler, graphRequest);
this.currentRequestProgress = requestProgress;
this.progressMap.put(graphRequest, requestProgress);
}
RequestProgress requestProgress2 = this.currentRequestProgress;
if (requestProgress2 != null) {
requestProgress2.addToMax(j);
}
this.maxProgress += (int) j;
}
@Override // java.io.OutputStream
public void write(byte[] buffer) {
Intrinsics.checkNotNullParameter(buffer, "buffer");
addProgress(buffer.length);
}
@Override // java.io.OutputStream
public void write(byte[] buffer, int i, int i2) {
Intrinsics.checkNotNullParameter(buffer, "buffer");
addProgress(i2);
}
@Override // java.io.OutputStream
public void write(int i) {
addProgress(1L);
}
}

View File

@@ -0,0 +1,115 @@
package com.facebook;
import android.os.Handler;
import com.facebook.GraphRequestBatch;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Iterator;
import java.util.Map;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class ProgressOutputStream extends FilterOutputStream implements RequestOutputStream {
private long batchProgress;
private RequestProgress currentRequestProgress;
private long lastReportedProgress;
private final long maxProgress;
private final Map<GraphRequest, RequestProgress> progressMap;
private final GraphRequestBatch requests;
private final long threshold;
public final long getBatchProgress() {
return this.batchProgress;
}
public final long getMaxProgress() {
return this.maxProgress;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public ProgressOutputStream(OutputStream out, GraphRequestBatch requests, Map<GraphRequest, RequestProgress> progressMap, long j) {
super(out);
Intrinsics.checkNotNullParameter(out, "out");
Intrinsics.checkNotNullParameter(requests, "requests");
Intrinsics.checkNotNullParameter(progressMap, "progressMap");
this.requests = requests;
this.progressMap = progressMap;
this.maxProgress = j;
this.threshold = FacebookSdk.getOnProgressThreshold();
}
private final void addProgress(long j) {
RequestProgress requestProgress = this.currentRequestProgress;
if (requestProgress != null) {
requestProgress.addProgress(j);
}
long j2 = this.batchProgress + j;
this.batchProgress = j2;
if (j2 >= this.lastReportedProgress + this.threshold || j2 >= this.maxProgress) {
reportBatchProgress();
}
}
private final void reportBatchProgress() {
if (this.batchProgress > this.lastReportedProgress) {
for (final GraphRequestBatch.Callback callback : this.requests.getCallbacks()) {
if (callback instanceof GraphRequestBatch.OnProgressCallback) {
Handler callbackHandler = this.requests.getCallbackHandler();
if ((callbackHandler == null ? null : Boolean.valueOf(callbackHandler.post(new Runnable() { // from class: com.facebook.ProgressOutputStream$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
ProgressOutputStream.m439reportBatchProgress$lambda0(GraphRequestBatch.Callback.this, this);
}
}))) == null) {
((GraphRequestBatch.OnProgressCallback) callback).onBatchProgress(this.requests, this.batchProgress, this.maxProgress);
}
}
}
this.lastReportedProgress = this.batchProgress;
}
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: reportBatchProgress$lambda-0, reason: not valid java name */
public static final void m439reportBatchProgress$lambda0(GraphRequestBatch.Callback callback, ProgressOutputStream this$0) {
Intrinsics.checkNotNullParameter(callback, "$callback");
Intrinsics.checkNotNullParameter(this$0, "this$0");
((GraphRequestBatch.OnProgressCallback) callback).onBatchProgress(this$0.requests, this$0.getBatchProgress(), this$0.getMaxProgress());
}
@Override // com.facebook.RequestOutputStream
public void setCurrentRequest(GraphRequest graphRequest) {
this.currentRequestProgress = graphRequest != null ? this.progressMap.get(graphRequest) : null;
}
@Override // java.io.FilterOutputStream, java.io.OutputStream
public void write(byte[] buffer) throws IOException {
Intrinsics.checkNotNullParameter(buffer, "buffer");
((FilterOutputStream) this).out.write(buffer);
addProgress(buffer.length);
}
@Override // java.io.FilterOutputStream, java.io.OutputStream
public void write(byte[] buffer, int i, int i2) throws IOException {
Intrinsics.checkNotNullParameter(buffer, "buffer");
((FilterOutputStream) this).out.write(buffer, i, i2);
addProgress(i2);
}
@Override // java.io.FilterOutputStream, java.io.OutputStream
public void write(int i) throws IOException {
((FilterOutputStream) this).out.write(i);
addProgress(1L);
}
@Override // java.io.FilterOutputStream, java.io.OutputStream, java.io.Closeable, java.lang.AutoCloseable
public void close() throws IOException {
super.close();
Iterator<RequestProgress> it = this.progressMap.values().iterator();
while (it.hasNext()) {
it.next().reportProgress();
}
reportBatchProgress();
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,6 @@
package com.facebook;
/* loaded from: classes2.dex */
public interface RequestOutputStream {
void setCurrentRequest(GraphRequest graphRequest);
}

View File

@@ -0,0 +1,69 @@
package com.facebook;
import android.os.Handler;
import com.facebook.GraphRequest;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes2.dex */
public final class RequestProgress {
private final Handler callbackHandler;
private long lastReportedProgress;
private long maxProgress;
private long progress;
private final GraphRequest request;
private final long threshold;
public final void addToMax(long j) {
this.maxProgress += j;
}
public final long getMaxProgress() {
return this.maxProgress;
}
public final long getProgress() {
return this.progress;
}
public RequestProgress(Handler handler, GraphRequest request) {
Intrinsics.checkNotNullParameter(request, "request");
this.callbackHandler = handler;
this.request = request;
this.threshold = FacebookSdk.getOnProgressThreshold();
}
public final void addProgress(long j) {
long j2 = this.progress + j;
this.progress = j2;
if (j2 >= this.lastReportedProgress + this.threshold || j2 >= this.maxProgress) {
reportProgress();
}
}
public final void reportProgress() {
if (this.progress > this.lastReportedProgress) {
final GraphRequest.Callback callback = this.request.getCallback();
final long j = this.maxProgress;
if (j <= 0 || !(callback instanceof GraphRequest.OnProgressCallback)) {
return;
}
final long j2 = this.progress;
Handler handler = this.callbackHandler;
if ((handler == null ? null : Boolean.valueOf(handler.post(new Runnable() { // from class: com.facebook.RequestProgress$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
RequestProgress.m440reportProgress$lambda0(GraphRequest.Callback.this, j2, j);
}
}))) == null) {
((GraphRequest.OnProgressCallback) callback).onProgress(j2, j);
}
this.lastReportedProgress = this.progress;
}
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: reportProgress$lambda-0, reason: not valid java name */
public static final void m440reportProgress$lambda0(GraphRequest.Callback callback, long j, long j2) {
((GraphRequest.OnProgressCallback) callback).onProgress(j, j2);
}
}

View File

@@ -0,0 +1,685 @@
package com.facebook;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import com.facebook.appevents.InternalAppEventsLogger;
import com.facebook.internal.AttributionIdentifiers;
import com.facebook.internal.FetchedAppSettings;
import com.facebook.internal.FetchedAppSettingsManager;
import com.facebook.internal.Utility;
import com.facebook.internal.instrument.crashshield.CrashShieldHandler;
import com.mbridge.msdk.MBridgeConstans;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class UserSettingsManager {
private static final String ADVERTISERID_COLLECTION_FALSE_WARNING = "The value for AdvertiserIDCollectionEnabled is currently set to FALSE so you're sending app events without collecting Advertiser ID. This can affect the quality of your advertising and analytics results.";
private static final String ADVERTISERID_COLLECTION_NOT_SET_WARNING = "You haven't set a value for AdvertiserIDCollectionEnabled. Set the flag to TRUE if you want to collect Advertiser ID for better advertising and analytics results. To request user consent before collecting data, set the flag value to FALSE, then change to TRUE once user consent is received. Learn more: https://developers.facebook.com/docs/app-events/getting-started-app-events-android#disable-auto-events.";
private static final String ADVERTISER_ID_KEY = "advertiser_id";
private static final String APPLICATION_FIELDS = "fields";
private static final String AUTO_APP_LINK_WARNING = "You haven't set the Auto App Link URL scheme: fb<YOUR APP ID> in AndroidManifest";
private static final String LAST_TIMESTAMP = "last_timestamp";
private static final long TIMEOUT_7D = 604800000;
private static final String USER_SETTINGS = "com.facebook.sdk.USER_SETTINGS";
private static final String USER_SETTINGS_BITMASK = "com.facebook.sdk.USER_SETTINGS_BITMASK";
private static final String VALUE = "value";
private static SharedPreferences userSettingPref;
public static final UserSettingsManager INSTANCE = new UserSettingsManager();
private static final String TAG = UserSettingsManager.class.getName();
private static final AtomicBoolean isInitialized = new AtomicBoolean(false);
private static final AtomicBoolean isFetchingCodelessStatus = new AtomicBoolean(false);
private static final UserSetting autoInitEnabled = new UserSetting(true, FacebookSdk.AUTO_INIT_ENABLED_PROPERTY);
private static final UserSetting autoLogAppEventsEnabledLocally = new UserSetting(true, FacebookSdk.AUTO_LOG_APP_EVENTS_ENABLED_PROPERTY);
private static final UserSetting advertiserIDCollectionEnabled = new UserSetting(true, FacebookSdk.ADVERTISER_ID_COLLECTION_ENABLED_PROPERTY);
private static final String EVENTS_CODELESS_SETUP_ENABLED = "auto_event_setup_enabled";
private static final UserSetting codelessSetupEnabled = new UserSetting(false, EVENTS_CODELESS_SETUP_ENABLED);
private static final UserSetting monitorEnabled = new UserSetting(true, FacebookSdk.MONITOR_ENABLED_PROPERTY);
private UserSettingsManager() {
}
private final void initializeIfNotInitialized() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
if (FacebookSdk.isInitialized() && isInitialized.compareAndSet(false, true)) {
SharedPreferences sharedPreferences = FacebookSdk.getApplicationContext().getSharedPreferences(USER_SETTINGS, 0);
Intrinsics.checkNotNullExpressionValue(sharedPreferences, "FacebookSdk.getApplicationContext()\n .getSharedPreferences(USER_SETTINGS, Context.MODE_PRIVATE)");
userSettingPref = sharedPreferences;
initializeUserSetting(autoLogAppEventsEnabledLocally, advertiserIDCollectionEnabled, autoInitEnabled);
initializeCodelessSetupEnabledAsync();
logWarnings();
logIfSDKSettingsChanged();
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
private final void initializeUserSetting(UserSetting... userSettingArr) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
int length = userSettingArr.length;
int i = 0;
while (i < length) {
UserSetting userSetting = userSettingArr[i];
i++;
if (userSetting == codelessSetupEnabled) {
initializeCodelessSetupEnabledAsync();
} else if (userSetting.getValue() == null) {
readSettingFromCache(userSetting);
if (userSetting.getValue() == null) {
loadSettingFromManifest(userSetting);
}
} else {
writeSettingToCache(userSetting);
}
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
private final void initializeCodelessSetupEnabledAsync() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
UserSetting userSetting = codelessSetupEnabled;
readSettingFromCache(userSetting);
final long currentTimeMillis = System.currentTimeMillis();
if (userSetting.getValue() == null || currentTimeMillis - userSetting.getLastTS() >= TIMEOUT_7D) {
userSetting.setValue(null);
userSetting.setLastTS(0L);
if (isFetchingCodelessStatus.compareAndSet(false, true)) {
FacebookSdk.getExecutor().execute(new Runnable() { // from class: com.facebook.UserSettingsManager$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
UserSettingsManager.m441initializeCodelessSetupEnabledAsync$lambda0(currentTimeMillis);
}
});
}
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: initializeCodelessSetupEnabledAsync$lambda-0, reason: not valid java name */
public static final void m441initializeCodelessSetupEnabledAsync$lambda0(long j) {
if (CrashShieldHandler.isObjectCrashing(UserSettingsManager.class)) {
return;
}
try {
if (advertiserIDCollectionEnabled.m442getValue()) {
FetchedAppSettingsManager fetchedAppSettingsManager = FetchedAppSettingsManager.INSTANCE;
FetchedAppSettings queryAppSettings = FetchedAppSettingsManager.queryAppSettings(FacebookSdk.getApplicationId(), false);
if (queryAppSettings != null && queryAppSettings.getCodelessEventsEnabled()) {
AttributionIdentifiers attributionIdentifiers = AttributionIdentifiers.Companion.getAttributionIdentifiers(FacebookSdk.getApplicationContext());
String androidAdvertiserId = (attributionIdentifiers == null || attributionIdentifiers.getAndroidAdvertiserId() == null) ? null : attributionIdentifiers.getAndroidAdvertiserId();
if (androidAdvertiserId != null) {
Bundle bundle = new Bundle();
bundle.putString(ADVERTISER_ID_KEY, androidAdvertiserId);
bundle.putString("fields", EVENTS_CODELESS_SETUP_ENABLED);
GraphRequest newGraphPathRequest = GraphRequest.Companion.newGraphPathRequest(null, MBridgeConstans.DYNAMIC_VIEW_WX_APP, null);
newGraphPathRequest.setParameters(bundle);
JSONObject jSONObject = newGraphPathRequest.executeAndWait().getJSONObject();
if (jSONObject != null) {
UserSetting userSetting = codelessSetupEnabled;
userSetting.setValue(Boolean.valueOf(jSONObject.optBoolean(EVENTS_CODELESS_SETUP_ENABLED, false)));
userSetting.setLastTS(j);
INSTANCE.writeSettingToCache(userSetting);
}
}
}
}
isFetchingCodelessStatus.set(false);
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, UserSettingsManager.class);
}
}
private final void writeSettingToCache(UserSetting userSetting) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
validateInitialized();
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("value", userSetting.getValue());
jSONObject.put(LAST_TIMESTAMP, userSetting.getLastTS());
SharedPreferences sharedPreferences = userSettingPref;
if (sharedPreferences != null) {
sharedPreferences.edit().putString(userSetting.getKey(), jSONObject.toString()).apply();
logIfSDKSettingsChanged();
} else {
Intrinsics.throwUninitializedPropertyAccessException("userSettingPref");
throw null;
}
} catch (Exception e) {
Utility utility = Utility.INSTANCE;
Utility.logd(TAG, e);
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
private final void readSettingFromCache(UserSetting userSetting) {
String str = "";
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
validateInitialized();
try {
SharedPreferences sharedPreferences = userSettingPref;
if (sharedPreferences != null) {
String string = sharedPreferences.getString(userSetting.getKey(), "");
if (string != null) {
str = string;
}
if (str.length() > 0) {
JSONObject jSONObject = new JSONObject(str);
userSetting.setValue(Boolean.valueOf(jSONObject.getBoolean("value")));
userSetting.setLastTS(jSONObject.getLong(LAST_TIMESTAMP));
return;
}
return;
}
Intrinsics.throwUninitializedPropertyAccessException("userSettingPref");
throw null;
} catch (JSONException e) {
Utility utility = Utility.INSTANCE;
Utility.logd(TAG, e);
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
private final void loadSettingFromManifest(UserSetting userSetting) {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
validateInitialized();
try {
Context applicationContext = FacebookSdk.getApplicationContext();
ApplicationInfo applicationInfo = applicationContext.getPackageManager().getApplicationInfo(applicationContext.getPackageName(), 128);
Intrinsics.checkNotNullExpressionValue(applicationInfo, "ctx.packageManager.getApplicationInfo(ctx.packageName, PackageManager.GET_META_DATA)");
Bundle bundle = applicationInfo.metaData;
if (bundle == null || !bundle.containsKey(userSetting.getKey())) {
return;
}
userSetting.setValue(Boolean.valueOf(applicationInfo.metaData.getBoolean(userSetting.getKey(), userSetting.getDefaultVal())));
} catch (PackageManager.NameNotFoundException e) {
Utility utility = Utility.INSTANCE;
Utility.logd(TAG, e);
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
private final void logWarnings() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
Context applicationContext = FacebookSdk.getApplicationContext();
ApplicationInfo applicationInfo = applicationContext.getPackageManager().getApplicationInfo(applicationContext.getPackageName(), 128);
Intrinsics.checkNotNullExpressionValue(applicationInfo, "ctx.packageManager.getApplicationInfo(ctx.packageName, PackageManager.GET_META_DATA)");
Bundle bundle = applicationInfo.metaData;
if (bundle != null) {
if (!bundle.containsKey(FacebookSdk.ADVERTISER_ID_COLLECTION_ENABLED_PROPERTY)) {
Log.w(TAG, ADVERTISERID_COLLECTION_NOT_SET_WARNING);
}
if (getAdvertiserIDCollectionEnabled()) {
return;
}
Log.w(TAG, ADVERTISERID_COLLECTION_FALSE_WARNING);
}
} catch (PackageManager.NameNotFoundException unused) {
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
private final void logIfSDKSettingsChanged() {
int i;
int i2;
ApplicationInfo applicationInfo;
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
if (isInitialized.get() && FacebookSdk.isInitialized()) {
Context applicationContext = FacebookSdk.getApplicationContext();
int i3 = 0;
int i4 = (autoInitEnabled.m442getValue() ? 1 : 0) | ((autoLogAppEventsEnabledLocally.m442getValue() ? 1 : 0) << 1) | ((advertiserIDCollectionEnabled.m442getValue() ? 1 : 0) << 2) | ((monitorEnabled.m442getValue() ? 1 : 0) << 3);
SharedPreferences sharedPreferences = userSettingPref;
if (sharedPreferences != null) {
int i5 = sharedPreferences.getInt(USER_SETTINGS_BITMASK, 0);
if (i5 != i4) {
SharedPreferences sharedPreferences2 = userSettingPref;
if (sharedPreferences2 != null) {
sharedPreferences2.edit().putInt(USER_SETTINGS_BITMASK, i4).apply();
try {
applicationInfo = applicationContext.getPackageManager().getApplicationInfo(applicationContext.getPackageName(), 128);
Intrinsics.checkNotNullExpressionValue(applicationInfo, "ctx.packageManager.getApplicationInfo(ctx.packageName, PackageManager.GET_META_DATA)");
} catch (PackageManager.NameNotFoundException unused) {
i = 0;
}
if (applicationInfo.metaData != null) {
String[] strArr = {FacebookSdk.AUTO_INIT_ENABLED_PROPERTY, FacebookSdk.AUTO_LOG_APP_EVENTS_ENABLED_PROPERTY, FacebookSdk.ADVERTISER_ID_COLLECTION_ENABLED_PROPERTY, FacebookSdk.MONITOR_ENABLED_PROPERTY};
boolean[] zArr = {true, true, true, true};
i = 0;
i2 = 0;
while (true) {
int i6 = i3 + 1;
try {
i |= (applicationInfo.metaData.containsKey(strArr[i3]) ? 1 : 0) << i3;
i2 |= (applicationInfo.metaData.getBoolean(strArr[i3], zArr[i3]) ? 1 : 0) << i3;
if (i6 > 3) {
break;
} else {
i3 = i6;
}
} catch (PackageManager.NameNotFoundException unused2) {
i3 = i2;
i2 = i3;
i3 = i;
InternalAppEventsLogger internalAppEventsLogger = new InternalAppEventsLogger(applicationContext);
Bundle bundle = new Bundle();
bundle.putInt("usage", i3);
bundle.putInt("initial", i2);
bundle.putInt("previous", i5);
bundle.putInt("current", i4);
internalAppEventsLogger.logChangedSettingsEvent(bundle);
return;
}
}
i3 = i;
InternalAppEventsLogger internalAppEventsLogger2 = new InternalAppEventsLogger(applicationContext);
Bundle bundle2 = new Bundle();
bundle2.putInt("usage", i3);
bundle2.putInt("initial", i2);
bundle2.putInt("previous", i5);
bundle2.putInt("current", i4);
internalAppEventsLogger2.logChangedSettingsEvent(bundle2);
return;
}
i2 = 0;
InternalAppEventsLogger internalAppEventsLogger22 = new InternalAppEventsLogger(applicationContext);
Bundle bundle22 = new Bundle();
bundle22.putInt("usage", i3);
bundle22.putInt("initial", i2);
bundle22.putInt("previous", i5);
bundle22.putInt("current", i4);
internalAppEventsLogger22.logChangedSettingsEvent(bundle22);
return;
}
Intrinsics.throwUninitializedPropertyAccessException("userSettingPref");
throw null;
}
return;
}
Intrinsics.throwUninitializedPropertyAccessException("userSettingPref");
throw null;
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
public static final void logIfAutoAppLinkEnabled() {
if (CrashShieldHandler.isObjectCrashing(UserSettingsManager.class)) {
return;
}
try {
Context applicationContext = FacebookSdk.getApplicationContext();
ApplicationInfo applicationInfo = applicationContext.getPackageManager().getApplicationInfo(applicationContext.getPackageName(), 128);
Intrinsics.checkNotNullExpressionValue(applicationInfo, "ctx.packageManager.getApplicationInfo(ctx.packageName, PackageManager.GET_META_DATA)");
Bundle bundle = applicationInfo.metaData;
if (bundle == null || !bundle.getBoolean("com.facebook.sdk.AutoAppLinkEnabled", false)) {
return;
}
InternalAppEventsLogger internalAppEventsLogger = new InternalAppEventsLogger(applicationContext);
Bundle bundle2 = new Bundle();
if (!Utility.isAutoAppLinkSetup()) {
bundle2.putString("SchemeWarning", AUTO_APP_LINK_WARNING);
Log.w(TAG, AUTO_APP_LINK_WARNING);
}
internalAppEventsLogger.logEvent("fb_auto_applink", bundle2);
} catch (PackageManager.NameNotFoundException unused) {
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, UserSettingsManager.class);
}
}
private final void validateInitialized() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return;
}
try {
if (isInitialized.get()) {
} else {
throw new FacebookSdkNotInitializedException("The UserSettingManager has not been initialized successfully");
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
}
}
public static final void setAutoInitEnabled(boolean z) {
if (CrashShieldHandler.isObjectCrashing(UserSettingsManager.class)) {
return;
}
try {
UserSetting userSetting = autoInitEnabled;
userSetting.setValue(Boolean.valueOf(z));
userSetting.setLastTS(System.currentTimeMillis());
if (isInitialized.get()) {
INSTANCE.writeSettingToCache(userSetting);
} else {
INSTANCE.initializeIfNotInitialized();
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, UserSettingsManager.class);
}
}
public static final boolean getAutoInitEnabled() {
if (CrashShieldHandler.isObjectCrashing(UserSettingsManager.class)) {
return false;
}
try {
INSTANCE.initializeIfNotInitialized();
return autoInitEnabled.m442getValue();
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, UserSettingsManager.class);
return false;
}
}
public static final void setAutoLogAppEventsEnabled(boolean z) {
if (CrashShieldHandler.isObjectCrashing(UserSettingsManager.class)) {
return;
}
try {
UserSetting userSetting = autoLogAppEventsEnabledLocally;
userSetting.setValue(Boolean.valueOf(z));
userSetting.setLastTS(System.currentTimeMillis());
if (isInitialized.get()) {
INSTANCE.writeSettingToCache(userSetting);
} else {
INSTANCE.initializeIfNotInitialized();
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, UserSettingsManager.class);
}
}
public static final boolean getAutoLogAppEventsEnabled() {
if (CrashShieldHandler.isObjectCrashing(UserSettingsManager.class)) {
return false;
}
try {
UserSettingsManager userSettingsManager = INSTANCE;
userSettingsManager.initializeIfNotInitialized();
return userSettingsManager.checkAutoLogAppEventsEnabled();
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, UserSettingsManager.class);
return false;
}
}
private final boolean checkAutoLogAppEventsEnabled() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return false;
}
try {
Map<String, Boolean> cachedMigratedAutoLogValuesInAppSettings = FetchedAppSettingsManager.getCachedMigratedAutoLogValuesInAppSettings();
if (cachedMigratedAutoLogValuesInAppSettings != null && !cachedMigratedAutoLogValuesInAppSettings.isEmpty()) {
Boolean bool = cachedMigratedAutoLogValuesInAppSettings.get(FetchedAppSettingsManager.AUTO_LOG_APP_EVENT_ENABLED_FIELD);
Boolean bool2 = cachedMigratedAutoLogValuesInAppSettings.get(FetchedAppSettingsManager.AUTO_LOG_APP_EVENTS_DEFAULT_FIELD);
if (bool != null) {
return bool.booleanValue();
}
Boolean checkClientSideConfiguration = checkClientSideConfiguration();
if (checkClientSideConfiguration != null) {
return checkClientSideConfiguration.booleanValue();
}
if (bool2 == null) {
return true;
}
return bool2.booleanValue();
}
return autoLogAppEventsEnabledLocally.m442getValue();
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return false;
}
}
private final Boolean checkClientSideConfiguration() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
Boolean readAutoLogAppEventsSettingFromCache = readAutoLogAppEventsSettingFromCache();
if (readAutoLogAppEventsSettingFromCache != null) {
return Boolean.valueOf(readAutoLogAppEventsSettingFromCache.booleanValue());
}
Boolean loadAutoLogAppEventsSettingFromManifest = loadAutoLogAppEventsSettingFromManifest();
if (loadAutoLogAppEventsSettingFromManifest == null) {
return null;
}
return Boolean.valueOf(loadAutoLogAppEventsSettingFromManifest.booleanValue());
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
}
private static final Boolean readAutoLogAppEventsSettingFromCache() {
SharedPreferences sharedPreferences;
String str = "";
if (CrashShieldHandler.isObjectCrashing(UserSettingsManager.class)) {
return null;
}
try {
INSTANCE.validateInitialized();
try {
sharedPreferences = userSettingPref;
} catch (JSONException e) {
Utility utility = Utility.INSTANCE;
Utility.logd(TAG, e);
}
if (sharedPreferences != null) {
String string = sharedPreferences.getString(autoLogAppEventsEnabledLocally.getKey(), "");
if (string != null) {
str = string;
}
if (str.length() > 0) {
return Boolean.valueOf(new JSONObject(str).getBoolean("value"));
}
return null;
}
Intrinsics.throwUninitializedPropertyAccessException("userSettingPref");
throw null;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, UserSettingsManager.class);
return null;
}
}
private final Boolean loadAutoLogAppEventsSettingFromManifest() {
if (CrashShieldHandler.isObjectCrashing(this)) {
return null;
}
try {
validateInitialized();
try {
Context applicationContext = FacebookSdk.getApplicationContext();
ApplicationInfo applicationInfo = applicationContext.getPackageManager().getApplicationInfo(applicationContext.getPackageName(), 128);
Intrinsics.checkNotNullExpressionValue(applicationInfo, "ctx.packageManager.getApplicationInfo(ctx.packageName, PackageManager.GET_META_DATA)");
Bundle bundle = applicationInfo.metaData;
if (bundle != null) {
UserSetting userSetting = autoLogAppEventsEnabledLocally;
if (bundle.containsKey(userSetting.getKey())) {
return Boolean.valueOf(applicationInfo.metaData.getBoolean(userSetting.getKey()));
}
}
} catch (PackageManager.NameNotFoundException e) {
Utility utility = Utility.INSTANCE;
Utility.logd(TAG, e);
}
return null;
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, this);
return null;
}
}
public static final void setAdvertiserIDCollectionEnabled(boolean z) {
if (CrashShieldHandler.isObjectCrashing(UserSettingsManager.class)) {
return;
}
try {
UserSetting userSetting = advertiserIDCollectionEnabled;
userSetting.setValue(Boolean.valueOf(z));
userSetting.setLastTS(System.currentTimeMillis());
if (isInitialized.get()) {
INSTANCE.writeSettingToCache(userSetting);
} else {
INSTANCE.initializeIfNotInitialized();
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, UserSettingsManager.class);
}
}
public static final boolean getAdvertiserIDCollectionEnabled() {
if (CrashShieldHandler.isObjectCrashing(UserSettingsManager.class)) {
return false;
}
try {
INSTANCE.initializeIfNotInitialized();
return advertiserIDCollectionEnabled.m442getValue();
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, UserSettingsManager.class);
return false;
}
}
public static final boolean getCodelessSetupEnabled() {
if (CrashShieldHandler.isObjectCrashing(UserSettingsManager.class)) {
return false;
}
try {
INSTANCE.initializeIfNotInitialized();
return codelessSetupEnabled.m442getValue();
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, UserSettingsManager.class);
return false;
}
}
public static final void setMonitorEnabled(boolean z) {
if (CrashShieldHandler.isObjectCrashing(UserSettingsManager.class)) {
return;
}
try {
UserSetting userSetting = monitorEnabled;
userSetting.setValue(Boolean.valueOf(z));
userSetting.setLastTS(System.currentTimeMillis());
if (isInitialized.get()) {
INSTANCE.writeSettingToCache(userSetting);
} else {
INSTANCE.initializeIfNotInitialized();
}
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, UserSettingsManager.class);
}
}
public static final boolean getMonitorEnabled() {
if (CrashShieldHandler.isObjectCrashing(UserSettingsManager.class)) {
return false;
}
try {
INSTANCE.initializeIfNotInitialized();
return monitorEnabled.m442getValue();
} catch (Throwable th) {
CrashShieldHandler.handleThrowable(th, UserSettingsManager.class);
return false;
}
}
public static final class UserSetting {
private boolean defaultVal;
private String key;
private long lastTS;
private Boolean value;
public final boolean getDefaultVal() {
return this.defaultVal;
}
public final String getKey() {
return this.key;
}
public final long getLastTS() {
return this.lastTS;
}
public final Boolean getValue() {
return this.value;
}
public final void setDefaultVal(boolean z) {
this.defaultVal = z;
}
public final void setKey(String str) {
Intrinsics.checkNotNullParameter(str, "<set-?>");
this.key = str;
}
public final void setLastTS(long j) {
this.lastTS = j;
}
public final void setValue(Boolean bool) {
this.value = bool;
}
public UserSetting(boolean z, String key) {
Intrinsics.checkNotNullParameter(key, "key");
this.defaultVal = z;
this.key = key;
}
/* renamed from: getValue, reason: collision with other method in class */
public final boolean m442getValue() {
Boolean bool = this.value;
return bool == null ? this.defaultVal : bool.booleanValue();
}
}
}

View File

@@ -0,0 +1,17 @@
package com.facebook;
/* loaded from: classes2.dex */
public final class WebDialog {
public static final WebDialog INSTANCE = new WebDialog();
private WebDialog() {
}
public static final int getWebDialogTheme() {
return com.facebook.internal.WebDialog.Companion.getWebDialogTheme();
}
public static final void setWebDialogTheme(int i) {
com.facebook.internal.WebDialog.Companion.setWebDialogTheme(i);
}
}

View File

@@ -0,0 +1,73 @@
package com.facebook.ads;
import androidx.annotation.Keep;
import com.facebook.infer.annotation.Nullsafe;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class AbstractAdListener implements InterstitialAdExtendedListener, RewardedVideoAdExtendedListener, RewardedInterstitialAdExtendedListener {
@Override // com.facebook.ads.AdListener
public void onAdClicked(Ad ad) {
}
@Override // com.facebook.ads.AdListener
public void onAdLoaded(Ad ad) {
}
@Override // com.facebook.ads.AdListener
public void onError(Ad ad, AdError adError) {
}
@Override // com.facebook.ads.InterstitialAdExtendedListener
public void onInterstitialActivityDestroyed() {
}
@Override // com.facebook.ads.InterstitialAdListener
public void onInterstitialDismissed(Ad ad) {
}
@Override // com.facebook.ads.InterstitialAdListener
public void onInterstitialDisplayed(Ad ad) {
}
@Override // com.facebook.ads.AdListener
public void onLoggingImpression(Ad ad) {
}
@Override // com.facebook.ads.RewardedAdListener
public void onRewardedAdCompleted() {
}
@Override // com.facebook.ads.RewardedAdListener
public void onRewardedAdServerFailed() {
}
@Override // com.facebook.ads.RewardedAdListener
public void onRewardedAdServerSucceeded() {
}
@Override // com.facebook.ads.RewardedInterstitialAdExtendedListener
public void onRewardedInterstitialActivityDestroyed() {
}
@Override // com.facebook.ads.RewardedInterstitialAdListener
public void onRewardedInterstitialClosed() {
}
@Override // com.facebook.ads.RewardedInterstitialAdListener
public void onRewardedInterstitialCompleted() {
}
@Override // com.facebook.ads.RewardedVideoAdExtendedListener
public void onRewardedVideoActivityDestroyed() {
}
@Override // com.facebook.ads.RewardedVideoAdListener
public void onRewardedVideoClosed() {
}
@Override // com.facebook.ads.RewardedVideoAdListener
public void onRewardedVideoCompleted() {
}
}

View File

@@ -0,0 +1,38 @@
package com.facebook.ads;
import androidx.annotation.Keep;
import com.facebook.ads.internal.bench.Benchmark;
@Keep
/* loaded from: classes2.dex */
public interface Ad {
@Keep
public interface LoadAdConfig {
}
@Keep
public interface LoadConfigBuilder {
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
LoadAdConfig build();
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
LoadConfigBuilder withBid(String str);
}
@Benchmark
void destroy();
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
String getPlacementId();
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
boolean isAdInvalidated();
@Benchmark
void loadAd();
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
@Deprecated
void setExtraHints(ExtraHints extraHints);
}

View File

@@ -0,0 +1,68 @@
package com.facebook.ads;
import android.text.TextUtils;
import androidx.annotation.Keep;
import com.facebook.infer.annotation.Nullsafe;
import com.mbridge.msdk.newreward.function.common.MBridgeError;
import java.util.Locale;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class AdError {
public static final int API_NOT_SUPPORTED = 7006;
public static final int BROKEN_MEDIA_ERROR_CODE = 2100;
public static final int CACHE_ERROR_CODE = 2002;
public static final int CLEAR_TEXT_SUPPORT_NOT_ALLOWED = 7003;
public static final int ICONVIEW_MISSING_ERROR_CODE = 6002;
public static final int INCORRECT_STATE_ERROR = 7004;
public static final int INTERNAL_ERROR_2003 = 2003;
public static final int INTERNAL_ERROR_2004 = 2004;
public static final int INTERNAL_ERROR_2006 = 2006;
public static final int INTERNAL_ERROR_CODE = 2001;
public static final int INTERSTITIAL_AD_TIMEOUT = 2009;
public static final int LOAD_CALLED_WHILE_SHOWING_AD = 7002;
public static final int LOAD_TOO_FREQUENTLY_ERROR_CODE = 1002;
public static final int MEDIATION_ERROR_CODE = 3001;
public static final int MEDIAVIEW_MISSING_ERROR_CODE = 6001;
public static final int MISSING_DEPENDENCIES_ERROR = 7005;
public static final int NATIVE_AD_IS_NOT_LOADED = 7007;
public static final int NETWORK_ERROR_CODE = 1000;
public static final int NO_FILL_ERROR_CODE = 1001;
public static final int REMOTE_ADS_SERVICE_ERROR = 2008;
public static final int SERVER_ERROR_CODE = 2000;
private final int errorCode;
private final String errorMessage;
public static final AdError NETWORK_ERROR = new AdError(1000, "Network Error");
public static final AdError NO_FILL = new AdError(1001, "No Fill");
public static final AdError LOAD_TOO_FREQUENTLY = new AdError(1002, "Ad was re-loaded too frequently");
public static final AdError SERVER_ERROR = new AdError(2000, "Server Error");
public static final AdError INTERNAL_ERROR = new AdError(2001, "Internal Error");
public static final AdError CACHE_ERROR = new AdError(2002, "Cache Error");
public static final int AD_PRESENTATION_ERROR_CODE = 9001;
public static final AdError AD_PRESENTATION_ERROR = new AdError(AD_PRESENTATION_ERROR_CODE, "Ad could not be presented");
public static final AdError MEDIATION_ERROR = new AdError(3001, "Mediation Error");
public static final AdError BROKEN_MEDIA_ERROR = new AdError(2100, "Native ad failed to load its media");
public static final int AD_ASSETS_UNSUPPORTED_TYPE_ERROR_CODE = 6003;
public static final AdError AD_ASSETS_UNSUPPORTED_TYPE_ERROR = new AdError(AD_ASSETS_UNSUPPORTED_TYPE_ERROR_CODE, "unsupported type of ad assets");
public static final int SHOW_CALLED_BEFORE_LOAD_ERROR_CODE = 7001;
public static final AdError SHOW_CALLED_BEFORE_LOAD_ERROR = new AdError(SHOW_CALLED_BEFORE_LOAD_ERROR_CODE, "Ad not loaded. First call loadAd() and wait for onAdLoaded() to be invoked before executing show()");
public int getErrorCode() {
return this.errorCode;
}
public String getErrorMessage() {
return this.errorMessage;
}
public AdError(int i, String str) {
str = TextUtils.isEmpty(str) ? MBridgeError.ERROR_MESSAGE_UN_KNOWN : str;
this.errorCode = i;
this.errorMessage = str;
}
public static AdError internalError(int i) {
return new AdError(i, String.format(Locale.US, "Internal error %d", Integer.valueOf(i)));
}
}

View File

@@ -0,0 +1,23 @@
package com.facebook.ads;
import androidx.annotation.Keep;
import com.facebook.infer.annotation.Nullsafe;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public enum AdExperienceType {
AD_EXPERIENCE_TYPE_REWARDED("ad_experience_config_rewarded"),
AD_EXPERIENCE_TYPE_REWARDED_INTERSTITIAL("ad_experience_config_rewarded_interstitial"),
AD_EXPERIENCE_TYPE_INTERSTITIAL("ad_experience_config_interstitial");
private String adExperienceType;
public String getAdExperienceType() {
return this.adExperienceType;
}
AdExperienceType(String str) {
this.adExperienceType = str;
}
}

View File

@@ -0,0 +1,20 @@
package com.facebook.ads;
import androidx.annotation.Keep;
import com.facebook.ads.internal.bench.Benchmark;
@Keep
/* loaded from: classes2.dex */
public interface AdListener {
@Benchmark
void onAdClicked(Ad ad);
@Benchmark
void onAdLoaded(Ad ad);
@Benchmark
void onError(Ad ad, AdError adError);
@Benchmark
void onLoggingImpression(Ad ad);
}

View File

@@ -0,0 +1,48 @@
package com.facebook.ads;
import android.content.Context;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import com.facebook.ads.internal.api.AdComponentFrameLayout;
import com.facebook.ads.internal.api.AdOptionsViewApi;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.infer.annotation.Nullsafe;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class AdOptionsView extends AdComponentFrameLayout {
private final AdOptionsViewApi mAdOptionsViewApi;
@Keep
public enum Orientation {
HORIZONTAL,
VERTICAL
}
public AdOptionsView(Context context, NativeAdBase nativeAdBase, @Nullable NativeAdLayout nativeAdLayout) {
super(context);
AdOptionsViewApi createAdOptionsView = DynamicLoaderFactory.makeLoader(context).createAdOptionsView(context, nativeAdBase, nativeAdLayout, this);
this.mAdOptionsViewApi = createAdOptionsView;
attachAdComponentViewApi(createAdOptionsView);
}
public AdOptionsView(Context context, NativeAdBase nativeAdBase, @Nullable NativeAdLayout nativeAdLayout, Orientation orientation, int i) {
super(context);
AdOptionsViewApi createAdOptionsView = DynamicLoaderFactory.makeLoader(context).createAdOptionsView(context, nativeAdBase, nativeAdLayout, orientation, i, this);
this.mAdOptionsViewApi = createAdOptionsView;
attachAdComponentViewApi(createAdOptionsView);
}
public void setIconColor(int i) {
this.mAdOptionsViewApi.setIconColor(i);
}
public void setIconSizeDp(int i) {
this.mAdOptionsViewApi.setIconSizeDp(i);
}
public void setSingleIcon(boolean z) {
this.mAdOptionsViewApi.setSingleIcon(z);
}
}

View File

@@ -0,0 +1,25 @@
package com.facebook.ads;
import android.os.Bundle;
import androidx.annotation.Keep;
import com.facebook.infer.annotation.Nullsafe;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public interface AdSDKNotificationListener {
public static final String ENCRYPTED_CPM_KEY = "encrypted_cpm";
public static final String IMPRESSION_EVENT = "impression";
@Retention(RetentionPolicy.SOURCE)
public @interface SDKEventKey {
}
@Retention(RetentionPolicy.SOURCE)
public @interface SDKEventType {
}
void onAdEvent(String str, Bundle bundle);
}

View File

@@ -0,0 +1,32 @@
package com.facebook.ads;
import androidx.annotation.Keep;
import com.facebook.infer.annotation.Nullsafe;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class AdSDKNotificationManager {
private static final List<AdSDKNotificationListener> sNotificationListeners = Collections.synchronizedList(new ArrayList());
public static List<AdSDKNotificationListener> getNotificationListeners() {
return sNotificationListeners;
}
public static void addSDKNotificationListener(AdSDKNotificationListener adSDKNotificationListener) {
List<AdSDKNotificationListener> list = sNotificationListeners;
synchronized (list) {
list.add(adSDKNotificationListener);
}
}
public static void removeSDKNotificationListener(AdSDKNotificationListener adSDKNotificationListener) {
List<AdSDKNotificationListener> list = sNotificationListeners;
synchronized (list) {
list.remove(adSDKNotificationListener);
}
}
}

View File

@@ -0,0 +1,159 @@
package com.facebook.ads;
import android.content.Context;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import com.facebook.ads.internal.settings.AdInternalSettings;
import com.facebook.ads.internal.settings.MultithreadedBundleWrapper;
import com.facebook.infer.annotation.Nullsafe;
import java.io.Serializable;
import java.util.Collection;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class AdSettings {
public static final boolean DEBUG = false;
@Keep
public enum IntegrationErrorMode {
INTEGRATION_ERROR_CRASH_DEBUG_MODE,
INTEGRATION_ERROR_CALLBACK_MODE;
public static final long serialVersionUID = 1;
}
@Keep
public enum TestAdType implements Serializable {
DEFAULT("DEFAULT", "Default"),
IMG_16_9_APP_INSTALL("IMG_16_9_APP_INSTALL", "Image App install"),
IMG_16_9_LINK("IMG_16_9_LINK", "Image link"),
VIDEO_HD_16_9_46S_APP_INSTALL("VID_HD_16_9_46S_APP_INSTALL", "Video 46 sec App install"),
VIDEO_HD_16_9_46S_LINK("VID_HD_16_9_46S_LINK", "Video 46 sec link"),
VIDEO_HD_16_9_15S_APP_INSTALL("VID_HD_16_9_15S_APP_INSTALL", "Video 15 sec App install"),
VIDEO_HD_16_9_15S_LINK("VID_HD_16_9_15S_LINK", "Video 15 sec link"),
VIDEO_HD_9_16_39S_APP_INSTALL("VID_HD_9_16_39S_APP_INSTALL", "Video 39 sec App install"),
VIDEO_HD_9_16_39S_LINK("VID_HD_9_16_39S_LINK", "Video 39 sec link"),
CAROUSEL_IMG_SQUARE_APP_INSTALL("CAROUSEL_IMG_SQUARE_APP_INSTALL", "Carousel App install"),
CAROUSEL_IMG_SQUARE_LINK("CAROUSEL_IMG_SQUARE_LINK", "Carousel link"),
PLAYABLE("PLAYABLE", "Playable ad");
public static final long serialVersionUID = 1;
private final String adTypeString;
private final String humanReadable;
public String getAdTypeString() {
return this.adTypeString;
}
public String getHumanReadable() {
return this.humanReadable;
}
TestAdType(String str, String str2) {
this.adTypeString = str;
this.humanReadable = str2;
}
}
public static void setDebugBuild(boolean z) {
AdInternalSettings.setDebugBuild(z);
}
public static void turnOnSDKDebugger(Context context) {
AdInternalSettings.turnOnSDKDebugger(context);
}
public static void addTestDevice(String str) {
AdInternalSettings.addTestDevice(str);
}
public static void addTestDevices(Collection<String> collection) {
AdInternalSettings.addTestDevices(collection);
}
public static void clearTestDevices() {
AdInternalSettings.clearTestDevices();
}
public static boolean isTestMode(Context context) {
return AdInternalSettings.isTestMode(context);
}
public static void setTestMode(boolean z) {
AdInternalSettings.setTestMode(z);
}
public static void setUrlPrefix(@Nullable String str) {
AdInternalSettings.setUrlPrefix(str);
}
@Nullable
public static String getUrlPrefix() {
return AdInternalSettings.getUrlPrefix();
}
public static boolean isVideoAutoplay() {
return AdInternalSettings.isVideoAutoplay();
}
public static boolean isVideoAutoplayOnMobile() {
return AdInternalSettings.isVideoAutoplayOnMobile();
}
public static void setVideoAutoplay(boolean z) {
AdInternalSettings.setVideoAutoplay(z);
}
public static void setVideoAutoplayOnMobile(boolean z) {
AdInternalSettings.setVideoAutoplayOnMobile(z);
}
public static void setMediationService(String str) {
AdInternalSettings.setMediationService(str);
}
@Nullable
public static String getMediationService() {
return AdInternalSettings.getMediationService();
}
public static void setMixedAudience(boolean z) {
AdInternalSettings.sSettingsBundle.putBoolean(AdInternalSettings.BOOL_MIXED_AUDIENCE_KEY, z);
}
public static boolean isMixedAudience() {
return AdInternalSettings.sSettingsBundle.getBoolean(AdInternalSettings.BOOL_MIXED_AUDIENCE_KEY, false);
}
public static void setTestAdType(TestAdType testAdType) {
AdInternalSettings.sSettingsBundle.putSerializable(AdInternalSettings.TEST_AD_TYPE_KEY, testAdType);
}
public static TestAdType getTestAdType() {
MultithreadedBundleWrapper multithreadedBundleWrapper = AdInternalSettings.sSettingsBundle;
Serializable serializable = multithreadedBundleWrapper.getSerializable(AdInternalSettings.TEST_AD_TYPE_KEY);
if (!(serializable instanceof TestAdType)) {
TestAdType testAdType = TestAdType.DEFAULT;
multithreadedBundleWrapper.putSerializable(AdInternalSettings.TEST_AD_TYPE_KEY, testAdType);
return testAdType;
}
return (TestAdType) serializable;
}
public static void setVisibleAnimation(boolean z) {
AdInternalSettings.setVisibleAnimation(z);
}
public static void setIntegrationErrorMode(IntegrationErrorMode integrationErrorMode) {
AdInternalSettings.sSettingsBundle.putSerializable(AdInternalSettings.SRL_INTEGRATION_ERROR_MODE_KEY, integrationErrorMode);
}
public static void setDataProcessingOptions(String[] strArr) {
AdInternalSettings.setDataProcessingOptions(strArr, null, null);
}
public static void setDataProcessingOptions(String[] strArr, int i, int i2) {
AdInternalSettings.setDataProcessingOptions(strArr, Integer.valueOf(i), Integer.valueOf(i2));
}
}

View File

@@ -0,0 +1,98 @@
package com.facebook.ads;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import com.facebook.ads.internal.api.AdSizeApi;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.infer.annotation.Nullsafe;
import java.io.Serializable;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class AdSize implements Serializable {
private final int UNDEFINED;
@Nullable
private AdSizeApi mAdSizeApi;
private final int mInitHeight;
private final int mInitSizeType;
private final int mInitWidth;
@Deprecated
public static final AdSize BANNER_320_50 = new AdSize(4);
public static final AdSize INTERSTITIAL = new AdSize(100);
public static final AdSize BANNER_HEIGHT_50 = new AdSize(5);
public static final AdSize BANNER_HEIGHT_90 = new AdSize(6);
public static final AdSize RECTANGLE_HEIGHT_250 = new AdSize(7);
public AdSize(int i, int i2) {
this.UNDEFINED = -1;
this.mInitSizeType = -1;
this.mInitWidth = i;
this.mInitHeight = i2;
}
private AdSize(int i) {
this.UNDEFINED = -1;
this.mInitSizeType = i;
this.mInitWidth = -1;
this.mInitHeight = -1;
}
public int getWidth() {
int i = this.mInitSizeType;
return i != -1 ? getAdSizeApi(i).getWidth() : this.mInitWidth;
}
public int getHeight() {
int i = this.mInitSizeType;
return i != -1 ? getAdSizeApi(i).getHeight() : this.mInitHeight;
}
public static AdSize fromWidthAndHeight(int i, int i2) {
AdSize adSize = INTERSTITIAL;
if (adSize.getHeight() == i2 && adSize.getWidth() == i) {
return adSize;
}
AdSize adSize2 = BANNER_320_50;
if (adSize2.getHeight() == i2 && adSize2.getWidth() == i) {
return adSize2;
}
AdSize adSize3 = BANNER_HEIGHT_50;
if (adSize3.getHeight() == i2 && adSize3.getWidth() == i) {
return adSize3;
}
AdSize adSize4 = BANNER_HEIGHT_90;
if (adSize4.getHeight() == i2 && adSize4.getWidth() == i) {
return adSize4;
}
AdSize adSize5 = RECTANGLE_HEIGHT_250;
if (adSize5.getHeight() == i2 && adSize5.getWidth() == i) {
return adSize5;
}
throw new IllegalArgumentException("Can't create AdSize using this width = " + i + " && height = " + i2);
}
public boolean equals(@Nullable Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
AdSize adSize = (AdSize) obj;
return getWidth() == adSize.getWidth() && getHeight() == adSize.getHeight();
}
public int hashCode() {
return (getWidth() * 31) + getHeight();
}
private AdSizeApi getAdSizeApi(int i) {
if (this.mAdSizeApi == null) {
this.mAdSizeApi = DynamicLoaderFactory.makeLoaderUnsafe().createAdSizeApi(i);
}
return this.mAdSizeApi;
}
}

View File

@@ -0,0 +1,108 @@
package com.facebook.ads;
import android.content.Context;
import android.content.res.Configuration;
import android.widget.RelativeLayout;
import androidx.annotation.Keep;
import com.facebook.ads.Ad;
import com.facebook.ads.internal.api.AdViewApi;
import com.facebook.ads.internal.api.AdViewParentApi;
import com.facebook.ads.internal.bench.Benchmark;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.infer.annotation.Nullsafe;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class AdView extends RelativeLayout implements Ad {
private final AdViewApi mAdViewApi;
private final AdViewParentApi mAdViewParentApi;
@Keep
public interface AdViewLoadConfig extends Ad.LoadAdConfig {
}
@Keep
public interface AdViewLoadConfigBuilder extends Ad.LoadConfigBuilder {
@Override // com.facebook.ads.Ad.LoadConfigBuilder
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
AdViewLoadConfig build();
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
AdViewLoadConfigBuilder withAdListener(AdListener adListener);
@Override // com.facebook.ads.Ad.LoadConfigBuilder
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
AdViewLoadConfigBuilder withBid(String str);
}
@Benchmark
public AdView(Context context, String str, AdSize adSize) {
super(context);
AdViewParentApi adViewParentApi = new AdViewParentApi() { // from class: com.facebook.ads.AdView.1
@Override // com.facebook.ads.internal.api.AdViewParentApi
@Benchmark
public void onConfigurationChanged(Configuration configuration) {
AdView.super.onConfigurationChanged(configuration);
}
};
this.mAdViewParentApi = adViewParentApi;
this.mAdViewApi = DynamicLoaderFactory.makeLoader(context).createAdViewApi(context, str, adSize, adViewParentApi, this);
}
@Benchmark
public AdView(Context context, String str, String str2) throws Exception {
super(context);
AdViewParentApi adViewParentApi = new AdViewParentApi() { // from class: com.facebook.ads.AdView.1
@Override // com.facebook.ads.internal.api.AdViewParentApi
@Benchmark
public void onConfigurationChanged(Configuration configuration) {
AdView.super.onConfigurationChanged(configuration);
}
};
this.mAdViewParentApi = adViewParentApi;
this.mAdViewApi = DynamicLoaderFactory.makeLoader(context).createAdViewApi(context, str, str2, adViewParentApi, this);
}
@Override // com.facebook.ads.Ad
@Benchmark
public void loadAd() {
this.mAdViewApi.loadAd();
}
@Benchmark
public void loadAd(AdViewLoadConfig adViewLoadConfig) {
this.mAdViewApi.loadAd(adViewLoadConfig);
}
@Override // com.facebook.ads.Ad
public boolean isAdInvalidated() {
return this.mAdViewApi.isAdInvalidated();
}
@Override // com.facebook.ads.Ad
@Deprecated
public void setExtraHints(ExtraHints extraHints) {
this.mAdViewApi.setExtraHints(extraHints);
}
@Override // com.facebook.ads.Ad
public void destroy() {
this.mAdViewApi.destroy();
}
@Override // com.facebook.ads.Ad
public String getPlacementId() {
return this.mAdViewApi.getPlacementId();
}
@Override // android.view.View
public void onConfigurationChanged(Configuration configuration) {
this.mAdViewApi.onConfigurationChanged(configuration);
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public AdViewLoadConfigBuilder buildLoadAdConfig() {
return this.mAdViewApi.buildLoadAdConfig();
}
}

View File

@@ -0,0 +1,154 @@
package com.facebook.ads;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.MotionEvent;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import com.facebook.ads.internal.api.AudienceNetworkActivityApi;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import java.io.FileDescriptor;
import java.io.PrintWriter;
@Keep
@SuppressLint({"MissingSuperCall"})
/* loaded from: classes2.dex */
public class AudienceNetworkActivity extends Activity {
private AudienceNetworkActivityApi mAudienceNetworkActivityApi;
private final AudienceNetworkActivityApi mAudienceNetworkActivityParentApi = new AudienceNetworkActivityApi() { // from class: com.facebook.ads.AudienceNetworkActivity.1
@Override // com.facebook.ads.internal.api.AudienceNetworkActivityApi
public void onCreate(Bundle bundle) {
AudienceNetworkActivity.super.onCreate(bundle);
}
@Override // com.facebook.ads.internal.api.AudienceNetworkActivityApi
public void onStart() {
AudienceNetworkActivity.super.onStart();
}
@Override // com.facebook.ads.internal.api.AudienceNetworkActivityApi
public void onPause() {
AudienceNetworkActivity.super.onPause();
}
@Override // com.facebook.ads.internal.api.AudienceNetworkActivityApi
public void onResume() {
AudienceNetworkActivity.super.onResume();
}
@Override // com.facebook.ads.internal.api.AudienceNetworkActivityApi
public void onStop() {
AudienceNetworkActivity.super.onStop();
}
@Override // com.facebook.ads.internal.api.AudienceNetworkActivityApi
public void onSaveInstanceState(Bundle bundle) {
AudienceNetworkActivity.super.onSaveInstanceState(bundle);
}
@Override // com.facebook.ads.internal.api.AudienceNetworkActivityApi
public void finish(int i) {
AudienceNetworkActivity.super.finish();
}
@Override // com.facebook.ads.internal.api.AudienceNetworkActivityApi
public void onDestroy() {
AudienceNetworkActivity.super.onDestroy();
}
@Override // com.facebook.ads.internal.api.AudienceNetworkActivityApi
public void onBackPressed() {
AudienceNetworkActivity.super.onBackPressed();
}
@Override // com.facebook.ads.internal.api.AudienceNetworkActivityApi
public void onConfigurationChanged(Configuration configuration) {
AudienceNetworkActivity.super.onConfigurationChanged(configuration);
}
@Override // com.facebook.ads.internal.api.AudienceNetworkActivityApi
public boolean onTouchEvent(MotionEvent motionEvent) {
return AudienceNetworkActivity.super.onTouchEvent(motionEvent);
}
@Override // com.facebook.ads.internal.api.AudienceNetworkActivityApi
public void onActivityResult(int i, int i2, Intent intent) {
AudienceNetworkActivity.super.onActivityResult(i, i2, intent);
}
@Override // com.facebook.ads.internal.api.AudienceNetworkActivityApi
public void dump(String str, @Nullable FileDescriptor fileDescriptor, PrintWriter printWriter, @Nullable String[] strArr) {
AudienceNetworkActivity.super.dump(str, fileDescriptor, printWriter, strArr);
}
};
@Override // android.app.Activity
public void onCreate(Bundle bundle) {
AudienceNetworkActivityApi createAudienceNetworkActivity = DynamicLoaderFactory.makeLoader(this).createAudienceNetworkActivity(this, this.mAudienceNetworkActivityParentApi);
this.mAudienceNetworkActivityApi = createAudienceNetworkActivity;
createAudienceNetworkActivity.onCreate(bundle);
}
@Override // android.app.Activity
public void onStart() {
this.mAudienceNetworkActivityApi.onStart();
}
@Override // android.app.Activity
public void onResume() {
this.mAudienceNetworkActivityApi.onResume();
}
@Override // android.app.Activity
public void onPause() {
this.mAudienceNetworkActivityApi.onPause();
}
@Override // android.app.Activity
public void onSaveInstanceState(Bundle bundle) {
this.mAudienceNetworkActivityApi.onSaveInstanceState(bundle);
}
@Override // android.app.Activity
public void finish() {
this.mAudienceNetworkActivityApi.finish(0);
}
@Override // android.app.Activity
public void onStop() {
this.mAudienceNetworkActivityApi.onStop();
}
@Override // android.app.Activity
public void onDestroy() {
this.mAudienceNetworkActivityApi.onDestroy();
}
@Override // android.app.Activity
public void onBackPressed() {
this.mAudienceNetworkActivityApi.onBackPressed();
}
@Override // android.app.Activity, android.content.ComponentCallbacks
public void onConfigurationChanged(Configuration configuration) {
this.mAudienceNetworkActivityApi.onConfigurationChanged(configuration);
}
@Override // android.app.Activity
public boolean onTouchEvent(MotionEvent motionEvent) {
return this.mAudienceNetworkActivityApi.onTouchEvent(motionEvent);
}
@Override // android.app.Activity
public void onActivityResult(int i, int i2, Intent intent) {
this.mAudienceNetworkActivityApi.onActivityResult(i, i2, intent);
}
@Override // android.app.Activity
public void dump(String str, @Nullable FileDescriptor fileDescriptor, PrintWriter printWriter, @Nullable String[] strArr) {
this.mAudienceNetworkActivityApi.dump(str, fileDescriptor, printWriter, strArr);
}
}

View File

@@ -0,0 +1,75 @@
package com.facebook.ads;
import android.content.Context;
import androidx.annotation.Keep;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.ads.internal.util.common.Preconditions;
import com.facebook.infer.annotation.Nullsafe;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.List;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public final class AudienceNetworkAds {
public static final String TAG = "FBAudienceNetwork";
@Keep
@Retention(RetentionPolicy.SOURCE)
public @interface AdFormat {
public static final int BANNER = 1;
public static final int INTERSTITIAL = 2;
public static final int NATIVE = 4;
public static final int NATIVE_BANNER = 5;
public static final int REWARDED_VIDEO = 6;
public static final int UNKNOWN = 0;
}
@Keep
public interface InitListener {
void onInitialized(InitResult initResult);
}
@Keep
public interface InitResult {
String getMessage();
boolean isSuccess();
}
@Keep
public interface InitSettingsBuilder {
void initialize();
InitSettingsBuilder withInitListener(InitListener initListener);
InitSettingsBuilder withMediationService(String str);
InitSettingsBuilder withPlacementIds(List<String> list);
}
private AudienceNetworkAds() {
}
public static void initialize(Context context) {
Preconditions.checkNotNull(context, "Context can not be null.");
DynamicLoaderFactory.initialize(context, null, null, false);
}
public static boolean isInitialized(Context context) {
if (DynamicLoaderFactory.getDynamicLoader() == null) {
return false;
}
return DynamicLoaderFactory.makeLoader(context).createAudienceNetworkAdsApi().isInitialized();
}
public static InitSettingsBuilder buildInitSettings(Context context) {
Preconditions.checkNotNull(context, "Context can not be null.");
return new com.facebook.ads.internal.api.InitSettingsBuilder(context);
}
public static int getAdFormatForPlacement(Context context, String str) {
return DynamicLoaderFactory.makeLoader(context).createAudienceNetworkAdsApi().getAdFormatForPlacement(str);
}
}

View File

@@ -0,0 +1,52 @@
package com.facebook.ads;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import androidx.annotation.Nullable;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.infer.annotation.Nullsafe;
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class AudienceNetworkContentProvider extends ContentProvider {
@Override // android.content.ContentProvider
public int delete(Uri uri, @Nullable String str, @Nullable String[] strArr) {
return 0;
}
@Override // android.content.ContentProvider
@Nullable
public String getType(Uri uri) {
return null;
}
@Override // android.content.ContentProvider
@Nullable
public Uri insert(Uri uri, @Nullable ContentValues contentValues) {
return null;
}
@Override // android.content.ContentProvider
@Nullable
public Cursor query(Uri uri, @Nullable String[] strArr, @Nullable String str, @Nullable String[] strArr2, @Nullable String str2) {
return null;
}
@Override // android.content.ContentProvider
public int update(Uri uri, @Nullable ContentValues contentValues, @Nullable String str, @Nullable String[] strArr) {
return 0;
}
@Override // android.content.ContentProvider
public boolean onCreate() {
Context context = getContext();
if (context == null) {
return false;
}
DynamicLoaderFactory.initialize(context, null, null, true);
return false;
}
}

View File

@@ -0,0 +1,19 @@
package com.facebook.ads;
import android.content.Context;
import androidx.annotation.Keep;
import androidx.annotation.WorkerThread;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.ads.internal.util.common.Preconditions;
import com.facebook.infer.annotation.Nullsafe;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public final class BidderTokenProvider {
@WorkerThread
public static String getBidderToken(Context context) {
Preconditions.checkNotNull(context, "Context can not be null.");
return DynamicLoaderFactory.makeLoader(context).createBidderTokenProviderApi().getBidderToken(context);
}
}

View File

@@ -0,0 +1,9 @@
package com.facebook.ads;
/* loaded from: classes2.dex */
public final class BuildConfig {
public static final String APPLICATION_ID = "com.facebook.ads";
public static final String BUILD_TYPE = "releaseDL";
public static final boolean DEBUG = false;
public static final String VERSION_NAME = "6.18.0";
}

View File

@@ -0,0 +1,17 @@
package com.facebook.ads;
import androidx.annotation.Keep;
import com.facebook.infer.annotation.Nullsafe;
import java.util.EnumSet;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public enum CacheFlag {
NONE,
ICON,
IMAGE,
VIDEO;
public static final EnumSet<CacheFlag> ALL = EnumSet.allOf(CacheFlag.class);
}

View File

@@ -0,0 +1,49 @@
package com.facebook.ads;
import android.annotation.TargetApi;
import android.content.Context;
import android.util.AttributeSet;
import androidx.annotation.Keep;
import com.facebook.ads.internal.api.DefaultMediaViewVideoRendererApi;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.infer.annotation.Nullsafe;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public final class DefaultMediaViewVideoRenderer extends MediaViewVideoRenderer {
private DefaultMediaViewVideoRendererApi mDefaultMediaViewVideoRendererApi;
public DefaultMediaViewVideoRenderer(Context context) {
super(context);
initializeSelf(context);
}
public DefaultMediaViewVideoRenderer(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
initializeSelf(context);
}
public DefaultMediaViewVideoRenderer(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
initializeSelf(context);
}
@TargetApi(21)
public DefaultMediaViewVideoRenderer(Context context, AttributeSet attributeSet, int i, int i2) {
super(context, attributeSet, i, i2);
initializeSelf(context);
}
private void initializeSelf(Context context) {
DefaultMediaViewVideoRendererApi createDefaultMediaViewVideoRendererApi = DynamicLoaderFactory.makeLoader(context).createDefaultMediaViewVideoRendererApi();
this.mDefaultMediaViewVideoRendererApi = createDefaultMediaViewVideoRendererApi;
createDefaultMediaViewVideoRendererApi.initialize(context, this, getMediaViewVideoRendererApi(), 0);
}
@Override // com.facebook.ads.MediaViewVideoRenderer
public void onPrepared() {
super.onPrepared();
this.mDefaultMediaViewVideoRendererApi.onPrepared();
}
}

View File

@@ -0,0 +1,175 @@
package com.facebook.ads;
import android.text.TextUtils;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import com.facebook.share.internal.ShareConstants;
import csdk.gluads.Consts;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
@Keep
@Deprecated
/* loaded from: classes2.dex */
public class ExtraHints {
private static final String HINTS_JSON_KEY = "hints";
private static final int KEYWORDS_MAX_COUNT = 5;
private static final String KEYWORD_SEPARATOR = ";";
private final String mHintsSerialized;
@Nullable
private final String mMediationData;
public String getHints() {
return this.mHintsSerialized;
}
@Nullable
public String getMediationData() {
return this.mMediationData;
}
private ExtraHints(HashMap<HintType, String> hashMap, @Nullable String str) {
this.mMediationData = str;
JSONObject jSONObject = new JSONObject();
JSONObject jSONObject2 = new JSONObject();
for (Map.Entry<HintType, String> entry : hashMap.entrySet()) {
try {
jSONObject2.put(entry.getKey().mKey, entry.getValue());
} catch (JSONException unused) {
}
}
try {
jSONObject.put(HINTS_JSON_KEY, jSONObject2);
} catch (JSONException unused2) {
}
this.mHintsSerialized = jSONObject.toString();
}
public enum HintType {
KEYWORDS(Consts.EXTRA_KEYWORDS),
CONTENT_URL(ShareConstants.STORY_DEEP_LINK_URL),
EXTRA_DATA("extra_data");
private String mKey;
HintType(String str) {
this.mKey = str;
}
}
@Keep
@Deprecated
public enum Keyword {
ACCESSORIES("accessories"),
ART_HISTORY("art_history"),
AUTOMOTIVE("automotive"),
BEAUTY("beauty"),
BIOLOGY("biology"),
BOARD_GAMES("board_games"),
BUSINESS_SOFTWARE("business_software"),
BUYING_SELLING_HOMES("buying_selling_homes"),
CATS("cats"),
CELEBRITIES("celebrities"),
CLOTHING("clothing"),
COMIC_BOOKS("comic_books"),
DESKTOP_VIDEO("desktop_video"),
DOGS("dogs"),
EDUCATION("education"),
EMAIL("email"),
ENTERTAINMENT("entertainment"),
FAMILY_PARENTING("family_parenting"),
FASHION("fashion"),
FINE_ART("fine_art"),
FOOD_DRINK("food_drink"),
FRENCH_CUISINE("french_cuisine"),
GOVERNMENT("government"),
HEALTH_FITNESS("health_fitness"),
HOBBIES("hobbies"),
HOME_GARDEN("home_garden"),
HUMOR("humor"),
INTERNET_TECHNOLOGY("internet_technology"),
LARGE_ANIMALS("large_animals"),
LAW("law"),
LEGAL_ISSUES("legal_issues"),
LITERATURE("literature"),
MARKETING("marketing"),
MOVIES("movies"),
MUSIC("music"),
NEWS("news"),
PERSONAL_FINANCE("personal_finance"),
PETS("pets"),
PHOTOGRAPHY("photography"),
POLITICS("politics"),
REAL_ESTATE("real_estate"),
ROLEPLAYING_GAMES("roleplaying_games"),
SCIENCE("science"),
SHOPPING("shopping"),
SOCIETY("society"),
SPORTS("sports"),
TECHNOLOGY("technology"),
TELEVISION("television"),
TRAVEL("travel"),
VIDEO_COMPUTER_GAMES("video_computer_games");
private String mKeyword;
Keyword(String str) {
this.mKeyword = str;
}
}
@Keep
@Deprecated
public static class Builder {
private HashMap<HintType, String> mHints = new HashMap<>();
private String mMediationData;
@Deprecated
public Builder keywords(List<Keyword> list) {
return this;
}
public Builder extraData(String str) {
if (str == null) {
return this;
}
this.mHints.put(HintType.EXTRA_DATA, str);
return this;
}
public Builder contentUrl(String str) {
if (str == null) {
return this;
}
this.mHints.put(HintType.CONTENT_URL, str);
return this;
}
public Builder mediationData(String str) {
if (TextUtils.isEmpty(str)) {
return this;
}
this.mMediationData = str;
return this;
}
public ExtraHints build() {
return new ExtraHints(this.mHints, this.mMediationData);
}
}
private static String join(List<String> list) {
StringBuilder sb = new StringBuilder();
Iterator<String> it = list.iterator();
while (it.hasNext()) {
sb.append(it.next());
sb.append(KEYWORD_SEPARATOR);
}
return sb.toString();
}
}

View File

@@ -0,0 +1,23 @@
package com.facebook.ads;
import androidx.annotation.Keep;
import com.facebook.ads.Ad;
/* loaded from: classes2.dex */
public interface FullScreenAd extends Ad {
@Keep
public interface ShowAdConfig {
}
@Keep
public interface ShowConfigBuilder {
ShowAdConfig build();
}
Ad.LoadConfigBuilder buildLoadAdConfig();
ShowConfigBuilder buildShowAdConfig();
boolean show();
}

View File

@@ -0,0 +1,119 @@
package com.facebook.ads;
import android.content.Context;
import androidx.annotation.Keep;
import androidx.annotation.UiThread;
import com.facebook.ads.Ad;
import com.facebook.ads.FullScreenAd;
import com.facebook.ads.internal.api.InterstitialAdApi;
import com.facebook.ads.internal.bench.Benchmark;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.infer.annotation.Nullsafe;
import java.util.EnumSet;
@Keep
@UiThread
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class InterstitialAd implements FullScreenAd {
private final InterstitialAdApi mInterstitialAdApi;
@Keep
public interface InterstitialAdLoadConfigBuilder extends Ad.LoadConfigBuilder {
@Override // com.facebook.ads.Ad.LoadConfigBuilder
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
InterstitialLoadAdConfig build();
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
InterstitialAdLoadConfigBuilder withAdListener(InterstitialAdListener interstitialAdListener);
@Override // com.facebook.ads.Ad.LoadConfigBuilder
InterstitialAdLoadConfigBuilder withBid(String str);
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
InterstitialAdLoadConfigBuilder withCacheFlags(EnumSet<CacheFlag> enumSet);
InterstitialAdLoadConfigBuilder withRewardData(RewardData rewardData);
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
InterstitialAdLoadConfigBuilder withRewardedAdListener(RewardedAdListener rewardedAdListener);
}
@Keep
public interface InterstitialAdShowConfigBuilder extends FullScreenAd.ShowConfigBuilder {
@Override // com.facebook.ads.FullScreenAd.ShowConfigBuilder
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
InterstitialShowAdConfig build();
}
@Keep
public interface InterstitialLoadAdConfig extends Ad.LoadAdConfig {
}
@Keep
public interface InterstitialShowAdConfig extends FullScreenAd.ShowAdConfig {
}
@Benchmark
public InterstitialAd(Context context, String str) {
this.mInterstitialAdApi = DynamicLoaderFactory.makeLoader(context).createInterstitialAd(context, str, this);
}
@Override // com.facebook.ads.Ad
@Deprecated
public void setExtraHints(ExtraHints extraHints) {
this.mInterstitialAdApi.setExtraHints(extraHints);
}
@Override // com.facebook.ads.Ad
public void loadAd() {
this.mInterstitialAdApi.loadAd();
}
public void loadAd(InterstitialLoadAdConfig interstitialLoadAdConfig) {
this.mInterstitialAdApi.loadAd(interstitialLoadAdConfig);
}
@Override // com.facebook.ads.Ad
public boolean isAdInvalidated() {
return this.mInterstitialAdApi.isAdInvalidated();
}
@Override // com.facebook.ads.Ad
public void destroy() {
this.mInterstitialAdApi.destroy();
}
@Override // com.facebook.ads.Ad
public String getPlacementId() {
return this.mInterstitialAdApi.getPlacementId();
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public boolean isAdLoaded() {
return this.mInterstitialAdApi.isAdLoaded();
}
@Override // com.facebook.ads.FullScreenAd
@Benchmark
public boolean show() {
return this.mInterstitialAdApi.show();
}
@Benchmark
public boolean show(InterstitialShowAdConfig interstitialShowAdConfig) {
return this.mInterstitialAdApi.show(interstitialShowAdConfig);
}
@Override // com.facebook.ads.FullScreenAd
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public InterstitialAdLoadConfigBuilder buildLoadAdConfig() {
return this.mInterstitialAdApi.buildLoadAdConfig();
}
@Override // com.facebook.ads.FullScreenAd
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public InterstitialAdShowConfigBuilder buildShowAdConfig() {
return this.mInterstitialAdApi.buildShowAdConfig();
}
}

View File

@@ -0,0 +1,9 @@
package com.facebook.ads;
import androidx.annotation.Keep;
@Keep
/* loaded from: classes2.dex */
public interface InterstitialAdExtendedListener extends InterstitialAdListener, RewardedAdListener {
void onInterstitialActivityDestroyed();
}

View File

@@ -0,0 +1,11 @@
package com.facebook.ads;
import androidx.annotation.Keep;
@Keep
/* loaded from: classes2.dex */
public interface InterstitialAdListener extends AdListener {
void onInterstitialDismissed(Ad ad);
void onInterstitialDisplayed(Ad ad);
}

View File

@@ -0,0 +1,95 @@
package com.facebook.ads;
import android.annotation.TargetApi;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.Keep;
import androidx.annotation.UiThread;
import com.facebook.ads.internal.api.AdNativeComponentView;
import com.facebook.ads.internal.api.AdViewConstructorParams;
import com.facebook.ads.internal.api.MediaViewApi;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.infer.annotation.Nullsafe;
@Keep
@UiThread
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class MediaView extends AdNativeComponentView {
private AdViewConstructorParams mConstructorParams;
private MediaViewApi mMediaViewApi;
public MediaViewApi getMediaViewApi() {
return this.mMediaViewApi;
}
public MediaView(Context context) {
super(context);
initializeSelf(new AdViewConstructorParams(context));
}
public MediaView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
initializeSelf(new AdViewConstructorParams(context, attributeSet));
}
public MediaView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
initializeSelf(new AdViewConstructorParams(context, attributeSet, i));
}
@TargetApi(21)
public MediaView(Context context, AttributeSet attributeSet, int i, int i2) {
super(context, attributeSet, i, i2);
initializeSelf(new AdViewConstructorParams(context, attributeSet, i, i2));
}
private void initializeSelf(AdViewConstructorParams adViewConstructorParams) {
this.mConstructorParams = adViewConstructorParams;
MediaViewApi createMediaViewApi = DynamicLoaderFactory.makeLoader(adViewConstructorParams.getContext()).createMediaViewApi();
this.mMediaViewApi = createMediaViewApi;
attachAdComponentViewApi(createMediaViewApi);
this.mMediaViewApi.initialize(adViewConstructorParams, this);
}
public void setVideoRenderer(MediaViewVideoRenderer mediaViewVideoRenderer) {
this.mMediaViewApi.setVideoRenderer(mediaViewVideoRenderer);
}
public int getMediaWidth() {
return this.mMediaViewApi.getMediaWidth();
}
public int getMediaHeight() {
return this.mMediaViewApi.getMediaHeight();
}
@Override // com.facebook.ads.internal.api.AdNativeComponentView
public View getAdContentsView() {
return this.mMediaViewApi.getAdContentsView();
}
public void setListener(MediaViewListener mediaViewListener) {
this.mMediaViewApi.setListener(mediaViewListener);
}
public void destroy() {
this.mMediaViewApi.destroy();
}
public void repair(Throwable th) {
post(new Runnable() { // from class: com.facebook.ads.MediaView.1
@Override // java.lang.Runnable
public void run() {
MediaView.this.removeAllViews();
((AdNativeComponentView) MediaView.this).mAdComponentViewApi = null;
MediaView mediaView = MediaView.this;
mediaView.mMediaViewApi = DynamicLoaderFactory.makeLoader(mediaView.mConstructorParams.getContext()).createMediaViewApi();
MediaView mediaView2 = MediaView.this;
mediaView2.attachAdComponentViewApi(mediaView2.mMediaViewApi);
MediaView.this.mMediaViewApi.initialize(MediaView.this.mConstructorParams, MediaView.this);
}
});
}
}

View File

@@ -0,0 +1,23 @@
package com.facebook.ads;
import androidx.annotation.Keep;
@Keep
/* loaded from: classes2.dex */
public interface MediaViewListener {
void onComplete(MediaView mediaView);
void onEnterFullscreen(MediaView mediaView);
void onExitFullscreen(MediaView mediaView);
void onFullscreenBackground(MediaView mediaView);
void onFullscreenForeground(MediaView mediaView);
void onPause(MediaView mediaView);
void onPlay(MediaView mediaView);
void onVolumeChange(MediaView mediaView, float f);
}

View File

@@ -0,0 +1,179 @@
package com.facebook.ads;
import android.annotation.TargetApi;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.FloatRange;
import androidx.annotation.IntRange;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import com.facebook.ads.internal.api.AdComponentFrameLayout;
import com.facebook.ads.internal.api.AdViewConstructorParams;
import com.facebook.ads.internal.api.MediaViewVideoRendererApi;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
@Keep
/* loaded from: classes2.dex */
public abstract class MediaViewVideoRenderer extends AdComponentFrameLayout {
private MediaViewVideoRendererApi mMediaViewVideoRendererApi;
@Nullable
@Deprecated
protected NativeAd nativeAd;
@Deprecated
protected VideoAutoplayBehavior videoAutoplayBehavior;
@Override // com.facebook.ads.internal.api.AdComponentFrameLayout, android.view.ViewGroup, com.facebook.ads.internal.api.AdComponentView
public void addView(View view) {
}
@Override // com.facebook.ads.internal.api.AdComponentFrameLayout, android.view.ViewGroup, com.facebook.ads.internal.api.AdComponentView
public void addView(View view, int i) {
}
@Override // com.facebook.ads.internal.api.AdComponentFrameLayout, android.view.ViewGroup, com.facebook.ads.internal.api.AdComponentView
public void addView(View view, int i, int i2) {
}
@Override // com.facebook.ads.internal.api.AdComponentFrameLayout, android.view.ViewGroup, com.facebook.ads.internal.api.AdComponentView
public void addView(View view, int i, ViewGroup.LayoutParams layoutParams) {
}
@Override // com.facebook.ads.internal.api.AdComponentFrameLayout, android.view.ViewGroup, android.view.ViewManager, com.facebook.ads.internal.api.AdComponentView
public void addView(View view, ViewGroup.LayoutParams layoutParams) {
}
@Deprecated
public void destroy() {
}
public MediaViewVideoRendererApi getMediaViewVideoRendererApi() {
return this.mMediaViewVideoRendererApi;
}
public void onCompleted() {
}
public void onError() {
}
public void onPaused() {
}
public void onPlayed() {
}
public void onPrepared() {
}
public void onSeek() {
}
public void onSeekDisengaged() {
}
public void onSeekEngaged() {
}
public void onVolumeChanged() {
}
@Deprecated
public final void setListener(Object obj) {
}
public boolean shouldAllowBackgroundPlayback() {
return false;
}
public MediaViewVideoRenderer(Context context) {
super(context);
initialize(new AdViewConstructorParams(context));
}
public MediaViewVideoRenderer(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
initialize(new AdViewConstructorParams(context, attributeSet));
}
public MediaViewVideoRenderer(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
initialize(new AdViewConstructorParams(context, attributeSet, i));
}
@TargetApi(21)
public MediaViewVideoRenderer(Context context, AttributeSet attributeSet, int i, int i2) {
super(context, attributeSet, i, i2);
initialize(new AdViewConstructorParams(context, attributeSet, i, i2));
}
private void initialize(AdViewConstructorParams adViewConstructorParams) {
MediaViewVideoRendererApi createMediaViewVideoRendererApi = DynamicLoaderFactory.makeLoader(adViewConstructorParams.getContext()).createMediaViewVideoRendererApi();
this.mMediaViewVideoRendererApi = createMediaViewVideoRendererApi;
attachAdComponentViewApi(createMediaViewVideoRendererApi);
this.mMediaViewVideoRendererApi.initialize(adViewConstructorParams, this);
}
@Deprecated
public void setNativeAd(NativeAd nativeAd) {
this.nativeAd = nativeAd;
this.videoAutoplayBehavior = nativeAd.getVideoAutoplayBehavior();
}
@Deprecated
public void unsetNativeAd() {
this.nativeAd = null;
this.videoAutoplayBehavior = VideoAutoplayBehavior.DEFAULT;
}
public final void play(VideoStartReason videoStartReason) {
this.mMediaViewVideoRendererApi.play(videoStartReason);
}
public final void pause(boolean z) {
this.mMediaViewVideoRendererApi.pause(z);
}
@IntRange(from = 0)
public final int getCurrentTimeMs() {
return this.mMediaViewVideoRendererApi.getCurrentTimeMs();
}
public final void engageSeek() {
this.mMediaViewVideoRendererApi.engageSeek();
}
public final void disengageSeek(VideoStartReason videoStartReason) {
this.mMediaViewVideoRendererApi.disengageSeek(videoStartReason);
}
public final void seekTo(@IntRange(from = 0) int i) {
this.mMediaViewVideoRendererApi.seekTo(i);
}
@IntRange(from = 0)
public final int getDuration() {
return this.mMediaViewVideoRendererApi.getDuration();
}
public final void setVolume(@FloatRange(from = 0.0d, to = 1.0d) float f) {
this.mMediaViewVideoRendererApi.setVolume(f);
}
@FloatRange(from = 0.0d, to = 1.0d)
public final float getVolume() {
return this.mMediaViewVideoRendererApi.getVolume();
}
public final boolean shouldAutoplay() {
return this.mMediaViewVideoRendererApi.shouldAutoplay();
}
@Deprecated
public final View getVideoView() {
return this.mMediaViewVideoRendererApi.getVideoView();
}
}

View File

@@ -0,0 +1,54 @@
package com.facebook.ads;
import android.annotation.TargetApi;
import android.content.Context;
import android.util.AttributeSet;
import androidx.annotation.Keep;
import com.facebook.ads.internal.api.DefaultMediaViewVideoRendererApi;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.infer.annotation.Nullsafe;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public final class MediaViewVideoRendererWithBackgroundPlayback extends MediaViewVideoRenderer {
private DefaultMediaViewVideoRendererApi mDefaultMediaViewVideoRendererApi;
@Override // com.facebook.ads.MediaViewVideoRenderer
public boolean shouldAllowBackgroundPlayback() {
return true;
}
public MediaViewVideoRendererWithBackgroundPlayback(Context context) {
super(context);
initialize(context);
}
public MediaViewVideoRendererWithBackgroundPlayback(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
initialize(context);
}
public MediaViewVideoRendererWithBackgroundPlayback(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
initialize(context);
}
@TargetApi(21)
public MediaViewVideoRendererWithBackgroundPlayback(Context context, AttributeSet attributeSet, int i, int i2) {
super(context, attributeSet, i, i2);
initialize(context);
}
private void initialize(Context context) {
DefaultMediaViewVideoRendererApi createDefaultMediaViewVideoRendererApi = DynamicLoaderFactory.makeLoader(context).createDefaultMediaViewVideoRendererApi();
this.mDefaultMediaViewVideoRendererApi = createDefaultMediaViewVideoRendererApi;
createDefaultMediaViewVideoRendererApi.initialize(context, this, getMediaViewVideoRendererApi(), 1);
}
@Override // com.facebook.ads.MediaViewVideoRenderer
public void onPrepared() {
super.onPrepared();
this.mDefaultMediaViewVideoRendererApi.onPrepared();
}
}

View File

@@ -0,0 +1,88 @@
package com.facebook.ads;
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import com.facebook.ads.internal.api.NativeAdApi;
import com.facebook.ads.internal.api.NativeAdBaseApi;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.ads.internal.util.common.Preconditions;
import com.facebook.infer.annotation.Nullsafe;
import java.util.List;
@Keep
@UiThread
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class NativeAd extends NativeAdBase {
private NativeAdApi mNativeAdApi;
@Keep
public enum AdCreativeType {
IMAGE,
VIDEO,
CAROUSEL,
UNKNOWN
}
public NativeAdApi getNativeAdApi() {
return this.mNativeAdApi;
}
public NativeAd(Context context, String str) {
super(context, str);
this.mNativeAdApi = DynamicLoaderFactory.makeLoader(context).createNativeAdApi(this, this.mNativeAdBaseApi);
}
public NativeAd(Context context, NativeAdBaseApi nativeAdBaseApi) {
super(nativeAdBaseApi);
this.mNativeAdApi = DynamicLoaderFactory.makeLoader(context).createNativeAdApi(this, this.mNativeAdBaseApi);
}
public NativeAd(Context context, NativeAdBase nativeAdBase) {
super(context, nativeAdBase);
this.mNativeAdApi = DynamicLoaderFactory.makeLoader(context).createNativeAdApi(nativeAdBase, this, this.mNativeAdBaseApi);
}
@Deprecated
public VideoAutoplayBehavior getVideoAutoplayBehavior() {
return this.mNativeAdApi.getVideoAutoplayBehavior();
}
public AdCreativeType getAdCreativeType() {
return this.mNativeAdApi.getAdCreativeType();
}
public void registerViewForInteraction(View view, MediaView mediaView) {
Preconditions.checkIsOnMainThread();
this.mNativeAdApi.registerViewForInteraction(view, mediaView);
}
public void registerViewForInteraction(View view, MediaView mediaView, @Nullable MediaView mediaView2) {
Preconditions.checkIsOnMainThread();
this.mNativeAdApi.registerViewForInteraction(view, mediaView, mediaView2);
}
public void registerViewForInteraction(View view, MediaView mediaView, @Nullable List<View> list) {
Preconditions.checkIsOnMainThread();
this.mNativeAdApi.registerViewForInteraction(view, mediaView, list);
}
public void registerViewForInteraction(View view, MediaView mediaView, @Nullable MediaView mediaView2, @Nullable List<View> list) {
Preconditions.checkIsOnMainThread();
this.mNativeAdApi.registerViewForInteraction(view, mediaView, mediaView2, list);
}
public void registerViewForInteraction(View view, MediaView mediaView, @Nullable ImageView imageView) {
Preconditions.checkIsOnMainThread();
this.mNativeAdApi.registerViewForInteraction(view, mediaView, imageView);
}
public void registerViewForInteraction(View view, MediaView mediaView, @Nullable ImageView imageView, @Nullable List<View> list) {
Preconditions.checkIsOnMainThread();
this.mNativeAdApi.registerViewForInteraction(view, mediaView, imageView, list);
}
}

View File

@@ -0,0 +1,370 @@
package com.facebook.ads;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import com.facebook.ads.Ad;
import com.facebook.ads.internal.api.NativeAdBaseApi;
import com.facebook.ads.internal.api.NativeAdImageApi;
import com.facebook.ads.internal.api.NativeAdRatingApi;
import com.facebook.ads.internal.bench.Benchmark;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.infer.annotation.Nullsafe;
import org.json.JSONObject;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public abstract class NativeAdBase implements Ad {
final NativeAdBaseApi mNativeAdBaseApi;
@Keep
public enum MediaCacheFlag {
NONE,
ALL
}
@Keep
public interface NativeAdLoadConfigBuilder extends Ad.LoadConfigBuilder {
public static final int UNKNOWN_IMAGE_SIZE = -1;
@Override // com.facebook.ads.Ad.LoadConfigBuilder
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
NativeLoadAdConfig build();
NativeAdLoadConfigBuilder withAdListener(NativeAdListener nativeAdListener);
@Override // com.facebook.ads.Ad.LoadConfigBuilder
NativeAdLoadConfigBuilder withBid(String str);
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
NativeAdLoadConfigBuilder withMediaCacheFlag(MediaCacheFlag mediaCacheFlag);
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
NativeAdLoadConfigBuilder withPreloadedIconView(int i, int i2);
}
@Keep
public interface NativeLoadAdConfig extends Ad.LoadAdConfig {
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public NativeAdBaseApi getInternalNativeAd() {
return this.mNativeAdBaseApi;
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
@Deprecated
public boolean isNativeConfigEnabled() {
return false;
}
@Benchmark
public static NativeAdBase fromBidPayload(Context context, String str, String str2) throws Exception {
return DynamicLoaderFactory.makeLoader(context).createNativeAdBaseFromBidPayload(context, str, str2);
}
@Keep
public static class Image {
private final NativeAdImageApi mNativeAdImageApi;
@Benchmark
public Image(NativeAdImageApi nativeAdImageApi) {
this.mNativeAdImageApi = nativeAdImageApi;
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public int getWidth() {
return this.mNativeAdImageApi.getWidth();
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public int getHeight() {
return this.mNativeAdImageApi.getHeight();
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public String getUrl() {
return this.mNativeAdImageApi.getUrl();
}
@Nullable
@Benchmark
public static Image fromJSONObject(JSONObject jSONObject) {
NativeAdImageApi createNativeAdImageApi = DynamicLoaderFactory.makeLoaderUnsafe().createNativeAdImageApi(jSONObject);
if (createNativeAdImageApi == null) {
return null;
}
return new Image(createNativeAdImageApi);
}
}
@Keep
public static class Rating {
private final NativeAdRatingApi mNativeAdRatingApi;
@Benchmark
public Rating(NativeAdRatingApi nativeAdRatingApi) {
this.mNativeAdRatingApi = nativeAdRatingApi;
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public double getValue() {
return this.mNativeAdRatingApi.getValue();
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public double getScale() {
return this.mNativeAdRatingApi.getScale();
}
@Nullable
@Benchmark
public static Rating fromJSONObject(JSONObject jSONObject) {
NativeAdRatingApi createNativeAdRatingApi = DynamicLoaderFactory.makeLoaderUnsafe().createNativeAdRatingApi(jSONObject);
if (createNativeAdRatingApi == null) {
return null;
}
return new Rating(createNativeAdRatingApi);
}
}
@Keep
public enum NativeComponentTag {
AD_ICON,
AD_TITLE,
AD_COVER_IMAGE,
AD_SUBTITLE,
AD_BODY,
AD_CALL_TO_ACTION,
AD_SOCIAL_CONTEXT,
AD_CHOICES_ICON,
AD_OPTIONS_VIEW,
AD_MEDIA;
public static void tagView(View view, NativeComponentTag nativeComponentTag) {
DynamicLoaderFactory.makeLoader(view.getContext()).createNativeComponentTagApi().tagView(view, nativeComponentTag);
}
}
@Benchmark
public NativeAdBase(Context context, String str) {
this.mNativeAdBaseApi = DynamicLoaderFactory.makeLoader(context).createNativeAdBaseApi(context, str);
}
@Benchmark
public NativeAdBase(NativeAdBaseApi nativeAdBaseApi) {
this.mNativeAdBaseApi = nativeAdBaseApi;
}
@Benchmark
public NativeAdBase(Context context, NativeAdBase nativeAdBase) {
this.mNativeAdBaseApi = DynamicLoaderFactory.makeLoader(context).createNativeAdBaseApi(nativeAdBase.mNativeAdBaseApi);
}
@Override // com.facebook.ads.Ad
@Deprecated
public void setExtraHints(ExtraHints extraHints) {
this.mNativeAdBaseApi.setExtraHints(extraHints);
}
@Override // com.facebook.ads.Ad
public void loadAd() {
this.mNativeAdBaseApi.loadAd();
}
@Benchmark
public void loadAd(NativeLoadAdConfig nativeLoadAdConfig) {
this.mNativeAdBaseApi.loadAd(nativeLoadAdConfig);
}
@Benchmark
public void downloadMedia() {
this.mNativeAdBaseApi.downloadMedia();
}
@Override // com.facebook.ads.Ad
public void destroy() {
this.mNativeAdBaseApi.destroy();
}
@Override // com.facebook.ads.Ad
public String getPlacementId() {
return this.mNativeAdBaseApi.getPlacementId();
}
@Override // com.facebook.ads.Ad
public boolean isAdInvalidated() {
return this.mNativeAdBaseApi.isAdInvalidated();
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public boolean isAdLoaded() {
return this.mNativeAdBaseApi.isAdLoaded();
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public boolean hasCallToAction() {
return this.mNativeAdBaseApi.hasCallToAction();
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public Image getAdIcon() {
if (this.mNativeAdBaseApi.getAdIcon() == null) {
return null;
}
return new Image(this.mNativeAdBaseApi.getAdIcon());
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public Image getAdCoverImage() {
if (this.mNativeAdBaseApi.getAdCoverImage() == null) {
return null;
}
return new Image(this.mNativeAdBaseApi.getAdCoverImage());
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
@Deprecated
public NativeAdViewAttributes getAdViewAttributes() {
return new NativeAdViewAttributes();
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public String getAdvertiserName() {
return this.mNativeAdBaseApi.getAdvertiserName();
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public String getAdHeadline() {
return this.mNativeAdBaseApi.getAdHeadline();
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public String getAdBodyText() {
return this.mNativeAdBaseApi.getAdBodyText();
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public String getAdUntrimmedBodyText() {
return this.mNativeAdBaseApi.getAdUntrimmedBodyText();
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public String getAdCallToAction() {
return this.mNativeAdBaseApi.getAdCallToAction();
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public String getAdSocialContext() {
return this.mNativeAdBaseApi.getAdSocialContext();
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public String getAdLinkDescription() {
return this.mNativeAdBaseApi.getAdLinkDescription();
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public String getSponsoredTranslation() {
return this.mNativeAdBaseApi.getSponsoredTranslation();
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public String getAdTranslation() {
return this.mNativeAdBaseApi.getAdTranslation();
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public String getPromotedTranslation() {
return this.mNativeAdBaseApi.getPromotedTranslation();
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
@Deprecated
public Rating getAdStarRating() {
if (this.mNativeAdBaseApi.getAdStarRating() == null) {
return null;
}
return new Rating(this.mNativeAdBaseApi.getAdStarRating());
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public String getId() {
return this.mNativeAdBaseApi.getId();
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public Image getAdChoicesIcon() {
if (this.mNativeAdBaseApi.getAdChoicesIcon() == null) {
return null;
}
return new Image(this.mNativeAdBaseApi.getAdChoicesIcon());
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public String getAdChoicesImageUrl() {
return this.mNativeAdBaseApi.getAdChoicesImageUrl();
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public float getAspectRatio() {
return this.mNativeAdBaseApi.getAspectRatio();
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public String getAdChoicesLinkUrl() {
return this.mNativeAdBaseApi.getAdChoicesLinkUrl();
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public String getAdChoicesText() {
return this.mNativeAdBaseApi.getAdChoicesText();
}
@Nullable
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public Drawable getPreloadedIconViewDrawable() {
return this.mNativeAdBaseApi.getPreloadedIconViewDrawable();
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public void onCtaBroadcast() {
this.mNativeAdBaseApi.onCtaBroadcast();
}
@Benchmark
public void unregisterView() {
this.mNativeAdBaseApi.unregisterView();
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public void setOnTouchListener(View.OnTouchListener onTouchListener) {
this.mNativeAdBaseApi.setOnTouchListener(onTouchListener);
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public NativeAdLoadConfigBuilder buildLoadAdConfig() {
return this.mNativeAdBaseApi.buildLoadAdConfig(this);
}
}

View File

@@ -0,0 +1,58 @@
package com.facebook.ads;
import android.content.Context;
import android.util.AttributeSet;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import com.facebook.ads.internal.api.AdComponentFrameLayout;
import com.facebook.ads.internal.api.NativeAdLayoutApi;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.infer.annotation.Nullsafe;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class NativeAdLayout extends AdComponentFrameLayout {
private NativeAdLayoutApi mNativeAdLayoutApi;
public NativeAdLayoutApi getNativeAdLayoutApi() {
return this.mNativeAdLayoutApi;
}
public NativeAdLayout(Context context) {
super(context);
initializeSelf(context);
}
public NativeAdLayout(Context context, @Nullable AttributeSet attributeSet) {
super(context, attributeSet);
initializeSelf(context);
}
public NativeAdLayout(Context context, @Nullable AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
initializeSelf(context);
}
public NativeAdLayout(Context context, NativeAdLayoutApi nativeAdLayoutApi) {
super(context);
this.mNativeAdLayoutApi = nativeAdLayoutApi;
attachAdComponentViewApi(nativeAdLayoutApi);
this.mNativeAdLayoutApi.initialize(this);
}
private void initializeSelf(Context context) {
NativeAdLayoutApi createNativeAdLayoutApi = DynamicLoaderFactory.makeLoader(context).createNativeAdLayoutApi();
this.mNativeAdLayoutApi = createNativeAdLayoutApi;
attachAdComponentViewApi(createNativeAdLayoutApi);
this.mNativeAdLayoutApi.initialize(this);
}
public void setMinWidth(int i) {
this.mNativeAdLayoutApi.setMinWidth(i);
}
public void setMaxWidth(int i) {
this.mNativeAdLayoutApi.setMaxWidth(i);
}
}

View File

@@ -0,0 +1,9 @@
package com.facebook.ads;
import androidx.annotation.Keep;
@Keep
/* loaded from: classes2.dex */
public interface NativeAdListener extends AdListener {
void onMediaDownloaded(Ad ad);
}

View File

@@ -0,0 +1,69 @@
package com.facebook.ads;
import android.content.Context;
import android.view.View;
import android.widget.LinearLayout;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import com.facebook.ads.NativeAdView;
import com.facebook.ads.internal.api.NativeAdScrollViewApi;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
@Keep
/* loaded from: classes2.dex */
public class NativeAdScrollView extends LinearLayout {
public static final int DEFAULT_INSET = 20;
public static final int DEFAULT_MAX_ADS = 10;
private final NativeAdScrollViewApi mNativeAdScrollViewApi;
@Keep
public interface AdViewProvider {
View createView(NativeAd nativeAd, int i);
void destroyView(NativeAd nativeAd, View view);
}
private NativeAdScrollView(Context context, NativeAdsManager nativeAdsManager, @Nullable AdViewProvider adViewProvider, int i, @Nullable NativeAdView.Type type, @Nullable NativeAdViewAttributes nativeAdViewAttributes, int i2) {
super(context);
this.mNativeAdScrollViewApi = DynamicLoaderFactory.makeLoader(context).createNativeAdScrollViewApi(this, context, nativeAdsManager, adViewProvider, i, type, nativeAdViewAttributes, i2);
}
public NativeAdScrollView(Context context, NativeAdsManager nativeAdsManager, AdViewProvider adViewProvider) {
this(context, nativeAdsManager, adViewProvider, 0, null, null, 10);
}
public NativeAdScrollView(Context context, NativeAdsManager nativeAdsManager, AdViewProvider adViewProvider, int i) {
this(context, nativeAdsManager, adViewProvider, 0, null, null, i);
}
public NativeAdScrollView(Context context, NativeAdsManager nativeAdsManager, int i) {
this(context, nativeAdsManager, null, i, null, null, 10);
}
public NativeAdScrollView(Context context, NativeAdsManager nativeAdsManager, int i, NativeAdViewAttributes nativeAdViewAttributes) {
this(context, nativeAdsManager, null, i, null, nativeAdViewAttributes, 10);
}
public NativeAdScrollView(Context context, NativeAdsManager nativeAdsManager, int i, NativeAdViewAttributes nativeAdViewAttributes, int i2) {
this(context, nativeAdsManager, null, i, null, nativeAdViewAttributes, i2);
}
@Deprecated
public NativeAdScrollView(Context context, NativeAdsManager nativeAdsManager, NativeAdView.Type type) {
this(context, nativeAdsManager, null, 0, type, null, 10);
}
@Deprecated
public NativeAdScrollView(Context context, NativeAdsManager nativeAdsManager, NativeAdView.Type type, NativeAdViewAttributes nativeAdViewAttributes) {
this(context, nativeAdsManager, null, 0, type, nativeAdViewAttributes, 10);
}
@Deprecated
public NativeAdScrollView(Context context, NativeAdsManager nativeAdsManager, NativeAdView.Type type, NativeAdViewAttributes nativeAdViewAttributes, int i) {
this(context, nativeAdsManager, null, 0, type, nativeAdViewAttributes, i);
}
public void setInset(int i) {
this.mNativeAdScrollViewApi.setInset(i);
}
}

View File

@@ -0,0 +1,81 @@
package com.facebook.ads;
import android.content.Context;
import android.view.View;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import com.facebook.ads.internal.api.NativeAdViewTypeApi;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.ads.internal.util.common.Preconditions;
@Keep
/* loaded from: classes2.dex */
public class NativeAdView {
public static View render(Context context, NativeAd nativeAd) {
Preconditions.checkNotNull(context, "context must be not null");
Preconditions.checkNotNull(nativeAd, "nativeAd must be not null");
return DynamicLoaderFactory.makeLoader(context).createNativeAdViewApi().render(context, nativeAd);
}
public static View render(Context context, NativeAd nativeAd, @Nullable NativeAdViewAttributes nativeAdViewAttributes) {
Preconditions.checkNotNull(context, "context must be not null");
Preconditions.checkNotNull(nativeAd, "nativeAd must be not null");
return DynamicLoaderFactory.makeLoader(context).createNativeAdViewApi().render(context, nativeAd, nativeAdViewAttributes);
}
@Deprecated
public static View render(Context context, NativeAd nativeAd, Type type) {
Preconditions.checkNotNull(context, "context must be not null");
Preconditions.checkNotNull(nativeAd, "nativeAd must be not null");
return DynamicLoaderFactory.makeLoader(context).createNativeAdViewApi().render(context, nativeAd, type);
}
@Deprecated
public static View render(Context context, NativeAd nativeAd, Type type, @Nullable NativeAdViewAttributes nativeAdViewAttributes) {
Preconditions.checkNotNull(context, "context must be not null");
Preconditions.checkNotNull(nativeAd, "nativeAd must be not null");
Preconditions.checkNotNull(type, "type must be not null");
return DynamicLoaderFactory.makeLoader(context).createNativeAdViewApi().render(context, nativeAd, type, nativeAdViewAttributes);
}
@Keep
@Deprecated
public enum Type {
HEIGHT_300(2),
HEIGHT_400(3);
private final int mEnumCode;
private NativeAdViewTypeApi mNativeAdViewTypeApi;
public int getEnumCode() {
return this.mEnumCode;
}
@Deprecated
Type(int i) {
this.mEnumCode = i;
}
@Deprecated
public int getWidth() {
return getNativeAdViewTypeApi(this.mEnumCode).getWidth();
}
@Deprecated
public int getHeight() {
return getNativeAdViewTypeApi(this.mEnumCode).getHeight();
}
@Deprecated
public int getValue() {
return getNativeAdViewTypeApi(this.mEnumCode).getValue();
}
private NativeAdViewTypeApi getNativeAdViewTypeApi(int i) {
if (this.mNativeAdViewTypeApi == null) {
this.mNativeAdViewTypeApi = DynamicLoaderFactory.makeLoaderUnsafe().createNativeAdViewTypeApi(i);
}
return this.mNativeAdViewTypeApi;
}
}
}

View File

@@ -0,0 +1,130 @@
package com.facebook.ads;
import android.content.Context;
import android.graphics.Typeface;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import com.facebook.ads.internal.api.NativeAdViewAttributesApi;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.infer.annotation.Nullsafe;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class NativeAdViewAttributes {
private final NativeAdViewAttributesApi mNativeAdViewAttributesApi;
@Deprecated
public int getBackgroundColor() {
return 0;
}
@Deprecated
public int getButtonBorderColor() {
return 0;
}
@Deprecated
public int getButtonColor() {
return 0;
}
@Deprecated
public int getButtonTextColor() {
return 0;
}
@Deprecated
public int getDescriptionTextColor() {
return 0;
}
@Deprecated
public int getDescriptionTextSize() {
return 0;
}
public NativeAdViewAttributesApi getInternalAttributes() {
return this.mNativeAdViewAttributesApi;
}
@Deprecated
public int getTitleTextColor() {
return 0;
}
@Deprecated
public int getTitleTextSize() {
return 0;
}
@Nullable
@Deprecated
public Typeface getTypeface() {
return null;
}
@Deprecated
public NativeAdViewAttributes setAutoplay(boolean z) {
return this;
}
@Deprecated
public NativeAdViewAttributes setAutoplayOnMobile(boolean z) {
return this;
}
public NativeAdViewAttributes(Context context) {
this.mNativeAdViewAttributesApi = DynamicLoaderFactory.makeLoader(context).createNativeAdViewAttributesApi();
}
@Deprecated
public NativeAdViewAttributes() {
this.mNativeAdViewAttributesApi = DynamicLoaderFactory.makeLoaderUnsafe().createNativeAdViewAttributesApi();
}
public NativeAdViewAttributes setTypeface(Typeface typeface) {
this.mNativeAdViewAttributesApi.setTypeface(typeface);
return this;
}
public NativeAdViewAttributes setBackgroundColor(int i) {
this.mNativeAdViewAttributesApi.setBackgroundColor(i);
return this;
}
public NativeAdViewAttributes setTitleTextColor(int i) {
this.mNativeAdViewAttributesApi.setPrimaryTextColor(i);
return this;
}
public NativeAdViewAttributes setDescriptionTextColor(int i) {
this.mNativeAdViewAttributesApi.setSecondaryTextColor(i);
return this;
}
public NativeAdViewAttributes setButtonColor(int i) {
this.mNativeAdViewAttributesApi.setCTABackgroundColor(i);
return this;
}
public NativeAdViewAttributes setButtonTextColor(int i) {
this.mNativeAdViewAttributesApi.setCTATextColor(i);
return this;
}
public NativeAdViewAttributes setButtonBorderColor(int i) {
this.mNativeAdViewAttributesApi.setCTABorderColor(i);
return this;
}
@Deprecated
public boolean getAutoplay() {
return AdSettings.isVideoAutoplay();
}
@Deprecated
public boolean getAutoplayOnMobile() {
return AdSettings.isVideoAutoplayOnMobile();
}
}

View File

@@ -0,0 +1,68 @@
package com.facebook.ads;
import android.content.Context;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import com.facebook.ads.NativeAdBase;
import com.facebook.ads.internal.api.NativeAdsManagerApi;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.ads.internal.util.common.Preconditions;
import com.facebook.infer.annotation.Nullsafe;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class NativeAdsManager {
private final NativeAdsManagerApi mNativeAdsManagerApi;
@Keep
public interface Listener {
void onAdError(AdError adError);
void onAdsLoaded();
}
public NativeAdsManager(Context context, String str, int i) {
Preconditions.checkNotNull(context, "Context can not be null");
Preconditions.checkIsTrue(i > -1, "Number of requested ads should be not be negative");
this.mNativeAdsManagerApi = DynamicLoaderFactory.makeLoader(context).createNativeAdsManagerApi(context, str, i);
}
public void setListener(Listener listener) {
this.mNativeAdsManagerApi.setListener(listener);
}
public void setExtraHints(String str) {
this.mNativeAdsManagerApi.setExtraHints(str);
}
public void loadAds() {
this.mNativeAdsManagerApi.loadAds();
}
public void loadAds(NativeAdBase.MediaCacheFlag mediaCacheFlag) {
this.mNativeAdsManagerApi.loadAds(mediaCacheFlag);
}
public int getUniqueNativeAdCount() {
return this.mNativeAdsManagerApi.getUniqueNativeAdCount();
}
@Nullable
public NativeAd nextNativeAd() {
return this.mNativeAdsManagerApi.nextNativeAd();
}
@Nullable
public NativeAd nextNativeAd(NativeAdListener nativeAdListener) {
return this.mNativeAdsManagerApi.nextNativeAd(nativeAdListener);
}
public boolean isLoaded() {
return this.mNativeAdsManagerApi.isLoaded();
}
public void disableAutoRefresh() {
this.mNativeAdsManagerApi.disableAutoRefresh();
}
}

View File

@@ -0,0 +1,54 @@
package com.facebook.ads;
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import androidx.annotation.VisibleForTesting;
import com.facebook.ads.internal.api.NativeAdBaseApi;
import com.facebook.ads.internal.api.NativeBannerAdApi;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.ads.internal.util.common.Preconditions;
import com.facebook.infer.annotation.Nullsafe;
import java.util.List;
@Keep
@UiThread
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class NativeBannerAd extends NativeAdBase {
private final NativeBannerAdApi mNativeBannerAdApi;
public NativeBannerAd(Context context, String str) {
super(context, str);
this.mNativeBannerAdApi = DynamicLoaderFactory.makeLoader(context).createNativeBannerAdApi(this, this.mNativeAdBaseApi);
}
@VisibleForTesting
public NativeBannerAd(Context context, NativeAdBaseApi nativeAdBaseApi) {
super(nativeAdBaseApi);
this.mNativeBannerAdApi = DynamicLoaderFactory.makeLoader(context).createNativeBannerAdApi(this, this.mNativeAdBaseApi);
}
public void registerViewForInteraction(View view, MediaView mediaView) {
Preconditions.checkIsOnMainThread();
this.mNativeBannerAdApi.registerViewForInteraction(view, mediaView);
}
public void registerViewForInteraction(View view, MediaView mediaView, @Nullable List<View> list) {
Preconditions.checkIsOnMainThread();
this.mNativeBannerAdApi.registerViewForInteraction(view, mediaView, list);
}
public void registerViewForInteraction(View view, ImageView imageView) {
Preconditions.checkIsOnMainThread();
this.mNativeBannerAdApi.registerViewForInteraction(view, imageView);
}
public void registerViewForInteraction(View view, ImageView imageView, @Nullable List<View> list) {
Preconditions.checkIsOnMainThread();
this.mNativeBannerAdApi.registerViewForInteraction(view, imageView, list);
}
}

View File

@@ -0,0 +1,68 @@
package com.facebook.ads;
import android.content.Context;
import android.view.View;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import com.facebook.ads.internal.api.NativeAdViewTypeApi;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.ads.internal.util.common.Preconditions;
import com.facebook.infer.annotation.Nullsafe;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class NativeBannerAdView {
public static View render(Context context, NativeBannerAd nativeBannerAd, Type type) {
Preconditions.checkNotNull(context, "context must be not null");
Preconditions.checkNotNull(nativeBannerAd, "nativeBannerAd must be not null");
Preconditions.checkNotNull(type, "type must be not null");
return DynamicLoaderFactory.makeLoader(context).createNativeBannerAdViewApi().render(context, nativeBannerAd, type, null);
}
public static View render(Context context, NativeBannerAd nativeBannerAd, Type type, NativeAdViewAttributes nativeAdViewAttributes) {
Preconditions.checkNotNull(context, "context must be not null");
Preconditions.checkNotNull(nativeBannerAd, "nativeBannerAd must be not null");
Preconditions.checkNotNull(type, "type must be not null");
return DynamicLoaderFactory.makeLoader(context).createNativeBannerAdViewApi().render(context, nativeBannerAd, type, nativeAdViewAttributes);
}
@Keep
public enum Type {
HEIGHT_50(4),
HEIGHT_100(0),
HEIGHT_120(1);
private final int mEnumCode;
@Nullable
private NativeAdViewTypeApi mNativeAdViewTypeApi;
public int getEnumCode() {
return this.mEnumCode;
}
Type(int i) {
this.mEnumCode = i;
}
public int getWidth() {
return getNativeAdViewTypeApi().getWidth();
}
public int getHeight() {
return getNativeAdViewTypeApi().getHeight();
}
public int getValue() {
return getNativeAdViewTypeApi().getValue();
}
private NativeAdViewTypeApi getNativeAdViewTypeApi() {
if (this.mNativeAdViewTypeApi == null) {
this.mNativeAdViewTypeApi = DynamicLoaderFactory.makeLoaderUnsafe().createNativeAdViewTypeApi(this.mEnumCode);
}
return this.mNativeAdViewTypeApi;
}
}
}

View File

@@ -0,0 +1,7 @@
package com.facebook.ads;
/* loaded from: classes2.dex */
public final class R {
private R() {
}
}

View File

@@ -0,0 +1,37 @@
package com.facebook.ads;
import androidx.annotation.Keep;
import com.facebook.infer.annotation.Nullsafe;
import java.io.Serializable;
@Keep
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class RewardData implements Serializable {
private static final long serialVersionUID = -6264212909606201882L;
private String mCurrency;
private int mQuantity;
private String mUserID;
public String getCurrency() {
return this.mCurrency;
}
public int getQuantity() {
return this.mQuantity;
}
public String getUserID() {
return this.mUserID;
}
public RewardData(String str, String str2) {
this(str, str2, 0);
}
public RewardData(String str, String str2, int i) {
this.mUserID = str;
this.mCurrency = str2;
this.mQuantity = i;
}
}

View File

@@ -0,0 +1,13 @@
package com.facebook.ads;
import androidx.annotation.Keep;
@Keep
/* loaded from: classes2.dex */
public interface RewardedAdListener {
void onRewardedAdCompleted();
void onRewardedAdServerFailed();
void onRewardedAdServerSucceeded();
}

View File

@@ -0,0 +1,127 @@
package com.facebook.ads;
import android.annotation.SuppressLint;
import android.content.Context;
import androidx.annotation.Keep;
import androidx.annotation.UiThread;
import com.facebook.ads.Ad;
import com.facebook.ads.FullScreenAd;
import com.facebook.ads.internal.api.RewardedInterstitialAdApi;
import com.facebook.ads.internal.bench.Benchmark;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.infer.annotation.Nullsafe;
@Keep
@UiThread
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class RewardedInterstitialAd implements FullScreenAd {
public static final int UNSET_VIDEO_DURATION = -1;
private final RewardedInterstitialAdApi mRewardedInterstitialAdApi;
@Keep
public interface RewardedInterstitialAdLoadConfigBuilder extends Ad.LoadConfigBuilder {
@Override // com.facebook.ads.Ad.LoadConfigBuilder
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
RewardedInterstitialLoadAdConfig build();
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
RewardedInterstitialAdLoadConfigBuilder withAdListener(RewardedInterstitialAdListener rewardedInterstitialAdListener);
@Override // com.facebook.ads.Ad.LoadConfigBuilder
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
RewardedInterstitialAdLoadConfigBuilder withBid(String str);
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
RewardedInterstitialAdLoadConfigBuilder withFailOnCacheFailureEnabled(boolean z);
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
RewardedInterstitialAdLoadConfigBuilder withRewardData(RewardData rewardData);
}
@Keep
public interface RewardedInterstitialAdShowConfigBuilder extends FullScreenAd.ShowConfigBuilder {
@Override // com.facebook.ads.FullScreenAd.ShowConfigBuilder
RewardedInterstitialShowAdConfig build();
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
RewardedInterstitialAdShowConfigBuilder withAppOrientation(int i);
}
@Keep
public interface RewardedInterstitialLoadAdConfig extends Ad.LoadAdConfig {
}
@Keep
public interface RewardedInterstitialShowAdConfig extends FullScreenAd.ShowAdConfig {
}
@Benchmark
public RewardedInterstitialAd(Context context, String str) {
this.mRewardedInterstitialAdApi = DynamicLoaderFactory.makeLoader(context).createRewardedInterstitialAd(context, str, this);
}
@Override // com.facebook.ads.Ad
@SuppressLint({"DeprecatedMethod"})
@Deprecated
public void setExtraHints(ExtraHints extraHints) {
this.mRewardedInterstitialAdApi.setExtraHints(extraHints);
}
@Override // com.facebook.ads.Ad
public void loadAd() {
this.mRewardedInterstitialAdApi.loadAd();
}
@Benchmark
public void loadAd(RewardedInterstitialLoadAdConfig rewardedInterstitialLoadAdConfig) {
this.mRewardedInterstitialAdApi.loadAd(rewardedInterstitialLoadAdConfig);
}
@Override // com.facebook.ads.Ad
public boolean isAdInvalidated() {
return this.mRewardedInterstitialAdApi.isAdInvalidated();
}
@Override // com.facebook.ads.FullScreenAd
public boolean show() {
return this.mRewardedInterstitialAdApi.show();
}
@Benchmark
public boolean show(RewardedInterstitialShowAdConfig rewardedInterstitialShowAdConfig) {
return this.mRewardedInterstitialAdApi.show(rewardedInterstitialShowAdConfig);
}
@Override // com.facebook.ads.Ad
public void destroy() {
this.mRewardedInterstitialAdApi.destroy();
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public boolean isAdLoaded() {
return this.mRewardedInterstitialAdApi.isAdLoaded();
}
@Override // com.facebook.ads.Ad
public String getPlacementId() {
return this.mRewardedInterstitialAdApi.getPlacementId();
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public int getVideoDuration() {
return this.mRewardedInterstitialAdApi.getVideoDuration();
}
@Override // com.facebook.ads.FullScreenAd
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public RewardedInterstitialAdLoadConfigBuilder buildLoadAdConfig() {
return this.mRewardedInterstitialAdApi.buildLoadAdConfig();
}
@Override // com.facebook.ads.FullScreenAd
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public RewardedInterstitialAdShowConfigBuilder buildShowAdConfig() {
return this.mRewardedInterstitialAdApi.buildShowAdConfig();
}
}

View File

@@ -0,0 +1,9 @@
package com.facebook.ads;
import androidx.annotation.Keep;
@Keep
/* loaded from: classes2.dex */
public interface RewardedInterstitialAdExtendedListener extends RewardedInterstitialAdListener {
void onRewardedInterstitialActivityDestroyed();
}

View File

@@ -0,0 +1,11 @@
package com.facebook.ads;
import androidx.annotation.Keep;
@Keep
/* loaded from: classes2.dex */
public interface RewardedInterstitialAdListener extends AdListener {
void onRewardedInterstitialClosed();
void onRewardedInterstitialCompleted();
}

View File

@@ -0,0 +1,128 @@
package com.facebook.ads;
import android.content.Context;
import androidx.annotation.Keep;
import androidx.annotation.UiThread;
import com.facebook.ads.Ad;
import com.facebook.ads.FullScreenAd;
import com.facebook.ads.internal.api.RewardedVideoAdApi;
import com.facebook.ads.internal.bench.Benchmark;
import com.facebook.ads.internal.dynamicloading.DynamicLoaderFactory;
import com.facebook.infer.annotation.Nullsafe;
@Keep
@UiThread
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes2.dex */
public class RewardedVideoAd implements FullScreenAd {
public static final int UNSET_VIDEO_DURATION = -1;
private final RewardedVideoAdApi mRewardedVideoAdApi;
@Keep
public interface RewardedVideoAdLoadConfigBuilder extends Ad.LoadConfigBuilder {
@Override // com.facebook.ads.Ad.LoadConfigBuilder
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
RewardedVideoLoadAdConfig build();
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
RewardedVideoAdLoadConfigBuilder withAdExperience(AdExperienceType adExperienceType);
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
RewardedVideoAdLoadConfigBuilder withAdListener(RewardedVideoAdListener rewardedVideoAdListener);
@Override // com.facebook.ads.Ad.LoadConfigBuilder
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
RewardedVideoAdLoadConfigBuilder withBid(String str);
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
RewardedVideoAdLoadConfigBuilder withFailOnCacheFailureEnabled(boolean z);
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
RewardedVideoAdLoadConfigBuilder withRewardData(RewardData rewardData);
}
@Keep
public interface RewardedVideoAdShowConfigBuilder extends FullScreenAd.ShowConfigBuilder {
@Override // com.facebook.ads.FullScreenAd.ShowConfigBuilder
RewardedVideoShowAdConfig build();
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
RewardedVideoAdShowConfigBuilder withAppOrientation(int i);
}
@Keep
public interface RewardedVideoLoadAdConfig extends Ad.LoadAdConfig {
}
@Keep
public interface RewardedVideoShowAdConfig extends FullScreenAd.ShowAdConfig {
}
@Benchmark
public RewardedVideoAd(Context context, String str) {
this.mRewardedVideoAdApi = DynamicLoaderFactory.makeLoader(context).createRewardedVideoAd(context, str, this);
}
@Override // com.facebook.ads.Ad
@Deprecated
public void setExtraHints(ExtraHints extraHints) {
this.mRewardedVideoAdApi.setExtraHints(extraHints);
}
@Override // com.facebook.ads.Ad
public void loadAd() {
this.mRewardedVideoAdApi.loadAd();
}
@Benchmark
public void loadAd(RewardedVideoLoadAdConfig rewardedVideoLoadAdConfig) {
this.mRewardedVideoAdApi.loadAd(rewardedVideoLoadAdConfig);
}
@Override // com.facebook.ads.Ad
public boolean isAdInvalidated() {
return this.mRewardedVideoAdApi.isAdInvalidated();
}
@Override // com.facebook.ads.FullScreenAd
public boolean show() {
return this.mRewardedVideoAdApi.show();
}
@Benchmark
public boolean show(RewardedVideoShowAdConfig rewardedVideoShowAdConfig) {
return this.mRewardedVideoAdApi.show(rewardedVideoShowAdConfig);
}
@Override // com.facebook.ads.Ad
public void destroy() {
this.mRewardedVideoAdApi.destroy();
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public boolean isAdLoaded() {
return this.mRewardedVideoAdApi.isAdLoaded();
}
@Override // com.facebook.ads.Ad
public String getPlacementId() {
return this.mRewardedVideoAdApi.getPlacementId();
}
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public int getVideoDuration() {
return this.mRewardedVideoAdApi.getVideoDuration();
}
@Override // com.facebook.ads.FullScreenAd
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public RewardedVideoAdLoadConfigBuilder buildLoadAdConfig() {
return this.mRewardedVideoAdApi.buildLoadAdConfig();
}
@Override // com.facebook.ads.FullScreenAd
@Benchmark(failAtMillis = 5, warnAtMillis = 1)
public RewardedVideoAdShowConfigBuilder buildShowAdConfig() {
return this.mRewardedVideoAdApi.buildShowAdConfig();
}
}

View File

@@ -0,0 +1,9 @@
package com.facebook.ads;
import androidx.annotation.Keep;
@Keep
/* loaded from: classes2.dex */
public interface RewardedVideoAdExtendedListener extends RewardedVideoAdListener {
void onRewardedVideoActivityDestroyed();
}

View File

@@ -0,0 +1,11 @@
package com.facebook.ads;
import androidx.annotation.Keep;
@Keep
/* loaded from: classes2.dex */
public interface RewardedVideoAdListener extends AdListener {
void onRewardedVideoClosed();
void onRewardedVideoCompleted();
}

View File

@@ -0,0 +1,8 @@
package com.facebook.ads;
import androidx.annotation.Keep;
@Keep
/* loaded from: classes2.dex */
public interface S2SRewardedInterstitialAdExtendedListener extends RewardedInterstitialAdExtendedListener, S2SRewardedInterstitialAdListener {
}

View File

@@ -0,0 +1,11 @@
package com.facebook.ads;
import androidx.annotation.Keep;
@Keep
/* loaded from: classes2.dex */
public interface S2SRewardedInterstitialAdListener extends RewardedInterstitialAdListener {
void onRewardServerFailed();
void onRewardServerSuccess();
}

View File

@@ -0,0 +1,8 @@
package com.facebook.ads;
import androidx.annotation.Keep;
@Keep
/* loaded from: classes2.dex */
public interface S2SRewardedVideoAdExtendedListener extends RewardedVideoAdExtendedListener, S2SRewardedVideoAdListener {
}

Some files were not shown because too many files have changed in this diff Show More