正在查看: 万能钥匙 v1.1.23 应用的 PermRequestProxyActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 万能钥匙 v1.1.23 应用的 PermRequestProxyActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.lantern.permission.ui;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.b;
import androidx.core.app.b;
import com.lantern.permission.ui.PermRequestProxyActivity;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import java.util.HashMap;
import mw.c;
import mw.d;
import mw.e;
import os.u5;
import ow.i;
import ow.j;
import um.a;
public class PermRequestProxyActivity extends AppCompatActivity {
public static HashMap<Integer, Object> W = new HashMap<>();
public static ChangeQuickRedirect changeQuickRedirect;
public String O;
public String P;
public int Q;
public Object R;
public String[] S;
public TextView T;
public TextView U;
public long V;
public static void J(PermRequestProxyActivity permRequestProxyActivity, DialogInterface dialogInterface, int i) {
permRequestProxyActivity.getClass();
if (PatchProxy.proxy(new Object[]{dialogInterface, new Integer(i)}, permRequestProxyActivity, changeQuickRedirect, false, 798, new Class[]{DialogInterface.class, Integer.TYPE}, Void.TYPE).isSupported) {
return;
}
permRequestProxyActivity.finish();
}
public static void K(PermRequestProxyActivity permRequestProxyActivity, DialogInterface dialogInterface) {
permRequestProxyActivity.getClass();
if (PatchProxy.proxy(new Object[]{dialogInterface}, permRequestProxyActivity, changeQuickRedirect, false, 799, new Class[]{DialogInterface.class}, Void.TYPE).isSupported) {
return;
}
permRequestProxyActivity.finish();
}
public static void L(PermRequestProxyActivity permRequestProxyActivity, DialogInterface dialogInterface, int i) {
permRequestProxyActivity.getClass();
if (PatchProxy.proxy(new Object[]{dialogInterface, new Integer(i)}, permRequestProxyActivity, changeQuickRedirect, false, 797, new Class[]{DialogInterface.class, Integer.TYPE}, Void.TYPE).isSupported) {
return;
}
Q(permRequestProxyActivity);
permRequestProxyActivity.finish();
}
public static void M(Object obj, int i, @NonNull String[] strArr, @NonNull int[] iArr) {
if (PatchProxy.proxy(new Object[]{obj, new Integer(i), strArr, iArr}, null, changeQuickRedirect, true, 786, new Class[]{Object.class, Integer.TYPE, String[].class, int[].class}, Void.TYPE).isSupported) {
return;
}
try {
if (obj instanceof b.f) {
a.b((b.f) obj, i, strArr, iArr);
}
} catch (Exception unused) {
}
}
public static void Q(Context context) {
if (PatchProxy.proxy(new Object[]{context}, null, changeQuickRedirect, true, 788, new Class[]{Context.class}, Void.TYPE).isSupported) {
return;
}
i.a.b(context, context.getPackageName());
}
public static Intent R(Context context, Object obj, int i, String[] strArr, String str, String str2) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{context, obj, new Integer(i), strArr, str, str2}, null, changeQuickRedirect, true, 787, new Class[]{Context.class, Object.class, Integer.TYPE, String[].class, String.class, String.class}, Intent.class);
if (proxy.isSupported) {
return (Intent) proxy.result;
}
W.put(Integer.valueOf(obj.hashCode()), obj);
Intent intent = new Intent(context, (Class<?>) PermRequestProxyActivity.class);
intent.putExtra("target", obj.hashCode());
intent.putExtra("perms", strArr);
intent.putExtra("title", str);
intent.putExtra("desc", str2);
intent.putExtra("request_code", i);
intent.setPackage(context.getPackageName());
return intent;
}
public static void request(Activity activity, Object obj, String[] strArr, String str, String str2, int i) {
if (PatchProxy.proxy(new Object[]{activity, obj, strArr, str, str2, new Integer(i)}, null, changeQuickRedirect, true, 785, new Class[]{Activity.class, Object.class, String[].class, String.class, String.class, Integer.TYPE}, Void.TYPE).isSupported) {
return;
}
int[] iArr = new int[strArr.length];
for (int i2 = 0; i2 < strArr.length; i2++) {
int a = a.a(activity, strArr[i2]);
iArr[i2] = a;
if (a != 0) {
try {
activity.startActivity(R(activity, obj, i, strArr, str, str2));
activity.overridePendingTransition(0, 0);
return;
} catch (Exception e) {
pa.b.c(e);
return;
}
}
}
M(obj, i, strArr, iArr);
}
public final void N(String str) {
if (PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 793, new Class[]{String.class}, Void.TYPE).isSupported) {
return;
}
j.a.h("wk_perm_request_proxy", str, 0);
}
public final int O(String str) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 791, new Class[]{String.class}, Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : j.a.b("wk_perm_request_proxy", str, 0);
}
public final boolean P(int[] iArr) {
for (int i : iArr) {
if (i != 0) {
return false;
}
}
return true;
}
public final void S(String str) {
if (PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 792, new Class[]{String.class}, Void.TYPE).isSupported) {
return;
}
j.a.h("wk_perm_request_proxy", str, O(str) + 1);
}
public final void T() {
if (PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 796, new Class[0], Void.TYPE).isSupported) {
return;
}
b.a aVar = new b.a(this);
aVar.setTitle(this.O);
aVar.f(this.P);
aVar.h(new DialogInterface.OnCancelListener() {
@Override
public final void onCancel(DialogInterface dialogInterface) {
PermRequestProxyActivity.K(PermRequestProxyActivity.this, dialogInterface);
}
});
aVar.setNegativeButton(e.perm_cancel, new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
PermRequestProxyActivity.J(PermRequestProxyActivity.this, dialogInterface, i);
}
});
aVar.setPositiveButton(e.perm_open, new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
PermRequestProxyActivity.L(PermRequestProxyActivity.this, dialogInterface, i);
}
});
aVar.n();
}
public void finish() {
if (PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 795, new Class[0], Void.TYPE).isSupported) {
return;
}
super/*android.app.Activity*/.finish();
overridePendingTransition(0, 0);
}
public void onCreate(Bundle bundle) {
String[] strArr;
if (PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 789, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
return;
}
ow.a.d(this);
super/*androidx.fragment.app.FragmentActivity*/.onCreate(bundle);
setContentView(d.layout_perm_request_proxy_activity);
this.T = (TextView) findViewById(c.tv_title);
this.U = (TextView) findViewById(c.tv_content);
Intent intent = getIntent();
if (intent != null) {
this.O = intent.getStringExtra("title");
this.P = intent.getStringExtra("desc");
this.S = intent.getStringArrayExtra("perms");
this.Q = intent.getIntExtra("request_code", 0);
this.R = W.remove(Integer.valueOf(intent.getIntExtra("target", 0)));
}
if (!TextUtils.isEmpty(this.O)) {
this.T.setText(this.O);
}
if (!TextUtils.isEmpty(this.P)) {
this.U.setText(this.P);
}
String[] strArr2 = this.S;
int[] iArr = new int[strArr2.length];
if (strArr2.length == 0) {
finish();
return;
}
int i = 0;
boolean z = false;
while (true) {
strArr = this.S;
if (i >= strArr.length) {
break;
}
String str = strArr[i];
int a = a.a(this, str);
iArr[i] = a;
if (a != 0 && O(str) > 0 && !a.c(this, str)) {
z = true;
}
i++;
}
if (z) {
M(this.R, this.Q, strArr, iArr);
T();
} else if (Build.VERSION.SDK_INT < 23) {
M(this.R, this.Q, strArr, iArr);
finish();
} else {
this.V = System.currentTimeMillis();
requestPermissions(this.S, 1);
S(this.S[0]);
}
}
public void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr) {
if (PatchProxy.proxy(new Object[]{new Integer(i), strArr, iArr}, this, changeQuickRedirect, false, 794, new Class[]{Integer.TYPE, String[].class, int[].class}, Void.TYPE).isSupported) {
return;
}
try {
super/*androidx.fragment.app.FragmentActivity*/.onRequestPermissionsResult(i, strArr, iArr);
u5.g(strArr);
if (i == 1) {
long currentTimeMillis = System.currentTimeMillis();
if (P(iArr)) {
N(strArr[0]);
M(this.R, this.Q, strArr, iArr);
finish();
} else if (currentTimeMillis - this.V < 300) {
T();
} else {
M(this.R, this.Q, strArr, iArr);
finish();
}
}
} catch (Exception unused) {
}
}
public void setRequestedOrientation(int i) {
if (PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 790, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
return;
}
super/*android.app.Activity*/.setRequestedOrientation(i);
ow.a.e(this);
}
}