导航菜单

页面标题

页面副标题

Chaupal v3.2 - ActivateDeviceFragment.java 源代码

正在查看: Chaupal v3.2 应用的 ActivateDeviceFragment.java JAVA 源代码文件

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


package com.yupptv.ott.fragments;

import android.R;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewOutlineProvider;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatButton;
import androidx.appcompat.widget.AppCompatEditText;
import com.airbnb.lottie.LottieDrawable;
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
import com.yupptv.ott.OTTApplication;
import com.yupptv.ottsdk.OttSDK;
import com.yupptv.ottsdk.managers.User.UserManager;
import com.yupptv.ottsdk.model.Error;
import eightbitlab.com.blurview.BlurView;
import hd.a;
import java.util.HashMap;

public class ActivateDeviceFragment extends com.yupptv.ott.activity.a implements DecoratedBarcodeView.a, View.OnClickListener {
    private com.journeyapps.barcodescanner.e e;
    private DecoratedBarcodeView f;
    private ImageView g;
    private ImageView h;
    private TextView i;
    private RelativeLayout j;
    private boolean k;
    private TextView l;
    private AppCompatButton m;
    private AppCompatEditText n;
    private LottieDrawable q;
    private BlurView r;
    private String s;
    String o = "";
    boolean p = false;
    private boolean t = false;

    class a implements UserManager.UserCallback<String> {
        a() {
        }

        @Override
        public void onSuccess(String str) {
            if (!TextUtils.isEmpty(str)) {
                Toast.makeText((Context) ActivateDeviceFragment.this, (CharSequence) (" " + str), 0).show();
            }
            HashMap<String, Object> h0 = cc.b.B0().h0(null);
            h0.put(cc.a.B, "true");
            h0.put(cc.a.z, "false");
            h0.put(cc.a.A, "true");
            cc.c.d().o(cc.b.w1, cc.b.B0().n(ActivateDeviceFragment.this.p, true));
            ActivateDeviceFragment.this.finish();
        }

        @Override
        public void onFailure(Error error) {
            if (error == null || error.getMessage() == null) {
                return;
            }
            Toast.makeText((Context) ActivateDeviceFragment.this, (CharSequence) (" " + error.getMessage()), 0).show();
            cc.c.d().o(cc.b.w1, cc.b.B0().n(ActivateDeviceFragment.this.p, false));
        }
    }

    private void Z(String str) {
        a.C0133a c0133a = hd.a.a;
        if (c0133a.b(OTTApplication.o()).getUserManager() != null) {
            c0133a.b(OTTApplication.o()).getUserManager().validatePasscode(str, new a());
        }
    }

    private void a0() {
        com.journeyapps.barcodescanner.e eVar = this.e;
        if (eVar != null) {
            eVar.u();
        }
    }

    private void b0() {
        this.f = (DecoratedBarcodeView) findViewById(ua.k.a);
        this.g = (ImageView) findViewById(2131428319);
        this.h = (ImageView) findViewById(2131428643);
        this.r = findViewById(2131427607);
        this.i = (TextView) findViewById(2131427825);
        this.j = (RelativeLayout) findViewById(2131427421);
        this.l = (TextView) findViewById(2131429422);
        this.m = findViewById(2131427420);
        this.n = findViewById(2131427423);
        this.f.setTorchListener(this);
        if (this.t) {
            this.n.setText(this.o);
        }
        if (com.yupptv.ott.a.k != null) {
            com.yupptv.ott.a.k = "";
        }
        this.f.setStatusText(getResources().getString(2131952752));
        this.g.setOnClickListener(this);
        this.i.setOnClickListener(this);
        this.l.setOnClickListener(this);
        this.m.setOnClickListener(this);
        if (com.yupptv.ott.a.h) {
            if (OTTApplication.w() != null) {
                this.s = OTTApplication.w().C();
            }
            j0(this.s);
        }
        cc.b.B0().C1("Activate Device");
        h0();
        LottieDrawable lottieDrawable = this.q;
        if (lottieDrawable != null) {
            lottieDrawable.r();
        }
        this.q = new LottieDrawable();
        final Handler handler = new Handler();
        new Thread(new Runnable() {
            @Override
            public final void run() {
                ActivateDeviceFragment.this.g0(handler);
            }
        }).start();
    }

    private void c0(Bundle bundle) {
        com.journeyapps.barcodescanner.e eVar = new com.journeyapps.barcodescanner.e(this, this.f);
        this.e = eVar;
        eVar.p(getIntent(), bundle);
        this.e.E(false);
        this.e.l();
    }

    public void d0(x1.g gVar) {
        LottieDrawable lottieDrawable;
        if (gVar != null && (lottieDrawable = this.q) != null) {
            lottieDrawable.u0(gVar);
        }
        this.q.O0(-1);
        this.q.z0("images");
        this.h.setImageDrawable(this.q);
        this.q.start();
    }

    public static void e0(Throwable th) {
        hd.h.b("LottieError", "Failed to load Lottie composition" + th);
    }

    public void f0(com.airbnb.lottie.n nVar) {
        if (nVar != null) {
            nVar.d(new x1.r() {
                public final void onResult(Object obj) {
                    ActivateDeviceFragment.this.d0((x1.g) obj);
                }
            }).c(new x1.r() {
                public final void onResult(Object obj) {
                    ActivateDeviceFragment.e0((Throwable) obj);
                }
            });
        }
    }

