This commit is contained in:
An Bui 2024-10-31 22:54:40 +07:00
parent 4473dec0f0
commit 54e34dbc20
15 changed files with 257 additions and 116 deletions

View file

@ -131,6 +131,7 @@ public class MainActivity extends AppCompatActivity {
private AlertDialog alertDialog;
private boolean doneonstart = false;
public static boolean isActivate = false;
public boolean skipIDEwithARM64DialogInStartVM = false;
@Override
protected void onCreate(Bundle bundle) {
@ -756,7 +757,7 @@ public class MainActivity extends AppCompatActivity {
int versionCode = pinfo.versionCode;
String versionName = pinfo.versionName;
if (versionCode < obj.getInt("versionCode") || !versionName.equals(obj.getString("versionName"))) {
if (versionCode < obj.getInt("versionCode") || !obj.getString("versionName").contains(versionName)) {
AlertDialog.Builder alert = new AlertDialog.Builder(activity, R.style.MainDialogTheme);
alert.setTitle("Install the latest version")
.setMessage(Html.fromHtml(obj.getString("Message") + "<br><br>update size:<br>" + obj.getString("size")))
@ -951,6 +952,27 @@ public class MainActivity extends AppCompatActivity {
}
}
if (MainSettingsManager.getArch(activity).equals("ARM64") && MainSettingsManager.getIfType(activity).equals("ide") && !activity.skipIDEwithARM64DialogInStartVM) {
AlertDialog abiAlertDialog = new AlertDialog.Builder(activity, R.style.MainDialogTheme).create();
abiAlertDialog.setTitle(activity.getResources().getString(R.string.problem_has_been_detected));
abiAlertDialog.setMessage(activity.getResources().getString(R.string.you_cannot_use_IDE_hard_drive_type_with_ARM64));
abiAlertDialog.setButton(DialogInterface.BUTTON_POSITIVE, activity.getResources().getString(R.string.continuetext), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
activity.skipIDEwithARM64DialogInStartVM = true;
startVM(vmName, env, itemExtra, itemPath);
}
});
abiAlertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, activity.getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
abiAlertDialog.show();
return;
} else if (activity.skipIDEwithARM64DialogInStartVM) {
activity.skipIDEwithARM64DialogInStartVM = false;
}
boolean isRunning = isMyServiceRunning(MainService.class);
ProgressDialog progressDialog = new ProgressDialog(activity, R.style.MainDialogTheme);