droidefense.log4j.Log类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(232)

本文整理了Java中droidefense.log4j.Log类的一些代码示例,展示了Log类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Log类的具体详情如下:
包路径:droidefense.log4j.Log
类名称:Log

Log介绍

暂无

代码示例

代码示例来源:origin: droidefense/engine

public AbstractHashedFile(boolean generateInformation) {
  this.generateInformation = generateInformation;
  if (generateInformation) {
    Log.write(LoggerType.INFO, "Full sample hashing is enabled!", "It may slow down overall analysis time");
  }
}

代码示例来源:origin: droidefense/engine

public static void write(LoggerType type, Object... oarray) {
  boolean alwaysPrintsErrors = type == LoggerType.ERROR || type == LoggerType.FATAL;
  if (isVerboseEnabled() || alwaysPrintsErrors) {
    //verbose enabled, print it
    LoggerType selectedLogger = instance.get(type.name());
    if (selectedLogger != null) {
      for (Object o : oarray)
        selectedLogger.log(o);
    }
  }
}

代码示例来源:origin: droidefense/engine

@Override
public boolean doTheJob() {
  Log.write(LoggerType.DEBUG, "[START] Unpacking...");
      parentNode = root;
      String entryName = entry.getName();
      Log.write(LoggerType.DEBUG, "\t" + entryName);
      if (!entry.isDirectory()) {
    Log.write(LoggerType.DEBUG, "Virtual file system created");
  } catch (FileNotFoundException e) {
    error = e;
    Log.write(LoggerType.ERROR, "Could not find target file to unzip", e.getLocalizedMessage());
  } catch (IOException e) {
    Log.write(LoggerType.ERROR, "An IO error ocurred while unpacking", e.getLocalizedMessage());
    error = e;
  } catch (Exception e) {
    Log.droidefenseGenericError(e);
    error = e;

代码示例来源:origin: droidefense/engine

private void executeCustom(CommandLine cmd) throws UnknownAnalyzerException {
  this.project = new DroidefenseProject();
  //get user selected unpacker. default zip
  APKUnpacker unpacker = APKUnpacker.ZIP;
  if (cmd.hasOption("unpacker")) {
    String unpackerStr = cmd.getOptionValue("unpacker");
    unpacker = APKUnpacker.getUnpackerFromStringName(unpackerStr);
  }
  this.project.setUsedUnpacker(unpacker);
  if (cmd.hasOption("output")) {
    project.setSettingsReportType(cmd.getOptionValue("output"));
  }
  //set boolean values
  project.setSettingAutoOpen(cmd.hasOption("show"));
  Log.beVerbose(cmd.hasOption("verbose"));
  //read user selected .apk
  if (cmd.hasOption("input")) {
    processInput(cmd, unpacker);
  } else {
    //as default action
    options.showHelp();
  }
}

代码示例来源:origin: droidefense/engine

public final void log(Object o, final int count) {
  String separator = "";
  for (int i = 0; i < count; i++)
    separator += "\t";
  Log.write(LoggerType.TRACE, separator + o);
}

代码示例来源:origin: droidefense/engine

public ManifestParser() {
  Log.write(LoggerType.TRACE, "Running ManifestParser...");
  Log.write(LoggerType.TRACE, "Compiled with JAVA SDK v" + JDK_LANGUAGE_LEVEL);
  Log.write(LoggerType.TRACE, "Max AndroidManifest.xml version supported: " + MAX_ANDROID_VERSION);
}

代码示例来源:origin: droidefense/engine

@Override
public void finish() {
  Log.write(LoggerType.DEBUG, "WORKER: RealFlowWorker FINISHED!");
}

代码示例来源:origin: droidefense/engine

private void connectionError(NATSException ex) {
    Log.write(LoggerType.ERROR, "Connection Exception: ", ex);
  }
}

代码示例来源:origin: droidefense/engine

private void readData(DalvikDexModel dexModel, DexOperator operator) {
  Log.write(LoggerType.DEBUG, "Reading DEX file data...");
  //TODO implement a secondary .dex file content reader
}

代码示例来源:origin: droidefense/engine

@Override
protected void postExecute() {
  Log.write(LoggerType.DEBUG, "Manifest Checker Plugin finished");
}

代码示例来源:origin: droidefense/engine

public void log(Object o, int level) {
  Log.write(LoggerType.TRACE, " " + o);
}

代码示例来源:origin: droidefense/engine

private void forceExit() {
  Log.write(LoggerType.TRACE, "Droidefense scan finished");
  Log.write(LoggerType.TRACE, "Aborting further execution");
  Log.write(LoggerType.TRACE, "Exiting...");
  //force exit
  System.exit(-1);
}

代码示例来源:origin: droidefense/engine

/**
 * Compare given data array with dex magic signature
 *
 * @param dexData
 * @return
 */
public static boolean verifyDexFile(byte[] dexData) {
  boolean valid = true;
  byte[] signature = InternalConstant.DEX_FILE_MAGIC;
  Log.write(LoggerType.TRACE, "Checking .dex file signature");
  for (int i = 0; i < signature.length; i++) {
    valid &= dexData[i] == signature[i];
  }
  Log.write(LoggerType.TRACE, ".dex file seems to be " + (valid ? "valid." : "not valid."));
  return true;
}

代码示例来源:origin: droidefense/engine

public void info() {
  Log.write(LoggerType.DEBUG, "-----------VFS INFO BEGIN-----------");
  Log.write(LoggerType.DEBUG, "Total elements in VFS: \t" + totalElements);
  Log.write(LoggerType.DEBUG, "Total folders in VFS: \t" + folderList.size());
  Log.write(LoggerType.DEBUG, "Total files in VFS: \t" + fileList.size());
  Log.write(LoggerType.DEBUG, "Estimated VFS size: \t");
  Log.write(LoggerType.DEBUG, "\t\tBytes: " + sizeBytes);
  Log.write(LoggerType.DEBUG, "\t\tKb: " + sizeBytes / 1000);
  Log.write(LoggerType.DEBUG, "\t\tMb: " + sizeBytes / 1000 / 1000);
  Log.write(LoggerType.DEBUG, "\t\tGb: " + sizeBytes / 1000 / 1000 / 1000);
  Log.write(LoggerType.DEBUG, "\t\tTb: " + sizeBytes / 1000 / 1000 / 1000 / 1000);
  Log.write(LoggerType.DEBUG, "-----------VFS INFO END-----------");
  print();
}

代码示例来源:origin: droidefense/engine

public void print() {
  Log.write(LoggerType.DEBUG, "-----------VFS FILE TREE BEGIN-----------");
  Log.write(LoggerType.DEBUG, this.tree());
  Log.write(LoggerType.DEBUG, "-----------VFS FILE TREE END-----------");
}

代码示例来源:origin: droidefense/engine

public void printProjectInfo() {
  Log.write(LoggerType.TRACE, " -- PROJECT OUTPUT -- ");
  Log.write(LoggerType.TRACE, "");
  Log.write(LoggerType.TRACE, getProjectAsJson());
}

代码示例来源:origin: droidefense/engine

public static void droidefenseGenericError(Exception e) {
    Log.write(LoggerType.ERROR, "Droidefense error, please report", e.getLocalizedMessage());
  }
}

代码示例来源:origin: droidefense/engine

public AndroidLogEmulator(String methodName, Object[] args) {
  this.methodName = methodName;
  this.args = args;
  if (actions.size() == 0) {
    actions.put(ERROR, args1 -> Log.write(LoggerType.ERROR, args1));
    actions.put(INFO, args12 -> Log.write(LoggerType.INFO, args12));
    actions.put(DEBUG, args13 -> Log.write(LoggerType.DEBUG, args13));
    actions.put(WARNING, args14 -> Log.write(LoggerType.WARN, args14));
  }
}

代码示例来源:origin: droidefense/engine

@Override
public void finish() {
  Log.write(LoggerType.DEBUG, "Android R references resolved!");
  Log.write(LoggerType.DEBUG, "Number of references resolved: " + this.references.size());
  Log.write(LoggerType.DEBUG, "Remapping old files...");
  this.remap();
}

代码示例来源:origin: droidefense/engine

@Override
public void onExecute() {
  if (metainfManifestFile != null) {
    Log.write(LoggerType.DEBUG, "Meta-inf manifest file found");
    Log.write(LoggerType.DEBUG, "Reading creator...");
    readFileCreator();
  }
}

相关文章

Log类方法