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