mirror of
https://github.com/xoureldeen/Vectras-VM-Android.git
synced 2026-05-02 00:00:25 +00:00
3.2.0
- Added new Qemu for x86_64. - Automatically use older Alpine Linux versions for devices that don't support 64-bit. - Fixed issue with aria2c.
This commit is contained in:
parent
19feb2ba09
commit
e058dc6f06
9 changed files with 62 additions and 46 deletions
|
|
@ -11,7 +11,7 @@ android {
|
|||
minSdk minApi
|
||||
targetSdk targetApi
|
||||
versionCode 23
|
||||
versionName "3.1.0"
|
||||
versionName "3.2.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled true
|
||||
}
|
||||
|
|
@ -89,7 +89,7 @@ dependencies {
|
|||
// implementation 'com.google.android.gms:play-services-ads:24.6.0'
|
||||
implementation 'com.google.guava:guava:33.5.0-jre'
|
||||
implementation 'com.google.code.gson:gson:2.13.2'
|
||||
implementation 'com.squareup.okhttp3:okhttp:5.1.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:5.2.0'
|
||||
implementation "androidx.window:window:1.5.0"
|
||||
implementation "commons-io:commons-io:2.20.0"
|
||||
implementation 'org.zeroturnaround:zt-zip:1.17'
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import android.os.Bundle;
|
|||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import com.vectras.vm.adapters.GithubUserAdapter;
|
||||
import com.vectras.vm.utils.CommandUtils;
|
||||
import com.vectras.vm.utils.UIUtils;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
|
@ -28,9 +29,11 @@ import android.widget.TextView;
|
|||
import com.vectras.vterm.Terminal;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public class AboutActivity extends AppCompatActivity implements View.OnClickListener{
|
||||
|
||||
ExecutorService executor = Executors.newSingleThreadExecutor();
|
||||
Button btn_osl, btn_clog;
|
||||
ImageButton btn_discord, btn_youtube, btn_github, btn_telegram, btn_instagram, btn_facebook;
|
||||
|
||||
|
|
@ -127,18 +130,9 @@ public class AboutActivity extends AppCompatActivity implements View.OnClickList
|
|||
|
||||
|
||||
TextView qemuVersion = findViewById(R.id.qemuVersion);
|
||||
|
||||
String command = "qemu-system-x86_64 --version";
|
||||
new Terminal(this).extractQemuVersion(command, false, this, (output, errors) -> {
|
||||
if (errors.isEmpty()) {
|
||||
String versionStr = "Unknown";
|
||||
if (output.equals("8.2.1") || output.equals("9.2.2"))
|
||||
versionStr = output + " - 3dfx";
|
||||
Log.d(TAG, "QEMU Version: " + versionStr);
|
||||
qemuVersion.setText(versionStr);
|
||||
} else {
|
||||
Log.e(TAG, "Errors: " + errors);
|
||||
}
|
||||
executor.execute(() -> {
|
||||
String qemuVersionName = CommandUtils.getQemuVersionName();
|
||||
runOnUiThread(() -> qemuVersion.setText(qemuVersionName));
|
||||
});
|
||||
|
||||
// SimpleAnimations.scale(findViewById(R.id.card_yagiz), 250);
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ public class SetupQemuActivity extends AppCompatActivity implements View.OnClick
|
|||
private String downloadBootstrapsCommand = "";
|
||||
private boolean aria2Error = false;
|
||||
private boolean isexecutingCommand = false;
|
||||
private boolean isEdgeServerError = false;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
|
@ -311,7 +312,7 @@ public class SetupQemuActivity extends AppCompatActivity implements View.OnClick
|
|||
Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
|
||||
if (fromAsset.equals("alpine")) {
|
||||
if (fromAsset.contains("alpine")) {
|
||||
File rootDir = new File(filesDir + "/distro/root");
|
||||
if (!rootDir.exists()) rootDir.mkdir();
|
||||
|
||||
|
|
@ -441,6 +442,8 @@ public class SetupQemuActivity extends AppCompatActivity implements View.OnClick
|
|||
libprooterror = true;
|
||||
} else if (textToAdd.contains("not complete: /root/setup.tar.gz")) {
|
||||
aria2Error = true;
|
||||
} else if (textToAdd.contains("edge") && textToAdd.contains("temporary error")) {
|
||||
isEdgeServerError = true;
|
||||
}
|
||||
|
||||
if (textToAdd.contains("Starting setup...")) {
|
||||
|
|
@ -567,7 +570,7 @@ public class SetupQemuActivity extends AppCompatActivity implements View.OnClick
|
|||
if (exitValue != 0) {
|
||||
isexecutingCommand = false;
|
||||
// If exit value is not zero, display a toast message
|
||||
if (!aria2Error) {
|
||||
if (!aria2Error && isEdgeServerError) {
|
||||
String toastMessage = "Command failed with exit code: " + exitValue;
|
||||
activity.runOnUiThread(() -> {
|
||||
appendTextAndScroll("Error: " + toastMessage + "\n");
|
||||
|
|
@ -597,13 +600,22 @@ public class SetupQemuActivity extends AppCompatActivity implements View.OnClick
|
|||
} else if (aria2Error && downloadBootstrapsCommand.contains("aria2c")) {
|
||||
activity.runOnUiThread(() -> {
|
||||
downloadBootstrapsCommand = " curl -o setup.tar.gz -L " + bootstrapfilelink;
|
||||
if (AppConfig.getSetupFiles().contains("arm64-v8a") || AppConfig.getSetupFiles().contains("x86_64")) {
|
||||
if (AppConfig.getSetupFiles().contains("64")) {
|
||||
setupVectras64();
|
||||
} else {
|
||||
setupVectras32();
|
||||
}
|
||||
});
|
||||
} else if (isEdgeServerError) {
|
||||
isEdgeServerError = false;
|
||||
activity.runOnUiThread(() -> {
|
||||
selectedMirrorCommand += " && sed '/edge/d' /etc/apk/repositories";
|
||||
if (AppConfig.getSetupFiles().contains("64")) {
|
||||
setupVectras64();
|
||||
} else {
|
||||
setupVectras32();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
} catch (IOException | InterruptedException e) {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.vectras.qemu.MainSettingsManager;
|
|||
import com.vectras.vm.R;
|
||||
import com.vectras.vm.VMManager;
|
||||
import com.vectras.vm.databinding.FragmentHomeSystemMonitorBinding;
|
||||
import com.vectras.vm.utils.CommandUtils;
|
||||
import com.vectras.vm.utils.DialogUtils;
|
||||
import com.vectras.vterm.Terminal;
|
||||
|
||||
|
|
@ -186,20 +187,15 @@ public class SystemMonitorFragment extends Fragment {
|
|||
@SuppressLint("SetTextI18n")
|
||||
private void getQemuInfo() {
|
||||
String currentArch = MainSettingsManager.getArch(requireActivity());
|
||||
String command = "qemu-system-x86_64 --version";
|
||||
new Terminal(requireActivity()).extractQemuVersion(command, false, requireActivity(), (output, errors) -> {
|
||||
if (errors.isEmpty()) {
|
||||
binding.tvQemuversion.setText(getString(R.string.version) + " " + (output.equals("8.2.1") || output.equals("9.2.2") ? output + " - 3dfx" : getString(R.string.unknow)) + ".");
|
||||
} else {
|
||||
Log.e(TAG, "Errors: " + errors);
|
||||
}
|
||||
});
|
||||
|
||||
binding.tvQemuarch.setText(getString(R.string.arch) + " " + currentArch + ".");
|
||||
|
||||
executor.execute(() -> {
|
||||
String qemuVersionName = CommandUtils.getQemuVersionName();
|
||||
String result = Terminal.executeShellCommandWithResult("ps -e command", requireActivity());
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
binding.tvQemuversion.setText(getString(R.string.version) + " " + qemuVersionName + ".");
|
||||
|
||||
if (!result.isEmpty()) {
|
||||
switch (currentArch) {
|
||||
case "X86_64" ->
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.vectras.vm.utils;
|
|||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.vectras.vm.VectrasApp;
|
||||
import com.vectras.vterm.Terminal;
|
||||
|
||||
public class CommandUtils {
|
||||
|
|
@ -17,4 +18,16 @@ public class CommandUtils {
|
|||
Terminal vterm = new Terminal(_activity);
|
||||
vterm.executeShellCommand2(_command, _isShowResult, _activity);
|
||||
}
|
||||
|
||||
public static String getQemuVersionName() {
|
||||
return getQemuVersion() + (is3dfxVersion() ? " - 3dfx" : "");
|
||||
}
|
||||
|
||||
public static String getQemuVersion() {
|
||||
return VectrasApp.getContext() == null ? "Unknow" : Terminal.executeShellCommandWithResult("qemu-system-x86_64 --version | head -n1 | awk '{print $4}'", VectrasApp.getContext()).replaceAll("\n", "");
|
||||
}
|
||||
|
||||
public static boolean is3dfxVersion() {
|
||||
return VectrasApp.getContext() != null && Terminal.executeShellCommandWithResult("qemu-system-x86_64 --version", VectrasApp.getContext()).contains("3dfx");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ public class Terminal {
|
|||
}).start();
|
||||
}
|
||||
|
||||
public static String executeShellCommandWithResult(String userCommand, Activity activity) {
|
||||
public static String executeShellCommandWithResult(String userCommand, Context context) {
|
||||
StringBuilder output = new StringBuilder();
|
||||
StringBuilder errors = new StringBuilder();
|
||||
Log.d(TAG, userCommand);
|
||||
|
|
@ -296,8 +296,8 @@ public class Terminal {
|
|||
try {
|
||||
ProcessBuilder processBuilder = new ProcessBuilder();
|
||||
|
||||
String filesDir = Objects.requireNonNull(activity.getFilesDir().getAbsolutePath());
|
||||
File tmpDir = new File(Objects.requireNonNull(activity.getFilesDir()), "usr/tmp");
|
||||
String filesDir = Objects.requireNonNull(context.getFilesDir().getAbsolutePath());
|
||||
File tmpDir = new File(Objects.requireNonNull(context.getFilesDir()), "usr/tmp");
|
||||
|
||||
processBuilder.environment().put("PROOT_TMP_DIR", tmpDir.getAbsolutePath());
|
||||
processBuilder.environment().put("HOME", "/root");
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<string name="app_name">Vectras VM</string>
|
||||
|
||||
<!--======================VECTRAS STRINGS====================-->
|
||||
<string name="app_version" translatable="false">3.1.0</string>
|
||||
<string name="app_version" translatable="false">3.2.0</string>
|
||||
<string name="qemu_version" translatable="false">Stable</string>
|
||||
<string name="str_home">Home</string>
|
||||
<string name="str_logger">Logger</string>
|
||||
|
|
|
|||
15
gradle/wrapper/gradle-wrapper.properties
vendored
15
gradle/wrapper/gradle-wrapper.properties
vendored
|
|
@ -1,7 +1,8 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
#Fri Oct 10 12:41:35 ICT 2025
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
{
|
||||
"versionCode":"21",
|
||||
"versionName":"v2.9.5-3dfx,v2.9.5-3dfx-almondcake,v2.9.5-3dfx-bread,v2.9.5-3dfx-churro,v2.9.5-3dfx-doughnut,v2.9.5-3dfx-empanada,v2.9.5-3dfx-flan,v2.9.5-3dfx-gugelhupf,v2.9.5-3dfx-hamentaschen,v2.9.5-3dfx-italianice,v2.9.5-3dfx-ladyfingers,v2.9.5-3dfx-madeleine,v2.9.5-3dfx-neapolitanicecream,v2.9.5-3dfx-orangecake,v2.9.5-3dfx-profiterole,v2.9.5-3dfx-quincejelly,v2.9.5-3dfx-rugelach,v2.9.5-3dfx-scone,v2.9.5-3dfx-tart,v2.9.5-3dfx-ube-halaya,v2.9.5-3dfx-victoria-sponge,v2.9.5-3dfx-waffle,v2.9.5-3dfx-xangos,v2.9.5-3dfx-yorkshire-pudding,v2.9.5-3dfx-zeppole,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",
|
||||
"size": "46 MB",
|
||||
"versionCode":"23",
|
||||
"versionName":"3.2.0",
|
||||
"size": "50 MB",
|
||||
"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":"22",
|
||||
"versionNameBeta":"3.1.0",
|
||||
"versionNameBetas":"v2.9.5-3dfx-madeleine,v2.9.5-3dfx-neapolitanicecream,v2.9.5-3dfx-orangecake,v2.9.5-3dfx-profiterole,v2.9.5-3dfx-quincejelly,v2.9.5-3dfx-rugelach,v2.9.5-3dfx-scone,v2.9.5-3dfx-tart,v2.9.5-3dfx-victoria-sponge,v2.9.5-3dfx-waffle,v2.9.5-3dfx-xangos,v2.9.5-3dfx-yorkshire-pudding,v2.9.5-3dfx-zeppole,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",
|
||||
"sizeBeta": "41 MB",
|
||||
"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",
|
||||
"sizeBeta": "50 MB",
|
||||
"urlBeta": "https://github.com/AnBui2004/Vectras-VM-Emu-Android/releases",
|
||||
"MessageBeta": "<h2>3.1.0</h2>Bugs fixed.",
|
||||
"MessageBeta": "<h2>3.2.0</h2>Bugs fixed.",
|
||||
"cancellableBeta": true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue