3

我正在尝试遵循本教程-http: //resources.infosecinstitute.com/ios-application-security-part-8-method-swizzling-using-cycript/#article

靠近文章底部,我在您输入的部分:

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

但我没有得到作者得到的响应,而是得到一个 TypeError

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

我正在运行 iOS 9.0.2 并拥有 Cycript 0.9.594

4

1 回答 1

2

这是因为语法发生了变化。messages 在 Cycript 中不再是有效的调用。而是使用 .prototype。

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

参考:

在此处输入图像描述

于 2016-12-13T07:26:29.197 回答