mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-04-01 22:14:01 +03:00
To Strings...
This commit is contained in:
parent
d18978cffb
commit
32082e4e36
4 changed files with 9 additions and 8 deletions
|
@ -162,7 +162,7 @@ public void build() throws IOException {
|
|||
String filename = e.getName();
|
||||
output.putNextEntry(IOHelper.newZipEntry(e.getName()));
|
||||
if (filename.endsWith(".class")) {
|
||||
CharSequence classname = filename.replace('/', '.').subSequence(0,
|
||||
String classname = filename.replace('/', '.').substring(0,
|
||||
filename.length() - ".class".length());
|
||||
byte[] bytes;
|
||||
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream(2048)) {
|
||||
|
@ -231,7 +231,7 @@ private void stdBuild() throws IOException {
|
|||
continue;
|
||||
}
|
||||
if (filename.endsWith(".class")) {
|
||||
CharSequence classname = filename.replace('/', '.').subSequence(0,
|
||||
String classname = filename.replace('/', '.').substring(0,
|
||||
filename.length() - ".class".length());
|
||||
byte[] bytes;
|
||||
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream(2048)) {
|
||||
|
|
|
@ -25,7 +25,7 @@ public static interface BuildHook {
|
|||
|
||||
@FunctionalInterface
|
||||
public static interface Transformer {
|
||||
byte[] transform(byte[] input, CharSequence classname, JARLauncherBinary data);
|
||||
byte[] transform(byte[] input, String classname, JARLauncherBinary data);
|
||||
}
|
||||
|
||||
private boolean BUILDRUNTIME;
|
||||
|
@ -95,13 +95,13 @@ public boolean buildRuntime() {
|
|||
return BUILDRUNTIME;
|
||||
}
|
||||
|
||||
public byte[] classTransform(byte[] clazz, CharSequence classname, JARLauncherBinary reader) {
|
||||
public byte[] classTransform(byte[] clazz, String classname, JARLauncherBinary reader) {
|
||||
byte[] result = clazz;
|
||||
for (Transformer transformer : CLASS_TRANSFORMER) result = transformer.transform(result, classname, reader);
|
||||
return result;
|
||||
}
|
||||
|
||||
public byte[] proGuardClassTransform(byte[] clazz, CharSequence classname, JARLauncherBinary reader) {
|
||||
public byte[] proGuardClassTransform(byte[] clazz, String classname, JARLauncherBinary reader) {
|
||||
byte[] result = clazz;
|
||||
for (Transformer transformer : POST_PROGUARD_HOOKS) result = transformer.transform(result, classname, reader);
|
||||
return result;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
public class NodeTransformer implements Transformer {
|
||||
@FunctionalInterface
|
||||
public static interface ClassNodeTransformer {
|
||||
void transform(ClassNode node, CharSequence classname, JARLauncherBinary data);
|
||||
void transform(ClassNode node, String classname, JARLauncherBinary data);
|
||||
}
|
||||
|
||||
private final List<ClassNodeTransformer> transLst;
|
||||
|
@ -28,7 +28,7 @@ public NodeTransformer() {
|
|||
}
|
||||
|
||||
@Override
|
||||
public byte[] transform(byte[] input, CharSequence classname, JARLauncherBinary data) {
|
||||
public byte[] transform(byte[] input, String classname, JARLauncherBinary data) {
|
||||
ClassReader cr = new ClassReader(input);
|
||||
ClassNode cn = new ClassNode();
|
||||
cr.accept(cn, ClassReader.EXPAND_FRAMES);
|
||||
|
|
|
@ -55,8 +55,9 @@ public static void makeJsonRequest(RequestInterface request, Runnable callback)
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
@LauncherAPI
|
||||
public static void startTask(Task task)
|
||||
public static void startTask(@SuppressWarnings("rawtypes") Task task)
|
||||
{
|
||||
try {
|
||||
worker.queue.put(task);
|
||||
|
|
Loading…
Reference in a new issue