导航菜单

页面标题

页面副标题

万能钥匙 v1.1.23 - EasyCameraActivity.java 源代码

正在查看: 万能钥匙 v1.1.23 应用的 EasyCameraActivity.java JAVA 源代码文件

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


package com.finogeeks.lib.applet.externallib.easyphotos.easyphotos.ui;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.WindowManager;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.finogeeks.lib.applet.R;
import com.finogeeks.lib.applet.externallib.easyphotos.cameralibrary.JCameraView;
import com.finogeeks.lib.applet.media.video.client.AbsFinMediaPlayer;
import com.finogeeks.lib.applet.rest.model.UserMessageType;
import gq.g;
import java.io.File;
import java.lang.ref.WeakReference;

public class EasyCameraActivity extends com.finogeeks.lib.applet.modules.base.a {
    public static WeakReference<d> c;
    private JCameraView a;
    private com.finogeeks.lib.applet.f.a.easyphotos.b.a b;

    public class a implements com.finogeeks.lib.applet.externallib.easyphotos.cameralibrary.e.c {
        public a() {
        }

        @Override
        public void a() {
            AppCompatActivity appCompatActivity = EasyCameraActivity.this;
            g.b(Toast.makeText((Context) appCompatActivity, (CharSequence) appCompatActivity.getString(R.string.fin_applet_missing_audio_permission_easy_photos), 0));
            EasyCameraActivity.this.setResult(0, new Intent());
            EasyCameraActivity.this.finish();
        }

        @Override
        public void onError() {
            EasyCameraActivity.this.setResult(0, new Intent());
            EasyCameraActivity.this.finish();
        }
    }

    public class b implements com.finogeeks.lib.applet.externallib.easyphotos.cameralibrary.e.d {
        public b() {
        }

        @Override
        public void a(Bitmap bitmap) {
            String a = com.finogeeks.lib.applet.externallib.easyphotos.cameralibrary.g.d.a(EasyCameraActivity.this, com.finogeeks.lib.applet.f.a.easyphotos.b.a.d(EasyCameraActivity.this).f, bitmap);
            Intent intent = new Intent();
            intent.putExtra("extraResultCaptureImagePath", a);
            EasyCameraActivity.this.setResult(-1, intent);
            EasyCameraActivity.this.finish();
        }

        @Override
        public void a(String str) {
            Intent intent = new Intent();
            intent.putExtra("extraResultCaptureVideoPath", str);
            EasyCameraActivity.this.setResult(-1, intent);
            EasyCameraActivity.this.finish();
        }
    }

    public class c implements com.finogeeks.lib.applet.externallib.easyphotos.cameralibrary.e.b {
        public c() {
        }

        @Override
        public void a() {
            EasyCameraActivity.this.finish();
        }
    }

    public interface d {
        void a();
    }

    private int a() {
        char c2;
        String str = this.b.a;
        int hashCode = str.hashCode();
        if (hashCode != 64897) {
            if (hashCode == 69775675 && str.equals("IMAGE")) {
                c2 = 1;
            }
            c2 = 65535;
        } else {
            if (str.equals("ALL")) {
                c2 = 0;
            }
            c2 = 65535;
        }
        if (c2 != 0) {
            return c2 != 1 ? 258 : 257;
        }
        return 259;
    }

    public static void a(d dVar) {
        c = new WeakReference<>(dVar);
    }

    private void b() {
        String str = com.finogeeks.lib.applet.f.a.easyphotos.b.a.d(this).f;
        File file = null;
        try {
            if (!TextUtils.isEmpty(str)) {
                File file2 = new File(str);
                if (file2.isFile()) {
                    file2 = null;
                }
                if (!file2.exists()) {
                    file2.mkdirs();
                }
                file = file2;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (file == null) {
            file = new File(getExternalCacheDir(), UserMessageType.CAMERA);
        }
        this.a.setSaveVideoPath(file.getAbsolutePath());
        this.a.setFeatures(a());
        this.a.setMediaQuality(this.b.d);
        this.a.setDuration(this.b.b + AbsFinMediaPlayer.MEDIA_INFO_BAD_INTERLEAVING);
        this.a.setErrorListener(new a());
        this.a.setJCameraListener(new b());
        this.a.setLeftClickListener(new c());
    }

    public static boolean c() {
        return c != null;
    }

    private void d() {
        getWindow().setFlags(1024, 1024);
        if (Build.VERSION.SDK_INT >= 28) {
            WindowManager.LayoutParams attributes = getWindow().getAttributes();
            attributes.layoutInDisplayCutoutMode = 1;
            getWindow().setAttributes(attributes);
        }
        setRequestedOrientation(1);
        setContentView(R.layout.fin_applet_activity_easy_camera);
        JCameraView jCameraView = (JCameraView) findViewById(R.id.jCameraView);
        this.a = jCameraView;
        jCameraView.a(this.b.c);
        b();
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        this.b = com.finogeeks.lib.applet.f.a.easyphotos.b.a.d(this);
        d();
    }

    @Override
    public void onDestroy() {
        d dVar;
        super.onDestroy();
        WeakReference<d> weakReference = c;
        if (weakReference != null && (dVar = weakReference.get()) != null) {
            dVar.a();
        }
        c = null;
    }

    @Override
    public void onPause() {
        super.onPause();
        this.a.b();
    }

    @Override
    public void onResume() {
        super.onResume();
        this.a.c();
    }

    @Override
    public void onStart() {
        super.onStart();
        getWindow().getDecorView().setSystemUiVisibility(5894);
    }
}