Skip to content

Instantly share code, notes, and snippets.

@rena2019
Created March 24, 2019 15:51
Show Gist options
  • Save rena2019/00b9cbbc70885a00f57312d0d03911af to your computer and use it in GitHub Desktop.
Save rena2019/00b9cbbc70885a00f57312d0d03911af to your computer and use it in GitHub Desktop.
class_name = "rena2019.dummyapp.LoginActivity"
if (Java.available) {
setTimeout(function() { // avoid java.lang.ClassNotFoundException
Java.perform(function() {
var my_class = Java.use(class_name);
//replace the original implementation of the function `isEmailValid` with our custom function
my_class.isEmailValid.implementation = function(x){
//print the original arguments
console.log( "original call: fun("+ x + ")");
//call the original implementation of `isEmailValid` with args
// var ret_value = this.isEmailValid("w@g.de");
//return ret_value;
return true;
}
});
}, 0);
} else {
send("Java not available in this process");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment