mirror of
https://github.com/xoureldeen/Vectras-VM-Android.git
synced 2026-04-29 14:59:50 +00:00
Madeleine
This commit is contained in:
parent
1120185df9
commit
dbbb09159c
45 changed files with 307 additions and 30 deletions
|
|
@ -459,7 +459,7 @@ public class CustomRomActivity extends AppCompatActivity {
|
|||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
textName.setText(Objects.requireNonNull(title.getText()).toString());
|
||||
|
||||
if (!Objects.requireNonNull(icon.getText()).toString().isEmpty())
|
||||
if (!thumbnailPath.isEmpty())
|
||||
return;
|
||||
|
||||
VectrasApp.setIconWithName(ivIcon, title.getText().toString());
|
||||
|
|
|
|||
|
|
@ -747,6 +747,28 @@ public class MainActivity extends AppCompatActivity {
|
|||
String versionName = pinfo.versionName;
|
||||
String versionNameonUpdate;
|
||||
|
||||
if (obj.getString("versionNameBetas").equals(versionName) && !MainSettingsManager.getcheckforupdatesfromthebetachannel(activity) && !MainSettingsManager.getDontShowAgainJoinBetaUpdateChannelDialog(activity)) {
|
||||
AlertDialog _alertDialog = new AlertDialog.Builder(activity, R.style.MainDialogTheme).create();
|
||||
_alertDialog.setTitle(getResources().getString(R.string.you_are_using_beta_version));
|
||||
_alertDialog.setMessage(getResources().getString(R.string.switch_to_check_for_updates_on_the_Beta_channel_now));
|
||||
_alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
MainSettingsManager.setcheckforupdatesfromthebetachannel(activity, true);
|
||||
}
|
||||
});
|
||||
_alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
_alertDialog.dismiss();
|
||||
}
|
||||
});
|
||||
_alertDialog.setButton(DialogInterface.BUTTON_NEUTRAL, getResources().getString(R.string.dont_show_again), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
MainSettingsManager.setDontShowAgainJoinBetaUpdateChannelDialog(activity, true);
|
||||
}
|
||||
});
|
||||
_alertDialog.show();
|
||||
}
|
||||
|
||||
if (MainSettingsManager.getcheckforupdatesfromthebetachannel(activity)) {
|
||||
versionNameonUpdate = obj.getString("versionNameBeta");
|
||||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,14 @@ import static android.content.Intent.ACTION_OPEN_DOCUMENT;
|
|||
import static android.content.Intent.ACTION_VIEW;
|
||||
import static android.view.View.GONE;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
|
|
@ -33,9 +35,16 @@ import androidx.core.graphics.Insets;
|
|||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import com.termux.app.TermuxService;
|
||||
import com.vectras.qemu.MainSettingsManager;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
|
@ -310,4 +319,30 @@ public class Minitools extends AppCompatActivity {
|
|||
return _view;
|
||||
}
|
||||
}
|
||||
|
||||
public void extractLoaderApk() {
|
||||
String apkLoaderAssetPath = "bootstrap/loader.apk";
|
||||
String apkLoaderextractedFilePath = TermuxService.PREFIX_PATH + "/libexec/termux-x11/loader.apk";
|
||||
|
||||
VectrasApp.deleteDirectory(apkLoaderextractedFilePath);
|
||||
if (copyAssetToFile(apkLoaderAssetPath, apkLoaderextractedFilePath)) {
|
||||
VectrasApp.copyAFile(TermuxService.PREFIX_PATH + "/libexec/termux-x11/loader.apk", AppConfig.maindirpath);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean copyAssetToFile(String assetPath, String outputPath) {
|
||||
try (InputStream in = getAssets().open(assetPath);
|
||||
OutputStream out = new FileOutputStream(outputPath)) {
|
||||
byte[] buffer = new byte[1024];
|
||||
int read;
|
||||
while ((read = in.read(buffer)) != -1) {
|
||||
out.write(buffer, 0, read);
|
||||
}
|
||||
out.flush();
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -217,7 +217,9 @@ public class SetupQemuActivity extends AppCompatActivity implements View.OnClick
|
|||
String filesDir = getFilesDir().getAbsolutePath();
|
||||
String abi = getDeviceAbi();
|
||||
String assetPath = "bootstrap/" + abi + ".tar";
|
||||
//String apkLoaderAssetPath = "bootstrap/loader.apk";
|
||||
String extractedFilePath = filesDir + "/" + abi + ".tar";
|
||||
//String apkLoaderextractedFilePath = TermuxService.PREFIX_PATH + "/libexec/termux-x11/loader.apk";
|
||||
|
||||
ProgressDialog progressDialog = new ProgressDialog(this);
|
||||
progressDialog.setMessage("Extracting data...");
|
||||
|
|
@ -270,6 +272,10 @@ public class SetupQemuActivity extends AppCompatActivity implements View.OnClick
|
|||
if (process != null) {
|
||||
process.destroy();
|
||||
}
|
||||
//VectrasApp.deleteDirectory(apkLoaderextractedFilePath);
|
||||
//if (!copyAssetToFile(apkLoaderAssetPath, apkLoaderextractedFilePath)) {
|
||||
//errorMessage = "Failed to copy loader.apk file.";
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue