MD5 校验值:719081c19dfabad7b000ef11fc4f3317
BaseWidget.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.os.Bundle; import android.widget.RemoteViews; import androidx.recyclerview.widget.LinearLayoutManager; import com.android.billingclient.api.Uu.fjIApSKKJvQ; 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.CurrencyManager; import com.samruston.flip.utils.CustomRemoteViews; import com.samruston.flip.utils.MultiConfigManager; import com.samruston.flip.utils.Utils; import com.samruston.flip.utils.WidgetManager; import com.samruston.flip.utils.oT.EXLFzoAaBfr; import kotlin.Metadata; import z0.dxa.xqAnwnogMlP; 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\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0015\n\u0000\n\u0002\u0018\u0002\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\b\b&\u0018\u0000 \"2\u00020\u0001:\u0002\"#B\u0007¢\u0006\u0004\b \u0010!J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H&J\b\u0010\u0007\u001a\u00020\u0006H&J\b\u0010\b\u001a\u00020\u0004H'J \u0010\u000e\u001a\u00020\r2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\n\u001a\u00020\t2\u0006\u0010\f\u001a\u00020\u000bH\u0016J\u0010\u0010\u000f\u001a\u00020\r2\u0006\u0010\u0003\u001a\u00020\u0002H\u0016J\u0010\u0010\u0010\u001a\u00020\r2\u0006\u0010\u0003\u001a\u00020\u0002H\u0016J\u0018\u0010\u0012\u001a\u00020\r2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0011\u001a\u00020\u000bH\u0016J \u0010\u0015\u001a\u00020\u00142\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\n\u001a\u00020\t2\u0006\u0010\u0013\u001a\u00020\u0004H\u0016J&\u0010\u001b\u001a\u00020\r2\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\r2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\n\u001a\u00020\t2\u0006\u0010\u0013\u001a\u00020\u00042\u0006\u0010\u001d\u001a\u00020\u001cH\u0016J\u0010\u0010\u001f\u001a\u00020\r2\u0006\u0010\u0003\u001a\u00020\u0002H\u0016¨\u0006$"}, d2 = {"Lcom/samruston/flip/widgets/BaseWidget;", "Lcom/samruston/flip/utils/WidgetManager$WidgetFeatures;", "Landroid/content/Context;", "context", "", "getTopColor", "", "isTransparent", "getLayout", "Landroid/appwidget/AppWidgetManager;", "appWidgetManager", "", "appWidgetIds", "Ln3/x;", "onUpdate", "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", "WidgetAction", "app_release"}, k = 1, mv = {1, 8, LinearLayoutManager.HORIZONTAL}) public abstract class BaseWidget extends WidgetManager.WidgetFeatures { public static final Companion INSTANCE = new Companion(null); @Metadata(d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u000e\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006J \u0010\u0007\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\b\u001a\u00020\t2\b\b\u0002\u0010\n\u001a\u00020\u000b¨\u0006\f"}, d2 = {"Lcom/samruston/flip/widgets/BaseWidget$Companion;", "", "()V", "makeOpenAppIntent", "Landroid/content/Intent;", "context", "Landroid/content/Context;", "makeWidgetIntent", "action", "Lcom/samruston/flip/widgets/BaseWidget$WidgetAction;", "position", "", "app_release"}, k = 1, mv = {1, 8, LinearLayoutManager.HORIZONTAL}, xi = 48) public static final class Companion { private Companion() { } public Companion(g gVar) { this(); } public static Intent makeWidgetIntent$default(Companion companion, Context context, WidgetAction widgetAction, int i8, int i9, Object obj) { if ((i9 & 4) != 0) { i8 = 0; } return companion.makeWidgetIntent(context, widgetAction, i8); } public final Intent makeOpenAppIntent(Context context) { k.f(context, "context"); Intent intent = new Intent(context.getApplicationContext(), (Class<?>) MainActivity.class); intent.setFlags(67108864); return intent; } public final Intent makeWidgetIntent(Context context, WidgetAction action, int position) { 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(fjIApSKKJvQ.VXwZvld + action + '-' + position); return intent; } } @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0010\b\u0086\u0001\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002j\u0002\b\u0003j\u0002\b\u0004j\u0002\b\u0005j\u0002\b\u0006j\u0002\b\u0007j\u0002\b\bj\u0002\b\tj\u0002\b\nj\u0002\b\u000bj\u0002\b\fj\u0002\b\rj\u0002\b\u000ej\u0002\b\u000fj\u0002\b\u0010¨\u0006\u0011"}, d2 = {"Lcom/samruston/flip/widgets/BaseWidget$WidgetAction;", "", "(Ljava/lang/String;I)V", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "ZERO", "DECIMAL", "DELETE", "SELECT", "REFRESH", "app_release"}, k = 1, mv = {1, 8, LinearLayoutManager.HORIZONTAL}, xi = 48) public enum WidgetAction { ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, ZERO, DECIMAL, DELETE, SELECT, REFRESH } 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, "widgetIds"); } @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, xqAnwnogMlP.hgZulaZScA); 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, 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$default(companion, applicationContext2, widgetAction, 0, 4, null), 134217728 | PendingIntentKt.getDefaultPendingFlags()); k.e(broadcast, "pendingIntent"); customRemoteViews.setOnClickPendingIntent(i8, broadcast); } @Override public void updateAllWidgets(Context context) { k.f(context, "context"); AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context); for (int i8 : appWidgetManager.getAppWidgetIds(new ComponentName(context, getClass()))) { k.e(appWidgetManager, "manager"); updateAppWidget(context, appWidgetManager, i8); } } @Override public Object updateAppWidget(Context context, AppWidgetManager appWidgetManager, int appWidgetId) { String str; k.f(context, "context"); k.f(appWidgetManager, "appWidgetManager"); CustomRemoteViews customRemoteViews = new CustomRemoteViews(context, getLayout(), false); try { String widgetString = WidgetManager.INSTANCE.getWidgetString(context); CurrencyManager.Companion companion = CurrencyManager.INSTANCE; double parseDouble = Double.parseDouble(companion.getInstance(context).removeSymbols(widgetString)); MultiConfigManager.Companion companion2 = MultiConfigManager.INSTANCE; String str2 = companion2.getInstance(context).getCurrencies().get(0); String str3 = companion2.getInstance(context).getCurrencies().get(1); String format$default = CurrencyManager.Companion.format$default(companion, context, companion.getInstance(context).convert(str2, str3, parseDouble), str3, false, 8, null); int i8 = R.id.fromValue; StringBuilder sb = new StringBuilder(); Utils utils = Utils.INSTANCE; String str4 = ""; if (!utils.showSymbol(context)) { str = ""; } else { str = companion.getInstance(context).getSymbol(str2); } sb.append(str); sb.append(widgetString); customRemoteViews.setText(i8, sb.toString()); int i9 = R.id.toValue; StringBuilder sb2 = new StringBuilder(); if (utils.showSymbol(context)) { str4 = companion.getInstance(context).getSymbol(str3); } sb2.append(str4); sb2.append(format$default); customRemoteViews.setText(i9, sb2.toString()); customRemoteViews.setText(R.id.fromTitle, context.getResources().getString(R.string.from) + ' ' + str2); customRemoteViews.setText(R.id.toTitle, context.getResources().getString(R.string.to) + ' ' + str3); if (!isTransparent()) { customRemoteViews.setColorFilter(R.id.refresh, -16777216); customRemoteViews.setTextColor(R.id.time, -16777216); } customRemoteViews.setViewVisibility(R.id.titleBarContainer, utils.showLastUpdated(context)); int i10 = 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))"); customRemoteViews.setText(i10, string); setIntent(context, customRemoteViews, R.id.refresh, WidgetAction.REFRESH); setIntent(context, customRemoteViews, R.id.keypad0, WidgetAction.ZERO); setIntent(context, customRemoteViews, R.id.keypad1, WidgetAction.ONE); setIntent(context, customRemoteViews, R.id.keypad2, WidgetAction.TWO); setIntent(context, customRemoteViews, R.id.keypad3, WidgetAction.THREE); setIntent(context, customRemoteViews, R.id.keypad4, WidgetAction.FOUR); setIntent(context, customRemoteViews, R.id.keypad5, WidgetAction.FIVE); setIntent(context, customRemoteViews, R.id.keypad6, WidgetAction.SIX); setIntent(context, customRemoteViews, R.id.keypad7, WidgetAction.SEVEN); setIntent(context, customRemoteViews, R.id.keypad8, WidgetAction.EIGHT); setIntent(context, customRemoteViews, R.id.keypad9, WidgetAction.NINE); setIntent(context, customRemoteViews, R.id.keypadDecimal, WidgetAction.DECIMAL); setIntent(context, customRemoteViews, R.id.keypadDelete, WidgetAction.DELETE); customRemoteViews.setBackgroundColor(R.id.top, getTopColor(context)); PendingIntent activity = PendingIntent.getActivity(context.getApplicationContext(), 0, new Intent(context, (Class<?>) MainActivity.class), PendingIntentKt.getDefaultPendingFlags() | 134217728); int i11 = R.id.top; k.e(activity, fjIApSKKJvQ.QdQvjCFDj); customRemoteViews.setOnClickPendingIntent(i11, activity); customRemoteViews.setOnClickPendingIntent(R.id.titleBarContainer, activity); Object views = customRemoteViews.getViews(); k.d(views, EXLFzoAaBfr.AljMcSZazrTEb); appWidgetManager.updateAppWidget(appWidgetId, (RemoteViews) views); return customRemoteViews; } catch (Exception e8) { e8.printStackTrace(); return customRemoteViews; } } }