Codota Logo
JadxRuntimeException
Code IndexAdd Codota to your IDE (free)

How to use
JadxRuntimeException
in
jadx.core.utils.exceptions

Best Java code snippets using jadx.core.utils.exceptions.JadxRuntimeException (Showing top 20 results out of 315)

  • Common ways to obtain JadxRuntimeException
private void myMethod () {
JadxRuntimeException j =
  • Codota IconString str;Throwable cause;new JadxRuntimeException(str, cause)
  • Smart code suggestions by Codota
}
origin: skylot/jadx

@Override
public void setParentInsn(InsnNode parentInsn) {
  if (parentInsn == wrappedInsn) {
    throw new JadxRuntimeException("Can't wrap instruction info itself: " + parentInsn);
  }
  this.parentInsn = parentInsn;
}
origin: skylot/jadx

@Override
public void setArg(int n, InsnArg arg) {
  throw new JadxRuntimeException("Unsupported operation for PHI node");
}
origin: skylot/jadx

private static BlockNode getBlock(int offset, Map<Integer, BlockNode> blocksMap) {
  BlockNode block = blocksMap.get(offset);
  if (block == null) {
    throw new JadxRuntimeException("Missing block: " + offset);
  }
  return block;
}
origin: skylot/jadx

  private String processVar(String varName) {
    String str = values.get(varName);
    if (str == null) {
      throw new JadxRuntimeException("Unknown variable: '" + varName
          + "' in template: " + templateName);
    }
    return str;
  }
}
origin: skylot/jadx

public static ImageIcon openIcon(String name) {
  String iconPath = "/icons-16/" + name + ".png";
  URL resource = Utils.class.getResource(iconPath);
  if (resource == null) {
    throw new JadxRuntimeException("Icon not found: " + iconPath);
  }
  return new ImageIcon(resource);
}
origin: skylot/jadx

public static File createTempFile(String suffix) {
  File temp;
  try {
    temp = File.createTempFile("jadx-tmp-", System.nanoTime() + "-" + suffix);
    temp.deleteOnExit();
  } catch (IOException e) {
    throw new JadxRuntimeException("Failed to create temp file with suffix: " + suffix);
  }
  return temp;
}
origin: skylot/jadx

public static Image openImage(String path) {
  URL resource = Utils.class.getResource(path);
  if (resource == null) {
    throw new JadxRuntimeException("Image not found: " + path);
  }
  return Toolkit.getDefaultToolkit().createImage(resource);
}
origin: skylot/jadx

public static void makeDirs(@Nullable File dir) {
  if (dir != null) {
    synchronized (MKDIR_SYNC) {
      if (!dir.mkdirs() && !dir.isDirectory()) {
        throw new JadxRuntimeException("Can't create directory " + dir);
      }
    }
  }
}
origin: skylot/jadx

/**
 * Add exception type to catch block
 * @param type - null for 'all' or 'Throwable' handler
 */
public void addCatchType(@Nullable ClassInfo type) {
  if (type != null) {
    this.catchTypes.add(type);
  } else {
    if (!this.catchTypes.isEmpty()) {
      throw new JadxRuntimeException("Null type added to not empty exception handler: " + this);
    }
  }
}
origin: skylot/jadx

public static File createTempDir(String suffix) {
  try {
    Path path = Files.createTempDirectory("jadx-tmp-" + System.nanoTime() + "-" + suffix);
    path.toFile().deleteOnExit();
    return path.toFile();
  } catch (IOException e) {
    throw new JadxRuntimeException("Failed to create temp directory with suffix: " + suffix);
  }
}
origin: skylot/jadx

private Document loadXML(String xml) {
  Document doc;
  try (InputStream xmlStream = ManifestAttributes.class.getResourceAsStream(xml)) {
    if (xmlStream == null) {
      throw new JadxRuntimeException(xml + " not found in classpath");
    }
    DocumentBuilder dBuilder = XmlSecurity.getSecureDbf().newDocumentBuilder();
    doc = dBuilder.parse(xmlStream);
  } catch (Exception e) {
    throw new JadxRuntimeException("Xml load error, file: " + xml, e);
  }
  return doc;
}
origin: skylot/jadx

  private void saveResourceFile(ResourceFile resFile, File outFile) throws JadxException {
    ResourcesLoader.decodeStream(resFile, (size, is) -> {
      try (FileOutputStream fileStream = new FileOutputStream(outFile)) {
        IOUtils.copy(is, fileStream);
      } catch (Exception e) {
        throw new JadxRuntimeException("Resource file save error", e);
      }
      return null;
    });
  }
}
origin: skylot/jadx

public void load() throws IOException, DecodeException {
  try (InputStream input = getClass().getResourceAsStream(CLST_FILENAME)) {
    if (input == null) {
      throw new JadxRuntimeException("Can't load classpath file: " + CLST_FILENAME);
    }
    load(input);
  }
}
origin: skylot/jadx

public void bindArg(RegisterArg arg, BlockNode pred) {
  if (blockBinds.containsValue(pred)) {
    throw new JadxRuntimeException("Duplicate predecessors in PHI insn: " + pred + ", " + this);
  }
  addArg(arg);
  blockBinds.put(arg, pred);
}
origin: skylot/jadx

private static void load(LangLocale locale) {
  ResourceBundle bundle;
  ClassLoader classLoader = ClassLoader.getSystemClassLoader();
  String resName = String.format("i18n/Messages_%s.properties", locale.get());
  URL bundleUrl = classLoader.getResource(resName);
  if (bundleUrl == null) {
    throw new JadxRuntimeException("Locale resource not found: " + resName);
  }
  try (Reader reader = new InputStreamReader(bundleUrl.openStream(), StandardCharsets.UTF_8)) {
    bundle = new PropertyResourceBundle(reader);
  } catch (IOException e) {
    throw new JadxRuntimeException("Failed to load " + resName, e);
  }
  i18nMessagesMap.put(locale, bundle);
}
origin: skylot/jadx

private void loadFiles(List<File> files) {
  if (files.isEmpty()) {
    throw new JadxRuntimeException("Empty file list");
  }
  inputFiles.clear();
  for (File file : files) {
    try {
      InputFile.addFilesFrom(file, inputFiles, args.isSkipSources());
    } catch (Exception e) {
      throw new JadxRuntimeException("Error load file: " + file, e);
    }
  }
}
origin: skylot/jadx

public static BlockNode selectOther(BlockNode node, List<BlockNode> blocks) {
  List<BlockNode> list = blocks;
  if (list.size() > 2) {
    list = cleanBlockList(list);
  }
  if (list.size() != 2) {
    throw new JadxRuntimeException("Incorrect nodes count for selectOther: " + node + " in " + list);
  }
  BlockNode first = list.get(0);
  if (first != node) {
    return first;
  } else {
    return list.get(1);
  }
}
origin: skylot/jadx

public IfRegion(IRegion parent, BlockNode header) {
  super(parent);
  if (header.getInstructions().size() != 1) {
    throw new JadxRuntimeException("Expected only one instruction in 'if' header");
  }
  this.header = header;
  this.condition = IfCondition.fromIfBlock(header);
}
origin: skylot/jadx

public void addClasspath(ClsSet set) {
  if (nameMap == null) {
    nameMap = new HashMap<>(set.getClassesCount());
    set.addToMap(nameMap);
  } else {
    throw new JadxRuntimeException("Classpath already loaded");
  }
}
origin: skylot/jadx

public static boolean hasBreakInsn(IContainer container) {
  if (container instanceof IBlock) {
    return BlockUtils.checkLastInsnType((IBlock) container, InsnType.BREAK);
  } else if (container instanceof IRegion) {
    List<IContainer> blocks = ((IRegion) container).getSubBlocks();
    return !blocks.isEmpty()
        && hasBreakInsn(blocks.get(blocks.size() - 1));
  } else {
    throw new JadxRuntimeException("Unknown container type: " + container);
  }
}
jadx.core.utils.exceptionsJadxRuntimeException

Most used methods

  • <init>

Popular in Java

  • Making http requests using okhttp
  • getSharedPreferences (Context)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now