    public void g0(Handler handler) {
        final com.airbnb.lottie.n k = x1.p.k(this, "activatetv_lottie.json");
        handler.postDelayed(new Runnable() {
            @Override
            public final void run() {
                ActivateDeviceFragment.this.f0(k);
            }
        }, 200L);
    }

    private void h0() {
        View decorView = getWindow().getDecorView();
        ViewGroup viewGroup = (ViewGroup) decorView.findViewById(R.id.content);
        Drawable background = decorView.getBackground();
        this.r.b(true);
        this.r.c(viewGroup, new sd.i(this)).d(background).a(570425344).g(25.0f);
        this.r.setOutlineProvider(ViewOutlineProvider.BACKGROUND);
        this.r.setClipToOutline(true);
    }

    public boolean dispatchTouchEvent(MotionEvent motionEvent) {
        if (motionEvent.getAction() == 0) {
            View currentFocus = getCurrentFocus();
            if (currentFocus instanceof AppCompatEditText) {
                hd.h0.d(this);
                currentFocus.clearFocus();
            }
        }
        return super/*android.app.Activity*/.dispatchTouchEvent(motionEvent);
    }

    @Override
    public void e() {
    }

    public void i0() {
        setRequestedOrientation(1);
    }

    public void j0(String str) {
        str.hashCode();
        switch (str) {
            case "BEN":
                OTTApplication.N(this);
                hd.a.a.b(OTTApplication.o()).setLocaleBengali(this);
                break;
            case "ENG":
                OTTApplication.O(this);
                OttSDK.setLocaleEnglish(this);
                break;
            case "HIN":
                OTTApplication.Q(this);
                hd.a.a.b(OTTApplication.o()).setLocaleHindi(this);
                break;
            case "TAM":
                OTTApplication.S(this);
                hd.a.a.b(OTTApplication.o()).setLocaleTamil(this);
                break;
            case "TEL":
                OTTApplication.T(this);
                hd.a.a.b(OTTApplication.o()).setLocaleTelugu(this);
                break;
            default:
                OTTApplication.O(this);
                OttSDK.setLocaleEnglish(this);
                break;
        }
    }

    @Override
    public void o() {
    }

    public void onBackPressed() {
        super/*androidx.activity.ComponentActivity*/.onBackPressed();
        if (this.k) {
            return;
        }
        this.k = true;
        this.j.setVisibility(8);
        this.f.setVisibility(0);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case 2131427420:
                this.p = false;
                AppCompatEditText appCompatEditText = this.n;
                if (appCompatEditText != null && appCompatEditText.getText().toString().trim().length() > 0) {
                    this.o = this.n.getText().toString();
                    HashMap hashMap = new HashMap();
                    hashMap.put(cc.a.P, "Activate");
                    hashMap.put(cc.a.Q, "Activate_device");
                    cc.c.d().t("activate_TV", hashMap);
                    Z(this.o);
                    break;
                } else {
                    Toast.makeText((Context) this, (CharSequence) getResources().getString(2131952047), 0).show();
                    break;
                }
                break;
            case 2131427825:
                this.k = false;
                this.f.setVisibility(8);
                this.j.setVisibility(0);
                break;
            case 2131428319:
                a0();
                finish();
                break;
            case 2131429422:
                this.k = true;
                this.j.setVisibility(8);
                this.f.setVisibility(0);
                this.p = true;
                HashMap<String, Object> h0 = cc.b.B0().h0(null);
                h0.put(cc.a.B, "true");
                h0.put(cc.a.z, "true");
                h0.put(cc.a.A, "false");
                break;
        }
    }

    protected void onCreate(Bundle bundle) {
        super/*androidx.fragment.app.h*/.onCreate(bundle);
        i0();
        setContentView(2131624129);
        if (getIntent() != null && getIntent().hasExtra("activationCode") && getIntent().getStringExtra("activationCode").trim().length() > 0) {
            this.o = getIntent().getStringExtra("activationCode");
            this.t = getIntent().getBooleanExtra("isFromDeeplink", false);
            Z(this.o);
        }
        this.k = true;
        b0();
        c0(bundle);
    }

    protected void onDestroy() {
        super.onDestroy();
        a0();
    }

    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        return this.f.onKeyDown(i, keyEvent) || super.onKeyDown(i, keyEvent);
    }

    protected void onPause() {
        super/*androidx.fragment.app.h*/.onPause();
        com.journeyapps.barcodescanner.e eVar = this.e;
        if (eVar == null || !this.k) {
            return;
        }
        eVar.v();
    }

    public void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr) {
        super/*androidx.fragment.app.h*/.onRequestPermissionsResult(i, strArr, iArr);
        this.e.w(i, strArr, iArr);
    }

    protected void onResume() {
        super/*androidx.fragment.app.h*/.onResume();
        i0();
        com.journeyapps.barcodescanner.e eVar = this.e;
        if (eVar == null || !this.k) {
            return;
        }
        eVar.x();
    }

    protected void onSaveInstanceState(Bundle bundle) {
        super/*androidx.activity.ComponentActivity*/.onSaveInstanceState(bundle);
        com.journeyapps.barcodescanner.e eVar = this.e;
        if (eVar == null || !this.k) {
            return;
        }
        eVar.y(bundle);
    }

    public void switchFlashlight(View view) {
    }
}