(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
module.exports=[
    {
        "name": "reserved0",
        "args": [],
        "ret": "void"
    },
    {
        "name": "reserved1",
        "args": [],
        "ret": "void"
    },
    {
        "name": "reserved2",
        "args": [],
        "ret": "void"
    },
    {
        "name": "DestroyJavaVM",
        "args": [
            "JavaVM*"
        ],
        "ret": "jint"
    },
    {
        "name": "AttachCurrentThread",
        "args": [
            "JavaVM*",
            "void**",
            "void*"
        ],
        "ret": "jint"
    },
    {
        "name": "DetachCurrentThread",
        "args": [
            "JavaVM*"
        ],
        "ret": "jint"
    },
    {
        "name": "GetEnv",
        "args": [
            "JavaVM*",
            "void**",
            "jint"
        ],
        "ret": "jint"
    },
    {
        "name": "AttachCurrentThreadAsDaemon",
        "args": [
            "JavaVM*",
            "void**",
            "void*"
        ],
        "ret": "jint"
    }
]

},{}],2:[function(require,module,exports){
module.exports=[
    {
        "name": "reserved0",
        "args": [],
        "ret": "void"
    },
    {
        "name": "reserved1",
        "args": [],
        "ret": "void"
    },
    {
        "name": "reserved2",
        "args": [],
        "ret": "void"
    },
    {
        "name": "reserved3",
        "args": [],
        "ret": "void"
    },
    {
        "name": "GetVersion",
        "args": [
            "JNIEnv*"
        ],
        "ret": "jint"
    },
    {
        "name": "DefineClass",
        "args": [
            "JNIEnv*",
            "char*",
            "jobject",
            "jbyte*",
            "jsize"
        ],
        "ret": "jclass"
    },
    {
        "name": "FindClass",
        "args": [
            "JNIEnv*",
            "char*"
        ],
        "ret": "jclass"
    },
    {
        "name": "FromReflectedMethod",
        "args": [
            "JNIEnv*",
            "jobject"
        ],
        "ret": "jmethodID"
    },
    {
        "name": "FromReflectedField",
        "args": [
            "JNIEnv*",
            "jobject"
        ],
        "ret": "jfieldID"
    },
    {
        "name": "ToReflectedMethod",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "jboolean"
        ],
        "ret": "jobject"
    },
    {
        "name": "GetSuperclass",
        "args": [
            "JNIEnv*",
            "jclass"
        ],
        "ret": "jclass"
    },
    {
        "name": "IsAssignableFrom",
        "args": [
            "JNIEnv*",
            "jclass",
            "jclass"
        ],
        "ret": "jboolean"
    },
    {
        "name": "ToReflectedField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID",
            "jboolean"
        ],
        "ret": "jobject"
    },
    {
        "name": "Throw",
        "args": [
            "JNIEnv*",
            "jthrowable"
        ],
        "ret": "jint"
    },
    {
        "name": "ThrowNew",
        "args": [
            "JNIEnv*",
            "jclass",
            "char*"
        ],
        "ret": "jint"
    },
    {
        "name": "ExceptionOccurred",
        "args": [
            "JNIEnv*"
        ],
        "ret": "jthrowable"
    },
    {
        "name": "ExceptionDescribe",
        "args": [
            "JNIEnv*"
        ],
        "ret": "void"
    },
    {
        "name": "ExceptionClear",
        "args": [
            "JNIEnv*"
        ],
        "ret": "void"
    },
    {
        "name": "FatalError",
        "args": [
            "JNIEnv*",
            "char*"
        ],
        "ret": "void"
    },
    {
        "name": "PushLocalFrame",
        "args": [
            "JNIEnv*",
            "jint"
        ],
        "ret": "jint"
    },
    {
        "name": "PopLocalFrame",
        "args": [
            "JNIEnv*",
            "jobject"
        ],
        "ret": "jobject"
    },
    {
        "name": "NewGlobalRef",
        "args": [
            "JNIEnv*",
            "jobject"
        ],
        "ret": "jobject"
    },
    {
        "name": "DeleteGlobalRef",
        "args": [
            "JNIEnv*",
            "jobject"
        ],
        "ret": "void"
    },
    {
        "name": "DeleteLocalRef",
        "args": [
            "JNIEnv*",
            "jobject"
        ],
        "ret": "void"
    },
    {
        "name": "IsSameObject",
        "args": [
            "JNIEnv*",
            "jobject",
            "jobject"
        ],
        "ret": "jboolean"
    },
    {
        "name": "NewLocalRef",
        "args": [
            "JNIEnv*",
            "jobject"
        ],
        "ret": "jobject"
    },
    {
        "name": "EnsureLocalCapacity",
        "args": [
            "JNIEnv*",
            "jint"
        ],
        "ret": "jint"
    },
    {
        "name": "AllocObject",
        "args": [
            "JNIEnv*",
            "jclass"
        ],
        "ret": "jobject"
    },
    {
        "name": "NewObject",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jobject"
    },
    {
        "name": "NewObjectV",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jobject"
    },
    {
        "name": "NewObjectA",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jobject"
    },
    {
        "name": "GetObjectClass",
        "args": [
            "JNIEnv*",
            "jobject"
        ],
        "ret": "jclass"
    },
    {
        "name": "IsInstanceOf",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass"
        ],
        "ret": "jboolean"
    },
    {
        "name": "GetMethodID",
        "args": [
            "JNIEnv*",
            "jclass",
            "char*",
            "char*"
        ],
        "ret": "jmethodID"
    },
    {
        "name": "CallObjectMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "..."
        ],
        "ret": "jobject"
    },
    {
        "name": "CallObjectMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "va_list"
        ],
        "ret": "jobject"
    },
    {
        "name": "CallObjectMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jobject"
    },
    {
        "name": "CallBooleanMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "..."
        ],
        "ret": "jboolean"
    },
    {
        "name": "CallBooleanMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "va_list"
        ],
        "ret": "jboolean"
    },
    {
        "name": "CallBooleanMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jboolean"
    },
    {
        "name": "CallByteMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "..."
        ],
        "ret": "jbyte"
    },
    {
        "name": "CallByteMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "va_list"
        ],
        "ret": "jbyte"
    },
    {
        "name": "CallByteMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jbyte"
    },
    {
        "name": "CallCharMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "..."
        ],
        "ret": "jchar"
    },
    {
        "name": "CallCharMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "va_list"
        ],
        "ret": "jchar"
    },
    {
        "name": "CallCharMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jchar"
    },
    {
        "name": "CallShortMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "..."
        ],
        "ret": "jshort"
    },
    {
        "name": "CallShortMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "va_list"
        ],
        "ret": "jshort"
    },
    {
        "name": "CallShortMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jshort"
    },
    {
        "name": "CallIntMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "..."
        ],
        "ret": "jint"
    },
    {
        "name": "CallIntMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "va_list"
        ],
        "ret": "jint"
    },
    {
        "name": "CallIntMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jint"
    },
    {
        "name": "CallLongMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "..."
        ],
        "ret": "jlong"
    },
    {
        "name": "CallLongMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "va_list"
        ],
        "ret": "jlong"
    },
    {
        "name": "CallLongMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jlong"
    },
    {
        "name": "CallFloatMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "..."
        ],
        "ret": "jfloat"
    },
    {
        "name": "CallFloatMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "va_list"
        ],
        "ret": "jfloat"
    },
    {
        "name": "CallFloatMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jfloat"
    },
    {
        "name": "CallDoubleMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "..."
        ],
        "ret": "jdouble"
    },
    {
        "name": "CallDoubleMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "va_list"
        ],
        "ret": "jdouble"
    },
    {
        "name": "CallDoubleMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jdouble"
    },
    {
        "name": "CallVoidMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "..."
        ],
        "ret": "void"
    },
    {
        "name": "CallVoidMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "va_list"
        ],
        "ret": "void"
    },
    {
        "name": "CallVoidMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "void"
    },
    {
        "name": "CallNonvirtualObjectMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jobject"
    },
    {
        "name": "CallNonvirtualObjectMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jobject"
    },
    {
        "name": "CallNonvirtualObjectMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jobject"
    },
    {
        "name": "CallNonvirtualBooleanMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jboolean"
    },
    {
        "name": "CallNonvirtualBooleanMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jboolean"
    },
    {
        "name": "CallNonvirtualBooleanMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jboolean"
    },
    {
        "name": "CallNonvirtualByteMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jbyte"
    },
    {
        "name": "CallNonvirtualByteMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jbyte"
    },
    {
        "name": "CallNonvirtualByteMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jbyte"
    },
    {
        "name": "CallNonvirtualCharMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jchar"
    },
    {
        "name": "CallNonvirtualCharMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jchar"
    },
    {
        "name": "CallNonvirtualCharMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jchar"
    },
    {
        "name": "CallNonvirtualShortMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jshort"
    },
    {
        "name": "CallNonvirtualShortMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jshort"
    },
    {
        "name": "CallNonvirtualShortMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jshort"
    },
    {
        "name": "CallNonvirtualIntMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jint"
    },
    {
        "name": "CallNonvirtualIntMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jint"
    },
    {
        "name": "CallNonvirtualIntMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jint"
    },
    {
        "name": "CallNonvirtualLongMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jlong"
    },
    {
        "name": "CallNonvirtualLongMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jlong"
    },
    {
        "name": "CallNonvirtualLongMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jlong"
    },
    {
        "name": "CallNonvirtualFloatMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jfloat"
    },
    {
        "name": "CallNonvirtualFloatMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jfloat"
    },
    {
        "name": "CallNonvirtualFloatMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jfloat"
    },
    {
        "name": "CallNonvirtualDoubleMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jdouble"
    },
    {
        "name": "CallNonvirtualDoubleMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jdouble"
    },
    {
        "name": "CallNonvirtualDoubleMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jdouble"
    },
    {
        "name": "CallNonvirtualVoidMethod",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "void"
    },
    {
        "name": "CallNonvirtualVoidMethodV",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "void"
    },
    {
        "name": "CallNonvirtualVoidMethodA",
        "args": [
            "JNIEnv*",
            "jobject",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "void"
    },
    {
        "name": "GetFieldID",
        "args": [
            "JNIEnv*",
            "jclass",
            "char*",
            "char*"
        ],
        "ret": "jfieldID"
    },
    {
        "name": "GetObjectField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID"
        ],
        "ret": "jobject"
    },
    {
        "name": "GetBooleanField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID"
        ],
        "ret": "jboolean"
    },
    {
        "name": "GetByteField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID"
        ],
        "ret": "jbyte"
    },
    {
        "name": "GetCharField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID"
        ],
        "ret": "jchar"
    },
    {
        "name": "GetShortField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID"
        ],
        "ret": "jshort"
    },
    {
        "name": "GetIntField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID"
        ],
        "ret": "jint"
    },
    {
        "name": "GetLongField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID"
        ],
        "ret": "jlong"
    },
    {
        "name": "GetFloatField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID"
        ],
        "ret": "jfloat"
    },
    {
        "name": "GetDoubleField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID"
        ],
        "ret": "jdouble"
    },
    {
        "name": "SetObjectField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID",
            "jobject"
        ],
        "ret": "void"
    },
    {
        "name": "SetBooleanField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID",
            "jboolean"
        ],
        "ret": "void"
    },
    {
        "name": "SetByteField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID",
            "jbyte"
        ],
        "ret": "void"
    },
    {
        "name": "SetCharField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID",
            "jchar"
        ],
        "ret": "void"
    },
    {
        "name": "SetShortField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID",
            "jshort"
        ],
        "ret": "void"
    },
    {
        "name": "SetIntField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID",
            "jint"
        ],
        "ret": "void"
    },
    {
        "name": "SetLongField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID",
            "jlong"
        ],
        "ret": "void"
    },
    {
        "name": "SetFloatField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID",
            "jfloat"
        ],
        "ret": "void"
    },
    {
        "name": "SetDoubleField",
        "args": [
            "JNIEnv*",
            "jobject",
            "jfieldID",
            "jdouble"
        ],
        "ret": "void"
    },
    {
        "name": "GetStaticMethodID",
        "args": [
            "JNIEnv*",
            "jclass",
            "char*",
            "char*"
        ],
        "ret": "jmethodID"
    },
    {
        "name": "CallStaticObjectMethod",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jobject"
    },
    {
        "name": "CallStaticObjectMethodV",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jobject"
    },
    {
        "name": "CallStaticObjectMethodA",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jobject"
    },
    {
        "name": "CallStaticBooleanMethod",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jboolean"
    },
    {
        "name": "CallStaticBooleanMethodV",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jboolean"
    },
    {
        "name": "CallStaticBooleanMethodA",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jboolean"
    },
    {
        "name": "CallStaticByteMethod",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jbyte"
    },
    {
        "name": "CallStaticByteMethodV",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jbyte"
    },
    {
        "name": "CallStaticByteMethodA",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jbyte"
    },
    {
        "name": "CallStaticCharMethod",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jchar"
    },
    {
        "name": "CallStaticCharMethodV",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jchar"
    },
    {
        "name": "CallStaticCharMethodA",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jchar"
    },
    {
        "name": "CallStaticShortMethod",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jshort"
    },
    {
        "name": "CallStaticShortMethodV",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jshort"
    },
    {
        "name": "CallStaticShortMethodA",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jshort"
    },
    {
        "name": "CallStaticIntMethod",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jint"
    },
    {
        "name": "CallStaticIntMethodV",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jint"
    },
    {
        "name": "CallStaticIntMethodA",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jint"
    },
    {
        "name": "CallStaticLongMethod",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jlong"
    },
    {
        "name": "CallStaticLongMethodV",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jlong"
    },
    {
        "name": "CallStaticLongMethodA",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jlong"
    },
    {
        "name": "CallStaticFloatMethod",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jfloat"
    },
    {
        "name": "CallStaticFloatMethodV",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jfloat"
    },
    {
        "name": "CallStaticFloatMethodA",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jfloat"
    },
    {
        "name": "CallStaticDoubleMethod",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "jdouble"
    },
    {
        "name": "CallStaticDoubleMethodV",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "jdouble"
    },
    {
        "name": "CallStaticDoubleMethodA",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "jdouble"
    },
    {
        "name": "CallStaticVoidMethod",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "..."
        ],
        "ret": "void"
    },
    {
        "name": "CallStaticVoidMethodV",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "va_list"
        ],
        "ret": "void"
    },
    {
        "name": "CallStaticVoidMethodA",
        "args": [
            "JNIEnv*",
            "jclass",
            "jmethodID",
            "jvalue*"
        ],
        "ret": "void"
    },
    {
        "name": "GetStaticFieldID",
        "args": [
            "JNIEnv*",
            "jclass",
            "char*",
            "char*"
        ],
        "ret": "jfieldID"
    },
    {
        "name": "GetStaticObjectField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID"
        ],
        "ret": "jobject"
    },
    {
        "name": "GetStaticBooleanField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID"
        ],
        "ret": "jboolean"
    },
    {
        "name": "GetStaticByteField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID"
        ],
        "ret": "jbyte"
    },
    {
        "name": "GetStaticCharField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID"
        ],
        "ret": "jchar"
    },
    {
        "name": "GetStaticShortField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID"
        ],
        "ret": "jshort"
    },
    {
        "name": "GetStaticIntField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID"
        ],
        "ret": "jint"
    },
    {
        "name": "GetStaticLongField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID"
        ],
        "ret": "jlong"
    },
    {
        "name": "GetStaticFloatField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID"
        ],
        "ret": "jfloat"
    },
    {
        "name": "GetStaticDoubleField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID"
        ],
        "ret": "jdouble"
    },
    {
        "name": "SetStaticObjectField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID",
            "jobject"
        ],
        "ret": "void"
    },
    {
        "name": "SetStaticBooleanField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID",
            "jboolean"
        ],
        "ret": "void"
    },
    {
        "name": "SetStaticByteField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID",
            "jbyte"
        ],
        "ret": "void"
    },
    {
        "name": "SetStaticCharField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID",
            "jchar"
        ],
        "ret": "void"
    },
    {
        "name": "SetStaticShortField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID",
            "jshort"
        ],
        "ret": "void"
    },
    {
        "name": "SetStaticIntField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID",
            "jint"
        ],
        "ret": "void"
    },
    {
        "name": "SetStaticLongField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID",
            "jlong"
        ],
        "ret": "void"
    },
    {
        "name": "SetStaticFloatField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID",
            "jfloat"
        ],
        "ret": "void"
    },
    {
        "name": "SetStaticDoubleField",
        "args": [
            "JNIEnv*",
            "jclass",
            "jfieldID",
            "jdouble"
        ],
        "ret": "void"
    },
    {
        "name": "NewString",
        "args": [
            "JNIEnv*",
            "jchar*",
            "jsize"
        ],
        "ret": "jstring"
    },
    {
        "name": "GetStringLength",
        "args": [
            "JNIEnv*",
            "jstring"
        ],
        "ret": "jsize"
    },
    {
        "name": "GetStringChars",
        "args": [
            "JNIEnv*",
            "jstring",
            "jboolean*"
        ],
        "ret": "jchar"
    },
    {
        "name": "ReleaseStringChars",
        "args": [
            "JNIEnv*",
            "jstring",
            "jchar*"
        ],
        "ret": "void"
    },
    {
        "name": "NewStringUTF",
        "args": [
            "JNIEnv*",
            "char*"
        ],
        "ret": "jstring"
    },
    {
        "name": "GetStringUTFLength",
        "args": [
            "JNIEnv*",
            "jstring"
        ],
        "ret": "jsize"
    },
    {
        "name": "GetStringUTFChars",
        "args": [
            "JNIEnv*",
            "jstring",
            "jboolean*"
        ],
        "ret": "char*"
    },
    {
        "name": "ReleaseStringUTFChars",
        "args": [
            "JNIEnv*",
            "jstring",
            "char*"
        ],
        "ret": "void"
    },
    {
        "name": "GetArrayLength",
        "args": [
            "JNIEnv*",
            "jarray"
        ],
        "ret": "jsize"
    },
    {
        "name": "NewObjectArray",
        "args": [
            "JNIEnv*",
            "jsize",
            "jclass",
            "jobject"
        ],
        "ret": "jobjectArray"
    },
    {
        "name": "GetObjectArrayElement",
        "args": [
            "JNIEnv*",
            "jobjectArray",
            "jsize"
        ],
        "ret": "jobject"
    },
    {
        "name": "SetObjectArrayElement",
        "args": [
            "JNIEnv*",
            "jobjectArray",
            "jsize",
            "jobject"
        ],
        "ret": "void"
    },
    {
        "name": "NewBooleanArray",
        "args": [
            "JNIEnv*",
            "jsize"
        ],
        "ret": "jbooleanArray"
    },
    {
        "name": "NewByteArray",
        "args": [
            "JNIEnv*",
            "jsize"
        ],
        "ret": "jbyteArray"
    },
    {
        "name": "NewCharArray",
        "args": [
            "JNIEnv*",
            "jsize"
        ],
        "ret": "jcharArray"
    },
    {
        "name": "NewShortArray",
        "args": [
            "JNIEnv*",
            "jsize"
        ],
        "ret": "jshortArray"
    },
    {
        "name": "NewIntArray",
        "args": [
            "JNIEnv*",
            "jsize"
        ],
        "ret": "jintArray"
    },
    {
        "name": "NewLongArray",
        "args": [
            "JNIEnv*",
            "jsize"
        ],
        "ret": "jlongArray"
    },
    {
        "name": "NewFloatArray",
        "args": [
            "JNIEnv*",
            "jsize"
        ],
        "ret": "jfloatArray"
    },
    {
        "name": "NewDoubleArray",
        "args": [
            "JNIEnv*",
            "jsize"
        ],
        "ret": "jdoubleArray"
    },
    {
        "name": "GetBooleanArrayElements",
        "args": [
            "JNIEnv*",
            "jbooleanArray",
            "jboolean*"
        ],
        "ret": "jboolean*"
    },
    {
        "name": "GetByteArrayElements",
        "args": [
            "JNIEnv*",
            "jbyteArray",
            "jboolean*"
        ],
        "ret": "jbyte*"
    },
    {
        "name": "GetCharArrayElements",
        "args": [
            "JNIEnv*",
            "jcharArray",
            "jboolean*"
        ],
        "ret": "jchar*"
    },
    {
        "name": "GetShortArrayElements",
        "args": [
            "JNIEnv*",
            "jshortArray",
            "jboolean*"
        ],
        "ret": "jshort*"
    },
    {
        "name": "GetIntArrayElements",
        "args": [
            "JNIEnv*",
            "jintArray",
            "jboolean*"
        ],
        "ret": "jint*"
    },
    {
        "name": "GetLongArrayElements",
        "args": [
            "JNIEnv*",
            "jlongArray",
            "jboolean*"
        ],
        "ret": "jlong*"
    },
    {
        "name": "GetFloatArrayElements",
        "args": [
            "JNIEnv*",
            "jfloatArray",
            "jboolean*"
        ],
        "ret": "jfloat*"
    },
    {
        "name": "GetDoubleArrayElements",
        "args": [
            "JNIEnv*",
            "jdoubleArray",
            "jboolean*"
        ],
        "ret": "jdouble*"
    },
    {
        "name": "ReleaseBooleanArrayElements",
        "args": [
            "JNIEnv*",
            "jbooleanArray",
            "jboolean*",
            "jint"
        ],
        "ret": "void"
    },
    {
        "name": "ReleaseByteArrayElements",
        "args": [
            "JNIEnv*",
            "jbyteArray",
            "jbyte*",
            "jint"
        ],
        "ret": "void"
    },
    {
        "name": "ReleaseCharArrayElements",
        "args": [
            "JNIEnv*",
            "jcharArray",
            "jchar*",
            "jint"
        ],
        "ret": "void"
    },
    {
        "name": "ReleaseShortArrayElements",
        "args": [
            "JNIEnv*",
            "jshortArray",
            "jshort*",
            "jint"
        ],
        "ret": "void"
    },
    {
        "name": "ReleaseIntArrayElements",
        "args": [
            "JNIEnv*",
            "jintArray",
            "jint*",
            "jint"
        ],
        "ret": "void"
    },
    {
        "name": "ReleaseLongArrayElements",
        "args": [
            "JNIEnv*",
            "jlongArray",
            "jlong*",
            "jint"
        ],
        "ret": "void"
    },
    {
        "name": "ReleaseFloatArrayElements",
        "args": [
            "JNIEnv*",
            "jfloatArray",
            "jfloat*",
            "jint"
        ],
        "ret": "void"
    },
    {
        "name": "ReleaseDoubleArrayElements",
        "args": [
            "JNIEnv*",
            "jdoubleArray",
            "jdouble*",
            "jint"
        ],
        "ret": "void"
    },
    {
        "name": "GetBooleanArrayRegion",
        "args": [
            "JNIEnv*",
            "jbooleanArray",
            "jsize",
            "jsize",
            "jboolean*"
        ],
        "ret": "void"
    },
    {
        "name": "GetByteArrayRegion",
        "args": [
            "JNIEnv*",
            "jbyteArray",
            "jsize",
            "jsize",
            "jbyte*"
        ],
        "ret": "void"
    },
    {
        "name": "GetCharArrayRegion",
        "args": [
            "JNIEnv*",
            "jcharArray",
            "jsize",
            "jsize",
            "jchar*"
        ],
        "ret": "void"
    },
    {
        "name": "GetShortArrayRegion",
        "args": [
            "JNIEnv*",
            "jshortArray",
            "jsize",
            "jsize",
            "jshort*"
        ],
        "ret": "void"
    },
    {
        "name": "GetIntArrayRegion",
        "args": [
            "JNIEnv*",
            "jintArray",
            "jsize",
            "jsize",
            "jint*"
        ],
        "ret": "void"
    },
    {
        "name": "GetLongArrayRegion",
        "args": [
            "JNIEnv*",
            "jlongArray",
            "jsize",
            "jsize",
            "jlong*"
        ],
        "ret": "void"
    },
    {
        "name": "GetFloatArrayRegion",
        "args": [
            "JNIEnv*",
            "jfloatArray",
            "jsize",
            "jsize",
            "jfloat*"
        ],
        "ret": "void"
    },
    {
        "name": "GetDoubleArrayRegion",
        "args": [
            "JNIEnv*",
            "jdoubleArray",
            "jsize",
            "jsize",
            "jdouble*"
        ],
        "ret": "void"
    },
    {
        "name": "SetBooleanArrayRegion",
        "args": [
            "JNIEnv*",
            "jbooleanArray",
            "jsize",
            "jsize",
            "jboolean*"
        ],
        "ret": "void"
    },
    {
        "name": "SetByteArrayRegion",
        "args": [
            "JNIEnv*",
            "jbyteArray",
            "jsize",
            "jsize",
            "jbyte*"
        ],
        "ret": "void"
    },
    {
        "name": "SetCharArrayRegion",
        "args": [
            "JNIEnv*",
            "jcharArray",
            "jsize",
            "jsize",
            "jchar*"
        ],
        "ret": "void"
    },
    {
        "name": "SetShortArrayRegion",
        "args": [
            "JNIEnv*",
            "jshortArray",
            "jsize",
            "jsize",
            "jshort*"
        ],
        "ret": "void"
    },
    {
        "name": "SetIntArrayRegion",
        "args": [
            "JNIEnv*",
            "jintArray",
            "jsize",
            "jsize",
            "jint*"
        ],
        "ret": "void"
    },
    {
        "name": "SetLongArrayRegion",
        "args": [
            "JNIEnv*",
            "jlongArray",
            "jsize",
            "jsize",
            "jlong*"
        ],
        "ret": "void"
    },
    {
        "name": "SetFloatArrayRegion",
        "args": [
            "JNIEnv*",
            "jfloatArray",
            "jsize",
            "jsize",
            "jfloat*"
        ],
        "ret": "void"
    },
    {
        "name": "SetDoubleArrayRegion",
        "args": [
            "JNIEnv*",
            "jdoubleArray",
            "jsize",
            "jsize",
            "jdouble*"
        ],
        "ret": "void"
    },
    {
        "name": "RegisterNatives",
        "args": [
            "JNIEnv*",
            "jclass",
            "JNINativeMethod*",
            "jint"
        ],
        "ret": "jint"
    },
    {
        "name": "UnregisterNatives",
        "args": [
            "JNIEnv*",
            "jclass"
        ],
        "ret": "jint"
    },
    {
        "name": "MonitorEnter",
        "args": [
            "JNIEnv*",
            "jobject"
        ],
        "ret": "jint"
    },
    {
        "name": "MonitorExit",
        "args": [
            "JNIEnv*",
            "jobject"
        ],
        "ret": "jint"
    },
    {
        "name": "GetJavaVM",
        "args": [
            "JNIEnv*",
            "JavaVM**"
        ],
        "ret": "jint"
    },
    {
        "name": "GetStringRegion",
        "args": [
            "JNIEnv*",
            "jstring",
            "jsize",
            "jsize",
            "jchar*"
        ],
        "ret": "void"
    },
    {
        "name": "GetStringUTFRegion",
        "args": [
            "JNIEnv*",
            "jstring",
            "jsize",
            "jsize",
            "char*"
        ],
        "ret": "void"
    },
    {
        "name": "GetPrimitiveArrayCritical",
        "args": [
            "JNIEnv*",
            "jarray",
            "jboolean*"
        ],
        "ret": "void"
    },
    {
        "name": "ReleasePrimitiveArrayCritical",
        "args": [
            "JNIEnv*",
            "jarray",
            "void*",
            "jint"
        ],
        "ret": "void"
    },
    {
        "name": "GetStringCritical",
        "args": [
            "JNIEnv*",
            "jstring",
            "jboolean*"
        ],
        "ret": "jchar"
    },
    {
        "name": "ReleaseStringCritical",
        "args": [
            "JNIEnv*",
            "jstring",
            "jchar*"
        ],
        "ret": "void"
    },
    {
        "name": "NewWeakGlobalRef",
        "args": [
            "JNIEnv*",
            "jobject"
        ],
        "ret": "jweak"
    },
    {
        "name": "DeleteWeakGlobalRef",
        "args": [
            "JNIEnv*",
            "jweak"
        ],
        "ret": "void"
    },
    {
        "name": "ExceptionCheck",
        "args": [
            "JNIEnv*"
        ],
        "ret": "jboolean"
    },
    {
        "name": "NewDirectByteBuffer",
        "args": [
            "JNIEnv*",
            "void*",
            "jlong"
        ],
        "ret": "jobject"
    },
    {
        "name": "GetDirectBufferAddress",
        "args": [
            "JNIEnv*",
            "jobject"
        ],
        "ret": "void"
    },
    {
        "name": "GetDirectBufferCapacity",
        "args": [
            "JNIEnv*",
            "jobject"
        ],
        "ret": "jlong"
    },
    {
        "name": "GetObjectRefType",
        "args": [
            "JNIEnv*",
            "jobject"
        ],
        "ret": "jobjectRefType"
    }
]

},{}],3:[function(require,module,exports){
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));

var _defineProperty = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));

(0, _defineProperty["default"])(exports, "__esModule", {
  value: true
});

var jni_env_interceptor_1 = require("../jni_env_interceptor");

var types_1 = require("../../utils/types");

var JNIEnvInterceptorARM =
/*#__PURE__*/
function (_jni_env_interceptor_) {
  (0, _inherits2["default"])(JNIEnvInterceptorARM, _jni_env_interceptor_);

  function JNIEnvInterceptorARM(references, threads, transport) {
    var _this;

    (0, _classCallCheck2["default"])(this, JNIEnvInterceptorARM);
    _this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(JNIEnvInterceptorARM).call(this, references, threads, transport));
    _this.vaList = NULL;
    _this.vaListOffset = 0;
    return _this;
  }

  (0, _createClass2["default"])(JNIEnvInterceptorARM, [{
    key: "createStubFunction",
    value: function createStubFunction() {
      var stub = Memory.alloc(Process.pageSize);
      Memory.patchCode(stub, Process.pageSize, function (code) {
        var cw = new ArmWriter(code, {
          pc: stub
        }); // push { lr }

        var PUSH_LR = 0xe52de004;
        cw.putInstruction(PUSH_LR); // pop { pc }

        var POP_PC = 0xe49df004;
        cw.putInstruction(POP_PC);
      });
      return stub;
    }
  }, {
    key: "buildVaArgParserShellcode",
    value: function buildVaArgParserShellcode(text, data, parser) {
      var DATA_OFFSET = 0x400;
      text.add(DATA_OFFSET).writePointer(parser);
      Memory.patchCode(text, Process.pageSize, function (code) {
        var cw = new ArmWriter(code, {
          pc: text
        }); // nops for the context interceptor to overwrite

        cw.putNop();
        cw.putNop();
        cw.putNop();
        cw.putNop(); // str r0, [pc, #0x400]

        var STR_R0_400 = 0xe58f0400;
        cw.putInstruction(STR_R0_400); // str r1, [pc, #0x400]

        var STR_R1_400 = 0xe58f1400;
        cw.putInstruction(STR_R1_400); // str r2, [pc, #0x400]

        var STR_R2_400 = 0xe58f2400;
        cw.putInstruction(STR_R2_400); // str r3, [pc, #0x400]

        var STR_R3_400 = 0xe58f3400;
        cw.putInstruction(STR_R3_400); // str lr, [pc, #0x400]

        var STR_LR_400 = 0xe58fe400;
        cw.putInstruction(STR_LR_400); // ldr r0, [pc, #0x3e4]

        var LDR_R0_3E4 = 0xe59f03d4;
        cw.putInstruction(LDR_R0_3E4); // blx r0

        var BLX_R0 = 0xe12fff30;
        cw.putInstruction(BLX_R0); // ldr r1, [pc, 0x3e0]

        var LDR_R1_3E0 = 0xe59f13e8;
        cw.putInstruction(LDR_R1_3E0); // ldr r2, [pc, 0x3e0]

        var LDR_R2_3E0 = 0xe59f23e8;
        cw.putInstruction(LDR_R2_3E0); // ldr r3, [pc, 0x3e0]

        var LDR_R3_3E0 = 0xe59f33e8;
        cw.putInstruction(LDR_R3_3E0); //blx r0

        cw.putInstruction(BLX_R0); // ldr r1, [pc, #0x3e4]

        var LDR_R1_3E4 = 0xe59f13e4;
        cw.putInstruction(LDR_R1_3E4); // bx r1

        var BX_R1 = 0xe12fff11;
        cw.putInstruction(BX_R1);
        cw.flush();
      });
    }
  }, {
    key: "setUpVaListArgExtract",
    value: function setUpVaListArgExtract(vaList) {
      this.vaList = vaList;
      this.vaListOffset = 0;
    }
  }, {
    key: "extractVaListArgValue",
    value: function extractVaListArgValue(method, paramId) {
      var currentPtr = this.vaList.add(this.vaListOffset);
      this.vaListOffset += types_1.Types.sizeOf(method.fridaParams[paramId]);
      return currentPtr;
    }
  }, {
    key: "resetVaListArgExtract",
    value: function resetVaListArgExtract() {
      this.vaList = NULL;
      this.vaListOffset = 0;
    }
  }]);
  return JNIEnvInterceptorARM;
}(jni_env_interceptor_1.JNIEnvInterceptor);

exports.JNIEnvInterceptorARM = JNIEnvInterceptorARM;

},{"../../utils/types":17,"../jni_env_interceptor":7,"@babel/runtime-corejs2/core-js/object/define-property":20,"@babel/runtime-corejs2/helpers/classCallCheck":26,"@babel/runtime-corejs2/helpers/createClass":27,"@babel/runtime-corejs2/helpers/getPrototypeOf":28,"@babel/runtime-corejs2/helpers/inherits":29,"@babel/runtime-corejs2/helpers/interopRequireDefault":30,"@babel/runtime-corejs2/helpers/possibleConstructorReturn":31}],4:[function(require,module,exports){
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));

var _defineProperty = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));

(0, _defineProperty["default"])(exports, "__esModule", {
  value: true
});

var jni_env_interceptor_1 = require("../jni_env_interceptor");

var JNIEnvInterceptorARM64 =
/*#__PURE__*/
function (_jni_env_interceptor_) {
  (0, _inherits2["default"])(JNIEnvInterceptorARM64, _jni_env_interceptor_);

  function JNIEnvInterceptorARM64(references, threads, transport) {
    var _this;

    (0, _classCallCheck2["default"])(this, JNIEnvInterceptorARM64);
    _this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(JNIEnvInterceptorARM64).call(this, references, threads, transport));
    _this.stack = NULL;
    _this.stackIndex = 0;
    _this.grTop = NULL;
    _this.vrTop = NULL;
    _this.grOffs = 0;
    _this.grOffsIndex = 0;
    _this.vrOffs = 0;
    _this.vrOffsIndex = 0;
    return _this;
  }

  (0, _createClass2["default"])(JNIEnvInterceptorARM64, [{
    key: "createStubFunction",
    value: function createStubFunction() {
      var stub = Memory.alloc(Process.pageSize);
      Memory.patchCode(stub, Process.pageSize, function (code) {
        var cw = new Arm64Writer(code, {
          pc: stub
        }); // ret

        var RET = 0xd65f03c0;
        cw.putInstruction(RET);
      });
      return stub;
    }
  }, {
    key: "buildVaArgParserShellcode",
    value: function buildVaArgParserShellcode(text, data, parser) {
      var DATA_OFFSET = 0x400;
      var BITS_IN_BYTE = 8;
      var HALF = 2;
      var NUM_REGS = 31;
      var NUM_REG_NO_LR = 30;
      text.add(DATA_OFFSET).writePointer(parser);
      Memory.patchCode(text, Process.pageSize, function (code) {
        var cw = new Arm64Writer(code, {
          pc: text
        }); // adrp x0, #0

        var ADRP_X0_0 = 0x90000000;
        cw.putInstruction(ADRP_X0_0); // back up all registers - just to be safe

        for (var i = 1; i < NUM_REGS; i++) {
          var ins = 0xF9000000; // src reg

          ins += i;
          var base = 0x408;
          var offset = base + i * Process.pointerSize; // dst address

          ins += offset / HALF << BITS_IN_BYTE; // str x<n>, [x0, #<offset>]

          cw.putInstruction(ins);
        } // ldr x0, [x0, #0x400]


        var LDR_X0_X0_400 = 0xF9420000;
        cw.putInstruction(LDR_X0_X0_400); // blr x0

        var BLR_X0 = 0xD63F0000;
        cw.putInstruction(BLR_X0);
        cw.putPushRegReg("x0", "sp"); // adrp x0, #0

        cw.putInstruction(ADRP_X0_0); // restore all registers - apart from lr and sp

        for (var _i = 1; _i < NUM_REG_NO_LR; _i++) {
          var _ins = 0xF9400000; // src reg

          _ins += _i;
          var _base = 0x408;

          var _offset = _base + _i * Process.pointerSize; // dst address


          _ins += _offset / HALF << BITS_IN_BYTE; // ldr x<n>, [x0, #<offset>]

          cw.putInstruction(_ins);
        }

        cw.putPopRegReg("x0", "sp"); // blr x0

        cw.putInstruction(BLR_X0); // adrp x1, #0

        var ADRP_X1_0 = 0x90000001;
        cw.putInstruction(ADRP_X1_0); // ldr x2, [x1, #0x4f8]

        var LDR_X2_X1_4F8 = 0xF9427C22;
        cw.putInstruction(LDR_X2_X1_4F8); // br x2

        var BR_X2 = 0xD61F0040;
        cw.putInstruction(BR_X2);
        cw.flush();
      });
    }
  }, {
    key: "setUpVaListArgExtract",
    value: function setUpVaListArgExtract(vaList) {
      var vrStart = 2;
      var grOffset = 3;
      var vrOffset = 4;
      this.stack = vaList.readPointer();
      this.stackIndex = 0;
      this.grTop = vaList.add(Process.pointerSize).readPointer();
      this.vrTop = vaList.add(Process.pointerSize * vrStart).readPointer();
      this.grOffs = vaList.add(Process.pointerSize * grOffset).readS32();
      this.grOffsIndex = 0;
      this.vrOffs = vaList.add(Process.pointerSize * grOffset + vrOffset).readS32();
      this.vrOffsIndex = 0;
    }
  }, {
    key: "extractVaListArgValue",
    value: function extractVaListArgValue(method, paramId) {
      var MAX_VR_REG_NUM = 8;
      var VR_REG_SIZE = 2;
      var MAX_GR_REG_NUM = 4;
      var currentPtr = NULL;

      if (method.fridaParams[paramId] === "float" || method.fridaParams[paramId] === "double") {
        if (this.vrOffsIndex < MAX_VR_REG_NUM) {
          currentPtr = this.vrTop.add(this.vrOffs).add(this.vrOffsIndex * Process.pointerSize * VR_REG_SIZE);
          this.vrOffsIndex++;
        } else {
          currentPtr = this.stack.add(this.stackIndex * Process.pointerSize);
          this.stackIndex++;
        }
      } else {
        if (this.grOffsIndex < MAX_GR_REG_NUM) {
          currentPtr = this.grTop.add(this.grOffs).add(this.grOffsIndex * Process.pointerSize);
          this.grOffsIndex++;
        } else {
          currentPtr = this.stack.add(this.stackIndex * Process.pointerSize);
          this.stackIndex++;
        }
      }

      return currentPtr;
    }
  }, {
    key: "resetVaListArgExtract",
    value: function resetVaListArgExtract() {
      this.stack = NULL;
      this.stackIndex = 0;
      this.grTop = NULL;
      this.vrTop = NULL;
      this.grOffs = 0;
      this.grOffsIndex = 0;
      this.vrOffs = 0;
      this.vrOffsIndex = 0;
    }
  }]);
  return JNIEnvInterceptorARM64;
}(jni_env_interceptor_1.JNIEnvInterceptor);

exports.JNIEnvInterceptorARM64 = JNIEnvInterceptorARM64;
;

},{"../jni_env_interceptor":7,"@babel/runtime-corejs2/core-js/object/define-property":20,"@babel/runtime-corejs2/helpers/classCallCheck":26,"@babel/runtime-corejs2/helpers/createClass":27,"@babel/runtime-corejs2/helpers/getPrototypeOf":28,"@babel/runtime-corejs2/helpers/inherits":29,"@babel/runtime-corejs2/helpers/interopRequireDefault":30,"@babel/runtime-corejs2/helpers/possibleConstructorReturn":31}],5:[function(require,module,exports){
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));

var _defineProperty = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));

var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
  return mod && mod.__esModule ? mod : {
    "default": mod
  };
};

(0, _defineProperty["default"])(exports, "__esModule", {
  value: true
});

var java_vm_json_1 = __importDefault(require("../data/java_vm.json"));

var JavaVM =
/*#__PURE__*/
function () {
  function JavaVM() {
    (0, _classCallCheck2["default"])(this, JavaVM);
    this._methods = java_vm_json_1["default"];
  }

  (0, _createClass2["default"])(JavaVM, [{
    key: "methods",
    get: function get() {
      return this._methods;
    }
  }], [{
    key: "getInstance",
    value: function getInstance() {
      if (JavaVM.instance === undefined) {
        JavaVM.instance = new JavaVM();
      }

      return JavaVM.instance;
    }
  }]);
  return JavaVM;
}();

exports.JavaVM = JavaVM;

},{"../data/java_vm.json":1,"@babel/runtime-corejs2/core-js/object/define-property":20,"@babel/runtime-corejs2/helpers/classCallCheck":26,"@babel/runtime-corejs2/helpers/createClass":27,"@babel/runtime-corejs2/helpers/interopRequireDefault":30}],6:[function(require,module,exports){
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));

var _defineProperty = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));

(0, _defineProperty["default"])(exports, "__esModule", {
  value: true
});

var java_vm_1 = require("./java_vm");

var types_1 = require("../utils/types");

var method_data_1 = require("../utils/method_data");

var JAVA_VM_INDEX = 0;
var COPY_ARRAY_INDEX = 0;
var JNI_OK = 0;
var JNI_ENV_INDEX = 1;

var JavaVMInterceptor =
/*#__PURE__*/
function () {
  function JavaVMInterceptor(references, threads, transport, jniEnvInterceptor) {
    (0, _classCallCheck2["default"])(this, JavaVMInterceptor);
    this.references = references;
    this.threads = threads;
    this.transport = transport;
    this.jniEnvInterceptor = jniEnvInterceptor;
    this.shadowJavaVM = NULL;
  }

  (0, _createClass2["default"])(JavaVMInterceptor, [{
    key: "isInitialised",
    value: function isInitialised() {
      return !this.shadowJavaVM.isNull();
    }
  }, {
    key: "get",
    value: function get() {
      return this.shadowJavaVM;
    }
  }, {
    key: "create",
    value: function create() {
      var javaVMOffset = 3;
      var javaVMLength = 8;
      var javaVM = this.threads.getJavaVM();
      var newJavaVMStruct = Memory.alloc(Process.pointerSize * javaVMLength);
      this.references.add(newJavaVMStruct);
      var newJavaVM = Memory.alloc(Process.pointerSize);
      newJavaVM.writePointer(newJavaVMStruct);

      for (var i = javaVMOffset; i < javaVMLength; i++) {
        var offset = i * Process.pointerSize;
        var javaVMStruct = javaVM.readPointer();
        var methodAddr = javaVMStruct.add(offset).readPointer();
        var callback = this.createJavaVMIntercept(i, methodAddr);
        var trampoline = this.jniEnvInterceptor.createStubFunction();
        this.references.add(trampoline); // ensure the CpuContext will be populated

        Interceptor.replace(trampoline, callback);
        newJavaVMStruct.add(offset).writePointer(trampoline);
      }

      this.shadowJavaVM = newJavaVM;
      return newJavaVM;
    }
  }, {
    key: "createJavaVMIntercept",
    value: function createJavaVMIntercept(id, methodAddr) {
      var self = this;
      var method = java_vm_1.JavaVM.getInstance().methods[id];
      var fridaArgs = method.args.map(function (a) {
        return types_1.Types.convertNativeJTypeToFridaType(a);
      });
      var fridaRet = types_1.Types.convertNativeJTypeToFridaType(method.ret);
      var nativeFunction = new NativeFunction(methodAddr, fridaRet, fridaArgs);
      var nativeCallback = new NativeCallback(function () {
        var threadId = this.threadId;
        var javaVM = self.threads.getJavaVM();
        var localArgs = [].slice.call(arguments);
        var jniEnv = NULL;
        localArgs[JAVA_VM_INDEX] = javaVM;
        var clonedArgs = localArgs.slice(COPY_ARRAY_INDEX);
        var ret = nativeFunction.apply(null, localArgs);
        var data = new method_data_1.MethodData(method, clonedArgs, ret);
        self.transport.reportJavaVMCall(data, this.context);

        if (method.name === "GetEnv" || method.name === "AttachCurrentThread" || method.name === "AttachCurrentThreadAsDaemon") {
          if (ret === JNI_OK) {
            self.threads.setJNIEnv(threadId, localArgs[JNI_ENV_INDEX].readPointer());
          }

          if (!self.jniEnvInterceptor.isInitialised()) {
            jniEnv = self.jniEnvInterceptor.create();
          } else {
            jniEnv = self.jniEnvInterceptor.get();
          }

          localArgs[JNI_ENV_INDEX].writePointer(jniEnv);
        }

        return ret;
      }, fridaRet, fridaArgs);
      this.references.add(nativeCallback);
      return nativeCallback;
    }
  }]);
  return JavaVMInterceptor;
}();

exports.JavaVMInterceptor = JavaVMInterceptor;
;

},{"../utils/method_data":15,"../utils/types":17,"./java_vm":5,"@babel/runtime-corejs2/core-js/object/define-property":20,"@babel/runtime-corejs2/helpers/classCallCheck":26,"@babel/runtime-corejs2/helpers/createClass":27,"@babel/runtime-corejs2/helpers/interopRequireDefault":30}],7:[function(require,module,exports){
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));

var _defineProperty = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));

var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
  return mod && mod.__esModule ? mod : {
    "default": mod
  };
};

(0, _defineProperty["default"])(exports, "__esModule", {
  value: true
});

var types_1 = require("../utils/types");

var java_method_1 = require("../utils/java_method");

var method_data_1 = require("../utils/method_data");

var config_1 = require("../utils/config");

var jni_env_json_1 = __importDefault(require("../data/jni_env.json"));

var TYPE_NAME_START = 0;
var TYPE_NAME_END = -1;
var COPY_ARRAY_INDEX = 0;
var JNI_ENV_INDEX = 0;

var JNIEnvInterceptor =
/*#__PURE__*/
function () {
  function JNIEnvInterceptor(references, threads, transport) {
    (0, _classCallCheck2["default"])(this, JNIEnvInterceptor);
    this.shadowJNIEnv = NULL;
    this.methods = {};
    this.fastMethodLookup = {};
    this.vaArgsBacktraces = {};
    this.references = references;
    this.threads = threads;
    this.transport = transport;
    this.javaVMInterceptor = null;
    this.vaArgsBacktraces = {};
  }

  (0, _createClass2["default"])(JNIEnvInterceptor, [{
    key: "isInitialised",
    value: function isInitialised() {
      return !this.shadowJNIEnv.equals(NULL);
    }
  }, {
    key: "get",
    value: function get() {
      return this.shadowJNIEnv;
    }
  }, {
    key: "create",
    value: function create() {
      var END_INDEX = 1;
      var threadId = Process.getCurrentThreadId();
      var jniEnv = this.threads.getJNIEnv(threadId);
      var jniEnvOffset = 4;
      var jniEnvLength = 232;
      var newJNIEnvStruct = Memory.alloc(Process.pointerSize * jniEnvLength);
      this.references.add(newJNIEnvStruct);
      var newJNIEnv = Memory.alloc(Process.pointerSize);
      newJNIEnv.writePointer(newJNIEnvStruct);
      this.references.add(newJNIEnv);

      for (var i = jniEnvOffset; i < jniEnvLength; i++) {
        var method = jni_env_json_1["default"][i];
        var offset = i * Process.pointerSize;
        var jniEnvStruct = jniEnv.readPointer();
        var methodAddr = jniEnvStruct.add(offset).readPointer();

        if (method.args[method.args.length - END_INDEX] === "...") {
          var callback = this.createJNIVarArgIntercept(i, methodAddr);
          var trampoline = this.createStubFunction();
          this.references.add(trampoline); // ensure the CpuContext will be populated

          Interceptor.replace(trampoline, callback);
          newJNIEnvStruct.add(offset).writePointer(trampoline);
        } else {
          var _callback = this.createJNIIntercept(i, methodAddr);

          var _trampoline = this.createStubFunction();

          this.references.add(_trampoline); // ensure the CpuContext will be populated

          Interceptor.replace(_trampoline, _callback);
          newJNIEnvStruct.add(offset).writePointer(_trampoline);
        }
      }

      this.shadowJNIEnv = newJNIEnv;
      return newJNIEnv;
    }
  }, {
    key: "setJavaVMInterceptor",
    value: function setJavaVMInterceptor(javaVMInterceptor) {
      this.javaVMInterceptor = javaVMInterceptor;
    }
  }, {
    key: "createStubFunction",
    value: function createStubFunction() {
      return new NativeCallback(function () {}, 'void', []);
    }
  }, {
    key: "createJNIVarArgIntercept",
    value: function createJNIVarArgIntercept(id, methodPtr) {
      var self = this;
      var method = jni_env_json_1["default"][id];
      var text = Memory.alloc(Process.pageSize);
      var data = Memory.alloc(Process.pageSize);
      this.references.add(text);
      this.references.add(data);
      var vaArgsCallback = this.createJNIVarArgInitialCallback(method, methodPtr);
      this.references.add(vaArgsCallback);
      self.buildVaArgParserShellcode(text, data, vaArgsCallback);
      var config = config_1.Config.getInstance();
      Interceptor.attach(text, function () {
        var backtraceType = Backtracer.ACCURATE;

        if (config.backtrace === "fuzzy") {
          backtraceType = config.backtrace;
        }

        self.vaArgsBacktraces[this.threadId] = Thread.backtrace(this.context, backtraceType);
      });
      return text;
    }
  }, {
    key: "addJavaArgsForJNIIntercept",
    value: function addJavaArgsForJNIIntercept(method, args) {
      var LAST_INDEX = -1;
      var FIRST_INDEX = 0;
      var METHOD_ID_INDEX = 2;
      var lastParamType = method.args.slice(LAST_INDEX)[FIRST_INDEX];

      if (!["va_list", "jvalue*"].includes(lastParamType)) {
        return args.slice(COPY_ARRAY_INDEX);
      }

      var clonedArgs = args.slice(COPY_ARRAY_INDEX);
      var midPtr = args[METHOD_ID_INDEX];
      var javaMethod = this.methods[midPtr.toString()];
      var nativeJTypes = javaMethod.nativeParams;
      var readPtr = args.slice(LAST_INDEX)[FIRST_INDEX];

      if (lastParamType === "va_list") {
        this.setUpVaListArgExtract(readPtr);
      }

      var UNION_SIZE = 8;

      for (var i = 0; i < nativeJTypes.length; i++) {
        var type = types_1.Types.convertNativeJTypeToFridaType(nativeJTypes[i]);
        var val = void 0;

        if (lastParamType === "va_list") {
          var currentPtr = this.extractVaListArgValue(javaMethod, i);
          val = this.readValue(currentPtr, type, true);
        } else {
          val = this.readValue(readPtr.add(UNION_SIZE * i), type);
        }

        clonedArgs.push(val);
      }

      if (lastParamType === "va_list") {
        this.resetVaListArgExtract();
      }

      return clonedArgs;
    }
  }, {
    key: "handleGetMethodResult",
    value: function handleGetMethodResult(args, ret) {
      var SIG_INDEX = 3;
      var signature = args[SIG_INDEX].readCString();

      if (signature !== null) {
        var methodSig = new java_method_1.JavaMethod(signature);
        this.methods[ret.toString()] = methodSig;
      }
    }
  }, {
    key: "handleGetJavaVM",
    value: function handleGetJavaVM(args, ret) {
      if (this.javaVMInterceptor !== null) {
        var JNI_OK = 0;
        var JAVA_VM_INDEX = 1;

        if (ret === JNI_OK) {
          var javaVMPtr = args[JAVA_VM_INDEX];
          this.threads.setJavaVM(javaVMPtr.readPointer());
          var javaVM;

          if (!this.javaVMInterceptor.isInitialised()) {
            javaVM = this.javaVMInterceptor.create();
          } else {
            javaVM = this.javaVMInterceptor.get();
          }

          javaVMPtr.writePointer(javaVM);
        }
      }
    }
  }, {
    key: "handleRegisterNatives",
    value: function handleRegisterNatives(args) {
      var METHOD_INDEX = 2;
      var SIZE_INDEX = 3;
      var JNI_METHOD_SIZE = 3;
      var self = this;
      var methods = args[METHOD_INDEX];
      var size = args[SIZE_INDEX];

      var _loop = function _loop(i) {
        var methodsPtr = methods;
        var namePtr = methodsPtr.add(i * Process.pointerSize).readPointer();
        var name = namePtr.readCString();
        var sigOffset = 1;
        var sigPtr = methodsPtr.add((i + sigOffset) * Process.pointerSize).readPointer();
        var sig = sigPtr.readCString();
        var addrOffset = 2;
        var addr = methodsPtr.add((i + addrOffset) * Process.pointerSize).readPointer();

        if (name === null || sig === null) {
          return "continue";
        }

        Interceptor.attach(addr, {
          onEnter: function onEnter(args) {
            var check = name + sig;
            var config = config_1.Config.getInstance();
            var EMPTY_ARRAY_LEN = 0;

            if (config.includeExport.length > EMPTY_ARRAY_LEN) {
              var included = config.includeExport.filter(function (i) {
                return check.includes(i);
              });

              if (included.length === EMPTY_ARRAY_LEN) {
                return;
              }
            }

            if (config.excludeExport.length > EMPTY_ARRAY_LEN) {
              var excluded = config.excludeExport.filter(function (e) {
                return check.includes(e);
              });

              if (excluded.length > EMPTY_ARRAY_LEN) {
                return;
              }
            }

            if (!self.threads.hasJNIEnv(this.threadId)) {
              self.threads.setJNIEnv(this.threadId, args[JNI_ENV_INDEX]);
            }

            args[JNI_ENV_INDEX] = self.shadowJNIEnv;
          }
        });
      };

      for (var i = 0; i < size * JNI_METHOD_SIZE; i += JNI_METHOD_SIZE) {
        var _ret = _loop(i);

        if (_ret === "continue") continue;
      }
    }
  }, {
    key: "handleJNIInterceptResult",
    value: function handleJNIInterceptResult(method, args, ret) {
      var name = method.name;

      if (["GetMethodID", "GetStaticMethodID"].includes(name)) {
        this.handleGetMethodResult(args, ret);
      } else if (method.name === "GetJavaVM") {
        this.handleGetJavaVM(args, ret);
      } else if (method.name === "RegisterNatives") {
        this.handleRegisterNatives(args);
      }
    }
  }, {
    key: "createJNIIntercept",
    value: function createJNIIntercept(id, methodPtr) {
      var self = this;
      var METHOD_ID_INDEX = 2;
      var method = jni_env_json_1["default"][id];
      var paramTypes = method.args.map(function (t) {
        return types_1.Types.convertNativeJTypeToFridaType(t);
      });
      var retType = types_1.Types.convertNativeJTypeToFridaType(method.ret);
      var nativeFunction = new NativeFunction(methodPtr, retType, paramTypes);
      var nativeCallback = new NativeCallback(function () {
        var threadId = this.threadId;
        var jniEnv = self.threads.getJNIEnv(threadId);
        var args = [].slice.call(arguments);
        args[JNI_ENV_INDEX] = jniEnv;
        var clonedArgs = self.addJavaArgsForJNIIntercept(method, args);
        var ret = nativeFunction.apply(null, args);
        var jmethod = undefined;

        if (args.length !== clonedArgs.length) {
          var key = args[METHOD_ID_INDEX].toString();
          jmethod = self.methods[key];
        }

        var data = new method_data_1.MethodData(method, clonedArgs, ret, jmethod);
        self.transport.reportJNIEnvCall(data, this.context);
        self.handleJNIInterceptResult(method, args, ret);
        return ret;
      }, retType, paramTypes);
      this.references.add(nativeCallback);
      return nativeCallback;
    }
  }, {
    key: "createJNIVarArgMainCallback",
    value: function createJNIVarArgMainCallback(method, methodPtr, initialparamTypes, mainParamTypes, retType) {
      var self = this;
      var mainCallback = new NativeCallback(function () {
        var METHOD_ID_INDEX = 2;
        var threadId = this.threadId;
        var args = [].slice.call(arguments);
        var jniEnv = self.threads.getJNIEnv(threadId);
        var key = args[METHOD_ID_INDEX].toString();
        var jmethod = self.methods[key];
        args[JNI_ENV_INDEX] = jniEnv;
        var ret = new NativeFunction(methodPtr, retType, initialparamTypes).apply(null, args);
        var data = new method_data_1.MethodData(method, args, ret, jmethod);
        self.transport.reportJNIEnvCall(data, self.vaArgsBacktraces[this.threadId]);
        delete self.vaArgsBacktraces[this.threadId];
        return ret;
      }, retType, mainParamTypes);
      return mainCallback;
    }
  }, {
    key: "createJNIVarArgInitialCallback",
    value: function createJNIVarArgInitialCallback(method, methodPtr) {
      var self = this;
      var vaArgsCallback = new NativeCallback(function () {
        var METHOD_ID_INDEX = 2;
        var methodId = arguments[METHOD_ID_INDEX];
        var javaMethod = self.methods[methodId];

        if (self.fastMethodLookup[methodId] !== undefined) {
          return self.fastMethodLookup[methodId];
        }

        var originalParams = method.args.slice(TYPE_NAME_START, TYPE_NAME_END).map(function (t) {
          return types_1.Types.convertNativeJTypeToFridaType(t);
        });
        var callbackParams = originalParams.slice(COPY_ARRAY_INDEX);
        originalParams.push("...");
        javaMethod.fridaParams.forEach(function (p) {
          callbackParams.push(p === "float" ? "double" : p);
          originalParams.push(p);
        });
        var retType = types_1.Types.convertNativeJTypeToFridaType(method.ret);
        var mainCallback = self.createJNIVarArgMainCallback(method, methodPtr, originalParams, callbackParams, retType);
        self.references.add(mainCallback);
        self.fastMethodLookup[methodId] = mainCallback;
        return mainCallback;
      }, "pointer", ["pointer", "pointer", "pointer"]);
      return vaArgsCallback;
    }
  }, {
    key: "readValue",
    value: function readValue(currentPtr, type, extend) {
      var val = NULL;

      if (type === "char") {
        val = currentPtr.readS8();
      } else if (type === "int16") {
        val = currentPtr.readS16();
      } else if (type === "uint16") {
        val = currentPtr.readU16();
      } else if (type === "int") {
        val = currentPtr.readS32();
      } else if (type === "int64") {
        val = currentPtr.readS64();
      } else if (type === "float") {
        if (extend === true) {
          val = currentPtr.readDouble();
        } else {
          val = currentPtr.readFloat();
        }
      } else if (type === "double") {
        val = currentPtr.readDouble();
      } else if (type === "pointer") {
        val = currentPtr.readPointer();
      }

      return val;
    }
  }]);
  return JNIEnvInterceptor;
}();

exports.JNIEnvInterceptor = JNIEnvInterceptor;
;

},{"../data/jni_env.json":2,"../utils/config":13,"../utils/java_method":14,"../utils/method_data":15,"../utils/types":17,"@babel/runtime-corejs2/core-js/object/define-property":20,"@babel/runtime-corejs2/helpers/classCallCheck":26,"@babel/runtime-corejs2/helpers/createClass":27,"@babel/runtime-corejs2/helpers/interopRequireDefault":30}],8:[function(require,module,exports){
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));

var _defineProperty = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));

(0, _defineProperty["default"])(exports, "__esModule", {
  value: true
});

var JNIThreadManager =
/*#__PURE__*/
function () {
  function JNIThreadManager() {
    (0, _classCallCheck2["default"])(this, JNIThreadManager);
    this.threads = {};
    this.shadowJavaVM = NULL;
  }

  (0, _createClass2["default"])(JNIThreadManager, [{
    key: "getJavaVM",
    value: function getJavaVM() {
      return this.shadowJavaVM;
    }
  }, {
    key: "hasJavaVM",
    value: function hasJavaVM() {
      return !this.shadowJavaVM.isNull();
    }
  }, {
    key: "setJavaVM",
    value: function setJavaVM(javaVM) {
      this.shadowJavaVM = javaVM;
    }
  }, {
    key: "getJNIEnv",
    value: function getJNIEnv(threadId) {
      if (this.threads[threadId] !== undefined) {
        return this.threads[threadId];
      } else {
        return NULL;
      }
    }
  }, {
    key: "hasJNIEnv",
    value: function hasJNIEnv(threadId) {
      return !this.getJNIEnv(threadId).isNull();
    }
  }, {
    key: "setJNIEnv",
    value: function setJNIEnv(threadId, jniEnv) {
      this.createEntry(threadId, jniEnv);
    }
  }, {
    key: "needsJNIEnvUpdate",
    value: function needsJNIEnvUpdate(threadId, jniEnv) {
      var entry = this.getEntry(threadId);

      if (entry === undefined || !entry.equals(jniEnv)) {
        return true;
      }

      return false;
    }
  }, {
    key: "createEntry",
    value: function createEntry(threadId, jniEnv) {
      this.threads[threadId] = jniEnv;
    }
  }, {
    key: "getEntry",
    value: function getEntry(threadId) {
      return this.threads[threadId];
    }
  }]);
  return JNIThreadManager;
}();

exports.JNIThreadManager = JNIThreadManager;
;

},{"@babel/runtime-corejs2/core-js/object/define-property":20,"@babel/runtime-corejs2/helpers/classCallCheck":26,"@babel/runtime-corejs2/helpers/createClass":27,"@babel/runtime-corejs2/helpers/interopRequireDefault":30}],9:[function(require,module,exports){
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));

var _defineProperty = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));

(0, _defineProperty["default"])(exports, "__esModule", {
  value: true
});

var jni_env_interceptor_1 = require("../jni_env_interceptor");

var JNIEnvInterceptorX64 =
/*#__PURE__*/
function (_jni_env_interceptor_) {
  (0, _inherits2["default"])(JNIEnvInterceptorX64, _jni_env_interceptor_);

  function JNIEnvInterceptorX64(references, threads, transport) {
    var _this;

    (0, _classCallCheck2["default"])(this, JNIEnvInterceptorX64);
    _this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(JNIEnvInterceptorX64).call(this, references, threads, transport));
    _this.grOffset = 0;
    _this.grOffsetStart = 0;
    _this.fpOffset = 0;
    _this.fpOffsetStart = 0;
    _this.overflowPtr = NULL;
    _this.dataPtr = NULL;
    return _this;
  }

  (0, _createClass2["default"])(JNIEnvInterceptorX64, [{
    key: "buildVaArgParserShellcode",
    value: function buildVaArgParserShellcode(text, data, parser) {
      Memory.patchCode(text, Process.pageSize, function (code) {
        var cw = new X86Writer(code, {
          pc: text
        });
        var XMM_INC_VALUE = 8;
        var SKIP_FIRST_REG = 1;
        var XMM_MOV_INS_1 = 0x66;
        var XMM_MOV_INS_2 = 0x48;
        var XMM_MOV_INS_3 = 0x0f;
        var XMM_MOV_TO_INS_4 = 0x7e;
        var XMM_MOV_INS_5 = 0xc7;
        var regs = ["rdi", "rsi", "rdx", "rcx", "r8", "r9", "rax", "rbx", "r10", "r11", "r12", "r13", "r14", "r15", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"];
        var dataOffset = 0;
        var xmmOffset = 0;

        for (var i = 0; i < regs.length; i++) {
          cw.putMovNearPtrReg(data.add(dataOffset), "rdi");
          dataOffset += Process.pointerSize;

          if (i < regs.length - SKIP_FIRST_REG) {
            if (regs[i + SKIP_FIRST_REG].includes("xmm")) {
              cw.putU8(XMM_MOV_INS_1);
              cw.putU8(XMM_MOV_INS_2);
              cw.putU8(XMM_MOV_INS_3);
              cw.putU8(XMM_MOV_TO_INS_4);
              cw.putU8(XMM_MOV_INS_5 + xmmOffset * XMM_INC_VALUE);
              xmmOffset++;
            } else {
              cw.putMovRegReg("rdi", regs[i + SKIP_FIRST_REG]);
            }
          }
        }

        xmmOffset--;
        cw.putPopReg("rdi");
        cw.putMovNearPtrReg(data.add(dataOffset), "rdi");
        dataOffset += Process.pointerSize;
        cw.putCallAddress(parser);
        cw.putMovNearPtrReg(data.add(dataOffset), "rax");
        dataOffset += Process.pointerSize;
        var REG_SIZE = 2;
        var END_INDEX = 1;
        var SKIP_FIRST_COPY = 0;
        var FIRST_ELEM_INDEX = 0;
        var XMM_MOV_FROM_INS_4 = 0x6e;
        var regRestoreOffset = dataOffset - Process.pointerSize * REG_SIZE;

        for (var _i = regs.length - END_INDEX; _i >= FIRST_ELEM_INDEX; _i--) {
          regRestoreOffset = _i * Process.pointerSize;
          cw.putMovRegNearPtr("rdi", data.add(regRestoreOffset));

          if (_i > SKIP_FIRST_COPY) {
            if (regs[_i].includes("xmm")) {
              cw.putU8(XMM_MOV_INS_1);
              cw.putU8(XMM_MOV_INS_2);
              cw.putU8(XMM_MOV_INS_3);
              cw.putU8(XMM_MOV_FROM_INS_4);
              cw.putU8(XMM_MOV_INS_5 + xmmOffset * XMM_INC_VALUE);
              xmmOffset--;
            } else {
              cw.putMovRegReg(regs[_i], "rdi");
            }
          }
        }

        cw.putMovNearPtrReg(data.add(dataOffset), "rdi");
        var rdiBackup = dataOffset;
        dataOffset += Process.pointerSize;
        var cbAddressOffset = rdiBackup - Process.pointerSize;
        cw.putMovRegNearPtr("rdi", data.add(cbAddressOffset));
        cw.putMovNearPtrReg(data.add(dataOffset), "r13");
        var r13Backup = dataOffset;
        cw.putMovRegReg("r13", "rdi");
        cw.putMovRegNearPtr("rdi", data.add(rdiBackup));
        cw.putCallReg("r13");
        cw.putMovRegNearPtr("r13", data.add(r13Backup));
        var retAddressOffset = cbAddressOffset - Process.pointerSize;
        cw.putJmpNearPtr(data.add(retAddressOffset));
        cw.flush();
      });
    }
  }, {
    key: "setUpVaListArgExtract",
    value: function setUpVaListArgExtract(vaList) {
      var FP_OFFSET = 4;
      var DATA_OFFSET = 2;
      this.grOffset = vaList.readU32();
      this.grOffsetStart = this.grOffset;
      this.fpOffset = vaList.add(FP_OFFSET).readU32();
      this.fpOffsetStart = this.fpOffset;
      this.overflowPtr = vaList.add(Process.pointerSize).readPointer();
      this.dataPtr = vaList.add(Process.pointerSize * DATA_OFFSET).readPointer();
    }
  }, {
    key: "extractVaListArgValue",
    value: function extractVaListArgValue(method, paramId) {
      var FP_REG_SIZE = 2;
      var MAX_GR_REG_NUM = 2;
      var MAX_FP_REG_NUM = 14;
      var OFFSET = 1;
      var currentPtr = NULL;

      if (method.fridaParams[paramId] === "float" || method.fridaParams[paramId] === "double") {
        var fpDelta = this.fpOffset - this.fpOffsetStart;

        if (fpDelta / Process.pointerSize < MAX_FP_REG_NUM) {
          currentPtr = this.dataPtr.add(this.fpOffset);
          this.fpOffset += Process.pointerSize * FP_REG_SIZE;
        } else {
          var reverseId = method.fridaParams.length - paramId - OFFSET;
          currentPtr = this.overflowPtr.add(reverseId * Process.pointerSize);
        }
      } else {
        var grDelta = this.grOffset - this.grOffsetStart;

        if (grDelta / Process.pointerSize < MAX_GR_REG_NUM) {
          currentPtr = this.dataPtr.add(this.grOffset);
          this.grOffset += Process.pointerSize;
        } else {
          var _reverseId = method.fridaParams.length - paramId - OFFSET;

          currentPtr = this.overflowPtr.add(_reverseId * Process.pointerSize);
        }
      }

      return currentPtr;
    }
  }, {
    key: "resetVaListArgExtract",
    value: function resetVaListArgExtract() {
      this.grOffset = 0;
      this.grOffsetStart = 0;
      this.fpOffset = 0;
      this.fpOffsetStart = 0;
      this.overflowPtr = NULL;
      this.dataPtr = NULL;
    }
  }]);
  return JNIEnvInterceptorX64;
}(jni_env_interceptor_1.JNIEnvInterceptor);

exports.JNIEnvInterceptorX64 = JNIEnvInterceptorX64;
;

},{"../jni_env_interceptor":7,"@babel/runtime-corejs2/core-js/object/define-property":20,"@babel/runtime-corejs2/helpers/classCallCheck":26,"@babel/runtime-corejs2/helpers/createClass":27,"@babel/runtime-corejs2/helpers/getPrototypeOf":28,"@babel/runtime-corejs2/helpers/inherits":29,"@babel/runtime-corejs2/helpers/interopRequireDefault":30,"@babel/runtime-corejs2/helpers/possibleConstructorReturn":31}],10:[function(require,module,exports){
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));

var _defineProperty = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));

(0, _defineProperty["default"])(exports, "__esModule", {
  value: true
});

var jni_env_interceptor_1 = require("../jni_env_interceptor");

var types_1 = require("../../utils/types");

var JNIEnvInterceptorX86 =
/*#__PURE__*/
function (_jni_env_interceptor_) {
  (0, _inherits2["default"])(JNIEnvInterceptorX86, _jni_env_interceptor_);

  function JNIEnvInterceptorX86(references, threads, transport) {
    var _this;

    (0, _classCallCheck2["default"])(this, JNIEnvInterceptorX86);
    _this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(JNIEnvInterceptorX86).call(this, references, threads, transport));
    _this.vaList = NULL;
    _this.vaListOffset = 0;
    return _this;
  }

  (0, _createClass2["default"])(JNIEnvInterceptorX86, [{
    key: "buildVaArgParserShellcode",
    value: function buildVaArgParserShellcode(text, data, parser) {
      var DATA_OFFSET = 0x400;
      text.add(DATA_OFFSET).writePointer(parser);
      Memory.patchCode(text, Process.pageSize, function (code) {
        var cw = new X86Writer(code, {
          pc: text
        });
        var dataOffset = DATA_OFFSET + Process.pointerSize;
        cw.putPopReg("eax");
        cw.putMovNearPtrReg(text.add(dataOffset + Process.pointerSize), "eax");
        cw.putCallAddress(parser);
        cw.putCallReg("eax");
        cw.putJmpNearPtr(text.add(dataOffset + Process.pointerSize));
        cw.flush();
      });
    }
  }, {
    key: "setUpVaListArgExtract",
    value: function setUpVaListArgExtract(vaList) {
      this.vaList = vaList;
      this.vaListOffset = 0;
    }
  }, {
    key: "extractVaListArgValue",
    value: function extractVaListArgValue(method, paramId) {
      var currentPtr = this.vaList.add(this.vaListOffset);
      this.vaListOffset += types_1.Types.sizeOf(method.fridaParams[paramId]);
      return currentPtr;
    }
  }, {
    key: "resetVaListArgExtract",
    value: function resetVaListArgExtract() {
      this.vaList = NULL;
      this.vaListOffset = 0;
    }
  }]);
  return JNIEnvInterceptorX86;
}(jni_env_interceptor_1.JNIEnvInterceptor);

exports.JNIEnvInterceptorX86 = JNIEnvInterceptorX86;
;

},{"../../utils/types":17,"../jni_env_interceptor":7,"@babel/runtime-corejs2/core-js/object/define-property":20,"@babel/runtime-corejs2/helpers/classCallCheck":26,"@babel/runtime-corejs2/helpers/createClass":27,"@babel/runtime-corejs2/helpers/getPrototypeOf":28,"@babel/runtime-corejs2/helpers/inherits":29,"@babel/runtime-corejs2/helpers/interopRequireDefault":30,"@babel/runtime-corejs2/helpers/possibleConstructorReturn":31}],11:[function(require,module,exports){
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

var _defineProperty = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));

(0, _defineProperty["default"])(exports, "__esModule", {
  value: true
});

var reference_manager_1 = require("./utils/reference_manager");

var config_1 = require("./utils/config");

var data_transport_1 = require("./transport/data_transport");

var jni_env_interceptor_x86_1 = require("./jni/x86/jni_env_interceptor_x86");

var jni_env_interceptor_x64_1 = require("./jni/x64/jni_env_interceptor_x64");

var jni_env_interceptor_arm_1 = require("./jni/arm/jni_env_interceptor_arm");

var jni_env_interceptor_arm64_1 = require("./jni/arm64/jni_env_interceptor_arm64");

var java_vm_interceptor_1 = require("./jni/java_vm_interceptor");

var jni_thread_manager_1 = require("./jni/jni_thread_manager");

var IS_IN_REPL = true;
var JNI_ENV_INDEX = 0;
var JAVA_VM_INDEX = 0;
var LIB_TRACK_FIRST_INDEX = 0;
var threads = new jni_thread_manager_1.JNIThreadManager();
var references = new reference_manager_1.ReferenceManager();
var transport = new data_transport_1.DataTransport(threads);
var jniEnvInterceptor = undefined;

if (Process.arch === "ia32") {
  jniEnvInterceptor = new jni_env_interceptor_x86_1.JNIEnvInterceptorX86(references, threads, transport);
} else if (Process.arch === "x64") {
  jniEnvInterceptor = new jni_env_interceptor_x64_1.JNIEnvInterceptorX64(references, threads, transport);
} else if (Process.arch === "arm") {
  jniEnvInterceptor = new jni_env_interceptor_arm_1.JNIEnvInterceptorARM(references, threads, transport);
} else if (Process.arch === "arm64") {
  jniEnvInterceptor = new jni_env_interceptor_arm64_1.JNIEnvInterceptorARM64(references, threads, transport);
}

if (jniEnvInterceptor === undefined) {
  throw new Error(Process.arch + " currently unsupported, please file an issue.");
}

var javaVMInterceptor = new java_vm_interceptor_1.JavaVMInterceptor(references, threads, transport, jniEnvInterceptor);
jniEnvInterceptor.setJavaVMInterceptor(javaVMInterceptor);
var config = config_1.Config.getInstance();
var trackedLibs = {};
var libBlacklist = {};

function checkLibrary(path) {
  var EMPTY_ARRAY_LENGTH = 0;
  var ONE_ELEMENT_ARRAY_LENGTH = 1;
  var willFollowLib = false;

  if (!IS_IN_REPL && !config_1.Config.initialised()) {
    var op = recv("config", function (message) {
      config = config_1.Config.getInstance(message.payload.libraries, message.payload.backtrace, message.payload.show_data, message.payload.include, message.payload.exclude, message.payload.include_export, message.payload.exclude_export, message.payload.env, message.payload.vm);
    });
    op.wait();
  }

  if (config.libsToTrack.length === ONE_ELEMENT_ARRAY_LENGTH) {
    if (config.libsToTrack[LIB_TRACK_FIRST_INDEX] === "*") {
      willFollowLib = true;
    }
  }

  if (!willFollowLib) {
    willFollowLib = config.libsToTrack.filter(function (l) {
      return path.includes(l);
    }).length > EMPTY_ARRAY_LENGTH;
  }

  if (willFollowLib) {
    send({
      type: "tracked_library",
      library: path
    });
  }

  return willFollowLib;
}

function interceptJNIOnLoad(jniOnLoadAddr) {
  return Interceptor.attach(jniOnLoadAddr, {
    onEnter: function onEnter(args) {
      var shadowJavaVM = NULL;
      var javaVM = ptr(args[JAVA_VM_INDEX].toString());

      if (!threads.hasJavaVM()) {
        threads.setJavaVM(javaVM);
      }

      if (!javaVMInterceptor.isInitialised()) {
        shadowJavaVM = javaVMInterceptor.create();
      } else {
        shadowJavaVM = javaVMInterceptor.get();
      }

      args[JAVA_VM_INDEX] = shadowJavaVM;
    }
  });
}

function interceptJNIFunction(jniFunctionAddr) {
  return Interceptor.attach(jniFunctionAddr, {
    onEnter: function onEnter(args) {
      if (jniEnvInterceptor === undefined) {
        return;
      }

      var threadId = this.threadId;
      var jniEnv = ptr(args[JNI_ENV_INDEX].toString());
      var shadowJNIEnv = NULL;
      threads.setJNIEnv(threadId, jniEnv);

      if (!jniEnvInterceptor.isInitialised()) {
        shadowJNIEnv = jniEnvInterceptor.create();
      } else {
        shadowJNIEnv = jniEnvInterceptor.get();
      }

      args[JNI_ENV_INDEX] = shadowJNIEnv;
    }
  });
}

var dlopenRef = Module.findExportByName(null, "dlopen");
var dlsymRef = Module.findExportByName(null, "dlsym");
var dlcloseRef = Module.findExportByName(null, "dlclose");

if (dlopenRef !== null && dlsymRef !== null && dlcloseRef !== null) {
  var HANDLE_INDEX = 0;
  var dlopen = new NativeFunction(dlopenRef, 'pointer', ['pointer', 'int']);
  Interceptor.replace(dlopen, new NativeCallback(function (filename, mode) {
    var path = filename.readCString();
    var retval = dlopen(filename, mode);

    if (checkLibrary(path)) {
      trackedLibs[retval.toString()] = true;
    } else {
      libBlacklist[retval.toString()] = true;
    }

    return retval;
  }, 'pointer', ['pointer', 'int']));
  var dlsym = new NativeFunction(dlsymRef, "pointer", ["pointer", "pointer"]);
  Interceptor.attach(dlsym, {
    onEnter: function onEnter(args) {
      var SYMBOL_INDEX = 1;
      this.handle = ptr(args[HANDLE_INDEX].toString());

      if (libBlacklist[this.handle]) {
        return;
      }

      this.symbol = args[SYMBOL_INDEX].readCString();
    },
    onLeave: function onLeave(retval) {
      var _this = this;

      if (retval.isNull() || libBlacklist[this.handle]) {
        return;
      }

      var EMPTY_ARRAY_LEN = 0;

      if (config.includeExport.length > EMPTY_ARRAY_LEN) {
        var included = config.includeExport.filter(function (i) {
          return _this.symbol.includes(i);
        });

        if (included.length === EMPTY_ARRAY_LEN) {
          return;
        }
      }

      if (config.excludeExport.length > EMPTY_ARRAY_LEN) {
        var excluded = config.excludeExport.filter(function (e) {
          return _this.symbol.includes(e);
        });

        if (excluded.length > EMPTY_ARRAY_LEN) {
          return;
        }
      }

      if (trackedLibs[this.handle] === undefined) {
        // Android 7 and above miss the initial dlopen call.
        // Give it another chance in dlsym.
        var mod = Process.findModuleByAddress(retval);

        if (mod !== null && checkLibrary(mod.path)) {
          trackedLibs[this.handle] = true;
        }
      }

      if (trackedLibs[this.handle] !== undefined) {
        var symbol = this.symbol;

        if (symbol === "JNI_OnLoad") {
          interceptJNIOnLoad(ptr(retval.toString()));
        } else if (symbol.startsWith("Java_") === true) {
          interceptJNIFunction(ptr(retval.toString()));
        }
      } else {
        var name = config.libsToTrack[HANDLE_INDEX];

        if (name !== "*") {
          var _mod = Process.findModuleByAddress(retval);

          if (_mod === null) {
            return;
          }

          name = _mod.name;
        }

        if (config.libsToTrack.includes(name) || name === "*") {
          interceptJNIFunction(ptr(retval.toString()));
        }
      }
    }
  });
  var dlclose = new NativeFunction(dlcloseRef, "int", ["pointer"]);
  Interceptor.attach(dlclose, {
    onEnter: function onEnter(args) {
      var handle = args[HANDLE_INDEX].toString();

      if (trackedLibs[handle]) {
        this.handle = handle;
      }
    },
    onLeave: function onLeave(retval) {
      if (this.handle !== undefined) {
        if (retval.isNull()) {
          delete trackedLibs[this.handle];
        }
      }
    }
  });
}

