导航菜单

页面标题

页面副标题

Kreate v1.5.0 - ActionReceiver.java 源代码

正在查看: Kreate v1.5.0 应用的 ActionReceiver.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package it.fast4x.rimusic.utils;

import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.drawable.Icon;
import android.os.Build;
import androidx.core.content.ContextCompat;
import io.ktor.http.LinkHeader;
import it.fast4x.rimusic.utils.ActionReceiver;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.TuplesKt;
import kotlin.Unit;
import kotlin.collections.MapsKt;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlin.properties.PropertyDelegateProvider;
import kotlin.properties.ReadOnlyProperty;
import kotlin.reflect.KProperty;

@Metadata(d1 = {"\u0000d\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010$\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0005\b'\u0018\u0000 '2\u00020\u0001:\u0002'(B\u000f\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0004\b\u0004\u0010\u0005Jc\u0010\u0012\u001a\u001a\u0012\u0004\u0012\u00020\u0000\u0012\u0010\u0012\u000e\u0012\u0004\u0012\u00020\u0000\u0012\u0004\u0012\u00020\b0\u00140\u00132\n\b\u0002\u0010\u0015\u001a\u0004\u0018\u00010\u00162\n\b\u0002\u0010\u0017\u001a\u0004\u0018\u00010\u00032\n\b\u0002\u0010\u0018\u001a\u0004\u0018\u00010\u00032\u0018\u0010\u0019\u001a\u0014\u0012\u0004\u0012\u00020\u001b\u0012\u0004\u0012\u00020\u001c\u0012\u0004\u0012\u00020\u001d0\u001aH\u0000¢\u0006\u0002\b\u001eJ\u0018\u0010\u0019\u001a\u00020\u001d2\u0006\u0010\u001f\u001a\u00020\u001b2\u0006\u0010 \u001a\u00020\u001cH\u0016J$\u0010!\u001a\t\u0018\u00010\u001c¢\u0006\u0002\b\"2\b\b\u0002\u0010#\u001a\u00020$H\u0007R\u00020\u001b¢\u0006\u0004\b%\u0010&J\u001f\u0010!\u001a\t\u0018\u00010\u001c¢\u0006\u0002\b\"2\u0006\u0010\u001f\u001a\u00020\u001b2\b\b\u0002\u0010#\u001a\u00020$R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R*\u0010\u0006\u001a\u001e\u0012\u0004\u0012\u00020\u0003\u0012\u0004\u0012\u00020\b0\u0007j\u000e\u0012\u0004\u0012\u00020\u0003\u0012\u0004\u0012\u00020\b`\tX\u0082\u0004¢\u0006\u0002\n\u0000R\u001d\u0010\n\u001a\u000e\u0012\u0004\u0012\u00020\u0003\u0012\u0004\u0012\u00020\b0\u000b8F¢\u0006\u0006\u001a\u0004\b\f\u0010\rR\u0011\u0010\u000e\u001a\u00020\u000f8F¢\u0006\u0006\u001a\u0004\b\u0010\u0010\u0011¨\u0006)"}, d2 = {"Lit/fast4x/rimusic/utils/ActionReceiver;", "Landroid/content/BroadcastReceiver;", "base", "", "<init>", "(Ljava/lang/String;)V", "mutableActions", "Ljava/util/HashMap;", "Lit/fast4x/rimusic/utils/ActionReceiver$Action;", "Lkotlin/collections/HashMap;", "all", "", "getAll", "()Ljava/util/Map;", "intentFilter", "Landroid/content/IntentFilter;", "getIntentFilter", "()Landroid/content/IntentFilter;", "action", "Lkotlin/properties/PropertyDelegateProvider;", "Lkotlin/properties/ReadOnlyProperty;", "icon", "Landroid/graphics/drawable/Icon;", LinkHeader.Parameters.Title, "contentDescription", "onReceive", "Lkotlin/Function2;", "Landroid/content/Context;", "Landroid/content/Intent;", "", "action$composeApp_full", "context", "intent", "register", "Lorg/jspecify/annotations/Nullable;", "flags", "", "_register", "(Landroid/content/Context;I)Landroid/content/Intent;", "Companion", "Action", "composeApp_full"}, k = 1, mv = {2, 1, 0}, xi = 48)
public abstract class ActionReceiver extends BroadcastReceiver {
    public static final int REQUEST_CODE = 100;
    private final String base;
    private final HashMap<String, Action> mutableActions;
    public static final int $stable = 8;

