Initial import of ADIF API reverse-engineering toolkit

This commit is contained in:
2025-12-16 08:37:56 +01:00
commit 60388529c1
11486 changed files with 1086536 additions and 0 deletions

View File

@@ -0,0 +1,123 @@
package com.google.android.gms.common.stats;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.PackageManager;
import android.util.Log;
import com.google.android.gms.common.annotation.KeepForSdk;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.internal.zzs;
import com.google.android.gms.common.util.PlatformVersion;
import com.google.android.gms.common.util.VisibleForTesting;
import com.google.android.gms.common.wrappers.Wrappers;
import java.util.NoSuchElementException;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
@KeepForSdk
/* loaded from: classes3.dex */
public class ConnectionTracker {
private static final Object zzb = new Object();
private static volatile ConnectionTracker zzc;
@VisibleForTesting
public ConcurrentHashMap zza = new ConcurrentHashMap();
private ConnectionTracker() {
}
@KeepForSdk
public static ConnectionTracker getInstance() {
if (zzc == null) {
synchronized (zzb) {
try {
if (zzc == null) {
zzc = new ConnectionTracker();
}
} finally {
}
}
}
ConnectionTracker connectionTracker = zzc;
Preconditions.checkNotNull(connectionTracker);
return connectionTracker;
}
private static void zzb(Context context, ServiceConnection serviceConnection) {
try {
context.unbindService(serviceConnection);
} catch (IllegalArgumentException | IllegalStateException | NoSuchElementException unused) {
}
}
private final boolean zzc(Context context, String str, Intent intent, ServiceConnection serviceConnection, int i, boolean z3, Executor executor) {
ComponentName component = intent.getComponent();
if (component != null) {
String packageName = component.getPackageName();
"com.google.android.gms".equals(packageName);
try {
if ((Wrappers.packageManager(context).getApplicationInfo(packageName, 0).flags & 2097152) != 0) {
Log.w("ConnectionTracker", "Attempted to bind to a service in a STOPPED package.");
return false;
}
} catch (PackageManager.NameNotFoundException unused) {
}
}
if (!zzd(serviceConnection)) {
return zze(context, intent, serviceConnection, i, executor);
}
ServiceConnection serviceConnection2 = (ServiceConnection) this.zza.putIfAbsent(serviceConnection, serviceConnection);
if (serviceConnection2 != null && serviceConnection != serviceConnection2) {
Log.w("ConnectionTracker", String.format("Duplicate binding with the same ServiceConnection: %s, %s, %s.", serviceConnection, str, intent.getAction()));
}
try {
boolean zze = zze(context, intent, serviceConnection, i, executor);
if (zze) {
return zze;
}
return false;
} finally {
this.zza.remove(serviceConnection, serviceConnection);
}
}
private static boolean zzd(ServiceConnection serviceConnection) {
return !(serviceConnection instanceof zzs);
}
private static final boolean zze(Context context, Intent intent, ServiceConnection serviceConnection, int i, Executor executor) {
return (!PlatformVersion.isAtLeastQ() || executor == null) ? context.bindService(intent, serviceConnection, i) : context.bindService(intent, i, executor, serviceConnection);
}
@KeepForSdk
public boolean bindService(Context context, Intent intent, ServiceConnection serviceConnection, int i) {
return zzc(context, context.getClass().getName(), intent, serviceConnection, i, true, null);
}
@KeepForSdk
public void unbindService(Context context, ServiceConnection serviceConnection) {
if (!zzd(serviceConnection) || !this.zza.containsKey(serviceConnection)) {
zzb(context, serviceConnection);
return;
}
try {
zzb(context, (ServiceConnection) this.zza.get(serviceConnection));
} finally {
this.zza.remove(serviceConnection);
}
}
@KeepForSdk
public void unbindServiceSafe(Context context, ServiceConnection serviceConnection) {
try {
unbindService(context, serviceConnection);
} catch (IllegalArgumentException unused) {
}
}
public final boolean zza(Context context, String str, Intent intent, ServiceConnection serviceConnection, int i, Executor executor) {
return zzc(context, str, intent, serviceConnection, i, true, executor);
}
}

