Merge pull request #22 from gungoren/patch-1

Update s3.js
This commit is contained in:
Carlos Polop 2020-10-30 10:10:33 +01:00 committed by GitHub
commit 1acdfb20df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -149,41 +149,6 @@ function hookSecret() {
}
});
}
rpc.exports = {
callsecretfunction: callSecretFun,
hooksecretfunction: hookSecret
};console.log("Script loaded successfully ");
var instances_array = [];
function callSecretFun() {
Java.perform(function () {
if (instances_array.length == 0) { // if array is empty
Java.choose("com.example.a11x256.frida_test.my_activity", {
onMatch: function (instance) {
console.log("Found instance: " + instance);
instances_array.push(instance)
console.log("Result of secret func: " + instance.secret());
},
onComplete: function () { }
});
}
else {//else if the array has some values
console.log("Result of secret func: " + instances_array[0].secret());
}
});
}
function hookSecret() {
Java.perform(function () {
var my_class = Java.use("com.example.a11x256.frida_test.my_activity");
var string_class = Java.use("java.lang.String");
my_class.secret.overload().implementation = function(){
var my_string = string_class.$new("THIS IS FAKE BB");
return my_string;
}
});
}
rpc.exports = {
callsecretfunction: callSecretFun,
hooksecretfunction: hookSecret