/** * Assemble the specified files, using the given options * * @param options a SmaliOptions object with the options to run smali with * @param input The files/directories to process * @return true if assembly completed with no errors, or false if errors were encountered */ public static boolean assemble(final SmaliOptions options, String... input) throws IOException { return assemble(options, Arrays.asList(input)); }
private static void getSmaliFilesInDir(@Nonnull File dir, @Nonnull Set<File> smaliFiles) { File[] files = dir.listFiles(); if (files != null) { for(File file: files) { if (file.isDirectory()) { getSmaliFilesInDir(file, smaliFiles); } else if (file.getName().endsWith(".smali")) { smaliFiles.add(file); } } } }
private static boolean compileSmali(File input, File output) { try { SmaliOptions params = new SmaliOptions(); params.outputDexFile = output.getAbsolutePath(); Smali.assemble(params, input.getAbsolutePath()); } catch (Exception e) { throw new AssertionError("Smali assemble error", e); } return true; } }
getSmaliFilesInDir(argFile, filesToProcessSet); } else if (argFile.isFile()) { filesToProcessSet.add(argFile);
/** * Assemble the specified files, using the given options * * @param options a SmaliOptions object with the options to run smali with * @param input The files/directories to process * @return true if assembly completed with no errors, or false if errors were encountered */ public static boolean assemble(final SmaliOptions options, String... input) throws IOException { return assemble(options, Arrays.asList(input)); }
private static void getSmaliFilesInDir(@Nonnull File dir, @Nonnull Set<File> smaliFiles) { File[] files = dir.listFiles(); if (files != null) { for(File file: files) { if (file.isDirectory()) { getSmaliFilesInDir(file, smaliFiles); } else if (file.getName().endsWith(".smali")) { smaliFiles.add(file); } } } }
@Override public void run() { if (help || input == null || input.isEmpty()) { usage(); return; } try { Smali.assemble(getOptions(), input); } catch (IOException ex) { throw new RuntimeException(ex); } }
getSmaliFilesInDir(argFile, filesToProcessSet); } else if (argFile.isFile()) { filesToProcessSet.add(argFile);
@Override public void run() { if (help || input == null || input.isEmpty()) { usage(); return; } try { Smali.assemble(getOptions(), input); } catch (IOException ex) { throw new RuntimeException(ex); } }
@Override public void run() { if (help || input == null || input.isEmpty()) { usage(); return; } try { Smali.assemble(getOptions(), input); } catch (IOException ex) { throw new RuntimeException(ex); } }