CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 x.java 源代码,内容仅作参考
package i.h;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import com.facebook.AccessToken;
import com.facebook.FacebookSdkNotInitializedException;
import com.facebook.GraphRequest;
import com.facebook.LoggingBehavior;
import com.facebook.internal.FetchedAppSettingsManager;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import java.util.HashSet;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.Metadata;
import org.json.JSONException;
import org.json.JSONObject;
@Metadata(d1 = {"\u0000J\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\t\n\u0002\u0010\t\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0010\u0011\n\u0002\b\u0010\bÁ\u0002\u0018\u00002\u00020\u0001:\u00017B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\b\u0010\u001d\u001a\u00020\u001eH\u0007J\b\u0010\u001f\u001a\u00020\u001eH\u0007J\b\u0010 \u001a\u00020\u001eH\u0007J\b\u0010!\u001a\u00020\u001eH\u0007J\b\u0010\"\u001a\u00020\u001eH\u0007J\b\u0010#\u001a\u00020$H\u0002J\b\u0010%\u001a\u00020$H\u0002J!\u0010&\u001a\u00020$2\u0012\u0010'\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00130(\"\u00020\u0013H\u0002¢\u0006\u0002\u0010)J\u0010\u0010*\u001a\u00020$2\u0006\u0010+\u001a\u00020\u0013H\u0002J\b\u0010,\u001a\u00020$H\u0007J\b\u0010-\u001a\u00020$H\u0002J\b\u0010.\u001a\u00020$H\u0002J\u0010\u0010/\u001a\u00020$2\u0006\u0010+\u001a\u00020\u0013H\u0002J\u0010\u00100\u001a\u00020$2\u0006\u00101\u001a\u00020\u001eH\u0007J\u0010\u00102\u001a\u00020$2\u0006\u00101\u001a\u00020\u001eH\u0007J\u0010\u00103\u001a\u00020$2\u0006\u00101\u001a\u00020\u001eH\u0007J\u0010\u00104\u001a\u00020$2\u0006\u00101\u001a\u00020\u001eH\u0007J\b\u00105\u001a\u00020$H\u0002J\u0010\u00106\u001a\u00020$2\u0006\u0010+\u001a\u00020\u0013H\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\t\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u000eX\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\u000f\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\u0010\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\u0011\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\u0012\u001a\u00020\u0013X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0014\u001a\u00020\u0013X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0015\u001a\u00020\u0013X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0016\u001a\u00020\u0013X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0017\u001a\u00020\u0018X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0019\u001a\u00020\u0018X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u001a\u001a\u00020\u0013X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u001b\u001a\u00020\u001cX\u0082.¢\u0006\u0002\n\u0000¨\u00068"}, d2 = {"Lcom/facebook/UserSettingsManager;", "", "()V", "ADVERTISERID_COLLECTION_FALSE_WARNING", "", "ADVERTISERID_COLLECTION_NOT_SET_WARNING", "ADVERTISER_ID_KEY", "APPLICATION_FIELDS", "AUTOLOG_APPEVENT_NOT_SET_WARNING", "AUTO_APP_LINK_WARNING", "EVENTS_CODELESS_SETUP_ENABLED", "LAST_TIMESTAMP", "TAG", "TIMEOUT_7D", "", "USER_SETTINGS", "USER_SETTINGS_BITMASK", "VALUE", "advertiserIDCollectionEnabled", "Lcom/facebook/UserSettingsManager$UserSetting;", "autoInitEnabled", "autoLogAppEventsEnabled", "codelessSetupEnabled", "isFetchingCodelessStatus", "Ljava/util/concurrent/atomic/AtomicBoolean;", "isInitialized", "monitorEnabled", "userSettingPref", "Landroid/content/SharedPreferences;", "getAdvertiserIDCollectionEnabled", "", "getAutoInitEnabled", "getAutoLogAppEventsEnabled", "getCodelessSetupEnabled", "getMonitorEnabled", "initializeCodelessSetupEnabledAsync", "", "initializeIfNotInitialized", "initializeUserSetting", "userSettings", "", "([Lcom/facebook/UserSettingsManager$UserSetting;)V", "loadSettingFromManifest", "userSetting", "logIfAutoAppLinkEnabled", "logIfSDKSettingsChanged", "logWarnings", "readSettingFromCache", "setAdvertiserIDCollectionEnabled", "flag", "setAutoInitEnabled", "setAutoLogAppEventsEnabled", "setMonitorEnabled", "validateInitialized", "writeSettingToCache", "UserSetting", "facebook-core_release"}, k = 1, mv = {1, 5, 1})
public final class x {
public static final String a;
public static final AtomicBoolean b;
public static final AtomicBoolean c;
public static final a f10289d;
public static final a f10290e;
public static final a f10291f;
public static final a f10292g;
public static final a f10293h;
public static SharedPreferences f10294i;
public static final x f10295j = new x();
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u000e\n\u0002\b\n\n\u0002\u0010\t\n\u0002\b\u000b\b\u0002\u0018\u00002\u00020\u0001B\u0015\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006J\u0006\u0010\u0016\u001a\u00020\u0003R\u001a\u0010\u0002\u001a\u00020\u0003X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0007\u0010\b\"\u0004\b\t\u0010\nR\u001a\u0010\u0004\u001a\u00020\u0005X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000b\u0010\f\"\u0004\b\r\u0010\u000eR\u001a\u0010\u000f\u001a\u00020\u0010X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0011\u0010\u0012\"\u0004\b\u0013\u0010\u0014R\u001e\u0010\u0015\u001a\u0004\u0018\u00010\u0003X\u0086\u000e¢\u0006\u0010\n\u0002\u0010\u001a\u001a\u0004\b\u0016\u0010\u0017\"\u0004\b\u0018\u0010\u0019¨\u0006\u001b"}, d2 = {"Lcom/facebook/UserSettingsManager$UserSetting;", "", "defaultVal", "", "key", "", "(ZLjava/lang/String;)V", "getDefaultVal", "()Z", "setDefaultVal", "(Z)V", "getKey", "()Ljava/lang/String;", "setKey", "(Ljava/lang/String;)V", "lastTS", "", "getLastTS", "()J", "setLastTS", "(J)V", AppMeasurementSdk.ConditionalUserProperty.VALUE, "getValue", "()Ljava/lang/Boolean;", "setValue", "(Ljava/lang/Boolean;)V", "Ljava/lang/Boolean;", "facebook-core_release"}, k = 1, mv = {1, 5, 1})
public static final class a {
public Boolean a;
public long b;
public boolean c;
public String f10296d;
public a(boolean z, String str) {
n.i.b.h.e(str, "key");
this.c = z;
this.f10296d = str;
}
public final boolean a() {
Boolean bool = this.a;
return bool != null ? bool.booleanValue() : this.c;
}
}
@Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "run"}, k = 3, mv = {1, 5, 1})
public static final class b implements Runnable {
public final long f10297i;
public b(long j2) {
this.f10297i = j2;
}
@Override
public final void run() {
i.h.b0.l f2;
if (i.h.b0.n0.l.a.b(this)) {
return;
}
try {
x xVar = x.f10295j;
if ((i.h.b0.n0.l.a.b(x.class) ? null : x.f10291f).a() && (f2 = FetchedAppSettingsManager.f(i.c(), false)) != null && f2.f10075j) {
i.h.b0.b c = i.h.b0.b.c(i.b());
String b = (c == null || c.b() == null) ? null : c.b();
if (b != null) {
Bundle bundle = new Bundle();
bundle.putString("advertiser_id", b);
bundle.putString("fields", "auto_event_setup_enabled");
GraphRequest h2 = GraphRequest.f2396p.h(null, i.c(), null);
h2.f2403j = true;
h2.l(bundle);
JSONObject jSONObject = h2.c().c;
if (jSONObject != null) {
x xVar2 = x.f10295j;
x.a(xVar2).a = Boolean.valueOf(jSONObject.optBoolean("auto_event_setup_enabled", false));
x.a(xVar2).b = this.f10297i;
a a = x.a(xVar2);
if (!i.h.b0.n0.l.a.b(x.class)) {
xVar2.k(a);
}
}
}
}
x xVar3 = x.f10295j;
(i.h.b0.n0.l.a.b(x.class) ? null : x.c).set(false);
} catch (Throwable th) {
i.h.b0.n0.l.a.a(th, this);
}
}
}
static {
String name = x.class.getName();
n.i.b.h.d(name, "UserSettingsManager::class.java.name");
a = name;
b = new AtomicBoolean(false);
c = new AtomicBoolean(false);
f10289d = new a(true, "com.facebook.sdk.AutoInitEnabled");
f10290e = new a(true, "com.facebook.sdk.AutoLogAppEventsEnabled");
f10291f = new a(true, "com.facebook.sdk.AdvertiserIDCollectionEnabled");
f10292g = new a(false, "auto_event_setup_enabled");
f10293h = new a(true, "com.facebook.sdk.MonitorEnabled");
}
public static final a a(x xVar) {
if (i.h.b0.n0.l.a.b(x.class)) {
return null;
}
try {
return f10292g;
} catch (Throwable th) {
i.h.b0.n0.l.a.a(th, x.class);
return null;
}
}
public static final boolean b() {
if (i.h.b0.n0.l.a.b(x.class)) {
return false;
}
try {
f10295j.e();
return f10291f.a();
} catch (Throwable th) {
i.h.b0.n0.l.a.a(th, x.class);
return false;
}
}
public static final boolean c() {
if (i.h.b0.n0.l.a.b(x.class)) {
return false;
}
try {
f10295j.e();
return f10290e.a();
} catch (Throwable th) {
i.h.b0.n0.l.a.a(th, x.class);
return false;
}
}
public final void d() {
if (i.h.b0.n0.l.a.b(this)) {
return;
}
try {
a aVar = f10292g;
i(aVar);
long currentTimeMillis = System.currentTimeMillis();
if (aVar.a == null || currentTimeMillis - aVar.b >= 604800000) {
aVar.a = null;
aVar.b = 0L;
if (c.compareAndSet(false, true)) {
i.d().execute(new b(currentTimeMillis));
}
}
} catch (Throwable th) {
i.h.b0.n0.l.a.a(th, this);
}
}
public final void e() {
if (i.h.b0.n0.l.a.b(this)) {
return;
}
try {
if (i.i()) {
if (b.compareAndSet(false, true)) {
SharedPreferences sharedPreferences = i.b().getSharedPreferences("com.facebook.sdk.USER_SETTINGS", 0);
n.i.b.h.d(sharedPreferences, "FacebookSdk.getApplicati…GS, Context.MODE_PRIVATE)");
f10294i = sharedPreferences;
a[] aVarArr = {f10290e, f10291f, f10289d};
if (!i.h.b0.n0.l.a.b(this)) {
for (int i2 = 0; i2 < 3; i2++) {
a aVar = aVarArr[i2];
if (aVar == f10292g) {
d();
} else if (aVar.a == null) {
i(aVar);
if (aVar.a == null) {
f(aVar);
}
} else {
k(aVar);
}
}
}
d();
h();
g();
}
}
} catch (Throwable th) {
i.h.b0.n0.l.a.a(th, this);
}
}
public final void f(a aVar) {
if (i.h.b0.n0.l.a.b(this)) {
return;
}
try {
j();
try {
Context b2 = i.b();
ApplicationInfo applicationInfo = b2.getPackageManager().getApplicationInfo(b2.getPackageName(), 128);
if ((applicationInfo != null ? applicationInfo.metaData : null) == null || !applicationInfo.metaData.containsKey(aVar.f10296d)) {
return;
}
aVar.a = Boolean.valueOf(applicationInfo.metaData.getBoolean(aVar.f10296d, aVar.c));
} catch (PackageManager.NameNotFoundException unused) {
HashSet<LoggingBehavior> hashSet = i.a;
}
} catch (Throwable th) {
i.h.b0.n0.l.a.a(th, this);
}
}
public final void g() {
int i2;
int i3;
Bundle bundle;
ApplicationInfo applicationInfo;
if (i.h.b0.n0.l.a.b(this)) {
return;
}
try {
if (b.get() && i.i()) {
Context b2 = i.b();
int i4 = ((f10289d.a() ? 1 : 0) << 0) | 0 | ((f10290e.a() ? 1 : 0) << 1) | ((f10291f.a() ? 1 : 0) << 2) | ((f10293h.a() ? 1 : 0) << 3);
SharedPreferences sharedPreferences = f10294i;
if (sharedPreferences == null) {
n.i.b.h.l("userSettingPref");
throw null;
}
int i5 = sharedPreferences.getInt("com.facebook.sdk.USER_SETTINGS_BITMASK", 0);
if (i5 != i4) {
SharedPreferences sharedPreferences2 = f10294i;
if (sharedPreferences2 != null) {
sharedPreferences2.edit().putInt("com.facebook.sdk.USER_SETTINGS_BITMASK", i4).apply();
try {
applicationInfo = b2.getPackageManager().getApplicationInfo(b2.getPackageName(), 128);
} catch (PackageManager.NameNotFoundException unused) {
}
if ((applicationInfo != null ? applicationInfo.metaData : null) != null) {
String[] strArr = {"com.facebook.sdk.AutoInitEnabled", "com.facebook.sdk.AutoLogAppEventsEnabled", "com.facebook.sdk.AdvertiserIDCollectionEnabled", "com.facebook.sdk.MonitorEnabled"};
boolean[] zArr = {true, true, true, true};
i2 = 0;
i3 = 0;
for (int i6 = 0; i6 < 4; i6++) {
try {
i3 |= (applicationInfo.metaData.containsKey(strArr[i6]) ? 1 : 0) << i6;
i2 |= (applicationInfo.metaData.getBoolean(strArr[i6], zArr[i6]) ? 1 : 0) << i6;
} catch (PackageManager.NameNotFoundException unused2) {
}
}
i.h.y.i iVar = new i.h.y.i(b2, (String) null, (AccessToken) null);
n.i.b.h.e(iVar, "loggerImpl");
bundle = new Bundle();
bundle.putInt("usage", i3);
bundle.putInt("initial", i2);
bundle.putInt("previous", i5);
bundle.putInt("current", i4);
n.i.b.h.e(bundle, "parameters");
if (!((bundle.getInt("previous") & 2) == 0)) {
HashSet<LoggingBehavior> hashSet = i.a;
if (!c()) {
return;
}
}
iVar.f("fb_sdk_settings_changed", null, bundle);
return;
}
i2 = 0;
i3 = 0;
i.h.y.i iVar2 = new i.h.y.i(b2, (String) null, (AccessToken) null);
n.i.b.h.e(iVar2, "loggerImpl");
bundle = new Bundle();
bundle.putInt("usage", i3);
bundle.putInt("initial", i2);
bundle.putInt("previous", i5);
bundle.putInt("current", i4);
n.i.b.h.e(bundle, "parameters");
if (!((bundle.getInt("previous") & 2) == 0)) {
}
iVar2.f("fb_sdk_settings_changed", null, bundle);
return;
}
n.i.b.h.l("userSettingPref");
throw null;
}
}
} catch (Throwable th) {
i.h.b0.n0.l.a.a(th, this);
}
}
public final void h() {
if (i.h.b0.n0.l.a.b(this)) {
return;
}
try {
Context b2 = i.b();
ApplicationInfo applicationInfo = b2.getPackageManager().getApplicationInfo(b2.getPackageName(), 128);
if ((applicationInfo != null ? applicationInfo.metaData : null) != null) {
if (!applicationInfo.metaData.containsKey("com.facebook.sdk.AutoLogAppEventsEnabled")) {
Log.w(a, "Please set a value for AutoLogAppEventsEnabled. Set the flag to TRUE if you want to collect app install, app launch and in-app purchase events automatically. To request user consent before collecting data, set the flag value to FALSE, then change to TRUE once user consent is received. Learn more: https://developers.facebook.com/docs/app-events/getting-started-app-events-android#disable-auto-events.");
}
if (!applicationInfo.metaData.containsKey("com.facebook.sdk.AdvertiserIDCollectionEnabled")) {
Log.w(a, "You haven't set a value for AdvertiserIDCollectionEnabled. Set the flag to TRUE if you want to collect Advertiser ID for better advertising and analytics results. To request user consent before collecting data, set the flag value to FALSE, then change to TRUE once user consent is received. Learn more: https://developers.facebook.com/docs/app-events/getting-started-app-events-android#disable-auto-events.");
}
if (b()) {
return;
}
Log.w(a, "The value for AdvertiserIDCollectionEnabled is currently set to FALSE so you're sending app events without collecting Advertiser ID. This can affect the quality of your advertising and analytics results.");
}
} catch (PackageManager.NameNotFoundException unused) {
} catch (Throwable th) {
i.h.b0.n0.l.a.a(th, this);
}
}
public final void i(a aVar) {
if (i.h.b0.n0.l.a.b(this)) {
return;
}
try {
j();
try {
SharedPreferences sharedPreferences = f10294i;
if (sharedPreferences != null) {
String string = sharedPreferences.getString(aVar.f10296d, "");
String str = string != null ? string : "";
n.i.b.h.d(str, "userSettingPref.getStrin…serSetting.key, \"\") ?: \"\"");
if (str.length() > 0) {
JSONObject jSONObject = new JSONObject(str);
aVar.a = Boolean.valueOf(jSONObject.getBoolean(AppMeasurementSdk.ConditionalUserProperty.VALUE));
aVar.b = jSONObject.getLong("last_timestamp");
return;
}
return;
}
n.i.b.h.l("userSettingPref");
throw null;
} catch (JSONException unused) {
HashSet<LoggingBehavior> hashSet = i.a;
}
} catch (Throwable th) {
i.h.b0.n0.l.a.a(th, this);
}
}
public final void j() {
if (i.h.b0.n0.l.a.b(this)) {
return;
}
try {
if (b.get()) {
return;
}
throw new FacebookSdkNotInitializedException("The UserSettingManager has not been initialized successfully");
} catch (Throwable th) {
i.h.b0.n0.l.a.a(th, this);
}
}
public final void k(a aVar) {
if (i.h.b0.n0.l.a.b(this)) {
return;
}
try {
j();
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put(AppMeasurementSdk.ConditionalUserProperty.VALUE, aVar.a);
jSONObject.put("last_timestamp", aVar.b);
SharedPreferences sharedPreferences = f10294i;
if (sharedPreferences != null) {
sharedPreferences.edit().putString(aVar.f10296d, jSONObject.toString()).apply();
g();
return;
}
n.i.b.h.l("userSettingPref");
throw null;
} catch (Exception unused) {
HashSet<LoggingBehavior> hashSet = i.a;
}
} catch (Throwable th) {
i.h.b0.n0.l.a.a(th, this);
}
}
}