mirror of
https://github.com/xoureldeen/Vectras-VM-Android.git
synced 2026-05-20 09:40:18 +00:00
commit
e96344d0d9
14 changed files with 265 additions and 200 deletions
7
.idea/deploymentTargetSelector.xml
generated
7
.idea/deploymentTargetSelector.xml
generated
|
|
@ -4,11 +4,14 @@
|
|||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2025-10-09T12:18:13.856673763Z">
|
||||
<DropdownSelection timestamp="2025-10-09T19:55:30.113124600Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="Default" identifier="serial=192.168.1.99:46165;connection=ef5048f0" />
|
||||
<DeviceId pluginId="FirebaseDirectAccess" identifier="reservation=projects/nguyenbaoanbui-9cba5/deviceSessions/session-2nrdccjx040yd" />
|
||||
</handle>
|
||||
<template>
|
||||
<DeviceId pluginId="FirebaseDirectAccess" type="TEMPLATE" identifier="model_id=b0q/33" />
|
||||
</template>
|
||||
</Target>
|
||||
</DropdownSelection>
|
||||
<DialogSelection />
|
||||
|
|
|
|||
3
.idea/misc.xml
generated
3
.idea/misc.xml
generated
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21" project-jdk-type="JavaSDK" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK" />
|
||||
</project>
|
||||
|
|
@ -10,8 +10,8 @@ android {
|
|||
applicationId "com.vectras.vm"
|
||||
minSdk minApi
|
||||
targetSdk targetApi
|
||||
versionCode 23
|
||||
versionName "3.2.0"
|
||||
versionCode 24
|
||||
versionName "3.2.1"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -981,7 +981,7 @@ public class MainActivity extends AppCompatActivity {
|
|||
}
|
||||
} else {
|
||||
StartVM.cdrompath = "";
|
||||
String env = StartVM.env(MainActivity.activity, AppConfig.pendingCommand, "", "1");
|
||||
String env = StartVM.env(MainActivity.activity, AppConfig.pendingCommand, "", true);
|
||||
MainActivity.startVM("Quick run", env, AppConfig.pendingCommand, "");
|
||||
VMManager.lastQemuCommand = AppConfig.pendingCommand;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ public class AdapterMainRoms extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
|||
Config.QMPPort = current.qmpPort;
|
||||
}
|
||||
Config.vmID = current.vmID;
|
||||
String env = StartVM.env(activity, current.itemExtra, current.itemPath, "");
|
||||
String env = StartVM.env(activity, current.itemExtra, current.itemPath, false);
|
||||
MainActivity.startVM(current.itemName, env, current.itemExtra, current.itemPath);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public class StartVM {
|
|||
|
||||
public static String cdrompath;
|
||||
|
||||
public static String env(Activity activity, String extras, String img, String cpu) {
|
||||
public static String env(Activity activity, String extras, String img, boolean isQuickRun) {
|
||||
|
||||
String filesDir = activity.getFilesDir().getAbsolutePath();
|
||||
|
||||
|
|
@ -29,213 +29,216 @@ public class StartVM {
|
|||
|
||||
ArrayList<String> params = new ArrayList<>(Arrays.asList(qemu));
|
||||
|
||||
if (cpu != null) {
|
||||
if (cpu.isEmpty()) {
|
||||
if (MainSettingsManager.getArch(activity).equals("I386"))
|
||||
params.add("qemu-system-i386");
|
||||
else if (MainSettingsManager.getArch(activity).equals("X86_64"))
|
||||
params.add("qemu-system-x86_64");
|
||||
else if (MainSettingsManager.getArch(activity).equals("ARM64"))
|
||||
params.add("qemu-system-aarch64");
|
||||
else if (MainSettingsManager.getArch(activity).equals("PPC"))
|
||||
params.add("qemu-system-ppc");
|
||||
if (!isQuickRun) {
|
||||
if (MainSettingsManager.getArch(activity).equals("I386"))
|
||||
params.add("qemu-system-i386");
|
||||
else if (MainSettingsManager.getArch(activity).equals("X86_64"))
|
||||
params.add("qemu-system-x86_64");
|
||||
else if (MainSettingsManager.getArch(activity).equals("ARM64"))
|
||||
params.add("qemu-system-aarch64");
|
||||
else if (MainSettingsManager.getArch(activity).equals("PPC"))
|
||||
params.add("qemu-system-ppc");
|
||||
|
||||
params.add("-qmp");
|
||||
params.add("unix:" + Config.getLocalQMPSocketPath() + ",server,nowait");
|
||||
params.add("-qmp");
|
||||
params.add("unix:" + Config.getLocalQMPSocketPath() + ",server,nowait");
|
||||
|
||||
String ifType;
|
||||
ifType= MainSettingsManager.getIfType(activity);
|
||||
String ifType;
|
||||
ifType= MainSettingsManager.getIfType(activity);
|
||||
|
||||
String cdrom = "";
|
||||
String hdd0;
|
||||
String hdd1;
|
||||
String cdrom = "";
|
||||
String hdd0;
|
||||
String hdd1;
|
||||
|
||||
if (!img.isEmpty()) {
|
||||
if (ifType.isEmpty()) {
|
||||
hdd0 = "-hda";
|
||||
hdd0 += " '" + img + "'";
|
||||
} else {
|
||||
if (!img.isEmpty()) {
|
||||
if (ifType.isEmpty()) {
|
||||
hdd0 = "-hda";
|
||||
hdd0 += " '" + img + "'";
|
||||
} else {
|
||||
hdd0 = "-drive";
|
||||
hdd0 += " index=0";
|
||||
hdd0 += ",media=disk";
|
||||
hdd0 += ",if=" + ifType;
|
||||
hdd0 += ",file='" + img + "'";
|
||||
|
||||
if ((MainSettingsManager.getArch(activity).equals("ARM64") && ifType.equals("ide")) || MainSettingsManager.getArch(activity).equals("PPC")) {
|
||||
hdd0 = "-drive";
|
||||
hdd0 += " index=0";
|
||||
hdd0 += ",media=disk";
|
||||
hdd0 += ",if=" + ifType;
|
||||
hdd0 += ",file='" + img + "'";
|
||||
|
||||
if ((MainSettingsManager.getArch(activity).equals("ARM64") && ifType.equals("ide")) || MainSettingsManager.getArch(activity).equals("PPC")) {
|
||||
hdd0 = "-drive";
|
||||
hdd0 += " index=0";
|
||||
hdd0 += ",media=disk";
|
||||
hdd0 += ",file='" + img + "'";
|
||||
}
|
||||
}
|
||||
params.add(hdd0);
|
||||
}
|
||||
params.add(hdd0);
|
||||
}
|
||||
|
||||
if (cdrompath.isEmpty()) {
|
||||
File cdromFile = new File(filesDir + "/data/Vectras/drive.iso");
|
||||
if (cdrompath.isEmpty()) {
|
||||
File cdromFile = new File(filesDir + "/data/Vectras/drive.iso");
|
||||
|
||||
if (cdromFile.exists()) {
|
||||
if (MainSettingsManager.getArch(activity).equals("ARM64")) {
|
||||
cdrom = " -drive";
|
||||
cdrom += " if=none,id=cdrom,format=raw,media=cdrom,file='" + cdromFile.getPath() + "'";
|
||||
cdrom += "-device";
|
||||
cdrom += " usb-storage,drive=cdrom";
|
||||
if (!extras.contains("-device nec-usb-xhci")) {
|
||||
cdrom += " -device";
|
||||
cdrom += " qemu-xhci";
|
||||
cdrom += " -device";
|
||||
cdrom += " nec-usb-xhci";
|
||||
}
|
||||
} else {
|
||||
if (ifType.isEmpty()) {
|
||||
cdrom = "-cdrom";
|
||||
cdrom += " '" + cdromFile.getPath() + "'";
|
||||
} else {
|
||||
cdrom = "-drive";
|
||||
cdrom += " index=1";
|
||||
cdrom += ",media=cdrom";
|
||||
cdrom += ",file='" + cdromFile.getPath() + "'";
|
||||
}
|
||||
}
|
||||
|
||||
params.add(cdrom);
|
||||
}
|
||||
} else {
|
||||
if (cdromFile.exists()) {
|
||||
if (MainSettingsManager.getArch(activity).equals("ARM64")) {
|
||||
cdrom += " -device";
|
||||
cdrom += " nec-usb-xhci,id=defaultxhci";
|
||||
cdrom += " -device";
|
||||
cdrom += " usb-storage,bus=defaultxhci.0,drive=cdrom";
|
||||
cdrom += " -drive";
|
||||
cdrom += " if=none,id=cdrom,format=raw,media=cdrom,file='" + cdrompath + "'";
|
||||
cdrom = " -drive";
|
||||
cdrom += " if=none,id=cdrom,format=raw,media=cdrom,file='" + cdromFile.getPath() + "'";
|
||||
cdrom += "-device";
|
||||
cdrom += " usb-storage,drive=cdrom";
|
||||
if (!extras.contains("-device nec-usb-xhci")) {
|
||||
cdrom += " -device";
|
||||
cdrom += " qemu-xhci";
|
||||
cdrom += " -device";
|
||||
cdrom += " nec-usb-xhci";
|
||||
}
|
||||
} else {
|
||||
if (ifType.isEmpty()) {
|
||||
cdrom = "-cdrom";
|
||||
cdrom += " '" + cdrompath + "'";
|
||||
cdrom += " '" + cdromFile.getPath() + "'";
|
||||
} else {
|
||||
cdrom = "-drive";
|
||||
cdrom += " index=1";
|
||||
cdrom += ",media=cdrom";
|
||||
cdrom += ",file='" + cdrompath + "'";
|
||||
cdrom += ",file='" + cdromFile.getPath() + "'";
|
||||
}
|
||||
}
|
||||
|
||||
params.add(cdrom);
|
||||
}
|
||||
|
||||
File hdd1File = new File(filesDir + "/data/Vectras/hdd1.qcow2");
|
||||
|
||||
if (hdd1File.exists()) {
|
||||
if (ifType.isEmpty()) {
|
||||
hdd1 = "-hdb";
|
||||
hdd1 += " '" + hdd1File.getPath() + "'";
|
||||
} else {
|
||||
hdd1 = "-drive";
|
||||
hdd1 += " index=2";
|
||||
hdd1 += ",media=disk";
|
||||
hdd1 += ",if=" + ifType;
|
||||
hdd1 += ",file='" + hdd1File.getPath() + "'";
|
||||
}
|
||||
|
||||
params.add(hdd1);
|
||||
}
|
||||
|
||||
if (MainSettingsManager.getSharedFolder(activity) && !MainSettingsManager.getArch(activity).equals("I386")) {
|
||||
String driveParams = "-drive ";
|
||||
if (ifType.isEmpty()) {
|
||||
driveParams += "media=disk,file=fat:";
|
||||
} else {
|
||||
driveParams += "index=3,media=disk,file=fat:";
|
||||
}
|
||||
driveParams += "rw:"; //Disk Drives are always Read/Write
|
||||
driveParams += FileUtils.getExternalFilesDirectory(activity).getPath() + "/SharedFolder,format=raw";
|
||||
params.add(driveParams);
|
||||
}
|
||||
|
||||
String memoryStr = "-m ";
|
||||
if (MainSettingsManager.getArch(activity).equals("PPC") && RamInfo.vectrasMemory(activity) > 2048) {
|
||||
memoryStr += 2048;
|
||||
} else {
|
||||
if (MainSettingsManager.getArch(activity).equals("ARM64")) {
|
||||
cdrom += " -device";
|
||||
cdrom += " nec-usb-xhci,id=defaultxhci";
|
||||
cdrom += " -device";
|
||||
cdrom += " usb-storage,bus=defaultxhci.0,drive=cdrom";
|
||||
cdrom += " -drive";
|
||||
cdrom += " if=none,id=cdrom,format=raw,media=cdrom,file='" + cdrompath + "'";
|
||||
} else {
|
||||
memoryStr += RamInfo.vectrasMemory(activity);
|
||||
}
|
||||
|
||||
String boot = "-boot ";
|
||||
if (extras.contains(".iso ")) {
|
||||
|
||||
boot += MainSettingsManager.getBoot(activity);
|
||||
} else {
|
||||
boot += "c";
|
||||
}
|
||||
|
||||
//String soundDevice = "-audiodev pa,id=pa -device AC97,audiodev=pa";
|
||||
|
||||
//params.add(soundDevice);
|
||||
|
||||
if (MainSettingsManager.useDefaultBios(activity)) {
|
||||
if (MainSettingsManager.getArch(activity).equals("PPC")) {
|
||||
bios = "-L ";
|
||||
bios += "pc-bios";
|
||||
} else if (MainSettingsManager.getArch(activity).equals("ARM64")) {
|
||||
bios = "-drive ";
|
||||
bios += "file=" + AppConfig.basefiledir + "QEMU_EFI.img,format=raw,readonly=on,if=pflash";
|
||||
bios += " -drive ";
|
||||
bios += "file=" + AppConfig.basefiledir + "QEMU_VARS.img,format=raw,if=pflash";
|
||||
} else if (MainSettingsManager.getArch(activity).equals("X86_64") && MainSettingsManager.getuseUEFI(activity)) {
|
||||
bios = "-drive ";
|
||||
bios += "file=" + AppConfig.basefiledir + "RELEASEX64_OVMF.fd,format=raw,readonly=on,if=pflash";
|
||||
bios += " -drive ";
|
||||
bios += "file=" + AppConfig.basefiledir + "RELEASEX64_OVMF_VARS.fd,format=raw,if=pflash";
|
||||
if (ifType.isEmpty()) {
|
||||
cdrom = "-cdrom";
|
||||
cdrom += " '" + cdrompath + "'";
|
||||
} else {
|
||||
bios = "-bios ";
|
||||
bios += AppConfig.basefiledir + "bios-vectras.bin";
|
||||
cdrom = "-drive";
|
||||
cdrom += " index=1";
|
||||
cdrom += ",media=cdrom";
|
||||
cdrom += ",file='" + cdrompath + "'";
|
||||
}
|
||||
}
|
||||
params.add(cdrom);
|
||||
}
|
||||
|
||||
String machine = "-M ";
|
||||
if (Objects.equals(MainSettingsManager.getArch(activity), "X86_64")) {
|
||||
machine += "pc";
|
||||
params.add(machine);
|
||||
} else if (Objects.equals(MainSettingsManager.getArch(activity), "ARM64")) {
|
||||
machine += "virt";
|
||||
params.add(machine);
|
||||
}
|
||||
|
||||
if (MainSettingsManager.useMemoryOvercommit(activity)) {
|
||||
params.add("-overcommit");
|
||||
params.add("mem-lock=off");
|
||||
}
|
||||
|
||||
|
||||
if (MainSettingsManager.useLocalTime(activity)) {
|
||||
params.add("-rtc");
|
||||
params.add("base=localtime");
|
||||
}
|
||||
|
||||
//if (!MainSettingsManager.getArch(activity).equals("PPC")) {
|
||||
//params.add("-nodefaults");
|
||||
//}
|
||||
|
||||
//if (!Objects.equals(MainSettingsManager.getArch(activity), "ARM64")) {
|
||||
params.add(bios);
|
||||
//}
|
||||
|
||||
params.add(boot);
|
||||
|
||||
params.add(memoryStr);
|
||||
File hdd1File = new File(filesDir + "/data/Vectras/hdd1.qcow2");
|
||||
|
||||
if (hdd1File.exists()) {
|
||||
if (ifType.isEmpty()) {
|
||||
if (extras.contains("-drive index=1,media=cdrom,file=")) {
|
||||
finalextra = extras.replace("-drive index=1,media=cdrom,file=", "-cdrom ");
|
||||
}
|
||||
hdd1 = "-hdb";
|
||||
hdd1 += " '" + hdd1File.getPath() + "'";
|
||||
} else {
|
||||
if (extras.contains("-cdrom ")) {
|
||||
finalextra = extras.replace("-cdrom ", "-drive index=1,media=cdrom,file=");
|
||||
}
|
||||
hdd1 = "-drive";
|
||||
hdd1 += " index=2";
|
||||
hdd1 += ",media=disk";
|
||||
hdd1 += ",if=" + ifType;
|
||||
hdd1 += ",file='" + hdd1File.getPath() + "'";
|
||||
}
|
||||
|
||||
params.add(hdd1);
|
||||
}
|
||||
|
||||
if (MainSettingsManager.getSharedFolder(activity) && !MainSettingsManager.getArch(activity).equals("I386")) {
|
||||
String driveParams = "-drive ";
|
||||
if (ifType.isEmpty()) {
|
||||
driveParams += "media=disk,file=fat:";
|
||||
} else {
|
||||
driveParams += "index=3,media=disk,file=fat:";
|
||||
}
|
||||
driveParams += "rw:"; //Disk Drives are always Read/Write
|
||||
driveParams += FileUtils.getExternalFilesDirectory(activity).getPath() + "/SharedFolder,format=raw";
|
||||
params.add(driveParams);
|
||||
}
|
||||
|
||||
String memoryStr = "-m ";
|
||||
if (MainSettingsManager.getArch(activity).equals("PPC") && RamInfo.vectrasMemory(activity) > 2048) {
|
||||
memoryStr += 2048;
|
||||
} else {
|
||||
memoryStr += RamInfo.vectrasMemory(activity);
|
||||
}
|
||||
|
||||
String boot = "-boot ";
|
||||
if (extras.contains(".iso ")) {
|
||||
|
||||
boot += MainSettingsManager.getBoot(activity);
|
||||
} else {
|
||||
boot += "c";
|
||||
}
|
||||
|
||||
//String soundDevice = "-audiodev pa,id=pa -device AC97,audiodev=pa";
|
||||
|
||||
//params.add(soundDevice);
|
||||
|
||||
if (MainSettingsManager.useDefaultBios(activity)) {
|
||||
if (MainSettingsManager.getArch(activity).equals("PPC")) {
|
||||
bios = "-L ";
|
||||
bios += "pc-bios";
|
||||
} else if (MainSettingsManager.getArch(activity).equals("ARM64")) {
|
||||
bios = "-drive ";
|
||||
bios += "file=" + AppConfig.basefiledir + "QEMU_EFI.img,format=raw,readonly=on,if=pflash";
|
||||
bios += " -drive ";
|
||||
bios += "file=" + AppConfig.basefiledir + "QEMU_VARS.img,format=raw,if=pflash";
|
||||
} else if (MainSettingsManager.getArch(activity).equals("X86_64") && MainSettingsManager.getuseUEFI(activity)) {
|
||||
bios = "-drive ";
|
||||
bios += "file=" + AppConfig.basefiledir + "RELEASEX64_OVMF.fd,format=raw,readonly=on,if=pflash";
|
||||
bios += " -drive ";
|
||||
bios += "file=" + AppConfig.basefiledir + "RELEASEX64_OVMF_VARS.fd,format=raw,if=pflash";
|
||||
} else {
|
||||
bios = "-bios ";
|
||||
bios += AppConfig.basefiledir + "bios-vectras.bin";
|
||||
}
|
||||
}
|
||||
|
||||
String machine = "-M ";
|
||||
if (Objects.equals(MainSettingsManager.getArch(activity), "X86_64")) {
|
||||
machine += "pc";
|
||||
params.add(machine);
|
||||
} else if (Objects.equals(MainSettingsManager.getArch(activity), "ARM64")) {
|
||||
machine += "virt";
|
||||
params.add(machine);
|
||||
}
|
||||
|
||||
if (MainSettingsManager.useMemoryOvercommit(activity)) {
|
||||
params.add("-overcommit");
|
||||
params.add("mem-lock=off");
|
||||
}
|
||||
|
||||
|
||||
if (MainSettingsManager.useLocalTime(activity)) {
|
||||
params.add("-rtc");
|
||||
params.add("base=localtime");
|
||||
}
|
||||
|
||||
//if (!MainSettingsManager.getArch(activity).equals("PPC")) {
|
||||
//params.add("-nodefaults");
|
||||
//}
|
||||
|
||||
//if (!Objects.equals(MainSettingsManager.getArch(activity), "ARM64")) {
|
||||
params.add(bios);
|
||||
//}
|
||||
|
||||
params.add(boot);
|
||||
|
||||
params.add(memoryStr);
|
||||
|
||||
if (ifType.isEmpty()) {
|
||||
if (extras.contains("-drive index=1,media=cdrom,file=")) {
|
||||
finalextra = extras.replace("-drive index=1,media=cdrom,file=", "-cdrom ");
|
||||
}
|
||||
} else {
|
||||
if (extras.contains("-cdrom ")) {
|
||||
finalextra = extras.replace("-cdrom ", "-drive index=1,media=cdrom,file=");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
params.add(finalextra);
|
||||
|
||||
if (isQuickRun) {
|
||||
params.add("-qmp");
|
||||
params.add("unix:" + Config.getLocalQMPSocketPath() + ",server,nowait");
|
||||
}
|
||||
|
||||
if (MainSettingsManager.getVmUi(activity).equals("VNC")) {
|
||||
|
||||
if (!MainSettingsManager.getVncExternalPassword(activity).isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ public class HomeStartVM {
|
|||
public static final String TAG = "HomeStartVM";
|
||||
public static AlertDialog progressDialog;
|
||||
public static boolean skipIDEwithARM64DialogInStartVM = false;
|
||||
public static boolean isStopNow = false;
|
||||
public static final Handler handlerForLaunch = new Handler(Looper.getMainLooper());
|
||||
public static Runnable tickForLaunch = null;
|
||||
|
||||
|
|
@ -48,7 +49,18 @@ public class HomeStartVM {
|
|||
String vmID,
|
||||
String thumbnailFile
|
||||
) {
|
||||
File romDir = new File(Config.getCacheDir() + "/" + vmID);
|
||||
isStopNow = false;
|
||||
|
||||
String finalvmID;
|
||||
if (vmID == null || vmID.isEmpty()) {
|
||||
finalvmID = VMManager.startRamdomVMID();
|
||||
} else {
|
||||
finalvmID = vmID;
|
||||
}
|
||||
|
||||
Config.vmID = finalvmID;
|
||||
|
||||
File romDir = new File(Config.getCacheDir() + "/" + finalvmID);
|
||||
if (!romDir.exists()) {
|
||||
if (!romDir.mkdirs()) {
|
||||
DialogUtils.oneDialog(activity, activity.getString(R.string.problem_has_been_detected), activity.getString(R.string.vm_cache_dir_failed_to_create_content), activity.getString(R.string.ok), true, R.drawable.warning_48px, true, null, null);
|
||||
|
|
@ -82,7 +94,7 @@ public class HomeStartVM {
|
|||
|
||||
VMManager.lastQemuCommand = env;
|
||||
|
||||
if (VMManager.isVMRunning(activity, vmID)) {
|
||||
if (VMManager.isVMRunning(activity, finalvmID)) {
|
||||
Toast.makeText(activity, "This VM is already running.", Toast.LENGTH_LONG).show();
|
||||
if (MainSettingsManager.getVmUi(activity).equals("VNC"))
|
||||
activity.startActivity(new Intent(activity, MainVNCActivity.class));
|
||||
|
|
@ -94,7 +106,7 @@ public class HomeStartVM {
|
|||
if (AppConfig.getSetupFiles().contains("arm") && !AppConfig.getSetupFiles().contains("arm64")) {
|
||||
if (env.contains("tcg,thread=multi")) {
|
||||
DialogUtils.twoDialog(activity, activity.getResources().getString(R.string.problem_has_been_detected), activity.getResources().getString(R.string.can_not_use_mttcg), activity.getString(R.string.ok), activity.getString(R.string.cancel), true, R.drawable.warning_48px, true,
|
||||
() -> startNow(activity, vmName, env.replace("tcg,thread=multi", "tcg,thread=single"), vmID, thumbnailFile), null, null);
|
||||
() -> startNow(activity, vmName, env.replace("tcg,thread=multi", "tcg,thread=single"), finalvmID, thumbnailFile), null, null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -103,7 +115,7 @@ public class HomeStartVM {
|
|||
DialogUtils.twoDialog(activity, activity.getString(R.string.problem_has_been_detected), activity.getString(R.string.you_cannot_use_IDE_hard_drive_type_with_ARM64), activity.getString(R.string.continuetext), activity.getString(R.string.cancel), true, R.drawable.warning_48px, true,
|
||||
() -> {
|
||||
skipIDEwithARM64DialogInStartVM = true;
|
||||
startNow(activity, vmName, env, vmID, thumbnailFile);
|
||||
startNow(activity, vmName, env, finalvmID, thumbnailFile);
|
||||
}, null, null);
|
||||
return;
|
||||
} else if (skipIDEwithARM64DialogInStartVM) {
|
||||
|
|
@ -148,16 +160,15 @@ public class HomeStartVM {
|
|||
tickForLaunch = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (VMManager.isQemuStopedWithError || FileUtils.isFileExists(Config.getLocalQMPSocketPath())) {
|
||||
if (isStopNow || VMManager.isQemuStopedWithError || FileUtils.isFileExists(Config.getLocalQMPSocketPath())) {
|
||||
handlerForLaunch.removeCallbacks(this);
|
||||
|
||||
progressDialog.dismiss();
|
||||
|
||||
//If Qemu doesn't crash and finish then launch.
|
||||
if (!VMManager.isQemuStopedWithError) {
|
||||
if (!isStopNow && !VMManager.isQemuStopedWithError) {
|
||||
if (MainSettingsManager.getVmUi(activity).equals("VNC")) {
|
||||
if (MainSettingsManager.getVncExternal(activity)) {
|
||||
Config.currentVNCServervmID = vmID;
|
||||
Config.currentVNCServervmID = finalvmID;
|
||||
DialogUtils.oneDialog(activity, activity.getString(R.string.vnc_server), activity.getString(R.string.running_vm_with_vnc_server_content) + " " + (Integer.parseInt(MainSettingsManager.getVncExternalDisplay(activity)) + 5900) + ".", activity.getString(R.string.ok), true, R.drawable.cast_24px, true, null, null);
|
||||
} else {
|
||||
MainVNCActivity.started = true;
|
||||
|
|
@ -200,7 +211,7 @@ public class HomeStartVM {
|
|||
if (thumbnailFile != null) {
|
||||
ImageView ivThumbnail = progressView.findViewById(R.id.iv_thumbnail);
|
||||
|
||||
if (thumbnailFile.isEmpty()){
|
||||
if (thumbnailFile.isEmpty()) {
|
||||
VMManager.setIconWithName(ivThumbnail, _content);
|
||||
} else {
|
||||
if (FileUtils.isFileExists(thumbnailFile)) {
|
||||
|
|
@ -215,6 +226,12 @@ public class HomeStartVM {
|
|||
}
|
||||
}
|
||||
|
||||
ImageView ivStop = progressView.findViewById(R.id.ivStop);
|
||||
ivStop.setOnClickListener(v -> {
|
||||
isStopNow = true;
|
||||
VMManager.shutdownCurrentVM();
|
||||
});
|
||||
|
||||
progressDialog = new MaterialAlertDialogBuilder(activity, R.style.CenteredDialogTheme)
|
||||
.setView(progressView)
|
||||
.setCancelable(false)
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ public class PendingCommand {
|
|||
}
|
||||
} else {
|
||||
com.vectras.vm.StartVM.cdrompath = "";
|
||||
String env = StartVM.env(activity, AppConfig.pendingCommand, "", "1");
|
||||
Config.vmID = VMManager.idGenerator();
|
||||
String env = StartVM.env(activity, AppConfig.pendingCommand, "", true);
|
||||
HomeStartVM.startNow(activity, "Quick run", env, Config.vmID, null);
|
||||
VMManager.lastQemuCommand = AppConfig.pendingCommand;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public class VmsHomeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
Config.QMPPort = current.qmpPort;
|
||||
}
|
||||
Config.vmID = current.vmID;
|
||||
String env = StartVM.env(activity, current.itemExtra, current.itemPath, "");
|
||||
String env = StartVM.env(activity, current.itemExtra, current.itemPath, false);
|
||||
HomeStartVM.startNow(activity, current.itemName, env, current.vmID, current.itemIcon);
|
||||
});
|
||||
|
||||
|
|
|
|||
10
app/src/main/res/drawable/stop_24px.xml
Normal file
10
app/src/main/res/drawable/stop_24px.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M320,320L320,320L320,640L320,640L320,320ZM240,720L240,240L720,240L720,720L240,720ZM320,640L640,640L640,320L320,320L320,640Z"/>
|
||||
</vector>
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
|
|
@ -10,7 +11,7 @@
|
|||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/ic_computer_180dp_with_padding"/>
|
||||
android:src="@drawable/ic_computer_180dp_with_padding" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
@ -32,10 +33,26 @@
|
|||
android:paddingVertical="8dp"
|
||||
android:text="@string/booting_up" />
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:indeterminate="true" />
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:indeterminate="true" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivStop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/stop_24px"
|
||||
app:tint="@color/red_error"
|
||||
android:background="?attr/selectableItemBackgroundBorderless" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<string name="app_name">Vectras VM</string>
|
||||
|
||||
<!--======================VECTRAS STRINGS====================-->
|
||||
<string name="app_version" translatable="false">3.2.0</string>
|
||||
<string name="app_version" translatable="false">3.2.1</string>
|
||||
<string name="qemu_version" translatable="false">Stable</string>
|
||||
<string name="str_home">Home</string>
|
||||
<string name="str_logger">Logger</string>
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
"url": "https://github.com/xoureldeen/Vectras-VM-Android/releases/v2.9.5",
|
||||
"Message": "<h2>v2.9.5-3dfx</h2><ul><li>Bring back 3dfx support.</li><li>Enhance app execution.</li><li>Added some linux programs in x11 display.</li><li>Added alpine linux (x11).</li><li>Russian language by <a href=\"https://github.com/OFGING\" target=\"_blank\">@OFGING</a></li></ul><br><br>New updates are live!",
|
||||
"cancellable": true,
|
||||
"versionCodeBeta":"23",
|
||||
"versionNameBeta":"3.2.0",
|
||||
"versionNameBetas":"v2.9.5.1-3dfx,v2.9.5.2-3dfx,v2.9.5.3-3dfx,v2.9.5.4-3dfx,v2.9.5.5-3dfx,v2.9.5.6-3dfx,v2.9.5.7-3dfx,v2.9.5.8-3dfx,v2.9.5.9-3dfx,v2.9.5.10-3dfx,v2.9.5.11-3dfx,v2.9.5.12-3dfx,v2.9.5.13-3dfx,3.0.0,3.1.0",
|
||||
"versionCodeBeta":"24",
|
||||
"versionNameBeta":"3.2.1",
|
||||
"versionNameBetas":"v2.9.5.1-3dfx,v2.9.5.2-3dfx,v2.9.5.3-3dfx,v2.9.5.4-3dfx,v2.9.5.5-3dfx,v2.9.5.6-3dfx,v2.9.5.7-3dfx,v2.9.5.8-3dfx,v2.9.5.9-3dfx,v2.9.5.10-3dfx,v2.9.5.11-3dfx,v2.9.5.12-3dfx,v2.9.5.13-3dfx,3.0.0,3.1.0,3.2.1",
|
||||
"sizeBeta": "50 MB",
|
||||
"urlBeta": "https://github.com/AnBui2004/Vectras-VM-Emu-Android/releases",
|
||||
"MessageBeta": "<h2>3.2.0</h2>Bugs fixed.",
|
||||
"MessageBeta": "<h2>3.2.1</h2>Bugs fixed.",
|
||||
"cancellableBeta": true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -655,6 +655,22 @@
|
|||
"creator": "Nguyen Bao An Bui",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"rom_name":"Windows 11 25H2",
|
||||
"rom_icon":"https://www.getmyos.com/app_public/files/t/1/2021/06/windows_11_logo_by_getmyos.png",
|
||||
"rom_url":"https://youtu.be/FWE9SIYbB5A",
|
||||
"rom_path":"Windows 11 25H2.cvbi",
|
||||
"rom_avail":true,
|
||||
"rom_size":"2025 Update",
|
||||
"rom_arch":"X86_64",
|
||||
"rom_kernel":"windows",
|
||||
"rom_extra":"",
|
||||
"final_rom_file_name":"",
|
||||
"desc":"This Rom is from Nguyen Bao An Bui. You can get it on An Bui app: https://play.google.com/store/apps/details?id=com.anbui.app\n\nWindows 11 is the latest major release of Microsoft's Windows NT operating system, released on October 5, 2021 as the successor to Windows 10 (2015). It is provided free for any Windows 10 devices that meet the new Windows 11 system requirements. A server version, Windows Server 2025, was released in 2024. Windows 11 is the first major version of Windows NT without a companion mobile version following the discontinuations of Windows Phone with Windows 10 Mobile.",
|
||||
"file_size": "15 GB",
|
||||
"creator": "Nguyen Bao An Bui",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"rom_name":"ReactOS",
|
||||
"rom_icon":"https://www.linuxinsider.com/wp-content/uploads/sites/2/2021/05/2016-react-os-1.jpg",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue