CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 a.java 源代码,内容仅作参考
package d.c.a.m;
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.app.Activity;
import android.app.Application;
import android.app.Dialog;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Looper;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RSIllegalArgumentException;
import android.renderscript.RenderScript;
import android.renderscript.ScriptIntrinsicBlur;
import android.support.v4.media.session.PlaybackStateCompat;
import android.text.SpannableString;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.animation.Animation;
import android.view.inputmethod.InputMethodManager;
import android.webkit.WebView;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AlertController;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import carbon.widget.LinearLayout;
import cn.like.nightmodel.NightModelManager;
import cn.like.nightmodel.ThemeModelManager;
import com.blankj.utilcode.util.NetworkUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.google.android.gms.common.GoogleApiAvailability;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.messaging.FirebaseMessaging;
import d.c.a.j.m;
import d.c.a.j.s;
import d.c.a.j.v;
import d.c.a.j.x;
import d.c.a.j.z;
import d.c.b.s1.t;
import d.c.b.s1.u;
import d.c.d.t0.d;
import d.c.g.i3.g;
import d.c.g.l3.i;
import d.c.g.l3.j;
import d.f.a.a;
import e.i.a.l;
import i.c.a.c.a0;
import i.c.a.c.k;
import i.c.a.c.m0;
import i.c.a.c.o;
import i.c.a.c.w;
import i.c.a.c.y;
import i.m.a.a;
import i.m.a.c;
import i.m.a.p;
import io.github.inflationx.calligraphy3.BuildConfig;
import java.io.BufferedReader;
import java.io.CharArrayReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.RandomAccessFile;
import java.io.StringReader;
import java.lang.ref.WeakReference;
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.channels.FileChannel;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Locale;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Set;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.GZIPInputStream;
import javax.annotation.Nullable;
import kotlin.Metadata;
import kotlin.coroutines.intrinsics.CoroutineSingletons;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlinx.coroutines.flow.FlowKt__EmittersKt$onStart$$inlined$unsafeFlow$1;
import n.e;
import n.i.b.h;
import o.b.e0;
import o.b.n0;
import org.commons.livechat.ChatBean;
import org.commons.livechat.ChatModel;
import org.commons.livechat.LiveChatButton;
import org.commons.livechat.OtherChatContainer;
import org.commons.livechat.PlatformView;
import org.commons.screenadapt.recyclerview.FastScreenListAdapter;
import org.commons.screenadapt.recyclerview.ScreenViewHolder;
import org.godfootsteps.arch.api.AppClient;
import org.godfootsteps.arch.api.entity.CustomPlaylist;
import org.godfootsteps.arch.api.entity.PlanContentEntity;
import org.godfootsteps.arch.api.entity.Track;
import org.godfootsteps.arch.api.model.AddDateBean;
import org.godfootsteps.arch.api.model.BookCaseBook;
import org.godfootsteps.arch.api.model.BookCaseModel;
import org.godfootsteps.arch.api.model.Bookmark;
import org.godfootsteps.arch.api.model.FcmModel;
import org.godfootsteps.arch.api.model.Note;
import org.godfootsteps.arch.api.model.SearchModel;
import org.godfootsteps.arch.api.model.StatusModel;
import org.godfootsteps.arch.api.model.relBean;
import org.godfootsteps.arch.api.util.RequestNoResult;
import org.godfootsteps.arch.config.ReadSettings;
import org.godfootsteps.arch.dialog.AlertDialogBuilder;
import org.godfootsteps.arch.util.GAEventSendUtil;
import org.godfootsteps.arch.util.LifecycleListener;
import org.godfootsteps.arch.util.TimeLimit;
import org.godfootsteps.arch.youtubeApi.YouTubeKeyHelper;
import org.godfootsteps.book.BookCaseFragment;
import org.godfootsteps.book.R$dimen;
import org.godfootsteps.book.R$id;
import org.godfootsteps.book.R$layout;
import org.godfootsteps.book.model.ReadPosition;
import org.godfootsteps.more.R$string;
import org.godfootsteps.more.db.UserContext;
import org.godfootsteps.more.livechat.ChatActivity;
import org.godfootsteps.more.livechat.UtilKt$setAppChatModel$4;
import org.godfootsteps.more.livechat.UtilKt$setAppChatModel$5;
import org.godfootsteps.more.util.CacheRemoverKt$cleanAppData$1;
import org.godfootsteps.video.R$color;
import org.godfootsteps.video.R$drawable;
import org.godfootsteps.video.db.VideoDb;
import org.json.JSONObject;
import org.jsoup.UncheckedIOException;
import org.jsoup.nodes.Document;
import org.lukhnos.portmobile.file.NoSuchFileException;
import org.lukhnos.portmobile.file.StandardOpenOption;
import razerdp.util.log.PopupLog;
import retrofit2.KotlinExtensions$suspendAndThrow$1;
import ru.ldralighieri.corbind.internal.InitialValueFlowKt$asInitialValueFlow$1;
import ru.ldralighieri.corbind.widget.TextViewTextChangesKt$textChanges$5;
import t.a.f;
import u.n;
@Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\u001a\n\u0010\u0000\u001a\u00020\u0001*\u00020\u0001\u001a\n\u0010\u0002\u001a\u00020\u0001*\u00020\u0001¨\u0006\u0003"}, d2 = {"getYoutubeHQUrl", "", "getYoutubeMQUrl", "arch_release"}, k = 2, mv = {1, 5, 1}, xi = 48)
public final class a {
public static long a;
public static String A(int i2, Object... objArr) {
if (i2 == 0) {
return null;
}
try {
return f.b.getResources().getString(i2, objArr);
} catch (Exception unused) {
return "";
}
}
public static String A0(Object obj) {
return obj == null ? "null" : obj.toString();
}
public static CharSequence B(Context context, int i2, int i3, int i4, boolean z) {
i iVar = new i(z, context);
j jVar = new j(z, context);
String h2 = n.m.t.a.p.m.e1.a.h(i3);
String h3 = n.m.t.a.p.m.e1.a.h(i4);
String h4 = n.m.t.a.p.m.e1.a.h(i2);
Locale g2 = s.g();
int indexOf = h4.toLowerCase(g2).indexOf(h2.toLowerCase(g2));
int indexOf2 = h4.toLowerCase(g2).indexOf(h3.toLowerCase(g2));
SpannableString spannableString = new SpannableString(h4);
if (indexOf >= 0 && h2.length() + indexOf <= h4.length()) {
spannableString.setSpan(iVar, indexOf, h2.length() + indexOf, 18);
}
if (indexOf2 >= 0 && h3.length() + indexOf2 <= h4.length()) {
spannableString.setSpan(jVar, indexOf2, h3.length() + indexOf2, 18);
}
return TextUtils.concat(spannableString);
}
public static void B0(Context context, String str) {
if (Looper.myLooper() != null && Looper.myLooper() == Looper.getMainLooper()) {
Toast.makeText(context.getApplicationContext(), str, 0).show();
} else if (context instanceof Activity) {
((Activity) context).runOnUiThread(new t.b.a(context, str));
}
}
public static String C() {
String a2 = s.a();
if (a2.equals("ne")) {
a2 = "hi";
} else if (a2.equals("ta") || a2.equals("khm") || a2.equals("hmn") || a2.equals("bn") || a2.equals("uk") || a2.equals("sr")) {
a2 = "en";
}
StringBuilder sb = new StringBuilder();
Objects.requireNonNull(AppClient.a);
sb.append("https://appservercn.kingdomsalvation.org");
sb.append("/terms/terms-of-use-");
sb.append(a2);
sb.append(".html");
return sb.toString();
}
public static final void C0(String str, n.i.a.a<e> aVar, n.i.a.a<e> aVar2) {
h.e(str, "bookId");
View inflate = LayoutInflater.from(w.c()).inflate(R$layout.dialog_book_download, (ViewGroup) null);
h.d(inflate, "from(activityOrAppContex…alog_book_download, null)");
ProgressBar progressBar = (ProgressBar) inflate.findViewById(R$id.progress);
AlertDialogBuilder alertDialogBuilder = new AlertDialogBuilder(w.c(), 0, 2);
alertDialogBuilder.f15257o = (int) w.c().getResources().getDimension(R$dimen.dp200_320_x);
AlertController.b bVar = alertDialogBuilder.f98i;
bVar.f94t = inflate;
bVar.f88n = false;
AlertDialog h2 = alertDialogBuilder.h();
BookCaseModel bookCaseModel = BookCaseFragment.f15645r;
String bookPath = bookCaseModel != null ? bookCaseModel.getBookPath() : null;
if (bookPath == null) {
StringBuilder J = i.a.b.a.a.J("/medias/");
J.append((Object) s.a());
J.append("/books/");
bookPath = J.toString();
}
StringBuilder sb = new StringBuilder();
Objects.requireNonNull(AppClient.a);
sb.append("https://appservercn.kingdomsalvation.org");
sb.append(bookPath);
sb.append(str);
sb.append(".zip");
String sb2 = sb.toString();
String str2 = y.J().getFilesDir().getAbsolutePath() + "/books/" + str + ".zip";
x.a aVar3 = x.a;
d dVar = new d(progressBar, h2, str, aVar, aVar2);
h.e(sb2, "url");
h.e(str2, "path");
Object obj = p.c;
Objects.requireNonNull(p.a.a);
final i.m.a.c cVar = new i.m.a.c(sb2);
cVar.k(str2);
cVar.f13085m = true;
cVar.f13084l = 100;
cVar.j(100);
cVar.f13081i = new d.c.a.j.w(dVar);
cVar.l();
Activity c = m0.c();
if (c != null && (c instanceof e.q.j)) {
((e.q.j) c).getLifecycle().a(new LifecycleListener(new n.i.a.a<e>() {
{
super(0);
}
@Override
public e invoke() {
invoke2();
return e.a;
}
public final void invoke2() {
a aVar4 = a.this;
if (aVar4 != null) {
((c) aVar4).f13081i = null;
}
if (aVar4 == null) {
return;
}
((c) aVar4).i();
}
}));
}
}
public static final String D() {
int rawOffset = TimeZone.getDefault().getRawOffset() / 3600000;
return (rawOffset >= 5 || rawOffset == -12) ? "asia" : rawOffset <= -4 ? "america" : "europe";
}
public static void D0(t tVar, List<Track> list) {
h.e(tVar, "this");
h.e(list, "trackList");
for (Track track : list) {
((u) tVar).Z(track.getRowId(), track.getAlbumId(), track.getTitle(), track.getAlbumTitle(), track.getName(), track.getType(), track.getDuration(), track.getLowUrl(), track.getHighUrl(), track.getSizeLow(), track.getSizeHigh(), track.getHymnAlbum(), track.getShare(), track.getVideoId(), track.getLastModified(), track.getOrderNumberInt(), track.getDownloaded());
}
}
public static Object E(c cVar, String str, String str2, String str3, n.g.c cVar2, int i2, Object obj) {
String str4 = null;
String str5 = (i2 & 2) != 0 ? "50" : null;
if ((i2 & 4) != 0) {
YouTubeKeyHelper youTubeKeyHelper = YouTubeKeyHelper.a;
str4 = YouTubeKeyHelper.c;
}
return cVar.c(str, str5, str4, cVar2);
}
public static d.g.a.b.b E0(d.g.a.b.b bVar, d.g.a.b.a<? super d.g.a.b.b> aVar) throws IOException {
if (bVar.a.isDirectory()) {
d.g.a.b.c cVar = (d.g.a.b.c) aVar;
for (File file : bVar.a.listFiles()) {
E0(new d.g.a.b.b(file), aVar);
}
} else {
((d.c.d.r0.b) aVar).a(bVar, null);
}
return bVar;
}
public static Bitmap F(View view, float f2, boolean z, int i2, int i3) {
Bitmap bitmap;
if (view != null && view.getWidth() > 0 && view.getHeight() > 0) {
int a2 = t.d.d.a();
StringBuilder J = i.a.b.a.a.J("模糊原始图像分辨率 [");
J.append(view.getWidth());
J.append(" x ");
J.append(view.getHeight());
J.append("]");
PopupLog.d(J.toString());
try {
Bitmap createBitmap = Bitmap.createBitmap((int) (view.getWidth() * f2), (int) (view.getHeight() * f2), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(createBitmap);
Matrix matrix = new Matrix();
matrix.preScale(f2, f2);
canvas.setMatrix(matrix);
Drawable background = view.getBackground();
if (background == null) {
canvas.drawColor(Color.parseColor("#FAFAFA"));
} else {
background.draw(canvas);
}
if (z && a2 > 0 && (view.getContext() instanceof Activity)) {
int statusBarColor = ((Activity) view.getContext()).getWindow().getStatusBarColor();
Paint paint = new Paint(1);
paint.setColor(statusBarColor);
canvas.drawRect(new Rect(0, 0, view.getWidth(), a2), paint);
}
view.draw(canvas);
PopupLog.d("模糊缩放图像分辨率 [" + createBitmap.getWidth() + " x " + createBitmap.getHeight() + "]");
if (i2 > 0 || i3 > 0) {
int i4 = (int) (i2 * f2);
int i5 = (int) (i3 * f2);
try {
return Bitmap.createBitmap(createBitmap, i4, i5, createBitmap.getWidth() - i4, createBitmap.getHeight() - i5, (Matrix) null, false);
} catch (Exception unused) {
System.gc();
return bitmap;
}
}
return createBitmap;
} catch (OutOfMemoryError unused2) {
System.gc();
return null;
}
}
PopupLog.f(PopupLog.LogMethod.e, "getViewBitmap >> 宽或者高为空", new Object[0]);
return null;
}
public static String G(int i2) {
StringBuilder sb = new StringBuilder();
if ((i2 & 119) == 119) {
sb.append("FILL");
sb.append(" | ");
} else {
if ((i2 & 112) == 112) {
sb.append("FILL_VERTICAL");
sb.append(" | ");
} else {
if ((i2 & 48) == 48) {
sb.append("TOP");
sb.append(" | ");
}
if ((i2 & 80) == 80) {
sb.append("BOTTOM");
sb.append(" | ");
}
}
if ((i2 & 7) == 7) {
sb.append("FILL_HORIZONTAL");
sb.append(" | ");
} else {
if ((i2 & 8388611) == 8388611) {
sb.append("START");
sb.append(" | ");
} else if ((i2 & 3) == 3) {
sb.append("LEFT");
sb.append(" | ");
}
if ((i2 & 8388613) == 8388613) {
sb.append("END");
sb.append(" | ");
} else if ((i2 & 5) == 5) {
sb.append("RIGHT");
sb.append(" | ");
}
}
}
if ((i2 & 17) == 17) {
sb.append("CENTER");
sb.append(" | ");
} else {
if ((i2 & 112) == 16) {
sb.append("CENTER_VERTICAL");
sb.append(" | ");
}
if ((i2 & 7) == 1) {
sb.append("CENTER_HORIZONTAL");
sb.append(" | ");
}
}
if (sb.length() == 0) {
sb.append("NO GRAVITY");
sb.append(" | ");
}
if ((i2 & 268435456) == 268435456) {
sb.append("DISPLAY_CLIP_VERTICAL");
sb.append(" | ");
}
if ((i2 & 16777216) == 16777216) {
sb.append("DISPLAY_CLIP_HORIZONTAL");
sb.append(" | ");
}
sb.delete(sb.length() - 3, sb.length());
return sb.toString();
}
public static final void H(Activity activity) {
int i2;
h.e(activity, "<this>");
if (!v.f() || e.c0.a.R()) {
i2 = 3846;
} else {
i2 = 12038;
if (v.h()) {
i2 = 12054;
}
}
activity.getWindow().getDecorView().setSystemUiVisibility(i2);
}
public static final void I(Activity activity) {
h.e(activity, "<this>");
ReadSettings readSettings = ReadSettings.f15218n;
if (readSettings.p() || readSettings.v() == -1) {
return;
}
Window window = activity.getWindow();
int v2 = readSettings.v();
if (v2 < 10) {
v2 = 10;
}
e.c0.a.f0(window, v2);
}
public static final void J() {
if (N()) {
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.w("sermon"));
if (s.v()) {
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.w("planNew"));
}
if (t0()) {
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.w("news"));
}
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.w("book"));
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.w("hymnAll"));
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.w("video"));
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.w("article"));
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.w("notification"));
UserContext userContext = UserContext.a;
if (UserContext.l() && UserContext.m()) {
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.w("insider"));
}
FirebaseMessaging.d().l(s.a());
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.w(D()));
}
}
public static boolean K() {
try {
return Class.forName("android.os.Looper").getDeclaredMethod("getMainLooper", new Class[0]).invoke(null, new Object[0]) != null;
} catch (ClassNotFoundException | IllegalAccessException | NoSuchMethodException | InvocationTargetException unused) {
return false;
}
}
public static boolean L(Drawable drawable) {
return drawable == null || ((drawable instanceof ColorDrawable) && ((ColorDrawable) drawable).getColor() == 0);
}
public static void M(boolean z) {
if (z) {
throw new IllegalArgumentException("Must be false");
}
}
public static final boolean N() {
int isGooglePlayServicesAvailable = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(y.J());
return (isGooglePlayServicesAvailable == 0 || isGooglePlayServicesAvailable == 2) && NetworkUtils.c();
}
public static final boolean O(Context context) {
Locale locale;
h.e(context, "<this>");
if (Build.VERSION.SDK_INT >= 24) {
locale = context.getResources().getConfiguration().getLocales().get(0);
h.d(locale, "{\n resources.….locales.get(0)\n }");
} else {
locale = context.getResources().getConfiguration().locale;
h.d(locale, "{\n resources.…guration.locale\n }");
}
return TextUtils.getLayoutDirectionFromLocale(locale) == 1;
}
public static void P(boolean z) {
if (!z) {
throw new IllegalArgumentException("Must be true");
}
}
public static void Q(boolean z, String str) {
if (!z) {
throw new IllegalArgumentException(str);
}
}
public static String R(String str) {
return str != null ? str.toLowerCase(Locale.ENGLISH) : "";
}
public static final boolean S(final Activity activity, final DialogInterface.OnCancelListener onCancelListener, boolean z) {
h.e(activity, "activity");
if (new l(activity).a()) {
return true;
}
AlertDialogBuilder alertDialogBuilder = new AlertDialogBuilder(activity, 0, 2);
alertDialogBuilder.r(R$string.fcm_allow);
alertDialogBuilder.j(z ? R$string.fcm_help_info_settings : R$string.fcm_help_info);
alertDialogBuilder.o(R$string.fcm_to_settings, new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i2) {
Activity activity2 = activity;
h.e(activity2, "$activity");
Intent intent = new Intent();
int i3 = Build.VERSION.SDK_INT;
intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS");
if (i3 >= 26) {
intent.putExtra("android.provider.extra.APP_PACKAGE", activity2.getPackageName());
} else {
intent.putExtra("app_package", activity2.getPackageName());
}
intent.putExtra("app_uid", activity2.getApplicationInfo().uid);
activity2.startActivityForResult(intent, 92);
}
});
alertDialogBuilder.l(R$string.fcm_later, new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i2) {
DialogInterface.OnCancelListener onCancelListener2 = onCancelListener;
if (onCancelListener2 == null) {
return;
}
onCancelListener2.onCancel(dialogInterface);
}
});
alertDialogBuilder.f98i.f88n = false;
alertDialogBuilder.h();
return false;
}
public static final boolean T(Activity activity, final DialogInterface.OnCancelListener onCancelListener) {
Dialog errorDialog;
h.e(activity, "<this>");
if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(activity) == 2 || (errorDialog = GoogleApiAvailability.getInstance().getErrorDialog(activity, GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(activity), 91, onCancelListener)) == null) {
return true;
}
errorDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public final void onDismiss(DialogInterface dialogInterface) {
DialogInterface.OnCancelListener onCancelListener2 = onCancelListener;
int isGooglePlayServicesAvailable = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(y.J());
if ((isGooglePlayServicesAvailable == 0 || isGooglePlayServicesAvailable == 2) || onCancelListener2 == null) {
return;
}
onCancelListener2.onCancel(dialogInterface);
}
});
errorDialog.setCancelable(false);
errorDialog.show();
return false;
}
public static final String U(String str) {
JSONObject optJSONObject;
String optString;
Intent intent;
String stringExtra;
List<BookCaseBook> list;
h.e(str, "<this>");
BookCaseModel bookCaseModel = BookCaseFragment.f15645r;
String str2 = "";
if (bookCaseModel != null && (list = bookCaseModel.getList()) != null) {
for (BookCaseBook bookCaseBook : list) {
if (h.a(str, bookCaseBook.getId())) {
String title = bookCaseBook.getTitle();
return title == null ? "" : title;
}
}
}
String e2 = new d.c.a.a.b.b(str).e();
if (!(n.o.a.o(e2))) {
try {
JSONObject optJSONObject2 = new JSONObject(e2).optJSONObject("result");
if (optJSONObject2 != null && (optJSONObject = optJSONObject2.optJSONObject("desc")) != null) {
optString = optJSONObject.optString("bookName");
}
} catch (Exception unused) {
}
}
optString = "";
if (n.o.a.o(optString)) {
Activity c = m0.c();
if (c != null && (intent = c.getIntent()) != null && (stringExtra = intent.getStringExtra("bookName")) != null) {
str2 = stringExtra;
}
return str2;
}
return optString;
}
public static FileInputStream V(d.g.a.b.b bVar) throws IOException {
return new FileInputStream(bVar.a);
}
public static FileOutputStream W(d.g.a.b.b bVar) throws IOException {
return new FileOutputStream(bVar.a);
}
public static String X(String str) {
return R(str).trim();
}
public static void Y(@Nullable String str) {
if (str == null || str.length() == 0) {
throw new IllegalArgumentException("String must not be empty");
}
}
public static void Z(@Nullable String str, String str2) {
if (str == null || str.length() == 0) {
throw new IllegalArgumentException(str2);
}
}
public static final String a() {
d.c.i.c cVar = (d.c.i.c) k.a.a.a.a.b(d.c.i.c.class);
boolean z = false;
if (cVar != null) {
Activity c = m0.c();
h.d(c, "getTopActivity()");
if (cVar.f(c)) {
z = true;
}
}
return z ? "文章阅读页" : "视频播放页";
}
public static void a0(@Nullable Object obj) {
if (obj == null) {
throw new IllegalArgumentException("Object must not be null");
}
}
public static final boolean b(List list) {
Iterator it = list.iterator();
while (it.hasNext()) {
if (!((PlanContentEntity) it.next()).isCompleted()) {
return false;
}
}
return true;
}
public static void b0(@Nullable Object obj, String str) {
if (obj == null) {
throw new IllegalArgumentException(str);
}
}
public static final void c(final RecyclerView recyclerView, List<CustomPlaylist> list, final d.c.k.t0.v vVar, final String str) {
h.e(recyclerView, "rv");
h.e(list, "allPlaylist");
h.e(vVar, "mAddToHelper");
h.e(str, "videoId");
final List<CustomPlaylist> e2 = e(list);
if (recyclerView.getAdapter() == null) {
final List<CustomPlaylist> e3 = e(e2);
recyclerView.setAdapter(new FastScreenListAdapter<CustomPlaylist>(e3) {
@Override
public int g() {
return org.godfootsteps.video.R$layout.playlist_sheet_item_small;
}
@Override
public void i(final ScreenViewHolder screenViewHolder, CustomPlaylist customPlaylist) {
final CustomPlaylist customPlaylist2 = customPlaylist;
h.e(customPlaylist2, "item");
if (screenViewHolder == null) {
return;
}
final String str2 = str;
final d.c.k.t0.v vVar2 = vVar;
View view = screenViewHolder.f15173i;
View view2 = null;
TextView textView = (TextView) (view == null ? null : view.findViewById(org.godfootsteps.video.R$id.tv_playlist_name));
if (textView != null) {
textView.post(new Runnable() {
@Override
public final void run() {
CustomPlaylist customPlaylist3 = CustomPlaylist.this;
ScreenViewHolder screenViewHolder2 = screenViewHolder;
ScreenViewHolder screenViewHolder3 = screenViewHolder;
n.i.b.h.e(customPlaylist3, "$item");
n.i.b.h.e(screenViewHolder3, "$this_apply");
String playlistName = customPlaylist3.getPlaylistName();
View view3 = screenViewHolder2.f15173i;
TextPaint paint = ((TextView) (view3 == null ? null : view3.findViewById(org.godfootsteps.video.R$id.tv_playlist_name))).getPaint();
View view4 = screenViewHolder2.f15173i;
CharSequence ellipsize = TextUtils.ellipsize(playlistName, paint, ((TextView) (view4 == null ? null : view4.findViewById(org.godfootsteps.video.R$id.tv_playlist_name))).getMeasuredWidth() - 10.0f, TextUtils.TruncateAt.END);
Objects.requireNonNull(ellipsize, "null cannot be cast to non-null type kotlin.String");
String str3 = (String) ellipsize;
View view5 = screenViewHolder3.f15173i;
((TextView) (view5 != null ? view5.findViewById(org.godfootsteps.video.R$id.tv_playlist_name) : null)).setText(str3);
}
});
}
if (customPlaylist2.isWatchLater()) {
View view3 = screenViewHolder.f15173i;
((ImageView) (view3 == null ? null : view3.findViewById(org.godfootsteps.video.R$id.iv_playlist))).setImageResource(R$drawable.ic_playlist_default);
} else {
View view4 = screenViewHolder.f15173i;
((ImageView) (view4 == null ? null : view4.findViewById(org.godfootsteps.video.R$id.iv_playlist))).setImageResource(R$drawable.ic_playlist_custom);
}
List<String> videoIdList = customPlaylist2.getVideoIdList();
try {
View view5 = screenViewHolder.f15173i;
if (view5 != null) {
view2 = view5.findViewById(org.godfootsteps.video.R$id.tv_playlist_video_count);
}
((TextView) view2).setText(String.valueOf(videoIdList.size()));
} catch (Exception e4) {
e4.printStackTrace();
}
screenViewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view6) {
CustomPlaylist customPlaylist3 = CustomPlaylist.this;
String str3 = str2;
v vVar3 = vVar2;
n.i.b.h.e(customPlaylist3, "$item");
n.i.b.h.e(str3, "$videoId");
n.i.b.h.e(vVar3, "$mAddToHelper");
List<String> allVideoIdList = customPlaylist3.getAllVideoIdList();
if (allVideoIdList.contains(str3)) {
allVideoIdList.remove(str3);
}
allVideoIdList.add(str3);
if (customPlaylist3.getStatus() == 0) {
customPlaylist3.setStatus(1);
}
String y = n.f.g.y(allVideoIdList, "|", null, null, 0, null, null, 62);
int length = y.length() - 1;
int i2 = 0;
boolean z = false;
while (i2 <= length) {
boolean z2 = y.charAt(!z ? i2 : length) == '|';
if (z) {
if (!z2) {
break;
}
length--;
} else if (z2) {
i2++;
} else {
z = true;
}
}
customPlaylist3.setVideoIds(y.subSequence(i2, length + 1).toString());
VideoDb.a aVar = VideoDb.f16257n;
Application J = y.J();
n.i.b.h.d(J, "getApp()");
aVar.a(J).q().o(customPlaylist3);
Dialog dialog = vVar3.f7130d;
if (dialog != null) {
n.i.b.h.c(dialog);
dialog.dismiss();
}
ToastUtils.b(org.godfootsteps.video.R$string.video_add_success);
d.c.i.d dVar = (d.c.i.d) k.a.a.a.a.b(d.c.i.d.class);
if (dVar != null) {
dVar.d();
}
GAEventSendUtil.a.z(customPlaylist3.getPlaylistName());
}
});
}
});
return;
}
int size = e2.size();
RecyclerView.Adapter adapter = recyclerView.getAdapter();
boolean z = size != (adapter == null ? 0 : adapter.getItemCount());
RecyclerView.Adapter adapter2 = recyclerView.getAdapter();
Objects.requireNonNull(adapter2, "null cannot be cast to non-null type org.commons.screenadapt.recyclerview.FastScreenListAdapter<org.godfootsteps.arch.api.entity.CustomPlaylist>");
FastScreenListAdapter fastScreenListAdapter = (FastScreenListAdapter) adapter2;
fastScreenListAdapter.a = e2;
fastScreenListAdapter.notifyDataSetChanged();
if (z) {
a0.a.postDelayed(new Runnable() {
@Override
public final void run() {
RecyclerView recyclerView2 = RecyclerView.this;
List list2 = e2;
n.i.b.h.e(recyclerView2, "$rv");
n.i.b.h.e(list2, "$customPlaylist");
RecyclerView.n layoutManager = recyclerView2.getLayoutManager();
Objects.requireNonNull(layoutManager, "null cannot be cast to non-null type androidx.recyclerview.widget.LinearLayoutManager");
((LinearLayoutManager) layoutManager).scrollToPositionWithOffset(list2.size() - 1, 0);
}
}, 100L);
}
}
public static final String c0(String str) {
return str == null || n.o.a.o(str) ? "" : str;
}
public static Bitmap d(Context context, Bitmap bitmap, int i2, int i3, float f2) {
a = System.currentTimeMillis();
PopupLog.f(PopupLog.LogMethod.i, "BlurHelper", "脚本模糊");
ScriptIntrinsicBlur scriptIntrinsicBlur = null;
if (bitmap == null || bitmap.isRecycled()) {
return null;
}
RenderScript create = RenderScript.create(context.getApplicationContext());
Allocation createFromBitmap = Allocation.createFromBitmap(create, bitmap);
Allocation createTyped = Allocation.createTyped(create, createFromBitmap.getType());
try {
scriptIntrinsicBlur = ScriptIntrinsicBlur.create(create, createFromBitmap.getElement());
} catch (RSIllegalArgumentException e2) {
if (e2.getMessage().contains("Unsuported element type")) {
scriptIntrinsicBlur = ScriptIntrinsicBlur.create(create, Element.U8_4(create));
}
}
if (scriptIntrinsicBlur == null) {
PopupLog.f(PopupLog.LogMethod.e, "BlurHelper", "脚本模糊失败,转fastBlur");
return s(context, bitmap, i2, i3, f2);
}
scriptIntrinsicBlur.setRadius(Math.max(0.0f, Math.min(f2, 20.0f)));
scriptIntrinsicBlur.setInput(createFromBitmap);
scriptIntrinsicBlur.forEach(createTyped);
createTyped.copyTo(bitmap);
create.destroy();
createFromBitmap.destroy();
createTyped.destroy();
Bitmap createScaledBitmap = Bitmap.createScaledBitmap(bitmap, i2, i3, true);
bitmap.recycle();
long currentTimeMillis = System.currentTimeMillis() - a;
if (PopupLog.e()) {
B0(context, "模糊用时:【" + currentTimeMillis + "ms】");
}
PopupLog.f(PopupLog.LogMethod.i, "BlurHelper", i.a.b.a.a.n("模糊用时:【", currentTimeMillis, "ms】"));
return createScaledBitmap;
}
public static final boolean d0(Activity activity, int i2, DialogInterface.OnCancelListener onCancelListener, boolean z) {
h.e(activity, "activity");
boolean z2 = true;
if (i2 == 91) {
int isGooglePlayServicesAvailable = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(y.J());
if (isGooglePlayServicesAvailable != 0 && isGooglePlayServicesAvailable != 2) {
z2 = false;
}
if (z2) {
S(activity, onCancelListener, z);
} else {
T(activity, onCancelListener);
}
} else if (i2 == 92) {
if (new l(activity).a()) {
return true;
}
S(activity, onCancelListener, z);
}
return false;
}
public static final List<CustomPlaylist> e(List<CustomPlaylist> list) {
h.e(list, "allPlaylist");
if (!list.isEmpty()) {
ArrayList arrayList = new ArrayList();
ArrayList arrayList2 = new ArrayList();
for (CustomPlaylist customPlaylist : list) {
if (n.o.a.C(customPlaylist.getId(), CustomPlaylist.WATCH_LATER_PREFIX, false, 2)) {
arrayList2.add(customPlaylist);
} else {
arrayList.add(customPlaylist);
}
}
if (arrayList2.isEmpty()) {
String j2 = h.j(CustomPlaylist.WATCH_LATER_PREFIX, s.a());
String string = w.c().getString(org.godfootsteps.video.R$string.video_watch_later);
h.d(string, "activityOrAppContext.getString(resId)");
String a2 = s.a();
h.d(a2, "getApiLang()");
CustomPlaylist customPlaylist2 = new CustomPlaylist(j2, string, a2, "", 3);
VideoDb.a aVar = VideoDb.f16257n;
Application J = y.J();
h.d(J, "getApp()");
aVar.a(J).q().j(customPlaylist2);
arrayList.add(0, customPlaylist2);
} else if (arrayList2.size() == 1) {
arrayList.add(0, arrayList2.get(0));
} else {
Iterator it = arrayList2.iterator();
if (!it.hasNext()) {
throw new NoSuchElementException();
}
CustomPlaylist customPlaylist3 = (CustomPlaylist) it.next();
while (it.hasNext()) {
CustomPlaylist customPlaylist4 = (CustomPlaylist) it.next();
if (customPlaylist3.getId().compareTo(customPlaylist4.getId()) < 0) {
customPlaylist3 = customPlaylist4;
}
}
arrayList.add(0, customPlaylist3);
}
return arrayList;
}
String j3 = h.j(CustomPlaylist.WATCH_LATER_PREFIX, s.a());
String string2 = w.c().getString(org.godfootsteps.video.R$string.video_watch_later);
h.d(string2, "activityOrAppContext.getString(resId)");
String a3 = s.a();
h.d(a3, "getApiLang()");
CustomPlaylist customPlaylist5 = new CustomPlaylist(j3, string2, a3, "", 3);
VideoDb.a aVar2 = VideoDb.f16257n;
Application J2 = y.J();
h.d(J2, "getApp()");
aVar2.a(J2).q().j(customPlaylist5);
return i.j.a.e.t.d.r3(customPlaylist5);
}
public static FileChannel e0(d.g.a.b.b bVar, StandardOpenOption... standardOpenOptionArr) throws IOException {
List asList = Arrays.asList(standardOpenOptionArr);
if (asList.size() == 1 && asList.contains(StandardOpenOption.READ)) {
return new RandomAccessFile(bVar.a, "r").getChannel();
}
if (asList.contains(StandardOpenOption.WRITE)) {
if ((!bVar.a.exists()) && asList.contains(StandardOpenOption.CREATE)) {
m(bVar);
}
return new RandomAccessFile(bVar.a, "rw").getChannel();
}
StringBuilder J = i.a.b.a.a.J("Unknown options: ");
J.append(standardOpenOptionArr);
throw new IOException(J.toString());
}
public static final void f() {
try {
new WebView(y.J()).clearCache(true);
} catch (Exception e2) {
e2.printStackTrace();
}
i.d.a.c.c(y.J()).b();
Activity c = m0.c();
if (c instanceof Context) {
m.a(c);
}
n.m.t.a.p.m.e1.a.z1(n0.f14883i, null, null, new CacheRemoverKt$cleanAppData$1(null), 3, null);
}
public static Document f0(File file, @Nullable String str) throws IOException {
boolean z;
d.f.b.a aVar;
Document e2;
Document document;
d.f.c.l lVar;
String absolutePath = file.getAbsolutePath();
Pattern pattern = d.f.a.a.a;
d.f.d.e a2 = d.f.d.e.a();
InputStream fileInputStream = new FileInputStream(file);
String R = R(file.getName());
if (R.endsWith(".gz") || R.endsWith(".z")) {
try {
if (fileInputStream.read() == 31) {
if (fileInputStream.read() == 139) {
z = true;
fileInputStream = !z ? new GZIPInputStream(new FileInputStream(file)) : new FileInputStream(file);
}
}
z = false;
if (!z) {
}
} finally {
fileInputStream.close();
}
}
int i2 = d.f.b.a.f7277n;
if (fileInputStream instanceof d.f.b.a) {
aVar = (d.f.b.a) fileInputStream;
} else {
aVar = new d.f.b.a(fileInputStream, 32768, 0);
}
try {
aVar.mark(32768);
ByteBuffer b = d.f.a.a.b(aVar, 5119);
boolean z2 = aVar.read() == -1;
aVar.reset();
a.C0038a a3 = d.f.a.a.a(b);
String str2 = a3 != null ? a3.a : str;
if (str2 == null) {
try {
CharBuffer decode = d.f.a.a.b.decode(b);
if (decode.hasArray()) {
e2 = a2.a.e(new CharArrayReader(decode.array(), decode.arrayOffset(), decode.limit()), absolutePath, a2);
} else {
e2 = a2.a.e(new StringReader(decode.toString()), absolutePath, a2);
}
Iterator<org.jsoup.nodes.Element> it = e2.k0("meta[http-equiv=content-type], meta[charset]").iterator();
String str3 = null;
do {
if (!it.hasNext()) {
break;
}
org.jsoup.nodes.Element next = it.next();
if (next.t("http-equiv")) {
String h2 = next.h("content");
if (h2 != null) {
Matcher matcher = d.f.a.a.a.matcher(h2);
if (matcher.find()) {
str3 = d.f.a.a.c(matcher.group(1).trim().replace("charset=", ""));
}
}
str3 = null;
}
if (str3 == null && next.t("charset")) {
str3 = next.h("charset");
continue;
}
} while (str3 == null);
if (str3 == null && e2.m() > 0) {
d.f.c.i l2 = e2.l(0);
if (l2 instanceof d.f.c.l) {
lVar = (d.f.c.l) l2;
} else {
if (l2 instanceof d.f.c.d) {
d.f.c.d dVar = (d.f.c.d) l2;
if (d.f.c.d.R(dVar.N())) {
lVar = dVar.Q();
}
}
lVar = null;
}
if (lVar != null && lVar.N().equalsIgnoreCase("xml")) {
str3 = lVar.h("encoding");
}
}
String c = d.f.a.a.c(str3);
if (c != null && !c.equalsIgnoreCase(d.f.a.a.c)) {
str2 = c.trim().replaceAll("[\"']", "");
} else if (z2) {
document = e2;
if (document == null) {
if (str2 == null) {
str2 = d.f.a.a.c;
}
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(aVar, str2), 32768);
if (a3 != null && a3.b) {
P(bufferedReader.skip(1L) == 1);
}
try {
document = a2.a.e(bufferedReader, absolutePath, a2);
Charset forName = str2.equals(d.f.a.a.c) ? d.f.a.a.b : Charset.forName(str2);
document.f16338s.f16343j = forName;
if (!forName.canEncode()) {
document.p0(d.f.a.a.b);
}
bufferedReader.close();
} catch (UncheckedIOException e3) {
throw e3.ioException();
}
}
return document;
}
} catch (UncheckedIOException e4) {
throw e4.ioException();
}
} else {
Z(str2, "Must set charset arg to character set of file to parse. Set to null to attempt to detect from HTML");
}
document = null;
if (document == null) {
}
return document;
} finally {
aVar.close();
}
}
public static final void g(ChatBean chatBean, String str, n.i.a.a<e> aVar) {
h.e(chatBean, "chatBean");
h.e(str, "clickPos");
UserContext userContext = UserContext.a;
if (UserContext.i()) {
return;
}
if (h.a(chatBean.getPlatform(), "chat")) {
e.c0.a.k0(ChatActivity.class);
if (aVar != null) {
aVar.invoke();
}
} else {
String url = chatBean.getUrl();
if (url != null) {
d.c.g.l3.l.d(url, chatBean.getPlatform(), aVar);
}
}
GAEventSendUtil.a.q(str, chatBean.getPlatform());
}
public static final String g0(String str) {
h.e(str, "str");
try {
try {
Date parse = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z", Locale.US).parse(str);
return parse == null ? str : z.a(parse.getTime());
} catch (Exception unused) {
Date parse2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US).parse(str);
return parse2 == null ? str : z.a(parse2.getTime());
}
} catch (Exception unused2) {
return str;
}
}
public static final List<i.n.c.a> h(List<? extends i.n.c.a> list) {
h.e(list, "toc");
m0(list);
ArrayList arrayList = new ArrayList();
arrayList.addAll(list);
return arrayList;
}
public static d.f.d.e h0(d.f.c.i iVar) {
d.f.d.e eVar;
Document D = iVar.D();
return (D == null || (eVar = D.f16339t) == null) ? new d.f.d.e(new d.f.d.b()) : eVar;
}
public static void i(Activity activity) {
if (activity == null) {
return;
}
View rootView = activity.getWindow().getDecorView().getRootView();
try {
InputMethodManager inputMethodManager = (InputMethodManager) rootView.getContext().getSystemService("input_method");
if (inputMethodManager != null) {
inputMethodManager.hideSoftInputFromWindow(rootView.getWindowToken(), 2);
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
public static d.g.a.b.d.a i0(d.g.a.b.b bVar) throws NoSuchFileException {
if (bVar.a.exists()) {
return new d.g.a.b.d.a(bVar.a);
}
throw new NoSuchFileException();
}
public static String j(long j2) {
return j2 >= 1073741824 ? String.format(s.g(), "%.1f GB", Float.valueOf(((float) j2) / ((float) 1073741824))) : j2 >= PlaybackStateCompat.ACTION_SET_CAPTIONING_ENABLED ? String.format(s.g(), "%.1f MB", Double.valueOf(((float) j2) / ((float) PlaybackStateCompat.ACTION_SET_CAPTIONING_ENABLED))) : j2 >= PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID ? String.format(s.g(), "%.0f KB", Float.valueOf((float) (j2 / PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID))) : String.format(s.g(), "%d B", Long.valueOf(j2));
}
public static final String j0(File file, String str) {
h.e(file, "<this>");
h.e(str, "url");
if (file.exists()) {
return n.m.t.a.p.m.e1.a.j(k.b(file));
}
String a2 = x.a.a(str, true);
if ((a2.length() > 0) && !h.a(a2, "404")) {
k.d(file, a2);
}
return a2;
}
public static d.g.a.b.b k(d.g.a.b.b bVar, d.g.a.b.b bVar2) throws IOException {
Throwable th;
FileChannel fileChannel;
if (!bVar.a.isDirectory()) {
FileChannel fileChannel2 = null;
try {
FileChannel channel = V(bVar).getChannel();
try {
fileChannel2 = W(bVar2).getChannel();
long size = channel.size();
for (long j2 = 0; j2 < size; j2 += fileChannel2.transferFrom(channel, j2, size - j2)) {
}
channel.close();
fileChannel2.close();
return bVar2;
} catch (Throwable th2) {
th = th2;
FileChannel fileChannel3 = fileChannel2;
fileChannel2 = channel;
fileChannel = fileChannel3;
fileChannel2.close();
fileChannel.close();
throw th;
}
} catch (Throwable th3) {
th = th3;
fileChannel = null;
}
} else {
throw new UnsupportedOperationException("Directory copy not supported in this implementation");
}
}
public static final void k0(boolean z) {
if (N()) {
TimeLimit timeLimit = TimeLimit.a;
h.e("refreshFcmTopics", "key");
long j2 = TimeLimit.a().a.getLong("refreshFcmTopics", -1L);
if (j2 == -1 || System.currentTimeMillis() - j2 >= 21600000 || z) {
FirebaseMessaging.d().f().addOnSuccessListener(new OnSuccessListener() {
@Override
public final void onSuccess(Object obj) {
final String str = (String) obj;
final String str2 = !h.a(BuildConfig.BUILD_TYPE, BuildConfig.BUILD_TYPE) ? "F5pyQFoI+bPTplKEa8a7mmRS4c0NsjQUmprBrLxi/JTMXrONK0KQUEjdmLDjH/Ce3/NNgACsUb7OqcoJvGc9eBrJrYJT4IvNoMOUKAZ6vexi2xbY01YuuiTz8GFCMiy3OR4NX5LcS+0Uw3xOZ5j/tAG1Yhsf8FWGI3O01RyprCFbKrqa9SaJrF3YU7pgcoIHEfQzD82LFyppUxt3ON4tK2Ag27k3FrxM+P/mwDi1GK2IddhCt2iUMdqD1oOB/2BA7KrezkQ+X1vRAUztM2NyxF7HLjQNNQyzusE8xHQboXaOtu74VS/xNidoKzLK6de7kMOPt+m7R9Cq0zsJlB84og==" : "htVDiT54CwCNExF9y+IfT+UGUxwImyQ2SeCX1pH0UFBnBJwmaVC3qjOsSEbfTaMsmXRePPxNEzfMyrCXT1BpPBxBU2To4pRh143FO4Yxsc4pa1BRt5g3/M+RXr5tRmjSGkz3jphXAOqy/WwArOc1GFWs9L3oWlw4Ckv1/wXikm8S/9jXAijrP6f/HJkz+d83E0sezM1DhhVTnoOXFQCyl7SaVmUHsmC6zBlyr+yMzpuZUvVaemyrf9Zq48OxhXSzHzpZVq96fAKXpCK8UWiW5+ZWjmFW324aZY3OrjB8XIMVRrjKtx2k6G9lLssxwjzVIoudmAZOCv7lcRbb4sDmhA==";
n.m.t.a.p.m.e1.a.g2(new n.i.a.l<RequestNoResult<FcmModel, FcmModel>, n.e>() {
@Metadata(d1 = {"\u0000\u0006\n\u0000\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001H\u008a@"}, d2 = {"<anonymous>", "Lorg/godfootsteps/arch/api/model/FcmModel;"}, k = 3, mv = {1, 5, 1}, xi = 48)
@n.g.f.a.c(c = "org.godfootsteps.more.fcm.FcmUtilKt$refreshFcmTopics$1$1$1", f = "FcmUtil.kt", l = {79}, m = "invokeSuspend")
public static final class AnonymousClass1 extends SuspendLambda implements n.i.a.l<n.g.c<? super FcmModel>, Object> {
public final String $key;
public final String $token;
public int label;
public AnonymousClass1(String str, String str2, n.g.c<? super AnonymousClass1> cVar) {
super(1, cVar);
this.$token = str;
this.$key = str2;
}
@Override
public final n.g.c<e> create(n.g.c<?> cVar) {
return new AnonymousClass1(this.$token, this.$key, cVar);
}
@Override
public final Object invoke(n.g.c<? super FcmModel> cVar) {
return ((AnonymousClass1) create(cVar)).invokeSuspend(e.a);
}
@Override
public final Object invokeSuspend(Object obj) {
CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
int i2 = this.label;
if (i2 == 0) {
i.j.a.e.t.d.Q4(obj);
Objects.requireNonNull(AppClient.a);
AppClient appClient = AppClient.Companion.f15176d;
StringBuilder J = i.a.b.a.a.J("https://iid.googleapis.com/iid/info/");
J.append((Object) this.$token);
J.append("?details=true");
String sb = J.toString();
String j2 = h.j("key=", n.m.t.a.p.m.e1.a.Y(this.$key, null, 1));
this.label = 1;
obj = appClient.b0(sb, j2, this);
if (obj == coroutineSingletons) {
return coroutineSingletons;
}
} else if (i2 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
i.j.a.e.t.d.Q4(obj);
}
return obj;
}
}
{
super(1);
}
@Override
public e invoke(RequestNoResult<FcmModel, FcmModel> requestNoResult) {
invoke2(requestNoResult);
return e.a;
}
public final void invoke2(RequestNoResult<FcmModel, FcmModel> requestNoResult) {
h.e(requestNoResult, "$this$requestNoResult");
requestNoResult.f(new AnonymousClass1(str, str2, null));
requestNoResult.f15180l = new n.i.a.l<FcmModel, e>() {
@Override
public e invoke(FcmModel fcmModel) {
invoke2(fcmModel);
return e.a;
}
public final void invoke2(FcmModel fcmModel) {
boolean z2;
HashMap<String, AddDateBean> topics;
h.e(fcmModel, "model");
TimeLimit timeLimit2 = TimeLimit.a;
TimeLimit.b("refreshFcmTopics");
String[] strArr = {"sermon", "book", "hymnAll", "video", "article", "planNew", "news", "notification"};
relBean rel = fcmModel.getRel();
Set<String> set = null;
if (rel != null && (topics = rel.getTopics()) != null) {
set = topics.keySet();
}
if (set == null) {
set = new HashSet<>();
}
ArrayList arrayList = new ArrayList();
int i2 = 0;
while (true) {
boolean z3 = true;
if (i2 < 8) {
String str3 = strArr[i2];
g gVar = g.f6802n;
Objects.requireNonNull(gVar);
h.e(str3, "key");
switch (str3.hashCode()) {
case -905834836:
if (str3.equals("sermon")) {
z2 = gVar.u();
break;
}
z2 = false;
break;
case -732377866:
if (str3.equals("article")) {
z2 = gVar.o();
break;
}
z2 = false;
break;
case -493917769:
if (str3.equals("planNew")) {
if (gVar.t()) {
break;
}
z3 = false;
z2 = z3;
break;
}
z2 = false;
break;
case 3029737:
if (str3.equals("book")) {
z2 = gVar.p();
break;
}
z2 = false;
break;
case 3377875:
if (str3.equals("news")) {
if (gVar.r()) {
break;
}
z3 = false;
z2 = z3;
break;
}
z2 = false;
break;
case 112202875:
if (str3.equals("video")) {
z2 = gVar.v();
break;
}
z2 = false;
break;
case 595233003:
if (str3.equals("notification")) {
z2 = gVar.s();
break;
}
z2 = false;
break;
case 1379236303:
if (str3.equals("hymnAll")) {
z2 = gVar.q();
break;
}
z2 = false;
break;
default:
z2 = false;
break;
}
if (z2) {
arrayList.add(str3);
if (!set.contains(str3)) {
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.w(str3));
}
}
i2++;
} else {
UserContext userContext = UserContext.a;
if (UserContext.l() && UserContext.m()) {
arrayList.add("insider");
if (!set.contains("insider")) {
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.w("insider"));
}
}
if ((!set.isEmpty()) && set.contains("hymn")) {
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.x("hymn"));
set.add("hymnAll");
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.w("hymnAll"));
}
if ((!set.isEmpty()) && set.contains("wordOfGod")) {
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.x("wordOfGod"));
set.add("book");
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.w("book"));
}
String a2 = s.a();
h.d(a2, "getApiLang()");
arrayList.add(a2);
if (!set.contains(a2)) {
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.w(a2));
}
String D = d.c.a.m.a.D();
arrayList.add(D);
if (!set.contains(D)) {
FirebaseMessaging.d().f3614i.onSuccessTask(new i.j.b.v.w(D));
}
for (String str4 : set) {
if (!arrayList.contains(str4)) {
StringBuilder P = i.a.b.a.a.P("unsubscribeFromTopic: ", str4, " current:");
P.append((Object) s.a());
o.a(P.toString());
FirebaseMessaging.d().o(str4);
}
}
return;
}
}
}
};
}
});
}
});
}
}
}
public static d.g.a.b.b l(d.g.a.b.b bVar) throws IOException {
if (bVar.a.exists()) {
if (bVar.a.isDirectory()) {
return bVar;
}
throw new IOException("Path is not a directory: " + bVar);
}
l(new d.g.a.b.b(bVar.a.getParent()));
if (bVar.a.mkdir()) {
return bVar;
}
throw new IOException("Failed creating directory: " + bVar);
}
public static final void l0(File file) {
if (file != null) {
try {
i.c.a.c.l.f(file);
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
public static d.g.a.b.b m(d.g.a.b.b bVar) throws IOException {
if (bVar.a.createNewFile()) {
return bVar;
}
throw new IOException("File cannot be created: " + bVar);
}
public static final void m0(List<? extends i.n.c.a> list) {
for (i.n.c.a aVar : list) {
boolean z = false;
aVar.setExpanded(false);
List<i.n.c.a> children = aVar.getChildren();
if (!((children == null || children.isEmpty()) ? true : true)) {
List<i.n.c.a> children2 = aVar.getChildren();
h.d(children2, "it.children");
m0(children2);
}
}
}
public static d.g.a.b.b n(d.g.a.b.b bVar, String str, String str2) throws IOException {
return new d.g.a.b.b(File.createTempFile(str, str2, bVar.a));
}
public static final void n0(final OtherChatContainer otherChatContainer, ChatModel chatModel) {
Activity c;
int i2;
h.e(otherChatContainer, "<this>");
h.e(chatModel, "chatModel");
Activity p2 = e.c0.a.p(otherChatContainer.getContext());
if (p2 instanceof e.q.j) {
Resources.Theme theme = p2.getTheme();
ThemeModelManager themeModelManager = ThemeModelManager.a;
if (h.a(theme, ThemeModelManager.f1963d)) {
NightModelManager nightModelManager = NightModelManager.a;
LinearLayout linearLayout = (LinearLayout) otherChatContainer.findViewById(org.godfootsteps.more.R$id.ll_chat_multi);
h.d(linearLayout, "ll_chat_multi");
h.e(p2, "activity");
h.e(linearLayout, "view");
List<h.a.a.e.c> g2 = NightModelManager.c.g(p2.hashCode());
if (g2 != null) {
int size = g2.size();
if (size > 0) {
i2 = 0;
while (true) {
int i3 = i2 + 1;
if (h.a(g2.get(i2).a.get(), linearLayout)) {
break;
} else if (i3 >= size) {
break;
} else {
i2 = i3;
}
}
}
i2 = -1;
if (i2 > 0) {
g2.remove(i2);
}
}
ReadSettings readSettings = ReadSettings.f15218n;
readSettings.C((e.q.j) p2, new d.c.g.j3.j(otherChatContainer));
if (e.c0.a.R()) {
otherChatContainer.b(1);
} else if (readSettings.z() == 0) {
otherChatContainer.b(0);
} else {
otherChatContainer.b(2);
}
}
}
UtilKt$setAppChatModel$4 utilKt$setAppChatModel$4 = new n.i.a.l<ChatBean, e>() {
@Override
public e invoke(ChatBean chatBean) {
invoke2(chatBean);
return e.a;
}
public final void invoke2(ChatBean chatBean) {
h.e(chatBean, "chatBean");
d.c.a.m.a.g(chatBean, d.c.a.m.a.a(), null);
}
};
UtilKt$setAppChatModel$5 utilKt$setAppChatModel$5 = new n.i.a.p<ImageView, String, e>() {
@Override
public e invoke(ImageView imageView, String str) {
invoke2(imageView, str);
return e.a;
}
public final void invoke2(ImageView imageView, String str) {
h.e(imageView, "imageView");
h.e(str, "url");
n.m.t.a.p.m.e1.a.F1(imageView, str, null, 2);
}
};
h.e(chatModel, "chatModel");
h.e(utilKt$setAppChatModel$4, "onClickChat");
h.e(utilKt$setAppChatModel$5, "onLoadIcon");
List<ChatBean> other = chatModel.getOther();
if (other == null || other.isEmpty()) {
View childAt = otherChatContainer.getChildAt(0);
h.d(childAt, "getChildAt(0)");
i.c.a.c.n0.c(childAt, false, 1);
View childAt2 = otherChatContainer.getChildAt(1);
h.d(childAt2, "getChildAt(1)");
i.c.a.c.n0.c(childAt2, false, 1);
} else if (chatModel.getOther().size() == 1) {
TextView textView = (TextView) otherChatContainer.a(org.commons.livechat.R$id.tv_guide1);
h.d(textView, "tv_guide1");
i.c.a.c.n0.u(textView, chatModel.getGuide());
View childAt3 = otherChatContainer.getChildAt(0);
h.d(childAt3, "getChildAt(0)");
i.c.a.c.n0.t(childAt3);
View childAt4 = otherChatContainer.getChildAt(1);
h.d(childAt4, "getChildAt(1)");
i.c.a.c.n0.c(childAt4, false, 1);
((LiveChatButton) otherChatContainer.a(org.commons.livechat.R$id.lcb_live_chat)).e(chatModel.getOther().get(0), 1, utilKt$setAppChatModel$4, utilKt$setAppChatModel$5);
} else {
View childAt5 = otherChatContainer.getChildAt(1);
h.d(childAt5, "getChildAt(1)");
i.c.a.c.n0.t(childAt5);
View childAt6 = otherChatContainer.getChildAt(0);
h.d(childAt6, "getChildAt(0)");
i.c.a.c.n0.c(childAt6, false, 1);
TextView textView2 = (TextView) otherChatContainer.a(org.commons.livechat.R$id.tv_guide2);
h.d(textView2, "tv_guide2");
i.c.a.c.n0.u(textView2, chatModel.getGuide());
((PlatformView) otherChatContainer.a(org.commons.livechat.R$id.platform_view_lcc)).setImageViews(new d.a.b.s(chatModel, utilKt$setAppChatModel$5, utilKt$setAppChatModel$4));
}
if (!v.i() || (c = m0.c()) == null) {
return;
}
d.a.a.b.a(c, new n.i.a.l<d.a.a.a.j, e>() {
@Metadata(d1 = {"\u0000\u0011\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016¨\u0006\u0004"}, d2 = {"org/godfootsteps/more/livechat/UtilKt$setAppChatModel$6$1", "Lorg/commons/screenadapt/adapt/AbsAdapt;", "onConfigureChanged", "", "more_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public static final class a extends d.a.a.a.c {
public final OtherChatContainer b;
public a(OtherChatContainer otherChatContainer) {
super(otherChatContainer);
this.b = otherChatContainer;
}
@Override
public void a() {
if (h.a(d.c.a.m.a.a(), "视频播放页")) {
final OtherChatContainer otherChatContainer = this.b;
otherChatContainer.post(
throw new UnsupportedOperationException("Method not decompiled: org.godfootsteps.more.livechat.UtilKt$setAppChatModel$6.a.a():void");
}
}
{
super(1);
}
@Override
public e invoke(d.a.a.a.j jVar) {
invoke2(jVar);
return e.a;
}
public final void invoke2(d.a.a.a.j jVar) {
ListIterator<d.a.a.a.c> listIterator;
h.e(jVar, "$this$applyScreenAdapt");
OtherChatContainer otherChatContainer2 = OtherChatContainer.this;
h.e(otherChatContainer2, "view");
ArrayList arrayList = new ArrayList();
List<d.a.a.a.c> list = jVar.a;
if (list != null && (listIterator = list.listIterator()) != null) {
while (listIterator.hasNext()) {
d.a.a.a.c next = listIterator.next();
if (h.a(next.a, otherChatContainer2)) {
arrayList.add(next);
}
}
}
List<d.a.a.a.c> list2 = jVar.a;
if (list2 != null) {
list2.removeAll(arrayList);
}
a aVar = new a(OtherChatContainer.this);
aVar.a();
jVar.b(aVar);
}
});
}
public static void o(StringBuilder sb, Object obj, Map<Object[], Object> map) {
if (obj == null) {
sb.append("null");
} else if (!obj.getClass().isArray()) {
try {
sb.append(obj.toString());
} catch (Throwable th) {
StringBuilder J = i.a.b.a.a.J("SLF4J: Failed toString() invocation on an object of type [");
J.append(obj.getClass().getName());
J.append("]");
d.i.e.e.b(J.toString(), th);
sb.append("[FAILED toString()]");
}
} else {
int i2 = 0;
if (obj instanceof boolean[]) {
boolean[] zArr = (boolean[]) obj;
sb.append('[');
int length = zArr.length;
while (i2 < length) {
sb.append(zArr[i2]);
if (i2 != length - 1) {
sb.append(", ");
}
i2++;
}
sb.append(']');
} else if (obj instanceof byte[]) {
byte[] bArr = (byte[]) obj;
sb.append('[');
int length2 = bArr.length;
while (i2 < length2) {
sb.append((int) bArr[i2]);
if (i2 != length2 - 1) {
sb.append(", ");
}
i2++;
}
sb.append(']');
} else if (obj instanceof char[]) {
char[] cArr = (char[]) obj;
sb.append('[');
int length3 = cArr.length;
while (i2 < length3) {
sb.append(cArr[i2]);
if (i2 != length3 - 1) {
sb.append(", ");
}
i2++;
}
sb.append(']');
} else if (obj instanceof short[]) {
short[] sArr = (short[]) obj;
sb.append('[');
int length4 = sArr.length;
while (i2 < length4) {
sb.append((int) sArr[i2]);
if (i2 != length4 - 1) {
sb.append(", ");
}
i2++;
}
sb.append(']');
} else if (obj instanceof int[]) {
int[] iArr = (int[]) obj;
sb.append('[');
int length5 = iArr.length;
while (i2 < length5) {
sb.append(iArr[i2]);
if (i2 != length5 - 1) {
sb.append(", ");
}
i2++;
}
sb.append(']');
} else if (obj instanceof long[]) {
long[] jArr = (long[]) obj;
sb.append('[');
int length6 = jArr.length;
while (i2 < length6) {
sb.append(jArr[i2]);
if (i2 != length6 - 1) {
sb.append(", ");
}
i2++;
}
sb.append(']');
} else if (obj instanceof float[]) {
float[] fArr = (float[]) obj;
sb.append('[');
int length7 = fArr.length;
while (i2 < length7) {
sb.append(fArr[i2]);
if (i2 != length7 - 1) {
sb.append(", ");
}
i2++;
}
sb.append(']');
} else if (obj instanceof double[]) {
double[] dArr = (double[]) obj;
sb.append('[');
int length8 = dArr.length;
while (i2 < length8) {
sb.append(dArr[i2]);
if (i2 != length8 - 1) {
sb.append(", ");
}
i2++;
}
sb.append(']');
} else {
Object[] objArr = (Object[]) obj;
sb.append('[');
if (!map.containsKey(objArr)) {
map.put(objArr, null);
int length9 = objArr.length;
while (i2 < length9) {
o(sb, objArr[i2], map);
if (i2 != length9 - 1) {
sb.append(", ");
}
i2++;
}
map.remove(objArr);
} else {
sb.append("...");
}
sb.append(']');
}
}
}
public static void o0(Context context, DialogInterface.OnClickListener onClickListener, DialogInterface.OnClickListener onClickListener2) {
if (s.u()) {
View inflate = LayoutInflater.from(context).inflate(org.godfootsteps.more.R$layout.dialog_privacy, (ViewGroup) null);
TextView textView = (TextView) inflate.findViewById(org.godfootsteps.more.R$id.tv_privacy);
textView.setText(y(context, R$string.privacy_dialog_privacy_prompt, R$string.privacy_submit_privacy));
textView.setMovementMethod(LinkMovementMethod.getInstance());
AlertDialogBuilder alertDialogBuilder = new AlertDialogBuilder(context);
alertDialogBuilder.f98i.f94t = inflate;
alertDialogBuilder.o(R$string.privacy_agree, onClickListener);
alertDialogBuilder.l(R$string.app_cancel, onClickListener2);
alertDialogBuilder.f98i.f88n = false;
alertDialogBuilder.h();
return;
}
onClickListener.onClick(null, 0);
}
public static boolean p(d.g.a.b.b bVar) throws IOException {
if (bVar.a.exists()) {
if (bVar.a.delete()) {
return true;
}
throw new IOException("Could not delete path: " + bVar);
}
return false;
}
public static void p0(Context context, DialogInterface.OnClickListener onClickListener, DialogInterface.OnClickListener onClickListener2) {
AlertDialogBuilder alertDialogBuilder = new AlertDialogBuilder(context);
alertDialogBuilder.r(R$string.user_sync_title);
alertDialogBuilder.j(R$string.user_sync_book_prompt);
alertDialogBuilder.o(R$string.user_sync_enable, onClickListener);
alertDialogBuilder.l(R$string.app_cancel, onClickListener2);
alertDialogBuilder.h();
}
public static final void q() {
try {
i.d.a.c c = i.d.a.c.c(y.J());
Objects.requireNonNull(c);
if (i.d.a.r.i.h()) {
c.f9445i.f9621f.a().clear();
l0(y.J().getExternalFilesDir("apk"));
l0(new File(y.J().getExternalCacheDir() + "/Htmls"));
l0(new File(y.J().getExternalCacheDir() + "/Css"));
l0(new File(y.J().getExternalCacheDir() + "/share"));
l0(new File(y.J().getExternalCacheDir() + "/audio-cache"));
l0(new File(y.J().getExternalCacheDir() + "/lrcCache"));
return;
}
throw new IllegalArgumentException("You must call this method on a background thread");
} catch (Exception unused) {
}
}
public static final void q0(final Activity activity) {
int i2;
h.e(activity, "<this>");
if (!v.f() || e.c0.a.R()) {
i2 = 1792;
} else {
i2 = 9984;
if (v.h()) {
a0.a.postDelayed(new Runnable() {
@Override
public final void run() {
Activity activity2 = activity;
n.i.b.h.e(activity2, "$this_showSystemUI");
e.c0.a.b0(activity2.getWindow(), e.c0.a.R() ? -16777216 : -1);
}
}, 50L);
i2 = 10000;
}
}
activity.getWindow().getDecorView().setSystemUiVisibility(i2);
}
public static final int r(int i2) {
return (int) ((i2 * Resources.getSystem().getDisplayMetrics().density) + 0.5f);
}
public static void r0(Context context, DialogInterface.OnClickListener onClickListener, DialogInterface.OnClickListener onClickListener2) {
if (s.u()) {
View inflate = LayoutInflater.from(context).inflate(org.godfootsteps.more.R$layout.dialog_privacy, (ViewGroup) null);
TextView textView = (TextView) inflate.findViewById(org.godfootsteps.more.R$id.tv_privacy);
textView.setText(B(context, R$string.privacy_dialog_terms_privacy_prompt, R$string.privacy_dialog_terms, R$string.privacy_dialog_privacy, true));
textView.setMovementMethod(LinkMovementMethod.getInstance());
AlertDialogBuilder alertDialogBuilder = new AlertDialogBuilder(context);
alertDialogBuilder.f98i.f94t = inflate;
alertDialogBuilder.o(R$string.privacy_agree, onClickListener);
alertDialogBuilder.l(R$string.app_cancel, null);
alertDialogBuilder.f98i.f88n = false;
alertDialogBuilder.h();
return;
}
onClickListener.onClick(null, 0);
}
public static Bitmap s(Context context, Bitmap bitmap, int i2, int i3, float f2) {
int[] iArr;
Bitmap bitmap2 = null;
if (bitmap.isRecycled()) {
return null;
}
int max = (int) Math.max(0.0f, Math.min(f2, 20.0f));
Bitmap copy = bitmap.copy(bitmap.getConfig(), true);
if (max >= 1) {
int width = copy.getWidth();
int height = copy.getHeight();
int i4 = width * height;
int[] iArr2 = new int[i4];
copy.getPixels(iArr2, 0, width, 0, 0, width, height);
int i5 = width - 1;
int i6 = height - 1;
int i7 = max + max + 1;
int[] iArr3 = new int[i4];
int[] iArr4 = new int[i4];
int[] iArr5 = new int[i4];
int[] iArr6 = new int[Math.max(width, height)];
int i8 = (i7 + 1) >> 1;
int i9 = i8 * i8;
int i10 = i9 * 256;
int[] iArr7 = new int[i10];
for (int i11 = 0; i11 < i10; i11++) {
iArr7[i11] = i11 / i9;
}
int[][] iArr8 = (int[][]) Array.newInstance(int.class, i7, 3);
int i12 = max + 1;
int i13 = 0;
int i14 = 0;
int i15 = 0;
while (i13 < height) {
Bitmap bitmap3 = copy;
int i16 = -max;
int i17 = 0;
int i18 = 0;
int i19 = 0;
int i20 = 0;
int i21 = 0;
int i22 = 0;
int i23 = 0;
int i24 = 0;
int i25 = 0;
while (i16 <= max) {
int i26 = height;
int i27 = i6;
int i28 = iArr2[Math.min(i5, Math.max(i16, 0)) + i14];
int[] iArr9 = iArr8[i16 + max];
iArr9[0] = (i28 & 16711680) >> 16;
iArr9[1] = (i28 & 65280) >> 8;
iArr9[2] = i28 & 255;
int abs = i12 - Math.abs(i16);
i17 = (iArr9[0] * abs) + i17;
i18 = (iArr9[1] * abs) + i18;
i19 = (iArr9[2] * abs) + i19;
if (i16 > 0) {
i23 += iArr9[0];
i24 += iArr9[1];
i25 += iArr9[2];
} else {
i20 += iArr9[0];
i21 += iArr9[1];
i22 += iArr9[2];
}
i16++;
height = i26;
i6 = i27;
}
int i29 = i6;
int i30 = height;
int i31 = 0;
int i32 = max;
while (i31 < width) {
iArr3[i14] = iArr7[i17];
iArr4[i14] = iArr7[i18];
iArr5[i14] = iArr7[i19];
int i33 = i17 - i20;
int i34 = i18 - i21;
int i35 = i19 - i22;
int[] iArr10 = iArr8[((i32 - max) + i7) % i7];
int i36 = i20 - iArr10[0];
int i37 = i21 - iArr10[1];
int i38 = i22 - iArr10[2];
if (i13 == 0) {
iArr = iArr7;
iArr6[i31] = Math.min(i31 + max + 1, i5);
} else {
iArr = iArr7;
}
int i39 = iArr2[i15 + iArr6[i31]];
iArr10[0] = (i39 & 16711680) >> 16;
iArr10[1] = (i39 & 65280) >> 8;
iArr10[2] = i39 & 255;
int i40 = i23 + iArr10[0];
int i41 = i24 + iArr10[1];
int i42 = i25 + iArr10[2];
i17 = i33 + i40;
i18 = i34 + i41;
i19 = i35 + i42;
i32 = (i32 + 1) % i7;
int[] iArr11 = iArr8[i32 % i7];
i20 = i36 + iArr11[0];
i21 = i37 + iArr11[1];
i22 = i38 + iArr11[2];
i23 = i40 - iArr11[0];
i24 = i41 - iArr11[1];
i25 = i42 - iArr11[2];
i14++;
i31++;
iArr7 = iArr;
}
i15 += width;
i13++;
copy = bitmap3;
height = i30;
i6 = i29;
}
Bitmap bitmap4 = copy;
int i43 = i6;
int i44 = height;
int[] iArr12 = iArr7;
int i45 = 0;
while (i45 < width) {
int i46 = -max;
int i47 = i46 * width;
int i48 = 0;
int i49 = 0;
int i50 = 0;
int i51 = 0;
int i52 = 0;
int i53 = 0;
int i54 = 0;
int i55 = 0;
int i56 = 0;
while (i46 <= max) {
int[] iArr13 = iArr6;
int max2 = Math.max(0, i47) + i45;
int[] iArr14 = iArr8[i46 + max];
iArr14[0] = iArr3[max2];
iArr14[1] = iArr4[max2];
iArr14[2] = iArr5[max2];
int abs2 = i12 - Math.abs(i46);
i48 = (iArr3[max2] * abs2) + i48;
i49 = (iArr4[max2] * abs2) + i49;
i56 = (iArr5[max2] * abs2) + i56;
if (i46 > 0) {
i52 += iArr14[0];
i53 += iArr14[1];
i54 += iArr14[2];
} else {
i55 += iArr14[0];
i50 += iArr14[1];
i51 += iArr14[2];
}
int i57 = i43;
if (i46 < i57) {
i47 += width;
}
i46++;
i43 = i57;
iArr6 = iArr13;
}
int[] iArr15 = iArr6;
int i58 = i43;
int i59 = 0;
int i60 = i44;
int i61 = max;
int i62 = i45;
while (i59 < i60) {
iArr2[i62] = (iArr2[i62] & (-16777216)) | (iArr12[i48] << 16) | (iArr12[i49] << 8) | iArr12[i56];
int i63 = i48 - i55;
int i64 = i49 - i50;
int i65 = i56 - i51;
int[] iArr16 = iArr8[((i61 - max) + i7) % i7];
int i66 = i55 - iArr16[0];
int i67 = i50 - iArr16[1];
int i68 = i51 - iArr16[2];
int i69 = max;
if (i45 == 0) {
iArr15[i59] = Math.min(i59 + i12, i58) * width;
}
int i70 = iArr15[i59] + i45;
iArr16[0] = iArr3[i70];
iArr16[1] = iArr4[i70];
iArr16[2] = iArr5[i70];
int i71 = i52 + iArr16[0];
int i72 = i53 + iArr16[1];
int i73 = i54 + iArr16[2];
i48 = i63 + i71;
i49 = i64 + i72;
i56 = i65 + i73;
i61 = (i61 + 1) % i7;
int[] iArr17 = iArr8[i61];
i55 = i66 + iArr17[0];
i50 = i67 + iArr17[1];
i51 = i68 + iArr17[2];
i52 = i71 - iArr17[0];
i53 = i72 - iArr17[1];
i54 = i73 - iArr17[2];
i62 += width;
i59++;
max = i69;
}
i45++;
i44 = i60;
i43 = i58;
iArr6 = iArr15;
}
bitmap4.setPixels(iArr2, 0, width, 0, 0, width, i44);
bitmap2 = bitmap4;
}
if (bitmap2 == null || bitmap2.isRecycled()) {
return null;
}
Bitmap createScaledBitmap = Bitmap.createScaledBitmap(bitmap2, i2, i3, true);
long currentTimeMillis = System.currentTimeMillis() - a;
if (PopupLog.e()) {
B0(context, "模糊用时:【" + currentTimeMillis + "ms】");
}
PopupLog.f(PopupLog.LogMethod.i, "BlurHelper", i.a.b.a.a.n("模糊用时:【", currentTimeMillis, "ms】"));
return createScaledBitmap;
}
public static void s0(d.c.i.f fVar, String str, String str2, List list, int i2, Object obj) {
if ((i2 & 2) != 0) {
str2 = null;
}
int i3 = i2 & 4;
fVar.g(str, str2, null);
}
public static String t(List list) {
if (list == null) {
return "list is null";
}
if (list.isEmpty()) {
return "list is empty";
}
StringBuilder O = i.a.b.a.a.O("\n", "{\n ");
for (Object obj : list) {
if (obj instanceof List) {
O.append(t((List) obj));
} else {
O.append(String.valueOf(obj));
O.append(" ,\n ");
}
}
O.append("}");
return O.toString();
}
public static final boolean t0() {
String language = s.g().getLanguage();
for (String str : s.b) {
if (language.equals(str)) {
return true;
}
}
return false;
}
public static Activity u(Context context) {
if (context instanceof Activity) {
return (Activity) context;
}
int i2 = 0;
while (context instanceof ContextWrapper) {
if (context instanceof Activity) {
return (Activity) context;
}
if (i2 > 20) {
break;
}
context = ((ContextWrapper) context).getBaseContext();
i2++;
}
WeakReference<Activity> weakReference = f.a.a.a;
if (weakReference == null) {
return null;
}
return weakReference.get();
}
public static final Object u0(Exception exc, n.g.c<?> cVar) {
KotlinExtensions$suspendAndThrow$1 kotlinExtensions$suspendAndThrow$1;
int i2;
if (cVar instanceof KotlinExtensions$suspendAndThrow$1) {
kotlinExtensions$suspendAndThrow$1 = (KotlinExtensions$suspendAndThrow$1) cVar;
int i3 = kotlinExtensions$suspendAndThrow$1.label;
if ((i3 & Integer.MIN_VALUE) != 0) {
kotlinExtensions$suspendAndThrow$1.label = i3 - Integer.MIN_VALUE;
Object obj = kotlinExtensions$suspendAndThrow$1.result;
CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
i2 = kotlinExtensions$suspendAndThrow$1.label;
if (i2 != 0) {
i.j.a.e.t.d.Q4(obj);
kotlinExtensions$suspendAndThrow$1.L$0 = exc;
kotlinExtensions$suspendAndThrow$1.label = 1;
e0.a.e0(kotlinExtensions$suspendAndThrow$1.getContext(), new n(kotlinExtensions$suspendAndThrow$1, exc));
if (coroutineSingletons == coroutineSingletons) {
h.e(kotlinExtensions$suspendAndThrow$1, "frame");
}
if (coroutineSingletons == coroutineSingletons) {
return coroutineSingletons;
}
} else if (i2 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
Exception exc2 = (Exception) kotlinExtensions$suspendAndThrow$1.L$0;
i.j.a.e.t.d.Q4(obj);
}
return e.a;
}
}
kotlinExtensions$suspendAndThrow$1 = new KotlinExtensions$suspendAndThrow$1(cVar);
Object obj2 = kotlinExtensions$suspendAndThrow$1.result;
CoroutineSingletons coroutineSingletons2 = CoroutineSingletons.COROUTINE_SUSPENDED;
i2 = kotlinExtensions$suspendAndThrow$1.label;
if (i2 != 0) {
}
return e.a;
}
public static long v(Animation animation, long j2) {
if (animation == null) {
return j2;
}
long duration = animation.getDuration();
return duration < 0 ? j2 : duration;
}
public static final void v0() {
FirebaseMessaging.d().f().addOnSuccessListener(new OnSuccessListener() {
@Override
public final void onSuccess(Object obj) {
final String str = (String) obj;
UserContext userContext = UserContext.a;
if ((TextUtils.isEmpty(UserContext.f()) && TextUtils.isEmpty(i.c.a.c.j.a().c())) || TextUtils.isEmpty(str)) {
return;
}
g.f6802n.w(false);
n.m.t.a.p.m.e1.a.g2(new n.i.a.l<RequestNoResult<StatusModel, StatusModel>, n.e>() {
@Metadata(d1 = {"\u0000\u0006\n\u0000\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001H\u008a@"}, d2 = {"<anonymous>", "Lorg/godfootsteps/arch/api/model/StatusModel;"}, k = 3, mv = {1, 5, 1}, xi = 48)
@n.g.f.a.c(c = "org.godfootsteps.more.fcm.FcmUtilKt$syncFcmToken$1$1$1", f = "FcmUtil.kt", l = {170}, m = "invokeSuspend")
public static final class AnonymousClass1 extends SuspendLambda implements n.i.a.l<n.g.c<? super StatusModel>, Object> {
public final String $token;
public int label;
public AnonymousClass1(String str, n.g.c<? super AnonymousClass1> cVar) {
super(1, cVar);
this.$token = str;
}
@Override
public final n.g.c<e> create(n.g.c<?> cVar) {
return new AnonymousClass1(this.$token, cVar);
}
@Override
public final Object invoke(n.g.c<? super StatusModel> cVar) {
return ((AnonymousClass1) create(cVar)).invokeSuspend(e.a);
}
@Override
public final Object invokeSuspend(Object obj) {
String j0;
String j02;
String j03;
CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
int i2 = this.label;
if (i2 == 0) {
i.j.a.e.t.d.Q4(obj);
Objects.requireNonNull(AppClient.a);
AppClient appClient = AppClient.Companion.f15176d;
UserContext userContext = UserContext.a;
j0 = n.m.t.a.p.m.e1.a.j0(UserContext.g(), (r2 & 1) != 0 ? "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjaVHmBid5Zx/6sKltt396TEDWt55xO1aCHqtUZh2XMC1Yrzm3CzhW+cbIyuQTZP2nLPDpkfk/UdBNafaqzTYNFPqwBKbcrlDukKcRTytS5mVQDwP7g0CJpJtDOQhBX4Vl/5aL8H91cSXqGa2E6PnR77uRwsyihufRWM6zcwf6QQIDAQAB" : null);
String c = i.c.a.c.j.a().c();
h.d(c, "getInstance().sequence");
j02 = n.m.t.a.p.m.e1.a.j0(c, (r2 & 1) != 0 ? "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjaVHmBid5Zx/6sKltt396TEDWt55xO1aCHqtUZh2XMC1Yrzm3CzhW+cbIyuQTZP2nLPDpkfk/UdBNafaqzTYNFPqwBKbcrlDukKcRTytS5mVQDwP7g0CJpJtDOQhBX4Vl/5aL8H91cSXqGa2E6PnR77uRwsyihufRWM6zcwf6QQIDAQAB" : null);
String str = this.$token;
if (str == null) {
j03 = "";
} else {
j03 = n.m.t.a.p.m.e1.a.j0(str, (r2 & 1) != 0 ? "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjaVHmBid5Zx/6sKltt396TEDWt55xO1aCHqtUZh2XMC1Yrzm3CzhW+cbIyuQTZP2nLPDpkfk/UdBNafaqzTYNFPqwBKbcrlDukKcRTytS5mVQDwP7g0CJpJtDOQhBX4Vl/5aL8H91cSXqGa2E6PnR77uRwsyihufRWM6zcwf6QQIDAQAB" : null);
}
this.label = 1;
obj = appClient.j0(j0, j02, j03, "android", this);
if (obj == coroutineSingletons) {
return coroutineSingletons;
}
} else if (i2 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
i.j.a.e.t.d.Q4(obj);
}
return obj;
}
}
{
super(1);
}
@Override
public e invoke(RequestNoResult<StatusModel, StatusModel> requestNoResult) {
invoke2(requestNoResult);
return e.a;
}
public final void invoke2(RequestNoResult<StatusModel, StatusModel> requestNoResult) {
h.e(requestNoResult, "$this$requestNoResult");
requestNoResult.f(new AnonymousClass1(str, null));
requestNoResult.f15180l = new n.i.a.l<StatusModel, e>() {
@Override
public e invoke(StatusModel statusModel) {
invoke2(statusModel);
return e.a;
}
public final void invoke2(StatusModel statusModel) {
h.e(statusModel, "it");
if (statusModel.getStatus() == 1) {
g.f6802n.w(true);
}
}
};
}
});
}
});
}
public static long w(Animator animator, long j2) {
long duration;
if (animator == null) {
return j2;
}
if (animator instanceof AnimatorSet) {
AnimatorSet animatorSet = (AnimatorSet) animator;
duration = animatorSet.getDuration();
if (duration < 0) {
Iterator<Animator> it = animatorSet.getChildAnimations().iterator();
while (it.hasNext()) {
duration = Math.max(duration, it.next().getDuration());
}
}
} else {
duration = animator.getDuration();
}
return duration < 0 ? j2 : duration;
}
public static final v.a.a.a.a<CharSequence> w0(TextView textView) {
h.e(textView, "<this>");
o.b.t1.a aVar = new o.b.t1.a(new TextViewTextChangesKt$textChanges$5(textView, null), null, 0, null, 14);
CharSequence text = textView.getText();
h.d(text, "text");
h.e(aVar, "<this>");
return new v.a.a.a.a<>(new FlowKt__EmittersKt$onStart$$inlined$unsafeFlow$1(new InitialValueFlowKt$asInitialValueFlow$1(text, null), aVar));
}
public static final View x(Activity activity, final d.c.k.t0.v vVar, final String str) {
h.e(activity, "<this>");
h.e(vVar, "mAddToHelper");
h.e(str, "videoId");
final View inflate = LayoutInflater.from(activity).inflate(org.godfootsteps.video.R$layout.playlist_dialog_video_add_to, (ViewGroup) null);
if (v.i()) {
inflate.setBackground(null);
}
inflate.findViewById(org.godfootsteps.video.R$id.iv_create_playlist).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
final v vVar2 = v.this;
final String str2 = str;
n.i.b.h.e(vVar2, "$mAddToHelper");
n.i.b.h.e(str2, "$videoId");
if (vVar2.f7130d != null && d.c.a.j.v.j()) {
Dialog dialog = vVar2.f7130d;
n.i.b.h.c(dialog);
dialog.dismiss();
}
View inflate2 = LayoutInflater.from(vVar2.a).inflate(org.godfootsteps.video.R$layout.dialog_enter_playlist_name, (ViewGroup) null);
final EditText editText = (EditText) inflate2.findViewById(org.godfootsteps.video.R$id.et_playlist_name);
editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public final boolean onEditorAction(TextView textView, int i2, KeyEvent keyEvent) {
n.i.b.h.e(keyEvent, "event");
return keyEvent.getKeyCode() == 66;
}
});
AlertDialogBuilder alertDialogBuilder = new AlertDialogBuilder(vVar2.a, 0, 2);
alertDialogBuilder.f15259q = new DialogInterface.OnShowListener() {
@Override
public final void onShow(DialogInterface dialogInterface) {
final EditText editText2 = editText;
editText2.postDelayed(new Runnable() {
@Override
public final void run() {
EditText editText3 = editText2;
editText3.requestFocus();
i.c.a.c.n.f(editText3);
}
}, 500L);
editText2.requestFocus();
Objects.requireNonNull(dialogInterface, "null cannot be cast to non-null type androidx.appcompat.app.AlertDialog");
((AlertDialog) dialogInterface).e(-1).setEnabled(false);
}
};
int color = vVar2.a.getResources().getColor(R$color.main);
alertDialogBuilder.f15254l = 1713669106;
alertDialogBuilder.f15255m = color;
alertDialogBuilder.o(org.godfootsteps.video.R$string.app_ensure, new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i2) {
EditText editText2 = editText;
String str3 = str2;
v vVar3 = vVar2;
n.i.b.h.e(vVar3, "this$0");
String obj = editText2.getText().toString();
int length = obj.length() - 1;
int i3 = 0;
boolean z = false;
while (i3 <= length) {
boolean z2 = n.i.b.h.g(obj.charAt(!z ? i3 : length), 32) <= 0;
if (z) {
if (!z2) {
break;
}
length--;
} else if (z2) {
i3++;
} else {
z = true;
}
}
String obj2 = obj.subSequence(i3, length + 1).toString();
String a2 = d.c.a.j.s.a();
if (!TextUtils.isEmpty(obj2)) {
String p0 = n.m.t.a.p.m.e1.a.p0();
n.i.b.h.d(a2, "lan");
n.i.b.h.c(str3);
VideoDb.f16257n.a(vVar3.a).q().j(new CustomPlaylist(p0, obj2, a2, str3, 3));
ToastUtils.b(org.godfootsteps.video.R$string.video_add_success);
d.c.i.d dVar = (d.c.i.d) k.a.a.a.a.b(d.c.i.d.class);
if (dVar != null) {
dVar.d();
}
GAEventSendUtil.a.z(obj2);
}
i.c.a.c.n.c(editText2);
}
});
alertDialogBuilder.l(org.godfootsteps.video.R$string.app_cancel, new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i2) {
i.c.a.c.n.c(editText);
}
});
AlertController.b bVar = alertDialogBuilder.f98i;
bVar.f88n = false;
bVar.f89o = new DialogInterface.OnCancelListener() {
@Override
public final void onCancel(DialogInterface dialogInterface) {
EditText editText2 = editText;
if (editText2 != null) {
i.c.a.c.n.c(editText2);
}
}
};
bVar.f90p = new DialogInterface.OnDismissListener() {
@Override
public final void onDismiss(DialogInterface dialogInterface) {
v vVar3 = v.this;
n.i.b.h.e(vVar3, "this$0");
i.c.a.c.n.d(vVar3.a);
}
};
bVar.f94t = inflate2;
AlertDialog a2 = alertDialogBuilder.a();
vVar2.c = a2;
n.i.b.h.c(a2);
a2.show();
n.i.b.h.d(editText, "enterName");
editText.addTextChangedListener(new u(alertDialogBuilder));
AlertDialog alertDialog = vVar2.c;
n.i.b.h.c(alertDialog);
alertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public final void onDismiss(DialogInterface dialogInterface) {
v vVar3 = v.this;
n.i.b.h.e(vVar3, "this$0");
vVar3.b.f16289n.a = false;
}
});
AlertDialog alertDialog2 = vVar2.c;
n.i.b.h.c(alertDialog2);
alertDialog2.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public final void onCancel(DialogInterface dialogInterface) {
v vVar3 = v.this;
n.i.b.h.e(vVar3, "this$0");
vVar3.b.f16289n.a = false;
}
});
vVar2.b.f16289n.a = true;
}
});
VideoDb.a aVar = VideoDb.f16257n;
d.c.k.s0.a q2 = aVar.a(activity).q();
String a2 = s.a();
h.d(a2, "getApiLang()");
List<CustomPlaylist> g2 = q2.g(a2);
RecyclerView recyclerView = (RecyclerView) inflate.findViewById(org.godfootsteps.video.R$id.rv_playlist);
h.d(recyclerView, "contentView.rv_playlist");
c(recyclerView, g2, vVar, str);
d.c.k.s0.a q3 = aVar.a(activity).q();
String a3 = s.a();
h.d(a3, "getApiLang()");
q3.d(a3).f((e.q.j) activity, new e.q.m() {
@Override
public final void a(Object obj) {
View view = inflate;
v vVar2 = vVar;
String str2 = str;
List list = (List) obj;
n.i.b.h.e(vVar2, "$mAddToHelper");
n.i.b.h.e(str2, "$videoId");
RecyclerView recyclerView2 = (RecyclerView) view.findViewById(org.godfootsteps.video.R$id.rv_playlist);
n.i.b.h.d(recyclerView2, "contentView.rv_playlist");
n.i.b.h.d(list, "it");
d.c.a.m.a.c(recyclerView2, list, vVar2, str2);
}
});
h.d(inflate, "contentView");
return inflate;
}
public static final ReadPosition x0(Bookmark bookmark) {
h.e(bookmark, "<this>");
return new ReadPosition(bookmark.getBookId(), bookmark.getPieceId(), bookmark.getPosition(), false, true, bookmark.getContent(), null, false, null, 456, null);
}
public static CharSequence y(Context context, int i2, int i3) {
d.c.g.l3.h hVar = new d.c.g.l3.h(context);
String h2 = n.m.t.a.p.m.e1.a.h(i3);
String h3 = n.m.t.a.p.m.e1.a.h(i2);
Locale g2 = s.g();
int indexOf = h3.toLowerCase(g2).indexOf(h2.toLowerCase(g2));
SpannableString spannableString = new SpannableString(h3);
if (indexOf >= 0 && h2.length() + indexOf <= h3.length()) {
spannableString.setSpan(hVar, indexOf, h2.length() + indexOf, 18);
}
return TextUtils.concat(spannableString);
}
public static final ReadPosition y0(Note note) {
h.e(note, "<this>");
return new ReadPosition(note.getBookId(), note.getPieceId(), note.getOffsetStart(), true, false, null, null, false, null, 496, null);
}
public static String z() {
String a2 = s.a();
if (a2.equals("ne")) {
a2 = "hi";
} else if (a2.equals("ta") || a2.equals("khm") || a2.equals("hmn") || a2.equals("bn") || a2.equals("uk") || a2.equals("sr")) {
a2 = "en";
}
StringBuilder sb = new StringBuilder();
Objects.requireNonNull(AppClient.a);
sb.append("https://appservercn.kingdomsalvation.org");
sb.append("/terms/privacy-policy-");
sb.append(a2);
sb.append(".html");
return sb.toString();
}
public static final ReadPosition z0(SearchModel searchModel, String str) {
h.e(searchModel, "<this>");
h.e(str, "keyword");
String bookId = searchModel.getBookId();
h.c(bookId);
String pieceId = searchModel.getPieceId();
h.c(pieceId);
return new ReadPosition(bookId, pieceId, searchModel.getPosition(), false, false, searchModel.getContent(), str, false, null, 408, null);
}
}