mirror of
https://github.com/xoureldeen/Vectras-VM-Android.git
synced 2026-05-02 16:20:30 +00:00
initial commit
This commit is contained in:
parent
a88504fe3e
commit
250d795823
8 changed files with 79 additions and 8 deletions
|
|
@ -64,7 +64,7 @@ public class Config {
|
|||
public static boolean enableSMPOnlyOnKVM = false;
|
||||
|
||||
//set to true if you need to debug native library loading
|
||||
public static boolean loadNativeLibsEarly = false;
|
||||
public static boolean loadNativeLibsEarly = false;
|
||||
|
||||
//XXX: QEMU 3.1.0 needs the libraries to be loaded from the main thread
|
||||
public static boolean loadNativeLibsMainThread = true;
|
||||
|
|
@ -174,7 +174,7 @@ public class Config {
|
|||
|
||||
public static String machinename = "VECTRAS";
|
||||
public static int paused = 0;
|
||||
public static String ui = "VNC";
|
||||
public static String ui = "X11";
|
||||
public static boolean maxPriority = false;
|
||||
public static final String defaultVNCColorMode = COLORMODEL.C24bit.nameString();
|
||||
public static final ScaleType defaultFullscreenScaleMode = ScaleType.FIT_CENTER;
|
||||
|
|
|
|||
|
|
@ -601,7 +601,7 @@ public class MainSettingsManager extends AppCompatActivity
|
|||
|
||||
public static String getVmUi(Activity activity) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
return prefs.getString("vmUi", "VNC");
|
||||
return prefs.getString("vmUi", Config.ui);
|
||||
}
|
||||
|
||||
public static void setResolution(Activity activity, String RESOLUTION) {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import android.app.ActivityManager;
|
|||
import android.app.Dialog;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
|
|
@ -22,6 +23,7 @@ import android.os.Bundle;
|
|||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.provider.DocumentsContract;
|
||||
import android.system.ErrnoException;
|
||||
import android.text.Html;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
|
|
@ -67,6 +69,7 @@ import com.vectras.qemu.utils.RamInfo;
|
|||
import com.vectras.vm.MainRoms.AdapterMainRoms;
|
||||
import com.vectras.vm.MainRoms.DataMainRoms;
|
||||
import com.vectras.vm.adapter.LogsAdapter;
|
||||
import com.vectras.vm.core.TermuxX11;
|
||||
import com.vectras.vm.logger.VectrasStatus;
|
||||
import com.vectras.vm.utils.AppUpdater;
|
||||
import com.vectras.vm.utils.FileUtils;
|
||||
|
|
@ -788,7 +791,21 @@ public class MainActivity extends AppCompatActivity {
|
|||
} else if (MainSettingsManager.getVmUi(activity).equals("SPICE")) {
|
||||
//activity.startActivity(new Intent(activity, RemoteCanvasActivity.class));
|
||||
} else if (MainSettingsManager.getVmUi(activity).equals("X11")) {
|
||||
//activity.startActivity(new Intent(activity, X11Activity.class));
|
||||
try {
|
||||
TermuxX11.main(new String[]{":0"});
|
||||
} catch (ErrnoException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
Intent x11Intent = new Intent();
|
||||
x11Intent.setClassName("com.termux.x11", "com.termux.x11.MainActivity");
|
||||
x11Intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
||||
try {
|
||||
activity.startActivity(x11Intent);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Log.e("LaunchActivity", "Activity not found: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ public class StartVM {
|
|||
|
||||
ArrayList<String> params = new ArrayList<>(Arrays.asList(qemu));
|
||||
|
||||
params.add("awesome;");
|
||||
|
||||
if (MainSettingsManager.getArch(activity).equals("I386"))
|
||||
params.add("qemu-system-i386");
|
||||
else if (MainSettingsManager.getArch(activity).equals("X86_64"))
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public class TermuxX11 {
|
|||
|
||||
public static void main(String[] args) throws ErrnoException {
|
||||
String filesDir = VectrasApp.vectrasapp.getFilesDir().getAbsolutePath();
|
||||
File xkbConfigRoot = new File(filesDir + "/distro/share/X11/xkb");
|
||||
File xkbConfigRoot = new File(filesDir + "/distro/usr/share/X11/xkb");
|
||||
if (!xkbConfigRoot.exists())
|
||||
throw new RuntimeException("XKB_CONFIG_ROOT not found: " + xkbConfigRoot);
|
||||
Os.setenv("XKB_CONFIG_ROOT", xkbConfigRoot.getAbsolutePath(), true);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public class Terminal {
|
|||
private String user = "root";
|
||||
|
||||
public static Process qemuProcess;
|
||||
public static String DISPLAY = ":1";
|
||||
public static String DISPLAY = ":0";
|
||||
|
||||
public Terminal(Context context) {
|
||||
this.context = context;
|
||||
|
|
@ -108,6 +108,9 @@ public class Terminal {
|
|||
"-b", "/storage",
|
||||
"-b", "/data",
|
||||
"-w", "/root",
|
||||
"/usr/bin/env", "-i",
|
||||
"HOME=/root",
|
||||
"DISPLAY="+DISPLAY,
|
||||
"/bin/sh",
|
||||
"--login"// The shell to execute inside PRoot
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue