Created
October 27, 2022 09:59
-
-
Save dkomanov/aaca4c0d89e1b7e9785c2b56f46a346b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub extern "system" fn decodeConfigUrlSafe4( | |
env: JNIEnv, | |
_class: JClass, | |
payload: jbyteArray, | |
size: usize, | |
) -> jbyteArray { | |
let arr = env.get_primitive_array_critical( | |
payload, | |
ReleaseMode::NoCopyBack, | |
).unwrap(); | |
let sl = unsafe { | |
from_raw_parts(arr.as_ptr() as *mut u8, size) | |
}; | |
let result = base64::decode_config(sl, base64::URL_SAFE_NO_PAD).unwrap(); | |
return env.byte_array_from_slice(&result).unwrap(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment