From a1bf49ba9ec31fc478c435e8a3e15f17ddd7c530 Mon Sep 17 00:00:00 2001 From: An Bui <91354810+AnBui2004@users.noreply.github.com> Date: Wed, 8 Apr 2026 20:31:41 +0700 Subject: [PATCH] 3.9.3 Bugs fixed. --- app/build.gradle | 6 +-- .../elephant/interaction/Interaction.java | 4 +- .../java/com/vectras/qemu/utils/RamInfo.java | 8 +-- app/src/main/java/com/vectras/vm/RomInfo.java | 6 +-- .../java/com/vectras/vm/utils/FileUtils.java | 17 +++--- .../com/vectras/vm/x11/LoriePreferences.java | 2 +- .../layout/activity_external_vnc_settings.xml | 1 + web/data/UpdateConfig.json | 8 +-- web/data/vroms-store.json | 54 +++++++++++++++++++ 9 files changed, 83 insertions(+), 23 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a75dc13..ff6b750 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,14 +6,14 @@ plugins { android { namespace 'com.vectras.vm' - compileSdk = 36 + compileSdk = 37 defaultConfig { applicationId "com.vectras.vm" minSdk minApi targetSdk targetApi - versionCode 96 - versionName "3.9.2" + versionCode 97 + versionName "3.9.3" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" multiDexEnabled true diff --git a/app/src/main/java/com/anbui/elephant/interaction/Interaction.java b/app/src/main/java/com/anbui/elephant/interaction/Interaction.java index 8fc1607..a89a137 100644 --- a/app/src/main/java/com/anbui/elephant/interaction/Interaction.java +++ b/app/src/main/java/com/anbui/elephant/interaction/Interaction.java @@ -136,9 +136,9 @@ public class Interaction { if (isSuccess && JSONUtils.isValidFromString(body)) { DataInteraction data = new Gson().fromJson(body, DataInteraction.class); dataInteraction.views = data.count; + setViews(); callback.onResult(true, data.count, getLikeCount()); LogPrinter.print(TAG, "View succeed."); - setViews(); } else { callback.onResult(false, 1, 0); LogPrinter.print(TAG, "View unsucceed."); @@ -199,8 +199,8 @@ public class Interaction { if (isSuccess && JSONUtils.isValidFromString(body)) { DataInteraction data = new Gson().fromJson(body, DataInteraction.class); dataInteraction.likes = data.count; - callback.onResult(true, getViewCount(), data.count); setLikes(); + callback.onResult(true, getViewCount(), data.count); LogPrinter.print(TAG, "Like succeed."); } else { callback.onResult(false, 1, 0); diff --git a/app/src/main/java/com/vectras/qemu/utils/RamInfo.java b/app/src/main/java/com/vectras/qemu/utils/RamInfo.java index 53d76b2..c8857b2 100644 --- a/app/src/main/java/com/vectras/qemu/utils/RamInfo.java +++ b/app/src/main/java/com/vectras/qemu/utils/RamInfo.java @@ -28,13 +28,13 @@ public class RamInfo { int freeRamInt = safeLongToInt(freeMem); int totalRamInt = safeLongToInt(totalMem); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity); - if (prefs.getBoolean("customMemory", false) && TextUtils.isNumberOnly(prefs.getString("memory", String.valueOf(256)))) { - if (Long.parseLong(prefs.getString("memory", String.valueOf(256))) > totalMem) { - prefs.edit().putInt("memory", totalRamInt / 2).apply(); + if (prefs.getBoolean("customMemory", false) && TextUtils.isNumberOnly(prefs.getString("memory", "256"))) { + if (Long.parseLong(prefs.getString("memory", "256")) > totalMem) { + prefs.edit().putString("memory", String.valueOf(totalRamInt / 2)).apply(); return totalRamInt / 2; } - return Integer.parseInt(prefs.getString("memory", String.valueOf(256))); + return Integer.parseInt(prefs.getString("memory", "256")); } else { return freeRamInt - 100; } diff --git a/app/src/main/java/com/vectras/vm/RomInfo.java b/app/src/main/java/com/vectras/vm/RomInfo.java index 7f4e0ad..f4be11c 100644 --- a/app/src/main/java/com/vectras/vm/RomInfo.java +++ b/app/src/main/java/com/vectras/vm/RomInfo.java @@ -321,10 +321,10 @@ public class RomInfo extends AppCompatActivity { Intent intent; try { intent = Intent.parseUri("intent://content/" + contentID + "#Intent;scheme=anbui;package=com.anbui.app;S.browser_fallback_url=https%3A%2F%2Fanbui.ovh%2Fapps%2Fgetanbuiapp.html;end", Intent.URI_INTENT_SCHEME); - } catch (URISyntaxException e) { - return; + startActivity(intent); + } catch (Exception ignored) { + binding.viewinanbuiapp.setVisibility(View.GONE); } - startActivity(intent); }); } diff --git a/app/src/main/java/com/vectras/vm/utils/FileUtils.java b/app/src/main/java/com/vectras/vm/utils/FileUtils.java index 81000e2..8876a54 100644 --- a/app/src/main/java/com/vectras/vm/utils/FileUtils.java +++ b/app/src/main/java/com/vectras/vm/utils/FileUtils.java @@ -71,7 +71,7 @@ public class FileUtils { @SuppressLint("NewApi") public static String getPath(Context context, final Uri uri) { - if (uri.toString().startsWith("content://ru.zdevs.zarchiver") && uri.getPath() != null && isFileExists(uri.getPath())) + if ((uri.toString().startsWith("content://ru.zdevs.zarchiver") || uri.toString().startsWith("content://bin.mt.plus")) && uri.getPath() != null && isFileExists(uri.getPath())) return uri.getPath(); // check here to KITKAT or new version @@ -356,11 +356,16 @@ public class FileUtils { try { InputStream inputStream = context.getContentResolver().openInputStream(uri); FileOutputStream outputStream = new FileOutputStream(output); - int read = 0; - int bufferSize = 1024; - final byte[] buffers = new byte[bufferSize]; - while ((read = inputStream.read(buffers)) != -1) { - outputStream.write(buffers, 0, read); + int read; + + byte[] buffer; + if (DeviceUtils.totalMemoryCapacity(context) < 4L * 1024 * 1024 * 1024) + buffer = new byte[64 * 1024]; + else + buffer = new byte[128 * 1024]; + + while ((read = inputStream.read(buffer)) != -1) { + outputStream.write(buffer, 0, read); } inputStream.close(); diff --git a/app/src/main/java/com/vectras/vm/x11/LoriePreferences.java b/app/src/main/java/com/vectras/vm/x11/LoriePreferences.java index 476ac25..5108f04 100644 --- a/app/src/main/java/com/vectras/vm/x11/LoriePreferences.java +++ b/app/src/main/java/com/vectras/vm/x11/LoriePreferences.java @@ -351,7 +351,7 @@ public class LoriePreferences extends AppCompatActivity { Intent intent = new Intent(ACTION_PREFERENCES_CHANGED); intent.putExtra("key", key); intent.setPackage("com.vectras.vm"); - requireContext().sendBroadcast(intent); + if (isAdded()) requireContext().sendBroadcast(intent); handler.postAtTime(this::updatePreferencesLayout, 100); return true; diff --git a/app/src/main/res/layout/activity_external_vnc_settings.xml b/app/src/main/res/layout/activity_external_vnc_settings.xml index 8c1e1ca..1acf76e 100644 --- a/app/src/main/res/layout/activity_external_vnc_settings.xml +++ b/app/src/main/res/layout/activity_external_vnc_settings.xml @@ -52,6 +52,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="numberSigned" + android:maxLength="5" android:digits="0123456789"/> diff --git a/web/data/UpdateConfig.json b/web/data/UpdateConfig.json index 209662e..9f65553 100644 --- a/web/data/UpdateConfig.json +++ b/web/data/UpdateConfig.json @@ -5,11 +5,11 @@ "url": "https://github.com/xoureldeen/Vectras-VM-Android/releases", "Message": "

3.9.0

\nBugs fixed.", "cancellable": true, - "versionCodeBeta":"96", - "versionNameBeta":"3.9.2", - "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.1,3.6.2,3.6.3,3.6.4,3.6.5,3.6.6,3.6.7,3.6.8,3.6.9,3.7.1,3.7.2,3.7.3,3.7.4,3.7.5,3.7.6,3.7.7,3.7.8,3.7.9,3.8.0,3.8.1,3.8.2,3.8.3,3.8.4,3.8.5,3.8.6,3.8.7,3.8.8,3.8.9,3.9.0,3.9.1,3.9.2", + "versionCodeBeta":"97", + "versionNameBeta":"3.9.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.1,3.6.2,3.6.3,3.6.4,3.6.5,3.6.6,3.6.7,3.6.8,3.6.9,3.7.1,3.7.2,3.7.3,3.7.4,3.7.5,3.7.6,3.7.7,3.7.8,3.7.9,3.8.0,3.8.1,3.8.2,3.8.3,3.8.4,3.8.5,3.8.6,3.8.7,3.8.8,3.8.9,3.9.0,3.9.1,3.9.2,3.9.3", "sizeBeta": "45 MB", "urlBeta": "https://github.com/AnBui2004/Vectras-VM-Emu-Android/releases", - "MessageBeta": "

3.9.2

Bugs fixed.", + "MessageBeta": "

3.9.3

Bugs fixed.", "cancellableBeta": true } diff --git a/web/data/vroms-store.json b/web/data/vroms-store.json index 96a1d62..0c77f0e 100644 --- a/web/data/vroms-store.json +++ b/web/data/vroms-store.json @@ -270,6 +270,24 @@ "vecid": "debian12cvbi", "id": "" }, + { + "rom_name": "Debian 14 (unstable)", + "rom_icon": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRw2CcpHNKIioANF5MV4H-Zw2H3S7hPDMaqeA&s", + "rom_url": "https://anbui.ovh/get/vec/community/linux/debian14sid.html", + "rom_path": "debian linux 14 forky sid_0.cvbi", + "rom_avail": true, + "rom_size": "Forky", + "rom_arch": "X86_64", + "rom_kernel": "linux", + "rom_extra": "", + "final_rom_file_name": "", + "desc": "Debian (/ˈdɛbiən/), also known as Debian GNU/Linux, is a free and open source Linux distribution, developed by the Debian Project, which was established by Ian Murdock in August 1993. Debian is one of the oldest operating systems based on the Linux kernel, and is the basis for many other Linux distributions.", + "file_size": "2 GB", + "creator": "Stiven2016", + "verified": true, + "vecid": "debianlinux14forkysid0cvbi", + "id": "" + }, { "rom_name": "Debian 4.0", "rom_icon": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRw2CcpHNKIioANF5MV4H-Zw2H3S7hPDMaqeA&s", @@ -1080,6 +1098,24 @@ "vecid": "windows1022h2rcvbi", "id": "99679" }, + { + "rom_name": "Windows 10 buid 10051", + "rom_icon": "https://vuetiwuvbyxywfukompp.supabase.co/storage/v1/object/public/getmyos/v1/files/2018/09/17/windows-logo_1_926ed76111646acbbe332bc5af0cf2ce.png", + "rom_url": "https://youtu.be/MkJVYVd9AME", + "rom_path": "Windows 10 buid 10051.cvbi", + "rom_avail": true, + "rom_size": "Insider Preview build", + "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 10 is a major release of Microsoft's Windows NT operating system. The successor to Windows 8.1, it was released to manufacturing on July 15, 2015, and later to retail on July 29, 2015. Windows 10 was made available for download via MSDN and TechNet, as a free upgrade for retail copies of Windows 8 and Windows 8.1 users via the Microsoft Store, and to Windows 7 users via Windows Update. Unlike previous Windows NT releases, Windows 10 receives new builds on an ongoing basis, which are available at no additional cost to users; devices in enterprise environments can alternatively use long-term support milestones that only receive critical updates, such as security patches.", + "file_size": "9 GB", + "creator": "Nguyen Bao An Bui", + "verified": true, + "vecid": "windows10buid10051cvbi", + "id": "99648" + }, { "rom_name": "Windows 10 buid 10074", "rom_icon": "https://vuetiwuvbyxywfukompp.supabase.co/storage/v1/object/public/getmyos/v1/files/2018/09/17/windows-logo_1_926ed76111646acbbe332bc5af0cf2ce.png", @@ -1404,6 +1440,24 @@ "vecid": "windows1126h1micro11cvbi", "id": "" }, + { + "rom_name": "Windows 11 build 21996.1", + "rom_icon": "https://www.getmyos.com/app_public/files/t/1/2021/06/windows_11_logo_by_getmyos.png", + "rom_url": "https://youtu.be/lHbw679OxTY", + "rom_path": "Windows 11 build 21996.1.cvbi", + "rom_avail": true, + "rom_size": "Leaked online on 15 June 2021", + "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": "10 GB", + "creator": "Nguyen Bao An Bui", + "verified": true, + "vecid": "windows11build219961cvbi", + "id": "99647" + }, { "rom_name": "Windows 11 build 22000.65", "rom_icon": "https://www.getmyos.com/app_public/files/t/1/2021/06/windows_11_logo_by_getmyos.png",