Call Recorder v6.34.2版本的 MD5 值为:298659ce317c966b10d9947b76831521

以下内容为反编译后的 MainActivity.java 源代码,内容仅作参考


package com.appstar.callrecorder;

import android.app.Dialog;
import android.content.ComponentName;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import androidx.appcompat.app.b;
import androidx.fragment.app.c;
import androidx.preference.j;
import b2.d;
import com.appstar.callrecorder.MainActivity;
import com.appstar.callrecordercore.g;
import com.appstar.callrecordercore.k;
import com.appstar.callrecordercore.l;
import g2.a;
import java.io.IOException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import u1.x;
public class MainActivity extends g {
    private ExecutorService f5230k0;
    private v1.a f5229j0 = null;
    private g2.a f5231l0 = null;
    private ServiceConnection f5232m0 = new a();

    class a implements ServiceConnection {
        a() {
        }

        @Override
        public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
            MainActivity.this.f5231l0 = a.AbstractBinderC0153a.K(iBinder);
            try {
                if (MainActivity.this.f5231l0.O3() == 0) {
                    SharedPreferences.Editor edit = j.b(MainActivity.this).edit();
                    edit.putBoolean(new String(l.f5867x), true);
                    edit.commit();
                    MainActivity.this.f5229j0.i();
                    MainActivity.this.y1();
                }
            } catch (RemoteException e9) {
                Log.e("MainActivity", "failed IPC", e9);
            }
        }

        @Override
        public void onServiceDisconnected(ComponentName componentName) {
            MainActivity.this.f5231l0 = null;
        }
    }

    public static class b extends c {
        public void C2(DialogInterface dialogInterface, int i9) {
            k.d1(C(), "https://www.appliqato.com/call-recorder-direct-download");
        }

        public static void D2(DialogInterface dialogInterface, int i9) {
        }

        @Override
        public Dialog r2(Bundle bundle) {
            w2(false);
            return new b.a(N1()).i(n0(R.string.update_dialog_text)).q(n0(R.string.update), new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i9) {
                    MainActivity.b.this.C2(dialogInterface, i9);
                }
            }).l(n0(R.string.later), new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface dialogInterface, int i9) {
                    MainActivity.b.D2(dialogInterface, i9);
                }
            }).a();
        }
    }

    private void b2() {
        final h2.a m9 = l.l().m(this);
        if (m9 != null) {
            if (m9.b()) {
                runOnUiThread(new Runnable() {
                    @Override
                    public final void run() {
                        MainActivity.this.c2();
                    }
                });
            } else if (m9.c()) {
                Log.d("MainActivity", "Check for version update");
                ExecutorService newSingleThreadExecutor = Executors.newSingleThreadExecutor();
                this.f5230k0 = newSingleThreadExecutor;
                newSingleThreadExecutor.execute(new Runnable() {
                    @Override
                    public final void run() {
                        MainActivity.this.e2(m9);
                    }
                });
            }
        }
    }

    public void c2() {
        if (isDestroyed()) {
            return;
        }
        try {
            new b().z2(b0(), "UPDATER");
        } catch (IllegalStateException e9) {
            Log.e("MainActivity", "Failed to load upgrade fragment - activity is probably destroyed", e9);
        }
    }

    public void d2() {
        if (isDestroyed()) {
            return;
        }
        try {
            new b().z2(b0(), "UPDATER");
        } catch (IllegalStateException e9) {
            Log.e("MainActivity", "Failed to load upgrade fragment - activity is probably destroyed", e9);
        }
    }

    public void e2(h2.a aVar) {
        if (aVar != null) {
            try {
                if (aVar.a()) {
                    Log.i("MainActivity", "Version update required");
                    runOnUiThread(new Runnable() {
                        @Override
                        public final void run() {
                            MainActivity.this.d2();
                        }
                    });
                }
            } catch (IOException | v8.c e9) {
                Log.e("MainActivity", "Failed to check version update", e9);
            }
        }
    }

    private void f2() {
        View findViewById = findViewById(R.id.adContainer1);
        SharedPreferences b9 = j.b(this);
        if (this.f5229j0 == null) {
            this.f5229j0 = v1.b.a(this, b9, (ViewGroup) findViewById);
            if (!d.s(this)) {
                findViewById.setMinimumHeight((int) x.a(this, ((t1.a) this.f5229j0).k()));
            }
            this.f5229j0.a(k.f.MAIN_SCREEN);
        }
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        f2();
        b2();
    }

    @Override
    public void onDestroy() {
        this.f5229j0.i();
        ExecutorService executorService = this.f5230k0;
        if (executorService != null) {
            try {
                if (!executorService.awaitTermination(100L, TimeUnit.MILLISECONDS)) {
                    this.f5230k0.shutdownNow();
                }
            } catch (InterruptedException unused) {
                this.f5230k0.shutdownNow();
            }
            this.f5230k0 = null;
        }
        super.onDestroy();
    }

    @Override
    public void onPause() {
        this.f5229j0.g();
        if (this.f5231l0 != null) {
            unbindService(this.f5232m0);
            this.f5231l0 = null;
        }
        super.onPause();
    }

    @Override
    public void onResume() {
        super.onResume();
        this.f5229j0.b();
        if (l.C(this) || !l.l().s()) {
            return;
        }
        Intent intent = new Intent();
        intent.setClassName("com.appstar.callrecorderpro", "com.appstar.callrecorderpro.RemoteService");
        intent.setAction(g2.a.class.getName());
        bindService(intent, this.f5232m0, 1);
    }
}