[app] Nuke ui framework check
This commit is contained in:
parent
d92de9a392
commit
630147b72c
|
|
@ -42,7 +42,7 @@ import io.github.lsposed.manager.databinding.ActivityMainBinding;
|
|||
import io.github.lsposed.manager.databinding.DialogAboutBinding;
|
||||
import io.github.lsposed.manager.ui.activity.base.BaseActivity;
|
||||
import io.github.lsposed.manager.ui.dialog.BlurBehindDialogBuilder;
|
||||
import io.github.lsposed.manager.ui.dialog.StatusDialogBuilder;
|
||||
import io.github.lsposed.manager.ui.dialog.InfoDialogBuilder;
|
||||
import io.github.lsposed.manager.util.GlideHelper;
|
||||
import io.github.lsposed.manager.util.ModuleUtil;
|
||||
import io.github.lsposed.manager.util.NavUtil;
|
||||
|
|
@ -62,7 +62,7 @@ public class MainActivity extends BaseActivity {
|
|||
HolidayHelper.setup(this);
|
||||
binding.status.setOnClickListener(v -> {
|
||||
if (ConfigManager.getXposedApiVersion() != -1) {
|
||||
new StatusDialogBuilder(this)
|
||||
new InfoDialogBuilder(this)
|
||||
.setTitle(R.string.info)
|
||||
.show();
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ import android.view.View;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.core.text.HtmlCompat;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Locale;
|
||||
|
||||
import io.github.lsposed.manager.BuildConfig;
|
||||
|
|
@ -36,9 +35,9 @@ import io.github.lsposed.manager.R;
|
|||
import io.github.lsposed.manager.databinding.DialogInfoBinding;
|
||||
import rikka.core.util.ClipboardUtils;
|
||||
|
||||
public class StatusDialogBuilder extends BlurBehindDialogBuilder {
|
||||
public class InfoDialogBuilder extends BlurBehindDialogBuilder {
|
||||
|
||||
public StatusDialogBuilder(@NonNull Context context) {
|
||||
public InfoDialogBuilder(@NonNull Context context) {
|
||||
super(context);
|
||||
DialogInfoBinding binding = DialogInfoBinding.inflate(LayoutInflater.from(context), null, false);
|
||||
|
||||
|
|
@ -52,7 +51,7 @@ public class StatusDialogBuilder extends BlurBehindDialogBuilder {
|
|||
binding.systemVersion.setText(String.format(Locale.US, "%1$s (API %2$d)", Build.VERSION.RELEASE, Build.VERSION.SDK_INT));
|
||||
}
|
||||
|
||||
binding.device.setText(getUIFramework());
|
||||
binding.device.setText(getDevice());
|
||||
binding.systemAbi.setText(Build.SUPPORTED_ABIS[0]);
|
||||
|
||||
if (ConfigManager.isPermissive()) {
|
||||
|
|
@ -73,33 +72,12 @@ public class StatusDialogBuilder extends BlurBehindDialogBuilder {
|
|||
context.getString(R.string.info_system_abi), binding.systemAbi.getText())));
|
||||
}
|
||||
|
||||
private String getUIFramework() {
|
||||
private String getDevice() {
|
||||
String manufacturer = Character.toUpperCase(Build.MANUFACTURER.charAt(0)) + Build.MANUFACTURER.substring(1);
|
||||
if (!Build.BRAND.equals(Build.MANUFACTURER)) {
|
||||
manufacturer += " " + Character.toUpperCase(Build.BRAND.charAt(0)) + Build.BRAND.substring(1);
|
||||
}
|
||||
manufacturer += " " + Build.MODEL + " ";
|
||||
if (new File("/system/framework/framework-miui-res.apk").exists() || new File("/system/app/miui/miui.apk").exists() || new File("/system/app/miuisystem/miuisystem.apk").exists()) {
|
||||
manufacturer += "(MIUI)";
|
||||
} else if (new File("/system/priv-app/oneplus-framework-res/oneplus-framework-res.apk").exists()) {
|
||||
manufacturer += "(Hydrogen/Oxygen OS)";
|
||||
} else if (new File("/system/framework/oppo-framework.jar").exists() || new File("/system/framework/oppo-framework-res.apk").exists() || new File("/system/framework/coloros-framework.jar").exists() || new File("/system/framework/coloros.services.jar").exists() || new File("/system/framework/oppo-services.jar").exists() || new File("/system/framework/coloros-support-wrapper.jar").exists()) {
|
||||
manufacturer += "(Color OS)";
|
||||
} else if (new File("/system/framework/hwEmui.jar").exists() || new File("/system/framework/hwcustEmui.jar").exists() || new File("/system/framework/hwframework.jar").exists() || new File("/system/framework/framework-res-hwext.apk").exists() || new File("/system/framework/hwServices.jar").exists() || new File("/system/framework/hwcustframework.jar").exists()) {
|
||||
manufacturer += "(EMUI)";
|
||||
} else if (new File("/system/framework/com.samsung.device.jar").exists() || new File("/system/framework/sec_platform_library.jar").exists()) {
|
||||
manufacturer += "(One UI)";
|
||||
} else if (new File("/system/priv-app/CarbonDelta/CarbonDelta.apk").exists()) {
|
||||
manufacturer += "(Carbon OS)";
|
||||
} else if (new File("/system/framework/flyme-framework.jar").exists() || new File("/system/framework/flyme-res").exists() || new File("/system/framework/flyme-telephony-common.jar").exists()) {
|
||||
manufacturer += "(Flyme)";
|
||||
} else if (new File("/system/framework/org.lineageos.platform-res.apk").exists() || new File("/system/framework/org.lineageos.platform.jar").exists()) {
|
||||
manufacturer += "(Lineage OS Based ROM)";
|
||||
} else if (new File("/system/framework/twframework.jar").exists() || new File("/system/framework/samsung-services.jar").exists()) {
|
||||
manufacturer += "(TouchWiz)";
|
||||
} else if (new File("/system/framework/core.jar.jex").exists()) {
|
||||
manufacturer += "(Aliyun OS)";
|
||||
}
|
||||
return manufacturer;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue