frida -U -l java.js com.android.terminal
On editing script or detaching from target process it crashes.
Crashes don't happen if I don't set up a hook.
java.js:
function onLoad() {
console.log("Loaded.")
Java.perform( function() {
URL = Java.use('java.net.URL');
URL.getHost.implementation = function () {
console.log("inside hook!");
return this.getHost();
};
});
Java.perform( function() {
url = URL.$new('http://www.ikke.no/');
host = url.getHost();
console.log('host=' + host);
});
}
onLoad();
Android 6.0.1, CM13. Device is Wileyfox Swift.