mirror of
https://github.com/xoureldeen/Vectras-VM-Android.git
synced 2026-05-15 18:40:28 +00:00
commit
b24c6d577e
12 changed files with 143 additions and 72 deletions
|
|
@ -15,8 +15,8 @@ android {
|
|||
applicationId "com.vectras.vm"
|
||||
minSdk minApi
|
||||
targetSdk targetApi
|
||||
versionCode 67
|
||||
versionName "3.6.3"
|
||||
versionCode 68
|
||||
versionName "3.6.4"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled true
|
||||
|
||||
|
|
|
|||
|
|
@ -137,8 +137,8 @@ abstract class AbstractBitmapData {
|
|||
drawable = createDrawable();
|
||||
|
||||
if (drawable != null) {
|
||||
if (Build.VERSION.SDK_INT >= 35) {
|
||||
drawable.setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
|
||||
if (Build.VERSION.SDK_INT >= 34) {
|
||||
v.setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
|
||||
}
|
||||
v.setImageDrawable(drawable);
|
||||
v.invalidate();
|
||||
|
|
|
|||
|
|
@ -1350,7 +1350,10 @@ public class MainVNCActivity extends VncCanvasActivity {
|
|||
sendCtrlAtlDelKey();
|
||||
} else {
|
||||
Boolean useKeyEvent = (Boolean) _data.get(_position).get("useKeyEvent");
|
||||
if (useKeyEvent != null && useKeyEvent) {
|
||||
Boolean sendWithQMP = (Boolean) _data.get(_position).get("useQMP");
|
||||
if (sendWithQMP != null && sendWithQMP) {
|
||||
VMManager.pressAKey(Objects.requireNonNull(_data.get(_position).get("keycode")).toString());
|
||||
} else if (useKeyEvent != null && useKeyEvent) {
|
||||
dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, Integer.parseInt(Objects.requireNonNull(_data.get(_position).get("keycode")).toString())));
|
||||
dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, Integer.parseInt(Objects.requireNonNull(_data.get(_position).get("keycode")).toString())));
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -564,8 +564,9 @@ public class VMCreatorActivity extends AppCompatActivity {
|
|||
FileUtils.writeToFile(AppConfig.maindirpath, "roms-data.json", "[]");
|
||||
}
|
||||
|
||||
boolean isSaveCompleted;
|
||||
if (modify) {
|
||||
VMManager.editVM(Objects.requireNonNull(binding.title.getText()).toString(),
|
||||
isSaveCompleted = VMManager.editVM(Objects.requireNonNull(binding.title.getText()).toString(),
|
||||
thumbnailPath,
|
||||
Objects.requireNonNull(binding.drive.getText()).toString(),
|
||||
MainSettingsManager.getArch(this),
|
||||
|
|
@ -573,7 +574,7 @@ public class VMCreatorActivity extends AppCompatActivity {
|
|||
Objects.requireNonNull(binding.qemu.getText()).toString(),
|
||||
getIntent().getIntExtra("POS", 0));
|
||||
} else {
|
||||
VMManager.createNewVM(Objects.requireNonNull(binding.title.getText()).toString(),
|
||||
isSaveCompleted = VMManager.createNewVM(Objects.requireNonNull(binding.title.getText()).toString(),
|
||||
thumbnailPath,
|
||||
Objects.requireNonNull(binding.drive.getText()).toString(),
|
||||
MainSettingsManager.getArch(this),
|
||||
|
|
@ -581,6 +582,15 @@ public class VMCreatorActivity extends AppCompatActivity {
|
|||
Objects.requireNonNull(binding.qemu.getText()).toString(), vmID, port);
|
||||
}
|
||||
|
||||
if (!isSaveCompleted) {
|
||||
DialogUtils.oneDialog(
|
||||
this,
|
||||
getString(R.string.oops),
|
||||
getString(R.string.unable_to_save_please_try_again_later),
|
||||
R.drawable.error_96px);
|
||||
return;
|
||||
}
|
||||
|
||||
created = true;
|
||||
|
||||
if (getIntent().hasExtra("addromnow")) {
|
||||
|
|
@ -809,6 +819,8 @@ public class VMCreatorActivity extends AppCompatActivity {
|
|||
|
||||
progressDialog.show();
|
||||
|
||||
Log.i(TAG, "importRom: Extracting from " + filePath + " to " + AppConfig.vmFolder + vmID);
|
||||
|
||||
new Thread(() -> {
|
||||
boolean result = isUseUri ? ZipUtils.extract(
|
||||
this,
|
||||
|
|
|
|||
|
|
@ -106,9 +106,25 @@ public class VMManager {
|
|||
}
|
||||
|
||||
vmList.add(0, vmConfigMap);
|
||||
writeToVMList(new Gson().toJson(vmList));
|
||||
writeToVMConfig(Objects.requireNonNull(vmConfigMap.get("vmID")).toString(), new Gson().toJson(vmConfigMap));
|
||||
return true;
|
||||
return writeToVMList(new Gson().toJson(vmList)) &&
|
||||
writeToVMConfig(Objects.requireNonNull(vmConfigMap.get("vmID")).toString(), new Gson().toJson(vmConfigMap));
|
||||
}
|
||||
|
||||
public static boolean addToVMList(HashMap<String, Object> vmConfigMap, String vmID) {
|
||||
String vmListJson = FileUtils.readAFile(AppConfig.romsdatajson);
|
||||
if (!JSONUtils.isValidFromString(vmListJson)) return false;
|
||||
|
||||
ArrayList<HashMap<String, Object>> vmList = new Gson().fromJson(vmListJson, new TypeToken<ArrayList<HashMap<String, Object>>>() {
|
||||
}.getType());
|
||||
|
||||
if (!vmID.isEmpty()) {
|
||||
generatedVMId = vmID;
|
||||
vmConfigMap.put("vmID", generatedVMId);
|
||||
}
|
||||
|
||||
vmList.add(0, vmConfigMap);
|
||||
return writeToVMList(new Gson().toJson(vmList)) &&
|
||||
writeToVMConfig(Objects.requireNonNull(vmConfigMap.get("vmID")).toString(), new Gson().toJson(vmConfigMap));
|
||||
}
|
||||
|
||||
public static boolean replaceToVMList(int postion, String vmId, String vmConfigJson) {
|
||||
|
|
@ -137,23 +153,48 @@ public class VMManager {
|
|||
return false;
|
||||
}
|
||||
|
||||
writeToVMList(new Gson().toJson(vmList));
|
||||
writeToVMConfig(Objects.requireNonNull(vmConfigMap.get("vmID")).toString(), new Gson().toJson(vmConfigMap));
|
||||
return true;
|
||||
return writeToVMList(new Gson().toJson(vmList)) &&
|
||||
writeToVMConfig(Objects.requireNonNull(vmConfigMap.get("vmID")).toString(), new Gson().toJson(vmConfigMap));
|
||||
}
|
||||
|
||||
public static void writeToVMList(String content) {
|
||||
FileUtils.writeToFile(AppConfig.maindirpath, "roms-data.json", content);
|
||||
public static boolean replaceToVMList(int postion, String vmId, HashMap<String, Object> vmConfigMap) {
|
||||
String vmListJson = FileUtils.readAFile(AppConfig.romsdatajson);
|
||||
if (!JSONUtils.isValidFromString(vmListJson)) return false;
|
||||
|
||||
int finalPosition = postion;
|
||||
ArrayList<HashMap<String, Object>> vmList = new Gson().fromJson(vmListJson, new TypeToken<ArrayList<HashMap<String, Object>>>() {
|
||||
}.getType());
|
||||
|
||||
if (postion == -1) {
|
||||
for (int _repeat = 0; _repeat < vmList.size(); _repeat++) {
|
||||
if (vmList.get(_repeat).containsKey("vmID")
|
||||
&& ((!vmId.isEmpty() && Objects.requireNonNull(vmList.get(_repeat).get("vmID")).toString().equals(vmId)) || Objects.requireNonNull(vmList.get(_repeat).get("vmID")).toString().equals(Objects.requireNonNull(vmConfigMap.get("vmID")).toString()))) {
|
||||
finalPosition = _repeat;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (finalPosition >= 0 && finalPosition < vmList.size()) {
|
||||
vmList.set(finalPosition, vmConfigMap);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
return writeToVMList(new Gson().toJson(vmList)) &&
|
||||
writeToVMConfig(Objects.requireNonNull(vmConfigMap.get("vmID")).toString(), new Gson().toJson(vmConfigMap));
|
||||
}
|
||||
|
||||
public static void writeToVMConfig(String vmID, String content) {
|
||||
FileUtils.writeToFile(AppConfig.maindirpath + "/roms/" + vmID, "rom-data.json", content.replace("\\u003d", "="));
|
||||
FileUtils.writeToFile(AppConfig.maindirpath + "/roms/" + vmID, "vmID.txt", vmID);
|
||||
public static boolean writeToVMList(String content) {
|
||||
return FileUtils.writeToFile(AppConfig.maindirpath, "roms-data.json", content);
|
||||
}
|
||||
|
||||
public static void createNewVM(String name, String thumbnail, String drive, String arch, String cdrom, String params, String vmID, int port) {
|
||||
ArrayList<HashMap<String, Object>> vmList;
|
||||
public static boolean writeToVMConfig(String vmID, String content) {
|
||||
return FileUtils.writeToFile(AppConfig.maindirpath + "/roms/" + vmID, "rom-data.json", content.replace("\\u003d", "=")) &&
|
||||
FileUtils.writeToFile(AppConfig.maindirpath + "/roms/" + vmID, "vmID.txt", vmID);
|
||||
}
|
||||
|
||||
public static boolean createNewVM(String name, String thumbnail, String drive, String arch, String cdrom, String params, String vmID, int port) {
|
||||
HashMap<String, Object> vmConfigMap = new HashMap<>();
|
||||
vmConfigMap.put("imgName", name);
|
||||
vmConfigMap.put("imgIcon", thumbnail);
|
||||
|
|
@ -164,16 +205,10 @@ public class VMManager {
|
|||
vmConfigMap.put("vmID", vmID);
|
||||
vmConfigMap.put("qmpPort", port);
|
||||
|
||||
vmList = new Gson().fromJson(FileUtils.readAFile(AppConfig.romsdatajson), new TypeToken<ArrayList<HashMap<String, Object>>>() {
|
||||
}.getType());
|
||||
|
||||
vmList.add(0, vmConfigMap);
|
||||
|
||||
writeToVMList(new Gson().toJson(vmList));
|
||||
writeToVMConfig(vmID, new Gson().toJson(vmConfigMap));
|
||||
return addToVMList(vmConfigMap, vmID);
|
||||
}
|
||||
|
||||
public static void editVM(String name, String thumbnail, String drive, String arch, String cdrom, String params, int position) {
|
||||
public static boolean editVM(String name, String thumbnail, String drive, String arch, String cdrom, String params, int position) {
|
||||
ArrayList<HashMap<String, Object>> vmList;
|
||||
|
||||
vmList = new Gson().fromJson(FileUtils.readAFile(AppConfig.romsdatajson), new TypeToken<ArrayList<HashMap<String, Object>>>() {
|
||||
|
|
@ -198,10 +233,7 @@ public class VMManager {
|
|||
vmConfigMap.put("vmID", idGenerator());
|
||||
}
|
||||
|
||||
vmList.set(position, vmConfigMap);
|
||||
|
||||
writeToVMList(new Gson().toJson(vmList));
|
||||
writeToVMConfig(Objects.requireNonNull(vmConfigMap.get("vmID")).toString(), new Gson().toJson(vmConfigMap));
|
||||
return replaceToVMList(position, "", vmConfigMap);
|
||||
}
|
||||
|
||||
public static void deleteVMDialog(String _vmName, int _position, Activity _activity) {
|
||||
|
|
@ -1312,37 +1344,37 @@ public class VMManager {
|
|||
}
|
||||
|
||||
public static void sendLeftMouseKey() {
|
||||
new Thread(() -> {
|
||||
try {
|
||||
keyDown("left");
|
||||
Thread.sleep(50);
|
||||
keyUp("left");
|
||||
} catch (InterruptedException e) {
|
||||
Log.d(TAG, "sendLeftMouseKey: " + e.getMessage());
|
||||
}
|
||||
}).start();
|
||||
pressAKey("left");
|
||||
}
|
||||
|
||||
public static void sendRightMouseKey() {
|
||||
new Thread(() -> {
|
||||
try {
|
||||
keyDown("right");
|
||||
Thread.sleep(50);
|
||||
keyUp("right");
|
||||
} catch (InterruptedException e) {
|
||||
Log.d(TAG, "sendRightMouseKey: " + e.getMessage());
|
||||
}
|
||||
}).start();
|
||||
pressAKey("right");
|
||||
}
|
||||
|
||||
public static void sendMiddleMouseKey() {
|
||||
pressAKey("middle");
|
||||
}
|
||||
|
||||
public static void sendSuperKey() {
|
||||
keyDown("KEY_LEFTMETA");
|
||||
}
|
||||
|
||||
public static void sendHoldSuperKey() {
|
||||
keyDown("KEY_LEFTMETA");
|
||||
}
|
||||
|
||||
public static void sendReleaseSuperKey() {
|
||||
keyUp("KEY_LEFTMETA");
|
||||
}
|
||||
|
||||
public static void pressAKey(String key) {
|
||||
new Thread(() -> {
|
||||
try {
|
||||
keyDown("middle");
|
||||
keyDown(key);
|
||||
Thread.sleep(50);
|
||||
keyUp("middle");
|
||||
keyUp(key);
|
||||
} catch (InterruptedException e) {
|
||||
Log.d(TAG, "sendMiddleMouseKey: " + e.getMessage());
|
||||
Log.d(TAG, "pressAKey: " + e.getMessage());
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -761,20 +761,22 @@ public class FileUtils {
|
|||
|
||||
}
|
||||
|
||||
public static void writeToFile(String folderPath, String fileName, String content) {
|
||||
public static boolean writeToFile(String folderPath, String fileName, String content) {
|
||||
File vDir = new File(folderPath);
|
||||
if (!vDir.exists()) {
|
||||
vDir.mkdirs();
|
||||
if (!vDir.mkdirs()) return false;
|
||||
}
|
||||
File file = new File(folderPath, fileName);
|
||||
FileOutputStream outputStream = null;
|
||||
FileOutputStream outputStream;
|
||||
try {
|
||||
outputStream = new FileOutputStream(file);
|
||||
outputStream.write(content.getBytes());
|
||||
outputStream.close();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
Log.e(TAG, "writeToFile: ", e);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void getAListOfAllFilesAndFoldersInADirectory(String path, ArrayList<String> list) {
|
||||
|
|
|
|||
|
|
@ -201,6 +201,7 @@ public class ListUtils {
|
|||
|
||||
mapForAddItems.put("keyname", "Ctrl + Alt + Del");
|
||||
mapForAddItems.put("keycode", 0);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", false);
|
||||
mapForAddItems.put("useIcon", false);
|
||||
mapForAddItems.put("rIcon", 0);
|
||||
|
|
@ -209,6 +210,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "Esc");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_ESCAPE);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", false);
|
||||
mapForAddItems.put("rIcon", 0);
|
||||
|
|
@ -216,7 +218,8 @@ public class ListUtils {
|
|||
|
||||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "Windows");
|
||||
mapForAddItems.put("keycode", 91);
|
||||
mapForAddItems.put("keycode", "KEY_LEFTMETA");
|
||||
mapForAddItems.put("useQMP", true);
|
||||
mapForAddItems.put("useKeyEvent", false);
|
||||
mapForAddItems.put("useIcon", true);
|
||||
mapForAddItems.put("rIcon", R.drawable.grid_view_24px);
|
||||
|
|
@ -225,7 +228,8 @@ public class ListUtils {
|
|||
// mapForAddItems = new HashMap<>();
|
||||
// mapForAddItems.put("keyname", "Menu");
|
||||
// mapForAddItems.put("keycode", 93);
|
||||
// mapForAddItems.put("useKeyEvent", false);
|
||||
// mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", false);
|
||||
// mapForAddItems.put("useIcon", true);
|
||||
// mapForAddItems.put("rIcon", R.drawable.menu_24px);
|
||||
// listmapForSendKey.add(mapForAddItems);
|
||||
|
|
@ -233,6 +237,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "Backspace");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_DEL);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", true);
|
||||
mapForAddItems.put("rIcon", R.drawable.backspace_24px);
|
||||
|
|
@ -241,6 +246,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "Enter");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_ENTER);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", true);
|
||||
mapForAddItems.put("rIcon", R.drawable.keyboard_return_24px);
|
||||
|
|
@ -249,6 +255,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "Tab");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_TAB);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", true);
|
||||
mapForAddItems.put("rIcon", R.drawable.sync_alt_24px);
|
||||
|
|
@ -257,6 +264,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "Up");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_DPAD_UP);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", true);
|
||||
mapForAddItems.put("rIcon", R.drawable.arrow_upward_24px);
|
||||
|
|
@ -265,6 +273,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "Down");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_DPAD_DOWN);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", true);
|
||||
mapForAddItems.put("rIcon", R.drawable.arrow_downward_24px);
|
||||
|
|
@ -273,6 +282,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "Left");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_DPAD_LEFT);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", true);
|
||||
mapForAddItems.put("rIcon", R.drawable.arrow_back_24px);
|
||||
|
|
@ -281,6 +291,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "Left");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_DPAD_RIGHT);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", true);
|
||||
mapForAddItems.put("rIcon", R.drawable.arrow_forward_24px);
|
||||
|
|
@ -289,6 +300,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "Home");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_MOVE_HOME);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", true);
|
||||
mapForAddItems.put("rIcon", R.drawable.vertical_align_top_24px);
|
||||
|
|
@ -297,6 +309,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "End");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_MOVE_END);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", true);
|
||||
mapForAddItems.put("rIcon", R.drawable.vertical_align_bottom_24px);
|
||||
|
|
@ -305,6 +318,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "End");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_PAGE_UP);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", true);
|
||||
mapForAddItems.put("rIcon", R.drawable.arrow_warm_up_24px);
|
||||
|
|
@ -313,6 +327,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "End");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_PAGE_DOWN);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", true);
|
||||
mapForAddItems.put("rIcon", R.drawable.arrow_cool_down_24px);
|
||||
|
|
@ -321,6 +336,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "End");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_INSERT);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", true);
|
||||
mapForAddItems.put("rIcon", R.drawable.insert_text_24px);
|
||||
|
|
@ -329,6 +345,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "F1");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_F1);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", false);
|
||||
mapForAddItems.put("rIcon", 0);
|
||||
|
|
@ -337,6 +354,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "F2");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_F2);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", false);
|
||||
mapForAddItems.put("rIcon", 0);
|
||||
|
|
@ -345,6 +363,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "F3");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_F3);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", false);
|
||||
mapForAddItems.put("rIcon", 0);
|
||||
|
|
@ -353,6 +372,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "F4");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_F4);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", false);
|
||||
mapForAddItems.put("rIcon", 0);
|
||||
|
|
@ -361,6 +381,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "F5");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_F5);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", false);
|
||||
mapForAddItems.put("rIcon", 0);
|
||||
|
|
@ -369,6 +390,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "F6");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_F6);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", false);
|
||||
mapForAddItems.put("rIcon", 0);
|
||||
|
|
@ -377,6 +399,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "F7");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_F7);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", false);
|
||||
mapForAddItems.put("rIcon", 0);
|
||||
|
|
@ -385,6 +408,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "F8");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_F8);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", false);
|
||||
mapForAddItems.put("rIcon", 0);
|
||||
|
|
@ -393,6 +417,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "F9");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_F9);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", false);
|
||||
mapForAddItems.put("rIcon", 0);
|
||||
|
|
@ -401,6 +426,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "F10");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_F10);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", false);
|
||||
mapForAddItems.put("rIcon", 0);
|
||||
|
|
@ -409,6 +435,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "F11");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_F11);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", false);
|
||||
mapForAddItems.put("rIcon", 0);
|
||||
|
|
@ -417,6 +444,7 @@ public class ListUtils {
|
|||
mapForAddItems = new HashMap<>();
|
||||
mapForAddItems.put("keyname", "F12");
|
||||
mapForAddItems.put("keycode", KeyEvent.KEYCODE_F12);
|
||||
mapForAddItems.put("useQMP", false);
|
||||
mapForAddItems.put("useKeyEvent", true);
|
||||
mapForAddItems.put("useIcon", false);
|
||||
mapForAddItems.put("rIcon", 0);
|
||||
|
|
|
|||
|
|
@ -364,11 +364,6 @@ public class ZipUtils {
|
|||
public static boolean isAllowExtract(ZipEntry entry, String targetDir) throws IOException {
|
||||
String entryName = entry.getName();
|
||||
|
||||
if (entryName.startsWith("/") || entryName.startsWith("\\")) {
|
||||
Log.w(TAG, "Absolute path blocked: " + entryName);
|
||||
return false;
|
||||
}
|
||||
|
||||
File destDir = new File(targetDir);
|
||||
File outFile = new File(destDir, entryName);
|
||||
|
||||
|
|
|
|||
|
|
@ -239,14 +239,14 @@ public class Terminal {
|
|||
|
||||
// Read the input stream for the output of the command
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
while (qemuProcess.isAlive() && (line = reader.readLine()) != null) {
|
||||
// Log.d(TAG, line);
|
||||
com.vectras.vm.logger.VectrasStatus.logError("<font color='#4db6ac'>VTERM: >" + line + "</font>");
|
||||
output.append(line).append("\n");
|
||||
}
|
||||
|
||||
// Read any errors from the error stream
|
||||
while ((line = errorReader.readLine()) != null) {
|
||||
while (qemuProcess.isAlive() && (line = errorReader.readLine()) != null) {
|
||||
Log.w(TAG, line);
|
||||
com.vectras.vm.logger.VectrasStatus.logError("<font color='red'>VTERM ERROR: >" + line + "</font>");
|
||||
output.append(line).append("\n");
|
||||
|
|
|
|||
|
|
@ -165,8 +165,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:hint="@string/qemu_params"
|
||||
android:theme="@style/AppTheme.TextInput"
|
||||
app:endIconContentDescription="@string/qemu_create_cmd"
|
||||
app:endIconMode="custom"
|
||||
app:startIconDrawable="@drawable/ic_qemu">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
|
|
|
|||
|
|
@ -500,6 +500,7 @@
|
|||
<string name="an_error_occurred_and_vm_was_not_modified">An error occurred and VM was not modified.</string>
|
||||
<string name="edit_with_create_command">Edit with Create command</string>
|
||||
<string name="edit_with_create_command_content">You can edit this VM with Create command app.</string>
|
||||
<string name="unable_to_save_please_try_again_later">Unable to save, please try again later.</string>
|
||||
|
||||
|
||||
<!--======================TERMUX STRINGS====================-->
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
"url": "https://github.com/xoureldeen/Vectras-VM-Android/releases",
|
||||
"Message": "<h2>3.6.0</h2>\nBugs fixed.",
|
||||
"cancellable": true,
|
||||
"versionCodeBeta":"67",
|
||||
"versionNameBeta":"3.6.3",
|
||||
"versionNameBetas":"3.0.0,3.1.0,3.2.1,3.2.2,3.2.3,3.2.4,3.2.5,3.2.6,3.2.7,3.2.8,3.2.9,3.2.10,3.3.1,3.3.2,3.3.3,3.3.4,3.3.5,3.3.6,3.3.7,3.3.8,3.3.9,3.4.1,3.4.2,3.4.3,3.4.4,3.4.5,3.4.6,3.4.7,3.4.8,3.4.9,3.5.1,3.5.2,3.5.3,3.5.4,3.5.5,3.5.6,3.5.7,3.5.8,3.5.9,3.6.0,3.6.1,3.6.2,3.6.3",
|
||||
"versionCodeBeta":"68",
|
||||
"versionNameBeta":"3.6.4",
|
||||
"versionNameBetas":"3.0.0,3.1.0,3.2.1,3.2.2,3.2.3,3.2.4,3.2.5,3.2.6,3.2.7,3.2.8,3.2.9,3.2.10,3.3.1,3.3.2,3.3.3,3.3.4,3.3.5,3.3.6,3.3.7,3.3.8,3.3.9,3.4.1,3.4.2,3.4.3,3.4.4,3.4.5,3.4.6,3.4.7,3.4.8,3.4.9,3.5.1,3.5.2,3.5.3,3.5.4,3.5.5,3.5.6,3.5.7,3.5.8,3.5.9,3.6.0,3.6.1,3.6.2,3.6.3,3.6.4",
|
||||
"sizeBeta": "43 MB",
|
||||
"urlBeta": "https://github.com/AnBui2004/Vectras-VM-Emu-Android/releases",
|
||||
"MessageBeta": "<h2>3.6.3</h2>Bugs fixed.",
|
||||
"MessageBeta": "<h2>3.6.4</h2>Bugs fixed.",
|
||||
"cancellableBeta": true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue