Skip to content

Commit

Permalink
2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
epicstudios856 committed Jan 26, 2024
1 parent e724a51 commit a6d138d
Show file tree
Hide file tree
Showing 47 changed files with 1,173 additions and 958 deletions.
12 changes: 0 additions & 12 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ android {
applicationId "com.vectras.vm"
minSdk 21
targetSdk 34
versionCode 9
versionName "PHANTOM v2.5"
versionCode 10
versionName "v2.6"

ndk { abiFilters "armeabi-v7a","arm64-v8a", "x86", "x86_64" }
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -70,7 +70,8 @@ dependencies {
implementation("com.google.firebase:firebase-crashlytics")
implementation("com.google.android.gms:play-services-auth:20.7.0")
implementation 'com.google.android.gms:play-services-ads:22.6.0'
implementation 'com.airbnb.android:lottie:6.2.0'
implementation 'com.airbnb.android:lottie:6.3.0'
implementation 'org.zeroturnaround:zt-zip:1.16'
implementation 'androidx.annotation:annotation:1.7.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
Expand Down
Binary file added app/release/app-release.apk
Binary file not shown.
20 changes: 20 additions & 0 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.vectras.vm",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 10,
"versionName": "v2.6",
"outputFile": "app-release.apk"
}
],
"elementType": "File"
}
5 changes: 5 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
android:hardwareAccelerated="false"
android:label="@string/title_activity_login"
android:launchMode="singleTask" />
<activity
android:name=".ui.login.VerifyEmailActivity"
android:exported="true"
android:hardwareAccelerated="false"
android:launchMode="singleTask" />
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
Binary file modified app/src/main/assets/roms/vgabios-virtio.bin
Binary file not shown.
Binary file modified app/src/main/assets/roms/vgabios-vmware.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion app/src/main/java/com/vectras/qemu/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static final String getCacheDir(){
return cacheDir.toString();
}
public static final String getBasefileDir() {
return getCacheDir() + "/vectras/";
return AppConfig.basefiledir;
}

public static String machineFolder = "machines/";
Expand Down
35 changes: 6 additions & 29 deletions app/src/main/java/com/vectras/qemu/MainSDLActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -451,13 +451,13 @@ public void onHideToolbar() {
}


