Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cycript TypeError("undefined is not an object when following tutorial

Tags:

ios

cycript

I am attempting to follow this tutorial - http://resources.infosecinstitute.com/ios-application-security-part-8-method-swizzling-using-cycript/#article

Close to the bottom of the article, I am at the part where you type:

ViewController.messages['validateLogin'] = function() { return true;}

but I don't get the response that the author gets, instead I get a TypeError

throw new TypeError("undefined is not an object (evaluating 'ViewController.messages.validateLogin=function(){return 1}')"

I am running iOS 9.0.2 and have Cycript 0.9.594

like image 950
Borgme Avatar asked Dec 03 '25 01:12

Borgme


1 Answers

This is because the syntax is changed. messages is no longer valid call in Cycript. Instead use .prototype.

ViewController.prototype.isDeviceJailbroken = function () { return false; }

Reference:

enter image description here

like image 132
rohan-patel Avatar answered Dec 04 '25 17:12

rohan-patel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!