导航菜单

页面标题

页面副标题

SpinDisplay v2.0.2.6 - MainActivity.java 源代码

正在查看: SpinDisplay v2.0.2.6 应用的 MainActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.dmz.f20ad.activity;

import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.preference.PreferenceManager;
import android.util.Log;
import android.view.View;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import androidx.core.content.FileProvider;
import androidx.fragment.app.Fragment;
import b.l.a.i;
import b.l.a.r;
import b.u.c;
import b.u.y;
import butterknife.ButterKnife;
import com.dmz.f20ad.App;
import com.dmz.f20ad.activity.MainActivity;
import com.dmz.f20ad.connect.UdpService;
import com.dmz.f20ad.fragment.DesignFragment;
import com.dmz.f20ad.fragment.DeviceManagerFragment;
import com.dmz.f20ad.fragment.MediasFragment;
import com.dmz.f20ad.fragment.ProjectonFragment;
import com.dmz.f20ad.fragment.ShareFragment;
import com.dmz.f20ad.model.DocumentInfo;
import com.dmz.f20ad.model.PackageInfo;
import com.dmz.f20ad.model.PackageLocal;
import com.dmz.f20ad.model.PackageLocalDao;
import com.dmz.f20ad.model.Template;
import com.dmz.f20ad.model.TemplateDao;
import com.dmz.f20ad.model.TemplateSource;
import d.a.a.d;
import d.a.a.f;
import d.e.a.n.r2;
import d.e.a.n.t2;
import d.e.a.n.u2;
import d.e.a.p.n0;
import d.e.a.p.p0;
import d.e.a.r.d;
import g.a.e;
import g.a.n.a;
import g.a.p.b;
import j.a0;
import j.b0;
import j.e0;
import j.f0;
import j.h0;
import j.v;
import j.w;
import j.y;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import l.a.a.m;
import l.a.b.k.h;
import me.zhanghai.android.materialprogressbar.BuildConfig;
import org.greenrobot.eventbus.ThreadMode;

public class MainActivity extends r2 {
    public static boolean w = false;
    public RadioButton mDesign;
    public RadioButton mDevices;
    public TextView mHelp;
    public RadioGroup mNavigationBar;
    public a s;
    public int t;
    public TemplateDao u;
    public String v;

    public static void a(Context context, String str) {
        Uri fromFile;
        Log.d("wyt", "installApk: ");
        try {
            File file = new File(str);
            Intent intent = new Intent();
            intent.setAction("android.intent.action.VIEW");
            intent.addCategory("android.intent.category.DEFAULT");
            intent.setFlags(268435456);
            if (Build.VERSION.SDK_INT >= 24) {
                fromFile = FileProvider.a(context, "com.dmz.f20ad.fileprovider", file);
                intent.addFlags(1);
            } else {
                fromFile = Uri.fromFile(file);
            }
            intent.setDataAndType(fromFile, "application/vnd.android.package-archive");
            context.startActivity(intent);
        } catch (Exception e2) {
            StringBuilder a2 = d.b.a.a.a.a("installApk: ");
            a2.append(e2.getMessage());
            Log.d("MainActivity wyt", a2.toString());
            y.d("文件解析失败" + e2.getMessage());
        }
    }

    public static void a(f fVar, Throwable th) {
        fVar.dismiss();
        y.e(th.getMessage());
    }

    public static void a(Object obj) {
    }

    public static void a(Throwable th) {
        StringBuilder a2 = d.b.a.a.a.a("downloadApplication: ");
        a2.append(th.getMessage());
        Log.e("MainActivity wyt", a2.toString());
    }

    public static h0 b(String str) {
        j.y yVar = new j.y(new y.b());
        b0.a aVar = new b0.a();
        aVar.a(str);
        f0 b2 = ((a0) yVar.a(aVar.a())).b();
        if (b2.i()) {
            return b2.f6582h;
        }
        Log.e("MainActivity wyt", "downloadDocument: " + b2);
        throw new IOException("Unexpected code" + b2);
    }

    public static void b(Object obj) {
    }

    public static void b(Throwable th) {
        StringBuilder a2 = d.b.a.a.a.a("downloadDocument: ");
        a2.append(th.getMessage());
        Log.e("MainActivity wyt", a2.toString());
    }

    public static h0 c(String str) {
        j.y yVar = new j.y(new y.b());
        b0.a aVar = new b0.a();
        aVar.a(str);
        f0 b2 = ((a0) yVar.a(aVar.a())).b();
        if (b2.i()) {
            return b2.f6582h;
        }
        Log.e("MainActivity wyt", "downloadFirmware: " + b2);
        throw new IOException("Unexpected code" + b2);
    }

    public static void c(Throwable th) {
        StringBuilder a2 = d.b.a.a.a.a("downloadFirmware: ");
        a2.append(th.getMessage());
        Log.e("MainActivity wyt", a2.toString());
    }

    public static void d(Throwable th) {
        StringBuilder a2 = d.b.a.a.a.a("updateApplication: ");
        a2.append(th.getMessage());
        Log.e("wyt", a2.toString());
    }

    public static void e(Throwable th) {
        StringBuilder a2 = d.b.a.a.a.a("updateFirmware: ");
        a2.append(th.getMessage());
        Log.e("wyt", a2.toString());
    }

    public static void f(Throwable th) {
        StringBuilder a2 = d.b.a.a.a.a("updateHelp: ");
        a2.append(th.getMessage());
        Log.e("wyt", a2.toString());
    }

    public Boolean a(h0 h0Var, File file, f fVar) {
        Log.d("wyt", "downloadApplication: 下载apk");
        InputStream i2 = h0Var.i();
        try {
            FileOutputStream fileOutputStream = new FileOutputStream(file.getAbsolutePath());
            byte[] bArr = new byte[4096];
            while (true) {
                int read = i2.read(bArr);
                if (read == -1) {
                    break;
                }
                fileOutputStream.write(bArr, 0, read);
            }
        } catch (Exception e2) {
            b.u.y.e(e2.getMessage());
            StringBuilder sb = new StringBuilder();
            sb.append("downloadFirmware: ");
            d.b.a.a.a.a(e2, sb, "wyt");
        }
        fVar.dismiss();
        this.v = file.getAbsolutePath();
        return true;
    }

    public void a(int i2, DocumentInfo documentInfo) {
        StringBuilder a2 = d.b.a.a.a.a(BuildConfig.FLAVOR);
        a2.append(documentInfo.path);
        Log.d("wyt", a2.toString());
        Log.d("MainActivity wyt", "updateHelp: " + i2 + "  " + documentInfo.version);
        if (i2 < documentInfo.version) {
            Log.d("MainActivity wyt", "updateHelp: download");
            a(documentInfo.path, documentInfo.version);
        }
    }

    public void a(PackageLocalDao packageLocalDao, List list) {
        StringBuilder sb;
        Iterator it2 = list.iterator();
        while (it2.hasNext()) {
            PackageInfo packageInfo = (PackageInfo) it2.next();
            StringBuilder a2 = d.b.a.a.a.a("updateFirmware: ");
            a2.append(packageInfo.path);
            Log.d("wyt", a2.toString());
            l.a.b.k.f<PackageLocal> queryBuilder = packageLocalDao.queryBuilder();
            queryBuilder.a(PackageLocalDao.Properties.PlatformId.a(1), PackageLocalDao.Properties.Type.a(Integer.valueOf(packageInfo.type)));
            PackageLocal b2 = queryBuilder.a().b();
            if (b2 == null) {
                sb = new StringBuilder();
            } else if (b2.getVersion() < packageInfo.version) {
                packageLocalDao.deleteByKey(b2.getId());
                sb = new StringBuilder();
            }
            sb.append("https://www.ftlled.com");
            sb.append("/");
            sb.append(packageInfo.path);
            a(sb.toString(), packageInfo);
        }
    }