private void onMouseMode() {
public void onMouseMode() {

String[] items = {"Trackpad Mouse (Phone)",
"Bluetooth/USB Mouse (Desktop mode)", //Physical mouse for Chromebook, Android x86 PC, or Bluetooth Mouse
};
final AlertDialog.Builder mBuilder = new AlertDialog.Builder(this);
mBuilder.setTitle("Mouse");
final AlertDialog.Builder mBuilder = new AlertDialog.Builder(this, R.style.MainDialogTheme);
mBuilder.setTitle("Mouse Mode");
mBuilder.setSingleChoiceItems(items, Config.mouseMode.ordinal(), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int i) {
Expand Down Expand Up @@ -531,13 +531,6 @@ private void promptSetUIModeDesktop(final boolean mouseMethodAlt) {
final AlertDialog alertDialog;
alertDialog = new AlertDialog.Builder(activity).create();
alertDialog.setTitle("Desktop Mode");

LinearLayout mLayout = new LinearLayout(this);
mLayout.setPadding(20, 20, 20, 20);
mLayout.setOrientation(LinearLayout.VERTICAL);

TextView textView = new TextView(activity);
textView.setVisibility(View.VISIBLE);
String desktopInstructions = this.getString(R.string.desktopInstructions);
if (!checkVMResolutionFits()) {
String resolutionWarning = "Warning: MainActivity.vmexecutor resolution "
Expand All @@ -547,17 +540,7 @@ private void promptSetUIModeDesktop(final boolean mouseMethodAlt) {
"Reduce display resolution within the Guest OS for better experience.\n\n";
desktopInstructions = resolutionWarning + desktopInstructions;
}
textView.setText(desktopInstructions);

ScrollView scrollView = new ScrollView(this);
scrollView.addView(textView);

LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
mLayout.addView(scrollView, params);

alertDialog.setView(mLayout);

alertDialog.setMessage(desktopInstructions);
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
setUIModeDesktop();
Expand Down Expand Up @@ -934,7 +917,6 @@ protected void onCreate(Bundle savedInstanceState) {
ImageButton ctrlBtn = findViewById(R.id.ctrlBtn);
ImageButton altBtn = findViewById(R.id.altBtn);
ImageButton delBtn = findViewById(R.id.delBtn);
Button ctrlAltDelBtn = findViewById(R.id.ctrlAltDelBtn);
ImageButton qmpBtn = findViewById(R.id.btnQmp);
ImageButton btnLogs = findViewById(R.id.btnLogs);
btnLogs.setOnClickListener(new View.OnClickListener() {
Expand Down Expand Up @@ -1049,7 +1031,7 @@ public void onClick(View v) {
delayKey(100);
SDLActivity.onNativeKeyDown(KeyEvent.KEYCODE_ENTER);
delayKey(100);
SDLActivity.onNativeKeyDown(KeyEvent.KEYCODE_ENTER);
SDLActivity.onNativeKeyUp(KeyEvent.KEYCODE_ENTER);
}
});
ctrlBtn.setOnClickListener(new View.OnClickListener() {
Expand Down Expand Up @@ -1091,12 +1073,6 @@ public void onClick(View v) {
SDLActivity.onNativeKeyDown(KeyEvent.KEYCODE_DEL);
}
});
ctrlAltDelBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
sendCtrlAltKey(KeyEvent.KEYCODE_DEL);
}
});
qmpBtn.setVisibility(View.GONE);
if (monitorMode) {
qmpBtn.setImageDrawable(getResources().getDrawable(R.drawable.round_terminal_24));
Expand Down Expand Up @@ -1156,6 +1132,7 @@ public void onClick(View v) {
});
}


private void createUI(int w, int h) {
mSurface = new MainSDLSurface(this);

Expand Down
26 changes: 26 additions & 0 deletions app/src/main/java/com/vectras/qemu/MainSettingsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,32 @@ public static String getTbSize(Activity activity) {
return prefs.getString("TbSize", "2048");
}

public static void setBoot(Activity activity, String boot) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
SharedPreferences.Editor edit = prefs.edit();
edit.putString("boot", boot);
edit.apply();
}

public static String getBoot(Activity activity) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
return prefs.getString("boot", "c");
}


public static void setCpu(Activity activity, String cpu) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
SharedPreferences.Editor edit = prefs.edit();
edit.putString("cpu", cpu);
edit.apply();
}

public static String getCpu(Activity activity) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
return prefs.getString("cpu", "qemu64");
}


public static void setVmUi(Activity activity, String vmUi) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
SharedPreferences.Editor edit = prefs.edit();
Expand Down
33 changes: 6 additions & 27 deletions app/src/main/java/com/vectras/qemu/MainVNCActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public class MainVNCActivity extends VncCanvasActivity {
public boolean ctrlClicked = false;
public boolean altClicked = false;
private ImageButton qmpBtn;
public static MainVNCActivity activity;

@Override
public void onCreate(Bundle b) {
Expand All @@ -102,6 +103,7 @@ public void onCreate(Bundle b) {
WindowManager.LayoutParams.FLAG_FULLSCREEN);

super.onCreate(b);
activity = this;

this.vncCanvas.setFocusableInTouchMode(true);

Expand Down Expand Up @@ -132,7 +134,6 @@ public void onCreate(Bundle b) {
ImageButton altBtn = findViewById(R.id.altBtn);
ImageButton delBtn = findViewById(R.id.delBtn);
ImageButton btnLogs = findViewById(R.id.btnLogs);
Button ctrlAltDelBtn = findViewById(R.id.ctrlAltDelBtn);
qmpBtn = findViewById(R.id.btnQmp);
btnLogs.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down Expand Up @@ -279,12 +280,6 @@ public void onClick(View v) {
keyDownUp(KeyEvent.KEYCODE_DEL);
}
});
ctrlAltDelBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
sendCtrlAtlDelKey();
}
});
qmpBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down Expand Up @@ -630,7 +625,7 @@ public void run() {
return true;
}

private void onMouseMode() {
public void onMouseMode() {

String[] items = {"Trackpad Mouse (Phone)",
"Bluetooth/USB Mouse (Desktop mode)", //Physical mouse for Chromebook, Android x86 PC, or Bluetooth Mouse
Expand Down Expand Up @@ -732,32 +727,16 @@ private void promptSetUIModeDesktop(final Activity activity, final boolean mouse
final AlertDialog alertDialog;
alertDialog = new AlertDialog.Builder(activity, R.style.MainDialogTheme).create();
alertDialog.setTitle("Desktop mode");

LinearLayout mLayout = new LinearLayout(this);
mLayout.setPadding(20, 20, 20, 20);
mLayout.setOrientation(LinearLayout.VERTICAL);

TextView textView = new TextView(activity);
textView.setVisibility(View.VISIBLE);

String desktopInstructions = this.getString(R.string.desktopInstructions);
if (!checkVMResolutionFits()) {
String resolutionWarning = "Warning: Machine resolution "
String resolutionWarning = "Warning: MainActivity.vmexecutor resolution "
+ vncCanvas.rfb.framebufferWidth + "x" + vncCanvas.rfb.framebufferHeight +
" is too high for Desktop Mode. " +
"Scaling will be used and Mouse Alignment will not be accurate. " +
"Reduce display resolution for better experience\n\n";
"Reduce display resolution within the Guest OS for better experience.\n\n";
desktopInstructions = resolutionWarning + desktopInstructions;
}
textView.setText(desktopInstructions);

LinearLayout.LayoutParams textViewParams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
ScrollView scrollView = new ScrollView(this);
scrollView.addView(textView);
mLayout.addView(scrollView, textViewParams);
alertDialog.setView(mLayout);

alertDialog.setMessage(desktopInstructions);
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {

Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/vectras/qemu/jni/StartVM.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ public StartVM(Context context) throws Exception {
this.libqemu = FileUtils.getNativeLibDir(context) + "/libqemu-system-x86_64.so";
this.arch = "x86_64";
this.machine_type = "pc";
this.cpu = "qemu64";
this.cpu = MainSettingsManager.getCpu(MainActivity.activity);
}
bootdevice = MainSettingsManager.getBoot(MainActivity.activity);
this.sound_card = MainSettingsManager.getSoundCard(MainActivity.activity);
this.cpuNum = MainSettingsManager.getCpuNum(MainActivity.activity);

Expand Down
17 changes: 13 additions & 4 deletions app/src/main/java/com/vectras/vm/AppConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.widget.ImageView.ScaleType;

import com.vectras.qemu.MainSettingsManager;
import com.vectras.vm.utils.FileUtils;

import java.io.File;
import java.util.Hashtable;
Expand Down Expand Up @@ -39,9 +40,17 @@ public static final String romsJson(Activity activity) {
}

// App config
public static final String datadirpath = SplashActivity.activity.getExternalFilesDir("data") + "/";
public static final String sharedFolder = datadirpath + "Vectras/ProgramFiles/";
public static final String basefiledir = datadirpath + "Vectras/.qemu/";
public static final String maindirpath = datadirpath + "Vectras/";
public static final String datadirpath() {
File f = new File(SplashActivity.activity.getExternalFilesDir("data") + "/Vectras");
if (f.exists())
return SplashActivity.activity.getExternalFilesDir("data") + "/Vectras";
else
return FileUtils.getExternalFilesDirectory(SplashActivity.activity).getPath();
}

;
public static final String sharedFolder = datadirpath() + "/SharedFolder/";
public static final String basefiledir = datadirpath() + "/.qemu/";
public static final String maindirpath = datadirpath() + "/";

}

0 comments on commit a6d138d

Please sign in to comment.