MCPcopy Index your code
hub / github.com/cSploit/android / errorLogging

Method errorLogging

cSploit/src/org/csploit/android/core/System.java:415–455  ·  view source on GitHub ↗
(Throwable e)

Source from the content-addressed store, hash-verified

413 }
414
415 public static synchronized void errorLogging(Throwable e){
416 String message = "Unknown error.",
417 trace = "Unknown trace.",
418 filename = (new File(Environment.getExternalStorageDirectory().toString(), ERROR_LOG_FILENAME)).getAbsolutePath();
419
420 if(e != null){
421 if(e.getMessage() != null && !e.getMessage().isEmpty())
422 message = e.getMessage();
423
424 else if(e.toString() != null)
425 message = e.toString();
426
427 if(message.equals(mLastError))
428 return;
429
430 Writer sWriter = new StringWriter();
431 PrintWriter pWriter = new PrintWriter(sWriter);
432
433 e.printStackTrace(pWriter);
434
435 trace = sWriter.toString();
436
437 if(mContext != null && getSettings().getBoolean("PREF_DEBUG_ERROR_LOGGING", false)){
438 try{
439 FileWriter fWriter = new FileWriter(filename, true);
440 BufferedWriter bWriter = new BufferedWriter(fWriter);
441
442 bWriter.write(trace);
443
444 bWriter.close();
445 }
446 catch(IOException ioe){
447 Logger.error(ioe.toString());
448 }
449 }
450 }
451
452 setLastError(message);
453 Logger.error(message);
454 Logger.error(trace);
455 }
456
457 public static String getPlatform()
458 {

Callers 15

onNewLineMethod · 0.95
runMethod · 0.95
onCreateMethod · 0.95
onReceiveMethod · 0.95
onCreateMethod · 0.95
runMethod · 0.95
trafficRedirectMethod · 0.95
undoTrafficRedirectMethod · 0.95
portRedirectMethod · 0.95
undoPortRedirectMethod · 0.95
spoofMethod · 0.95

Calls 6

getSettingsMethod · 0.95
errorMethod · 0.95
setLastErrorMethod · 0.95
isEmptyMethod · 0.80
toStringMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected