LINE.apk(点击下载) / LineApplication.java


package jp.naver.line.android;

import android.app.Application;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.net.Uri;
import com.google.android.play.core.assetpacks.b3;
import com.linecorp.line.album.ui.viewmodel.v1;
import em3.q;
import em3.s;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.regex.Pattern;
import jc3.g;
import jp.naver.line.android.urlscheme.SchemeServiceReferrer;
import jp.naver.line.android.util.b1;
import jp.naver.line.android.util.f;
import kotlin.Deprecated;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.Metadata;
import kotlin.NoWhenBranchMatchedException;
import kotlin.Pair;
import kotlin.Unit;
import nn.k;
import rg3.a;
import rg3.c;
import rr0.p;
import sg3.h;
import sg3.i;
import sg3.m;
import sg3.o;
import sg3.r;
import sg3.t;
import sg3.u;
import sg3.v;
import tg3.l;
import ua3.e;
import vg3.a0;
import vg3.b0;
import vg3.c0;
import vg3.d0;
import vg3.e0;
import vg3.f0;
import vg3.g0;
import vg3.h0;
import vg3.i0;
import vg3.j0;
import vg3.k0;
import vg3.w;
import vg3.x;
import vg3.y;
import vg3.z;
import z1.j;
import zi1.n;
import zj3.d;

@Metadata(bv = {}, d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u00002\u00020\u0001:\u0001\u0004B\u0007¢\u0006\u0004\b\u0002\u0010\u0003¨\u0006\u0005"}, d2 = {"Ljp/naver/line/android/LineApplication;", "Landroid/app/Application;", "<init>", "()V", "a", "app_productionRelease"}, k = 1, mv = {1, 6, 0})
public final class LineApplication extends Application {

    /* renamed from: g  reason: collision with root package name */
    public static final LineApplication f93492g = null;

    /* renamed from: h  reason: collision with root package name */
    public static LineApplication f93493h;

    /* renamed from: i  reason: collision with root package name */
    public static final bg3.b f93494i = new bg3.a();

    /* renamed from: b  reason: collision with root package name */
    public final Lazy f93495b = LazyKt.lazy(new c(this));

    /* renamed from: c  reason: collision with root package name */
    public final Lazy f93496c = LazyKt.lazy(new b(this));

    /* renamed from: d  reason: collision with root package name */
    public final AtomicBoolean f93497d = new AtomicBoolean(false);

    /* renamed from: e  reason: collision with root package name */
    public final LinkedHashSet<String> f93498e = new LinkedHashSet<>();

    /* renamed from: f  reason: collision with root package name */
    public boolean f93499f;

    @Deprecated(message = "You should explicitly pass a Context instead.")
    public static final class a {
        public static final LineApplication a() {
            LineApplication lineApplication = LineApplication.f93493h;
            if (lineApplication != null) {
                return lineApplication;
            }
            q.l("application");
            throw null;
        }
    }

    public static final class b extends s implements dm3.a<h13.a> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ LineApplication f93500b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public b(LineApplication lineApplication) {
            super(0);
            this.f93500b = lineApplication;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // dm3.a
        public h13.a invoke() {
            return new h13.a(this.f93500b);
        }
    }

    public static final class c extends s implements dm3.a<rg3.a> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ LineApplication f93501b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public c(LineApplication lineApplication) {
            super(0);
            this.f93501b = lineApplication;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // dm3.a
        public rg3.a invoke() {
            LineApplication lineApplication = this.f93501b;
            LineApplication lineApplication2 = LineApplication.f93492g;
            return new rg3.a(lineApplication, LineApplication.f93494i);
        }
    }

    public static final LineApplication a(Context context) {
        q.f(context, "context");
        boolean z14 = context.getApplicationContext() instanceof LineApplication;
        Context applicationContext = context.getApplicationContext();
        Objects.requireNonNull(applicationContext, "null cannot be cast to non-null type jp.naver.line.android.LineApplication");
        return (LineApplication) applicationContext;
    }

    public void attachBaseContext(Context context) {
        q.f(context, "base");
        super.attachBaseContext(context);
        xf.a.a(this);
    }

    public final h13.a b() {
        return (h13.a) this.f93496c.getValue();
    }

    public final rg3.a c() {
        return (rg3.a) this.f93495b.getValue();
    }

    public final void d() {
        LinkedHashSet<String> linkedHashSet;
        if (this.f93497d.getAndSet(false)) {
            synchronized (this.f93498e) {
                linkedHashSet = new LinkedHashSet(this.f93498e);
                this.f93498e.clear();
            }
            for (String str : linkedHashSet) {
                try {
                    d.f199582a.d(this, str, SchemeServiceReferrer.Unknown.f98264c);
                } catch (Exception unused) {
                }
            }
        }
    }

    public final Unit e() {
        rg3.a c14 = c();
        try {
            c14.f137380e.f();
            return Unit.INSTANCE;
        } catch (c.b.a e14) {
            String c15 = c14.c();
            throw new c.b.a(e14.getMessage() + ", " + c15);
        }
    }

    public final void f() {
        rg3.a c14 = c();
        CountDownLatch countDownLatch = c14.f137377b;
        c.a aVar = rg3.c.f137384g;
        c.a aVar2 = rg3.c.f137384g;
        if (countDownLatch.await(60000, TimeUnit.MILLISECONDS)) {
            Throwable th4 = c14.f137381f;
            if (th4 != null) {
                throw th4;
            }
            return;
        }
        throw new c.b.C2621b(c14.c());
    }

    public void onConfigurationChanged(Configuration configuration) {
        q.f(configuration, "newConfig");
        super.onConfigurationChanged(configuration);
        Context applicationContext = getApplicationContext();
        q.e(applicationContext, "applicationContext");
        Locale a14 = new ua3.c(applicationContext).a();
        e.a(applicationContext, a14);
        Context applicationContext2 = applicationContext.getApplicationContext();
        if (!q.b(applicationContext2, applicationContext)) {
            q.e(applicationContext2, "appContext");
            e.a(applicationContext2, a14);
        }
        rg3.a c14 = c();
        Objects.requireNonNull(c14);
        a.AbstractC2619a d14 = c14.d(this);
        if (z1.d.o(d14 != null ? Boolean.valueOf(q.b(d14, a.AbstractC2619a.C2620a.f137382a)) : null)) {
            e();
            Configuration configuration2 = getResources().getConfiguration();
            q.e(configuration2, "resources.configuration");
            b3.b(configuration2);
            b3.a(g.i().b(this));
            if (k.f118909b) {
                g i14 = g.i();
                q.e(i14, "getInstance()");
                ((n) rb.a.d(this, n.f199365z3)).u(d2.g.o(this, i14));
            }
        }
    }

    public void onCreate() {
        boolean z14;
        a.AbstractC2619a d14;
        Notification.Builder builder;
        int i14;
        Pair pair;
        super.onCreate();
        lk.d.f107199a = this;
        ((my.g) rb.a.d(this, my.g.J1)).b();
        f93493h = this;
        b1 b1Var = new b1(this);
        PackageManager packageManager = b1Var.f98307c;
        String str = b1Var.f98306b;
        q.e(str, "packageName");
        j.f(packageManager, str);
        PackageManager packageManager2 = b1Var.f98307c;
        String str2 = b1Var.f98306b;
        q.e(str2, "packageName");
        if (!j.f(packageManager2, str2)) {
            z14 = false;
        } else {
            ArrayList arrayList = new ArrayList();
            for (Object obj : (List) b1Var.f98311g.getValue()) {
                String str3 = (String) obj;
                Pattern compile = Pattern.compile("^config\\..+dpi$");
                q.e(compile, "compile(pattern)");
                q.f(str3, "input");
                if (compile.matcher(str3).matches()) {
                    arrayList.add(obj);
                }
            }
            arrayList.toString();
            z14 = arrayList.isEmpty();
        }
        if (!z14) {
            b1Var.b();
            ((NotificationManager) b1Var.f98309e.getValue()).cancel(420923824);
        } else {
            Intent intent = new Intent("android.intent.action.VIEW");
            intent.addFlags(268435456);
            if (((Boolean) b1Var.f98310f.getValue()).booleanValue()) {
                StringBuilder a14 = b.d.a("http://play.google.com/store/apps/details?id=");
                a14.append(b1Var.f98306b);
                intent.setData(Uri.parse(a14.toString()));
                intent.setPackage("com.android.vending");
            } else {
                intent.setData(Uri.parse("https://line.me/download"));
            }
            int i15 = ((Boolean) b1Var.f98310f.getValue()).booleanValue() ? 2 : 1;
            PendingIntent activity = PendingIntent.getActivity(b1Var.f98305a, 0, intent, 201326592);
            if (f.a()) {
                builder = new Notification.Builder(b1Var.f98305a, th3.e.NEW_MESSAGE.f());
            } else {
                builder = new Notification.Builder(b1Var.f98305a);
            }
            Locale a15 = new ua3.c(b1Var.f98305a).a();
            String country = a15.getCountry();
            String language = a15.getLanguage();
            if (q.b(language, Locale.JAPANESE.getLanguage())) {
                i14 = R.array.sideload_check_translation_ja;
            } else if (q.b(language, "es")) {
                i14 = q.b(country, "ES") ? R.array.sideload_check_translation_es_rES : R.array.sideload_check_translation_es;
            } else if (q.b(language, Locale.KOREAN.getLanguage())) {
                i14 = R.array.sideload_check_translation_ko;
            } else if (q.b(language, Locale.CHINESE.getLanguage())) {
                i14 = q.b(country, Locale.SIMPLIFIED_CHINESE.getCountry()) ? R.array.sideload_check_translation_zh_rCN : R.array.sideload_check_translation_zh_rTW;
            } else if (q.b(language, "vi")) {
                i14 = R.array.sideload_check_translation_vi;
            } else if (q.b(language, "tr")) {
                i14 = R.array.sideload_check_translation_tr;
            } else if (q.b(language, "ru")) {
                i14 = R.array.sideload_check_translation_ru;
            } else if (q.b(language, Locale.GERMAN.getLanguage())) {
                i14 = R.array.sideload_check_translation_de;
            } else if (q.b(language, "th")) {
                i14 = R.array.sideload_check_translation_th;
            } else if (q.b(language, Locale.FRENCH.getLanguage())) {
                i14 = R.array.sideload_check_translation_fr;
            } else if (q.b(language, "ms")) {
                i14 = R.array.sideload_check_translation_ms;
            } else if (q.b(language, "in")) {
                i14 = R.array.sideload_check_translation_in;
            } else if (q.b(language, "ar")) {
                i14 = R.array.sideload_check_translation_ar;
            } else if (q.b(language, "pt")) {
                i14 = q.b(country, "BR") ? R.array.sideload_check_translation_pt_rBR : R.array.sideload_check_translation_pt_rPT;
            } else {
                i14 = q.b(language, Locale.ITALIAN.getLanguage()) ? R.array.sideload_check_translation_it : R.array.sideload_check_translation_en;
            }
            String[] stringArray = b1Var.f98305a.getResources().getStringArray(i14);
            q.e(stringArray, "context.resources.getStringArray(translationRes)");
            int i16 = b1.a.$EnumSwitchMapping$0[j.q.e(i15)];
            if (i16 == 1) {
                pair = new Pair(b1Var.a(stringArray, 1), b1Var.a(stringArray, 2));
            } else if (i16 == 2) {
                pair = new Pair(b1Var.a(stringArray, 3), b1Var.a(stringArray, 4));
            } else {
                throw new NoWhenBranchMatchedException();
            }
            String str4 = (String) pair.component2();
            builder.setSmallIcon(R.drawable.icon_reinstall_nodpi).setWhen(System.currentTimeMillis()).setContentTitle((String) pair.component1()).setContentText(str4).setTicker(str4).setContentIntent(activity).setPriority(1);
            ((NotificationManager) b1Var.f98309e.getValue()).notify(420923824, builder.build());
            b1Var.b();
        }
        boolean z15 = f13.b.f70202q;
        OutputStream outputStream = wg.b.f176912a;
        System.setOut(new PrintStream(outputStream));
        System.setErr(new PrintStream(outputStream));
        rg3.a c14 = c();
        Objects.requireNonNull(c14);
        if (c14.f137378c == null && (d14 = c14.d(this)) != null) {
            rg3.e eVar = new rg3.e();
            vx2.a.f175259a = new rg3.f(eVar, d14);
            uy2.a.f168774a = new p(new rg3.f(eVar, d14), 10);
            List<? extends rg3.c> i17 = ql3.p.i(new rg3.d(this, d14, c14.f137376a), new ug3.a(this, c14.f137376a), new h(this, c14.f137376a, null, 4), new sg3.n(this, c14.f137376a), c14.f137380e, new o(this, c14.f137376a), c14.f137379d, new sg3.e(c14.f137376a), new r(this, c14.f137376a), new m(this, c14.f137376a), new sg3.a(c14.f137376a), new sg3.q(this, c14.f137376a), new sg3.b(this, c14.f137376a), new sg3.j(this, c14.f137376a), new sg3.c(c14.f137376a), new t(this, c14.f137376a), new sg3.f(this, c14.f137376a), new u(this, c14.f137376a), null, new v(this, c14.f137376a), new i(this, c14.f137376a), new sg3.p(this, c14.f137376a), new sg3.s(this, c14.f137376a), new sg3.k(this, c14.f137376a), new sg3.g(this, c14.f137376a), null, null, new tg3.f(this, c14.f137376a), new tg3.p(this, c14.f137376a), new tg3.c(c14.f137376a), new tg3.n(c14.f137376a), new tg3.m(c14.f137376a), new tg3.q(this, c14.f137376a), null, new tg3.i(this, c14.f137376a), new tg3.d(c14.f137376a), new l(this, c14.f137376a), new tg3.e(this, c14.f137376a), new tg3.h(this, c14.f137376a), new tg3.a(this, c14.f137376a), new tg3.g(this, c14.f137376a), new tg3.k(this, c14.f137376a), null, new y(c14.f137376a), new g0(this, c14.f137376a), new vg3.j(c14.f137376a), new vg3.o(this, c14.f137376a), new vg3.r(this, c14.f137376a), new vg3.g(c14.f137376a), new h0(this, c14.f137376a), new z(this, c14.f137376a), new vg3.s(c14.f137376a), new vg3.e(c14.f137376a), new k0(this, c14.f137376a), new w(this, c14.f137376a), new vg3.h(this, c14.f137376a), new vg3.k(c14.f137376a), new c0(this, c14.f137376a), new vg3.i(c14.f137376a), new vg3.m(c14.f137376a), new vg3.u(c14.f137376a), new vg3.d(this, c14.f137376a), new e0(this, c14.f137376a), new x(this, c14.f137376a), new vg3.t(c14.f137376a), new vg3.a(this, c14.f137376a), new vg3.v(this, c14.f137376a), new j0(this, c14.f137376a), null, new b0(this, c14.f137376a), new d0(c14.f137376a), new vg3.l(this, c14.f137376a), new vg3.b(this, c14.f137376a), new f0(this, c14.f137376a), new a0(this, c14.f137376a), new vg3.c(this, c14.f137376a), new vg3.q(this, c14.f137376a), new i0(this, c14.f137376a), new sg3.l(this, c14.f137376a), new vg3.p(this, c14.f137376a));
            c14.f137378c = i17;
            Iterator<T> it3 = c14.a(i17, c.EnumC2622c.MAIN_THREAD, d14).iterator();
            while (it3.hasNext()) {
                it3.next().a();
            }
            ix2.s sVar = new ix2.s(c14.b(c14.a(c14.f137378c, c.EnumC2622c.CORE, d14)), new nq0.a(c14, 9));
            List<rg3.c> a16 = c14.a(c14.f137378c, c.EnumC2622c.GENERAL, d14);
            ArrayList arrayList2 = new ArrayList(ql3.q.p(a16, 10));
            Iterator<T> it4 = a16.iterator();
            while (it4.hasNext()) {
                arrayList2.add(new ix2.j(new v1(it4.next(), 1)).D(zy2.a.f202073c));
            }
            sVar.g(zw2.b.t(new ix2.s(new ix2.q(arrayList2), new iv.u(c14, 7)).r(new i12.h(c14, 1)).n(new i12.i(c14, 1)), c14.b(c14.a(c14.f137378c, c.EnumC2622c.POST_STARTUP, d14)))).u(zy2.a.f202073c).o(new jj1.l(c14, 3)).A();
        }
    }
}