View File

@@ -0,0 +1,17 @@
package com.google.android.gms.common.stats;
import android.content.ComponentName;
import com.google.android.gms.common.annotation.KeepForSdk;
@KeepForSdk
/* loaded from: classes3.dex */
public final class LoggingConstants {
@KeepForSdk
@Deprecated
public static final String EXTRA_WAKE_LOCK_KEY = "WAKE_LOCK_KEY";
public static final ComponentName zza = new ComponentName("com.google.android.gms", "com.google.android.gms.common.stats.GmsCoreStatsService");
private LoggingConstants() {
}
}

View File

@@ -0,0 +1,44 @@
package com.google.android.gms.common.stats;
import C.w;
import com.google.android.gms.common.annotation.KeepForSdk;
import com.google.android.gms.common.internal.ReflectedParcelable;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
@KeepForSdk
@Deprecated
/* loaded from: classes3.dex */
public abstract class StatsEvent extends AbstractSafeParcelable implements ReflectedParcelable {
@KeepForSdk
/* loaded from: classes3.dex */
public interface Types {
@KeepForSdk
public static final int EVENT_TYPE_ACQUIRE_WAKE_LOCK = 7;
@KeepForSdk
public static final int EVENT_TYPE_RELEASE_WAKE_LOCK = 8;
}
public final String toString() {
long zzc = zzc();
int zza = zza();
long zzb = zzb();
String zzd = zzd();
StringBuilder sb = new StringBuilder();
sb.append(zzc);
sb.append("\t");
sb.append(zza);
sb.append("\t");
return w.q(sb, zzb, zzd);
}
public abstract int zza();
public abstract long zzb();
public abstract long zzc();
public abstract String zzd();
}

View File

@@ -0,0 +1,20 @@
package com.google.android.gms.common.stats;
import android.os.PowerManager;
import android.os.Process;
import android.text.TextUtils;
import com.google.android.gms.common.annotation.KeepForSdk;
@KeepForSdk
@Deprecated
/* loaded from: classes3.dex */
public class StatsUtils {
@KeepForSdk
public static String getEventKey(PowerManager.WakeLock wakeLock, String str) {
String valueOf = String.valueOf((Process.myPid() << 32) | System.identityHashCode(wakeLock));
if (true == TextUtils.isEmpty(str)) {
str = "";
}
return String.valueOf(valueOf).concat(String.valueOf(str));
}
}

View File

