mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-17 16:47:14 -04:00
JRE lib path improvement
This commit is contained in:
parent
96491e143f
commit
9b4d43d72d
@ -18,7 +18,7 @@ public class JREUtils
|
|||||||
|
|
||||||
private static String nativeLibDir;
|
private static String nativeLibDir;
|
||||||
|
|
||||||
private static String findInLdLibPath(String libName) {
|
public static String findInLdLibPath(String libName) {
|
||||||
for (String libPath : Os.getenv("LD_LIBRARY_PATH").split(":")) {
|
for (String libPath : Os.getenv("LD_LIBRARY_PATH").split(":")) {
|
||||||
File f = new File(libPath, libName);
|
File f = new File(libPath, libName);
|
||||||
if (f.exists() && f.isFile()) {
|
if (f.exists() && f.isFile()) {
|
||||||
@ -121,10 +121,10 @@ public class JREUtils
|
|||||||
|
|
||||||
public static void setJavaEnvironment(Context ctx, int launchType) throws Throwable {
|
public static void setJavaEnvironment(Context ctx, int launchType) throws Throwable {
|
||||||
nativeLibDir = ctx.getApplicationInfo().nativeLibraryDir;
|
nativeLibDir = ctx.getApplicationInfo().nativeLibraryDir;
|
||||||
String libName = System.getProperty("os.arch").contains("64") ? "lib64" : "lib";
|
String libName = Tools.currentArch.contains("64") ? "lib64" : "lib";
|
||||||
|
|
||||||
StringBuilder ldLibraryPath = new StringBuilder();
|
StringBuilder ldLibraryPath = new StringBuilder();
|
||||||
|
/*
|
||||||
for (String arch : Tools.currentArch.split("/")) {
|
for (String arch : Tools.currentArch.split("/")) {
|
||||||
File f = new File(Tools.homeJreDir + "/lib/" + arch);
|
File f = new File(Tools.homeJreDir + "/lib/" + arch);
|
||||||
if (f.exists() && f.isDirectory()) {
|
if (f.exists() && f.isDirectory()) {
|
||||||
@ -133,15 +133,14 @@ public class JREUtils
|
|||||||
ldLibraryPath.append(Tools.homeJreDir + "/lib/" + arch + ":");
|
ldLibraryPath.append(Tools.homeJreDir + "/lib/" + arch + ":");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
if (ldLibraryPath.length() == 0) {
|
ldLibraryPath.append(
|
||||||
ldLibraryPath.append(
|
// To make libjli.so ignore re-execute
|
||||||
// To make libjli.so ignore re-execute
|
Tools.homeJreDir + "/" + Tools.homeJreLib + "/server:" +
|
||||||
Tools.homeJreDir + "/lib/server:" +
|
Tools.homeJreDir + "/" + Tools.homeJreLib + "/lib/jli:" +
|
||||||
Tools.homeJreDir + "/lib/jli:" +
|
Tools.homeJreDir + "/" + Tools.homeJreLib + ":"
|
||||||
Tools.homeJreDir + "/lib:"
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
ldLibraryPath.append(
|
ldLibraryPath.append(
|
||||||
"/system/" + libName + ":" +
|
"/system/" + libName + ":" +
|
||||||
|
@ -28,25 +28,25 @@ import android.system.*;
|
|||||||
public class PojavLoginActivity extends AppCompatActivity
|
public class PojavLoginActivity extends AppCompatActivity
|
||||||
// MineActivity
|
// MineActivity
|
||||||
{
|
{
|
||||||
private EditText edit2, edit3;
|
private EditText edit2, edit3;
|
||||||
private int REQUEST_STORAGE_REQUEST_CODE = 1;
|
private int REQUEST_STORAGE_REQUEST_CODE = 1;
|
||||||
private ProgressBar prb;
|
private ProgressBar prb;
|
||||||
private CheckBox sRemember, sOffline;
|
private CheckBox sRemember, sOffline;
|
||||||
private LinearLayout loginLayout;
|
private LinearLayout loginLayout;
|
||||||
private ImageView imageLogo;
|
private ImageView imageLogo;
|
||||||
private TextView startupTextView;
|
private TextView startupTextView;
|
||||||
|
|
||||||
private boolean isPromptingGrant = false;
|
private boolean isPromptingGrant = false;
|
||||||
// private boolean isPermGranted = false;
|
// private boolean isPermGranted = false;
|
||||||
|
|
||||||
private SharedPreferences firstLaunchPrefs;
|
private SharedPreferences firstLaunchPrefs;
|
||||||
// private final String PREF_IS_DONOTSHOWAGAIN_WARN = "isWarnDoNotShowAgain";
|
// private final String PREF_IS_DONOTSHOWAGAIN_WARN = "isWarnDoNotShowAgain";
|
||||||
public static final String PREF_IS_INSTALLED_JAVARUNTIME = "isJavaRuntimeInstalled";
|
public static final String PREF_IS_INSTALLED_JAVARUNTIME = "isJavaRuntimeInstalled";
|
||||||
|
|
||||||
private boolean isInitCalled = false;
|
private boolean isInitCalled = false;
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState){
|
protected void onCreate(Bundle savedInstanceState){
|
||||||
super.onCreate(savedInstanceState); // false);
|
super.onCreate(savedInstanceState); // false);
|
||||||
|
|
||||||
Tools.updateWindowSize(this);
|
Tools.updateWindowSize(this);
|
||||||
ControlButton.pixelOf2dp = (int) Tools.dpToPx(this, 2);
|
ControlButton.pixelOf2dp = (int) Tools.dpToPx(this, 2);
|
||||||
@ -60,236 +60,174 @@ public class PojavLoginActivity extends AppCompatActivity
|
|||||||
specialButtons[3].name = getString(R.string.control_secondary);
|
specialButtons[3].name = getString(R.string.control_secondary);
|
||||||
specialButtons[4].name = getString(R.string.control_mouse);
|
specialButtons[4].name = getString(R.string.control_mouse);
|
||||||
|
|
||||||
final View decorView = getWindow().getDecorView();
|
final View decorView = getWindow().getDecorView();
|
||||||
decorView.setOnSystemUiVisibilityChangeListener (new View.OnSystemUiVisibilityChangeListener() {
|
decorView.setOnSystemUiVisibilityChangeListener (new View.OnSystemUiVisibilityChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSystemUiVisibilityChange(int visibility) {
|
public void onSystemUiVisibilityChange(int visibility) {
|
||||||
if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
|
if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
|
||||||
decorView.setSystemUiVisibility(
|
decorView.setSystemUiVisibility(
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||||
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||||
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||||
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
|
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!isInitCalled) {
|
if (!isInitCalled) {
|
||||||
init();
|
init();
|
||||||
isInitCalled = true;
|
isInitCalled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
firstLaunchPrefs = getSharedPreferences("pojav_extract", MODE_PRIVATE);
|
firstLaunchPrefs = getSharedPreferences("pojav_extract", MODE_PRIVATE);
|
||||||
|
new InitTask().execute();
|
||||||
|
}
|
||||||
|
|
||||||
// Remove vmos warning???
|
private class InitTask extends AsyncTask<Void, String, Integer>{
|
||||||
/*
|
private AlertDialog startAle;
|
||||||
if (isAndroid7() && !firstLaunchPrefs.getBoolean(PREF_IS_DONOTSHOWAGAIN_WARN, false)) {
|
private ProgressBar progress;
|
||||||
AlertDialog.Builder startDlg = new AlertDialog.Builder(PojavLoginActivity.this);
|
|
||||||
startDlg.setTitle(R.string.warning_title);
|
|
||||||
|
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
|
private ProgressBar progressSpin;
|
||||||
|
// private EditText progressLog;
|
||||||
|
private AlertDialog progDlg;
|
||||||
|
|
||||||
LinearLayout conLay = new LinearLayout(this);
|
@Override
|
||||||
conLay.setLayoutParams(params);
|
protected void onPreExecute()
|
||||||
conLay.setOrientation(LinearLayout.VERTICAL);
|
{
|
||||||
TextView conText = new TextView(this);
|
LinearLayout startScr = new LinearLayout(PojavLoginActivity.this);
|
||||||
conText.setText(R.string.warning_msg);
|
LayoutInflater.from(PojavLoginActivity.this).inflate(R.layout.start_screen, startScr);
|
||||||
conText.setLayoutParams(params);
|
|
||||||
final CheckBox conCheck = new CheckBox(this);
|
|
||||||
conCheck.setText(R.string.warning_noshowagain);
|
|
||||||
conCheck.setLayoutParams(params);
|
|
||||||
conLay.addView(conCheck);
|
|
||||||
|
|
||||||
conLay.addView(conText);
|
FontChanger.changeFonts(startScr);
|
||||||
|
|
||||||
startDlg.setView(conLay);
|
progress = (ProgressBar) startScr.findViewById(R.id.startscreenProgress);
|
||||||
startDlg.setCancelable(false);
|
|
||||||
startDlg.setPositiveButton(R.string.warning_action_install, new DialogInterface.OnClickListener(){
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface p1, int p2)
|
|
||||||
{
|
|
||||||
setPref(PREF_IS_DONOTSHOWAGAIN_WARN, conCheck.isChecked());
|
|
||||||
|
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
|
||||||
intent.setData(Uri.parse("market://details?id=com.vmos.glb"));
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
startDlg.setNegativeButton(R.string.warning_action_tryanyway, new DialogInterface.OnClickListener(){
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface p1, int p2)
|
|
||||||
{
|
|
||||||
setPref(PREF_IS_DONOTSHOWAGAIN_WARN, conCheck.isChecked());
|
|
||||||
|
|
||||||
new InitTask().execute();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
startDlg.setNeutralButton(R.string.warning_action_exit, new DialogInterface.OnClickListener(){
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface p1, int p2)
|
|
||||||
{
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
startDlg.show();
|
|
||||||
} else {
|
|
||||||
*/
|
|
||||||
new InitTask().execute();
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
private class InitTask extends AsyncTask<Void, String, Integer>{
|
|
||||||
private AlertDialog startAle;
|
|
||||||
private ProgressBar progress;
|
|
||||||
|
|
||||||
private ProgressBar progressSpin;
|
|
||||||
// private EditText progressLog;
|
|
||||||
private AlertDialog progDlg;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPreExecute()
|
|
||||||
{
|
|
||||||
LinearLayout startScr = new LinearLayout(PojavLoginActivity.this);
|
|
||||||
LayoutInflater.from(PojavLoginActivity.this).inflate(R.layout.start_screen, startScr);
|
|
||||||
|
|
||||||
FontChanger.changeFonts(startScr);
|
|
||||||
|
|
||||||
progress = (ProgressBar) startScr.findViewById(R.id.startscreenProgress);
|
|
||||||
startupTextView = (TextView) startScr.findViewById(R.id.startscreen_text);
|
startupTextView = (TextView) startScr.findViewById(R.id.startscreen_text);
|
||||||
//startScr.addView(progress);
|
//startScr.addView(progress);
|
||||||
|
|
||||||
AlertDialog.Builder startDlg = new AlertDialog.Builder(PojavLoginActivity.this, R.style.AppTheme);
|
AlertDialog.Builder startDlg = new AlertDialog.Builder(PojavLoginActivity.this, R.style.AppTheme);
|
||||||
startDlg.setView(startScr);
|
startDlg.setView(startScr);
|
||||||
startDlg.setCancelable(false);
|
startDlg.setCancelable(false);
|
||||||
|
|
||||||
startAle = startDlg.create();
|
startAle = startDlg.create();
|
||||||
startAle.show();
|
startAle.show();
|
||||||
startAle.getWindow().setLayout(
|
startAle.getWindow().setLayout(
|
||||||
WindowManager.LayoutParams.MATCH_PARENT,
|
WindowManager.LayoutParams.MATCH_PARENT,
|
||||||
WindowManager.LayoutParams.WRAP_CONTENT
|
WindowManager.LayoutParams.WRAP_CONTENT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int revokeCount = -1;
|
private int revokeCount = -1;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Integer doInBackground(Void[] p1)
|
protected Integer doInBackground(Void[] p1)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
} catch (InterruptedException e) {}
|
} catch (InterruptedException e) {}
|
||||||
|
|
||||||
publishProgress("visible");
|
publishProgress("visible");
|
||||||
|
|
||||||
while (Build.VERSION.SDK_INT >= 23 && !isStorageAllowed()){
|
while (Build.VERSION.SDK_INT >= 23 && !isStorageAllowed()){
|
||||||
try {
|
try {
|
||||||
revokeCount++;
|
revokeCount++;
|
||||||
if (revokeCount >= 3) {
|
if (revokeCount >= 3) {
|
||||||
Toast.makeText(PojavLoginActivity.this, R.string.toast_permission_denied, Toast.LENGTH_LONG).show();
|
Toast.makeText(PojavLoginActivity.this, R.string.toast_permission_denied, Toast.LENGTH_LONG).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
isPromptingGrant = true;
|
isPromptingGrant = true;
|
||||||
requestStoragePermission();
|
requestStoragePermission();
|
||||||
while (isPromptingGrant) {
|
while (isPromptingGrant) {
|
||||||
Thread.sleep(200);
|
Thread.sleep(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (InterruptedException e) {}
|
} catch (InterruptedException e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
initMain();
|
initMain();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onProgressUpdate(String... obj)
|
protected void onProgressUpdate(String... obj)
|
||||||
{
|
{
|
||||||
if (obj[0].equals("visible")) {
|
if (obj[0].equals("visible")) {
|
||||||
progress.setVisibility(View.VISIBLE);
|
progress.setVisibility(View.VISIBLE);
|
||||||
} /* else if (obj.length == 2 && obj[1] != null) {
|
} /* else if (obj.length == 2 && obj[1] != null) {
|
||||||
progressLog.append(obj[1]);
|
progressLog.append(obj[1]);
|
||||||
} */
|
} */
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Integer obj) {
|
protected void onPostExecute(Integer obj) {
|
||||||
startAle.dismiss();
|
startAle.dismiss();
|
||||||
if (progressSpin != null) progressSpin.setVisibility(View.GONE);
|
if (progressSpin != null) progressSpin.setVisibility(View.GONE);
|
||||||
if (obj == 0) {
|
if (obj == 0) {
|
||||||
if (progDlg != null) progDlg.dismiss();
|
if (progDlg != null) progDlg.dismiss();
|
||||||
uiInit();
|
uiInit();
|
||||||
} /* else if (progressLog != null) {
|
} /* else if (progressLog != null) {
|
||||||
progressLog.setText(getResources().getString(R.string.error_checklog, "\n\n" + progressLog.getText()));
|
progressLog.setText(getResources().getString(R.string.error_checklog, "\n\n" + progressLog.getText()));
|
||||||
} */
|
} */
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
private void appendlnToLog(String txt) {
|
private void appendlnToLog(String txt) {
|
||||||
publishProgress("", txt + "\n");
|
publishProgress("", txt + "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void execCmd(String cmd) throws Exception {
|
private void execCmd(String cmd) throws Exception {
|
||||||
appendlnToLog("> " + cmd);
|
appendlnToLog("> " + cmd);
|
||||||
ShellProcessOperation mainProcess = new ShellProcessOperation(new ShellProcessOperation.OnPrintListener(){
|
ShellProcessOperation mainProcess = new ShellProcessOperation(new ShellProcessOperation.OnPrintListener(){
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPrintLine(String text)
|
public void onPrintLine(String text)
|
||||||
{
|
{
|
||||||
publishProgress(text);
|
publishProgress(text);
|
||||||
}
|
}
|
||||||
}, cmd);
|
}, cmd);
|
||||||
mainProcess.initInputStream(MCLoginActivity.this);
|
mainProcess.initInputStream(MCLoginActivity.this);
|
||||||
String msgExit = cmd.split(" ")[0] + " has exited with code " + mainProcess.waitFor();
|
String msgExit = cmd.split(" ")[0] + " has exited with code " + mainProcess.waitFor();
|
||||||
if (mainProcess.exitCode() != 0) {
|
if (mainProcess.exitCode() != 0) {
|
||||||
throw new Error("(ERROR) " + msgExit);
|
throw new Error("(ERROR) " + msgExit);
|
||||||
} else {
|
} else {
|
||||||
appendlnToLog("(SUCCESS) " + msgExit);
|
appendlnToLog("(SUCCESS) " + msgExit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void uiInit() {
|
private void uiInit() {
|
||||||
setContentView(R.layout.launcher_login_v2);
|
setContentView(R.layout.launcher_login_v2);
|
||||||
|
|
||||||
loginLayout = findViewById(R.id.login_layout_linear);
|
loginLayout = findViewById(R.id.login_layout_linear);
|
||||||
imageLogo = findViewById(R.id.login_image_logo);
|
imageLogo = findViewById(R.id.login_image_logo);
|
||||||
loginLayout.postDelayed(new Runnable(){
|
loginLayout.postDelayed(new Runnable(){
|
||||||
@Override
|
@Override
|
||||||
public void run(){
|
public void run(){
|
||||||
imageLogo.setTranslationY(loginLayout.getY() - (imageLogo.getHeight() / 2f));
|
imageLogo.setTranslationY(loginLayout.getY() - (imageLogo.getHeight() / 2f));
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
edit2 = (EditText) findViewById(R.id.login_edit_email);
|
edit2 = (EditText) findViewById(R.id.login_edit_email);
|
||||||
edit3 = (EditText) findViewById(R.id.login_edit_password);
|
edit3 = (EditText) findViewById(R.id.login_edit_password);
|
||||||
if(prb == null) prb = (ProgressBar) findViewById(R.id.launcherAccProgress);
|
if(prb == null) prb = (ProgressBar) findViewById(R.id.launcherAccProgress);
|
||||||
|
|
||||||
sRemember = findViewById(R.id.login_switch_remember);
|
sRemember = findViewById(R.id.login_switch_remember);
|
||||||
sOffline = findViewById(R.id.login_switch_offline);
|
sOffline = findViewById(R.id.login_switch_offline);
|
||||||
sOffline.setOnCheckedChangeListener(new OnCheckedChangeListener(){
|
sOffline.setOnCheckedChangeListener(new OnCheckedChangeListener(){
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton p1, boolean p2) {
|
public void onCheckedChanged(CompoundButton p1, boolean p2) {
|
||||||
// May delete later
|
// May delete later
|
||||||
edit3.setEnabled(!p2);
|
edit3.setEnabled(!p2);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
Tools.updateWindowSize(this);
|
Tools.updateWindowSize(this);
|
||||||
|
|
||||||
@ -297,28 +235,28 @@ public class PojavLoginActivity extends AppCompatActivity
|
|||||||
final View decorView = getWindow().getDecorView();
|
final View decorView = getWindow().getDecorView();
|
||||||
decorView.setSystemUiVisibility(uiOptions);
|
decorView.setSystemUiVisibility(uiOptions);
|
||||||
|
|
||||||
if (loginLayout != null && imageLogo != null) {
|
if (loginLayout != null && imageLogo != null) {
|
||||||
imageLogo.setTranslationY(loginLayout.getY() - (imageLogo.getHeight() / 2f));
|
imageLogo.setTranslationY(loginLayout.getY() - (imageLogo.getHeight() / 2f));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear current profile
|
// Clear current profile
|
||||||
PojavProfile.setCurrentProfile(this, null);
|
PojavProfile.setCurrentProfile(this, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isJavaRuntimeInstalled() {
|
private boolean isJavaRuntimeInstalled() {
|
||||||
return firstLaunchPrefs.getBoolean(PREF_IS_INSTALLED_JAVARUNTIME, false);
|
return firstLaunchPrefs.getBoolean(PREF_IS_INSTALLED_JAVARUNTIME, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean setPref(String prefName, boolean value) {
|
private boolean setPref(String prefName, boolean value) {
|
||||||
return firstLaunchPrefs.edit().putBoolean(prefName, value).commit();
|
return firstLaunchPrefs.edit().putBoolean(prefName, value).commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initMain()
|
private void initMain()
|
||||||
{
|
{
|
||||||
mkdirs(Tools.worksDir);
|
mkdirs(Tools.worksDir);
|
||||||
mkdirs(Tools.versnDir);
|
mkdirs(Tools.versnDir);
|
||||||
mkdirs(Tools.libraries);
|
mkdirs(Tools.libraries);
|
||||||
mkdirs(Tools.mpProfiles);
|
mkdirs(Tools.mpProfiles);
|
||||||
|
|
||||||
mkdirs(Tools.MAIN_PATH);
|
mkdirs(Tools.MAIN_PATH);
|
||||||
mkdirs(Tools.MAIN_PATH + "/lwjgl3");
|
mkdirs(Tools.MAIN_PATH + "/lwjgl3");
|
||||||
@ -326,50 +264,56 @@ public class PojavLoginActivity extends AppCompatActivity
|
|||||||
|
|
||||||
mkdirs(Tools.CTRLMAP_PATH);
|
mkdirs(Tools.CTRLMAP_PATH);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
new CustomControls(this).save(Tools.CTRLDEF_FILE);
|
new CustomControls(this).save(Tools.CTRLDEF_FILE);
|
||||||
|
|
||||||
Tools.copyAssetFile(this, "options.txt", Tools.MAIN_PATH, false);
|
Tools.copyAssetFile(this, "options.txt", Tools.MAIN_PATH, false);
|
||||||
|
|
||||||
// Extract launcher_profiles.json
|
// Extract launcher_profiles.json
|
||||||
// TODO: Remove after implement.
|
// TODO: Remove after implement.
|
||||||
Tools.copyAssetFile(this, "launcher_profiles.json", Tools.MAIN_PATH, false);
|
Tools.copyAssetFile(this, "launcher_profiles.json", Tools.MAIN_PATH, false);
|
||||||
|
|
||||||
Tools.copyAssetFile(this, "ClassWrapper.jar", Tools.MAIN_PATH + "/lwjgl3", false);
|
Tools.copyAssetFile(this, "ClassWrapper.jar", Tools.MAIN_PATH + "/lwjgl3", false);
|
||||||
|
|
||||||
// Yep, the codebase from v1.0.3:
|
// Yep, the codebase from v1.0.3:
|
||||||
//FileAccess.copyAssetToFolderIfNonExist(this, "1.0.jar", Tools.versnDir + "/1.0");
|
//FileAccess.copyAssetToFolderIfNonExist(this, "1.0.jar", Tools.versnDir + "/1.0");
|
||||||
//FileAccess.copyAssetToFolderIfNonExist(this, "1.7.3.jar", Tools.versnDir + "/1.7.3");
|
//FileAccess.copyAssetToFolderIfNonExist(this, "1.7.3.jar", Tools.versnDir + "/1.7.3");
|
||||||
//FileAccess.copyAssetToFolderIfNonExist(this, "1.7.10.jar", Tools.versnDir + "/1.7.10");
|
//FileAccess.copyAssetToFolderIfNonExist(this, "1.7.10.jar", Tools.versnDir + "/1.7.10");
|
||||||
|
|
||||||
UpdateDataChanger.changeDataAuto("2.4", "2.4.2");
|
UpdateDataChanger.changeDataAuto("2.4", "2.4.2");
|
||||||
|
|
||||||
if (!isJavaRuntimeInstalled()) {
|
if (!isJavaRuntimeInstalled()) {
|
||||||
File jreTarFile = selectJreTarFile();
|
File jreTarFile = selectJreTarFile();
|
||||||
uncompressTarXZ(jreTarFile, new File(Tools.homeJreDir));
|
uncompressTarXZ(jreTarFile, new File(Tools.homeJreDir));
|
||||||
|
|
||||||
File ftIn = new File(Tools.homeJreDir, "lib/libfreetype.so.6");
|
|
||||||
File ftOut = new File(Tools.homeJreDir, "lib/libfreetype.so");
|
|
||||||
if (ftIn.exists() && (!ftOut.exists() || ftIn.length() != ftOut.length())) {
|
|
||||||
IOUtils.copy(
|
|
||||||
new FileInputStream(ftIn),
|
|
||||||
new FileOutputStream(ftOut)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
setPref(PREF_IS_INSTALLED_JAVARUNTIME, true);
|
setPref(PREF_IS_INSTALLED_JAVARUNTIME, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (String arch : Tools.currentArch.split("/")) {
|
||||||
|
File f = new File(Tools.homeJreDir + "/lib/" + arch);
|
||||||
|
if (f.exists() && f.isDirectory()) {
|
||||||
|
Tools.homeJreLib = "lib/" + arch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
File ftIn = new File(Tools.homeJreDir, Tools.homeJreLib + "/libfreetype.so.6");
|
||||||
|
File ftOut = new File(Tools.homeJreDir, Tools.homeJreLib + "/libfreetype.so");
|
||||||
|
if (ftIn.exists() && (!ftOut.exists() || ftIn.length() != ftOut.length())) {
|
||||||
|
ftIn.renameTo(ftOut);
|
||||||
|
}
|
||||||
|
|
||||||
// Refresh libraries
|
// Refresh libraries
|
||||||
copyDummyNativeLib("libawt_xawt.so");
|
copyDummyNativeLib("libawt_xawt.so");
|
||||||
copyDummyNativeLib("libfontconfig.so");
|
copyDummyNativeLib("libfontconfig.so");
|
||||||
}
|
}
|
||||||
catch(Throwable e){
|
catch(Throwable e){
|
||||||
Tools.showError(this, e);
|
Tools.showError(this, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void copyDummyNativeLib(String name) throws Throwable {
|
private void copyDummyNativeLib(String name) throws Throwable {
|
||||||
File fileLib = new File(Tools.homeJreDir, "lib/" + name);
|
File fileLib = new File(Tools.homeJreDir, Tools.homeJreLib + "/" + name);
|
||||||
fileLib.delete();
|
fileLib.delete();
|
||||||
IOUtils.copy(
|
IOUtils.copy(
|
||||||
new FileInputStream(new File(getApplicationInfo().nativeLibraryDir, name)),
|
new FileInputStream(new File(getApplicationInfo().nativeLibraryDir, name)),
|
||||||
@ -486,235 +430,235 @@ public class PojavLoginActivity extends AppCompatActivity
|
|||||||
tarIn.close();
|
tarIn.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean mkdirs(String path)
|
private boolean mkdirs(String path)
|
||||||
{
|
{
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
if(file.getParentFile().exists())
|
if(file.getParentFile().exists())
|
||||||
return file.mkdir();
|
return file.mkdir();
|
||||||
else return file.mkdirs();
|
else return file.mkdirs();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
public void loginUsername(View view)
|
public void loginUsername(View view)
|
||||||
{
|
{
|
||||||
LinearLayout mainLaun = new LinearLayout(this);
|
LinearLayout mainLaun = new LinearLayout(this);
|
||||||
LayoutInflater.from(this).inflate(R.layout.launcher_user, mainLaun, true);
|
LayoutInflater.from(this).inflate(R.layout.launcher_user, mainLaun, true);
|
||||||
replaceFonts(mainLaun);
|
replaceFonts(mainLaun);
|
||||||
|
|
||||||
//edit1 = mainLaun.findViewById(R.id.launcherAccUsername);
|
//edit1 = mainLaun.findViewById(R.id.launcherAccUsername);
|
||||||
|
|
||||||
new AlertDialog.Builder(this)
|
new AlertDialog.Builder(this)
|
||||||
.setTitle("Register with username")
|
.setTitle("Register with username")
|
||||||
.setView(mainLaun)
|
.setView(mainLaun)
|
||||||
.show();
|
.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// developer methods
|
// developer methods
|
||||||
// end dev methods
|
// end dev methods
|
||||||
public void loginSavedAcc(View view)
|
public void loginSavedAcc(View view)
|
||||||
{
|
{
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
|
|
||||||
if (Tools.enableDevFeatures) {
|
if (Tools.enableDevFeatures) {
|
||||||
builder.setNegativeButton("Toggle UI v2", new DialogInterface.OnClickListener(){
|
builder.setNegativeButton("Toggle UI v2", new DialogInterface.OnClickListener(){
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface p1, int p2)
|
public void onClick(DialogInterface p1, int p2)
|
||||||
{
|
{
|
||||||
int ver = PojavV2ActivityManager.getLauncherRemakeInt(PojavLoginActivity.this) == 0 ? 1 : 0;
|
int ver = PojavV2ActivityManager.getLauncherRemakeInt(PojavLoginActivity.this) == 0 ? 1 : 0;
|
||||||
PojavV2ActivityManager.setLauncherRemakeVer(PojavLoginActivity.this, ver);
|
PojavV2ActivityManager.setLauncherRemakeVer(PojavLoginActivity.this, ver);
|
||||||
Toast.makeText(PojavLoginActivity.this, "Changed to use v" + (ver + 1), Toast.LENGTH_SHORT).show();
|
Toast.makeText(PojavLoginActivity.this, "Changed to use v" + (ver + 1), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.setPositiveButton(android.R.string.cancel, null);
|
builder.setPositiveButton(android.R.string.cancel, null);
|
||||||
builder.setTitle(this.getString(R.string.login_select_account));
|
builder.setTitle(this.getString(R.string.login_select_account));
|
||||||
final AlertDialog dialog = builder.create();
|
final AlertDialog dialog = builder.create();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
LinearLayout.LayoutParams lpHint, lpFlv;
|
LinearLayout.LayoutParams lpHint, lpFlv;
|
||||||
|
|
||||||
lpHint = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
lpHint = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||||
lpFlv = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
lpFlv = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||||
lpHint.weight = 1;
|
lpHint.weight = 1;
|
||||||
lpFlv.weight = 1;
|
lpFlv.weight = 1;
|
||||||
*/
|
*/
|
||||||
dialog.setTitle(this.getString(R.string.login_select_account));
|
dialog.setTitle(this.getString(R.string.login_select_account));
|
||||||
System.out.println("Setting title...");
|
System.out.println("Setting title...");
|
||||||
LinearLayout dialay = new LinearLayout(this);
|
LinearLayout dialay = new LinearLayout(this);
|
||||||
dialay.setOrientation(LinearLayout.VERTICAL);
|
dialay.setOrientation(LinearLayout.VERTICAL);
|
||||||
TextView fhint = new TextView(this);
|
TextView fhint = new TextView(this);
|
||||||
fhint.setText(R.string.hint_select_account);
|
fhint.setText(R.string.hint_select_account);
|
||||||
// fhint.setLayoutParams(lpHint);
|
// fhint.setLayoutParams(lpHint);
|
||||||
|
|
||||||
final FileListView flv = new FileListView(dialog);
|
final FileListView flv = new FileListView(dialog);
|
||||||
// flv.setLayoutParams(lpFlv);
|
// flv.setLayoutParams(lpFlv);
|
||||||
|
|
||||||
flv.lockPathAt(Tools.mpProfiles);
|
flv.lockPathAt(Tools.mpProfiles);
|
||||||
flv.setFileSelectedListener(new FileSelectedListener(){
|
flv.setFileSelectedListener(new FileSelectedListener(){
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFileLongClick(final File file, String path)
|
public void onFileLongClick(final File file, String path)
|
||||||
{
|
{
|
||||||
AlertDialog.Builder builder2 = new AlertDialog.Builder(PojavLoginActivity.this);
|
AlertDialog.Builder builder2 = new AlertDialog.Builder(PojavLoginActivity.this);
|
||||||
builder2.setTitle(file.getName());
|
builder2.setTitle(file.getName());
|
||||||
builder2.setMessage(R.string.warning_remove_account);
|
builder2.setMessage(R.string.warning_remove_account);
|
||||||
builder2.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener(){
|
builder2.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener(){
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface p1, int p2) {
|
public void onClick(DialogInterface p1, int p2) {
|
||||||
file.delete();
|
file.delete();
|
||||||
flv.refreshPath();
|
flv.refreshPath();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
builder2.setNegativeButton(android.R.string.cancel, null);
|
builder2.setNegativeButton(android.R.string.cancel, null);
|
||||||
builder2.show();
|
builder2.show();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onFileSelected(File file, final String path) {
|
public void onFileSelected(File file, final String path) {
|
||||||
try {
|
try {
|
||||||
if (MCProfile.load(path).isMojangAccount()){
|
if (MCProfile.load(path).isMojangAccount()){
|
||||||
MCProfile.updateTokens(PojavLoginActivity.this, path, new RefreshListener(){
|
MCProfile.updateTokens(PojavLoginActivity.this, path, new RefreshListener(){
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(Throwable e)
|
public void onFailed(Throwable e)
|
||||||
{
|
{
|
||||||
Tools.showError(PojavLoginActivity.this, e);
|
Tools.showError(PojavLoginActivity.this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess()
|
public void onSuccess()
|
||||||
{
|
{
|
||||||
MCProfile.launch(PojavLoginActivity.this, path);
|
MCProfile.launch(PojavLoginActivity.this, path);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
MCProfile.launch(PojavLoginActivity.this, path);
|
MCProfile.launch(PojavLoginActivity.this, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
//Tools.throwError(MCLoginActivity.this, new Exception(builder.getAccessToken() + "," + builder.getUUID() + "," + builder.getNickname() + "," + builder.getEmail() + "," + builder.getPassword()));
|
//Tools.throwError(MCLoginActivity.this, new Exception(builder.getAccessToken() + "," + builder.getUUID() + "," + builder.getNickname() + "," + builder.getEmail() + "," + builder.getPassword()));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Tools.showError(PojavLoginActivity.this, e);
|
Tools.showError(PojavLoginActivity.this, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dialay.addView(fhint);
|
dialay.addView(fhint);
|
||||||
dialay.addView(flv);
|
dialay.addView(flv);
|
||||||
|
|
||||||
dialog.setView(dialay);
|
dialog.setView(dialay);
|
||||||
dialog.setTitle(this.getString(R.string.login_select_account));
|
dialog.setTitle(this.getString(R.string.login_select_account));
|
||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private MCProfile.Builder loginOffline() {
|
private MCProfile.Builder loginOffline() {
|
||||||
new File(Tools.mpProfiles).mkdir();
|
new File(Tools.mpProfiles).mkdir();
|
||||||
|
|
||||||
String text = edit2.getText().toString();
|
String text = edit2.getText().toString();
|
||||||
if(text.isEmpty()){
|
if(text.isEmpty()){
|
||||||
edit2.setError(getResources().getString(R.string.global_error_field_empty));
|
edit2.setError(getResources().getString(R.string.global_error_field_empty));
|
||||||
} else if(text.length() <= 2){
|
} else if(text.length() <= 2){
|
||||||
edit2.setError(getResources().getString(R.string.login_error_short_username));
|
edit2.setError(getResources().getString(R.string.login_error_short_username));
|
||||||
} else if(new File(Tools.mpProfiles + "/" + text).exists()){
|
} else if(new File(Tools.mpProfiles + "/" + text).exists()){
|
||||||
edit2.setError(getResources().getString(R.string.login_error_exist_username));
|
edit2.setError(getResources().getString(R.string.login_error_exist_username));
|
||||||
} else{
|
} else{
|
||||||
MCProfile.Builder builder = new MCProfile.Builder();
|
MCProfile.Builder builder = new MCProfile.Builder();
|
||||||
builder.setIsMojangAccount(false);
|
builder.setIsMojangAccount(false);
|
||||||
builder.setUsername(text);
|
builder.setUsername(text);
|
||||||
|
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private MCProfile.Builder mProfile = null;
|
private MCProfile.Builder mProfile = null;
|
||||||
public void loginMC(final View v)
|
public void loginMC(final View v)
|
||||||
{
|
{
|
||||||
/*skip it
|
/*skip it
|
||||||
|
|
||||||
String proFilePath = MCProfile.build(builder);
|
String proFilePath = MCProfile.build(builder);
|
||||||
MCProfile.launchWithProfile(this, proFilePath);
|
MCProfile.launchWithProfile(this, proFilePath);
|
||||||
end skip*/
|
end skip*/
|
||||||
|
|
||||||
if (sOffline.isChecked()) {
|
if (sOffline.isChecked()) {
|
||||||
mProfile = loginOffline();
|
mProfile = loginOffline();
|
||||||
playProfile();
|
playProfile();
|
||||||
} else {
|
} else {
|
||||||
new LoginTask().setLoginListener(new LoginListener(){
|
new LoginTask().setLoginListener(new LoginListener(){
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBeforeLogin()
|
public void onBeforeLogin()
|
||||||
{
|
{
|
||||||
// TODO: Implement this method
|
// TODO: Implement this method
|
||||||
v.setEnabled(false);
|
v.setEnabled(false);
|
||||||
prb.setVisibility(View.VISIBLE);
|
prb.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoginDone(String[] result)
|
public void onLoginDone(String[] result)
|
||||||
{
|
{
|
||||||
// TODO: Implement this method
|
// TODO: Implement this method
|
||||||
if(result[0].equals("ERROR")){
|
if(result[0].equals("ERROR")){
|
||||||
Tools.dialogOnUiThread(PojavLoginActivity.this, getResources().getString(R.string.global_error), strArrToString(result));
|
Tools.dialogOnUiThread(PojavLoginActivity.this, getResources().getString(R.string.global_error), strArrToString(result));
|
||||||
} else{
|
} else{
|
||||||
MCProfile.Builder builder = new MCProfile.Builder();
|
MCProfile.Builder builder = new MCProfile.Builder();
|
||||||
builder.setAccessToken(result[1]);
|
builder.setAccessToken(result[1]);
|
||||||
builder.setClientID(result[2]);
|
builder.setClientID(result[2]);
|
||||||
builder.setProfileID(result[3]);
|
builder.setProfileID(result[3]);
|
||||||
builder.setUsername(result[4]);
|
builder.setUsername(result[4]);
|
||||||
builder.setVersion("1.7.10");
|
builder.setVersion("1.7.10");
|
||||||
|
|
||||||
mProfile = builder;
|
mProfile = builder;
|
||||||
}
|
}
|
||||||
v.setEnabled(true);
|
v.setEnabled(true);
|
||||||
prb.setVisibility(View.GONE);
|
prb.setVisibility(View.GONE);
|
||||||
|
|
||||||
playProfile();
|
playProfile();
|
||||||
}
|
}
|
||||||
}).execute(edit2.getText().toString(), edit3.getText().toString());
|
}).execute(edit2.getText().toString(), edit3.getText().toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void playProfile() {
|
private void playProfile() {
|
||||||
if (mProfile != null) {
|
if (mProfile != null) {
|
||||||
String profilePath = null;
|
String profilePath = null;
|
||||||
if (sRemember.isChecked()) {
|
if (sRemember.isChecked()) {
|
||||||
profilePath = MCProfile.build(mProfile);
|
profilePath = MCProfile.build(mProfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
MCProfile.launch(PojavLoginActivity.this, profilePath == null ? mProfile : profilePath);
|
MCProfile.launch(PojavLoginActivity.this, profilePath == null ? mProfile : profilePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String strArrToString(String[] strArr)
|
public static String strArrToString(String[] strArr)
|
||||||
{
|
{
|
||||||
String[] strArrEdit = strArr;
|
String[] strArrEdit = strArr;
|
||||||
strArrEdit[0] = "";
|
strArrEdit[0] = "";
|
||||||
|
|
||||||
String str = Arrays.toString(strArrEdit);
|
String str = Arrays.toString(strArrEdit);
|
||||||
str = str.substring(1, str.length() - 1).replace(",", "\n");
|
str = str.substring(1, str.length() - 1).replace(",", "\n");
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
//We are calling this method to check the permission status
|
//We are calling this method to check the permission status
|
||||||
private boolean isStorageAllowed() {
|
private boolean isStorageAllowed() {
|
||||||
//Getting the permission status
|
//Getting the permission status
|
||||||
int result1 = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
int result1 = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||||
int result2 = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);
|
int result2 = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);
|
||||||
|
|
||||||
//If permission is granted returning true
|
//If permission is granted returning true
|
||||||
return result1 == PackageManager.PERMISSION_GRANTED &&
|
return result1 == PackageManager.PERMISSION_GRANTED &&
|
||||||
result2 == PackageManager.PERMISSION_GRANTED;
|
result2 == PackageManager.PERMISSION_GRANTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Requesting permission
|
//Requesting permission
|
||||||
private void requestStoragePermission()
|
private void requestStoragePermission()
|
||||||
{
|
{
|
||||||
ActivityCompat.requestPermissions(this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE}, REQUEST_STORAGE_REQUEST_CODE);
|
ActivityCompat.requestPermissions(this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE}, REQUEST_STORAGE_REQUEST_CODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -724,7 +668,7 @@ public class PojavLoginActivity extends AppCompatActivity
|
|||||||
|
|
||||||
//Checking the request code of our request
|
//Checking the request code of our request
|
||||||
if(requestCode == REQUEST_STORAGE_REQUEST_CODE){
|
if(requestCode == REQUEST_STORAGE_REQUEST_CODE){
|
||||||
isPromptingGrant = false;
|
isPromptingGrant = false;
|
||||||
// isPermGranted = grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED;
|
// isPermGranted = grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@ public final class Tools
|
|||||||
|
|
||||||
// New since 3.0.0
|
// New since 3.0.0
|
||||||
public static String homeJreDir = datapath + "/jre_runtime";
|
public static String homeJreDir = datapath + "/jre_runtime";
|
||||||
|
public static String homeJreLib = "lib";
|
||||||
|
|
||||||
// New since 2.4.2
|
// New since 2.4.2
|
||||||
public static String versnDir = MAIN_PATH + "/versions";
|
public static String versnDir = MAIN_PATH + "/versions";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user