// Ripped from https://github.com/Ch0pin/medusa/ and modified to fit Androguard packets

colorLog('[+] LOADING CODE_LOADING/NATIVE.JS',{c: Color.Red});

var systemA = Java.use('java.lang.System');

systemA.load.implementation = function(filename) {
    agPacket({filename: filename}).send();
    return this.load(filename);
}

/*
systemA.loadLibrary.implementation = function(libname) {
    agPacket({libname: libname}).send();
    colorLog('[+] Application is loading the following library:'+libname,{c: Color.Red});
    return this.loadLibrary(libname);
}*/

systemA.mapLibraryName.implementation = function(libname) {
    agPacket({libname: libname}).send();
    var ret = this.mapLibraryName(libname);
    return ret;
}