Initial commit

This commit is contained in:
2025-05-13 19:24:51 +02:00
commit a950f49678
10604 changed files with 932663 additions and 0 deletions

View File

@@ -0,0 +1,320 @@
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.internal.Utility;
import com.facebook.internal.Validate;
import com.ubt.jimu.controller.data.widget.JockstickDataConverter;
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 org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.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";
private static final int CURRENT_JSON_FORMAT = 1;
private static final String DECLINED_PERMISSIONS_KEY = "declined_permissions";
private static final String EXPIRES_AT_KEY = "expires_at";
public static final String EXPIRES_IN_KEY = "expires_in";
private static final String LAST_REFRESH_KEY = "last_refresh";
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 Set<String> declinedPermissions;
private final Date expires;
private final Date lastRefresh;
private final Set<String> permissions;
private final AccessTokenSource source;
private final String token;
private final String userId;
private static final Date MAX_DATE = new Date(Long.MAX_VALUE);
private static final Date DEFAULT_EXPIRATION_TIME = MAX_DATE;
private static final Date DEFAULT_LAST_REFRESH_TIME = new Date();
private static final AccessTokenSource DEFAULT_ACCESS_TOKEN_SOURCE = AccessTokenSource.FACEBOOK_APPLICATION_WEB;
public static final Parcelable.Creator<AccessToken> CREATOR = new Parcelable.Creator() { // from class: com.facebook.AccessToken.2
@Override // android.os.Parcelable.Creator
public AccessToken createFromParcel(Parcel parcel) {
return new AccessToken(parcel);
}
@Override // android.os.Parcelable.Creator
public AccessToken[] newArray(int i) {
return new AccessToken[i];
}
};
public interface AccessTokenCreationCallback {
void a(AccessToken accessToken);
void a(FacebookException facebookException);
}
public interface AccessTokenRefreshCallback {
void a(AccessToken accessToken);
void a(FacebookException facebookException);
}
public AccessToken(String str, String str2, String str3, Collection<String> collection, Collection<String> collection2, AccessTokenSource accessTokenSource, Date date, Date date2) {
Validate.a(str, "accessToken");
Validate.a(str2, "applicationId");
Validate.a(str3, "userId");
this.expires = date == null ? DEFAULT_EXPIRATION_TIME : date;
this.permissions = Collections.unmodifiableSet(collection != null ? new HashSet(collection) : new HashSet());
this.declinedPermissions = Collections.unmodifiableSet(collection2 != null ? new HashSet(collection2) : new HashSet());
this.token = str;
this.source = accessTokenSource == null ? DEFAULT_ACCESS_TOKEN_SOURCE : accessTokenSource;
this.lastRefresh = date2 == null ? DEFAULT_LAST_REFRESH_TIME : date2;
this.applicationId = str2;
this.userId = str3;
}
private void appendPermissions(StringBuilder sb) {
sb.append(" permissions:");
if (this.permissions == null) {
sb.append("null");
return;
}
sb.append("[");
sb.append(TextUtils.join(", ", this.permissions));
sb.append("]");
}
/* JADX INFO: Access modifiers changed from: private */
public static AccessToken createFromBundle(List<String> list, Bundle bundle, AccessTokenSource accessTokenSource, Date date, String str) {
String string = bundle.getString(ACCESS_TOKEN_KEY);
Date a = Utility.a(bundle, EXPIRES_IN_KEY, date);
String string2 = bundle.getString("user_id");
if (Utility.c(string) || a == null) {
return null;
}
return new AccessToken(string, str, string2, list, null, accessTokenSource, a, new Date());
}
static AccessToken createFromJSONObject(JSONObject jSONObject) throws JSONException {
if (jSONObject.getInt("version") > 1) {
throw new FacebookException("Unknown AccessToken serialization format.");
}
String string = jSONObject.getString(TOKEN_KEY);
Date date = new Date(jSONObject.getLong(EXPIRES_AT_KEY));
JSONArray jSONArray = jSONObject.getJSONArray(PERMISSIONS_KEY);
JSONArray jSONArray2 = jSONObject.getJSONArray(DECLINED_PERMISSIONS_KEY);
Date date2 = new Date(jSONObject.getLong(LAST_REFRESH_KEY));
return new AccessToken(string, jSONObject.getString(APPLICATION_ID_KEY), jSONObject.getString("user_id"), Utility.b(jSONArray), Utility.b(jSONArray2), AccessTokenSource.valueOf(jSONObject.getString("source")), date, date2);
}
static AccessToken createFromLegacyCache(Bundle bundle) {
List<String> permissionsFromBundle = getPermissionsFromBundle(bundle, "com.facebook.TokenCachingStrategy.Permissions");
List<String> permissionsFromBundle2 = getPermissionsFromBundle(bundle, "com.facebook.TokenCachingStrategy.DeclinedPermissions");
String a = LegacyTokenHelper.a(bundle);
if (Utility.c(a)) {
a = FacebookSdk.c();
}
String str = a;
String c = LegacyTokenHelper.c(bundle);
try {
return new AccessToken(c, str, Utility.a(c).getString(JockstickDataConverter.ID), permissionsFromBundle, permissionsFromBundle2, LegacyTokenHelper.b(bundle), LegacyTokenHelper.a(bundle, "com.facebook.TokenCachingStrategy.ExpirationDate"), LegacyTokenHelper.a(bundle, "com.facebook.TokenCachingStrategy.LastRefreshDate"));
} catch (JSONException unused) {
return null;
}
}
public static void createFromNativeLinkingIntent(Intent intent, final String str, final AccessTokenCreationCallback accessTokenCreationCallback) {
Validate.a(intent, "intent");
if (intent.getExtras() == null) {
accessTokenCreationCallback.a(new FacebookException("No extras found on intent"));
return;
}
final Bundle bundle = new Bundle(intent.getExtras());
String string = bundle.getString(ACCESS_TOKEN_KEY);
if (string == null || string.isEmpty()) {
accessTokenCreationCallback.a(new FacebookException("No access token found on intent"));
return;
}
String string2 = bundle.getString("user_id");
if (string2 == null || string2.isEmpty()) {
Utility.a(string, new Utility.GraphMeRequestWithCacheCallback() { // from class: com.facebook.AccessToken.1
@Override // com.facebook.internal.Utility.GraphMeRequestWithCacheCallback
public void a(JSONObject jSONObject) {
try {
bundle.putString("user_id", jSONObject.getString(JockstickDataConverter.ID));
accessTokenCreationCallback.a(AccessToken.createFromBundle(null, bundle, AccessTokenSource.FACEBOOK_APPLICATION_WEB, new Date(), str));
} catch (JSONException unused) {
accessTokenCreationCallback.a(new FacebookException("Unable to generate access token due to missing user id"));
}
}
@Override // com.facebook.internal.Utility.GraphMeRequestWithCacheCallback
public void a(FacebookException facebookException) {
accessTokenCreationCallback.a(facebookException);
}
});
} else {
accessTokenCreationCallback.a(createFromBundle(null, bundle, AccessTokenSource.FACEBOOK_APPLICATION_WEB, new Date(), str));
}
}
@SuppressLint({"FieldGetter"})
static AccessToken createFromRefresh(AccessToken accessToken, Bundle bundle) {
AccessTokenSource accessTokenSource = accessToken.source;
if (accessTokenSource != AccessTokenSource.FACEBOOK_APPLICATION_WEB && accessTokenSource != AccessTokenSource.FACEBOOK_APPLICATION_NATIVE && accessTokenSource != AccessTokenSource.FACEBOOK_APPLICATION_SERVICE) {
throw new FacebookException("Invalid token source: " + accessToken.source);
}
Date a = Utility.a(bundle, EXPIRES_IN_KEY, new Date(0L));
String string = bundle.getString(ACCESS_TOKEN_KEY);
if (Utility.c(string)) {
return null;
}
return new AccessToken(string, accessToken.applicationId, accessToken.getUserId(), accessToken.getPermissions(), accessToken.getDeclinedPermissions(), accessToken.source, a, new Date());
}
public static AccessToken getCurrentAccessToken() {
return AccessTokenManager.d().b();
}
static List<String> getPermissionsFromBundle(Bundle bundle, String str) {
ArrayList<String> stringArrayList = bundle.getStringArrayList(str);
return stringArrayList == null ? Collections.emptyList() : Collections.unmodifiableList(new ArrayList(stringArrayList));
}
public static void refreshCurrentAccessTokenAsync() {
AccessTokenManager.d().a((AccessTokenRefreshCallback) null);
}
public static void setCurrentAccessToken(AccessToken accessToken) {
AccessTokenManager.d().a(accessToken);
}
private String tokenToString() {
return this.token == null ? "null" : FacebookSdk.a(LoggingBehavior.INCLUDE_ACCESS_TOKENS) ? this.token : "ACCESS_TOKEN_REMOVED";
}
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
public boolean equals(Object obj) {
String str;
if (this == obj) {
return true;
}
if (!(obj instanceof AccessToken)) {
return false;
}
AccessToken accessToken = (AccessToken) obj;
return this.expires.equals(accessToken.expires) && this.permissions.equals(accessToken.permissions) && this.declinedPermissions.equals(accessToken.declinedPermissions) && this.token.equals(accessToken.token) && this.source == accessToken.source && this.lastRefresh.equals(accessToken.lastRefresh) && ((str = this.applicationId) != null ? str.equals(accessToken.applicationId) : accessToken.applicationId == null) && this.userId.equals(accessToken.userId);
}
public String getApplicationId() {
return this.applicationId;
}
public Set<String> getDeclinedPermissions() {
return this.declinedPermissions;
}
public Date getExpires() {
return this.expires;
}
public Date getLastRefresh() {
return this.lastRefresh;
}
public Set<String> getPermissions() {
return this.permissions;
}
public AccessTokenSource getSource() {
return this.source;
}
public String getToken() {
return this.token;
}
public String getUserId() {
return this.userId;
}
public int hashCode() {
int hashCode = (((((((((((527 + this.expires.hashCode()) * 31) + this.permissions.hashCode()) * 31) + this.declinedPermissions.hashCode()) * 31) + this.token.hashCode()) * 31) + this.source.hashCode()) * 31) + this.lastRefresh.hashCode()) * 31;
String str = this.applicationId;
return ((hashCode + (str == null ? 0 : str.hashCode())) * 31) + this.userId.hashCode();
}
public boolean isExpired() {
return new Date().after(this.expires);
}
JSONObject toJSONObject() throws JSONException {
JSONObject jSONObject = new JSONObject();
jSONObject.put("version", 1);
jSONObject.put(TOKEN_KEY, this.token);
jSONObject.put(EXPIRES_AT_KEY, this.expires.getTime());
jSONObject.put(PERMISSIONS_KEY, new JSONArray((Collection) this.permissions));
jSONObject.put(DECLINED_PERMISSIONS_KEY, new JSONArray((Collection) this.declinedPermissions));
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);
return jSONObject;
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{AccessToken");
sb.append(" token:");
sb.append(tokenToString());
appendPermissions(sb);
sb.append("}");
return sb.toString();
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel parcel, int i) {
parcel.writeLong(this.expires.getTime());
parcel.writeStringList(new ArrayList(this.permissions));
parcel.writeStringList(new ArrayList(this.declinedPermissions));
parcel.writeString(this.token);
parcel.writeString(this.source.name());
parcel.writeLong(this.lastRefresh.getTime());
parcel.writeString(this.applicationId);
parcel.writeString(this.userId);
}
public static void refreshCurrentAccessTokenAsync(AccessTokenRefreshCallback accessTokenRefreshCallback) {
AccessTokenManager.d().a(accessTokenRefreshCallback);
}
AccessToken(Parcel parcel) {
this.expires = new Date(parcel.readLong());
ArrayList arrayList = new ArrayList();
parcel.readStringList(arrayList);
this.permissions = Collections.unmodifiableSet(new HashSet(arrayList));
arrayList.clear();
parcel.readStringList(arrayList);
this.declinedPermissions = Collections.unmodifiableSet(new HashSet(arrayList));
this.token = parcel.readString();
this.source = AccessTokenSource.valueOf(parcel.readString());
this.lastRefresh = new Date(parcel.readLong());
this.applicationId = parcel.readString();
this.userId = parcel.readString();
}
}

View File

@@ -0,0 +1,101 @@
package com.facebook;
import android.content.SharedPreferences;
import android.os.Bundle;
import com.facebook.internal.Validate;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
class AccessTokenCache {
private final SharedPreferences a;
private final SharedPreferencesTokenCachingStrategyFactory b;
private LegacyTokenHelper c;
static class SharedPreferencesTokenCachingStrategyFactory {
SharedPreferencesTokenCachingStrategyFactory() {
}
public LegacyTokenHelper a() {
return new LegacyTokenHelper(FacebookSdk.b());
}
}
AccessTokenCache(SharedPreferences sharedPreferences, SharedPreferencesTokenCachingStrategyFactory sharedPreferencesTokenCachingStrategyFactory) {
this.a = sharedPreferences;
this.b = sharedPreferencesTokenCachingStrategyFactory;
}
private AccessToken c() {
String string = this.a.getString("com.facebook.AccessTokenManager.CachedAccessToken", null);
if (string != null) {
try {
return AccessToken.createFromJSONObject(new JSONObject(string));
} catch (JSONException unused) {
}
}
return null;
}
private AccessToken d() {
Bundle b = e().b();
if (b == null || !LegacyTokenHelper.d(b)) {
return null;
}
return AccessToken.createFromLegacyCache(b);
}
private LegacyTokenHelper e() {
if (this.c == null) {
synchronized (this) {
if (this.c == null) {
this.c = this.b.a();
}
}
}
return this.c;
}
private boolean f() {
return this.a.contains("com.facebook.AccessTokenManager.CachedAccessToken");
}
private boolean g() {
return FacebookSdk.p();
}
public void a(AccessToken accessToken) {
Validate.a(accessToken, "accessToken");
try {
this.a.edit().putString("com.facebook.AccessTokenManager.CachedAccessToken", accessToken.toJSONObject().toString()).apply();
} catch (JSONException unused) {
}
}
public AccessToken b() {
if (f()) {
return c();
}
if (!g()) {
return null;
}
AccessToken d = d();
if (d == null) {
return d;
}
a(d);
e().a();
return d;
}
public AccessTokenCache() {
this(FacebookSdk.b().getSharedPreferences("com.facebook.AccessTokenManager.SharedPreferences", 0), new SharedPreferencesTokenCachingStrategyFactory());
}
public void a() {
this.a.edit().remove("com.facebook.AccessTokenManager.CachedAccessToken").apply();
if (g()) {
e().a();
}
}
}

View File

@@ -0,0 +1,243 @@
package com.facebook;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.facebook.AccessToken;
import com.facebook.GraphRequest;
import com.facebook.GraphRequestBatch;
import com.facebook.internal.Utility;
import com.facebook.internal.Validate;
import com.liulishuo.filedownloader.model.FileDownloadModel;
import java.util.Date;
import java.util.HashSet;
import java.util.Locale;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes.dex */
final class AccessTokenManager {
private static volatile AccessTokenManager f;
private final LocalBroadcastManager a;
private final AccessTokenCache b;
private AccessToken c;
private AtomicBoolean d = new AtomicBoolean(false);
private Date e = new Date(0);
private static class RefreshResult {
public String a;
public int b;
private RefreshResult() {
}
}
AccessTokenManager(LocalBroadcastManager localBroadcastManager, AccessTokenCache accessTokenCache) {
Validate.a(localBroadcastManager, "localBroadcastManager");
Validate.a(accessTokenCache, "accessTokenCache");
this.a = localBroadcastManager;
this.b = accessTokenCache;
}
static AccessTokenManager d() {
if (f == null) {
synchronized (AccessTokenManager.class) {
if (f == null) {
f = new AccessTokenManager(LocalBroadcastManager.a(FacebookSdk.b()), new AccessTokenCache());
}
}
}
return f;
}
private boolean e() {
if (this.c == null) {
return false;
}
Long valueOf = Long.valueOf(new Date().getTime());
return this.c.getSource().canExtendToken() && valueOf.longValue() - this.e.getTime() > 3600000 && valueOf.longValue() - this.c.getLastRefresh().getTime() > 86400000;
}
AccessToken b() {
return this.c;
}
boolean c() {
AccessToken b = this.b.b();
if (b == null) {
return false;
}
a(b, false);
return true;
}
private static GraphRequest b(AccessToken accessToken, GraphRequest.Callback callback) {
return new GraphRequest(accessToken, "me/permissions", new Bundle(), HttpMethod.GET, callback);
}
void a(AccessToken accessToken) {
a(accessToken, true);
}
private void a(AccessToken accessToken, boolean z) {
AccessToken accessToken2 = this.c;
this.c = accessToken;
this.d.set(false);
this.e = new Date(0L);
if (z) {
if (accessToken != null) {
this.b.a(accessToken);
} else {
this.b.a();
Utility.a(FacebookSdk.b());
}
}
if (Utility.a(accessToken2, accessToken)) {
return;
}
a(accessToken2, accessToken);
}
/* JADX INFO: Access modifiers changed from: private */
public void b(final AccessToken.AccessTokenRefreshCallback accessTokenRefreshCallback) {
final AccessToken accessToken = this.c;
if (accessToken == null) {
if (accessTokenRefreshCallback != null) {
accessTokenRefreshCallback.a(new FacebookException("No current access token to refresh"));
}
} else {
if (!this.d.compareAndSet(false, true)) {
if (accessTokenRefreshCallback != null) {
accessTokenRefreshCallback.a(new FacebookException("Refresh already in progress"));
return;
}
return;
}
this.e = new Date();
final HashSet hashSet = new HashSet();
final HashSet hashSet2 = new HashSet();
final AtomicBoolean atomicBoolean = new AtomicBoolean(false);
final RefreshResult refreshResult = new RefreshResult();
GraphRequestBatch graphRequestBatch = new GraphRequestBatch(b(accessToken, new GraphRequest.Callback(this) { // from class: com.facebook.AccessTokenManager.2
@Override // com.facebook.GraphRequest.Callback
public void a(GraphResponse graphResponse) {
JSONArray optJSONArray;
JSONObject b = graphResponse.b();
if (b == null || (optJSONArray = b.optJSONArray("data")) == null) {
return;
}
atomicBoolean.set(true);
for (int i = 0; i < optJSONArray.length(); i++) {
JSONObject optJSONObject = optJSONArray.optJSONObject(i);
if (optJSONObject != null) {
String optString = optJSONObject.optString("permission");
String optString2 = optJSONObject.optString(FileDownloadModel.STATUS);
if (!Utility.c(optString) && !Utility.c(optString2)) {
String lowerCase = optString2.toLowerCase(Locale.US);
if (lowerCase.equals("granted")) {
hashSet.add(optString);
} else if (lowerCase.equals("declined")) {
hashSet2.add(optString);
} else {
Log.w("AccessTokenManager", "Unexpected status: " + lowerCase);
}
}
}
}
}
}), a(accessToken, new GraphRequest.Callback(this) { // from class: com.facebook.AccessTokenManager.3
@Override // com.facebook.GraphRequest.Callback
public void a(GraphResponse graphResponse) {
JSONObject b = graphResponse.b();
if (b == null) {
return;
}
refreshResult.a = b.optString(AccessToken.ACCESS_TOKEN_KEY);
refreshResult.b = b.optInt("expires_at");
}
}));
graphRequestBatch.a(new GraphRequestBatch.Callback() { // from class: com.facebook.AccessTokenManager.4
@Override // com.facebook.GraphRequestBatch.Callback
public void a(GraphRequestBatch graphRequestBatch2) {
AccessToken accessToken2 = null;
try {
if (AccessTokenManager.d().b() != null && AccessTokenManager.d().b().getUserId() == accessToken.getUserId()) {
if (!atomicBoolean.get() && refreshResult.a == null && refreshResult.b == 0) {
if (accessTokenRefreshCallback != null) {
accessTokenRefreshCallback.a(new FacebookException("Failed to refresh access token"));
}
AccessTokenManager.this.d.set(false);
AccessToken.AccessTokenRefreshCallback accessTokenRefreshCallback2 = accessTokenRefreshCallback;
return;
}
AccessToken accessToken3 = new AccessToken(refreshResult.a != null ? refreshResult.a : accessToken.getToken(), accessToken.getApplicationId(), accessToken.getUserId(), atomicBoolean.get() ? hashSet : accessToken.getPermissions(), atomicBoolean.get() ? hashSet2 : accessToken.getDeclinedPermissions(), accessToken.getSource(), refreshResult.b != 0 ? new Date(refreshResult.b * 1000) : accessToken.getExpires(), new Date());
try {
AccessTokenManager.d().a(accessToken3);
AccessTokenManager.this.d.set(false);
AccessToken.AccessTokenRefreshCallback accessTokenRefreshCallback3 = accessTokenRefreshCallback;
if (accessTokenRefreshCallback3 != null) {
accessTokenRefreshCallback3.a(accessToken3);
return;
}
return;
} catch (Throwable th) {
th = th;
accessToken2 = accessToken3;
AccessTokenManager.this.d.set(false);
AccessToken.AccessTokenRefreshCallback accessTokenRefreshCallback4 = accessTokenRefreshCallback;
if (accessTokenRefreshCallback4 != null && accessToken2 != null) {
accessTokenRefreshCallback4.a(accessToken2);
}
throw th;
}
}
if (accessTokenRefreshCallback != null) {
accessTokenRefreshCallback.a(new FacebookException("No current access token to refresh"));
}
AccessTokenManager.this.d.set(false);
AccessToken.AccessTokenRefreshCallback accessTokenRefreshCallback5 = accessTokenRefreshCallback;
} catch (Throwable th2) {
th = th2;
}
}
});
graphRequestBatch.c();
}
}
private void a(AccessToken accessToken, AccessToken accessToken2) {
Intent intent = new Intent("com.facebook.sdk.ACTION_CURRENT_ACCESS_TOKEN_CHANGED");
intent.putExtra("com.facebook.sdk.EXTRA_OLD_ACCESS_TOKEN", accessToken);
intent.putExtra("com.facebook.sdk.EXTRA_NEW_ACCESS_TOKEN", accessToken2);
this.a.a(intent);
}
void a() {
if (e()) {
a((AccessToken.AccessTokenRefreshCallback) null);
}
}
private static GraphRequest a(AccessToken accessToken, GraphRequest.Callback callback) {
Bundle bundle = new Bundle();
bundle.putString("grant_type", "fb_extend_sso_token");
return new GraphRequest(accessToken, "oauth/access_token", bundle, HttpMethod.GET, callback);
}
void a(final AccessToken.AccessTokenRefreshCallback accessTokenRefreshCallback) {
if (Looper.getMainLooper().equals(Looper.myLooper())) {
b(accessTokenRefreshCallback);
} else {
new Handler(Looper.getMainLooper()).post(new Runnable() { // from class: com.facebook.AccessTokenManager.1
@Override // java.lang.Runnable
public void run() {
AccessTokenManager.this.b(accessTokenRefreshCallback);
}
});
}
}
}

View File

@@ -0,0 +1,24 @@
package com.facebook;
/* loaded from: classes.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);
private final boolean canExtendToken;
AccessTokenSource(boolean z) {
this.canExtendToken = z;
}
boolean canExtendToken() {
return this.canExtendToken;
}
}

View File

@@ -0,0 +1,16 @@
package com.facebook;
import android.content.Intent;
import com.facebook.internal.CallbackManagerImpl;
/* loaded from: classes.dex */
public interface CallbackManager {
public static class Factory {
public static CallbackManager a() {
return new CallbackManagerImpl();
}
}
boolean a(int i, int i2, Intent intent);
}

View File

@@ -0,0 +1,49 @@
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;
/* loaded from: classes.dex */
public class CustomTabActivity extends Activity {
public static final String b = CustomTabActivity.class.getSimpleName() + ".action_customTabRedirect";
public static final String c = CustomTabActivity.class.getSimpleName() + ".action_destroy";
private BroadcastReceiver a;
@Override // android.app.Activity
protected void onActivityResult(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
if (i2 == 0) {
Intent intent2 = new Intent(b);
intent2.putExtra(CustomTabMainActivity.e, getIntent().getDataString());
LocalBroadcastManager.a(this).a(intent2);
this.a = new BroadcastReceiver() { // from class: com.facebook.CustomTabActivity.1
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent3) {
CustomTabActivity.this.finish();
}
};
LocalBroadcastManager.a(this).a(this.a, new IntentFilter(c));
}
}
@Override // android.app.Activity
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
Intent intent = new Intent(this, (Class<?>) CustomTabMainActivity.class);
intent.setAction(b);
intent.putExtra(CustomTabMainActivity.e, getIntent().getDataString());
intent.addFlags(603979776);
startActivityForResult(intent, 2);
}
@Override // android.app.Activity
protected void onDestroy() {
LocalBroadcastManager.a(this).a(this.a);
super.onDestroy();
}
}

View File

@@ -0,0 +1,79 @@
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 com.facebook.internal.CustomTab;
/* loaded from: classes.dex */
public class CustomTabMainActivity extends Activity {
public static final String c = CustomTabMainActivity.class.getSimpleName() + ".extra_params";
public static final String d = CustomTabMainActivity.class.getSimpleName() + ".extra_chromePackage";
public static final String e = CustomTabMainActivity.class.getSimpleName() + ".extra_url";
public static final String f = CustomTabMainActivity.class.getSimpleName() + ".action_refresh";
private boolean a = true;
private BroadcastReceiver b;
public static final String a() {
return "fb" + FacebookSdk.c() + "://authorize";
}
@Override // android.app.Activity
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
if (CustomTabActivity.b.equals(getIntent().getAction())) {
setResult(0);
finish();
} else if (bundle == null) {
Bundle bundleExtra = getIntent().getBundleExtra(c);
new CustomTab("oauth", bundleExtra).a(this, getIntent().getStringExtra(d));
this.a = false;
this.b = new BroadcastReceiver() { // from class: com.facebook.CustomTabMainActivity.1
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
Intent intent2 = new Intent(CustomTabMainActivity.this, (Class<?>) CustomTabMainActivity.class);
intent2.setAction(CustomTabMainActivity.f);
String str = CustomTabMainActivity.e;
intent2.putExtra(str, intent.getStringExtra(str));
intent2.addFlags(603979776);
CustomTabMainActivity.this.startActivity(intent2);
}
};
LocalBroadcastManager.a(this).a(this.b, new IntentFilter(CustomTabActivity.b));
}
}
@Override // android.app.Activity
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
if (f.equals(intent.getAction())) {
LocalBroadcastManager.a(this).a(new Intent(CustomTabActivity.c));
a(-1, intent);
} else if (CustomTabActivity.b.equals(intent.getAction())) {
a(-1, intent);
}
}
@Override // android.app.Activity
protected void onResume() {
super.onResume();
if (this.a) {
a(0, null);
}
this.a = true;
}
private void a(int i, Intent intent) {
LocalBroadcastManager.a(this).a(this.b);
if (intent != null) {
setResult(i, intent);
} else {
setResult(i);
}
finish();
}
}

View File

@@ -0,0 +1,85 @@
package com.facebook;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.util.Log;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import com.facebook.internal.FacebookDialogFragment;
import com.facebook.internal.NativeProtocol;
import com.facebook.login.LoginFragment;
import com.facebook.share.internal.DeviceShareDialogFragment;
import com.facebook.share.model.ShareContent;
/* loaded from: classes.dex */
public class FacebookActivity extends FragmentActivity {
public static String b = "PassThrough";
private static String c = "SingleFragment";
private static final String d = FacebookActivity.class.getName();
private Fragment a;
private void F0() {
setResult(0, NativeProtocol.a(getIntent(), (Bundle) null, NativeProtocol.a(NativeProtocol.d(getIntent()))));
finish();
}
public Fragment D0() {
return this.a;
}
protected Fragment E0() {
Intent intent = getIntent();
FragmentManager supportFragmentManager = getSupportFragmentManager();
Fragment a = supportFragmentManager.a(c);
if (a != null) {
return a;
}
if ("FacebookDialogFragment".equals(intent.getAction())) {
FacebookDialogFragment facebookDialogFragment = new FacebookDialogFragment();
facebookDialogFragment.setRetainInstance(true);
facebookDialogFragment.a(supportFragmentManager, c);
return facebookDialogFragment;
}
if ("DeviceShareDialogFragment".equals(intent.getAction())) {
DeviceShareDialogFragment deviceShareDialogFragment = new DeviceShareDialogFragment();
deviceShareDialogFragment.setRetainInstance(true);
deviceShareDialogFragment.a((ShareContent) intent.getParcelableExtra("content"));
deviceShareDialogFragment.a(supportFragmentManager, c);
return deviceShareDialogFragment;
}
LoginFragment loginFragment = new LoginFragment();
loginFragment.setRetainInstance(true);
FragmentTransaction a2 = supportFragmentManager.a();
a2.a(R$id.com_facebook_fragment_container, loginFragment, c);
a2.a();
return loginFragment;
}
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity, android.content.ComponentCallbacks
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
Fragment fragment = this.a;
if (fragment != null) {
fragment.onConfigurationChanged(configuration);
}
}
@Override // androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
Intent intent = getIntent();
if (!FacebookSdk.o()) {
Log.d(d, "Facebook SDK not initialized. Make sure you call sdkInitialize inside your Application's onCreate method.");
FacebookSdk.c(getApplicationContext());
}
setContentView(R$layout.com_facebook_activity_layout);
if (b.equals(intent.getAction())) {
F0();
} else {
this.a = E0();
}
}
}

View File

@@ -0,0 +1,21 @@
package com.facebook;
/* loaded from: classes.dex */
public class FacebookAuthorizationException extends FacebookException {
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);
}
}

View File

@@ -0,0 +1,31 @@
package com.facebook;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.facebook.internal.NativeProtocol;
/* loaded from: classes.dex */
public class FacebookBroadcastReceiver extends BroadcastReceiver {
protected void a(String str, String str2, Bundle bundle) {
}
protected void b(String str, String str2, Bundle bundle) {
}
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
String stringExtra = intent.getStringExtra("com.facebook.platform.protocol.CALL_ID");
String stringExtra2 = intent.getStringExtra("com.facebook.platform.protocol.PROTOCOL_ACTION");
if (stringExtra == null || stringExtra2 == null) {
return;
}
Bundle extras = intent.getExtras();
if (NativeProtocol.g(intent)) {
a(stringExtra, stringExtra2, extras);
} else {
b(stringExtra, stringExtra2, extras);
}
}
}

View File

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

View File

@@ -0,0 +1,75 @@
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 java.io.FileNotFoundException;
import java.util.UUID;
/* loaded from: classes.dex */
public class FacebookContentProvider extends ContentProvider {
private static final String a = FacebookContentProvider.class.getName();
public static String a(String str, UUID uuid, String str2) {
return String.format("%s%s/%s/%s", "content://com.facebook.app.FacebookContentProvider", str, uuid.toString(), str2);
}
@Override // android.content.ContentProvider
public int delete(Uri uri, String str, String[] strArr) {
return 0;
}
@Override // android.content.ContentProvider
public String getType(Uri uri) {
return null;
}
@Override // android.content.ContentProvider
public Uri insert(Uri uri, ContentValues contentValues) {
return null;
}
@Override // android.content.ContentProvider
public boolean onCreate() {
return true;
}
@Override // android.content.ContentProvider
public ParcelFileDescriptor openFile(Uri uri, String str) throws FileNotFoundException {
Pair<UUID, String> a2 = a(uri);
if (a2 == null) {
throw new FileNotFoundException();
}
try {
return ParcelFileDescriptor.open(NativeAppCallAttachmentStore.a((UUID) a2.first, (String) a2.second), 268435456);
} catch (FileNotFoundException e) {
Log.e(a, "Got unexpected exception:" + e);
throw e;
}
}
@Override // android.content.ContentProvider
public Cursor query(Uri uri, String[] strArr, String str, String[] strArr2, String str2) {
return null;
}
@Override // android.content.ContentProvider
public int update(Uri uri, ContentValues contentValues, String str, String[] strArr) {
return 0;
}
Pair<UUID, String> a(Uri uri) {
try {
String[] split = uri.getPath().substring(1).split("/");
String str = split[0];
return new Pair<>(UUID.fromString(str), split[1]);
} catch (Exception unused) {
return null;
}
}
}

View File

@@ -0,0 +1,5 @@
package com.facebook;
/* loaded from: classes.dex */
public interface FacebookDialog<CONTENT, RESULT> {
}

View File

@@ -0,0 +1,27 @@
package com.facebook;
/* loaded from: classes.dex */
public class FacebookDialogException extends FacebookException {
static final long serialVersionUID = 1;
private int errorCode;
private String failingUrl;
public FacebookDialogException(String str, int i, String str2) {
super(str);
this.errorCode = i;
this.failingUrl = str2;
}
public int getErrorCode() {
return this.errorCode;
}
public String getFailingUrl() {
return this.failingUrl;
}
@Override // com.facebook.FacebookException, java.lang.Throwable
public final String toString() {
return "{FacebookDialogException: errorCode: " + getErrorCode() + ", message: " + getMessage() + ", url: " + getFailingUrl() + "}";
}
}

View File

@@ -0,0 +1,30 @@
package com.facebook;
/* loaded from: classes.dex */
public class FacebookException extends RuntimeException {
static final long serialVersionUID = 1;
public FacebookException() {
}
@Override // java.lang.Throwable
public String toString() {
return getMessage();
}
public FacebookException(String str) {
super(str);
}
public FacebookException(String str, Object... objArr) {
this(String.format(str, objArr));
}
public FacebookException(String str, Throwable th) {
super(str, th);
}
public FacebookException(Throwable th) {
super(th);
}
}

View File

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

View File

@@ -0,0 +1,21 @@
package com.facebook;
/* loaded from: classes.dex */
public class FacebookOperationCanceledException extends FacebookException {
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);
}
}

View File

@@ -0,0 +1,265 @@
package com.facebook;
import android.os.Parcel;
import android.os.Parcelable;
import com.facebook.internal.FacebookRequestErrorClassification;
import com.facebook.internal.FetchedAppSettings;
import com.facebook.internal.FetchedAppSettingsManager;
import com.facebook.internal.Utility;
import com.ubt.jimu.base.entities.Course;
import java.net.HttpURLConnection;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.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 final FacebookException exception;
private final JSONObject requestResult;
private final JSONObject requestResultBody;
private final int requestStatusCode;
private final int subErrorCode;
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.1
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public FacebookRequestError createFromParcel(Parcel parcel) {
return new FacebookRequestError(parcel);
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public FacebookRequestError[] newArray(int i) {
return new FacebookRequestError[i];
}
};
public enum Category {
LOGIN_RECOVERABLE,
OTHER,
TRANSIENT
}
private static class Range {
private final int a;
private final int b;
boolean a(int i) {
return this.a <= i && i <= this.b;
}
private Range(int i, int i2) {
this.a = i;
this.b = i2;
}
}
static FacebookRequestError checkResponseAndCreateError(JSONObject jSONObject, Object obj, HttpURLConnection httpURLConnection) {
int optInt;
String str;
String str2;
String str3;
String str4;
boolean z;
int i;
try {
if (jSONObject.has(Course.TYPE_BLOCKLY)) {
int i2 = jSONObject.getInt(Course.TYPE_BLOCKLY);
Object a = Utility.a(jSONObject, BODY_KEY, "FACEBOOK_NON_JSON_RESULT");
if (a != null && (a instanceof JSONObject)) {
JSONObject jSONObject2 = (JSONObject) a;
boolean z2 = true;
if (jSONObject2.has("error")) {
JSONObject jSONObject3 = (JSONObject) Utility.a(jSONObject2, "error", (String) null);
String optString = jSONObject3.optString("type", null);
String optString2 = jSONObject3.optString(ERROR_MESSAGE_FIELD_KEY, null);
i = jSONObject3.optInt(Course.TYPE_BLOCKLY, -1);
int optInt2 = jSONObject3.optInt(ERROR_SUB_CODE_KEY, -1);
str3 = jSONObject3.optString(ERROR_USER_MSG_KEY, null);
str4 = jSONObject3.optString(ERROR_USER_TITLE_KEY, null);
z = jSONObject3.optBoolean(ERROR_IS_TRANSIENT_KEY, false);
str2 = optString2;
optInt = optInt2;
str = optString;
} else {
if (!jSONObject2.has(ERROR_CODE_KEY) && !jSONObject2.has(ERROR_MSG_KEY) && !jSONObject2.has(ERROR_REASON_KEY)) {
str = null;
str2 = null;
str3 = null;
str4 = null;
i = -1;
optInt = -1;
z2 = false;
z = false;
}
String optString3 = jSONObject2.optString(ERROR_REASON_KEY, null);
String optString4 = jSONObject2.optString(ERROR_MSG_KEY, null);
int optInt3 = jSONObject2.optInt(ERROR_CODE_KEY, -1);
optInt = jSONObject2.optInt(ERROR_SUB_CODE_KEY, -1);
str = optString3;
str2 = optString4;
str3 = null;
str4 = null;
z = false;
i = optInt3;
}
if (z2) {
return new FacebookRequestError(i2, i, optInt, str, str2, str4, str3, z, jSONObject2, jSONObject, obj, httpURLConnection, null);
}
}
if (!HTTP_RANGE_SUCCESS.a(i2)) {
return new FacebookRequestError(i2, -1, -1, null, null, null, null, false, jSONObject.has(BODY_KEY) ? (JSONObject) Utility.a(jSONObject, BODY_KEY, "FACEBOOK_NON_JSON_RESULT") : null, jSONObject, obj, httpURLConnection, null);
}
}
} catch (JSONException unused) {
}
return null;
}
static synchronized FacebookRequestErrorClassification getErrorClassification() {
synchronized (FacebookRequestError.class) {
FetchedAppSettings c = FetchedAppSettingsManager.c(FacebookSdk.c());
if (c == null) {
return FacebookRequestErrorClassification.a();
}
return c.d();
}
}
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
public Object getBatchRequestResult() {
return this.batchRequestResult;
}
public Category getCategory() {
return this.category;
}
public HttpURLConnection getConnection() {
return this.connection;
}
public int getErrorCode() {
return this.errorCode;
}
public String getErrorMessage() {
String str = this.errorMessage;
return str != null ? str : this.exception.getLocalizedMessage();
}
public String getErrorRecoveryMessage() {
return this.errorRecoveryMessage;
}
public String getErrorType() {
return this.errorType;
}
public String getErrorUserMessage() {
return this.errorUserMessage;
}
public String getErrorUserTitle() {
return this.errorUserTitle;
}
public FacebookException getException() {
return this.exception;
}
public JSONObject getRequestResult() {
return this.requestResult;
}
public JSONObject getRequestResultBody() {
return this.requestResultBody;
}
public int getRequestStatusCode() {
return this.requestStatusCode;
}
public int getSubErrorCode() {
return this.subErrorCode;
}
public String toString() {
return "{HttpStatus: " + this.requestStatusCode + ", errorCode: " + this.errorCode + ", errorType: " + this.errorType + ", errorMessage: " + getErrorMessage() + "}";
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel parcel, int i) {
parcel.writeInt(this.requestStatusCode);
parcel.writeInt(this.errorCode);
parcel.writeInt(this.subErrorCode);
parcel.writeString(this.errorType);
parcel.writeString(this.errorMessage);
parcel.writeString(this.errorUserTitle);
parcel.writeString(this.errorUserMessage);
}
private FacebookRequestError(int i, int i2, int i3, String str, String str2, String str3, String str4, boolean z, JSONObject jSONObject, JSONObject jSONObject2, Object obj, HttpURLConnection httpURLConnection, FacebookException facebookException) {
boolean z2;
this.requestStatusCode = i;
this.errorCode = i2;
this.subErrorCode = i3;
this.errorType = str;
this.errorMessage = str2;
this.requestResultBody = jSONObject;
this.requestResult = jSONObject2;
this.batchRequestResult = obj;
this.connection = httpURLConnection;
this.errorUserTitle = str3;
this.errorUserMessage = str4;
if (facebookException != null) {
this.exception = facebookException;
z2 = true;
} else {
this.exception = new FacebookServiceException(this, str2);
z2 = false;
}
FacebookRequestErrorClassification errorClassification = getErrorClassification();
this.category = z2 ? Category.OTHER : errorClassification.a(i2, i3, z);
this.errorRecoveryMessage = errorClassification.a(this.category);
}
FacebookRequestError(HttpURLConnection httpURLConnection, Exception exc) {
this(-1, -1, -1, null, null, null, null, false, null, null, null, httpURLConnection, exc instanceof FacebookException ? (FacebookException) exc : new FacebookException(exc));
}
public FacebookRequestError(int i, String str, String str2) {
this(-1, i, -1, str, str2, null, null, false, null, null, null, null, null);
}
private FacebookRequestError(Parcel parcel) {
this(parcel.readInt(), parcel.readInt(), parcel.readInt(), parcel.readString(), parcel.readString(), parcel.readString(), parcel.readString(), false, null, null, null, null, null);
}
}

View File

@@ -0,0 +1,367 @@
package com.facebook;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.AsyncTask;
import android.support.v4.media.session.PlaybackStateCompat;
import com.facebook.appevents.AppEventsLogger;
import com.facebook.internal.BoltsMeasurementEventListener;
import com.facebook.internal.FetchedAppSettingsManager;
import com.facebook.internal.LockOnGetVariable;
import com.facebook.internal.NativeProtocol;
import com.facebook.internal.ServerProtocol;
import com.facebook.internal.Utility;
import com.facebook.internal.Validate;
import com.ubtrobot.jimu.robotapi.PeripheralType;
import java.io.File;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Locale;
import java.util.concurrent.Callable;
import java.util.concurrent.Executor;
import java.util.concurrent.FutureTask;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
/* loaded from: classes.dex */
public final class FacebookSdk {
private static Executor b;
private static volatile String c;
private static volatile String d;
private static volatile String e;
private static volatile int f;
private static volatile Boolean g;
private static Context l;
private static Boolean q;
private static final HashSet<LoggingBehavior> a = new HashSet<>(Arrays.asList(LoggingBehavior.DEVELOPER_ERRORS));
private static volatile String h = "facebook.com";
private static AtomicLong i = new AtomicLong(PlaybackStateCompat.ACTION_PREPARE_FROM_SEARCH);
private static volatile boolean j = false;
private static boolean k = false;
private static int m = 64206;
private static final Object n = new Object();
private static final int o = R$style.com_facebook_activity_theme;
private static String p = ServerProtocol.a();
public interface InitializeCallback {
void a();
}
static {
new LinkedBlockingQueue(10);
new ThreadFactory() { // from class: com.facebook.FacebookSdk.1
private final AtomicInteger a = new AtomicInteger(0);
@Override // java.util.concurrent.ThreadFactory
public Thread newThread(Runnable runnable) {
return new Thread(runnable, "FacebookSdk #" + this.a.incrementAndGet());
}
};
q = false;
}
public static Context b() {
Validate.c();
return l;
}
@Deprecated
public static synchronized void c(Context context) {
synchronized (FacebookSdk.class) {
a(context, (InitializeCallback) null);
}
}
public static String d() {
Validate.c();
return d;
}
public static boolean e() {
Validate.c();
return g.booleanValue();
}
public static int f() {
Validate.c();
return m;
}
public static String g() {
Validate.c();
return e;
}
public static Executor h() {
synchronized (n) {
if (b == null) {
b = AsyncTask.THREAD_POOL_EXECUTOR;
}
}
return b;
}
public static String i() {
return h;
}
public static String j() {
return p;
}
public static long k() {
Validate.c();
return i.get();
}
public static String l() {
return "4.24.0";
}
public static int m() {
Validate.c();
return f;
}
public static boolean n() {
return j;
}
public static synchronized boolean o() {
boolean booleanValue;
synchronized (FacebookSdk.class) {
booleanValue = q.booleanValue();
}
return booleanValue;
}
public static boolean p() {
return k;
}
@Deprecated
public static synchronized void a(final Context context, final InitializeCallback initializeCallback) {
synchronized (FacebookSdk.class) {
if (q.booleanValue()) {
if (initializeCallback != null) {
initializeCallback.a();
}
return;
}
Validate.a(context, "applicationContext");
Validate.a(context, false);
Validate.b(context, false);
l = context.getApplicationContext();
b(l);
if (Utility.c(c)) {
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.");
}
q = true;
FetchedAppSettingsManager.b();
NativeProtocol.f();
BoltsMeasurementEventListener.a(l);
new LockOnGetVariable(new Callable<File>() { // from class: com.facebook.FacebookSdk.2
/* JADX WARN: Can't rename method to resolve collision */
@Override // java.util.concurrent.Callable
public File call() throws Exception {
return FacebookSdk.l.getCacheDir();
}
});
h().execute(new FutureTask(new Callable<Void>() { // from class: com.facebook.FacebookSdk.3
@Override // java.util.concurrent.Callable
public Void call() throws Exception {
AccessTokenManager.d().c();
ProfileManager.c().b();
if (AccessToken.getCurrentAccessToken() != null && Profile.getCurrentProfile() == null) {
Profile.fetchProfileForCurrentAccessToken();
}
InitializeCallback initializeCallback2 = InitializeCallback.this;
if (initializeCallback2 != null) {
initializeCallback2.a();
}
AppEventsLogger.b(context.getApplicationContext()).a();
return null;
}
}));
}
}
public static void b(Context context, final String str) {
final Context applicationContext = context.getApplicationContext();
h().execute(new Runnable() { // from class: com.facebook.FacebookSdk.4
@Override // java.lang.Runnable
public void run() {
FacebookSdk.a(applicationContext, str);
}
});
}
public static String c() {
Validate.c();
return c;
}
static void b(Context context) {
if (context == null) {
return;
}
try {
ApplicationInfo applicationInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(), PeripheralType.SERVO);
if (applicationInfo == null || applicationInfo.metaData == null) {
return;
}
if (c == null) {
Object obj = applicationInfo.metaData.get("com.facebook.sdk.ApplicationId");
if (obj instanceof String) {
String str = (String) obj;
if (str.toLowerCase(Locale.ROOT).startsWith("fb")) {
c = str.substring(2);
} else {
c = str;
}
} else if (obj instanceof Integer) {
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 (d == null) {
d = applicationInfo.metaData.getString("com.facebook.sdk.ApplicationName");
}
if (e == null) {
e = applicationInfo.metaData.getString("com.facebook.sdk.ClientToken");
}
if (f == 0) {
a(applicationInfo.metaData.getInt("com.facebook.sdk.WebDialogTheme"));
}
if (m == 64206) {
m = applicationInfo.metaData.getInt("com.facebook.sdk.CallbackOffset", 64206);
}
if (g == null) {
g = Boolean.valueOf(applicationInfo.metaData.getBoolean("com.facebook.sdk.AutoLogAppEventsEnabled", true));
}
} catch (PackageManager.NameNotFoundException unused) {
}
}
public static boolean a(LoggingBehavior loggingBehavior) {
boolean z;
synchronized (a) {
z = n() && a.contains(loggingBehavior);
}
return z;
}
/* JADX WARN: Removed duplicated region for block: B:14:0x0068 A[Catch: Exception -> 0x00b9, TRY_ENTER, TryCatch #2 {Exception -> 0x00b9, blocks: (B:5:0x0005, B:7:0x003c, B:8:0x004a, B:20:0x005f, B:14:0x0068, B:17:0x007e, B:23:0x0084, B:25:0x0099, B:26:0x00a4, B:30:0x00a9, B:31:0x00b0, B:32:0x00b1, B:33:0x00b8), top: B:2:0x0001, inners: #1 }] */
/* JADX WARN: Removed duplicated region for block: B:17:0x007e A[Catch: Exception -> 0x00b9, TryCatch #2 {Exception -> 0x00b9, blocks: (B:5:0x0005, B:7:0x003c, B:8:0x004a, B:20:0x005f, B:14:0x0068, B:17:0x007e, B:23:0x0084, B:25:0x0099, B:26:0x00a4, B:30:0x00a9, B:31:0x00b0, B:32:0x00b1, B:33:0x00b8), top: B:2:0x0001, inners: #1 }] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
static com.facebook.GraphResponse a(android.content.Context r14, java.lang.String r15) {
/*
r0 = 0
if (r14 == 0) goto Lb1
if (r15 == 0) goto Lb1
com.facebook.internal.AttributionIdentifiers r1 = com.facebook.internal.AttributionIdentifiers.d(r14) // Catch: java.lang.Exception -> Lb9
java.lang.String r2 = "com.facebook.sdk.attributionTracking"
r3 = 0
android.content.SharedPreferences r2 = r14.getSharedPreferences(r2, r3) // Catch: java.lang.Exception -> Lb9
java.lang.StringBuilder r4 = new java.lang.StringBuilder // Catch: java.lang.Exception -> Lb9
r4.<init>() // Catch: java.lang.Exception -> Lb9
r4.append(r15) // Catch: java.lang.Exception -> Lb9
java.lang.String r5 = "ping"
r4.append(r5) // Catch: java.lang.Exception -> Lb9
java.lang.String r4 = r4.toString() // Catch: java.lang.Exception -> Lb9
java.lang.StringBuilder r5 = new java.lang.StringBuilder // Catch: java.lang.Exception -> Lb9
r5.<init>() // Catch: java.lang.Exception -> Lb9
r5.append(r15) // Catch: java.lang.Exception -> Lb9
java.lang.String r6 = "json"
r5.append(r6) // Catch: java.lang.Exception -> Lb9
java.lang.String r5 = r5.toString() // Catch: java.lang.Exception -> Lb9
r6 = 0
long r8 = r2.getLong(r4, r6) // Catch: java.lang.Exception -> Lb9
java.lang.String r10 = r2.getString(r5, r0) // Catch: java.lang.Exception -> Lb9
com.facebook.internal.AppEventsLoggerUtility$GraphAPIActivityType r11 = com.facebook.internal.AppEventsLoggerUtility.GraphAPIActivityType.MOBILE_INSTALL_EVENT // Catch: org.json.JSONException -> La8 java.lang.Exception -> Lb9
java.lang.String r12 = com.facebook.appevents.AppEventsLogger.a(r14) // Catch: org.json.JSONException -> La8 java.lang.Exception -> Lb9
boolean r13 = a(r14) // Catch: org.json.JSONException -> La8 java.lang.Exception -> Lb9
org.json.JSONObject r14 = com.facebook.internal.AppEventsLoggerUtility.a(r11, r1, r12, r13, r14) // Catch: org.json.JSONException -> La8 java.lang.Exception -> Lb9
java.lang.String r1 = "%s/activities"
r11 = 1
java.lang.Object[] r12 = new java.lang.Object[r11] // Catch: java.lang.Exception -> Lb9
r12[r3] = r15 // Catch: java.lang.Exception -> Lb9
java.lang.String r15 = java.lang.String.format(r1, r12) // Catch: java.lang.Exception -> Lb9
com.facebook.GraphRequest r14 = com.facebook.GraphRequest.a(r0, r15, r14, r0) // Catch: java.lang.Exception -> Lb9
int r15 = (r8 > r6 ? 1 : (r8 == r6 ? 0 : -1))
if (r15 == 0) goto L84
if (r10 == 0) goto L65
org.json.JSONObject r15 = new org.json.JSONObject // Catch: org.json.JSONException -> L65 java.lang.Exception -> Lb9
r15.<init>(r10) // Catch: org.json.JSONException -> L65 java.lang.Exception -> Lb9
goto L66
L65:
r15 = r0
L66:
if (r15 != 0) goto L7e
java.lang.String r15 = "true"
com.facebook.GraphRequestBatch r1 = new com.facebook.GraphRequestBatch // Catch: java.lang.Exception -> Lb9
com.facebook.GraphRequest[] r2 = new com.facebook.GraphRequest[r11] // Catch: java.lang.Exception -> Lb9
r2[r3] = r14 // Catch: java.lang.Exception -> Lb9
r1.<init>(r2) // Catch: java.lang.Exception -> Lb9
java.util.List r14 = com.facebook.GraphResponse.a(r15, r0, r1) // Catch: java.lang.Exception -> Lb9
java.lang.Object r14 = r14.get(r3) // Catch: java.lang.Exception -> Lb9
com.facebook.GraphResponse r14 = (com.facebook.GraphResponse) r14 // Catch: java.lang.Exception -> Lb9
return r14
L7e:
com.facebook.GraphResponse r14 = new com.facebook.GraphResponse // Catch: java.lang.Exception -> Lb9
r14.<init>(r0, r0, r0, r15) // Catch: java.lang.Exception -> Lb9
return r14
L84:
com.facebook.GraphResponse r14 = r14.a() // Catch: java.lang.Exception -> Lb9
android.content.SharedPreferences$Editor r15 = r2.edit() // Catch: java.lang.Exception -> Lb9
long r1 = java.lang.System.currentTimeMillis() // Catch: java.lang.Exception -> Lb9
r15.putLong(r4, r1) // Catch: java.lang.Exception -> Lb9
org.json.JSONObject r1 = r14.b() // Catch: java.lang.Exception -> Lb9
if (r1 == 0) goto La4
org.json.JSONObject r1 = r14.b() // Catch: java.lang.Exception -> Lb9
java.lang.String r1 = r1.toString() // Catch: java.lang.Exception -> Lb9
r15.putString(r5, r1) // Catch: java.lang.Exception -> Lb9
La4:
r15.apply() // Catch: java.lang.Exception -> Lb9
return r14
La8:
r14 = move-exception
com.facebook.FacebookException r15 = new com.facebook.FacebookException // Catch: java.lang.Exception -> Lb9
java.lang.String r1 = "An error occurred while publishing install."
r15.<init>(r1, r14) // Catch: java.lang.Exception -> Lb9
throw r15 // Catch: java.lang.Exception -> Lb9
Lb1:
java.lang.IllegalArgumentException r14 = new java.lang.IllegalArgumentException // Catch: java.lang.Exception -> Lb9
java.lang.String r15 = "Both context and applicationId must be non-null"
r14.<init>(r15) // Catch: java.lang.Exception -> Lb9
throw r14 // Catch: java.lang.Exception -> Lb9
Lb9:
r14 = move-exception
java.lang.String r15 = "Facebook-publish"
com.facebook.internal.Utility.a(r15, r14)
com.facebook.GraphResponse r15 = new com.facebook.GraphResponse
com.facebook.FacebookRequestError r1 = new com.facebook.FacebookRequestError
r1.<init>(r0, r14)
r15.<init>(r0, r0, r1)
return r15
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.FacebookSdk.a(android.content.Context, java.lang.String):com.facebook.GraphResponse");
}
public static boolean a(Context context) {
Validate.c();
return context.getSharedPreferences("com.facebook.sdk.appEventPreferences", 0).getBoolean("limitEventUsage", false);
}
public static void a(int i2) {
if (i2 == 0) {
i2 = o;
}
f = i2;
}
}

View File

@@ -0,0 +1,21 @@
package com.facebook;
/* loaded from: classes.dex */
public class FacebookSdkNotInitializedException extends FacebookException {
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);
}
}

View File

@@ -0,0 +1,21 @@
package com.facebook;
/* loaded from: classes.dex */
public class FacebookServiceException extends FacebookException {
private static final long serialVersionUID = 1;
private final FacebookRequestError error;
public FacebookServiceException(FacebookRequestError facebookRequestError, String str) {
super(str);
this.error = facebookRequestError;
}
public final FacebookRequestError getRequestError() {
return this.error;
}
@Override // com.facebook.FacebookException, java.lang.Throwable
public final String toString() {
return "{FacebookServiceException: httpResponseCode: " + this.error.getRequestStatusCode() + ", facebookErrorCode: " + this.error.getErrorCode() + ", facebookErrorType: " + this.error.getErrorType() + ", message: " + this.error.getErrorMessage() + "}";
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,67 @@
package com.facebook;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.util.Log;
import java.net.HttpURLConnection;
import java.util.List;
/* loaded from: classes.dex */
public class GraphRequestAsyncTask extends AsyncTask<Void, Void, List<GraphResponse>> {
private static final String d = GraphRequestAsyncTask.class.getCanonicalName();
private final HttpURLConnection a;
private final GraphRequestBatch b;
private Exception c;
public GraphRequestAsyncTask(GraphRequestBatch graphRequestBatch) {
this(null, graphRequestBatch);
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // android.os.AsyncTask
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public void onPostExecute(List<GraphResponse> list) {
super.onPostExecute(list);
Exception exc = this.c;
if (exc != null) {
Log.d(d, String.format("onPostExecute: exception encountered during request: %s", exc.getMessage()));
}
}
@Override // android.os.AsyncTask
protected void onPreExecute() {
super.onPreExecute();
if (FacebookSdk.n()) {
Log.d(d, String.format("execute async task: %s", this));
}
if (this.b.f() == null) {
this.b.a(Thread.currentThread() instanceof HandlerThread ? new Handler() : new Handler(Looper.getMainLooper()));
}
}
public String toString() {
return "{RequestAsyncTask: connection: " + this.a + ", requests: " + this.b + "}";
}
public GraphRequestAsyncTask(HttpURLConnection httpURLConnection, GraphRequestBatch graphRequestBatch) {
this.b = graphRequestBatch;
this.a = httpURLConnection;
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // android.os.AsyncTask
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public List<GraphResponse> doInBackground(Void... voidArr) {
try {
if (this.a == null) {
return this.b.a();
}
return GraphRequest.a(this.a, this.b);
} catch (Exception e) {
this.c = e;
return null;
}
}
}

View File

@@ -0,0 +1,127 @@
package com.facebook;
import android.os.Handler;
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/* loaded from: classes.dex */
public class GraphRequestBatch extends AbstractList<GraphRequest> {
private static AtomicInteger g = new AtomicInteger();
private Handler a;
private List<GraphRequest> b;
private int c = 0;
private final String d = Integer.valueOf(g.incrementAndGet()).toString();
private List<Callback> e = new ArrayList();
private String f;
public interface Callback {
void a(GraphRequestBatch graphRequestBatch);
}
public interface OnProgressCallback extends Callback {
void a(GraphRequestBatch graphRequestBatch, long j, long j2);
}
public GraphRequestBatch(Collection<GraphRequest> collection) {
this.b = new ArrayList();
this.b = new ArrayList(collection);
}
public void a(Callback callback) {
if (this.e.contains(callback)) {
return;
}
this.e.add(callback);
}
@Override // java.util.AbstractList, java.util.List
/* renamed from: b, reason: merged with bridge method [inline-methods] */
public final GraphRequest set(int i, GraphRequest graphRequest) {
return this.b.set(i, graphRequest);
}
public final GraphRequestAsyncTask c() {
return d();
}
@Override // java.util.AbstractList, java.util.AbstractCollection, java.util.Collection, java.util.List
public final void clear() {
this.b.clear();
}
GraphRequestAsyncTask d() {
return GraphRequest.b(this);
}
public final String e() {
return this.f;
}
final Handler f() {
return this.a;
}
final List<Callback> g() {
return this.e;
}
final String j() {
return this.d;
}
final List<GraphRequest> k() {
return this.b;
}
public int l() {
return this.c;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public final int size() {
return this.b.size();
}
List<GraphResponse> b() {
return GraphRequest.a(this);
}
@Override // java.util.AbstractList, java.util.List
public final GraphRequest get(int i) {
return this.b.get(i);
}
@Override // java.util.AbstractList, java.util.List
public final GraphRequest remove(int i) {
return this.b.remove(i);
}
@Override // java.util.AbstractList, java.util.AbstractCollection, java.util.Collection, java.util.List
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public final boolean add(GraphRequest graphRequest) {
return this.b.add(graphRequest);
}
@Override // java.util.AbstractList, java.util.List
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public final void add(int i, GraphRequest graphRequest) {
this.b.add(i, graphRequest);
}
final void a(Handler handler) {
this.a = handler;
}
public final List<GraphResponse> a() {
return b();
}
public GraphRequestBatch(GraphRequest... graphRequestArr) {
this.b = new ArrayList();
this.b = Arrays.asList(graphRequestArr);
}
}

View File

@@ -0,0 +1,221 @@
package com.facebook;
import com.facebook.internal.Logger;
import com.facebook.internal.Utility;
import com.ubt.jimu.diy.model.CategoryModel;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;
/* loaded from: classes.dex */
public class GraphResponse {
private final HttpURLConnection a;
private final JSONObject b;
private final FacebookRequestError c;
public enum PagingDirection {
NEXT,
PREVIOUS
}
GraphResponse(GraphRequest graphRequest, HttpURLConnection httpURLConnection, String str, JSONObject jSONObject) {
this(graphRequest, httpURLConnection, str, jSONObject, null, null);
}
public final FacebookRequestError a() {
return this.c;
}
public final JSONObject b() {
return this.b;
}
public String toString() {
String str;
try {
Locale locale = Locale.US;
Object[] objArr = new Object[1];
objArr[0] = Integer.valueOf(this.a != null ? this.a.getResponseCode() : 200);
str = String.format(locale, "%d", objArr);
} catch (IOException unused) {
str = CategoryModel.unknown;
}
return "{Response: responseCode: " + str + ", graphObject: " + this.b + ", error: " + this.c + "}";
}
GraphResponse(GraphRequest graphRequest, HttpURLConnection httpURLConnection, String str, JSONArray jSONArray) {
this(graphRequest, httpURLConnection, str, null, jSONArray, null);
}
static List<GraphResponse> a(HttpURLConnection httpURLConnection, GraphRequestBatch graphRequestBatch) {
InputStream inputStream = null;
try {
inputStream = httpURLConnection.getResponseCode() >= 400 ? httpURLConnection.getErrorStream() : httpURLConnection.getInputStream();
return a(inputStream, httpURLConnection, graphRequestBatch);
} catch (FacebookException e) {
Logger.a(LoggingBehavior.REQUESTS, "Response", "Response <Error>: %s", e);
return a(graphRequestBatch, httpURLConnection, e);
} catch (Exception e2) {
Logger.a(LoggingBehavior.REQUESTS, "Response", "Response <Error>: %s", e2);
return a(graphRequestBatch, httpURLConnection, new FacebookException(e2));
} finally {
Utility.a((Closeable) inputStream);
}
}
GraphResponse(GraphRequest graphRequest, HttpURLConnection httpURLConnection, FacebookRequestError facebookRequestError) {
this(graphRequest, httpURLConnection, null, null, null, facebookRequestError);
}
GraphResponse(GraphRequest graphRequest, HttpURLConnection httpURLConnection, String str, JSONObject jSONObject, JSONArray jSONArray, FacebookRequestError facebookRequestError) {
this.a = httpURLConnection;
this.b = jSONObject;
this.c = facebookRequestError;
}
static List<GraphResponse> a(InputStream inputStream, HttpURLConnection httpURLConnection, GraphRequestBatch graphRequestBatch) throws FacebookException, JSONException, IOException {
String a = Utility.a(inputStream);
Logger.a(LoggingBehavior.INCLUDE_RAW_RESPONSES, "Response", "Response (raw)\n Size: %d\n Response:\n%s\n", Integer.valueOf(a.length()), a);
return a(a, httpURLConnection, graphRequestBatch);
}
static List<GraphResponse> a(String str, HttpURLConnection httpURLConnection, GraphRequestBatch graphRequestBatch) throws FacebookException, JSONException, IOException {
List<GraphResponse> a = a(httpURLConnection, graphRequestBatch, new JSONTokener(str).nextValue());
Logger.a(LoggingBehavior.REQUESTS, "Response", "Response\n Id: %s\n Size: %d\n Responses:\n%s\n", graphRequestBatch.j(), Integer.valueOf(str.length()), a);
return a;
}
/* JADX WARN: Removed duplicated region for block: B:11:0x0056 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
private static java.util.List<com.facebook.GraphResponse> a(java.net.HttpURLConnection r7, java.util.List<com.facebook.GraphRequest> r8, java.lang.Object r9) throws com.facebook.FacebookException, org.json.JSONException {
/*
int r0 = r8.size()
java.util.ArrayList r1 = new java.util.ArrayList
r1.<init>(r0)
r2 = 0
r3 = 1
if (r0 != r3) goto L51
java.lang.Object r3 = r8.get(r2)
com.facebook.GraphRequest r3 = (com.facebook.GraphRequest) r3
org.json.JSONObject r4 = new org.json.JSONObject // Catch: java.io.IOException -> L34 org.json.JSONException -> L43
r4.<init>() // Catch: java.io.IOException -> L34 org.json.JSONException -> L43
java.lang.String r5 = "body"
r4.put(r5, r9) // Catch: java.io.IOException -> L34 org.json.JSONException -> L43
if (r7 == 0) goto L24
int r5 = r7.getResponseCode() // Catch: java.io.IOException -> L34 org.json.JSONException -> L43
goto L26
L24:
r5 = 200(0xc8, float:2.8E-43)
L26:
java.lang.String r6 = "code"
r4.put(r6, r5) // Catch: java.io.IOException -> L34 org.json.JSONException -> L43
org.json.JSONArray r5 = new org.json.JSONArray // Catch: java.io.IOException -> L34 org.json.JSONException -> L43
r5.<init>() // Catch: java.io.IOException -> L34 org.json.JSONException -> L43
r5.put(r4) // Catch: java.io.IOException -> L34 org.json.JSONException -> L43
goto L52
L34:
r4 = move-exception
com.facebook.GraphResponse r5 = new com.facebook.GraphResponse
com.facebook.FacebookRequestError r6 = new com.facebook.FacebookRequestError
r6.<init>(r7, r4)
r5.<init>(r3, r7, r6)
r1.add(r5)
goto L51
L43:
r4 = move-exception
com.facebook.GraphResponse r5 = new com.facebook.GraphResponse
com.facebook.FacebookRequestError r6 = new com.facebook.FacebookRequestError
r6.<init>(r7, r4)
r5.<init>(r3, r7, r6)
r1.add(r5)
L51:
r5 = r9
L52:
boolean r3 = r5 instanceof org.json.JSONArray
if (r3 == 0) goto L97
org.json.JSONArray r5 = (org.json.JSONArray) r5
int r3 = r5.length()
if (r3 != r0) goto L97
L5e:
int r0 = r5.length()
if (r2 >= r0) goto L96
java.lang.Object r0 = r8.get(r2)
com.facebook.GraphRequest r0 = (com.facebook.GraphRequest) r0
java.lang.Object r3 = r5.get(r2) // Catch: com.facebook.FacebookException -> L76 org.json.JSONException -> L85
com.facebook.GraphResponse r3 = a(r0, r7, r3, r9) // Catch: com.facebook.FacebookException -> L76 org.json.JSONException -> L85
r1.add(r3) // Catch: com.facebook.FacebookException -> L76 org.json.JSONException -> L85
goto L93
L76:
r3 = move-exception
com.facebook.GraphResponse r4 = new com.facebook.GraphResponse
com.facebook.FacebookRequestError r6 = new com.facebook.FacebookRequestError
r6.<init>(r7, r3)
r4.<init>(r0, r7, r6)
r1.add(r4)
goto L93
L85:
r3 = move-exception
com.facebook.GraphResponse r4 = new com.facebook.GraphResponse
com.facebook.FacebookRequestError r6 = new com.facebook.FacebookRequestError
r6.<init>(r7, r3)
r4.<init>(r0, r7, r6)
r1.add(r4)
L93:
int r2 = r2 + 1
goto L5e
L96:
return r1
L97:
com.facebook.FacebookException r7 = new com.facebook.FacebookException
java.lang.String r8 = "Unexpected number of results"
r7.<init>(r8)
throw r7
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.GraphResponse.a(java.net.HttpURLConnection, java.util.List, java.lang.Object):java.util.List");
}
private static GraphResponse a(GraphRequest graphRequest, HttpURLConnection httpURLConnection, Object obj, Object obj2) throws JSONException {
if (obj instanceof JSONObject) {
JSONObject jSONObject = (JSONObject) obj;
FacebookRequestError checkResponseAndCreateError = FacebookRequestError.checkResponseAndCreateError(jSONObject, obj2, httpURLConnection);
if (checkResponseAndCreateError != null) {
if (checkResponseAndCreateError.getErrorCode() == 190 && Utility.a(graphRequest.c())) {
AccessToken.setCurrentAccessToken(null);
}
return new GraphResponse(graphRequest, httpURLConnection, checkResponseAndCreateError);
}
Object a = Utility.a(jSONObject, "body", "FACEBOOK_NON_JSON_RESULT");
if (a instanceof JSONObject) {
return new GraphResponse(graphRequest, httpURLConnection, a.toString(), (JSONObject) a);
}
if (a instanceof JSONArray) {
return new GraphResponse(graphRequest, httpURLConnection, a.toString(), (JSONArray) a);
}
obj = JSONObject.NULL;
}
if (obj == JSONObject.NULL) {
return new GraphResponse(graphRequest, httpURLConnection, obj.toString(), (JSONObject) null);
}
throw new FacebookException("Got unexpected object type in response, class: " + obj.getClass().getSimpleName());
}
static List<GraphResponse> a(List<GraphRequest> list, HttpURLConnection httpURLConnection, FacebookException facebookException) {
int size = list.size();
ArrayList arrayList = new ArrayList(size);
for (int i = 0; i < size; i++) {
arrayList.add(new GraphResponse(list.get(i), httpURLConnection, new FacebookRequestError(httpURLConnection, facebookException)));
}
return arrayList;
}
}

View File

@@ -0,0 +1,8 @@
package com.facebook;
/* loaded from: classes.dex */
public enum HttpMethod {
GET,
POST,
DELETE
}

View File

@@ -0,0 +1,228 @@
package com.facebook;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import com.facebook.internal.Logger;
import com.facebook.internal.Utility;
import com.facebook.internal.Validate;
import java.util.ArrayList;
import java.util.Date;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
final class LegacyTokenHelper {
private static final String c = "LegacyTokenHelper";
private String a;
private SharedPreferences b;
public LegacyTokenHelper(Context context) {
this(context, null);
}
public static String c(Bundle bundle) {
Validate.a(bundle, "bundle");
return bundle.getString("com.facebook.TokenCachingStrategy.Token");
}
public static boolean d(Bundle bundle) {
String string;
return (bundle == null || (string = bundle.getString("com.facebook.TokenCachingStrategy.Token")) == null || string.length() == 0 || bundle.getLong("com.facebook.TokenCachingStrategy.ExpirationDate", 0L) == 0) ? false : true;
}
public void a() {
this.b.edit().clear().apply();
}
public Bundle b() {
Bundle bundle = new Bundle();
for (String str : this.b.getAll().keySet()) {
try {
a(str, bundle);
} catch (JSONException e) {
Logger.a(LoggingBehavior.CACHE, 5, c, "Error reading cached value for key: '" + str + "' -- " + e);
return null;
}
}
return bundle;
}
public LegacyTokenHelper(Context context, String str) {
Validate.a(context, "context");
this.a = Utility.c(str) ? "com.facebook.SharedPreferencesTokenCachingStrategy.DEFAULT_KEY" : str;
Context applicationContext = context.getApplicationContext();
this.b = (applicationContext != null ? applicationContext : context).getSharedPreferences(this.a, 0);
}
public static String a(Bundle bundle) {
Validate.a(bundle, "bundle");
return bundle.getString("com.facebook.TokenCachingStrategy.ApplicationId");
}
static Date a(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 void a(String str, Bundle bundle) throws JSONException {
JSONObject jSONObject = new JSONObject(this.b.getString(str, "{}"));
String string = jSONObject.getString("valueType");
if (string.equals("bool")) {
bundle.putBoolean(str, jSONObject.getBoolean("value"));
return;
}
int i = 0;
if (string.equals("bool[]")) {
JSONArray jSONArray = jSONObject.getJSONArray("value");
boolean[] zArr = new boolean[jSONArray.length()];
while (i < zArr.length) {
zArr[i] = jSONArray.getBoolean(i);
i++;
}
bundle.putBooleanArray(str, zArr);
return;
}
if (string.equals("byte")) {
bundle.putByte(str, (byte) jSONObject.getInt("value"));
return;
}
if (string.equals("byte[]")) {
JSONArray jSONArray2 = jSONObject.getJSONArray("value");
byte[] bArr = new byte[jSONArray2.length()];
while (i < bArr.length) {
bArr[i] = (byte) jSONArray2.getInt(i);
i++;
}
bundle.putByteArray(str, bArr);
return;
}
if (string.equals("short")) {
bundle.putShort(str, (short) jSONObject.getInt("value"));
return;
}
if (string.equals("short[]")) {
JSONArray jSONArray3 = jSONObject.getJSONArray("value");
short[] sArr = new short[jSONArray3.length()];
while (i < sArr.length) {
sArr[i] = (short) jSONArray3.getInt(i);
i++;
}
bundle.putShortArray(str, sArr);
return;
}
if (string.equals("int")) {
bundle.putInt(str, jSONObject.getInt("value"));
return;
}
if (string.equals("int[]")) {
JSONArray jSONArray4 = jSONObject.getJSONArray("value");
int[] iArr = new int[jSONArray4.length()];
while (i < iArr.length) {
iArr[i] = jSONArray4.getInt(i);
i++;
}
bundle.putIntArray(str, iArr);
return;
}
if (string.equals("long")) {
bundle.putLong(str, jSONObject.getLong("value"));
return;
}
if (string.equals("long[]")) {
JSONArray jSONArray5 = jSONObject.getJSONArray("value");
long[] jArr = new long[jSONArray5.length()];
while (i < jArr.length) {
jArr[i] = jSONArray5.getLong(i);
i++;
}
bundle.putLongArray(str, jArr);
return;
}
if (string.equals("float")) {
bundle.putFloat(str, (float) jSONObject.getDouble("value"));
return;
}
if (string.equals("float[]")) {
JSONArray jSONArray6 = jSONObject.getJSONArray("value");
float[] fArr = new float[jSONArray6.length()];
while (i < fArr.length) {
fArr[i] = (float) jSONArray6.getDouble(i);
i++;
}
bundle.putFloatArray(str, fArr);
return;
}
if (string.equals("double")) {
bundle.putDouble(str, jSONObject.getDouble("value"));
return;
}
if (string.equals("double[]")) {
JSONArray jSONArray7 = jSONObject.getJSONArray("value");
double[] dArr = new double[jSONArray7.length()];
while (i < dArr.length) {
dArr[i] = jSONArray7.getDouble(i);
i++;
}
bundle.putDoubleArray(str, dArr);
return;
}
if (string.equals("char")) {
String string2 = jSONObject.getString("value");
if (string2 == null || string2.length() != 1) {
return;
}
bundle.putChar(str, string2.charAt(0));
return;
}
if (string.equals("char[]")) {
JSONArray jSONArray8 = jSONObject.getJSONArray("value");
char[] cArr = new char[jSONArray8.length()];
for (int i2 = 0; i2 < cArr.length; i2++) {
String string3 = jSONArray8.getString(i2);
if (string3 != null && string3.length() == 1) {
cArr[i2] = string3.charAt(0);
}
}
bundle.putCharArray(str, cArr);
return;
}
if (string.equals("string")) {
bundle.putString(str, jSONObject.getString("value"));
return;
}
if (string.equals("stringList")) {
JSONArray jSONArray9 = jSONObject.getJSONArray("value");
int length = jSONArray9.length();
ArrayList<String> arrayList = new ArrayList<>(length);
while (i < length) {
Object obj = jSONArray9.get(i);
arrayList.add(i, obj == JSONObject.NULL ? null : (String) obj);
i++;
}
bundle.putStringArrayList(str, arrayList);
return;
}
if (string.equals("enum")) {
try {
bundle.putSerializable(str, Enum.valueOf(Class.forName(jSONObject.getString("enumType")), jSONObject.getString("value")));
} catch (ClassNotFoundException | IllegalArgumentException unused) {
}
}
}
public static AccessTokenSource b(Bundle bundle) {
Validate.a(bundle, "bundle");
if (bundle.containsKey("com.facebook.TokenCachingStrategy.AccessTokenSource")) {
return (AccessTokenSource) bundle.getSerializable("com.facebook.TokenCachingStrategy.AccessTokenSource");
}
return bundle.getBoolean("com.facebook.TokenCachingStrategy.IsSSO") ? AccessTokenSource.FACEBOOK_APPLICATION_WEB : AccessTokenSource.WEB_VIEW;
}
}

View File

@@ -0,0 +1,13 @@
package com.facebook;
/* loaded from: classes.dex */
public enum LoggingBehavior {
REQUESTS,
INCLUDE_ACCESS_TOKENS,
INCLUDE_RAW_RESPONSES,
CACHE,
APP_EVENTS,
DEVELOPER_ERRORS,
GRAPH_API_DEBUG_WARNING,
GRAPH_API_DEBUG_INFO
}

View File

@@ -0,0 +1,218 @@
package com.facebook;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
import com.facebook.internal.ImageRequest;
import com.facebook.internal.Utility;
import com.facebook.internal.Validate;
import com.ubt.jimu.base.entities.Constant;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
public final class Profile implements Parcelable {
public static final Parcelable.Creator<Profile> CREATOR = new Parcelable.Creator() { // from class: com.facebook.Profile.2
@Override // android.os.Parcelable.Creator
public Profile createFromParcel(Parcel parcel) {
return new Profile(parcel);
}
@Override // android.os.Parcelable.Creator
public Profile[] newArray(int i) {
return new Profile[i];
}
};
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 final String firstName;
private final String id;
private final String lastName;
private final Uri linkUri;
private final String middleName;
private final String name;
public static void fetchProfileForCurrentAccessToken() {
AccessToken currentAccessToken = AccessToken.getCurrentAccessToken();
if (currentAccessToken == null) {
setCurrentProfile(null);
} else {
Utility.a(currentAccessToken.getToken(), new Utility.GraphMeRequestWithCacheCallback() { // from class: com.facebook.Profile.1
@Override // com.facebook.internal.Utility.GraphMeRequestWithCacheCallback
public void a(FacebookException facebookException) {
}
@Override // com.facebook.internal.Utility.GraphMeRequestWithCacheCallback
public void a(JSONObject jSONObject) {
String optString = jSONObject.optString("id");
if (optString == null) {
return;
}
String optString2 = jSONObject.optString(Constant.Community.SOURCE_LINK_TYPE);
Profile.setCurrentProfile(new Profile(optString, jSONObject.optString(Profile.FIRST_NAME_KEY), jSONObject.optString(Profile.MIDDLE_NAME_KEY), jSONObject.optString(Profile.LAST_NAME_KEY), jSONObject.optString("name"), optString2 != null ? Uri.parse(optString2) : null));
}
});
}
}
public static Profile getCurrentProfile() {
return ProfileManager.c().a();
}
public static void setCurrentProfile(Profile profile) {
ProfileManager.c().a(profile);
}
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Profile)) {
return false;
}
Profile profile = (Profile) obj;
if (this.id.equals(profile.id) && this.firstName == null) {
if (profile.firstName == null) {
return true;
}
} else if (this.firstName.equals(profile.firstName) && this.middleName == null) {
if (profile.middleName == null) {
return true;
}
} else if (this.middleName.equals(profile.middleName) && this.lastName == null) {
if (profile.lastName == null) {
return true;
}
} else if (this.lastName.equals(profile.lastName) && this.name == null) {
if (profile.name == null) {
return true;
}
} else {
if (!this.name.equals(profile.name) || this.linkUri != null) {
return this.linkUri.equals(profile.linkUri);
}
if (profile.linkUri == null) {
return true;
}
}
return false;
}
public String getFirstName() {
return this.firstName;
}
public String getId() {
return this.id;
}
public String getLastName() {
return this.lastName;
}
public Uri getLinkUri() {
return this.linkUri;
}
public String getMiddleName() {
return this.middleName;
}
public String getName() {
return this.name;
}
public Uri getProfilePictureUri(int i, int i2) {
return ImageRequest.a(this.id, i, i2);
}
public int hashCode() {
int hashCode = 527 + this.id.hashCode();
String str = this.firstName;
if (str != null) {
hashCode = (hashCode * 31) + str.hashCode();
}
String str2 = this.middleName;
if (str2 != null) {
hashCode = (hashCode * 31) + str2.hashCode();
}
String str3 = this.lastName;
if (str3 != null) {
hashCode = (hashCode * 31) + str3.hashCode();
}
String str4 = this.name;
if (str4 != null) {
hashCode = (hashCode * 31) + str4.hashCode();
}
Uri uri = this.linkUri;
return uri != null ? (hashCode * 31) + uri.hashCode() : hashCode;
}
JSONObject toJSONObject() {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("id", this.id);
jSONObject.put(FIRST_NAME_KEY, this.firstName);
jSONObject.put(MIDDLE_NAME_KEY, this.middleName);
jSONObject.put(LAST_NAME_KEY, this.lastName);
jSONObject.put("name", this.name);
if (this.linkUri == null) {
return jSONObject;
}
jSONObject.put(LINK_URI_KEY, this.linkUri.toString());
return jSONObject;
} catch (JSONException unused) {
return null;
}
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel parcel, int i) {
parcel.writeString(this.id);
parcel.writeString(this.firstName);
parcel.writeString(this.middleName);
parcel.writeString(this.lastName);
parcel.writeString(this.name);
Uri uri = this.linkUri;
parcel.writeString(uri == null ? null : uri.toString());
}
public Profile(String str, String str2, String str3, String str4, String str5, Uri uri) {
Validate.a(str, "id");
this.id = str;
this.firstName = str2;
this.middleName = str3;
this.lastName = str4;
this.name = str5;
this.linkUri = uri;
}
Profile(JSONObject jSONObject) {
this.id = jSONObject.optString("id", null);
this.firstName = jSONObject.optString(FIRST_NAME_KEY, null);
this.middleName = jSONObject.optString(MIDDLE_NAME_KEY, 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 ? Uri.parse(optString) : 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);
}
}

View File

@@ -0,0 +1,37 @@
package com.facebook;
import android.content.SharedPreferences;
import com.facebook.internal.Validate;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
final class ProfileCache {
private final SharedPreferences a = FacebookSdk.b().getSharedPreferences("com.facebook.AccessTokenManager.SharedPreferences", 0);
ProfileCache() {
}
void a(Profile profile) {
Validate.a(profile, "profile");
JSONObject jSONObject = profile.toJSONObject();
if (jSONObject != null) {
this.a.edit().putString("com.facebook.ProfileManager.CachedProfile", jSONObject.toString()).apply();
}
}
Profile b() {
String string = this.a.getString("com.facebook.ProfileManager.CachedProfile", null);
if (string != null) {
try {
return new Profile(new JSONObject(string));
} catch (JSONException unused) {
}
}
return null;
}
void a() {
this.a.edit().remove("com.facebook.ProfileManager.CachedProfile").apply();
}
}

View File

@@ -0,0 +1,72 @@
package com.facebook;
import android.content.Intent;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.facebook.internal.Utility;
import com.facebook.internal.Validate;
/* loaded from: classes.dex */
final class ProfileManager {
private static volatile ProfileManager d;
private final LocalBroadcastManager a;
private final ProfileCache b;
private Profile c;
ProfileManager(LocalBroadcastManager localBroadcastManager, ProfileCache profileCache) {
Validate.a(localBroadcastManager, "localBroadcastManager");
Validate.a(profileCache, "profileCache");
this.a = localBroadcastManager;
this.b = profileCache;
}
static ProfileManager c() {
if (d == null) {
synchronized (ProfileManager.class) {
if (d == null) {
d = new ProfileManager(LocalBroadcastManager.a(FacebookSdk.b()), new ProfileCache());
}
}
}
return d;
}
Profile a() {
return this.c;
}
boolean b() {
Profile b = this.b.b();
if (b == null) {
return false;
}
a(b, false);
return true;
}
void a(Profile profile) {
a(profile, true);
}
private void a(Profile profile, boolean z) {
Profile profile2 = this.c;
this.c = profile;
if (z) {
if (profile != null) {
this.b.a(profile);
} else {
this.b.a();
}
}
if (Utility.a(profile2, profile)) {
return;
}
a(profile2, profile);
}
private void a(Profile profile, Profile profile2) {
Intent intent = new Intent("com.facebook.sdk.ACTION_CURRENT_PROFILE_CHANGED");
intent.putExtra("com.facebook.sdk.EXTRA_OLD_PROFILE", profile);
intent.putExtra("com.facebook.sdk.EXTRA_NEW_PROFILE", profile2);
this.a.a(intent);
}
}

View File

@@ -0,0 +1,57 @@
package com.facebook;
import android.os.Handler;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes.dex */
class ProgressNoopOutputStream extends OutputStream implements RequestOutputStream {
private final Map<GraphRequest, RequestProgress> a = new HashMap();
private final Handler b;
private GraphRequest c;
private RequestProgress d;
private int e;
ProgressNoopOutputStream(Handler handler) {
this.b = handler;
}
@Override // com.facebook.RequestOutputStream
public void a(GraphRequest graphRequest) {
this.c = graphRequest;
this.d = graphRequest != null ? this.a.get(graphRequest) : null;
}
Map<GraphRequest, RequestProgress> b() {
return this.a;
}
@Override // java.io.OutputStream
public void write(byte[] bArr) {
a(bArr.length);
}
@Override // java.io.OutputStream
public void write(byte[] bArr, int i, int i2) {
a(i2);
}
@Override // java.io.OutputStream
public void write(int i) {
a(1L);
}
int a() {
return this.e;
}
void a(long j) {
if (this.d == null) {
this.d = new RequestProgress(this.b, this.c);
this.a.put(this.c, this.d);
}
this.d.b(j);
this.e = (int) (this.e + j);
}
}

View File

@@ -0,0 +1,95 @@
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;
/* loaded from: classes.dex */
class ProgressOutputStream extends FilterOutputStream implements RequestOutputStream {
private final Map<GraphRequest, RequestProgress> a;
private final GraphRequestBatch b;
private final long c;
private long d;
private long e;
private long f;
private RequestProgress g;
ProgressOutputStream(OutputStream outputStream, GraphRequestBatch graphRequestBatch, Map<GraphRequest, RequestProgress> map, long j) {
super(outputStream);
this.b = graphRequestBatch;
this.a = map;
this.f = j;
this.c = FacebookSdk.k();
}
@Override // java.io.FilterOutputStream, java.io.OutputStream, java.io.Closeable, java.lang.AutoCloseable
public void close() throws IOException {
super.close();
Iterator<RequestProgress> it = this.a.values().iterator();
while (it.hasNext()) {
it.next().a();
}
a();
}
@Override // java.io.FilterOutputStream, java.io.OutputStream
public void write(byte[] bArr) throws IOException {
((FilterOutputStream) this).out.write(bArr);
a(bArr.length);
}
private void a(long j) {
RequestProgress requestProgress = this.g;
if (requestProgress != null) {
requestProgress.a(j);
}
this.d += j;
long j2 = this.d;
if (j2 >= this.e + this.c || j2 >= this.f) {
a();
}
}
@Override // java.io.FilterOutputStream, java.io.OutputStream
public void write(byte[] bArr, int i, int i2) throws IOException {
((FilterOutputStream) this).out.write(bArr, i, i2);
a(i2);
}
@Override // java.io.FilterOutputStream, java.io.OutputStream
public void write(int i) throws IOException {
((FilterOutputStream) this).out.write(i);
a(1L);
}
private void a() {
if (this.d > this.e) {
for (GraphRequestBatch.Callback callback : this.b.g()) {
if (callback instanceof GraphRequestBatch.OnProgressCallback) {
Handler f = this.b.f();
final GraphRequestBatch.OnProgressCallback onProgressCallback = (GraphRequestBatch.OnProgressCallback) callback;
if (f == null) {
onProgressCallback.a(this.b, this.d, this.f);
} else {
f.post(new Runnable() { // from class: com.facebook.ProgressOutputStream.1
@Override // java.lang.Runnable
public void run() {
onProgressCallback.a(ProgressOutputStream.this.b, ProgressOutputStream.this.d, ProgressOutputStream.this.f);
}
});
}
}
}
this.e = this.d;
}
}
@Override // com.facebook.RequestOutputStream
public void a(GraphRequest graphRequest) {
this.g = graphRequest != null ? this.a.get(graphRequest) : null;
}
}

View File

@@ -0,0 +1,137 @@
package com.facebook;
/* loaded from: classes.dex */
public final class R$drawable {
public static final int abc_ab_share_pack_mtrl_alpha = 2131230726;
public static final int abc_action_bar_item_background_material = 2131230727;
public static final int abc_btn_borderless_material = 2131230728;
public static final int abc_btn_check_material = 2131230729;
public static final int abc_btn_check_to_on_mtrl_000 = 2131230730;
public static final int abc_btn_check_to_on_mtrl_015 = 2131230731;
public static final int abc_btn_colored_material = 2131230732;
public static final int abc_btn_default_mtrl_shape = 2131230733;
public static final int abc_btn_radio_material = 2131230734;
public static final int abc_btn_radio_to_on_mtrl_000 = 2131230735;
public static final int abc_btn_radio_to_on_mtrl_015 = 2131230736;
public static final int abc_btn_switch_to_on_mtrl_00001 = 2131230737;
public static final int abc_btn_switch_to_on_mtrl_00012 = 2131230738;
public static final int abc_cab_background_internal_bg = 2131230739;
public static final int abc_cab_background_top_material = 2131230740;
public static final int abc_cab_background_top_mtrl_alpha = 2131230741;
public static final int abc_control_background_material = 2131230742;
public static final int abc_dialog_material_background = 2131230743;
public static final int abc_edit_text_material = 2131230744;
public static final int abc_ic_ab_back_material = 2131230745;
public static final int abc_ic_arrow_drop_right_black_24dp = 2131230746;
public static final int abc_ic_clear_material = 2131230747;
public static final int abc_ic_commit_search_api_mtrl_alpha = 2131230748;
public static final int abc_ic_go_search_api_material = 2131230749;
public static final int abc_ic_menu_copy_mtrl_am_alpha = 2131230750;
public static final int abc_ic_menu_cut_mtrl_alpha = 2131230751;
public static final int abc_ic_menu_overflow_material = 2131230752;
public static final int abc_ic_menu_paste_mtrl_am_alpha = 2131230753;
public static final int abc_ic_menu_selectall_mtrl_alpha = 2131230754;
public static final int abc_ic_menu_share_mtrl_alpha = 2131230755;
public static final int abc_ic_search_api_material = 2131230756;
public static final int abc_ic_star_black_16dp = 2131230757;
public static final int abc_ic_star_black_36dp = 2131230758;
public static final int abc_ic_star_black_48dp = 2131230759;
public static final int abc_ic_star_half_black_16dp = 2131230760;
public static final int abc_ic_star_half_black_36dp = 2131230761;
public static final int abc_ic_star_half_black_48dp = 2131230762;
public static final int abc_ic_voice_search_api_material = 2131230763;
public static final int abc_item_background_holo_dark = 2131230764;
public static final int abc_item_background_holo_light = 2131230765;
public static final int abc_list_divider_mtrl_alpha = 2131230767;
public static final int abc_list_focused_holo = 2131230768;
public static final int abc_list_longpressed_holo = 2131230769;
public static final int abc_list_pressed_holo_dark = 2131230770;
public static final int abc_list_pressed_holo_light = 2131230771;
public static final int abc_list_selector_background_transition_holo_dark = 2131230772;
public static final int abc_list_selector_background_transition_holo_light = 2131230773;
public static final int abc_list_selector_disabled_holo_dark = 2131230774;
public static final int abc_list_selector_disabled_holo_light = 2131230775;
public static final int abc_list_selector_holo_dark = 2131230776;
public static final int abc_list_selector_holo_light = 2131230777;
public static final int abc_menu_hardkey_panel_mtrl_mult = 2131230778;
public static final int abc_popup_background_mtrl_mult = 2131230779;
public static final int abc_ratingbar_indicator_material = 2131230780;
public static final int abc_ratingbar_material = 2131230781;
public static final int abc_ratingbar_small_material = 2131230782;
public static final int abc_scrubber_control_off_mtrl_alpha = 2131230783;
public static final int abc_scrubber_control_to_pressed_mtrl_000 = 2131230784;
public static final int abc_scrubber_control_to_pressed_mtrl_005 = 2131230785;
public static final int abc_scrubber_primary_mtrl_alpha = 2131230786;
public static final int abc_scrubber_track_mtrl_alpha = 2131230787;
public static final int abc_seekbar_thumb_material = 2131230788;
public static final int abc_seekbar_tick_mark_material = 2131230789;
public static final int abc_seekbar_track_material = 2131230790;
public static final int abc_spinner_mtrl_am_alpha = 2131230791;
public static final int abc_spinner_textfield_background_material = 2131230792;
public static final int abc_switch_thumb_material = 2131230793;
public static final int abc_switch_track_mtrl_alpha = 2131230794;
public static final int abc_tab_indicator_material = 2131230795;
public static final int abc_tab_indicator_mtrl_alpha = 2131230796;
public static final int abc_text_cursor_material = 2131230797;
public static final int abc_text_select_handle_left_mtrl_dark = 2131230798;
public static final int abc_text_select_handle_left_mtrl_light = 2131230799;
public static final int abc_text_select_handle_middle_mtrl_dark = 2131230800;
public static final int abc_text_select_handle_middle_mtrl_light = 2131230801;
public static final int abc_text_select_handle_right_mtrl_dark = 2131230802;
public static final int abc_text_select_handle_right_mtrl_light = 2131230803;
public static final int abc_textfield_activated_mtrl_alpha = 2131230804;
public static final int abc_textfield_default_mtrl_alpha = 2131230805;
public static final int abc_textfield_search_activated_mtrl_alpha = 2131230806;
public static final int abc_textfield_search_default_mtrl_alpha = 2131230807;
public static final int abc_textfield_search_material = 2131230808;
public static final int abc_vector_test = 2131230809;
public static final int com_facebook_auth_dialog_background = 2131230942;
public static final int com_facebook_auth_dialog_cancel_background = 2131230943;
public static final int com_facebook_auth_dialog_header_background = 2131230944;
public static final int com_facebook_button_background = 2131230945;
public static final int com_facebook_button_icon = 2131230946;
public static final int com_facebook_button_icon_blue = 2131230947;
public static final int com_facebook_button_icon_white = 2131230948;
public static final int com_facebook_button_like_background = 2131230949;
public static final int com_facebook_button_like_icon_selected = 2131230950;
public static final int com_facebook_button_login_background = 2131230951;
public static final int com_facebook_button_login_logo = 2131230952;
public static final int com_facebook_button_login_silver_background = 2131230953;
public static final int com_facebook_button_send_background = 2131230954;
public static final int com_facebook_button_send_icon_blue = 2131230955;
public static final int com_facebook_button_send_icon_white = 2131230956;
public static final int com_facebook_close = 2131230957;
public static final int com_facebook_favicon_blue = 2131230958;
public static final int com_facebook_profile_picture_blank_portrait = 2131230959;
public static final int com_facebook_profile_picture_blank_square = 2131230960;
public static final int com_facebook_send_button_icon = 2131230961;
public static final int com_facebook_tooltip_black_background = 2131230962;
public static final int com_facebook_tooltip_black_bottomnub = 2131230963;
public static final int com_facebook_tooltip_black_topnub = 2131230964;
public static final int com_facebook_tooltip_black_xout = 2131230965;
public static final int com_facebook_tooltip_blue_background = 2131230966;
public static final int com_facebook_tooltip_blue_bottomnub = 2131230967;
public static final int com_facebook_tooltip_blue_topnub = 2131230968;
public static final int com_facebook_tooltip_blue_xout = 2131230969;
public static final int messenger_bubble_large_blue = 2131231507;
public static final int messenger_bubble_large_white = 2131231508;
public static final int messenger_bubble_small_blue = 2131231509;
public static final int messenger_bubble_small_white = 2131231510;
public static final int messenger_button_blue_bg_round = 2131231511;
public static final int messenger_button_blue_bg_selector = 2131231512;
public static final int messenger_button_send_round_shadow = 2131231513;
public static final int messenger_button_white_bg_round = 2131231514;
public static final int messenger_button_white_bg_selector = 2131231515;
public static final int notification_action_background = 2131231536;
public static final int notification_bg = 2131231537;
public static final int notification_bg_low = 2131231538;
public static final int notification_bg_low_normal = 2131231539;
public static final int notification_bg_low_pressed = 2131231540;
public static final int notification_bg_normal = 2131231541;
public static final int notification_bg_normal_pressed = 2131231542;
public static final int notification_icon_background = 2131231543;
public static final int notification_template_icon_bg = 2131231544;
public static final int notification_template_icon_low_bg = 2131231545;
public static final int notification_tile_bg = 2131231546;
public static final int notify_panel_notification_icon_bg = 2131231547;
}

View File

@@ -0,0 +1,143 @@
package com.facebook;
/* loaded from: classes.dex */
public final class R$id {
public static final int action0 = 2131296268;
public static final int action_bar = 2131296272;
public static final int action_bar_activity_content = 2131296273;
public static final int action_bar_container = 2131296274;
public static final int action_bar_root = 2131296275;
public static final int action_bar_spinner = 2131296276;
public static final int action_bar_subtitle = 2131296277;
public static final int action_bar_title = 2131296278;
public static final int action_container = 2131296279;
public static final int action_context_bar = 2131296280;
public static final int action_divider = 2131296281;
public static final int action_image = 2131296282;
public static final int action_menu_divider = 2131296283;
public static final int action_menu_presenter = 2131296284;
public static final int action_mode_bar = 2131296285;
public static final int action_mode_bar_stub = 2131296286;
public static final int action_mode_close_button = 2131296287;
public static final int action_text = 2131296288;
public static final int actions = 2131296289;
public static final int activity_chooser_view_content = 2131296290;
public static final int add = 2131296309;
public static final int alertTitle = 2131296315;
public static final int always = 2131296317;
public static final int automatic = 2131296328;
public static final int beginning = 2131296339;
public static final int bottom = 2131296348;
public static final int box_count = 2131296353;
public static final int button = 2131296398;
public static final int buttonPanel = 2131296399;
public static final int cancel_action = 2131296403;
public static final int cancel_button = 2131296404;
public static final int center = 2131296441;
public static final int checkbox = 2131296449;
public static final int chronometer = 2131296452;
public static final int collapseActionView = 2131296459;
public static final int com_facebook_body_frame = 2131296463;
public static final int com_facebook_button_xout = 2131296464;
public static final int com_facebook_device_auth_instructions = 2131296465;
public static final int com_facebook_fragment_container = 2131296466;
public static final int com_facebook_login_activity_progress_bar = 2131296467;
public static final int com_facebook_smart_instructions_0 = 2131296468;
public static final int com_facebook_smart_instructions_or = 2131296469;
public static final int com_facebook_tooltip_bubble_view_bottom_pointer = 2131296470;
public static final int com_facebook_tooltip_bubble_view_text_body = 2131296471;
public static final int com_facebook_tooltip_bubble_view_top_pointer = 2131296472;
public static final int confirmation_code = 2131296478;
public static final int contentPanel = 2131296485;
public static final int custom = 2131296508;
public static final int customPanel = 2131296509;
public static final int decor_content_parent = 2131296525;
public static final int default_activity_button = 2131296526;
public static final int disableHome = 2131296537;
public static final int display_always = 2131296539;
public static final int edit_query = 2131296556;
public static final int end = 2131296567;
public static final int end_padder = 2131296568;
public static final int expand_activities_button = 2131296594;
public static final int expanded_menu = 2131296595;
public static final int home = 2131296696;
public static final int homeAsUp = 2131296697;
public static final int icon = 2131296701;
public static final int icon_group = 2131296702;
public static final int ifRoom = 2131296705;
public static final int image = 2131296817;
public static final int info = 2131296971;
public static final int inline = 2131296972;
public static final int large = 2131297046;
public static final int left = 2131297071;
public static final int line1 = 2131297087;
public static final int line3 = 2131297088;
public static final int listMode = 2131297089;
public static final int list_item = 2131297090;
public static final int media_actions = 2131297154;
public static final int messenger_send_button = 2131297164;
public static final int middle = 2131297168;
public static final int multiply = 2131297181;
public static final int never = 2131297188;
public static final int never_display = 2131297189;
public static final int none = 2131297193;
public static final int normal = 2131297194;
public static final int notification_background = 2131297195;
public static final int notification_main_column = 2131297196;
public static final int notification_main_column_container = 2131297197;
public static final int open_graph = 2131297204;
public static final int page = 2131297208;
public static final int parentPanel = 2131297216;
public static final int progress_bar = 2131297254;
public static final int progress_circular = 2131297255;
public static final int progress_horizontal = 2131297256;
public static final int radio = 2131297284;
public static final int right = 2131297305;
public static final int right_icon = 2131297308;
public static final int right_side = 2131297309;
public static final int screen = 2131297445;
public static final int scrollIndicatorDown = 2131297447;
public static final int scrollIndicatorUp = 2131297448;
public static final int scrollView = 2131297449;
public static final int search_badge = 2131297451;
public static final int search_bar = 2131297452;
public static final int search_button = 2131297453;
public static final int search_close_btn = 2131297454;
public static final int search_edit_frame = 2131297455;
public static final int search_go_btn = 2131297456;
public static final int search_mag_icon = 2131297457;
public static final int search_plate = 2131297458;
public static final int search_src_text = 2131297459;
public static final int search_voice_btn = 2131297460;
public static final int select_dialog_listview = 2131297462;
public static final int shortcut = 2131297475;
public static final int showCustom = 2131297476;
public static final int showHome = 2131297477;
public static final int showTitle = 2131297478;
public static final int small = 2131297483;
public static final int spacer = 2131297490;
public static final int split_action_bar = 2131297493;
public static final int src_atop = 2131297496;
public static final int src_in = 2131297497;
public static final int src_over = 2131297498;
public static final int standard = 2131297499;
public static final int status_bar_latest_event_content = 2131297504;
public static final int submenuarrow = 2131297512;
public static final int submit_area = 2131297513;
public static final int tabMode = 2131297522;
public static final int text = 2131297537;
public static final int text2 = 2131297538;
public static final int textSpacerNoButtons = 2131297539;
public static final int textSpacerNoTitle = 2131297540;
public static final int time = 2131297551;
public static final int title = 2131297555;
public static final int titleDividerNoCustom = 2131297556;
public static final int title_template = 2131297565;
public static final int top = 2131297568;
public static final int topPanel = 2131297569;
public static final int unknown = 2131297896;
public static final int up = 2131297898;
public static final int useLogo = 2131297902;
public static final int withText = 2131297984;
public static final int wrap_content = 2131297986;
}

View File

@@ -0,0 +1,61 @@
package com.facebook;
/* loaded from: classes.dex */
public final class R$layout {
public static final int abc_action_bar_title_item = 2131492864;
public static final int abc_action_bar_up_container = 2131492865;
public static final int abc_action_menu_item_layout = 2131492866;
public static final int abc_action_menu_layout = 2131492867;
public static final int abc_action_mode_bar = 2131492868;
public static final int abc_action_mode_close_item_material = 2131492869;
public static final int abc_activity_chooser_view = 2131492870;
public static final int abc_activity_chooser_view_list_item = 2131492871;
public static final int abc_alert_dialog_button_bar_material = 2131492872;
public static final int abc_alert_dialog_material = 2131492873;
public static final int abc_alert_dialog_title_material = 2131492874;
public static final int abc_dialog_title_material = 2131492876;
public static final int abc_expanded_menu_layout = 2131492877;
public static final int abc_list_menu_item_checkbox = 2131492878;
public static final int abc_list_menu_item_icon = 2131492879;
public static final int abc_list_menu_item_layout = 2131492880;
public static final int abc_list_menu_item_radio = 2131492881;
public static final int abc_popup_menu_header_item_layout = 2131492882;
public static final int abc_popup_menu_item_layout = 2131492883;
public static final int abc_screen_content_include = 2131492884;
public static final int abc_screen_simple = 2131492885;
public static final int abc_screen_simple_overlay_action_mode = 2131492886;
public static final int abc_screen_toolbar = 2131492887;
public static final int abc_search_dropdown_item_icons_2line = 2131492888;
public static final int abc_search_view = 2131492889;
public static final int abc_select_dialog_material = 2131492890;
public static final int com_facebook_activity_layout = 2131493015;
public static final int com_facebook_device_auth_dialog_fragment = 2131493016;
public static final int com_facebook_login_fragment = 2131493017;
public static final int com_facebook_smart_device_dialog_fragment = 2131493018;
public static final int com_facebook_tooltip_bubble = 2131493019;
public static final int messenger_button_send_blue_large = 2131493279;
public static final int messenger_button_send_blue_round = 2131493280;
public static final int messenger_button_send_blue_small = 2131493281;
public static final int messenger_button_send_white_large = 2131493282;
public static final int messenger_button_send_white_round = 2131493283;
public static final int messenger_button_send_white_small = 2131493284;
public static final int notification_action = 2131493288;
public static final int notification_action_tombstone = 2131493289;
public static final int notification_media_action = 2131493290;
public static final int notification_media_cancel_action = 2131493291;
public static final int notification_template_big_media = 2131493292;
public static final int notification_template_big_media_custom = 2131493293;
public static final int notification_template_big_media_narrow = 2131493294;
public static final int notification_template_big_media_narrow_custom = 2131493295;
public static final int notification_template_custom_big = 2131493296;
public static final int notification_template_icon_group = 2131493297;
public static final int notification_template_lines_media = 2131493298;
public static final int notification_template_media = 2131493299;
public static final int notification_template_media_custom = 2131493300;
public static final int notification_template_part_chronometer = 2131493301;
public static final int notification_template_part_time = 2131493302;
public static final int select_dialog_item_material = 2131493348;
public static final int select_dialog_multichoice_material = 2131493349;
public static final int select_dialog_singlechoice_material = 2131493350;
public static final int support_simple_spinner_dropdown_item = 2131493355;
}

View File

@@ -0,0 +1,60 @@
package com.facebook;
/* loaded from: classes.dex */
public final class R$string {
public static final int abc_action_bar_home_description = 2131820553;
public static final int abc_action_bar_up_description = 2131820554;
public static final int abc_action_menu_overflow_description = 2131820555;
public static final int abc_action_mode_done = 2131820556;
public static final int abc_activity_chooser_view_see_all = 2131820557;
public static final int abc_activitychooserview_choose_application = 2131820558;
public static final int abc_capital_off = 2131820559;
public static final int abc_capital_on = 2131820560;
public static final int abc_font_family_body_1_material = 2131820561;
public static final int abc_font_family_body_2_material = 2131820562;
public static final int abc_font_family_button_material = 2131820563;
public static final int abc_font_family_caption_material = 2131820564;
public static final int abc_font_family_display_1_material = 2131820565;
public static final int abc_font_family_display_2_material = 2131820566;
public static final int abc_font_family_display_3_material = 2131820567;
public static final int abc_font_family_display_4_material = 2131820568;
public static final int abc_font_family_headline_material = 2131820569;
public static final int abc_font_family_menu_material = 2131820570;
public static final int abc_font_family_subhead_material = 2131820571;
public static final int abc_font_family_title_material = 2131820572;
public static final int abc_search_hint = 2131820583;
public static final int abc_searchview_description_clear = 2131820584;
public static final int abc_searchview_description_query = 2131820585;
public static final int abc_searchview_description_search = 2131820586;
public static final int abc_searchview_description_submit = 2131820587;
public static final int abc_searchview_description_voice = 2131820588;
public static final int abc_shareactionprovider_share_with = 2131820589;
public static final int abc_shareactionprovider_share_with_application = 2131820590;
public static final int abc_toolbar_collapse_description = 2131820591;
public static final int com_facebook_device_auth_instructions = 2131820750;
public static final int com_facebook_image_download_unknown_error = 2131820751;
public static final int com_facebook_internet_permission_error_message = 2131820752;
public static final int com_facebook_internet_permission_error_title = 2131820753;
public static final int com_facebook_like_button_liked = 2131820754;
public static final int com_facebook_like_button_not_liked = 2131820755;
public static final int com_facebook_loading = 2131820756;
public static final int com_facebook_loginview_cancel_action = 2131820757;
public static final int com_facebook_loginview_log_in_button = 2131820758;
public static final int com_facebook_loginview_log_in_button_continue = 2131820759;
public static final int com_facebook_loginview_log_in_button_long = 2131820762;
public static final int com_facebook_loginview_log_out_action = 2131820763;
public static final int com_facebook_loginview_log_out_button = 2131820766;
public static final int com_facebook_loginview_logged_in_as = 2131820769;
public static final int com_facebook_loginview_logged_in_using_facebook = 2131820772;
public static final int com_facebook_send_button_text = 2131820775;
public static final int com_facebook_share_button_text = 2131820778;
public static final int com_facebook_smart_device_instructions = 2131820781;
public static final int com_facebook_smart_device_instructions_or = 2131820782;
public static final int com_facebook_smart_login_confirmation_cancel = 2131820783;
public static final int com_facebook_smart_login_confirmation_continue_as = 2131820786;
public static final int com_facebook_smart_login_confirmation_title = 2131820789;
public static final int com_facebook_tooltip_default = 2131820792;
public static final int messenger_send_button_text = 2131821253;
public static final int search_menu_title = 2131821508;
public static final int status_bar_notification_info_overflow = 2131821607;
}

View File

@@ -0,0 +1,358 @@
package com.facebook;
/* loaded from: classes.dex */
public final class R$style {
public static final int AlertDialog_AppCompat = 2131886081;
public static final int AlertDialog_AppCompat_Light = 2131886082;
public static final int Animation_AppCompat_Dialog = 2131886084;
public static final int Animation_AppCompat_DropDownUp = 2131886085;
public static final int Base_AlertDialog_AppCompat = 2131886093;
public static final int Base_AlertDialog_AppCompat_Light = 2131886094;
public static final int Base_Animation_AppCompat_Dialog = 2131886095;
public static final int Base_Animation_AppCompat_DropDownUp = 2131886096;
public static final int Base_CardView = 2131886098;
public static final int Base_DialogWindowTitleBackground_AppCompat = 2131886100;
public static final int Base_DialogWindowTitle_AppCompat = 2131886099;
public static final int Base_TextAppearance_AppCompat = 2131886101;
public static final int Base_TextAppearance_AppCompat_Body1 = 2131886102;
public static final int Base_TextAppearance_AppCompat_Body2 = 2131886103;
public static final int Base_TextAppearance_AppCompat_Button = 2131886104;
public static final int Base_TextAppearance_AppCompat_Caption = 2131886105;
public static final int Base_TextAppearance_AppCompat_Display1 = 2131886106;
public static final int Base_TextAppearance_AppCompat_Display2 = 2131886107;
public static final int Base_TextAppearance_AppCompat_Display3 = 2131886108;
public static final int Base_TextAppearance_AppCompat_Display4 = 2131886109;
public static final int Base_TextAppearance_AppCompat_Headline = 2131886110;
public static final int Base_TextAppearance_AppCompat_Inverse = 2131886111;
public static final int Base_TextAppearance_AppCompat_Large = 2131886112;
public static final int Base_TextAppearance_AppCompat_Large_Inverse = 2131886113;
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 2131886114;
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 2131886115;
public static final int Base_TextAppearance_AppCompat_Medium = 2131886116;
public static final int Base_TextAppearance_AppCompat_Medium_Inverse = 2131886117;
public static final int Base_TextAppearance_AppCompat_Menu = 2131886118;
public static final int Base_TextAppearance_AppCompat_SearchResult = 2131886119;
public static final int Base_TextAppearance_AppCompat_SearchResult_Subtitle = 2131886120;
public static final int Base_TextAppearance_AppCompat_SearchResult_Title = 2131886121;
public static final int Base_TextAppearance_AppCompat_Small = 2131886122;
public static final int Base_TextAppearance_AppCompat_Small_Inverse = 2131886123;
public static final int Base_TextAppearance_AppCompat_Subhead = 2131886124;
public static final int Base_TextAppearance_AppCompat_Subhead_Inverse = 2131886125;
public static final int Base_TextAppearance_AppCompat_Title = 2131886126;
public static final int Base_TextAppearance_AppCompat_Title_Inverse = 2131886127;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Menu = 2131886129;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 2131886130;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 2131886131;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title = 2131886132;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 2131886133;
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 2131886134;
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Title = 2131886135;
public static final int Base_TextAppearance_AppCompat_Widget_Button = 2131886136;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 2131886137;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Colored = 2131886138;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Inverse = 2131886139;
public static final int Base_TextAppearance_AppCompat_Widget_DropDownItem = 2131886140;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Header = 2131886141;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Large = 2131886142;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Small = 2131886143;
public static final int Base_TextAppearance_AppCompat_Widget_Switch = 2131886144;
public static final int Base_TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 2131886145;
public static final int Base_TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 2131886146;
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 2131886147;
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Title = 2131886148;
public static final int Base_ThemeOverlay_AppCompat = 2131886180;
public static final int Base_ThemeOverlay_AppCompat_ActionBar = 2131886181;
public static final int Base_ThemeOverlay_AppCompat_Dark = 2131886182;
public static final int Base_ThemeOverlay_AppCompat_Dark_ActionBar = 2131886183;
public static final int Base_ThemeOverlay_AppCompat_Dialog = 2131886184;
public static final int Base_ThemeOverlay_AppCompat_Dialog_Alert = 2131886185;
public static final int Base_ThemeOverlay_AppCompat_Light = 2131886186;
public static final int Base_Theme_AppCompat = 2131886149;
public static final int Base_Theme_AppCompat_CompactMenu = 2131886150;
public static final int Base_Theme_AppCompat_Dialog = 2131886151;
public static final int Base_Theme_AppCompat_DialogWhenLarge = 2131886155;
public static final int Base_Theme_AppCompat_Dialog_Alert = 2131886152;
public static final int Base_Theme_AppCompat_Dialog_FixedSize = 2131886153;
public static final int Base_Theme_AppCompat_Dialog_MinWidth = 2131886154;
public static final int Base_Theme_AppCompat_Light = 2131886156;
public static final int Base_Theme_AppCompat_Light_DarkActionBar = 2131886157;
public static final int Base_Theme_AppCompat_Light_Dialog = 2131886158;
public static final int Base_Theme_AppCompat_Light_DialogWhenLarge = 2131886162;
public static final int Base_Theme_AppCompat_Light_Dialog_Alert = 2131886159;
public static final int Base_Theme_AppCompat_Light_Dialog_FixedSize = 2131886160;
public static final int Base_Theme_AppCompat_Light_Dialog_MinWidth = 2131886161;
public static final int Base_V21_ThemeOverlay_AppCompat_Dialog = 2131886202;
public static final int Base_V21_Theme_AppCompat = 2131886198;
public static final int Base_V21_Theme_AppCompat_Dialog = 2131886199;
public static final int Base_V21_Theme_AppCompat_Light = 2131886200;
public static final int Base_V21_Theme_AppCompat_Light_Dialog = 2131886201;
public static final int Base_V22_Theme_AppCompat = 2131886203;
public static final int Base_V22_Theme_AppCompat_Light = 2131886204;
public static final int Base_V23_Theme_AppCompat = 2131886205;
public static final int Base_V23_Theme_AppCompat_Light = 2131886206;
public static final int Base_V7_ThemeOverlay_AppCompat_Dialog = 2131886216;
public static final int Base_V7_Theme_AppCompat = 2131886212;
public static final int Base_V7_Theme_AppCompat_Dialog = 2131886213;
public static final int Base_V7_Theme_AppCompat_Light = 2131886214;
public static final int Base_V7_Theme_AppCompat_Light_Dialog = 2131886215;
public static final int Base_V7_Widget_AppCompat_AutoCompleteTextView = 2131886217;
public static final int Base_V7_Widget_AppCompat_EditText = 2131886218;
public static final int Base_Widget_AppCompat_ActionBar = 2131886220;
public static final int Base_Widget_AppCompat_ActionBar_Solid = 2131886221;
public static final int Base_Widget_AppCompat_ActionBar_TabBar = 2131886222;
public static final int Base_Widget_AppCompat_ActionBar_TabText = 2131886223;
public static final int Base_Widget_AppCompat_ActionBar_TabView = 2131886224;
public static final int Base_Widget_AppCompat_ActionButton = 2131886225;
public static final int Base_Widget_AppCompat_ActionButton_CloseMode = 2131886226;
public static final int Base_Widget_AppCompat_ActionButton_Overflow = 2131886227;
public static final int Base_Widget_AppCompat_ActionMode = 2131886228;
public static final int Base_Widget_AppCompat_ActivityChooserView = 2131886229;
public static final int Base_Widget_AppCompat_AutoCompleteTextView = 2131886230;
public static final int Base_Widget_AppCompat_Button = 2131886231;
public static final int Base_Widget_AppCompat_ButtonBar = 2131886237;
public static final int Base_Widget_AppCompat_ButtonBar_AlertDialog = 2131886238;
public static final int Base_Widget_AppCompat_Button_Borderless = 2131886232;
public static final int Base_Widget_AppCompat_Button_Borderless_Colored = 2131886233;
public static final int Base_Widget_AppCompat_Button_ButtonBar_AlertDialog = 2131886234;
public static final int Base_Widget_AppCompat_Button_Colored = 2131886235;
public static final int Base_Widget_AppCompat_Button_Small = 2131886236;
public static final int Base_Widget_AppCompat_CompoundButton_CheckBox = 2131886239;
public static final int Base_Widget_AppCompat_CompoundButton_RadioButton = 2131886240;
public static final int Base_Widget_AppCompat_CompoundButton_Switch = 2131886241;
public static final int Base_Widget_AppCompat_DrawerArrowToggle = 2131886242;
public static final int Base_Widget_AppCompat_DrawerArrowToggle_Common = 2131886243;
public static final int Base_Widget_AppCompat_DropDownItem_Spinner = 2131886244;
public static final int Base_Widget_AppCompat_EditText = 2131886245;
public static final int Base_Widget_AppCompat_ImageButton = 2131886246;
public static final int Base_Widget_AppCompat_Light_ActionBar = 2131886247;
public static final int Base_Widget_AppCompat_Light_ActionBar_Solid = 2131886248;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabBar = 2131886249;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText = 2131886250;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText_Inverse = 2131886251;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabView = 2131886252;
public static final int Base_Widget_AppCompat_Light_PopupMenu = 2131886253;
public static final int Base_Widget_AppCompat_Light_PopupMenu_Overflow = 2131886254;
public static final int Base_Widget_AppCompat_ListMenuView = 2131886255;
public static final int Base_Widget_AppCompat_ListPopupWindow = 2131886256;
public static final int Base_Widget_AppCompat_ListView = 2131886257;
public static final int Base_Widget_AppCompat_ListView_DropDown = 2131886258;
public static final int Base_Widget_AppCompat_ListView_Menu = 2131886259;
public static final int Base_Widget_AppCompat_PopupMenu = 2131886260;
public static final int Base_Widget_AppCompat_PopupMenu_Overflow = 2131886261;
public static final int Base_Widget_AppCompat_PopupWindow = 2131886262;
public static final int Base_Widget_AppCompat_ProgressBar = 2131886263;
public static final int Base_Widget_AppCompat_ProgressBar_Horizontal = 2131886264;
public static final int Base_Widget_AppCompat_RatingBar = 2131886265;
public static final int Base_Widget_AppCompat_RatingBar_Indicator = 2131886266;
public static final int Base_Widget_AppCompat_RatingBar_Small = 2131886267;
public static final int Base_Widget_AppCompat_SearchView = 2131886268;
public static final int Base_Widget_AppCompat_SearchView_ActionBar = 2131886269;
public static final int Base_Widget_AppCompat_SeekBar = 2131886270;
public static final int Base_Widget_AppCompat_SeekBar_Discrete = 2131886271;
public static final int Base_Widget_AppCompat_Spinner = 2131886272;
public static final int Base_Widget_AppCompat_Spinner_Underlined = 2131886273;
public static final int Base_Widget_AppCompat_TextView_SpinnerItem = 2131886274;
public static final int Base_Widget_AppCompat_Toolbar = 2131886275;
public static final int Base_Widget_AppCompat_Toolbar_Button_Navigation = 2131886276;
public static final int CardView = 2131886283;
public static final int CardView_Dark = 2131886284;
public static final int CardView_Light = 2131886285;
public static final int MessengerButton = 2131886294;
public static final int MessengerButtonText = 2131886301;
public static final int MessengerButtonText_Blue = 2131886302;
public static final int MessengerButtonText_Blue_Large = 2131886303;
public static final int MessengerButtonText_Blue_Small = 2131886304;
public static final int MessengerButtonText_White = 2131886305;
public static final int MessengerButtonText_White_Large = 2131886306;
public static final int MessengerButtonText_White_Small = 2131886307;
public static final int MessengerButton_Blue = 2131886295;
public static final int MessengerButton_Blue_Large = 2131886296;
public static final int MessengerButton_Blue_Small = 2131886297;
public static final int MessengerButton_White = 2131886298;
public static final int MessengerButton_White_Large = 2131886299;
public static final int MessengerButton_White_Small = 2131886300;
public static final int Platform_AppCompat = 2131886313;
public static final int Platform_AppCompat_Light = 2131886314;
public static final int Platform_ThemeOverlay_AppCompat = 2131886319;
public static final int Platform_ThemeOverlay_AppCompat_Dark = 2131886320;
public static final int Platform_ThemeOverlay_AppCompat_Light = 2131886321;
public static final int Platform_V21_AppCompat = 2131886322;
public static final int Platform_V21_AppCompat_Light = 2131886323;
public static final int Platform_V25_AppCompat = 2131886324;
public static final int Platform_V25_AppCompat_Light = 2131886325;
public static final int Platform_Widget_AppCompat_Spinner = 2131886326;
public static final int RtlOverlay_DialogWindowTitle_AppCompat = 2131886328;
public static final int RtlOverlay_Widget_AppCompat_ActionBar_TitleItem = 2131886329;
public static final int RtlOverlay_Widget_AppCompat_DialogTitle_Icon = 2131886330;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem = 2131886331;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_InternalGroup = 2131886332;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Text = 2131886335;
public static final int RtlOverlay_Widget_AppCompat_SearchView_MagIcon = 2131886342;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown = 2131886337;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon1 = 2131886338;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon2 = 2131886339;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Query = 2131886340;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Text = 2131886341;
public static final int RtlUnderlay_Widget_AppCompat_ActionButton = 2131886343;
public static final int RtlUnderlay_Widget_AppCompat_ActionButton_Overflow = 2131886344;
public static final int TextAppearance_AppCompat = 2131886347;
public static final int TextAppearance_AppCompat_Body1 = 2131886348;
public static final int TextAppearance_AppCompat_Body2 = 2131886349;
public static final int TextAppearance_AppCompat_Button = 2131886350;
public static final int TextAppearance_AppCompat_Caption = 2131886351;
public static final int TextAppearance_AppCompat_Display1 = 2131886352;
public static final int TextAppearance_AppCompat_Display2 = 2131886353;
public static final int TextAppearance_AppCompat_Display3 = 2131886354;
public static final int TextAppearance_AppCompat_Display4 = 2131886355;
public static final int TextAppearance_AppCompat_Headline = 2131886356;
public static final int TextAppearance_AppCompat_Inverse = 2131886357;
public static final int TextAppearance_AppCompat_Large = 2131886358;
public static final int TextAppearance_AppCompat_Large_Inverse = 2131886359;
public static final int TextAppearance_AppCompat_Light_SearchResult_Subtitle = 2131886360;
public static final int TextAppearance_AppCompat_Light_SearchResult_Title = 2131886361;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 2131886362;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 2131886363;
public static final int TextAppearance_AppCompat_Medium = 2131886364;
public static final int TextAppearance_AppCompat_Medium_Inverse = 2131886365;
public static final int TextAppearance_AppCompat_Menu = 2131886366;
public static final int TextAppearance_AppCompat_SearchResult_Subtitle = 2131886367;
public static final int TextAppearance_AppCompat_SearchResult_Title = 2131886368;
public static final int TextAppearance_AppCompat_Small = 2131886369;
public static final int TextAppearance_AppCompat_Small_Inverse = 2131886370;
public static final int TextAppearance_AppCompat_Subhead = 2131886371;
public static final int TextAppearance_AppCompat_Subhead_Inverse = 2131886372;
public static final int TextAppearance_AppCompat_Title = 2131886373;
public static final int TextAppearance_AppCompat_Title_Inverse = 2131886374;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Menu = 2131886376;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 2131886377;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 2131886378;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title = 2131886379;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 2131886380;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 2131886381;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse = 2131886382;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title = 2131886383;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse = 2131886384;
public static final int TextAppearance_AppCompat_Widget_Button = 2131886385;
public static final int TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 2131886386;
public static final int TextAppearance_AppCompat_Widget_Button_Colored = 2131886387;
public static final int TextAppearance_AppCompat_Widget_Button_Inverse = 2131886388;
public static final int TextAppearance_AppCompat_Widget_DropDownItem = 2131886389;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Header = 2131886390;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Large = 2131886391;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Small = 2131886392;
public static final int TextAppearance_AppCompat_Widget_Switch = 2131886393;
public static final int TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 2131886394;
public static final int TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 2131886428;
public static final int TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 2131886429;
public static final int TextAppearance_Widget_AppCompat_Toolbar_Title = 2131886430;
public static final int ThemeOverlay_AppCompat = 2131886482;
public static final int ThemeOverlay_AppCompat_ActionBar = 2131886483;
public static final int ThemeOverlay_AppCompat_Dark = 2131886484;
public static final int ThemeOverlay_AppCompat_Dark_ActionBar = 2131886485;
public static final int ThemeOverlay_AppCompat_Dialog = 2131886486;
public static final int ThemeOverlay_AppCompat_Dialog_Alert = 2131886487;
public static final int ThemeOverlay_AppCompat_Light = 2131886488;
public static final int Theme_AppCompat = 2131886433;
public static final int Theme_AppCompat_CompactMenu = 2131886434;
public static final int Theme_AppCompat_DayNight = 2131886435;
public static final int Theme_AppCompat_DayNight_DarkActionBar = 2131886436;
public static final int Theme_AppCompat_DayNight_Dialog = 2131886437;
public static final int Theme_AppCompat_DayNight_DialogWhenLarge = 2131886440;
public static final int Theme_AppCompat_DayNight_Dialog_Alert = 2131886438;
public static final int Theme_AppCompat_DayNight_Dialog_MinWidth = 2131886439;
public static final int Theme_AppCompat_DayNight_NoActionBar = 2131886441;
public static final int Theme_AppCompat_Dialog = 2131886442;
public static final int Theme_AppCompat_DialogWhenLarge = 2131886445;
public static final int Theme_AppCompat_Dialog_Alert = 2131886443;
public static final int Theme_AppCompat_Dialog_MinWidth = 2131886444;
public static final int Theme_AppCompat_Light = 2131886446;
public static final int Theme_AppCompat_Light_DarkActionBar = 2131886447;
public static final int Theme_AppCompat_Light_Dialog = 2131886448;
public static final int Theme_AppCompat_Light_DialogWhenLarge = 2131886451;
public static final int Theme_AppCompat_Light_Dialog_Alert = 2131886449;
public static final int Theme_AppCompat_Light_Dialog_MinWidth = 2131886450;
public static final int Theme_AppCompat_Light_NoActionBar = 2131886452;
public static final int Theme_AppCompat_NoActionBar = 2131886453;
public static final int Widget_AppCompat_ActionBar = 2131886502;
public static final int Widget_AppCompat_ActionBar_Solid = 2131886503;
public static final int Widget_AppCompat_ActionBar_TabBar = 2131886504;
public static final int Widget_AppCompat_ActionBar_TabText = 2131886505;
public static final int Widget_AppCompat_ActionBar_TabView = 2131886506;
public static final int Widget_AppCompat_ActionButton = 2131886507;
public static final int Widget_AppCompat_ActionButton_CloseMode = 2131886508;
public static final int Widget_AppCompat_ActionButton_Overflow = 2131886509;
public static final int Widget_AppCompat_ActionMode = 2131886510;
public static final int Widget_AppCompat_ActivityChooserView = 2131886511;
public static final int Widget_AppCompat_AutoCompleteTextView = 2131886512;
public static final int Widget_AppCompat_Button = 2131886513;
public static final int Widget_AppCompat_ButtonBar = 2131886519;
public static final int Widget_AppCompat_ButtonBar_AlertDialog = 2131886520;
public static final int Widget_AppCompat_Button_Borderless = 2131886514;
public static final int Widget_AppCompat_Button_Borderless_Colored = 2131886515;
public static final int Widget_AppCompat_Button_ButtonBar_AlertDialog = 2131886516;
public static final int Widget_AppCompat_Button_Colored = 2131886517;
public static final int Widget_AppCompat_Button_Small = 2131886518;
public static final int Widget_AppCompat_CompoundButton_CheckBox = 2131886521;
public static final int Widget_AppCompat_CompoundButton_RadioButton = 2131886522;
public static final int Widget_AppCompat_CompoundButton_Switch = 2131886523;
public static final int Widget_AppCompat_DrawerArrowToggle = 2131886524;
public static final int Widget_AppCompat_DropDownItem_Spinner = 2131886525;
public static final int Widget_AppCompat_EditText = 2131886526;
public static final int Widget_AppCompat_ImageButton = 2131886527;
public static final int Widget_AppCompat_Light_ActionBar = 2131886528;
public static final int Widget_AppCompat_Light_ActionBar_Solid = 2131886529;
public static final int Widget_AppCompat_Light_ActionBar_Solid_Inverse = 2131886530;
public static final int Widget_AppCompat_Light_ActionBar_TabBar = 2131886531;
public static final int Widget_AppCompat_Light_ActionBar_TabBar_Inverse = 2131886532;
public static final int Widget_AppCompat_Light_ActionBar_TabText = 2131886533;
public static final int Widget_AppCompat_Light_ActionBar_TabText_Inverse = 2131886534;
public static final int Widget_AppCompat_Light_ActionBar_TabView = 2131886535;
public static final int Widget_AppCompat_Light_ActionBar_TabView_Inverse = 2131886536;
public static final int Widget_AppCompat_Light_ActionButton = 2131886537;
public static final int Widget_AppCompat_Light_ActionButton_CloseMode = 2131886538;
public static final int Widget_AppCompat_Light_ActionButton_Overflow = 2131886539;
public static final int Widget_AppCompat_Light_ActionMode_Inverse = 2131886540;
public static final int Widget_AppCompat_Light_ActivityChooserView = 2131886541;
public static final int Widget_AppCompat_Light_AutoCompleteTextView = 2131886542;
public static final int Widget_AppCompat_Light_DropDownItem_Spinner = 2131886543;
public static final int Widget_AppCompat_Light_ListPopupWindow = 2131886544;
public static final int Widget_AppCompat_Light_ListView_DropDown = 2131886545;
public static final int Widget_AppCompat_Light_PopupMenu = 2131886546;
public static final int Widget_AppCompat_Light_PopupMenu_Overflow = 2131886547;
public static final int Widget_AppCompat_Light_SearchView = 2131886548;
public static final int Widget_AppCompat_Light_Spinner_DropDown_ActionBar = 2131886549;
public static final int Widget_AppCompat_ListMenuView = 2131886550;
public static final int Widget_AppCompat_ListPopupWindow = 2131886551;
public static final int Widget_AppCompat_ListView = 2131886552;
public static final int Widget_AppCompat_ListView_DropDown = 2131886553;
public static final int Widget_AppCompat_ListView_Menu = 2131886554;
public static final int Widget_AppCompat_PopupMenu = 2131886555;
public static final int Widget_AppCompat_PopupMenu_Overflow = 2131886556;
public static final int Widget_AppCompat_PopupWindow = 2131886557;
public static final int Widget_AppCompat_ProgressBar = 2131886558;
public static final int Widget_AppCompat_ProgressBar_Horizontal = 2131886559;
public static final int Widget_AppCompat_RatingBar = 2131886560;
public static final int Widget_AppCompat_RatingBar_Indicator = 2131886561;
public static final int Widget_AppCompat_RatingBar_Small = 2131886562;
public static final int Widget_AppCompat_SearchView = 2131886563;
public static final int Widget_AppCompat_SearchView_ActionBar = 2131886564;
public static final int Widget_AppCompat_SeekBar = 2131886565;
public static final int Widget_AppCompat_SeekBar_Discrete = 2131886566;
public static final int Widget_AppCompat_Spinner = 2131886567;
public static final int Widget_AppCompat_Spinner_DropDown = 2131886568;
public static final int Widget_AppCompat_Spinner_DropDown_ActionBar = 2131886569;
public static final int Widget_AppCompat_Spinner_Underlined = 2131886570;
public static final int Widget_AppCompat_TextView_SpinnerItem = 2131886571;
public static final int Widget_AppCompat_Toolbar = 2131886572;
public static final int Widget_AppCompat_Toolbar_Button_Navigation = 2131886573;
public static final int com_facebook_activity_theme = 2131886636;
public static final int com_facebook_auth_dialog = 2131886637;
public static final int com_facebook_auth_dialog_instructions_textview = 2131886638;
public static final int com_facebook_button = 2131886639;
public static final int com_facebook_button_like = 2131886640;
public static final int com_facebook_button_send = 2131886641;
public static final int com_facebook_button_share = 2131886642;
public static final int com_facebook_loginview_default_style = 2131886643;
public static final int com_facebook_loginview_silver_style = 2131886644;
public static final int tooltip_bubble_text = 2131886746;
}

View File

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

View File

@@ -0,0 +1,55 @@
package com.facebook;
import android.os.Handler;
import com.facebook.GraphRequest;
/* loaded from: classes.dex */
class RequestProgress {
private final GraphRequest a;
private final Handler b;
private final long c = FacebookSdk.k();
private long d;
private long e;
private long f;
RequestProgress(Handler handler, GraphRequest graphRequest) {
this.a = graphRequest;
this.b = handler;
}
void a(long j) {
this.d += j;
long j2 = this.d;
if (j2 >= this.e + this.c || j2 >= this.f) {
a();
}
}
void b(long j) {
this.f += j;
}
void a() {
if (this.d > this.e) {
GraphRequest.Callback d = this.a.d();
final long j = this.f;
if (j <= 0 || !(d instanceof GraphRequest.OnProgressCallback)) {
return;
}
final long j2 = this.d;
final GraphRequest.OnProgressCallback onProgressCallback = (GraphRequest.OnProgressCallback) d;
Handler handler = this.b;
if (handler == null) {
onProgressCallback.a(j2, j);
} else {
handler.post(new Runnable(this) { // from class: com.facebook.RequestProgress.1
@Override // java.lang.Runnable
public void run() {
onProgressCallback.a(j2, j);
}
});
}
this.e = this.d;
}
}
}

View File

@@ -0,0 +1,62 @@
package com.facebook.appevents;
import com.facebook.AccessToken;
import com.facebook.FacebookSdk;
import com.facebook.internal.Utility;
import java.io.Serializable;
/* loaded from: classes.dex */
class AccessTokenAppIdPair implements Serializable {
private final String a;
private final String b;
static class SerializationProxyV1 implements Serializable {
private final String a;
private final String b;
private Object readResolve() {
return new AccessTokenAppIdPair(this.a, this.b);
}
private SerializationProxyV1(String str, String str2) {
this.a = str;
this.b = str2;
}
}
public AccessTokenAppIdPair(AccessToken accessToken) {
this(accessToken.getToken(), FacebookSdk.c());
}
private Object writeReplace() {
return new SerializationProxyV1(this.a, this.b);
}
public String a() {
return this.a;
}
public String b() {
return this.b;
}
public boolean equals(Object obj) {
if (!(obj instanceof AccessTokenAppIdPair)) {
return false;
}
AccessTokenAppIdPair accessTokenAppIdPair = (AccessTokenAppIdPair) obj;
return Utility.a(accessTokenAppIdPair.a, this.a) && Utility.a(accessTokenAppIdPair.b, this.b);
}
public int hashCode() {
String str = this.a;
int hashCode = str == null ? 0 : str.hashCode();
String str2 = this.b;
return hashCode ^ (str2 != null ? str2.hashCode() : 0);
}
public AccessTokenAppIdPair(String str, String str2) {
this.a = Utility.c(str) ? null : str;
this.b = str2;
}
}

View File

@@ -0,0 +1,56 @@
package com.facebook.appevents;
import android.preference.PreferenceManager;
import android.util.Log;
import com.facebook.FacebookSdk;
import java.util.concurrent.locks.ReentrantReadWriteLock;
/* loaded from: classes.dex */
class AnalyticsUserIDStore {
private static final String a = "AnalyticsUserIDStore";
private static String c;
private static ReentrantReadWriteLock b = new ReentrantReadWriteLock();
private static volatile boolean d = false;
public static String b() {
if (!d) {
Log.w(a, "initStore should have been called before calling setUserID");
c();
}
b.readLock().lock();
try {
return c;
} finally {
b.readLock().unlock();
}
}
/* JADX INFO: Access modifiers changed from: private */
public static void c() {
if (d) {
return;
}
b.writeLock().lock();
try {
if (d) {
return;
}
c = PreferenceManager.getDefaultSharedPreferences(FacebookSdk.b()).getString("com.facebook.appevents.AnalyticsUserIDStore.userID", null);
d = true;
} finally {
b.writeLock().unlock();
}
}
public static void d() {
if (d) {
return;
}
AppEventsLogger.b().execute(new Runnable() { // from class: com.facebook.appevents.AnalyticsUserIDStore.1
@Override // java.lang.Runnable
public void run() {
AnalyticsUserIDStore.c();
}
});
}
}

View File

@@ -0,0 +1,176 @@
package com.facebook.appevents;
import android.os.Bundle;
import com.facebook.FacebookException;
import com.facebook.LoggingBehavior;
import com.facebook.internal.Logger;
import com.facebook.internal.Utility;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.HashSet;
import java.util.Locale;
import java.util.UUID;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
class AppEvent implements Serializable {
private static final HashSet<String> e = new HashSet<>();
private final JSONObject a;
private final boolean b;
private final String c;
private final String d;
static class SerializationProxyV1 implements Serializable {
private final String a;
private final boolean b;
private Object readResolve() throws JSONException {
return new AppEvent(this.a, this.b, null);
}
}
static class SerializationProxyV2 implements Serializable {
private final String a;
private final boolean b;
private final String c;
private Object readResolve() throws JSONException {
return new AppEvent(this.a, this.b, this.c);
}
private SerializationProxyV2(String str, boolean z, String str2) {
this.a = str;
this.b = z;
this.c = str2;
}
}
private String e() {
return a(this.a.toString());
}
private Object writeReplace() {
return new SerializationProxyV2(this.a.toString(), this.b, this.d);
}
public boolean a() {
return this.b;
}
public JSONObject b() {
return this.a;
}
public String c() {
return this.c;
}
public boolean d() {
if (this.d == null) {
return true;
}
return e().equals(this.d);
}
public String toString() {
return String.format("\"%s\", implicit: %b, json: %s", this.a.optString("_eventName"), Boolean.valueOf(this.b), this.a.toString());
}
public AppEvent(String str, String str2, Double d, Bundle bundle, boolean z, UUID uuid) throws JSONException, FacebookException {
this.a = a(str, str2, d, bundle, z, uuid);
this.b = z;
this.c = str2;
this.d = e();
}
private static JSONObject a(String str, String str2, Double d, Bundle bundle, boolean z, UUID uuid) throws FacebookException, JSONException {
b(str2);
JSONObject jSONObject = new JSONObject();
jSONObject.put("_eventName", str2);
jSONObject.put("_eventName_md5", a(str2));
jSONObject.put("_logTime", System.currentTimeMillis() / 1000);
jSONObject.put("_ui", str);
if (uuid != null) {
jSONObject.put("_session_id", uuid);
}
if (d != null) {
jSONObject.put("_valueToSum", d.doubleValue());
}
if (z) {
jSONObject.put("_implicitlyLogged", "1");
}
String e2 = AppEventsLogger.e();
if (e2 != null) {
jSONObject.put("_app_user_id", e2);
}
if (bundle != null) {
for (String str3 : bundle.keySet()) {
b(str3);
Object obj = bundle.get(str3);
if (!(obj instanceof String) && !(obj instanceof Number)) {
throw new FacebookException(String.format("Parameter value '%s' for key '%s' should be a string or a numeric type.", obj, str3));
}
jSONObject.put(str3, obj.toString());
}
}
if (!z) {
Logger.a(LoggingBehavior.APP_EVENTS, "AppEvents", "Created app event '%s'", jSONObject.toString());
}
return jSONObject;
}
private static void b(String str) throws FacebookException {
boolean contains;
if (str == null || str.length() == 0 || str.length() > 40) {
if (str == null) {
str = "<None Provided>";
}
throw new FacebookException(String.format(Locale.ROOT, "Identifier '%s' must be less than %d characters", str, 40));
}
synchronized (e) {
contains = e.contains(str);
}
if (contains) {
return;
}
if (!str.matches("^[0-9a-zA-Z_]+[0-9a-zA-Z _-]*$")) {
throw new FacebookException(String.format("Skipping event named '%s' due to illegal name - must be under 40 chars and alphanumeric, _, - or space, and not start with a space or hyphen.", str));
}
synchronized (e) {
e.add(str);
}
}
private AppEvent(String str, boolean z, String str2) throws JSONException {
this.a = new JSONObject(str);
this.b = z;
this.c = this.a.optString("_eventName");
this.d = str2;
}
private static String a(String str) {
try {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
byte[] bytes = str.getBytes("UTF-8");
messageDigest.update(bytes, 0, bytes.length);
return a(messageDigest.digest());
} catch (UnsupportedEncodingException e2) {
Utility.a("Failed to generate checksum: ", (Exception) e2);
return "1";
} catch (NoSuchAlgorithmException e3) {
Utility.a("Failed to generate checksum: ", (Exception) e3);
return "0";
}
}
private static String a(byte[] bArr) {
StringBuffer stringBuffer = new StringBuffer();
for (byte b : bArr) {
stringBuffer.append(String.format("%02x", Byte.valueOf(b)));
}
return stringBuffer.toString();
}
}

View File

@@ -0,0 +1,59 @@
package com.facebook.appevents;
import android.content.Context;
import com.facebook.FacebookSdk;
import com.facebook.internal.AttributionIdentifiers;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
/* loaded from: classes.dex */
class AppEventCollection {
private final HashMap<AccessTokenAppIdPair, SessionEventsState> a = new HashMap<>();
public synchronized void a(PersistedEvents persistedEvents) {
if (persistedEvents == null) {
return;
}
for (AccessTokenAppIdPair accessTokenAppIdPair : persistedEvents.a()) {
SessionEventsState b = b(accessTokenAppIdPair);
Iterator<AppEvent> it = persistedEvents.b(accessTokenAppIdPair).iterator();
while (it.hasNext()) {
b.a(it.next());
}
}
}
public synchronized Set<AccessTokenAppIdPair> b() {
return this.a.keySet();
}
private synchronized SessionEventsState b(AccessTokenAppIdPair accessTokenAppIdPair) {
SessionEventsState sessionEventsState;
sessionEventsState = this.a.get(accessTokenAppIdPair);
if (sessionEventsState == null) {
Context b = FacebookSdk.b();
sessionEventsState = new SessionEventsState(AttributionIdentifiers.d(b), AppEventsLogger.a(b));
}
this.a.put(accessTokenAppIdPair, sessionEventsState);
return sessionEventsState;
}
public synchronized void a(AccessTokenAppIdPair accessTokenAppIdPair, AppEvent appEvent) {
b(accessTokenAppIdPair).a(appEvent);
}
public synchronized SessionEventsState a(AccessTokenAppIdPair accessTokenAppIdPair) {
return this.a.get(accessTokenAppIdPair);
}
public synchronized int a() {
int i;
i = 0;
Iterator<SessionEventsState> it = this.a.values().iterator();
while (it.hasNext()) {
i += it.next().a();
}
return i;
}
}

View File

@@ -0,0 +1,182 @@
package com.facebook.appevents;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.facebook.AccessToken;
import com.facebook.FacebookRequestError;
import com.facebook.FacebookSdk;
import com.facebook.GraphRequest;
import com.facebook.GraphResponse;
import com.facebook.LoggingBehavior;
import com.facebook.appevents.AppEventsLogger;
import com.facebook.internal.FetchedAppSettings;
import com.facebook.internal.FetchedAppSettingsManager;
import com.facebook.internal.Logger;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
class AppEventQueue {
private static final String a = "com.facebook.appevents.AppEventQueue";
private static ScheduledFuture d;
private static volatile AppEventCollection b = new AppEventCollection();
private static final ScheduledExecutorService c = Executors.newSingleThreadScheduledExecutor();
private static final Runnable e = new Runnable() { // from class: com.facebook.appevents.AppEventQueue.1
@Override // java.lang.Runnable
public void run() {
ScheduledFuture unused = AppEventQueue.d = null;
if (AppEventsLogger.c() != AppEventsLogger.FlushBehavior.EXPLICIT_ONLY) {
AppEventQueue.b(FlushReason.TIMER);
}
}
};
public static Set<AccessTokenAppIdPair> e() {
return b.b();
}
public static void f() {
c.execute(new Runnable() { // from class: com.facebook.appevents.AppEventQueue.2
@Override // java.lang.Runnable
public void run() {
AppEventStore.a(AppEventQueue.b);
AppEventCollection unused = AppEventQueue.b = new AppEventCollection();
}
});
}
static void b(FlushReason flushReason) {
b.a(AppEventStore.a());
try {
FlushStatistics a2 = a(flushReason, b);
if (a2 != null) {
Intent intent = new Intent("com.facebook.sdk.APP_EVENTS_FLUSHED");
intent.putExtra("com.facebook.sdk.APP_EVENTS_NUM_EVENTS_FLUSHED", a2.a);
intent.putExtra("com.facebook.sdk.APP_EVENTS_FLUSH_RESULT", a2.b);
LocalBroadcastManager.a(FacebookSdk.b()).a(intent);
}
} catch (Exception e2) {
Log.w(a, "Caught unexpected exception while flushing app events: ", e2);
}
}
public static void a(final FlushReason flushReason) {
c.execute(new Runnable() { // from class: com.facebook.appevents.AppEventQueue.3
@Override // java.lang.Runnable
public void run() {
AppEventQueue.b(FlushReason.this);
}
});
}
public static void a(final AccessTokenAppIdPair accessTokenAppIdPair, final AppEvent appEvent) {
c.execute(new Runnable() { // from class: com.facebook.appevents.AppEventQueue.4
@Override // java.lang.Runnable
public void run() {
AppEventQueue.b.a(AccessTokenAppIdPair.this, appEvent);
if (AppEventsLogger.c() != AppEventsLogger.FlushBehavior.EXPLICIT_ONLY && AppEventQueue.b.a() > 100) {
AppEventQueue.b(FlushReason.EVENT_THRESHOLD);
} else if (AppEventQueue.d == null) {
ScheduledFuture unused = AppEventQueue.d = AppEventQueue.c.schedule(AppEventQueue.e, 15L, TimeUnit.SECONDS);
}
}
});
}
private static FlushStatistics a(FlushReason flushReason, AppEventCollection appEventCollection) {
FlushStatistics flushStatistics = new FlushStatistics();
boolean a2 = FacebookSdk.a(FacebookSdk.b());
ArrayList arrayList = new ArrayList();
for (AccessTokenAppIdPair accessTokenAppIdPair : appEventCollection.b()) {
GraphRequest a3 = a(accessTokenAppIdPair, appEventCollection.a(accessTokenAppIdPair), a2, flushStatistics);
if (a3 != null) {
arrayList.add(a3);
}
}
if (arrayList.size() <= 0) {
return null;
}
Logger.a(LoggingBehavior.APP_EVENTS, a, "Flushing %d events due to %s.", Integer.valueOf(flushStatistics.a), flushReason.toString());
Iterator it = arrayList.iterator();
while (it.hasNext()) {
((GraphRequest) it.next()).a();
}
return flushStatistics;
}
/* JADX INFO: Access modifiers changed from: private */
public static void b(final AccessTokenAppIdPair accessTokenAppIdPair, GraphRequest graphRequest, GraphResponse graphResponse, final SessionEventsState sessionEventsState, FlushStatistics flushStatistics) {
String str;
String str2;
FacebookRequestError a2 = graphResponse.a();
FlushResult flushResult = FlushResult.SUCCESS;
if (a2 == null) {
str = "Success";
} else if (a2.getErrorCode() == -1) {
flushResult = FlushResult.NO_CONNECTIVITY;
str = "Failed: No Connectivity";
} else {
str = String.format("Failed:\n Response: %s\n Error %s", graphResponse.toString(), a2.toString());
flushResult = FlushResult.SERVER_ERROR;
}
if (FacebookSdk.a(LoggingBehavior.APP_EVENTS)) {
try {
str2 = new JSONArray((String) graphRequest.j()).toString(2);
} catch (JSONException unused) {
str2 = "<Can't encode events for debug logging>";
}
Logger.a(LoggingBehavior.APP_EVENTS, a, "Flush completed\nParams: %s\n Result: %s\n Events JSON: %s", graphRequest.e().toString(), str, str2);
}
sessionEventsState.a(a2 != null);
if (flushResult == FlushResult.NO_CONNECTIVITY) {
FacebookSdk.h().execute(new Runnable() { // from class: com.facebook.appevents.AppEventQueue.6
@Override // java.lang.Runnable
public void run() {
AppEventStore.a(AccessTokenAppIdPair.this, sessionEventsState);
}
});
}
if (flushResult == FlushResult.SUCCESS || flushStatistics.b == FlushResult.NO_CONNECTIVITY) {
return;
}
flushStatistics.b = flushResult;
}
private static GraphRequest a(final AccessTokenAppIdPair accessTokenAppIdPair, final SessionEventsState sessionEventsState, boolean z, final FlushStatistics flushStatistics) {
String b2 = accessTokenAppIdPair.b();
FetchedAppSettings a2 = FetchedAppSettingsManager.a(b2, false);
final GraphRequest a3 = GraphRequest.a((AccessToken) null, String.format("%s/activities", b2), (JSONObject) null, (GraphRequest.Callback) null);
Bundle h = a3.h();
if (h == null) {
h = new Bundle();
}
h.putString(AccessToken.ACCESS_TOKEN_KEY, accessTokenAppIdPair.a());
String d2 = AppEventsLogger.d();
if (d2 != null) {
h.putString("device_token", d2);
}
a3.a(h);
int a4 = sessionEventsState.a(a3, FacebookSdk.b(), a2 != null ? a2.g() : false, z);
if (a4 == 0) {
return null;
}
flushStatistics.a += a4;
a3.a(new GraphRequest.Callback() { // from class: com.facebook.appevents.AppEventQueue.5
@Override // com.facebook.GraphRequest.Callback
public void a(GraphResponse graphResponse) {
AppEventQueue.b(AccessTokenAppIdPair.this, a3, graphResponse, sessionEventsState, flushStatistics);
}
});
return a3;
}
}

View File

@@ -0,0 +1,197 @@
package com.facebook.appevents;
import android.content.Context;
import android.util.Log;
import com.facebook.FacebookSdk;
import com.facebook.appevents.AccessTokenAppIdPair;
import com.facebook.appevents.AppEvent;
import com.facebook.appevents.internal.AppEventUtility;
import com.facebook.internal.Utility;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamClass;
/* loaded from: classes.dex */
class AppEventStore {
private static final String a = "com.facebook.appevents.AppEventStore";
private static class MovedClassObjectInputStream extends ObjectInputStream {
public MovedClassObjectInputStream(InputStream inputStream) throws IOException {
super(inputStream);
}
@Override // java.io.ObjectInputStream
protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException {
ObjectStreamClass readClassDescriptor = super.readClassDescriptor();
return readClassDescriptor.getName().equals("com.facebook.appevents.AppEventsLogger$AccessTokenAppIdPair$SerializationProxyV1") ? ObjectStreamClass.lookup(AccessTokenAppIdPair.SerializationProxyV1.class) : readClassDescriptor.getName().equals("com.facebook.appevents.AppEventsLogger$AppEvent$SerializationProxyV1") ? ObjectStreamClass.lookup(AppEvent.SerializationProxyV1.class) : readClassDescriptor;
}
}
AppEventStore() {
}
public static synchronized void a(AccessTokenAppIdPair accessTokenAppIdPair, SessionEventsState sessionEventsState) {
synchronized (AppEventStore.class) {
AppEventUtility.b();
PersistedEvents a2 = a();
if (a2.a(accessTokenAppIdPair)) {
a2.b(accessTokenAppIdPair).addAll(sessionEventsState.b());
} else {
a2.a(accessTokenAppIdPair, sessionEventsState.b());
}
a(a2);
}
}
public static synchronized void a(AppEventCollection appEventCollection) {
synchronized (AppEventStore.class) {
AppEventUtility.b();
PersistedEvents a2 = a();
for (AccessTokenAppIdPair accessTokenAppIdPair : appEventCollection.b()) {
a2.a(accessTokenAppIdPair, appEventCollection.a(accessTokenAppIdPair).b());
}
a(a2);
}
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Removed duplicated region for block: B:16:0x008a A[Catch: all -> 0x0091, TRY_LEAVE, TryCatch #0 {, blocks: (B:4:0x0003, B:10:0x0021, B:12:0x0024, B:16:0x008a, B:23:0x002f, B:35:0x0045, B:37:0x0048, B:40:0x0053, B:32:0x0057, B:44:0x005e, B:46:0x0061, B:47:0x0073, B:50:0x006c, B:26:0x0075, B:28:0x0078, B:31:0x0083), top: B:3:0x0003, inners: #1, #4, #9, #10 }] */
/* JADX WARN: Type inference failed for: r1v12, types: [java.lang.Exception, java.lang.Throwable] */
/* JADX WARN: Type inference failed for: r4v11, types: [java.lang.String] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public static synchronized com.facebook.appevents.PersistedEvents a() {
/*
java.lang.Class<com.facebook.appevents.AppEventStore> r0 = com.facebook.appevents.AppEventStore.class
monitor-enter(r0)
com.facebook.appevents.internal.AppEventUtility.b() // Catch: java.lang.Throwable -> L91
android.content.Context r1 = com.facebook.FacebookSdk.b() // Catch: java.lang.Throwable -> L91
r2 = 0
java.lang.String r3 = "AppEventsLogger.persistedevents"
java.io.FileInputStream r3 = r1.openFileInput(r3) // Catch: java.lang.Throwable -> L3a java.lang.Exception -> L3c java.io.FileNotFoundException -> L74
com.facebook.appevents.AppEventStore$MovedClassObjectInputStream r4 = new com.facebook.appevents.AppEventStore$MovedClassObjectInputStream // Catch: java.lang.Throwable -> L3a java.lang.Exception -> L3c java.io.FileNotFoundException -> L74
java.io.BufferedInputStream r5 = new java.io.BufferedInputStream // Catch: java.lang.Throwable -> L3a java.lang.Exception -> L3c java.io.FileNotFoundException -> L74
r5.<init>(r3) // Catch: java.lang.Throwable -> L3a java.lang.Exception -> L3c java.io.FileNotFoundException -> L74
r4.<init>(r5) // Catch: java.lang.Throwable -> L3a java.lang.Exception -> L3c java.io.FileNotFoundException -> L74
java.lang.Object r3 = r4.readObject() // Catch: java.lang.Exception -> L38 java.lang.Throwable -> L5b java.io.FileNotFoundException -> L75
com.facebook.appevents.PersistedEvents r3 = (com.facebook.appevents.PersistedEvents) r3 // Catch: java.lang.Exception -> L38 java.lang.Throwable -> L5b java.io.FileNotFoundException -> L75
com.facebook.internal.Utility.a(r4) // Catch: java.lang.Throwable -> L91
java.lang.String r2 = "AppEventsLogger.persistedevents"
java.io.File r1 = r1.getFileStreamPath(r2) // Catch: java.lang.Exception -> L2e java.lang.Throwable -> L91
r1.delete() // Catch: java.lang.Exception -> L2e java.lang.Throwable -> L91
goto L36
L2e:
r1 = move-exception
java.lang.String r2 = com.facebook.appevents.AppEventStore.a // Catch: java.lang.Throwable -> L91
java.lang.String r4 = "Got unexpected exception when removing events file: "
android.util.Log.w(r2, r4, r1) // Catch: java.lang.Throwable -> L91
L36:
r2 = r3
goto L88
L38:
r3 = move-exception
goto L3e
L3a:
r3 = move-exception
goto L5e
L3c:
r3 = move-exception
r4 = r2
L3e:
java.lang.String r5 = com.facebook.appevents.AppEventStore.a // Catch: java.lang.Throwable -> L5b
java.lang.String r6 = "Got unexpected exception while reading events: "
android.util.Log.w(r5, r6, r3) // Catch: java.lang.Throwable -> L5b
com.facebook.internal.Utility.a(r4) // Catch: java.lang.Throwable -> L91
java.lang.String r3 = "AppEventsLogger.persistedevents"
java.io.File r1 = r1.getFileStreamPath(r3) // Catch: java.lang.Exception -> L52 java.lang.Throwable -> L91
r1.delete() // Catch: java.lang.Exception -> L52 java.lang.Throwable -> L91
goto L88
L52:
r1 = move-exception
java.lang.String r3 = com.facebook.appevents.AppEventStore.a // Catch: java.lang.Throwable -> L91
java.lang.String r4 = "Got unexpected exception when removing events file: "
L57:
android.util.Log.w(r3, r4, r1) // Catch: java.lang.Throwable -> L91
goto L88
L5b:
r2 = move-exception
r3 = r2
r2 = r4
L5e:
com.facebook.internal.Utility.a(r2) // Catch: java.lang.Throwable -> L91
java.lang.String r2 = "AppEventsLogger.persistedevents"
java.io.File r1 = r1.getFileStreamPath(r2) // Catch: java.lang.Exception -> L6b java.lang.Throwable -> L91
r1.delete() // Catch: java.lang.Exception -> L6b java.lang.Throwable -> L91
goto L73
L6b:
r1 = move-exception
java.lang.String r2 = com.facebook.appevents.AppEventStore.a // Catch: java.lang.Throwable -> L91
java.lang.String r4 = "Got unexpected exception when removing events file: "
android.util.Log.w(r2, r4, r1) // Catch: java.lang.Throwable -> L91
L73:
throw r3 // Catch: java.lang.Throwable -> L91
L74:
r4 = r2
L75:
com.facebook.internal.Utility.a(r4) // Catch: java.lang.Throwable -> L91
java.lang.String r3 = "AppEventsLogger.persistedevents"
java.io.File r1 = r1.getFileStreamPath(r3) // Catch: java.lang.Exception -> L82 java.lang.Throwable -> L91
r1.delete() // Catch: java.lang.Exception -> L82 java.lang.Throwable -> L91
goto L88
L82:
r1 = move-exception
java.lang.String r3 = com.facebook.appevents.AppEventStore.a // Catch: java.lang.Throwable -> L91
java.lang.String r4 = "Got unexpected exception when removing events file: "
goto L57
L88:
if (r2 != 0) goto L8f
com.facebook.appevents.PersistedEvents r2 = new com.facebook.appevents.PersistedEvents // Catch: java.lang.Throwable -> L91
r2.<init>() // Catch: java.lang.Throwable -> L91
L8f:
monitor-exit(r0)
return r2
L91:
r1 = move-exception
monitor-exit(r0)
throw r1
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.appevents.AppEventStore.a():com.facebook.appevents.PersistedEvents");
}
private static void a(PersistedEvents persistedEvents) {
Context b = FacebookSdk.b();
ObjectOutputStream objectOutputStream = null;
try {
try {
ObjectOutputStream objectOutputStream2 = new ObjectOutputStream(new BufferedOutputStream(b.openFileOutput("AppEventsLogger.persistedevents", 0)));
try {
objectOutputStream2.writeObject(persistedEvents);
Utility.a(objectOutputStream2);
} catch (Exception e) {
e = e;
objectOutputStream = objectOutputStream2;
Log.w(a, "Got unexpected exception while persisting events: ", e);
try {
b.getFileStreamPath("AppEventsLogger.persistedevents").delete();
} catch (Exception unused) {
}
Utility.a(objectOutputStream);
} catch (Throwable th) {
th = th;
objectOutputStream = objectOutputStream2;
Utility.a(objectOutputStream);
throw th;
}
} catch (Exception e2) {
e = e2;
}
} catch (Throwable th2) {
th = th2;
}
}
}

View File

@@ -0,0 +1,181 @@
package com.facebook.appevents;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import com.facebook.AccessToken;
import com.facebook.FacebookException;
import com.facebook.FacebookSdk;
import com.facebook.LoggingBehavior;
import com.facebook.appevents.internal.ActivityLifecycleTracker;
import com.facebook.internal.FetchedAppSettingsManager;
import com.facebook.internal.Logger;
import com.facebook.internal.Utility;
import com.facebook.internal.Validate;
import java.util.HashSet;
import java.util.Iterator;
import java.util.UUID;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import org.json.JSONException;
/* loaded from: classes.dex */
public class AppEventsLogger {
private static ScheduledThreadPoolExecutor c;
private static FlushBehavior d = FlushBehavior.AUTO;
private static Object e = new Object();
private static String f;
private static boolean g;
private static String h;
private final String a;
private final AccessTokenAppIdPair b;
public enum FlushBehavior {
AUTO,
EXPLICIT_ONLY
}
private AppEventsLogger(Context context, String str, AccessToken accessToken) {
this(Utility.b(context), str, accessToken);
}
public static void a(Application application, String str) {
if (!FacebookSdk.o()) {
throw new FacebookException("The Facebook sdk must be initialized before calling activateApp");
}
AnalyticsUserIDStore.d();
if (str == null) {
str = FacebookSdk.c();
}
FacebookSdk.b(application, str);
ActivityLifecycleTracker.a(application, str);
}
public static AppEventsLogger b(Context context) {
return new AppEventsLogger(context, (String) null, (AccessToken) null);
}
public static FlushBehavior c() {
FlushBehavior flushBehavior;
synchronized (e) {
flushBehavior = d;
}
return flushBehavior;
}
static String d() {
String str;
synchronized (e) {
str = h;
}
return str;
}
public static String e() {
return AnalyticsUserIDStore.b();
}
private static void f() {
synchronized (e) {
if (c != null) {
return;
}
c = new ScheduledThreadPoolExecutor(1);
c.scheduleAtFixedRate(new Runnable() { // from class: com.facebook.appevents.AppEventsLogger.4
@Override // java.lang.Runnable
public void run() {
HashSet hashSet = new HashSet();
Iterator<AccessTokenAppIdPair> it = AppEventQueue.e().iterator();
while (it.hasNext()) {
hashSet.add(it.next().b());
}
Iterator it2 = hashSet.iterator();
while (it2.hasNext()) {
FetchedAppSettingsManager.a((String) it2.next(), true);
}
}
}, 0L, 86400L, TimeUnit.SECONDS);
}
}
public static void g() {
AppEventQueue.f();
}
static Executor b() {
if (c == null) {
f();
}
return c;
}
protected AppEventsLogger(String str, String str2, AccessToken accessToken) {
Validate.c();
this.a = str;
accessToken = accessToken == null ? AccessToken.getCurrentAccessToken() : accessToken;
if (accessToken != null && (str2 == null || str2.equals(accessToken.getApplicationId()))) {
this.b = new AccessTokenAppIdPair(accessToken);
} else {
this.b = new AccessTokenAppIdPair(null, str2 == null ? Utility.c(FacebookSdk.b()) : str2);
}
f();
}
public static AppEventsLogger a(Context context, String str) {
return new AppEventsLogger(context, str, (AccessToken) null);
}
public void a(String str, Bundle bundle) {
a(str, null, bundle, false, ActivityLifecycleTracker.h());
}
public void a(String str, double d2, Bundle bundle) {
a(str, Double.valueOf(d2), bundle, false, ActivityLifecycleTracker.h());
}
public void a() {
AppEventQueue.a(FlushReason.EXPLICIT);
}
public void a(String str, Double d2, Bundle bundle) {
a(str, d2, bundle, true, ActivityLifecycleTracker.h());
}
private void a(String str, Double d2, Bundle bundle, boolean z, UUID uuid) {
try {
a(FacebookSdk.b(), new AppEvent(this.a, str, d2, bundle, z, uuid), this.b);
} catch (FacebookException e2) {
Logger.a(LoggingBehavior.APP_EVENTS, "AppEvents", "Invalid app event: %s", e2.toString());
} catch (JSONException e3) {
Logger.a(LoggingBehavior.APP_EVENTS, "AppEvents", "JSON encoding for app event failed: '%s'", e3.toString());
}
}
private static void a(Context context, AppEvent appEvent, AccessTokenAppIdPair accessTokenAppIdPair) {
AppEventQueue.a(accessTokenAppIdPair, appEvent);
if (appEvent.a() || g) {
return;
}
if (appEvent.c() == "fb_mobile_activate_app") {
g = true;
} else {
Logger.a(LoggingBehavior.APP_EVENTS, "AppEvents", "Warning: Please call AppEventsLogger.activateApp(...)from the long-lived activity's onResume() methodbefore logging other app events.");
}
}
public static String a(Context context) {
if (f == null) {
synchronized (e) {
if (f == null) {
f = context.getSharedPreferences("com.facebook.sdk.appEventPreferences", 0).getString("anonymousAppDeviceGUID", null);
if (f == null) {
f = "XZ" + UUID.randomUUID().toString();
context.getSharedPreferences("com.facebook.sdk.appEventPreferences", 0).edit().putString("anonymousAppDeviceGUID", f).apply();
}
}
}
}
return f;
}
}

View File

@@ -0,0 +1,11 @@
package com.facebook.appevents;
/* loaded from: classes.dex */
enum FlushReason {
EXPLICIT,
TIMER,
SESSION_CHANGE,
PERSISTED_EVENTS,
EVENT_THRESHOLD,
EAGER_FLUSHING_EVENT
}

View File

@@ -0,0 +1,9 @@
package com.facebook.appevents;
/* loaded from: classes.dex */
public enum FlushResult {
SUCCESS,
SERVER_ERROR,
NO_CONNECTIVITY,
UNKNOWN_ERROR
}

View File

@@ -0,0 +1,10 @@
package com.facebook.appevents;
/* loaded from: classes.dex */
class FlushStatistics {
public int a = 0;
public FlushResult b = FlushResult.SUCCESS;
FlushStatistics() {
}
}

View File

@@ -0,0 +1,54 @@
package com.facebook.appevents;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
/* loaded from: classes.dex */
class PersistedEvents implements Serializable {
private HashMap<AccessTokenAppIdPair, List<AppEvent>> a = new HashMap<>();
static class SerializationProxyV1 implements Serializable {
private final HashMap<AccessTokenAppIdPair, List<AppEvent>> a;
private Object readResolve() {
return new PersistedEvents(this.a);
}
private SerializationProxyV1(HashMap<AccessTokenAppIdPair, List<AppEvent>> hashMap) {
this.a = hashMap;
}
}
public PersistedEvents() {
}
private Object writeReplace() {
return new SerializationProxyV1(this.a);
}
public Set<AccessTokenAppIdPair> a() {
return this.a.keySet();
}
public List<AppEvent> b(AccessTokenAppIdPair accessTokenAppIdPair) {
return this.a.get(accessTokenAppIdPair);
}
public boolean a(AccessTokenAppIdPair accessTokenAppIdPair) {
return this.a.containsKey(accessTokenAppIdPair);
}
public PersistedEvents(HashMap<AccessTokenAppIdPair, List<AppEvent>> hashMap) {
this.a.putAll(hashMap);
}
public void a(AccessTokenAppIdPair accessTokenAppIdPair, List<AppEvent> list) {
if (!this.a.containsKey(accessTokenAppIdPair)) {
this.a.put(accessTokenAppIdPair, list);
} else {
this.a.get(accessTokenAppIdPair).addAll(list);
}
}
}

View File

@@ -0,0 +1,110 @@
package com.facebook.appevents;
import android.content.Context;
import android.os.Bundle;
import com.facebook.GraphRequest;
import com.facebook.internal.AppEventsLoggerUtility;
import com.facebook.internal.AttributionIdentifiers;
import com.facebook.internal.Utility;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
class SessionEventsState {
private List<AppEvent> a = new ArrayList();
private List<AppEvent> b = new ArrayList();
private int c;
private AttributionIdentifiers d;
private String e;
public SessionEventsState(AttributionIdentifiers attributionIdentifiers, String str) {
this.d = attributionIdentifiers;
this.e = str;
}
public synchronized void a(AppEvent appEvent) {
if (this.a.size() + this.b.size() >= 1000) {
this.c++;
} else {
this.a.add(appEvent);
}
}
public synchronized List<AppEvent> b() {
List<AppEvent> list;
list = this.a;
this.a = new ArrayList();
return list;
}
public synchronized int a() {
return this.a.size();
}
public synchronized void a(boolean z) {
if (z) {
this.a.addAll(this.b);
}
this.b.clear();
this.c = 0;
}
public int a(GraphRequest graphRequest, Context context, boolean z, boolean z2) {
synchronized (this) {
int i = this.c;
this.b.addAll(this.a);
this.a.clear();
JSONArray jSONArray = new JSONArray();
for (AppEvent appEvent : this.b) {
if (appEvent.d()) {
if (z || !appEvent.a()) {
jSONArray.put(appEvent.b());
}
} else {
Utility.a("Event with invalid checksum: %s", appEvent.toString());
}
}
if (jSONArray.length() == 0) {
return 0;
}
a(graphRequest, context, i, jSONArray, z2);
return jSONArray.length();
}
}
private void a(GraphRequest graphRequest, Context context, int i, JSONArray jSONArray, boolean z) {
JSONObject jSONObject;
try {
jSONObject = AppEventsLoggerUtility.a(AppEventsLoggerUtility.GraphAPIActivityType.CUSTOM_APP_EVENTS, this.d, this.e, z, context);
if (this.c > 0) {
jSONObject.put("num_skipped_events", i);
}
} catch (JSONException unused) {
jSONObject = new JSONObject();
}
graphRequest.a(jSONObject);
Bundle h = graphRequest.h();
if (h == null) {
h = new Bundle();
}
String jSONArray2 = jSONArray.toString();
if (jSONArray2 != null) {
h.putByteArray("custom_events_file", a(jSONArray2));
graphRequest.a((Object) jSONArray2);
}
graphRequest.a(h);
}
private byte[] a(String str) {
try {
return str.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
Utility.a("Encoding exception: ", (Exception) e);
return null;
}
}
}

View File

@@ -0,0 +1,182 @@
package com.facebook.appevents.internal;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import com.facebook.FacebookSdk;
import com.facebook.appevents.AppEventsLogger;
import com.facebook.appevents.internal.SourceApplicationInfo;
import com.facebook.internal.FetchedAppSettings;
import com.facebook.internal.FetchedAppSettingsManager;
import com.facebook.internal.Utility;
import java.util.UUID;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
/* loaded from: classes.dex */
public class ActivityLifecycleTracker {
private static final String a = "com.facebook.appevents.internal.ActivityLifecycleTracker";
private static volatile ScheduledFuture c;
private static volatile SessionInfo e;
private static String g;
private static long h;
private static final ScheduledExecutorService b = Executors.newSingleThreadScheduledExecutor();
private static AtomicInteger d = new AtomicInteger(0);
private static AtomicBoolean f = new AtomicBoolean(false);
private static void g() {
if (c != null) {
c.cancel(false);
}
c = null;
}
public static UUID h() {
if (e != null) {
return e.c();
}
return null;
}
/* JADX INFO: Access modifiers changed from: private */
public static int i() {
FetchedAppSettings c2 = FetchedAppSettingsManager.c(FacebookSdk.c());
return c2 == null ? Constants.a() : c2.e();
}
public static void b(Activity activity) {
final long currentTimeMillis = System.currentTimeMillis();
final Context applicationContext = activity.getApplicationContext();
final String b2 = Utility.b(activity);
final SourceApplicationInfo a2 = SourceApplicationInfo.Factory.a(activity);
b.execute(new Runnable() { // from class: com.facebook.appevents.internal.ActivityLifecycleTracker.2
@Override // java.lang.Runnable
public void run() {
if (ActivityLifecycleTracker.e == null) {
SessionInfo j = SessionInfo.j();
if (j != null) {
SessionLogger.a(applicationContext, b2, j, ActivityLifecycleTracker.g);
}
SessionInfo unused = ActivityLifecycleTracker.e = new SessionInfo(Long.valueOf(currentTimeMillis), null);
ActivityLifecycleTracker.e.a(a2);
SessionLogger.a(applicationContext, b2, a2, ActivityLifecycleTracker.g);
}
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public static void c(Activity activity) {
if (d.decrementAndGet() < 0) {
d.set(0);
Log.w(a, "Unexpected activity pause without a matching activity resume. Logging data may be incorrect. Make sure you call activateApp from your Application's onCreate method");
}
g();
final long currentTimeMillis = System.currentTimeMillis();
final Context applicationContext = activity.getApplicationContext();
final String b2 = Utility.b(activity);
b.execute(new Runnable() { // from class: com.facebook.appevents.internal.ActivityLifecycleTracker.4
@Override // java.lang.Runnable
public void run() {
if (ActivityLifecycleTracker.e == null) {
SessionInfo unused = ActivityLifecycleTracker.e = new SessionInfo(Long.valueOf(currentTimeMillis), null);
}
ActivityLifecycleTracker.e.a(Long.valueOf(currentTimeMillis));
if (ActivityLifecycleTracker.d.get() <= 0) {
ScheduledFuture unused2 = ActivityLifecycleTracker.c = ActivityLifecycleTracker.b.schedule(new Runnable() { // from class: com.facebook.appevents.internal.ActivityLifecycleTracker.4.1
@Override // java.lang.Runnable
public void run() {
if (ActivityLifecycleTracker.d.get() <= 0) {
AnonymousClass4 anonymousClass4 = AnonymousClass4.this;
SessionLogger.a(applicationContext, b2, ActivityLifecycleTracker.e, ActivityLifecycleTracker.g);
SessionInfo.i();
SessionInfo unused3 = ActivityLifecycleTracker.e = null;
}
ScheduledFuture unused4 = ActivityLifecycleTracker.c = null;
}
}, ActivityLifecycleTracker.i(), TimeUnit.SECONDS);
}
long j = ActivityLifecycleTracker.h;
AutomaticAnalyticsLogger.a(b2, j > 0 ? (currentTimeMillis - j) / 1000 : 0L);
ActivityLifecycleTracker.e.h();
}
});
}
public static void d(Activity activity) {
d.incrementAndGet();
g();
final long currentTimeMillis = System.currentTimeMillis();
h = currentTimeMillis;
final Context applicationContext = activity.getApplicationContext();
final String b2 = Utility.b(activity);
b.execute(new Runnable() { // from class: com.facebook.appevents.internal.ActivityLifecycleTracker.3
@Override // java.lang.Runnable
public void run() {
if (ActivityLifecycleTracker.e == null) {
SessionInfo unused = ActivityLifecycleTracker.e = new SessionInfo(Long.valueOf(currentTimeMillis), null);
SessionLogger.a(applicationContext, b2, (SourceApplicationInfo) null, ActivityLifecycleTracker.g);
} else if (ActivityLifecycleTracker.e.d() != null) {
long longValue = currentTimeMillis - ActivityLifecycleTracker.e.d().longValue();
if (longValue > ActivityLifecycleTracker.i() * 1000) {
SessionLogger.a(applicationContext, b2, ActivityLifecycleTracker.e, ActivityLifecycleTracker.g);
SessionLogger.a(applicationContext, b2, (SourceApplicationInfo) null, ActivityLifecycleTracker.g);
SessionInfo unused2 = ActivityLifecycleTracker.e = new SessionInfo(Long.valueOf(currentTimeMillis), null);
} else if (longValue > 1000) {
ActivityLifecycleTracker.e.g();
}
}
ActivityLifecycleTracker.e.a(Long.valueOf(currentTimeMillis));
ActivityLifecycleTracker.e.h();
}
});
}
public static void a(Application application, String str) {
if (f.compareAndSet(false, true)) {
g = str;
application.registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() { // from class: com.facebook.appevents.internal.ActivityLifecycleTracker.1
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityCreated(Activity activity, Bundle bundle) {
AppEventUtility.a();
ActivityLifecycleTracker.b(activity);
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityDestroyed(Activity activity) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityPaused(Activity activity) {
AppEventUtility.a();
ActivityLifecycleTracker.c(activity);
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityResumed(Activity activity) {
AppEventUtility.a();
ActivityLifecycleTracker.d(activity);
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityStarted(Activity activity) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityStopped(Activity activity) {
AppEventsLogger.g();
}
});
}
}
}

View File

@@ -0,0 +1,10 @@
package com.facebook.appevents.internal;
/* loaded from: classes.dex */
public class AppEventUtility {
public static void a() {
}
public static void b() {
}
}

View File

@@ -0,0 +1,44 @@
package com.facebook.appevents.internal;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import com.facebook.FacebookSdk;
import com.facebook.appevents.AppEventsLogger;
import com.facebook.internal.FetchedAppSettings;
import com.facebook.internal.FetchedAppSettingsManager;
import com.facebook.internal.Validate;
/* loaded from: classes.dex */
public class AutomaticAnalyticsLogger {
private static final String a = "com.facebook.appevents.internal.AutomaticAnalyticsLogger";
public static void a() {
Context b = FacebookSdk.b();
String c = FacebookSdk.c();
boolean e = FacebookSdk.e();
Validate.a(b, "context");
if (e) {
if (b instanceof Application) {
AppEventsLogger.a((Application) b, c);
} else {
Log.w(a, "Automatic logging of basic events will not happen, because FacebookSdk.getApplicationContext() returns object that is not instance of android.app.Application. Make sure you call FacebookSdk.sdkInitialize() from Application class and pass application context.");
}
}
}
public static void a(String str, long j) {
Context b = FacebookSdk.b();
String c = FacebookSdk.c();
Validate.a(b, "context");
FetchedAppSettings a2 = FetchedAppSettingsManager.a(c, false);
if (a2 == null || !a2.a() || j <= 0) {
return;
}
AppEventsLogger b2 = AppEventsLogger.b(b);
Bundle bundle = new Bundle(1);
bundle.putCharSequence("fb_aa_time_spent_view_name", str);
b2.a("fb_aa_time_spent_on_view", j, bundle);
}
}

View File

@@ -0,0 +1,8 @@
package com.facebook.appevents.internal;
/* loaded from: classes.dex */
public class Constants {
public static int a() {
return 60;
}
}

View File

@@ -0,0 +1,11 @@
package com.facebook.appevents.internal;
import com.facebook.AccessToken;
import com.facebook.appevents.AppEventsLogger;
/* loaded from: classes.dex */
class InternalAppEventsLogger extends AppEventsLogger {
InternalAppEventsLogger(String str, String str2, AccessToken accessToken) {
super(str, str2, accessToken);
}
}

View File

@@ -0,0 +1,109 @@
package com.facebook.appevents.internal;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import com.facebook.FacebookSdk;
import java.util.UUID;
/* loaded from: classes.dex */
class SessionInfo {
private Long a;
private Long b;
private int c;
private Long d;
private SourceApplicationInfo e;
private UUID f;
public SessionInfo(Long l, Long l2) {
this(l, l2, UUID.randomUUID());
}
public static void i() {
SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(FacebookSdk.b()).edit();
edit.remove("com.facebook.appevents.SessionInfo.sessionStartTime");
edit.remove("com.facebook.appevents.SessionInfo.sessionEndTime");
edit.remove("com.facebook.appevents.SessionInfo.interruptionCount");
edit.remove("com.facebook.appevents.SessionInfo.sessionId");
edit.apply();
SourceApplicationInfo.b();
}
public static SessionInfo j() {
SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(FacebookSdk.b());
long j = defaultSharedPreferences.getLong("com.facebook.appevents.SessionInfo.sessionStartTime", 0L);
long j2 = defaultSharedPreferences.getLong("com.facebook.appevents.SessionInfo.sessionEndTime", 0L);
String string = defaultSharedPreferences.getString("com.facebook.appevents.SessionInfo.sessionId", null);
if (j == 0 || j2 == 0 || string == null) {
return null;
}
SessionInfo sessionInfo = new SessionInfo(Long.valueOf(j), Long.valueOf(j2));
sessionInfo.c = defaultSharedPreferences.getInt("com.facebook.appevents.SessionInfo.interruptionCount", 0);
sessionInfo.e = SourceApplicationInfo.c();
sessionInfo.d = Long.valueOf(System.currentTimeMillis());
sessionInfo.f = UUID.fromString(string);
return sessionInfo;
}
public void a(Long l) {
this.b = l;
}
public int b() {
return this.c;
}
public UUID c() {
return this.f;
}
public Long d() {
return this.b;
}
public long e() {
Long l;
if (this.a == null || (l = this.b) == null) {
return 0L;
}
return l.longValue() - this.a.longValue();
}
public SourceApplicationInfo f() {
return this.e;
}
public void g() {
this.c++;
}
public void h() {
SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(FacebookSdk.b()).edit();
edit.putLong("com.facebook.appevents.SessionInfo.sessionStartTime", this.a.longValue());
edit.putLong("com.facebook.appevents.SessionInfo.sessionEndTime", this.b.longValue());
edit.putInt("com.facebook.appevents.SessionInfo.interruptionCount", this.c);
edit.putString("com.facebook.appevents.SessionInfo.sessionId", this.f.toString());
edit.apply();
SourceApplicationInfo sourceApplicationInfo = this.e;
if (sourceApplicationInfo != null) {
sourceApplicationInfo.a();
}
}
public SessionInfo(Long l, Long l2, UUID uuid) {
this.a = l;
this.b = l2;
this.f = uuid;
}
public long a() {
Long l = this.d;
if (l == null) {
return 0L;
}
return l.longValue();
}
public void a(SourceApplicationInfo sourceApplicationInfo) {
this.e = sourceApplicationInfo;
}
}

View File

@@ -0,0 +1,61 @@
package com.facebook.appevents.internal;
import android.content.Context;
import android.os.Bundle;
import com.facebook.LoggingBehavior;
import com.facebook.appevents.AppEventsLogger;
import com.facebook.internal.Logger;
import java.util.Locale;
/* loaded from: classes.dex */
class SessionLogger {
private static final String a = "com.facebook.appevents.internal.SessionLogger";
private static final long[] b = {300000, 900000, 1800000, 3600000, 21600000, 43200000, 86400000, 172800000, 259200000, 604800000, 1209600000, 1814400000, 2419200000L, 5184000000L, 7776000000L, 10368000000L, 12960000000L, 15552000000L, 31536000000L};
public static void a(Context context, String str, SourceApplicationInfo sourceApplicationInfo, String str2) {
String sourceApplicationInfo2 = sourceApplicationInfo != null ? sourceApplicationInfo.toString() : "Unclassified";
Bundle bundle = new Bundle();
bundle.putString("fb_mobile_launch_source", sourceApplicationInfo2);
InternalAppEventsLogger internalAppEventsLogger = new InternalAppEventsLogger(str, str2, null);
internalAppEventsLogger.a("fb_mobile_activate_app", bundle);
if (AppEventsLogger.c() != AppEventsLogger.FlushBehavior.EXPLICIT_ONLY) {
internalAppEventsLogger.a();
}
}
public static void a(Context context, String str, SessionInfo sessionInfo, String str2) {
Long valueOf = Long.valueOf(sessionInfo.a() - sessionInfo.d().longValue());
if (valueOf.longValue() < 0) {
a();
valueOf = 0L;
}
Long valueOf2 = Long.valueOf(sessionInfo.e());
if (valueOf2.longValue() < 0) {
a();
valueOf2 = 0L;
}
Bundle bundle = new Bundle();
bundle.putInt("fb_mobile_app_interruptions", sessionInfo.b());
bundle.putString("fb_mobile_time_between_sessions", String.format(Locale.ROOT, "session_quanta_%d", Integer.valueOf(a(valueOf.longValue()))));
SourceApplicationInfo f = sessionInfo.f();
bundle.putString("fb_mobile_launch_source", f != null ? f.toString() : "Unclassified");
bundle.putLong("_logTime", sessionInfo.d().longValue() / 1000);
new InternalAppEventsLogger(str, str2, null).a("fb_mobile_deactivate_app", valueOf2.longValue() / 1000, bundle);
}
private static void a() {
Logger.a(LoggingBehavior.APP_EVENTS, a, "Clock skew detected");
}
private static int a(long j) {
int i = 0;
while (true) {
long[] jArr = b;
if (i >= jArr.length || jArr[i] >= j) {
break;
}
i++;
}
return i;
}
}

View File

@@ -0,0 +1,79 @@
package com.facebook.appevents.internal;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import bolts.AppLinks;
import com.facebook.FacebookSdk;
/* loaded from: classes.dex */
class SourceApplicationInfo {
private String a;
private boolean b;
public static class Factory {
public static SourceApplicationInfo a(Activity activity) {
ComponentName callingActivity = activity.getCallingActivity();
if (callingActivity == null) {
return null;
}
String packageName = callingActivity.getPackageName();
if (packageName.equals(activity.getPackageName())) {
return null;
}
Intent intent = activity.getIntent();
boolean z = false;
if (intent != null && !intent.getBooleanExtra("_fbSourceApplicationHasBeenSet", false)) {
intent.putExtra("_fbSourceApplicationHasBeenSet", true);
Bundle a = AppLinks.a(intent);
if (a != null) {
Bundle bundle = a.getBundle("referer_app_link");
if (bundle != null) {
packageName = bundle.getString("package");
}
z = true;
}
}
intent.putExtra("_fbSourceApplicationHasBeenSet", true);
return new SourceApplicationInfo(packageName, z);
}
}
public static void b() {
SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(FacebookSdk.b()).edit();
edit.remove("com.facebook.appevents.SourceApplicationInfo.callingApplicationPackage");
edit.remove("com.facebook.appevents.SourceApplicationInfo.openedByApplink");
edit.apply();
}
public static SourceApplicationInfo c() {
SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(FacebookSdk.b());
if (defaultSharedPreferences.contains("com.facebook.appevents.SourceApplicationInfo.callingApplicationPackage")) {
return new SourceApplicationInfo(defaultSharedPreferences.getString("com.facebook.appevents.SourceApplicationInfo.callingApplicationPackage", null), defaultSharedPreferences.getBoolean("com.facebook.appevents.SourceApplicationInfo.openedByApplink", false));
}
return null;
}
public void a() {
SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(FacebookSdk.b()).edit();
edit.putString("com.facebook.appevents.SourceApplicationInfo.callingApplicationPackage", this.a);
edit.putBoolean("com.facebook.appevents.SourceApplicationInfo.openedByApplink", this.b);
edit.apply();
}
public String toString() {
String str = this.b ? "Applink" : "Unclassified";
if (this.a == null) {
return str;
}
return str + "(" + this.a + ")";
}
private SourceApplicationInfo(String str, boolean z) {
this.a = str;
this.b = z;
}
}

View File

@@ -0,0 +1,89 @@
package com.facebook.devicerequests.internal;
import android.annotation.TargetApi;
import android.net.nsd.NsdManager;
import android.net.nsd.NsdServiceInfo;
import android.os.Build;
import com.facebook.FacebookSdk;
import com.facebook.internal.FetchedAppSettingsManager;
import com.facebook.internal.SmartLoginOption;
import java.util.HashMap;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
public class DeviceRequestsHelper {
private static HashMap<String, NsdManager.RegistrationListener> a = new HashMap<>();
public static String a() {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("device", Build.DEVICE);
jSONObject.put("model", Build.MODEL);
} catch (JSONException unused) {
}
return jSONObject.toString();
}
public static boolean b() {
return Build.VERSION.SDK_INT >= 16 && FetchedAppSettingsManager.c(FacebookSdk.c()).f().contains(SmartLoginOption.Enabled);
}
public static boolean c(String str) {
if (b()) {
return d(str);
}
return false;
}
@TargetApi(16)
private static boolean d(final String str) {
if (a.containsKey(str)) {
return true;
}
final String format = String.format("%s_%s_%s", "fbsdk", String.format("%s-%s", "android", FacebookSdk.l().replace('.', '|')), str);
NsdServiceInfo nsdServiceInfo = new NsdServiceInfo();
nsdServiceInfo.setServiceType("_fb._tcp.");
nsdServiceInfo.setServiceName(format);
nsdServiceInfo.setPort(80);
NsdManager nsdManager = (NsdManager) FacebookSdk.b().getSystemService("servicediscovery");
NsdManager.RegistrationListener registrationListener = new NsdManager.RegistrationListener() { // from class: com.facebook.devicerequests.internal.DeviceRequestsHelper.1
@Override // android.net.nsd.NsdManager.RegistrationListener
public void onRegistrationFailed(NsdServiceInfo nsdServiceInfo2, int i) {
DeviceRequestsHelper.a(str);
}
@Override // android.net.nsd.NsdManager.RegistrationListener
public void onServiceRegistered(NsdServiceInfo nsdServiceInfo2) {
if (format.equals(nsdServiceInfo2.getServiceName())) {
return;
}
DeviceRequestsHelper.a(str);
}
@Override // android.net.nsd.NsdManager.RegistrationListener
public void onServiceUnregistered(NsdServiceInfo nsdServiceInfo2) {
}
@Override // android.net.nsd.NsdManager.RegistrationListener
public void onUnregistrationFailed(NsdServiceInfo nsdServiceInfo2, int i) {
}
};
a.put(str, registrationListener);
nsdManager.registerService(nsdServiceInfo, 1, registrationListener);
return true;
}
@TargetApi(16)
private static void b(String str) {
NsdManager.RegistrationListener registrationListener = a.get(str);
if (registrationListener != null) {
((NsdManager) FacebookSdk.b().getSystemService("servicediscovery")).unregisterService(registrationListener);
a.remove(str);
}
}
public static void a(String str) {
b(str);
}
}

View File

@@ -0,0 +1,66 @@
package com.facebook.internal;
import android.content.Intent;
import java.util.UUID;
/* loaded from: classes.dex */
public class AppCall {
private static AppCall d;
private UUID a;
private Intent b;
private int c;
public AppCall(int i) {
this(i, UUID.randomUUID());
}
public static synchronized AppCall a(UUID uuid, int i) {
synchronized (AppCall.class) {
AppCall e = e();
if (e != null && e.a().equals(uuid) && e.b() == i) {
a((AppCall) null);
return e;
}
return null;
}
}
public static AppCall e() {
return d;
}
public int b() {
return this.c;
}
public Intent c() {
return this.b;
}
public boolean d() {
return a(this);
}
public AppCall(int i, UUID uuid) {
this.a = uuid;
this.c = i;
}
private static synchronized boolean a(AppCall appCall) {
boolean z;
synchronized (AppCall.class) {
AppCall e = e();
d = appCall;
z = e != null;
}
return z;
}
public UUID a() {
return this.a;
}
public void a(Intent intent) {
this.b = intent;
}
}

View File

@@ -0,0 +1,36 @@
package com.facebook.internal;
import android.content.Context;
import com.facebook.LoggingBehavior;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
public class AppEventsLoggerUtility {
private static final Map<GraphAPIActivityType, String> a = new HashMap<GraphAPIActivityType, String>() { // from class: com.facebook.internal.AppEventsLoggerUtility.1
{
put(GraphAPIActivityType.MOBILE_INSTALL_EVENT, "MOBILE_APP_INSTALL");
put(GraphAPIActivityType.CUSTOM_APP_EVENTS, "CUSTOM_APP_EVENTS");
}
};
public enum GraphAPIActivityType {
MOBILE_INSTALL_EVENT,
CUSTOM_APP_EVENTS
}
public static JSONObject a(GraphAPIActivityType graphAPIActivityType, AttributionIdentifiers attributionIdentifiers, String str, boolean z, Context context) throws JSONException {
JSONObject jSONObject = new JSONObject();
jSONObject.put("event", a.get(graphAPIActivityType));
Utility.a(jSONObject, attributionIdentifiers, str, z);
try {
Utility.a(jSONObject, context);
} catch (Exception e) {
Logger.a(LoggingBehavior.APP_EVENTS, "AppEvents", "Fetching extended device info parameters failed: '%s'", e.toString());
}
jSONObject.put("application_package_name", context.getPackageName());
return jSONObject;
}
}

View File

@@ -0,0 +1,206 @@
package com.facebook.internal;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.PackageManager;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Looper;
import android.os.Parcel;
import android.os.RemoteException;
import com.facebook.FacebookException;
import java.lang.reflect.Method;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.atomic.AtomicBoolean;
/* loaded from: classes.dex */
public class AttributionIdentifiers {
private static final String f = "com.facebook.internal.AttributionIdentifiers";
private static AttributionIdentifiers g;
private String a;
private String b;
private String c;
private boolean d;
private long e;
private static final class GoogleAdInfo implements IInterface {
private IBinder a;
GoogleAdInfo(IBinder iBinder) {
this.a = iBinder;
}
@Override // android.os.IInterface
public IBinder asBinder() {
return this.a;
}
public String i() throws RemoteException {
Parcel obtain = Parcel.obtain();
Parcel obtain2 = Parcel.obtain();
try {
obtain.writeInterfaceToken("com.google.android.gms.ads.identifier.internal.IAdvertisingIdService");
this.a.transact(1, obtain, obtain2, 0);
obtain2.readException();
return obtain2.readString();
} finally {
obtain2.recycle();
obtain.recycle();
}
}
public boolean j() throws RemoteException {
Parcel obtain = Parcel.obtain();
Parcel obtain2 = Parcel.obtain();
try {
obtain.writeInterfaceToken("com.google.android.gms.ads.identifier.internal.IAdvertisingIdService");
obtain.writeInt(1);
this.a.transact(2, obtain, obtain2, 0);
obtain2.readException();
return obtain2.readInt() != 0;
} finally {
obtain2.recycle();
obtain.recycle();
}
}
}
private static final class GoogleAdServiceConnection implements ServiceConnection {
private AtomicBoolean a;
private final BlockingQueue<IBinder> b;
private GoogleAdServiceConnection() {
this.a = new AtomicBoolean(false);
this.b = new LinkedBlockingDeque();
}
public IBinder a() throws InterruptedException {
if (this.a.compareAndSet(true, true)) {
throw new IllegalStateException("Binder already consumed");
}
return this.b.take();
}
@Override // android.content.ServiceConnection
public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
if (iBinder != null) {
try {
this.b.put(iBinder);
} catch (InterruptedException unused) {
}
}
}
@Override // android.content.ServiceConnection
public void onServiceDisconnected(ComponentName componentName) {
}
}
private static AttributionIdentifiers a(Context context) {
AttributionIdentifiers b = b(context);
if (b != null) {
return b;
}
AttributionIdentifiers c = c(context);
return c == null ? new AttributionIdentifiers() : c;
}
private static AttributionIdentifiers b(Context context) {
Method a;
Object a2;
try {
if (Looper.myLooper() == Looper.getMainLooper()) {
throw new FacebookException("getAndroidId cannot be called on the main thread.");
}
Method a3 = Utility.a("com.google.android.gms.common.GooglePlayServicesUtil", "isGooglePlayServicesAvailable", (Class<?>[]) new Class[]{Context.class});
if (a3 == null) {
return null;
}
Object a4 = Utility.a((Object) null, a3, context);
if (!(a4 instanceof Integer) || ((Integer) a4).intValue() != 0 || (a = Utility.a("com.google.android.gms.ads.identifier.AdvertisingIdClient", "getAdvertisingIdInfo", (Class<?>[]) new Class[]{Context.class})) == null || (a2 = Utility.a((Object) null, a, context)) == null) {
return null;
}
Method a5 = Utility.a(a2.getClass(), "getId", (Class<?>[]) new Class[0]);
Method a6 = Utility.a(a2.getClass(), "isLimitAdTrackingEnabled", (Class<?>[]) new Class[0]);
if (a5 != null && a6 != null) {
AttributionIdentifiers attributionIdentifiers = new AttributionIdentifiers();
attributionIdentifiers.b = (String) Utility.a(a2, a5, new Object[0]);
attributionIdentifiers.d = ((Boolean) Utility.a(a2, a6, new Object[0])).booleanValue();
return attributionIdentifiers;
}
return null;
} catch (Exception e) {
Utility.a("android_id", e);
return null;
}
}
private static AttributionIdentifiers c(Context context) {
GoogleAdServiceConnection googleAdServiceConnection = new GoogleAdServiceConnection();
Intent intent = new Intent("com.google.android.gms.ads.identifier.service.START");
intent.setPackage("com.google.android.gms");
if (context.bindService(intent, googleAdServiceConnection, 1)) {
try {
GoogleAdInfo googleAdInfo = new GoogleAdInfo(googleAdServiceConnection.a());
AttributionIdentifiers attributionIdentifiers = new AttributionIdentifiers();
attributionIdentifiers.b = googleAdInfo.i();
attributionIdentifiers.d = googleAdInfo.j();
return attributionIdentifiers;
} catch (Exception e) {
Utility.a("android_id", e);
} finally {
context.unbindService(googleAdServiceConnection);
}
}
return null;
}
/* JADX WARN: Removed duplicated region for block: B:18:0x0064 A[Catch: all -> 0x00c7, Exception -> 0x00c9, TryCatch #5 {Exception -> 0x00c9, all -> 0x00c7, blocks: (B:12:0x0031, B:14:0x0042, B:16:0x005e, B:18:0x0064, B:20:0x0068, B:22:0x006c, B:57:0x004a, B:59:0x0056), top: B:11:0x0031 }] */
/* JADX WARN: Removed duplicated region for block: B:20:0x0068 A[Catch: all -> 0x00c7, Exception -> 0x00c9, TryCatch #5 {Exception -> 0x00c9, all -> 0x00c7, blocks: (B:12:0x0031, B:14:0x0042, B:16:0x005e, B:18:0x0064, B:20:0x0068, B:22:0x006c, B:57:0x004a, B:59:0x0056), top: B:11:0x0031 }] */
/* JADX WARN: Removed duplicated region for block: B:22:0x006c A[Catch: all -> 0x00c7, Exception -> 0x00c9, TRY_LEAVE, TryCatch #5 {Exception -> 0x00c9, all -> 0x00c7, blocks: (B:12:0x0031, B:14:0x0042, B:16:0x005e, B:18:0x0064, B:20:0x0068, B:22:0x006c, B:57:0x004a, B:59:0x0056), top: B:11:0x0031 }] */
/* JADX WARN: Removed duplicated region for block: B:53:0x00ef */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public static com.facebook.internal.AttributionIdentifiers d(android.content.Context r12) {
/*
Method dump skipped, instructions count: 243
To view this dump change 'Code comments level' option to 'DEBUG'
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.internal.AttributionIdentifiers.d(android.content.Context):com.facebook.internal.AttributionIdentifiers");
}
private static String e(Context context) {
PackageManager packageManager = context.getPackageManager();
if (packageManager != null) {
return packageManager.getInstallerPackageName(context.getPackageName());
}
return null;
}
private static AttributionIdentifiers a(AttributionIdentifiers attributionIdentifiers) {
attributionIdentifiers.e = System.currentTimeMillis();
g = attributionIdentifiers;
return attributionIdentifiers;
}
public String a() {
return this.b;
}
public String c() {
return this.a;
}
public String b() {
return this.c;
}
public boolean d() {
return this.d;
}
}

View File

@@ -0,0 +1,57 @@
package com.facebook.internal;
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 com.facebook.appevents.AppEventsLogger;
/* loaded from: classes.dex */
public class BoltsMeasurementEventListener extends BroadcastReceiver {
private static BoltsMeasurementEventListener b;
private Context a;
private BoltsMeasurementEventListener(Context context) {
this.a = context.getApplicationContext();
}
private void a() {
LocalBroadcastManager.a(this.a).a(this);
}
private void b() {
LocalBroadcastManager.a(this.a).a(this, new IntentFilter("com.parse.bolts.measurement_event"));
}
protected void finalize() throws Throwable {
try {
a();
} finally {
super.finalize();
}
}
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
AppEventsLogger b2 = AppEventsLogger.b(context);
String str = "bf_" + intent.getStringExtra("event_name");
Bundle bundleExtra = intent.getBundleExtra("event_args");
Bundle bundle = new Bundle();
for (String str2 : bundleExtra.keySet()) {
bundle.putString(str2.replaceAll("[^0-9a-zA-Z _-]", "-").replaceAll("^[ -]*", "").replaceAll("[ -]*$", ""), (String) bundleExtra.get(str2));
}
b2.a(str, bundle);
}
public static BoltsMeasurementEventListener a(Context context) {
BoltsMeasurementEventListener boltsMeasurementEventListener = b;
if (boltsMeasurementEventListener != null) {
return boltsMeasurementEventListener;
}
b = new BoltsMeasurementEventListener(context);
b.b();
return b;
}
}

View File

@@ -0,0 +1,98 @@
package com.facebook.internal;
import android.os.Bundle;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
public class BundleJSONConverter {
private static final Map<Class<?>, Setter> a = new HashMap();
public interface Setter {
void a(Bundle bundle, String str, Object obj) throws JSONException;
}
static {
a.put(Boolean.class, new Setter() { // from class: com.facebook.internal.BundleJSONConverter.1
@Override // com.facebook.internal.BundleJSONConverter.Setter
public void a(Bundle bundle, String str, Object obj) throws JSONException {
bundle.putBoolean(str, ((Boolean) obj).booleanValue());
}
});
a.put(Integer.class, new Setter() { // from class: com.facebook.internal.BundleJSONConverter.2
@Override // com.facebook.internal.BundleJSONConverter.Setter
public void a(Bundle bundle, String str, Object obj) throws JSONException {
bundle.putInt(str, ((Integer) obj).intValue());
}
});
a.put(Long.class, new Setter() { // from class: com.facebook.internal.BundleJSONConverter.3
@Override // com.facebook.internal.BundleJSONConverter.Setter
public void a(Bundle bundle, String str, Object obj) throws JSONException {
bundle.putLong(str, ((Long) obj).longValue());
}
});
a.put(Double.class, new Setter() { // from class: com.facebook.internal.BundleJSONConverter.4
@Override // com.facebook.internal.BundleJSONConverter.Setter
public void a(Bundle bundle, String str, Object obj) throws JSONException {
bundle.putDouble(str, ((Double) obj).doubleValue());
}
});
a.put(String.class, new Setter() { // from class: com.facebook.internal.BundleJSONConverter.5
@Override // com.facebook.internal.BundleJSONConverter.Setter
public void a(Bundle bundle, String str, Object obj) throws JSONException {
bundle.putString(str, (String) obj);
}
});
a.put(String[].class, new Setter() { // from class: com.facebook.internal.BundleJSONConverter.6
@Override // com.facebook.internal.BundleJSONConverter.Setter
public void a(Bundle bundle, String str, Object obj) throws JSONException {
throw new IllegalArgumentException("Unexpected type from JSON");
}
});
a.put(JSONArray.class, new Setter() { // from class: com.facebook.internal.BundleJSONConverter.7
@Override // com.facebook.internal.BundleJSONConverter.Setter
public void a(Bundle bundle, String str, Object obj) throws JSONException {
JSONArray jSONArray = (JSONArray) obj;
ArrayList<String> arrayList = new ArrayList<>();
if (jSONArray.length() == 0) {
bundle.putStringArrayList(str, arrayList);
return;
}
for (int i = 0; i < jSONArray.length(); i++) {
Object obj2 = jSONArray.get(i);
if (!(obj2 instanceof String)) {
throw new IllegalArgumentException("Unexpected type in an array: " + obj2.getClass());
}
arrayList.add((String) obj2);
}
bundle.putStringArrayList(str, arrayList);
}
});
}
public static Bundle a(JSONObject jSONObject) throws JSONException {
Bundle bundle = new Bundle();
Iterator<String> keys = jSONObject.keys();
while (keys.hasNext()) {
String next = keys.next();
Object obj = jSONObject.get(next);
if (obj != null && obj != JSONObject.NULL) {
if (obj instanceof JSONObject) {
bundle.putBundle(next, a((JSONObject) obj));
} else {
Setter setter = a.get(obj.getClass());
if (setter == null) {
throw new IllegalArgumentException("Unsupported type: " + obj.getClass());
}
setter.a(bundle, next, obj);
}
}
}
return bundle;
}
}

View File

@@ -0,0 +1,80 @@
package com.facebook.internal;
import android.content.Intent;
import com.facebook.CallbackManager;
import com.facebook.FacebookSdk;
import com.ubt.jimu.unity.bluetooth.MyUnityListener;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes.dex */
public final class CallbackManagerImpl implements CallbackManager {
private static Map<Integer, Callback> b = new HashMap();
private Map<Integer, Callback> a = new HashMap();
public interface Callback {
boolean a(int i, Intent intent);
}
public enum RequestCodeOffset {
Login(0),
Share(1),
Message(2),
Like(3),
GameRequest(4),
AppGroupCreate(5),
AppGroupJoin(6),
AppInvite(7),
DeviceShare(8);
private final int offset;
RequestCodeOffset(int i) {
this.offset = i;
}
public int toRequestCode() {
return FacebookSdk.f() + this.offset;
}
}
private static synchronized Callback a(Integer num) {
Callback callback;
synchronized (CallbackManagerImpl.class) {
callback = b.get(num);
}
return callback;
}
public static synchronized void b(int i, Callback callback) {
synchronized (CallbackManagerImpl.class) {
Validate.a(callback, MyUnityListener.CALLBACK);
if (b.containsKey(Integer.valueOf(i))) {
return;
}
b.put(Integer.valueOf(i), callback);
}
}
public void a(int i, Callback callback) {
Validate.a(callback, MyUnityListener.CALLBACK);
this.a.put(Integer.valueOf(i), callback);
}
@Override // com.facebook.CallbackManager
public boolean a(int i, int i2, Intent intent) {
Callback callback = this.a.get(Integer.valueOf(i));
if (callback != null) {
return callback.a(i2, intent);
}
return b(i, i2, intent);
}
private static boolean b(int i, int i2, Intent intent) {
Callback a = a(Integer.valueOf(i));
if (a != null) {
return a.a(i2, intent);
}
return false;
}
}

View File

@@ -0,0 +1,24 @@
package com.facebook.internal;
import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import androidx.browser.customtabs.CustomTabsIntent;
import com.facebook.FacebookSdk;
/* loaded from: classes.dex */
public class CustomTab {
private Uri a;
public CustomTab(String str, Bundle bundle) {
bundle = bundle == null ? new Bundle() : bundle;
this.a = Utility.a(ServerProtocol.b(), FacebookSdk.j() + "/dialog/" + str, bundle);
}
public void a(Activity activity, String str) {
CustomTabsIntent a = new CustomTabsIntent.Builder().a();
a.a.setPackage(str);
a.a.addFlags(1073741824);
a.a(activity, this.a);
}
}

View File

@@ -0,0 +1,10 @@
package com.facebook.internal;
/* loaded from: classes.dex */
public interface DialogFeature {
String getAction();
int getMinVersion();
String name();
}

View File

@@ -0,0 +1,104 @@
package com.facebook.internal;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.facebook.FacebookActivity;
import com.facebook.FacebookException;
import com.facebook.FacebookSdk;
import com.facebook.internal.FetchedAppSettings;
import com.facebook.internal.NativeProtocol;
/* loaded from: classes.dex */
public class DialogPresenter {
public interface ParameterProvider {
Bundle a();
Bundle b();
}
public static void a(AppCall appCall) {
b(appCall, new FacebookException("Unable to show the provided content via the web or the installed version of the Facebook app. Some dialogs are only supported starting API 14."));
}
public static void b(AppCall appCall, FacebookException facebookException) {
a(appCall, facebookException);
}
public static NativeProtocol.ProtocolVersionQueryResult b(DialogFeature dialogFeature) {
String c = FacebookSdk.c();
String action = dialogFeature.getAction();
return NativeProtocol.a(action, a(c, action, dialogFeature));
}
public static void a(AppCall appCall, Activity activity) {
activity.startActivityForResult(appCall.c(), appCall.b());
appCall.d();
}
public static void a(AppCall appCall, FragmentWrapper fragmentWrapper) {
fragmentWrapper.a(appCall.c(), appCall.b());
throw null;
}
public static boolean a(DialogFeature dialogFeature) {
return b(dialogFeature).a() != -1;
}
public static void a(AppCall appCall, FacebookException facebookException) {
if (facebookException == null) {
return;
}
Validate.c(FacebookSdk.b());
Intent intent = new Intent();
intent.setClass(FacebookSdk.b(), FacebookActivity.class);
intent.setAction(FacebookActivity.b);
NativeProtocol.a(intent, appCall.a().toString(), (String) null, NativeProtocol.e(), NativeProtocol.a(facebookException));
appCall.a(intent);
}
public static void a(AppCall appCall, String str, Bundle bundle) {
Validate.c(FacebookSdk.b());
Validate.d(FacebookSdk.b());
Bundle bundle2 = new Bundle();
bundle2.putString("action", str);
bundle2.putBundle("params", bundle);
Intent intent = new Intent();
NativeProtocol.a(intent, appCall.a().toString(), str, NativeProtocol.e(), bundle2);
intent.setClass(FacebookSdk.b(), FacebookActivity.class);
intent.setAction("FacebookDialogFragment");
appCall.a(intent);
}
public static void a(AppCall appCall, ParameterProvider parameterProvider, DialogFeature dialogFeature) {
Bundle b;
Context b2 = FacebookSdk.b();
String action = dialogFeature.getAction();
NativeProtocol.ProtocolVersionQueryResult b3 = b(dialogFeature);
int a = b3.a();
if (a != -1) {
if (NativeProtocol.b(a)) {
b = parameterProvider.a();
} else {
b = parameterProvider.b();
}
if (b == null) {
b = new Bundle();
}
Intent a2 = NativeProtocol.a(b2, appCall.a().toString(), action, b3, b);
if (a2 != null) {
appCall.a(a2);
return;
}
throw new FacebookException("Unable to create Intent; this likely means theFacebook app is not installed.");
}
throw new FacebookException("Cannot present this dialog. This likely means that the Facebook app is not installed.");
}
private static int[] a(String str, String str2, DialogFeature dialogFeature) {
FetchedAppSettings.DialogFeatureConfig a = FetchedAppSettings.a(str, str2, dialogFeature.name());
return a != null ? a.c() : new int[]{dialogFeature.getMinVersion()};
}
}

View File

@@ -0,0 +1,118 @@
package com.facebook.internal;
import android.app.Activity;
import android.util.Log;
import com.facebook.FacebookDialog;
import com.facebook.FacebookException;
import com.facebook.FacebookSdk;
import java.util.Iterator;
import java.util.List;
/* loaded from: classes.dex */
public abstract class FacebookDialogBase<CONTENT, RESULT> implements FacebookDialog<CONTENT, RESULT> {
protected static final Object e = new Object();
private final Activity a;
private final FragmentWrapper b;
private List<FacebookDialogBase<CONTENT, RESULT>.ModeHandler> c;
private int d;
/* JADX INFO: Access modifiers changed from: protected */
public abstract class ModeHandler {
protected ModeHandler(FacebookDialogBase facebookDialogBase) {
}
public abstract AppCall a(CONTENT content);
public Object a() {
return FacebookDialogBase.e;
}
public abstract boolean a(CONTENT content, boolean z);
}
protected FacebookDialogBase(Activity activity, int i) {
Validate.a(activity, "activity");
this.a = activity;
this.b = null;
this.d = i;
}
private List<FacebookDialogBase<CONTENT, RESULT>.ModeHandler> e() {
if (this.c == null) {
this.c = c();
}
return this.c;
}
protected abstract AppCall a();
public void a(CONTENT content) {
a(content, e);
}
protected Activity b() {
Activity activity = this.a;
if (activity != null) {
return activity;
}
FragmentWrapper fragmentWrapper = this.b;
if (fragmentWrapper == null) {
return null;
}
fragmentWrapper.a();
throw null;
}
protected abstract List<FacebookDialogBase<CONTENT, RESULT>.ModeHandler> c();
public int d() {
return this.d;
}
protected void a(CONTENT content, Object obj) {
AppCall b = b(content, obj);
if (b == null) {
Log.e("FacebookDialog", "No code path should ever result in a null appCall");
if (FacebookSdk.n()) {
throw new IllegalStateException("No code path should ever result in a null appCall");
}
} else {
FragmentWrapper fragmentWrapper = this.b;
if (fragmentWrapper == null) {
DialogPresenter.a(b, this.a);
} else {
DialogPresenter.a(b, fragmentWrapper);
throw null;
}
}
}
private AppCall b(CONTENT content, Object obj) {
boolean z = obj == e;
AppCall appCall = null;
Iterator<FacebookDialogBase<CONTENT, RESULT>.ModeHandler> it = e().iterator();
while (true) {
if (!it.hasNext()) {
break;
}
FacebookDialogBase<CONTENT, RESULT>.ModeHandler next = it.next();
if (z || Utility.a(next.a(), obj)) {
if (next.a(content, true)) {
try {
appCall = next.a(content);
break;
} catch (FacebookException e2) {
appCall = a();
DialogPresenter.b(appCall, e2);
}
}
}
}
if (appCall != null) {
return appCall;
}
AppCall a = a();
DialogPresenter.a(a);
return a;
}
}

View File

@@ -0,0 +1,118 @@
package com.facebook.internal;
import android.app.Dialog;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentActivity;
import com.facebook.FacebookException;
import com.facebook.FacebookSdk;
import com.facebook.internal.WebDialog;
/* loaded from: classes.dex */
public class FacebookDialogFragment extends DialogFragment {
private Dialog j;
/* JADX INFO: Access modifiers changed from: private */
public void b(Bundle bundle) {
FragmentActivity activity = getActivity();
Intent intent = new Intent();
if (bundle == null) {
bundle = new Bundle();
}
intent.putExtras(bundle);
activity.setResult(-1, intent);
activity.finish();
}
@Override // androidx.fragment.app.Fragment, android.content.ComponentCallbacks
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
if ((this.j instanceof WebDialog) && isResumed()) {
((WebDialog) this.j).d();
}
}
@Override // androidx.fragment.app.DialogFragment, androidx.fragment.app.Fragment
public void onCreate(Bundle bundle) {
WebDialog webDialog;
super.onCreate(bundle);
if (this.j == null) {
FragmentActivity activity = getActivity();
Bundle d = NativeProtocol.d(activity.getIntent());
if (d.getBoolean("is_fallback", false)) {
String string = d.getString("url");
if (Utility.c(string)) {
Utility.a("FacebookDialogFragment", "Cannot start a fallback WebDialog with an empty/missing 'url'");
activity.finish();
return;
} else {
FacebookWebFallbackDialog facebookWebFallbackDialog = new FacebookWebFallbackDialog(activity, string, String.format("fb%s://bridge/", FacebookSdk.c()));
facebookWebFallbackDialog.a(new WebDialog.OnCompleteListener() { // from class: com.facebook.internal.FacebookDialogFragment.2
@Override // com.facebook.internal.WebDialog.OnCompleteListener
public void a(Bundle bundle2, FacebookException facebookException) {
FacebookDialogFragment.this.b(bundle2);
}
});
webDialog = facebookWebFallbackDialog;
}
} else {
String string2 = d.getString("action");
Bundle bundle2 = d.getBundle("params");
if (Utility.c(string2)) {
Utility.a("FacebookDialogFragment", "Cannot start a WebDialog with an empty/missing 'actionName'");
activity.finish();
return;
} else {
WebDialog.Builder builder = new WebDialog.Builder(activity, string2, bundle2);
builder.a(new WebDialog.OnCompleteListener() { // from class: com.facebook.internal.FacebookDialogFragment.1
@Override // com.facebook.internal.WebDialog.OnCompleteListener
public void a(Bundle bundle3, FacebookException facebookException) {
FacebookDialogFragment.this.a(bundle3, facebookException);
}
});
webDialog = builder.a();
}
}
this.j = webDialog;
}
}
@Override // androidx.fragment.app.DialogFragment, androidx.fragment.app.Fragment
public void onDestroyView() {
if (b() != null && getRetainInstance()) {
b().setDismissMessage(null);
}
super.onDestroyView();
}
@Override // androidx.fragment.app.Fragment
public void onResume() {
super.onResume();
Dialog dialog = this.j;
if (dialog instanceof WebDialog) {
((WebDialog) dialog).d();
}
}
public void a(Dialog dialog) {
this.j = dialog;
}
@Override // androidx.fragment.app.DialogFragment
public Dialog a(Bundle bundle) {
if (this.j == null) {
a((Bundle) null, (FacebookException) null);
b(false);
}
return this.j;
}
/* JADX INFO: Access modifiers changed from: private */
public void a(Bundle bundle, FacebookException facebookException) {
FragmentActivity activity = getActivity();
activity.setResult(facebookException == null ? -1 : 0, NativeProtocol.a(activity.getIntent(), bundle, facebookException));
activity.finish();
}
}

View File

@@ -0,0 +1,49 @@
package com.facebook.internal;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import android.util.Log;
import com.facebook.FacebookSdk;
/* loaded from: classes.dex */
public final class FacebookInitProvider extends ContentProvider {
private static final String a = FacebookInitProvider.class.getSimpleName();
@Override // android.content.ContentProvider
public int delete(Uri uri, String str, String[] strArr) {
return 0;
}
@Override // android.content.ContentProvider
public String getType(Uri uri) {
return null;
}
@Override // android.content.ContentProvider
public Uri insert(Uri uri, ContentValues contentValues) {
return null;
}
@Override // android.content.ContentProvider
public boolean onCreate() {
try {
FacebookSdk.c(getContext());
return false;
} catch (Exception e) {
Log.i(a, "Failed to auto initialize the Facebook SDK", e);
return false;
}
}
@Override // android.content.ContentProvider
public Cursor query(Uri uri, String[] strArr, String str, String[] strArr2, String str2) {
return null;
}
@Override // android.content.ContentProvider
public int update(Uri uri, ContentValues contentValues, String str, String[] strArr) {
return 0;
}
}

View File

@@ -0,0 +1,173 @@
package com.facebook.internal;
import com.facebook.FacebookRequestError;
import com.ubt.jimu.base.entities.Course;
import com.unity3d.ads.metadata.MediationMetaData;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes.dex */
public final class FacebookRequestErrorClassification {
private static FacebookRequestErrorClassification g;
private final Map<Integer, Set<Integer>> a;
private final Map<Integer, Set<Integer>> b;
private final Map<Integer, Set<Integer>> c;
private final String d;
private final String e;
private final String f;
/* renamed from: com.facebook.internal.FacebookRequestErrorClassification$3, reason: invalid class name */
static /* synthetic */ class AnonymousClass3 {
static final /* synthetic */ int[] a = new int[FacebookRequestError.Category.values().length];
static {
try {
a[FacebookRequestError.Category.OTHER.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[FacebookRequestError.Category.LOGIN_RECOVERABLE.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[FacebookRequestError.Category.TRANSIENT.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
}
}
FacebookRequestErrorClassification(Map<Integer, Set<Integer>> map, Map<Integer, Set<Integer>> map2, Map<Integer, Set<Integer>> map3, String str, String str2, String str3) {
this.a = map;
this.b = map2;
this.c = map3;
this.d = str;
this.e = str2;
this.f = str3;
}
private static FacebookRequestErrorClassification b() {
return new FacebookRequestErrorClassification(null, new HashMap<Integer, Set<Integer>>() { // from class: com.facebook.internal.FacebookRequestErrorClassification.1
{
put(2, null);
put(4, null);
put(9, null);
put(17, null);
put(341, null);
}
}, new HashMap<Integer, Set<Integer>>() { // from class: com.facebook.internal.FacebookRequestErrorClassification.2
{
put(102, null);
put(190, null);
}
}, null, null, null);
}
public String a(FacebookRequestError.Category category) {
int i = AnonymousClass3.a[category.ordinal()];
if (i == 1) {
return this.d;
}
if (i == 2) {
return this.f;
}
if (i != 3) {
return null;
}
return this.e;
}
public FacebookRequestError.Category a(int i, int i2, boolean z) {
Set<Integer> set;
Set<Integer> set2;
Set<Integer> set3;
if (z) {
return FacebookRequestError.Category.TRANSIENT;
}
Map<Integer, Set<Integer>> map = this.a;
if (map != null && map.containsKey(Integer.valueOf(i)) && ((set3 = this.a.get(Integer.valueOf(i))) == null || set3.contains(Integer.valueOf(i2)))) {
return FacebookRequestError.Category.OTHER;
}
Map<Integer, Set<Integer>> map2 = this.c;
if (map2 != null && map2.containsKey(Integer.valueOf(i)) && ((set2 = this.c.get(Integer.valueOf(i))) == null || set2.contains(Integer.valueOf(i2)))) {
return FacebookRequestError.Category.LOGIN_RECOVERABLE;
}
Map<Integer, Set<Integer>> map3 = this.b;
if (map3 != null && map3.containsKey(Integer.valueOf(i)) && ((set = this.b.get(Integer.valueOf(i))) == null || set.contains(Integer.valueOf(i2)))) {
return FacebookRequestError.Category.TRANSIENT;
}
return FacebookRequestError.Category.OTHER;
}
public static synchronized FacebookRequestErrorClassification a() {
FacebookRequestErrorClassification facebookRequestErrorClassification;
synchronized (FacebookRequestErrorClassification.class) {
if (g == null) {
g = b();
}
facebookRequestErrorClassification = g;
}
return facebookRequestErrorClassification;
}
private static Map<Integer, Set<Integer>> a(JSONObject jSONObject) {
int optInt;
HashSet hashSet;
JSONArray optJSONArray = jSONObject.optJSONArray("items");
if (optJSONArray.length() == 0) {
return null;
}
HashMap hashMap = new HashMap();
for (int i = 0; i < optJSONArray.length(); i++) {
JSONObject optJSONObject = optJSONArray.optJSONObject(i);
if (optJSONObject != null && (optInt = optJSONObject.optInt(Course.TYPE_BLOCKLY)) != 0) {
JSONArray optJSONArray2 = optJSONObject.optJSONArray("subcodes");
if (optJSONArray2 == null || optJSONArray2.length() <= 0) {
hashSet = null;
} else {
hashSet = new HashSet();
for (int i2 = 0; i2 < optJSONArray2.length(); i2++) {
int optInt2 = optJSONArray2.optInt(i2);
if (optInt2 != 0) {
hashSet.add(Integer.valueOf(optInt2));
}
}
}
hashMap.put(Integer.valueOf(optInt), hashSet);
}
}
return hashMap;
}
public static FacebookRequestErrorClassification a(JSONArray jSONArray) {
String optString;
if (jSONArray == null) {
return null;
}
Map<Integer, Set<Integer>> map = null;
Map<Integer, Set<Integer>> map2 = null;
Map<Integer, Set<Integer>> map3 = null;
String str = null;
String str2 = null;
String str3 = null;
for (int i = 0; i < jSONArray.length(); i++) {
JSONObject optJSONObject = jSONArray.optJSONObject(i);
if (optJSONObject != null && (optString = optJSONObject.optString(MediationMetaData.KEY_NAME)) != null) {
if (optString.equalsIgnoreCase("other")) {
str = optJSONObject.optString("recovery_message", null);
map = a(optJSONObject);
} else if (optString.equalsIgnoreCase("transient")) {
str2 = optJSONObject.optString("recovery_message", null);
map2 = a(optJSONObject);
} else if (optString.equalsIgnoreCase("login_recoverable")) {
str3 = optJSONObject.optString("recovery_message", null);
map3 = a(optJSONObject);
}
}
}
return new FacebookRequestErrorClassification(map, map2, map3, str, str2, str3);
}
}

View File

@@ -0,0 +1,41 @@
package com.facebook.internal;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.os.Build;
import java.util.HashSet;
/* loaded from: classes.dex */
public class FacebookSignatureValidator {
private static final HashSet<String> a = a();
private static HashSet<String> a() {
HashSet<String> hashSet = new HashSet<>();
hashSet.add("8a3c4b262d721acd49a4bf97d5213199c86fa2b9");
hashSet.add("a4b7452e2ed8f5f191058ca7bbfd26b0d3214bfc");
hashSet.add("5e8f16062ea3cd2c4a0d547876baa6f38cabf625");
return hashSet;
}
public static boolean a(Context context, String str) {
String str2 = Build.BRAND;
int i = context.getApplicationInfo().flags;
if (str2.startsWith("generic") && (i & 2) != 0) {
return true;
}
try {
Signature[] signatureArr = context.getPackageManager().getPackageInfo(str, 64).signatures;
if (signatureArr != null && signatureArr.length > 0) {
for (Signature signature : signatureArr) {
if (!a.contains(Utility.a(signature.toByteArray()))) {
return false;
}
}
return true;
}
} catch (PackageManager.NameNotFoundException unused) {
}
return false;
}
}

View File

@@ -0,0 +1,71 @@
package com.facebook.internal;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.webkit.WebView;
import com.unity3d.ads.metadata.MediationMetaData;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
public class FacebookWebFallbackDialog extends WebDialog {
private static final String m = FacebookWebFallbackDialog.class.getName();
private boolean l;
public FacebookWebFallbackDialog(Context context, String str, String str2) {
super(context, str);
b(str2);
}
@Override // com.facebook.internal.WebDialog, android.app.Dialog, android.content.DialogInterface
public void cancel() {
WebView a = a();
if (!c() || b() || a == null || !a.isShown()) {
super.cancel();
return;
}
if (this.l) {
return;
}
this.l = true;
a.loadUrl("javascript:(function() { var event = document.createEvent('Event'); event.initEvent('fbPlatformDialogMustClose',true,true); document.dispatchEvent(event);})();");
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() { // from class: com.facebook.internal.FacebookWebFallbackDialog.1
@Override // java.lang.Runnable
public void run() {
FacebookWebFallbackDialog.super.cancel();
}
}, 1500L);
}
@Override // com.facebook.internal.WebDialog
protected Bundle a(String str) {
Bundle d = Utility.d(Uri.parse(str).getQuery());
String string = d.getString("bridge_args");
d.remove("bridge_args");
if (!Utility.c(string)) {
try {
d.putBundle("com.facebook.platform.protocol.BRIDGE_ARGS", BundleJSONConverter.a(new JSONObject(string)));
} catch (JSONException e) {
Utility.a(m, "Unable to parse bridge_args JSON", e);
}
}
String string2 = d.getString("method_results");
d.remove("method_results");
if (!Utility.c(string2)) {
if (Utility.c(string2)) {
string2 = "{}";
}
try {
d.putBundle("com.facebook.platform.protocol.RESULT_ARGS", BundleJSONConverter.a(new JSONObject(string2)));
} catch (JSONException e2) {
Utility.a(m, "Unable to parse bridge_args JSON", e2);
}
}
d.remove(MediationMetaData.KEY_VERSION);
d.putInt("com.facebook.platform.protocol.PROTOCOL_VERSION", NativeProtocol.e());
return d;
}
}

View File

@@ -0,0 +1,134 @@
package com.facebook.internal;
import android.net.Uri;
import com.unity3d.ads.metadata.MediationMetaData;
import java.util.EnumSet;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes.dex */
public final class FetchedAppSettings {
private boolean a;
private boolean b;
private int c;
private EnumSet<SmartLoginOption> d;
private Map<String, Map<String, DialogFeatureConfig>> e;
private boolean f;
private FacebookRequestErrorClassification g;
public FetchedAppSettings(boolean z, String str, boolean z2, boolean z3, int i, EnumSet<SmartLoginOption> enumSet, Map<String, Map<String, DialogFeatureConfig>> map, boolean z4, FacebookRequestErrorClassification facebookRequestErrorClassification, String str2, String str3) {
this.a = z;
this.b = z3;
this.e = map;
this.g = facebookRequestErrorClassification;
this.c = i;
this.f = z4;
this.d = enumSet;
}
public boolean a() {
return this.f;
}
public boolean b() {
return this.b;
}
public Map<String, Map<String, DialogFeatureConfig>> c() {
return this.e;
}
public FacebookRequestErrorClassification d() {
return this.g;
}
public int e() {
return this.c;
}
public EnumSet<SmartLoginOption> f() {
return this.d;
}
public boolean g() {
return this.a;
}
public static DialogFeatureConfig a(String str, String str2, String str3) {
FetchedAppSettings c;
Map<String, DialogFeatureConfig> map;
if (Utility.c(str2) || Utility.c(str3) || (c = FetchedAppSettingsManager.c(str)) == null || (map = c.c().get(str2)) == null) {
return null;
}
return map.get(str3);
}
public static class DialogFeatureConfig {
private String a;
private String b;
private int[] c;
private DialogFeatureConfig(String str, String str2, Uri uri, int[] iArr) {
this.a = str;
this.b = str2;
this.c = iArr;
}
public static DialogFeatureConfig a(JSONObject jSONObject) {
String optString = jSONObject.optString(MediationMetaData.KEY_NAME);
if (Utility.c(optString)) {
return null;
}
String[] split = optString.split("\\|");
if (split.length != 2) {
return null;
}
String str = split[0];
String str2 = split[1];
if (Utility.c(str) || Utility.c(str2)) {
return null;
}
String optString2 = jSONObject.optString("url");
return new DialogFeatureConfig(str, str2, Utility.c(optString2) ? null : Uri.parse(optString2), a(jSONObject.optJSONArray("versions")));
}
public String b() {
return this.b;
}
public int[] c() {
return this.c;
}
private static int[] a(JSONArray jSONArray) {
if (jSONArray == null) {
return null;
}
int length = jSONArray.length();
int[] iArr = new int[length];
for (int i = 0; i < length; i++) {
int i2 = -1;
int optInt = jSONArray.optInt(i, -1);
if (optInt == -1) {
String optString = jSONArray.optString(i);
if (!Utility.c(optString)) {
try {
i2 = Integer.parseInt(optString);
} catch (NumberFormatException e) {
Utility.a("FacebookSDK", (Exception) e);
}
iArr[i] = i2;
}
}
i2 = optInt;
iArr[i] = i2;
}
return iArr;
}
public String a() {
return this.a;
}
}
}

View File

@@ -0,0 +1,123 @@
package com.facebook.internal;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.TextUtils;
import com.facebook.AccessToken;
import com.facebook.FacebookSdk;
import com.facebook.GraphRequest;
import com.facebook.appevents.internal.AutomaticAnalyticsLogger;
import com.facebook.appevents.internal.Constants;
import com.facebook.internal.FetchedAppSettings;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
public final class FetchedAppSettingsManager {
private static final String[] a = {"supports_implicit_sdk_logging", "gdpv4_nux_content", "gdpv4_nux_enabled", "gdpv4_chrome_custom_tabs_enabled", "android_dialog_configs", "android_sdk_error_categories", "app_events_session_timeout", "app_events_feature_bitmask", "seamless_login", "smart_login_bookmark_icon_url", "smart_login_menu_icon_url"};
private static Map<String, FetchedAppSettings> b = new ConcurrentHashMap();
private static AtomicBoolean c = new AtomicBoolean(false);
public static void b() {
final Context b2 = FacebookSdk.b();
final String c2 = FacebookSdk.c();
boolean compareAndSet = c.compareAndSet(false, true);
if (Utility.c(c2) || b.containsKey(c2) || !compareAndSet) {
return;
}
final String format = String.format("com.facebook.internal.APP_SETTINGS.%s", c2);
FacebookSdk.h().execute(new Runnable() { // from class: com.facebook.internal.FetchedAppSettingsManager.1
@Override // java.lang.Runnable
public void run() {
SharedPreferences sharedPreferences = b2.getSharedPreferences("com.facebook.internal.preferences.APP_SETTINGS", 0);
JSONObject jSONObject = null;
String string = sharedPreferences.getString(format, null);
if (!Utility.c(string)) {
try {
jSONObject = new JSONObject(string);
} catch (JSONException e) {
Utility.a("FacebookSDK", (Exception) e);
}
if (jSONObject != null) {
FetchedAppSettingsManager.b(c2, jSONObject);
}
}
JSONObject b3 = FetchedAppSettingsManager.b(c2);
if (b3 != null) {
FetchedAppSettingsManager.b(c2, b3);
sharedPreferences.edit().putString(format, b3.toString()).apply();
}
AutomaticAnalyticsLogger.a();
FetchedAppSettingsManager.c.set(false);
}
});
}
public static FetchedAppSettings c(String str) {
if (str != null) {
return b.get(str);
}
return null;
}
public static FetchedAppSettings a(String str, boolean z) {
if (!z && b.containsKey(str)) {
return b.get(str);
}
JSONObject b2 = b(str);
if (b2 == null) {
return null;
}
return b(str, b2);
}
private static Map<String, Map<String, FetchedAppSettings.DialogFeatureConfig>> a(JSONObject jSONObject) {
JSONArray optJSONArray;
HashMap hashMap = new HashMap();
if (jSONObject != null && (optJSONArray = jSONObject.optJSONArray("data")) != null) {
for (int i = 0; i < optJSONArray.length(); i++) {
FetchedAppSettings.DialogFeatureConfig a2 = FetchedAppSettings.DialogFeatureConfig.a(optJSONArray.optJSONObject(i));
if (a2 != null) {
String a3 = a2.a();
Map map = (Map) hashMap.get(a3);
if (map == null) {
map = new HashMap();
hashMap.put(a3, map);
}
map.put(a2.b(), a2);
}
}
}
return hashMap;
}
/* JADX INFO: Access modifiers changed from: private */
public static FetchedAppSettings b(String str, JSONObject jSONObject) {
FacebookRequestErrorClassification a2;
JSONArray optJSONArray = jSONObject.optJSONArray("android_sdk_error_categories");
if (optJSONArray == null) {
a2 = FacebookRequestErrorClassification.a();
} else {
a2 = FacebookRequestErrorClassification.a(optJSONArray);
}
FetchedAppSettings fetchedAppSettings = new FetchedAppSettings(jSONObject.optBoolean("supports_implicit_sdk_logging", false), jSONObject.optString("gdpv4_nux_content", ""), jSONObject.optBoolean("gdpv4_nux_enabled", false), jSONObject.optBoolean("gdpv4_chrome_custom_tabs_enabled", false), jSONObject.optInt("app_events_session_timeout", Constants.a()), SmartLoginOption.parseOptions(jSONObject.optLong("seamless_login")), a(jSONObject.optJSONObject("android_dialog_configs")), (jSONObject.optInt("app_events_feature_bitmask", 0) & 8) != 0, a2, jSONObject.optString("smart_login_bookmark_icon_url"), jSONObject.optString("smart_login_menu_icon_url"));
b.put(str, fetchedAppSettings);
return fetchedAppSettings;
}
/* JADX INFO: Access modifiers changed from: private */
public static JSONObject b(String str) {
Bundle bundle = new Bundle();
bundle.putString("fields", TextUtils.join(",", a));
GraphRequest a2 = GraphRequest.a((AccessToken) null, str, (GraphRequest.Callback) null);
a2.a(true);
a2.a(bundle);
return a2.a().b();
}
}

View File

@@ -0,0 +1,15 @@
package com.facebook.internal;
import android.app.Activity;
import android.content.Intent;
/* loaded from: classes.dex */
public class FragmentWrapper {
public final Activity a() {
throw null;
}
public void a(Intent intent, int i) {
throw null;
}
}

View File

@@ -0,0 +1,26 @@
package com.facebook.internal;
import android.net.Uri;
import com.baidu.cloud.media.player.misc.IMediaFormat;
import java.util.Locale;
/* loaded from: classes.dex */
public class ImageRequest {
public static Uri a(String str, int i, int i2) {
Validate.a(str, "userId");
int max = Math.max(i, 0);
int max2 = Math.max(i2, 0);
if (max == 0 && max2 == 0) {
throw new IllegalArgumentException("Either width or height must be greater than 0");
}
Uri.Builder path = new Uri.Builder().scheme("https").authority("graph.facebook.com").path(String.format(Locale.US, "%s/picture", str));
if (max2 != 0) {
path.appendQueryParameter(IMediaFormat.KEY_HEIGHT, String.valueOf(max2));
}
if (max != 0) {
path.appendQueryParameter(IMediaFormat.KEY_WIDTH, String.valueOf(max));
}
path.appendQueryParameter("migration_overrides", "{october_2012:true}");
return path.build();
}
}

View File

@@ -0,0 +1,10 @@
package com.facebook.internal;
/* loaded from: classes.dex */
public class InternalSettings {
private static volatile String a;
public static String a() {
return a;
}
}

View File

@@ -0,0 +1,28 @@
package com.facebook.internal;
import com.facebook.FacebookSdk;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.FutureTask;
/* loaded from: classes.dex */
public class LockOnGetVariable<T> {
private T a;
private CountDownLatch b = new CountDownLatch(1);
public LockOnGetVariable(final Callable<T> callable) {
FacebookSdk.h().execute(new FutureTask(new Callable<Void>() { // from class: com.facebook.internal.LockOnGetVariable.1
@Override // java.util.concurrent.Callable
public Void call() throws Exception {
try {
LockOnGetVariable.this.a = callable.call();
LockOnGetVariable.this.b.countDown();
return null;
} catch (Throwable th) {
LockOnGetVariable.this.b.countDown();
throw th;
}
}
}));
}
}

View File

@@ -0,0 +1,104 @@
package com.facebook.internal;
import android.util.Log;
import com.facebook.FacebookSdk;
import com.facebook.LoggingBehavior;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes.dex */
public class Logger {
private static final HashMap<String, String> e = new HashMap<>();
private final LoggingBehavior a;
private final String b;
private StringBuilder c;
private int d = 3;
public Logger(LoggingBehavior loggingBehavior, String str) {
Validate.a(str, "tag");
this.a = loggingBehavior;
this.b = "FacebookSDK." + str;
this.c = new StringBuilder();
}
public static synchronized void a(String str, String str2) {
synchronized (Logger.class) {
e.put(str, str2);
}
}
public static synchronized void c(String str) {
synchronized (Logger.class) {
if (!FacebookSdk.a(LoggingBehavior.INCLUDE_ACCESS_TOKENS)) {
a(str, "ACCESS_TOKEN_REMOVED");
}
}
}
private static synchronized String d(String str) {
synchronized (Logger.class) {
for (Map.Entry<String, String> entry : e.entrySet()) {
str = str.replace(entry.getKey(), entry.getValue());
}
}
return str;
}
public void b(String str) {
a(this.a, this.d, this.b, str);
}
private boolean b() {
return FacebookSdk.a(this.a);
}
public static void a(LoggingBehavior loggingBehavior, String str, String str2) {
a(loggingBehavior, 3, str, str2);
}
public static void a(LoggingBehavior loggingBehavior, String str, String str2, Object... objArr) {
if (FacebookSdk.a(loggingBehavior)) {
a(loggingBehavior, 3, str, String.format(str2, objArr));
}
}
public static void a(LoggingBehavior loggingBehavior, int i, String str, String str2, Object... objArr) {
if (FacebookSdk.a(loggingBehavior)) {
a(loggingBehavior, i, str, String.format(str2, objArr));
}
}
public static void a(LoggingBehavior loggingBehavior, int i, String str, String str2) {
if (FacebookSdk.a(loggingBehavior)) {
String d = d(str2);
if (!str.startsWith("FacebookSDK.")) {
str = "FacebookSDK." + str;
}
Log.println(i, str, d);
if (loggingBehavior == LoggingBehavior.DEVELOPER_ERRORS) {
new Exception().printStackTrace();
}
}
}
public void a() {
b(this.c.toString());
this.c = new StringBuilder();
}
public void a(String str) {
if (b()) {
this.c.append(str);
}
}
public void a(String str, Object... objArr) {
if (b()) {
this.c.append(String.format(str, objArr));
}
}
public void a(String str, Object obj) {
a(" %s:\t%s\n", str, obj);
}
}

View File

@@ -0,0 +1,7 @@
package com.facebook.internal;
/* loaded from: classes.dex */
public enum LoginAuthorizationType {
READ,
PUBLISH
}

View File

@@ -0,0 +1,201 @@
package com.facebook.internal;
import android.graphics.Bitmap;
import android.net.Uri;
import android.util.Log;
import com.facebook.FacebookContentProvider;
import com.facebook.FacebookException;
import com.facebook.FacebookSdk;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.UUID;
/* loaded from: classes.dex */
public final class NativeAppCallAttachmentStore {
private static final String a = "com.facebook.internal.NativeAppCallAttachmentStore";
private static File b;
public static final class Attachment {
private final UUID a;
private final String b;
private final String c;
private Bitmap d;
private Uri e;
private boolean f;
private boolean g;
private Attachment(UUID uuid, Bitmap bitmap, Uri uri) {
this.a = uuid;
this.d = bitmap;
this.e = uri;
if (uri != null) {
String scheme = uri.getScheme();
if ("content".equalsIgnoreCase(scheme)) {
this.f = true;
this.g = (uri.getAuthority() == null || uri.getAuthority().startsWith("media")) ? false : true;
} else if ("file".equalsIgnoreCase(uri.getScheme())) {
this.g = true;
} else if (!Utility.e(uri)) {
throw new FacebookException("Unsupported scheme for media Uri : " + scheme);
}
} else {
if (bitmap == null) {
throw new FacebookException("Cannot share media without a bitmap or Uri set");
}
this.g = true;
}
this.c = !this.g ? null : UUID.randomUUID().toString();
this.b = !this.g ? this.e.toString() : FacebookContentProvider.a(FacebookSdk.c(), uuid, this.c);
}
public String a() {
return this.b;
}
}
private NativeAppCallAttachmentStore() {
}
public static Attachment a(UUID uuid, Bitmap bitmap) {
Validate.a(uuid, "callId");
Validate.a(bitmap, "attachmentBitmap");
return new Attachment(uuid, bitmap, null);
}
static File b() {
File c = c();
c.mkdirs();
return c;
}
static synchronized File c() {
File file;
synchronized (NativeAppCallAttachmentStore.class) {
if (b == null) {
b = new File(FacebookSdk.b().getCacheDir(), "com.facebook.NativeAppCallAttachmentStore.files");
}
file = b;
}
return file;
}
public static Attachment a(UUID uuid, Uri uri) {
Validate.a(uuid, "callId");
Validate.a(uri, "attachmentUri");
return new Attachment(uuid, null, uri);
}
private static void a(Bitmap bitmap, File file) throws IOException {
FileOutputStream fileOutputStream = new FileOutputStream(file);
try {
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fileOutputStream);
} finally {
Utility.a(fileOutputStream);
}
}
private static void a(Uri uri, boolean z, File file) throws IOException {
InputStream openInputStream;
FileOutputStream fileOutputStream = new FileOutputStream(file);
try {
if (!z) {
openInputStream = new FileInputStream(uri.getPath());
} else {
openInputStream = FacebookSdk.b().getContentResolver().openInputStream(uri);
}
Utility.a(openInputStream, (OutputStream) fileOutputStream);
} finally {
Utility.a(fileOutputStream);
}
}
public static void a(Collection<Attachment> collection) {
if (collection == null || collection.size() == 0) {
return;
}
if (b == null) {
a();
}
b();
ArrayList arrayList = new ArrayList();
try {
for (Attachment attachment : collection) {
if (attachment.g) {
File a2 = a(attachment.a, attachment.c, true);
arrayList.add(a2);
if (attachment.d != null) {
a(attachment.d, a2);
} else if (attachment.e != null) {
a(attachment.e, attachment.f, a2);
}
}
}
} catch (IOException e) {
Log.e(a, "Got unexpected exception:" + e);
Iterator it = arrayList.iterator();
while (it.hasNext()) {
try {
((File) it.next()).delete();
} catch (Exception unused) {
}
}
throw new FacebookException(e);
}
}
public static void a(UUID uuid) {
File a2 = a(uuid, false);
if (a2 != null) {
Utility.a(a2);
}
}
public static File a(UUID uuid, String str) throws FileNotFoundException {
if (!Utility.c(str) && uuid != null) {
try {
return a(uuid, str, false);
} catch (IOException unused) {
throw new FileNotFoundException();
}
}
throw new FileNotFoundException();
}
static File a(UUID uuid, boolean z) {
File file = b;
if (file == null) {
return null;
}
File file2 = new File(file, uuid.toString());
if (z && !file2.exists()) {
file2.mkdirs();
}
return file2;
}
static File a(UUID uuid, String str, boolean z) throws IOException {
File a2 = a(uuid, z);
if (a2 == null) {
return null;
}
try {
return new File(a2, URLEncoder.encode(str, "UTF-8"));
} catch (UnsupportedEncodingException unused) {
return null;
}
}
public static void a() {
Utility.a(c());
}
}

View File

@@ -0,0 +1,512 @@
package com.facebook.internal;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import com.baidu.cloud.media.player.BDCloudMediaPlayer;
import com.facebook.FacebookException;
import com.facebook.FacebookOperationCanceledException;
import com.facebook.FacebookSdk;
import com.facebook.login.DefaultAudience;
import com.unity3d.ads.metadata.MediationMetaData;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeSet;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
/* loaded from: classes.dex */
public final class NativeProtocol {
private static final String a = "com.facebook.internal.NativeProtocol";
private static List<NativeAppInfo> b = d();
private static Map<String, List<NativeAppInfo>> c = c();
private static AtomicBoolean d = new AtomicBoolean(false);
private static final List<Integer> e = Arrays.asList(20160327, 20141218, 20141107, 20141028, 20141001, 20140701, 20140324, 20140204, 20131107, 20130618, 20130502, 20121101);
private static class FBLiteAppInfo extends NativeAppInfo {
private FBLiteAppInfo() {
super();
}
@Override // com.facebook.internal.NativeProtocol.NativeAppInfo
protected String b() {
return "com.facebook.lite.platform.LoginGDPDialogActivity";
}
@Override // com.facebook.internal.NativeProtocol.NativeAppInfo
protected String c() {
return "com.facebook.lite";
}
}
private static class KatanaAppInfo extends NativeAppInfo {
private KatanaAppInfo() {
super();
}
@Override // com.facebook.internal.NativeProtocol.NativeAppInfo
protected String b() {
return "com.facebook.katana.ProxyAuth";
}
@Override // com.facebook.internal.NativeProtocol.NativeAppInfo
protected String c() {
return "com.facebook.katana";
}
}
private static class MessengerAppInfo extends NativeAppInfo {
private MessengerAppInfo() {
super();
}
@Override // com.facebook.internal.NativeProtocol.NativeAppInfo
protected String b() {
return null;
}
@Override // com.facebook.internal.NativeProtocol.NativeAppInfo
protected String c() {
return "com.facebook.orca";
}
}
private static abstract class NativeAppInfo {
private TreeSet<Integer> a;
private NativeAppInfo() {
}
protected abstract String b();
protected abstract String c();
public TreeSet<Integer> a() {
if (this.a == null) {
a(false);
}
return this.a;
}
/* JADX INFO: Access modifiers changed from: private */
/* JADX WARN: Code restructure failed: missing block: B:12:0x0005, code lost:
if (r0.a == null) goto L6;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public synchronized void a(boolean r1) {
/*
r0 = this;
monitor-enter(r0)
if (r1 != 0) goto L7
java.util.TreeSet<java.lang.Integer> r1 = r0.a // Catch: java.lang.Throwable -> Lf
if (r1 != 0) goto Ld
L7:
java.util.TreeSet r1 = com.facebook.internal.NativeProtocol.a(r0) // Catch: java.lang.Throwable -> Lf
r0.a = r1 // Catch: java.lang.Throwable -> Lf
Ld:
monitor-exit(r0)
return
Lf:
r1 = move-exception
monitor-exit(r0)
throw r1
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.internal.NativeProtocol.NativeAppInfo.a(boolean):void");
}
}
public static class ProtocolVersionQueryResult {
private NativeAppInfo a;
private int b;
private ProtocolVersionQueryResult() {
}
public static ProtocolVersionQueryResult a(NativeAppInfo nativeAppInfo, int i) {
ProtocolVersionQueryResult protocolVersionQueryResult = new ProtocolVersionQueryResult();
protocolVersionQueryResult.a = nativeAppInfo;
protocolVersionQueryResult.b = i;
return protocolVersionQueryResult;
}
public static ProtocolVersionQueryResult b() {
ProtocolVersionQueryResult protocolVersionQueryResult = new ProtocolVersionQueryResult();
protocolVersionQueryResult.b = -1;
return protocolVersionQueryResult;
}
public int a() {
return this.b;
}
}
private static class WakizashiAppInfo extends NativeAppInfo {
private WakizashiAppInfo() {
super();
}
@Override // com.facebook.internal.NativeProtocol.NativeAppInfo
protected String b() {
return "com.facebook.katana.ProxyAuth";
}
@Override // com.facebook.internal.NativeProtocol.NativeAppInfo
protected String c() {
return "com.facebook.wakizashi";
}
}
private static Map<String, List<NativeAppInfo>> c() {
HashMap hashMap = new HashMap();
ArrayList arrayList = new ArrayList();
arrayList.add(new MessengerAppInfo());
hashMap.put("com.facebook.platform.action.request.OGACTIONPUBLISH_DIALOG", b);
hashMap.put("com.facebook.platform.action.request.FEED_DIALOG", b);
hashMap.put("com.facebook.platform.action.request.LIKE_DIALOG", b);
hashMap.put("com.facebook.platform.action.request.APPINVITES_DIALOG", b);
hashMap.put("com.facebook.platform.action.request.MESSAGE_DIALOG", arrayList);
hashMap.put("com.facebook.platform.action.request.OGMESSAGEPUBLISH_DIALOG", arrayList);
return hashMap;
}
private static List<NativeAppInfo> d() {
ArrayList arrayList = new ArrayList();
arrayList.add(new KatanaAppInfo());
arrayList.add(new WakizashiAppInfo());
return arrayList;
}
public static final int e() {
return e.get(0).intValue();
}
public static Bundle f(Intent intent) {
int e2 = e(intent);
Bundle extras = intent.getExtras();
return (!b(e2) || extras == null) ? extras : extras.getBundle("com.facebook.platform.protocol.RESULT_ARGS");
}
public static boolean g(Intent intent) {
Bundle a2 = a(intent);
return a2 != null ? a2.containsKey(BDCloudMediaPlayer.OnNativeInvokeListener.ARG_ERROR) : intent.hasExtra("com.facebook.platform.status.ERROR_TYPE");
}
static Intent b(Context context, Intent intent, NativeAppInfo nativeAppInfo) {
ResolveInfo resolveService;
if (intent == null || (resolveService = context.getPackageManager().resolveService(intent, 0)) == null || !FacebookSignatureValidator.a(context, resolveService.serviceInfo.packageName)) {
return null;
}
return intent;
}
public static int e(Intent intent) {
return intent.getIntExtra("com.facebook.platform.protocol.PROTOCOL_VERSION", 0);
}
static Intent a(Context context, Intent intent, NativeAppInfo nativeAppInfo) {
ResolveInfo resolveActivity;
if (intent == null || (resolveActivity = context.getPackageManager().resolveActivity(intent, 0)) == null || !FacebookSignatureValidator.a(context, resolveActivity.activityInfo.packageName)) {
return null;
}
return intent;
}
public static Intent b(Context context, String str, Collection<String> collection, String str2, boolean z, boolean z2, DefaultAudience defaultAudience, String str3) {
for (NativeAppInfo nativeAppInfo : b) {
Intent a2 = a(context, a(nativeAppInfo, str, collection, str2, z, z2, defaultAudience, str3), nativeAppInfo);
if (a2 != null) {
return a2;
}
}
return null;
}
public static Bundle d(Intent intent) {
if (!b(e(intent))) {
return intent.getExtras();
}
return intent.getBundleExtra("com.facebook.platform.protocol.METHOD_ARGS");
}
public static Intent a(Context context, String str, Collection<String> collection, String str2, boolean z, boolean z2, DefaultAudience defaultAudience, String str3) {
FBLiteAppInfo fBLiteAppInfo = new FBLiteAppInfo();
return a(context, a(fBLiteAppInfo, str, collection, str2, z, z2, defaultAudience, str3), fBLiteAppInfo);
}
public static void f() {
if (d.compareAndSet(false, true)) {
FacebookSdk.h().execute(new Runnable() { // from class: com.facebook.internal.NativeProtocol.1
@Override // java.lang.Runnable
public void run() {
try {
Iterator it = NativeProtocol.b.iterator();
while (it.hasNext()) {
((NativeAppInfo) it.next()).a(true);
}
} finally {
NativeProtocol.d.set(false);
}
}
});
}
}
public static boolean b(int i) {
return e.contains(Integer.valueOf(i)) && i >= 20140701;
}
private static Intent a(NativeAppInfo nativeAppInfo, String str, Collection<String> collection, String str2, boolean z, boolean z2, DefaultAudience defaultAudience, String str3) {
String b2 = nativeAppInfo.b();
if (b2 == null) {
return null;
}
Intent putExtra = new Intent().setClassName(nativeAppInfo.c(), b2).putExtra("client_id", str);
putExtra.putExtra("facebook_sdk_version", FacebookSdk.l());
if (!Utility.a(collection)) {
putExtra.putExtra("scope", TextUtils.join(",", collection));
}
if (!Utility.c(str2)) {
putExtra.putExtra("e2e", str2);
}
putExtra.putExtra("state", str3);
putExtra.putExtra("response_type", "token,signed_request");
putExtra.putExtra("return_scopes", "true");
if (z2) {
putExtra.putExtra("default_audience", defaultAudience.getNativeProtocolAudience());
}
putExtra.putExtra("legacy_override", FacebookSdk.j());
putExtra.putExtra("auth_type", "rerequest");
return putExtra;
}
public static UUID b(Intent intent) {
String stringExtra;
if (intent == null) {
return null;
}
if (b(e(intent))) {
Bundle bundleExtra = intent.getBundleExtra("com.facebook.platform.protocol.BRIDGE_ARGS");
stringExtra = bundleExtra != null ? bundleExtra.getString("action_id") : null;
} else {
stringExtra = intent.getStringExtra("com.facebook.platform.protocol.CALL_ID");
}
if (stringExtra == null) {
return null;
}
try {
return UUID.fromString(stringExtra);
} catch (IllegalArgumentException unused) {
return null;
}
}
public static Bundle c(Intent intent) {
if (!g(intent)) {
return null;
}
Bundle a2 = a(intent);
if (a2 != null) {
return a2.getBundle(BDCloudMediaPlayer.OnNativeInvokeListener.ARG_ERROR);
}
return intent.getExtras();
}
private static Uri b(NativeAppInfo nativeAppInfo) {
return Uri.parse("content://" + nativeAppInfo.c() + ".provider.PlatformProvider/versions");
}
/* JADX INFO: Access modifiers changed from: private */
public static TreeSet<Integer> c(NativeAppInfo nativeAppInfo) {
ProviderInfo providerInfo;
TreeSet<Integer> treeSet = new TreeSet<>();
ContentResolver contentResolver = FacebookSdk.b().getContentResolver();
String[] strArr = {MediationMetaData.KEY_VERSION};
Uri b2 = b(nativeAppInfo);
Cursor cursor = null;
try {
try {
providerInfo = FacebookSdk.b().getPackageManager().resolveContentProvider(nativeAppInfo.c() + ".provider.PlatformProvider", 0);
} catch (RuntimeException e2) {
Log.e(a, "Failed to query content resolver.", e2);
providerInfo = null;
}
if (providerInfo != null) {
try {
cursor = contentResolver.query(b2, strArr, null, null, null);
} catch (NullPointerException | SecurityException unused) {
Log.e(a, "Failed to query content resolver.");
}
if (cursor != null) {
while (cursor.moveToNext()) {
treeSet.add(Integer.valueOf(cursor.getInt(cursor.getColumnIndex(MediationMetaData.KEY_VERSION))));
}
}
}
return treeSet;
} finally {
if (cursor != null) {
cursor.close();
}
}
}
public static Intent a(Context context, String str, String str2, ProtocolVersionQueryResult protocolVersionQueryResult, Bundle bundle) {
NativeAppInfo nativeAppInfo;
Intent a2;
if (protocolVersionQueryResult == null || (nativeAppInfo = protocolVersionQueryResult.a) == null || (a2 = a(context, new Intent().setAction("com.facebook.platform.PLATFORM_ACTIVITY").setPackage(nativeAppInfo.c()).addCategory("android.intent.category.DEFAULT"), nativeAppInfo)) == null) {
return null;
}
a(a2, str, str2, protocolVersionQueryResult.b, bundle);
return a2;
}
public static void a(Intent intent, String str, String str2, int i, Bundle bundle) {
String c2 = FacebookSdk.c();
String d2 = FacebookSdk.d();
intent.putExtra("com.facebook.platform.protocol.PROTOCOL_VERSION", i).putExtra("com.facebook.platform.protocol.PROTOCOL_ACTION", str2).putExtra("com.facebook.platform.extra.APPLICATION_ID", c2);
if (b(i)) {
Bundle bundle2 = new Bundle();
bundle2.putString("action_id", str);
Utility.a(bundle2, "app_name", d2);
intent.putExtra("com.facebook.platform.protocol.BRIDGE_ARGS", bundle2);
if (bundle == null) {
bundle = new Bundle();
}
intent.putExtra("com.facebook.platform.protocol.METHOD_ARGS", bundle);
return;
}
intent.putExtra("com.facebook.platform.protocol.CALL_ID", str);
if (!Utility.c(d2)) {
intent.putExtra("com.facebook.platform.extra.APPLICATION_NAME", d2);
}
intent.putExtras(bundle);
}
public static Intent a(Intent intent, Bundle bundle, FacebookException facebookException) {
UUID b2 = b(intent);
if (b2 == null) {
return null;
}
Intent intent2 = new Intent();
intent2.putExtra("com.facebook.platform.protocol.PROTOCOL_VERSION", e(intent));
Bundle bundle2 = new Bundle();
bundle2.putString("action_id", b2.toString());
if (facebookException != null) {
bundle2.putBundle(BDCloudMediaPlayer.OnNativeInvokeListener.ARG_ERROR, a(facebookException));
}
intent2.putExtra("com.facebook.platform.protocol.BRIDGE_ARGS", bundle2);
if (bundle != null) {
intent2.putExtra("com.facebook.platform.protocol.RESULT_ARGS", bundle);
}
return intent2;
}
public static Intent a(Context context) {
for (NativeAppInfo nativeAppInfo : b) {
Intent b2 = b(context, new Intent("com.facebook.platform.PLATFORM_SERVICE").setPackage(nativeAppInfo.c()).addCategory("android.intent.category.DEFAULT"), nativeAppInfo);
if (b2 != null) {
return b2;
}
}
return null;
}
public static Bundle a(Intent intent) {
if (b(e(intent))) {
return intent.getBundleExtra("com.facebook.platform.protocol.BRIDGE_ARGS");
}
return null;
}
public static FacebookException a(Bundle bundle) {
if (bundle == null) {
return null;
}
String string = bundle.getString("error_type");
if (string == null) {
string = bundle.getString("com.facebook.platform.status.ERROR_TYPE");
}
String string2 = bundle.getString("error_description");
if (string2 == null) {
string2 = bundle.getString("com.facebook.platform.status.ERROR_DESCRIPTION");
}
if (string != null && string.equalsIgnoreCase("UserCanceled")) {
return new FacebookOperationCanceledException(string2);
}
return new FacebookException(string2);
}
public static Bundle a(FacebookException facebookException) {
if (facebookException == null) {
return null;
}
Bundle bundle = new Bundle();
bundle.putString("error_description", facebookException.toString());
if (facebookException instanceof FacebookOperationCanceledException) {
bundle.putString("error_type", "UserCanceled");
}
return bundle;
}
public static int a(int i) {
return a(b, new int[]{i}).a();
}
public static ProtocolVersionQueryResult a(String str, int[] iArr) {
return a(c.get(str), iArr);
}
private static ProtocolVersionQueryResult a(List<NativeAppInfo> list, int[] iArr) {
f();
if (list == null) {
return ProtocolVersionQueryResult.b();
}
for (NativeAppInfo nativeAppInfo : list) {
int a2 = a(nativeAppInfo.a(), e(), iArr);
if (a2 != -1) {
return ProtocolVersionQueryResult.a(nativeAppInfo, a2);
}
}
return ProtocolVersionQueryResult.b();
}
public static int a(TreeSet<Integer> treeSet, int i, int[] iArr) {
int length = iArr.length - 1;
Iterator<Integer> descendingIterator = treeSet.descendingIterator();
int i2 = length;
int i3 = -1;
while (descendingIterator.hasNext()) {
int intValue = descendingIterator.next().intValue();
i3 = Math.max(i3, intValue);
while (i2 >= 0 && iArr[i2] > intValue) {
i2--;
}
if (i2 < 0) {
return -1;
}
if (iArr[i2] == intValue) {
if (i2 % 2 == 0) {
return Math.min(i3, i);
}
return -1;
}
}
return -1;
}
}

View File

@@ -0,0 +1,7 @@
package com.facebook.internal;
/* loaded from: classes.dex */
public enum PermissionType {
READ,
PUBLISH
}

View File

@@ -0,0 +1,120 @@
package com.facebook.internal;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
/* loaded from: classes.dex */
public abstract class PlatformServiceClient implements ServiceConnection {
private final Context a;
private final Handler b;
private CompletedListener c;
private boolean d;
private Messenger e;
private int f;
private int g;
private final String h;
private final int i;
public interface CompletedListener {
void a(Bundle bundle);
}
public PlatformServiceClient(Context context, int i, int i2, int i3, String str) {
Context applicationContext = context.getApplicationContext();
this.a = applicationContext != null ? applicationContext : context;
this.f = i;
this.g = i2;
this.h = str;
this.i = i3;
this.b = new Handler() { // from class: com.facebook.internal.PlatformServiceClient.1
@Override // android.os.Handler
public void handleMessage(Message message) {
PlatformServiceClient.this.a(message);
}
};
}
private void c() {
Bundle bundle = new Bundle();
bundle.putString("com.facebook.platform.extra.APPLICATION_ID", this.h);
a(bundle);
Message obtain = Message.obtain((Handler) null, this.f);
obtain.arg1 = this.i;
obtain.setData(bundle);
obtain.replyTo = new Messenger(this.b);
try {
this.e.send(obtain);
} catch (RemoteException unused) {
b(null);
}
}
protected abstract void a(Bundle bundle);
public void a(CompletedListener completedListener) {
this.c = completedListener;
}
public boolean b() {
Intent a;
if (this.d || NativeProtocol.a(this.i) == -1 || (a = NativeProtocol.a(this.a)) == null) {
return false;
}
this.d = true;
this.a.bindService(a, this, 1);
return true;
}
@Override // android.content.ServiceConnection
public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
this.e = new Messenger(iBinder);
c();
}
@Override // android.content.ServiceConnection
public void onServiceDisconnected(ComponentName componentName) {
this.e = null;
try {
this.a.unbindService(this);
} catch (IllegalArgumentException unused) {
}
b(null);
}
public void a() {
this.d = false;
}
protected void a(Message message) {
if (message.what == this.g) {
Bundle data = message.getData();
if (data.getString("com.facebook.platform.status.ERROR_TYPE") != null) {
b(null);
} else {
b(data);
}
try {
this.a.unbindService(this);
} catch (IllegalArgumentException unused) {
}
}
}
private void b(Bundle bundle) {
if (this.d) {
this.d = false;
CompletedListener completedListener = this.c;
if (completedListener != null) {
completedListener.a(bundle);
}
}
}
}

View File

@@ -0,0 +1,17 @@
package com.facebook.internal;
import java.util.concurrent.ConcurrentHashMap;
import org.json.JSONObject;
/* loaded from: classes.dex */
class ProfileInformationCache {
private static final ConcurrentHashMap<String, JSONObject> a = new ConcurrentHashMap<>();
public static JSONObject a(String str) {
return a.get(str);
}
public static void a(String str, JSONObject jSONObject) {
a.put(str, jSONObject);
}
}

View File

@@ -0,0 +1,26 @@
package com.facebook.internal;
import com.facebook.FacebookSdk;
import java.util.Collection;
/* loaded from: classes.dex */
public final class ServerProtocol {
public static final Collection<String> a = Utility.b("service_disabled", "AndroidAuthKillSwitchException");
public static final Collection<String> b = Utility.b("access_denied", "OAuthAccessDeniedException");
public static final String a() {
return "v2.9";
}
public static final String b() {
return String.format("m.%s", FacebookSdk.i());
}
public static final String c() {
return String.format("https://graph.%s", FacebookSdk.i());
}
public static final String d() {
return String.format("https://graph-video.%s", FacebookSdk.i());
}
}

View File

@@ -0,0 +1,34 @@
package com.facebook.internal;
import java.util.EnumSet;
import java.util.Iterator;
/* loaded from: classes.dex */
public enum SmartLoginOption {
None(0),
Enabled(1),
RequireConfirm(2);
public static final EnumSet<SmartLoginOption> ALL = EnumSet.allOf(SmartLoginOption.class);
private final long mValue;
SmartLoginOption(long j) {
this.mValue = j;
}
public static EnumSet<SmartLoginOption> parseOptions(long j) {
EnumSet<SmartLoginOption> noneOf = EnumSet.noneOf(SmartLoginOption.class);
Iterator it = ALL.iterator();
while (it.hasNext()) {
SmartLoginOption smartLoginOption = (SmartLoginOption) it.next();
if ((smartLoginOption.getValue() & j) != 0) {
noneOf.add(smartLoginOption);
}
}
return noneOf;
}
public long getValue() {
return this.mValue;
}
}

View File

@@ -0,0 +1,804 @@
package com.facebook.internal;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Parcel;
import android.os.StatFs;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
import android.view.WindowManager;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
import com.facebook.AccessToken;
import com.facebook.FacebookException;
import com.facebook.FacebookSdk;
import com.facebook.GraphRequest;
import com.facebook.GraphResponse;
import com.facebook.HttpMethod;
import com.liulishuo.filedownloader.model.FileDownloadModel;
import com.ubt.jimu.diy.model.CategoryModel;
import com.ubt.jimu.unity.bluetooth.UnityActivity;
import java.io.BufferedInputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.math.BigInteger;
import java.net.HttpURLConnection;
import java.net.URLConnection;
import java.net.URLDecoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.TimeZone;
import java.util.regex.Pattern;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;
/* loaded from: classes.dex */
public final class Utility {
private static int a = 0;
private static long b = -1;
private static long c = -1;
private static long d = -1;
private static String e = "";
private static String f = "";
private static String g = "NoCarrier";
public interface GraphMeRequestWithCacheCallback {
void a(FacebookException facebookException);
void a(JSONObject jSONObject);
}
public interface Mapper<T, K> {
K apply(T t);
}
public static class PermissionsPair {
List<String> a;
List<String> b;
public PermissionsPair(List<String> list, List<String> list2) {
this.a = list;
this.b = list2;
}
public List<String> a() {
return this.b;
}
public List<String> b() {
return this.a;
}
}
public static <T> boolean a(Collection<T> collection) {
return collection == null || collection.size() == 0;
}
public static <T> Collection<T> b(T... tArr) {
return Collections.unmodifiableCollection(Arrays.asList(tArr));
}
public static boolean c(String str) {
return str == null || str.length() == 0;
}
public static Bundle d(String str) {
Bundle bundle = new Bundle();
if (!c(str)) {
for (String str2 : str.split("&")) {
String[] split = str2.split("=");
try {
if (split.length == 2) {
bundle.putString(URLDecoder.decode(split[0], "UTF-8"), URLDecoder.decode(split[1], "UTF-8"));
} else if (split.length == 1) {
bundle.putString(URLDecoder.decode(split[0], "UTF-8"), "");
}
} catch (UnsupportedEncodingException e2) {
a("FacebookSDK", (Exception) e2);
}
}
}
return bundle;
}
public static boolean e(Uri uri) {
return uri != null && ("http".equalsIgnoreCase(uri.getScheme()) || "https".equalsIgnoreCase(uri.getScheme()) || "fbstaging".equalsIgnoreCase(uri.getScheme()));
}
public static String a(byte[] bArr) {
return a("SHA-1", bArr);
}
public static List<String> b(JSONArray jSONArray) throws JSONException {
ArrayList arrayList = new ArrayList();
for (int i = 0; i < jSONArray.length(); i++) {
arrayList.add(jSONArray.getString(i));
}
return arrayList;
}
public static String c(Context context) {
Validate.a(context, "context");
FacebookSdk.c(context);
return FacebookSdk.c();
}
private static String a(String str, byte[] bArr) {
try {
return a(MessageDigest.getInstance(str), bArr);
} catch (NoSuchAlgorithmException unused) {
return null;
}
}
private static void e(Context context) {
if (b == -1 || System.currentTimeMillis() - b >= 1800000) {
b = System.currentTimeMillis();
d();
d(context);
e();
b();
}
}
private static String a(MessageDigest messageDigest, byte[] bArr) {
messageDigest.update(bArr);
byte[] digest = messageDigest.digest();
StringBuilder sb = new StringBuilder();
for (byte b2 : digest) {
sb.append(Integer.toHexString((b2 >> 4) & 15));
sb.append(Integer.toHexString((b2 >> 0) & 15));
}
return sb.toString();
}
public static String b(Context context) {
return context == null ? "null" : context == context.getApplicationContext() ? CategoryModel.unknown : context.getClass().getSimpleName();
}
public static boolean c(Uri uri) {
return uri != null && "content".equalsIgnoreCase(uri.getScheme());
}
private static int c() {
int i = a;
if (i > 0) {
return i;
}
try {
File[] listFiles = new File("/sys/devices/system/cpu/").listFiles(new FilenameFilter() { // from class: com.facebook.internal.Utility.2
@Override // java.io.FilenameFilter
public boolean accept(File file, String str) {
return Pattern.matches("cpu[0-9]+", str);
}
});
if (listFiles != null) {
a = listFiles.length;
}
} catch (Exception unused) {
}
if (a <= 0) {
a = Math.max(Runtime.getRuntime().availableProcessors(), 1);
}
return a;
}
public static String b(Uri uri) {
if (uri == null) {
return null;
}
return uri.toString();
}
private static GraphRequest b(String str) {
Bundle bundle = new Bundle();
bundle.putString("fields", "id,name,first_name,middle_name,last_name,link");
bundle.putString(AccessToken.ACCESS_TOKEN_KEY, str);
return new GraphRequest(null, "me", bundle, HttpMethod.GET, null);
}
private static void e() {
try {
if (a()) {
StatFs statFs = new StatFs(Environment.getExternalStorageDirectory().getPath());
c = statFs.getBlockCount() * statFs.getBlockSize();
}
c = a(c);
} catch (Exception unused) {
}
}
public static Uri a(String str, String str2, Bundle bundle) {
Uri.Builder builder = new Uri.Builder();
builder.scheme("https");
builder.authority(str);
builder.path(str2);
if (bundle != null) {
for (String str3 : bundle.keySet()) {
Object obj = bundle.get(str3);
if (obj instanceof String) {
builder.appendQueryParameter(str3, (String) obj);
}
}
}
return builder.build();
}
private static void b() {
try {
if (a()) {
StatFs statFs = new StatFs(Environment.getExternalStorageDirectory().getPath());
d = statFs.getAvailableBlocks() * statFs.getBlockSize();
}
d = a(d);
} catch (Exception unused) {
}
}
public static boolean d(Uri uri) {
return uri != null && "file".equalsIgnoreCase(uri.getScheme());
}
private static void d() {
try {
TimeZone timeZone = TimeZone.getDefault();
e = timeZone.getDisplayName(timeZone.inDaylightTime(new Date()), 0);
f = timeZone.getID();
} catch (Exception unused) {
}
}
public static void a(Bundle bundle, String str, String str2) {
if (c(str2)) {
return;
}
bundle.putString(str, str2);
}
private static void d(Context context) {
if (g.equals("NoCarrier")) {
try {
g = ((TelephonyManager) context.getSystemService("phone")).getNetworkOperatorName();
} catch (Exception unused) {
}
}
}
public static void a(Bundle bundle, String str, Uri uri) {
if (uri != null) {
a(bundle, str, uri.toString());
}
}
public static boolean a(Bundle bundle, String str, Object obj) {
if (obj == null) {
bundle.remove(str);
return true;
}
if (obj instanceof Boolean) {
bundle.putBoolean(str, ((Boolean) obj).booleanValue());
return true;
}
if (obj instanceof boolean[]) {
bundle.putBooleanArray(str, (boolean[]) obj);
return true;
}
if (obj instanceof Double) {
bundle.putDouble(str, ((Double) obj).doubleValue());
return true;
}
if (obj instanceof double[]) {
bundle.putDoubleArray(str, (double[]) obj);
return true;
}
if (obj instanceof Integer) {
bundle.putInt(str, ((Integer) obj).intValue());
return true;
}
if (obj instanceof int[]) {
bundle.putIntArray(str, (int[]) obj);
return true;
}
if (obj instanceof Long) {
bundle.putLong(str, ((Long) obj).longValue());
return true;
}
if (obj instanceof long[]) {
bundle.putLongArray(str, (long[]) obj);
return true;
}
if (obj instanceof String) {
bundle.putString(str, (String) obj);
return true;
}
if (obj instanceof JSONArray) {
bundle.putString(str, obj.toString());
return true;
}
if (!(obj instanceof JSONObject)) {
return false;
}
bundle.putString(str, obj.toString());
return true;
}
public static void a(Closeable closeable) {
if (closeable != null) {
try {
closeable.close();
} catch (IOException unused) {
}
}
}
public static void a(URLConnection uRLConnection) {
if (uRLConnection == null || !(uRLConnection instanceof HttpURLConnection)) {
return;
}
((HttpURLConnection) uRLConnection).disconnect();
}
public static Object a(JSONObject jSONObject, String str, String str2) throws JSONException {
Object opt = jSONObject.opt(str);
if (opt != null && (opt instanceof String)) {
opt = new JSONTokener((String) opt).nextValue();
}
if (opt == null || (opt instanceof JSONObject) || (opt instanceof JSONArray)) {
return opt;
}
if (str2 != null) {
JSONObject jSONObject2 = new JSONObject();
jSONObject2.putOpt(str2, opt);
return jSONObject2;
}
throw new FacebookException("Got an unexpected non-JSON object.");
}
public static String a(InputStream inputStream) throws IOException {
BufferedInputStream bufferedInputStream;
Throwable th;
InputStreamReader inputStreamReader;
try {
bufferedInputStream = new BufferedInputStream(inputStream);
try {
inputStreamReader = new InputStreamReader(bufferedInputStream);
} catch (Throwable th2) {
th = th2;
inputStreamReader = null;
}
try {
StringBuilder sb = new StringBuilder();
char[] cArr = new char[2048];
while (true) {
int read = inputStreamReader.read(cArr);
if (read != -1) {
sb.append(cArr, 0, read);
} else {
String sb2 = sb.toString();
a((Closeable) bufferedInputStream);
a(inputStreamReader);
return sb2;
}
}
} catch (Throwable th3) {
th = th3;
a((Closeable) bufferedInputStream);
a(inputStreamReader);
throw th;
}
} catch (Throwable th4) {
bufferedInputStream = null;
th = th4;
inputStreamReader = null;
}
}
public static int a(InputStream inputStream, OutputStream outputStream) throws IOException {
BufferedInputStream bufferedInputStream;
try {
bufferedInputStream = new BufferedInputStream(inputStream);
} catch (Throwable th) {
th = th;
bufferedInputStream = null;
}
try {
byte[] bArr = new byte[UnityActivity.BLOCKLY_TYPE_NONE];
int i = 0;
while (true) {
int read = bufferedInputStream.read(bArr);
if (read == -1) {
break;
}
outputStream.write(bArr, 0, read);
i += read;
}
bufferedInputStream.close();
if (inputStream != null) {
inputStream.close();
}
return i;
} catch (Throwable th2) {
th = th2;
if (bufferedInputStream != null) {
bufferedInputStream.close();
}
if (inputStream != null) {
inputStream.close();
}
throw th;
}
}
private static void a(Context context, String str) {
CookieSyncManager.createInstance(context).sync();
CookieManager cookieManager = CookieManager.getInstance();
String cookie = cookieManager.getCookie(str);
if (cookie == null) {
return;
}
for (String str2 : cookie.split(";")) {
String[] split = str2.split("=");
if (split.length > 0) {
cookieManager.setCookie(str, split[0].trim() + "=;expires=Sat, 1 Jan 2000 00:00:01 UTC;");
}
}
cookieManager.removeExpiredCookie();
}
public static void a(Context context) {
a(context, "facebook.com");
a(context, ".facebook.com");
a(context, "https://facebook.com");
a(context, "https://.facebook.com");
}
public static void a(String str, Exception exc) {
if (!FacebookSdk.n() || str == null || exc == null) {
return;
}
Log.d(str, exc.getClass().getSimpleName() + ": " + exc.getMessage());
}
public static void a(String str, String str2) {
if (!FacebookSdk.n() || str == null || str2 == null) {
return;
}
Log.d(str, str2);
}
public static void a(String str, String str2, Throwable th) {
if (!FacebookSdk.n() || c(str)) {
return;
}
Log.d(str, str2, th);
}
public static <T> boolean a(T t, T t2) {
if (t == null) {
return t2 == null;
}
return t.equals(t2);
}
public static void a(File file) {
File[] listFiles;
if (file.exists()) {
if (file.isDirectory() && (listFiles = file.listFiles()) != null) {
for (File file2 : listFiles) {
a(file2);
}
}
file.delete();
}
}
public static <T> List<T> a(T... tArr) {
ArrayList arrayList = new ArrayList();
for (T t : tArr) {
if (t != null) {
arrayList.add(t);
}
}
return arrayList;
}
public static Set<String> a(JSONArray jSONArray) throws JSONException {
HashSet hashSet = new HashSet();
for (int i = 0; i < jSONArray.length(); i++) {
hashSet.add(jSONArray.getString(i));
}
return hashSet;
}
public static void a(JSONObject jSONObject, AttributionIdentifiers attributionIdentifiers, String str, boolean z) throws JSONException {
if (attributionIdentifiers != null && attributionIdentifiers.c() != null) {
jSONObject.put("attribution", attributionIdentifiers.c());
}
if (attributionIdentifiers != null && attributionIdentifiers.a() != null) {
jSONObject.put("advertiser_id", attributionIdentifiers.a());
jSONObject.put("advertiser_tracking_enabled", !attributionIdentifiers.d());
}
if (attributionIdentifiers != null && attributionIdentifiers.b() != null) {
jSONObject.put("installer_package", attributionIdentifiers.b());
}
jSONObject.put("anon_id", str);
jSONObject.put("application_tracking_enabled", !z);
}
public static void a(JSONObject jSONObject, Context context) throws JSONException {
String str;
Locale locale;
int i;
int i2;
WindowManager windowManager;
JSONArray jSONArray = new JSONArray();
jSONArray.put("a2");
e(context);
String packageName = context.getPackageName();
int i3 = -1;
try {
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(packageName, 0);
i3 = packageInfo.versionCode;
str = packageInfo.versionName;
} catch (PackageManager.NameNotFoundException unused) {
str = "";
}
jSONArray.put(packageName);
jSONArray.put(i3);
jSONArray.put(str);
jSONArray.put(Build.VERSION.RELEASE);
jSONArray.put(Build.MODEL);
try {
locale = context.getResources().getConfiguration().locale;
} catch (Exception unused2) {
locale = Locale.getDefault();
}
jSONArray.put(locale.getLanguage() + "_" + locale.getCountry());
jSONArray.put(e);
jSONArray.put(g);
double d2 = 0.0d;
try {
windowManager = (WindowManager) context.getSystemService("window");
} catch (Exception unused3) {
}
if (windowManager != null) {
Display defaultDisplay = windowManager.getDefaultDisplay();
DisplayMetrics displayMetrics = new DisplayMetrics();
defaultDisplay.getMetrics(displayMetrics);
i = displayMetrics.widthPixels;
try {
i2 = displayMetrics.heightPixels;
try {
d2 = displayMetrics.density;
} catch (Exception unused4) {
}
} catch (Exception unused5) {
}
jSONArray.put(i);
jSONArray.put(i2);
jSONArray.put(String.format("%.2f", Double.valueOf(d2)));
jSONArray.put(c());
jSONArray.put(c);
jSONArray.put(d);
jSONArray.put(f);
jSONObject.put("extinfo", jSONArray.toString());
}
i = 0;
i2 = 0;
jSONArray.put(i);
jSONArray.put(i2);
jSONArray.put(String.format("%.2f", Double.valueOf(d2)));
jSONArray.put(c());
jSONArray.put(c);
jSONArray.put(d);
jSONArray.put(f);
jSONObject.put("extinfo", jSONArray.toString());
}
public static Method a(Class<?> cls, String str, Class<?>... clsArr) {
try {
return cls.getMethod(str, clsArr);
} catch (NoSuchMethodException unused) {
return null;
}
}
public static Method a(String str, String str2, Class<?>... clsArr) {
try {
return a(Class.forName(str), str2, clsArr);
} catch (ClassNotFoundException unused) {
return null;
}
}
public static Object a(Object obj, Method method, Object... objArr) {
try {
return method.invoke(obj, objArr);
} catch (IllegalAccessException | InvocationTargetException unused) {
return null;
}
}
public static <T, K> List<K> a(List<T> list, Mapper<T, K> mapper) {
if (list == null) {
return null;
}
ArrayList arrayList = new ArrayList();
Iterator<T> it = list.iterator();
while (it.hasNext()) {
K apply = mapper.apply(it.next());
if (apply != null) {
arrayList.add(apply);
}
}
if (arrayList.size() == 0) {
return null;
}
return arrayList;
}
public static long a(Uri uri) {
Cursor cursor = null;
try {
cursor = FacebookSdk.b().getContentResolver().query(uri, null, null, null, null);
int columnIndex = cursor.getColumnIndex("_size");
cursor.moveToFirst();
return cursor.getLong(columnIndex);
} finally {
if (cursor != null) {
cursor.close();
}
}
}
public static Date a(Bundle bundle, String str, Date date) {
long parseLong;
if (bundle == null) {
return null;
}
Object obj = bundle.get(str);
if (obj instanceof Long) {
parseLong = ((Long) obj).longValue();
} else {
if (!(obj instanceof String)) {
return null;
}
try {
parseLong = Long.parseLong((String) obj);
} catch (NumberFormatException unused) {
return null;
}
}
if (parseLong == 0) {
return new Date(Long.MAX_VALUE);
}
return new Date(date.getTime() + (parseLong * 1000));
}
public static void a(Parcel parcel, Map<String, String> map) {
if (map == null) {
parcel.writeInt(-1);
return;
}
parcel.writeInt(map.size());
for (Map.Entry<String, String> entry : map.entrySet()) {
parcel.writeString(entry.getKey());
parcel.writeString(entry.getValue());
}
}
public static Map<String, String> a(Parcel parcel) {
int readInt = parcel.readInt();
if (readInt < 0) {
return null;
}
HashMap hashMap = new HashMap();
for (int i = 0; i < readInt; i++) {
hashMap.put(parcel.readString(), parcel.readString());
}
return hashMap;
}
public static boolean a(AccessToken accessToken) {
if (accessToken != null) {
return accessToken.equals(AccessToken.getCurrentAccessToken());
}
return false;
}
public static void a(final String str, final GraphMeRequestWithCacheCallback graphMeRequestWithCacheCallback) {
JSONObject a2 = ProfileInformationCache.a(str);
if (a2 != null) {
graphMeRequestWithCacheCallback.a(a2);
return;
}
GraphRequest.Callback callback = new GraphRequest.Callback() { // from class: com.facebook.internal.Utility.1
@Override // com.facebook.GraphRequest.Callback
public void a(GraphResponse graphResponse) {
if (graphResponse.a() != null) {
GraphMeRequestWithCacheCallback.this.a(graphResponse.a().getException());
} else {
ProfileInformationCache.a(str, graphResponse.b());
GraphMeRequestWithCacheCallback.this.a(graphResponse.b());
}
}
};
GraphRequest b2 = b(str);
b2.a(callback);
b2.b();
}
public static JSONObject a(String str) {
JSONObject a2 = ProfileInformationCache.a(str);
if (a2 != null) {
return a2;
}
GraphResponse a3 = b(str).a();
if (a3.a() != null) {
return null;
}
return a3.b();
}
private static boolean a() {
return "mounted".equals(Environment.getExternalStorageState());
}
private static long a(double d2) {
return Math.round(d2 / 1.073741824E9d);
}
public static PermissionsPair a(JSONObject jSONObject) throws JSONException {
String optString;
JSONArray jSONArray = jSONObject.getJSONObject("permissions").getJSONArray("data");
ArrayList arrayList = new ArrayList(jSONArray.length());
ArrayList arrayList2 = new ArrayList(jSONArray.length());
for (int i = 0; i < jSONArray.length(); i++) {
JSONObject optJSONObject = jSONArray.optJSONObject(i);
String optString2 = optJSONObject.optString("permission");
if (optString2 != null && !optString2.equals("installed") && (optString = optJSONObject.optString(FileDownloadModel.STATUS)) != null) {
if (optString.equals("granted")) {
arrayList.add(optString2);
} else if (optString.equals("declined")) {
arrayList2.add(optString2);
}
}
}
return new PermissionsPair(arrayList, arrayList2);
}
public static String a(int i) {
return new BigInteger(i * 5, new Random()).toString(32);
}
}

View File

@@ -0,0 +1,171 @@
package com.facebook.internal;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.util.Log;
import com.facebook.CustomTabActivity;
import com.facebook.FacebookSdk;
import com.facebook.FacebookSdkNotInitializedException;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
/* loaded from: classes.dex */
public final class Validate {
private static final String a = "com.facebook.internal.Validate";
public static void a(Object obj, String str) {
if (obj != null) {
return;
}
throw new NullPointerException("Argument '" + str + "' cannot be null");
}
public static <T> void b(Collection<T> collection, String str) {
if (collection.isEmpty()) {
throw new IllegalArgumentException("Container '" + str + "' cannot be empty");
}
}
public static <T> void c(Collection<T> collection, String str) {
a((Collection) collection, str);
b(collection, str);
}
public static void d(Context context) {
b(context, true);
}
public static <T> void a(Collection<T> collection, String str) {
a((Object) collection, str);
Iterator<T> it = collection.iterator();
while (it.hasNext()) {
if (it.next() == null) {
throw new NullPointerException("Container '" + str + "' cannot contain null values");
}
}
}
public static String b() {
String g = FacebookSdk.g();
if (g != null) {
return g;
}
throw new IllegalStateException("No Client Token found, please set the Client Token.");
}
public static void c() {
if (!FacebookSdk.o()) {
throw new FacebookSdkNotInitializedException("The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first.");
}
}
public static void a(String str, String str2) {
if (Utility.c(str)) {
throw new IllegalArgumentException("Argument '" + str2 + "' cannot be null or empty");
}
}
public static void b(Context context, boolean z) {
a(context, "context");
if (context.checkCallingOrSelfPermission("android.permission.INTERNET") == -1) {
if (!z) {
Log.w(a, "No internet permissions granted for the app, please add <uses-permission android:name=\"android.permission.INTERNET\" /> to your AndroidManifest.xml.");
return;
}
throw new IllegalStateException("No internet permissions granted for the app, please add <uses-permission android:name=\"android.permission.INTERNET\" /> to your AndroidManifest.xml.");
}
}
public static void c(Context context) {
a(context, true);
}
public static String a() {
String c = FacebookSdk.c();
if (c != null) {
return c;
}
throw new IllegalStateException("No App ID found, please set the App ID.");
}
/* JADX WARN: Removed duplicated region for block: B:14:0x002b A[ORIG_RETURN, RETURN] */
/* JADX WARN: Removed duplicated region for block: B:7:0x001b */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public static void a(android.content.Context r3, boolean r4) {
/*
java.lang.String r0 = "context"
a(r3, r0)
android.content.pm.PackageManager r0 = r3.getPackageManager()
if (r0 == 0) goto L18
android.content.ComponentName r1 = new android.content.ComponentName
java.lang.Class<com.facebook.FacebookActivity> r2 = com.facebook.FacebookActivity.class
r1.<init>(r3, r2)
r3 = 1
android.content.pm.ActivityInfo r3 = r0.getActivityInfo(r1, r3) // Catch: android.content.pm.PackageManager.NameNotFoundException -> L18
goto L19
L18:
r3 = 0
L19:
if (r3 != 0) goto L2b
java.lang.String r3 = "FacebookActivity is not declared in the AndroidManifest.xml, please add com.facebook.FacebookActivity to your AndroidManifest.xml file. See https://developers.facebook.com/docs/android/getting-started for more info."
if (r4 != 0) goto L25
java.lang.String r4 = com.facebook.internal.Validate.a
android.util.Log.w(r4, r3)
goto L2b
L25:
java.lang.IllegalStateException r4 = new java.lang.IllegalStateException
r4.<init>(r3)
throw r4
L2b:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.internal.Validate.a(android.content.Context, boolean):void");
}
public static boolean b(Context context) {
List<ResolveInfo> list;
a(context, "context");
PackageManager packageManager = context.getPackageManager();
if (packageManager != null) {
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
intent.addCategory("android.intent.category.BROWSABLE");
intent.setData(Uri.parse("fb" + FacebookSdk.c() + "://authorize"));
list = packageManager.queryIntentActivities(intent, 64);
} else {
list = null;
}
if (list == null) {
return false;
}
Iterator<ResolveInfo> it = list.iterator();
boolean z = false;
while (it.hasNext()) {
if (!it.next().activityInfo.name.equals(CustomTabActivity.class.getName())) {
return false;
}
z = true;
}
return z;
}
public static void a(Context context) {
a(context, "context");
String a2 = a();
PackageManager packageManager = context.getPackageManager();
if (packageManager != null) {
String str = "com.facebook.app.FacebookContentProvider" + a2;
if (packageManager.resolveContentProvider(str, 0) == null) {
throw new IllegalStateException(String.format("A ContentProvider for this app was not set up in the AndroidManifest.xml, please add %s as a provider to your AndroidManifest.xml file. See https://developers.facebook.com/docs/sharing/android for more info.", str));
}
}
}
}

View File

@@ -0,0 +1,647 @@
package com.facebook.internal;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.net.Uri;
import android.net.http.SslError;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.webkit.SslErrorHandler;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.facebook.AccessToken;
import com.facebook.FacebookDialogException;
import com.facebook.FacebookException;
import com.facebook.FacebookGraphResponseException;
import com.facebook.FacebookOperationCanceledException;
import com.facebook.FacebookRequestError;
import com.facebook.FacebookSdk;
import com.facebook.GraphRequest;
import com.facebook.GraphResponse;
import com.facebook.R$drawable;
import com.facebook.R$string;
import com.facebook.share.internal.ShareInternalUtility;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CountDownLatch;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes.dex */
public class WebDialog extends Dialog {
private String a;
private String b;
private OnCompleteListener c;
private WebView d;
private ProgressDialog e;
private ImageView f;
private FrameLayout g;
private UploadStagingResourcesTask h;
private boolean i;
private boolean j;
private boolean k;
public static class Builder {
private Context a;
private String b;
private String c;
private int d;
private OnCompleteListener e;
private Bundle f;
private AccessToken g;
public Builder(Context context, String str, Bundle bundle) {
this.g = AccessToken.getCurrentAccessToken();
if (this.g == null) {
String c = Utility.c(context);
if (c == null) {
throw new FacebookException("Attempted to create a builder without a valid access token or a valid default Application ID.");
}
this.b = c;
}
a(context, str, bundle);
}
public Builder a(OnCompleteListener onCompleteListener) {
this.e = onCompleteListener;
return this;
}
public String b() {
return this.b;
}
public Context c() {
return this.a;
}
public OnCompleteListener d() {
return this.e;
}
public Bundle e() {
return this.f;
}
public int f() {
return this.d;
}
public WebDialog a() {
AccessToken accessToken = this.g;
if (accessToken != null) {
this.f.putString("app_id", accessToken.getApplicationId());
this.f.putString(AccessToken.ACCESS_TOKEN_KEY, this.g.getToken());
} else {
this.f.putString("app_id", this.b);
}
return new WebDialog(this.a, this.c, this.f, this.d, this.e);
}
public Builder(Context context, String str, String str2, Bundle bundle) {
str = str == null ? Utility.c(context) : str;
Validate.a(str, "applicationId");
this.b = str;
a(context, str2, bundle);
}
private void a(Context context, String str, Bundle bundle) {
this.a = context;
this.c = str;
if (bundle != null) {
this.f = bundle;
} else {
this.f = new Bundle();
}
}
}
private class DialogWebViewClient extends WebViewClient {
private DialogWebViewClient() {
}
@Override // android.webkit.WebViewClient
public void onPageFinished(WebView webView, String str) {
super.onPageFinished(webView, str);
if (!WebDialog.this.j) {
WebDialog.this.e.dismiss();
}
WebDialog.this.g.setBackgroundColor(0);
WebDialog.this.d.setVisibility(0);
WebDialog.this.f.setVisibility(0);
WebDialog.this.k = true;
}
@Override // android.webkit.WebViewClient
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
Utility.a("FacebookSDK.WebDialog", "Webview loading URL: " + str);
super.onPageStarted(webView, str, bitmap);
if (WebDialog.this.j) {
return;
}
WebDialog.this.e.show();
}
@Override // android.webkit.WebViewClient
public void onReceivedError(WebView webView, int i, String str, String str2) {
super.onReceivedError(webView, i, str, str2);
WebDialog.this.a(new FacebookDialogException(str, i, str2));
}
@Override // android.webkit.WebViewClient
public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
super.onReceivedSslError(webView, sslErrorHandler, sslError);
sslErrorHandler.cancel();
WebDialog.this.a(new FacebookDialogException(null, -11, null));
}
/* JADX WARN: Removed duplicated region for block: B:30:0x0090 */
/* JADX WARN: Removed duplicated region for block: B:31:0x0096 */
@Override // android.webkit.WebViewClient
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public boolean shouldOverrideUrlLoading(android.webkit.WebView r6, java.lang.String r7) {
/*
r5 = this;
java.lang.StringBuilder r6 = new java.lang.StringBuilder
r6.<init>()
java.lang.String r0 = "Redirect URL: "
r6.append(r0)
r6.append(r7)
java.lang.String r6 = r6.toString()
java.lang.String r0 = "FacebookSDK.WebDialog"
com.facebook.internal.Utility.a(r0, r6)
com.facebook.internal.WebDialog r6 = com.facebook.internal.WebDialog.this
java.lang.String r6 = com.facebook.internal.WebDialog.a(r6)
boolean r6 = r7.startsWith(r6)
r0 = 1
if (r6 == 0) goto La6
com.facebook.internal.WebDialog r6 = com.facebook.internal.WebDialog.this
android.os.Bundle r6 = r6.a(r7)
java.lang.String r7 = "error"
java.lang.String r7 = r6.getString(r7)
if (r7 != 0) goto L37
java.lang.String r7 = "error_type"
java.lang.String r7 = r6.getString(r7)
L37:
java.lang.String r1 = "error_msg"
java.lang.String r1 = r6.getString(r1)
if (r1 != 0) goto L45
java.lang.String r1 = "error_message"
java.lang.String r1 = r6.getString(r1)
L45:
if (r1 != 0) goto L4d
java.lang.String r1 = "error_description"
java.lang.String r1 = r6.getString(r1)
L4d:
java.lang.String r2 = "error_code"
java.lang.String r2 = r6.getString(r2)
boolean r3 = com.facebook.internal.Utility.c(r2)
r4 = -1
if (r3 != 0) goto L5f
int r2 = java.lang.Integer.parseInt(r2) // Catch: java.lang.NumberFormatException -> L5f
goto L60
L5f:
r2 = -1
L60:
boolean r3 = com.facebook.internal.Utility.c(r7)
if (r3 == 0) goto L74
boolean r3 = com.facebook.internal.Utility.c(r1)
if (r3 == 0) goto L74
if (r2 != r4) goto L74
com.facebook.internal.WebDialog r7 = com.facebook.internal.WebDialog.this
r7.a(r6)
goto La5
L74:
if (r7 == 0) goto L8c
java.lang.String r6 = "access_denied"
boolean r6 = r7.equals(r6)
if (r6 != 0) goto L86
java.lang.String r6 = "OAuthAccessDeniedException"
boolean r6 = r7.equals(r6)
if (r6 == 0) goto L8c
L86:
com.facebook.internal.WebDialog r6 = com.facebook.internal.WebDialog.this
r6.cancel()
goto La5
L8c:
r6 = 4201(0x1069, float:5.887E-42)
if (r2 != r6) goto L96
com.facebook.internal.WebDialog r6 = com.facebook.internal.WebDialog.this
r6.cancel()
goto La5
L96:
com.facebook.FacebookRequestError r6 = new com.facebook.FacebookRequestError
r6.<init>(r2, r7, r1)
com.facebook.internal.WebDialog r7 = com.facebook.internal.WebDialog.this
com.facebook.FacebookServiceException r2 = new com.facebook.FacebookServiceException
r2.<init>(r6, r1)
r7.a(r2)
La5:
return r0
La6:
java.lang.String r6 = "fbconnect://cancel"
boolean r6 = r7.startsWith(r6)
if (r6 == 0) goto Lb4
com.facebook.internal.WebDialog r6 = com.facebook.internal.WebDialog.this
r6.cancel()
return r0
Lb4:
java.lang.String r6 = "touch"
boolean r6 = r7.contains(r6)
r1 = 0
if (r6 == 0) goto Lbe
return r1
Lbe:
com.facebook.internal.WebDialog r6 = com.facebook.internal.WebDialog.this // Catch: android.content.ActivityNotFoundException -> Ld3
android.content.Context r6 = r6.getContext() // Catch: android.content.ActivityNotFoundException -> Ld3
android.content.Intent r2 = new android.content.Intent // Catch: android.content.ActivityNotFoundException -> Ld3
java.lang.String r3 = "android.intent.action.VIEW"
android.net.Uri r7 = android.net.Uri.parse(r7) // Catch: android.content.ActivityNotFoundException -> Ld3
r2.<init>(r3, r7) // Catch: android.content.ActivityNotFoundException -> Ld3
r6.startActivity(r2) // Catch: android.content.ActivityNotFoundException -> Ld3
return r0
Ld3:
return r1
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.internal.WebDialog.DialogWebViewClient.shouldOverrideUrlLoading(android.webkit.WebView, java.lang.String):boolean");
}
}
public interface OnCompleteListener {
void a(Bundle bundle, FacebookException facebookException);
}
private class UploadStagingResourcesTask extends AsyncTask<Void, Void, String[]> {
private String a;
private Bundle b;
private Exception[] c;
UploadStagingResourcesTask(String str, Bundle bundle) {
this.a = str;
this.b = bundle;
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // android.os.AsyncTask
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public String[] doInBackground(Void... voidArr) {
String[] stringArray = this.b.getStringArray("media");
final String[] strArr = new String[stringArray.length];
this.c = new Exception[stringArray.length];
final CountDownLatch countDownLatch = new CountDownLatch(stringArray.length);
ConcurrentLinkedQueue concurrentLinkedQueue = new ConcurrentLinkedQueue();
AccessToken currentAccessToken = AccessToken.getCurrentAccessToken();
for (final int i = 0; i < stringArray.length; i++) {
try {
if (isCancelled()) {
Iterator it = concurrentLinkedQueue.iterator();
while (it.hasNext()) {
((AsyncTask) it.next()).cancel(true);
}
return null;
}
Uri parse = Uri.parse(stringArray[i]);
if (Utility.e(parse)) {
strArr[i] = parse.toString();
countDownLatch.countDown();
} else {
concurrentLinkedQueue.add(ShareInternalUtility.a(currentAccessToken, parse, new GraphRequest.Callback() { // from class: com.facebook.internal.WebDialog.UploadStagingResourcesTask.1
@Override // com.facebook.GraphRequest.Callback
public void a(GraphResponse graphResponse) {
FacebookRequestError a;
try {
a = graphResponse.a();
} catch (Exception e) {
UploadStagingResourcesTask.this.c[i] = e;
}
if (a != null) {
String errorMessage = a.getErrorMessage();
if (errorMessage == null) {
errorMessage = "Error staging photo.";
}
throw new FacebookGraphResponseException(graphResponse, errorMessage);
}
JSONObject b = graphResponse.b();
if (b == null) {
throw new FacebookException("Error staging photo.");
}
String optString = b.optString("uri");
if (optString == null) {
throw new FacebookException("Error staging photo.");
}
strArr[i] = optString;
countDownLatch.countDown();
}
}).b());
}
} catch (Exception unused) {
Iterator it2 = concurrentLinkedQueue.iterator();
while (it2.hasNext()) {
((AsyncTask) it2.next()).cancel(true);
}
return null;
}
}
countDownLatch.await();
return strArr;
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // android.os.AsyncTask
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public void onPostExecute(String[] strArr) {
WebDialog.this.e.dismiss();
for (Exception exc : this.c) {
if (exc != null) {
WebDialog.this.a(exc);
return;
}
}
if (strArr == null) {
WebDialog.this.a(new FacebookException("Failed to stage photos for web dialog"));
return;
}
List asList = Arrays.asList(strArr);
if (asList.contains(null)) {
WebDialog.this.a(new FacebookException("Failed to stage photos for web dialog"));
return;
}
Utility.a(this.b, "media", new JSONArray((Collection) asList));
WebDialog.this.a = Utility.a(ServerProtocol.b(), FacebookSdk.j() + "/dialog/" + this.a, this.b).toString();
WebDialog.this.a((WebDialog.this.f.getDrawable().getIntrinsicWidth() / 2) + 1);
}
}
public WebDialog(Context context, String str) {
this(context, str, FacebookSdk.m());
}
private int a(int i, float f, int i2, int i3) {
int i4 = (int) (i / f);
double d = 0.5d;
if (i4 <= i2) {
d = 1.0d;
} else if (i4 < i3) {
d = 0.5d + (((i3 - i4) / (i3 - i2)) * 0.5d);
}
return (int) (i * d);
}
@Override // android.app.Dialog, android.content.DialogInterface
public void cancel() {
if (this.c == null || this.i) {
return;
}
a(new FacebookOperationCanceledException());
}
@Override // android.app.Dialog, android.content.DialogInterface
public void dismiss() {
ProgressDialog progressDialog;
WebView webView = this.d;
if (webView != null) {
webView.stopLoading();
}
if (!this.j && (progressDialog = this.e) != null && progressDialog.isShowing()) {
this.e.dismiss();
}
super.dismiss();
}
@Override // android.app.Dialog, android.view.Window.Callback
public void onAttachedToWindow() {
this.j = false;
super.onAttachedToWindow();
}
@Override // android.app.Dialog
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.e = new ProgressDialog(getContext());
this.e.requestWindowFeature(1);
this.e.setMessage(getContext().getString(R$string.com_facebook_loading));
this.e.setCanceledOnTouchOutside(false);
this.e.setOnCancelListener(new DialogInterface.OnCancelListener() { // from class: com.facebook.internal.WebDialog.1
@Override // android.content.DialogInterface.OnCancelListener
public void onCancel(DialogInterface dialogInterface) {
WebDialog.this.cancel();
}
});
requestWindowFeature(1);
this.g = new FrameLayout(getContext());
d();
getWindow().setGravity(17);
getWindow().setSoftInputMode(16);
e();
if (this.a != null) {
a((this.f.getDrawable().getIntrinsicWidth() / 2) + 1);
}
this.g.addView(this.f, new ViewGroup.LayoutParams(-2, -2));
setContentView(this.g);
}
@Override // android.app.Dialog, android.view.Window.Callback
public void onDetachedFromWindow() {
this.j = true;
super.onDetachedFromWindow();
}
@Override // android.app.Dialog, android.view.KeyEvent.Callback
public boolean onKeyDown(int i, KeyEvent keyEvent) {
if (i == 4) {
cancel();
}
return super.onKeyDown(i, keyEvent);
}
@Override // android.app.Dialog
protected void onStart() {
super.onStart();
UploadStagingResourcesTask uploadStagingResourcesTask = this.h;
if (uploadStagingResourcesTask == null || uploadStagingResourcesTask.getStatus() != AsyncTask.Status.PENDING) {
d();
} else {
this.h.execute(new Void[0]);
this.e.show();
}
}
@Override // android.app.Dialog
protected void onStop() {
UploadStagingResourcesTask uploadStagingResourcesTask = this.h;
if (uploadStagingResourcesTask != null) {
uploadStagingResourcesTask.cancel(true);
this.e.dismiss();
}
super.onStop();
}
public WebDialog(Context context, String str, int i) {
super(context, i == 0 ? FacebookSdk.m() : i);
this.b = "fbconnect://success";
this.i = false;
this.j = false;
this.k = false;
this.a = str;
}
private void e() {
this.f = new ImageView(getContext());
this.f.setOnClickListener(new View.OnClickListener() { // from class: com.facebook.internal.WebDialog.2
@Override // android.view.View.OnClickListener
public void onClick(View view) {
WebDialog.this.cancel();
}
});
this.f.setImageDrawable(getContext().getResources().getDrawable(R$drawable.com_facebook_close));
this.f.setVisibility(4);
}
protected void b(String str) {
this.b = str;
}
protected boolean c() {
return this.k;
}
public void d() {
Display defaultDisplay = ((WindowManager) getContext().getSystemService("window")).getDefaultDisplay();
DisplayMetrics displayMetrics = new DisplayMetrics();
defaultDisplay.getMetrics(displayMetrics);
int i = displayMetrics.widthPixels;
int i2 = displayMetrics.heightPixels;
if (i >= i2) {
i = i2;
}
int i3 = displayMetrics.widthPixels;
int i4 = displayMetrics.heightPixels;
if (i3 < i4) {
i3 = i4;
}
getWindow().setLayout(Math.min(a(i, displayMetrics.density, 480, 800), displayMetrics.widthPixels), Math.min(a(i3, displayMetrics.density, 800, 1280), displayMetrics.heightPixels));
}
protected boolean b() {
return this.i;
}
public void a(OnCompleteListener onCompleteListener) {
this.c = onCompleteListener;
}
protected Bundle a(String str) {
Uri parse = Uri.parse(str);
Bundle d = Utility.d(parse.getQuery());
d.putAll(Utility.d(parse.getFragment()));
return d;
}
public WebDialog(Context context, String str, Bundle bundle, int i, OnCompleteListener onCompleteListener) {
super(context, i == 0 ? FacebookSdk.m() : i);
this.b = "fbconnect://success";
this.i = false;
this.j = false;
this.k = false;
bundle = bundle == null ? new Bundle() : bundle;
bundle.putString("redirect_uri", "fbconnect://success");
bundle.putString("display", "touch");
bundle.putString("sdk", String.format(Locale.ROOT, "android-%s", FacebookSdk.l()));
this.c = onCompleteListener;
if (str.equals("share") && bundle.containsKey("media")) {
this.h = new UploadStagingResourcesTask(str, bundle);
return;
}
this.a = Utility.a(ServerProtocol.b(), FacebookSdk.j() + "/dialog/" + str, bundle).toString();
}
protected WebView a() {
return this.d;
}
protected void a(Bundle bundle) {
OnCompleteListener onCompleteListener = this.c;
if (onCompleteListener == null || this.i) {
return;
}
this.i = true;
onCompleteListener.a(bundle, null);
dismiss();
}
protected void a(Throwable th) {
FacebookException facebookException;
if (this.c == null || this.i) {
return;
}
this.i = true;
if (th instanceof FacebookException) {
facebookException = (FacebookException) th;
} else {
facebookException = new FacebookException(th);
}
this.c.a(null, facebookException);
dismiss();
}
/* JADX INFO: Access modifiers changed from: private */
@SuppressLint({"SetJavaScriptEnabled"})
public void a(int i) {
LinearLayout linearLayout = new LinearLayout(getContext());
this.d = new WebView(this, getContext().getApplicationContext()) { // from class: com.facebook.internal.WebDialog.3
@Override // android.webkit.WebView, android.view.View
public void onWindowFocusChanged(boolean z) {
try {
super.onWindowFocusChanged(z);
} catch (NullPointerException unused) {
}
}
};
this.d.setVerticalScrollBarEnabled(false);
this.d.setHorizontalScrollBarEnabled(false);
this.d.setWebViewClient(new DialogWebViewClient());
this.d.getSettings().setJavaScriptEnabled(true);
this.d.loadUrl(this.a);
this.d.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
this.d.setVisibility(4);
this.d.getSettings().setSavePassword(false);
this.d.getSettings().setSaveFormData(false);
this.d.setFocusable(true);
this.d.setFocusableInTouchMode(true);
this.d.setOnTouchListener(new View.OnTouchListener(this) { // from class: com.facebook.internal.WebDialog.4
@Override // android.view.View.OnTouchListener
public boolean onTouch(View view, MotionEvent motionEvent) {
if (view.hasFocus()) {
return false;
}
view.requestFocus();
return false;
}
});
linearLayout.setPadding(i, i, i, i);
linearLayout.addView(this.d);
linearLayout.setBackgroundColor(-872415232);
this.g.addView(linearLayout);
}
}

View File

@@ -0,0 +1,250 @@
package com.facebook.login;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.fragment.app.FragmentActivity;
import com.facebook.AccessTokenSource;
import com.facebook.CustomTabMainActivity;
import com.facebook.FacebookOperationCanceledException;
import com.facebook.FacebookSdk;
import com.facebook.internal.FetchedAppSettings;
import com.facebook.internal.FetchedAppSettingsManager;
import com.facebook.internal.Utility;
import com.facebook.internal.Validate;
import com.facebook.login.LoginClient;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
public class CustomTabLoginMethodHandler extends WebLoginMethodHandler {
private static final int API_EC_DIALOG_CANCEL = 4201;
private static final int CHALLENGE_LENGTH = 20;
private static final String[] CHROME_PACKAGES = {"com.android.chrome", "com.chrome.beta", "com.chrome.dev"};
public static final Parcelable.Creator<CustomTabLoginMethodHandler> CREATOR = new Parcelable.Creator() { // from class: com.facebook.login.CustomTabLoginMethodHandler.1
@Override // android.os.Parcelable.Creator
public CustomTabLoginMethodHandler createFromParcel(Parcel parcel) {
return new CustomTabLoginMethodHandler(parcel);
}
@Override // android.os.Parcelable.Creator
public CustomTabLoginMethodHandler[] newArray(int i) {
return new CustomTabLoginMethodHandler[i];
}
};
private static final String CUSTOM_TABS_SERVICE_ACTION = "android.support.customtabs.action.CustomTabsService";
private static final int CUSTOM_TAB_REQUEST_CODE = 1;
private String currentPackage;
private String expectedChallenge;
CustomTabLoginMethodHandler(LoginClient loginClient) {
super(loginClient);
this.expectedChallenge = Utility.a(20);
}
private String getChromePackage() {
String str = this.currentPackage;
if (str != null) {
return str;
}
FragmentActivity activity = this.loginClient.getActivity();
List<ResolveInfo> queryIntentServices = activity.getPackageManager().queryIntentServices(new Intent(CUSTOM_TABS_SERVICE_ACTION), 0);
if (queryIntentServices == null) {
return null;
}
HashSet hashSet = new HashSet(Arrays.asList(CHROME_PACKAGES));
Iterator<ResolveInfo> it = queryIntentServices.iterator();
while (it.hasNext()) {
ServiceInfo serviceInfo = it.next().serviceInfo;
if (serviceInfo != null && hashSet.contains(serviceInfo.packageName)) {
this.currentPackage = serviceInfo.packageName;
return this.currentPackage;
}
}
return null;
}
private boolean isCustomTabsAllowed() {
return isCustomTabsEnabled() && getChromePackage() != null && Validate.b(FacebookSdk.b());
}
private boolean isCustomTabsEnabled() {
FetchedAppSettings c = FetchedAppSettingsManager.c(Utility.c(this.loginClient.getActivity()));
return c != null && c.b();
}
/* JADX WARN: Removed duplicated region for block: B:36:0x009d */
/* JADX WARN: Removed duplicated region for block: B:38:0x00a6 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
private void onCustomTabComplete(java.lang.String r7, com.facebook.login.LoginClient.Request r8) {
/*
r6 = this;
if (r7 == 0) goto Lb3
java.lang.String r0 = com.facebook.CustomTabMainActivity.a()
boolean r0 = r7.startsWith(r0)
if (r0 == 0) goto Lb3
android.net.Uri r7 = android.net.Uri.parse(r7)
java.lang.String r0 = r7.getQuery()
android.os.Bundle r0 = com.facebook.internal.Utility.d(r0)
java.lang.String r7 = r7.getFragment()
android.os.Bundle r7 = com.facebook.internal.Utility.d(r7)
r0.putAll(r7)
boolean r7 = r6.validateChallengeParam(r0)
r1 = 0
if (r7 != 0) goto L35
com.facebook.FacebookException r7 = new com.facebook.FacebookException
java.lang.String r0 = "Invalid state parameter"
r7.<init>(r0)
super.onComplete(r8, r1, r7)
return
L35:
java.lang.String r7 = "error"
java.lang.String r7 = r0.getString(r7)
if (r7 != 0) goto L43
java.lang.String r7 = "error_type"
java.lang.String r7 = r0.getString(r7)
L43:
java.lang.String r2 = "error_msg"
java.lang.String r2 = r0.getString(r2)
if (r2 != 0) goto L51
java.lang.String r2 = "error_message"
java.lang.String r2 = r0.getString(r2)
L51:
if (r2 != 0) goto L59
java.lang.String r2 = "error_description"
java.lang.String r2 = r0.getString(r2)
L59:
java.lang.String r3 = "error_code"
java.lang.String r3 = r0.getString(r3)
boolean r4 = com.facebook.internal.Utility.c(r3)
r5 = -1
if (r4 != 0) goto L6b
int r3 = java.lang.Integer.parseInt(r3) // Catch: java.lang.NumberFormatException -> L6b
goto L6c
L6b:
r3 = -1
L6c:
boolean r4 = com.facebook.internal.Utility.c(r7)
if (r4 == 0) goto L7e
boolean r4 = com.facebook.internal.Utility.c(r2)
if (r4 == 0) goto L7e
if (r3 != r5) goto L7e
super.onComplete(r8, r0, r1)
goto Lb3
L7e:
if (r7 == 0) goto L99
java.lang.String r0 = "access_denied"
boolean r0 = r7.equals(r0)
if (r0 != 0) goto L90
java.lang.String r0 = "OAuthAccessDeniedException"
boolean r0 = r7.equals(r0)
if (r0 == 0) goto L99
L90:
com.facebook.FacebookOperationCanceledException r7 = new com.facebook.FacebookOperationCanceledException
r7.<init>()
super.onComplete(r8, r1, r7)
goto Lb3
L99:
r0 = 4201(0x1069, float:5.887E-42)
if (r3 != r0) goto La6
com.facebook.FacebookOperationCanceledException r7 = new com.facebook.FacebookOperationCanceledException
r7.<init>()
super.onComplete(r8, r1, r7)
goto Lb3
La6:
com.facebook.FacebookRequestError r0 = new com.facebook.FacebookRequestError
r0.<init>(r3, r7, r2)
com.facebook.FacebookServiceException r7 = new com.facebook.FacebookServiceException
r7.<init>(r0, r2)
super.onComplete(r8, r1, r7)
Lb3:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.facebook.login.CustomTabLoginMethodHandler.onCustomTabComplete(java.lang.String, com.facebook.login.LoginClient$Request):void");
}
private boolean validateChallengeParam(Bundle bundle) {
try {
String string = bundle.getString("state");
if (string == null) {
return false;
}
return new JSONObject(string).getString("7_challenge").equals(this.expectedChallenge);
} catch (JSONException unused) {
return false;
}
}
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
@Override // com.facebook.login.LoginMethodHandler
String getNameForLogging() {
return "custom_tab";
}
@Override // com.facebook.login.WebLoginMethodHandler
protected String getSSODevice() {
return "chrome_custom_tab";
}
@Override // com.facebook.login.WebLoginMethodHandler
AccessTokenSource getTokenSource() {
return AccessTokenSource.CHROME_CUSTOM_TAB;
}
@Override // com.facebook.login.LoginMethodHandler
boolean onActivityResult(int i, int i2, Intent intent) {
if (i != 1) {
return super.onActivityResult(i, i2, intent);
}
LoginClient.Request pendingRequest = this.loginClient.getPendingRequest();
if (i2 == -1) {
onCustomTabComplete(intent.getStringExtra(CustomTabMainActivity.e), pendingRequest);
return true;
}
super.onComplete(pendingRequest, null, new FacebookOperationCanceledException());
return false;
}
@Override // com.facebook.login.LoginMethodHandler
protected void putChallengeParam(JSONObject jSONObject) throws JSONException {
jSONObject.put("7_challenge", this.expectedChallenge);
}
@Override // com.facebook.login.LoginMethodHandler
boolean tryAuthorize(LoginClient.Request request) {
if (!isCustomTabsAllowed()) {
return false;
}
Bundle addExtraParameters = addExtraParameters(getParameters(request), request);
Intent intent = new Intent(this.loginClient.getActivity(), (Class<?>) CustomTabMainActivity.class);
intent.putExtra(CustomTabMainActivity.c, addExtraParameters);
intent.putExtra(CustomTabMainActivity.d, getChromePackage());
this.loginClient.getFragment().startActivityForResult(intent, 1);
return true;
}
@Override // com.facebook.login.LoginMethodHandler, android.os.Parcelable
public void writeToParcel(Parcel parcel, int i) {
super.writeToParcel(parcel, i);
parcel.writeString(this.expectedChallenge);
}
CustomTabLoginMethodHandler(Parcel parcel) {
super(parcel);
this.expectedChallenge = parcel.readString();
}
}

View File

@@ -0,0 +1,19 @@
package com.facebook.login;
/* loaded from: classes.dex */
public enum DefaultAudience {
NONE(null),
ONLY_ME("only_me"),
FRIENDS("friends"),
EVERYONE("everyone");
private final String nativeProtocolAudience;
DefaultAudience(String str) {
this.nativeProtocolAudience = str;
}
public String getNativeProtocolAudience() {
return this.nativeProtocolAudience;
}
}

View File

@@ -0,0 +1,394 @@
package com.facebook.login;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.Html;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.fragment.app.DialogFragment;
import com.facebook.AccessToken;
import com.facebook.AccessTokenSource;
import com.facebook.FacebookActivity;
import com.facebook.FacebookException;
import com.facebook.FacebookRequestError;
import com.facebook.FacebookSdk;
import com.facebook.GraphRequest;
import com.facebook.GraphRequestAsyncTask;
import com.facebook.GraphResponse;
import com.facebook.HttpMethod;
import com.facebook.R$id;
import com.facebook.R$layout;
import com.facebook.R$string;
import com.facebook.R$style;
import com.facebook.appevents.AppEventsLogger;
import com.facebook.devicerequests.internal.DeviceRequestsHelper;
import com.facebook.internal.FetchedAppSettingsManager;
import com.facebook.internal.SmartLoginOption;
import com.facebook.internal.Utility;
import com.facebook.internal.Validate;
import com.facebook.login.LoginClient;
import com.ubt.jimu.base.entities.Course;
import com.ubt.jimu.controller.data.widget.JockstickDataConverter;
import com.unity3d.ads.metadata.MediationMetaData;
import java.util.Date;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
public class DeviceAuthDialog extends DialogFragment {
private ProgressBar j;
private TextView k;
private DeviceAuthMethodHandler l;
private volatile GraphRequestAsyncTask n;
private volatile ScheduledFuture o;
private volatile RequestState p;
private Dialog q;
private AtomicBoolean m = new AtomicBoolean();
private boolean r = false;
private boolean s = false;
private LoginClient.Request t = null;
private static class RequestState implements Parcelable {
public static final Parcelable.Creator<RequestState> CREATOR = new Parcelable.Creator<RequestState>() { // from class: com.facebook.login.DeviceAuthDialog.RequestState.1
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public RequestState createFromParcel(Parcel parcel) {
return new RequestState(parcel);
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public RequestState[] newArray(int i) {
return new RequestState[i];
}
};
private long interval;
private long lastPoll;
private String requestCode;
private String userCode;
RequestState() {
}
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
public long getInterval() {
return this.interval;
}
public String getRequestCode() {
return this.requestCode;
}
public String getUserCode() {
return this.userCode;
}
public void setInterval(long j) {
this.interval = j;
}
public void setLastPoll(long j) {
this.lastPoll = j;
}
public void setRequestCode(String str) {
this.requestCode = str;
}
public void setUserCode(String str) {
this.userCode = str;
}
public boolean withinLastRefreshWindow() {
return this.lastPoll != 0 && (new Date().getTime() - this.lastPoll) - (this.interval * 1000) < 0;
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel parcel, int i) {
parcel.writeString(this.userCode);
parcel.writeString(this.requestCode);
parcel.writeLong(this.interval);
parcel.writeLong(this.lastPoll);
}
protected RequestState(Parcel parcel) {
this.userCode = parcel.readString();
this.requestCode = parcel.readString();
this.interval = parcel.readLong();
this.lastPoll = parcel.readLong();
}
}
private GraphRequest o() {
Bundle bundle = new Bundle();
bundle.putString(Course.TYPE_BLOCKLY, this.p.getRequestCode());
return new GraphRequest(null, "device/login_status", bundle, HttpMethod.POST, new GraphRequest.Callback() { // from class: com.facebook.login.DeviceAuthDialog.4
@Override // com.facebook.GraphRequest.Callback
public void a(GraphResponse graphResponse) {
if (DeviceAuthDialog.this.m.get()) {
return;
}
FacebookRequestError a = graphResponse.a();
if (a == null) {
try {
DeviceAuthDialog.this.c(graphResponse.b().getString(AccessToken.ACCESS_TOKEN_KEY));
return;
} catch (JSONException e) {
DeviceAuthDialog.this.a(new FacebookException(e));
return;
}
}
int subErrorCode = a.getSubErrorCode();
if (subErrorCode != 1349152) {
switch (subErrorCode) {
case 1349172:
case 1349174:
DeviceAuthDialog.this.x();
break;
case 1349173:
break;
default:
DeviceAuthDialog.this.a(graphResponse.a().getException());
break;
}
return;
}
DeviceAuthDialog.this.q();
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public void q() {
if (this.m.compareAndSet(false, true)) {
if (this.p != null) {
DeviceRequestsHelper.a(this.p.getUserCode());
}
DeviceAuthMethodHandler deviceAuthMethodHandler = this.l;
if (deviceAuthMethodHandler != null) {
deviceAuthMethodHandler.onCancel();
}
this.q.dismiss();
}
}
/* JADX INFO: Access modifiers changed from: private */
public void v() {
this.p.setLastPoll(new Date().getTime());
this.n = o().b();
}
/* JADX INFO: Access modifiers changed from: private */
public void x() {
this.o = DeviceAuthMethodHandler.getBackgroundExecutor().schedule(new Runnable() { // from class: com.facebook.login.DeviceAuthDialog.3
@Override // java.lang.Runnable
public void run() {
DeviceAuthDialog.this.v();
}
}, this.p.getInterval(), TimeUnit.SECONDS);
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
RequestState requestState;
View onCreateView = super.onCreateView(layoutInflater, viewGroup, bundle);
this.l = (DeviceAuthMethodHandler) ((LoginFragment) ((FacebookActivity) getActivity()).D0()).o().getCurrentHandler();
if (bundle != null && (requestState = (RequestState) bundle.getParcelable("request_state")) != null) {
a(requestState);
}
return onCreateView;
}
@Override // androidx.fragment.app.Fragment
public void onDestroy() {
this.r = true;
this.m.set(true);
super.onDestroy();
if (this.n != null) {
this.n.cancel(true);
}
if (this.o != null) {
this.o.cancel(true);
}
}
@Override // androidx.fragment.app.DialogFragment, android.content.DialogInterface.OnDismissListener
public void onDismiss(DialogInterface dialogInterface) {
super.onDismiss(dialogInterface);
if (this.r) {
return;
}
q();
}
@Override // androidx.fragment.app.DialogFragment, androidx.fragment.app.Fragment
public void onSaveInstanceState(Bundle bundle) {
super.onSaveInstanceState(bundle);
if (this.p != null) {
bundle.putParcelable("request_state", this.p);
}
}
/* JADX INFO: Access modifiers changed from: private */
public View c(boolean z) {
LayoutInflater layoutInflater = getActivity().getLayoutInflater();
View inflate = z ? layoutInflater.inflate(R$layout.com_facebook_smart_device_dialog_fragment, (ViewGroup) null) : layoutInflater.inflate(R$layout.com_facebook_device_auth_dialog_fragment, (ViewGroup) null);
this.j = (ProgressBar) inflate.findViewById(R$id.progress_bar);
this.k = (TextView) inflate.findViewById(R$id.confirmation_code);
((Button) inflate.findViewById(R$id.cancel_button)).setOnClickListener(new View.OnClickListener() { // from class: com.facebook.login.DeviceAuthDialog.2
@Override // android.view.View.OnClickListener
public void onClick(View view) {
DeviceAuthDialog.this.q();
}
});
((TextView) inflate.findViewById(R$id.com_facebook_device_auth_instructions)).setText(Html.fromHtml(getString(R$string.com_facebook_device_auth_instructions)));
return inflate;
}
@Override // androidx.fragment.app.DialogFragment
public Dialog a(Bundle bundle) {
this.q = new Dialog(getActivity(), R$style.com_facebook_auth_dialog);
getActivity().getLayoutInflater();
this.q.setContentView(c(DeviceRequestsHelper.b() && !this.s));
return this.q;
}
/* JADX INFO: Access modifiers changed from: private */
public void c(final String str) {
Bundle bundle = new Bundle();
bundle.putString("fields", "id,permissions,name");
new GraphRequest(new AccessToken(str, FacebookSdk.c(), "0", null, null, null, null, null), "me", bundle, HttpMethod.GET, new GraphRequest.Callback() { // from class: com.facebook.login.DeviceAuthDialog.7
@Override // com.facebook.GraphRequest.Callback
public void a(GraphResponse graphResponse) {
if (DeviceAuthDialog.this.m.get()) {
return;
}
if (graphResponse.a() != null) {
DeviceAuthDialog.this.a(graphResponse.a().getException());
return;
}
try {
JSONObject b = graphResponse.b();
String string = b.getString(JockstickDataConverter.ID);
Utility.PermissionsPair a = Utility.a(b);
String string2 = b.getString(MediationMetaData.KEY_NAME);
DeviceRequestsHelper.a(DeviceAuthDialog.this.p.getUserCode());
if (!FetchedAppSettingsManager.c(FacebookSdk.c()).f().contains(SmartLoginOption.RequireConfirm) || DeviceAuthDialog.this.s) {
DeviceAuthDialog.this.a(string, a, str);
} else {
DeviceAuthDialog.this.s = true;
DeviceAuthDialog.this.a(string, a, str, string2);
}
} catch (JSONException e) {
DeviceAuthDialog.this.a(new FacebookException(e));
}
}
}).b();
}
public void a(LoginClient.Request request) {
this.t = request;
Bundle bundle = new Bundle();
bundle.putString("scope", TextUtils.join(",", request.getPermissions()));
String deviceRedirectUriString = request.getDeviceRedirectUriString();
if (deviceRedirectUriString != null) {
bundle.putString("redirect_uri", deviceRedirectUriString);
}
bundle.putString(AccessToken.ACCESS_TOKEN_KEY, Validate.a() + "|" + Validate.b());
bundle.putString("device_info", DeviceRequestsHelper.a());
new GraphRequest(null, "device/login", bundle, HttpMethod.POST, new GraphRequest.Callback() { // from class: com.facebook.login.DeviceAuthDialog.1
@Override // com.facebook.GraphRequest.Callback
public void a(GraphResponse graphResponse) {
if (DeviceAuthDialog.this.r) {
return;
}
if (graphResponse.a() != null) {
DeviceAuthDialog.this.a(graphResponse.a().getException());
return;
}
JSONObject b = graphResponse.b();
RequestState requestState = new RequestState();
try {
requestState.setUserCode(b.getString("user_code"));
requestState.setRequestCode(b.getString(Course.TYPE_BLOCKLY));
requestState.setInterval(b.getLong("interval"));
DeviceAuthDialog.this.a(requestState);
} catch (JSONException e) {
DeviceAuthDialog.this.a(new FacebookException(e));
}
}
}).b();
}
/* JADX INFO: Access modifiers changed from: private */
public void a(RequestState requestState) {
this.p = requestState;
this.k.setText(requestState.getUserCode());
this.k.setVisibility(0);
this.j.setVisibility(8);
if (!this.s && DeviceRequestsHelper.c(requestState.getUserCode())) {
AppEventsLogger.b(getContext()).a("fb_smart_login_service", (Double) null, (Bundle) null);
}
if (requestState.withinLastRefreshWindow()) {
x();
} else {
v();
}
}
/* JADX INFO: Access modifiers changed from: private */
public void a(final String str, final Utility.PermissionsPair permissionsPair, final String str2, String str3) {
String string = getResources().getString(R$string.com_facebook_smart_login_confirmation_title);
String string2 = getResources().getString(R$string.com_facebook_smart_login_confirmation_continue_as);
String string3 = getResources().getString(R$string.com_facebook_smart_login_confirmation_cancel);
String format = String.format(string2, str3);
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setMessage(string).setCancelable(true).setNegativeButton(format, new DialogInterface.OnClickListener() { // from class: com.facebook.login.DeviceAuthDialog.6
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
DeviceAuthDialog.this.a(str, permissionsPair, str2);
}
}).setPositiveButton(string3, new DialogInterface.OnClickListener() { // from class: com.facebook.login.DeviceAuthDialog.5
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
DeviceAuthDialog.this.q.setContentView(DeviceAuthDialog.this.c(false));
DeviceAuthDialog deviceAuthDialog = DeviceAuthDialog.this;
deviceAuthDialog.a(deviceAuthDialog.t);
}
});
builder.create().show();
}
/* JADX INFO: Access modifiers changed from: private */
public void a(String str, Utility.PermissionsPair permissionsPair, String str2) {
this.l.onSuccess(str2, FacebookSdk.c(), str, permissionsPair.b(), permissionsPair.a(), AccessTokenSource.DEVICE_AUTH, null, null);
this.q.dismiss();
}
/* JADX INFO: Access modifiers changed from: private */
public void a(FacebookException facebookException) {
if (this.m.compareAndSet(false, true)) {
if (this.p != null) {
DeviceRequestsHelper.a(this.p.getUserCode());
}
this.l.onError(facebookException);
this.q.dismiss();
}
}
}

View File

@@ -0,0 +1,84 @@
package com.facebook.login;
import android.os.Parcel;
import android.os.Parcelable;
import com.facebook.AccessToken;
import com.facebook.AccessTokenSource;
import com.facebook.login.LoginClient;
import java.util.Collection;
import java.util.Date;
import java.util.concurrent.ScheduledThreadPoolExecutor;
/* loaded from: classes.dex */
class DeviceAuthMethodHandler extends LoginMethodHandler {
public static final Parcelable.Creator<DeviceAuthMethodHandler> CREATOR = new Parcelable.Creator() { // from class: com.facebook.login.DeviceAuthMethodHandler.1
@Override // android.os.Parcelable.Creator
public DeviceAuthMethodHandler createFromParcel(Parcel parcel) {
return new DeviceAuthMethodHandler(parcel);
}
@Override // android.os.Parcelable.Creator
public DeviceAuthMethodHandler[] newArray(int i) {
return new DeviceAuthMethodHandler[i];
}
};
private static ScheduledThreadPoolExecutor backgroundExecutor;
DeviceAuthMethodHandler(LoginClient loginClient) {
super(loginClient);
}
public static synchronized ScheduledThreadPoolExecutor getBackgroundExecutor() {
ScheduledThreadPoolExecutor scheduledThreadPoolExecutor;
synchronized (DeviceAuthMethodHandler.class) {
if (backgroundExecutor == null) {
backgroundExecutor = new ScheduledThreadPoolExecutor(1);
}
scheduledThreadPoolExecutor = backgroundExecutor;
}
return scheduledThreadPoolExecutor;
}
private void showDialog(LoginClient.Request request) {
DeviceAuthDialog deviceAuthDialog = new DeviceAuthDialog();
deviceAuthDialog.a(this.loginClient.getActivity().getSupportFragmentManager(), "login_with_facebook");
deviceAuthDialog.a(request);
}
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
@Override // com.facebook.login.LoginMethodHandler
String getNameForLogging() {
return "device_auth";
}
public void onCancel() {
this.loginClient.completeAndValidate(LoginClient.Result.createCancelResult(this.loginClient.getPendingRequest(), "User canceled log in."));
}
public void onError(Exception exc) {
this.loginClient.completeAndValidate(LoginClient.Result.createErrorResult(this.loginClient.getPendingRequest(), null, exc.getMessage()));
}
public void onSuccess(String str, String str2, String str3, Collection<String> collection, Collection<String> collection2, AccessTokenSource accessTokenSource, Date date, Date date2) {
this.loginClient.completeAndValidate(LoginClient.Result.createTokenResult(this.loginClient.getPendingRequest(), new AccessToken(str, str2, str3, collection, collection2, accessTokenSource, date, date2)));
}
@Override // com.facebook.login.LoginMethodHandler
boolean tryAuthorize(LoginClient.Request request) {
showDialog(request);
return true;
}
@Override // com.facebook.login.LoginMethodHandler, android.os.Parcelable
public void writeToParcel(Parcel parcel, int i) {
super.writeToParcel(parcel, i);
}
protected DeviceAuthMethodHandler(Parcel parcel) {
super(parcel);
}
}

View File

@@ -0,0 +1,53 @@
package com.facebook.login;
import android.content.Intent;
import android.os.Parcel;
import android.os.Parcelable;
import com.facebook.internal.NativeProtocol;
import com.facebook.login.LoginClient;
/* loaded from: classes.dex */
class FacebookLiteLoginMethodHandler extends NativeAppLoginMethodHandler {
public static final Parcelable.Creator<FacebookLiteLoginMethodHandler> CREATOR = new Parcelable.Creator() { // from class: com.facebook.login.FacebookLiteLoginMethodHandler.1
@Override // android.os.Parcelable.Creator
public FacebookLiteLoginMethodHandler createFromParcel(Parcel parcel) {
return new FacebookLiteLoginMethodHandler(parcel);
}
@Override // android.os.Parcelable.Creator
public FacebookLiteLoginMethodHandler[] newArray(int i) {
return new FacebookLiteLoginMethodHandler[i];
}
};
FacebookLiteLoginMethodHandler(LoginClient loginClient) {
super(loginClient);
}
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
@Override // com.facebook.login.LoginMethodHandler
String getNameForLogging() {
return "fb_lite_login";
}
@Override // com.facebook.login.NativeAppLoginMethodHandler, com.facebook.login.LoginMethodHandler
boolean tryAuthorize(LoginClient.Request request) {
String e2e = LoginClient.getE2E();
Intent a = NativeProtocol.a(this.loginClient.getActivity(), request.getApplicationId(), request.getPermissions(), e2e, request.isRerequest(), request.hasPublishPermission(), request.getDefaultAudience(), getClientState(request.getAuthId()));
addLoggingExtra("e2e", e2e);
return tryIntent(a, LoginClient.getLoginRequestCode());
}
@Override // com.facebook.login.LoginMethodHandler, android.os.Parcelable
public void writeToParcel(Parcel parcel, int i) {
super.writeToParcel(parcel, i);
}
FacebookLiteLoginMethodHandler(Parcel parcel) {
super(parcel);
}
}

View File

@@ -0,0 +1,16 @@
package com.facebook.login;
import android.content.Context;
import android.os.Bundle;
import com.facebook.internal.PlatformServiceClient;
/* loaded from: classes.dex */
final class GetTokenClient extends PlatformServiceClient {
GetTokenClient(Context context, String str) {
super(context, 65536, 65537, 20121101, str);
}
@Override // com.facebook.internal.PlatformServiceClient
protected void a(Bundle bundle) {
}
}

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