Skip to content

Commit

Permalink
Fix Submodule Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
thejudge156 authored and CADIndie committed Jun 5, 2024
1 parent ce178a8 commit 727b1ec
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
8 changes: 7 additions & 1 deletion .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
with:
submodules: true
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
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
13 changes: 5 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,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 +45,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")
}
}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ dependencyResolutionManagement {
}

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

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
2 changes: 1 addition & 1 deletion wrapper

0 comments on commit 727b1ec

Please sign in to comment.