    public void a(final f fVar, final long j2, final long j3, boolean z) {
        runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                long j4 = j2;
                fVar.a((int) ((j4 * 100.0f) / j3));
            }
        });
    }

    @SuppressLint({"WrongConstant"})
    public final void a(final String str) {
        b.u.y.d("下载:" + str);
        f.b bVar = new f.b(this);
        bVar.f3764b = getResources().getString(2131755097);
        bVar.a(BuildConfig.FLAVOR);
        bVar.f3766d = d.CENTER;
        bVar.j0 = true;
        if (bVar.s != null) {
            throw new IllegalStateException("You cannot set progress() when you're using a custom view.");
        }
        bVar.B0 = false;
        bVar.i0 = false;
        bVar.k0 = -1;
        bVar.l0 = 100;
        final f b2 = bVar.b();
        b2.a(0);
        final d.a aVar = new d.a() {
            @Override
            public final void a(long j2, long j3, boolean z) {
                MainActivity.this.a(b2, j2, j3, z);
            }
        };
        final File file = new File(App.f2838g.e(), "app.apk");
        if (file.exists()) {
            file.delete();
        }
        this.s.c(e.a(new Callable() {
            @Override
            public final Object call() {
                return MainActivity.a(d.a.this, str);
            }
        }).a(c.f2548a).a(new b() {
            @Override
            public final void a(Object obj) {
                MainActivity.a((Throwable) obj);
            }
        }).a(new b() {
            @Override
            public final void a(Object obj) {
                MainActivity.this.a(file, b2, (j.h0) obj);
            }
        }, new d.e.a.r.f.a()));
    }

    public void a(List list) {
        long j2;
        Iterator it2 = list.iterator();
        while (it2.hasNext()) {
            TemplateSource templateSource = (TemplateSource) it2.next();
            l.a.b.k.f<Template> queryBuilder = this.u.queryBuilder();
            l.a.b.f fVar = TemplateDao.Properties.TemplateId;
            StringBuilder a2 = d.b.a.a.a.a("yun_");
            a2.append(templateSource.id);
            queryBuilder.a(fVar.a(a2.toString()), new h[0]);
            List<Template> b2 = queryBuilder.b();
            if (b2.size() == 0) {
                j2 = -1L;
            } else {
                Template template = b2.get(0);
                if (template.getVersion() < templateSource.version) {
                    j2 = template.getId();
                }
            }
            a(templateSource, j2);
        }
    }

    public void doClick(View view) {
        if (view.getId() != 2131296516) {
            return;
        }
        startActivity(new Intent(this, (Class<?>) PdfActivity.class));
        overridePendingTransition(2130772002, 2130772005);
    }

    @Override
    public void onActivityResult(int i2, int i3, Intent intent) {
        super.onActivityResult(i2, i3, intent);
        if (i2 == 10086) {
            a((Context) this, this.v);
        }
    }

    @Override
    public void onBackPressed() {
        moveTaskToBack(true);
    }

    @m(threadMode = ThreadMode.MAIN)
    public void onBusEvent(p0 p0Var) {
        String str = p0Var.f5197a;
        if (str == "deviceconnected" || str == "devicedisconnect") {
            w();
        }
    }

    @Override
    public void onCreate(Bundle bundle) {
        RadioGroup radioGroup;
        super.onCreate(bundle);
        getWindow().addFlags(128);
        setContentView(2131492900);
        ButterKnife.a(this);
        SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(App.f2838g).edit();
        int i2 = 0;
        edit.putBoolean("app_quit", false);
        edit.apply();
        this.s = new a();
        this.u = App.f2838g.c().getTemplateDao();
        x();
        final int parseInt = Integer.parseInt("2.0.2.6".replace(".", BuildConfig.FLAVOR));
        this.s.c(d.e.a.r.b.b().a(e0.a(w.a("application/json; charset=utf-8"), String.format("{\"platform\":%1$d,\"packagename\":\"%2$s\"}", 4, "com.dmz.f20ad"))).a(b.u.a.f2542a).a(new b() {
            @Override
            public final void a(Object obj) {
                MainActivity.d((Throwable) obj);
            }
        }).a(new b() {
            @Override
            public final void a(Object obj) {
                MainActivity.this.a(parseInt, (PackageInfo) obj);
            }
        }, new d.e.a.r.f.a()));
        if (this.u.loadAll().size() == 0) {
            this.u.insert(new Template("local_0", "自定义文字", "Custom text", "ic_drawtext", BuildConfig.FLAVOR, 0, 0, 1, "PaintsActivity", 0, BuildConfig.FLAVOR, 0));
            this.u.loadAll();
        }
        this.s.c(d.e.a.r.b.a().a(e0.a(w.a("application/json; charset=utf-8"), "{\"platform\":\"android\"}")).a(b.u.a.f2542a).a(g.a.s.b.b()).a(new b() {
            @Override
            public final void a(Object obj) {
                MainActivity.this.a((List) obj);
            }
        }, new d.e.a.r.f.a()));
        final int i3 = App.f2838g.getSharedPreferences("com.dmz.f20ad", 0).getInt("document_version", 0);
        Log.d("MainActivity wyt", "updateHelp: " + i3);
        this.s.c(d.e.a.r.b.a().d(e0.a(w.a("application/json; charset=utf-8"), String.format("{\"platform\":%1$d,\"packagename\":\"%2$s\"}", 2, "com.dmz.f20ad"))).a(b.u.a.f2542a).a(new b() {
            @Override
            public final void a(Object obj) {
                MainActivity.f((Throwable) obj);
            }
        }).a(new b() {
            @Override
            public final void a(Object obj) {
                MainActivity.this.a(i3, (DocumentInfo) obj);
            }
        }, new d.e.a.r.f.a()));
        this.mNavigationBar.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(RadioGroup radioGroup2, int i4) {
                MainActivity.this.a(radioGroup2, i4);
            }
        });
        if (bundle == null) {
            this.t = -1;
            radioGroup = this.mNavigationBar;
        } else {
            this.t = bundle.getInt("checkId");
            radioGroup = this.mNavigationBar;
            i2 = this.t;
        }
        ((RadioButton) radioGroup.getChildAt(i2)).setChecked(true);
        l.a.a.c.c().b(this);
        startService(new Intent(this, (Class<?>) UdpService.class));
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(App.f2838g).edit();
        edit.putBoolean("app_quit", true);
        edit.apply();
        l.a.a.c.c().c(this);
        this.s.a();
    }

    @Override
    public void onResume() {
        boolean z;
        super.onResume();
        Iterator<ActivityManager.RunningServiceInfo> it2 = ((ActivityManager) getSystemService("activity")).getRunningServices(100).iterator();
        while (true) {
            if (!it2.hasNext()) {
                z = false;
                break;
            } else if ("com.dmz.f20ad.connect.UdpService".equals(it2.next().service.getClassName())) {
                z = true;
                break;
            }
        }
        if (z) {
            Log.d("MainActivity wyt", "onResume: udp service start");
        } else {
            Log.d("MainActivity wyt", "onResume: udp service closed");
            startService(new Intent(this, (Class<?>) UdpService.class));
        }
        w();
    }

    @Override
    public void onSaveInstanceState(Bundle bundle, PersistableBundle persistableBundle) {
        super.onSaveInstanceState(bundle, persistableBundle);
        bundle.putInt("checkId", this.t);
    }

    public final void w() {
        Iterator<n0> it2 = UdpService.f3079f.values().iterator();
        int i2 = 0;
        while (it2.hasNext()) {
            if (!it2.next().F) {
                i2++;
            }
        }
        this.mDevices.setText(i2 == 0 ? getString(2131755046) : getString(2131755047, new Object[]{Integer.valueOf(i2)}));
    }

    public void x() {
        e0 a2 = e0.a(w.a("application/json; charset=utf-8"), String.format("{\"type\":%1$d,\"platform\":%2$d}", 1, 1));
        final PackageLocalDao packageLocalDao = App.f2838g.c().getPackageLocalDao();
        this.s.c(d.e.a.r.b.b().b(a2).a(b.u.a.f2542a).a(new b() {
            @Override
            public final void a(Object obj) {
                MainActivity.e((Throwable) obj);
            }
        }).a(new b() {
            @Override
            public final void a(Object obj) {
                MainActivity.this.a(packageLocalDao, (List) obj);
            }
        }, new d.e.a.r.f.a()));
    }

    public void a(final String str, final int i2) {
        final File file = new File(App.f2838g.e(), "help.pdf");
        if (file.exists()) {
            file.delete();
        }
        this.s.c(e.a(new Callable() {
            @Override
            public final Object call() {
                return MainActivity.b(str);
            }
        }).a(c.f2548a).a(new b() {
            @Override
            public final void a(Object obj) {
                MainActivity.b((Throwable) obj);
            }
        }).b(new b() {
            @Override
            public final void a(Object obj) {
                MainActivity.this.a(file, i2, (j.h0) obj);
            }
        }));
    }

    public void a(final String str, final PackageInfo packageInfo) {
        final File file = new File(App.f2838g.e(), packageInfo.type + ".pov");
        if (file.exists()) {
            file.delete();
        }
        this.s.c(e.a(new Callable() {
            @Override
            public final Object call() {
                return MainActivity.c(str);
            }
        }).a(c.f2548a).a(new b() {
            @Override
            public final void a(Object obj) {
                MainActivity.c((Throwable) obj);
            }
        }).b(new b() {
            @Override
            public final void a(Object obj) {
                MainActivity.this.a(file, packageInfo, (j.h0) obj);
            }
        }));
    }

    public final void a(TemplateSource templateSource, Long l2) {
        StringBuilder a2 = d.b.a.a.a.a("template");
        a2.append(File.separator);
        a2.append("template_");
        a2.append(templateSource.id);
        String sb = a2.toString();
        j.y yVar = new j.y();
        b0.a aVar = new b0.a();
        aVar.a(templateSource.path);
        f0 b2 = ((a0) yVar.a(aVar.a())).b();
        if (b2.i()) {
            ZipInputStream zipInputStream = new ZipInputStream(new BufferedInputStream(b2.f6582h.i()));
            File file = new File(getExternalFilesDir(null).getPath(), sb);
            if (!file.exists()) {
                file.mkdirs();
            }
            byte[] bArr = new byte[8192];
            while (true) {
                ZipEntry nextEntry = zipInputStream.getNextEntry();
                if (nextEntry == null) {
                    break;
                }
                if (!nextEntry.getName().contains("__MACOSX") && !nextEntry.getName().contains("__macosx")) {
                    if (nextEntry.isDirectory()) {
                        new File(file, nextEntry.getName()).mkdirs();
                    } else {
                        File file2 = new File(file, nextEntry.getName());
                        if (file2.exists()) {
                            file2.delete();
                        }
                        FileOutputStream fileOutputStream = new FileOutputStream(file2);
                        while (true) {
                            int read = zipInputStream.read(bArr);
                            if (read <= 0) {
                                break;
                            } else {
                                fileOutputStream.write(bArr, 0, read);
                            }
                        }
                        fileOutputStream.flush();
                        fileOutputStream.close();
                    }
                }
            }
            zipInputStream.close();
            String[] list = file.list();
            if (list.length == 1) {
                StringBuilder a3 = d.b.a.a.a.a(sb);
                a3.append(File.separator);
                a3.append(list[0]);
                sb = a3.toString();
            }
            String str = sb;
            try {
                String str2 = "yun_" + templateSource.id;
                String str3 = templateSource.name;
                String str4 = templateSource.name_en;
                int i2 = templateSource.frames;
                int i3 = templateSource.duration;
                Template template = new Template(str2, str3, str4, "thumbnail.jpg", str, 2, i2 / i3, templateSource.version, templateSource.gateway, i3, templateSource.description, 0);
                if (l2.longValue() < 0) {
                    this.u.insert(template);
                } else {
                    template.setId(l2);
                    this.u.update(template);
                }
                return;
            } catch (Exception unused) {
                return;
            }
        }
        StringBuilder a4 = d.b.a.a.a.a("downloadTemplate: ");
        a4.append(b2.f6579e);
        Log.e("MainActivity wyt", a4.toString());
        throw new IOException("Unexpected code" + b2);
    }

    public static f0 a(d.a aVar, v.a aVar2) {
        j.l0.f.f fVar = (j.l0.f.f) aVar2;
        f0 a2 = fVar.a(fVar.f6748f);
        f0.a j2 = a2.j();
        j2.f6594g = new d.e.a.r.d(a2.f6582h, aVar, 0);
        return j2.a();
    }

    public static h0 a(final d.a aVar, String str) {
        y.b bVar = new y.b();
        bVar.f7079f.add(new v() {
            @Override
            public final j.f0 a(v.a aVar2) {
                return MainActivity.a(d.a.this, aVar2);
            }
        });
        j.y yVar = new j.y(bVar);
        b0.a aVar2 = new b0.a();
        aVar2.a(str);
        f0 b2 = ((a0) yVar.a(aVar2.a())).b();
        if (b2.i()) {
            return b2.f6582h;
        }
        b.u.y.e(b2.f6579e);
        throw new IOException("Unexpected code" + b2);
    }

    public void a(Boolean bool) {
        if (bool.booleanValue()) {
            b.u.y.f(2131755186);
            String str = this.v;
            Log.d("wyt", "installApkO: ");
            if (Build.VERSION.SDK_INT >= 26) {
                if (!getPackageManager().canRequestPackageInstalls()) {
                    Log.d("wyt", "installApkO: 获取未知来源");
                    f.b bVar = new f.b(this);
                    bVar.f3764b = "权限获取";
                    bVar.a("安装应用需要打开安装未知来源应用权限,请去设置中开启权限");
                    bVar.f3775m = "确定";
                    bVar.A = new u2(this);
                    bVar.b();
                    return;
                }
                Log.d("wyt", "8.0手机已经拥有安装未知来源应用的权限,直接安装!");
            }
            a((Context) this, str);
        }
    }

    public void a(final File file, final f fVar, final h0 h0Var) {
        this.s.c(e.a(new Callable() {
            @Override
            public final Object call() {
                return MainActivity.this.a(h0Var, file, fVar);
            }
        }).a(c.f2548a).a(new b() {
            @Override
            public final void a(Object obj) {
                MainActivity.a(d.a.a.f.this, (Throwable) obj);
            }
        }).b(new b() {
            @Override
            public final void a(Object obj) {
                MainActivity.this.a((Boolean) obj);
            }
        }));
    }

    public static Object a(h0 h0Var, File file, int i2) {
        InputStream i3 = h0Var.i();
        try {
            FileOutputStream fileOutputStream = new FileOutputStream(file.getAbsolutePath());
            byte[] bArr = new byte[4096];
            while (true) {
                int read = i3.read(bArr);
                if (read == -1) {
                    break;
                }
                fileOutputStream.write(bArr, 0, read);
            }
            Log.d("MainActivity wyt", "downloadDocument: 下载完成");
            SharedPreferences.Editor edit = App.f2838g.getSharedPreferences("com.dmz.f20ad", 0).edit();
            edit.putInt("document_version", i2);
            edit.apply();
        } catch (Exception e2) {
            d.b.a.a.a.a(e2, d.b.a.a.a.a("downloadFirmware: "), "wyt");
        }
        return new Object();
    }

    public void a(final File file, final int i2, final h0 h0Var) {
        this.s.c(e.a(new Callable() {
            @Override
            public final Object call() {
                return MainActivity.a(j.h0.this, file, i2);
            }
        }).a(c.f2548a).b((b) new b() {
            @Override
            public final void a(Object obj) {
                MainActivity.a(obj);
            }
        }));
    }

    public static Object a(h0 h0Var, File file, PackageInfo packageInfo) {
        InputStream i2 = h0Var.i();
        try {
            FileOutputStream fileOutputStream = new FileOutputStream(file.getAbsolutePath());
            byte[] bArr = new byte[4096];
            while (true) {
                int read = i2.read(bArr);
                if (read == -1) {
                    break;
                }
                fileOutputStream.write(bArr, 0, read);
            }
            PackageLocalDao packageLocalDao = App.f2838g.c().getPackageLocalDao();
            PackageLocal packageLocal = new PackageLocal(packageInfo.platform_id, packageInfo.name, packageInfo.packagename, packageInfo.type, packageInfo.version, file.getAbsolutePath(), packageInfo.description);
            packageLocal.setId(Long.valueOf(packageInfo.type));
            packageLocalDao.insert(packageLocal);
        } catch (Exception e2) {
            d.b.a.a.a.a(e2, d.b.a.a.a.a("downloadFirmware: "), "wyt");
        }
        return new Object();
    }

    public void a(final File file, final PackageInfo packageInfo, final h0 h0Var) {
        this.s.c(e.a(new Callable() {
            @Override
            public final Object call() {
                return MainActivity.a(j.h0.this, file, packageInfo);
            }
        }).a(c.f2548a).b((b) new b() {
            @Override
            public final void a(Object obj) {
                MainActivity.b(obj);
            }
        }));
    }

    public void a(RadioGroup radioGroup, int i2) {
        Fragment shareFragment;
        Fragment a2;
        i l2 = l();
        r a3 = l2.a();
        Fragment a4 = l2.a(String.valueOf(i2));
        int i3 = this.t;
        if (i3 != -1 && (a2 = l2.a(String.valueOf(i3))) != null) {
            a3.c(a2);
        }
        if (a4 == null) {
            switch (i2) {
                case 2131296375:
                    shareFragment = new ShareFragment();
                    break;
                case 2131296435:
                    shareFragment = new DesignFragment();
                    break;
                case 2131296447:
                    shareFragment = new DeviceManagerFragment();
                    break;
                case 2131296609:
                    shareFragment = new MediasFragment();
                    break;
                case 2131296670:
                    shareFragment = new ProjectonFragment();
                    break;
                default:
                    return;
            }
            a3.a(2131296420, shareFragment, String.valueOf(i2), 1);
        } else {
            a3.e(a4);
        }
        a3.a();
        this.t = i2;
    }

    public void a(int i2, PackageInfo packageInfo) {
        if (i2 < packageInfo.version) {
            f.b bVar = new f.b(this);
            bVar.f3764b = getResources().getString(2131755099);
            bVar.a(packageInfo.description);
            bVar.L = false;
            bVar.M = false;
            bVar.f3775m = getResources().getString(2131755098);
            bVar.A = new t2(this, packageInfo);
            bVar.b();
        }
    }
}