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,15 @@
package androidx.savedstate;
/* loaded from: classes.dex */
public final class R {
public static final class id {
public static int view_tree_saved_state_registry_owner = 0x7f0a0292;
private id() {
}
}
private R() {
}
}

View File

@@ -0,0 +1,102 @@
package androidx.savedstate;
import android.os.Bundle;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleEventObserver;
import androidx.lifecycle.LifecycleOwner;
import androidx.savedstate.SavedStateRegistry;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class Recreator implements LifecycleEventObserver {
public static final String CLASSES_KEY = "classes_to_restore";
public static final String COMPONENT_KEY = "androidx.savedstate.Restarter";
public static final Companion Companion = new Companion(null);
private final SavedStateRegistryOwner owner;
public Recreator(SavedStateRegistryOwner owner) {
Intrinsics.checkNotNullParameter(owner, "owner");
this.owner = owner;
}
@Override // androidx.lifecycle.LifecycleEventObserver
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
Intrinsics.checkNotNullParameter(source, "source");
Intrinsics.checkNotNullParameter(event, "event");
if (event != Lifecycle.Event.ON_CREATE) {
throw new AssertionError("Next event must be ON_CREATE");
}
source.getLifecycle().removeObserver(this);
Bundle consumeRestoredStateForKey = this.owner.getSavedStateRegistry().consumeRestoredStateForKey(COMPONENT_KEY);
if (consumeRestoredStateForKey == null) {
return;
}
ArrayList<String> stringArrayList = consumeRestoredStateForKey.getStringArrayList(CLASSES_KEY);
if (stringArrayList == null) {
throw new IllegalStateException("Bundle with restored state for the component \"androidx.savedstate.Restarter\" must contain list of strings by the key \"classes_to_restore\"");
}
Iterator<String> it = stringArrayList.iterator();
while (it.hasNext()) {
reflectiveNew(it.next());
}
}
private final void reflectiveNew(String str) {
try {
Class<? extends U> asSubclass = Class.forName(str, false, Recreator.class.getClassLoader()).asSubclass(SavedStateRegistry.AutoRecreated.class);
Intrinsics.checkNotNullExpressionValue(asSubclass, "{\n Class.…class.java)\n }");
try {
Constructor declaredConstructor = asSubclass.getDeclaredConstructor(new Class[0]);
declaredConstructor.setAccessible(true);
try {
Object newInstance = declaredConstructor.newInstance(new Object[0]);
Intrinsics.checkNotNullExpressionValue(newInstance, "{\n constr…wInstance()\n }");
((SavedStateRegistry.AutoRecreated) newInstance).onRecreated(this.owner);
} catch (Exception e) {
throw new RuntimeException("Failed to instantiate " + str, e);
}
} catch (NoSuchMethodException e2) {
throw new IllegalStateException("Class " + asSubclass.getSimpleName() + " must have default constructor in order to be automatically recreated", e2);
}
} catch (ClassNotFoundException e3) {
throw new RuntimeException("Class " + str + " wasn't found", e3);
}
}
public static final class SavedStateProvider implements SavedStateRegistry.SavedStateProvider {
private final Set<String> classes;
public SavedStateProvider(SavedStateRegistry registry) {
Intrinsics.checkNotNullParameter(registry, "registry");
this.classes = new LinkedHashSet();
registry.registerSavedStateProvider(Recreator.COMPONENT_KEY, this);
}
@Override // androidx.savedstate.SavedStateRegistry.SavedStateProvider
public Bundle saveState() {
Bundle bundle = new Bundle();
bundle.putStringArrayList(Recreator.CLASSES_KEY, new ArrayList<>(this.classes));
return bundle;
}
public final void add(String className) {
Intrinsics.checkNotNullParameter(className, "className");
this.classes.add(className);
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,196 @@
package androidx.savedstate;
import android.annotation.SuppressLint;
import android.os.Bundle;
import androidx.annotation.MainThread;
import androidx.arch.core.internal.SafeIterableMap;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleEventObserver;
import androidx.lifecycle.LifecycleOwner;
import androidx.savedstate.Recreator;
import java.util.Iterator;
import java.util.Map;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@SuppressLint({"RestrictedApi"})
@SourceDebugExtension({"SMAP\nSavedStateRegistry.kt\nKotlin\n*S Kotlin\n*F\n+ 1 SavedStateRegistry.kt\nandroidx/savedstate/SavedStateRegistry\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,272:1\n1#2:273\n*E\n"})
/* loaded from: classes.dex */
public final class SavedStateRegistry {
private static final Companion Companion = new Companion(null);
@Deprecated
private static final String SAVED_COMPONENTS_KEY = "androidx.lifecycle.BundlableSavedStateRegistry.key";
private boolean attached;
private final SafeIterableMap<String, SavedStateProvider> components = new SafeIterableMap<>();
private boolean isAllowingSavingState = true;
private boolean isRestored;
private Recreator.SavedStateProvider recreatorProvider;
private Bundle restoredState;
public interface AutoRecreated {
void onRecreated(SavedStateRegistryOwner savedStateRegistryOwner);
}
public interface SavedStateProvider {
Bundle saveState();
}
public final boolean isAllowingSavingState$savedstate_release() {
return this.isAllowingSavingState;
}
@MainThread
public final boolean isRestored() {
return this.isRestored;
}
public final void setAllowingSavingState$savedstate_release(boolean z) {
this.isAllowingSavingState = z;
}
@MainThread
public final Bundle consumeRestoredStateForKey(String key) {
Intrinsics.checkNotNullParameter(key, "key");
if (!this.isRestored) {
throw new IllegalStateException("You can consumeRestoredStateForKey only after super.onCreate of corresponding component".toString());
}
Bundle bundle = this.restoredState;
if (bundle == null) {
return null;
}
Bundle bundle2 = bundle != null ? bundle.getBundle(key) : null;
Bundle bundle3 = this.restoredState;
if (bundle3 != null) {
bundle3.remove(key);
}
Bundle bundle4 = this.restoredState;
if (bundle4 == null || bundle4.isEmpty()) {
this.restoredState = null;
}
return bundle2;
}
@MainThread
public final void registerSavedStateProvider(String key, SavedStateProvider provider) {
Intrinsics.checkNotNullParameter(key, "key");
Intrinsics.checkNotNullParameter(provider, "provider");
if (this.components.putIfAbsent(key, provider) != null) {
throw new IllegalArgumentException("SavedStateProvider with the given key is already registered".toString());
}
}
public final SavedStateProvider getSavedStateProvider(String key) {
Intrinsics.checkNotNullParameter(key, "key");
Iterator<Map.Entry<String, SavedStateProvider>> it = this.components.iterator();
while (it.hasNext()) {
Map.Entry<String, SavedStateProvider> components = it.next();
Intrinsics.checkNotNullExpressionValue(components, "components");
String key2 = components.getKey();
SavedStateProvider value = components.getValue();
if (Intrinsics.areEqual(key2, key)) {
return value;
}
}
return null;
}
@MainThread
public final void unregisterSavedStateProvider(String key) {
Intrinsics.checkNotNullParameter(key, "key");
this.components.remove(key);
}
@MainThread
public final void runOnNextRecreation(Class<? extends AutoRecreated> clazz) {
Intrinsics.checkNotNullParameter(clazz, "clazz");
if (!this.isAllowingSavingState) {
throw new IllegalStateException("Can not perform this action after onSaveInstanceState".toString());
}
Recreator.SavedStateProvider savedStateProvider = this.recreatorProvider;
if (savedStateProvider == null) {
savedStateProvider = new Recreator.SavedStateProvider(this);
}
this.recreatorProvider = savedStateProvider;
try {
clazz.getDeclaredConstructor(new Class[0]);
Recreator.SavedStateProvider savedStateProvider2 = this.recreatorProvider;
if (savedStateProvider2 != null) {
String name = clazz.getName();
Intrinsics.checkNotNullExpressionValue(name, "clazz.name");
savedStateProvider2.add(name);
}
} catch (NoSuchMethodException e) {
throw new IllegalArgumentException("Class " + clazz.getSimpleName() + " must have default constructor in order to be automatically recreated", e);
}
}
@MainThread
public final void performAttach$savedstate_release(Lifecycle lifecycle) {
Intrinsics.checkNotNullParameter(lifecycle, "lifecycle");
if (!(!this.attached)) {
throw new IllegalStateException("SavedStateRegistry was already attached.".toString());
}
lifecycle.addObserver(new LifecycleEventObserver() { // from class: androidx.savedstate.SavedStateRegistry$$ExternalSyntheticLambda0
@Override // androidx.lifecycle.LifecycleEventObserver
public final void onStateChanged(LifecycleOwner lifecycleOwner, Lifecycle.Event event) {
SavedStateRegistry.performAttach$lambda$4(SavedStateRegistry.this, lifecycleOwner, event);
}
});
this.attached = true;
}
/* JADX INFO: Access modifiers changed from: private */
public static final void performAttach$lambda$4(SavedStateRegistry this$0, LifecycleOwner lifecycleOwner, Lifecycle.Event event) {
Intrinsics.checkNotNullParameter(this$0, "this$0");
Intrinsics.checkNotNullParameter(lifecycleOwner, "<anonymous parameter 0>");
Intrinsics.checkNotNullParameter(event, "event");
if (event == Lifecycle.Event.ON_START) {
this$0.isAllowingSavingState = true;
} else if (event == Lifecycle.Event.ON_STOP) {
this$0.isAllowingSavingState = false;
}
}
@MainThread
public final void performRestore$savedstate_release(Bundle bundle) {
if (!this.attached) {
throw new IllegalStateException("You must call performAttach() before calling performRestore(Bundle).".toString());
}
if (!(!this.isRestored)) {
throw new IllegalStateException("SavedStateRegistry was already restored.".toString());
}
this.restoredState = bundle != null ? bundle.getBundle(SAVED_COMPONENTS_KEY) : null;
this.isRestored = true;
}
@MainThread
public final void performSave(Bundle outBundle) {
Intrinsics.checkNotNullParameter(outBundle, "outBundle");
Bundle bundle = new Bundle();
Bundle bundle2 = this.restoredState;
if (bundle2 != null) {
bundle.putAll(bundle2);
}
SafeIterableMap<String, SavedStateProvider>.IteratorWithAdditions iteratorWithAdditions = this.components.iteratorWithAdditions();
Intrinsics.checkNotNullExpressionValue(iteratorWithAdditions, "this.components.iteratorWithAdditions()");
while (iteratorWithAdditions.hasNext()) {
Map.Entry next = iteratorWithAdditions.next();
bundle.putBundle((String) next.getKey(), ((SavedStateProvider) next.getValue()).saveState());
}
if (bundle.isEmpty()) {
return;
}
outBundle.putBundle(SAVED_COMPONENTS_KEY, bundle);
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,75 @@
package androidx.savedstate;
import android.os.Bundle;
import androidx.annotation.MainThread;
import androidx.lifecycle.Lifecycle;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class SavedStateRegistryController {
public static final Companion Companion = new Companion(null);
private boolean attached;
private final SavedStateRegistryOwner owner;
private final SavedStateRegistry savedStateRegistry;
public /* synthetic */ SavedStateRegistryController(SavedStateRegistryOwner savedStateRegistryOwner, DefaultConstructorMarker defaultConstructorMarker) {
this(savedStateRegistryOwner);
}
public static final SavedStateRegistryController create(SavedStateRegistryOwner savedStateRegistryOwner) {
return Companion.create(savedStateRegistryOwner);
}
public final SavedStateRegistry getSavedStateRegistry() {
return this.savedStateRegistry;
}
private SavedStateRegistryController(SavedStateRegistryOwner savedStateRegistryOwner) {
this.owner = savedStateRegistryOwner;
this.savedStateRegistry = new SavedStateRegistry();
}
@MainThread
public final void performAttach() {
Lifecycle lifecycle = this.owner.getLifecycle();
if (lifecycle.getCurrentState() != Lifecycle.State.INITIALIZED) {
throw new IllegalStateException("Restarter must be created only during owner's initialization stage".toString());
}
lifecycle.addObserver(new Recreator(this.owner));
this.savedStateRegistry.performAttach$savedstate_release(lifecycle);
this.attached = true;
}
@MainThread
public final void performRestore(Bundle bundle) {
if (!this.attached) {
performAttach();
}
Lifecycle lifecycle = this.owner.getLifecycle();
if (!(!lifecycle.getCurrentState().isAtLeast(Lifecycle.State.STARTED))) {
throw new IllegalStateException(("performRestore cannot be called when owner is " + lifecycle.getCurrentState()).toString());
}
this.savedStateRegistry.performRestore$savedstate_release(bundle);
}
@MainThread
public final void performSave(Bundle outBundle) {
Intrinsics.checkNotNullParameter(outBundle, "outBundle");
this.savedStateRegistry.performSave(outBundle);
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final SavedStateRegistryController create(SavedStateRegistryOwner owner) {
Intrinsics.checkNotNullParameter(owner, "owner");
return new SavedStateRegistryController(owner, null);
}
}
}

View File

@@ -0,0 +1,8 @@
package androidx.savedstate;
import androidx.lifecycle.LifecycleOwner;
/* loaded from: classes.dex */
public interface SavedStateRegistryOwner extends LifecycleOwner {
SavedStateRegistry getSavedStateRegistry();
}

View File

@@ -0,0 +1,47 @@
package androidx.savedstate;
import android.view.View;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.sequences.Sequence;
import kotlin.sequences.SequencesKt__SequencesKt;
import kotlin.sequences.SequencesKt___SequencesKt;
/* loaded from: classes.dex */
public final class ViewTreeSavedStateRegistryOwner {
public static final void set(View view, SavedStateRegistryOwner savedStateRegistryOwner) {
Intrinsics.checkNotNullParameter(view, "<this>");
view.setTag(R.id.view_tree_saved_state_registry_owner, savedStateRegistryOwner);
}
public static final SavedStateRegistryOwner get(View view) {
Sequence generateSequence;
Sequence mapNotNull;
Object firstOrNull;
Intrinsics.checkNotNullParameter(view, "<this>");
generateSequence = SequencesKt__SequencesKt.generateSequence(view, new Function1() { // from class: androidx.savedstate.ViewTreeSavedStateRegistryOwner$findViewTreeSavedStateRegistryOwner$1
@Override // kotlin.jvm.functions.Function1
public final View invoke(View view2) {
Intrinsics.checkNotNullParameter(view2, "view");
Object parent = view2.getParent();
if (parent instanceof View) {
return (View) parent;
}
return null;
}
});
mapNotNull = SequencesKt___SequencesKt.mapNotNull(generateSequence, new Function1() { // from class: androidx.savedstate.ViewTreeSavedStateRegistryOwner$findViewTreeSavedStateRegistryOwner$2
@Override // kotlin.jvm.functions.Function1
public final SavedStateRegistryOwner invoke(View view2) {
Intrinsics.checkNotNullParameter(view2, "view");
Object tag = view2.getTag(R.id.view_tree_saved_state_registry_owner);
if (tag instanceof SavedStateRegistryOwner) {
return (SavedStateRegistryOwner) tag;
}
return null;
}
});
firstOrNull = SequencesKt___SequencesKt.firstOrNull(mapNotNull);
return (SavedStateRegistryOwner) firstOrNull;
}
}