本文整理了Java中droidefense.log4j.Log.write()
方法的一些代码示例,展示了Log.write()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Log.write()
方法的具体详情如下:
包路径:droidefense.log4j.Log
类名称:Log
方法名:write
暂无
代码示例来源: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
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
@Override
public void onExecute() {
if (metainfManifestFile != null) {
Log.write(LoggerType.DEBUG, "Meta-inf manifest file found");
Log.write(LoggerType.DEBUG, "Reading creator...");
readFileCreator();
}
}
代码示例来源:origin: droidefense/engine
private void createDefaultConfigurationFile() {
Log.write(LoggerType.DEBUG, "Creating default config.json file...");
try {
boolean success = DroidDefenseEnvironmentConfig.getInstance().createDefaultConfigJsonFile();
if (success) {
Log.write(LoggerType.INFO, "Configuration file succesfully created", "Please, configure it and lauch droidefense again");
}
} catch (ConfigFileNotFoundException e) {
Log.write(LoggerType.FATAL, "Could not create default .json file. Please check your filesystem permissions and try again");
}
}
}
代码示例来源:origin: droidefense/engine
private void printMatchedRules(ArrayList<Rule> matchedRules) {
if (matchedRules != null && !matchedRules.isEmpty()) {
for (Rule r : matchedRules) {
Log.write(LoggerType.INFO, "Matched rule: " + r.getDesc());
Log.write(LoggerType.INFO, "Rule details:" + r.toString());
}
}
}
代码示例来源:origin: droidefense/engine
@Override
public void parserCode() {
Log.write(LoggerType.INFO, "\n\nSearching for Steganos content...\n\n");
ArrayList<VirtualFile> fileList = currentProject.getAppFiles();
/*for (AbstractHashedFile r : fileList) {
//TODO implement at least LSB algorithm
}*/
}
}
代码示例来源:origin: droidefense/engine
private void openReportOnBorwser() {
try {
Desktop.getDesktop().open(reportFile);
} catch (Exception e) {
Log.write(LoggerType.ERROR, "Could no automatically open sample report on user browser", e.getLocalizedMessage());
}
}
}
代码示例来源:origin: droidefense/engine
@Override
public void finish() {
currentProject.setFollowCallsMap(flowMap);
Log.write(LoggerType.DEBUG, "WORKER: FollowCallsControlFlowGraphWorker FINISHED!");
}
代码示例来源:origin: droidefense/engine
public AbstractHandler() {
try {
environment = DroidDefenseEnvironmentConfig.getInstance();
} catch (ConfigFileNotFoundException e) {
Log.write(LoggerType.FATAL, "Could not retrieve droidefense environment config file data");
}
}
代码示例来源:origin: droidefense/engine
@Override
public String getResultName() {
try {
return DroidDefenseEnvironmentConfig.getInstance().ANDROID_SDK_SUPPORT_CLASS_HASHSET_NAME;
} catch (ConfigFileNotFoundException e) {
Log.write(LoggerType.FATAL, "Could not retrieve ANDROID_SDK_SUPPORT_CLASS_HASHSET_NAME from external config file", e.getLocalizedMessage());
return null;
}
}
},
代码示例来源:origin: droidefense/engine
private void remap() {
this.currentProject.setAndroidReferences(this.references);
ArrayList<VirtualFile> xmls = this.currentProject.getXmlFiles();
for (VirtualFile vf : xmls) {
Log.write(LoggerType.DEBUG, "Updating content of " + vf.getPath());
singleRemap(vf);
}
//todo reparse AndroidManifest.xml
Log.write(LoggerType.DEBUG, "Remapping [OK]");
}
代码示例来源:origin: droidefense/engine
private void readSingleDexFile(DalvikDexModel model, DexOperator op, DexHashedFile dex) {
if (!dex.isHeaderReaded()) {
try {
readHeader(model, op);
dex.setDexHeaderReaded(true);
readData(model, op);
} catch (IllegalArgumentException e) {
Log.write(LoggerType.ERROR, "Could not read header of dex file " + dex.getAbsolutePath());
Log.write(LoggerType.ERROR, "Error details: " + e.getLocalizedMessage());
}
}
}
代码示例来源:origin: droidefense/engine
private DroidDefenseEnvironment() {
//read external config
try {
config = DroidDefenseEnvironmentConfig.getInstance();
readEnvironmentalFiles();
} catch (ConfigFileNotFoundException e) {
Log.write(LoggerType.FATAL, "Error reading configuration file", e.getLocalizedMessage());
}
}
代码示例来源:origin: droidefense/engine
private void definePackageNameTypes() {
try {
this.currentProject.setClassWithPackageName(man.getApplication().getActivities().get(0).getName().contains(man.getPackageName()));
} catch (Exception e) {
Log.write(LoggerType.ERROR, "Droidefense could not determine if this sample has built-in package name in source code classes", e.getLocalizedMessage());
this.currentProject.setClassWithPackageName(false);
}
}
代码示例来源:origin: droidefense/engine
@Override
public void parserCode() {
Log.write(LoggerType.INFO, "\n\nParsing Android Certificate...\n");
//TODO fix
try {
AbstractHashedFile certificateFile = currentProject.getStaticInfo().getCertFile();
extractCertInfo(certificateFile.getStream());
} catch (Exception e) {
e.printStackTrace();
}
}
代码示例来源:origin: droidefense/engine
private void startSampleScan(DroidefenseProject project) throws UnknownAnalyzerException {
Log.write(LoggerType.TRACE, "Project ID:\t" + project.getProjectId());
AbstractAndroidAnalysis analyzer = AnalysisFactory.getAnalyzer(AnalysisFactory.GENERAL);
project.analyze(analyzer);
}
代码示例来源:origin: droidefense/engine
@Override
public boolean doTheJob() {
if (file != null && file.isFile() && file.canRead()) {
try {
ret = FileIOHandler.callSystemExec(EXEC_PATH + file.getAbsolutePath());
return true;
} catch (IOException e) {
Log.write(LoggerType.ERROR, "Could not use file command to detect filetype", e.getLocalizedMessage());
}
}
return false;
}
代码示例来源:origin: droidefense/engine
@Override
protected boolean analyze() {
Log.write(LoggerType.TRACE, "\n\n --- Running Droidefense psocut analysis ---\n\n");
AbstractHandler handler;
//run pscout apimodel
handler = new PscoutHandler(currentProject, currentProject.getNormalControlFlowMap().getNodeList());
executionSuccessful = handler.doTheJob();
//stop timer
stop();
return executionSuccessful;
}
代码示例来源:origin: droidefense/engine
@Override
protected boolean analyze() {
Log.write(LoggerType.TRACE, "\n\n --- Running Droidefense dynamic analysis ---\n\n");
//run dex file statistics handler
AbstractHandler handler = new DexMetadataHandler(currentProject);
executionSuccessful &= handler.doTheJob();
//execute selected controlflow
handler = new VMWorkersHandler(currentProject);
executionSuccessful &= handler.doTheJob();
this.currentProject.setDynamicAnalysisDone(true);
return executionSuccessful;
}
代码示例来源:origin: droidefense/engine
private boolean getContentInfoFromCustom() {
Log.write(LoggerType.TRACE, "getting content info from custom file classifier...");
SignatureHandler handler = SignatureHandler.getInstance();
handler.setFile(this);
handler.setNameExtension(this.getExtensionFilename());
handler.doTheJob();
handler.updateDescription();
return handler.isSignatureFound();
}
内容来源于网络,如有侵权,请联系作者删除!