导航菜单

页面标题

页面副标题

Fancy Optimizer v4.6.3 - InMobiAdActivity.java 源代码

正在查看: Fancy Optimizer v4.6.3 应用的 InMobiAdActivity.java JAVA 源代码文件

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


package com.inmobi.ads.rendering;

import android.R;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.util.SparseArray;
import android.view.MotionEvent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.inmobi.commons.core.configs.AdConfig;
import com.inmobi.media.ct;
import com.inmobi.media.cv;
import com.inmobi.media.cx;
import com.inmobi.media.cy;
import com.inmobi.media.dh;
import com.inmobi.media.fw;
import com.inmobi.media.gl;
import com.inmobi.media.hm;
import com.inmobi.media.i;
import com.inmobi.media.ic;
import com.inmobi.media.ij;
import com.inmobi.media.is;
import com.inmobi.media.j;
import com.inmobi.media.q;
import com.inmobi.media.s;
import com.ironsource.mediationsdk.utils.IronSourceConstants;

@SuppressLint({"ClickableViewAccessibility"})
public class InMobiAdActivity extends Activity {
    private static final String d = "InMobiAdActivity";
    private static SparseArray<j> e = new SparseArray<>();
    private static q f;
    private static s g;
    public cy a;
    private cx h;

    @Nullable
    private q i;
    private int j;
    public boolean b = false;
    private boolean k = false;
    public boolean c = false;

    @Override
    public void onBackPressed() {
        cv cvVar;
        int i = this.j;
        if (i != 102) {
            if (i == 100) {
                this.b = true;
                finish();
                return;
            }
            return;
        }
        cx cxVar = this.h;
        if (cxVar == null || (cvVar = cxVar.b) == null) {
            return;
        }
        cvVar.f();
    }

    @Override
    public void onConfigurationChanged(Configuration configuration) {
        super.onConfigurationChanged(configuration);
        cy cyVar = this.a;
        if (cyVar != null) {
            cyVar.a();
        }
    }

    @Override
    @TargetApi(23)
    public void onCreate(Bundle bundle) {
        AdConfig adConfig;
        AdConfig adConfig2;
        s sVar;
        super.onCreate(bundle);
        if (!ic.a()) {
            finish();
            ij.a((byte) 2, "InMobi", "Session not found, AdActivity will be closed");
            return;
        }
        this.k = false;
        if (Build.VERSION.SDK_INT >= 29) {
            is.a(this);
        }
        this.j = getIntent().getIntExtra("com.inmobi.ads.rendering.InMobiAdActivity.EXTRA_AD_ACTIVITY_TYPE", IronSourceConstants.REWARDED_VIDEO_FETCH_AVAILABILITY_FALSE);
        this.a = new cy(this);
        int i = this.j;
        if (i != 100) {
            if (i == 102) {
                cx cxVar = new cx(this);
                this.h = cxVar;
                this.a.a(cxVar);
                this.h.a(getIntent(), e);
                return;
            }
            return;
        }
        String stringExtra = getIntent().getStringExtra("com.inmobi.ads.rendering.InMobiAdActivity.IN_APP_BROWSER_URL");
        long longExtra = getIntent().getLongExtra("placementId", Long.MIN_VALUE);
        boolean booleanExtra = getIntent().getBooleanExtra("allowAutoRedirection", false);
        String stringExtra2 = getIntent().getStringExtra("impressionId");
        String stringExtra3 = getIntent().getStringExtra("creativeId");
        s sVar2 = q.a;
        q qVar = f;
        try {
            if (qVar != null) {
                sVar2 = qVar.getListener();
                adConfig = f.getAdConfig();
            } else {
                adConfig = (AdConfig) fw.a("ads", ic.f());
                s sVar3 = g;
                if (sVar3 != null) {
                    adConfig2 = adConfig;
                    sVar = sVar3;
                    q qVar2 = new q(this, (byte) 1, null, stringExtra2, Boolean.TRUE, "DEFAULT");
                    this.i = qVar2;
                    qVar2.setPlacementId(longExtra);
                    this.i.setCreativeId(stringExtra3);
                    this.i.setAllowAutoRedirection(booleanExtra);
                    this.i.setShouldFireRenderBeacon(false);
                    this.i.a(sVar, adConfig2, false, false);
                    RelativeLayout relativeLayout = new RelativeLayout(this);
                    RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
                    layoutParams.addRule(10);
                    layoutParams.addRule(2, i.c);
                    relativeLayout.setBackgroundColor(-1);
                    relativeLayout.addView(this.i, layoutParams);
                    float f2 = is.a().c;
                    LinearLayout linearLayout = new LinearLayout(this);
                    RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(-1, (int) (48.0f * f2));
                    linearLayout.setOrientation(0);
                    linearLayout.setId(i.c);
                    linearLayout.setWeightSum(100.0f);
                    linearLayout.setBackgroundResource(R.drawable.bottom_bar);
                    linearLayout.setBackgroundColor(-7829368);
                    layoutParams2.addRule(12);
                    relativeLayout.addView(linearLayout, layoutParams2);
                    LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-1, -1);
                    layoutParams3.weight = 25.0f;
                    ct ctVar = new ct(this, f2, (byte) 2);
                    ctVar.setOnTouchListener(new View.OnTouchListener() {
                        @Override
                        public final boolean onTouch(View view, MotionEvent motionEvent) {
                            if (motionEvent.getAction() != 1) {
                                if (motionEvent.getAction() == 0) {
                                    view.setBackgroundColor(-16711681);
                                }
                                return true;
                            }
                            view.setBackgroundColor(-7829368);
                            InMobiAdActivity inMobiAdActivity = InMobiAdActivity.this;
                            inMobiAdActivity.b = true;
                            inMobiAdActivity.finish();
                            return true;
                        }
                    });
                    linearLayout.addView(ctVar, layoutParams3);
                    ct ctVar2 = new ct(this, f2, (byte) 3);
                    ctVar2.setOnTouchListener(new View.OnTouchListener() {
                        @Override
                        public final boolean onTouch(View view, MotionEvent motionEvent) {
                            if (motionEvent.getAction() == 1) {
                                view.setBackgroundColor(-7829368);
                                InMobiAdActivity.this.i.reload();
                                return true;
                            }
                            if (motionEvent.getAction() == 0) {
                                view.setBackgroundColor(-16711681);
                            }
                            return true;
                        }
                    });
                    linearLayout.addView(ctVar2, layoutParams3);
                    ct ctVar3 = new ct(this, f2, (byte) 4);
                    ctVar3.setOnTouchListener(new View.OnTouchListener() {
                        @Override
                        public final boolean onTouch(View view, MotionEvent motionEvent) {
                            if (motionEvent.getAction() != 1) {
                                if (motionEvent.getAction() == 0) {
                                    view.setBackgroundColor(-16711681);
                                }
                                return true;
                            }
                            view.setBackgroundColor(-7829368);
                            if (InMobiAdActivity.this.i.canGoBack()) {
                                InMobiAdActivity.this.i.goBack();
                            } else {
                                InMobiAdActivity inMobiAdActivity = InMobiAdActivity.this;
                                inMobiAdActivity.b = true;
                                inMobiAdActivity.finish();
                            }
                            return true;
                        }
                    });
                    linearLayout.addView(ctVar3, layoutParams3);
                    ct ctVar4 = new ct(this, f2, (byte) 6);
                    ctVar4.setOnTouchListener(new View.OnTouchListener() {
                        @Override
                        public final boolean onTouch(View view, MotionEvent motionEvent) {
                            if (motionEvent.getAction() != 1) {
                                if (motionEvent.getAction() == 0) {
                                    view.setBackgroundColor(-16711681);
                                }
                                return true;
                            }
                            view.setBackgroundColor(-7829368);
                            if (InMobiAdActivity.this.i.canGoForward()) {
                                InMobiAdActivity.this.i.goForward();
                            }
                            return true;
                        }
                    });
                    linearLayout.addView(ctVar4, layoutParams3);
                    setContentView(relativeLayout);
                    this.i.loadUrl(stringExtra);
                    this.i.setFullScreenActivityContext(this);
                    this.a.a(this.i);
                    return;
                }
            }
            q qVar22 = new q(this, (byte) 1, null, stringExtra2, Boolean.TRUE, "DEFAULT");
            this.i = qVar22;
            qVar22.setPlacementId(longExtra);
            this.i.setCreativeId(stringExtra3);
            this.i.setAllowAutoRedirection(booleanExtra);
            this.i.setShouldFireRenderBeacon(false);
            this.i.a(sVar, adConfig2, false, false);
            RelativeLayout relativeLayout2 = new RelativeLayout(this);
            RelativeLayout.LayoutParams layoutParams4 = new RelativeLayout.LayoutParams(-1, -1);
            layoutParams4.addRule(10);
            layoutParams4.addRule(2, i.c);
            relativeLayout2.setBackgroundColor(-1);
            relativeLayout2.addView(this.i, layoutParams4);
            float f22 = is.a().c;
            LinearLayout linearLayout2 = new LinearLayout(this);
            RelativeLayout.LayoutParams layoutParams22 = new RelativeLayout.LayoutParams(-1, (int) (48.0f * f22));
            linearLayout2.setOrientation(0);
            linearLayout2.setId(i.c);
            linearLayout2.setWeightSum(100.0f);
            linearLayout2.setBackgroundResource(R.drawable.bottom_bar);
            linearLayout2.setBackgroundColor(-7829368);
            layoutParams22.addRule(12);
            relativeLayout2.addView(linearLayout2, layoutParams22);
            LinearLayout.LayoutParams layoutParams32 = new LinearLayout.LayoutParams(-1, -1);
            layoutParams32.weight = 25.0f;
            ct ctVar5 = new ct(this, f22, (byte) 2);
            ctVar5.setOnTouchListener(new View.OnTouchListener() {
                @Override
                public final boolean onTouch(View view, MotionEvent motionEvent) {
                    if (motionEvent.getAction() != 1) {
                        if (motionEvent.getAction() == 0) {
                            view.setBackgroundColor(-16711681);
                        }
                        return true;
                    }
                    view.setBackgroundColor(-7829368);
                    InMobiAdActivity inMobiAdActivity = InMobiAdActivity.this;
                    inMobiAdActivity.b = true;
                    inMobiAdActivity.finish();
                    return true;
                }
            });
            linearLayout2.addView(ctVar5, layoutParams32);
            ct ctVar22 = new ct(this, f22, (byte) 3);
            ctVar22.setOnTouchListener(new View.OnTouchListener() {
                @Override
                public final boolean onTouch(View view, MotionEvent motionEvent) {
                    if (motionEvent.getAction() == 1) {
                        view.setBackgroundColor(-7829368);
                        InMobiAdActivity.this.i.reload();
                        return true;
                    }
                    if (motionEvent.getAction() == 0) {
                        view.setBackgroundColor(-16711681);
                    }
                    return true;
                }
            });
            linearLayout2.addView(ctVar22, layoutParams32);
            ct ctVar32 = new ct(this, f22, (byte) 4);
            ctVar32.setOnTouchListener(new View.OnTouchListener() {
                @Override
                public final boolean onTouch(View view, MotionEvent motionEvent) {
                    if (motionEvent.getAction() != 1) {
                        if (motionEvent.getAction() == 0) {
                            view.setBackgroundColor(-16711681);
                        }
                        return true;
                    }
                    view.setBackgroundColor(-7829368);
                    if (InMobiAdActivity.this.i.canGoBack()) {
                        InMobiAdActivity.this.i.goBack();
                    } else {
                        InMobiAdActivity inMobiAdActivity = InMobiAdActivity.this;
                        inMobiAdActivity.b = true;
                        inMobiAdActivity.finish();
                    }
                    return true;
                }
            });
            linearLayout2.addView(ctVar32, layoutParams32);
            ct ctVar42 = new ct(this, f22, (byte) 6);
            ctVar42.setOnTouchListener(new View.OnTouchListener() {
                @Override
                public final boolean onTouch(View view, MotionEvent motionEvent) {
                    if (motionEvent.getAction() != 1) {
                        if (motionEvent.getAction() == 0) {
                            view.setBackgroundColor(-16711681);
                        }
                        return true;
                    }
                    view.setBackgroundColor(-7829368);
                    if (InMobiAdActivity.this.i.canGoForward()) {
                        InMobiAdActivity.this.i.goForward();
                    }
                    return true;
                }
            });
            linearLayout2.addView(ctVar42, layoutParams32);
            setContentView(relativeLayout2);
            this.i.loadUrl(stringExtra);
            this.i.setFullScreenActivityContext(this);
            this.a.a(this.i);
            return;
        } catch (Exception e2) {
            gl.a().a(new hm(e2));
            sVar.a();
            finish();
            return;
        }
        sVar = sVar2;
        adConfig2 = adConfig;
    }

    @Override
    public void onDestroy() {
        if (this.b) {
            int i = this.j;
            if (100 == i) {
                q qVar = this.i;
                if (qVar != null && qVar.getFullScreenEventsListener() != null) {
                    try {
                        this.i.getFullScreenEventsListener().b(this.i);
                        this.i.destroy();
                        cy cyVar = this.a;
                        if (cyVar != null) {
                            cyVar.b(this.i);
                        }
                        this.i = null;
                    } catch (Exception unused) {
                    }
                }
            } else if (102 == i) {
                cx cxVar = this.h;
                if (cxVar != null) {
                    cy cyVar2 = this.a;
                    if (cyVar2 != null) {
                        cyVar2.b(cxVar);
                    }
                    this.h.a();
                }
                this.h = null;
            }
        } else {
            int i2 = this.j;
            if (100 != i2 && 102 == i2) {
                cx cxVar2 = this.h;
                if (cxVar2 != null) {
                    cy cyVar3 = this.a;
                    if (cyVar3 != null) {
                        cyVar3.b(cxVar2);
                    }
                    this.h.a();
                }
                this.h = null;
            }
        }
        cy cyVar4 = this.a;
        if (cyVar4 != null) {
            cyVar4.a.clear();
            cyVar4.disable();
            cyVar4.b = null;
        }
        super.onDestroy();
    }

    @Override
    public void onMultiWindowModeChanged(boolean z) {
        cx cxVar;
        super.onMultiWindowModeChanged(z);
        if (z || (cxVar = this.h) == null) {
            return;
        }
        j jVar = cxVar.c;
        dh orientationProperties = jVar instanceof q ? ((q) jVar).getOrientationProperties() : null;
        cy cyVar = this.a;
        if (cyVar != null) {
            cyVar.a(orientationProperties);
        }
    }

    @Override
    public void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        this.k = false;
        this.i = null;
        setIntent(intent);
        cx cxVar = this.h;
        if (cxVar != null) {
            cxVar.a(intent, e);
            cv cvVar = cxVar.b;
            if (cvVar != null) {
                cvVar.b();
            }
        }
    }

    @Override
    public void onResume() {
        cx cxVar;
        cv cvVar;
        super.onResume();
        if (this.b) {
            return;
        }
        int i = this.j;
        if (100 != i) {
            if (102 != i || (cxVar = this.h) == null || (cvVar = cxVar.b) == null) {
                return;
            }
            cvVar.c();
            return;
        }
        q qVar = this.i;
        if (qVar == null || qVar.getFullScreenEventsListener() == null) {
            return;
        }
        try {
            if (this.k) {
                return;
            }
            this.k = true;
            this.i.getFullScreenEventsListener().a(this.i);
        } catch (Exception unused) {
        }
    }

    @Override
    public void onStart() {
        cx cxVar;
        cv cvVar;
        super.onStart();
        if (this.b || 102 != this.j || (cxVar = this.h) == null || (cvVar = cxVar.b) == null) {
            return;
        }
        cvVar.b();
    }

    @Override
    public void onStop() {
        cx cxVar;
        cv cvVar;
        super.onStop();
        if (this.b || (cxVar = this.h) == null || (cvVar = cxVar.b) == null) {
            return;
        }
        cvVar.d();
    }

    public static int a(j jVar) {
        int hashCode = jVar.hashCode();
        e.put(hashCode, jVar);
        return hashCode;
    }

    public static void a(@NonNull Object obj) {
        e.remove(obj.hashCode());
    }

    public static void a(q qVar) {
        f = qVar;
    }

    public static void a(s sVar) {
        g = sVar;
    }

    public final void a(dh dhVar) {
        cy cyVar = this.a;
        if (cyVar != null) {
            cyVar.a(dhVar);
        }
    }

    @Override
    public void onMultiWindowModeChanged(boolean z, Configuration configuration) {
        super.onMultiWindowModeChanged(z, configuration);
        onMultiWindowModeChanged(z);
    }
}