Initial commit
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
package com.yanzhenjie.permission.overlay.setting;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import com.ubt.jimu.base.entities.Constant;
|
||||
import com.yanzhenjie.permission.source.Source;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class AlertWindowSettingPage {
|
||||
private static final String b = Build.MANUFACTURER.toLowerCase();
|
||||
private Source a;
|
||||
|
||||
public AlertWindowSettingPage(Source source) {
|
||||
this.a = source;
|
||||
}
|
||||
|
||||
private Intent b(Context context) {
|
||||
Intent intent = new Intent();
|
||||
intent.setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.permissionmanager.ui.MainActivity"));
|
||||
if (a(context, intent)) {
|
||||
return intent;
|
||||
}
|
||||
intent.setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.addviewmonitor.AddViewMonitorActivity"));
|
||||
if (a(context, intent)) {
|
||||
return intent;
|
||||
}
|
||||
intent.setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.notificationmanager.ui.NotificationManagmentActivity"));
|
||||
return intent;
|
||||
}
|
||||
|
||||
private Intent c(Context context) {
|
||||
Intent intent = new Intent("com.meizu.safe.security.SHOW_APPSEC");
|
||||
intent.putExtra(Constant.SelectRobot.PACKAGE_NAME_KEY, context.getPackageName());
|
||||
intent.setComponent(new ComponentName("com.meizu.safe", "com.meizu.safe.security.AppSecActivity"));
|
||||
return intent;
|
||||
}
|
||||
|
||||
private Intent d(Context context) {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(Constant.SelectRobot.PACKAGE_NAME_KEY, context.getPackageName());
|
||||
intent.setClassName("com.color.safecenter", "com.color.safecenter.permission.floatwindow.FloatWindowListActivity");
|
||||
if (a(context, intent)) {
|
||||
return intent;
|
||||
}
|
||||
intent.setClassName("com.coloros.safecenter", "com.coloros.safecenter.sysfloatwindow.FloatWindowListActivity");
|
||||
if (a(context, intent)) {
|
||||
return intent;
|
||||
}
|
||||
intent.setClassName("com.oppo.safe", "com.oppo.safe.permission.PermissionAppListActivity");
|
||||
return intent;
|
||||
}
|
||||
|
||||
private Intent e(Context context) {
|
||||
Intent intent = new Intent();
|
||||
intent.setClassName("com.iqoo.secure", "com.iqoo.secure.ui.phoneoptimize.FloatWindowManager");
|
||||
intent.putExtra("packagename", context.getPackageName());
|
||||
if (a(context, intent)) {
|
||||
return intent;
|
||||
}
|
||||
intent.setComponent(new ComponentName("com.iqoo.secure", "com.iqoo.secure.safeguard.SoftPermissionDetailActivity"));
|
||||
return intent;
|
||||
}
|
||||
|
||||
private Intent f(Context context) {
|
||||
Intent intent = new Intent("miui.intent.action.APP_PERM_EDITOR");
|
||||
intent.putExtra("extra_pkgname", context.getPackageName());
|
||||
if (a(context, intent)) {
|
||||
return intent;
|
||||
}
|
||||
intent.setPackage("com.miui.securitycenter");
|
||||
if (a(context, intent)) {
|
||||
return intent;
|
||||
}
|
||||
intent.setClassName("com.miui.securitycenter", "com.miui.permcenter.permissions.AppPermissionsEditorActivity");
|
||||
return intent;
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
try {
|
||||
this.a.a(b.contains("huawei") ? b(this.a.a()) : b.contains("xiaomi") ? f(this.a.a()) : b.contains("oppo") ? d(this.a.a()) : b.contains("vivo") ? e(this.a.a()) : b.contains("meizu") ? c(this.a.a()) : a(this.a.a()), i);
|
||||
} catch (Exception unused) {
|
||||
this.a.a(a(this.a.a()), i);
|
||||
}
|
||||
}
|
||||
|
||||
private static Intent a(Context context) {
|
||||
Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
|
||||
intent.setData(Uri.fromParts("package", context.getPackageName(), null));
|
||||
return intent;
|
||||
}
|
||||
|
||||
private static boolean a(Context context, Intent intent) {
|
||||
return context.getPackageManager().queryIntentActivities(intent, 65536).size() > 0;
|
||||
}
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
package com.yanzhenjie.permission.overlay.setting;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import com.ubt.jimu.base.entities.Constant;
|
||||
import com.yanzhenjie.permission.source.Source;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class OverlaySettingPage {
|
||||
private static final String b = Build.MANUFACTURER.toLowerCase();
|
||||
private Source a;
|
||||
|
||||
public OverlaySettingPage(Source source) {
|
||||
this.a = source;
|
||||
}
|
||||
|
||||
private void b(int i) {
|
||||
Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
|
||||
intent.setData(Uri.fromParts("package", this.a.a().getPackageName(), null));
|
||||
this.a.a(intent, i);
|
||||
}
|
||||
|
||||
private boolean c(int i) {
|
||||
Intent intent = new Intent("android.settings.action.MANAGE_OVERLAY_PERMISSION");
|
||||
intent.setData(Uri.fromParts("package", this.a.a().getPackageName(), null));
|
||||
try {
|
||||
this.a.a(intent, i);
|
||||
return true;
|
||||
} catch (Exception unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean d(int i) {
|
||||
Intent intent = new Intent("com.meizu.safe.security.SHOW_APPSEC");
|
||||
intent.putExtra(Constant.SelectRobot.PACKAGE_NAME_KEY, this.a.a().getPackageName());
|
||||
intent.setComponent(new ComponentName("com.meizu.safe", "com.meizu.safe.security.AppSecActivity"));
|
||||
try {
|
||||
this.a.a(intent, i);
|
||||
return true;
|
||||
} catch (Exception unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
if (!b.contains("meizu")) {
|
||||
if (c(i)) {
|
||||
return;
|
||||
}
|
||||
b(i);
|
||||
} else {
|
||||
if (d(i) || c(i)) {
|
||||
return;
|
||||
}
|
||||
b(i);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user