if (IS_IN_REPL) {
  console.error("Welcome to jnitrace. Tracing is running...");
  console.warn("NOTE: the recommended way to run this module is using the " + "python wrapper. It provides nicely formated coloured output " + "in the form of frida-trace. To get jnitrace run " + "'pip install jnitrace' or go to " + "'https://github.com/chame1eon/jnitrace'");
}

},{"./jni/arm/jni_env_interceptor_arm":3,"./jni/arm64/jni_env_interceptor_arm64":4,"./jni/java_vm_interceptor":6,"./jni/jni_thread_manager":8,"./jni/x64/jni_env_interceptor_x64":9,"./jni/x86/jni_env_interceptor_x86":10,"./transport/data_transport":12,"./utils/config":13,"./utils/reference_manager":16,"@babel/runtime-corejs2/core-js/object/define-property":20,"@babel/runtime-corejs2/helpers/interopRequireDefault":30}],12:[function(require,module,exports){
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var _defineProperty = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));

(0, _defineProperty["default"])(exports, "__esModule", {
  value: true
});

var types_1 = require("../utils/types");

var config_1 = require("../utils/config");

var JNI_OK = 0;
var TYPE_NAME_START = 0;
var TYPE_NAME_END = -1;
var SKIP_ENV_INDEX = 1;
var EMPTY_ARRAY_LEN = 0;

var NativeMethodJSONContainer = function NativeMethodJSONContainer(name, sig, addr) {
  (0, _classCallCheck2["default"])(this, NativeMethodJSONContainer);
  this.name = name;
  this.sig = sig;
  this.addr = addr;
};

;
/* eslint-disable @typescript-eslint/camelcase */

var DataJSONContainer =
/*#__PURE__*/
function () {
  function DataJSONContainer(value, data, dataIndex) {
    (0, _classCallCheck2["default"])(this, DataJSONContainer);
    var RET_INDEX = -1;
    this.value = value;

    if (data !== null) {
      if (!(data instanceof ArrayBuffer)) {
        this.data = data;
      }
    }

    if (dataIndex !== undefined) {
      if (dataIndex === RET_INDEX) {
        this.has_data = true;
      } else {
        this.data_for = dataIndex;
      }
    }
  }

  (0, _createClass2["default"])(DataJSONContainer, [{
    key: "getMetadata",
    value: function getMetadata() {
      return this.metadata;
    }
  }, {
    key: "setMetadata",
    value: function setMetadata(metadata) {
      this.metadata = metadata;
    }
  }]);
  return DataJSONContainer;
}();

;

var BacktraceJSONContainer = function BacktraceJSONContainer(address, module, symbol) {
  (0, _classCallCheck2["default"])(this, BacktraceJSONContainer);
  this.address = address;
  this.module = module;
  this.symbol = symbol;
};

;

var RecordJSONContainer = function RecordJSONContainer(callType, method, args, ret, threadId, timestamp, javaParams, backtrace) {
  (0, _classCallCheck2["default"])(this, RecordJSONContainer);
  this.type = "trace_data";
  this.call_type = callType;
  this.method = method;
  this.args = args;
  this.ret = ret;
  this.thread_id = threadId;
  this.timestamp = timestamp;
  this.java_params = javaParams;
  this.backtrace = backtrace;
};

;
/* eslint-enable @typescript-eslint/camelcase */

var DataTransport =
/*#__PURE__*/
function () {
  function DataTransport(threads) {
    (0, _classCallCheck2["default"])(this, DataTransport);
    this.threads = threads;
    this.start = (0, _now["default"])();
    this.byteArraySizes = {};
    this.jobjects = {};
    this.jfieldIDs = {};
    this.jmethodIDs = {};
  }

  (0, _createClass2["default"])(DataTransport, [{
    key: "reportJavaVMCall",
    value: function reportJavaVMCall(data, context) {
      var config = config_1.Config.getInstance();
      var outputArgs = [];
      var outputRet = new DataJSONContainer(data.ret, null);
      var javaVM = this.threads.getJavaVM();

      if (!config.vm || this.shouldIgnoreMethod(data)) {
        return;
      }

      outputArgs.push(new DataJSONContainer(javaVM, null));
      var sendData = this.addJavaVMArgs(data, outputArgs);
      this.sendToHost("JavaVM", data, outputArgs, outputRet, sendData, context);
    }
  }, {
    key: "reportJNIEnvCall",
    value: function reportJNIEnvCall(data, context) {
      var RET_INDEX = 0;
      var config = config_1.Config.getInstance();
      var threadId = Process.getCurrentThreadId();
      var outputArgs = [];
      var outputRet = [];
      var jniEnv = this.threads.getJNIEnv(threadId);
      this.updateState(data);
      outputArgs.push(new DataJSONContainer(jniEnv, null));
      var sendData = null;
      var argData = this.addJNIEnvArgs(data, outputArgs);
      var retData = this.addJNIEnvRet(data, outputRet);

      if (argData !== null && retData === null) {
        sendData = argData;
      } else if (argData == null && retData !== null) {
        sendData = retData;
      }

      this.enrichTraceData(data, outputArgs, outputRet);

      if (!config.env || this.shouldIgnoreMethod(data)) {
        return;
      }

      this.sendToHost("JNIEnv", data, outputArgs, outputRet[RET_INDEX], sendData, context);
    }
  }, {
    key: "updateArrayLengths",
    value: function updateArrayLengths(data, isGet) {
      var JARRAY_INDEX = 1;

      if (isGet) {
        this.byteArraySizes[data.args[JARRAY_INDEX].toString()] = data.ret;
      } else {
        //isSet
        this.byteArraySizes[data.ret.toString()] = data.args[JARRAY_INDEX];
      }
    }
  }, {
    key: "updateMethodIDs",
    value: function updateMethodIDs(data) {
      var NAME_INDEX = 2;
      var SIG_INDEX = 3;
      var methodID = data.ret.toString();
      var name = data.args[NAME_INDEX].readCString();
      var sig = data.args[SIG_INDEX].readCString();

      if (name !== null && sig !== null) {
        this.jmethodIDs[methodID] = name + sig;
      }
    }
  }, {
    key: "updateFieldIDs",
    value: function updateFieldIDs(data) {
      var NAME_INDEX = 2;
      var SIG_INDEX = 3;
      var fieldID = data.ret.toString();
      var name = data.args[NAME_INDEX].readCString();
      var sig = data.args[SIG_INDEX].readCString();

      if (name !== null && sig !== null) {
        this.jfieldIDs[fieldID] = name + ":" + sig;
      }
    }
  }, {
    key: "updateClassIDs",
    value: function updateClassIDs(data) {
      var NAME_INDEX = 1;
      var jclass = data.ret.toString();
      var name = data.args[NAME_INDEX].readCString();

      if (name !== null) {
        this.jobjects[jclass] = name;
      }
    }
  }, {
    key: "updateObjectIDsFromRefs",
    value: function updateObjectIDsFromRefs(data, isCreate) {
      var OBJECT_INDEX = 1;

      if (isCreate) {
        var newRef = data.ret.toString();
        var oldRef = data.args[OBJECT_INDEX].toString();

        if (this.jobjects[oldRef] !== undefined) {
          this.jobjects[newRef] = this.jobjects[oldRef];
        }
      } else {
        var jobject = data.args[OBJECT_INDEX].toString();
        delete this.jobjects[jobject];
      }
    }
  }, {
    key: "updateObjectIDsFromClass",
    value: function updateObjectIDsFromClass(data) {
      var OBJECT_INDEX = 1;
      var jobject = data.args[OBJECT_INDEX].toString();
      var jclass = data.ret.toString();

      if (this.jobjects[jobject] !== undefined) {
        this.jobjects[jclass] = jobject;
      }
    }
  }, {
    key: "updateObjectIDsFromCall",
    value: function updateObjectIDsFromCall(data) {
      var TYPE_START = 1;
      var TYPE_END = -1;
      var LAST_CALL_INDEX = 3;
      var CALL_PTRS_OFFSET = 5;

      if (data.javaMethod !== undefined) {
        var start = 4;
        var lastArg = data.method.args[LAST_CALL_INDEX];

        if (["jvalue*", "va_list"].includes(lastArg)) {
          start = CALL_PTRS_OFFSET;
        }

        for (var i = start; i < data.args.length; i++) {
          var arg = data.args[i].toString();

          if (this.jobjects[arg] !== undefined) {
            // skip where we have an existing class name
            continue;
          }

          var nativeJType = data.javaMethod.nativeParams[i - start];

          if (types_1.Types.isComplexObjectType(nativeJType)) {
            this.jobjects[arg] = nativeJType.slice(TYPE_START, TYPE_END);
          }
        }

        if (data.method.name.includes("Object")) {
          if (this.jobjects[data.ret.toString()] === undefined) {
            this.jobjects[data.ret.toString()] = data.javaMethod.ret.slice(TYPE_START, TYPE_END);
          }
        }
      }
    }
  }, {
    key: "updateState",
    value: function updateState(data) {
      var name = data.method.name;

      if (name === "GetArrayLength") {
        this.updateArrayLengths(data, true);
      } else if (name.startsWith("New") && name.endsWith("Array")) {
        this.updateArrayLengths(data, false);
      } else if (["GetMethodID", "GetStaticMethodID"].includes(name)) {
        this.updateMethodIDs(data);
      } else if (["GetFieldID", "GetStaticFieldID"].includes(name)) {
        this.updateFieldIDs(data);
      } else if (["FindClass", "DefineClass"].includes(name)) {
        this.updateClassIDs(data);
      } else if (name.startsWith("New") && name.endsWith("GlobalRef")) {
        this.updateObjectIDsFromRefs(data, true);
      } else if (name.startsWith("Delete") && name.endsWith("GlobalRef")) {
        this.updateObjectIDsFromRefs(data, false);
      } else if (name === "GetObjectClass") {
        this.updateObjectIDsFromClass(data);
      } else if (name.startsWith("Call")) {
        this.updateObjectIDsFromCall(data);
      }
    }
  }, {
    key: "shouldIgnoreMethod",
    value: function shouldIgnoreMethod(data) {
      var config = config_1.Config.getInstance();
      var include = config.include;
      var exclude = config.exclude;
      var name = data.method.name;

      if (include.length > EMPTY_ARRAY_LEN) {
        var included = include.filter(function (i) {
          return new RegExp(i).test(name);
        });

        if (included.length === EMPTY_ARRAY_LEN) {
          return true;
        }
      }

      if (exclude.length > EMPTY_ARRAY_LEN) {
        var excluded = exclude.filter(function (e) {
          return new RegExp(e).test(name);
        });

        if (excluded.length > EMPTY_ARRAY_LEN) {
          return true;
        }
      }

      return false;
    }
  }, {
    key: "enrichSingleItem",
    value: function enrichSingleItem(type, key, item) {
      if (types_1.Types.isComplexObjectType(type)) {
        if (this.jobjects[key] !== undefined) {
          item.setMetadata(this.jobjects[key]);
        }
      } else if (type === "jmethodID") {
        if (this.jmethodIDs[key] !== undefined) {
          item.setMetadata(this.jmethodIDs[key]);
        }
      } else if (type === "jfieldID") {
        if (this.jfieldIDs[key] !== undefined) {
          item.setMetadata(this.jfieldIDs[key]);
        }
      }
    }
  }, {
    key: "enrichTraceData",
    value: function enrichTraceData(data, args, ret) {
      var ONLY_RET = 0;
      var i = 0;

      for (; i < data.method.args.length; i++) {
        if (["jvalue*, va_list"].includes(data.method.args[i])) {
          i++;
          continue;
        } else if (data.method.args[i] === "...") {
          break;
        }

        this.enrichSingleItem(data.method.args[i], data.args[i].toString(), args[i]);
      }

      var OFFSET = i;

      for (; i < args.length; i++) {
        if (data.javaMethod !== undefined) {
          this.enrichSingleItem(data.javaMethod.nativeParams[i - OFFSET], data.args[i].toString(), args[i]);
        }
      }

      if (data.ret !== undefined) {
        this.enrichSingleItem(data.method.ret, data.ret.toString(), ret[ONLY_RET]);
      }
    }
  }, {
    key: "addDefinceClassArgs",
    value: function addDefinceClassArgs(data, outputArgs) {
      var CLASS_NAME_INDEX = 1;
      var OBJECT_INDEX = 2;
      var BUF_INDEX = 3;
      var LEN_INDEX = 4;
      var name = data.getArgAsPtr(CLASS_NAME_INDEX).readCString();
      outputArgs.push(new DataJSONContainer(data.args[CLASS_NAME_INDEX], name));
      outputArgs.push(new DataJSONContainer(data.args[OBJECT_INDEX], null));
      var buf = data.getArgAsPtr(BUF_INDEX);
      var len = data.getArgAsNum(LEN_INDEX);
      var classData = buf.readByteArray(len);
      outputArgs.push(new DataJSONContainer(data.args[BUF_INDEX], null, BUF_INDEX));
      outputArgs.push(new DataJSONContainer(data.args[LEN_INDEX], null));
      return classData;
    }
  }, {
    key: "addFindClassArgs",
    value: function addFindClassArgs(data, outputArgs) {
      var CLASS_NAME_INDEX = 1;
      var name = data.getArgAsPtr(CLASS_NAME_INDEX).readCString();
      outputArgs.push(new DataJSONContainer(data.args[CLASS_NAME_INDEX], name));
    }
  }, {
    key: "addThrowNewArgs",
    value: function addThrowNewArgs(data, outputArgs) {
      var CLASS_INDEX = 1;
      var MESSAGE_INDEX = 2;
      var message = data.getArgAsPtr(MESSAGE_INDEX).readCString();
      outputArgs.push(new DataJSONContainer(data.args[CLASS_INDEX], null));
      outputArgs.push(new DataJSONContainer(data.args[MESSAGE_INDEX], message));
    }
  }, {
    key: "addFatalErrorArgs",
    value: function addFatalErrorArgs(data, outputArgs) {
      var MESSAGE_INDEX = 1;
      var message = data.getArgAsPtr(MESSAGE_INDEX).readCString();
      outputArgs.push(new DataJSONContainer(data.args[MESSAGE_INDEX], message));
    }
  }, {
    key: "addGetGenericIDArgs",
    value: function addGetGenericIDArgs(data, outputArgs) {
      var CLASS_INDEX = 1;
      var NAME_INDEX = 2;
      var SIG_INDEX = 3;
      var name = data.getArgAsPtr(NAME_INDEX).readCString();
      var sig = data.getArgAsPtr(SIG_INDEX).readCString();
      outputArgs.push(new DataJSONContainer(data.args[CLASS_INDEX], null));
      outputArgs.push(new DataJSONContainer(data.args[NAME_INDEX], name));
      outputArgs.push(new DataJSONContainer(data.args[SIG_INDEX], sig));
    }
  }, {
    key: "addNewStringArgs",
    value: function addNewStringArgs(data, outputArgs) {
      var BUF_INDEX = 1;
      var LEN_INDEX = 2;
      var buf = data.getArgAsPtr(BUF_INDEX);
      var len = data.getArgAsNum(LEN_INDEX);
      var unicode = buf.readByteArray(len);
      outputArgs.push(new DataJSONContainer(data.args[BUF_INDEX], null, BUF_INDEX));
      outputArgs.push(new DataJSONContainer(data.args[LEN_INDEX], null));
      return unicode;
    }
  }, {
    key: "addGetGenericBufferArgs",
    value: function addGetGenericBufferArgs(data, outputArgs) {
      var JARRAY_INDEX = 1;
      var BUF_INDEX = 2;
      outputArgs.push(new DataJSONContainer(data.args[JARRAY_INDEX], null));

      if (!data.getArgAsPtr(BUF_INDEX).isNull()) {
        outputArgs.push(new DataJSONContainer(data.args[BUF_INDEX], data.getArgAsPtr(BUF_INDEX).readS8()));
      } else {
        outputArgs.push(new DataJSONContainer(data.args[BUF_INDEX], null));
      }
    }
  }, {
    key: "addReleaseCharsArgs",
    value: function addReleaseCharsArgs(data, outputArgs) {
      var JSTIRNG_INDEX = 2;
      var UNICODE_BUF_INDEX = 2;
      var unicode = data.getArgAsPtr(UNICODE_BUF_INDEX).readCString();
      outputArgs.push(new DataJSONContainer(data.args[JSTIRNG_INDEX], null));
      outputArgs.push(new DataJSONContainer(data.args[UNICODE_BUF_INDEX], unicode));
    }
  }, {
    key: "addGetGenericBufferRegionArgs",
    value: function addGetGenericBufferRegionArgs(data, outputArgs) {
      var LAST_ARG_OFFSET = 1;
      var LEN_INDEX = 3;
      var BUF_INDEX = 4;
      var type = data.method.args[BUF_INDEX].slice(TYPE_NAME_START, TYPE_NAME_END);
      var nType = types_1.Types.convertNativeJTypeToFridaType(type);
      var size = types_1.Types.sizeOf(nType);
      var buf = data.getArgAsPtr(BUF_INDEX);
      var len = data.getArgAsNum(LEN_INDEX);
      var region = buf.readByteArray(len * size);
      var loopLen = data.args.length - LAST_ARG_OFFSET;

      for (var i = SKIP_ENV_INDEX; i < loopLen; i++) {
        outputArgs.push(new DataJSONContainer(data.args[i], null));
      }

      outputArgs.push(new DataJSONContainer(data.args[data.args.length - LAST_ARG_OFFSET], null, data.args.length - LAST_ARG_OFFSET));
      return region;
    }
  }, {
    key: "addNewStringUTFArgs",
    value: function addNewStringUTFArgs(data, outputArgs) {
      var CHAR_PTR_INDEX = 1;
      var utf = data.getArgAsPtr(CHAR_PTR_INDEX).readUtf8String();
      outputArgs.push(new DataJSONContainer(data.args[CHAR_PTR_INDEX], utf));
    }
  }, {
    key: "addRegisterNativesArgs",
    value: function addRegisterNativesArgs(data, outputArgs) {
      var JCLASS_INDEX = 1;
      var METHODS_PTR_INDEX = 2;
      var SIZE_INDEX = 3;
      var JNI_METHOD_SIZE = 3;
      var size = data.getArgAsNum(SIZE_INDEX);
      var natives = [];
      outputArgs.push(new DataJSONContainer(data.args[JCLASS_INDEX], null));

      for (var i = 0; i < size * JNI_METHOD_SIZE; i += JNI_METHOD_SIZE) {
        var methodsPtr = data.getArgAsPtr(METHODS_PTR_INDEX);
        var namePtr = methodsPtr.add(i * Process.pointerSize).readPointer();
        var name = namePtr.readCString();
        var sigOffset = 1;
        var sigPtr = methodsPtr.add((i + sigOffset) * Process.pointerSize).readPointer();
        var sig = sigPtr.readCString();
        var addrOffset = 2;
        var addr = methodsPtr.add((i + addrOffset) * Process.pointerSize).readPointer();
        natives.push(new NativeMethodJSONContainer({
          value: namePtr.toString(),
          data: name
        }, {
          value: sigPtr.toString(),
          data: sig
        }, {
          value: addr.toString()
        }));
      }

      outputArgs.push(new DataJSONContainer(data.args[METHODS_PTR_INDEX], natives));
      outputArgs.push(new DataJSONContainer(data.args[SIZE_INDEX], null));
    }
  }, {
    key: "addGetJavaVMArgs",
    value: function addGetJavaVMArgs(data, outputArgs) {
      var JAVAVM_INDEX = 1;
      outputArgs.push(new DataJSONContainer(data.args[JAVAVM_INDEX], data.getArgAsPtr(JAVAVM_INDEX).readPointer()));
    }
  }, {
    key: "addReleaseStringCriticalArgs",
    value: function addReleaseStringCriticalArgs(data, outputArgs) {
      var JSTRING_INDEX = 1;
      var JCHAR_PTR_INDEX = 2;
      outputArgs.push(new DataJSONContainer(data.args[JSTRING_INDEX], null));
      outputArgs.push(new DataJSONContainer(data.args[JCHAR_PTR_INDEX], data.getArgAsPtr(JSTRING_INDEX).readCString()));
    }
  }, {
    key: "addReleaseElementsArgs",
    value: function addReleaseElementsArgs(data, outputArgs) {
      var BYTE_ARRAY_INDEX = 1;
      var BUFFER_PTR_INDEX = 2;
      var SKIP_ENV_INDEX = 1;
      var byteArrayArg = data.method.args[BUFFER_PTR_INDEX];
      var type = byteArrayArg.slice(TYPE_NAME_START, TYPE_NAME_END);
      var nType = types_1.Types.convertNativeJTypeToFridaType(type);
      var size = types_1.Types.sizeOf(nType);
      var buf = data.getArgAsPtr(BUFFER_PTR_INDEX);
      var byteArray = data.getArgAsPtr(BYTE_ARRAY_INDEX).toString();
      var len = this.byteArraySizes[byteArray];
      var region = null;

      if (len !== undefined) {
        region = buf.readByteArray(len * size);
      }

      for (var i = SKIP_ENV_INDEX; i < data.args.length; i++) {
        var arg = data.args[i];
        var dataFor = undefined;

        if (i === BUFFER_PTR_INDEX) {
          dataFor = i;
        }

        outputArgs.push(new DataJSONContainer(arg, null, dataFor));
      }

      return region;
    }
  }, {
    key: "addGenericArgs",
    value: function addGenericArgs(data, outputArgs) {
      for (var i = 1; i < data.args.length; i++) {
        outputArgs.push(new DataJSONContainer(data.args[i], null));
      }
    }
  }, {
    key: "addJNIEnvArgs",
    value: function addJNIEnvArgs(data, outputArgs) {
      var name = data.method.name;

      if (name === "DefineClass") {
        return this.addDefinceClassArgs(data, outputArgs);
      } else if (name === "FindClass") {
        this.addFindClassArgs(data, outputArgs);
      } else if (name === "ThrowNew") {
        this.addThrowNewArgs(data, outputArgs);
      } else if (name === "FatalError") {
        this.addFatalErrorArgs(data, outputArgs);
      } else if (name.endsWith("ID")) {
        this.addGetGenericIDArgs(data, outputArgs);
      } else if (name === "NewString") {
        return this.addNewStringArgs(data, outputArgs);
      } else if (name.startsWith("Get") && name.endsWith("Chars") || name.startsWith("Get") && name.endsWith("Elements") || name.startsWith("Get") && name.endsWith("ArrayCritical") || name === "GetStringCritical") {
        this.addGetGenericBufferArgs(data, outputArgs);
      } else if (name.startsWith("Release") && name.endsWith("Chars")) {
        this.addReleaseCharsArgs(data, outputArgs);
      } else if (name.endsWith("Region")) {
        return this.addGetGenericBufferRegionArgs(data, outputArgs);
      } else if (name === "NewStringUTF") {
        this.addNewStringUTFArgs(data, outputArgs);
      } else if (name === "RegisterNatives") {
        this.addRegisterNativesArgs(data, outputArgs);
      } else if (name === "GetJavaVM") {
        this.addGetJavaVMArgs(data, outputArgs);
      } else if (name === "ReleaseStringCritical") {
        this.addReleaseStringCriticalArgs(data, outputArgs);
      } else if (name.startsWith("Release") && name.endsWith("Elements") || name.startsWith("Release") && name.endsWith("ArrayCritical")) {
        return this.addReleaseElementsArgs(data, outputArgs);
      } else {
        this.addGenericArgs(data, outputArgs);
      }

      return null;
    }
  }, {
    key: "addJNIEnvRet",
    value: function addJNIEnvRet(data, outputRet) {
      var RET_INDEX = -1;
      var ENVPTR_ARG_INDEX = 1;
      var name = data.method.name;

      if (name.startsWith("Get") && name.endsWith("Elements") || name.startsWith("Get") && name.endsWith("ArrayCritical")) {
        var key = data.args[ENVPTR_ARG_INDEX].toString();

        if (this.byteArraySizes[key] !== undefined) {
          var type = data.method.ret.slice(TYPE_NAME_START, TYPE_NAME_END);
          var nType = types_1.Types.convertNativeJTypeToFridaType(type);
          var size = types_1.Types.sizeOf(nType);
          var buf = data.ret;
          var len = this.byteArraySizes[data.getArgAsPtr(ENVPTR_ARG_INDEX).toString()];
          outputRet.push(new DataJSONContainer(data.ret, null, RET_INDEX));
          return buf.readByteArray(len * size);
        }
      }

      outputRet.push(new DataJSONContainer(data.ret, null));
      return null;
    }
  }, {
    key: "addAttachCurrentThreadArgs",
    value: function addAttachCurrentThreadArgs(data, outputArgs) {
      var ENV_ARG_INDEX = 1;
      var ARGS_ARG_INDEX = 2;
      var JINT_SIZE = 4;
      var argStructSize = types_1.Types.sizeOf("pointer") + types_1.Types.sizeOf("pointer") + JINT_SIZE;
      var threadId = Process.getCurrentThreadId();
      var env = data.args[ENV_ARG_INDEX];
      var envData = null;

      if (data.ret === JNI_OK) {
        envData = this.threads.getJNIEnv(threadId);
      } else if (!data.getArgAsPtr(ENV_ARG_INDEX).isNull()) {
        envData = data.getArgAsPtr(ENV_ARG_INDEX).readPointer();
      }

      outputArgs.push(new DataJSONContainer(env, envData));
      var argValue = data.args[ARGS_ARG_INDEX];

      if (!data.getArgAsPtr(ARGS_ARG_INDEX).isNull()) {
        outputArgs.push(new DataJSONContainer(argValue, null, ARGS_ARG_INDEX));
        return data.getArgAsPtr(ARGS_ARG_INDEX).readByteArray(argStructSize);
      } else {
        outputArgs.push(new DataJSONContainer(argValue, null));
      }

      return null;
    }
  }, {
    key: "addGetEnvArgs",
    value: function addGetEnvArgs(data, outputArgs) {
      var ENV_ARG_INDEX = 1;
      var VERSION_ARG_INDEX = 2;
      var threadId = Process.getCurrentThreadId();
      var env = data.args[ENV_ARG_INDEX];
      var binData = null;

      if (data.ret === JNI_OK) {
        binData = this.threads.getJNIEnv(threadId);
      } else if (!data.getArgAsPtr(ENV_ARG_INDEX).isNull()) {
        binData = data.getArgAsPtr(ENV_ARG_INDEX).readPointer();
      }

      outputArgs.push(new DataJSONContainer(env, binData));
      outputArgs.push(new DataJSONContainer(data.args[VERSION_ARG_INDEX], null));
    }
  }, {
    key: "addJavaVMArgs",
    value: function addJavaVMArgs(data, outputArgs) {
      var name = data.method.name;

      if (name.startsWith("AttachCurrentThread")) {
        return this.addAttachCurrentThreadArgs(data, outputArgs);
      } else if (name === "GetEnv") {
        this.addGetEnvArgs(data, outputArgs);
      }

      return null;
    }
  }, {
    key: "createBacktrace",
    value: function createBacktrace(context, type) {
      var bt = context;

      if (!(bt instanceof Array)) {
        var backtraceType = null;

        if (type === "fuzzy") {
          backtraceType = Backtracer.FUZZY;
        } else {
          backtraceType = Backtracer.ACCURATE;
        }

        bt = Thread.backtrace(context, backtraceType);
      }

      return bt.map(function (addr) {
        return new BacktraceJSONContainer(addr, Process.findModuleByAddress(addr), DebugSymbol.fromAddress(addr));
      });
    }
  }, {
    key: "sendToHost",
    value: function sendToHost(type, data, args, ret, sendData, context) {
      var config = config_1.Config.getInstance();
      var jParams = data.jParams;
      var backtrace = undefined;

      if (config.backtrace !== "none") {
        backtrace = this.createBacktrace(context, config.backtrace);
      }

      var output = new RecordJSONContainer(type, data.method, args, ret, Process.getCurrentThreadId(), (0, _now["default"])() - this.start, jParams, backtrace);
      send(output, sendData);
    }
  }]);
  return DataTransport;
}();

exports.DataTransport = DataTransport;
;

},{"../utils/config":13,"../utils/types":17,"@babel/runtime-corejs2/core-js/date/now":18,"@babel/runtime-corejs2/core-js/object/define-property":20,"@babel/runtime-corejs2/helpers/classCallCheck":26,"@babel/runtime-corejs2/helpers/createClass":27,"@babel/runtime-corejs2/helpers/interopRequireDefault":30}],13:[function(require,module,exports){
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));

var _defineProperty = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));

(0, _defineProperty["default"])(exports, "__esModule", {
  value: true
});

var Config =
/*#__PURE__*/
function () {
  function Config() {
    var libsToTrack = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ["*"];
    var backtrace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "accurate";
    var showData = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
    var include = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
    var exclude = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
    var includeExport = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : [];
    var excludeExport = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [];
    var env = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : true;
    var vm = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : true;
    (0, _classCallCheck2["default"])(this, Config);
    this._libsToTrack = libsToTrack;
    this._backtrace = backtrace;
    this._showData = showData;
    this._include = include;
    this._exclude = exclude;
    this._includeExport = includeExport;
    this._excludeExport = excludeExport;
    this._env = env;
    this._vm = vm;
    this._hostInitialised = false;
  }

  (0, _createClass2["default"])(Config, [{
    key: "libsToTrack",
    get: function get() {
      return this._libsToTrack;
    }
  }, {
    key: "backtrace",
    get: function get() {
      return this._backtrace;
    }
  }, {
    key: "showData",
    get: function get() {
      return this._showData;
    }
  }, {
    key: "include",
    get: function get() {
      return this._include;
    }
  }, {
    key: "exclude",
    get: function get() {
      return this._exclude;
    }
  }, {
    key: "includeExport",
    get: function get() {
      return this._includeExport;
    }
  }, {
    key: "excludeExport",
    get: function get() {
      return this._excludeExport;
    }
  }, {
    key: "env",
    get: function get() {
      return this._env;
    }
  }, {
    key: "vm",
    get: function get() {
      return this._vm;
    }
  }], [{
    key: "initialised",
    value: function initialised() {
      if (Config.instance === undefined) {
        return false;
      } else {
        return Config.instance._hostInitialised;
      }
    }
  }, {
    key: "getInstance",
    value: function getInstance(libsToTrack, backtrace, showData, include, exclude, includeExport, excludeExport, env, vm) {
      if (libsToTrack !== undefined && backtrace !== undefined && showData !== undefined && include !== undefined && exclude !== undefined && includeExport !== undefined && excludeExport !== undefined && env !== undefined && vm !== undefined) {
        Config.instance = new Config(libsToTrack, backtrace, showData, include, exclude, includeExport, excludeExport, env, vm);
        Config.instance._hostInitialised = true;
      } else if (Config.instance === undefined) {
        Config.instance = new Config();
      }

      return Config.instance;
    }
  }]);
  return Config;
}();

exports.Config = Config;
;

},{"@babel/runtime-corejs2/core-js/object/define-property":20,"@babel/runtime-corejs2/helpers/classCallCheck":26,"@babel/runtime-corejs2/helpers/createClass":27,"@babel/runtime-corejs2/helpers/interopRequireDefault":30}],14:[function(require,module,exports){
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));

var _defineProperty = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));

(0, _defineProperty["default"])(exports, "__esModule", {
  value: true
});

var types_1 = require("./types");

var SEMI_COLON_OFFSET = 1;

var JavaMethod =
/*#__PURE__*/
function () {
  function JavaMethod(signature) {
    (0, _classCallCheck2["default"])(this, JavaMethod);
    var primitiveTypes = ["B", "S", "I", "J", "F", "D", "C", "Z", "V"];
    var isArray = false;
    var isRet = false;
    var jParamTypes = [];
    var jRetType = "unknown";

    for (var i = 0; i < signature.length; i++) {
      if (signature.charAt(i) === "(") {
        continue;
      }

      if (signature.charAt(i) === ")") {
        isRet = true;
        continue;
      }

      if (signature.charAt(i) === "[") {
        isArray = true;
        continue;
      }

      var jtype = "unknown";

      if (primitiveTypes.includes(signature.charAt(i))) {
        jtype = signature.charAt(i);
      } else if (signature.charAt(i) === "L") {
        var end = signature.indexOf(";", i) + SEMI_COLON_OFFSET;
        jtype = signature.substring(i, end);
        i = end - SEMI_COLON_OFFSET;
      } //TODO DELETE


      if (isArray) {
        jtype = "[" + jtype;
      }

      if (!isRet) {
        jParamTypes.push(jtype);
      } else {
        jRetType = jtype;
      }

      isArray = false;
    }

    this.signature = signature;
    this._params = jParamTypes;
    this._ret = jRetType;
  }

  (0, _createClass2["default"])(JavaMethod, [{
    key: "params",
    get: function get() {
      return this._params;
    }
  }, {
    key: "nativeParams",
    get: function get() {
      var nativeParams = [];

      this._params.forEach(function (p) {
        var nativeJType = types_1.Types.convertJTypeToNativeJType(p);
        nativeParams.push(nativeJType);
      });

      return nativeParams;
    }
  }, {
    key: "fridaParams",
    get: function get() {
      var fridaParams = [];

      this._params.forEach(function (p) {
        var nativeJType = types_1.Types.convertJTypeToNativeJType(p);
        var fridaType = types_1.Types.convertNativeJTypeToFridaType(nativeJType);
        fridaParams.push(fridaType);
      });

      return fridaParams;
    }
  }, {
    key: "ret",
    get: function get() {
      return this._ret;
    }
  }, {
    key: "fridaRet",
    get: function get() {
      var jTypeRet = types_1.Types.convertJTypeToNativeJType(this._ret);
      return types_1.Types.convertNativeJTypeToFridaType(jTypeRet);
    }
  }]);
  return JavaMethod;
}();

exports.JavaMethod = JavaMethod;
;

},{"./types":17,"@babel/runtime-corejs2/core-js/object/define-property":20,"@babel/runtime-corejs2/helpers/classCallCheck":26,"@babel/runtime-corejs2/helpers/createClass":27,"@babel/runtime-corejs2/helpers/interopRequireDefault":30}],15:[function(require,module,exports){
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));

var _defineProperty = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));

(0, _defineProperty["default"])(exports, "__esModule", {
  value: true
});

var MethodData =
/*#__PURE__*/
function () {
  function MethodData(method, args, ret, jmethod) {
    (0, _classCallCheck2["default"])(this, MethodData);
    this._method = method;
    this._jmethod = jmethod;
    this._args = args;
    this._ret = ret;

    if (jmethod === undefined) {
      this._jparams = [];
    } else {
      this._jparams = jmethod.nativeParams;
    }
  }

  (0, _createClass2["default"])(MethodData, [{
    key: "getArgAsPtr",
    value: function getArgAsPtr(i) {
      return this._args[i];
    }
  }, {
    key: "getArgAsNum",
    value: function getArgAsNum(i) {
      return this._args[i];
    }
  }, {
    key: "method",
    get: function get() {
      return this._method;
    }
  }, {
    key: "javaMethod",
    get: function get() {
      return this._jmethod;
    }
  }, {
    key: "args",
    get: function get() {
      return this._args;
    }
  }, {
    key: "jParams",
    get: function get() {
      return this._jparams;
    }
  }, {
    key: "ret",
    get: function get() {
      return this._ret;
    }
  }]);
  return MethodData;
}();

exports.MethodData = MethodData;
;

},{"@babel/runtime-corejs2/core-js/object/define-property":20,"@babel/runtime-corejs2/helpers/classCallCheck":26,"@babel/runtime-corejs2/helpers/createClass":27,"@babel/runtime-corejs2/helpers/interopRequireDefault":30}],16:[function(require,module,exports){
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));

var _defineProperty = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));

(0, _defineProperty["default"])(exports, "__esModule", {
  value: true
});

var ReferenceManager =
/*#__PURE__*/
function () {
  function ReferenceManager() {
    (0, _classCallCheck2["default"])(this, ReferenceManager);
    this.references = {};
  }

  (0, _createClass2["default"])(ReferenceManager, [{
    key: "add",
    value: function add(ref) {
      this.references[ref.toString()] = ref;
    }
  }, {
    key: "release",
    value: function release(ref) {
      if (this.references[ref.toString()] !== undefined) {
        delete this.references[ref.toString()];
      }
    }
  }]);
  return ReferenceManager;
}();

exports.ReferenceManager = ReferenceManager;
;

},{"@babel/runtime-corejs2/core-js/object/define-property":20,"@babel/runtime-corejs2/helpers/classCallCheck":26,"@babel/runtime-corejs2/helpers/createClass":27,"@babel/runtime-corejs2/helpers/interopRequireDefault":30}],17:[function(require,module,exports){
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

var _defineProperty = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));

(0, _defineProperty["default"])(exports, "__esModule", {
  value: true
});
var ARRAY_TYPE_INDEX = 1;
var TYPE_SIZE_64_BIT = 8;
var TYPE_SIZE_CHAR = 1;
var Types = {
  isComplexObjectType: function isComplexObjectType(type) {
    var JOBJECT = ["jobject", "jclass", "jweak"];
    return JOBJECT.includes(type);
  },
  sizeOf: function sizeOf(type) {
    if (type === "double" || type === "float" || type === "int64") {
      return TYPE_SIZE_64_BIT;
    } else if (type === "char") {
      return TYPE_SIZE_CHAR;
    } else {
      return Process.pointerSize;
    }
  },
  convertNativeJTypeToFridaType: function convertNativeJTypeToFridaType(jtype) {
    if (jtype.endsWith("*")) {
      return "pointer";
    }

    if (jtype === "va_list") {
      return "pointer";
    }

    if (jtype === "jmethodID") {
      return "pointer";
    }

    if (jtype === "jfieldID") {
      return "pointer";
    }

    if (jtype === "va_list") {
      return "va_list";
    }

    if (jtype === "jweak") {
      jtype = "jobject";
    }

    if (jtype === "jthrowable") {
      jtype = "jobject";
    }

    if (jtype.includes("Array")) {
      jtype = "jarray";
    }

    if (jtype === "jarray") {
      jtype = "jobject";
    }

    if (jtype === "jstring") {
      jtype = "jobject";
    }

    if (jtype === "jclass") {
      jtype = "jobject";
    }

    if (jtype === "jobject") {
      return "pointer";
    }

    if (jtype === "jsize") {
      jtype = "jint";
    }

    if (jtype === "jdouble") {
      return "double";
    }

    if (jtype === "jfloat") {
      return "float";
    }

    if (jtype === "jchar") {
      return "uint16";
    }

    if (jtype === "jboolean") {
      return "char";
    }

    if (jtype === "jlong") {
      return "int64";
    }

    if (jtype === "jint") {
      return "int";
    }

    if (jtype === "jshort") {
      return "int16";
    }

    if (jtype === "jbyte") {
      return "char";
    }

    return jtype;
  },
  convertJTypeToNativeJType: function convertJTypeToNativeJType(jtype) {
    var result = "";
    var isArray = false;

    if (jtype.startsWith("[")) {
      isArray = true;
      jtype = jtype.substring(ARRAY_TYPE_INDEX);
    }

    if (jtype === "B") {
      result += "jbyte";
    } else if (jtype === "S") {
      result += "jshort";
    } else if (jtype === "I") {
      result += "jint";
    } else if (jtype === "J") {
      result += "jlong";
    } else if (jtype === "F") {
      result += "jfloat";
    } else if (jtype === "D") {
      result += "jdouble";
    } else if (jtype === "C") {
      result += "jchar";
    } else if (jtype === "Z") {
      result += "jboolean";
    } else if (jtype.startsWith("L")) {
      if (jtype === "Ljava/lang/String;") {
        result += "jstring";
      } else if (jtype === "Ljava/lang/Class;") {
        result += "jclass";
      } else {
        result += "jobject";
      }
    }

    if (isArray) {
      if (result === "jstring") {
        result = "jobject";
      }

      result += "Array";
    }

    return result;
  }
};
exports.Types = Types;

},{"@babel/runtime-corejs2/core-js/object/define-property":20,"@babel/runtime-corejs2/helpers/interopRequireDefault":30}],18:[function(require,module,exports){
module.exports = require("core-js/library/fn/date/now");
},{"core-js/library/fn/date/now":34}],19:[function(require,module,exports){
module.exports = require("core-js/library/fn/object/create");
},{"core-js/library/fn/object/create":35}],20:[function(require,module,exports){
module.exports = require("core-js/library/fn/object/define-property");
},{"core-js/library/fn/object/define-property":36}],21:[function(require,module,exports){
module.exports = require("core-js/library/fn/object/get-prototype-of");
},{"core-js/library/fn/object/get-prototype-of":37}],22:[function(require,module,exports){
module.exports = require("core-js/library/fn/object/set-prototype-of");
},{"core-js/library/fn/object/set-prototype-of":38}],23:[function(require,module,exports){
module.exports = require("core-js/library/fn/symbol");
},{"core-js/library/fn/symbol":39}],24:[function(require,module,exports){
module.exports = require("core-js/library/fn/symbol/iterator");
},{"core-js/library/fn/symbol/iterator":40}],25:[function(require,module,exports){
function _assertThisInitialized(self) {
  if (self === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }

  return self;
}

module.exports = _assertThisInitialized;
},{}],26:[function(require,module,exports){
function _classCallCheck(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}

module.exports = _classCallCheck;
},{}],27:[function(require,module,exports){
var _Object$defineProperty = require("../core-js/object/define-property");

function _defineProperties(target, props) {
  for (var i = 0; i < props.length; i++) {
    var descriptor = props[i];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor) descriptor.writable = true;

    _Object$defineProperty(target, descriptor.key, descriptor);
  }
}

function _createClass(Constructor, protoProps, staticProps) {
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  if (staticProps) _defineProperties(Constructor, staticProps);
  return Constructor;
}

module.exports = _createClass;
},{"../core-js/object/define-property":20}],28:[function(require,module,exports){
var _Object$getPrototypeOf = require("../core-js/object/get-prototype-of");

var _Object$setPrototypeOf = require("../core-js/object/set-prototype-of");

function _getPrototypeOf(o) {
  module.exports = _getPrototypeOf = _Object$setPrototypeOf ? _Object$getPrototypeOf : function _getPrototypeOf(o) {
    return o.__proto__ || _Object$getPrototypeOf(o);
  };
  return _getPrototypeOf(o);
}

module.exports = _getPrototypeOf;
},{"../core-js/object/get-prototype-of":21,"../core-js/object/set-prototype-of":22}],29:[function(require,module,exports){
var _Object$create = require("../core-js/object/create");

var setPrototypeOf = require("./setPrototypeOf");

function _inherits(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }

  subClass.prototype = _Object$create(superClass && superClass.prototype, {
    constructor: {
      value: subClass,
      writable: true,
      configurable: true
    }
  });
  if (superClass) setPrototypeOf(subClass, superClass);
}

module.exports = _inherits;
},{"../core-js/object/create":19,"./setPrototypeOf":32}],30:[function(require,module,exports){
function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : {
    "default": obj
  };
}

module.exports = _interopRequireDefault;
},{}],31:[function(require,module,exports){
var _typeof = require("../helpers/typeof");

var assertThisInitialized = require("./assertThisInitialized");

function _possibleConstructorReturn(self, call) {
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
    return call;
  }

  return assertThisInitialized(self);
}

module.exports = _possibleConstructorReturn;
},{"../helpers/typeof":33,"./assertThisInitialized":25}],32:[function(require,module,exports){
var _Object$setPrototypeOf = require("../core-js/object/set-prototype-of");

function _setPrototypeOf(o, p) {
  module.exports = _setPrototypeOf = _Object$setPrototypeOf || function _setPrototypeOf(o, p) {
    o.__proto__ = p;
    return o;
  };

  return _setPrototypeOf(o, p);
}

module.exports = _setPrototypeOf;
},{"../core-js/object/set-prototype-of":22}],33:[function(require,module,exports){
var _Symbol$iterator = require("../core-js/symbol/iterator");

var _Symbol = require("../core-js/symbol");

function _typeof2(obj) { if (typeof _Symbol === "function" && typeof _Symbol$iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof _Symbol === "function" && obj.constructor === _Symbol && obj !== _Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }

function _typeof(obj) {
  if (typeof _Symbol === "function" && _typeof2(_Symbol$iterator) === "symbol") {
    module.exports = _typeof = function _typeof(obj) {
      return _typeof2(obj);
    };
  } else {
    module.exports = _typeof = function _typeof(obj) {
      return obj && typeof _Symbol === "function" && obj.constructor === _Symbol && obj !== _Symbol.prototype ? "symbol" : _typeof2(obj);
    };
  }

  return _typeof(obj);
}

module.exports = _typeof;
},{"../core-js/symbol":23,"../core-js/symbol/iterator":24}],34:[function(require,module,exports){
require('../../modules/es6.date.now');
module.exports = require('../../modules/_core').Date.now;

},{"../../modules/_core":46,"../../modules/es6.date.now":99}],35:[function(require,module,exports){
require('../../modules/es6.object.create');
var $Object = require('../../modules/_core').Object;
module.exports = function create(P, D) {
  return $Object.create(P, D);
};

},{"../../modules/_core":46,"../../modules/es6.object.create":100}],36:[function(require,module,exports){
require('../../modules/es6.object.define-property');
var $Object = require('../../modules/_core').Object;
module.exports = function defineProperty(it, key, desc) {
  return $Object.defineProperty(it, key, desc);
};

},{"../../modules/_core":46,"../../modules/es6.object.define-property":101}],37:[function(require,module,exports){
require('../../modules/es6.object.get-prototype-of');
module.exports = require('../../modules/_core').Object.getPrototypeOf;

},{"../../modules/_core":46,"../../modules/es6.object.get-prototype-of":102}],38:[function(require,module,exports){
require('../../modules/es6.object.set-prototype-of');
module.exports = require('../../modules/_core').Object.setPrototypeOf;

},{"../../modules/_core":46,"../../modules/es6.object.set-prototype-of":103}],39:[function(require,module,exports){
require('../../modules/es6.symbol');
require('../../modules/es6.object.to-string');
require('../../modules/es7.symbol.async-iterator');
require('../../modules/es7.symbol.observable');
module.exports = require('../../modules/_core').Symbol;

},{"../../modules/_core":46,"../../modules/es6.object.to-string":104,"../../modules/es6.symbol":106,"../../modules/es7.symbol.async-iterator":107,"../../modules/es7.symbol.observable":108}],40:[function(require,module,exports){
require('../../modules/es6.string.iterator');
require('../../modules/web.dom.iterable');
module.exports = require('../../modules/_wks-ext').f('iterator');

},{"../../modules/_wks-ext":96,"../../modules/es6.string.iterator":105,"../../modules/web.dom.iterable":109}],41:[function(require,module,exports){
module.exports = function (it) {
  if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  return it;
};

},{}],42:[function(require,module,exports){
module.exports = function () { /* empty */ };

},{}],43:[function(require,module,exports){
var isObject = require('./_is-object');
module.exports = function (it) {
  if (!isObject(it)) throw TypeError(it + ' is not an object!');
  return it;
};

},{"./_is-object":62}],44:[function(require,module,exports){
// false -> Array#indexOf
// true  -> Array#includes
var toIObject = require('./_to-iobject');
var toLength = require('./_to-length');
var toAbsoluteIndex = require('./_to-absolute-index');
module.exports = function (IS_INCLUDES) {
  return function ($this, el, fromIndex) {
    var O = toIObject($this);
    var length = toLength(O.length);
    var index = toAbsoluteIndex(fromIndex, length);
    var value;
    // Array#includes uses SameValueZero equality algorithm
    // eslint-disable-next-line no-self-compare
    if (IS_INCLUDES && el != el) while (length > index) {
      value = O[index++];
      // eslint-disable-next-line no-self-compare
      if (value != value) return true;
    // Array#indexOf ignores holes, Array#includes - not
    } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
      if (O[index] === el) return IS_INCLUDES || index || 0;
    } return !IS_INCLUDES && -1;
  };
};

},{"./_to-absolute-index":88,"./_to-iobject":90,"./_to-length":91}],45:[function(require,module,exports){
var toString = {}.toString;

module.exports = function (it) {
  return toString.call(it).slice(8, -1);
};

},{}],46:[function(require,module,exports){
var core = module.exports = { version: '2.6.9' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef

},{}],47:[function(require,module,exports){
// optional / simple context binding
var aFunction = require('./_a-function');
module.exports = function (fn, that, length) {
  aFunction(fn);
  if (that === undefined) return fn;
  switch (length) {
    case 1: return function (a) {
      return fn.call(that, a);
    };
    case 2: return function (a, b) {
      return fn.call(that, a, b);
    };
    case 3: return function (a, b, c) {
      return fn.call(that, a, b, c);
    };
  }
  return function (/* ...args */) {
    return fn.apply(that, arguments);
  };
};

},{"./_a-function":41}],48:[function(require,module,exports){
// 7.2.1 RequireObjectCoercible(argument)
module.exports = function (it) {
  if (it == undefined) throw TypeError("Can't call method on  " + it);
  return it;
};

},{}],49:[function(require,module,exports){
// Thank's IE8 for his funny defineProperty
module.exports = !require('./_fails')(function () {
  return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});

},{"./_fails":54}],50:[function(require,module,exports){
var isObject = require('./_is-object');
var document = require('./_global').document;
// typeof document.createElement is 'object' in old IE
var is = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
  return is ? document.createElement(it) : {};
};

},{"./_global":55,"./_is-object":62}],51:[function(require,module,exports){
// IE 8- don't enum bug keys
module.exports = (
  'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');

},{}],52:[function(require,module,exports){
// all enumerable object keys, includes symbols
var getKeys = require('./_object-keys');
var gOPS = require('./_object-gops');
var pIE = require('./_object-pie');
module.exports = function (it) {
  var result = getKeys(it);
  var getSymbols = gOPS.f;
  if (getSymbols) {
    var symbols = getSymbols(it);
    var isEnum = pIE.f;
    var i = 0;
    var key;
    while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
  } return result;
};

},{"./_object-gops":75,"./_object-keys":78,"./_object-pie":79}],53:[function(require,module,exports){
var global = require('./_global');
var core = require('./_core');
var ctx = require('./_ctx');
var hide = require('./_hide');
var has = require('./_has');
var PROTOTYPE = 'prototype';

var $export = function (type, name, source) {
  var IS_FORCED = type & $export.F;
  var IS_GLOBAL = type & $export.G;
  var IS_STATIC = type & $export.S;
  var IS_PROTO = type & $export.P;
  var IS_BIND = type & $export.B;
  var IS_WRAP = type & $export.W;
  var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
  var expProto = exports[PROTOTYPE];
  var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
  var key, own, out;
  if (IS_GLOBAL) source = name;
  for (key in source) {
    // contains in native
    own = !IS_FORCED && target && target[key] !== undefined;
    if (own && has(exports, key)) continue;
    // export native or passed
    out = own ? target[key] : source[key];
    // prevent global pollution for namespaces
    exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
    // bind timers to global for call from export context
    : IS_BIND && own ? ctx(out, global)
    // wrap global constructors for prevent change them in library
    : IS_WRAP && target[key] == out ? (function (C) {
      var F = function (a, b, c) {
        if (this instanceof C) {
          switch (arguments.length) {
            case 0: return new C();
            case 1: return new C(a);
            case 2: return new C(a, b);
          } return new C(a, b, c);
        } return C.apply(this, arguments);
      };
      F[PROTOTYPE] = C[PROTOTYPE];
      return F;
    // make static versions for prototype methods
    })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
    // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
    if (IS_PROTO) {
      (exports.virtual || (exports.virtual = {}))[key] = out;
      // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
      if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
    }
  }
};
// type bitmap
$export.F = 1;   // forced
$export.G = 2;   // global
$export.S = 4;   // static
$export.P = 8;   // proto
$export.B = 16;  // bind
$export.W = 32;  // wrap
$export.U = 64;  // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;

},{"./_core":46,"./_ctx":47,"./_global":55,"./_has":56,"./_hide":57}],54:[function(require,module,exports){
module.exports = function (exec) {
  try {
    return !!exec();
  } catch (e) {
    return true;
  }
};

},{}],55:[function(require,module,exports){
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
  ? window : typeof self != 'undefined' && self.Math == Math ? self
  // eslint-disable-next-line no-new-func
  : Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef

},{}],56:[function(require,module,exports){
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
  return hasOwnProperty.call(it, key);
};

},{}],57:[function(require,module,exports){
var dP = require('./_object-dp');
var createDesc = require('./_property-desc');
module.exports = require('./_descriptors') ? function (object, key, value) {
  return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
  object[key] = value;
  return object;
};

},{"./_descriptors":49,"./_object-dp":70,"./_property-desc":81}],58:[function(require,module,exports){
var document = require('./_global').document;
module.exports = document && document.documentElement;

},{"./_global":55}],59:[function(require,module,exports){
module.exports = !require('./_descriptors') && !require('./_fails')(function () {
  return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;
});

},{"./_descriptors":49,"./_dom-create":50,"./_fails":54}],60:[function(require,module,exports){
// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = require('./_cof');
// eslint-disable-next-line no-prototype-builtins
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
  return cof(it) == 'String' ? it.split('') : Object(it);
};

},{"./_cof":45}],61:[function(require,module,exports){
// 7.2.2 IsArray(argument)
var cof = require('./_cof');
module.exports = Array.isArray || function isArray(arg) {
  return cof(arg) == 'Array';
};

},{"./_cof":45}],62:[function(require,module,exports){
module.exports = function (it) {
  return typeof it === 'object' ? it !== null : typeof it === 'function';
};

},{}],63:[function(require,module,exports){
'use strict';
var create = require('./_object-create');
var descriptor = require('./_property-desc');
var setToStringTag = require('./_set-to-string-tag');
var IteratorPrototype = {};

// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
require('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });

module.exports = function (Constructor, NAME, next) {
  Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
  setToStringTag(Constructor, NAME + ' Iterator');
};

},{"./_hide":57,"./_object-create":69,"./_property-desc":81,"./_set-to-string-tag":84,"./_wks":97}],64:[function(require,module,exports){
'use strict';
var LIBRARY = require('./_library');
var $export = require('./_export');
var redefine = require('./_redefine');
var hide = require('./_hide');
var Iterators = require('./_iterators');
var $iterCreate = require('./_iter-create');
var setToStringTag = require('./_set-to-string-tag');
var getPrototypeOf = require('./_object-gpo');
var ITERATOR = require('./_wks')('iterator');
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
var FF_ITERATOR = '@@iterator';
var KEYS = 'keys';
var VALUES = 'values';

var returnThis = function () { return this; };

module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
  $iterCreate(Constructor, NAME, next);
  var getMethod = function (kind) {
    if (!BUGGY && kind in proto) return proto[kind];
    switch (kind) {
      case KEYS: return function keys() { return new Constructor(this, kind); };
      case VALUES: return function values() { return new Constructor(this, kind); };
    } return function entries() { return new Constructor(this, kind); };
  };
  var TAG = NAME + ' Iterator';
  var DEF_VALUES = DEFAULT == VALUES;
  var VALUES_BUG = false;
  var proto = Base.prototype;
  var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
  var $default = $native || getMethod(DEFAULT);
  var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
  var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
  var methods, key, IteratorPrototype;
  // Fix native
  if ($anyNative) {
    IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
    if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
      // Set @@toStringTag to native iterators
      setToStringTag(IteratorPrototype, TAG, true);
      // fix for some old engines
      if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
    }
  }
  // fix Array#{values, @@iterator}.name in V8 / FF
  if (DEF_VALUES && $native && $native.name !== VALUES) {
    VALUES_BUG = true;
    $default = function values() { return $native.call(this); };
  }
  // Define iterator
  if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
    hide(proto, ITERATOR, $default);
  }
  // Plug for library
  Iterators[NAME] = $default;
  Iterators[TAG] = returnThis;
  if (DEFAULT) {
    methods = {
      values: DEF_VALUES ? $default : getMethod(VALUES),
      keys: IS_SET ? $default : getMethod(KEYS),
      entries: $entries
    };
    if (FORCED) for (key in methods) {
      if (!(key in proto)) redefine(proto, key, methods[key]);
    } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  }
  return methods;
};

},{"./_export":53,"./_hide":57,"./_iter-create":63,"./_iterators":66,"./_library":67,"./_object-gpo":76,"./_redefine":82,"./_set-to-string-tag":84,"./_wks":97}],65:[function(require,module,exports){
module.exports = function (done, value) {
  return { value: value, done: !!done };
};

},{}],66:[function(require,module,exports){
module.exports = {};

},{}],67:[function(require,module,exports){
module.exports = true;

},{}],68:[function(require,module,exports){
var META = require('./_uid')('meta');
var isObject = require('./_is-object');
var has = require('./_has');
var setDesc = require('./_object-dp').f;
var id = 0;
var isExtensible = Object.isExtensible || function () {
  return true;
};
var FREEZE = !require('./_fails')(function () {
  return isExtensible(Object.preventExtensions({}));
});
var setMeta = function (it) {
  setDesc(it, META, { value: {
    i: 'O' + ++id, // object ID
    w: {}          // weak collections IDs
  } });
};
var fastKey = function (it, create) {
  // return primitive with prefix
  if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  if (!has(it, META)) {
    // can't set metadata to uncaught frozen object
    if (!isExtensible(it)) return 'F';
    // not necessary to add metadata
    if (!create) return 'E';
    // add missing metadata
    setMeta(it);
  // return object ID
  } return it[META].i;
};
var getWeak = function (it, create) {
  if (!has(it, META)) {
    // can't set metadata to uncaught frozen object
    if (!isExtensible(it)) return true;
    // not necessary to add metadata
    if (!create) return false;
    // add missing metadata
    setMeta(it);
  // return hash weak collections IDs
  } return it[META].w;
};
// add metadata on freeze-family methods calling
var onFreeze = function (it) {
  if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
  return it;
};
var meta = module.exports = {
  KEY: META,
  NEED: false,
  fastKey: fastKey,
  getWeak: getWeak,
  onFreeze: onFreeze
};

},{"./_fails":54,"./_has":56,"./_is-object":62,"./_object-dp":70,"./_uid":94}],69:[function(require,module,exports){
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = require('./_an-object');
var dPs = require('./_object-dps');
var enumBugKeys = require('./_enum-bug-keys');
var IE_PROTO = require('./_shared-key')('IE_PROTO');
var Empty = function () { /* empty */ };
var PROTOTYPE = 'prototype';

// Create object with fake `null` prototype: use iframe Object with cleared prototype
var createDict = function () {
  // Thrash, waste and sodomy: IE GC bug
  var iframe = require('./_dom-create')('iframe');
  var i = enumBugKeys.length;
  var lt = '<';
  var gt = '>';
  var iframeDocument;
  iframe.style.display = 'none';
  require('./_html').appendChild(iframe);
  iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  // createDict = iframe.contentWindow.Object;
  // html.removeChild(iframe);
  iframeDocument = iframe.contentWindow.document;
  iframeDocument.open();
  iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  iframeDocument.close();
  createDict = iframeDocument.F;
  while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
  return createDict();
};

module.exports = Object.create || function create(O, Properties) {
  var result;
  if (O !== null) {
    Empty[PROTOTYPE] = anObject(O);
    result = new Empty();
    Empty[PROTOTYPE] = null;
    // add "__proto__" for Object.getPrototypeOf polyfill
    result[IE_PROTO] = O;
  } else result = createDict();
  return Properties === undefined ? result : dPs(result, Properties);
};

},{"./_an-object":43,"./_dom-create":50,"./_enum-bug-keys":51,"./_html":58,"./_object-dps":71,"./_shared-key":85}],70:[function(require,module,exports){
var anObject = require('./_an-object');
var IE8_DOM_DEFINE = require('./_ie8-dom-define');
var toPrimitive = require('./_to-primitive');
var dP = Object.defineProperty;

exports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  anObject(O);
  P = toPrimitive(P, true);
  anObject(Attributes);
  if (IE8_DOM_DEFINE) try {
    return dP(O, P, Attributes);
  } catch (e) { /* empty */ }
  if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  if ('value' in Attributes) O[P] = Attributes.value;
  return O;
};

},{"./_an-object":43,"./_descriptors":49,"./_ie8-dom-define":59,"./_to-primitive":93}],71:[function(require,module,exports){
var dP = require('./_object-dp');
var anObject = require('./_an-object');
var getKeys = require('./_object-keys');

module.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {
  anObject(O);
  var keys = getKeys(Properties);
  var length = keys.length;
  var i = 0;
  var P;
  while (length > i) dP.f(O, P = keys[i++], Properties[P]);
  return O;
};

},{"./_an-object":43,"./_descriptors":49,"./_object-dp":70,"./_object-keys":78}],72:[function(require,module,exports){
var pIE = require('./_object-pie');
var createDesc = require('./_property-desc');
var toIObject = require('./_to-iobject');
var toPrimitive = require('./_to-primitive');
var has = require('./_has');
var IE8_DOM_DEFINE = require('./_ie8-dom-define');
var gOPD = Object.getOwnPropertyDescriptor;

exports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {
  O = toIObject(O);
  P = toPrimitive(P, true);
  if (IE8_DOM_DEFINE) try {
    return gOPD(O, P);
  } catch (e) { /* empty */ }
  if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
};

},{"./_descriptors":49,"./_has":56,"./_ie8-dom-define":59,"./_object-pie":79,"./_property-desc":81,"./_to-iobject":90,"./_to-primitive":93}],73:[function(require,module,exports){
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
var toIObject = require('./_to-iobject');
var gOPN = require('./_object-gopn').f;
var toString = {}.toString;

var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  ? Object.getOwnPropertyNames(window) : [];

var getWindowNames = function (it) {
  try {
    return gOPN(it);
  } catch (e) {
    return windowNames.slice();
  }
};

module.exports.f = function getOwnPropertyNames(it) {
  return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
};

},{"./_object-gopn":74,"./_to-iobject":90}],74:[function(require,module,exports){
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
var $keys = require('./_object-keys-internal');
var hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');

exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  return $keys(O, hiddenKeys);
};

},{"./_enum-bug-keys":51,"./_object-keys-internal":77}],75:[function(require,module,exports){
exports.f = Object.getOwnPropertySymbols;

},{}],76:[function(require,module,exports){
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = require('./_has');
var toObject = require('./_to-object');
var IE_PROTO = require('./_shared-key')('IE_PROTO');
var ObjectProto = Object.prototype;

module.exports = Object.getPrototypeOf || function (O) {
  O = toObject(O);
  if (has(O, IE_PROTO)) return O[IE_PROTO];
  if (typeof O.constructor == 'function' && O instanceof O.constructor) {
    return O.constructor.prototype;
  } return O instanceof Object ? ObjectProto : null;
};

},{"./_has":56,"./_shared-key":85,"./_to-object":92}],77:[function(require,module,exports){
var has = require('./_has');
var toIObject = require('./_to-iobject');
var arrayIndexOf = require('./_array-includes')(false);
var IE_PROTO = require('./_shared-key')('IE_PROTO');

module.exports = function (object, names) {
  var O = toIObject(object);
  var i = 0;
  var result = [];
  var key;
  for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
  // Don't enum bug & hidden keys
  while (names.length > i) if (has(O, key = names[i++])) {
    ~arrayIndexOf(result, key) || result.push(key);
  }
  return result;
};

},{"./_array-includes":44,"./_has":56,"./_shared-key":85,"./_to-iobject":90}],78:[function(require,module,exports){
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = require('./_object-keys-internal');
var enumBugKeys = require('./_enum-bug-keys');

module.exports = Object.keys || function keys(O) {
  return $keys(O, enumBugKeys);
};

},{"./_enum-bug-keys":51,"./_object-keys-internal":77}],79:[function(require,module,exports){
exports.f = {}.propertyIsEnumerable;

},{}],80:[function(require,module,exports){
// most Object methods by ES6 should accept primitives
var $export = require('./_export');
var core = require('./_core');
var fails = require('./_fails');
module.exports = function (KEY, exec) {
  var fn = (core.Object || {})[KEY] || Object[KEY];
  var exp = {};
  exp[KEY] = exec(fn);
  $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
};

},{"./_core":46,"./_export":53,"./_fails":54}],81:[function(require,module,exports){
module.exports = function (bitmap, value) {
  return {
    enumerable: !(bitmap & 1),
    configurable: !(bitmap & 2),
    writable: !(bitmap & 4),
    value: value
  };
};

},{}],82:[function(require,module,exports){
module.exports = require('./_hide');

},{"./_hide":57}],83:[function(require,module,exports){
// Works with __proto__ only. Old v8 can't work with null proto objects.
/* eslint-disable no-proto */
var isObject = require('./_is-object');
var anObject = require('./_an-object');
var check = function (O, proto) {
  anObject(O);
  if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
};
module.exports = {
  set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
    function (test, buggy, set) {
      try {
        set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);
        set(test, []);
        buggy = !(test instanceof Array);
      } catch (e) { buggy = true; }
      return function setPrototypeOf(O, proto) {
        check(O, proto);
        if (buggy) O.__proto__ = proto;
        else set(O, proto);
        return O;
      };
    }({}, false) : undefined),
  check: check
};

},{"./_an-object":43,"./_ctx":47,"./_is-object":62,"./_object-gopd":72}],84:[function(require,module,exports){
var def = require('./_object-dp').f;
var has = require('./_has');
var TAG = require('./_wks')('toStringTag');

module.exports = function (it, tag, stat) {
  if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
};

},{"./_has":56,"./_object-dp":70,"./_wks":97}],85:[function(require,module,exports){
var shared = require('./_shared')('keys');
var uid = require('./_uid');
module.exports = function (key) {
  return shared[key] || (shared[key] = uid(key));
};

},{"./_shared":86,"./_uid":94}],86:[function(require,module,exports){
var core = require('./_core');
var global = require('./_global');
var SHARED = '__core-js_shared__';
var store = global[SHARED] || (global[SHARED] = {});

(module.exports = function (key, value) {
  return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
  version: core.version,
  mode: require('./_library') ? 'pure' : 'global',
  copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
});

},{"./_core":46,"./_global":55,"./_library":67}],87:[function(require,module,exports){
var toInteger = require('./_to-integer');
var defined = require('./_defined');
// true  -> String#at
// false -> String#codePointAt
module.exports = function (TO_STRING) {
  return function (that, pos) {
    var s = String(defined(that));
    var i = toInteger(pos);
    var l = s.length;
    var a, b;
    if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
    a = s.charCodeAt(i);
    return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
      ? TO_STRING ? s.charAt(i) : a
      : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  };
};

},{"./_defined":48,"./_to-integer":89}],88:[function(require,module,exports){
var toInteger = require('./_to-integer');
var max = Math.max;
var min = Math.min;
module.exports = function (index, length) {
  index = toInteger(index);
  return index < 0 ? max(index + length, 0) : min(index, length);
};

},{"./_to-integer":89}],89:[function(require,module,exports){
// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
module.exports = function (it) {
  return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};

},{}],90:[function(require,module,exports){
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = require('./_iobject');
var defined = require('./_defined');
module.exports = function (it) {
  return IObject(defined(it));
};

},{"./_defined":48,"./_iobject":60}],91:[function(require,module,exports){
// 7.1.15 ToLength
var toInteger = require('./_to-integer');
var min = Math.min;
module.exports = function (it) {
  return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};

},{"./_to-integer":89}],92:[function(require,module,exports){
// 7.1.13 ToObject(argument)
var defined = require('./_defined');
module.exports = function (it) {
  return Object(defined(it));
};

},{"./_defined":48}],93:[function(require,module,exports){
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = require('./_is-object');
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function (it, S) {
  if (!isObject(it)) return it;
  var fn, val;
  if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  throw TypeError("Can't convert object to primitive value");
};

},{"./_is-object":62}],94:[function(require,module,exports){
var id = 0;
var px = Math.random();
module.exports = function (key) {
  return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};

},{}],95:[function(require,module,exports){
var global = require('./_global');
var core = require('./_core');
var LIBRARY = require('./_library');
var wksExt = require('./_wks-ext');
var defineProperty = require('./_object-dp').f;
module.exports = function (name) {
  var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
  if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
};

},{"./_core":46,"./_global":55,"./_library":67,"./_object-dp":70,"./_wks-ext":96}],96:[function(require,module,exports){
exports.f = require('./_wks');

},{"./_wks":97}],97:[function(require,module,exports){
var store = require('./_shared')('wks');
var uid = require('./_uid');
var Symbol = require('./_global').Symbol;
var USE_SYMBOL = typeof Symbol == 'function';

var $exports = module.exports = function (name) {
  return store[name] || (store[name] =
    USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};

$exports.store = store;

},{"./_global":55,"./_shared":86,"./_uid":94}],98:[function(require,module,exports){
'use strict';
var addToUnscopables = require('./_add-to-unscopables');
var step = require('./_iter-step');
var Iterators = require('./_iterators');
var toIObject = require('./_to-iobject');

// 22.1.3.4 Array.prototype.entries()
// 22.1.3.13 Array.prototype.keys()
// 22.1.3.29 Array.prototype.values()
// 22.1.3.30 Array.prototype[@@iterator]()
module.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {
  this._t = toIObject(iterated); // target
  this._i = 0;                   // next index
  this._k = kind;                // kind
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
}, function () {
  var O = this._t;
  var kind = this._k;
  var index = this._i++;
  if (!O || index >= O.length) {
    this._t = undefined;
    return step(1);
  }
  if (kind == 'keys') return step(0, index);
  if (kind == 'values') return step(0, O[index]);
  return step(0, [index, O[index]]);
}, 'values');

// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
Iterators.Arguments = Iterators.Array;

addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');

},{"./_add-to-unscopables":42,"./_iter-define":64,"./_iter-step":65,"./_iterators":66,"./_to-iobject":90}],99:[function(require,module,exports){
// 20.3.3.1 / 15.9.4.4 Date.now()
var $export = require('./_export');

$export($export.S, 'Date', { now: function () { return new Date().getTime(); } });

},{"./_export":53}],100:[function(require,module,exports){
var $export = require('./_export');
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
$export($export.S, 'Object', { create: require('./_object-create') });

},{"./_export":53,"./_object-create":69}],101:[function(require,module,exports){
var $export = require('./_export');
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f });

},{"./_descriptors":49,"./_export":53,"./_object-dp":70}],102:[function(require,module,exports){
// 19.1.2.9 Object.getPrototypeOf(O)
var toObject = require('./_to-object');
var $getPrototypeOf = require('./_object-gpo');

require('./_object-sap')('getPrototypeOf', function () {
  return function getPrototypeOf(it) {
    return $getPrototypeOf(toObject(it));
  };
});

},{"./_object-gpo":76,"./_object-sap":80,"./_to-object":92}],103:[function(require,module,exports){
// 19.1.3.19 Object.setPrototypeOf(O, proto)
var $export = require('./_export');
$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set });

},{"./_export":53,"./_set-proto":83}],104:[function(require,module,exports){

},{}],105:[function(require,module,exports){
'use strict';
var $at = require('./_string-at')(true);

// 21.1.3.27 String.prototype[@@iterator]()
require('./_iter-define')(String, 'String', function (iterated) {
  this._t = String(iterated); // target
  this._i = 0;                // next index
// 21.1.5.2.1 %StringIteratorPrototype%.next()
}, function () {
  var O = this._t;
  var index = this._i;
  var point;
  if (index >= O.length) return { value: undefined, done: true };
  point = $at(O, index);
  this._i += point.length;
  return { value: point, done: false };
});

},{"./_iter-define":64,"./_string-at":87}],106:[function(require,module,exports){
'use strict';
// ECMAScript 6 symbols shim
var global = require('./_global');
var has = require('./_has');
var DESCRIPTORS = require('./_descriptors');
var $export = require('./_export');
var redefine = require('./_redefine');
var META = require('./_meta').KEY;
var $fails = require('./_fails');
var shared = require('./_shared');
var setToStringTag = require('./_set-to-string-tag');
var uid = require('./_uid');
var wks = require('./_wks');
var wksExt = require('./_wks-ext');
var wksDefine = require('./_wks-define');
var enumKeys = require('./_enum-keys');
var isArray = require('./_is-array');
var anObject = require('./_an-object');
var isObject = require('./_is-object');
var toObject = require('./_to-object');
var toIObject = require('./_to-iobject');
var toPrimitive = require('./_to-primitive');
var createDesc = require('./_property-desc');
var _create = require('./_object-create');
var gOPNExt = require('./_object-gopn-ext');
var $GOPD = require('./_object-gopd');
var $GOPS = require('./_object-gops');
var $DP = require('./_object-dp');
var $keys = require('./_object-keys');
var gOPD = $GOPD.f;
var dP = $DP.f;
var gOPN = gOPNExt.f;
var $Symbol = global.Symbol;
var $JSON = global.JSON;
var _stringify = $JSON && $JSON.stringify;
var PROTOTYPE = 'prototype';
var HIDDEN = wks('_hidden');
var TO_PRIMITIVE = wks('toPrimitive');
var isEnum = {}.propertyIsEnumerable;
var SymbolRegistry = shared('symbol-registry');
var AllSymbols = shared('symbols');
var OPSymbols = shared('op-symbols');
var ObjectProto = Object[PROTOTYPE];
var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
var QObject = global.QObject;
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;

// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
var setSymbolDesc = DESCRIPTORS && $fails(function () {
  return _create(dP({}, 'a', {
    get: function () { return dP(this, 'a', { value: 7 }).a; }
  })).a != 7;
}) ? function (it, key, D) {
  var protoDesc = gOPD(ObjectProto, key);
  if (protoDesc) delete ObjectProto[key];
  dP(it, key, D);
  if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
} : dP;

var wrap = function (tag) {
  var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
  sym._k = tag;
  return sym;
};

var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
  return typeof it == 'symbol';
} : function (it) {
  return it instanceof $Symbol;
};

var $defineProperty = function defineProperty(it, key, D) {
  if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
  anObject(it);
  key = toPrimitive(key, true);
  anObject(D);
  if (has(AllSymbols, key)) {
    if (!D.enumerable) {
      if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
      it[HIDDEN][key] = true;
    } else {
      if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
      D = _create(D, { enumerable: createDesc(0, false) });
    } return setSymbolDesc(it, key, D);
  } return dP(it, key, D);
};
var $defineProperties = function defineProperties(it, P) {
  anObject(it);
  var keys = enumKeys(P = toIObject(P));
  var i = 0;
  var l = keys.length;
  var key;
  while (l > i) $defineProperty(it, key = keys[i++], P[key]);
  return it;
};
var $create = function create(it, P) {
  return P === undefined ? _create(it) : $defineProperties(_create(it), P);
};
var $propertyIsEnumerable = function propertyIsEnumerable(key) {
  var E = isEnum.call(this, key = toPrimitive(key, true));
  if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
  return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
};
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
  it = toIObject(it);
  key = toPrimitive(key, true);
  if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
  var D = gOPD(it, key);
  if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
  return D;
};
var $getOwnPropertyNames = function getOwnPropertyNames(it) {
  var names = gOPN(toIObject(it));
  var result = [];
  var i = 0;
  var key;
  while (names.length > i) {
    if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
  } return result;
};
var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
  var IS_OP = it === ObjectProto;
  var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
  var result = [];
  var i = 0;
  var key;
  while (names.length > i) {
    if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
  } return result;
};

