MyRecorder v1.01.90.0219版本的 MD5 值为:c361f51174a0bf833abfa72929caf8d3
以下内容为反编译后的 BaseActivity.java 源代码,内容仅作参考
package com.myviocerecorder.voicerecorder.activities;
import ak.k0;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.os.SystemClock;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.material.snackbar.Snackbar;
import com.myviocerecorder.voicerecorder.App;
import com.myviocerecorder.voicerecorder.activities.BaseActivity;
import com.myviocerecorder.voicerecorder.bean.NotifyData;
import com.myviocerecorder.voicerecorder.billing.j;
import com.myviocerecorder.voicerecorder.billing.k;
import com.myviocerecorder.voicerecorder.constant.UserConfig;
import com.myviocerecorder.voicerecorder.models.Recording;
import com.myviocerecorder.voicerecorder.purchase.VipBillingActivityForChristmas2022;
import com.myviocerecorder.voicerecorder.purchase.VipBillingActivityForChristmasOto2022;
import com.myviocerecorder.voicerecorder.purchase.VipBillingActivityForFiveDay2022;
import com.myviocerecorder.voicerecorder.purchase.VipBillingActivityForFiveDayOto2022;
import com.myviocerecorder.voicerecorder.purchase.VipBillingActivityForHalfYear2023;
import com.myviocerecorder.voicerecorder.purchase.VipBillingActivityForHalfYearOto2023;
import com.myviocerecorder.voicerecorder.purchase.VipBillingActivityForLoyal;
import com.myviocerecorder.voicerecorder.purchase.VipBillingActivityForNewyear2022;
import com.myviocerecorder.voicerecorder.purchase.VipBillingActivityForNewyearOto2022;
import com.myviocerecorder.voicerecorder.purchase.VipBillingActivityForThanks2022;
import com.myviocerecorder.voicerecorder.purchase.VipBillingActivityForThanksOto2022;
import com.myviocerecorder.voicerecorder.purchase.VipScrollDetailActivity;
import com.myviocerecorder.voicerecorder.ui.activities.CropActivity;
import com.myviocerecorder.voicerecorder.ui.activities.PlayerActivity;
import com.myviocerecorder.voicerecorder.ui.activities.TrimActivity;
import g0.b;
import ge.h;
import ie.c;
import ie.f;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import mk.l;
import myrecorder.voicerecorder.voicememos.audiorecorder.recordingapp.R;
import nk.s;
import wk.o;
import xe.c0;
import xe.e;
import xe.m;
import xe.y;
public class BaseActivity extends AppCompatActivity implements k {
public static int f39189s;
public static l<? super Boolean, k0> f39191u;
public l<? super Boolean, k0> f39199h;
public boolean f39200i;
public ProgressDialog f39201j;
public yd.a f39205n;
public j f39206o;
public static final a f39188r = new a(null);
public static final int f39190t = 3;
public Map<Integer, View> f39208q = new LinkedHashMap();
public final String f39192a = "recorder";
public final String f39193b = "home";
public final String f39194c = "market";
public final String f39195d = "https";
public final String f39196e = "http";
public final String f39197f = "vip_fiveday_2022";
public final String f39198g = "vip_thanks_2022";
public int f39202k = de.a.f41115a.l();
public boolean f39203l = true;
public ArrayList<Uri> f39204m = new ArrayList<>();
public final int f39207p = 100;
public static final class a {
public a() {
}
public a(nk.j jVar) {
this();
}
public final boolean a() {
UserConfig j10;
App.a aVar = App.f39143g;
App b10 = aVar.b();
Long valueOf = (b10 == null || (j10 = b10.j()) == null) ? null : Long.valueOf(j10.t0());
s.e(valueOf);
long longValue = valueOf.longValue();
App b11 = aVar.b();
if (!(b11 != null && b11.p()) && longValue > 0) {
long elapsedRealtime = (longValue + 86400000) - SystemClock.elapsedRealtime();
if (elapsedRealtime > 0 && elapsedRealtime < 86400000) {
return true;
}
App b12 = aVar.b();
UserConfig j11 = b12 != null ? b12.j() : null;
if (j11 != null) {
j11.N1(-1L);
}
}
return false;
}
public final int b() {
return BaseActivity.f39190t;
}
public final int c() {
return BaseActivity.f39189s;
}
public final void d(int i10) {
BaseActivity.f39189s = i10;
}
public final void e(Context context) {
Intent intent;
UserConfig j10;
UserConfig j11;
UserConfig j12;
UserConfig j13;
UserConfig j14;
s.h(context, "context");
boolean z7 = false;
if (e.l()) {
App b10 = App.f39143g.b();
if (b10 != null && (j14 = b10.j()) != null && j14.L()) {
z7 = true;
}
intent = z7 ? new Intent(context, VipBillingActivityForFiveDay2022.class) : new Intent(context, VipBillingActivityForFiveDayOto2022.class);
} else if (e.p()) {
App b11 = App.f39143g.b();
if (b11 != null && (j13 = b11.j()) != null && j13.L()) {
z7 = true;
}
intent = z7 ? new Intent(context, VipBillingActivityForThanks2022.class) : new Intent(context, VipBillingActivityForThanksOto2022.class);
} else if (e.i()) {
App b12 = App.f39143g.b();
if (b12 != null && (j12 = b12.j()) != null && j12.L()) {
z7 = true;
}
intent = z7 ? new Intent(context, VipBillingActivityForChristmas2022.class) : new Intent(context, VipBillingActivityForChristmasOto2022.class);
} else if (e.r()) {
App b13 = App.f39143g.b();
if (b13 != null && (j11 = b13.j()) != null && j11.L()) {
z7 = true;
}
intent = z7 ? new Intent(context, VipBillingActivityForNewyear2022.class) : new Intent(context, VipBillingActivityForNewyearOto2022.class);
} else if (e.j()) {
App b14 = App.f39143g.b();
if (b14 != null && (j10 = b14.j()) != null && j10.L()) {
z7 = true;
}
intent = z7 ? new Intent(context, VipBillingActivityForHalfYear2023.class) : new Intent(context, VipBillingActivityForHalfYearOto2023.class);
d(c() + 1);
} else {
intent = a() ? new Intent(context, VipBillingActivityForLoyal.class) : new Intent(context, VipScrollDetailActivity.class);
}
context.startActivity(intent);
}
}
public static final void v(BaseActivity baseActivity, int i10, View view) {
s.h(baseActivity, "this$0");
baseActivity.A();
if (i10 == 4) {
he.a.f44584a.b().e("permission_record_snackbar_go");
} else {
he.a.f44584a.b().e("permission_storage_snackbar_go");
}
}
public final void A() {
Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
intent.setData(Uri.parse("package:" + getPackageName()));
startActivity(intent.addFlags(268435456));
}
public void B(Context context, String str) {
s.h(context, "context");
try {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
if (!(context instanceof Activity)) {
intent.setFlags(270532608);
}
context.startActivity(intent);
} catch (Exception unused) {
}
}
public void C(Context context, String str) {
s.h(context, "context");
try {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
intent.setPackage("com.android.vending");
if (!(context instanceof Activity)) {
intent.setFlags(270532608);
}
context.startActivity(intent);
} catch (Exception unused) {
B(context, str);
}
}
public boolean D(Context context, String str) {
App.a aVar;
App b10;
Uri parse;
UserConfig j10;
UserConfig j11;
s.h(context, "context");
if (c0.b(str)) {
L(context);
return false;
}
try {
aVar = App.f39143g;
b10 = aVar.b();
s.e(b10);
parse = Uri.parse(str);
} catch (Exception unused) {
}
if (parse == null) {
L(context);
return true;
}
String scheme = parse.getScheme();
String host = parse.getHost();
if (!o.v(this.f39192a, scheme, true)) {
if (o.v(this.f39194c, parse.getScheme(), true)) {
C(context, str);
return true;
}
if (!o.v(this.f39195d, parse.getScheme(), true) && !o.v(this.f39196e, parse.getScheme(), true)) {
if (!b10.o()) {
String uri = new Uri.Builder().scheme(this.f39192a).authority(this.f39193b).build().toString();
s.g(uri, "Builder().scheme(SCHEME_…T_APP).build().toString()");
B(context, uri);
return true;
}
}
B(context, str);
return true;
} else if (!s.c(this.f39193b, host)) {
if (this.f39197f.equals(host)) {
App b11 = aVar.b();
if ((b11 == null || (j11 = b11.j()) == null || !j11.L()) ? false : true) {
Intent intent = new Intent(context, VipBillingActivityForFiveDay2022.class);
intent.putExtra("fromNoti", true);
J(context, intent);
} else {
Intent intent2 = new Intent(context, VipBillingActivityForFiveDayOto2022.class);
intent2.putExtra("fromNoti", true);
J(context, intent2);
}
return true;
} else if (!this.f39198g.equals(host)) {
B(context, str);
return true;
} else {
App b12 = aVar.b();
if ((b12 == null || (j10 = b12.j()) == null || !j10.L()) ? false : true) {
Intent intent3 = new Intent(context, VipBillingActivityForThanks2022.class);
intent3.putExtra("fromNoti", true);
J(context, intent3);
} else {
Intent intent4 = new Intent(context, VipBillingActivityForThanksOto2022.class);
intent4.putExtra("fromNoti", true);
J(context, intent4);
}
return true;
}
} else {
List<String> pathSegments = parse.getPathSegments();
if (pathSegments != null && pathSegments.size() >= 0) {
pathSegments.get(0);
}
if (!b10.o()) {
B(context, str);
return true;
}
}
return false;
}
public void E() {
j jVar = this.f39206o;
if (jVar != null) {
jVar.w(true, true);
}
}
public final void F(ProgressDialog progressDialog) {
this.f39201j = progressDialog;
}
public final void G() {
int l10 = de.a.f41115a.l();
this.f39202k = l10;
if (!(this instanceof TrimActivity) && !(this instanceof CropActivity) && !(this instanceof PlayerActivity)) {
super.setTheme(l10);
} else if (l10 == R.style.NoActionBar) {
super.setTheme(R.style.NoActionBarNoAnimation);
} else {
super.setTheme(R.style.NoActionBarNightNoAnimation);
}
}
public void H(Context context, String str) {
if (isFinishing() || isDestroyed()) {
return;
}
ProgressDialog progressDialog = new ProgressDialog(this, R.style.HomeProcessDialog);
this.f39201j = progressDialog;
progressDialog.setMessage(str);
ProgressDialog progressDialog2 = this.f39201j;
if (progressDialog2 != null) {
progressDialog2.setCanceledOnTouchOutside(false);
}
ProgressDialog progressDialog3 = this.f39201j;
if (progressDialog3 != null) {
progressDialog3.show();
}
}
public final void I(Context context, Intent intent) {
if (!(context instanceof Activity) && intent != null) {
intent.setFlags(270532608);
}
if (context != null) {
context.startActivity(intent);
}
}
public void J(Context context, Intent intent) {
if (!(context instanceof Activity) && intent != null) {
intent.setFlags(270532608);
}
if (context != null) {
context.startActivity(intent);
}
}
public void K(Context context, String str, String str2) {
try {
try {
Intent l10 = l(str, str2);
if (l10 != null) {
l10.setPackage("com.google.android.gm");
}
I(context, l10);
} catch (Exception unused) {
I(context, l(str, str2));
}
} catch (Exception unused2) {
y.j(context, R.string.no_app_found);
}
}
public final void L(Context context) {
s.h(context, "context");
App b10 = App.f39143g.b();
s.e(b10);
if (b10.o()) {
return;
}
String uri = new Uri.Builder().scheme(this.f39192a).authority(this.f39193b).build().toString();
s.g(uri, "Builder().scheme(SCHEME_… .build().toString()");
B(context, uri);
}
@Override
public void applyOverrideConfiguration(Configuration configuration) {
UserConfig j10;
s.h(configuration, "overrideConfiguration");
if (Build.VERSION.SDK_INT <= 25) {
App b10 = App.f39143g.b();
Locale b11 = xe.a.b((b10 == null || (j10 = b10.j()) == null) ? null : j10.c0());
s.g(b11, "getLocale(selectedLanguage)");
configuration.setLocale(b11);
}
super.applyOverrideConfiguration(configuration);
}
@Override
public void attachBaseContext(Context context) {
s.h(context, "newBase");
try {
Locale b10 = h.d(context).e() == 0 ? f.b() : c.c().get(h.d(context).e());
super.attachBaseContext(b10 != null ? f.c(context, b10) : context);
} catch (Exception unused) {
super.attachBaseContext(context);
}
}
@Override
public void b() {
}
@Override
public void d(String str) {
j jVar = this.f39206o;
if (jVar != null) {
jVar.M();
}
}
public Intent l(String str, String str2) {
Intent intent = new Intent("android.intent.action.SEND");
intent.setType("plain/text");
intent.putExtra("android.intent.extra.EMAIL", new String[]{"betterapp.feedback@outlook.com"});
intent.putExtra("android.intent.extra.TEXT", str2);
intent.putExtra("android.intent.extra.SUBJECT", str);
return intent;
}
public final Recording m(String str) {
File file = new File(str);
int hashCode = file.hashCode();
String name = file.getName();
String absolutePath = file.getAbsolutePath();
int lastModified = (int) (file.lastModified() / 1000);
String absolutePath2 = file.getAbsolutePath();
s.g(absolutePath2, "file.absolutePath");
Integer f10 = h.f(this, absolutePath2);
return new Recording(hashCode, name, absolutePath, lastModified, f10 != null ? f10.intValue() : 0, file.length(), null);
}
public boolean n(Activity activity, Intent intent) {
String stringExtra;
s.h(activity, "activity");
if (intent == null) {
return false;
}
try {
stringExtra = intent.getStringExtra("noti_url");
} catch (Exception unused) {
}
if (c0.b(stringExtra)) {
intent.putExtra("noti_url", "");
return false;
}
return D(activity, stringExtra);
}
public final j o() {
return this.f39206o;
}
@Override
public void onActivityResult(int i10, int i11, Intent intent) {
super.onActivityResult(i10, i11, intent);
if (i10 == f39190t) {
if (i11 == -1) {
Iterator<Uri> it = this.f39204m.iterator();
while (it.hasNext()) {
m.b(it.next());
}
}
this.f39204m.clear();
}
}
@Override
public void onConfigurationChanged(Configuration configuration) {
s.h(configuration, "newConfig");
super.onConfigurationChanged(configuration);
de.a aVar = de.a.f41115a;
aVar.o();
if (this.f39202k != aVar.l()) {
recreate();
}
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
G();
App b10 = App.f39143g.b();
if (b10 != null) {
b10.k(this);
}
j jVar = new j(this);
this.f39206o = jVar;
jVar.N(this);
}
@Override
public void onDestroy() {
super.onDestroy();
f39191u = null;
}
@Override
public void onNightModeChanged(int i10) {
super.onNightModeChanged(i10);
}
@Override
public void onRequestPermissionsResult(int i10, String[] strArr, int[] iArr) {
l<? super Boolean, k0> lVar;
s.h(strArr, "permissions");
s.h(iArr, "grantResults");
super.onRequestPermissionsResult(i10, strArr, iArr);
this.f39200i = false;
if (iArr.length == 0) {
return;
}
if (strArr.length == 0) {
return;
}
if (i10 == this.f39207p && (lVar = this.f39199h) != null) {
lVar.invoke(Boolean.valueOf(iArr[0] == 0));
}
if (!b.w(this, strArr[0]) && iArr[0] != 0) {
SharedPreferences.Editor edit = h.d(this).i().edit();
edit.putBoolean("nopermission_" + strArr[0], true).commit();
}
if (strArr[0].equals("android.permission.RECORD_AUDIO")) {
if (iArr[0] == 0) {
he.a.f44584a.b().e("permission_record_allow");
} else {
he.a.f44584a.b().e("permission_record_deny");
}
} else if (strArr[0].equals("android.permission.WRITE_EXTERNAL_STORAGE") || strArr[0].equals("android.permission.READ_EXTERNAL_STORAGE")) {
if (iArr[0] == 0) {
he.a.f44584a.b().e("permission_storage_allow");
} else {
he.a.f44584a.b().e("permission_storage_deny");
}
}
}
@Override
public void onRestart() {
super.onRestart();
de.a aVar = de.a.f41115a;
aVar.o();
if (this.f39202k != aVar.l()) {
recreate();
}
}
@Override
public void onResume() {
super.onResume();
this.f39203l = true;
}
@Override
public void onStop() {
super.onStop();
this.f39199h = null;
this.f39203l = false;
}
public final ProgressDialog p() {
return this.f39201j;
}
public final int q() {
return this.f39202k;
}
public final Uri r(Intent intent) {
String action = intent != null ? intent.getAction() : null;
if (intent == null || TextUtils.isEmpty(action)) {
return null;
}
if ("android.intent.action.SEND".equals(action)) {
Bundle extras = intent.getExtras();
if (extras != null) {
return (Uri) extras.getParcelable("android.intent.extra.STREAM");
}
return null;
} else if ("android.intent.action.VIEW".equals(action) || "android.intent.action.EDIT".equals(action)) {
return intent.getData();
} else {
return null;
}
}
public final ArrayList<Uri> s() {
return this.f39204m;
}
@Override
public void setContentView(int i10) {
super.setContentView(i10);
this.f39205n = new yd.a(findViewById(16908290));
}
public final yd.a t() {
return this.f39205n;
}
public final void u(final int i10, l<? super Boolean, k0> lVar) {
String string;
s.h(lVar, "callback");
this.f39199h = null;
if (h.o(this, i10)) {
lVar.invoke(Boolean.TRUE);
return;
}
SharedPreferences i11 = h.d(this).i();
if (!i11.getBoolean("nopermission_" + h.l(this, i10), false) || b.w(this, h.l(this, i10))) {
if (i10 == 4) {
he.a.f44584a.b().e("permission_record_show");
} else {
he.a.f44584a.b().e("permission_storage_show");
}
this.f39200i = true;
this.f39199h = lVar;
b.t(this, new String[]{h.l(this, i10)}, this.f39207p);
return;
}
if (i10 == 4) {
string = getString(R.string.record_permission_detail);
s.g(string, "getString(R.string.record_permission_detail)");
he.a.f44584a.b().e("permission_record_snackbar_show");
} else if (i10 == 16) {
string = getString(R.string.pemission_audio_setting);
s.g(string, "getString(R.string.pemission_audio_setting)");
} else if (i10 != 17) {
string = getString(R.string.storage_permission_detail);
s.g(string, "getString(R.string.storage_permission_detail)");
he.a.f44584a.b().e("permission_storage_snackbar_show");
} else {
string = getString(R.string.pemission_image_setting);
s.g(string, "getString(R.string.pemission_image_setting)");
}
Snackbar action = Snackbar.make(getWindow().getDecorView(), string, 10000).setActionTextColor(i0.a.c(this, R.color.red_pink_f04070)).setAction(R.string.permission_detail_action, new View.OnClickListener() {
@Override
public final void onClick(View view) {
BaseActivity.v(BaseActivity.this, i10, view);
}
});
s.g(action, "make(\n th… }\n }");
View view = action.getView();
s.g(view, "snackbar.view");
((TextView) view.findViewById(R.id.snackbar_text)).setMaxLines(5);
action.show();
}
public final boolean w(Intent intent) {
UserConfig j10;
UserConfig j11;
boolean z7 = false;
if (intent != null) {
Parcelable parcelableExtra = intent.getParcelableExtra("local_data");
if (parcelableExtra instanceof NotifyData) {
int u6 = ((NotifyData) parcelableExtra).u();
if (u6 == 1) {
Intent intent2 = new Intent(this, VipBillingActivityForLoyal.class);
intent2.putExtra("extra_come_from", VipBillingActivityForLoyal.P.a());
startActivity(intent2);
he.a.f44584a.b().o("notif_special_offer_click");
return true;
} else if (u6 == 2) {
App b10 = App.f39143g.b();
if (b10 != null && (j11 = b10.j()) != null && j11.L()) {
z7 = true;
}
if (z7) {
Intent intent3 = new Intent(this, VipBillingActivityForFiveDay2022.class);
intent3.putExtra("fromNoti", true);
J(this, intent3);
} else {
Intent intent4 = new Intent(this, VipBillingActivityForFiveDayOto2022.class);
intent4.putExtra("fromNoti", true);
J(this, intent4);
}
return true;
} else if (u6 == 3) {
App b11 = App.f39143g.b();
if (b11 != null && (j10 = b11.j()) != null && j10.L()) {
z7 = true;
}
if (z7) {
Intent intent5 = new Intent(this, VipBillingActivityForThanks2022.class);
intent5.putExtra("fromNoti", true);
J(this, intent5);
} else {
Intent intent6 = new Intent(this, VipBillingActivityForThanksOto2022.class);
intent6.putExtra("fromNoti", true);
J(this, intent6);
}
return true;
}
}
}
return false;
}
public void x() {
ProgressDialog progressDialog;
if (!isFinishing() && !isDestroyed()) {
try {
ProgressDialog progressDialog2 = this.f39201j;
if (progressDialog2 == null) {
return;
}
boolean z7 = true;
if (progressDialog2 == null || !progressDialog2.isShowing()) {
z7 = false;
}
if (!z7 || (progressDialog = this.f39201j) == null) {
return;
}
progressDialog.dismiss();
} catch (Exception unused) {
}
}
}
public final boolean y() {
return se.a.a().c(this.f39202k);
}
public final boolean z() {
return this.f39203l;
}
}