@@ -0,0 +1,138 @@
package com.google.android.gms.common.stats;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import com.google.android.gms.common.annotation.KeepForSdk;
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
import java.util.List;
@KeepForSdk
@SafeParcelable.Class(creator = "WakeLockEventCreator")
@Deprecated
/* loaded from: classes3.dex */
public final class WakeLockEvent extends StatsEvent {
public static final Parcelable.Creator<WakeLockEvent> CREATOR = new zza();
@SafeParcelable.VersionField(id = 1)
final int zza;
@SafeParcelable.Field(getter = "getTimeMillis", id = 2)
private final long zzb;
@SafeParcelable.Field(getter = "getEventType", id = 11)
private int zzc;
@SafeParcelable.Field(getter = "getWakeLockName", id = 4)
private final String zzd;
@SafeParcelable.Field(getter = "getSecondaryWakeLockName", id = 10)
private final String zze;
@SafeParcelable.Field(getter = "getCodePackage", id = 17)
private final String zzf;
@SafeParcelable.Field(getter = "getWakeLockType", id = 5)
private final int zzg;
@SafeParcelable.Field(getter = "getCallingPackages", id = 6)
private final List zzh;
@SafeParcelable.Field(getter = "getEventKey", id = 12)
private final String zzi;
@SafeParcelable.Field(getter = "getElapsedRealtime", id = 8)
private final long zzj;
@SafeParcelable.Field(getter = "getDeviceState", id = 14)
private int zzk;
@SafeParcelable.Field(getter = "getHostPackage", id = 13)
private final String zzl;
@SafeParcelable.Field(getter = "getBeginPowerPercentage", id = 15)
private final float zzm;
@SafeParcelable.Field(getter = "getTimeout", id = 16)
private final long zzn;
@SafeParcelable.Field(getter = "getAcquiredWithTimeout", id = 18)
private final boolean zzo;
private long zzp = -1;
@SafeParcelable.Constructor
public WakeLockEvent(@SafeParcelable.Param(id = 1) int i, @SafeParcelable.Param(id = 2) long j4, @SafeParcelable.Param(id = 11) int i4, @SafeParcelable.Param(id = 4) String str, @SafeParcelable.Param(id = 5) int i5, @SafeParcelable.Param(id = 6) List list, @SafeParcelable.Param(id = 12) String str2, @SafeParcelable.Param(id = 8) long j5, @SafeParcelable.Param(id = 14) int i6, @SafeParcelable.Param(id = 10) String str3, @SafeParcelable.Param(id = 13) String str4, @SafeParcelable.Param(id = 15) float f2, @SafeParcelable.Param(id = 16) long j6, @SafeParcelable.Param(id = 17) String str5, @SafeParcelable.Param(id = 18) boolean z3) {
this.zza = i;
this.zzb = j4;
this.zzc = i4;
this.zzd = str;
this.zze = str3;
this.zzf = str5;
this.zzg = i5;
this.zzh = list;
this.zzi = str2;
this.zzj = j5;
this.zzk = i6;
this.zzl = str4;
this.zzm = f2;
this.zzn = j6;
this.zzo = z3;
}
@Override // android.os.Parcelable
public final void writeToParcel(Parcel parcel, int i) {
int beginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
SafeParcelWriter.writeInt(parcel, 1, this.zza);
SafeParcelWriter.writeLong(parcel, 2, this.zzb);
SafeParcelWriter.writeString(parcel, 4, this.zzd, false);
SafeParcelWriter.writeInt(parcel, 5, this.zzg);
SafeParcelWriter.writeStringList(parcel, 6, this.zzh, false);
SafeParcelWriter.writeLong(parcel, 8, this.zzj);
SafeParcelWriter.writeString(parcel, 10, this.zze, false);
SafeParcelWriter.writeInt(parcel, 11, this.zzc);
SafeParcelWriter.writeString(parcel, 12, this.zzi, false);
SafeParcelWriter.writeString(parcel, 13, this.zzl, false);
SafeParcelWriter.writeInt(parcel, 14, this.zzk);
SafeParcelWriter.writeFloat(parcel, 15, this.zzm);
SafeParcelWriter.writeLong(parcel, 16, this.zzn);
SafeParcelWriter.writeString(parcel, 17, this.zzf, false);
SafeParcelWriter.writeBoolean(parcel, 18, this.zzo);
SafeParcelWriter.finishObjectHeader(parcel, beginObjectHeader);
}
@Override // com.google.android.gms.common.stats.StatsEvent
public final int zza() {
return this.zzc;
}
@Override // com.google.android.gms.common.stats.StatsEvent
public final long zzb() {
return this.zzp;
}
@Override // com.google.android.gms.common.stats.StatsEvent
public final long zzc() {
return this.zzb;
}
@Override // com.google.android.gms.common.stats.StatsEvent
public final String zzd() {
List list = this.zzh;
String str = this.zzd;
int i = this.zzg;
String join = list == null ? "" : TextUtils.join(",", list);
int i4 = this.zzk;
String str2 = this.zze;
if (str2 == null) {
str2 = "";
}
String str3 = this.zzl;
if (str3 == null) {
str3 = "";
}
float f2 = this.zzm;
String str4 = this.zzf;
return "\t" + str + "\t" + i + "\t" + join + "\t" + i4 + "\t" + str2 + "\t" + str3 + "\t" + f2 + "\t" + (str4 != null ? str4 : "") + "\t" + this.zzo;
}
}

View File

@@ -0,0 +1,38 @@
package com.google.android.gms.common.stats;
import android.content.Context;
import android.content.Intent;
import com.google.android.gms.common.annotation.KeepForSdk;
import java.util.List;
@KeepForSdk
@Deprecated
/* loaded from: classes3.dex */
public class WakeLockTracker {
private static WakeLockTracker zza = new WakeLockTracker();
@KeepForSdk
public static WakeLockTracker getInstance() {
return zza;
}
@KeepForSdk
public void registerAcquireEvent(Context context, Intent intent, String str, String str2, String str3, int i, String str4) {
}
@KeepForSdk
public void registerDeadlineEvent(Context context, String str, String str2, String str3, int i, List<String> list, boolean z3, long j4) {
}
@KeepForSdk
public void registerEvent(Context context, String str, int i, String str2, String str3, String str4, int i4, List<String> list) {
}
@KeepForSdk
public void registerReleaseEvent(Context context, Intent intent) {
}
@KeepForSdk
public void registerEvent(Context context, String str, int i, String str2, String str3, String str4, int i4, List<String> list, long j4) {
}
}

View File

@@ -0,0 +1,92 @@
package com.google.android.gms.common.stats;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
import java.util.ArrayList;
/* loaded from: classes3.dex */
public final class zza implements Parcelable.Creator {
@Override // android.os.Parcelable.Creator
public final /* bridge */ /* synthetic */ Object createFromParcel(Parcel parcel) {
int validateObjectHeader = SafeParcelReader.validateObjectHeader(parcel);
int i = 0;
int i4 = 0;
int i5 = 0;
int i6 = 0;
boolean z3 = false;
long j4 = 0;
long j5 = 0;
long j6 = 0;
String str = null;
ArrayList<String> arrayList = null;
String str2 = null;
String str3 = null;
String str4 = null;
String str5 = null;
float f2 = 0.0f;
while (parcel.dataPosition() < validateObjectHeader) {
int readHeader = SafeParcelReader.readHeader(parcel);
switch (SafeParcelReader.getFieldId(readHeader)) {
case 1:
i = SafeParcelReader.readInt(parcel, readHeader);
break;
case 2:
j4 = SafeParcelReader.readLong(parcel, readHeader);
break;
case 3:
case 7:
case 9:
default:
SafeParcelReader.skipUnknownField(parcel, readHeader);
break;
case 4:
str = SafeParcelReader.createString(parcel, readHeader);
break;
case 5:
i5 = SafeParcelReader.readInt(parcel, readHeader);
break;
case 6:
arrayList = SafeParcelReader.createStringList(parcel, readHeader);
break;
case 8:
j5 = SafeParcelReader.readLong(parcel, readHeader);
break;
case 10:
str3 = SafeParcelReader.createString(parcel, readHeader);
break;
case 11:
i4 = SafeParcelReader.readInt(parcel, readHeader);
break;
case 12:
str2 = SafeParcelReader.createString(parcel, readHeader);
break;
case 13:
str4 = SafeParcelReader.createString(parcel, readHeader);
break;
case 14:
i6 = SafeParcelReader.readInt(parcel, readHeader);
break;
case 15:
f2 = SafeParcelReader.readFloat(parcel, readHeader);
break;
case 16:
j6 = SafeParcelReader.readLong(parcel, readHeader);
break;
case 17:
str5 = SafeParcelReader.createString(parcel, readHeader);
break;
case 18:
z3 = SafeParcelReader.readBoolean(parcel, readHeader);
break;
}
}
SafeParcelReader.ensureAtEnd(parcel, validateObjectHeader);
return new WakeLockEvent(i, j4, i4, str, i5, arrayList, str2, j5, i6, str3, str4, f2, j6, str5, z3);
}
@Override // android.os.Parcelable.Creator
public final /* synthetic */ Object[] newArray(int i) {
return new WakeLockEvent[i];
}
}