MCPcopy Create free account
hub / github.com/astonbitecode/j4rs / get_load_class_method

Function get_load_class_method

rust/src/cache.rs:2328–2344  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2326
2327#[cfg(target_os = "android")]
2328pub(crate) unsafe fn get_load_class_method() -> errors::Result<jmethodID> {
2329 get_cached!(
2330 GET_LOAD_CLASS_METHOD,
2331 {
2332 let env = get_thread_local_env()?;
2333 let cstr1 = utils::to_c_string("loadClass");
2334 let cstr2 = utils::to_c_string("(Ljava/lang/String;)Ljava/lang/Class;");
2335 let j = unsafe {
2336 (opt_to_res(get_jni_get_method_id())?)(env, get_classloader_class()?, cstr1, cstr2)
2337 };
2338 utils::drop_c_string(cstr1);
2339 utils::drop_c_string(cstr2);
2340 j
2341 },
2342 set_load_class_method
2343 )
2344}
2345
2346#[cfg(target_os = "android")]
2347pub(crate) fn set_android_context_wrapper_class(j: jclass) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected