导航菜单

页面标题

页面副标题

BetterTogether v3.0.0 - ConsentDialogActivity.java 源代码

正在查看: BetterTogether v3.0.0 应用的 ConsentDialogActivity.java JAVA 源代码文件

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


package com.mopub.common.privacy;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.webkit.WebView;
import com.mopub.common.Constants;
import com.mopub.common.MoPub;
import com.mopub.common.Preconditions;
import com.mopub.common.logging.MoPubLog;
import com.mopub.mobileads.MoPubErrorCode;
import io.c;
import io.f;
import io.j;
import io.s;

public class ConsentDialogActivity extends Activity {
    public static final int w = 0;
    public j d;
    public io.b e;
    public Handler i;
    public ConsentStatus v;

    public final void a(boolean z) {
        Handler handler = this.i;
        if (handler != null) {
            handler.removeCallbacks(this.e);
        }
        j jVar = this.d;
        if (jVar != null) {
            jVar.setCloseVisible(z);
        }
    }

    @Override
    public final void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        String stringExtra = getIntent().getStringExtra("html-page-content");
        if (TextUtils.isEmpty(stringExtra)) {
            MoPubLog.log(MoPubLog.SdkLogEvent.CUSTOM, "Web page for ConsentDialogActivity is empty");
            MoPubLog.ConsentLogEvent consentLogEvent = MoPubLog.ConsentLogEvent.SHOW_FAILED;
            MoPubErrorCode moPubErrorCode = MoPubErrorCode.INTERNAL_ERROR;
            MoPubLog.log(consentLogEvent, Integer.valueOf(moPubErrorCode.getIntCode()), moPubErrorCode);
            finish();
            return;
        }
        requestWindowFeature(1);
        getWindow().addFlags(1024);
        try {
            j jVar = new j(this);
            this.d = jVar;
            io.a aVar = new io.a(this);
            Preconditions.checkNotNull(aVar);
            jVar.W = aVar;
            this.e = new io.b(this);
            setContentView(this.d);
            j jVar2 = this.d;
            c cVar = new c();
            jVar2.getClass();
            Preconditions.checkNotNull(stringExtra);
            jVar2.V = cVar;
            WebView webView = jVar2.U;
            webView.setWebViewClient(jVar2.a0);
            jVar2.setOnCloseListener(new f(jVar2));
            webView.loadDataWithBaseURL(g0.b.n(new StringBuilder("https://"), Constants.HOST, "/"), stringExtra, "text/html", "UTF-8", null);
        } catch (RuntimeException e) {
            MoPubLog.log(MoPubLog.SdkLogEvent.CUSTOM_WITH_THROWABLE, "Unable to create WebView", e);
            MoPubLog.ConsentLogEvent consentLogEvent2 = MoPubLog.ConsentLogEvent.SHOW_FAILED;
            MoPubErrorCode moPubErrorCode2 = MoPubErrorCode.INTERNAL_ERROR;
            MoPubLog.log(consentLogEvent2, Integer.valueOf(moPubErrorCode2.getIntCode()), moPubErrorCode2);
            finish();
        }
    }

    @Override
    public final void onDestroy() {
        ConsentStatus consentStatus;
        PersonalInfoManager personalInformationManager = MoPub.getPersonalInformationManager();
        if (personalInformationManager != null && (consentStatus = this.v) != null) {
            Preconditions.checkNotNull(consentStatus);
            int i = s.a[consentStatus.ordinal()];
            if (i == 1) {
                personalInformationManager.b(consentStatus, ConsentChangeReason.GRANTED_BY_USER.getReason());
                personalInformationManager.requestSync(true);
            } else if (i != 2) {
                MoPubLog.log(MoPubLog.ConsentLogEvent.CUSTOM, "Invalid consent status: " + consentStatus + ". This is a bug with the use of changeConsentStateFromDialog.");
            } else {
                personalInformationManager.b(consentStatus, ConsentChangeReason.DENIED_BY_USER.getReason());
                personalInformationManager.requestSync(true);
            }
        }
        super.onDestroy();
    }

    @Override
    public final void onResume() {
        super.onResume();
        MoPubLog.log(MoPubLog.ConsentLogEvent.SHOW_SUCCESS, new Object[0]);
    }

    @Override
    public final void onStart() {
        super.onStart();
        Handler handler = new Handler();
        this.i = handler;
        handler.postDelayed(this.e, 10000L);
    }

    @Override
    public final void onStop() {
        super.onStop();
        a(true);
    }
}