Initial import of ADIF API reverse-engineering toolkit
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package com.google.android.gms.stats;
|
||||
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.internal.ShowFirstParty;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@ShowFirstParty
|
||||
@KeepForSdk
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
/* loaded from: classes3.dex */
|
||||
public @interface CodePackage {
|
||||
|
||||
@KeepForSdk
|
||||
public static final String COMMON = "COMMON";
|
||||
|
||||
@KeepForSdk
|
||||
public static final String DRIVE = "DRIVE";
|
||||
|
||||
@KeepForSdk
|
||||
public static final String FITNESS = "FITNESS";
|
||||
|
||||
@KeepForSdk
|
||||
public static final String GCM = "GCM";
|
||||
|
||||
@KeepForSdk
|
||||
public static final String ICING = "ICING";
|
||||
|
||||
@KeepForSdk
|
||||
public static final String LOCATION = "LOCATION";
|
||||
|
||||
@KeepForSdk
|
||||
public static final String LOCATION_SHARING = "LOCATION_SHARING";
|
||||
|
||||
@KeepForSdk
|
||||
public static final String OTA = "OTA";
|
||||
|
||||
@KeepForSdk
|
||||
public static final String REMINDERS = "REMINDERS";
|
||||
|
||||
@KeepForSdk
|
||||
public static final String SECURITY = "SECURITY";
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.google.android.gms.stats;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import com.google.android.gms.common.annotation.KeepForSdk;
|
||||
import com.google.android.gms.common.internal.ShowFirstParty;
|
||||
import k0.AbstractC0415a;
|
||||
|
||||
@ShowFirstParty
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public abstract class GCoreWakefulBroadcastReceiver extends AbstractC0415a {
|
||||
@KeepForSdk
|
||||
public static boolean completeWakefulIntent(Context context, Intent intent) {
|
||||
if (intent == null) {
|
||||
return false;
|
||||
}
|
||||
return AbstractC0415a.completeWakefulIntent(intent);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.google.android.gms.stats;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class R {
|
||||
private R() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,301 @@
|
||||
package com.google.android.gms.stats;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.PowerManager;
|
||||
import android.os.WorkSource;
|
||||
import android.text.TextUtils;
|
||||
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.ShowFirstParty;
|
||||
import com.google.android.gms.common.util.Clock;
|
||||
import com.google.android.gms.common.util.DefaultClock;
|
||||
import com.google.android.gms.common.util.Strings;
|
||||
import com.google.android.gms.common.util.WorkSourceUtil;
|
||||
import com.google.android.gms.internal.stats.zzh;
|
||||
import com.google.android.gms.internal.stats.zzi;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import kotlin.jvm.internal.LongCompanionObject;
|
||||
|
||||
@ShowFirstParty
|
||||
@KeepForSdk
|
||||
/* loaded from: classes3.dex */
|
||||
public class WakeLock {
|
||||
private static final long zzb = TimeUnit.DAYS.toMillis(366);
|
||||
private static volatile ScheduledExecutorService zzc = null;
|
||||
private static final Object zzd = new Object();
|
||||
private static volatile zzd zze = new zzb();
|
||||
com.google.android.gms.internal.stats.zzb zza;
|
||||
private final Object zzf;
|
||||
private final PowerManager.WakeLock zzg;
|
||||
private int zzh;
|
||||
private Future<?> zzi;
|
||||
private long zzj;
|
||||
private final Set<zze> zzk;
|
||||
private boolean zzl;
|
||||
private int zzm;
|
||||
private Clock zzn;
|
||||
private WorkSource zzo;
|
||||
private final String zzp;
|
||||
private final String zzq;
|
||||
private final Context zzr;
|
||||
private final Map<String, zzc> zzs;
|
||||
private AtomicInteger zzt;
|
||||
private final ScheduledExecutorService zzu;
|
||||
|
||||
@KeepForSdk
|
||||
public WakeLock(Context context, int i, String str) {
|
||||
String packageName = context.getPackageName();
|
||||
this.zzf = new Object();
|
||||
this.zzh = 0;
|
||||
this.zzk = new HashSet();
|
||||
this.zzl = true;
|
||||
this.zzn = DefaultClock.getInstance();
|
||||
this.zzs = new HashMap();
|
||||
this.zzt = new AtomicInteger(0);
|
||||
Preconditions.checkNotNull(context, "WakeLock: context must not be null");
|
||||
Preconditions.checkNotEmpty(str, "WakeLock: wakeLockName must not be empty");
|
||||
this.zzr = context.getApplicationContext();
|
||||
this.zzq = str;
|
||||
this.zza = null;
|
||||
if ("com.google.android.gms".equals(context.getPackageName())) {
|
||||
this.zzp = str;
|
||||
} else {
|
||||
String valueOf = String.valueOf(str);
|
||||
this.zzp = valueOf.length() != 0 ? "*gcore*:".concat(valueOf) : new String("*gcore*:");
|
||||
}
|
||||
PowerManager powerManager = (PowerManager) context.getSystemService("power");
|
||||
if (powerManager == null) {
|
||||
StringBuilder sb = new StringBuilder(29);
|
||||
sb.append((CharSequence) "expected a non-null reference", 0, 29);
|
||||
throw new zzi(sb.toString());
|
||||
}
|
||||
PowerManager.WakeLock newWakeLock = powerManager.newWakeLock(i, str);
|
||||
this.zzg = newWakeLock;
|
||||
if (WorkSourceUtil.hasWorkSourcePermission(context)) {
|
||||
WorkSource fromPackage = WorkSourceUtil.fromPackage(context, Strings.isEmptyOrWhitespace(packageName) ? context.getPackageName() : packageName);
|
||||
this.zzo = fromPackage;
|
||||
if (fromPackage != null) {
|
||||
zze(newWakeLock, fromPackage);
|
||||
}
|
||||
}
|
||||
ScheduledExecutorService scheduledExecutorService = zzc;
|
||||
if (scheduledExecutorService == null) {
|
||||
synchronized (zzd) {
|
||||
try {
|
||||
scheduledExecutorService = zzc;
|
||||
if (scheduledExecutorService == null) {
|
||||
zzh.zza();
|
||||
scheduledExecutorService = Executors.unconfigurableScheduledExecutorService(Executors.newScheduledThreadPool(1));
|
||||
zzc = scheduledExecutorService;
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
}
|
||||
this.zzu = scheduledExecutorService;
|
||||
}
|
||||
|
||||
public static /* synthetic */ void zza(WakeLock wakeLock) {
|
||||
synchronized (wakeLock.zzf) {
|
||||
try {
|
||||
if (wakeLock.isHeld()) {
|
||||
Log.e("WakeLock", String.valueOf(wakeLock.zzp).concat(" ** IS FORCE-RELEASED ON TIMEOUT **"));
|
||||
wakeLock.zzc();
|
||||
if (wakeLock.isHeld()) {
|
||||
wakeLock.zzh = 1;
|
||||
wakeLock.zzd(0);
|
||||
}
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final String zzb(String str) {
|
||||
if (this.zzl) {
|
||||
TextUtils.isEmpty(null);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private final void zzc() {
|
||||
if (this.zzk.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
ArrayList arrayList = new ArrayList(this.zzk);
|
||||
this.zzk.clear();
|
||||
if (arrayList.size() <= 0) {
|
||||
return;
|
||||
}
|
||||
throw null;
|
||||
}
|
||||
|
||||
private final void zzd(int i) {
|
||||
synchronized (this.zzf) {
|
||||
try {
|
||||
if (isHeld()) {
|
||||
if (this.zzl) {
|
||||
int i4 = this.zzh - 1;
|
||||
this.zzh = i4;
|
||||
if (i4 > 0) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
this.zzh = 0;
|
||||
}
|
||||
zzc();
|
||||
Iterator<zzc> it = this.zzs.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().zza = 0;
|
||||
}
|
||||
this.zzs.clear();
|
||||
Future<?> future = this.zzi;
|
||||
if (future != null) {
|
||||
future.cancel(false);
|
||||
this.zzi = null;
|
||||
this.zzj = 0L;
|
||||
}
|
||||
this.zzm = 0;
|
||||
if (this.zzg.isHeld()) {
|
||||
try {
|
||||
try {
|
||||
this.zzg.release();
|
||||
if (this.zza != null) {
|
||||
this.zza = null;
|
||||
}
|
||||
} catch (RuntimeException e4) {
|
||||
if (!e4.getClass().equals(RuntimeException.class)) {
|
||||
throw e4;
|
||||
}
|
||||
Log.e("WakeLock", String.valueOf(this.zzp).concat(" failed to release!"), e4);
|
||||
if (this.zza != null) {
|
||||
this.zza = null;
|
||||
}
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
if (this.zza != null) {
|
||||
this.zza = null;
|
||||
}
|
||||
throw th;
|
||||
}
|
||||
} else {
|
||||
Log.e("WakeLock", String.valueOf(this.zzp).concat(" should be held!"));
|
||||
}
|
||||
}
|
||||
} catch (Throwable th2) {
|
||||
throw th2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void zze(PowerManager.WakeLock wakeLock, WorkSource workSource) {
|
||||
try {
|
||||
wakeLock.setWorkSource(workSource);
|
||||
} catch (ArrayIndexOutOfBoundsException | IllegalArgumentException e4) {
|
||||
Log.wtf("WakeLock", e4.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public void acquire(long j4) {
|
||||
this.zzt.incrementAndGet();
|
||||
long j5 = zzb;
|
||||
long j6 = LongCompanionObject.MAX_VALUE;
|
||||
long max = Math.max(Math.min(LongCompanionObject.MAX_VALUE, j5), 1L);
|
||||
if (j4 > 0) {
|
||||
max = Math.min(j4, max);
|
||||
}
|
||||
synchronized (this.zzf) {
|
||||
try {
|
||||
if (!isHeld()) {
|
||||
this.zza = com.google.android.gms.internal.stats.zzb.zza(false, null);
|
||||
this.zzg.acquire();
|
||||
this.zzn.elapsedRealtime();
|
||||
}
|
||||
this.zzh++;
|
||||
this.zzm++;
|
||||
zzb(null);
|
||||
zzc zzcVar = this.zzs.get(null);
|
||||
if (zzcVar == null) {
|
||||
zzcVar = new zzc(null);
|
||||
this.zzs.put(null, zzcVar);
|
||||
}
|
||||
zzcVar.zza++;
|
||||
long elapsedRealtime = this.zzn.elapsedRealtime();
|
||||
if (LongCompanionObject.MAX_VALUE - elapsedRealtime > max) {
|
||||
j6 = elapsedRealtime + max;
|
||||
}
|
||||
if (j6 > this.zzj) {
|
||||
this.zzj = j6;
|
||||
Future<?> future = this.zzi;
|
||||
if (future != null) {
|
||||
future.cancel(false);
|
||||
}
|
||||
this.zzi = this.zzu.schedule(new Runnable() { // from class: com.google.android.gms.stats.zza
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
WakeLock.zza(WakeLock.this);
|
||||
}
|
||||
}, max, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public boolean isHeld() {
|
||||
boolean z3;
|
||||
synchronized (this.zzf) {
|
||||
z3 = this.zzh > 0;
|
||||
}
|
||||
return z3;
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public void release() {
|
||||
if (this.zzt.decrementAndGet() < 0) {
|
||||
Log.e("WakeLock", String.valueOf(this.zzp).concat(" release without a matched acquire!"));
|
||||
}
|
||||
synchronized (this.zzf) {
|
||||
try {
|
||||
zzb(null);
|
||||
if (this.zzs.containsKey(null)) {
|
||||
zzc zzcVar = this.zzs.get(null);
|
||||
if (zzcVar != null) {
|
||||
int i = zzcVar.zza - 1;
|
||||
zzcVar.zza = i;
|
||||
if (i == 0) {
|
||||
this.zzs.remove(null);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.w("WakeLock", String.valueOf(this.zzp).concat(" counter does not exist"));
|
||||
}
|
||||
zzd(0);
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@KeepForSdk
|
||||
public void setReferenceCounted(boolean z3) {
|
||||
synchronized (this.zzf) {
|
||||
this.zzl = z3;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.google.android.gms.stats;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
final class zzb implements zzd {
|
||||
}
|
||||
12
apk_decompiled/sources/com/google/android/gms/stats/zzc.java
Normal file
12
apk_decompiled/sources/com/google/android/gms/stats/zzc.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package com.google.android.gms.stats;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
final class zzc {
|
||||
int zza;
|
||||
|
||||
public /* synthetic */ zzc(zzb zzbVar) {
|
||||
}
|
||||
|
||||
private zzc() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.google.android.gms.stats;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public interface zzd {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.google.android.gms.stats;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class zze {
|
||||
}
|
||||
Reference in New Issue
Block a user