Saturday, September 14, 2013

Running Cycript from Cydgets

My main objective here.

At this moment in time, I have no interest in tweaks. Cycript seems like a great tool for the tweak maker.

Cycript is great for executing code while runtime. I can image how great this is for Tweak developers.

What about themers? One issue, themers theme. Majority are graphic designers, and picked up how to use some code for there lockscreens. With knowing a little about code, you can run script that affect apples code at runtime. (basic javascript)

Saurik makes it very simple with Cydgets. I personally have created a lockscreen (Only using Cydgets)
It will unlock itself in 10 seconds. Great thing is its not a trick. Meaning it actually uses apples code to unlock the device.

You can also write files to text. Tweaks like infoStats. This can be done from inside an html. No tweak needed. Cycript merges that boundary.

Want to get values from apps? Sure just use cycript.  Display missed calls on your lockscreen for your theme? Yes, Use an unlock other than slide to unlock? YES!  Anything is possible, and is worth looking at.  I will explain my code below.


To run [[SBAwayController sharedAwayController] unlockWithSound:NO] we first need to create a script, this way cycript knows it needs to run this code. You can do this by

<script type='text/cycript'> Your Code Here</script>

Standard script, but notice text/cycript.  Now we can insert obj c right here O_o 

<script type='text/cycript'> 
setTimeout(function(){unlock()}, 10000);
function unlock(){
  [[SBAwayController sharedAwayController] unlockWithSound:NO]
}
</script>

The entire code. It is set to run after a few seconds. This means if you put this  in cydgets as a cydget:P It will unlock your phone after the timeset.

ISSUES: So far I have had one issue. If I connect this to a button. Meaning if I press a button it executes this code, then I will go into safe mode. At this time i'm not sure why, but I will report back. Working as timeout and not button, makes me thing that maybe the pressed action needs to be canceled. Not sure yet. This does work, reason I am posting. I myself didn't see it possible. It surely is.





No comments:

Post a Comment