Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
package com.google.firebase.crashlytics.internal.common;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import com.applovin.sdk.AppLovinEventTypes;
import com.google.firebase.crashlytics.internal.Logger;
/* loaded from: classes3.dex */
public class BatteryState {
public final Float level;
public final boolean powerConnected;
public Float getBatteryLevel() {
return this.level;
}
public BatteryState(Float f, boolean z) {
this.powerConnected = z;
this.level = f;
}
public int getBatteryVelocity() {
Float f;
if (!this.powerConnected || (f = this.level) == null) {
return 1;
}
return ((double) f.floatValue()) < 0.99d ? 2 : 3;
}
public static BatteryState get(Context context) {
boolean z = false;
Float f = null;
try {
Intent registerReceiver = context.registerReceiver(null, new IntentFilter("android.intent.action.BATTERY_CHANGED"));
if (registerReceiver != null) {
z = isPowerConnected(registerReceiver);
f = getLevel(registerReceiver);
}
} catch (IllegalStateException e) {
Logger.getLogger().e("An error occurred getting battery state.", e);
}
return new BatteryState(f, z);
}
public static boolean isPowerConnected(Intent intent) {
int intExtra = intent.getIntExtra("status", -1);
if (intExtra == -1) {
return false;
}
return intExtra == 2 || intExtra == 5;
}
public static Float getLevel(Intent intent) {
int intExtra = intent.getIntExtra(AppLovinEventTypes.USER_COMPLETED_LEVEL, -1);
int intExtra2 = intent.getIntExtra("scale", -1);
if (intExtra == -1 || intExtra2 == -1) {
return null;
}
return Float.valueOf(intExtra / intExtra2);
}
}