app/src/main/assets/python/app_packages/rubicon/java/api.py
def dispatch_cast(raw, type_signature):
    """Convert a raw argument provided via a callback into a Python object matching the provided signature.
    This is used by the callback dispatch mechanism. The values passed back will
    be raw pointers to Java objects (even primitives are passed as pointers).
    They need to be converted into Python objects to be passed to the proxied
    interface implementation.
    """
    if type_signature == b'Z':
        return java.CallBooleanMethod(jobject(raw), reflect.Boolean__booleanValue)

    elif type_signature == b'B':
        return java.CallByteMethod(jobject(raw), reflect.Byte__byteValue)

    elif type_signature == b'C':
        return java.CallCharMethod(jobject(raw), reflect.Char__charValue)

    elif type_signature == b'S':
        return java.CallShortMethod(jobject(raw), reflect.Short__shortValue)

    elif type_signature == b'I':
        return java.CallIntMethod(jobject(raw), reflect.Integer__intValue)

    elif type_signature == b'J':
        return java.CallLongMethod(jobject(raw), reflect.Long__longValue)

    elif type_signature == b'F':
        return java.CallFloatMethod(jobject(raw), reflect.Float__floatValue)

    elif type_signature == b'D':
        return java.CallDoubleMethod(jobject(raw), reflect.Double__doubleValue)

    elif type_signature == b'Ljava/lang/String;':
        # Check for NULL return values
        if jstring(raw).value:
            return java.GetStringUTFChars(cast(raw, jstring), None).decode('utf-8')
        return None

    elif type_signature.startswith(b'L'):
        # Check for NULL return values
        if jobject(raw).value:
            gref = java.NewGlobalRef(jobject(raw))
            # print("Return type", type_signature)
            # print("Create returned instance")
            return JavaClass(type_signature[1:-1].decode('utf-8'))(__jni__=gref)
        return None

    raise ValueError("Don't know how to convert argument with type signature '%s'" % type_signature)
Convert a raw argument provided via a callback into a Python object matching the provided signature.
    This is used by the callback dispatch mechanism. The values passed back will
    be raw pointers to Java objects (even primitives are passed as pointers).
    They need to be converted into Python objects to be passed to the proxied
    interface implementation.
    
Convert a raw argument provided via a callback into a Python object matching the provided signature.
This is used by the callback dispatch mechanism. The values passed back will
be raw pointers to Java objects (even primitives are passed as pointers).
They need to be converted into Python objects to be passed to the proxied
interface implementation.
Convert a raw argument provided via a callback into a Python object matching the provided signature . This is used by the callback dispatch mechanism . The values passed back will be raw pointers to Java objects ( even primitives are passed as pointers ) . They need to be converted into Python objects to be passed to the proxied interface implementation .
def dispatch_cast(raw, type_signature):
    if type_signature == b'Z':
        return java.CallBooleanMethod(jobject(raw), reflect.Boolean__booleanValue)
    elif type_signature == b'B':
        return java.CallByteMethod(jobject(raw), reflect.Byte__byteValue)
    elif type_signature == b'C':
        return java.CallCharMethod(jobject(raw), reflect.Char__charValue)
    elif type_signature == b'S':
        return java.CallShortMethod(jobject(raw), reflect.Short__shortValue)
    elif type_signature == b'I':
        return java.CallIntMethod(jobject(raw), reflect.Integer__intValue)
    elif type_signature == b'J':
        return java.CallLongMethod(jobject(raw), reflect.Long__longValue)
    elif type_signature == b'F':
        return java.CallFloatMethod(jobject(raw), reflect.Float__floatValue)
    elif type_signature == b'D':
        return java.CallDoubleMethod(jobject(raw), reflect.Double__doubleValue)
    elif type_signature == b'Ljava/lang/String;':
        if jstring(raw).value:
            return java.GetStringUTFChars(cast(raw, jstring), None).decode('utf-8')
        return None
    elif type_signature.startswith(b'L'):
        if jobject(raw).value:
            gref = java.NewGlobalRef(jobject(raw))
            return JavaClass(type_signature[1:-1].decode('utf-8'))(__jni__=gref)
        return None
    raise ValueError("Don't know how to convert argument with type signature '%s'" % type_signature)
def dispatch_cast ( raw , type_signature ) : if type_signature == b'Z' : return java . CallBooleanMethod ( jobject ( raw ) , reflect . Boolean__booleanValue ) elif type_signature == b'B' : return java . CallByteMethod ( jobject ( raw ) , reflect . Byte__byteValue ) elif type_signature == b'C' : return java . CallCharMethod ( jobject ( raw ) , reflect . Char__charValue ) elif type_signature == b'S' : return java . CallShortMethod ( jobject ( raw ) , reflect . Short__shortValue ) elif type_signature == b'I' : return java . CallIntMethod ( jobject ( raw ) , reflect . Integer__intValue ) elif type_signature == b'J' : return java . CallLongMethod ( jobject ( raw ) , reflect . Long__longValue ) elif type_signature == b'F' : return java . CallFloatMethod ( jobject ( raw ) , reflect . Float__floatValue ) elif type_signature == b'D' : return java . CallDoubleMethod ( jobject ( raw ) , reflect . Double__doubleValue ) elif type_signature == b'Ljava/lang/String;' : if jstring ( raw ) . value : return java . GetStringUTFChars ( cast ( raw , jstring ) , None ) . decode ( 'utf-8' ) return None elif type_signature . startswith ( b'L' ) : if jobject ( raw ) . value : gref = java . NewGlobalRef ( jobject ( raw ) ) return JavaClass ( type_signature [ 1 : - 1 ] . decode ( 'utf-8' ) ) ( __jni__ = gref ) return None raise ValueError ( "Don't know how to convert argument with type signature '%s'" % type_signature )
Convert a raw argument provided via a callback into a Python object matching the provided signature.
Convert a raw argument provided via a callback into a Python object matching the provided signature .
"""Convert a raw argument provided via a callback into a Python object matching the provided signature.
    This is used by the callback dispatch mechanism. The values passed back will
    be raw pointers to Java objects (even primitives are passed as pointers).
    They need to be converted into Python objects to be passed to the proxied
    interface implementation.
    """ # Check for NULL return values # Check for NULL return values # print("Return type", type_signature) # print("Create returned instance")
raw
type_signature