mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-20 13:30:15 -07:00
Integrated Caciocavallo to classpath to support launch b1.3_01 and older
This commit is contained in:
parent
cfd58c274b
commit
f6836e75e6
10 changed files with 47 additions and 249 deletions
|
|
@ -1,115 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="net.kdt.pojavlaunch"
|
||||
android:versionCode="156236"
|
||||
android:versionName="3.3.1b_6409b_20201218">
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="21"
|
||||
android:targetSdkVersion="29"/>
|
||||
|
||||
<uses-feature
|
||||
android:glEsVersion="0x00020000"/>
|
||||
|
||||
<uses-permission
|
||||
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
|
||||
<uses-permission
|
||||
android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
|
||||
<uses-permission
|
||||
android:name="android.permission.INTERNET"/>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:name=".PojavApplication"
|
||||
android:theme="@style/AppTheme"
|
||||
android:label="@string/app_name"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:roundIcon="@drawable/ic_launcher"
|
||||
android:resizeableActivity="true"
|
||||
android:requestLegacyExternalStorage="true">
|
||||
|
||||
<meta-data
|
||||
android:name="android.max_aspect"
|
||||
android:value="ratio_float"/>
|
||||
|
||||
<activity
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:label="@string/app_short_name"
|
||||
android:name=".PojavLoginActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action
|
||||
android:name="android.intent.action.MAIN"/>
|
||||
|
||||
<category
|
||||
android:name="android.intent.category.LAUNCHER"/>
|
||||
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action
|
||||
android:name="android.intent.action.VIEW"/>
|
||||
|
||||
<category
|
||||
android:name="android.intent.category.DEFAULT"/>
|
||||
|
||||
<category
|
||||
android:name="android.intent.category.BROWSABLE"/>
|
||||
|
||||
<data
|
||||
android:scheme="ms-xal-00000000402b5328"
|
||||
android:host="auth"/>
|
||||
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:theme="@style/MenuDialog"
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:name=".FatalErrorActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"/>
|
||||
|
||||
<activity
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:name=".MCLauncherActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"/>
|
||||
|
||||
<activity
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:name=".PojavLauncherActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"/>
|
||||
|
||||
<activity
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:name=".JavaGUILauncherActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"/>
|
||||
|
||||
<activity
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:name=".CustomControlsActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"/>
|
||||
|
||||
<activity
|
||||
android:launchMode="standard"
|
||||
android:multiprocess="true"
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"/>
|
||||
|
||||
<activity
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:name=".prefs.LauncherPreferenceActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"/>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="net.kdt.pojavlaunch"
|
||||
android:versionCode="156236"
|
||||
android:versionName="3.3.1b_6409b_20201218" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="21"
|
||||
android:targetSdkVersion="29" />
|
||||
|
||||
<uses-feature android:glEsVersion="0x00020000" />
|
||||
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<application
|
||||
android:name="net.kdt.pojavlaunch.PojavApplication"
|
||||
android:allowBackup="true"
|
||||
android:appComponentFactory="androidx.core.app.CoreComponentFactory"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:resizeableActivity="true"
|
||||
android:roundIcon="@drawable/ic_launcher"
|
||||
android:theme="@style/AppTheme" >
|
||||
<meta-data
|
||||
android:name="android.max_aspect"
|
||||
android:value="ratio_float" />
|
||||
|
||||
<activity
|
||||
android:name="net.kdt.pojavlaunch.PojavLoginActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"
|
||||
android:label="@string/app_short_name"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="sensorLandscape" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:host="auth"
|
||||
android:scheme="ms-xal-00000000402b5328" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="net.kdt.pojavlaunch.FatalErrorActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:theme="@style/MenuDialog" />
|
||||
<activity
|
||||
android:name="net.kdt.pojavlaunch.MCLauncherActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"
|
||||
android:screenOrientation="sensorLandscape" />
|
||||
<activity
|
||||
android:name="net.kdt.pojavlaunch.PojavLauncherActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"
|
||||
android:screenOrientation="sensorLandscape" />
|
||||
<activity
|
||||
android:name="net.kdt.pojavlaunch.JavaGUILauncherActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"
|
||||
android:screenOrientation="sensorLandscape" />
|
||||
<activity
|
||||
android:name="net.kdt.pojavlaunch.CustomControlsActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"
|
||||
android:screenOrientation="sensorLandscape" />
|
||||
<activity
|
||||
android:name="net.kdt.pojavlaunch.MainActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"
|
||||
android:launchMode="standard"
|
||||
android:multiprocess="true"
|
||||
android:screenOrientation="sensorLandscape" />
|
||||
<activity
|
||||
android:name="net.kdt.pojavlaunch.prefs.LauncherPreferenceActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|keyboard|navigation"
|
||||
android:screenOrientation="sensorLandscape" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1 @@
|
|||
20210116:1
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -188,24 +188,6 @@ public class JavaGUILauncherActivity extends LoggableActivity {
|
|||
try {
|
||||
List<String> javaArgList = new ArrayList<String>();
|
||||
|
||||
File cacioAwtLibPath = new File(Tools.DIR_GAME_NEW, "cacioawtlib");
|
||||
if (cacioAwtLibPath.exists()) {
|
||||
StringBuilder libStr = new StringBuilder();
|
||||
for (File file: cacioAwtLibPath.listFiles()) {
|
||||
if (file.getName().endsWith(".jar")) {
|
||||
libStr.append(":" + file.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
javaArgList.add("-Xbootclasspath/a" + libStr.toString());
|
||||
}
|
||||
|
||||
javaArgList.add("-Dcacio.managed.screensize=" + CallbackBridge.windowWidth + "x" + CallbackBridge.windowHeight);
|
||||
|
||||
File cacioArgOverrideFile = new File(cacioAwtLibPath, "overrideargs.txt");
|
||||
if (cacioArgOverrideFile.exists()) {
|
||||
javaArgList.addAll(Arrays.asList(Tools.read(cacioArgOverrideFile.getAbsolutePath()).split(" ")));
|
||||
}
|
||||
|
||||
if (javaArgs != null) {
|
||||
javaArgList.addAll(Arrays.asList(javaArgs.split(" ")));
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -335,6 +335,29 @@ public class PojavLoginActivity extends BaseActivity
|
|||
}
|
||||
}
|
||||
|
||||
private void unpackComponent(AssetManager am, String component) throws IOException {
|
||||
InputStream is = am.open("components/" + component + "/version");
|
||||
if(!new File(Tools.DIR_GAME_NEW + "/" + component + "/version").exists()) {
|
||||
Log.i("UnpackPrep", component + ": Pack was installed manually, or does not exist, unpacking new...");
|
||||
String[] fileList = am.list("components/" + component);
|
||||
for(String s : fileList) {
|
||||
Tools.copyAssetFile(this, "components/" + component + "/" + s, Tools.DIR_GAME_NEW + "/" + component, true);
|
||||
}
|
||||
} else {
|
||||
FileInputStream fis = new FileInputStream(new File(Tools.DIR_GAME_NEW + "/" + component + "/version"));
|
||||
String release1 = Tools.read(is);
|
||||
String release2 = Tools.read(fis);
|
||||
if (!release1.equals(release2)) {
|
||||
String[] fileList = am.list("components/" + component);
|
||||
for (String s : fileList) {
|
||||
Tools.copyAssetFile(this, "components/" + component + "/" + s, Tools.DIR_GAME_NEW + "/" + component, true);
|
||||
}
|
||||
} else {
|
||||
Log.i("UnpackPrep", component + ": Pack is up-to-date with the launcher, continuing...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initMain() throws Throwable {
|
||||
mkdirs(Tools.DIR_ACCOUNT_NEW);
|
||||
PojavMigrator.migrateAccountData(this);
|
||||
|
|
@ -380,35 +403,8 @@ public class PojavLoginActivity extends BaseActivity
|
|||
|
||||
AssetManager am = this.getAssets();
|
||||
|
||||
InputStream is = am.open("components/lwjgl3/version");
|
||||
if(!new File(Tools.DIR_GAME_NEW + "/lwjgl3/version").exists()) {
|
||||
Log.i("LWJGL3Prep","Pack was installed manually, or does not exist, unpacking new...");
|
||||
String[] lwjglFileList = am.list("components/lwjgl3");
|
||||
// FileOutputStream fos;
|
||||
// InputStream iis;
|
||||
for(String s : lwjglFileList) {
|
||||
Tools.copyAssetFile(this, "components/lwjgl3/" + s, Tools.DIR_GAME_NEW + "/lwjgl3", true);
|
||||
/*
|
||||
iis = am.open("components/lwjgl3/"+s);
|
||||
fos = new FileOutputStream(new File(Tools.DIR_GAME_NEW+"/lwjgl3/"+s));
|
||||
IOUtils.copy(iis,fos);
|
||||
fos.close();
|
||||
iis.close();
|
||||
*/
|
||||
}
|
||||
} else {
|
||||
FileInputStream fis = new FileInputStream(new File(Tools.DIR_GAME_NEW + "/lwjgl3/version"));
|
||||
String release1 = Tools.read(is);
|
||||
String release2 = Tools.read(fis);
|
||||
if (!release1.equals(release2)) {
|
||||
String[] lwjglFileList = am.list("components/lwjgl3");
|
||||
for (String s : lwjglFileList) {
|
||||
Tools.copyAssetFile(this, "components/lwjgl3/" + s, Tools.DIR_GAME_NEW + "/lwjgl3", true);
|
||||
}
|
||||
} else {
|
||||
Log.i("LWJGL3Prep","Pack is up-to-date with the launcher, continuing...");
|
||||
}
|
||||
}
|
||||
unpackComponent(am, "caciocavallo");
|
||||
unpackComponent(am, "lwjgl3");
|
||||
if (!isJavaRuntimeInstalled(am)) {
|
||||
if(!installRuntimeAutomatically(am)) {
|
||||
File jreTarFile = selectJreTarFile();
|
||||
|
|
|
|||
|
|
@ -70,7 +70,19 @@ public final class Tools
|
|||
// 13w17a: 20130425
|
||||
// 13w18a: 20130502
|
||||
if (mcReleaseDate < 20130502) {
|
||||
// TODO support 13w17a and below by use other AWT impl
|
||||
javaArgList.add("-Djava.awt.headless=false");
|
||||
|
||||
StringBuilder cacioClasspath = new StringBuilder();
|
||||
cacioClasspath.append("-Xbootclasspath/a");
|
||||
File cacioDir = new File(DIR_GAME_NEW + "/caciocavallo");
|
||||
if (cacioDir.exists() && cacioDir.isDirectory()) {
|
||||
for (File file : cacioDir.listFiles()) {
|
||||
if (file.getName().endsWith(".jar")) {
|
||||
cacioClasspath.append(":" + file.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
}
|
||||
javaArgList.add(cacioClasspath.toString());
|
||||
}
|
||||
|
||||
javaArgList.add("-cp");
|
||||
|
|
@ -98,6 +110,14 @@ public final class Tools
|
|||
overrideableArgList.add("-Dpojav.path.minecraft=" + Tools.DIR_GAME_NEW);
|
||||
overrideableArgList.add("-Dpojav.path.private.account=" + Tools.DIR_ACCOUNT_NEW);
|
||||
|
||||
// Caciocavallo config
|
||||
overrideableArgList.add("-Dcacio.managed.screensize=" + CallbackBridge.windowWidth + "x" + CallbackBridge.windowHeight);
|
||||
overrideableArgList.add("-Dsun.font.fontmanager=net.java.openjdk.cacio.ctc.CTCFontManager");
|
||||
overrideableArgList.add("-Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel");
|
||||
overrideableArgList.add("-Dawt.toolkit=net.java.openjdk.cacio.ctc.CTCToolkit");
|
||||
overrideableArgList.add("-Djava.awt.graphicsenv=net.java.openjdk.cacio.ctc.CTCGraphicsEnvironment");
|
||||
overrideableArgList.add("-Dcacio.font.fontmanager=net.java.openjdk.cacio.ctc.CTCFontManager");
|
||||
|
||||
// javaArgList.add("-Dorg.lwjgl.libname=liblwjgl3.so");
|
||||
// javaArgList.add("-Dorg.lwjgl.system.jemalloc.libname=libjemalloc.so");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue