调研通 v3.0.3版本的 MD5 值为:fe075d21227d488bdb9f6aa09d3b3f35

以下内容为反编译后的 n.java 源代码,内容仅作参考


package com.yyt.common.o;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.TextView;
import c.o.a.a.b;
import com.arialyy.aria.core.Aria;
import com.arialyy.aria.core.download.target.HttpBuilderTarget;
import com.huawei.hms.framework.common.ContainerUtils;
import com.huawei.hms.push.constant.RemoteMessageConst;
import com.tencent.smtt.sdk.QbSdk;
import com.tencent.smtt.sdk.TbsDownloader;
import com.tencent.smtt.sdk.TbsListener;
import com.yyt.common.plugin.gcm.PushHandlerActivity;
import java.net.URLDecoder;
import java.util.HashMap;
import org.apache.cordova.ConfigXmlParser;
import org.eclipse.paho.client.mqttv3.MqttTopic;
import org.json.JSONException;
import org.json.JSONObject;

@SuppressLint({"NewApi"})
public class n {

    private static final String f11204a = "MobileUtil";

    private static int f11205b = 100;

    static boolean f11206c;

    class a extends Handler {
        a() {
        }

        @Override
        public void handleMessage(Message message) {
            throw new RuntimeException();
        }
    }

    class b implements TbsListener {
        b() {
        }

        @Override
        public void onDownloadFinish(int i) {
            Log.i(n.f11204a, "X5内核下载结束状态编码:" + i);
        }

        @Override
        public void onDownloadProgress(int i) {
            Log.i(n.f11204a, "X5内核下载进度:" + i);
        }

        @Override
        public void onInstallFinish(int i) {
            Log.i(n.f11204a, "X5内核安装结束状态编码: " + i);
        }
    }

    public static void a(Activity activity) {
        ((HttpBuilderTarget) Aria.download(activity).load("http://fbcs.uf-tobacco.com/yyt-fileservice-admin/fileDownloadService?pkCorp=1002&cuserid=0001AA10000000000T86&userCode=wurq&serviceCode=webnc&path=group1/M00/00/09/Cry1O2HxSr6Aa_w9AAQMaTbzQTA75.docx&fileName=%25E5%2580%259F%25E6%25AC%25BE%25E5%258D%2595%25E5%25BC%2595%25E7%2594%25A8%25E4%25BA%258B%25E5%2589%258D%25E7%2594%25B3%25E8%25AF%25B7%25E4%25BD%25BF%25E7%2594%25A8%25E5%259C%25BA%25E6%2599%25AF.docx&sessionid=f85bf8491ee58e18&isMobile=true").setFilePath("/sdcard/1.doc", true).resetState()).create();
    }

    public static boolean b(Context context, String str, String str2) {
        final a aVar = new a();
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        if (!r.p(str)) {
            builder.setTitle(str);
        }
        builder.setCancelable(false);
        builder.setMessage(str2);
        builder.setPositiveButton("否", new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                n.n(aVar, dialogInterface, i);
            }
        });
        builder.setNegativeButton("是", new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                n.o(aVar, dialogInterface, i);
            }
        });
        builder.show();
        try {
            Looper.loop();
        } catch (RuntimeException unused) {
        }
        return f11206c;
    }

    public static String c(Context context, String str, String str2) {
        ConfigXmlParser configXmlParser = new ConfigXmlParser();
        configXmlParser.parse(context);
        return configXmlParser.getPreferences().getString(str, str2);
    }

    public static String d(Context context) {
        String str;
        String k = k(context, "app_theme");
        s.m(context, "nav-tint-color", "#FFFFFF");
        str = "#4ba7a5";
        if (k != null && !"".equals(k)) {
            "default".equals(k);
            str = "polar".equals(k) ? "#15C8A9" : "#4ba7a5";
            if ("green".equals(k)) {
                str = "#026953";
            }
            if ("blue".equals(k)) {
                str = "#0089FF";
            }
            if ("white".equals(k)) {
                s.m(context, "nav-tint-color", "#000000");
                return "#FFFFFF";
            }
        }
        return str;
    }

    public static String e(Context context) {
        String i = s.i(context, "nav-tint-color");
        return i == null ? "#FFFFFF" : i;
    }

    public static PackageInfo f(Context context) {
        try {
            return context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
        } catch (PackageManager.NameNotFoundException e2) {
            com.yyt.common.plugin.logger.c.a(f11204a, "PackageManager.NameNotFoundException异常。" + e2.getMessage(), e2);
            return null;
        }
    }

    public static String g(String str, String str2) {
        if (str.indexOf("?") > 0) {
            str = str.substring(str.indexOf("?") + 1);
        }
        String[] split = str.split("&");
        HashMap hashMap = new HashMap();
        for (String str3 : split) {
            String[] split2 = str3.split(ContainerUtils.KEY_VALUE_DELIMITER);
            if (split2.length >= 2) {
                hashMap.put(split2[0], split2[1]);
            }
        }
        String str4 = (String) hashMap.get(str2);
        if (str4 == null) {
            return str4;
        }
        try {
            return URLDecoder.decode(str4, "UTF-8");
        } catch (Exception unused) {
            return str4;
        }
    }

    public static String h(String str) {
        String str2 = str.equals("android.permission.WRITE_EXTERNAL_STORAGE") ? "你已禁止授予写入存储权限,可能会造成功能不可用,如需使用请到设置里开启权限" : "你已禁止授予权限,可能会造成功能不可用,如需使用请到设置里开启权限";
        if (str.equals("android.permission.READ_EXTERNAL_STORAGE")) {
            str2 = "你已禁止授予读取存储权限,可能会造成功能不可用,如需使用请到设置里开启权限";
        }
        if (str.equals("android.permission.RECORD_AUDIO")) {
            str2 = "你已禁止授予麦克风权限,可能会造成功能不可用,如需使用请到设置里开启权限";
        }
        return str.equals("android.permission.CAMERA") ? "你已禁止授予相机权限,可能会造成功能不可用,如需使用请到设置里开启权限" : str2;
    }

    public static View i(Context context, String str) {
        String str2;
        String str3;
        View inflate = LayoutInflater.from(context).inflate(b.l.layout_permission_tip, (ViewGroup) null);
        try {
            str2 = String.valueOf(context.getPackageManager().getApplicationLabel(context.getApplicationInfo()));
        } catch (Throwable unused) {
            str2 = "友门户";
        }
        String str4 = "";
        if (str.equals("android.permission.WRITE_EXTERNAL_STORAGE") || str.equals("android.permission.READ_EXTERNAL_STORAGE")) {
            str4 = str2 + "申请获取存储权限";
            str3 = "在下方弹框中选择允许后,你可以查看和选择相册里的图片视频作为附件进行上传,保存图片或文件到设备";
        } else {
            str3 = "";
        }
        if (str.equals("android.permission.RECORD_AUDIO")) {
            str4 = str2 + "申请获取麦克风权限";
            str3 = "在下方弹框中选择允许后,你可以使用语音制单、语音搜索等功能";
        }
        if (str.equals("android.permission.CAMERA")) {
            str4 = str2 + "申请获取相机权限";
            str3 = "在下方弹框中选择允许后,你可以使用[扫一扫]进行二维码扫码,也可以,保存图片或文件到设备";
        }
        if (str.equals("android.permission.ACCESS_FINE_LOCATION")) {
            str4 = str2 + "申请获取位置权限";
            str3 = "在下方弹框中选择允许后,你可以使用定位功能";
        }
        ((TextView) inflate.findViewById(b.i.permission_tiptitle_view)).setText(str4);
        ((TextView) inflate.findViewById(b.i.permission_tipcontent_view)).setText(str3);
        WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();
        layoutParams.height = -1;
        layoutParams.width = -1;
        layoutParams.alpha = 0.8f;
        layoutParams.type = 2;
        inflate.setLayoutParams(layoutParams);
        return inflate;
    }

    public static String j(Context context, String str) {
        if (str.startsWith("file://") || str.startsWith("http")) {
            return str;
        }
        String i = str.startsWith("com.") ? s.i(context, str.split(MqttTopic.TOPIC_LEVEL_SEPARATOR)[0]) : null;
        if (str.startsWith("apps/com.")) {
            String str2 = str.split(MqttTopic.TOPIC_LEVEL_SEPARATOR)[1];
            str = str.replace("apps/", "");
            i = s.i(context, str2);
        }
        if (i == null) {
            if (str.startsWith("com.")) {
                return com.yyt.common.resources.plugin.q.c(context) + "/default/apps/" + str;
            }
            return com.yyt.common.resources.plugin.q.c(context) + "/default/" + str;
        }
        return "file://" + i + str;
    }

    public static String k(Context context, String str) {
        String i = s.i(context, com.yyt.common.d.G);
        if (i == null) {
            return null;
        }
        try {
            return new JSONObject(i).getString(str);
        } catch (JSONException unused) {
            return null;
        }
    }

    public static void l(Context context) {
        com.yyt.common.e.i(context).f();
    }

    public static void m(Context context) {
        if (QbSdk.canLoadX5(context)) {
            return;
        }
        QbSdk.reset(context);
        QbSdk.setDownloadWithoutWifi(true);
        QbSdk.setTbsListener(new b());
        TbsDownloader.startDownload(context);
    }

    public static void n(Handler handler, DialogInterface dialogInterface, int i) {
        f11206c = false;
        handler.sendMessage(handler.obtainMessage());
    }

    public static void o(Handler handler, DialogInterface dialogInterface, int i) {
        f11206c = true;
        handler.sendMessage(handler.obtainMessage());
    }

    public static void p(Activity activity) {
        Intent intent = new Intent();
        intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS");
        intent.setData(Uri.parse("package:" + activity.getApplication().getPackageName()));
        activity.startActivity(intent);
    }

    public static void q(Context context, String str, JSONObject jSONObject) throws JSONException {
        NotificationManager notificationManager = (NotificationManager) context.getSystemService(RemoteMessageConst.NOTIFICATION);
        Notification.Builder builder = new Notification.Builder(context);
        com.yyt.common.plugin.logger.c.b(f11204a, "显示通知消息:" + jSONObject.toString());
        Intent intent = new Intent(context, (Class<?>) PushHandlerActivity.class);
        intent.setFlags(335544320);
        intent.putExtra("notificationInfo", jSONObject.toString());
        builder.setContentTitle(str).setTicker(jSONObject.getString("alert")).setContentText(jSONObject.getString("alert")).setContentIntent(PendingIntent.getActivity(context, 0, intent, 134217728)).setWhen(System.currentTimeMillis()).setOngoing(false).setDefaults(1);
        Notification build = builder.build();
        build.flags = 16;
        build.defaults |= 2;
        notificationManager.notify(f11205b, build);
        f11205b++;
        try {
            com.yyt.common.shortcutbadger.b.a(context, jSONObject.getInt("badge"));
        } catch (Exception e2) {
            Log.e(f11204a, "设置角标出现异常." + e2.getMessage(), e2);
        }
    }
}