[app] Add old hook method to show version mismatched dialog (#160)
This commit is contained in:
parent
37b5e6a896
commit
a10e882a39
|
|
@ -23,8 +23,15 @@ package io.github.lsposed.manager;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
public class Constants {
|
public class Constants {
|
||||||
|
@SuppressWarnings("FieldMayBeFinal")
|
||||||
|
private static String xposedVersion = null;
|
||||||
|
|
||||||
public static void showErrorToast(int type) {
|
public static void showErrorToast(int type) {
|
||||||
Toast.makeText(App.getInstance(), R.string.app_destroyed, Toast.LENGTH_LONG).show();
|
Toast.makeText(App.getInstance(), R.string.app_destroyed, Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for showing the version mismatch dialog
|
||||||
|
public static String getXposedVersion() {
|
||||||
|
return xposedVersion;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ import androidx.appcompat.app.AlertDialog;
|
||||||
import io.github.lsposed.manager.App;
|
import io.github.lsposed.manager.App;
|
||||||
import io.github.lsposed.manager.BuildConfig;
|
import io.github.lsposed.manager.BuildConfig;
|
||||||
import io.github.lsposed.manager.ConfigManager;
|
import io.github.lsposed.manager.ConfigManager;
|
||||||
|
import io.github.lsposed.manager.Constants;
|
||||||
import io.github.lsposed.manager.R;
|
import io.github.lsposed.manager.R;
|
||||||
import io.github.lsposed.manager.util.NavUtil;
|
import io.github.lsposed.manager.util.NavUtil;
|
||||||
import io.github.lsposed.manager.util.theme.ThemeUtil;
|
import io.github.lsposed.manager.util.theme.ThemeUtil;
|
||||||
|
|
@ -54,6 +55,10 @@ public class BaseActivity extends MaterialActivity {
|
||||||
|
|
||||||
// make sure the versions are consistent
|
// make sure the versions are consistent
|
||||||
String coreVersionStr = ConfigManager.getXposedVersionName();
|
String coreVersionStr = ConfigManager.getXposedVersionName();
|
||||||
|
// for showing the version mismatch dialog
|
||||||
|
if (coreVersionStr == null) {
|
||||||
|
coreVersionStr = Constants.getXposedVersion();
|
||||||
|
}
|
||||||
if (coreVersionStr != null) {
|
if (coreVersionStr != null) {
|
||||||
if (!BuildConfig.VERSION_NAME.equals(coreVersionStr)) {
|
if (!BuildConfig.VERSION_NAME.equals(coreVersionStr)) {
|
||||||
new AlertDialog.Builder(this)
|
new AlertDialog.Builder(this)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue