Skip to content

Commit

Permalink
[fix] Fix architecture support, change version to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
george committed Jun 2, 2024
1 parent ecdf355 commit 88ecee3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = "org.hostile"
version = "1.0.0-SNAPSHOT-final"
version = "1.0.0"

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,17 @@ public NativeTlsLibrary downloadBinaries() {
directory.mkdir();
}

String systemArchitecture = System.getProperty("os.arch");
String normalizedPlatform = getPlatform();
String architectureBits = System.getProperty("os.arch").replaceAll("[^0-9]", "");

String architectureTag = !normalizedPlatform.equals("windows") && (systemArchitecture.equals("aarch64") || systemArchitecture.equals("arm64")) ?
"arm64" : systemArchitecture.replaceAll("[^0-9]", "");

return Jsoup.connect(String.format(REPOSITORY_RELEASES_URL + "/expanded_assets/%s", this.releaseString)).get()
.select("a")
.stream()
.filter(element -> element.attr("href") != null &&
element.attr("href").contains(normalizedPlatform) && element.attr("href").contains(architectureBits))
element.attr("href").contains(normalizedPlatform) && element.attr("href").contains(architectureTag))
.map(this::downloadAndInject)
.filter(Objects::nonNull)
.findFirst()
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/org/hostile/jtls/response/Response.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import com.google.gson.JsonObject;
import org.hostile.jtls.client.JavaTlsClient;
import org.hostile.jtls.cookie.Cookie;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
Expand Down Expand Up @@ -44,6 +46,10 @@ public Response(JsonObject object, JavaTlsClient client) {
}
}

public Document soup() {
return Jsoup.parse(this.body);
}

public String text() {
return this.body;
}
Expand Down

0 comments on commit 88ecee3

Please sign in to comment.