fix: remove unused smali builder methods

This commit is contained in:
Connor Tumbleson 2021-03-28 17:26:19 -04:00
parent bddf575318
commit d2288ef921
No known key found for this signature in database
GPG Key ID: C3CC0A201EC7DA75

View File

@ -21,7 +21,6 @@ import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.Token; import org.antlr.runtime.Token;
import org.antlr.runtime.tree.CommonTree; import org.antlr.runtime.tree.CommonTree;
import org.antlr.runtime.tree.CommonTreeNodeStream; import org.antlr.runtime.tree.CommonTreeNodeStream;
import org.apache.commons.io.IOUtils;
import org.jf.dexlib2.writer.builder.DexBuilder; import org.jf.dexlib2.writer.builder.DexBuilder;
import org.jf.smali.smaliFlexLexer; import org.jf.smali.smaliFlexLexer;
import org.jf.smali.smaliParser; import org.jf.smali.smaliParser;
@ -31,28 +30,6 @@ import java.io.*;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
public class SmaliMod { public class SmaliMod {
public static boolean assembleSmaliFile(String smali, DexBuilder dexBuilder, int apiLevel, boolean verboseErrors,
boolean printTokens, File smaliFile) throws IOException, RuntimeException, RecognitionException {
InputStream is = new ByteArrayInputStream(smali.getBytes());
return assembleSmaliFile(is, dexBuilder, apiLevel, verboseErrors, printTokens, smaliFile);
}
public static boolean assembleSmaliFile(InputStream is,DexBuilder dexBuilder, int apiLevel, boolean verboseErrors,
boolean printTokens, File smaliFile) throws IOException, RecognitionException {
// copy our filestream into a tmp file, so we don't overwrite
File tmp = File.createTempFile("BRUT",".bak");
tmp.deleteOnExit();
OutputStream os = new FileOutputStream(tmp);
IOUtils.copy(is, os);
os.close();
return assembleSmaliFile(tmp,dexBuilder, apiLevel, verboseErrors, printTokens);
}
public static boolean assembleSmaliFile(File smaliFile,DexBuilder dexBuilder, int apiLevel, boolean verboseErrors, public static boolean assembleSmaliFile(File smaliFile,DexBuilder dexBuilder, int apiLevel, boolean verboseErrors,
boolean printTokens) throws IOException, RecognitionException { boolean printTokens) throws IOException, RecognitionException {