// 19.4.1.1 Symbol([description])
if (!USE_NATIVE) {
  $Symbol = function Symbol() {
    if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
    var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
    var $set = function (value) {
      if (this === ObjectProto) $set.call(OPSymbols, value);
      if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
      setSymbolDesc(this, tag, createDesc(1, value));
    };
    if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
    return wrap(tag);
  };
  redefine($Symbol[PROTOTYPE], 'toString', function toString() {
    return this._k;
  });

  $GOPD.f = $getOwnPropertyDescriptor;
  $DP.f = $defineProperty;
  require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;
  require('./_object-pie').f = $propertyIsEnumerable;
  $GOPS.f = $getOwnPropertySymbols;

  if (DESCRIPTORS && !require('./_library')) {
    redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
  }

  wksExt.f = function (name) {
    return wrap(wks(name));
  };
}

$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });

for (var es6Symbols = (
  // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
  'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);

for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);

$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
  // 19.4.2.1 Symbol.for(key)
  'for': function (key) {
    return has(SymbolRegistry, key += '')
      ? SymbolRegistry[key]
      : SymbolRegistry[key] = $Symbol(key);
  },
  // 19.4.2.5 Symbol.keyFor(sym)
  keyFor: function keyFor(sym) {
    if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
    for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
  },
  useSetter: function () { setter = true; },
  useSimple: function () { setter = false; }
});

$export($export.S + $export.F * !USE_NATIVE, 'Object', {
  // 19.1.2.2 Object.create(O [, Properties])
  create: $create,
  // 19.1.2.4 Object.defineProperty(O, P, Attributes)
  defineProperty: $defineProperty,
  // 19.1.2.3 Object.defineProperties(O, Properties)
  defineProperties: $defineProperties,
  // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
  // 19.1.2.7 Object.getOwnPropertyNames(O)
  getOwnPropertyNames: $getOwnPropertyNames,
  // 19.1.2.8 Object.getOwnPropertySymbols(O)
  getOwnPropertySymbols: $getOwnPropertySymbols
});

// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
// https://bugs.chromium.org/p/v8/issues/detail?id=3443
var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });

$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {
  getOwnPropertySymbols: function getOwnPropertySymbols(it) {
    return $GOPS.f(toObject(it));
  }
});

// 24.3.2 JSON.stringify(value [, replacer [, space]])
$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
  var S = $Symbol();
  // MS Edge converts symbol values to JSON as {}
  // WebKit converts symbol values to JSON as null
  // V8 throws on boxed symbols
  return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
})), 'JSON', {
  stringify: function stringify(it) {
    var args = [it];
    var i = 1;
    var replacer, $replacer;
    while (arguments.length > i) args.push(arguments[i++]);
    $replacer = replacer = args[1];
    if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
    if (!isArray(replacer)) replacer = function (key, value) {
      if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
      if (!isSymbol(value)) return value;
    };
    args[1] = replacer;
    return _stringify.apply($JSON, args);
  }
});

// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
// 19.4.3.5 Symbol.prototype[@@toStringTag]
setToStringTag($Symbol, 'Symbol');
// 20.2.1.9 Math[@@toStringTag]
setToStringTag(Math, 'Math', true);
// 24.3.3 JSON[@@toStringTag]
setToStringTag(global.JSON, 'JSON', true);

},{"./_an-object":43,"./_descriptors":49,"./_enum-keys":52,"./_export":53,"./_fails":54,"./_global":55,"./_has":56,"./_hide":57,"./_is-array":61,"./_is-object":62,"./_library":67,"./_meta":68,"./_object-create":69,"./_object-dp":70,"./_object-gopd":72,"./_object-gopn":74,"./_object-gopn-ext":73,"./_object-gops":75,"./_object-keys":78,"./_object-pie":79,"./_property-desc":81,"./_redefine":82,"./_set-to-string-tag":84,"./_shared":86,"./_to-iobject":90,"./_to-object":92,"./_to-primitive":93,"./_uid":94,"./_wks":97,"./_wks-define":95,"./_wks-ext":96}],107:[function(require,module,exports){
require('./_wks-define')('asyncIterator');

},{"./_wks-define":95}],108:[function(require,module,exports){
require('./_wks-define')('observable');

},{"./_wks-define":95}],109:[function(require,module,exports){
require('./es6.array.iterator');
var global = require('./_global');
var hide = require('./_hide');
var Iterators = require('./_iterators');
var TO_STRING_TAG = require('./_wks')('toStringTag');

var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
  'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
  'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
  'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
  'TextTrackList,TouchList').split(',');

for (var i = 0; i < DOMIterables.length; i++) {
  var NAME = DOMIterables[i];
  var Collection = global[NAME];
  var proto = Collection && Collection.prototype;
  if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
  Iterators[NAME] = Iterators.Array;
}

},{"./_global":55,"./_hide":57,"./_iterators":66,"./_wks":97,"./es6.array.iterator":98}]},{},[11])
//# sourceMappingURL=data:application/json;charset=utf-8;base64, 
