62 lines
1.8 KiB
Java
62 lines
1.8 KiB
Java
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);
|
|
}
|
|
}
|
|
}
|