Search in sources :

Example 1 with StackOverflowError

use of java.lang.StackOverflowError in project XPrivacy by M66B.

the class Util method bug.

public static void bug(XHook hook, Throwable ex) {
    if (ex instanceof InvocationTargetException) {
        InvocationTargetException exex = (InvocationTargetException) ex;
        if (exex.getTargetException() != null)
            ex = exex.getTargetException();
    }
    int priority;
    if (ex instanceof ActivityShare.AbortException)
        priority = Log.WARN;
    else if (ex instanceof ActivityShare.ServerException)
        priority = Log.WARN;
    else if (ex instanceof ConnectTimeoutException)
        priority = Log.WARN;
    else if (ex instanceof FileNotFoundException)
        priority = Log.WARN;
    else if (ex instanceof HttpHostConnectException)
        priority = Log.WARN;
    else if (ex instanceof NameNotFoundException)
        priority = Log.WARN;
    else if (ex instanceof NoClassDefFoundError)
        priority = Log.WARN;
    else if (ex instanceof OutOfMemoryError)
        priority = Log.WARN;
    else if (ex instanceof RuntimeException)
        priority = Log.WARN;
    else if (ex instanceof SecurityException)
        priority = Log.WARN;
    else if (ex instanceof SocketTimeoutException)
        priority = Log.WARN;
    else if (ex instanceof SSLPeerUnverifiedException)
        priority = Log.WARN;
    else if (ex instanceof StackOverflowError)
        priority = Log.WARN;
    else if (ex instanceof TransactionTooLargeException)
        priority = Log.WARN;
    else if (ex instanceof UnknownHostException)
        priority = Log.WARN;
    else if (ex instanceof UnsatisfiedLinkError)
        priority = Log.WARN;
    else
        priority = Log.ERROR;
    boolean xprivacy = false;
    for (StackTraceElement frame : ex.getStackTrace()) if (frame.getClassName() != null && frame.getClassName().startsWith("biz.bokhorst.xprivacy")) {
        xprivacy = true;
        break;
    }
    if (!xprivacy)
        priority = Log.WARN;
    log(hook, priority, ex.toString() + " uid=" + Process.myUid() + "\n" + Log.getStackTraceString(ex));
}
Also used : UnknownHostException(java.net.UnknownHostException) NameNotFoundException(android.content.pm.PackageManager.NameNotFoundException) SSLPeerUnverifiedException(javax.net.ssl.SSLPeerUnverifiedException) FileNotFoundException(java.io.FileNotFoundException) InvocationTargetException(java.lang.reflect.InvocationTargetException) SuppressLint(android.annotation.SuppressLint) RuntimeException(java.lang.RuntimeException) SocketTimeoutException(java.net.SocketTimeoutException) HttpHostConnectException(org.apache.http.conn.HttpHostConnectException) TransactionTooLargeException(android.os.TransactionTooLargeException) StackOverflowError(java.lang.StackOverflowError) ConnectTimeoutException(org.apache.http.conn.ConnectTimeoutException)

Aggregations

SuppressLint (android.annotation.SuppressLint)1 NameNotFoundException (android.content.pm.PackageManager.NameNotFoundException)1 TransactionTooLargeException (android.os.TransactionTooLargeException)1 FileNotFoundException (java.io.FileNotFoundException)1 RuntimeException (java.lang.RuntimeException)1 StackOverflowError (java.lang.StackOverflowError)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 SocketTimeoutException (java.net.SocketTimeoutException)1 UnknownHostException (java.net.UnknownHostException)1 SSLPeerUnverifiedException (javax.net.ssl.SSLPeerUnverifiedException)1 ConnectTimeoutException (org.apache.http.conn.ConnectTimeoutException)1 HttpHostConnectException (org.apache.http.conn.HttpHostConnectException)1