APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:CoinCalc
版本号:17.5
包名称:com.samruston.flip

MD5 校验值:719081c19dfabad7b000ef11fc4f3317

反编译源代码说明

BaseWidgetPro.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package com.samruston.flip.widgets;

import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.widget.RemoteViews;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.Xjqh.nBvyS;
import com.google.android.material.timepicker.GOQC.kBtYkq;
import com.samruston.flip.CurrencySwitcherActivity;
import com.samruston.flip.MainActivity;
import com.samruston.flip.PendingIntentKt;
import com.samruston.flip.R;
import com.samruston.flip.services.WidgetUpdateReceiver;
import com.samruston.flip.utils.CustomRemoteViews;
import com.samruston.flip.utils.ProMode;
import com.samruston.flip.utils.Utils;
import com.samruston.flip.utils.WidgetManager;
import com.samruston.flip.widgets.BaseWidget;
import g4.HORM.IMrTeQhIyR;
import kotlin.Metadata;
import s0.NtA.SujKJQxN;
import z3.g;
import z3.k;

@Metadata(d1 = {"\u0000N\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0015\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0006\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0007\b&\u0018\u0000 \"2\u00020\u0001:\u0001\"B\u0007¢\u0006\u0004\b \u0010!J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H&J \u0010\u000b\u001a\u00020\n2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0007\u001a\u00020\u00062\u0006\u0010\t\u001a\u00020\bH\u0016J\b\u0010\f\u001a\u00020\u0004H'J\b\u0010\u000e\u001a\u00020\rH&J\u0010\u0010\u000f\u001a\u00020\n2\u0006\u0010\u0003\u001a\u00020\u0002H\u0016J\u0010\u0010\u0010\u001a\u00020\n2\u0006\u0010\u0003\u001a\u00020\u0002H\u0016J\u0018\u0010\u0012\u001a\u00020\n2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0011\u001a\u00020\bH\u0016J \u0010\u0015\u001a\u00020\u00142\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0007\u001a\u00020\u00062\u0006\u0010\u0013\u001a\u00020\u0004H\u0016J&\u0010\u001b\u001a\u00020\n2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0017\u001a\u00020\u00162\u0006\u0010\u0018\u001a\u00020\u00042\u0006\u0010\u001a\u001a\u00020\u0019J(\u0010\u001e\u001a\u00020\n2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0007\u001a\u00020\u00062\u0006\u0010\u0013\u001a\u00020\u00042\u0006\u0010\u001d\u001a\u00020\u001cH\u0016J\u0010\u0010\u001f\u001a\u00020\n2\u0006\u0010\u0003\u001a\u00020\u0002H\u0016¨\u0006#"}, d2 = {"Lcom/samruston/flip/widgets/BaseWidgetPro;", "Lcom/samruston/flip/utils/WidgetManager$WidgetFeatures;", "Landroid/content/Context;", "context", "", "getTopColor", "Landroid/appwidget/AppWidgetManager;", "appWidgetManager", "", "appWidgetIds", "Ln3/x;", "onUpdate", "getLayout", "", "isTransparent", "onEnabled", "onDisabled", "widgetIds", "onDeleted", "appWidgetId", "", "updateAppWidget", "Lcom/samruston/flip/utils/CustomRemoteViews;", "customRemoteViews", "id", "Lcom/samruston/flip/widgets/BaseWidget$WidgetAction;", "action", "setIntent", "Landroid/os/Bundle;", "newOptions", "onAppWidgetOptionsChanged", "updateAllWidgets", "<init>", "()V", "Companion", "app_release"}, k = 1, mv = {1, 8, LinearLayoutManager.HORIZONTAL})
public abstract class BaseWidgetPro extends WidgetManager.WidgetFeatures {

    public static final Companion INSTANCE = new Companion(null);

    @Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0016\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\b¨\u0006\t"}, d2 = {"Lcom/samruston/flip/widgets/BaseWidgetPro$Companion;", "", "()V", "makeWidgetIntent", "Landroid/content/Intent;", "context", "Landroid/content/Context;", "action", "Lcom/samruston/flip/widgets/BaseWidget$WidgetAction;", "app_release"}, k = 1, mv = {1, 8, LinearLayoutManager.HORIZONTAL}, xi = 48)
    public static final class Companion {
        private Companion() {
        }

        public Companion(g gVar) {
            this();
        }

        public final Intent makeWidgetIntent(Context context, BaseWidget.WidgetAction action) {
            k.f(context, "context");
            k.f(action, "action");
            Intent intent = new Intent(context.getApplicationContext(), (Class<?>) WidgetUpdateReceiver.class);
            intent.putExtra("action", action);
            intent.setFlags(67108864);
            intent.setAction("buttonPress " + action + ' ' + Math.random());
            return intent;
        }
    }

    public abstract int getLayout();

    public abstract int getTopColor(Context context);

    public abstract boolean isTransparent();

    @Override
    public void onDeleted(Context context, int[] iArr) {
        k.f(context, "context");
        k.f(iArr, IMrTeQhIyR.wWXB);
    }

    @Override
    public void onDisabled(Context context) {
        k.f(context, "context");
    }

    @Override
    public void onEnabled(Context context) {
        k.f(context, "context");
    }

    @Override
    public void onAppWidgetOptionsChanged(Context context, AppWidgetManager appWidgetManager, int i8, Bundle bundle) {
        k.f(context, "context");
        k.f(appWidgetManager, "appWidgetManager");
        k.f(bundle, "newOptions");
        updateAppWidget(context, appWidgetManager, i8);
    }

    @Override
    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] iArr) {
        k.f(context, "context");
        k.f(appWidgetManager, "appWidgetManager");
        k.f(iArr, "appWidgetIds");
        int length = iArr.length - 1;
        if (length >= 0) {
            int i8 = 0;
            while (true) {
                updateAppWidget(context, appWidgetManager, iArr[i8]);
                if (i8 != length) {
                    i8++;
                } else {
                    return;
                }
            }
        }
    }

    public final void setIntent(Context context, CustomRemoteViews customRemoteViews, int i8, BaseWidget.WidgetAction widgetAction) {
        k.f(context, "context");
        k.f(customRemoteViews, "customRemoteViews");
        k.f(widgetAction, "action");
        Context applicationContext = context.getApplicationContext();
        Companion companion = INSTANCE;
        Context applicationContext2 = context.getApplicationContext();
        k.e(applicationContext2, "context.applicationContext");
        PendingIntent broadcast = PendingIntent.getBroadcast(applicationContext, 0, companion.makeWidgetIntent(applicationContext2, widgetAction), 134217728 | PendingIntentKt.getDefaultPendingFlags());
        k.e(broadcast, "pendingIntent");
        customRemoteViews.setOnClickPendingIntent(i8, broadcast);
    }

    @Override
    public void updateAllWidgets(Context context) {
        k.f(context, kBtYkq.bWcn);
        AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
        for (int i8 : appWidgetManager.getAppWidgetIds(new ComponentName(context, getClass()))) {
            k.e(appWidgetManager, nBvyS.DCvWTfvN);
            updateAppWidget(context, appWidgetManager, i8);
        }
    }

    @Override
    public Object updateAppWidget(Context context, AppWidgetManager appWidgetManager, int appWidgetId) {
        k.f(context, "context");
        k.f(appWidgetManager, "appWidgetManager");
        if (!ProMode.INSTANCE.hasPurchased(context)) {
            CustomRemoteViews customRemoteViews = new CustomRemoteViews(context, R.layout.widget_upgrade, false);
            Object views = customRemoteViews.getViews();
            k.d(views, "null cannot be cast to non-null type android.widget.RemoteViews");
            appWidgetManager.updateAppWidget(appWidgetId, (RemoteViews) views);
            return customRemoteViews;
        }
        CustomRemoteViews customRemoteViews2 = new CustomRemoteViews(context, getLayout(), false);
        try {
            Intent intent = new Intent(context, (Class<?>) WidgetListService.class);
            intent.putExtra(SujKJQxN.UALXDHPTFDqlRpu, appWidgetId);
            intent.putExtra("random", Math.random());
            intent.setData(Uri.parse(intent.toUri(1)));
            customRemoteViews2.setRemoteAdapter(R.id.list, intent);
            PendingIntent broadcast = PendingIntent.getBroadcast(context.getApplicationContext(), 0, new Intent(context.getApplicationContext(), (Class<?>) WidgetUpdateReceiver.class), PendingIntentKt.getDefaultPendingFlags() | 134217728);
            int i8 = R.id.list;
            k.e(broadcast, "selectedPendingIntent");
            customRemoteViews2.setPendingIntentTemplate(i8, broadcast);
            customRemoteViews2.setViewVisibility(R.id.titleBarContainer, Utils.INSTANCE.showLastUpdated(context));
            if (!isTransparent()) {
                customRemoteViews2.setColorFilter(R.id.refresh, -16777216);
                customRemoteViews2.setTextColor(R.id.time, -16777216);
            }
            int i9 = R.id.time;
            String string = context.getResources().getString(R.string.last_updated_time, CurrencySwitcherActivity.Companion.getLastUpdateTime$default(CurrencySwitcherActivity.INSTANCE, context, false, 2, null));
            k.e(string, "context.resources.getStr…tLastUpdateTime(context))");
            customRemoteViews2.setText(i9, string);
            setIntent(context, customRemoteViews2, R.id.refresh, BaseWidget.WidgetAction.REFRESH);
            setIntent(context, customRemoteViews2, R.id.keypad0, BaseWidget.WidgetAction.ZERO);
            setIntent(context, customRemoteViews2, R.id.keypad1, BaseWidget.WidgetAction.ONE);
            setIntent(context, customRemoteViews2, R.id.keypad2, BaseWidget.WidgetAction.TWO);
            setIntent(context, customRemoteViews2, R.id.keypad3, BaseWidget.WidgetAction.THREE);
            setIntent(context, customRemoteViews2, R.id.keypad4, BaseWidget.WidgetAction.FOUR);
            setIntent(context, customRemoteViews2, R.id.keypad5, BaseWidget.WidgetAction.FIVE);
            setIntent(context, customRemoteViews2, R.id.keypad6, BaseWidget.WidgetAction.SIX);
            setIntent(context, customRemoteViews2, R.id.keypad7, BaseWidget.WidgetAction.SEVEN);
            setIntent(context, customRemoteViews2, R.id.keypad8, BaseWidget.WidgetAction.EIGHT);
            setIntent(context, customRemoteViews2, R.id.keypad9, BaseWidget.WidgetAction.NINE);
            setIntent(context, customRemoteViews2, R.id.keypadDecimal, BaseWidget.WidgetAction.DECIMAL);
            setIntent(context, customRemoteViews2, R.id.keypadDelete, BaseWidget.WidgetAction.DELETE);
            customRemoteViews2.setBackgroundColor(R.id.list, getTopColor(context));
            PendingIntent activity = PendingIntent.getActivity(context.getApplicationContext(), 0, new Intent(context, (Class<?>) MainActivity.class), PendingIntentKt.getDefaultPendingFlags() | 134217728);
            int i10 = R.id.titleBarContainer;
            k.e(activity, "pendingIntent");
            customRemoteViews2.setOnClickPendingIntent(i10, activity);
            Object views2 = customRemoteViews2.getViews();
            k.d(views2, "null cannot be cast to non-null type android.widget.RemoteViews");
            appWidgetManager.updateAppWidget(appWidgetId, (RemoteViews) views2);
            return customRemoteViews2;
        } catch (Exception e8) {
            e8.printStackTrace();
            return customRemoteViews2;
        }
    }
}