This commit is contained in:
An Bui 2025-06-26 11:25:37 +07:00
parent abdadcb5c4
commit 549e89584e
28 changed files with 508 additions and 546 deletions

13
.idea/deviceManager.xml generated Normal file
View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DeviceTable">
<option name="columnSorters">
<list>
<ColumnSorterState>
<option name="column" value="Name" />
<option name="order" value="ASCENDING" />
</ColumnSorterState>
</list>
</option>
</component>
</project>

View file

@ -11,7 +11,7 @@ android {
minSdk minApi
targetSdk targetApi
versionCode 21
versionName "v2.9.5-3dfx-waffle"
versionName "v2.9.5-3dfx-xangos"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}

View file

@ -47,6 +47,7 @@ import com.google.android.gms.ads.MobileAds;
import com.google.android.gms.ads.initialization.InitializationStatus;
import com.google.android.gms.ads.initialization.OnInitializationCompleteListener;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.progressindicator.LinearProgressIndicator;
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textfield.TextInputLayout;
import com.vectras.qemu.MainSettingsManager;
@ -54,6 +55,7 @@ import com.vectras.vm.Fragment.CreateImageDialogFragment;
import com.vectras.vm.MainRoms.DataMainRoms;
import com.vectras.vm.logger.VectrasStatus;
import com.vectras.vm.utils.DeviceUtils;
import com.vectras.vm.utils.DialogUtils;
import com.vectras.vm.utils.FileUtils;
import com.vectras.vm.utils.UIUtils;
@ -79,12 +81,16 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.Timer;
import java.util.TimerTask;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.vectras.vm.utils.ZipUtils;
import com.vectras.vterm.Terminal;
import com.vectras.vm.utils.PermissionUtils;
@ -112,6 +118,14 @@ public class CustomRomActivity extends AppCompatActivity {
private ImageView ivIcon;
public static TextInputLayout driveLayout;
LinearProgressIndicator linearprogress;
TextView textviewprogress;
private Timer _timer = new Timer();
private TimerTask timerTask;
double zipFileSize = 0;
double folderSize = 0;
int decompressionProgress = 0;
private boolean isFilled(TextInputEditText TXT) {
if (TXT.getText().toString().trim().length() > 0)
return true;
@ -134,7 +148,7 @@ public class CustomRomActivity extends AppCompatActivity {
super.onCreateOptionsMenu(menu);
//if (!modify)
menu.add(1, 1, 1, getString(R.string.create)).setShortcut('3', 'c').setIcon(R.drawable.check_24px).setShowAsAction(1);
menu.add(1, 1, 1, getString(R.string.create)).setShortcut('3', 'c').setIcon(R.drawable.check_24px).setShowAsAction(1);
return true;
}
@ -156,41 +170,7 @@ public class CustomRomActivity extends AppCompatActivity {
//
// startActivityForResult(intent, 0);
//if (mainlayout.getVisibility() == View.VISIBLE) {
if (Objects.requireNonNull(title.getText()).toString().isEmpty()) {
UIUtils.oneDialog(getResources().getString(R.string.oops), getResources().getString(R.string.need_set_name),true, false, activity);
} else if ((!Objects.requireNonNull(drive.getText()).toString().isEmpty()) || (!Objects.requireNonNull(cdrom.getText()).toString().isEmpty())) {
checkJsonFile();
} else {
if (VMManager.isHaveADisk(Objects.requireNonNull(qemu.getText()).toString())) {
checkJsonFile();
} else {
if (qemu.getText().toString().isEmpty()) {
AlertDialog alertDialog = new AlertDialog.Builder(activity, R.style.MainDialogTheme).create();
alertDialog.setTitle(getResources().getString(R.string.problem_has_been_detected));
alertDialog.setMessage(getResources().getString(R.string.qemu_params_is_empty));
alertDialog.setCancelable(true);
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.continuetext), (dialog, which) -> {
checkJsonFile();
});
alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), (dialog, which) -> {
});
alertDialog.show();
} else {
AlertDialog alertDialog = new AlertDialog.Builder(activity, R.style.MainDialogTheme).create();
alertDialog.setTitle(getResources().getString(R.string.problem_has_been_detected));
alertDialog.setMessage(getResources().getString(R.string.you_have_not_added_any_storage_devices));
alertDialog.setCancelable(true);
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.continuetext), (dialog, which) -> {
checkJsonFile();
});
alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), (dialog, which) -> {
});
alertDialog.show();
}
}
}
startCreateVM();
//}
return true;
case android.R.id.home:
@ -234,6 +214,10 @@ public class CustomRomActivity extends AppCompatActivity {
TextInputLayout iconLayout = findViewById(R.id.iconField);
TextInputLayout qemuLayout = findViewById(R.id.qemuField);
TextView arch = findViewById(R.id.textArch);
linearprogress = findViewById(R.id.linearprogress);
textviewprogress = findViewById(R.id.textviewprogress);
arch.setText(MainSettingsManager.getArch(this));
icon.setOnClickListener(new View.OnClickListener() {
@Override
@ -314,45 +298,35 @@ public class CustomRomActivity extends AppCompatActivity {
dialogFragment.customRom = true;
dialogFragment.show(getSupportFragmentManager(), "CreateImageDialogFragment");
} else {
AlertDialog ad = new AlertDialog.Builder(CustomRomActivity.this, R.style.MainDialogTheme).create();
ad.setTitle(getString(R.string.change_hard_drive));
ad.setMessage(getString(R.string.do_you_want_to_change_create_or_remove));
ad.setButton(Dialog.BUTTON_NEGATIVE, getString(R.string.change), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*");
DialogUtils.threeDialog(CustomRomActivity.this, getString(R.string.change_hard_drive), getString(R.string.do_you_want_to_change_create_or_remove), getString(R.string.change), getString(R.string.remove), getString(R.string.create), true, R.drawable.hard_drive_24px, true,
() -> {
Intent intent = new Intent(ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*");
// Optionally, specify a URI for the file that should appear in the
// system file picker when it loads.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, Environment.DIRECTORY_DOWNLOADS);
}
// Optionally, specify a URI for the file that should appear in the
// system file picker when it loads.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, Environment.DIRECTORY_DOWNLOADS);
}
startActivityForResult(intent, 1002);
ad.dismiss();
}
});
ad.setButton(Dialog.BUTTON_POSITIVE, getString(R.string.remove), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
FileUtils.deleteDirectory(drive.getText().toString());
drive.setText("");
driveLayout.setEndIconDrawable(R.drawable.round_add_24);
ad.dismiss();
}
});
ad.setButton(Dialog.BUTTON_NEUTRAL, getString(R.string.create), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (!createVMFolder()) {
return;
}
CreateImageDialogFragment dialogFragment = new CreateImageDialogFragment();
dialogFragment.customRom = true;
dialogFragment.show(getSupportFragmentManager(), "CreateImageDialogFragment");
ad.dismiss();
}
});
ad.show();
startActivityForResult(intent, 1002);
},
() -> {
if (drive.getText().toString().contains(AppConfig.vmFolder + vmID)) {
FileUtils.deleteDirectory(drive.getText().toString());
}
drive.setText("");
driveLayout.setEndIconDrawable(R.drawable.round_add_24);
},
() -> {
if (!createVMFolder()) {
return;
}
CreateImageDialogFragment dialogFragment = new CreateImageDialogFragment();
dialogFragment.customRom = true;
dialogFragment.show(getSupportFragmentManager(), "CreateImageDialogFragment");
}, null);
}
}
});
@ -391,41 +365,7 @@ public class CustomRomActivity extends AppCompatActivity {
addRomBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (Objects.requireNonNull(title.getText()).toString().isEmpty()) {
UIUtils.oneDialog(getResources().getString(R.string.oops), getResources().getString(R.string.need_set_name),true, false, activity);
} else if ((!Objects.requireNonNull(drive.getText()).toString().isEmpty()) || (!Objects.requireNonNull(cdrom.getText()).toString().isEmpty())) {
checkJsonFile();
} else {
if (VMManager.isHaveADisk(Objects.requireNonNull(qemu.getText()).toString())) {
checkJsonFile();
} else {
if (qemu.getText().toString().isEmpty()) {
AlertDialog alertDialog = new AlertDialog.Builder(activity, R.style.MainDialogTheme).create();
alertDialog.setTitle(getResources().getString(R.string.problem_has_been_detected));
alertDialog.setMessage(getResources().getString(R.string.qemu_params_is_empty));
alertDialog.setCancelable(true);
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.continuetext), (dialog, which) -> {
checkJsonFile();
});
alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), (dialog, which) -> {
});
alertDialog.show();
} else {
AlertDialog alertDialog = new AlertDialog.Builder(activity, R.style.MainDialogTheme).create();
alertDialog.setTitle(getResources().getString(R.string.problem_has_been_detected));
alertDialog.setMessage(getResources().getString(R.string.you_have_not_added_any_storage_devices));
alertDialog.setCancelable(true);
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.continuetext), (dialog, which) -> {
checkJsonFile();
});
alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), (dialog, which) -> {
});
alertDialog.show();
}
}
}
startCreateVM();
}
});
@ -506,34 +446,25 @@ public class CustomRomActivity extends AppCompatActivity {
startActivityForResult(intent, 1001);
} else {
AlertDialog ad = new AlertDialog.Builder(CustomRomActivity.this, R.style.MainDialogTheme).create();
ad.setTitle(getString(R.string.change_thumbnail));
ad.setMessage(getString(R.string.do_you_want_to_change_or_remove));
ad.setButton(Dialog.BUTTON_NEGATIVE, getString(R.string.change), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image/*");
DialogUtils.twoDialog(CustomRomActivity.this, getString(R.string.change_thumbnail), getString(R.string.do_you_want_to_change_or_remove), getString(R.string.change), getString(R.string.remove), true, R.drawable.photo_24px, true,
() -> {
Intent intent = new Intent(ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image/*");
// Optionally, specify a URI for the file that should appear in the
// system file picker when it loads.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, Environment.DIRECTORY_DOWNLOADS);
}
// Optionally, specify a URI for the file that should appear in the
// system file picker when it loads.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, Environment.DIRECTORY_DOWNLOADS);
}
startActivityForResult(intent, 1001);
ad.dismiss();
}
});
ad.setButton(Dialog.BUTTON_POSITIVE, getString(R.string.remove), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
thumbnailPath = "";
ivAddThubnail.setImageResource(R.drawable.round_add_24);
VMManager.setIconWithName(ivIcon, Objects.requireNonNull(title.getText()).toString());
ad.dismiss();
}
});
ad.show();
startActivityForResult(intent, 1001);
},
() -> {
thumbnailPath = "";
ivAddThubnail.setImageResource(R.drawable.round_add_24);
VMManager.setIconWithName(ivIcon, Objects.requireNonNull(title.getText()).toString());
}, null);
}
}
});
@ -542,7 +473,7 @@ public class CustomRomActivity extends AppCompatActivity {
lineardisclaimer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
UIUtils.oneDialogWithCustomButtonPositive(getString(R.string.dont_miss_out), getString(R.string.disclaimer_when_using_rom), getString(R.string.i_agree), false, false, CustomRomActivity.this);
DialogUtils.oneDialog(CustomRomActivity.this, getResources().getString(R.string.oops), getResources().getString(R.string.disclaimer_when_using_rom), getResources().getString(R.string.i_agree), true, R.drawable.verified_user_24px, true, null, null);
}
});
@ -564,8 +495,8 @@ public class CustomRomActivity extends AppCompatActivity {
//Matcher matcher = pattern.matcher(current.itemExtra);
//if (matcher.find()) {
//String cdromPath = matcher.group(1);
//cdrom.setText(cdromPath);
//String cdromPath = matcher.group(1);
//cdrom.setText(cdromPath);
//}
qemu.setText(current.itemExtra);
@ -922,126 +853,34 @@ public class CustomRomActivity extends AppCompatActivity {
}
private void startCreateVM() {
//errorjsondialog();
File isoFile = new File(Objects.requireNonNull(cdrom.getText()).toString());
if (isoFile.exists() && !Objects.requireNonNull(qemu.getText()).toString().contains(cdrom.getText().toString())) {
isoFile.delete();
}
if (modify) {
int position = getIntent().getIntExtra("POS", 0);
final File jsonFile = new File(AppConfig.romsdatajson);
current.itemDrv1 = Objects.requireNonNull(drive.getText()).toString();
current.itemExtra = Objects.requireNonNull(qemu.getText()).toString();
try {
JSONObject jObj = MainActivity.jArray.getJSONObject(position);
jObj.put("imgName", Objects.requireNonNull(title.getText()).toString());
jObj.put("imgIcon", Objects.requireNonNull(icon.getText()).toString());
jObj.put("imgPath", drive.getText().toString());
jObj.put("imgExtra", qemu.getText().toString());
MainActivity.jArray.put(position, jObj);
} catch (JSONException e) {
throw new RuntimeException(e);
}
try {
Writer output = null;
output = new BufferedWriter(new FileWriter(jsonFile));
output.write(MainActivity.jArray.toString());
output.close();
} catch (Exception e) {
UIUtils.toastLong(CustomRomActivity.this, e.toString());
} finally {
MainActivity.loadDataVbi();
finish();
//activity.startActivity(new Intent(activity, SplashActivity.class));
}
if (Objects.requireNonNull(title.getText()).toString().isEmpty()) {
DialogUtils.oneDialog(CustomRomActivity.this, getString(R.string.oops), getString(R.string.need_set_name), getString(R.string.ok), true, R.drawable.error_96px, true, null, null);
} else {
String CREDENTIAL_SHARED_PREF = "settings_prefs";
SharedPreferences credentials = activity.getSharedPreferences(CREDENTIAL_SHARED_PREF, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = credentials.edit();
editor.putBoolean("isFirstLaunch", Boolean.TRUE);
editor.apply();
whenProcessing(true);
final File jsonFile = new File(AppConfig.romsdatajson);
RomsJso obj = new RomsJso();
if (jsonFile.exists()) {
try {
List<DataMainRoms> data = new ArrayList<>();
JSONArray jArray = null;
jArray = new JSONArray(FileUtils.readFromFile(CustomRomActivity.this, jsonFile));
String _contentDialog = "";
if (qemu.getText().toString().isEmpty()) {
_contentDialog = getResources().getString(R.string.qemu_params_is_empty);
}
try {
// Extract data from json and store into ArrayList as class objects
for (int i = 0; i < jArray.length(); i++) {
JSONObject json_data = jArray.getJSONObject(i);
DataMainRoms romsMainData = new DataMainRoms();
romsMainData.itemName = json_data.getString("imgName");
romsMainData.itemIcon = json_data.getString("imgIcon");
romsMainData.itemPath = json_data.getString("imgPath");
romsMainData.itemExtra = json_data.getString("imgExtra");
data.add(romsMainData);
}
} catch (JSONException e) {
Toast.makeText(CustomRomActivity.this, e.toString(), Toast.LENGTH_LONG).show();
if ((Objects.requireNonNull(drive.getText()).toString().isEmpty()) && (Objects.requireNonNull(cdrom.getText()).toString().isEmpty())) {
if (!VMManager.isHaveADisk(Objects.requireNonNull(qemu.getText()).toString())) {
if (!_contentDialog.isEmpty()) {
_contentDialog += "\n\n";
}
_contentDialog += getResources().getString(R.string.you_have_not_added_any_storage_devices);
}
JSONObject jsonObject = obj.makeJSONObject(Objects.requireNonNull(title.getText()).toString(), Objects.requireNonNull(icon.getText()).toString(), MainSettingsManager.getArch(activity), drive.getText().toString(), qemu.getText().toString());
jArray.put(jsonObject);
try {
Writer output = null;
output = new BufferedWriter(new FileWriter(jsonFile));
//output.write(jArray.toString().replace("\\", "").replace("//", "/"));
output.write(jArray.toString());
output.close();
} catch (Exception e) {
UIUtils.toastLong(activity, e.toString());
whenProcessing(false);
}
} catch (JSONException e) {
whenProcessing(false);
throw new RuntimeException(e);
}
} else {
JSONObject jsonObject = obj.makeJSONObject(Objects.requireNonNull(title.getText()).toString(), Objects.requireNonNull(icon.getText()).toString(), MainSettingsManager.getArch(activity), drive.getText().toString(), qemu.getText().toString());
JSONArray jsonArray = new JSONArray();
jsonArray.put(jsonObject);
try {
Writer output = null;
output = new BufferedWriter(new FileWriter(jsonFile));
//output.write(jsonArray.toString().replace("\\", "").replace("//", "/"));
output.write(jsonArray.toString());
output.close();
} catch (Exception e) {
UIUtils.toastLong(activity, e.toString());
}
VectrasStatus.logInfo("Welcome to Vectras ♡");
}
if (getIntent().hasExtra("addromnow")) {
RomsManagerActivity.isFinishNow = true;
}
finish();
//activity.startActivity(new Intent(activity, SplashActivity.class));
}
if (!previousName.isEmpty() && !title.getText().toString().equals(previousName)) {
if (FileUtils.isFileExists(AppConfig.vmFolder + previousName + "/vmID.txt")) {
FileUtils.copyAFile(AppConfig.vmFolder + previousName + "/vmID.txt", AppConfig.vmFolder + vmID + "/vmID.txt");
if (_contentDialog.isEmpty()) {
checkJsonFile();
} else {
FileUtils.writeToFile(AppConfig.vmFolder + title.getText().toString(), "/vmID.txt", VMManager.idGenerator());
FileUtils.copyAFile(AppConfig.vmFolder + vmID + "/vmID.txt", AppConfig.vmFolder + previousName + "/vmID.txt");
DialogUtils.twoDialog(CustomRomActivity.this, getString(R.string.problem_has_been_detected), _contentDialog, getString(R.string.continuetext), getString(R.string.cancel), true, R.drawable.warning_48px, true,
() ->{
checkJsonFile();
finish();
}, null, null);
}
} else {
FileUtils.writeToFile(AppConfig.vmFolder + title.getText().toString(), "/vmID.txt", VMManager.idGenerator());
}
if ((!secondVMdirectory.isEmpty()) && FileUtils.isFileExists(AppConfig.vmFolder + vmID + "/vmID.txt")) {
if (!(AppConfig.vmFolder + title.getText().toString()).equals(secondVMdirectory)) {
FileUtils.copyAFile(AppConfig.vmFolder + vmID + "/vmID.txt", secondVMdirectory + "/vmID.txt");
}
}
}
private void startCreateNewVM() {
@ -1059,7 +898,7 @@ public class CustomRomActivity extends AppCompatActivity {
}
modify = false;
if(!MainActivity.isActivate) {
if (!MainActivity.isActivate) {
startActivity(new Intent(CustomRomActivity.this, SplashActivity.class));
} else {
Intent openURL = new Intent();
@ -1113,9 +952,10 @@ public class CustomRomActivity extends AppCompatActivity {
//Error code: CR_CVBI1
if (!FileUtils.isFileExists(_filepath)) {
if (getIntent().hasExtra("addromnow")) {
UIUtils.oneDialog(getResources().getString(R.string.oops), getResources().getString(R.string.error_CR_CVBI1), false, true, this);
DialogUtils.oneDialog(CustomRomActivity.this, getResources().getString(R.string.oops), getResources().getString(R.string.error_CR_CVBI1), getResources().getString(R.string.ok), true, R.drawable.error_96px, true,
this::finish, this::finish);
} else {
UIUtils.oneDialog(getResources().getString(R.string.oops), getResources().getString(R.string.error_CR_CVBI1), true, false, this);
DialogUtils.oneDialog(CustomRomActivity.this, getResources().getString(R.string.oops), getResources().getString(R.string.error_CR_CVBI1), getResources().getString(R.string.ok), true, R.drawable.error_96px, true, null, null);
}
return;
}
@ -1127,6 +967,33 @@ public class CustomRomActivity extends AppCompatActivity {
whenProcessing(true);
custom.setVisibility(View.GONE);
ivIcon.setEnabled(false);
zipFileSize = FileUtils.getFileSize(_filepath);
ZipUtils.reset();
timerTask = new TimerTask() {
@Override
public void run() {
runOnUiThread(new Runnable() {
@Override
public void run() {
folderSize = FileUtils.getFolderSize(AppConfig.vmFolder + vmID);
decompressionProgress = ZipUtils.getDecompressionProgress(folderSize, zipFileSize);
if (decompressionProgress > 0) {
if (decompressionProgress > 98) {
linearprogress.setIndeterminate(true);
} else {
linearprogress.setProgressCompat(ZipUtils.getDecompressionProgress(folderSize, zipFileSize), true);
}
textviewprogress.setText(getResources().getString(R.string.about) + " " + String.valueOf(ZipUtils.getRemainingDecompressionTime(folderSize, zipFileSize)) + " " + getResources().getString(R.string.seconds_left));
}
}
});
}
};
_timer.schedule(timerTask, 0, 1000);
Thread t = new Thread() {
public void run() {
FileInputStream zipFile = null;
@ -1192,9 +1059,10 @@ public class CustomRomActivity extends AppCompatActivity {
t.start();
} else {
if (getIntent().hasExtra("addromnow")) {
UIUtils.oneDialog(getResources().getString(R.string.problem_has_been_detected), getResources().getString(R.string.format_not_supported_please_select_file_with_format_cvbi), false, true, this);
DialogUtils.oneDialog(CustomRomActivity.this, getResources().getString(R.string.problem_has_been_detected), getResources().getString(R.string.format_not_supported_please_select_file_with_format_cvbi), getResources().getString(R.string.ok), true, R.drawable.error_96px, true,
this::finish, this::finish);
} else {
UIUtils.oneDialog(getResources().getString(R.string.problem_has_been_detected), getResources().getString(R.string.format_not_supported_please_select_file_with_format_cvbi), true, false, this);
DialogUtils.oneDialog(CustomRomActivity.this, getResources().getString(R.string.problem_has_been_detected), getResources().getString(R.string.format_not_supported_please_select_file_with_format_cvbi), getResources().getString(R.string.ok), true, R.drawable.error_96px, true, null, null);
}
}
@ -1210,24 +1078,14 @@ public class CustomRomActivity extends AppCompatActivity {
if (VMManager.isADiskFile(selectedFilePath.getPath())) {
startProcessingHardDriveFile(_content_describer, _addtodrive);
} else {
alertDialog = new AlertDialog.Builder(activity, R.style.MainDialogTheme).create();
alertDialog.setTitle(getResources().getString(R.string.problem_has_been_detected));
alertDialog.setMessage(getResources().getString(R.string.file_format_is_not_supported));
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.continuetext), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
startProcessingHardDriveFile(_content_describer, _addtodrive);
}
});
alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
alertDialog.dismiss();
}
});
alertDialog.show();
DialogUtils.twoDialog(CustomRomActivity.this, getString(R.string.problem_has_been_detected), getString(R.string.file_format_is_not_supported), getResources().getString(R.string.continuetext), getResources().getString(R.string.cancel), true, R.drawable.hard_drive_24px, true,
() -> {
startProcessingHardDriveFile(_content_describer, _addtodrive);
}, null, null);
}
}
private void startProcessingHardDriveFile (Uri _content_describer, boolean _addtodrive) {
private void startProcessingHardDriveFile(Uri _content_describer, boolean _addtodrive) {
File selectedFilePath = new File(getPath(_content_describer));
if (MainSettingsManager.copyFile(activity)) {
LinearLayout custom = findViewById(R.id.custom);
@ -1298,9 +1156,9 @@ public class CustomRomActivity extends AppCompatActivity {
private String cdromPatternCompile() {
//Matches any string of characters that does not contain single quotes
if (MainSettingsManager.getArch(activity).equals("ARM64")) {
return "-device usb-storage,drive=cdrom -drive if=none,id=cdrom,format=raw,media=cdrom,file='([^']*)'";
return "-device usb-storage,drive=cdrom -drive if=none,id=cdrom,format=raw,media=cdrom,file='([^']*)'";
} else if (MainSettingsManager.getIfType(activity).isEmpty()) {
return "-cdrom '([^']*)'";
return "-cdrom '([^']*)'";
} else {
return "-drive index=1,media=cdrom,file='([^']*)'";
}
@ -1309,9 +1167,9 @@ public class CustomRomActivity extends AppCompatActivity {
private String cdromPatternCompile2() {
//Matches any string of characters, but will try to match the shortest string possible
if (MainSettingsManager.getArch(activity).equals("ARM64")) {
return "-device usb-storage,drive=cdrom -drive if=none,id=cdrom,format=raw,media=cdrom,file='(.*?)'";
return "-device usb-storage,drive=cdrom -drive if=none,id=cdrom,format=raw,media=cdrom,file='(.*?)'";
} else if (MainSettingsManager.getIfType(activity).isEmpty()) {
return "-cdrom '(.*?)'";
return "-cdrom '(.*?)'";
} else {
return "-drive index=1,media=cdrom,file='(.*?)'";
}
@ -1352,6 +1210,8 @@ public class CustomRomActivity extends AppCompatActivity {
if (_isProcessing) {
mainlayout.setVisibility(View.GONE);
appbar.setVisibility(View.GONE);
linearprogress.setIndeterminate(true);
textviewprogress.setText(getResources().getString(R.string.processing_this_may_take_a_few_minutes));
} else {
mainlayout.setVisibility(View.VISIBLE);
appbar.setVisibility(View.VISIBLE);
@ -1361,9 +1221,9 @@ public class CustomRomActivity extends AppCompatActivity {
private void thumbnailProcessing() {
if (!thumbnailPath.isEmpty()) {
ivAddThubnail.setImageResource(R.drawable.round_edit_24);
File imgFile = new File(thumbnailPath);
File imgFile = new File(thumbnailPath);
if(imgFile.exists()){
if (imgFile.exists()) {
Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
ivIcon.setImageBitmap(myBitmap);
} else {
@ -1387,9 +1247,10 @@ public class CustomRomActivity extends AppCompatActivity {
if (!romDir.exists()) {
if (!romDir.mkdirs()) {
if (getIntent().hasExtra("addromnow")) {
UIUtils.oneDialog(getResources().getString(R.string.oops), getResources().getString(R.string.unable_to_create_the_directory_to_create_the_vm), false, true, this);
DialogUtils.oneDialog(CustomRomActivity.this, getResources().getString(R.string.oops), getResources().getString(R.string.unable_to_create_the_directory_to_create_the_vm), getResources().getString(R.string.ok), true, R.drawable.error_96px, true,
this::finish, this::finish);
} else {
UIUtils.oneDialog(getResources().getString(R.string.oops), getResources().getString(R.string.unable_to_create_the_directory_to_create_the_vm), true, false, this);
DialogUtils.oneDialog(CustomRomActivity.this, getResources().getString(R.string.oops), getResources().getString(R.string.unable_to_create_the_directory_to_create_the_vm), getResources().getString(R.string.ok), true, R.drawable.error_96px, true, null, null);
}
return false;
} else {
@ -1401,6 +1262,9 @@ public class CustomRomActivity extends AppCompatActivity {
}
private void afterExtractCVBIFile(String _filename) {
if (timerTask != null) {
timerTask.cancel();
}
LinearLayout custom = findViewById(R.id.custom);
whenProcessing(false);
custom.setVisibility(View.VISIBLE);
@ -1442,13 +1306,14 @@ public class CustomRomActivity extends AppCompatActivity {
VMManager.setArch("X86_64", CustomRomActivity.this);
}
UIUtils.oneDialog(getResources().getString(R.string.oops), getResources().getString(R.string.error_CR_CVBI2), true, false, CustomRomActivity.this);
DialogUtils.oneDialog(CustomRomActivity.this, getResources().getString(R.string.oops), getResources().getString(R.string.error_CR_CVBI2), getResources().getString(R.string.ok), true, R.drawable.warning_48px, true, null, null);
} else {
//Error code: CR_CVBI3
if (getIntent().hasExtra("addromnow")) {
UIUtils.oneDialog(getResources().getString(R.string.oops), getResources().getString(R.string.error_CR_CVBI3), false, true, CustomRomActivity.this);
DialogUtils.oneDialog(CustomRomActivity.this, getResources().getString(R.string.oops), getResources().getString(R.string.error_CR_CVBI3), getResources().getString(R.string.ok), true, R.drawable.error_96px, true,
this::finish, this::finish);
} else {
UIUtils.oneDialog(getResources().getString(R.string.oops), getResources().getString(R.string.error_CR_CVBI3), true, false, CustomRomActivity.this);
DialogUtils.oneDialog(CustomRomActivity.this, getResources().getString(R.string.oops), getResources().getString(R.string.error_CR_CVBI3), getResources().getString(R.string.ok), true, R.drawable.error_96px, true, null, null);
}
}
} else {

View file

@ -26,6 +26,7 @@ import com.google.gson.reflect.TypeToken;
import com.vectras.vm.utils.FileUtils;
import com.vectras.vm.utils.PackageUtils;
import com.vectras.vm.utils.UIUtils;
import com.vectras.vm.utils.ZipUtils;
import org.checkerframework.checker.guieffect.qual.UI;
import org.zeroturnaround.zip.FileSource;
@ -66,6 +67,7 @@ public class ExportRomActivity extends AppCompatActivity {
private double folderSizeMB = 0;
private LinearProgressIndicator progressBar;
private TextView textviewsettingup;
private int compressionProgress = 0;
@Override
@ -224,8 +226,12 @@ public class ExportRomActivity extends AppCompatActivity {
FileUtils.writeToFile(new File(String.valueOf(getApplicationContext().getExternalFilesDir("data"))).getPath(), "rom-data.json", new Gson().toJson(mapForGetData));
folderSize = FileUtils.getFolderSize(getRomPath);
folderSizeMB = (folderSize / (1024 * 10.24)) / 2;
//folderSize = FileUtils.getFolderSize(getRomPath);
//folderSizeMB = (folderSize / (1024 * 10.24)) / 2;
folderSize = FileUtils.getFileSize(diskfile);
folderSize += FileUtils.getFileSize(cdromfile);
folderSize += FileUtils.getFileSize(iconfile);
ZipUtils.reset();
timerTask = new TimerTask() {
@Override
@ -234,22 +240,14 @@ public class ExportRomActivity extends AppCompatActivity {
@Override
public void run() {
zipFileSize = FileUtils.getFileSize(FileUtils.getExternalFilesDirectory(getApplicationContext()).getPath() + "/cvbi/" + Objects.requireNonNull(mapForGetData.get("title")).toString() + ".cvbi");
double zipFileSizeMB = zipFileSize / (1024 * 1024);
double currentProgress = (100 / folderSizeMB) * zipFileSizeMB;
if ((100 / folderSizeMB) * zipFileSizeMB < 0) {
if ((int)currentProgress != (int)zipprogresslast) {
zipprogress++ ;
compressionProgress = ZipUtils.getCompressionProgress(folderSize, zipFileSize);
if (compressionProgress > 0) {
if (compressionProgress > 98) {
progressBar.setIndeterminate(true);
} else {
progressBar.setProgressCompat(compressionProgress, true);
}
} else {
zipprogress = currentProgress;
}
if (zipprogress > 99) {
zipprogress = 99;
}
zipprogresslast = currentProgress;
if (folderSize > 0 || zipFileSize > 0) {
progressBar.setProgressCompat((int) zipprogress, true);
textviewsettingup.setText(String.valueOf((int) zipprogress) + "% completed.");
textviewsettingup.setText(getResources().getString(R.string.about) + " " + String.valueOf(ZipUtils.getRemainingCompressionTime(folderSize, zipFileSize)) + " " + getResources().getString(R.string.seconds_left));
}
}
});

View file

@ -10,6 +10,7 @@ import static com.vectras.vm.utils.LibraryChecker.isPackageInstalled2;
import static com.vectras.vm.utils.UIUtils.UIAlert;
import com.vectras.vm.utils.CommandUtils;
import com.vectras.vm.utils.DialogUtils;
import com.vectras.vm.utils.PermissionUtils;
import android.androidVNC.androidVNC;
@ -582,43 +583,8 @@ public class MainActivity extends AppCompatActivity {
public void onInitializationComplete(InitializationStatus initializationStatus) {
}
});
if (Config.debug)
UIAlert(activity, getString(R.string.debug_testing_build_5), getString(R.string.welcome_to_debug_build_of_vectras_vm_br) +
getString(R.string.this_version_unstable_and_has_alot_of_bugs_br) +
getString(R.string.don_t_forget_to_tell_us_on_github_issues_or_telegram_bot_br) +
getString(R.string.a_href_https_t_me_vectras_protect_bot_telegram_report_bot_a_br) +
getString(R.string.a_href_https_github_com_epicstudios856_vectras_vm_android_issues_github_issues_page_a_br));
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
if (!prefs.getBoolean("tgDialog", false)) {
AlertDialog alertDialog;
alertDialog = new AlertDialog.Builder(activity, R.style.MainDialogTheme).create();
alertDialog.setTitle(getString(R.string.join_us_on_telegram));
alertDialog.setMessage(getString(R.string.join_us_on_telegram_where_we_publish_all_the_news_and_updates_and_receive_your_opinions_and_bugs));
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, getString(R.string.join), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
String tg = "https://t.me/vectras_os";
Intent f = new Intent(ACTION_VIEW);
f.setData(Uri.parse(tg));
startActivity(f);
return;
}
});
alertDialog.setButton(DialogInterface.BUTTON_NEUTRAL, getString(R.string.cancel), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
return;
}
});
alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getString(R.string.dont_show_again), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
SharedPreferences.Editor edit = prefs.edit();
edit.putBoolean("tgDialog", true);
edit.apply();
return;
}
});
alertDialog.show();
}
DialogUtils.joinTelegram(activity);
totalRam = findViewById(R.id.totalRam);
usedRam = findViewById(R.id.usedRam);
@ -993,22 +959,22 @@ public class MainActivity extends AppCompatActivity {
public static void startVM(String vmName, String env, String itemExtra, String itemPath) {
timerTask = new TimerTask() {
@Override
public void run() {
ActivityManager manager = (ActivityManager) activity.getSystemService(ACTIVITY_SERVICE);
for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
if (!AudioStreamService.class.getName().equals(service.service.getClassName())) {
if (SDK_INT >= Build.VERSION_CODES.O) {
activity.startForegroundService(new Intent(activity, AudioStreamService.class));
} else {
activity.startService(new Intent(activity, AudioStreamService.class));
}
}
}
}
};
timer.schedule(timerTask, 5000);
// timerTask = new TimerTask() {
// @Override
// public void run() {
// ActivityManager manager = (ActivityManager) activity.getSystemService(ACTIVITY_SERVICE);
// for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
// if (!AudioStreamService.class.getName().equals(service.service.getClassName())) {
// if (SDK_INT >= Build.VERSION_CODES.O) {
// activity.startForegroundService(new Intent(activity, AudioStreamService.class));
// } else {
// activity.startService(new Intent(activity, AudioStreamService.class));
// }
// }
// }
// }
// };
// timer.schedule(timerTask, 5000);
File romDir = new File(Config.getCacheDir()+ "/" + Config.vmID);
romDir.mkdirs();

View file

@ -38,6 +38,7 @@ import androidx.core.view.WindowInsetsCompat;
import com.termux.app.TermuxService;
import com.vectras.qemu.MainSettingsManager;
import com.vectras.vm.utils.CommandUtils;
import com.vectras.vm.utils.DialogUtils;
import com.vectras.vm.utils.FileUtils;
import com.vectras.vm.utils.ListUtils;
import com.vectras.vm.utils.PackageUtils;
@ -82,167 +83,95 @@ public class Minitools extends AppCompatActivity {
setupsoundfortermux.setOnClickListener(v -> {
if (PackageUtils.isInstalled("com.termux", getApplicationContext())) {
AlertDialog alertDialog = new AlertDialog.Builder(Minitools.this, R.style.MainDialogTheme).create();
alertDialog.setTitle(getResources().getString(R.string.setup_sound));
alertDialog.setMessage(getResources().getString(R.string.setup_sound_guide_content));
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.start_setup), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("Setup", "curl -o setup.sh https://raw.githubusercontent.com/AnBui2004/termux/refs/heads/main/installpulseaudio.sh && chmod +rwx setup.sh && ./setup.sh && rm setup.sh");
clipboard.setPrimaryClip(clip);
Intent intent = new Intent();
intent.setAction(ACTION_VIEW);
intent.setData(Uri.parse("android-app://com.termux"));
startActivity(intent);
Toast.makeText(getApplicationContext(), getResources().getString(R.string.copied), Toast.LENGTH_LONG).show();
return;
}
});
alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
alertDialog.dismiss();
}
});
alertDialog.show();
DialogUtils.twoDialog(Minitools.this, getString(R.string.setup_sound), getResources().getString(R.string.setup_sound_guide_content), getString(R.string.start_setup), getString(R.string.cancel), true, R.drawable.volume_up_24px, true,
() -> {
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("Setup", "curl -o setup.sh https://raw.githubusercontent.com/AnBui2004/termux/refs/heads/main/installpulseaudio.sh && chmod +rwx setup.sh && ./setup.sh && rm setup.sh");
clipboard.setPrimaryClip(clip);
Intent intent = new Intent();
intent.setAction(ACTION_VIEW);
intent.setData(Uri.parse("android-app://com.termux"));
startActivity(intent);
Toast.makeText(getApplicationContext(), getResources().getString(R.string.copied), Toast.LENGTH_LONG).show();
}, null, null);
} else {
AlertDialog alertDialog = new AlertDialog.Builder(Minitools.this, R.style.MainDialogTheme).create();
alertDialog.setTitle(getResources().getString(R.string.termux_is_not_installed));
alertDialog.setMessage(getResources().getString(R.string.you_need_to_install_termux));
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.install), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent();
intent.setAction(ACTION_VIEW);
intent.setData(Uri.parse("https://github.com/termux/termux-app/releases"));
startActivity(intent);
return;
}
});
alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
alertDialog.dismiss();
}
});
alertDialog.show();
DialogUtils.twoDialog(Minitools.this, getString(R.string.termux_is_not_installed), getResources().getString(R.string.you_need_to_install_termux), getString(R.string.install), getString(R.string.cancel), true, R.drawable.arrow_downward_24px, true,
() -> {
Intent intent = new Intent();
intent.setAction(ACTION_VIEW);
intent.setData(Uri.parse("https://github.com/termux/termux-app/releases"));
startActivity(intent);
}, null, null);
}
});
cleanup.setOnClickListener(v -> {
AlertDialog alertDialog = new AlertDialog.Builder(Minitools.this, R.style.MainDialogTheme).create();
alertDialog.setTitle(getResources().getString(R.string.clean_up));
alertDialog.setMessage(getResources().getString(R.string.clean_up_content));
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.clean_up), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
VMManager.cleanUp();
Toast.makeText(getApplicationContext(), getResources().getString(R.string.done), Toast.LENGTH_LONG).show();
restore.setVisibility(GONE);
cleanup.setVisibility(GONE);
}
});
alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
alertDialog.dismiss();
}
});
alertDialog.show();
DialogUtils.twoDialog(Minitools.this, getResources().getString(R.string.clean_up), getResources().getString(R.string.clean_up_content), getResources().getString(R.string.clean_up), getResources().getString(R.string.cancel), true, R.drawable.cleaning_services_24px, true,
() -> {
VMManager.cleanUp();
Toast.makeText(getApplicationContext(), getResources().getString(R.string.done), Toast.LENGTH_LONG).show();
restore.setVisibility(GONE);
cleanup.setVisibility(GONE);
}, null, null);
});
restore.setOnClickListener(v -> {
AlertDialog alertDialog = new AlertDialog.Builder(Minitools.this, R.style.MainDialogTheme).create();
alertDialog.setTitle(getResources().getString(R.string.restore));
alertDialog.setMessage(getResources().getString(R.string.restore_content));
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.continuetext), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
VMManager.restoreVMs();
UIUtils.oneDialog(getResources().getString(R.string.done), getResources().getString(R.string.restored) + " " + String.valueOf(VMManager.restoredVMs) + ".", true, false, Minitools.this);
restore.setVisibility(GONE);
}
});
alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
alertDialog.dismiss();
}
});
alertDialog.show();
DialogUtils.twoDialog(Minitools.this, getResources().getString(R.string.restore), getResources().getString(R.string.restore_content), getResources().getString(R.string.continuetext), getResources().getString(R.string.cancel), true, R.drawable.settings_backup_restore_24px, true,
() -> {
VMManager.restoreVMs();
UIUtils.oneDialog(getResources().getString(R.string.done), getResources().getString(R.string.restored) + " " + String.valueOf(VMManager.restoredVMs) + ".", true, false, Minitools.this);
restore.setVisibility(GONE);
}, null, null);
});
deleteallvm.setOnClickListener(v -> {
AlertDialog alertDialog = new AlertDialog.Builder(Minitools.this, R.style.MainDialogTheme).create();
alertDialog.setTitle(getResources().getString(R.string.delete_all_vm));
alertDialog.setMessage(getResources().getString(R.string.delete_all_vm_content));
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.delete_all), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
VMManager.killallqemuprocesses(getApplicationContext());
FileUtils.deleteDirectory(AppConfig.vmFolder);
FileUtils.deleteDirectory(AppConfig.recyclebin);
FileUtils.deleteDirectory(AppConfig.romsdatajson);
File vDir = new File(AppConfig.maindirpath);
vDir.mkdirs();
FileUtils.writeToFile(AppConfig.maindirpath, "roms-data.json", "[]");
cleanup.setVisibility(GONE);
restore.setVisibility(GONE);
deleteallvm.setVisibility(GONE);
Toast.makeText(getApplicationContext(), getResources().getString(R.string.done), Toast.LENGTH_LONG).show();
}
});
alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
alertDialog.dismiss();
}
});
alertDialog.show();
DialogUtils.twoDialog(Minitools.this, getResources().getString(R.string.delete_all_vm), getResources().getString(R.string.delete_all_vm_content), getResources().getString(R.string.delete_all), getResources().getString(R.string.cancel), true, R.drawable.delete_24px, true,
() -> {
VMManager.killallqemuprocesses(getApplicationContext());
FileUtils.deleteDirectory(AppConfig.vmFolder);
FileUtils.deleteDirectory(AppConfig.recyclebin);
FileUtils.deleteDirectory(AppConfig.romsdatajson);
File vDir = new File(AppConfig.maindirpath);
vDir.mkdirs();
FileUtils.writeToFile(AppConfig.maindirpath, "roms-data.json", "[]");
cleanup.setVisibility(GONE);
restore.setVisibility(GONE);
deleteallvm.setVisibility(GONE);
Toast.makeText(getApplicationContext(), getResources().getString(R.string.done), Toast.LENGTH_LONG).show();
}, null, null);
});
deleteall.setOnClickListener(v -> {
AlertDialog alertDialog = new AlertDialog.Builder(Minitools.this, R.style.MainDialogTheme).create();
alertDialog.setTitle(getResources().getString(R.string.delete_all));
alertDialog.setMessage(getResources().getString(R.string.delete_all_content));
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.delete_all), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
VMManager.killallqemuprocesses(getApplicationContext());
FileUtils.deleteDirectory(AppConfig.maindirpath);
File vDir = new File(AppConfig.maindirpath);
vDir.mkdirs();
FileUtils.writeToFile(AppConfig.maindirpath, "roms-data.json", "[]");
cleanup.setVisibility(GONE);
restore.setVisibility(GONE);
deleteallvm.setVisibility(GONE);
deleteall.setVisibility(GONE);
Toast.makeText(getApplicationContext(), getResources().getString(R.string.done), Toast.LENGTH_LONG).show();
}
});
alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
alertDialog.dismiss();
}
});
alertDialog.show();
DialogUtils.twoDialog(Minitools.this, getResources().getString(R.string.delete_all), getResources().getString(R.string.delete_all_content), getResources().getString(R.string.delete_all), getResources().getString(R.string.cancel), true, R.drawable.delete_forever_24px, true,
() -> {
VMManager.killallqemuprocesses(getApplicationContext());
FileUtils.deleteDirectory(AppConfig.maindirpath);
File vDir = new File(AppConfig.maindirpath);
vDir.mkdirs();
FileUtils.writeToFile(AppConfig.maindirpath, "roms-data.json", "[]");
cleanup.setVisibility(GONE);
restore.setVisibility(GONE);
deleteallvm.setVisibility(GONE);
deleteall.setVisibility(GONE);
Toast.makeText(getApplicationContext(), getResources().getString(R.string.done), Toast.LENGTH_LONG).show();
}, null, null);
});
reinstallsystem.setOnClickListener(v -> {
AlertDialog alertDialog = new AlertDialog.Builder(Minitools.this, R.style.MainDialogTheme).create();
alertDialog.setTitle(getResources().getString(R.string.reinstall_system));
alertDialog.setMessage(getResources().getString(R.string.reinstall_system_content));
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.continuetext), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
MainActivity.isActivate = false;
AppConfig.needreinstallsystem = true;
VMManager.killallqemuprocesses(Minitools.this);
FileUtils.deleteDirectory(getFilesDir().getAbsolutePath() + "/data");
FileUtils.deleteDirectory(getFilesDir().getAbsolutePath() + "/distro");
FileUtils.deleteDirectory(getFilesDir().getAbsolutePath() + "/usr");
Intent intent = new Intent();
intent.setClass(Minitools.this, SetupQemuActivity.class);
startActivity(intent);
finish();
}
});
alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
alertDialog.dismiss();
}
});
alertDialog.show();
DialogUtils.twoDialog(Minitools.this, getResources().getString(R.string.reinstall_system), getResources().getString(R.string.reinstall_system_content), getResources().getString(R.string.continuetext), getResources().getString(R.string.cancel), true, R.drawable.system_update_24px, true,
() -> {
MainActivity.isActivate = false;
AppConfig.needreinstallsystem = true;
VMManager.killallqemuprocesses(Minitools.this);
FileUtils.deleteDirectory(getFilesDir().getAbsolutePath() + "/data");
FileUtils.deleteDirectory(getFilesDir().getAbsolutePath() + "/distro");
FileUtils.deleteDirectory(getFilesDir().getAbsolutePath() + "/usr");
Intent intent = new Intent();
intent.setClass(Minitools.this, SetupQemuActivity.class);
startActivity(intent);
finish();
}, null, null);
});
spinnerselectmirror.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {

View file

@ -110,7 +110,7 @@ public class SetupQemuActivity extends AppCompatActivity implements View.OnClick
private HashMap<String, Object> mmap = new HashMap<>();
private String bootstrapfilelink = "";
private ArrayList<HashMap<String, String>> listmapForSelectMirrors = new ArrayList<>();
private String selectedMirrorCommand = "";
private String selectedMirrorCommand = "echo ";
private String selectedMirrorLocation = "";
private String downloadBootstrapsCommand = "";
private boolean aria2Error = false;

View file

@ -1,9 +1,17 @@
package com.vectras.vm.utils;
import static android.content.Intent.ACTION_VIEW;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import androidx.preference.PreferenceManager;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.vectras.vm.R;
public class DialogUtils {
@ -95,4 +103,25 @@ public class DialogUtils {
});
dialog.show();
}
public static void joinTelegram(Activity _activity) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(_activity);
if (!prefs.getBoolean("tgDialog", false)) {
threeDialog(_activity, _activity.getResources().getString(R.string.join_us_on_telegram),
_activity.getResources().getString(R.string.join_us_on_telegram_where_we_publish_all_the_news_and_updates_and_receive_your_opinions_and_bugs),
_activity.getResources().getString(R.string.join), _activity.getResources().getString(R.string.cancel), _activity.getResources().getString(R.string.dont_show_again),
true, R.drawable.send_24px, true,
() -> {
String tg = "https://t.me/vectras_os";
Intent f = new Intent(ACTION_VIEW);
f.setData(Uri.parse(tg));
_activity.startActivity(f);
}, null,
() -> {
SharedPreferences.Editor edit = prefs.edit();
edit.putBoolean("tgDialog", true);
edit.apply();
}, null);
}
}
}

View file

@ -735,9 +735,12 @@ public class FileUtils {
}
}
public static int getFileSize (String _path) {
public static int getFileSize(String _path) {
try {
File file = new File(_path);
if (!file.exists()) {
return 0;
}
return (int) file.length();
} catch (Exception _e) {
return 0;

View file

@ -21,24 +21,17 @@ public class PermissionUtils {
return true;
} else {
if (request) {
AlertDialog alertDialog = new AlertDialog.Builder(activity, R.style.MainDialogTheme).create();
alertDialog.setTitle(activity.getResources().getString(R.string.allow_permissions));
alertDialog.setMessage(activity.getResources().getString(R.string.you_need_to_grant_permission_to_access_the_storage_before_use));
alertDialog.setCancelable(false);
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, activity.getResources().getString(R.string.allow), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (activity.shouldShowRequestPermissionRationale(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(Uri.parse("package:" + activity.getPackageName()));
activity.startActivity(intent);
Toast.makeText(activity, activity.getResources().getString(R.string.find_and_allow_access_to_storage_in_settings), Toast.LENGTH_LONG).show();
} else {
ActivityCompat.requestPermissions(activity, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1000);
}
alertDialog.dismiss();
}
});
alertDialog.show();
DialogUtils.oneDialog(activity, activity.getString(R.string.allow_permissions), activity.getString(R.string.you_need_to_grant_permission_to_access_the_storage_before_use), activity.getString(R.string.allow), true, R.drawable.folder_24px, false,
() -> {
if (activity.shouldShowRequestPermissionRationale(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(Uri.parse("package:" + activity.getPackageName()));
activity.startActivity(intent);
Toast.makeText(activity, activity.getResources().getString(R.string.find_and_allow_access_to_storage_in_settings), Toast.LENGTH_LONG).show();
} else {
ActivityCompat.requestPermissions(activity, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1000);
}
}, null);
}
return false;
}

View file

@ -0,0 +1,91 @@
package com.vectras.vm.utils;
import android.app.Activity;
import android.util.Log;
import java.util.Objects;
public class ZipUtils {
public static int lastProgress = 0;
public static double lastZipFileSize = 0;
public static void reset() {
lastProgress = 0;
lastZipFileSize = 0;
}
public static int getCompressionProgress(double _allfilesize, double _zipfilesize) {
int _result = 0;
double allfilesizeMB = _allfilesize / (1024 * 1024);
double maximumPredictedSize = allfilesizeMB / 2;
double zipFileSizeMB = _zipfilesize / (1024 * 1024);
double currentProgress = (zipFileSizeMB / maximumPredictedSize) * 100;
if (currentProgress < 0) {
// if ((int)currentProgress != lastProgress) {
_result = lastProgress + 1 ;
// }
} else {
_result = (int) currentProgress;
}
if (_result > 99) {
_result = 99;
}
lastProgress = _result;
return _result;
}
public static int getRemainingCompressionTime(double _allfilesize, double _zipfilesize) {
int _result = 0;
double allfilesizeMB = _allfilesize / (1024 * 1024);
double zipFileSizeMB = _zipfilesize / (1024 * 1024);
double maximumPredictedSize = allfilesizeMB / 2;
if (lastProgress > 0) {
_result = (int) ((maximumPredictedSize - zipFileSizeMB) / (zipFileSizeMB - lastZipFileSize));
} else {
_result = 3600;
}
if (_result < 0) {
_result = _result * -1;
}
lastZipFileSize = zipFileSizeMB;
return _result ;
}
public static int getDecompressionProgress(double _unpackedsize, double _zipfilesize) {
int _result = 0;
double unpackedsizeMB = _unpackedsize / (1024 * 1024);
double zipFileSizeMB = _zipfilesize / (1024 * 1024);
double maximumPredictedSize = zipFileSizeMB * 2.5;
double currentProgress = (unpackedsizeMB / maximumPredictedSize) * 100;
if (currentProgress < 0) {
// if ((int)currentProgress != lastProgress) {
_result = lastProgress + 1 ;
// }
} else {
_result = (int) currentProgress;
}
if (_result > 99) {
_result = 99;
}
lastProgress = _result;
return _result;
}
public static int getRemainingDecompressionTime(double _unpackedsize, double _zipfilesize) {
int _result = 0;
double unpackedsizeMB = _unpackedsize / (1024 * 1024);
double zipFileSizeMB = _zipfilesize / (1024 * 1024);
double maximumPredictedSize = zipFileSizeMB * 2.5;
if (lastProgress > 0) {
_result = (int) ((maximumPredictedSize - unpackedsizeMB) / (unpackedsizeMB - lastZipFileSize));
} else {
_result = 3600;
}
if (_result < 0) {
_result = _result * -1;
}
lastZipFileSize = unpackedsizeMB;
return _result ;
}
}

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M40,720Q49,613 105.5,523Q162,433 256,380L182,252Q176,243 179,233Q182,223 192,218Q200,213 210,216Q220,219 226,228L300,356Q386,320 480,320Q574,320 660,356L734,228Q740,219 750,216Q760,213 768,218Q778,223 781,233Q784,243 778,252L704,380Q798,433 854.5,523Q911,613 920,720L40,720ZM280,610Q301,610 315.5,595.5Q330,581 330,560Q330,539 315.5,524.5Q301,510 280,510Q259,510 244.5,524.5Q230,539 230,560Q230,581 244.5,595.5Q259,610 280,610ZM680,610Q701,610 715.5,595.5Q730,581 730,560Q730,539 715.5,524.5Q701,510 680,510Q659,510 644.5,524.5Q630,539 630,560Q630,581 644.5,595.5Q659,610 680,610Z"/>
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M320,840L320,800L400,720L160,720Q127,720 103.5,696.5Q80,673 80,640L80,200Q80,167 103.5,143.5Q127,120 160,120L800,120Q833,120 856.5,143.5Q880,167 880,200L880,640Q880,673 856.5,696.5Q833,720 800,720L560,720L640,800L640,840L320,840ZM160,520L800,520L800,200Q800,200 800,200Q800,200 800,200L160,200Q160,200 160,200Q160,200 160,200L160,520ZM160,520L160,200Q160,200 160,200Q160,200 160,200L160,200Q160,200 160,200Q160,200 160,200L160,520Z"/>
</vector>

View file

@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal"
android:autoMirrored="true">
<path
android:fillColor="@android:color/white"
android:pathData="M400,400Q400,400 400,400Q400,400 400,400L400,400Q400,400 400,400Q400,400 400,400L400,400L400,400L400,400Q400,400 400,400Q400,400 400,400Q400,400 400,400Q400,400 400,400L400,400Q400,400 400,400Q400,400 400,400L400,400Q400,400 400,400Q400,400 400,400L400,400ZM160,800Q127,800 103.5,776.5Q80,753 80,720L80,240Q80,207 103.5,183.5Q127,160 160,160L800,160Q833,160 856.5,183.5Q880,207 880,240L160,240Q160,240 160,240Q160,240 160,240L160,720Q160,720 160,720Q160,720 160,720L240,720L240,800L160,800ZM800,720L800,400Q800,400 800,400Q800,400 800,400L640,400Q640,400 640,400Q640,400 640,400L640,720Q640,720 640,720Q640,720 640,720L800,720Q800,720 800,720Q800,720 800,720ZM620,800Q595,800 577.5,782.5Q560,765 560,740L560,380Q560,355 577.5,337.5Q595,320 620,320L820,320Q845,320 862.5,337.5Q880,355 880,380L880,740Q880,765 862.5,782.5Q845,800 820,800L620,800ZM720,500Q733,500 741.5,491Q750,482 750,470Q750,457 741.5,448.5Q733,440 720,440Q708,440 699,448.5Q690,457 690,470Q690,482 699,491Q708,500 720,500ZM340,800L320,730Q301,713 290.5,690Q280,667 280,640Q280,613 290.5,590Q301,567 320,550L340,480L460,480L480,550Q499,567 509.5,590Q520,613 520,640Q520,667 509.5,690Q499,713 480,730L460,800L340,800ZM400,700Q426,700 443,682.5Q460,665 460,640Q460,615 442,597.5Q424,580 400,580Q376,580 358,597Q340,614 340,640Q340,666 357,683Q374,700 400,700ZM720,560Q720,560 720,560Q720,560 720,560L720,560Q720,560 720,560Q720,560 720,560L720,560Q720,560 720,560Q720,560 720,560L720,560Q720,560 720,560Q720,560 720,560Z"/>
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M160,800Q127,800 103.5,776.5Q80,753 80,720L80,240Q80,207 103.5,183.5Q127,160 160,160L400,160L480,240L800,240Q833,240 856.5,263.5Q880,287 880,320L880,720Q880,753 856.5,776.5Q833,800 800,800L160,800ZM160,720L800,720Q800,720 800,720Q800,720 800,720L800,320Q800,320 800,320Q800,320 800,320L447,320L367,240L160,240Q160,240 160,240Q160,240 160,240L160,720Q160,720 160,720Q160,720 160,720ZM160,720Q160,720 160,720Q160,720 160,720L160,240Q160,240 160,240Q160,240 160,240L160,240L160,320L160,320Q160,320 160,320Q160,320 160,320L160,720Q160,720 160,720Q160,720 160,720Z"/>
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M200,840L120,360L840,360L760,840L200,840ZM267,760L693,760L744,440L216,440L267,760ZM400,600L560,600Q577,600 588.5,588.5Q600,577 600,560Q600,543 588.5,531.5Q577,520 560,520L400,520Q383,520 371.5,531.5Q360,543 360,560Q360,577 371.5,588.5Q383,600 400,600ZM240,320Q223,320 211.5,308.5Q200,297 200,280Q200,263 211.5,251.5Q223,240 240,240L720,240Q737,240 748.5,251.5Q760,263 760,280Q760,297 748.5,308.5Q737,320 720,320L240,320ZM320,200Q303,200 291.5,188.5Q280,177 280,160Q280,143 291.5,131.5Q303,120 320,120L640,120Q657,120 668.5,131.5Q680,143 680,160Q680,177 668.5,188.5Q657,200 640,200L320,200ZM267,760L267,760L693,760L693,760L267,760Z"/>
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M200,840Q167,840 143.5,816.5Q120,793 120,760L120,200Q120,167 143.5,143.5Q167,120 200,120L760,120Q793,120 816.5,143.5Q840,167 840,200L840,760Q840,793 816.5,816.5Q793,840 760,840L200,840ZM200,760L760,760Q760,760 760,760Q760,760 760,760L760,200Q760,200 760,200Q760,200 760,200L200,200Q200,200 200,200Q200,200 200,200L200,760Q200,760 200,760Q200,760 200,760ZM240,680L720,680L570,480L450,640L360,520L240,680ZM200,760Q200,760 200,760Q200,760 200,760L200,200Q200,200 200,200Q200,200 200,200L200,200Q200,200 200,200Q200,200 200,200L200,760Q200,760 200,760Q200,760 200,760Z"/>
</vector>

View file

@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal"
android:autoMirrored="true">
<path
android:fillColor="@android:color/white"
android:pathData="M120,800L120,160L880,480L120,800ZM200,680L674,480L200,280L200,420L440,480L200,540L200,680ZM200,680L200,480L200,280L200,420L200,420L200,540L200,540L200,680Z"/>
</vector>

View file

@ -271,17 +271,20 @@
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<com.google.android.material.progressindicator.CircularProgressIndicator
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:indeterminate="true"
app:showAnimationBehavior="inward"/>
<TextView
android:id="@+id/textviewprogress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:gravity="center"
android:text="@string/processing_this_may_take_a_few_minutes" />
<com.google.android.material.progressindicator.LinearProgressIndicator
android:layout_width="200dp"
android:layout_height="wrap_content"
android:padding="8dp"
android:indeterminate="true"
android:max="100"
app:showAnimationBehavior="inward"
android:id="@+id/linearprogress"/>
</LinearLayout>
</LinearLayout>

View file

@ -61,10 +61,9 @@
android:layout_marginLeft="8dp"
android:layout_weight="1"/>
<LinearLayout
<com.google.android.material.card.MaterialCardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/backgroud_stroke_for_spinner">
android:layout_height="wrap_content">
<Spinner
android:id="@+id/spinnerselectmirror"
@ -72,7 +71,7 @@
android:layout_height="wrap_content"
android:spinnerMode="dialog"
tools:listitem="@layout/simple_layout_for_spiner"/>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
<LinearLayout

View file

@ -159,7 +159,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/windows"
app:icon="@drawable/ic_windows"
app:icon="@drawable/grid_view_24px"
app:strokeColor="?attr/colorPrimary" />
<com.google.android.material.button.MaterialButton
@ -168,7 +168,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/linux"
app:icon="@drawable/ic_linux"
app:icon="@drawable/devices_other_24px"
app:strokeColor="?attr/colorPrimary" />
<com.google.android.material.button.MaterialButton
@ -176,8 +176,8 @@
style="@style/Widget.Material3.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/apple"
app:icon="@drawable/ic_apple"
android:text="@string/macos"
app:icon="@drawable/desktop_mac_24px"
app:strokeColor="?attr/colorPrimary" />
<com.google.android.material.button.MaterialButton
@ -186,7 +186,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/android"
app:icon="@drawable/ic_android"
app:icon="@drawable/android_24px"
app:strokeColor="?attr/colorPrimary" />
<com.google.android.material.button.MaterialButton
@ -195,7 +195,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/other"
app:icon="@drawable/ic_other"
app:icon="@drawable/menu_24px"
app:strokeColor="?attr/colorPrimary" />
</com.google.android.material.button.MaterialButtonToggleGroup>
</HorizontalScrollView>

View file

@ -159,17 +159,16 @@
android:paddingTop="20dp"
android:paddingBottom="8dp"
android:text="@string/do_you_want_to_change_the_mirror_before_setting_up_the_current_mirror_is" />
<LinearLayout
<com.google.android.material.card.MaterialCardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/backgroud_stroke_for_spinner">
android:layout_height="wrap_content">
<Spinner
android:id="@+id/spinnerselectmirror"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:spinnerMode="dialog"
tools:listitem="@layout/simple_layout_for_spiner"/>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
</LinearLayout>

View file

@ -295,7 +295,7 @@
android:layout_height="wrap_content"
android:padding="8dp"
android:gravity="center_horizontal|center_vertical"
app:icon="@drawable/hard_disk_24px"
app:icon="@drawable/home_storage_24px"
android:text="@string/go_to_rom_store" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View file

@ -7,7 +7,7 @@
android:title="@string/store" />
<item
android:id="@+id/navigation_item_get_rom"
android:icon="@drawable/hard_disk_24px"
android:icon="@drawable/home_storage_24px"
android:title="@string/roms_store" />
<item
android:id="@+id/navigation_item_website"

View file

@ -3,7 +3,7 @@
<string name="app_name">Vectras VM</string>
<!--======================VECTRAS STRINGS====================-->
<string name="app_version" translatable="false">v2.9.5 (3dfx - Waffle)</string>
<string name="app_version" translatable="false">v2.9.5 (3dfx - Xangos)</string>
<string name="qemu_version" translatable="false">Stable</string>
<string name="str_home">Home</string>
<string name="str_logger">Logger</string>
@ -441,6 +441,8 @@
<string name="remove_and_do_not_keep_files">Remove and don\'t keep files</string>
<string name="remove_but_keep_files">Remove and keep files</string>
<string name="remove_vm_content">Do you want to remove it? You can choose to keep or not keep the files.</string>
<string name="macos">macOS</string>
<string name="seconds_left">seconds left</string>
<!--======================TERMUX STRINGS====================-->
<string name="application_name" translatable="false">Vterm</string>
@ -545,10 +547,10 @@
<string name="x11">X11</string>
<string name="rom_options">Rom Options</string>
<string name="about_app">About App</string>
<string name="join_us_on_telegram">JOIN US ON TELEGRAM</string>
<string name="join_us_on_telegram_where_we_publish_all_the_news_and_updates_and_receive_your_opinions_and_bugs">Join us on Telegram where we publish all the news and updates and receive your opinions and bugs</string>
<string name="join_us_on_telegram">Join us on Telegram</string>
<string name="join_us_on_telegram_where_we_publish_all_the_news_and_updates_and_receive_your_opinions_and_bugs">Join us on Telegram where we publish all the news and updates and receive your opinions and bugs.</string>
<string name="join">Join</string>
<string name="dont_show_again">DONT SHOW AGAIN</string>
<string name="dont_show_again">Don\'t show again</string>
<string name="this_version_unstable_and_has_alot_of_bugs_br"><![CDATA[this version unstable and has a lot of bugs<br>]]></string>
<string name="debug_testing_build_5">DEBUG TESTING BUILD 5</string>
<string name="welcome_to_debug_build_of_vectras_vm_br"><![CDATA[welcome to debug build of vectras vm :)<br>]]></string>

View file

@ -6,7 +6,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:8.10.1' // Android Gradle plugin
classpath 'com.android.tools.build:gradle:8.11.0' // Android Gradle plugin
// Add other classpaths like Google Services and Firebase Crashlytics if needed here.
classpath 'com.google.gms:google-services:4.4.2' // assuming you need it for your project
classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.3'

View file

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

View file

@ -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",
"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",
"size": "46 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":"21",
"versionNameBeta":"v2.9.5-3dfx-waffle",
"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",
"sizeBeta": "42 MB",
"versionNameBeta":"v2.9.5-3dfx-xangos",
"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",
"sizeBeta": "41 MB",
"urlBeta": "https://github.com/AnBui2004/Vectras-VM-Emu-Android/releases",
"MessageBeta": "<h2>Waffle</h2>Bugs fixed.",
"MessageBeta": "<h2>Xangos</h2>Bugs fixed.",
"cancellableBeta": true
}