mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-19 01:27:18 -04:00
VIU fixes & improvements pt. 4
Add proper support for saving to folder paths Fixed MainActivity switch case ordering causing buttons to swap functionality Added version file for security components Fixed security component paths in Forge installer Switched default profile icon to Pojav logo More logcat exception prints Less unnecessary logcat prints More null checks
This commit is contained in:
parent
3649ef6470
commit
c16423d21a
@ -0,0 +1 @@
|
||||
1
|
@ -235,7 +235,7 @@ public class CustomControlsActivity extends BaseActivity {
|
||||
private static void loadControl(String path,ControlLayout layout) {
|
||||
try {
|
||||
layout.loadLayout(path);
|
||||
sSelectedName = new File(path).getName();
|
||||
sSelectedName = path.replace(Tools.CTRLMAP_PATH, ".");
|
||||
// Remove `.json`
|
||||
sSelectedName = sSelectedName.substring(0, sSelectedName.length() - 5);
|
||||
} catch (Exception e) {
|
||||
|
@ -275,9 +275,9 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
||||
|
||||
// Run java on sandbox, non-overrideable.
|
||||
Collections.reverse(javaArgList);
|
||||
javaArgList.add("-Xbootclasspath/a:" + Tools.DIR_DATA + "/pro-grade.jar");
|
||||
javaArgList.add("-Xbootclasspath/a:" + Tools.DIR_DATA + "/security/pro-grade.jar");
|
||||
javaArgList.add("-Djava.security.manager=net.sourceforge.prograde.sm.ProGradeJSM");
|
||||
javaArgList.add("-Djava.security.policy=" + Tools.DIR_DATA + "/java_sandbox.policy");
|
||||
javaArgList.add("-Djava.security.policy=" + Tools.DIR_DATA + "/security/java_sandbox.policy");
|
||||
Collections.reverse(javaArgList);
|
||||
|
||||
return JREUtils.launchJavaVM(this, javaArgList);
|
||||
|
@ -93,9 +93,9 @@ public class MainActivity extends BaseActivity {
|
||||
case 0: mControlLayout.addControlButton(new ControlData("New")); break;
|
||||
case 1: mControlLayout.addDrawer(new ControlDrawerData()); break;
|
||||
//case 2: mControlLayout.addJoystickButton(new ControlData()); break;
|
||||
case 3 : CustomControlsActivity.load(mControlLayout); break;
|
||||
case 4: CustomControlsActivity.save(true,mControlLayout); break;
|
||||
case 5: CustomControlsActivity.dialogSelectDefaultCtrl(mControlLayout); break;
|
||||
case 2 : CustomControlsActivity.load(mControlLayout); break;
|
||||
case 3: CustomControlsActivity.save(true,mControlLayout); break;
|
||||
case 4: CustomControlsActivity.dialogSelectDefaultCtrl(mControlLayout); break;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -353,11 +353,13 @@ public class ControlLayout extends FrameLayout {
|
||||
|
||||
// When the input window cannot be hidden, it returns false
|
||||
imm.hideSoftInputFromWindow(getWindowToken(), 0);
|
||||
mControlPopup.disappearColor();
|
||||
mControlPopup.disappear();
|
||||
if(mControlPopup != null) {
|
||||
mControlPopup.disappearColor();
|
||||
mControlPopup.disappear();
|
||||
}
|
||||
|
||||
actionRow.setFollowedButton(null);
|
||||
mHandleView.hide();
|
||||
if(actionRow != null) actionRow.setFollowedButton(null);
|
||||
if(mHandleView != null) mHandleView.hide();
|
||||
}
|
||||
|
||||
public void save(String path){
|
||||
|
@ -26,7 +26,6 @@ import net.kdt.pojavlaunch.R;
|
||||
import net.kdt.pojavlaunch.Tools;
|
||||
import net.kdt.pojavlaunch.extra.ExtraConstants;
|
||||
import net.kdt.pojavlaunch.extra.ExtraCore;
|
||||
import net.kdt.pojavlaunch.fragments.FileSelectorFragment;
|
||||
import net.kdt.pojavlaunch.multirt.MultiRTUtils;
|
||||
import net.kdt.pojavlaunch.multirt.RTSpinnerAdapter;
|
||||
import net.kdt.pojavlaunch.multirt.Runtime;
|
||||
@ -122,12 +121,11 @@ public class ProfileEditorFragment extends Fragment {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mDefaultVersion.getContext());
|
||||
ExpandableListView expandableListView = (ExpandableListView) LayoutInflater.from(mDefaultVersion.getContext())
|
||||
.inflate(R.layout.dialog_expendable_list_view , null);
|
||||
|
||||
JMinecraftVersionList.Version[] versionList;
|
||||
if(getValue(ExtraConstants.RELEASE_TABLE) == null)
|
||||
versionList = new JMinecraftVersionList.Version[0];
|
||||
else versionList = ((JMinecraftVersionList) getValue(ExtraConstants.RELEASE_TABLE)).versions;
|
||||
ExpandableListAdapter adapter = new VersionListAdapter(versionList, mDefaultVersion.getContext());
|
||||
JMinecraftVersionList jMinecraftVersionList = (JMinecraftVersionList) getValue(ExtraConstants.RELEASE_TABLE);
|
||||
JMinecraftVersionList.Version[] versionArray;
|
||||
if(jMinecraftVersionList == null || jMinecraftVersionList.versions == null) versionArray = new JMinecraftVersionList.Version[0];
|
||||
else versionArray = jMinecraftVersionList.versions;
|
||||
ExpandableListAdapter adapter = new VersionListAdapter(versionArray, mDefaultVersion.getContext());
|
||||
|
||||
expandableListView.setAdapter(adapter);
|
||||
builder.setView(expandableListView);
|
||||
|
@ -24,8 +24,7 @@ public class ProfileIconCache {
|
||||
|
||||
public static void initDefault(Context context) {
|
||||
if(sDefaultIcon != null) return;
|
||||
|
||||
sDefaultIcon = ResourcesCompat.getDrawable(context.getResources(), R.drawable.ic_gamepad_pointer, null);
|
||||
sDefaultIcon = ResourcesCompat.getDrawable(context.getResources(), R.mipmap.ic_launcher_foreground, null);
|
||||
sDefaultIcon.setBounds(0, 0, 10, 10);
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
package net.kdt.pojavlaunch.progresskeeper;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
@ -29,7 +27,6 @@ public class ProgressKeeper {
|
||||
progressState.varArg = va;
|
||||
}
|
||||
|
||||
Log.d("ProgressLayout", "shouldCallStarted="+shouldCallStarted+" shouldCallEnded="+shouldCallEnded);
|
||||
ConcurrentLinkedQueue<ProgressListener> progressListeners = sProgressListeners.get(progressRecord);
|
||||
if(progressListeners != null)
|
||||
for(ProgressListener listener : progressListeners) {
|
||||
|
@ -99,7 +99,7 @@ public class AsyncAssetManager {
|
||||
unpackComponent(ctx, "lwjgl3", false);
|
||||
unpackComponent(ctx, "security", true);
|
||||
} catch (IOException e) {
|
||||
Log.e("AsyncAssetManager", "Failed o unpack components !");
|
||||
Log.e("AsyncAssetManager", "Failed o unpack components !",e );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -353,6 +353,7 @@ public class AsyncMinecraftDownloader {
|
||||
|
||||
public static String normalizeVersionId(String versionString) {
|
||||
JMinecraftVersionList versionList = (JMinecraftVersionList) ExtraCore.getValue(ExtraConstants.RELEASE_TABLE);
|
||||
if(versionList == null || versionList.versions == null) return versionString;
|
||||
if("latest-release".equals(versionString)) versionString = versionList.latest.get("release");
|
||||
if("latest-snapshot".equals(versionString)) versionString = versionList.latest.get("snapshot");
|
||||
return versionString;
|
||||
@ -360,6 +361,7 @@ public class AsyncMinecraftDownloader {
|
||||
|
||||
public static JMinecraftVersionList.Version getListedVersion(String normalizedVersionString) {
|
||||
JMinecraftVersionList versionList = (JMinecraftVersionList) ExtraCore.getValue(ExtraConstants.RELEASE_TABLE);
|
||||
if(versionList == null || versionList.versions == null) return null; // can't have listed versions if there's no list
|
||||
for(JMinecraftVersionList.Version version : versionList.versions) {
|
||||
if(version.id.equals(normalizedVersionString)) return version;
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ import java.util.Collections;
|
||||
public class AsyncVersionList {
|
||||
|
||||
public void getVersionList(@Nullable VersionDoneListener listener){
|
||||
ProgressKeeper.submitProgress(ProgressLayout.DOWNLOAD_VERSION_LIST, 0, R.string.downloading_versions);
|
||||
sExecutorService.execute(() -> {
|
||||
File versionFile = new File(Tools.DIR_DATA + "/version_list.json");
|
||||
JMinecraftVersionList versionList = null;
|
||||
@ -53,7 +52,6 @@ public class AsyncVersionList {
|
||||
|
||||
if(listener != null)
|
||||
listener.onVersionDone(versionList);
|
||||
ProgressLayout.clearProgress(ProgressLayout.DOWNLOAD_VERSION_LIST);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user