正在查看: 万能钥匙 v1.1.23 应用的 DocumentViewerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 万能钥匙 v1.1.23 应用的 DocumentViewerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.finogeeks.lib.applet.modules.documentviewer;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.MimeTypeMap;
import android.widget.FrameLayout;
import android.widget.TextView;
import com.finogeeks.lib.applet.R;
import com.finogeeks.lib.applet.i.ext.TbsInitializer;
import com.finogeeks.lib.applet.main.FinAppEnv;
import com.finogeeks.lib.applet.modules.ext.s;
import com.finogeeks.lib.applet.modules.log.FLog;
import com.finogeeks.lib.applet.modules.provider.FinAppletFileProvider;
import com.finogeeks.lib.applet.modules.subscaleview.ImageEditeActivity;
import com.finogeeks.lib.applet.utils.FileDownloader;
import com.finogeeks.lib.applet.utils.OrientationUtil;
import com.finogeeks.lib.applet.utils.r;
import com.tencent.smtt.sdk.TbsReaderView;
import hh0.l;
import java.io.File;
import java.util.HashMap;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.g0;
import kotlin.jvm.internal.n;
import kotlin.jvm.internal.p;
import kotlin.jvm.internal.y;
import lg0.h;
import lg0.i;
import tj0.t;
@Metadata(d1 = {"\u0000L\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0000\n\u0002\b\b\n\u0002\u0010\u000e\n\u0002\b\b\n\u0002\u0010\u000b\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0006\b\u0007\u0018\u00002\u00020\u00012\u00020\u0002:\u00014B\u0007¢\u0006\u0004\b\u0003\u0010\u0004J\u0019\u0010\b\u001a\u00020\u00072\b\u0010\u0006\u001a\u0004\u0018\u00010\u0005H\u0014¢\u0006\u0004\b\b\u0010\tJ-\u0010\u000f\u001a\u00020\u00072\b\u0010\u000b\u001a\u0004\u0018\u00010\n2\b\u0010\r\u001a\u0004\u0018\u00010\f2\b\u0010\u000e\u001a\u0004\u0018\u00010\fH\u0016¢\u0006\u0004\b\u000f\u0010\u0010J\u000f\u0010\u0011\u001a\u00020\u0007H\u0014¢\u0006\u0004\b\u0011\u0010\u0004J\u000f\u0010\u0012\u001a\u00020\u0007H\u0002¢\u0006\u0004\b\u0012\u0010\u0004J\u000f\u0010\u0013\u001a\u00020\u0007H\u0002¢\u0006\u0004\b\u0013\u0010\u0004J\u000f\u0010\u0014\u001a\u00020\u0007H\u0002¢\u0006\u0004\b\u0014\u0010\u0004J\u001f\u0010\u0018\u001a\u00020\u00152\u0006\u0010\u0016\u001a\u00020\u00152\u0006\u0010\u0017\u001a\u00020\u0015H\u0002¢\u0006\u0004\b\u0018\u0010\u0019J\u001f\u0010\u001c\u001a\u00020\u00072\u0006\u0010\u001a\u001a\u00020\u00152\u0006\u0010\u001b\u001a\u00020\u0015H\u0002¢\u0006\u0004\b\u001c\u0010\u001dJ)\u0010 \u001a\u00020\u00072\u0006\u0010\u001a\u001a\u00020\u00152\u0006\u0010\u001b\u001a\u00020\u00152\b\b\u0002\u0010\u001f\u001a\u00020\u001eH\u0002¢\u0006\u0004\b \u0010!R\u0016\u0010\"\u001a\u00020\n8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\"\u0010#R\"\u0010$\u001a\u00020\u001e8\u0006@\u0006X\u0086\u000e¢\u0006\u0012\n\u0004\b$\u0010%\u001a\u0004\b$\u0010&\"\u0004\b'\u0010(R\u001b\u0010.\u001a\u00020)8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b*\u0010+\u001a\u0004\b,\u0010-R\u001b\u00103\u001a\u00020/8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b0\u0010+\u001a\u0004\b1\u00102¨\u00065"}, d2 = {"Lcom/finogeeks/lib/applet/modules/documentviewer/DocumentViewerActivity;", "Lcom/finogeeks/lib/applet/modules/base/SwipeBackBaseActivity;", "Lcom/tencent/smtt/sdk/TbsReaderView$ReaderCallback;", "<init>", "()V", "Landroid/os/Bundle;", "savedInstanceState", "Llg0/e0;", "onCreate", "(Landroid/os/Bundle;)V", "", "p0", "", "p1", "p2", "onCallBackAction", "(Ljava/lang/Integer;Ljava/lang/Object;Ljava/lang/Object;)V", "onDestroy", "action", "addTbsReaderViewAndOpenDocument", "checkTbs", "", ImageEditeActivity.EXTRA_FILE_PATH, "fileExt", "ensureFileName", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "path", "ext", "openDocument", "(Ljava/lang/String;Ljava/lang/String;)V", "", "unkonw", "openFileChooser", "(Ljava/lang/String;Ljava/lang/String;Z)V", "checkTbsTimes", "I", "isAddTbsView", "Z", "()Z", "setAddTbsView", "(Z)V", "Lcom/finogeeks/lib/applet/modules/tbs/TbsInitializer;", "tbsInitializer$delegate", "Llg0/h;", "getTbsInitializer", "()Lcom/finogeeks/lib/applet/modules/tbs/TbsInitializer;", "tbsInitializer", "Lcom/tencent/smtt/sdk/TbsReaderView;", "tbsReaderView$delegate", "getTbsReaderView", "()Lcom/tencent/smtt/sdk/TbsReaderView;", "tbsReaderView", "Companion", "finapplet_release"}, k = 1, mv = {1, 4, 0})
public final class DocumentViewerActivity extends com.finogeeks.lib.applet.modules.base.a implements TbsReaderView.ReaderCallback {
static final l[] f = {g0.j(new y(g0.b(DocumentViewerActivity.class), "tbsInitializer", "getTbsInitializer()Lcom/finogeeks/lib/applet/modules/tbs/TbsInitializer;")), g0.j(new y(g0.b(DocumentViewerActivity.class), "tbsReaderView", "getTbsReaderView()Lcom/tencent/smtt/sdk/TbsReaderView;"))};
private final h a = i.a(new d());
private final h b = i.a(new e());
private int c;
private boolean d;
private HashMap e;
public static final class a extends p implements ah0.a<FileDownloader> {
public static final a a = new a();
public a() {
super(0);
}
public final FileDownloader m572invoke() {
return new FileDownloader();
}
}
public static final class b {
static {
g0.j(new y(g0.b(b.class), "fileDownloader", "getFileDownloader()Lcom/finogeeks/lib/applet/utils/FileDownloader;"));
}
private b() {
}
public b(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
}
@Metadata(d1 = {"\u0000\u001f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\b\n\u0002\b\u0005*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0017\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016¢\u0006\u0004\b\u0005\u0010\u0006J\u000f\u0010\u0007\u001a\u00020\u0004H\u0016¢\u0006\u0004\b\u0007\u0010\bJ\u0017\u0010\n\u001a\u00020\u00042\u0006\u0010\t\u001a\u00020\u0002H\u0016¢\u0006\u0004\b\n\u0010\u0006J\u0017\u0010\r\u001a\u00020\u00042\u0006\u0010\f\u001a\u00020\u000bH\u0016¢\u0006\u0004\b\r\u0010\u000eJ\u000f\u0010\u000f\u001a\u00020\u0004H\u0016¢\u0006\u0004\b\u000f\u0010\b¨\u0006\u0010"}, d2 = {"com/finogeeks/lib/applet/modules/documentviewer/DocumentViewerActivity$checkTbs$1", "Lcom/finogeeks/lib/applet/modules/tbs/TbsInitializer$InitCallback;", "", "isX5", "Llg0/e0;", "onViewInitFinished", "(Z)V", "onTbsDisabled", "()V", "success", "onTbsDownloadFinished", "", "progress", "onTbsDownloadProgress", "(I)V", "onTbsInstallFinish", "finapplet_release"}, k = 1, mv = {1, 4, 0})
public static final class c implements TbsInitializer.c {
public static final class a implements Runnable {
public a() {
}
@Override
public final void run() {
DocumentViewerActivity documentViewerActivity = DocumentViewerActivity.this;
int i = R.id.tvDownloadingTbs;
TextView textView = (TextView) documentViewerActivity._$_findCachedViewById(i);
n.e(textView, "tvDownloadingTbs");
textView.setVisibility(0);
TextView textView2 = (TextView) DocumentViewerActivity.this._$_findCachedViewById(i);
n.e(textView2, "tvDownloadingTbs");
textView2.setText(DocumentViewerActivity.this.getString(R.string.fin_applet_tbs_plugin_is_disabled));
}
}
@Metadata(d1 = {"\u0000\b\n\u0002\u0018\u0002\n\u0002\b\u0003\u0010\u0003\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"Llg0/e0;", "run", "()V", "<anonymous>"}, k = 3, mv = {1, 4, 0})
public static final class b implements Runnable {
final boolean b;
public static final class a implements Runnable {
public a() {
}
@Override
public final void run() {
DocumentViewerActivity.this.c();
}
}
public b(boolean z10) {
this.b = z10;
}
@Override
public final void run() {
if (this.b) {
return;
}
if (DocumentViewerActivity.this.c >= 3) {
TextView textView = (TextView) DocumentViewerActivity.this._$_findCachedViewById(R.id.tvDownloadingTbs);
n.e(textView, "tvDownloadingTbs");
textView.setText(DocumentViewerActivity.this.getString(R.string.fin_applet_download_tbs_plugin_failed));
} else {
DocumentViewerActivity documentViewerActivity = DocumentViewerActivity.this;
int i = R.id.tvDownloadingTbs;
TextView textView2 = (TextView) documentViewerActivity._$_findCachedViewById(i);
n.e(textView2, "tvDownloadingTbs");
textView2.setText(DocumentViewerActivity.this.getString(R.string.fin_applet_download_tbs_plugin_failed_with_retry, 2));
((TextView) DocumentViewerActivity.this._$_findCachedViewById(i)).postDelayed(new a(), 2000L);
}
}
}
public static final class RunnableC0207c implements Runnable {
final int b;
public RunnableC0207c(int i) {
this.b = i;
}
@Override
public final void run() {
TextView textView = (TextView) DocumentViewerActivity.this._$_findCachedViewById(R.id.tvDownloadingTbs);
n.e(textView, "tvDownloadingTbs");
textView.setText(DocumentViewerActivity.this.getString(R.string.fin_applet_downloading_tbs_plugin, Integer.valueOf(Math.min(this.b, 100))));
}
}
public static final class d implements Runnable {
final boolean b;
public d(boolean z10) {
this.b = z10;
}
@Override
public final void run() {
if (!this.b) {
TextView textView = (TextView) DocumentViewerActivity.this._$_findCachedViewById(R.id.tvDownloadingTbs);
n.e(textView, "tvDownloadingTbs");
textView.setText(DocumentViewerActivity.this.getString(R.string.fin_applet_init_tbs_plugin_failed));
} else {
TextView textView2 = (TextView) DocumentViewerActivity.this._$_findCachedViewById(R.id.tvDownloadingTbs);
n.e(textView2, "tvDownloadingTbs");
textView2.setVisibility(8);
DocumentViewerActivity.this.b();
}
}
}
public c() {
}
@Override
public void a() {
DocumentViewerActivity.this.runOnUiThread(new a());
}
@Override
public void a(int i) {
DocumentViewerActivity.this.runOnUiThread(new RunnableC0207c(i));
}
@Override
public void a(boolean z10) {
DocumentViewerActivity.this.runOnUiThread(new b(z10));
}
@Override
public void b() {
}
@Override
public void onViewInitFinished(boolean isX5) {
DocumentViewerActivity.this.runOnUiThread(new d(isX5));
}
}
public static final class d extends p implements ah0.a<TbsInitializer> {
public d() {
super(0);
}
public final TbsInitializer m573invoke() {
return new TbsInitializer(DocumentViewerActivity.this);
}
}
public static final class e extends p implements ah0.a<TbsReaderView> {
public e() {
super(0);
}
public final TbsReaderView m574invoke() {
TbsReaderView.ReaderCallback readerCallback = DocumentViewerActivity.this;
return new TbsReaderView(readerCallback, readerCallback);
}
}
static {
new b(null);
i.a(a.a);
}
private final String a(String str, String str2) {
String b2 = s.b(str);
if (b2.length() == 0 && str2.length() > 0) {
return s.c(str) + '.' + str2;
}
if (b2.length() > 0 && str2.length() == 0) {
String c2 = s.c(str);
return c2 != null ? c2 : "";
}
if (b2.length() <= 0 || str2.length() <= 0) {
String c3 = s.c(str);
return c3 != null ? c3 : "";
}
if (n.d(b2, str2)) {
String c4 = s.c(str);
return c4 != null ? c4 : "";
}
String c5 = s.c(t.F(str, b2, str2, false, 4, (Object) null));
return c5 != null ? c5 : "";
}
private final void a() {
if (isFinishing() || isDestroyed()) {
return;
}
String stringExtra = getIntent().getStringExtra(ImageEditeActivity.EXTRA_FILE_PATH);
if (stringExtra == null) {
n.t();
}
n.e(stringExtra, "intent.getStringExtra(EXTRA_FILE_PATH)!!");
String stringExtra2 = getIntent().getStringExtra("fileExt");
if (stringExtra2 == null) {
n.t();
}
n.e(stringExtra2, "intent.getStringExtra(EXTRA_FILE_EXT)!!");
if (t.y(stringExtra)) {
return;
}
if (stringExtra2 == null || t.y(stringExtra2)) {
stringExtra2 = s.b(stringExtra);
}
String str = stringExtra2;
if (t.y(str)) {
return;
}
a(this, stringExtra, str, false, 4, null);
}
public static void a(DocumentViewerActivity documentViewerActivity, String str, String str2, boolean z10, int i, Object obj) {
if ((i & 4) != 0) {
z10 = true;
}
documentViewerActivity.a(str, str2, z10);
}
private final void a(String str, String str2, boolean z10) {
String name;
String str3;
File file = new File(str);
Intent intent = new Intent("android.intent.action.VIEW");
String a2 = com.finogeeks.lib.applet.api.file.d.a(str);
String name2 = file.getName();
n.e(name2, "input.name");
if (!t.u(name2, ".bin", false, 2, (Object) null) && !t.y(s.b(str))) {
name = file.getName();
} else if (a2 == null || t.y(a2)) {
name = file.getName();
} else {
name = file.getName() + '.' + a2;
}
File file2 = new File(getCacheDir() + "/download/public", name);
yg0.n.t(file, file2, true, 0, 4, (Object) null);
if (z10 || (str3 = MimeTypeMap.getSingleton().getMimeTypeFromExtension(str2)) == null) {
str3 = "";
}
if (str3.length() == 0) {
str3 = "*/*";
}
if (Build.VERSION.SDK_INT >= 24) {
intent.setDataAndType(FinAppletFileProvider.a(this, file2), str3);
intent.addFlags(1);
} else {
intent.setDataAndType(Uri.fromFile(file2), str3);
}
try {
startActivity(intent);
finish();
} catch (Throwable th2) {
th2.printStackTrace();
}
}
public final void b() {
if (this.d) {
String stringExtra = getIntent().getStringExtra(ImageEditeActivity.EXTRA_FILE_PATH);
if (stringExtra == null) {
n.t();
}
n.e(stringExtra, "intent.getStringExtra(EXTRA_FILE_PATH)!!");
String stringExtra2 = getIntent().getStringExtra("fileExt");
if (stringExtra2 == null) {
n.t();
}
n.e(stringExtra2, "intent.getStringExtra(EXTRA_FILE_EXT)!!");
b(stringExtra, stringExtra2);
return;
}
this.d = true;
((FrameLayout) _$_findCachedViewById(R.id.flContent)).addView((View) e(), (ViewGroup.LayoutParams) new FrameLayout.LayoutParams(-1, -1));
String stringExtra3 = getIntent().getStringExtra(ImageEditeActivity.EXTRA_FILE_PATH);
if (stringExtra3 == null) {
n.t();
}
n.e(stringExtra3, "intent.getStringExtra(EXTRA_FILE_PATH)!!");
String stringExtra4 = getIntent().getStringExtra("fileExt");
if (stringExtra4 == null) {
n.t();
}
n.e(stringExtra4, "intent.getStringExtra(EXTRA_FILE_EXT)!!");
b(stringExtra3, stringExtra4);
}
private final void b(String str, String str2) {
if (t.y(str)) {
return;
}
String b2 = (str2 == null || t.y(str2)) ? s.b(str) : str2;
if (t.y(b2)) {
return;
}
if (!e().preOpen(b2, false)) {
a(this, str, str2, false, 4, null);
return;
}
String a2 = a(str, b2);
File cacheDir = getCacheDir();
n.e(cacheDir, "cacheDir");
String absolutePath = cacheDir.getAbsolutePath();
String str3 = absolutePath + File.separator + a2;
r.b(str, str3);
FLog.d$default("", "openDocument cacheDirPath:" + absolutePath + ",cacheFilePath:" + str3 + ",fileName:" + a2 + ",filePath:" + str + ",fileExt:" + b2, null, 4, null);
Bundle bundle = new Bundle();
bundle.putString(ImageEditeActivity.EXTRA_FILE_PATH, str3);
bundle.putString("tempPath", absolutePath);
e().openFile(bundle);
}
public final void c() {
this.c++;
d().a(FinAppEnv.INSTANCE.getFinAppConfig(), new c());
}
private final TbsInitializer d() {
h hVar = this.a;
l lVar = f[0];
return (TbsInitializer) hVar.getValue();
}
private final TbsReaderView e() {
h hVar = this.b;
l lVar = f[1];
return (TbsReaderView) hVar.getValue();
}
@Override
public void _$_clearFindViewByIdCache() {
HashMap hashMap = this.e;
if (hashMap != null) {
hashMap.clear();
}
}
@Override
public View _$_findCachedViewById(int i) {
if (this.e == null) {
this.e = new HashMap();
}
View view = (View) this.e.get(Integer.valueOf(i));
if (view != null) {
return view;
}
View findViewById = findViewById(i);
this.e.put(Integer.valueOf(i), findViewById);
return findViewById;
}
public void onCallBackAction(Integer p0, Object p1, Object p2) {
FLog.d$default("", "openDocument , onCallBackAction p0:" + p0 + ",p1:" + p1 + ",p2:," + p2, null, 4, null);
if (p0 != null && 19 == p0.intValue() && (p1 instanceof Integer) && ((Number) p1).intValue() > 0) {
a();
} else if ((p2 instanceof Bundle) && ((Bundle) p2).containsKey("errcode")) {
a();
}
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
OrientationUtil.INSTANCE.configOrientation(this);
setContentView(R.layout.fin_applet_activity_document_viewer);
c();
}
@Override
public void onDestroy() {
super.onDestroy();
e().onStop();
}
}