jni_raw

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2026 License: CC0-1.0 Imports: 13 Imported by: 0

Documentation

Overview

Package jni_raw implements a gRPC server that exposes the raw JNI Env surface over gRPC. All JNI objects are referenced by int64 handles stored in the shared HandleStore. MethodIDs and FieldIDs are passed as int64 values cast from their pointer representation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	pb.UnimplementedJNIServiceServer
	VM      *jni.VM
	Handles *handlestore.HandleStore
	// AppContextHandle is the HandleStore handle for the Android
	// application Context. Set during server startup so clients can
	// retrieve it via the GetAppContext RPC instead of guessing.
	AppContextHandle int64
	// AppClassLoader is an optional handle to the APK's ClassLoader.
	// When set, FindClass falls back to ClassLoader.loadClass() if the
	// JNI FindClass fails (native threads use BootClassLoader which
	// can't find APK classes).
	AppClassLoader int64
}

Server implements pb.JNIServiceServer.

func (*Server) AllocObject

func (s *Server) AllocObject(_ context.Context, req *pb.AllocObjectRequest) (*pb.AllocObjectResponse, error)

func (*Server) CallMethod

func (s *Server) CallMethod(_ context.Context, req *pb.CallMethodRequest) (*pb.CallMethodResponse, error)

func (*Server) CallStaticMethod

func (*Server) EnsureLocalCapacity

func (*Server) ExceptionCheck

func (*Server) ExceptionClear

func (*Server) ExceptionDescribe

func (*Server) ExceptionOccurred

func (*Server) FindClass

func (s *Server) FindClass(_ context.Context, req *pb.FindClassRequest) (*pb.FindClassResponse, error)

func (*Server) FromReflectedField

func (*Server) FromReflectedMethod

func (*Server) GetAppContext

func (*Server) GetArrayLength

func (*Server) GetByteArrayData

func (*Server) GetField

func (*Server) GetFieldID

func (s *Server) GetFieldID(_ context.Context, req *pb.GetFieldIDRequest) (*pb.GetFieldIDResponse, error)

func (*Server) GetMethodID

func (s *Server) GetMethodID(_ context.Context, req *pb.GetMethodIDRequest) (*pb.GetMethodIDResponse, error)

func (*Server) GetObjectClass

func (*Server) GetObjectRefType

func (*Server) GetStaticFieldID

func (*Server) GetStaticMethodID

func (*Server) GetStringLength

func (*Server) GetStringUTFChars

func (*Server) GetSuperclass

func (*Server) GetVersion

func (*Server) IsAssignableFrom

func (*Server) IsInstanceOf

func (*Server) IsSameObject

func (*Server) MonitorEnter

func (*Server) MonitorExit

func (s *Server) MonitorExit(_ context.Context, req *pb.MonitorExitRequest) (*pb.MonitorExitResponse, error)

func (*Server) NewObject

func (s *Server) NewObject(_ context.Context, req *pb.NewObjectRequest) (*pb.NewObjectResponse, error)

func (*Server) NewObjectArray

func (*Server) NewPrimitiveArray

func (*Server) NewStringUTF

func (*Server) PopLocalFrame

func (*Server) Proxy

func (s *Server) Proxy(stream pb.JNIService_ProxyServer) error

Proxy implements the bidirectional streaming RPC that creates a Java dynamic proxy and forwards method invocations to the gRPC client as CallbackEvent messages. The client responds with CallbackResponse messages that are dispatched back to the blocked JVM callback thread.

func (*Server) PushLocalFrame

func (*Server) SetField

func (*Server) Throw

func (s *Server) Throw(_ context.Context, req *pb.ThrowRequest) (*pb.ThrowResponse, error)

func (*Server) ThrowNew

func (s *Server) ThrowNew(_ context.Context, req *pb.ThrowNewRequest) (*pb.ThrowNewResponse, error)

func (*Server) ToReflectedField

func (*Server) ToReflectedMethod

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL