Skip to content

Instantly share code, notes, and snippets.

@SeeFlowerX
Created February 21, 2022 01:20
Show Gist options
  • Save SeeFlowerX/09383286f4e70c114e415cb4a248db55 to your computer and use it in GitHub Desktop.
Save SeeFlowerX/09383286f4e70c114e415cb4a248db55 to your computer and use it in GitHub Desktop.
Java.perform(function() {
const System = Java.use('java.lang.System');
const Runtime = Java.use('java.lang.Runtime');
const SystemLoad_2 = System.loadLibrary.overload('java.lang.String');
const VMStack = Java.use('dalvik.system.VMStack');
SystemLoad_2.implementation = function(library) {
send("Loading dynamic library => " + library);
try {
const loaded = Runtime.getRuntime().loadLibrary0(VMStack.getCallingClassLoader(), library);
if(library === 'myLib') {
//do my stuff
}
return loaded;
} catch(ex) {
console.log(ex);
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment