mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 09:01:08 +03:00
[FIX] ClassPath для Radon и Proguard.
This commit is contained in:
parent
62af331966
commit
9122a700e0
4 changed files with 12 additions and 2 deletions
|
@ -21,6 +21,7 @@ public final class JARLauncherBinary extends LauncherBinary {
|
||||||
public final Path buildDir;
|
public final Path buildDir;
|
||||||
public List<LauncherBuildTask> tasks;
|
public List<LauncherBuildTask> tasks;
|
||||||
public List<Path> coreLibs;
|
public List<Path> coreLibs;
|
||||||
|
public List<Path> addonLibs;
|
||||||
|
|
||||||
public JARLauncherBinary(LaunchServer server) throws IOException {
|
public JARLauncherBinary(LaunchServer server) throws IOException {
|
||||||
super(server);
|
super(server);
|
||||||
|
@ -31,6 +32,7 @@ public JARLauncherBinary(LaunchServer server) throws IOException {
|
||||||
buildDir = server.dir.resolve("build");
|
buildDir = server.dir.resolve("build");
|
||||||
tasks = new ArrayList<>();
|
tasks = new ArrayList<>();
|
||||||
coreLibs = new ArrayList<>();
|
coreLibs = new ArrayList<>();
|
||||||
|
addonLibs = new ArrayList<>();
|
||||||
if (!Files.isDirectory(buildDir)) {
|
if (!Files.isDirectory(buildDir)) {
|
||||||
Files.deleteIfExists(buildDir);
|
Files.deleteIfExists(buildDir);
|
||||||
Files.createDirectory(buildDir);
|
Files.createDirectory(buildDir);
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ProguardConf {
|
public class ProguardConf {
|
||||||
private static final String charsFirst = "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ";
|
|
||||||
private static final String chars = "1aAbBcC2dDeEfF3gGhHiI4jJkKl5mMnNoO6pPqQrR7sStT8uUvV9wWxX0yYzZ";
|
private static final String chars = "1aAbBcC2dDeEfF3gGhHiI4jJkKl5mMnNoO6pPqQrR7sStT8uUvV9wWxX0yYzZ";
|
||||||
|
|
||||||
private static String generateString(SecureRandom rand, String lowString, String upString, int il) {
|
private static String generateString(SecureRandom rand, String lowString, String upString, int il) {
|
||||||
|
@ -51,6 +50,9 @@ public String[] buildConfig(Path inputJar, Path outputJar) {
|
||||||
srv.launcherBinary.coreLibs.stream()
|
srv.launcherBinary.coreLibs.stream()
|
||||||
.map(e -> "-libraryjars \'" + e.toAbsolutePath().toString() + "\'")
|
.map(e -> "-libraryjars \'" + e.toAbsolutePath().toString() + "\'")
|
||||||
.forEach(confStrs::add);
|
.forEach(confStrs::add);
|
||||||
|
srv.launcherBinary.addonLibs.stream()
|
||||||
|
.map(e -> "-libraryjars \'" + e.toAbsolutePath().toString() + "\'")
|
||||||
|
.forEach(confStrs::add);
|
||||||
confStrs.add("-classobfuscationdictionary \'" + words.toFile().getName() + "\'");
|
confStrs.add("-classobfuscationdictionary \'" + words.toFile().getName() + "\'");
|
||||||
confStrs.add(readConf());
|
confStrs.add(readConf());
|
||||||
return confStrs.toArray(new String[0]);
|
return confStrs.toArray(new String[0]);
|
||||||
|
|
|
@ -30,7 +30,9 @@ public String getName() {
|
||||||
@Override
|
@Override
|
||||||
public Path process(Path inputFile) throws IOException {
|
public Path process(Path inputFile) throws IOException {
|
||||||
server.launcherBinary.coreLibs.clear();
|
server.launcherBinary.coreLibs.clear();
|
||||||
|
server.launcherBinary.addonLibs.clear();
|
||||||
IOHelper.walk(server.launcherLibraries, new ListFileVisitor(server.launcherBinary.coreLibs), true);
|
IOHelper.walk(server.launcherLibraries, new ListFileVisitor(server.launcherBinary.coreLibs), true);
|
||||||
|
IOHelper.walk(server.launcherLibrariesCompile, new ListFileVisitor(server.launcherBinary.addonLibs), true);
|
||||||
UnpackHelper.unpack(IOHelper.getResourceURL("Launcher.jar"), result);
|
UnpackHelper.unpack(IOHelper.getResourceURL("Launcher.jar"), result);
|
||||||
tryUnpack();
|
tryUnpack();
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -4,8 +4,10 @@
|
||||||
import ru.gravit.utils.helper.IOHelper;
|
import ru.gravit.utils.helper.IOHelper;
|
||||||
import ru.gravit.utils.helper.UnpackHelper;
|
import ru.gravit.utils.helper.UnpackHelper;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import me.itzsomebody.radon.Radon;
|
import me.itzsomebody.radon.Radon;
|
||||||
|
@ -35,7 +37,9 @@ public Path process(Path inputFile) throws IOException {
|
||||||
SessionInfo info = p.createSessionFromConfig();
|
SessionInfo info = p.createSessionFromConfig();
|
||||||
info.setInput(inputFile.toFile());
|
info.setInput(inputFile.toFile());
|
||||||
info.setOutput(outputFile.toFile());
|
info.setOutput(outputFile.toFile());
|
||||||
info.setLibraries(srv.launcherBinary.coreLibs.stream().map(e -> e.toFile()).collect(Collectors.toList()));
|
List<File> libs = srv.launcherBinary.coreLibs.stream().map(e -> e.toFile()).collect(Collectors.toList());
|
||||||
|
libs.addAll(srv.launcherBinary.addonLibs.stream().map(e -> e.toFile()).collect(Collectors.toList()));
|
||||||
|
info.setLibraries(libs);
|
||||||
Radon r = new Radon(info);
|
Radon r = new Radon(info);
|
||||||
r.run();
|
r.run();
|
||||||
return outputFile;
|
return outputFile;
|
||||||
|
|
Loading…
Reference in a new issue