The code

Time to write some actual code.

Open Tweak.xm and remove all pre-written text. We will be working the class from the "The research" chapter called SBALockScreenView and its method -(void)setCustomSlideToUnlockText:(id)arg1. In your Tweak.xm write the following.

%hook SBLockScreenView
    arg1 = @"SliderChanger";

This is pretty straight forward. You are "hooking" into the class SBLockScreenView and hijacking the method setCustomSlideToUnlockText. The argument arg1 may say id but in reality it is an NSString. So we reset the argument to @"SliderChanger" and then we call the original method with the updated argument. We do this by calling %orig(arg1).

We then close the %hook with %end.

Now go to the terminal again and write make package install to install the new tweak to your device. By now it should have changed the "slide to unlock" to "SliderChanger".


Congratulations, you are now an iOS tweak developer.