Skip to content

Commit

Permalink
Merge pull request #6 from QuestCraftPlusPlus/QuestCraft
Browse files Browse the repository at this point in the history
merging (expect on a different branch)
  • Loading branch information
thewiilover authored Jun 6, 2024
2 parents 2da9e5b + cecb34f commit 2e56193
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 18 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,21 @@ permissions:
jobs:
build:

runs-on: ubuntu-latest
runs-on: windows-2022

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
with:
submodules: true
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '11'
distribution: 'temurin'
- uses: nttld/setup-ndk@v1
with:
ndk-version: r21d
local-cache: true
- name: Make Gradle wrapper executable
run: git lfs pull | chmod +x ./gradlew
- name: Build with Gradle
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ local.properties
bin
.classpath
.project
/.cxx
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "wrapper"]
path = wrapper
url = https://github.com/QuestCraftPlusPlus/Wrapper-IL2CPP.git
17 changes: 8 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
plugins {
id("com.android.library") version("7.4.0")
id("com.android.library") version("7.1.0")
}

android {
ndkVersion = "26.1.10909125"
compileSdkVersion = "android-32"
defaultConfig {
minSdkVersion(29)

ndk.stl = "c++_shared"
}

buildTypes {
Expand All @@ -27,6 +29,10 @@ android {
buildToolsVersion = "30.0.3"
}

build {
finalizedBy(':wrapper:launcher:build')
}

dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api("org.apache.commons:commons-math3:3.6.1")
Expand All @@ -41,14 +47,7 @@ dependencies {
implementation("org.json:json:20220924")
implementation("commons-io:commons-io:2.13.0")
implementation("commons-codec:commons-codec:1.15")
implementation("androidx.legacy:legacy-support-v4:1.0.0")
implementation("androidx.preference:preference-ktx:1.2.1")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.legacy:legacy-preference-v14:1.0.0")
implementation("com.google.android.material:material:1.8.0")
implementation("androidx.annotation:annotation:1.7.1")
implementation("com.microsoft.azure:msal4j:1.14.0")
implementation("androidx.browser:browser:1.7.0")
implementation("blank:unity-classes")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
}
}
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
android.useAndroidX=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx4G
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Tue Jun 04 16:34:57 EDT 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 4 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ dependencyResolutionManagement {
}
flatDir {
dirs("libs")
dirs("wrapper/unityLibrary/libs")
}
}
}

rootProject.name = "Pojlib"
rootProject.name = "Pojlib"
include ':wrapper', ':wrapper:launcher', "wrapper:unityLibrary", "wrapper:unityLibrary:xrmanifest.androidlib"

Binary file modified src/main/assets/JRE-21.zip
Binary file not shown.
Binary file added src/main/assets/hacks/ResConfHack.jar
Binary file not shown.
11 changes: 9 additions & 2 deletions src/main/java/pojlib/account/LoginHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.io.FileReader;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
Expand Down Expand Up @@ -64,7 +65,10 @@ public static MinecraftAccount getNewToken(Activity activity) {
throw new RuntimeException("Error!: QuestCraft account not set!");
}
IAccount account = accounts.iterator().next();
future = pca.acquireTokenSilently(SilentParameters.builder(Set.of("XboxLive.SignIn", "XboxLive.offline_access"), account).build());
HashSet<String> params = new HashSet<>();
params.add("XboxLive.SignIn");
params.add("XboxLive.offline_access");
future = pca.acquireTokenSilently(SilentParameters.builder(params, account).build());
} catch (MalformedURLException e) {
Logger.getInstance().appendToLog(e.toString());
throw new RuntimeException(e);
Expand All @@ -82,8 +86,11 @@ public static MinecraftAccount getNewToken(Activity activity) {
public static void beginLogin(Activity activity) {
loginThread = new Thread(() -> {
Consumer<DeviceCode> deviceCodeConsumer = (DeviceCode deviceCode) -> API_V1.msaMessage = deviceCode.message();
HashSet<String> params = new HashSet<>();
params.add("XboxLive.SignIn");
params.add("XboxLive.offline_access");
CompletableFuture<IAuthenticationResult> future = pca.acquireToken(
DeviceCodeFlowParameters.builder(Set.of("XboxLive.SignIn", "XboxLive.offline_access"), deviceCodeConsumer).build());
DeviceCodeFlowParameters.builder(params, deviceCodeConsumer).build());

try {
IAuthenticationResult res = future.get();
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/pojlib/install/Installer.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public static String installLibraries(VersionInfo versionInfo, String gameDir) t

// Add our GLFW
classpath.add(Constants.USER_HOME + "/lwjgl3/lwjgl-glfw-classes.jar");
// DNS SRV Resolver fix
classpath.add(Constants.USER_HOME + "/hacks/ResConfHack.jar");

return classpath.toString();
}
Expand Down Expand Up @@ -118,6 +120,7 @@ public static String installAssets(VersionInfo minecraftVersionInfo, String game
FileUtils.writeByteArrayToFile(new File(instance.gameDir + "/config/modernfix-mixins.properties"), FileUtil.loadFromAssetToByte(activity,"modernfix-mixins.properties"));
FileUtils.writeByteArrayToFile(new File(instance.gameDir + "/options.txt"), FileUtil.loadFromAssetToByte(activity, "options.txt"));
FileUtils.writeByteArrayToFile(new File(instance.gameDir + "/optionsviveprofiles.txt"), FileUtil.loadFromAssetToByte(activity, "optionsviveprofiles.txt"));
FileUtils.writeByteArrayToFile(new File(Constants.USER_HOME + "/hacks/ResConfHack.jar"), FileUtil.loadFromAssetToByte(activity, "hacks/ResConfHack.jar"));

return new File(gameDir + "/assets").getAbsolutePath();
}
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/pojlib/util/JREUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ else if (API_V1.model.equals("Oculus Quest")) {

userArgs.add("-XX:+UseZGC");
userArgs.add("-XX:+ZGenerational");
userArgs.add("-XX:+UnlockExperimentalVMOptions");
userArgs.add("-XX:-UseJVMCICompiler");
userArgs.add("-XX:+UnlockDiagnosticVMOptions");
userArgs.add("-XX:+DisableExplicitGC");
userArgs.add("-XX:+UseCriticalJavaThreadPriority");

userArgs.add("-Dorg.lwjgl.opengl.libname=" + graphicsLib);
userArgs.add("-Dorg.lwjgl.opengles.libname=" + "/system/lib64/libGLESv3.so");
Expand Down Expand Up @@ -242,7 +247,8 @@ public static List<String> getJavaArgs(Context ctx, MinecraftInstances.Instance
"-Dglfwstub.windowHeight=" + 720,
"-Dglfwstub.initEgl=false",
"-Dlog4j2.formatMsgNoLookups=true", //Log4j RCE mitigation
"-Dnet.minecraft.clientmodname=" + "null"
"-Dnet.minecraft.clientmodname=" + "QuestCraft",
"-Dext.net.resolvPath=" + Constants.USER_HOME + "/hacks/ResConfHack.jar"
));
}

Expand Down
1 change: 1 addition & 0 deletions wrapper
Submodule wrapper added at f6140b

0 comments on commit 2e56193

Please sign in to comment.