    public ActionReceiver(String base) {
        Intrinsics.checkNotNullParameter(base, "base");
        this.base = base;
        this.mutableActions = new HashMap<>();
    }

    @Metadata(d1 = {"\u00004\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0007\u0018\u00002\u00020\u0001BI\b\u0000\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\b\u0010\u0004\u001a\u0004\u0018\u00010\u0005\u0012\b\u0010\u0006\u001a\u0004\u0018\u00010\u0003\u0012\b\u0010\u0007\u001a\u0004\u0018\u00010\u0003\u0012\u0018\u0010\b\u001a\u0014\u0012\u0004\u0012\u00020\n\u0012\u0004\u0012\u00020\u000b\u0012\u0004\u0012\u00020\f0\t¢\u0006\u0004\b\r\u0010\u000eR\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u000f\u0010\u0010R\u0013\u0010\u0004\u001a\u0004\u0018\u00010\u0005¢\u0006\b\n\u0000\u001a\u0004\b\u0011\u0010\u0012R\u0013\u0010\u0006\u001a\u0004\u0018\u00010\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u0013\u0010\u0010R\u0013\u0010\u0007\u001a\u0004\u0018\u00010\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u0014\u0010\u0010R&\u0010\b\u001a\u0014\u0012\u0004\u0012\u00020\n\u0012\u0004\u0012\u00020\u000b\u0012\u0004\u0012\u00020\f0\tX\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0015\u0010\u0016R\u0015\u0010\u0017\u001a\u00020\u00188Fb\u00020\n¢\u0006\u0006\u001a\u0004\b\u0019\u0010\u001a¨\u0006\u001b"}, d2 = {"Lit/fast4x/rimusic/utils/ActionReceiver$Action;", "", "value", "", "icon", "Landroid/graphics/drawable/Icon;", LinkHeader.Parameters.Title, "contentDescription", "onReceive", "Lkotlin/Function2;", "Landroid/content/Context;", "Landroid/content/Intent;", "", "<init>", "(Ljava/lang/String;Landroid/graphics/drawable/Icon;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function2;)V", "getValue", "()Ljava/lang/String;", "getIcon", "()Landroid/graphics/drawable/Icon;", "getTitle", "getContentDescription", "getOnReceive$composeApp_full", "()Lkotlin/jvm/functions/Function2;", "pendingIntent", "Landroid/app/PendingIntent;", "getPendingIntent", "(Landroid/content/Context;)Landroid/app/PendingIntent;", "composeApp_full"}, k = 1, mv = {2, 1, 0}, xi = 48)
    public static final class Action {
        public static final int $stable = 8;
        private final String contentDescription;
        private final Icon icon;
        private final Function2<Context, Intent, Unit> onReceive;
        private final String title;
        private final String value;

        public Action(String value, Icon icon, String str, String str2, Function2<? super Context, ? super Intent, Unit> onReceive) {
            Intrinsics.checkNotNullParameter(value, "value");
            Intrinsics.checkNotNullParameter(onReceive, "onReceive");
            this.value = value;
            this.icon = icon;
            this.title = str;
            this.contentDescription = str2;
            this.onReceive = onReceive;
        }

        public final String getValue() {
            return this.value;
        }

        public final Icon getIcon() {
            return this.icon;
        }

        public final String getTitle() {
            return this.title;
        }

        public final String getContentDescription() {
            return this.contentDescription;
        }

        public final Function2<Context, Intent, Unit> getOnReceive$composeApp_full() {
            return this.onReceive;
        }

        public final PendingIntent getPendingIntent(Context context_receiver_0) {
            Intrinsics.checkNotNullParameter(context_receiver_0, "$context_receiver_0");
            PendingIntent broadcast = PendingIntent.getBroadcast(context_receiver_0, 100, new Intent(this.value).setPackage(context_receiver_0.getPackageName()), (Build.VERSION.SDK_INT >= 23 ? 67108864 : 0) | 134217728);
            Intrinsics.checkNotNullExpressionValue(broadcast, "getBroadcast(...)");
            return broadcast;
        }
    }

    public final Map<String, Action> getAll() {
        return MapsKt.toMap(this.mutableActions);
    }

    public final IntentFilter getIntentFilter() {
        IntentFilter intentFilter = new IntentFilter();
        Set<String> keySet = this.mutableActions.keySet();
        Intrinsics.checkNotNullExpressionValue(keySet, "<get-keys>(...)");
        Iterator<T> it2 = keySet.iterator();
        while (it2.hasNext()) {
            intentFilter.addAction((String) it2.next());
        }
        return intentFilter;
    }

    public static PropertyDelegateProvider action$composeApp_full$default(ActionReceiver actionReceiver, Icon icon, String str, String str2, Function2 function2, int i, Object obj) {
        if (obj != null) {
            throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: action");
        }
        if ((i & 1) != 0) {
            icon = null;
        }
        if ((i & 2) != 0) {
            str = null;
        }
        if ((i & 4) != 0) {
            str2 = null;
        }
        return actionReceiver.action$composeApp_full(icon, str, str2, function2);
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        Function2<Context, Intent, Unit> onReceive$composeApp_full;
        Intrinsics.checkNotNullParameter(context, "context");
        Intrinsics.checkNotNullParameter(intent, "intent");
        Action action = this.mutableActions.get(intent.getAction());
        if (action == null || (onReceive$composeApp_full = action.getOnReceive$composeApp_full()) == null) {
            return;
        }
        onReceive$composeApp_full.invoke(context, intent);
    }

    public static Intent _register$default(ActionReceiver actionReceiver, Context context, int i, int i2, Object obj) {
        if (obj != null) {
            throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: register");
        }
        if ((i2 & 2) != 0) {
            i = 4;
        }
        return actionReceiver._register(context, i);
    }

    public final Intent _register(Context context_receiver_0, int i) {
        Intrinsics.checkNotNullParameter(context_receiver_0, "$context_receiver_0");
        return register(context_receiver_0, i);
    }

    public static Intent register$default(ActionReceiver actionReceiver, Context context, int i, int i2, Object obj) {
        if (obj != null) {
            throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: register");
        }
        if ((i2 & 2) != 0) {
            i = 4;
        }
        return actionReceiver.register(context, i);
    }

    public final Intent register(Context context, int flags) {
        Intrinsics.checkNotNullParameter(context, "context");
        return ContextCompat.registerReceiver(context, this, getIntentFilter(), flags);
    }

    public final PropertyDelegateProvider<ActionReceiver, ReadOnlyProperty<ActionReceiver, Action>> action$composeApp_full(final Icon icon, final String title, final String contentDescription, final Function2<? super Context, ? super Intent, Unit> onReceive) {
        Intrinsics.checkNotNullParameter(onReceive, "onReceive");
        return new PropertyDelegateProvider() {
            @Override
            public Object provideDelegate(Object obj, KProperty kProperty) {
                return provideDelegate((ActionReceiver) obj, (KProperty<?>) kProperty);
            }

            @Override
            public final ReadOnlyProperty<ActionReceiver, ActionReceiver.Action> provideDelegate(ActionReceiver actionReceiver, KProperty<?> property) {
                String str;
                HashMap hashMap;
                Intrinsics.checkNotNullParameter(property, "property");
                str = ActionReceiver.this.base;
                String str2 = str + IPCheckerKt.DELIM + property.getName();
                final ActionReceiver.Action action = new ActionReceiver.Action(str2, icon, title, contentDescription, onReceive);
                hashMap = actionReceiver.mutableActions;
                Pair pair = TuplesKt.to(str2, action);
                hashMap.put(pair.getFirst(), pair.getSecond());
                final Function2<ActionReceiver, KProperty<?>, ActionReceiver.Action> function2 = new Function2<ActionReceiver, KProperty<?>, ActionReceiver.Action>() {
                    @Override
                    public final ActionReceiver.Action invoke(ActionReceiver actionReceiver2, KProperty<?> kProperty) {
                        Intrinsics.checkNotNullParameter(actionReceiver2, "<unused var>");
                        Intrinsics.checkNotNullParameter(kProperty, "<unused var>");
                        return ActionReceiver.Action.this;
                    }
                };
                return new ReadOnlyProperty() {
                    @Override
                    public final ActionReceiver.Action getValue(ActionReceiver actionReceiver2, KProperty<?> innerProperty) {
                        Intrinsics.checkNotNullParameter(innerProperty, "innerProperty");
                        return Function2.this.invoke(actionReceiver2, innerProperty);
                    }
                };
            }
        };
    }
}