// Path: main/src/domain/xink/vpn/AppException.java
// public class AppException extends RuntimeException {
// 
//     private static final long serialVersionUID = 1L;
// 
//     private int messageCode;
// 
//     private Object[] messageArgs;
// 
//     public AppException(final String detailMessage) {
//         super(detailMessage);
//     }
// 
//     public AppException(final String message, final int msgCode, final Object... msgArgs) {
//         super(message);
//         this.messageCode = msgCode;
//         this.messageArgs = msgArgs;
//     }
// 
//     public AppException(final String message, final Throwable throwable, final int msgCode, final Object... msgArgs) {
//         super(message, throwable);
//         this.messageCode = msgCode;
//         this.messageArgs = msgArgs;
//     }
// 
//     public AppException(final String message, final Throwable cause) {
//         super(message, cause);
//     }
// 
//     public int getMessageCode() {
//         return messageCode;
//     }
// 
//     public Object[] getMessageArgs() {
//         return messageArgs;
//     }
// 
// }


import java.lang.reflect.Method;
import xink.vpn.AppException;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
    }

    public boolean delete(final String key) {
        return this.<Boolean> invokeStubMethod("delete", key);
    }

    public void unlock(final Activity ctx) {
        try {
            Intent intent = new Intent(UNLOCK_ACTION);
            ctx.startActivity(intent);
        } catch (ActivityNotFoundException e) {
            Log.e("xink", "unlock credentials failed", e);
        }
    }

    public boolean isUnlocked() {
        int err = this.<Integer> invokeStubMethod("test");
        Log.d("xink", "KeyStore.test result is: " + err);
        return err == NO_ERROR;
    }

    /**
     * Check whether the keystore is hacked by xink.
     */
    public boolean isHacked() {
        try {
            Method m = getStubClass().getDeclaredMethod("execute", int.class, byte[][].class);
            m.setAccessible(true);
            m.invoke(getStub(), 'x', new byte[0][]);
        } catch (Throwable e) {
// Path: main/src/domain/xink/vpn/AppException.java
// public class AppException extends RuntimeException {
// 
//     private static final long serialVersionUID = 1L;
// 
//     private int messageCode;
// 
//     private Object[] messageArgs;
// 
//     public AppException(final String detailMessage) {
//         super(detailMessage);
//     }
// 
//     public AppException(final String message, final int msgCode, final Object... msgArgs) {
//         super(message);
//         this.messageCode = msgCode;
//         this.messageArgs = msgArgs;
//     }
// 
//     public AppException(final String message, final Throwable throwable, final int msgCode, final Object... msgArgs) {
//         super(message, throwable);
//         this.messageCode = msgCode;
//         this.messageArgs = msgArgs;
//     }
// 
//     public AppException(final String message, final Throwable cause) {
//         super(message, cause);
//     }
// 
//     public int getMessageCode() {
//         return messageCode;
//     }
// 
//     public Object[] getMessageArgs() {
//         return messageArgs;
//     }
// 
// }


// Path: main/src/domain/xink/vpn/wrapper/KeyStore.java
import java.lang.reflect.Method;
import xink.vpn.AppException;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

    }

    public boolean delete(final String key) {
        return this.<Boolean> invokeStubMethod("delete", key);
    }

    public void unlock(final Activity ctx) {
        try {
            Intent intent = new Intent(UNLOCK_ACTION);
            ctx.startActivity(intent);
        } catch (ActivityNotFoundException e) {
            Log.e("xink", "unlock credentials failed", e);
        }
    }

    public boolean isUnlocked() {
        int err = this.<Integer> invokeStubMethod("test");
        Log.d("xink", "KeyStore.test result is: " + err);
        return err == NO_ERROR;
    }

    /**
     * Check whether the keystore is hacked by xink.
     */
    public boolean isHacked() {
        try {
            Method m = getStubClass().getDeclaredMethod("execute", int.class, byte[][].class);
            m.setAccessible(true);
            m.invoke(getStub(), 'x', new byte[0][]);
        } catch (Throwable e) {
            throw new AppException("verify failed", e);