导航菜单

页面标题

页面副标题

CreditNow v1.0.2 - CameraPermissionsActivity.java 源代码

正在查看: CreditNow v1.0.2 应用的 CameraPermissionsActivity.java JAVA 源代码文件

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


package com.regula.common;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Parcelable;
import androidx.annotation.NonNull;
import defpackage.gf3;

public class CameraPermissionsActivity extends Activity {
    public final Intent a() {
        Bundle extras = getIntent().getExtras();
        if (extras == null) {
            return null;
        }
        Intent intent = new Intent(this, (Class<?>) extras.getSerializable("camActivityType"));
        intent.setFlags(67108864);
        for (String str : extras.keySet()) {
            Object obj = extras.get(str);
            if (obj instanceof Boolean) {
                intent.putExtra(str, (Boolean) obj);
            } else if (obj instanceof Integer) {
                intent.putExtra(str, (Integer) obj);
            } else if (obj instanceof Parcelable) {
                intent.putExtra(str, (Parcelable) obj);
            } else if (obj instanceof String) {
                intent.putExtra(str, (String) obj);
            }
        }
        return intent;
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        Intent a = a();
        PackageManager packageManager = getApplicationContext().getPackageManager();
        if (!packageManager.hasSystemFeature("android.hardware.camera") && !packageManager.hasSystemFeature("android.hardware.camera.front")) {
            a.putExtra("AnyCameraAvailable", false);
            startActivity(a);
            finish();
        } else if (ph0.a(this, "android.permission.CAMERA") != 0) {
            gf3.m("OnResume: Asking permissions");
            x3.s(this, new String[]{"android.permission.CAMERA"}, 1100);
        } else {
            gf3.m("OnResume: Permissions granted");
            startActivity(a);
            finish();
        }
    }

    @Override
    public void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr) {
        if (i != 1100) {
            return;
        }
        Intent a = a();
        if (a == null) {
            a = new Intent();
        }
        if (iArr.length == 0 || iArr[0] != 0) {
            a.putExtra("PermissionGranted", false);
        }
        startActivity(a);
        finish();
    }
}