QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 ShortCutFileManager.java 源代码,内容仅作参考
package com.tencent.mtt.external.reader.dex.internal.menu.datasource.shortcut;
import android.text.TextUtils;
import com.tencent.common.plugin.exports.QBPluginItemInfo;
import com.tencent.mtt.R;
import com.tencent.mtt.base.hometab.ICustomTabService;
import com.tencent.mtt.browser.homepage.fastcut.IFastCutManager;
import com.tencent.mtt.browser.setting.manager.SkinManager;
import com.tencent.mtt.external.reader.dex.base.ReaderConfig;
import com.tencent.mtt.external.reader.dex.internal.menu.MenuContext;
import com.tencent.mtt.external.reader.dex.internal.menu.handler.MenuExposeHandler;
import com.tencent.mtt.external.reader.dex.internal.menu.handler.MenuHandlerBase;
import com.tencent.mtt.external.reader.dex.internal.menu.panel.MenuItemHolder;
import com.tencent.mtt.external.reader.dex.internal.menu.panel.MenuItemRes;
import com.tencent.mtt.nxeasy.list.IEasyItemDataHolder;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.mtt.view.toast.MttToaster;
import qb.a.e;
public class ShortCutFileManager {
private static int a() {
if (SkinManager.s().l()) {
return e.f85871a;
}
return 0;
}
private static MenuItemHolder a(String str, int i, int i2, MenuContext menuContext, ReaderConfig readerConfig) {
return MenuItemHolder.g().a(new MenuItemRes(str, i, a(), 1.0f)).a(new MenuHandlerBase(menuContext, i2)).a(new MenuExposeHandler(menuContext, i2, readerConfig.r));
}
public static IEasyItemDataHolder a(ReaderConfig readerConfig, MenuContext menuContext) {
int i;
String str;
if (a(readerConfig)) {
return null;
}
ShortCutMenuReportUtils.a("qb://filesdk/reader?pkg=com.tencent.mtt&filePath=" + readerConfig.t());
if (c(readerConfig)) {
i = R.drawable.b77;
str = "移除直达";
} else {
i = R.drawable.b76;
str = "添加直达";
}
return a(str, i, 536870912, menuContext, readerConfig);
}
public static void a(ShortCutModel shortCutModel) {
IFastCutManager iFastCutManager = (IFastCutManager) QBContext.getInstance().getService(IFastCutManager.class);
if (iFastCutManager == null || shortCutModel == null) {
return;
}
if (iFastCutManager.removeFastCut(shortCutModel)) {
MttToaster.show("已移除直达", 0);
}
ShortCutMenuReportUtils.b(shortCutModel.f57481a, shortCutModel);
}
public static boolean a(ReaderConfig readerConfig) {
if (!((ICustomTabService) QBContext.getInstance().getService(ICustomTabService.class)).checkTabShowing(117) || !readerConfig.N() || readerConfig.ac() || readerConfig.bq() || readerConfig.k || readerConfig.an()) {
return true;
}
return TextUtils.isEmpty(readerConfig.t());
}
public static void b(ReaderConfig readerConfig) {
IFastCutManager iFastCutManager = (IFastCutManager) QBContext.getInstance().getService(IFastCutManager.class);
if (iFastCutManager == null || readerConfig == null || TextUtils.isEmpty(readerConfig.t())) {
return;
}
ShortCutModel shortCutModel = new ShortCutModel("qb://filesdk/reader?pkg=com.tencent.mtt&filePath=" + readerConfig.t(), readerConfig.u());
shortCutModel.f57483c = d(readerConfig);
shortCutModel.a("2");
if (iFastCutManager.hasExist(shortCutModel)) {
a(shortCutModel);
} else {
b(shortCutModel);
}
}
private static void b(ShortCutModel shortCutModel) {
IFastCutManager iFastCutManager = (IFastCutManager) QBContext.getInstance().getService(IFastCutManager.class);
if (iFastCutManager == null || shortCutModel == null) {
return;
}
iFastCutManager.addFastCut(shortCutModel, true, null);
ShortCutMenuReportUtils.a(shortCutModel.f57481a, shortCutModel);
}
public static boolean c(ReaderConfig readerConfig) {
IFastCutManager iFastCutManager = (IFastCutManager) QBContext.getInstance().getService(IFastCutManager.class);
if (iFastCutManager == null || readerConfig == null || TextUtils.isEmpty(readerConfig.t())) {
return false;
}
return iFastCutManager.hasExist(new ShortCutModel("qb://filesdk/reader?pkg=com.tencent.mtt&filePath=" + readerConfig.t(), readerConfig.u()));
}
private static String d(ReaderConfig readerConfig) {
if (readerConfig == null) {
return "";
}
if (readerConfig.ai()) {
return "https://m4.publicimg.browser.qq.com/publicimg/nav/xhome/file_exl.png";
}
if (readerConfig.ah()) {
return "https://m4.publicimg.browser.qq.com/publicimg/nav/xhome/file_doc.png";
}
String str = readerConfig.o;
if (TextUtils.isEmpty(str)) {
return "";
}
char c2 = 65535;
switch (str.hashCode()) {
case 98472:
if (str.equals("chm")) {
c2 = 1;
break;
}
break;
case 110834:
if (str.equals("pdf")) {
c2 = 3;
break;
}
break;
case 111220:
if (str.equals("ppt")) {
c2 = 4;
break;
}
break;
case 115312:
if (str.equals(QBPluginItemInfo.CONTENT_TXT)) {
c2 = 0;
break;
}
break;
case 3120248:
if (str.equals("epub")) {
c2 = 2;
break;
}
break;
case 3447940:
if (str.equals("pptx")) {
c2 = 5;
break;
}
break;
}
return c2 != 0 ? c2 != 1 ? c2 != 2 ? c2 != 3 ? (c2 == 4 || c2 == 5) ? "https://m4.publicimg.browser.qq.com/publicimg/nav/xhome/file_ppt.png" : "" : "https://m4.publicimg.browser.qq.com/publicimg/nav/xhome/file_pdf.png" : "https://m4.publicimg.browser.qq.com/publicimg/nav/xhome/file_epub.png" : "https://m4.publicimg.browser.qq.com/publicimg/nav/xhome/file_chm.png" : "https://m4.publicimg.browser.qq.com/publicimg/nav/xhome/file_txt.png";
}
}